parse 4.1.0-alpha.1 → 4.1.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/parse.js +63 -24
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +63 -24
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/LiveQueryClient.js +7 -3
- package/lib/browser/ParseFile.js +1 -0
- package/lib/browser/ParseQuery.js +53 -19
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/LiveQueryClient.js +5 -2
- package/lib/node/ParseFile.js +1 -0
- package/lib/node/ParseQuery.js +27 -0
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/LiveQueryClient.js +7 -3
- package/lib/react-native/ParseFile.js +1 -0
- package/lib/react-native/ParseQuery.js +34 -11
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/LiveQueryClient.js +7 -3
- package/lib/weapp/ParseFile.js +1 -0
- package/lib/weapp/ParseQuery.js +53 -19
- package/package.json +15 -15
|
@@ -182,7 +182,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
|
|
|
182
182
|
SERVER_AUTH_TOKEN: null,
|
|
183
183
|
LIVEQUERY_SERVER_URL: null,
|
|
184
184
|
ENCRYPTED_KEY: null,
|
|
185
|
-
VERSION: 'js' + "4.1.0-alpha.
|
|
185
|
+
VERSION: 'js' + "4.1.0-alpha.3",
|
|
186
186
|
APPLICATION_ID: null,
|
|
187
187
|
JAVASCRIPT_KEY: null,
|
|
188
188
|
MASTER_KEY: null,
|
|
@@ -303,21 +303,25 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
|
|
|
303
303
|
}, {
|
|
304
304
|
key: "subscribe",
|
|
305
305
|
value: function (query /*: Object*/, sessionToken /*: ?string*/) /*: LiveQuerySubscription*/{
|
|
306
|
-
var
|
|
306
|
+
var _queryJSON$keys,
|
|
307
|
+
_queryJSON$watch,
|
|
308
|
+
_this2 = this;
|
|
307
309
|
if (!query) {
|
|
308
310
|
return;
|
|
309
311
|
}
|
|
310
312
|
var className = query.className;
|
|
311
313
|
var queryJSON = query.toJSON();
|
|
312
314
|
var where = queryJSON.where;
|
|
313
|
-
var fields = (0, _keys.default)(queryJSON) ?
|
|
315
|
+
var fields = (_queryJSON$keys = (0, _keys.default)(queryJSON)) === null || _queryJSON$keys === void 0 ? void 0 : _queryJSON$keys.split(',');
|
|
316
|
+
var watch = (_queryJSON$watch = queryJSON.watch) === null || _queryJSON$watch === void 0 ? void 0 : _queryJSON$watch.split(',');
|
|
314
317
|
var subscribeRequest = {
|
|
315
318
|
op: OP_TYPES.SUBSCRIBE,
|
|
316
319
|
requestId: this.requestId,
|
|
317
320
|
query: {
|
|
318
321
|
className: className,
|
|
319
322
|
where: where,
|
|
320
|
-
fields: fields
|
|
323
|
+
fields: fields,
|
|
324
|
+
watch: watch
|
|
321
325
|
}
|
|
322
326
|
};
|
|
323
327
|
if (sessionToken) {
|
package/lib/browser/ParseFile.js
CHANGED
|
@@ -369,6 +369,7 @@ var ParseFile = /*#__PURE__*/function () {
|
|
|
369
369
|
key: "cancel",
|
|
370
370
|
value: function () {
|
|
371
371
|
if (this._requestTask && typeof this._requestTask.abort === 'function') {
|
|
372
|
+
this._requestTask._aborted = true;
|
|
372
373
|
this._requestTask.abort();
|
|
373
374
|
}
|
|
374
375
|
this._requestTask = null;
|
|
@@ -226,6 +226,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
226
226
|
(0, _classCallCheck2.default)(this, ParseQuery);
|
|
227
227
|
(0, _defineProperty2.default)(this, "className", void 0);
|
|
228
228
|
(0, _defineProperty2.default)(this, "_where", void 0);
|
|
229
|
+
(0, _defineProperty2.default)(this, "_watch", void 0);
|
|
229
230
|
(0, _defineProperty2.default)(this, "_include", void 0);
|
|
230
231
|
(0, _defineProperty2.default)(this, "_exclude", void 0);
|
|
231
232
|
(0, _defineProperty2.default)(this, "_select", void 0);
|
|
@@ -261,6 +262,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
261
262
|
throw new TypeError('A ParseQuery must be constructed with a ParseObject or class name.');
|
|
262
263
|
}
|
|
263
264
|
this._where = {};
|
|
265
|
+
this._watch = [];
|
|
264
266
|
this._include = [];
|
|
265
267
|
this._exclude = [];
|
|
266
268
|
this._count = false;
|
|
@@ -453,6 +455,9 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
453
455
|
var params /*: QueryJSON*/ = {
|
|
454
456
|
where: this._where
|
|
455
457
|
};
|
|
458
|
+
if (this._watch.length) {
|
|
459
|
+
params.watch = this._watch.join(',');
|
|
460
|
+
}
|
|
456
461
|
if (this._include.length) {
|
|
457
462
|
params.include = this._include.join(',');
|
|
458
463
|
}
|
|
@@ -522,6 +527,9 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
522
527
|
if (json.where) {
|
|
523
528
|
this._where = json.where;
|
|
524
529
|
}
|
|
530
|
+
if (json.watch) {
|
|
531
|
+
this._watch = json.watch.split(',');
|
|
532
|
+
}
|
|
525
533
|
if (json.include) {
|
|
526
534
|
this._include = json.include.split(',');
|
|
527
535
|
}
|
|
@@ -2111,6 +2119,32 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2111
2119
|
return this;
|
|
2112
2120
|
}
|
|
2113
2121
|
|
|
2122
|
+
/**
|
|
2123
|
+
* Restricts live query to trigger only for watched fields.
|
|
2124
|
+
*
|
|
2125
|
+
* Requires Parse Server 6.0.0+
|
|
2126
|
+
*
|
|
2127
|
+
* @param {...string|Array<string>} keys The name(s) of the key(s) to watch.
|
|
2128
|
+
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
2129
|
+
*/
|
|
2130
|
+
}, {
|
|
2131
|
+
key: "watch",
|
|
2132
|
+
value: function () /*: ParseQuery*/{
|
|
2133
|
+
var _this14 = this;
|
|
2134
|
+
for (var _len8 = arguments.length, keys = new Array(_len8), _key12 = 0; _key12 < _len8; _key12++) {
|
|
2135
|
+
keys[_key12] = arguments[_key12];
|
|
2136
|
+
}
|
|
2137
|
+
(0, _forEach.default)(keys).call(keys, function (key) {
|
|
2138
|
+
if ((0, _isArray.default)(key)) {
|
|
2139
|
+
var _context22;
|
|
2140
|
+
_this14._watch = (0, _concat.default)(_context22 = _this14._watch).call(_context22, key);
|
|
2141
|
+
} else {
|
|
2142
|
+
_this14._watch.push(key);
|
|
2143
|
+
}
|
|
2144
|
+
});
|
|
2145
|
+
return this;
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2114
2148
|
/**
|
|
2115
2149
|
* Changes the read preference that the backend will use when performing the query to the database.
|
|
2116
2150
|
*
|
|
@@ -2140,30 +2174,30 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2140
2174
|
value: function () {
|
|
2141
2175
|
var _subscribe = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(sessionToken /*:: ?: string*/) {
|
|
2142
2176
|
var currentUser, liveQueryClient, subscription;
|
|
2143
|
-
return _regenerator.default.wrap(function (
|
|
2144
|
-
while (1) switch (
|
|
2177
|
+
return _regenerator.default.wrap(function (_context23) {
|
|
2178
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
2145
2179
|
case 0:
|
|
2146
|
-
|
|
2180
|
+
_context23.next = 2;
|
|
2147
2181
|
return _CoreManager.default.getUserController().currentUserAsync();
|
|
2148
2182
|
case 2:
|
|
2149
|
-
currentUser =
|
|
2183
|
+
currentUser = _context23.sent;
|
|
2150
2184
|
if (!sessionToken) {
|
|
2151
2185
|
sessionToken = currentUser ? currentUser.getSessionToken() : undefined;
|
|
2152
2186
|
}
|
|
2153
|
-
|
|
2187
|
+
_context23.next = 6;
|
|
2154
2188
|
return _CoreManager.default.getLiveQueryController().getDefaultLiveQueryClient();
|
|
2155
2189
|
case 6:
|
|
2156
|
-
liveQueryClient =
|
|
2190
|
+
liveQueryClient = _context23.sent;
|
|
2157
2191
|
if (liveQueryClient.shouldOpen()) {
|
|
2158
2192
|
liveQueryClient.open();
|
|
2159
2193
|
}
|
|
2160
2194
|
subscription = liveQueryClient.subscribe(this, sessionToken);
|
|
2161
|
-
return
|
|
2195
|
+
return _context23.abrupt("return", subscription.subscribePromise.then(function () {
|
|
2162
2196
|
return subscription;
|
|
2163
2197
|
}));
|
|
2164
2198
|
case 10:
|
|
2165
2199
|
case "end":
|
|
2166
|
-
return
|
|
2200
|
+
return _context23.stop();
|
|
2167
2201
|
}
|
|
2168
2202
|
}, _callee7, this);
|
|
2169
2203
|
}));
|
|
@@ -2245,7 +2279,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2245
2279
|
}, {
|
|
2246
2280
|
key: "cancel",
|
|
2247
2281
|
value: function () /*: ParseQuery*/{
|
|
2248
|
-
var
|
|
2282
|
+
var _this15 = this;
|
|
2249
2283
|
if (this._xhrRequest.task && typeof this._xhrRequest.task.abort === 'function') {
|
|
2250
2284
|
this._xhrRequest.task._aborted = true;
|
|
2251
2285
|
this._xhrRequest.task.abort();
|
|
@@ -2254,16 +2288,16 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2254
2288
|
return this;
|
|
2255
2289
|
}
|
|
2256
2290
|
return this._xhrRequest.onchange = function () {
|
|
2257
|
-
return
|
|
2291
|
+
return _this15.cancel();
|
|
2258
2292
|
};
|
|
2259
2293
|
}
|
|
2260
2294
|
}, {
|
|
2261
2295
|
key: "_setRequestTask",
|
|
2262
2296
|
value: function (options) {
|
|
2263
|
-
var
|
|
2297
|
+
var _this16 = this;
|
|
2264
2298
|
options.requestTask = function (task) {
|
|
2265
|
-
|
|
2266
|
-
|
|
2299
|
+
_this16._xhrRequest.task = task;
|
|
2300
|
+
_this16._xhrRequest.onchange();
|
|
2267
2301
|
};
|
|
2268
2302
|
}
|
|
2269
2303
|
}], [{
|
|
@@ -2275,8 +2309,8 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2275
2309
|
}, {
|
|
2276
2310
|
key: "or",
|
|
2277
2311
|
value: function () /*: ParseQuery*/{
|
|
2278
|
-
for (var
|
|
2279
|
-
queries[
|
|
2312
|
+
for (var _len9 = arguments.length, queries = new Array(_len9), _key13 = 0; _key13 < _len9; _key13++) {
|
|
2313
|
+
queries[_key13] = arguments[_key13];
|
|
2280
2314
|
}
|
|
2281
2315
|
var className = _getClassNameFromQueries(queries);
|
|
2282
2316
|
var query = new ParseQuery(className);
|
|
@@ -2299,8 +2333,8 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2299
2333
|
}, {
|
|
2300
2334
|
key: "and",
|
|
2301
2335
|
value: function () /*: ParseQuery*/{
|
|
2302
|
-
for (var
|
|
2303
|
-
queries[
|
|
2336
|
+
for (var _len10 = arguments.length, queries = new Array(_len10), _key14 = 0; _key14 < _len10; _key14++) {
|
|
2337
|
+
queries[_key14] = arguments[_key14];
|
|
2304
2338
|
}
|
|
2305
2339
|
var className = _getClassNameFromQueries(queries);
|
|
2306
2340
|
var query = new ParseQuery(className);
|
|
@@ -2323,8 +2357,8 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
2323
2357
|
}, {
|
|
2324
2358
|
key: "nor",
|
|
2325
2359
|
value: function () /*: ParseQuery*/{
|
|
2326
|
-
for (var
|
|
2327
|
-
queries[
|
|
2360
|
+
for (var _len11 = arguments.length, queries = new Array(_len11), _key15 = 0; _key15 < _len11; _key15++) {
|
|
2361
|
+
queries[_key15] = arguments[_key15];
|
|
2328
2362
|
}
|
|
2329
2363
|
var className = _getClassNameFromQueries(queries);
|
|
2330
2364
|
var query = new ParseQuery(className);
|
package/lib/node/CoreManager.js
CHANGED
|
@@ -179,7 +179,7 @@ const config /*: Config & { [key: string]: mixed }*/ = {
|
|
|
179
179
|
SERVER_AUTH_TOKEN: null,
|
|
180
180
|
LIVEQUERY_SERVER_URL: null,
|
|
181
181
|
ENCRYPTED_KEY: null,
|
|
182
|
-
VERSION: 'js' + "4.1.0-alpha.
|
|
182
|
+
VERSION: 'js' + "4.1.0-alpha.3",
|
|
183
183
|
APPLICATION_ID: null,
|
|
184
184
|
JAVASCRIPT_KEY: null,
|
|
185
185
|
MASTER_KEY: null,
|
|
@@ -188,20 +188,23 @@ class LiveQueryClient extends _EventEmitter.default {
|
|
|
188
188
|
* @returns {LiveQuerySubscription | undefined}
|
|
189
189
|
*/
|
|
190
190
|
subscribe(query /*: Object*/, sessionToken /*: ?string*/) /*: LiveQuerySubscription*/{
|
|
191
|
+
var _queryJSON$keys, _queryJSON$watch;
|
|
191
192
|
if (!query) {
|
|
192
193
|
return;
|
|
193
194
|
}
|
|
194
195
|
const className = query.className;
|
|
195
196
|
const queryJSON = query.toJSON();
|
|
196
197
|
const where = queryJSON.where;
|
|
197
|
-
const fields = queryJSON.keys ?
|
|
198
|
+
const fields = (_queryJSON$keys = queryJSON.keys) === null || _queryJSON$keys === void 0 ? void 0 : _queryJSON$keys.split(',');
|
|
199
|
+
const watch = (_queryJSON$watch = queryJSON.watch) === null || _queryJSON$watch === void 0 ? void 0 : _queryJSON$watch.split(',');
|
|
198
200
|
const subscribeRequest = {
|
|
199
201
|
op: OP_TYPES.SUBSCRIBE,
|
|
200
202
|
requestId: this.requestId,
|
|
201
203
|
query: {
|
|
202
204
|
className,
|
|
203
205
|
where,
|
|
204
|
-
fields
|
|
206
|
+
fields,
|
|
207
|
+
watch
|
|
205
208
|
}
|
|
206
209
|
};
|
|
207
210
|
if (sessionToken) {
|
package/lib/node/ParseFile.js
CHANGED
package/lib/node/ParseQuery.js
CHANGED
|
@@ -200,6 +200,7 @@ class ParseQuery {
|
|
|
200
200
|
*/
|
|
201
201
|
/*:: className: string;*/
|
|
202
202
|
/*:: _where: any;*/
|
|
203
|
+
/*:: _watch: Array<string>;*/
|
|
203
204
|
/*:: _include: Array<string>;*/
|
|
204
205
|
/*:: _exclude: Array<string>;*/
|
|
205
206
|
/*:: _select: Array<string>;*/
|
|
@@ -239,6 +240,7 @@ class ParseQuery {
|
|
|
239
240
|
throw new TypeError('A ParseQuery must be constructed with a ParseObject or class name.');
|
|
240
241
|
}
|
|
241
242
|
this._where = {};
|
|
243
|
+
this._watch = [];
|
|
242
244
|
this._include = [];
|
|
243
245
|
this._exclude = [];
|
|
244
246
|
this._count = false;
|
|
@@ -391,6 +393,9 @@ class ParseQuery {
|
|
|
391
393
|
const params /*: QueryJSON*/ = {
|
|
392
394
|
where: this._where
|
|
393
395
|
};
|
|
396
|
+
if (this._watch.length) {
|
|
397
|
+
params.watch = this._watch.join(',');
|
|
398
|
+
}
|
|
394
399
|
if (this._include.length) {
|
|
395
400
|
params.include = this._include.join(',');
|
|
396
401
|
}
|
|
@@ -458,6 +463,9 @@ class ParseQuery {
|
|
|
458
463
|
if (json.where) {
|
|
459
464
|
this._where = json.where;
|
|
460
465
|
}
|
|
466
|
+
if (json.watch) {
|
|
467
|
+
this._watch = json.watch.split(',');
|
|
468
|
+
}
|
|
461
469
|
if (json.include) {
|
|
462
470
|
this._include = json.include.split(',');
|
|
463
471
|
}
|
|
@@ -1795,6 +1803,25 @@ class ParseQuery {
|
|
|
1795
1803
|
return this;
|
|
1796
1804
|
}
|
|
1797
1805
|
|
|
1806
|
+
/**
|
|
1807
|
+
* Restricts live query to trigger only for watched fields.
|
|
1808
|
+
*
|
|
1809
|
+
* Requires Parse Server 6.0.0+
|
|
1810
|
+
*
|
|
1811
|
+
* @param {...string|Array<string>} keys The name(s) of the key(s) to watch.
|
|
1812
|
+
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
1813
|
+
*/
|
|
1814
|
+
watch(...keys /*: Array<string | Array<string>>*/) /*: ParseQuery*/{
|
|
1815
|
+
keys.forEach(key => {
|
|
1816
|
+
if (Array.isArray(key)) {
|
|
1817
|
+
this._watch = this._watch.concat(key);
|
|
1818
|
+
} else {
|
|
1819
|
+
this._watch.push(key);
|
|
1820
|
+
}
|
|
1821
|
+
});
|
|
1822
|
+
return this;
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1798
1825
|
/**
|
|
1799
1826
|
* Changes the read preference that the backend will use when performing the query to the database.
|
|
1800
1827
|
*
|
|
@@ -123,21 +123,25 @@ var LiveQueryClient = function (_EventEmitter) {
|
|
|
123
123
|
}, {
|
|
124
124
|
key: "subscribe",
|
|
125
125
|
value: function (query, sessionToken) {
|
|
126
|
-
var
|
|
126
|
+
var _queryJSON$keys,
|
|
127
|
+
_queryJSON$watch,
|
|
128
|
+
_this2 = this;
|
|
127
129
|
if (!query) {
|
|
128
130
|
return;
|
|
129
131
|
}
|
|
130
132
|
var className = query.className;
|
|
131
133
|
var queryJSON = query.toJSON();
|
|
132
134
|
var where = queryJSON.where;
|
|
133
|
-
var fields = queryJSON.keys ?
|
|
135
|
+
var fields = (_queryJSON$keys = queryJSON.keys) == null ? void 0 : _queryJSON$keys.split(',');
|
|
136
|
+
var watch = (_queryJSON$watch = queryJSON.watch) == null ? void 0 : _queryJSON$watch.split(',');
|
|
134
137
|
var subscribeRequest = {
|
|
135
138
|
op: OP_TYPES.SUBSCRIBE,
|
|
136
139
|
requestId: this.requestId,
|
|
137
140
|
query: {
|
|
138
141
|
className: className,
|
|
139
142
|
where: where,
|
|
140
|
-
fields: fields
|
|
143
|
+
fields: fields,
|
|
144
|
+
watch: watch
|
|
141
145
|
}
|
|
142
146
|
};
|
|
143
147
|
if (sessionToken) {
|
|
@@ -181,6 +181,7 @@ var ParseFile = function () {
|
|
|
181
181
|
key: "cancel",
|
|
182
182
|
value: function () {
|
|
183
183
|
if (this._requestTask && typeof this._requestTask.abort === 'function') {
|
|
184
|
+
this._requestTask._aborted = true;
|
|
184
185
|
this._requestTask.abort();
|
|
185
186
|
}
|
|
186
187
|
this._requestTask = null;
|
|
@@ -131,6 +131,7 @@ var ParseQuery = function () {
|
|
|
131
131
|
throw new TypeError('A ParseQuery must be constructed with a ParseObject or class name.');
|
|
132
132
|
}
|
|
133
133
|
this._where = {};
|
|
134
|
+
this._watch = [];
|
|
134
135
|
this._include = [];
|
|
135
136
|
this._exclude = [];
|
|
136
137
|
this._count = false;
|
|
@@ -262,6 +263,9 @@ var ParseQuery = function () {
|
|
|
262
263
|
var params = {
|
|
263
264
|
where: this._where
|
|
264
265
|
};
|
|
266
|
+
if (this._watch.length) {
|
|
267
|
+
params.watch = this._watch.join(',');
|
|
268
|
+
}
|
|
265
269
|
if (this._include.length) {
|
|
266
270
|
params.include = this._include.join(',');
|
|
267
271
|
}
|
|
@@ -309,6 +313,9 @@ var ParseQuery = function () {
|
|
|
309
313
|
if (json.where) {
|
|
310
314
|
this._where = json.where;
|
|
311
315
|
}
|
|
316
|
+
if (json.watch) {
|
|
317
|
+
this._watch = json.watch.split(',');
|
|
318
|
+
}
|
|
312
319
|
if (json.include) {
|
|
313
320
|
this._include = json.include.split(',');
|
|
314
321
|
}
|
|
@@ -1144,6 +1151,22 @@ var ParseQuery = function () {
|
|
|
1144
1151
|
});
|
|
1145
1152
|
return this;
|
|
1146
1153
|
}
|
|
1154
|
+
}, {
|
|
1155
|
+
key: "watch",
|
|
1156
|
+
value: function () {
|
|
1157
|
+
var _this14 = this;
|
|
1158
|
+
for (var _len8 = arguments.length, keys = new Array(_len8), _key12 = 0; _key12 < _len8; _key12++) {
|
|
1159
|
+
keys[_key12] = arguments[_key12];
|
|
1160
|
+
}
|
|
1161
|
+
keys.forEach(function (key) {
|
|
1162
|
+
if (Array.isArray(key)) {
|
|
1163
|
+
_this14._watch = _this14._watch.concat(key);
|
|
1164
|
+
} else {
|
|
1165
|
+
_this14._watch.push(key);
|
|
1166
|
+
}
|
|
1167
|
+
});
|
|
1168
|
+
return this;
|
|
1169
|
+
}
|
|
1147
1170
|
}, {
|
|
1148
1171
|
key: "readPreference",
|
|
1149
1172
|
value: function (_readPreference, includeReadPreference, subqueryReadPreference) {
|
|
@@ -1204,7 +1227,7 @@ var ParseQuery = function () {
|
|
|
1204
1227
|
}, {
|
|
1205
1228
|
key: "cancel",
|
|
1206
1229
|
value: function () {
|
|
1207
|
-
var
|
|
1230
|
+
var _this15 = this;
|
|
1208
1231
|
if (this._xhrRequest.task && typeof this._xhrRequest.task.abort === 'function') {
|
|
1209
1232
|
this._xhrRequest.task._aborted = true;
|
|
1210
1233
|
this._xhrRequest.task.abort();
|
|
@@ -1213,16 +1236,16 @@ var ParseQuery = function () {
|
|
|
1213
1236
|
return this;
|
|
1214
1237
|
}
|
|
1215
1238
|
return this._xhrRequest.onchange = function () {
|
|
1216
|
-
return
|
|
1239
|
+
return _this15.cancel();
|
|
1217
1240
|
};
|
|
1218
1241
|
}
|
|
1219
1242
|
}, {
|
|
1220
1243
|
key: "_setRequestTask",
|
|
1221
1244
|
value: function (options) {
|
|
1222
|
-
var
|
|
1245
|
+
var _this16 = this;
|
|
1223
1246
|
options.requestTask = function (task) {
|
|
1224
|
-
|
|
1225
|
-
|
|
1247
|
+
_this16._xhrRequest.task = task;
|
|
1248
|
+
_this16._xhrRequest.onchange();
|
|
1226
1249
|
};
|
|
1227
1250
|
}
|
|
1228
1251
|
}], [{
|
|
@@ -1234,8 +1257,8 @@ var ParseQuery = function () {
|
|
|
1234
1257
|
}, {
|
|
1235
1258
|
key: "or",
|
|
1236
1259
|
value: function () {
|
|
1237
|
-
for (var
|
|
1238
|
-
queries[
|
|
1260
|
+
for (var _len9 = arguments.length, queries = new Array(_len9), _key13 = 0; _key13 < _len9; _key13++) {
|
|
1261
|
+
queries[_key13] = arguments[_key13];
|
|
1239
1262
|
}
|
|
1240
1263
|
var className = _getClassNameFromQueries(queries);
|
|
1241
1264
|
var query = new ParseQuery(className);
|
|
@@ -1245,8 +1268,8 @@ var ParseQuery = function () {
|
|
|
1245
1268
|
}, {
|
|
1246
1269
|
key: "and",
|
|
1247
1270
|
value: function () {
|
|
1248
|
-
for (var
|
|
1249
|
-
queries[
|
|
1271
|
+
for (var _len10 = arguments.length, queries = new Array(_len10), _key14 = 0; _key14 < _len10; _key14++) {
|
|
1272
|
+
queries[_key14] = arguments[_key14];
|
|
1250
1273
|
}
|
|
1251
1274
|
var className = _getClassNameFromQueries(queries);
|
|
1252
1275
|
var query = new ParseQuery(className);
|
|
@@ -1256,8 +1279,8 @@ var ParseQuery = function () {
|
|
|
1256
1279
|
}, {
|
|
1257
1280
|
key: "nor",
|
|
1258
1281
|
value: function () {
|
|
1259
|
-
for (var
|
|
1260
|
-
queries[
|
|
1282
|
+
for (var _len11 = arguments.length, queries = new Array(_len11), _key15 = 0; _key15 < _len11; _key15++) {
|
|
1283
|
+
queries[_key15] = arguments[_key15];
|
|
1261
1284
|
}
|
|
1262
1285
|
var className = _getClassNameFromQueries(queries);
|
|
1263
1286
|
var query = new ParseQuery(className);
|
package/lib/weapp/CoreManager.js
CHANGED
|
@@ -182,7 +182,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
|
|
|
182
182
|
SERVER_AUTH_TOKEN: null,
|
|
183
183
|
LIVEQUERY_SERVER_URL: null,
|
|
184
184
|
ENCRYPTED_KEY: null,
|
|
185
|
-
VERSION: 'js' + "4.1.0-alpha.
|
|
185
|
+
VERSION: 'js' + "4.1.0-alpha.3",
|
|
186
186
|
APPLICATION_ID: null,
|
|
187
187
|
JAVASCRIPT_KEY: null,
|
|
188
188
|
MASTER_KEY: null,
|
|
@@ -303,21 +303,25 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
|
|
|
303
303
|
}, {
|
|
304
304
|
key: "subscribe",
|
|
305
305
|
value: function (query /*: Object*/, sessionToken /*: ?string*/) /*: LiveQuerySubscription*/{
|
|
306
|
-
var
|
|
306
|
+
var _queryJSON$keys,
|
|
307
|
+
_queryJSON$watch,
|
|
308
|
+
_this2 = this;
|
|
307
309
|
if (!query) {
|
|
308
310
|
return;
|
|
309
311
|
}
|
|
310
312
|
var className = query.className;
|
|
311
313
|
var queryJSON = query.toJSON();
|
|
312
314
|
var where = queryJSON.where;
|
|
313
|
-
var fields = (0, _keys.default)(queryJSON) ?
|
|
315
|
+
var fields = (_queryJSON$keys = (0, _keys.default)(queryJSON)) === null || _queryJSON$keys === void 0 ? void 0 : _queryJSON$keys.split(',');
|
|
316
|
+
var watch = (_queryJSON$watch = queryJSON.watch) === null || _queryJSON$watch === void 0 ? void 0 : _queryJSON$watch.split(',');
|
|
314
317
|
var subscribeRequest = {
|
|
315
318
|
op: OP_TYPES.SUBSCRIBE,
|
|
316
319
|
requestId: this.requestId,
|
|
317
320
|
query: {
|
|
318
321
|
className: className,
|
|
319
322
|
where: where,
|
|
320
|
-
fields: fields
|
|
323
|
+
fields: fields,
|
|
324
|
+
watch: watch
|
|
321
325
|
}
|
|
322
326
|
};
|
|
323
327
|
if (sessionToken) {
|
package/lib/weapp/ParseFile.js
CHANGED
|
@@ -371,6 +371,7 @@ var ParseFile = /*#__PURE__*/function () {
|
|
|
371
371
|
key: "cancel",
|
|
372
372
|
value: function () {
|
|
373
373
|
if (this._requestTask && typeof this._requestTask.abort === 'function') {
|
|
374
|
+
this._requestTask._aborted = true;
|
|
374
375
|
this._requestTask.abort();
|
|
375
376
|
}
|
|
376
377
|
this._requestTask = null;
|