parse 5.2.0-alpha.1 → 5.2.0-alpha.3

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 (247) hide show
  1. package/dist/parse.js +10519 -15246
  2. package/dist/parse.min.js +2 -2
  3. package/dist/parse.weapp.js +10499 -15371
  4. package/dist/parse.weapp.min.js +2 -2
  5. package/lib/browser/Analytics.js +7 -11
  6. package/lib/browser/AnonymousUtils.js +17 -22
  7. package/lib/browser/Cloud.js +23 -41
  8. package/lib/browser/CoreManager.js +71 -79
  9. package/lib/browser/CryptoController.js +14 -9
  10. package/lib/browser/EventEmitter.js +9 -2
  11. package/lib/browser/EventuallyQueue.js +156 -357
  12. package/lib/browser/FacebookUtils.js +23 -28
  13. package/lib/browser/IndexedDBStorageController.js +18 -14
  14. package/lib/browser/InstallationController.js +55 -121
  15. package/lib/browser/LiveQueryClient.js +312 -485
  16. package/lib/browser/LiveQuerySubscription.js +25 -28
  17. package/lib/browser/LocalDatastore.js +258 -624
  18. package/lib/browser/LocalDatastoreController.default.js +42 -226
  19. package/lib/browser/LocalDatastoreController.js +11 -1
  20. package/lib/browser/LocalDatastoreController.react-native.js +66 -160
  21. package/lib/browser/LocalDatastoreUtils.js +4 -7
  22. package/lib/browser/ObjectStateMutations.js +54 -96
  23. package/lib/browser/OfflineQuery.js +106 -198
  24. package/lib/browser/Parse.js +44 -60
  25. package/lib/browser/ParseACL.js +242 -288
  26. package/lib/browser/ParseCLP.js +372 -572
  27. package/lib/browser/ParseConfig.js +115 -138
  28. package/lib/browser/ParseError.js +85 -182
  29. package/lib/browser/ParseFile.js +294 -438
  30. package/lib/browser/ParseGeoPoint.js +121 -146
  31. package/lib/browser/ParseHooks.js +23 -25
  32. package/lib/browser/ParseInstallation.js +225 -367
  33. package/lib/browser/ParseLiveQuery.js +74 -148
  34. package/lib/browser/ParseObject.js +2014 -2621
  35. package/lib/browser/ParseOp.js +343 -484
  36. package/lib/browser/ParsePolygon.js +101 -120
  37. package/lib/browser/ParseQuery.js +1708 -2052
  38. package/lib/browser/ParseRelation.js +99 -118
  39. package/lib/browser/ParseRole.js +88 -140
  40. package/lib/browser/ParseSchema.js +372 -434
  41. package/lib/browser/ParseSession.js +62 -110
  42. package/lib/browser/ParseUser.js +941 -1284
  43. package/lib/browser/Push.js +15 -38
  44. package/lib/browser/RESTController.js +85 -124
  45. package/lib/browser/SingleInstanceStateController.js +57 -86
  46. package/lib/browser/Socket.weapp.js +50 -33
  47. package/lib/browser/Storage.js +23 -28
  48. package/lib/browser/StorageController.browser.js +16 -13
  49. package/lib/browser/StorageController.default.js +15 -14
  50. package/lib/browser/StorageController.js +14 -1
  51. package/lib/browser/StorageController.react-native.js +31 -30
  52. package/lib/browser/StorageController.weapp.js +19 -13
  53. package/lib/browser/TaskQueue.js +31 -43
  54. package/lib/browser/UniqueInstanceStateController.js +65 -86
  55. package/lib/browser/WebSocketController.js +11 -4
  56. package/lib/browser/Xhr.weapp.js +90 -78
  57. package/lib/browser/arrayContainsObject.js +3 -3
  58. package/lib/browser/canBeSerialized.js +10 -11
  59. package/lib/browser/decode.js +11 -11
  60. package/lib/browser/encode.js +11 -11
  61. package/lib/browser/equals.js +9 -10
  62. package/lib/browser/escape.js +2 -2
  63. package/lib/browser/isRevocableSession.js +1 -1
  64. package/lib/browser/parseDate.js +10 -10
  65. package/lib/browser/promiseUtils.js +19 -19
  66. package/lib/browser/unique.js +4 -4
  67. package/lib/browser/unsavedChildren.js +20 -21
  68. package/lib/browser/uuid.js +2 -4
  69. package/lib/node/Analytics.js +5 -9
  70. package/lib/node/AnonymousUtils.js +10 -15
  71. package/lib/node/Cloud.js +11 -11
  72. package/lib/node/CoreManager.js +59 -67
  73. package/lib/node/CryptoController.js +8 -3
  74. package/lib/node/EventEmitter.js +7 -1
  75. package/lib/node/EventuallyQueue.js +20 -39
  76. package/lib/node/FacebookUtils.js +4 -8
  77. package/lib/node/IndexedDBStorageController.js +14 -10
  78. package/lib/node/InstallationController.js +12 -13
  79. package/lib/node/LiveQueryClient.js +23 -21
  80. package/lib/node/LiveQuerySubscription.js +6 -7
  81. package/lib/node/LocalDatastore.js +23 -23
  82. package/lib/node/LocalDatastoreController.default.js +11 -12
  83. package/lib/node/LocalDatastoreController.js +14 -1
  84. package/lib/node/LocalDatastoreController.react-native.js +25 -21
  85. package/lib/node/LocalDatastoreUtils.js +4 -7
  86. package/lib/node/ObjectStateMutations.js +12 -22
  87. package/lib/node/OfflineQuery.js +37 -23
  88. package/lib/node/Parse.js +36 -50
  89. package/lib/node/ParseACL.js +21 -30
  90. package/lib/node/ParseCLP.js +38 -40
  91. package/lib/node/ParseConfig.js +10 -17
  92. package/lib/node/ParseError.js +460 -461
  93. package/lib/node/ParseFile.js +27 -47
  94. package/lib/node/ParseGeoPoint.js +16 -17
  95. package/lib/node/ParseHooks.js +16 -18
  96. package/lib/node/ParseInstallation.js +10 -11
  97. package/lib/node/ParseLiveQuery.js +9 -14
  98. package/lib/node/ParseObject.js +142 -173
  99. package/lib/node/ParseOp.js +35 -47
  100. package/lib/node/ParsePolygon.js +14 -20
  101. package/lib/node/ParseQuery.js +100 -123
  102. package/lib/node/ParseRelation.js +10 -19
  103. package/lib/node/ParseRole.js +10 -11
  104. package/lib/node/ParseSchema.js +29 -42
  105. package/lib/node/ParseSession.js +10 -11
  106. package/lib/node/ParseUser.js +76 -87
  107. package/lib/node/Push.js +7 -12
  108. package/lib/node/RESTController.js +24 -36
  109. package/lib/node/SingleInstanceStateController.js +41 -69
  110. package/lib/node/Socket.weapp.js +23 -2
  111. package/lib/node/Storage.js +14 -19
  112. package/lib/node/StorageController.browser.js +10 -8
  113. package/lib/node/StorageController.default.js +9 -9
  114. package/lib/node/StorageController.js +16 -1
  115. package/lib/node/StorageController.react-native.js +20 -20
  116. package/lib/node/StorageController.weapp.js +14 -8
  117. package/lib/node/TaskQueue.js +2 -3
  118. package/lib/node/UniqueInstanceStateController.js +43 -63
  119. package/lib/node/WebSocketController.js +15 -2
  120. package/lib/node/Xhr.weapp.js +11 -2
  121. package/lib/node/arrayContainsObject.js +4 -4
  122. package/lib/node/canBeSerialized.js +5 -5
  123. package/lib/node/decode.js +4 -4
  124. package/lib/node/encode.js +5 -5
  125. package/lib/node/equals.js +4 -4
  126. package/lib/node/escape.js +1 -1
  127. package/lib/node/isRevocableSession.js +1 -1
  128. package/lib/node/parseDate.js +1 -1
  129. package/lib/node/promiseUtils.js +7 -7
  130. package/lib/node/unique.js +5 -5
  131. package/lib/node/unsavedChildren.js +5 -5
  132. package/lib/node/uuid.js +2 -4
  133. package/lib/react-native/Analytics.js +2 -2
  134. package/lib/react-native/AnonymousUtils.js +3 -4
  135. package/lib/react-native/CoreManager.js +2 -3
  136. package/lib/react-native/CryptoController.js +6 -1
  137. package/lib/react-native/EventEmitter.js +6 -1
  138. package/lib/react-native/EventuallyQueue.js +1 -2
  139. package/lib/react-native/FacebookUtils.js +1 -2
  140. package/lib/react-native/IndexedDBStorageController.js +11 -5
  141. package/lib/react-native/InstallationController.js +1 -2
  142. package/lib/react-native/LiveQueryClient.js +8 -7
  143. package/lib/react-native/LiveQuerySubscription.js +2 -4
  144. package/lib/react-native/LocalDatastore.js +3 -3
  145. package/lib/react-native/LocalDatastoreController.default.js +1 -2
  146. package/lib/react-native/LocalDatastoreController.js +11 -1
  147. package/lib/react-native/LocalDatastoreController.react-native.js +11 -12
  148. package/lib/react-native/LocalDatastoreUtils.js +3 -6
  149. package/lib/react-native/OfflineQuery.js +25 -20
  150. package/lib/react-native/Parse.js +24 -38
  151. package/lib/react-native/ParseACL.js +4 -6
  152. package/lib/react-native/ParseCLP.js +2 -4
  153. package/lib/react-native/ParseConfig.js +4 -6
  154. package/lib/react-native/ParseError.js +13 -31
  155. package/lib/react-native/ParseFile.js +3 -4
  156. package/lib/react-native/ParseGeoPoint.js +2 -4
  157. package/lib/react-native/ParseInstallation.js +13 -30
  158. package/lib/react-native/ParseLiveQuery.js +2 -4
  159. package/lib/react-native/ParseObject.js +77 -87
  160. package/lib/react-native/ParseOp.js +41 -79
  161. package/lib/react-native/ParsePolygon.js +2 -4
  162. package/lib/react-native/ParseQuery.js +43 -45
  163. package/lib/react-native/ParseRelation.js +2 -4
  164. package/lib/react-native/ParseRole.js +13 -30
  165. package/lib/react-native/ParseSchema.js +3 -5
  166. package/lib/react-native/ParseSession.js +12 -29
  167. package/lib/react-native/ParseUser.js +24 -49
  168. package/lib/react-native/RESTController.js +10 -4
  169. package/lib/react-native/SingleInstanceStateController.js +23 -37
  170. package/lib/react-native/Socket.weapp.js +9 -4
  171. package/lib/react-native/Storage.js +1 -2
  172. package/lib/react-native/StorageController.browser.js +6 -1
  173. package/lib/react-native/StorageController.default.js +6 -1
  174. package/lib/react-native/StorageController.js +13 -1
  175. package/lib/react-native/StorageController.react-native.js +11 -6
  176. package/lib/react-native/StorageController.weapp.js +6 -1
  177. package/lib/react-native/TaskQueue.js +2 -4
  178. package/lib/react-native/UniqueInstanceStateController.js +23 -37
  179. package/lib/react-native/WebSocketController.js +9 -1
  180. package/lib/react-native/Xhr.weapp.js +9 -4
  181. package/lib/react-native/unsavedChildren.js +3 -3
  182. package/lib/react-native/uuid.js +1 -2
  183. package/lib/weapp/Analytics.js +7 -11
  184. package/lib/weapp/AnonymousUtils.js +17 -22
  185. package/lib/weapp/Cloud.js +23 -41
  186. package/lib/weapp/CoreManager.js +71 -79
  187. package/lib/weapp/CryptoController.js +14 -9
  188. package/lib/weapp/EventEmitter.js +9 -2
  189. package/lib/weapp/EventuallyQueue.js +156 -357
  190. package/lib/weapp/FacebookUtils.js +23 -28
  191. package/lib/weapp/IndexedDBStorageController.js +18 -14
  192. package/lib/weapp/InstallationController.js +55 -121
  193. package/lib/weapp/LiveQueryClient.js +312 -485
  194. package/lib/weapp/LiveQuerySubscription.js +25 -28
  195. package/lib/weapp/LocalDatastore.js +258 -624
  196. package/lib/weapp/LocalDatastoreController.default.js +42 -226
  197. package/lib/weapp/LocalDatastoreController.js +11 -1
  198. package/lib/weapp/LocalDatastoreController.react-native.js +66 -160
  199. package/lib/weapp/LocalDatastoreUtils.js +4 -7
  200. package/lib/weapp/ObjectStateMutations.js +54 -96
  201. package/lib/weapp/OfflineQuery.js +106 -198
  202. package/lib/weapp/Parse.js +44 -59
  203. package/lib/weapp/ParseACL.js +242 -288
  204. package/lib/weapp/ParseCLP.js +372 -572
  205. package/lib/weapp/ParseConfig.js +115 -138
  206. package/lib/weapp/ParseError.js +85 -182
  207. package/lib/weapp/ParseFile.js +295 -440
  208. package/lib/weapp/ParseGeoPoint.js +121 -146
  209. package/lib/weapp/ParseHooks.js +23 -25
  210. package/lib/weapp/ParseInstallation.js +225 -367
  211. package/lib/weapp/ParseLiveQuery.js +74 -148
  212. package/lib/weapp/ParseObject.js +2014 -2621
  213. package/lib/weapp/ParseOp.js +343 -484
  214. package/lib/weapp/ParsePolygon.js +101 -120
  215. package/lib/weapp/ParseQuery.js +1708 -2052
  216. package/lib/weapp/ParseRelation.js +99 -118
  217. package/lib/weapp/ParseRole.js +88 -140
  218. package/lib/weapp/ParseSchema.js +372 -434
  219. package/lib/weapp/ParseSession.js +62 -110
  220. package/lib/weapp/ParseUser.js +941 -1284
  221. package/lib/weapp/Push.js +15 -38
  222. package/lib/weapp/RESTController.js +86 -125
  223. package/lib/weapp/SingleInstanceStateController.js +57 -86
  224. package/lib/weapp/Socket.weapp.js +50 -33
  225. package/lib/weapp/Storage.js +23 -28
  226. package/lib/weapp/StorageController.browser.js +16 -13
  227. package/lib/weapp/StorageController.default.js +15 -14
  228. package/lib/weapp/StorageController.js +14 -1
  229. package/lib/weapp/StorageController.react-native.js +31 -30
  230. package/lib/weapp/StorageController.weapp.js +19 -13
  231. package/lib/weapp/TaskQueue.js +31 -43
  232. package/lib/weapp/UniqueInstanceStateController.js +65 -86
  233. package/lib/weapp/WebSocketController.js +11 -4
  234. package/lib/weapp/Xhr.weapp.js +90 -78
  235. package/lib/weapp/arrayContainsObject.js +3 -3
  236. package/lib/weapp/canBeSerialized.js +10 -11
  237. package/lib/weapp/decode.js +11 -11
  238. package/lib/weapp/encode.js +11 -11
  239. package/lib/weapp/equals.js +9 -10
  240. package/lib/weapp/escape.js +2 -2
  241. package/lib/weapp/isRevocableSession.js +1 -1
  242. package/lib/weapp/parseDate.js +10 -10
  243. package/lib/weapp/promiseUtils.js +19 -19
  244. package/lib/weapp/unique.js +4 -4
  245. package/lib/weapp/unsavedChildren.js +20 -21
  246. package/lib/weapp/uuid.js +6 -8
  247. package/package.json +24 -30
