parse 4.0.0-alpha.6 → 4.0.0-alpha.8
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.
- package/LICENSE +167 -25
- package/NOTICE +10 -0
- package/README.md +1 -3
- package/dist/parse.js +3991 -6551
- package/dist/parse.min.js +7 -6
- package/dist/parse.weapp.js +3152 -6482
- package/dist/parse.weapp.min.js +7 -6
- package/lib/browser/Analytics.js +4 -11
- package/lib/browser/AnonymousUtils.js +2 -9
- package/lib/browser/Cloud.js +4 -11
- package/lib/browser/CloudCode.js +0 -1
- package/lib/browser/CoreManager.js +3 -10
- package/lib/browser/EventEmitter.js +0 -7
- package/lib/browser/EventuallyQueue.js +282 -668
- package/lib/browser/FacebookUtils.js +2 -9
- package/lib/browser/InstallationController.js +0 -7
- package/lib/browser/LiveQueryClient.js +35 -26
- package/lib/browser/LiveQuerySubscription.js +5 -4
- package/lib/browser/LocalDatastore.js +472 -864
- package/lib/browser/LocalDatastoreController.js +161 -547
- package/lib/browser/LocalDatastoreController.react-native.js +156 -537
- package/lib/browser/LocalDatastoreUtils.js +2 -9
- package/lib/browser/ObjectStateMutations.js +25 -25
- package/lib/browser/OfflineQuery.js +31 -33
- package/lib/browser/Parse.js +4 -13
- package/lib/browser/ParseACL.js +9 -16
- package/lib/browser/ParseCLP.js +46 -48
- package/lib/browser/ParseConfig.js +6 -13
- package/lib/browser/ParseError.js +2 -11
- package/lib/browser/ParseFile.js +107 -482
- package/lib/browser/ParseGeoPoint.js +4 -11
- package/lib/browser/ParseHooks.js +2 -2
- package/lib/browser/ParseInstallation.js +2 -2
- package/lib/browser/ParseLiveQuery.js +104 -480
- package/lib/browser/ParseObject.js +598 -958
- package/lib/browser/ParseOp.js +11 -11
- package/lib/browser/ParsePolygon.js +5 -12
- package/lib/browser/ParseQuery.js +365 -758
- package/lib/browser/ParseRelation.js +2 -9
- package/lib/browser/ParseRole.js +2 -2
- package/lib/browser/ParseSchema.js +2 -9
- package/lib/browser/ParseSession.js +2 -2
- package/lib/browser/ParseUser.js +221 -607
- package/lib/browser/Push.js +2 -9
- package/lib/browser/RESTController.js +12 -19
- package/lib/browser/SingleInstanceStateController.js +4 -11
- package/lib/browser/Storage.js +0 -7
- package/lib/browser/StorageController.browser.js +0 -7
- package/lib/browser/StorageController.default.js +0 -7
- package/lib/browser/StorageController.react-native.js +0 -7
- package/lib/browser/StorageController.weapp.js +0 -7
- package/lib/browser/TaskQueue.js +0 -7
- package/lib/browser/UniqueInstanceStateController.js +8 -15
- package/lib/browser/arrayContainsObject.js +2 -9
- package/lib/browser/canBeSerialized.js +2 -9
- package/lib/browser/decode.js +4 -11
- package/lib/browser/encode.js +8 -15
- package/lib/browser/equals.js +4 -13
- package/lib/browser/escape.js +0 -7
- package/lib/browser/isRevocableSession.js +2 -9
- package/lib/browser/parseDate.js +2 -9
- package/lib/browser/promiseUtils.js +4 -4
- package/lib/browser/unique.js +4 -11
- package/lib/browser/unsavedChildren.js +6 -13
- package/lib/browser/uuid.js +5 -1
- package/lib/node/Analytics.js +0 -7
- package/lib/node/AnonymousUtils.js +0 -7
- package/lib/node/Cloud.js +0 -7
- package/lib/node/CloudCode.js +0 -1
- package/lib/node/CoreManager.js +1 -8
- package/lib/node/EventEmitter.js +0 -7
- package/lib/node/FacebookUtils.js +0 -7
- package/lib/node/InstallationController.js +0 -7
- package/lib/node/LiveQueryClient.js +18 -17
- package/lib/node/LiveQuerySubscription.js +2 -11
- package/lib/node/LocalDatastore.js +0 -7
- package/lib/node/LocalDatastoreController.js +0 -7
- package/lib/node/LocalDatastoreController.react-native.js +0 -7
- package/lib/node/LocalDatastoreUtils.js +0 -7
- package/lib/node/ObjectStateMutations.js +0 -7
- package/lib/node/Parse.js +0 -9
- package/lib/node/ParseACL.js +0 -7
- package/lib/node/ParseCLP.js +0 -7
- package/lib/node/ParseConfig.js +0 -7
- package/lib/node/ParseError.js +0 -9
- package/lib/node/ParseFile.js +7 -12
- package/lib/node/ParseGeoPoint.js +0 -7
- package/lib/node/ParseInstallation.js +0 -7
- package/lib/node/ParseLiveQuery.js +0 -7
- package/lib/node/ParseObject.js +45 -34
- package/lib/node/ParseOp.js +0 -7
- package/lib/node/ParsePolygon.js +0 -7
- package/lib/node/ParseQuery.js +3 -18
- package/lib/node/ParseRelation.js +0 -7
- package/lib/node/ParseRole.js +0 -7
- package/lib/node/ParseSchema.js +0 -7
- package/lib/node/ParseSession.js +0 -7
- package/lib/node/ParseUser.js +0 -7
- package/lib/node/Push.js +0 -7
- package/lib/node/RESTController.js +0 -7
- package/lib/node/SingleInstanceStateController.js +0 -7
- package/lib/node/Storage.js +0 -7
- package/lib/node/StorageController.browser.js +0 -7
- package/lib/node/StorageController.default.js +0 -7
- package/lib/node/StorageController.react-native.js +0 -7
- package/lib/node/StorageController.weapp.js +0 -7
- package/lib/node/TaskQueue.js +0 -7
- package/lib/node/UniqueInstanceStateController.js +0 -7
- package/lib/node/arrayContainsObject.js +0 -7
- package/lib/node/canBeSerialized.js +0 -7
- package/lib/node/decode.js +0 -7
- package/lib/node/encode.js +0 -7
- package/lib/node/equals.js +0 -9
- package/lib/node/escape.js +0 -7
- package/lib/node/isRevocableSession.js +0 -7
- package/lib/node/parseDate.js +0 -7
- package/lib/node/unique.js +0 -7
- package/lib/node/unsavedChildren.js +0 -7
- package/lib/node/uuid.js +7 -1
- package/lib/react-native/CoreManager.js +2 -2
- package/lib/react-native/EventuallyQueue.js +169 -676
- package/lib/react-native/LiveQueryClient.js +16 -50
- package/lib/react-native/LiveQuerySubscription.js +3 -2
- package/lib/react-native/LocalDatastore.js +303 -863
- package/lib/react-native/LocalDatastoreController.js +75 -535
- package/lib/react-native/LocalDatastoreController.react-native.js +95 -503
- package/lib/react-native/ObjectStateMutations.js +2 -31
- package/lib/react-native/OfflineQuery.js +17 -63
- package/lib/react-native/ParseCLP.js +55 -129
- package/lib/react-native/ParseFile.js +63 -468
- package/lib/react-native/ParseLiveQuery.js +60 -455
- package/lib/react-native/ParseObject.js +263 -897
- package/lib/react-native/ParseQuery.js +207 -643
- package/lib/react-native/ParseSchema.js +3 -3
- package/lib/react-native/ParseUser.js +118 -573
- package/lib/react-native/RESTController.js +1 -29
- package/lib/react-native/uuid.js +5 -1
- package/lib/weapp/Analytics.js +4 -11
- package/lib/weapp/AnonymousUtils.js +2 -9
- package/lib/weapp/Cloud.js +4 -11
- package/lib/weapp/CloudCode.js +0 -1
- package/lib/weapp/CoreManager.js +3 -10
- package/lib/weapp/EventEmitter.js +0 -7
- package/lib/weapp/EventuallyQueue.js +282 -668
- package/lib/weapp/FacebookUtils.js +2 -9
- package/lib/weapp/InstallationController.js +0 -7
- package/lib/weapp/LiveQueryClient.js +35 -26
- package/lib/weapp/LiveQuerySubscription.js +5 -4
- package/lib/weapp/LocalDatastore.js +472 -864
- package/lib/weapp/LocalDatastoreController.js +161 -547
- package/lib/weapp/LocalDatastoreController.react-native.js +156 -537
- package/lib/weapp/LocalDatastoreUtils.js +2 -9
- package/lib/weapp/ObjectStateMutations.js +25 -25
- package/lib/weapp/OfflineQuery.js +31 -33
- package/lib/weapp/Parse.js +4 -13
- package/lib/weapp/ParseACL.js +9 -16
- package/lib/weapp/ParseCLP.js +46 -48
- package/lib/weapp/ParseConfig.js +6 -13
- package/lib/weapp/ParseError.js +2 -11
- package/lib/weapp/ParseFile.js +107 -482
- package/lib/weapp/ParseGeoPoint.js +4 -11
- package/lib/weapp/ParseHooks.js +2 -2
- package/lib/weapp/ParseInstallation.js +2 -2
- package/lib/weapp/ParseLiveQuery.js +104 -480
- package/lib/weapp/ParseObject.js +598 -958
- package/lib/weapp/ParseOp.js +11 -11
- package/lib/weapp/ParsePolygon.js +5 -12
- package/lib/weapp/ParseQuery.js +365 -758
- package/lib/weapp/ParseRelation.js +2 -9
- package/lib/weapp/ParseRole.js +2 -2
- package/lib/weapp/ParseSchema.js +2 -9
- package/lib/weapp/ParseSession.js +2 -2
- package/lib/weapp/ParseUser.js +221 -607
- package/lib/weapp/Push.js +2 -9
- package/lib/weapp/RESTController.js +12 -19
- package/lib/weapp/SingleInstanceStateController.js +4 -11
- package/lib/weapp/Storage.js +0 -7
- package/lib/weapp/StorageController.browser.js +0 -7
- package/lib/weapp/StorageController.default.js +0 -7
- package/lib/weapp/StorageController.react-native.js +0 -7
- package/lib/weapp/StorageController.weapp.js +0 -7
- package/lib/weapp/TaskQueue.js +0 -7
- package/lib/weapp/UniqueInstanceStateController.js +8 -15
- package/lib/weapp/arrayContainsObject.js +2 -9
- package/lib/weapp/canBeSerialized.js +2 -9
- package/lib/weapp/decode.js +4 -11
- package/lib/weapp/encode.js +8 -15
- package/lib/weapp/equals.js +4 -13
- package/lib/weapp/escape.js +0 -7
- package/lib/weapp/isRevocableSession.js +2 -9
- package/lib/weapp/parseDate.js +2 -9
- package/lib/weapp/promiseUtils.js +4 -4
- package/lib/weapp/unique.js +4 -11
- package/lib/weapp/unsavedChildren.js +6 -13
- package/lib/weapp/uuid.js +2 -0
- package/package.json +24 -24
- package/PATENTS +0 -37
package/lib/weapp/ParseQuery.js
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _sliceInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/slice");
|
|
6
|
-
|
|
7
|
-
var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse");
|
|
8
|
-
|
|
9
|
-
var _Promise2 = require("@babel/runtime-corejs3/core-js-stable/promise");
|
|
10
|
-
|
|
11
|
-
var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/set-prototype-of");
|
|
12
|
-
|
|
13
|
-
var _typeof3 = require("@babel/runtime-corejs3/helpers/typeof");
|
|
14
|
-
|
|
15
|
-
var _forEachInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
16
|
-
|
|
17
|
-
var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of");
|
|
18
|
-
|
|
19
|
-
var _Object$create = require("@babel/runtime-corejs3/core-js-stable/object/create");
|
|
20
|
-
|
|
21
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
22
4
|
|
|
23
|
-
var
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
24
6
|
|
|
25
7
|
_Object$defineProperty(exports, "__esModule", {
|
|
26
8
|
value: true
|
|
@@ -28,49 +10,51 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
28
10
|
|
|
29
11
|
exports.default = void 0;
|
|
30
12
|
|
|
31
|
-
var
|
|
13
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
|
|
32
14
|
|
|
33
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
|
34
16
|
|
|
35
|
-
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
36
|
-
|
|
37
17
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toConsumableArray"));
|
|
38
18
|
|
|
39
|
-
var
|
|
19
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
|
40
20
|
|
|
41
|
-
var
|
|
21
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
42
22
|
|
|
43
|
-
var
|
|
23
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
44
24
|
|
|
45
|
-
var
|
|
25
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
|
46
26
|
|
|
47
|
-
var
|
|
27
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
48
28
|
|
|
49
|
-
var
|
|
29
|
+
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
50
30
|
|
|
51
|
-
var
|
|
31
|
+
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
52
32
|
|
|
53
|
-
var
|
|
33
|
+
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
54
34
|
|
|
55
|
-
var
|
|
35
|
+
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
|
|
56
36
|
|
|
57
37
|
var _map2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
58
38
|
|
|
59
|
-
var
|
|
39
|
+
var _filter2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
60
40
|
|
|
61
|
-
var
|
|
41
|
+
var _keys2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/keys"));
|
|
62
42
|
|
|
63
|
-
var
|
|
43
|
+
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
64
44
|
|
|
65
|
-
var
|
|
45
|
+
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
66
46
|
|
|
67
|
-
var
|
|
47
|
+
var _sort = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/sort"));
|
|
68
48
|
|
|
69
|
-
var
|
|
49
|
+
var _splice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/splice"));
|
|
70
50
|
|
|
71
|
-
var
|
|
51
|
+
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
72
52
|
|
|
73
|
-
var
|
|
53
|
+
var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
|
|
54
|
+
|
|
55
|
+
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
56
|
+
|
|
57
|
+
var _entries = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/entries"));
|
|
74
58
|
|
|
75
59
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
76
60
|
|
|
@@ -87,364 +71,10 @@ var _ParseObject = _interopRequireDefault(require("./ParseObject"));
|
|
|
87
71
|
var _OfflineQuery = _interopRequireDefault(require("./OfflineQuery"));
|
|
88
72
|
|
|
89
73
|
var _LocalDatastoreUtils = require("./LocalDatastoreUtils");
|
|
74
|
+
/*
|
|
75
|
+
* @flow
|
|
76
|
+
*/
|
|
90
77
|
|
|
91
|
-
function _regeneratorRuntime() {
|
|
92
|
-
"use strict";
|
|
93
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
94
|
-
|
|
95
|
-
_regeneratorRuntime = function () {
|
|
96
|
-
return exports;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
var exports = {},
|
|
100
|
-
Op = Object.prototype,
|
|
101
|
-
hasOwn = Op.hasOwnProperty,
|
|
102
|
-
$Symbol = "function" == typeof _Symbol ? _Symbol : {},
|
|
103
|
-
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
104
|
-
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
105
|
-
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
106
|
-
|
|
107
|
-
function define(obj, key, value) {
|
|
108
|
-
return _Object$defineProperty(obj, key, {
|
|
109
|
-
value: value,
|
|
110
|
-
enumerable: !0,
|
|
111
|
-
configurable: !0,
|
|
112
|
-
writable: !0
|
|
113
|
-
}), obj[key];
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
try {
|
|
117
|
-
define({}, "");
|
|
118
|
-
} catch (err) {
|
|
119
|
-
define = function (obj, key, value) {
|
|
120
|
-
return obj[key] = value;
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
125
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
126
|
-
generator = _Object$create(protoGenerator.prototype),
|
|
127
|
-
context = new Context(tryLocsList || []);
|
|
128
|
-
|
|
129
|
-
return generator._invoke = function (innerFn, self, context) {
|
|
130
|
-
var state = "suspendedStart";
|
|
131
|
-
return function (method, arg) {
|
|
132
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
133
|
-
|
|
134
|
-
if ("completed" === state) {
|
|
135
|
-
if ("throw" === method) throw arg;
|
|
136
|
-
return doneResult();
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
for (context.method = method, context.arg = arg;;) {
|
|
140
|
-
var delegate = context.delegate;
|
|
141
|
-
|
|
142
|
-
if (delegate) {
|
|
143
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
144
|
-
|
|
145
|
-
if (delegateResult) {
|
|
146
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
147
|
-
return delegateResult;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
152
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
153
|
-
context.dispatchException(context.arg);
|
|
154
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
155
|
-
state = "executing";
|
|
156
|
-
var record = tryCatch(innerFn, self, context);
|
|
157
|
-
|
|
158
|
-
if ("normal" === record.type) {
|
|
159
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
160
|
-
return {
|
|
161
|
-
value: record.arg,
|
|
162
|
-
done: context.done
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
}(innerFn, self, context), generator;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
function tryCatch(fn, obj, arg) {
|
|
173
|
-
try {
|
|
174
|
-
return {
|
|
175
|
-
type: "normal",
|
|
176
|
-
arg: fn.call(obj, arg)
|
|
177
|
-
};
|
|
178
|
-
} catch (err) {
|
|
179
|
-
return {
|
|
180
|
-
type: "throw",
|
|
181
|
-
arg: err
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
exports.wrap = wrap;
|
|
187
|
-
var ContinueSentinel = {};
|
|
188
|
-
|
|
189
|
-
function Generator() {}
|
|
190
|
-
|
|
191
|
-
function GeneratorFunction() {}
|
|
192
|
-
|
|
193
|
-
function GeneratorFunctionPrototype() {}
|
|
194
|
-
|
|
195
|
-
var IteratorPrototype = {};
|
|
196
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
197
|
-
return this;
|
|
198
|
-
});
|
|
199
|
-
var getProto = _Object$getPrototypeOf,
|
|
200
|
-
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
201
|
-
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
202
|
-
|
|
203
|
-
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype);
|
|
204
|
-
|
|
205
|
-
function defineIteratorMethods(prototype) {
|
|
206
|
-
var _context23;
|
|
207
|
-
|
|
208
|
-
_forEachInstanceProperty2(_context23 = ["next", "throw", "return"]).call(_context23, function (method) {
|
|
209
|
-
define(prototype, method, function (arg) {
|
|
210
|
-
return this._invoke(method, arg);
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
216
|
-
function invoke(method, arg, resolve, reject) {
|
|
217
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
218
|
-
|
|
219
|
-
if ("throw" !== record.type) {
|
|
220
|
-
var result = record.arg,
|
|
221
|
-
value = result.value;
|
|
222
|
-
return value && "object" == _typeof3(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
223
|
-
invoke("next", value, resolve, reject);
|
|
224
|
-
}, function (err) {
|
|
225
|
-
invoke("throw", err, resolve, reject);
|
|
226
|
-
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
227
|
-
result.value = unwrapped, resolve(result);
|
|
228
|
-
}, function (error) {
|
|
229
|
-
return invoke("throw", error, resolve, reject);
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
reject(record.arg);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
var previousPromise;
|
|
237
|
-
|
|
238
|
-
this._invoke = function (method, arg) {
|
|
239
|
-
function callInvokeWithMethodAndArg() {
|
|
240
|
-
return new PromiseImpl(function (resolve, reject) {
|
|
241
|
-
invoke(method, arg, resolve, reject);
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
250
|
-
var method = delegate.iterator[context.method];
|
|
251
|
-
|
|
252
|
-
if (undefined === method) {
|
|
253
|
-
if (context.delegate = null, "throw" === context.method) {
|
|
254
|
-
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
255
|
-
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
return ContinueSentinel;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
262
|
-
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
263
|
-
var info = record.arg;
|
|
264
|
-
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
function pushTryEntry(locs) {
|
|
268
|
-
var entry = {
|
|
269
|
-
tryLoc: locs[0]
|
|
270
|
-
};
|
|
271
|
-
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
function resetTryEntry(entry) {
|
|
275
|
-
var record = entry.completion || {};
|
|
276
|
-
record.type = "normal", delete record.arg, entry.completion = record;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
function Context(tryLocsList) {
|
|
280
|
-
this.tryEntries = [{
|
|
281
|
-
tryLoc: "root"
|
|
282
|
-
}], _forEachInstanceProperty2(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
function values(iterable) {
|
|
286
|
-
if (iterable) {
|
|
287
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
288
|
-
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
289
|
-
if ("function" == typeof iterable.next) return iterable;
|
|
290
|
-
|
|
291
|
-
if (!isNaN(iterable.length)) {
|
|
292
|
-
var i = -1,
|
|
293
|
-
next = function next() {
|
|
294
|
-
for (; ++i < iterable.length;) {
|
|
295
|
-
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
return next.value = undefined, next.done = !0, next;
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
return next.next = next;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return {
|
|
306
|
-
next: doneResult
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
function doneResult() {
|
|
311
|
-
return {
|
|
312
|
-
value: undefined,
|
|
313
|
-
done: !0
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
318
|
-
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
319
|
-
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
320
|
-
}, exports.mark = function (genFun) {
|
|
321
|
-
return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun;
|
|
322
|
-
}, exports.awrap = function (arg) {
|
|
323
|
-
return {
|
|
324
|
-
__await: arg
|
|
325
|
-
};
|
|
326
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
327
|
-
return this;
|
|
328
|
-
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
329
|
-
void 0 === PromiseImpl && (PromiseImpl = _Promise2);
|
|
330
|
-
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
331
|
-
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
332
|
-
return result.done ? result.value : iter.next();
|
|
333
|
-
});
|
|
334
|
-
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
335
|
-
return this;
|
|
336
|
-
}), define(Gp, "toString", function () {
|
|
337
|
-
return "[object Generator]";
|
|
338
|
-
}), exports.keys = function (object) {
|
|
339
|
-
var keys = [];
|
|
340
|
-
|
|
341
|
-
for (var key in object) {
|
|
342
|
-
keys.push(key);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
return _reverseInstanceProperty(keys).call(keys), function next() {
|
|
346
|
-
for (; keys.length;) {
|
|
347
|
-
var key = keys.pop();
|
|
348
|
-
if (key in object) return next.value = key, next.done = !1, next;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
return next.done = !0, next;
|
|
352
|
-
};
|
|
353
|
-
}, exports.values = values, Context.prototype = {
|
|
354
|
-
constructor: Context,
|
|
355
|
-
reset: function (skipTempReset) {
|
|
356
|
-
var _context24;
|
|
357
|
-
|
|
358
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty2(_context24 = this.tryEntries).call(_context24, resetTryEntry), !skipTempReset) for (var name in this) {
|
|
359
|
-
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty2(name).call(name, 1)) && (this[name] = undefined);
|
|
360
|
-
}
|
|
361
|
-
},
|
|
362
|
-
stop: function () {
|
|
363
|
-
this.done = !0;
|
|
364
|
-
var rootRecord = this.tryEntries[0].completion;
|
|
365
|
-
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
366
|
-
return this.rval;
|
|
367
|
-
},
|
|
368
|
-
dispatchException: function (exception) {
|
|
369
|
-
if (this.done) throw exception;
|
|
370
|
-
var context = this;
|
|
371
|
-
|
|
372
|
-
function handle(loc, caught) {
|
|
373
|
-
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
377
|
-
var entry = this.tryEntries[i],
|
|
378
|
-
record = entry.completion;
|
|
379
|
-
if ("root" === entry.tryLoc) return handle("end");
|
|
380
|
-
|
|
381
|
-
if (entry.tryLoc <= this.prev) {
|
|
382
|
-
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
383
|
-
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
384
|
-
|
|
385
|
-
if (hasCatch && hasFinally) {
|
|
386
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
387
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
388
|
-
} else if (hasCatch) {
|
|
389
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
390
|
-
} else {
|
|
391
|
-
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
392
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
},
|
|
397
|
-
abrupt: function (type, arg) {
|
|
398
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
399
|
-
var entry = this.tryEntries[i];
|
|
400
|
-
|
|
401
|
-
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
402
|
-
var finallyEntry = entry;
|
|
403
|
-
break;
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
408
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
409
|
-
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
410
|
-
},
|
|
411
|
-
complete: function (record, afterLoc) {
|
|
412
|
-
if ("throw" === record.type) throw record.arg;
|
|
413
|
-
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
414
|
-
},
|
|
415
|
-
finish: function (finallyLoc) {
|
|
416
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
417
|
-
var entry = this.tryEntries[i];
|
|
418
|
-
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
419
|
-
}
|
|
420
|
-
},
|
|
421
|
-
catch: function (tryLoc) {
|
|
422
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
423
|
-
var entry = this.tryEntries[i];
|
|
424
|
-
|
|
425
|
-
if (entry.tryLoc === tryLoc) {
|
|
426
|
-
var record = entry.completion;
|
|
427
|
-
|
|
428
|
-
if ("throw" === record.type) {
|
|
429
|
-
var thrown = record.arg;
|
|
430
|
-
resetTryEntry(entry);
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
return thrown;
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
throw new Error("illegal catch attempt");
|
|
438
|
-
},
|
|
439
|
-
delegateYield: function (iterable, resultName, nextLoc) {
|
|
440
|
-
return this.delegate = {
|
|
441
|
-
iterator: values(iterable),
|
|
442
|
-
resultName: resultName,
|
|
443
|
-
nextLoc: nextLoc
|
|
444
|
-
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
445
|
-
}
|
|
446
|
-
}, exports;
|
|
447
|
-
}
|
|
448
78
|
/**
|
|
449
79
|
* Converts a string into a regex that matches it.
|
|
450
80
|
* Surrounding with \Q .. \E does this, we just need to escape any \E's in
|
|
@@ -537,7 +167,7 @@ function handleSelectResult(data
|
|
|
537
167
|
}
|
|
538
168
|
});
|
|
539
169
|
|
|
540
|
-
if ((0,
|
|
170
|
+
if ((0, _keys.default)(serverDataMask).length > 0) {
|
|
541
171
|
// When selecting from sub-objects, we don't want to blow away the missing
|
|
542
172
|
// information that we may have retrieved before. We've already added any
|
|
543
173
|
// missing selected keys to sub-objects, but we still need to add in the
|
|
@@ -554,17 +184,17 @@ function handleSelectResult(data
|
|
|
554
184
|
function copyMissingDataWithMask(src, dest, mask, copyThisLevel) {
|
|
555
185
|
//copy missing elements at this level
|
|
556
186
|
if (copyThisLevel) {
|
|
557
|
-
for (var
|
|
558
|
-
if (src.hasOwnProperty(
|
|
559
|
-
dest[
|
|
187
|
+
for (var _key2 in src) {
|
|
188
|
+
if (src.hasOwnProperty(_key2) && !dest.hasOwnProperty(_key2)) {
|
|
189
|
+
dest[_key2] = src[_key2];
|
|
560
190
|
}
|
|
561
191
|
}
|
|
562
192
|
}
|
|
563
193
|
|
|
564
|
-
for (var
|
|
565
|
-
if (dest[
|
|
194
|
+
for (var _key4 in mask) {
|
|
195
|
+
if (dest[_key4] !== undefined && dest[_key4] !== null && src !== undefined && src !== null) {
|
|
566
196
|
//traverse into objects as needed
|
|
567
|
-
copyMissingDataWithMask(src[
|
|
197
|
+
copyMissingDataWithMask(src[_key4], dest[_key4], mask[_key4], true);
|
|
568
198
|
}
|
|
569
199
|
}
|
|
570
200
|
}
|
|
@@ -829,104 +459,102 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
829
459
|
}, {
|
|
830
460
|
key: "_handleOfflineQuery",
|
|
831
461
|
value: function () {
|
|
832
|
-
var _handleOfflineQuery2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
462
|
+
var _handleOfflineQuery2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(params
|
|
833
463
|
/*: any*/
|
|
834
464
|
) {
|
|
835
465
|
var _context,
|
|
836
466
|
_this2 = this;
|
|
837
467
|
|
|
838
468
|
var localDatastore, objects, results, keys, alwaysSelectedKeys, sorts, count, limit;
|
|
839
|
-
return
|
|
840
|
-
while (1) {
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
}
|
|
469
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
470
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
471
|
+
case 0:
|
|
472
|
+
_OfflineQuery.default.validateQuery(this);
|
|
473
|
+
|
|
474
|
+
localDatastore = _CoreManager.default.getLocalDatastore();
|
|
475
|
+
_context3.next = 4;
|
|
476
|
+
return localDatastore._serializeObjectsFromPinName(this._localDatastorePinName);
|
|
477
|
+
|
|
478
|
+
case 4:
|
|
479
|
+
objects = _context3.sent;
|
|
480
|
+
results = (0, _filter2.default)(_context = (0, _map2.default)(objects).call(objects, function (json, index, arr) {
|
|
481
|
+
var object = _ParseObject.default.fromJSON(json, false);
|
|
482
|
+
|
|
483
|
+
if (json._localId && !json.objectId) {
|
|
484
|
+
object._localId = json._localId;
|
|
485
|
+
}
|
|
857
486
|
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
487
|
+
if (!_OfflineQuery.default.matchesQuery(_this2.className, object, arr, _this2)) {
|
|
488
|
+
return null;
|
|
489
|
+
}
|
|
861
490
|
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
491
|
+
return object;
|
|
492
|
+
})).call(_context, function (object) {
|
|
493
|
+
return object !== null;
|
|
494
|
+
});
|
|
866
495
|
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
(0, _forEach.default)(_context2 = (0, _keys2.default)(json)).call(_context2, function (key) {
|
|
877
|
-
if (!(0, _includes.default)(keys).call(keys, key)) {
|
|
878
|
-
delete json[key];
|
|
879
|
-
}
|
|
880
|
-
});
|
|
881
|
-
return _ParseObject.default.fromJSON(json, false);
|
|
882
|
-
});
|
|
883
|
-
}
|
|
496
|
+
if ((0, _keys2.default)(params)) {
|
|
497
|
+
keys = (0, _keys2.default)(params).split(',');
|
|
498
|
+
alwaysSelectedKeys = ['className', 'objectId', 'createdAt', 'updatedAt', 'ACL'];
|
|
499
|
+
keys = (0, _concat.default)(keys).call(keys, alwaysSelectedKeys);
|
|
500
|
+
results = (0, _map2.default)(results).call(results, function (object) {
|
|
501
|
+
var _context2;
|
|
502
|
+
|
|
503
|
+
var json = object._toFullJSON();
|
|
884
504
|
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
505
|
+
(0, _forEach.default)(_context2 = (0, _keys.default)(json)).call(_context2, function (key) {
|
|
506
|
+
if (!(0, _includes.default)(keys).call(keys, key)) {
|
|
507
|
+
delete json[key];
|
|
508
|
+
}
|
|
889
509
|
});
|
|
890
|
-
|
|
510
|
+
return _ParseObject.default.fromJSON(json, false);
|
|
511
|
+
});
|
|
512
|
+
}
|
|
891
513
|
|
|
514
|
+
if (params.order) {
|
|
515
|
+
sorts = params.order.split(',');
|
|
516
|
+
(0, _sort.default)(results).call(results, function (a, b) {
|
|
517
|
+
return handleOfflineSort(a, b, sorts);
|
|
518
|
+
});
|
|
519
|
+
} // count total before applying limit/skip
|
|
892
520
|
|
|
893
|
-
if (params.count) {
|
|
894
|
-
count = results.length; // total count from response
|
|
895
|
-
}
|
|
896
521
|
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
522
|
+
if (params.count) {
|
|
523
|
+
count = results.length; // total count from response
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
if (params.skip) {
|
|
527
|
+
if (params.skip >= results.length) {
|
|
528
|
+
results = [];
|
|
529
|
+
} else {
|
|
530
|
+
results = (0, _splice.default)(results).call(results, params.skip, results.length);
|
|
903
531
|
}
|
|
532
|
+
}
|
|
904
533
|
|
|
905
|
-
|
|
534
|
+
limit = results.length;
|
|
906
535
|
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
536
|
+
if (params.limit !== 0 && params.limit < results.length) {
|
|
537
|
+
limit = params.limit;
|
|
538
|
+
}
|
|
910
539
|
|
|
911
|
-
|
|
540
|
+
results = (0, _splice.default)(results).call(results, 0, limit);
|
|
912
541
|
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
542
|
+
if (!(typeof count === 'number')) {
|
|
543
|
+
_context3.next = 15;
|
|
544
|
+
break;
|
|
545
|
+
}
|
|
917
546
|
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
547
|
+
return _context3.abrupt("return", {
|
|
548
|
+
results: results,
|
|
549
|
+
count: count
|
|
550
|
+
});
|
|
922
551
|
|
|
923
|
-
|
|
924
|
-
|
|
552
|
+
case 15:
|
|
553
|
+
return _context3.abrupt("return", results);
|
|
925
554
|
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
}
|
|
555
|
+
case 16:
|
|
556
|
+
case "end":
|
|
557
|
+
return _context3.stop();
|
|
930
558
|
}
|
|
931
559
|
}, _callee, this);
|
|
932
560
|
}));
|
|
@@ -1002,8 +630,8 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1002
630
|
params.explain = true;
|
|
1003
631
|
}
|
|
1004
632
|
|
|
1005
|
-
for (var
|
|
1006
|
-
params[
|
|
633
|
+
for (var _key6 in this._extraOptions) {
|
|
634
|
+
params[_key6] = this._extraOptions[_key6];
|
|
1007
635
|
}
|
|
1008
636
|
|
|
1009
637
|
return params;
|
|
@@ -1045,8 +673,8 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1045
673
|
this._include = json.include.split(',');
|
|
1046
674
|
}
|
|
1047
675
|
|
|
1048
|
-
if ((0,
|
|
1049
|
-
this._select = (0,
|
|
676
|
+
if ((0, _keys2.default)(json)) {
|
|
677
|
+
this._select = (0, _keys2.default)(json).split(',');
|
|
1050
678
|
}
|
|
1051
679
|
|
|
1052
680
|
if (json.excludeKeys) {
|
|
@@ -1089,12 +717,12 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1089
717
|
this._explain = !!json.explain;
|
|
1090
718
|
}
|
|
1091
719
|
|
|
1092
|
-
for (var
|
|
1093
|
-
if (json.hasOwnProperty(
|
|
720
|
+
for (var _key8 in json) {
|
|
721
|
+
if (json.hasOwnProperty(_key8)) {
|
|
1094
722
|
var _context4;
|
|
1095
723
|
|
|
1096
|
-
if ((0, _indexOf.default)(_context4 = ['where', 'include', 'keys', 'count', 'limit', 'skip', 'order', 'readPreference', 'includeReadPreference', 'subqueryReadPreference', 'hint', 'explain']).call(_context4,
|
|
1097
|
-
this._extraOptions[
|
|
724
|
+
if ((0, _indexOf.default)(_context4 = ['where', 'include', 'keys', 'count', 'limit', 'skip', 'order', 'readPreference', 'includeReadPreference', 'subqueryReadPreference', 'hint', 'explain']).call(_context4, _key8) === -1) {
|
|
725
|
+
this._extraOptions[_key8] = json[_key8];
|
|
1098
726
|
}
|
|
1099
727
|
}
|
|
1100
728
|
}
|
|
@@ -1127,7 +755,6 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1127
755
|
* <li>context: A dictionary that is accessible in Cloud Code `beforeFind` trigger.
|
|
1128
756
|
* <li>json: Return raw json without converting to Parse.Object
|
|
1129
757
|
* </ul>
|
|
1130
|
-
*
|
|
1131
758
|
* @returns {Promise} A promise that is resolved with the result when
|
|
1132
759
|
* the query completes.
|
|
1133
760
|
*/
|
|
@@ -1178,7 +805,6 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1178
805
|
* <li>context: A dictionary that is accessible in Cloud Code `beforeFind` trigger.
|
|
1179
806
|
* <li>json: Return raw json without converting to Parse.Object
|
|
1180
807
|
* </ul>
|
|
1181
|
-
*
|
|
1182
808
|
* @returns {Promise} A promise that is resolved with the results when
|
|
1183
809
|
* the query completes.
|
|
1184
810
|
*/
|
|
@@ -1277,38 +903,36 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1277
903
|
}, {
|
|
1278
904
|
key: "findAll",
|
|
1279
905
|
value: function () {
|
|
1280
|
-
var _findAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
906
|
+
var _findAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(options
|
|
1281
907
|
/*:: ?: BatchOptions*/
|
|
1282
908
|
) {
|
|
1283
909
|
var result;
|
|
1284
|
-
return
|
|
1285
|
-
while (1) {
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
return _context7.stop();
|
|
1306
|
-
}
|
|
910
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
911
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
912
|
+
case 0:
|
|
913
|
+
result
|
|
914
|
+
/*: ParseObject[]*/
|
|
915
|
+
= [];
|
|
916
|
+
_context7.next = 3;
|
|
917
|
+
return this.eachBatch(function (objects
|
|
918
|
+
/*: ParseObject[]*/
|
|
919
|
+
) {
|
|
920
|
+
var _context6;
|
|
921
|
+
|
|
922
|
+
result = (0, _concat.default)(_context6 = []).call(_context6, (0, _toConsumableArray2.default)(result), (0, _toConsumableArray2.default)(objects));
|
|
923
|
+
}, options);
|
|
924
|
+
|
|
925
|
+
case 3:
|
|
926
|
+
return _context7.abrupt("return", result);
|
|
927
|
+
|
|
928
|
+
case 4:
|
|
929
|
+
case "end":
|
|
930
|
+
return _context7.stop();
|
|
1307
931
|
}
|
|
1308
932
|
}, _callee2, this);
|
|
1309
933
|
}));
|
|
1310
934
|
|
|
1311
|
-
function findAll(
|
|
935
|
+
function findAll() {
|
|
1312
936
|
return _findAll.apply(this, arguments);
|
|
1313
937
|
}
|
|
1314
938
|
|
|
@@ -1324,14 +948,13 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1324
948
|
* <li>sessionToken: A valid session token, used for making a request on
|
|
1325
949
|
* behalf of a specific user.
|
|
1326
950
|
* </ul>
|
|
1327
|
-
*
|
|
1328
951
|
* @returns {Promise} A promise that is resolved with the count when
|
|
1329
952
|
* the query completes.
|
|
1330
953
|
*/
|
|
1331
954
|
|
|
1332
955
|
}, {
|
|
1333
956
|
key: "count",
|
|
1334
|
-
value: function
|
|
957
|
+
value: function (options
|
|
1335
958
|
/*:: ?: FullOptions*/
|
|
1336
959
|
)
|
|
1337
960
|
/*: Promise<number>*/
|
|
@@ -1367,13 +990,12 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1367
990
|
* <li>sessionToken: A valid session token, used for making a request on
|
|
1368
991
|
* behalf of a specific user.
|
|
1369
992
|
* </ul>
|
|
1370
|
-
*
|
|
1371
993
|
* @returns {Promise} A promise that is resolved with the query completes.
|
|
1372
994
|
*/
|
|
1373
995
|
|
|
1374
996
|
}, {
|
|
1375
997
|
key: "distinct",
|
|
1376
|
-
value: function
|
|
998
|
+
value: function (key
|
|
1377
999
|
/*: string*/
|
|
1378
1000
|
, options
|
|
1379
1001
|
/*:: ?: FullOptions*/
|
|
@@ -1409,13 +1031,12 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1409
1031
|
* <li>sessionToken: A valid session token, used for making a request on
|
|
1410
1032
|
* behalf of a specific user.
|
|
1411
1033
|
* </ul>
|
|
1412
|
-
*
|
|
1413
1034
|
* @returns {Promise} A promise that is resolved with the query completes.
|
|
1414
1035
|
*/
|
|
1415
1036
|
|
|
1416
1037
|
}, {
|
|
1417
1038
|
key: "aggregate",
|
|
1418
|
-
value: function
|
|
1039
|
+
value: function (pipeline
|
|
1419
1040
|
/*: mixed*/
|
|
1420
1041
|
, options
|
|
1421
1042
|
/*:: ?: FullOptions*/
|
|
@@ -1438,7 +1059,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1438
1059
|
throw new Error('Invalid pipeline must be Array or Object');
|
|
1439
1060
|
}
|
|
1440
1061
|
|
|
1441
|
-
if ((0,
|
|
1062
|
+
if ((0, _keys.default)(this._where || {}).length) {
|
|
1442
1063
|
if (!(0, _isArray.default)(pipeline)) {
|
|
1443
1064
|
pipeline = [pipeline];
|
|
1444
1065
|
}
|
|
@@ -1471,14 +1092,13 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1471
1092
|
* <li>context: A dictionary that is accessible in Cloud Code `beforeFind` trigger.
|
|
1472
1093
|
* <li>json: Return raw json without converting to Parse.Object
|
|
1473
1094
|
* </ul>
|
|
1474
|
-
*
|
|
1475
1095
|
* @returns {Promise} A promise that is resolved with the object when
|
|
1476
1096
|
* the query completes.
|
|
1477
1097
|
*/
|
|
1478
1098
|
|
|
1479
1099
|
}, {
|
|
1480
1100
|
key: "first",
|
|
1481
|
-
value: function
|
|
1101
|
+
value: function (options
|
|
1482
1102
|
/*:: ?: FullOptions*/
|
|
1483
1103
|
)
|
|
1484
1104
|
/*: Promise<ParseObject | void>*/
|
|
@@ -1567,7 +1187,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1567
1187
|
|
|
1568
1188
|
}, {
|
|
1569
1189
|
key: "eachBatch",
|
|
1570
|
-
value: function
|
|
1190
|
+
value: function (callback
|
|
1571
1191
|
/*: (objs: Array<ParseObject>) => Promise<*>*/
|
|
1572
1192
|
, options
|
|
1573
1193
|
/*:: ?: BatchOptions*/
|
|
@@ -1579,8 +1199,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1579
1199
|
options = options || {};
|
|
1580
1200
|
|
|
1581
1201
|
if (this._order || this._skip || this._limit >= 0) {
|
|
1582
|
-
|
|
1583
|
-
return _promise.default.reject(error);
|
|
1202
|
+
return _promise.default.reject('Cannot iterate on a query with sort, skip, or limit.');
|
|
1584
1203
|
}
|
|
1585
1204
|
|
|
1586
1205
|
var query = new ParseQuery(this.className);
|
|
@@ -1600,22 +1219,22 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1600
1219
|
query._hint = this._hint;
|
|
1601
1220
|
query._where = {};
|
|
1602
1221
|
|
|
1603
|
-
for (var
|
|
1604
|
-
var val = this._where[
|
|
1222
|
+
for (var _attr2 in this._where) {
|
|
1223
|
+
var val = this._where[_attr2];
|
|
1605
1224
|
|
|
1606
1225
|
if ((0, _isArray.default)(val)) {
|
|
1607
|
-
query._where[
|
|
1226
|
+
query._where[_attr2] = (0, _map2.default)(val).call(val, function (v) {
|
|
1608
1227
|
return v;
|
|
1609
1228
|
});
|
|
1610
1229
|
} else if (val && (0, _typeof2.default)(val) === 'object') {
|
|
1611
1230
|
var conditionMap = {};
|
|
1612
|
-
query._where[
|
|
1231
|
+
query._where[_attr2] = conditionMap;
|
|
1613
1232
|
|
|
1614
1233
|
for (var cond in val) {
|
|
1615
1234
|
conditionMap[cond] = val[cond];
|
|
1616
1235
|
}
|
|
1617
1236
|
} else {
|
|
1618
|
-
query._where[
|
|
1237
|
+
query._where[_attr2] = val;
|
|
1619
1238
|
}
|
|
1620
1239
|
}
|
|
1621
1240
|
|
|
@@ -1642,52 +1261,50 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1642
1261
|
var previousResults = [];
|
|
1643
1262
|
return (0, _promiseUtils.continueWhile)(function () {
|
|
1644
1263
|
return !finished;
|
|
1645
|
-
}, /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
1264
|
+
}, /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
1646
1265
|
var _yield$Promise$all, _yield$Promise$all2, results;
|
|
1647
1266
|
|
|
1648
|
-
return
|
|
1649
|
-
while (1) {
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
return _promise.default.all([(0, _find.default)(query).call(query, findOptions), _promise.default.resolve(previousResults.length > 0 && callback(previousResults))]);
|
|
1654
|
-
|
|
1655
|
-
case 2:
|
|
1656
|
-
_yield$Promise$all = _context10.sent;
|
|
1657
|
-
_yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 1);
|
|
1658
|
-
results = _yield$Promise$all2[0];
|
|
1659
|
-
|
|
1660
|
-
if (!(results.length >= query._limit)) {
|
|
1661
|
-
_context10.next = 10;
|
|
1662
|
-
break;
|
|
1663
|
-
}
|
|
1267
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
1268
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1269
|
+
case 0:
|
|
1270
|
+
_context10.next = 2;
|
|
1271
|
+
return _promise.default.all([(0, _find.default)(query).call(query, findOptions), _promise.default.resolve(previousResults.length > 0 && callback(previousResults))]);
|
|
1664
1272
|
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1273
|
+
case 2:
|
|
1274
|
+
_yield$Promise$all = _context10.sent;
|
|
1275
|
+
_yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 1);
|
|
1276
|
+
results = _yield$Promise$all2[0];
|
|
1669
1277
|
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
}
|
|
1278
|
+
if (!(results.length >= query._limit)) {
|
|
1279
|
+
_context10.next = 10;
|
|
1280
|
+
break;
|
|
1281
|
+
}
|
|
1675
1282
|
|
|
1676
|
-
|
|
1677
|
-
|
|
1283
|
+
query.greaterThan('objectId', results[results.length - 1].id);
|
|
1284
|
+
previousResults = results;
|
|
1285
|
+
_context10.next = 17;
|
|
1286
|
+
break;
|
|
1678
1287
|
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
_context10.next =
|
|
1288
|
+
case 10:
|
|
1289
|
+
if (!(results.length > 0)) {
|
|
1290
|
+
_context10.next = 16;
|
|
1682
1291
|
break;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
_context10.next = 13;
|
|
1295
|
+
return _promise.default.resolve(callback(results));
|
|
1683
1296
|
|
|
1684
|
-
|
|
1685
|
-
|
|
1297
|
+
case 13:
|
|
1298
|
+
finished = true;
|
|
1299
|
+
_context10.next = 17;
|
|
1300
|
+
break;
|
|
1686
1301
|
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1302
|
+
case 16:
|
|
1303
|
+
finished = true;
|
|
1304
|
+
|
|
1305
|
+
case 17:
|
|
1306
|
+
case "end":
|
|
1307
|
+
return _context10.stop();
|
|
1691
1308
|
}
|
|
1692
1309
|
}, _callee3);
|
|
1693
1310
|
})));
|
|
@@ -1715,7 +1332,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1715
1332
|
|
|
1716
1333
|
}, {
|
|
1717
1334
|
key: "each",
|
|
1718
|
-
value: function
|
|
1335
|
+
value: function (callback
|
|
1719
1336
|
/*: (obj: ParseObject) => any*/
|
|
1720
1337
|
, options
|
|
1721
1338
|
/*:: ?: BatchOptions*/
|
|
@@ -1742,7 +1359,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1742
1359
|
|
|
1743
1360
|
}, {
|
|
1744
1361
|
key: "hint",
|
|
1745
|
-
value: function
|
|
1362
|
+
value: function (value
|
|
1746
1363
|
/*: mixed*/
|
|
1747
1364
|
)
|
|
1748
1365
|
/*: ParseQuery*/
|
|
@@ -1763,7 +1380,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1763
1380
|
|
|
1764
1381
|
}, {
|
|
1765
1382
|
key: "explain",
|
|
1766
|
-
value: function
|
|
1383
|
+
value: function ()
|
|
1767
1384
|
/*: ParseQuery*/
|
|
1768
1385
|
{
|
|
1769
1386
|
var _explain
|
|
@@ -1790,7 +1407,6 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1790
1407
|
* <li>index: The index of the current Parse.Object being processed in the array.</li>
|
|
1791
1408
|
* <li>query: The query map was called upon.</li>
|
|
1792
1409
|
* </ul>
|
|
1793
|
-
*
|
|
1794
1410
|
* @param {object} options Valid options are:<ul>
|
|
1795
1411
|
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
|
|
1796
1412
|
* be used for this request.
|
|
@@ -1804,7 +1420,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1804
1420
|
}, {
|
|
1805
1421
|
key: "map",
|
|
1806
1422
|
value: function () {
|
|
1807
|
-
var _map = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
1423
|
+
var _map = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(callback
|
|
1808
1424
|
/*: (currentObject: ParseObject, index: number, query: ParseQuery) => any*/
|
|
1809
1425
|
, options
|
|
1810
1426
|
/*:: ?: BatchOptions*/
|
|
@@ -1812,32 +1428,30 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1812
1428
|
var _this5 = this;
|
|
1813
1429
|
|
|
1814
1430
|
var array, index;
|
|
1815
|
-
return
|
|
1816
|
-
while (1) {
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
return
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
}, options);
|
|
1431
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
1432
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1433
|
+
case 0:
|
|
1434
|
+
array = [];
|
|
1435
|
+
index = 0;
|
|
1436
|
+
_context11.next = 4;
|
|
1437
|
+
return this.each(function (object) {
|
|
1438
|
+
return _promise.default.resolve(callback(object, index, _this5)).then(function (result) {
|
|
1439
|
+
array.push(result);
|
|
1440
|
+
index += 1;
|
|
1441
|
+
});
|
|
1442
|
+
}, options);
|
|
1828
1443
|
|
|
1829
|
-
|
|
1830
|
-
|
|
1444
|
+
case 4:
|
|
1445
|
+
return _context11.abrupt("return", array);
|
|
1831
1446
|
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
}
|
|
1447
|
+
case 5:
|
|
1448
|
+
case "end":
|
|
1449
|
+
return _context11.stop();
|
|
1836
1450
|
}
|
|
1837
1451
|
}, _callee4, this);
|
|
1838
1452
|
}));
|
|
1839
1453
|
|
|
1840
|
-
function map(
|
|
1454
|
+
function map() {
|
|
1841
1455
|
return _map.apply(this, arguments);
|
|
1842
1456
|
}
|
|
1843
1457
|
|
|
@@ -1870,7 +1484,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1870
1484
|
}, {
|
|
1871
1485
|
key: "reduce",
|
|
1872
1486
|
value: function () {
|
|
1873
|
-
var _reduce = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
1487
|
+
var _reduce = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(callback
|
|
1874
1488
|
/*: (accumulator: any, currentObject: ParseObject, index: number) => any*/
|
|
1875
1489
|
, initialValue
|
|
1876
1490
|
/*: any*/
|
|
@@ -1878,48 +1492,46 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1878
1492
|
/*:: ?: BatchOptions*/
|
|
1879
1493
|
) {
|
|
1880
1494
|
var accumulator, index;
|
|
1881
|
-
return
|
|
1882
|
-
while (1) {
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
}
|
|
1495
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
1496
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
1497
|
+
case 0:
|
|
1498
|
+
accumulator = initialValue;
|
|
1499
|
+
index = 0;
|
|
1500
|
+
_context12.next = 4;
|
|
1501
|
+
return this.each(function (object) {
|
|
1502
|
+
// If no initial value was given, we take the first object from the query
|
|
1503
|
+
// as the initial value and don't call the callback with it.
|
|
1504
|
+
if (index === 0 && initialValue === undefined) {
|
|
1505
|
+
accumulator = object;
|
|
1506
|
+
index += 1;
|
|
1507
|
+
return;
|
|
1508
|
+
}
|
|
1896
1509
|
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1510
|
+
return _promise.default.resolve(callback(accumulator, object, index)).then(function (result) {
|
|
1511
|
+
accumulator = result;
|
|
1512
|
+
index += 1;
|
|
1513
|
+
});
|
|
1514
|
+
}, options);
|
|
1902
1515
|
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1516
|
+
case 4:
|
|
1517
|
+
if (!(index === 0 && initialValue === undefined)) {
|
|
1518
|
+
_context12.next = 6;
|
|
1519
|
+
break;
|
|
1520
|
+
}
|
|
1908
1521
|
|
|
1909
|
-
|
|
1522
|
+
throw new TypeError('Reducing empty query result set with no initial value');
|
|
1910
1523
|
|
|
1911
|
-
|
|
1912
|
-
|
|
1524
|
+
case 6:
|
|
1525
|
+
return _context12.abrupt("return", accumulator);
|
|
1913
1526
|
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
}
|
|
1527
|
+
case 7:
|
|
1528
|
+
case "end":
|
|
1529
|
+
return _context12.stop();
|
|
1918
1530
|
}
|
|
1919
1531
|
}, _callee5, this);
|
|
1920
1532
|
}));
|
|
1921
1533
|
|
|
1922
|
-
function reduce(
|
|
1534
|
+
function reduce() {
|
|
1923
1535
|
return _reduce.apply(this, arguments);
|
|
1924
1536
|
}
|
|
1925
1537
|
|
|
@@ -1938,7 +1550,6 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1938
1550
|
* <li>index: The index of the current Parse.Object being processed in the array.</li>
|
|
1939
1551
|
* <li>query: The query filter was called upon.</li>
|
|
1940
1552
|
* </ul>
|
|
1941
|
-
*
|
|
1942
1553
|
* @param {object} options Valid options are:<ul>
|
|
1943
1554
|
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
|
|
1944
1555
|
* be used for this request.
|
|
@@ -1952,7 +1563,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1952
1563
|
}, {
|
|
1953
1564
|
key: "filter",
|
|
1954
1565
|
value: function () {
|
|
1955
|
-
var _filter = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
1566
|
+
var _filter = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(callback
|
|
1956
1567
|
/*: (currentObject: ParseObject, index: number, query: ParseQuery) => boolean*/
|
|
1957
1568
|
, options
|
|
1958
1569
|
/*:: ?: BatchOptions*/
|
|
@@ -1960,41 +1571,39 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
1960
1571
|
var _this6 = this;
|
|
1961
1572
|
|
|
1962
1573
|
var array, index;
|
|
1963
|
-
return
|
|
1964
|
-
while (1) {
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
return
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
}
|
|
1574
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
1575
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
1576
|
+
case 0:
|
|
1577
|
+
array = [];
|
|
1578
|
+
index = 0;
|
|
1579
|
+
_context13.next = 4;
|
|
1580
|
+
return this.each(function (object) {
|
|
1581
|
+
return _promise.default.resolve(callback(object, index, _this6)).then(function (flag) {
|
|
1582
|
+
if (flag) {
|
|
1583
|
+
array.push(object);
|
|
1584
|
+
}
|
|
1975
1585
|
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1586
|
+
index += 1;
|
|
1587
|
+
});
|
|
1588
|
+
}, options);
|
|
1979
1589
|
|
|
1980
|
-
|
|
1981
|
-
|
|
1590
|
+
case 4:
|
|
1591
|
+
return _context13.abrupt("return", array);
|
|
1982
1592
|
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
}
|
|
1593
|
+
case 5:
|
|
1594
|
+
case "end":
|
|
1595
|
+
return _context13.stop();
|
|
1987
1596
|
}
|
|
1988
1597
|
}, _callee6, this);
|
|
1989
1598
|
}));
|
|
1990
1599
|
|
|
1991
|
-
function filter(
|
|
1600
|
+
function filter() {
|
|
1992
1601
|
return _filter.apply(this, arguments);
|
|
1993
1602
|
}
|
|
1994
1603
|
|
|
1995
1604
|
return filter;
|
|
1996
1605
|
}()
|
|
1997
|
-
|
|
1606
|
+
/* Query Conditions */
|
|
1998
1607
|
|
|
1999
1608
|
/**
|
|
2000
1609
|
* Adds a constraint to the query that requires a particular key's value to
|
|
@@ -2007,7 +1616,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2007
1616
|
|
|
2008
1617
|
}, {
|
|
2009
1618
|
key: "equalTo",
|
|
2010
|
-
value: function
|
|
1619
|
+
value: function (key
|
|
2011
1620
|
/*: string | { [key: string]: any }*/
|
|
2012
1621
|
, value
|
|
2013
1622
|
/*: ?mixed*/
|
|
@@ -2047,7 +1656,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2047
1656
|
|
|
2048
1657
|
}, {
|
|
2049
1658
|
key: "notEqualTo",
|
|
2050
|
-
value: function
|
|
1659
|
+
value: function (key
|
|
2051
1660
|
/*: string | { [key: string]: any }*/
|
|
2052
1661
|
, value
|
|
2053
1662
|
/*: ?mixed*/
|
|
@@ -2082,7 +1691,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2082
1691
|
|
|
2083
1692
|
}, {
|
|
2084
1693
|
key: "lessThan",
|
|
2085
|
-
value: function
|
|
1694
|
+
value: function (key
|
|
2086
1695
|
/*: string*/
|
|
2087
1696
|
, value
|
|
2088
1697
|
/*: mixed*/
|
|
@@ -2102,7 +1711,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2102
1711
|
|
|
2103
1712
|
}, {
|
|
2104
1713
|
key: "greaterThan",
|
|
2105
|
-
value: function
|
|
1714
|
+
value: function (key
|
|
2106
1715
|
/*: string*/
|
|
2107
1716
|
, value
|
|
2108
1717
|
/*: mixed*/
|
|
@@ -2122,7 +1731,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2122
1731
|
|
|
2123
1732
|
}, {
|
|
2124
1733
|
key: "lessThanOrEqualTo",
|
|
2125
|
-
value: function
|
|
1734
|
+
value: function (key
|
|
2126
1735
|
/*: string*/
|
|
2127
1736
|
, value
|
|
2128
1737
|
/*: mixed*/
|
|
@@ -2142,7 +1751,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2142
1751
|
|
|
2143
1752
|
}, {
|
|
2144
1753
|
key: "greaterThanOrEqualTo",
|
|
2145
|
-
value: function
|
|
1754
|
+
value: function (key
|
|
2146
1755
|
/*: string*/
|
|
2147
1756
|
, value
|
|
2148
1757
|
/*: mixed*/
|
|
@@ -2162,7 +1771,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2162
1771
|
|
|
2163
1772
|
}, {
|
|
2164
1773
|
key: "containedIn",
|
|
2165
|
-
value: function
|
|
1774
|
+
value: function (key
|
|
2166
1775
|
/*: string*/
|
|
2167
1776
|
, value
|
|
2168
1777
|
/*: mixed*/
|
|
@@ -2182,7 +1791,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2182
1791
|
|
|
2183
1792
|
}, {
|
|
2184
1793
|
key: "notContainedIn",
|
|
2185
|
-
value: function
|
|
1794
|
+
value: function (key
|
|
2186
1795
|
/*: string*/
|
|
2187
1796
|
, value
|
|
2188
1797
|
/*: mixed*/
|
|
@@ -2202,7 +1811,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2202
1811
|
|
|
2203
1812
|
}, {
|
|
2204
1813
|
key: "containedBy",
|
|
2205
|
-
value: function
|
|
1814
|
+
value: function (key
|
|
2206
1815
|
/*: string*/
|
|
2207
1816
|
, values
|
|
2208
1817
|
/*: Array<mixed>*/
|
|
@@ -2222,7 +1831,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2222
1831
|
|
|
2223
1832
|
}, {
|
|
2224
1833
|
key: "containsAll",
|
|
2225
|
-
value: function
|
|
1834
|
+
value: function (key
|
|
2226
1835
|
/*: string*/
|
|
2227
1836
|
, values
|
|
2228
1837
|
/*: Array<mixed>*/
|
|
@@ -2242,7 +1851,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2242
1851
|
|
|
2243
1852
|
}, {
|
|
2244
1853
|
key: "containsAllStartingWith",
|
|
2245
|
-
value: function
|
|
1854
|
+
value: function (key
|
|
2246
1855
|
/*: string*/
|
|
2247
1856
|
, values
|
|
2248
1857
|
/*: Array<string>*/
|
|
@@ -2271,7 +1880,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2271
1880
|
|
|
2272
1881
|
}, {
|
|
2273
1882
|
key: "exists",
|
|
2274
|
-
value: function
|
|
1883
|
+
value: function (key
|
|
2275
1884
|
/*: string*/
|
|
2276
1885
|
)
|
|
2277
1886
|
/*: ParseQuery*/
|
|
@@ -2287,7 +1896,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2287
1896
|
|
|
2288
1897
|
}, {
|
|
2289
1898
|
key: "doesNotExist",
|
|
2290
|
-
value: function
|
|
1899
|
+
value: function (key
|
|
2291
1900
|
/*: string*/
|
|
2292
1901
|
)
|
|
2293
1902
|
/*: ParseQuery*/
|
|
@@ -2307,7 +1916,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2307
1916
|
|
|
2308
1917
|
}, {
|
|
2309
1918
|
key: "matches",
|
|
2310
|
-
value: function
|
|
1919
|
+
value: function (key
|
|
2311
1920
|
/*: string*/
|
|
2312
1921
|
, regex
|
|
2313
1922
|
/*: RegExp*/
|
|
@@ -2348,7 +1957,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2348
1957
|
|
|
2349
1958
|
}, {
|
|
2350
1959
|
key: "matchesQuery",
|
|
2351
|
-
value: function
|
|
1960
|
+
value: function (key
|
|
2352
1961
|
/*: string*/
|
|
2353
1962
|
, query
|
|
2354
1963
|
/*: ParseQuery*/
|
|
@@ -2371,7 +1980,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2371
1980
|
|
|
2372
1981
|
}, {
|
|
2373
1982
|
key: "doesNotMatchQuery",
|
|
2374
|
-
value: function
|
|
1983
|
+
value: function (key
|
|
2375
1984
|
/*: string*/
|
|
2376
1985
|
, query
|
|
2377
1986
|
/*: ParseQuery*/
|
|
@@ -2396,7 +2005,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2396
2005
|
|
|
2397
2006
|
}, {
|
|
2398
2007
|
key: "matchesKeyInQuery",
|
|
2399
|
-
value: function
|
|
2008
|
+
value: function (key
|
|
2400
2009
|
/*: string*/
|
|
2401
2010
|
, queryKey
|
|
2402
2011
|
/*: string*/
|
|
@@ -2426,7 +2035,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2426
2035
|
|
|
2427
2036
|
}, {
|
|
2428
2037
|
key: "doesNotMatchKeyInQuery",
|
|
2429
|
-
value: function
|
|
2038
|
+
value: function (key
|
|
2430
2039
|
/*: string*/
|
|
2431
2040
|
, queryKey
|
|
2432
2041
|
/*: string*/
|
|
@@ -2453,7 +2062,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2453
2062
|
|
|
2454
2063
|
}, {
|
|
2455
2064
|
key: "contains",
|
|
2456
|
-
value: function
|
|
2065
|
+
value: function (key
|
|
2457
2066
|
/*: string*/
|
|
2458
2067
|
, substring
|
|
2459
2068
|
/*: string*/
|
|
@@ -2498,7 +2107,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2498
2107
|
|
|
2499
2108
|
}, {
|
|
2500
2109
|
key: "fullText",
|
|
2501
|
-
value: function
|
|
2110
|
+
value: function (key
|
|
2502
2111
|
/*: string*/
|
|
2503
2112
|
, value
|
|
2504
2113
|
/*: string*/
|
|
@@ -2555,7 +2164,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2555
2164
|
|
|
2556
2165
|
}, {
|
|
2557
2166
|
key: "sortByTextScore",
|
|
2558
|
-
value: function
|
|
2167
|
+
value: function () {
|
|
2559
2168
|
this.ascending('$score');
|
|
2560
2169
|
this.select(['$score']);
|
|
2561
2170
|
return this;
|
|
@@ -2573,7 +2182,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2573
2182
|
|
|
2574
2183
|
}, {
|
|
2575
2184
|
key: "startsWith",
|
|
2576
|
-
value: function
|
|
2185
|
+
value: function (key
|
|
2577
2186
|
/*: string*/
|
|
2578
2187
|
, prefix
|
|
2579
2188
|
/*: string*/
|
|
@@ -2600,7 +2209,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2600
2209
|
|
|
2601
2210
|
}, {
|
|
2602
2211
|
key: "endsWith",
|
|
2603
|
-
value: function
|
|
2212
|
+
value: function (key
|
|
2604
2213
|
/*: string*/
|
|
2605
2214
|
, suffix
|
|
2606
2215
|
/*: string*/
|
|
@@ -2626,7 +2235,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2626
2235
|
|
|
2627
2236
|
}, {
|
|
2628
2237
|
key: "near",
|
|
2629
|
-
value: function
|
|
2238
|
+
value: function (key
|
|
2630
2239
|
/*: string*/
|
|
2631
2240
|
, point
|
|
2632
2241
|
/*: ParseGeoPoint*/
|
|
@@ -2655,7 +2264,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2655
2264
|
|
|
2656
2265
|
}, {
|
|
2657
2266
|
key: "withinRadians",
|
|
2658
|
-
value: function
|
|
2267
|
+
value: function (key
|
|
2659
2268
|
/*: string*/
|
|
2660
2269
|
, point
|
|
2661
2270
|
/*: ParseGeoPoint*/
|
|
@@ -2691,7 +2300,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2691
2300
|
|
|
2692
2301
|
}, {
|
|
2693
2302
|
key: "withinMiles",
|
|
2694
|
-
value: function
|
|
2303
|
+
value: function (key
|
|
2695
2304
|
/*: string*/
|
|
2696
2305
|
, point
|
|
2697
2306
|
/*: ParseGeoPoint*/
|
|
@@ -2720,7 +2329,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2720
2329
|
|
|
2721
2330
|
}, {
|
|
2722
2331
|
key: "withinKilometers",
|
|
2723
|
-
value: function
|
|
2332
|
+
value: function (key
|
|
2724
2333
|
/*: string*/
|
|
2725
2334
|
, point
|
|
2726
2335
|
/*: ParseGeoPoint*/
|
|
@@ -2748,7 +2357,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2748
2357
|
|
|
2749
2358
|
}, {
|
|
2750
2359
|
key: "withinGeoBox",
|
|
2751
|
-
value: function
|
|
2360
|
+
value: function (key
|
|
2752
2361
|
/*: string*/
|
|
2753
2362
|
, southwest
|
|
2754
2363
|
/*: ParseGeoPoint*/
|
|
@@ -2785,7 +2394,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2785
2394
|
|
|
2786
2395
|
}, {
|
|
2787
2396
|
key: "withinPolygon",
|
|
2788
|
-
value: function
|
|
2397
|
+
value: function (key
|
|
2789
2398
|
/*: string*/
|
|
2790
2399
|
, points
|
|
2791
2400
|
/*: Array<Array<number>>*/
|
|
@@ -2807,7 +2416,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2807
2416
|
|
|
2808
2417
|
}, {
|
|
2809
2418
|
key: "polygonContains",
|
|
2810
|
-
value: function
|
|
2419
|
+
value: function (key
|
|
2811
2420
|
/*: string*/
|
|
2812
2421
|
, point
|
|
2813
2422
|
/*: ParseGeoPoint*/
|
|
@@ -2818,7 +2427,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2818
2427
|
$point: point
|
|
2819
2428
|
});
|
|
2820
2429
|
}
|
|
2821
|
-
|
|
2430
|
+
/* Query Orderings */
|
|
2822
2431
|
|
|
2823
2432
|
/**
|
|
2824
2433
|
* Sorts the results in ascending order by the given key.
|
|
@@ -2830,13 +2439,13 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2830
2439
|
|
|
2831
2440
|
}, {
|
|
2832
2441
|
key: "ascending",
|
|
2833
|
-
value: function
|
|
2442
|
+
value: function ()
|
|
2834
2443
|
/*: ParseQuery*/
|
|
2835
2444
|
{
|
|
2836
2445
|
this._order = [];
|
|
2837
2446
|
|
|
2838
|
-
for (var _len = arguments.length, keys = new Array(_len),
|
|
2839
|
-
keys[
|
|
2447
|
+
for (var _len = arguments.length, keys = new Array(_len), _key9 = 0; _key9 < _len; _key9++) {
|
|
2448
|
+
keys[_key9] = arguments[_key9];
|
|
2840
2449
|
}
|
|
2841
2450
|
|
|
2842
2451
|
return this.addAscending.apply(this, keys);
|
|
@@ -2852,7 +2461,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2852
2461
|
|
|
2853
2462
|
}, {
|
|
2854
2463
|
key: "addAscending",
|
|
2855
|
-
value: function
|
|
2464
|
+
value: function ()
|
|
2856
2465
|
/*: ParseQuery*/
|
|
2857
2466
|
{
|
|
2858
2467
|
var _this9 = this;
|
|
@@ -2861,8 +2470,8 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2861
2470
|
this._order = [];
|
|
2862
2471
|
}
|
|
2863
2472
|
|
|
2864
|
-
for (var _len2 = arguments.length, keys = new Array(_len2),
|
|
2865
|
-
keys[
|
|
2473
|
+
for (var _len2 = arguments.length, keys = new Array(_len2), _key10 = 0; _key10 < _len2; _key10++) {
|
|
2474
|
+
keys[_key10] = arguments[_key10];
|
|
2866
2475
|
}
|
|
2867
2476
|
|
|
2868
2477
|
(0, _forEach.default)(keys).call(keys, function (key) {
|
|
@@ -2886,13 +2495,13 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2886
2495
|
|
|
2887
2496
|
}, {
|
|
2888
2497
|
key: "descending",
|
|
2889
|
-
value: function
|
|
2498
|
+
value: function ()
|
|
2890
2499
|
/*: ParseQuery*/
|
|
2891
2500
|
{
|
|
2892
2501
|
this._order = [];
|
|
2893
2502
|
|
|
2894
|
-
for (var _len3 = arguments.length, keys = new Array(_len3),
|
|
2895
|
-
keys[
|
|
2503
|
+
for (var _len3 = arguments.length, keys = new Array(_len3), _key11 = 0; _key11 < _len3; _key11++) {
|
|
2504
|
+
keys[_key11] = arguments[_key11];
|
|
2896
2505
|
}
|
|
2897
2506
|
|
|
2898
2507
|
return this.addDescending.apply(this, keys);
|
|
@@ -2908,7 +2517,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2908
2517
|
|
|
2909
2518
|
}, {
|
|
2910
2519
|
key: "addDescending",
|
|
2911
|
-
value: function
|
|
2520
|
+
value: function ()
|
|
2912
2521
|
/*: ParseQuery*/
|
|
2913
2522
|
{
|
|
2914
2523
|
var _this10 = this;
|
|
@@ -2917,8 +2526,8 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2917
2526
|
this._order = [];
|
|
2918
2527
|
}
|
|
2919
2528
|
|
|
2920
|
-
for (var _len4 = arguments.length, keys = new Array(_len4),
|
|
2921
|
-
keys[
|
|
2529
|
+
for (var _len4 = arguments.length, keys = new Array(_len4), _key12 = 0; _key12 < _len4; _key12++) {
|
|
2530
|
+
keys[_key12] = arguments[_key12];
|
|
2922
2531
|
}
|
|
2923
2532
|
|
|
2924
2533
|
(0, _forEach.default)(keys).call(keys, function (key) {
|
|
@@ -2934,7 +2543,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2934
2543
|
});
|
|
2935
2544
|
return this;
|
|
2936
2545
|
}
|
|
2937
|
-
|
|
2546
|
+
/* Query Options */
|
|
2938
2547
|
|
|
2939
2548
|
/**
|
|
2940
2549
|
* Sets the number of results to skip before returning any results.
|
|
@@ -2947,7 +2556,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2947
2556
|
|
|
2948
2557
|
}, {
|
|
2949
2558
|
key: "skip",
|
|
2950
|
-
value: function
|
|
2559
|
+
value: function (n
|
|
2951
2560
|
/*: number*/
|
|
2952
2561
|
)
|
|
2953
2562
|
/*: ParseQuery*/
|
|
@@ -2968,7 +2577,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2968
2577
|
|
|
2969
2578
|
}, {
|
|
2970
2579
|
key: "limit",
|
|
2971
|
-
value: function
|
|
2580
|
+
value: function (n
|
|
2972
2581
|
/*: number*/
|
|
2973
2582
|
)
|
|
2974
2583
|
/*: ParseQuery*/
|
|
@@ -2992,7 +2601,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2992
2601
|
|
|
2993
2602
|
}, {
|
|
2994
2603
|
key: "withCount",
|
|
2995
|
-
value: function
|
|
2604
|
+
value: function ()
|
|
2996
2605
|
/*: ParseQuery*/
|
|
2997
2606
|
{
|
|
2998
2607
|
var includeCount
|
|
@@ -3020,13 +2629,13 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3020
2629
|
|
|
3021
2630
|
}, {
|
|
3022
2631
|
key: "include",
|
|
3023
|
-
value: function
|
|
2632
|
+
value: function ()
|
|
3024
2633
|
/*: ParseQuery*/
|
|
3025
2634
|
{
|
|
3026
2635
|
var _this11 = this;
|
|
3027
2636
|
|
|
3028
|
-
for (var _len5 = arguments.length, keys = new Array(_len5),
|
|
3029
|
-
keys[
|
|
2637
|
+
for (var _len5 = arguments.length, keys = new Array(_len5), _key13 = 0; _key13 < _len5; _key13++) {
|
|
2638
|
+
keys[_key13] = arguments[_key13];
|
|
3030
2639
|
}
|
|
3031
2640
|
|
|
3032
2641
|
(0, _forEach.default)(keys).call(keys, function (key) {
|
|
@@ -3050,7 +2659,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3050
2659
|
|
|
3051
2660
|
}, {
|
|
3052
2661
|
key: "includeAll",
|
|
3053
|
-
value: function
|
|
2662
|
+
value: function ()
|
|
3054
2663
|
/*: ParseQuery*/
|
|
3055
2664
|
{
|
|
3056
2665
|
return this.include('*');
|
|
@@ -3066,7 +2675,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3066
2675
|
|
|
3067
2676
|
}, {
|
|
3068
2677
|
key: "select",
|
|
3069
|
-
value: function
|
|
2678
|
+
value: function ()
|
|
3070
2679
|
/*: ParseQuery*/
|
|
3071
2680
|
{
|
|
3072
2681
|
var _this12 = this;
|
|
@@ -3075,8 +2684,8 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3075
2684
|
this._select = [];
|
|
3076
2685
|
}
|
|
3077
2686
|
|
|
3078
|
-
for (var _len6 = arguments.length, keys = new Array(_len6),
|
|
3079
|
-
keys[
|
|
2687
|
+
for (var _len6 = arguments.length, keys = new Array(_len6), _key14 = 0; _key14 < _len6; _key14++) {
|
|
2688
|
+
keys[_key14] = arguments[_key14];
|
|
3080
2689
|
}
|
|
3081
2690
|
|
|
3082
2691
|
(0, _forEach.default)(keys).call(keys, function (key) {
|
|
@@ -3102,13 +2711,13 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3102
2711
|
|
|
3103
2712
|
}, {
|
|
3104
2713
|
key: "exclude",
|
|
3105
|
-
value: function
|
|
2714
|
+
value: function ()
|
|
3106
2715
|
/*: ParseQuery*/
|
|
3107
2716
|
{
|
|
3108
2717
|
var _this13 = this;
|
|
3109
2718
|
|
|
3110
|
-
for (var _len7 = arguments.length, keys = new Array(_len7),
|
|
3111
|
-
keys[
|
|
2719
|
+
for (var _len7 = arguments.length, keys = new Array(_len7), _key15 = 0; _key15 < _len7; _key15++) {
|
|
2720
|
+
keys[_key15] = arguments[_key15];
|
|
3112
2721
|
}
|
|
3113
2722
|
|
|
3114
2723
|
(0, _forEach.default)(keys).call(keys, function (key) {
|
|
@@ -3133,7 +2742,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3133
2742
|
|
|
3134
2743
|
}, {
|
|
3135
2744
|
key: "readPreference",
|
|
3136
|
-
value: function
|
|
2745
|
+
value: function (_readPreference
|
|
3137
2746
|
/*: string*/
|
|
3138
2747
|
, includeReadPreference
|
|
3139
2748
|
/*:: ?: string*/
|
|
@@ -3158,48 +2767,46 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3158
2767
|
}, {
|
|
3159
2768
|
key: "subscribe",
|
|
3160
2769
|
value: function () {
|
|
3161
|
-
var _subscribe = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
2770
|
+
var _subscribe = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(sessionToken
|
|
3162
2771
|
/*:: ?: string*/
|
|
3163
2772
|
) {
|
|
3164
2773
|
var currentUser, liveQueryClient, subscription;
|
|
3165
|
-
return
|
|
3166
|
-
while (1) {
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
return _CoreManager.default.getUserController().currentUserAsync();
|
|
3171
|
-
|
|
3172
|
-
case 2:
|
|
3173
|
-
currentUser = _context22.sent;
|
|
3174
|
-
|
|
3175
|
-
if (!sessionToken) {
|
|
3176
|
-
sessionToken = currentUser ? currentUser.getSessionToken() : undefined;
|
|
3177
|
-
}
|
|
2774
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
2775
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
2776
|
+
case 0:
|
|
2777
|
+
_context22.next = 2;
|
|
2778
|
+
return _CoreManager.default.getUserController().currentUserAsync();
|
|
3178
2779
|
|
|
3179
|
-
|
|
3180
|
-
|
|
2780
|
+
case 2:
|
|
2781
|
+
currentUser = _context22.sent;
|
|
3181
2782
|
|
|
3182
|
-
|
|
3183
|
-
|
|
2783
|
+
if (!sessionToken) {
|
|
2784
|
+
sessionToken = currentUser ? currentUser.getSessionToken() : undefined;
|
|
2785
|
+
}
|
|
3184
2786
|
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
2787
|
+
_context22.next = 6;
|
|
2788
|
+
return _CoreManager.default.getLiveQueryController().getDefaultLiveQueryClient();
|
|
2789
|
+
|
|
2790
|
+
case 6:
|
|
2791
|
+
liveQueryClient = _context22.sent;
|
|
3188
2792
|
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
}));
|
|
2793
|
+
if (liveQueryClient.shouldOpen()) {
|
|
2794
|
+
liveQueryClient.open();
|
|
2795
|
+
}
|
|
3193
2796
|
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
return
|
|
3197
|
-
|
|
2797
|
+
subscription = liveQueryClient.subscribe(this, sessionToken);
|
|
2798
|
+
return _context22.abrupt("return", subscription.subscribePromise.then(function () {
|
|
2799
|
+
return subscription;
|
|
2800
|
+
}));
|
|
2801
|
+
|
|
2802
|
+
case 10:
|
|
2803
|
+
case "end":
|
|
2804
|
+
return _context22.stop();
|
|
3198
2805
|
}
|
|
3199
2806
|
}, _callee7, this);
|
|
3200
2807
|
}));
|
|
3201
2808
|
|
|
3202
|
-
function subscribe(
|
|
2809
|
+
function subscribe() {
|
|
3203
2810
|
return _subscribe.apply(this, arguments);
|
|
3204
2811
|
}
|
|
3205
2812
|
|
|
@@ -3226,7 +2833,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3226
2833
|
*
|
|
3227
2834
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
3228
2835
|
*/
|
|
3229
|
-
function
|
|
2836
|
+
function ()
|
|
3230
2837
|
/*: ParseQuery*/
|
|
3231
2838
|
{
|
|
3232
2839
|
this._queriesLocalDatastore = false;
|
|
@@ -3241,7 +2848,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3241
2848
|
|
|
3242
2849
|
}, {
|
|
3243
2850
|
key: "fromLocalDatastore",
|
|
3244
|
-
value: function
|
|
2851
|
+
value: function ()
|
|
3245
2852
|
/*: ParseQuery*/
|
|
3246
2853
|
{
|
|
3247
2854
|
return this.fromPinWithName(null);
|
|
@@ -3254,7 +2861,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3254
2861
|
|
|
3255
2862
|
}, {
|
|
3256
2863
|
key: "fromPin",
|
|
3257
|
-
value: function
|
|
2864
|
+
value: function ()
|
|
3258
2865
|
/*: ParseQuery*/
|
|
3259
2866
|
{
|
|
3260
2867
|
return this.fromPinWithName(_LocalDatastoreUtils.DEFAULT_PIN);
|
|
@@ -3268,7 +2875,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3268
2875
|
|
|
3269
2876
|
}, {
|
|
3270
2877
|
key: "fromPinWithName",
|
|
3271
|
-
value: function
|
|
2878
|
+
value: function (name
|
|
3272
2879
|
/*:: ?: string*/
|
|
3273
2880
|
)
|
|
3274
2881
|
/*: ParseQuery*/
|
|
@@ -3290,7 +2897,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3290
2897
|
|
|
3291
2898
|
}, {
|
|
3292
2899
|
key: "cancel",
|
|
3293
|
-
value: function
|
|
2900
|
+
value: function ()
|
|
3294
2901
|
/*: ParseQuery*/
|
|
3295
2902
|
{
|
|
3296
2903
|
var _this14 = this;
|
|
@@ -3313,7 +2920,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3313
2920
|
}
|
|
3314
2921
|
}, {
|
|
3315
2922
|
key: "_setRequestTask",
|
|
3316
|
-
value: function
|
|
2923
|
+
value: function (options) {
|
|
3317
2924
|
var _this15 = this;
|
|
3318
2925
|
|
|
3319
2926
|
options.requestTask = function (task) {
|
|
@@ -3324,7 +2931,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3324
2931
|
}
|
|
3325
2932
|
}], [{
|
|
3326
2933
|
key: "fromJSON",
|
|
3327
|
-
value: function
|
|
2934
|
+
value: function (className
|
|
3328
2935
|
/*: string*/
|
|
3329
2936
|
, json
|
|
3330
2937
|
/*: QueryJSON*/
|
|
@@ -3336,11 +2943,11 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3336
2943
|
}
|
|
3337
2944
|
}, {
|
|
3338
2945
|
key: "or",
|
|
3339
|
-
value: function
|
|
2946
|
+
value: function ()
|
|
3340
2947
|
/*: ParseQuery*/
|
|
3341
2948
|
{
|
|
3342
|
-
for (var _len8 = arguments.length, queries = new Array(_len8),
|
|
3343
|
-
queries[
|
|
2949
|
+
for (var _len8 = arguments.length, queries = new Array(_len8), _key16 = 0; _key16 < _len8; _key16++) {
|
|
2950
|
+
queries[_key16] = arguments[_key16];
|
|
3344
2951
|
}
|
|
3345
2952
|
|
|
3346
2953
|
var className = _getClassNameFromQueries(queries);
|
|
@@ -3366,11 +2973,11 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3366
2973
|
|
|
3367
2974
|
}, {
|
|
3368
2975
|
key: "and",
|
|
3369
|
-
value: function
|
|
2976
|
+
value: function ()
|
|
3370
2977
|
/*: ParseQuery*/
|
|
3371
2978
|
{
|
|
3372
|
-
for (var _len9 = arguments.length, queries = new Array(_len9),
|
|
3373
|
-
queries[
|
|
2979
|
+
for (var _len9 = arguments.length, queries = new Array(_len9), _key17 = 0; _key17 < _len9; _key17++) {
|
|
2980
|
+
queries[_key17] = arguments[_key17];
|
|
3374
2981
|
}
|
|
3375
2982
|
|
|
3376
2983
|
var className = _getClassNameFromQueries(queries);
|
|
@@ -3396,11 +3003,11 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3396
3003
|
|
|
3397
3004
|
}, {
|
|
3398
3005
|
key: "nor",
|
|
3399
|
-
value: function
|
|
3006
|
+
value: function ()
|
|
3400
3007
|
/*: ParseQuery*/
|
|
3401
3008
|
{
|
|
3402
|
-
for (var _len10 = arguments.length, queries = new Array(_len10),
|
|
3403
|
-
queries[
|
|
3009
|
+
for (var _len10 = arguments.length, queries = new Array(_len10), _key18 = 0; _key18 < _len10; _key18++) {
|
|
3010
|
+
queries[_key18] = arguments[_key18];
|
|
3404
3011
|
}
|
|
3405
3012
|
|
|
3406
3013
|
var className = _getClassNameFromQueries(queries);
|
|
@@ -3416,7 +3023,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
3416
3023
|
}();
|
|
3417
3024
|
|
|
3418
3025
|
var DefaultController = {
|
|
3419
|
-
find: function
|
|
3026
|
+
find: function (className
|
|
3420
3027
|
/*: string*/
|
|
3421
3028
|
, params
|
|
3422
3029
|
/*: QueryJSON*/
|
|
@@ -3429,7 +3036,7 @@ var DefaultController = {
|
|
|
3429
3036
|
|
|
3430
3037
|
return RESTController.request('GET', 'classes/' + className, params, options);
|
|
3431
3038
|
},
|
|
3432
|
-
aggregate: function
|
|
3039
|
+
aggregate: function (className
|
|
3433
3040
|
/*: string*/
|
|
3434
3041
|
, params
|
|
3435
3042
|
/*: any*/
|