parse 5.3.0-alpha.2 → 5.3.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 (50) hide show
  1. package/dist/parse.js +17 -24
  2. package/dist/parse.min.js +2 -2
  3. package/dist/parse.weapp.js +17 -22
  4. package/dist/parse.weapp.min.js +2 -2
  5. package/lib/browser/CoreManager.js +1 -1
  6. package/lib/browser/FacebookUtils.js +1 -1
  7. package/lib/browser/LocalDatastoreController.react-native.js +1 -1
  8. package/lib/browser/OfflineQuery.js +5 -9
  9. package/lib/browser/Parse.js +1 -3
  10. package/lib/browser/ParseConfig.js +1 -1
  11. package/lib/browser/ParseFile.js +0 -1
  12. package/lib/browser/ParseObject.js +1 -1
  13. package/lib/browser/ParseQuery.js +1 -1
  14. package/lib/browser/ParseUser.js +1 -1
  15. package/lib/browser/RESTController.js +2 -2
  16. package/lib/browser/StorageController.weapp.js +1 -1
  17. package/lib/node/CoreManager.js +1 -1
  18. package/lib/node/FacebookUtils.js +1 -1
  19. package/lib/node/LocalDatastoreController.react-native.js +1 -1
  20. package/lib/node/OfflineQuery.js +5 -9
  21. package/lib/node/Parse.js +1 -1
  22. package/lib/node/ParseConfig.js +1 -1
  23. package/lib/node/ParseFile.js +0 -1
  24. package/lib/node/ParseObject.js +1 -1
  25. package/lib/node/ParseQuery.js +1 -1
  26. package/lib/node/ParseUser.js +1 -1
  27. package/lib/node/RESTController.js +2 -2
  28. package/lib/node/StorageController.weapp.js +1 -1
  29. package/lib/react-native/CoreManager.js +1 -1
  30. package/lib/react-native/LocalDatastoreController.react-native.js +1 -1
  31. package/lib/react-native/OfflineQuery.js +5 -5
  32. package/lib/react-native/ParseConfig.js +1 -1
  33. package/lib/react-native/ParseObject.js +2 -1
  34. package/lib/react-native/ParseQuery.js +1 -1
  35. package/lib/react-native/ParseUser.js +1 -1
  36. package/lib/react-native/RESTController.js +11 -10
  37. package/lib/react-native/StorageController.weapp.js +1 -1
  38. package/lib/weapp/CoreManager.js +1 -1
  39. package/lib/weapp/FacebookUtils.js +1 -1
  40. package/lib/weapp/LocalDatastoreController.react-native.js +1 -1
  41. package/lib/weapp/OfflineQuery.js +5 -9
  42. package/lib/weapp/Parse.js +1 -1
  43. package/lib/weapp/ParseConfig.js +1 -1
  44. package/lib/weapp/ParseFile.js +0 -1
  45. package/lib/weapp/ParseObject.js +1 -1
  46. package/lib/weapp/ParseQuery.js +1 -1
  47. package/lib/weapp/ParseUser.js +1 -1
  48. package/lib/weapp/RESTController.js +2 -2
  49. package/lib/weapp/StorageController.weapp.js +1 -1
  50. package/package.json +20 -18
package/dist/parse.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Parse JavaScript SDK v5.3.0-alpha.2
2
+ * Parse JavaScript SDK v5.3.0-alpha.3
3
3
  *
4
4
  * The source tree of this library can be found at
5
5
  * https://github.com/ParsePlatform/Parse-SDK-JS
@@ -358,7 +358,7 @@ const config = {
358
358
  SERVER_AUTH_TOKEN: null,
359
359
  LIVEQUERY_SERVER_URL: null,
360
360
  ENCRYPTED_KEY: null,
361
- VERSION: 'js' + "5.3.0-alpha.2",
361
+ VERSION: 'js' + "5.3.0-alpha.3",
362
362
  APPLICATION_ID: null,
363
363
  JAVASCRIPT_KEY: null,
364
364
  MASTER_KEY: null,
@@ -1108,7 +1108,7 @@ const FacebookUtils = {
1108
1108
  }
1109
1109
  }