@@ -9,6 +9,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
10
  var _CoreManager = _interopRequireDefault(require("./CoreManager"));
11
11
  var _ParseError = _interopRequireDefault(require("./ParseError"));
12
+ var _Xhr = _interopRequireDefault(require("./Xhr.weapp"));
12
13
  var XHR = null;
13
14
  if (typeof XMLHttpRequest !== 'undefined') {
14
15
  XHR = XMLHttpRequest;
@@ -72,7 +73,7 @@ var ParseFile = function () {
72
73
  }
73
74
  }
74
75
  }
75
- (0, _createClass2.default)(ParseFile, [{
76
+ return (0, _createClass2.default)(ParseFile, [{
76
77
  key: "getData",
77
78
  value: function () {
78
79
  var _getData = (0, _asyncToGenerator2.default)(function* () {
@@ -284,7 +285,6 @@ var ParseFile = function () {
284
285
  return chunks.join('');
285
286
  }
286
287
  }]);
287
- return ParseFile;
288
288
  }();
289
289
  var DefaultController = {
290
290
  saveFile: function () {
@@ -398,6 +398,5 @@ var DefaultController = {
398
398
  }
399
399
  };
400
400
  _CoreManager.default.setFileController(DefaultController);
401
- var _default = ParseFile;
402
- exports.default = _default;
401
+ var _default = exports.default = ParseFile;
403
402
  exports.b64Digit = b64Digit;
@@ -25,7 +25,7 @@ var ParseGeoPoint = function () {
25
25
  this._longitude = 0;
26
26
  }
27
27
  }
28
- (0, _createClass2.default)(ParseGeoPoint, [{
28
+ return (0, _createClass2.default)(ParseGeoPoint, [{
29
29
  key: "latitude",
30
30
  get: function () {
31
31
  return this._latitude;
@@ -111,7 +111,5 @@ var ParseGeoPoint = function () {
111
111
  });
112
112
  }
113
113
  }]);
114
- return ParseGeoPoint;
115
114
  }();
116
- var _default = ParseGeoPoint;
117
- exports.default = _default;
115
+ var _default = exports.default = ParseGeoPoint;
@@ -7,37 +7,23 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
7
7
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
11
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
10
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
11
+ var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
13
12
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
13
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
14
  var _CoreManager = _interopRequireDefault(require("./CoreManager"));
15
15
  var _ParseError = _interopRequireDefault(require("./ParseError"));
16
16
  var _ParseObject2 = _interopRequireDefault(require("./ParseObject"));
17
- function _createSuper(Derived) {
18
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
19
- return function () {
20
- var Super = (0, _getPrototypeOf2.default)(Derived),
21
- result;
22
- if (hasNativeReflectConstruct) {
23
- var NewTarget = (0, _getPrototypeOf2.default)(this).constructor;
24
- result = Reflect.construct(Super, arguments, NewTarget);
25
- } else {
26
- result = Super.apply(this, arguments);
27
- }
28
- return (0, _possibleConstructorReturn2.default)(this, result);
29
- };
17
+ function _callSuper(t, o, e) {
18
+ return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e));
30
19
  }
31
20
  function _isNativeReflectConstruct() {
32
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
33
- if (Reflect.construct.sham) return false;
34
- if (typeof Proxy === "function") return true;
35
21
  try {
36
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
37
- return true;
38
- } catch (e) {
39
- return false;
40
- }
22
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
23
+ } catch (t) {}
24
+ return (_isNativeReflectConstruct = function () {
25
+ return !!t;
26
+ })();
41
27
  }
42
28
  var DEVICE_TYPES = {
43
29
  IOS: 'ios',
@@ -48,12 +34,10 @@ var DEVICE_TYPES = {
48
34
  WEB: 'web'
49
35
  };
50
36
  var ParseInstallation = function (_ParseObject) {
51
- (0, _inherits2.default)(ParseInstallation, _ParseObject);
52
- var _super = _createSuper(ParseInstallation);
53
37
  function ParseInstallation(attributes) {
54
38
  var _this;
55
39
  (0, _classCallCheck2.default)(this, ParseInstallation);
56
- _this = _super.call(this, '_Installation');
40
+ _this = _callSuper(this, ParseInstallation, ['_Installation']);
57
41
  if (attributes && typeof attributes === 'object') {
58
42
  if (!_this.set(attributes)) {
59
43
  throw new Error("Can't create an invalid Installation");
@@ -61,7 +45,8 @@ var ParseInstallation = function (_ParseObject) {
61
45
  }
62
46
  return _this;
63
47
  }
64
- (0, _createClass2.default)(ParseInstallation, [{
48
+ (0, _inherits2.default)(ParseInstallation, _ParseObject);
49
+ return (0, _createClass2.default)(ParseInstallation, [{
65
50
  key: "appIdentifier",
66
51
  get: function () {
67
52
  return this.get('appIdentifier');
@@ -199,9 +184,7 @@ var ParseInstallation = function (_ParseObject) {
199
184
  return _CoreManager.default.getInstallationController().currentInstallation();
200
185
  }
201
186
  }]);
202
- return ParseInstallation;
203
187
  }(_ParseObject2.default);
204
188
  _ParseObject2.default.registerSubclass('_Installation', ParseInstallation);
205
189
  module.exports = ParseInstallation;
206
- var _default = ParseInstallation;
207
- exports.default = _default;
190
+ var _default = exports.default = ParseInstallation;
@@ -30,7 +30,7 @@ var LiveQuery = function () {
30
30
  };
31
31
  this.on('error', function () {});
32
32
  }
33
- (0, _createClass2.default)(LiveQuery, [{
33
+ return (0, _createClass2.default)(LiveQuery, [{
34
34
  key: "open",
35
35
  value: function () {
36
36
  var _open = (0, _asyncToGenerator2.default)(function* () {
@@ -55,10 +55,8 @@ var LiveQuery = function () {
55
55
  return close;
56
56
  }()
57
57
  }]);
58
- return LiveQuery;
59
58
  }();
60
- var _default = LiveQuery;
61
- exports.default = _default;
59
+ var _default = exports.default = LiveQuery;
62
60
  var defaultLiveQueryClient;
63
61
  var DefaultLiveQueryController = {
64
62
  setDefaultLiveQueryClient: function (liveQueryClient) {
@@ -25,44 +25,30 @@ var SingleInstanceStateController = _interopRequireWildcard(require("./SingleIns
25
25
  var _unique = _interopRequireDefault(require("./unique"));
26
26
  var UniqueInstanceStateController = _interopRequireWildcard(require("./UniqueInstanceStateController"));
27
27
  var _unsavedChildren = _interopRequireDefault(require("./unsavedChildren"));
28
- function _getRequireWildcardCache(nodeInterop) {
29
- if (typeof WeakMap !== "function") return null;
30
- var cacheBabelInterop = new WeakMap();
31
- var cacheNodeInterop = new WeakMap();
32
- return (_getRequireWildcardCache = function (nodeInterop) {
33
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
34
- })(nodeInterop);
28
+ function _getRequireWildcardCache(e) {
29
+ if ("function" != typeof WeakMap) return null;
30
+ var r = new WeakMap(),
31
+ t = new WeakMap();
32
+ return (_getRequireWildcardCache = function (e) {
33
+ return e ? t : r;
34
+ })(e);
35
35
  }
36
- function _interopRequireWildcard(obj, nodeInterop) {
37
- if (!nodeInterop && obj && obj.__esModule) {
38
- return obj;
36
+ function _interopRequireWildcard(e, r) {
37
+ if (!r && e && e.__esModule) return e;
38
+ if (null === e || "object" != typeof e && "function" != typeof e) return {
39
+ default: e
40
+ };
41
+ var t = _getRequireWildcardCache(r);
42
+ if (t && t.has(e)) return t.get(e);
43
+ var n = {
44
+ __proto__: null
45
+ },
46
+ a = Object.defineProperty && Object.getOwnPropertyDescriptor;
47
+ for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
48
+ var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
49
+ i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
39
50
  }
40
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
41
- return {
42
- default: obj
43
- };
44
- }
45
- var cache = _getRequireWildcardCache(nodeInterop);
46
- if (cache && cache.has(obj)) {
47
- return cache.get(obj);
48
- }
49
- var newObj = {};
50
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
51
- for (var key in obj) {
52
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
53
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
54
- if (desc && (desc.get || desc.set)) {
55
- Object.defineProperty(newObj, key, desc);
56
- } else {
57
- newObj[key] = obj[key];
58
- }
59
- }
60
- }
61
- newObj.default = obj;
62
- if (cache) {
63
- cache.set(obj, newObj);
64
- }
65
- return newObj;
51
+ return n.default = e, t && t.set(e, n), n;
66
52
  }
67
53
  var classMap = {};
68
54
  var objectCount = 0;
@@ -96,9 +82,9 @@ var ParseObject = function () {
96
82
  } else if (className && typeof className === 'object') {
97
83
  this.className = className.className;
98
84
  toSet = {};
99
- for (var _attr in className) {
100
- if (_attr !== 'className') {
101
- toSet[_attr] = className[_attr];
85
+ for (var attr in className) {
86
+ if (attr !== 'className') {
87
+ toSet[attr] = className[attr];
102
88
  }
103
89
  }
104
90
  if (attributes && typeof attributes === 'object') {
@@ -109,7 +95,7 @@ var ParseObject = function () {
109
95
  throw new Error("Can't create an invalid Parse Object");
110
96
  }
111
97
  }
112
- (0, _createClass2.default)(ParseObject, [{
98
+ return (0, _createClass2.default)(ParseObject, [{
113
99
  key: "attributes",
114
100
  get: function () {
115
101
  var stateController = _CoreManager.default.getObjectStateController();
@@ -165,8 +151,8 @@ var ParseObject = function () {
165
151
  value: function () {
166
152
  var serverData = this._getServerData();
167
153
  var unset = {};
168
- for (var _attr2 in serverData) {
169
- unset[_attr2] = undefined;
154
+ for (var attr in serverData) {
155
+ unset[attr] = undefined;
170
156
  }
171
157
  var stateController = _CoreManager.default.getObjectStateController();
172
158
  stateController.setServerData(this._getStateIdentifier(), unset);
@@ -194,17 +180,17 @@ var ParseObject = function () {
194
180
  var stateController = _CoreManager.default.getObjectStateController();
195
181
  var objectCache = stateController.getObjectCache(this._getStateIdentifier());
196
182
  var dirty = {};
197
- for (var _attr3 in attributes) {
198
- var val = attributes[_attr3];
183
+ for (var attr in attributes) {
184
+ var val = attributes[attr];
199
185
  if (val && typeof val === 'object' && !(val instanceof ParseObject) && !(val instanceof _ParseFile.default) && !(val instanceof _ParseRelation.default)) {
200
186
  try {
201
187
  var json = (0, _encode.default)(val, false, true);
202
188
  var stringified = JSON.stringify(json);
203
- if (objectCache[_attr3] !== stringified) {
204
- dirty[_attr3] = val;
189
+ if (objectCache[attr] !== stringified) {
190
+ dirty[attr] = val;
205
191
  }
206
192
  } catch (e) {
207
- dirty[_attr3] = val;
193
+ dirty[attr] = val;
208
194
  }
209
195
  }
210
196
  }
@@ -280,13 +266,13 @@ var ParseObject = function () {
280
266
  var stateController = _CoreManager.default.getObjectStateController();
281
267
  stateController.initializeState(this._getStateIdentifier());
282
268
  var decoded = {};
283
- for (var _attr4 in serverData) {
284
- if (_attr4 === 'ACL') {
285
- decoded[_attr4] = new _ParseACL.default(serverData[_attr4]);
286
- } else if (_attr4 !== 'objectId') {
287
- decoded[_attr4] = (0, _decode.default)(serverData[_attr4]);
288
- if (decoded[_attr4] instanceof _ParseRelation.default) {
289
- decoded[_attr4]._ensureParentAndKey(this, _attr4);
269
+ for (var attr in serverData) {
270
+ if (attr === 'ACL') {
271
+ decoded[attr] = new _ParseACL.default(serverData[attr]);
272
+ } else if (attr !== 'objectId') {
273
+ decoded[attr] = (0, _decode.default)(serverData[attr]);
274
+ if (decoded[attr] instanceof _ParseRelation.default) {
275
+ decoded[attr]._ensureParentAndKey(this, attr);
290
276
  }
291
277
  }
292
278
  }
@@ -383,11 +369,17 @@ var ParseObject = function () {
383
369
  seen = seen || [seenEntry];
384
370
  var json = {};
385
371
  var attrs = this.attributes;
386
- for (var _attr5 in attrs) {
387
- if ((_attr5 === 'createdAt' || _attr5 === 'updatedAt') && attrs[_attr5].toJSON) {
388
- json[_attr5] = attrs[_attr5].toJSON();
372
+ for (var attr in attrs) {
373
+ if ((attr === 'createdAt' || attr === 'updatedAt') && attrs[attr].toJSON) {
374
+ json[attr] = attrs[attr].toJSON();
389
375
  } else {
390
- json[_attr5] = (0, _encode.default)(attrs[_attr5], false, false, seen, offline);
376
+ json[attr] = (0, _encode.default)(attrs[attr], false, false, seen, offline);
377
+ }
378
+ }
379
+ var pending = this._getPendingOps();
380
+ for (var _attr in pending[0]) {
381
+ if (_attr.indexOf('.') < 0) {
382
+ json[_attr] = pending[0][_attr].toJSON(offline);
391
383
  }
392
384
  }
393
385
  if (this.id) {
@@ -436,13 +428,13 @@ var ParseObject = function () {
436
428
  var pendingOps = this._getPendingOps();
437
429
  var keys = {};
438
430
  for (var i = 0; i < pendingOps.length; i++) {
439
- for (var _attr6 in pendingOps[i]) {
440
- keys[_attr6] = true;
431
+ for (var attr in pendingOps[i]) {
432
+ keys[attr] = true;
441
433
  }
442
434
  }
443
435
  var dirtyObjects = this._getDirtyObjectAttributes();
444
- for (var _attr7 in dirtyObjects) {
445
- keys[_attr7] = true;
436
+ for (var _attr2 in dirtyObjects) {
437
+ keys[_attr2] = true;
446
438
  }
447
439
  return Object.keys(keys);
448
440
  }
@@ -565,11 +557,11 @@ var ParseObject = function () {
565
557
  }
566
558
  var currentAttributes = this.attributes;
567
559
  var newValues = {};
568
- for (var _attr8 in newOps) {
569
- if (newOps[_attr8] instanceof _ParseOp.RelationOp) {
570
- newValues[_attr8] = newOps[_attr8].applyTo(currentAttributes[_attr8], this, _attr8);
571
- } else if (!(newOps[_attr8] instanceof _ParseOp.UnsetOp)) {
572
- newValues[_attr8] = newOps[_attr8].applyTo(currentAttributes[_attr8]);
560
+ for (var attr in newOps) {
561
+ if (newOps[attr] instanceof _ParseOp.RelationOp) {
562
+ newValues[attr] = newOps[attr].applyTo(currentAttributes[attr], this, attr);
563
+ } else if (!(newOps[attr] instanceof _ParseOp.UnsetOp)) {
564
+ newValues[attr] = newOps[attr].applyTo(currentAttributes[attr]);
573
565
  }
574
566
  }
575
567
  if (!options.ignoreValidation) {
@@ -584,9 +576,9 @@ var ParseObject = function () {
584
576
  var pendingOps = this._getPendingOps();
585
577
  var last = pendingOps.length - 1;
586
578
  var stateController = _CoreManager.default.getObjectStateController();
587
- for (var _attr9 in newOps) {
588
- var nextOp = newOps[_attr9].mergeWith(pendingOps[last][_attr9]);
589
- stateController.setPendingOp(this._getStateIdentifier(), _attr9, nextOp);
579
+ for (var _attr3 in newOps) {
580
+ var nextOp = newOps[_attr3].mergeWith(pendingOps[last][_attr3]);
581
+ stateController.setPendingOp(this._getStateIdentifier(), _attr3, nextOp);
590
582
  }
591
583
  return this;
592
584
  }
@@ -746,8 +738,8 @@ var ParseObject = function () {
746
738
  if (attrs.hasOwnProperty('ACL') && !(attrs.ACL instanceof _ParseACL.default)) {
747
739
  return new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'ACL must be a Parse ACL.');
748
740
  }
749
- for (var _key in attrs) {
750
- if (!/^[A-Za-z][0-9A-Za-z_.]*$/.test(_key)) {
741
+ for (var key in attrs) {
742
+ if (!/^[A-Za-z][0-9A-Za-z_.]*$/.test(key)) {
751
743
  return new _ParseError.default(_ParseError.default.INVALID_KEY_NAME);
752
744
  }
753
745
  }
@@ -771,14 +763,14 @@ var ParseObject = function () {
771
763
  key: "revert",
772
764
  value: function () {
773
765
  var keysToRevert;
774
- for (var _len = arguments.length, keys = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {
775
- keys[_key2] = arguments[_key2];
766
+ for (var _len = arguments.length, keys = new Array(_len), _key = 0; _key < _len; _key++) {
767
+ keys[_key] = arguments[_key];
776
768
  }
777
769
  if (keys.length) {
778
770
  keysToRevert = [];
779
- for (var _key3 of keys) {
780
- if (typeof _key3 === 'string') {
781
- keysToRevert.push(_key3);
771
+ for (var key of keys) {
772
+ if (typeof key === 'string') {
773
+ keysToRevert.push(key);
782
774
  } else {
783
775
  throw new Error('Parse.Object#revert expects either no, or a list of string, arguments.');
784
776
  }
@@ -795,9 +787,9 @@ var ParseObject = function () {
795
787
  if (typeof this.constructor.readOnlyAttributes === 'function') {
796
788
  readonly = readonly.concat(this.constructor.readOnlyAttributes());
797
789
  }
798
- for (var _attr10 in attributes) {
799
- if (readonly.indexOf(_attr10) < 0) {
800
- erasable[_attr10] = true;
790
+ for (var attr in attributes) {
791
+ if (readonly.indexOf(attr) < 0) {
792
+ erasable[attr] = true;
801
793
  }
802
794
  }
803
795
  return this.set(erasable, {
@@ -1132,11 +1124,11 @@ var ParseObject = function () {
1132
1124
  var constructor = classMap[json.className];
1133
1125
  var o = constructor ? new constructor(json.className) : new ParseObject(json.className);
1134
1126
  var otherAttributes = {};
1135
- for (var _attr11 in json) {
1136
- if (_attr11 !== 'className' && _attr11 !== '__type') {
1137
- otherAttributes[_attr11] = json[_attr11];
1127
+ for (var attr in json) {
1128
+ if (attr !== 'className' && attr !== '__type') {
1129
+ otherAttributes[attr] = json[attr];
1138
1130
  if (dirty) {
1139
- o.set(_attr11, json[_attr11]);
1131
+ o.set(attr, json[attr]);
1140
1132
  }
1141
1133
  }
1142
1134
  }
@@ -1343,7 +1335,6 @@ var ParseObject = function () {
1343
1335
  return localDatastore.unPinWithName(_LocalDatastoreUtils.PIN_PREFIX + name);
1344
1336
  }
1345
1337
  }]);
1346
- return ParseObject;
1347
1338
  }();
1348
1339
  var DefaultController = {
1349
1340
  fetch: function (target, forceFetch, options) {
@@ -1652,5 +1643,4 @@ var DefaultController = {
1652
1643
  };
1653
1644
  _CoreManager.default.setParseObject(ParseObject);
1654
1645
  _CoreManager.default.setObjectController(DefaultController);
1655
- var _default = ParseObject;
1656
- exports.default = _default;
1646
+ var _default = exports.default = ParseObject;