parse 5.3.0-alpha.1 → 5.3.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/parse.js +531 -612
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +531 -610
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/FacebookUtils.js +1 -1
- package/lib/browser/LocalDatastoreController.react-native.js +1 -1
- package/lib/browser/ObjectStateMutations.js +1 -10
- package/lib/browser/OfflineQuery.js +5 -9
- package/lib/browser/Parse.js +1 -3
- package/lib/browser/ParseConfig.js +1 -1
- package/lib/browser/ParseFile.js +0 -1
- package/lib/browser/ParseObject.js +1 -1
- package/lib/browser/ParseQuery.js +1 -1
- package/lib/browser/ParseUser.js +1 -1
- package/lib/browser/RESTController.js +2 -2
- package/lib/browser/StorageController.weapp.js +1 -1
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/FacebookUtils.js +1 -1
- package/lib/node/LocalDatastoreController.react-native.js +1 -1
- package/lib/node/ObjectStateMutations.js +1 -5
- package/lib/node/OfflineQuery.js +5 -9
- package/lib/node/Parse.js +1 -1
- package/lib/node/ParseConfig.js +1 -1
- package/lib/node/ParseFile.js +0 -1
- package/lib/node/ParseObject.js +1 -1
- package/lib/node/ParseQuery.js +1 -1
- package/lib/node/ParseUser.js +1 -1
- package/lib/node/RESTController.js +2 -2
- package/lib/node/StorageController.weapp.js +1 -1
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/LocalDatastoreController.react-native.js +1 -1
- package/lib/react-native/ObjectStateMutations.js +0 -5
- package/lib/react-native/OfflineQuery.js +5 -5
- package/lib/react-native/ParseConfig.js +1 -1
- package/lib/react-native/ParseObject.js +2 -1
- package/lib/react-native/ParseQuery.js +1 -1
- package/lib/react-native/ParseUser.js +1 -1
- package/lib/react-native/RESTController.js +11 -10
- package/lib/react-native/StorageController.weapp.js +1 -1
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/FacebookUtils.js +1 -1
- package/lib/weapp/LocalDatastoreController.react-native.js +1 -1
- package/lib/weapp/ObjectStateMutations.js +1 -10
- package/lib/weapp/OfflineQuery.js +5 -9
- package/lib/weapp/Parse.js +1 -1
- package/lib/weapp/ParseConfig.js +1 -1
- package/lib/weapp/ParseFile.js +0 -1
- package/lib/weapp/ParseObject.js +1 -1
- package/lib/weapp/ParseQuery.js +1 -1
- package/lib/weapp/ParseUser.js +1 -1
- package/lib/weapp/RESTController.js +2 -2
- package/lib/weapp/StorageController.weapp.js +1 -1
- package/package.json +20 -18
|
@@ -103,7 +103,7 @@ const FacebookUtils = {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
if (initOptions.status && typeof console !== 'undefined') {
|
|
106
|
-
const warn = console.warn || console.log || function () {};
|
|
106
|
+
const warn = console.warn || console.log || function () {};
|
|
107
107
|
warn.call(console, 'The "status" flag passed into' + ' FB.init, when set to true, can interfere with Parse Facebook' + ' integration, so it has been suppressed. Please call' + ' FB.getLoginStatus() explicitly if you require this behavior.');
|
|
108
108
|
}
|
|
109
109
|
initOptions.status = false;
|
|
@@ -16,10 +16,6 @@ exports.setPendingOp = setPendingOp;
|
|
|
16
16
|
exports.setServerData = setServerData;
|
|
17
17
|
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
18
18
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
19
|
-
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
20
|
-
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
21
|
-
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/parse-int"));
|
|
22
|
-
var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/values"));
|
|
23
19
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
|
|
24
20
|
var _encode = _interopRequireDefault(require("./encode"));
|
|
25
21
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
@@ -172,12 +168,7 @@ function nestedSet(obj, key, value) {
|
|
|
172
168
|
function commitServerChanges(serverData, objectCache, changes) {
|
|
173
169
|
const ParseObject = _CoreManager.default.getParseObject();
|
|
174
170
|
for (const attr in changes) {
|
|
175
|
-
|
|
176
|
-
let val = changes[attr];
|
|
177
|
-
// Check for JSON array { '0': { something }, '1': { something } }
|
|
178
|
-
if (val && typeof val === 'object' && !(0, _isArray.default)(val) && (0, _keys.default)(val).length > 0 && (0, _some.default)(_context = (0, _keys.default)(val)).call(_context, k => !isNaN((0, _parseInt2.default)(k))) && !(0, _includes.default)(_context2 = ['sentPerUTCOffset', 'failedPerUTCOffset']).call(_context2, attr)) {
|
|
179
|
-
val = (0, _values.default)(val);
|
|
180
|
-
}
|
|
171
|
+
const val = changes[attr];
|
|
181
172
|
nestedSet(serverData, attr, val);
|
|
182
173
|
if (val && typeof val === 'object' && !(val instanceof ParseObject) && !(val instanceof _ParseFile.default) && !(val instanceof _ParseRelation.default)) {
|
|
183
174
|
const json = (0, _encode.default)(val, false, true);
|
|
@@ -317,11 +317,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
317
317
|
compareTo = parserResult.result;
|
|
318
318
|
}
|
|
319
319
|
// Compare Date Object or Date String
|
|
320
|
-
if (toString.call(compareTo) === '[object Date]' || typeof compareTo === 'string' &&
|
|
321
|
-
// @ts-ignore
|
|
322
|
-
new Date(compareTo) !== 'Invalid Date' &&
|
|
323
|
-
// @ts-ignore
|
|
324
|
-
!isNaN(new Date(compareTo))) {
|
|
320
|
+
if (toString.call(compareTo) === '[object Date]' || typeof compareTo === 'string' && new Date(compareTo).toString() !== 'Invalid Date') {
|
|
325
321
|
object[key] = new Date(object[key].iso ? object[key].iso : object[key]);
|
|
326
322
|
}
|
|
327
323
|
switch (condition) {
|
|
@@ -442,7 +438,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
442
438
|
break;
|
|
443
439
|
case '$select':
|
|
444
440
|
{
|
|
445
|
-
const subQueryObjects = (0, _filter.default)(objects).call(objects, (obj,
|
|
441
|
+
const subQueryObjects = (0, _filter.default)(objects).call(objects, (obj, _index, arr) => {
|
|
446
442
|
return matchesQuery(compareTo.query.className, obj, arr, compareTo.query.where);
|
|
447
443
|
});
|
|
448
444
|
for (let i = 0; i < subQueryObjects.length; i += 1) {
|
|
@@ -453,7 +449,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
453
449
|
}
|
|
454
450
|
case '$dontSelect':
|
|
455
451
|
{
|
|
456
|
-
const subQueryObjects = (0, _filter.default)(objects).call(objects, (obj,
|
|
452
|
+
const subQueryObjects = (0, _filter.default)(objects).call(objects, (obj, _index, arr) => {
|
|
457
453
|
return matchesQuery(compareTo.query.className, obj, arr, compareTo.query.where);
|
|
458
454
|
});
|
|
459
455
|
for (let i = 0; i < subQueryObjects.length; i += 1) {
|
|
@@ -464,7 +460,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
464
460
|
}
|
|
465
461
|
case '$inQuery':
|
|
466
462
|
{
|
|
467
|
-
const subQueryObjects = (0, _filter.default)(objects).call(objects, (obj,
|
|
463
|
+
const subQueryObjects = (0, _filter.default)(objects).call(objects, (obj, _index, arr) => {
|
|
468
464
|
return matchesQuery(compareTo.className, obj, arr, compareTo.where);
|
|
469
465
|
});
|
|
470
466
|
for (let i = 0; i < subQueryObjects.length; i += 1) {
|
|
@@ -477,7 +473,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
477
473
|
}
|
|
478
474
|
case '$notInQuery':
|
|
479
475
|
{
|
|
480
|
-
const subQueryObjects = (0, _filter.default)(objects).call(objects, (obj,
|
|
476
|
+
const subQueryObjects = (0, _filter.default)(objects).call(objects, (obj, _index, arr) => {
|
|
481
477
|
return matchesQuery(compareTo.className, obj, arr, compareTo.where);
|
|
482
478
|
});
|
|
483
479
|
for (let i = 0; i < subQueryObjects.length; i += 1) {
|
package/lib/browser/Parse.js
CHANGED
|
@@ -137,9 +137,7 @@ const Parse = {
|
|
|
137
137
|
*/
|
|
138
138
|
initialize(applicationId, javaScriptKey) {
|
|
139
139
|
if ("browser" === 'browser' && _CoreManager.default.get('IS_NODE') && !process.env.SERVER_RENDERING) {
|
|
140
|
-
/* eslint-disable no-console */
|
|
141
140
|
console.log("It looks like you're using the browser version of the SDK in a " + "node.js environment. You should require('parse/node') instead.");
|
|
142
|
-
/* eslint-enable no-console */
|
|
143
141
|
}
|
|
144
142
|
Parse._initialize(applicationId, javaScriptKey);
|
|
145
143
|
},
|
|
@@ -373,7 +371,7 @@ const Parse = {
|
|
|
373
371
|
*/
|
|
374
372
|
dumpLocalDatastore() {
|
|
375
373
|
if (!this.LocalDatastore.isEnabled) {
|
|
376
|
-
console.log('Parse.enableLocalDatastore() must be called first');
|
|
374
|
+
console.log('Parse.enableLocalDatastore() must be called first');
|
|
377
375
|
return _promise.default.resolve({});
|
|
378
376
|
} else {
|
|
379
377
|
return Parse.LocalDatastore._getAllContents();
|
package/lib/browser/ParseFile.js
CHANGED
|
@@ -403,7 +403,6 @@ const DefaultController = {
|
|
|
403
403
|
throw new Error('saveFile can only be used with File-type sources.');
|
|
404
404
|
}
|
|
405
405
|
const base64Data = await new _promise.default((res, rej) => {
|
|
406
|
-
// eslint-disable-next-line no-undef
|
|
407
406
|
const reader = new FileReader();
|
|
408
407
|
reader.onload = () => res(reader.result);
|
|
409
408
|
reader.onerror = error => rej(error);
|
|
@@ -262,7 +262,7 @@ class ParseObject {
|
|
|
262
262
|
if (objectCache[attr] !== stringified) {
|
|
263
263
|
dirty[attr] = val;
|
|
264
264
|
}
|
|
265
|
-
} catch (
|
|
265
|
+
} catch (_) {
|
|
266
266
|
// Error occurred, possibly by a nested unsaved pointer in a mutable container
|
|
267
267
|
// No matter how it happened, it indicates a change in the attribute
|
|
268
268
|
dirty[attr] = val;
|
|
@@ -342,7 +342,7 @@ class ParseQuery {
|
|
|
342
342
|
_OfflineQuery.default.validateQuery(this);
|
|
343
343
|
const localDatastore = _CoreManager.default.getLocalDatastore();
|
|
344
344
|
const objects = await localDatastore._serializeObjectsFromPinName(this._localDatastorePinName);
|
|
345
|
-
let results = (0, _filter.default)(_context = (0, _map.default)(objects).call(objects, (json,
|
|
345
|
+
let results = (0, _filter.default)(_context = (0, _map.default)(objects).call(objects, (json, _index, arr) => {
|
|
346
346
|
const object = _ParseObject.default.fromJSON(json, false);
|
|
347
347
|
if (json._localId && !json.objectId) {
|
|
348
348
|
object._localId = json._localId;
|
package/lib/browser/ParseUser.js
CHANGED
|
@@ -28,7 +28,7 @@ let useXDomainRequest = false;
|
|
|
28
28
|
if (typeof XDomainRequest !== 'undefined' && !('withCredentials' in new XMLHttpRequest())) {
|
|
29
29
|
useXDomainRequest = true;
|
|
30
30
|
}
|
|
31
|
-
function ajaxIE9(method, url, data,
|
|
31
|
+
function ajaxIE9(method, url, data, _headers, options) {
|
|
32
32
|
return new _promise.default((resolve, reject) => {
|
|
33
33
|
// @ts-ignore
|
|
34
34
|
const xdr = new XDomainRequest();
|
|
@@ -291,7 +291,7 @@ const RESTController = {
|
|
|
291
291
|
try {
|
|
292
292
|
const errorJSON = JSON.parse(response.responseText);
|
|
293
293
|
error = new _ParseError.default(errorJSON.code, errorJSON.error);
|
|
294
|
-
} catch (
|
|
294
|
+
} catch (_) {
|
|
295
295
|
// If we fail to parse the error text, that's okay.
|
|
296
296
|
error = new _ParseError.default(_ParseError.default.INVALID_JSON, 'Received an error with invalid JSON from Parse: ' + response.responseText);
|
|
297
297
|
}
|
package/lib/node/CoreManager.js
CHANGED
|
@@ -106,7 +106,7 @@ const FacebookUtils = {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
if (initOptions.status && typeof console !== 'undefined') {
|
|
109
|
-
const warn = console.warn || console.log || function () {};
|
|
109
|
+
const warn = console.warn || console.log || function () {};
|
|
110
110
|
warn.call(console, 'The "status" flag passed into' + ' FB.init, when set to true, can interfere with Parse Facebook' + ' integration, so it has been suppressed. Please call' + ' FB.getLoginStatus() explicitly if you require this behavior.');
|
|
111
111
|
}
|
|
112
112
|
initOptions.status = false;
|
|
@@ -168,11 +168,7 @@ function nestedSet(obj, key, value) {
|
|
|
168
168
|
function commitServerChanges(serverData, objectCache, changes) {
|
|
169
169
|
const ParseObject = _CoreManager.default.getParseObject();
|
|
170
170
|
for (const attr in changes) {
|
|
171
|
-
|
|
172
|
-
// Check for JSON array { '0': { something }, '1': { something } }
|
|
173
|
-
if (val && typeof val === 'object' && !Array.isArray(val) && Object.keys(val).length > 0 && Object.keys(val).some(k => !isNaN(parseInt(k))) && !['sentPerUTCOffset', 'failedPerUTCOffset'].includes(attr)) {
|
|
174
|
-
val = Object.values(val);
|
|
175
|
-
}
|
|
171
|
+
const val = changes[attr];
|
|
176
172
|
nestedSet(serverData, attr, val);
|
|
177
173
|
if (val && typeof val === 'object' && !(val instanceof ParseObject) && !(val instanceof _ParseFile.default) && !(val instanceof _ParseRelation.default)) {
|
|
178
174
|
const json = (0, _encode.default)(val, false, true);
|
package/lib/node/OfflineQuery.js
CHANGED
|
@@ -311,11 +311,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
311
311
|
compareTo = parserResult.result;
|
|
312
312
|
}
|
|
313
313
|
// Compare Date Object or Date String
|
|
314
|
-
if (toString.call(compareTo) === '[object Date]' || typeof compareTo === 'string' &&
|
|
315
|
-
// @ts-ignore
|
|
316
|
-
new Date(compareTo) !== 'Invalid Date' &&
|
|
317
|
-
// @ts-ignore
|
|
318
|
-
!isNaN(new Date(compareTo))) {
|
|
314
|
+
if (toString.call(compareTo) === '[object Date]' || typeof compareTo === 'string' && new Date(compareTo).toString() !== 'Invalid Date') {
|
|
319
315
|
object[key] = new Date(object[key].iso ? object[key].iso : object[key]);
|
|
320
316
|
}
|
|
321
317
|
switch (condition) {
|
|
@@ -435,7 +431,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
435
431
|
break;
|
|
436
432
|
case '$select':
|
|
437
433
|
{
|
|
438
|
-
const subQueryObjects = objects.filter((obj,
|
|
434
|
+
const subQueryObjects = objects.filter((obj, _index, arr) => {
|
|
439
435
|
return matchesQuery(compareTo.query.className, obj, arr, compareTo.query.where);
|
|
440
436
|
});
|
|
441
437
|
for (let i = 0; i < subQueryObjects.length; i += 1) {
|
|
@@ -446,7 +442,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
446
442
|
}
|
|
447
443
|
case '$dontSelect':
|
|
448
444
|
{
|
|
449
|
-
const subQueryObjects = objects.filter((obj,
|
|
445
|
+
const subQueryObjects = objects.filter((obj, _index, arr) => {
|
|
450
446
|
return matchesQuery(compareTo.query.className, obj, arr, compareTo.query.where);
|
|
451
447
|
});
|
|
452
448
|
for (let i = 0; i < subQueryObjects.length; i += 1) {
|
|
@@ -457,7 +453,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
457
453
|
}
|
|
458
454
|
case '$inQuery':
|
|
459
455
|
{
|
|
460
|
-
const subQueryObjects = objects.filter((obj,
|
|
456
|
+
const subQueryObjects = objects.filter((obj, _index, arr) => {
|
|
461
457
|
return matchesQuery(compareTo.className, obj, arr, compareTo.where);
|
|
462
458
|
});
|
|
463
459
|
for (let i = 0; i < subQueryObjects.length; i += 1) {
|
|
@@ -470,7 +466,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
470
466
|
}
|
|
471
467
|
case '$notInQuery':
|
|
472
468
|
{
|
|
473
|
-
const subQueryObjects = objects.filter((obj,
|
|
469
|
+
const subQueryObjects = objects.filter((obj, _index, arr) => {
|
|
474
470
|
return matchesQuery(compareTo.className, obj, arr, compareTo.where);
|
|
475
471
|
});
|
|
476
472
|
for (let i = 0; i < subQueryObjects.length; i += 1) {
|
package/lib/node/Parse.js
CHANGED
|
@@ -360,7 +360,7 @@ const Parse = {
|
|
|
360
360
|
*/
|
|
361
361
|
dumpLocalDatastore() {
|
|
362
362
|
if (!this.LocalDatastore.isEnabled) {
|
|
363
|
-
console.log('Parse.enableLocalDatastore() must be called first');
|
|
363
|
+
console.log('Parse.enableLocalDatastore() must be called first');
|
|
364
364
|
return Promise.resolve({});
|
|
365
365
|
} else {
|
|
366
366
|
return Parse.LocalDatastore._getAllContents();
|
package/lib/node/ParseConfig.js
CHANGED
package/lib/node/ParseFile.js
CHANGED
|
@@ -387,7 +387,6 @@ const DefaultController = {
|
|
|
387
387
|
throw new Error('saveFile can only be used with File-type sources.');
|
|
388
388
|
}
|
|
389
389
|
const base64Data = await new Promise((res, rej) => {
|
|
390
|
-
// eslint-disable-next-line no-undef
|
|
391
390
|
const reader = new FileReader();
|
|
392
391
|
reader.onload = () => res(reader.result);
|
|
393
392
|
reader.onerror = error => rej(error);
|
package/lib/node/ParseObject.js
CHANGED
|
@@ -247,7 +247,7 @@ class ParseObject {
|
|
|
247
247
|
if (objectCache[attr] !== stringified) {
|
|
248
248
|
dirty[attr] = val;
|
|
249
249
|
}
|
|
250
|
-
} catch (
|
|
250
|
+
} catch (_) {
|
|
251
251
|
// Error occurred, possibly by a nested unsaved pointer in a mutable container
|
|
252
252
|
// No matter how it happened, it indicates a change in the attribute
|
|
253
253
|
dirty[attr] = val;
|
package/lib/node/ParseQuery.js
CHANGED
|
@@ -309,7 +309,7 @@ class ParseQuery {
|
|
|
309
309
|
_OfflineQuery.default.validateQuery(this);
|
|
310
310
|
const localDatastore = _CoreManager.default.getLocalDatastore();
|
|
311
311
|
const objects = await localDatastore._serializeObjectsFromPinName(this._localDatastorePinName);
|
|
312
|
-
let results = objects.map((json,
|
|
312
|
+
let results = objects.map((json, _index, arr) => {
|
|
313
313
|
const object = _ParseObject.default.fromJSON(json, false);
|
|
314
314
|
if (json._localId && !json.objectId) {
|
|
315
315
|
object._localId = json._localId;
|
package/lib/node/ParseUser.js
CHANGED
|
@@ -26,7 +26,7 @@ let useXDomainRequest = false;
|
|
|
26
26
|
if (typeof XDomainRequest !== 'undefined' && !('withCredentials' in new XMLHttpRequest())) {
|
|
27
27
|
useXDomainRequest = true;
|
|
28
28
|
}
|
|
29
|
-
function ajaxIE9(method, url, data,
|
|
29
|
+
function ajaxIE9(method, url, data, _headers, options) {
|
|
30
30
|
return new Promise((resolve, reject) => {
|
|
31
31
|
// @ts-ignore
|
|
32
32
|
const xdr = new XDomainRequest();
|
|
@@ -287,7 +287,7 @@ const RESTController = {
|
|
|
287
287
|
try {
|
|
288
288
|
const errorJSON = JSON.parse(response.responseText);
|
|
289
289
|
error = new _ParseError.default(errorJSON.code, errorJSON.error);
|
|
290
|
-
} catch (
|
|
290
|
+
} catch (_) {
|
|
291
291
|
// If we fail to parse the error text, that's okay.
|
|
292
292
|
error = new _ParseError.default(_ParseError.default.INVALID_JSON, 'Received an error with invalid JSON from Parse: ' + response.responseText);
|
|
293
293
|
}
|
|
@@ -150,11 +150,6 @@ function commitServerChanges(serverData, objectCache, changes) {
|
|
|
150
150
|
var ParseObject = _CoreManager.default.getParseObject();
|
|
151
151
|
for (var _attr3 in changes) {
|
|
152
152
|
var val = changes[_attr3];
|
|
153
|
-
if (val && typeof val === 'object' && !Array.isArray(val) && Object.keys(val).length > 0 && Object.keys(val).some(function (k) {
|
|
154
|
-
return !isNaN(parseInt(k));
|
|
155
|
-
}) && !['sentPerUTCOffset', 'failedPerUTCOffset'].includes(_attr3)) {
|
|
156
|
-
val = Object.values(val);
|
|
157
|
-
}
|
|
158
153
|
nestedSet(serverData, _attr3, val);
|
|
159
154
|
if (val && typeof val === 'object' && !(val instanceof ParseObject) && !(val instanceof _ParseFile.default) && !(val instanceof _ParseRelation.default)) {
|
|
160
155
|
var json = (0, _encode.default)(val, false, true);
|
|
@@ -249,7 +249,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
249
249
|
}
|
|
250
250
|
compareTo = parserResult.result;
|
|
251
251
|
}
|
|
252
|
-
if (toString.call(compareTo) === '[object Date]' || typeof compareTo === 'string' && new Date(compareTo) !== 'Invalid Date'
|
|
252
|
+
if (toString.call(compareTo) === '[object Date]' || typeof compareTo === 'string' && new Date(compareTo).toString() !== 'Invalid Date') {
|
|
253
253
|
object[key] = new Date(object[key].iso ? object[key].iso : object[key]);
|
|
254
254
|
}
|
|
255
255
|
switch (condition) {
|
|
@@ -359,7 +359,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
359
359
|
break;
|
|
360
360
|
case '$select':
|
|
361
361
|
{
|
|
362
|
-
var subQueryObjects = objects.filter(function (obj,
|
|
362
|
+
var subQueryObjects = objects.filter(function (obj, _index, arr) {
|
|
363
363
|
return matchesQuery(compareTo.query.className, obj, arr, compareTo.query.where);
|
|
364
364
|
});
|
|
365
365
|
for (var _i = 0; _i < subQueryObjects.length; _i += 1) {
|
|
@@ -370,7 +370,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
370
370
|
}
|
|
371
371
|
case '$dontSelect':
|
|
372
372
|
{
|
|
373
|
-
var _subQueryObjects = objects.filter(function (obj,
|
|
373
|
+
var _subQueryObjects = objects.filter(function (obj, _index, arr) {
|
|
374
374
|
return matchesQuery(compareTo.query.className, obj, arr, compareTo.query.where);
|
|
375
375
|
});
|
|
376
376
|
for (var _i2 = 0; _i2 < _subQueryObjects.length; _i2 += 1) {
|
|
@@ -381,7 +381,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
381
381
|
}
|
|
382
382
|
case '$inQuery':
|
|
383
383
|
{
|
|
384
|
-
var _subQueryObjects2 = objects.filter(function (obj,
|
|
384
|
+
var _subQueryObjects2 = objects.filter(function (obj, _index, arr) {
|
|
385
385
|
return matchesQuery(compareTo.className, obj, arr, compareTo.where);
|
|
386
386
|
});
|
|
387
387
|
for (var _i3 = 0; _i3 < _subQueryObjects2.length; _i3 += 1) {
|
|
@@ -394,7 +394,7 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
394
394
|
}
|
|
395
395
|
case '$notInQuery':
|
|
396
396
|
{
|
|
397
|
-
var _subQueryObjects3 = objects.filter(function (obj,
|
|
397
|
+
var _subQueryObjects3 = objects.filter(function (obj, _index, arr) {
|
|
398
398
|
return matchesQuery(compareTo.className, obj, arr, compareTo.where);
|
|
399
399
|
});
|
|
400
400
|
for (var _i4 = 0; _i4 < _subQueryObjects3.length; _i4 += 1) {
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
exports.default = void 0;
|
|
6
6
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
7
7
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
|
+
var _readOnlyError2 = _interopRequireDefault(require("@babel/runtime/helpers/readOnlyError"));
|
|
8
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
11
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
@@ -189,7 +190,7 @@ var ParseObject = function () {
|
|
|
189
190
|
if (objectCache[attr] !== stringified) {
|
|
190
191
|
dirty[attr] = val;
|
|
191
192
|
}
|
|
192
|
-
} catch (
|
|
193
|
+
} catch (_) {
|
|
193
194
|
dirty[attr] = val;
|
|
194
195
|
}
|
|
195
196
|
}
|
|
@@ -199,7 +199,7 @@ var ParseQuery = function () {
|
|
|
199
199
|
_OfflineQuery.default.validateQuery(this);
|
|
200
200
|
var localDatastore = _CoreManager.default.getLocalDatastore();
|
|
201
201
|
var objects = yield localDatastore._serializeObjectsFromPinName(this._localDatastorePinName);
|
|
202
|
-
var results = objects.map(function (json,
|
|
202
|
+
var results = objects.map(function (json, _index, arr) {
|
|
203
203
|
var object = _ParseObject.default.fromJSON(json, false);
|
|
204
204
|
if (json._localId && !json.objectId) {
|
|
205
205
|
object._localId = json._localId;
|
|
@@ -16,7 +16,7 @@ var useXDomainRequest = false;
|
|
|
16
16
|
if (typeof XDomainRequest !== 'undefined' && !('withCredentials' in new XMLHttpRequest())) {
|
|
17
17
|
useXDomainRequest = true;
|
|
18
18
|
}
|
|
19
|
-
function ajaxIE9(method, url, data,
|
|
19
|
+
function ajaxIE9(method, url, data, _headers, options) {
|
|
20
20
|
return new Promise(function (resolve, reject) {
|
|
21
21
|
var xdr = new XDomainRequest();
|
|
22
22
|
xdr.onload = function () {
|
|
@@ -62,7 +62,7 @@ var RESTController = {
|
|
|
62
62
|
var isIdempotent = _CoreManager.default.get('IDEMPOTENCY') && ['POST', 'PUT'].includes(method);
|
|
63
63
|
var requestId = isIdempotent ? (0, _uuid.default)() : '';
|
|
64
64
|
var attempts = 0;
|
|
65
|
-
|
|
65
|
+
var _dispatch = function () {
|
|
66
66
|
if (XHR == null) {
|
|
67
67
|
throw new Error('Cannot make a request: No definition of XMLHttpRequest was found.');
|
|
68
68
|
}
|
|
@@ -101,7 +101,7 @@ var RESTController = {
|
|
|
101
101
|
} else if (xhr.status >= 500 || xhr.status === 0) {
|
|
102
102
|
if (++attempts < _CoreManager.default.get('REQUEST_ATTEMPT_LIMIT')) {
|
|
103
103
|
var delay = Math.round(Math.random() * 125 * Math.pow(2, attempts));
|
|
104
|
-
setTimeout(
|
|
104
|
+
setTimeout(_dispatch, delay);
|
|
105
105
|
} else if (xhr.status === 0) {
|
|
106
106
|
promise.reject('Unable to connect to the Parse API');
|
|
107
107
|
} else {
|
|
@@ -129,7 +129,7 @@ var RESTController = {
|
|
|
129
129
|
headers[key] = customHeaders[key];
|
|
130
130
|
}
|
|
131
131
|
if (options && typeof options.progress === 'function') {
|
|
132
|
-
var handleProgress = function
|
|
132
|
+
var handleProgress = function (type, event) {
|
|
133
133
|
if (event.lengthComputable) {
|
|
134
134
|
options.progress(event.loaded / event.total, event.loaded, event.total, {
|
|
135
135
|
type: type
|
|
@@ -166,10 +166,11 @@ var RESTController = {
|
|
|
166
166
|
if (options && typeof options.requestTask === 'function') {
|
|
167
167
|
options.requestTask(xhr);
|
|
168
168
|
}
|
|
169
|
-
}
|
|
169
|
+
};
|
|
170
|
+
_dispatch();
|
|
170
171
|
return promise;
|
|
171
172
|
},
|
|
172
|
-
request: function
|
|
173
|
+
request: function (method, path, data, options) {
|
|
173
174
|
options = options || {};
|
|
174
175
|
var url = _CoreManager.default.get('SERVER_URL');
|
|
175
176
|
if (url[url.length - 1] !== '/') {
|
|
@@ -255,13 +256,13 @@ var RESTController = {
|
|
|
255
256
|
});
|
|
256
257
|
}).catch(RESTController.handleError);
|
|
257
258
|
},
|
|
258
|
-
handleError: function
|
|
259
|
+
handleError: function (response) {
|
|
259
260
|
var error;
|
|
260
261
|
if (response && response.responseText) {
|
|
261
262
|
try {
|
|
262
263
|
var errorJSON = JSON.parse(response.responseText);
|
|
263
264
|
error = new _ParseError.default(errorJSON.code, errorJSON.error);
|
|
264
|
-
} catch (
|
|
265
|
+
} catch (_) {
|
|
265
266
|
error = new _ParseError.default(_ParseError.default.INVALID_JSON, 'Received an error with invalid JSON from Parse: ' + response.responseText);
|
|
266
267
|
}
|
|
267
268
|
} else {
|
|
@@ -270,10 +271,10 @@ var RESTController = {
|
|
|
270
271
|
}
|
|
271
272
|
return Promise.reject(error);
|
|
272
273
|
},
|
|
273
|
-
_setXHR: function
|
|
274
|
+
_setXHR: function (xhr) {
|
|
274
275
|
XHR = xhr;
|
|
275
276
|
},
|
|
276
|
-
_getXHR: function
|
|
277
|
+
_getXHR: function () {
|
|
277
278
|
return XHR;
|
|
278
279
|
}
|
|
279
280
|
};
|
package/lib/weapp/CoreManager.js
CHANGED
|
@@ -103,7 +103,7 @@ const FacebookUtils = {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
if (initOptions.status && typeof console !== 'undefined') {
|
|
106
|
-
const warn = console.warn || console.log || function () {};
|
|
106
|
+
const warn = console.warn || console.log || function () {};
|
|
107
107
|
warn.call(console, 'The "status" flag passed into' + ' FB.init, when set to true, can interfere with Parse Facebook' + ' integration, so it has been suppressed. Please call' + ' FB.getLoginStatus() explicitly if you require this behavior.');
|
|
108
108
|
}
|
|
109
109
|
initOptions.status = false;
|