1110
1110
  if (initOptions.status && typeof console !== 'undefined') {
1111
- const warn = console.warn || console.log || function () {}; // eslint-disable-line no-console
1111
+ const warn = console.warn || console.log || function () {};
1112
1112
  warn.call(console, 'The "status" flag passed into' + ' FB.init, when set to true, can interfere with Parse Facebook' + ' integration, so it has been suppressed. Please call' + ' FB.getLoginStatus() explicitly if you require this behavior.');
1113
1113
  }
1114
1114
  initOptions.status = false;
@@ -2532,7 +2532,7 @@ const LocalDatastoreController = {
2532
2532
  const [key, value] = pair;
2533
2533
  try {
2534
2534
  LDS[key] = JSON.parse(value);
2535
- } catch (error) {
2535
+ } catch (_) {
2536
2536
  LDS[key] = null;
2537
2537
  }
2538
2538
  });
@@ -3080,11 +3080,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
3080
3080
  compareTo = parserResult.result;
3081
3081
  }
3082
3082
  // Compare Date Object or Date String
3083
- if (toString.call(compareTo) === '[object Date]' || typeof compareTo === 'string' &&
3084
- // @ts-ignore
3085
- new Date(compareTo) !== 'Invalid Date' &&
3086
- // @ts-ignore
3087
- !isNaN(new Date(compareTo))) {
3083
+ if (toString.call(compareTo) === '[object Date]' || typeof compareTo === 'string' && new Date(compareTo).toString() !== 'Invalid Date') {
3088
3084
  object[key] = new Date(object[key].iso ? object[key].iso : object[key]);
3089
3085
  }
3090
3086
  switch (condition) {
@@ -3205,7 +3201,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
3205
3201
  break;
3206
3202
  case '$select':
3207
3203
  {
3208
- const subQueryObjects = (0, _filter.default)(objects).call(objects, (obj, index, arr) => {
3204
+ const subQueryObjects = (0, _filter.default)(objects).call(objects, (obj, _index, arr) => {
3209
3205
  return matchesQuery(compareTo.query.className, obj, arr, compareTo.query.where);
3210
3206
  });
3211
3207
  for (let i = 0; i < subQueryObjects.length; i += 1) {
@@ -3216,7 +3212,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
3216
3212
  }
3217
3213
  case '$dontSelect':
3218
3214
  {
3219
- const subQueryObjects = (0, _filter.default)(objects).call(objects, (obj, index, arr) => {
3215
+ const subQueryObjects = (0, _filter.default)(objects).call(objects, (obj, _index, arr) => {
3220
3216
  return matchesQuery(compareTo.query.className, obj, arr, compareTo.query.where);
3221
3217
  });
3222
3218
  for (let i = 0; i < subQueryObjects.length; i += 1) {
@@ -3227,7 +3223,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
3227
3223
  }
3228
3224
  case '$inQuery':
3229
3225
  {
3230
- const subQueryObjects = (0, _filter.default)(objects).call(objects, (obj, index, arr) => {
3226
+ const subQueryObjects = (0, _filter.default)(objects).call(objects, (obj, _index, arr) => {
3231
3227
  return matchesQuery(compareTo.className, obj, arr, compareTo.where);
3232
3228
  });
3233
3229
  for (let i = 0; i < subQueryObjects.length; i += 1) {
@@ -3240,7 +3236,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
3240
3236
  }
3241
3237
  case '$notInQuery':
3242
3238
  {
3243
- const subQueryObjects = (0, _filter.default)(objects).call(objects, (obj, index, arr) => {
3239
+ const subQueryObjects = (0, _filter.default)(objects).call(objects, (obj, _index, arr) => {
3244
3240
  return matchesQuery(compareTo.className, obj, arr, compareTo.where);
3245
3241
  });
3246
3242
  for (let i = 0; i < subQueryObjects.length; i += 1) {
@@ -3459,9 +3455,7 @@ const Parse = {
3459
3455
  */
3460
3456
  initialize(applicationId, javaScriptKey) {
3461
3457
  if ("browser" === 'browser' && _CoreManager.default.get('IS_NODE') && !process.env.SERVER_RENDERING) {
3462
- /* eslint-disable no-console */
3463
3458
  console.log("It looks like you're using the browser version of the SDK in a " + "node.js environment. You should require('parse/node') instead.");
3464
- /* eslint-enable no-console */
3465
3459
  }
3466
3460
  Parse._initialize(applicationId, javaScriptKey);
3467
3461
  },
@@ -3695,7 +3689,7 @@ const Parse = {
3695
3689
  */
3696
3690
  dumpLocalDatastore() {
3697
3691
  if (!this.LocalDatastore.isEnabled) {
3698
- console.log('Parse.enableLocalDatastore() must be called first'); // eslint-disable-line no-console
3692
+ console.log('Parse.enableLocalDatastore() must be called first');
3699
3693
  return _promise.default.resolve({});
3700
3694
  } else {
3701
3695
  return Parse.LocalDatastore._getAllContents();
@@ -4764,7 +4758,7 @@ function decodePayload(data) {
4764
4758
  if (json && typeof json === 'object') {
4765
4759
  return (0, _decode.default)(json);
4766
4760
  }
4767
- } catch (e) {
4761
+ } catch (_) {
4768
4762
  return null;
4769
4763
  }
4770
4764
  }
@@ -5751,7 +5745,6 @@ const DefaultController = {
5751
5745
  throw new Error('saveFile can only be used with File-type sources.');
5752
5746
  }
5753
5747
  const base64Data = await new _promise.default((res, rej) => {
5754
- // eslint-disable-next-line no-undef
5755
5748
  const reader = new FileReader();
5756
5749
  reader.onload = () => res(reader.result);
5757
5750
  reader.onerror = error => rej(error);
@@ -6902,7 +6895,7 @@ class ParseObject {
6902
6895
  if (objectCache[attr] !== stringified) {
6903
6896
  dirty[attr] = val;
6904
6897
  }
6905
- } catch (e) {
6898
+ } catch (_) {
6906
6899
  // Error occurred, possibly by a nested unsaved pointer in a mutable container
6907
6900
  // No matter how it happened, it indicates a change in the attribute
6908
6901
  dirty[attr] = val;
@@ -10036,7 +10029,7 @@ class ParseQuery {
10036
10029
  _OfflineQuery.default.validateQuery(this);
10037
10030
  const localDatastore = _CoreManager.default.getLocalDatastore();
10038
10031
  const objects = await localDatastore._serializeObjectsFromPinName(this._localDatastorePinName);
10039
- let results = (0, _filter.default)(_context = (0, _map.default)(objects).call(objects, (json, index, arr) => {
10032
+ let results = (0, _filter.default)(_context = (0, _map.default)(objects).call(objects, (json, _index, arr) => {
10040
10033
  const object = _ParseObject.default.fromJSON(json, false);
10041
10034
  if (json._localId && !json.objectId) {
10042
10035
  object._localId = json._localId;
@@ -12777,7 +12770,7 @@ class ParseUser extends _ParseObject.default {
12777
12770
  reject(error);
12778
12771
  });
12779
12772
  },
12780
- error: (provider, error) => {
12773
+ error: (_provider, error) => {
12781
12774
  reject(error);
12782
12775
  }
12783
12776
  });
@@ -14034,7 +14027,7 @@ let useXDomainRequest = false;
14034
14027
  if (typeof XDomainRequest !== 'undefined' && !('withCredentials' in new XMLHttpRequest())) {
14035
14028
  useXDomainRequest = true;
14036
14029
  }
14037
- function ajaxIE9(method, url, data, headers, options) {
14030
+ function ajaxIE9(method, url, data, _headers, options) {
14038
14031
  return new _promise.default((resolve, reject) => {
14039
14032
  // @ts-ignore
14040
14033
  const xdr = new XDomainRequest();
@@ -14297,7 +14290,7 @@ const RESTController = {
14297
14290
  try {
14298
14291
  const errorJSON = JSON.parse(response.responseText);
14299
14292
  error = new _ParseError.default(errorJSON.code, errorJSON.error);
14300
- } catch (e) {
14293
+ } catch (_) {
14301
14294
  // If we fail to parse the error text, that's okay.
14302
14295
  error = new _ParseError.default(_ParseError.default.INVALID_JSON, 'Received an error with invalid JSON from Parse: ' + response.responseText);
14303
14296
  }
@@ -14818,7 +14811,7 @@ const StorageController = {
14818
14811
  try {
14819
14812
  // @ts-ignore
14820
14813
  wx.setStorageSync(path, value);
14821
- } catch (e) {
14814
+ } catch (_) {
14822
14815
  // Quota exceeded
14823
14816
  }
14824
14817
  },