parse 5.1.0 → 5.2.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 (143) hide show
  1. package/dist/parse.js +1556 -1309
  2. package/dist/parse.min.js +2 -2
  3. package/dist/parse.weapp.js +1560 -1313
  4. package/dist/parse.weapp.min.js +2 -2
  5. package/lib/browser/Cloud.js +7 -11
  6. package/lib/browser/CoreManager.js +10 -10
  7. package/lib/browser/EventuallyQueue.js +1 -1
  8. package/lib/browser/InstallationController.js +3 -3
  9. package/lib/browser/LiveQueryClient.js +102 -60
  10. package/lib/browser/LocalDatastore.js +189 -147
  11. package/lib/browser/LocalDatastoreController.default.js +14 -9
  12. package/lib/browser/LocalDatastoreController.react-native.js +14 -12
  13. package/lib/browser/LocalDatastoreUtils.js +0 -5
  14. package/lib/browser/ObjectStateMutations.js +57 -21
  15. package/lib/browser/Parse.js +2 -2
  16. package/lib/browser/ParseCLP.js +9 -17
  17. package/lib/browser/ParseFile.js +27 -31
  18. package/lib/browser/ParseGeoPoint.js +9 -3
  19. package/lib/browser/ParseHooks.js +13 -13
  20. package/lib/browser/ParseInstallation.js +117 -9
  21. package/lib/browser/ParseObject.js +19 -17
  22. package/lib/browser/ParseOp.js +17 -17
  23. package/lib/browser/ParsePolygon.js +1 -1
  24. package/lib/browser/ParseQuery.js +147 -149
  25. package/lib/browser/ParseRole.js +5 -9
  26. package/lib/browser/ParseSchema.js +1 -1
  27. package/lib/browser/ParseUser.js +66 -51
  28. package/lib/browser/Push.js +5 -10
  29. package/lib/browser/RESTController.js +1 -1
  30. package/lib/browser/SingleInstanceStateController.js +1 -1
  31. package/lib/browser/TaskQueue.js +10 -10
  32. package/lib/browser/UniqueInstanceStateController.js +1 -1
  33. package/lib/browser/arrayContainsObject.js +0 -4
  34. package/lib/browser/canBeSerialized.js +0 -4
  35. package/lib/browser/decode.js +0 -7
  36. package/lib/browser/encode.js +3 -7
  37. package/lib/browser/equals.js +1 -1
  38. package/lib/browser/escape.js +0 -4
  39. package/lib/browser/isRevocableSession.js +0 -4
  40. package/lib/browser/parseDate.js +1 -5
  41. package/lib/browser/promiseUtils.js +11 -10
  42. package/lib/browser/unique.js +1 -5
  43. package/lib/browser/unsavedChildren.js +0 -8
  44. package/lib/browser/uuid.js +2 -2
  45. package/lib/node/Cloud.js +7 -11
  46. package/lib/node/CoreManager.js +10 -10
  47. package/lib/node/EventuallyQueue.js +1 -1
  48. package/lib/node/InstallationController.js +3 -3
  49. package/lib/node/LiveQueryClient.js +14 -24
  50. package/lib/node/LocalDatastore.js +7 -11
  51. package/lib/node/LocalDatastoreController.default.js +12 -10
  52. package/lib/node/LocalDatastoreController.react-native.js +13 -12
  53. package/lib/node/LocalDatastoreUtils.js +0 -5
  54. package/lib/node/ObjectStateMutations.js +45 -19
  55. package/lib/node/Parse.js +2 -2
  56. package/lib/node/ParseCLP.js +8 -18
  57. package/lib/node/ParseFile.js +27 -40
  58. package/lib/node/ParseGeoPoint.js +9 -3
  59. package/lib/node/ParseHooks.js +13 -13
  60. package/lib/node/ParseInstallation.js +60 -2
  61. package/lib/node/ParseObject.js +19 -17
  62. package/lib/node/ParseOp.js +21 -21
  63. package/lib/node/ParsePolygon.js +1 -1
  64. package/lib/node/ParseQuery.js +84 -107
  65. package/lib/node/ParseRole.js +3 -8
  66. package/lib/node/ParseSchema.js +4 -4
  67. package/lib/node/ParseUser.js +42 -37
  68. package/lib/node/Push.js +3 -8
  69. package/lib/node/RESTController.js +1 -1
  70. package/lib/node/SingleInstanceStateController.js +1 -1
  71. package/lib/node/TaskQueue.js +9 -11
  72. package/lib/node/UniqueInstanceStateController.js +1 -1
  73. package/lib/node/arrayContainsObject.js +0 -4
  74. package/lib/node/canBeSerialized.js +0 -4
  75. package/lib/node/decode.js +0 -7
  76. package/lib/node/encode.js +3 -7
  77. package/lib/node/equals.js +1 -1
  78. package/lib/node/escape.js +0 -4
  79. package/lib/node/isRevocableSession.js +0 -4
  80. package/lib/node/parseDate.js +1 -5
  81. package/lib/node/promiseUtils.js +11 -10
  82. package/lib/node/unique.js +1 -5
  83. package/lib/node/unsavedChildren.js +0 -8
  84. package/lib/node/uuid.js +2 -2
  85. package/lib/react-native/Cloud.js +0 -1
  86. package/lib/react-native/CoreManager.js +1 -1
  87. package/lib/react-native/LiveQueryClient.js +49 -32
  88. package/lib/react-native/LocalDatastore.js +38 -14
  89. package/lib/react-native/LocalDatastoreController.default.js +7 -1
  90. package/lib/react-native/LocalDatastoreController.react-native.js +7 -1
  91. package/lib/react-native/ObjectStateMutations.js +30 -9
  92. package/lib/react-native/ParseCLP.js +3 -3
  93. package/lib/react-native/ParseFile.js +7 -6
  94. package/lib/react-native/ParseInstallation.js +51 -3
  95. package/lib/react-native/ParseObject.js +6 -5
  96. package/lib/react-native/ParseQuery.js +45 -37
  97. package/lib/react-native/ParseRole.js +1 -1
  98. package/lib/react-native/ParseUser.js +22 -16
  99. package/lib/react-native/TaskQueue.js +8 -2
  100. package/lib/react-native/decode.js +0 -1
  101. package/lib/react-native/promiseUtils.js +5 -4
  102. package/lib/react-native/uuid.js +1 -2
  103. package/lib/weapp/Cloud.js +7 -11
  104. package/lib/weapp/CoreManager.js +10 -10
  105. package/lib/weapp/EventuallyQueue.js +1 -1
  106. package/lib/weapp/InstallationController.js +3 -3
  107. package/lib/weapp/LiveQueryClient.js +102 -60
  108. package/lib/weapp/LocalDatastore.js +189 -147
  109. package/lib/weapp/LocalDatastoreController.default.js +14 -9
  110. package/lib/weapp/LocalDatastoreController.react-native.js +14 -12
  111. package/lib/weapp/LocalDatastoreUtils.js +0 -5
  112. package/lib/weapp/ObjectStateMutations.js +57 -21
  113. package/lib/weapp/Parse.js +2 -2
  114. package/lib/weapp/ParseCLP.js +9 -17
  115. package/lib/weapp/ParseFile.js +27 -31
  116. package/lib/weapp/ParseGeoPoint.js +9 -3
  117. package/lib/weapp/ParseHooks.js +13 -13
  118. package/lib/weapp/ParseInstallation.js +117 -9
  119. package/lib/weapp/ParseObject.js +19 -17
  120. package/lib/weapp/ParseOp.js +17 -17
  121. package/lib/weapp/ParsePolygon.js +1 -1
  122. package/lib/weapp/ParseQuery.js +147 -149
  123. package/lib/weapp/ParseRole.js +5 -9
  124. package/lib/weapp/ParseSchema.js +1 -1
  125. package/lib/weapp/ParseUser.js +66 -51
  126. package/lib/weapp/Push.js +5 -10
  127. package/lib/weapp/RESTController.js +1 -1
  128. package/lib/weapp/SingleInstanceStateController.js +1 -1
  129. package/lib/weapp/TaskQueue.js +10 -10
  130. package/lib/weapp/UniqueInstanceStateController.js +1 -1
  131. package/lib/weapp/arrayContainsObject.js +0 -4
  132. package/lib/weapp/canBeSerialized.js +0 -4
  133. package/lib/weapp/decode.js +0 -7
  134. package/lib/weapp/encode.js +3 -7
  135. package/lib/weapp/equals.js +1 -1
  136. package/lib/weapp/escape.js +0 -4
  137. package/lib/weapp/isRevocableSession.js +0 -4
  138. package/lib/weapp/parseDate.js +1 -5
  139. package/lib/weapp/promiseUtils.js +11 -10
  140. package/lib/weapp/unique.js +1 -5
  141. package/lib/weapp/unsavedChildren.js +0 -8
  142. package/lib/weapp/uuid.js +3 -3
  143. package/package.json +5 -6
