parse 3.5.0-alpha.4 → 3.5.0-alpha.6
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 +37 -12
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +642 -962
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/IndexedDBStorageController.js +6 -2
- package/lib/browser/OfflineQuery.js +29 -8
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/IndexedDBStorageController.js +6 -2
- package/lib/node/OfflineQuery.js +18 -3
- package/lib/node/Parse.js +0 -1
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/IndexedDBStorageController.js +4 -2
- package/lib/react-native/OfflineQuery.js +28 -7
- package/lib/react-native/Parse.js +0 -1
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/IndexedDBStorageController.js +6 -2
- package/lib/weapp/OfflineQuery.js +29 -8
- package/lib/weapp/Parse.js +0 -1
- package/package.json +1 -1
|
@@ -7,8 +7,10 @@ var _idbKeyval = require("idb-keyval");
|
|
|
7
7
|
* @flow
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
/* global window */
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
if (typeof window !== 'undefined' && window.indexedDB) {
|
|
12
14
|
var ParseStore = (0, _idbKeyval.createStore)('parseDB', 'parseStore');
|
|
13
15
|
var IndexedDBStorageController = {
|
|
14
16
|
async: 1,
|
|
@@ -37,5 +39,7 @@ try {
|
|
|
37
39
|
}
|
|
38
40
|
};
|
|
39
41
|
module.exports = IndexedDBStorageController;
|
|
40
|
-
}
|
|
42
|
+
} else {
|
|
43
|
+
// IndexedDB not supported
|
|
44
|
+
module.exports = undefined;
|
|
41
45
|
}
|
|
@@ -729,21 +729,42 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
729
729
|
|
|
730
730
|
case '$geoWithin':
|
|
731
731
|
{
|
|
732
|
-
|
|
732
|
+
if (compareTo.$polygon) {
|
|
733
|
+
var _context4;
|
|
734
|
+
|
|
735
|
+
var points = (0, _map.default)(_context4 = compareTo.$polygon).call(_context4, function (geoPoint) {
|
|
736
|
+
return [geoPoint.latitude, geoPoint.longitude];
|
|
737
|
+
});
|
|
738
|
+
var polygon = new ParsePolygon(points);
|
|
739
|
+
return polygon.containsPoint(object[key]);
|
|
740
|
+
}
|
|
733
741
|
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
742
|
+
if (compareTo.$centerSphere) {
|
|
743
|
+
var _compareTo$$centerSph = (0, _slicedToArray2.default)(compareTo.$centerSphere, 2),
|
|
744
|
+
WGS84Point = _compareTo$$centerSph[0],
|
|
745
|
+
maxDistance = _compareTo$$centerSph[1];
|
|
746
|
+
|
|
747
|
+
var centerPoint = new ParseGeoPoint({
|
|
748
|
+
latitude: WGS84Point[1],
|
|
749
|
+
longitude: WGS84Point[0]
|
|
750
|
+
});
|
|
751
|
+
var point = new ParseGeoPoint(object[key]);
|
|
752
|
+
|
|
753
|
+
var _distance = point.radiansTo(centerPoint);
|
|
754
|
+
|
|
755
|
+
return _distance <= maxDistance;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
break;
|
|
739
759
|
}
|
|
740
760
|
|
|
741
761
|
case '$geoIntersects':
|
|
742
762
|
{
|
|
743
763
|
var _polygon = new ParsePolygon(object[key].coordinates);
|
|
744
764
|
|
|
745
|
-
var
|
|
746
|
-
|
|
765
|
+
var _point = new ParseGeoPoint(compareTo.$point);
|
|
766
|
+
|
|
767
|
+
return _polygon.containsPoint(_point);
|
|
747
768
|
}
|
|
748
769
|
|
|
749
770
|
default:
|
package/lib/node/CoreManager.js
CHANGED
|
@@ -5,8 +5,10 @@ var _idbKeyval = require("idb-keyval");
|
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
/* global window */
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
if (typeof window !== 'undefined' && window.indexedDB) {
|
|
10
12
|
const ParseStore = (0, _idbKeyval.createStore)('parseDB', 'parseStore');
|
|
11
13
|
module.exports = {
|
|
12
14
|
async: 1,
|
|
@@ -40,5 +42,7 @@ try {
|
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
};
|
|
43
|
-
}
|
|
45
|
+
} else {
|
|
46
|
+
// IndexedDB not supported
|
|
47
|
+
module.exports = undefined;
|
|
44
48
|
}
|
package/lib/node/OfflineQuery.js
CHANGED
|
@@ -590,9 +590,24 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
590
590
|
|
|
591
591
|
case '$geoWithin':
|
|
592
592
|
{
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
593
|
+
if (compareTo.$polygon) {
|
|
594
|
+
const points = compareTo.$polygon.map(geoPoint => [geoPoint.latitude, geoPoint.longitude]);
|
|
595
|
+
const polygon = new ParsePolygon(points);
|
|
596
|
+
return polygon.containsPoint(object[key]);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
if (compareTo.$centerSphere) {
|
|
600
|
+
const [WGS84Point, maxDistance] = compareTo.$centerSphere;
|
|
601
|
+
const centerPoint = new ParseGeoPoint({
|
|
602
|
+
latitude: WGS84Point[1],
|
|
603
|
+
longitude: WGS84Point[0]
|
|
604
|
+
});
|
|
605
|
+
const point = new ParseGeoPoint(object[key]);
|
|
606
|
+
const distance = point.radiansTo(centerPoint);
|
|
607
|
+
return distance <= maxDistance;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
break;
|
|
596
611
|
}
|
|
597
612
|
|
|
598
613
|
case '$geoIntersects':
|
package/lib/node/Parse.js
CHANGED
|
@@ -328,7 +328,6 @@ Parse.Storage = require('./Storage');
|
|
|
328
328
|
Parse.User = require('./ParseUser').default;
|
|
329
329
|
Parse.LiveQuery = require('./ParseLiveQuery').default;
|
|
330
330
|
Parse.LiveQueryClient = require('./LiveQueryClient').default;
|
|
331
|
-
Parse.IndexedDB = require('./IndexedDBStorageController');
|
|
332
331
|
|
|
333
332
|
Parse._request = function (...args) {
|
|
334
333
|
return _CoreManager.default.getRESTController().request.apply(null, args);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _idbKeyval = require("idb-keyval");
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
if (typeof window !== 'undefined' && window.indexedDB) {
|
|
4
4
|
var ParseStore = (0, _idbKeyval.createStore)('parseDB', 'parseStore');
|
|
5
5
|
var IndexedDBStorageController = {
|
|
6
6
|
async: 1,
|
|
@@ -21,4 +21,6 @@ try {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
module.exports = IndexedDBStorageController;
|
|
24
|
-
}
|
|
24
|
+
} else {
|
|
25
|
+
module.exports = undefined;
|
|
26
|
+
}
|
|
@@ -567,19 +567,40 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
567
567
|
|
|
568
568
|
case '$geoWithin':
|
|
569
569
|
{
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
570
|
+
if (compareTo.$polygon) {
|
|
571
|
+
var points = compareTo.$polygon.map(function (geoPoint) {
|
|
572
|
+
return [geoPoint.latitude, geoPoint.longitude];
|
|
573
|
+
});
|
|
574
|
+
var polygon = new ParsePolygon(points);
|
|
575
|
+
return polygon.containsPoint(object[key]);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
if (compareTo.$centerSphere) {
|
|
579
|
+
var _compareTo$$centerSph = (0, _slicedToArray2.default)(compareTo.$centerSphere, 2),
|
|
580
|
+
WGS84Point = _compareTo$$centerSph[0],
|
|
581
|
+
maxDistance = _compareTo$$centerSph[1];
|
|
582
|
+
|
|
583
|
+
var centerPoint = new ParseGeoPoint({
|
|
584
|
+
latitude: WGS84Point[1],
|
|
585
|
+
longitude: WGS84Point[0]
|
|
586
|
+
});
|
|
587
|
+
var point = new ParseGeoPoint(object[key]);
|
|
588
|
+
|
|
589
|
+
var _distance = point.radiansTo(centerPoint);
|
|
590
|
+
|
|
591
|
+
return _distance <= maxDistance;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
break;
|
|
575
595
|
}
|
|
576
596
|
|
|
577
597
|
case '$geoIntersects':
|
|
578
598
|
{
|
|
579
599
|
var _polygon = new ParsePolygon(object[key].coordinates);
|
|
580
600
|
|
|
581
|
-
var
|
|
582
|
-
|
|
601
|
+
var _point = new ParseGeoPoint(compareTo.$point);
|
|
602
|
+
|
|
603
|
+
return _polygon.containsPoint(_point);
|
|
583
604
|
}
|
|
584
605
|
|
|
585
606
|
default:
|
|
@@ -213,7 +213,6 @@ Parse.Storage = require('./Storage');
|
|
|
213
213
|
Parse.User = require('./ParseUser').default;
|
|
214
214
|
Parse.LiveQuery = require('./ParseLiveQuery').default;
|
|
215
215
|
Parse.LiveQueryClient = require('./LiveQueryClient').default;
|
|
216
|
-
Parse.IndexedDB = require('./IndexedDBStorageController');
|
|
217
216
|
|
|
218
217
|
Parse._request = function () {
|
|
219
218
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
package/lib/weapp/CoreManager.js
CHANGED
|
@@ -7,8 +7,10 @@ var _idbKeyval = require("idb-keyval");
|
|
|
7
7
|
* @flow
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
/* global window */
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
if (typeof window !== 'undefined' && window.indexedDB) {
|
|
12
14
|
var ParseStore = (0, _idbKeyval.createStore)('parseDB', 'parseStore');
|
|
13
15
|
var IndexedDBStorageController = {
|
|
14
16
|
async: 1,
|
|
@@ -37,5 +39,7 @@ try {
|
|
|
37
39
|
}
|
|
38
40
|
};
|
|
39
41
|
module.exports = IndexedDBStorageController;
|
|
40
|
-
}
|
|
42
|
+
} else {
|
|
43
|
+
// IndexedDB not supported
|
|
44
|
+
module.exports = undefined;
|
|
41
45
|
}
|
|
@@ -729,21 +729,42 @@ function matchesKeyConstraints(className, object, objects, key, constraints) {
|
|
|
729
729
|
|
|
730
730
|
case '$geoWithin':
|
|
731
731
|
{
|
|
732
|
-
|
|
732
|
+
if (compareTo.$polygon) {
|
|
733
|
+
var _context4;
|
|
734
|
+
|
|
735
|
+
var points = (0, _map.default)(_context4 = compareTo.$polygon).call(_context4, function (geoPoint) {
|
|
736
|
+
return [geoPoint.latitude, geoPoint.longitude];
|
|
737
|
+
});
|
|
738
|
+
var polygon = new ParsePolygon(points);
|
|
739
|
+
return polygon.containsPoint(object[key]);
|
|
740
|
+
}
|
|
733
741
|
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
742
|
+
if (compareTo.$centerSphere) {
|
|
743
|
+
var _compareTo$$centerSph = (0, _slicedToArray2.default)(compareTo.$centerSphere, 2),
|
|
744
|
+
WGS84Point = _compareTo$$centerSph[0],
|
|
745
|
+
maxDistance = _compareTo$$centerSph[1];
|
|
746
|
+
|
|
747
|
+
var centerPoint = new ParseGeoPoint({
|
|
748
|
+
latitude: WGS84Point[1],
|
|
749
|
+
longitude: WGS84Point[0]
|
|
750
|
+
});
|
|
751
|
+
var point = new ParseGeoPoint(object[key]);
|
|
752
|
+
|
|
753
|
+
var _distance = point.radiansTo(centerPoint);
|
|
754
|
+
|
|
755
|
+
return _distance <= maxDistance;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
break;
|
|
739
759
|
}
|
|
740
760
|
|
|
741
761
|
case '$geoIntersects':
|
|
742
762
|
{
|
|
743
763
|
var _polygon = new ParsePolygon(object[key].coordinates);
|
|
744
764
|
|
|
745
|
-
var
|
|
746
|
-
|
|
765
|
+
var _point = new ParseGeoPoint(compareTo.$point);
|
|
766
|
+
|
|
767
|
+
return _polygon.containsPoint(_point);
|
|
747
768
|
}
|
|
748
769
|
|
|
749
770
|
default:
|
package/lib/weapp/Parse.js
CHANGED
|
@@ -332,7 +332,6 @@ Parse.Storage = require('./Storage');
|
|
|
332
332
|
Parse.User = require('./ParseUser').default;
|
|
333
333
|
Parse.LiveQuery = require('./ParseLiveQuery').default;
|
|
334
334
|
Parse.LiveQueryClient = require('./LiveQueryClient').default;
|
|
335
|
-
Parse.IndexedDB = require('./IndexedDBStorageController');
|
|
336
335
|
|
|
337
336
|
Parse._request = function () {
|
|
338
337
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|