@@ -11,18 +11,19 @@ exports.when = when;
11
11
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
12
12
  var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
13
13
  // Create Deferred Promise
14
- function resolvingPromise() {
15
- var res;
16
- var rej;
14
+ function resolvingPromise /*:: <T = any>*/() {
15
+ var res /*: (value: T) => void*/;
16
+ var rej /*: (error: T) => void*/;
17
17
  var promise = new _promise.default(function (resolve, reject) {
18
18
  res = resolve;
19
19
  rej = reject;
20
20
  });
21
- promise.resolve = res;
22
- promise.reject = rej;
23
- return promise;
21
+ var defer /*: typeof promise & { resolve: (res: T) => void, reject: (err: any) => void }*/ = promise;
22
+ defer.resolve = res;
23
+ defer.reject = rej;
24
+ return defer;
24
25
  }
25
- function when(promises) {
26
+ function when(promises /*: any*/) {
26
27
  var objects;
27
28
  var arrayArgument = (0, _isArray.default)(promises);
28
29
  if (arrayArgument) {
@@ -40,7 +41,7 @@ function when(promises) {
40
41
  if (total === 0) {
41
42
  return _promise.default.resolve(returnValue);
42
43
  }
43
- var promise = new resolvingPromise();
44
+ var promise = resolvingPromise();
44
45
  var resolveOne = function () {
45
46
  total--;
46
47
  if (total <= 0) {
@@ -51,7 +52,7 @@ function when(promises) {
51
52
  }
52
53
  }
53
54
  };
54
- var chain = function (object, index) {
55
+ var chain = function (object /*: Promise<any>*/, index /*: number*/) {
55
56
  if (object && typeof object.then === 'function') {
56
57
  object.then(function (result) {
57
58
  results[index] = result;
@@ -71,7 +72,7 @@ function when(promises) {
71
72
  }
72
73
  return promise;
73
74
  }
74
- function continueWhile(test, emitter) {
75
+ function continueWhile(test /*: () => any*/, emitter /*: () => Promise<any>*/) {
75
76
  if (test()) {
76
77
  return emitter().then(function () {
77
78
  return continueWhile(test, emitter);
@@ -10,12 +10,8 @@ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
10
10
  var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
11
11
  var _arrayContainsObject = _interopRequireDefault(require("./arrayContainsObject"));
12
12
  var _CoreManager = _interopRequireDefault(require("./CoreManager"));
13
- /**
14
- * @flow
15
- */
16
-
17
13
  function unique /*:: <T>*/(arr /*: Array<T>*/) /*: Array<T>*/{
18
- var uniques = [];
14
+ var uniques /*: T[]*/ = [];
19
15
  (0, _forEach.default)(arr).call(arr, function (value) {
20
16
  var ParseObject = _CoreManager.default.getParseObject();
21
17
  if (value instanceof ParseObject) {
@@ -14,14 +14,6 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/ty
14
14
  var _CoreManager = _interopRequireDefault(require("./CoreManager"));
15
15
  var _ParseFile = _interopRequireDefault(require("./ParseFile"));
16
16
  var _ParseRelation = _interopRequireDefault(require("./ParseRelation"));
17
- /**
18
- * @flow
19
- */
20
- /*:: import type ParseObject from './ParseObject';*/
21
- /*:: type EncounterMap = {
22
- objects: { [identifier: string]: ParseObject | boolean },
23
- files: Array<ParseFile>,
24
- };*/
25
17
  /**
26
18
  * Return an array of unsaved children, which are either Parse Objects or Files.
27
19
  * If it encounters any dirty Objects without Ids, it will throw an exception.
package/lib/weapp/uuid.js CHANGED
@@ -6,8 +6,7 @@ _Object$defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _uuid = require("uuid");
9
- var uuid /*: () => string*/ = null;
10
- uuid = function () {
9
+ var uuid = function () {
11
10
  var s /*: string[]*/ = [];
12
11
  var hexDigits = '0123456789abcdef';
13
12
  for (var i = 0; i < 36; i++) {
@@ -17,7 +16,8 @@ uuid = function () {
17
16
  s[19] = hexDigits.substr(Number(s[19]) & 0x3 | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
18
17
  s[8] = s[13] = s[18] = s[23] = '-';
19
18
  return s.join('');
20
- };
19
+ } /*: () => string*/;
20
+
21
21
  module.exports = uuid;
22
22
  var _default = uuid;
23
23
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parse",
3
- "version": "5.1.0",
3
+ "version": "5.2.0-alpha.1",
4
4
  "description": "Parse JavaScript SDK",
5
5
  "homepage": "https://parseplatform.org",
6
6
  "keywords": [
@@ -38,7 +38,6 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@babel/core": "7.22.0",
41
- "@babel/eslint-parser": "7.21.8",
42
41
  "@babel/plugin-proposal-class-properties": "7.18.6",
43
42
  "@babel/plugin-transform-flow-comments": "7.22.5",
44
43
  "@babel/plugin-transform-flow-strip-types": "7.21.0",
@@ -63,9 +62,9 @@
63
62
  "codecov": "3.8.3",
64
63
  "core-js": "3.30.2",
65
64
  "cross-env": "7.0.2",
66
- "eslint": "8.40.0",
65
+ "eslint": "8.56.0",
67
66
  "eslint-plugin-flowtype": "8.0.3",
68
- "eslint-plugin-jsdoc": "43.0.7",
67
+ "eslint-plugin-jsdoc": "48.2.5",
69
68
  "express": "4.18.2",
70
69
  "gulp": "4.0.2",
71
70
  "gulp-babel": "8.0.0",
@@ -105,8 +104,8 @@
105
104
  "test:mongodb:runnerstart": "mongodb-runner start -- --port 27017",
106
105
  "test:types": "dtslint --expectOnly types",
107
106
  "posttest:mongodb": "mongodb-runner stop --all",
108
- "lint": "eslint --cache src/ integration/",
109
- "lint:fix": "eslint --fix --cache src/ integration/",
107
+ "lint": "eslint --cache src/ integration/ --ext .js --ext .ts",
108
+ "lint:fix": "eslint --fix --cache src/ integration/ --ext .js --ext .ts",
110
109
  "lint:types": "dtslint types",
111
110
  "watch": "cross-env PARSE_BUILD=${PARSE_BUILD} gulp watch",
112
111
  "watch:browser": "cross-env PARSE_BUILD=browser npm run watch",