parse 3.5.0 → 3.5.1-alpha.2
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/README.md +2 -1
- package/dist/parse.js +422 -347
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +422 -347
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/EventuallyQueue.js +31 -27
- package/lib/browser/LiveQueryClient.js +6 -2
- package/lib/browser/LocalDatastore.js +20 -20
- package/lib/browser/LocalDatastoreController.js +16 -14
- package/lib/browser/LocalDatastoreController.react-native.js +10 -10
- package/lib/browser/ParseCLP.js +32 -32
- package/lib/browser/ParseFile.js +27 -15
- package/lib/browser/ParseLiveQuery.js +6 -6
- package/lib/browser/ParseObject.js +84 -69
- package/lib/browser/ParseOp.js +3 -1
- package/lib/browser/ParseQuery.js +115 -88
- package/lib/browser/ParseUser.js +74 -64
- package/lib/browser/RESTController.js +6 -7
- package/lib/browser/StorageController.react-native.js +7 -12
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/ParseFile.js +1 -0
- package/lib/node/ParseQuery.js +3 -1
- package/lib/node/StorageController.react-native.js +7 -13
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/LiveQueryClient.js +6 -2
- package/lib/react-native/LocalDatastore.js +3 -2
- package/lib/react-native/ParseCLP.js +32 -32
- package/lib/react-native/ParseFile.js +10 -3
- package/lib/react-native/ParseObject.js +14 -9
- package/lib/react-native/ParseOp.js +3 -1
- package/lib/react-native/ParseQuery.js +21 -7
- package/lib/react-native/RESTController.js +6 -7
- package/lib/react-native/StorageController.react-native.js +7 -10
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/EventuallyQueue.js +31 -27
- package/lib/weapp/LiveQueryClient.js +6 -2
- package/lib/weapp/LocalDatastore.js +20 -20
- package/lib/weapp/LocalDatastoreController.js +16 -14
- package/lib/weapp/LocalDatastoreController.react-native.js +10 -10
- package/lib/weapp/ParseCLP.js +32 -32
- package/lib/weapp/ParseFile.js +27 -15
- package/lib/weapp/ParseLiveQuery.js +6 -6
- package/lib/weapp/ParseObject.js +84 -69
- package/lib/weapp/ParseOp.js +3 -1
- package/lib/weapp/ParseQuery.js +115 -88
- package/lib/weapp/ParseUser.js +74 -64
- package/lib/weapp/RESTController.js +6 -7
- package/lib/weapp/StorageController.react-native.js +7 -12
- package/package.json +3 -2
|
@@ -4,12 +4,9 @@ var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
|
4
4
|
|
|
5
5
|
var StorageController = {
|
|
6
6
|
async: 1,
|
|
7
|
-
getAsyncStorage: function () {
|
|
8
|
-
return _CoreManager.default.getAsyncStorage();
|
|
9
|
-
},
|
|
10
7
|
getItemAsync: function (path) {
|
|
11
8
|
return new Promise(function (resolve, reject) {
|
|
12
|
-
|
|
9
|
+
_CoreManager.default.getAsyncStorage().getItem(path, function (err, value) {
|
|
13
10
|
if (err) {
|
|
14
11
|
reject(err);
|
|
15
12
|
} else {
|
|
@@ -20,7 +17,7 @@ var StorageController = {
|
|
|
20
17
|
},
|
|
21
18
|
setItemAsync: function (path, value) {
|
|
22
19
|
return new Promise(function (resolve, reject) {
|
|
23
|
-
|
|
20
|
+
_CoreManager.default.getAsyncStorage().setItem(path, value, function (err, value) {
|
|
24
21
|
if (err) {
|
|
25
22
|
reject(err);
|
|
26
23
|
} else {
|
|
@@ -31,7 +28,7 @@ var StorageController = {
|
|
|
31
28
|
},
|
|
32
29
|
removeItemAsync: function (path) {
|
|
33
30
|
return new Promise(function (resolve, reject) {
|
|
34
|
-
|
|
31
|
+
_CoreManager.default.getAsyncStorage().removeItem(path, function (err) {
|
|
35
32
|
if (err) {
|
|
36
33
|
reject(err);
|
|
37
34
|
} else {
|
|
@@ -42,7 +39,7 @@ var StorageController = {
|
|
|
42
39
|
},
|
|
43
40
|
getAllKeysAsync: function () {
|
|
44
41
|
return new Promise(function (resolve, reject) {
|
|
45
|
-
|
|
42
|
+
_CoreManager.default.getAsyncStorage().getAllKeys(function (err, keys) {
|
|
46
43
|
if (err) {
|
|
47
44
|
reject(err);
|
|
48
45
|
} else {
|
|
@@ -53,7 +50,7 @@ var StorageController = {
|
|
|
53
50
|
},
|
|
54
51
|
multiGet: function (keys) {
|
|
55
52
|
return new Promise(function (resolve, reject) {
|
|
56
|
-
|
|
53
|
+
_CoreManager.default.getAsyncStorage().multiGet(keys, function (err, result) {
|
|
57
54
|
if (err) {
|
|
58
55
|
reject(err);
|
|
59
56
|
} else {
|
|
@@ -64,7 +61,7 @@ var StorageController = {
|
|
|
64
61
|
},
|
|
65
62
|
multiRemove: function (keys) {
|
|
66
63
|
return new Promise(function (resolve, reject) {
|
|
67
|
-
|
|
64
|
+
_CoreManager.default.getAsyncStorage().multiRemove(keys, function (err) {
|
|
68
65
|
if (err) {
|
|
69
66
|
reject(err);
|
|
70
67
|
} else {
|
|
@@ -74,7 +71,7 @@ var StorageController = {
|
|
|
74
71
|
});
|
|
75
72
|
},
|
|
76
73
|
clear: function () {
|
|
77
|
-
return
|
|
74
|
+
return _CoreManager.default.getAsyncStorage().clear();
|
|
78
75
|
}
|
|
79
76
|
};
|
|
80
77
|
module.exports = StorageController;
|
package/lib/weapp/CoreManager.js
CHANGED
|
@@ -509,7 +509,7 @@ var EventuallyQueue = {
|
|
|
509
509
|
|
|
510
510
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
511
511
|
var queueData, queueId, index, prop;
|
|
512
|
-
return _regeneratorRuntime().wrap(function (_context) {
|
|
512
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
513
513
|
while (1) {
|
|
514
514
|
switch (_context.prev = _context.next) {
|
|
515
515
|
case 0:
|
|
@@ -552,10 +552,10 @@ var EventuallyQueue = {
|
|
|
552
552
|
}, _callee);
|
|
553
553
|
}))();
|
|
554
554
|
},
|
|
555
|
-
store: function (data) {
|
|
555
|
+
store: function store(data) {
|
|
556
556
|
return _Storage.default.setItemAsync(QUEUE_KEY, (0, _stringify.default)(data));
|
|
557
557
|
},
|
|
558
|
-
load: function () {
|
|
558
|
+
load: function load() {
|
|
559
559
|
return _Storage.default.getItemAsync(QUEUE_KEY);
|
|
560
560
|
},
|
|
561
561
|
|
|
@@ -567,11 +567,13 @@ var EventuallyQueue = {
|
|
|
567
567
|
* @returns {Promise<Array>}
|
|
568
568
|
* @static
|
|
569
569
|
*/
|
|
570
|
-
getQueue: function ()
|
|
570
|
+
getQueue: function getQueue()
|
|
571
571
|
/*: Promise<Array>*/
|
|
572
572
|
{
|
|
573
|
+
var _this2 = this;
|
|
574
|
+
|
|
573
575
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
574
|
-
return _regeneratorRuntime().wrap(function (_context2) {
|
|
576
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
575
577
|
while (1) {
|
|
576
578
|
switch (_context2.prev = _context2.next) {
|
|
577
579
|
case 0:
|
|
@@ -582,7 +584,7 @@ var EventuallyQueue = {
|
|
|
582
584
|
|
|
583
585
|
_context2.t0 = JSON;
|
|
584
586
|
_context2.next = 4;
|
|
585
|
-
return
|
|
587
|
+
return _this2.load();
|
|
586
588
|
|
|
587
589
|
case 4:
|
|
588
590
|
_context2.t1 = _context2.sent;
|
|
@@ -619,7 +621,7 @@ var EventuallyQueue = {
|
|
|
619
621
|
* @static
|
|
620
622
|
* @ignore
|
|
621
623
|
*/
|
|
622
|
-
setQueue: function (queue
|
|
624
|
+
setQueue: function setQueue(queue
|
|
623
625
|
/*: Queue*/
|
|
624
626
|
)
|
|
625
627
|
/*: Promise<void>*/
|
|
@@ -636,7 +638,7 @@ var EventuallyQueue = {
|
|
|
636
638
|
* @static
|
|
637
639
|
* @ignore
|
|
638
640
|
*/
|
|
639
|
-
remove: function (queueId
|
|
641
|
+
remove: function remove(queueId
|
|
640
642
|
/*: string*/
|
|
641
643
|
)
|
|
642
644
|
/*: Promise<void>*/
|
|
@@ -645,7 +647,7 @@ var EventuallyQueue = {
|
|
|
645
647
|
|
|
646
648
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
647
649
|
var queueData, index;
|
|
648
|
-
return _regeneratorRuntime().wrap(function (_context3) {
|
|
650
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
649
651
|
while (1) {
|
|
650
652
|
switch (_context3.prev = _context3.next) {
|
|
651
653
|
case 0:
|
|
@@ -682,7 +684,7 @@ var EventuallyQueue = {
|
|
|
682
684
|
* @returns {Promise} A promise that is fulfilled when queue is cleared.
|
|
683
685
|
* @static
|
|
684
686
|
*/
|
|
685
|
-
clear: function ()
|
|
687
|
+
clear: function clear()
|
|
686
688
|
/*: Promise*/
|
|
687
689
|
{
|
|
688
690
|
queueCache = [];
|
|
@@ -698,7 +700,7 @@ var EventuallyQueue = {
|
|
|
698
700
|
* @static
|
|
699
701
|
* @ignore
|
|
700
702
|
*/
|
|
701
|
-
queueItemExists: function (queue
|
|
703
|
+
queueItemExists: function queueItemExists(queue
|
|
702
704
|
/*: Queue*/
|
|
703
705
|
, queueId
|
|
704
706
|
/*: string*/
|
|
@@ -718,17 +720,19 @@ var EventuallyQueue = {
|
|
|
718
720
|
* @returns {number}
|
|
719
721
|
* @static
|
|
720
722
|
*/
|
|
721
|
-
length: function ()
|
|
723
|
+
length: function length()
|
|
722
724
|
/*: number*/
|
|
723
725
|
{
|
|
726
|
+
var _this4 = this;
|
|
727
|
+
|
|
724
728
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
725
729
|
var queueData;
|
|
726
|
-
return _regeneratorRuntime().wrap(function (_context4) {
|
|
730
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
727
731
|
while (1) {
|
|
728
732
|
switch (_context4.prev = _context4.next) {
|
|
729
733
|
case 0:
|
|
730
734
|
_context4.next = 2;
|
|
731
|
-
return
|
|
735
|
+
return _this4.getQueue();
|
|
732
736
|
|
|
733
737
|
case 2:
|
|
734
738
|
queueData = _context4.sent;
|
|
@@ -751,14 +755,14 @@ var EventuallyQueue = {
|
|
|
751
755
|
* @returns {Promise<boolean>} Returns true if queue was sent successfully.
|
|
752
756
|
* @static
|
|
753
757
|
*/
|
|
754
|
-
sendQueue: function ()
|
|
758
|
+
sendQueue: function sendQueue()
|
|
755
759
|
/*: Promise<boolean>*/
|
|
756
760
|
{
|
|
757
761
|
var _this5 = this;
|
|
758
762
|
|
|
759
763
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
760
764
|
var queue, queueData, i, queueObject, id, hash, className, ObjectType;
|
|
761
|
-
return _regeneratorRuntime().wrap(function (_context5) {
|
|
765
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
762
766
|
while (1) {
|
|
763
767
|
switch (_context5.prev = _context5.next) {
|
|
764
768
|
case 0:
|
|
@@ -844,7 +848,7 @@ var EventuallyQueue = {
|
|
|
844
848
|
* @static
|
|
845
849
|
* @ignore
|
|
846
850
|
*/
|
|
847
|
-
sendQueueCallback: function (object
|
|
851
|
+
sendQueueCallback: function sendQueueCallback(object
|
|
848
852
|
/*: ParseObject*/
|
|
849
853
|
, queueObject
|
|
850
854
|
/*: QueueObject*/
|
|
@@ -854,7 +858,7 @@ var EventuallyQueue = {
|
|
|
854
858
|
var _this6 = this;
|
|
855
859
|
|
|
856
860
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
857
|
-
return _regeneratorRuntime().wrap(function (_context6) {
|
|
861
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
858
862
|
while (1) {
|
|
859
863
|
switch (_context6.prev = _context6.next) {
|
|
860
864
|
case 0:
|
|
@@ -952,7 +956,7 @@ var EventuallyQueue = {
|
|
|
952
956
|
* @param [ms] Milliseconds to ping the server. Default 2000ms
|
|
953
957
|
* @static
|
|
954
958
|
*/
|
|
955
|
-
poll: function () {
|
|
959
|
+
poll: function poll() {
|
|
956
960
|
var _this7 = this;
|
|
957
961
|
|
|
958
962
|
var ms
|
|
@@ -987,7 +991,7 @@ var EventuallyQueue = {
|
|
|
987
991
|
* @name Parse.EventuallyQueue.stopPoll
|
|
988
992
|
* @static
|
|
989
993
|
*/
|
|
990
|
-
stopPoll: function () {
|
|
994
|
+
stopPoll: function stopPoll() {
|
|
991
995
|
clearInterval(polling);
|
|
992
996
|
polling = undefined;
|
|
993
997
|
},
|
|
@@ -1000,25 +1004,25 @@ var EventuallyQueue = {
|
|
|
1000
1004
|
* @returns {boolean}
|
|
1001
1005
|
* @static
|
|
1002
1006
|
*/
|
|
1003
|
-
isPolling: function ()
|
|
1007
|
+
isPolling: function isPolling()
|
|
1004
1008
|
/*: boolean*/
|
|
1005
1009
|
{
|
|
1006
1010
|
return !!polling;
|
|
1007
1011
|
},
|
|
1008
|
-
_setPolling: function (flag
|
|
1012
|
+
_setPolling: function _setPolling(flag
|
|
1009
1013
|
/*: boolean*/
|
|
1010
1014
|
) {
|
|
1011
1015
|
polling = flag;
|
|
1012
1016
|
},
|
|
1013
1017
|
process: {
|
|
1014
|
-
create: function (ObjectType, queueObject) {
|
|
1018
|
+
create: function create(ObjectType, queueObject) {
|
|
1015
1019
|
var object = new ObjectType();
|
|
1016
1020
|
return EventuallyQueue.sendQueueCallback(object, queueObject);
|
|
1017
1021
|
},
|
|
1018
|
-
byId: function (ObjectType, queueObject) {
|
|
1022
|
+
byId: function byId(ObjectType, queueObject) {
|
|
1019
1023
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
1020
1024
|
var sessionToken, query, results;
|
|
1021
|
-
return _regeneratorRuntime().wrap(function (_context7) {
|
|
1025
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
1022
1026
|
while (1) {
|
|
1023
1027
|
switch (_context7.prev = _context7.next) {
|
|
1024
1028
|
case 0:
|
|
@@ -1042,10 +1046,10 @@ var EventuallyQueue = {
|
|
|
1042
1046
|
}, _callee7);
|
|
1043
1047
|
}))();
|
|
1044
1048
|
},
|
|
1045
|
-
byHash: function (ObjectType, queueObject) {
|
|
1049
|
+
byHash: function byHash(ObjectType, queueObject) {
|
|
1046
1050
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
1047
1051
|
var sessionToken, query, results;
|
|
1048
|
-
return _regeneratorRuntime().wrap(function (_context8) {
|
|
1052
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
1049
1053
|
while (1) {
|
|
1050
1054
|
switch (_context8.prev = _context8.next) {
|
|
1051
1055
|
case 0:
|
|
@@ -367,6 +367,8 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
|
|
|
367
367
|
)
|
|
368
368
|
/*: LiveQuerySubscription*/
|
|
369
369
|
{
|
|
370
|
+
var _this2 = this;
|
|
371
|
+
|
|
370
372
|
if (!query) {
|
|
371
373
|
return;
|
|
372
374
|
}
|
|
@@ -393,7 +395,7 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
|
|
|
393
395
|
this.subscriptions.set(this.requestId, subscription);
|
|
394
396
|
this.requestId += 1;
|
|
395
397
|
this.connectPromise.then(function () {
|
|
396
|
-
|
|
398
|
+
_this2.socket.send((0, _stringify.default)(subscribeRequest));
|
|
397
399
|
});
|
|
398
400
|
return subscription;
|
|
399
401
|
}
|
|
@@ -408,6 +410,8 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
|
|
|
408
410
|
value: function (subscription
|
|
409
411
|
/*: Object*/
|
|
410
412
|
) {
|
|
413
|
+
var _this3 = this;
|
|
414
|
+
|
|
411
415
|
if (!subscription) {
|
|
412
416
|
return;
|
|
413
417
|
}
|
|
@@ -418,7 +422,7 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
|
|
|
418
422
|
requestId: subscription.id
|
|
419
423
|
};
|
|
420
424
|
this.connectPromise.then(function () {
|
|
421
|
-
|
|
425
|
+
_this3.socket.send((0, _stringify.default)(unsubscribeRequest));
|
|
422
426
|
});
|
|
423
427
|
}
|
|
424
428
|
/**
|
|
@@ -595,7 +595,7 @@ var LocalDatastore = {
|
|
|
595
595
|
|
|
596
596
|
var pinName, toPinPromises, objectKeys, _iterator, _step, parent, children, parentKey, json, objectKey, fromPinPromise, _yield$Promise$all, _yield$Promise$all2, pinned, toPin;
|
|
597
597
|
|
|
598
|
-
return _regeneratorRuntime().wrap(function (_context2) {
|
|
598
|
+
return _regeneratorRuntime().wrap(function _callee$(_context2) {
|
|
599
599
|
while (1) {
|
|
600
600
|
switch (_context2.prev = _context2.next) {
|
|
601
601
|
case 0:
|
|
@@ -649,7 +649,7 @@ var LocalDatastore = {
|
|
|
649
649
|
},
|
|
650
650
|
// Removes object and children keys from pin name
|
|
651
651
|
// Keeps the object and children pinned
|
|
652
|
-
_handleUnPinAllWithName: function (name
|
|
652
|
+
_handleUnPinAllWithName: function _handleUnPinAllWithName(name
|
|
653
653
|
/*: string*/
|
|
654
654
|
, objects
|
|
655
655
|
/*: Array<ParseObject>*/
|
|
@@ -659,7 +659,7 @@ var LocalDatastore = {
|
|
|
659
659
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
660
660
|
var localDatastore, pinName, promises, objectKeys, _iterator2, _step2, _objectKeys, _context3, parent, children, parentKey, pinned, _iterator3, _step3, objectKey, hasReference, key, pinnedObjects;
|
|
661
661
|
|
|
662
|
-
return _regeneratorRuntime().wrap(function (_context4) {
|
|
662
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context4) {
|
|
663
663
|
while (1) {
|
|
664
664
|
switch (_context4.prev = _context4.next) {
|
|
665
665
|
case 0:
|
|
@@ -781,7 +781,7 @@ var LocalDatastore = {
|
|
|
781
781
|
}))();
|
|
782
782
|
},
|
|
783
783
|
// Retrieve all pointer fields from object recursively
|
|
784
|
-
_getChildren: function (object
|
|
784
|
+
_getChildren: function _getChildren(object
|
|
785
785
|
/*: ParseObject*/
|
|
786
786
|
) {
|
|
787
787
|
var encountered = {};
|
|
@@ -796,7 +796,7 @@ var LocalDatastore = {
|
|
|
796
796
|
|
|
797
797
|
return encountered;
|
|
798
798
|
},
|
|
799
|
-
_traverse: function (object
|
|
799
|
+
_traverse: function _traverse(object
|
|
800
800
|
/*: any*/
|
|
801
801
|
, encountered
|
|
802
802
|
/*: any*/
|
|
@@ -826,7 +826,7 @@ var LocalDatastore = {
|
|
|
826
826
|
}
|
|
827
827
|
},
|
|
828
828
|
// Transform keys in pin name to objects
|
|
829
|
-
_serializeObjectsFromPinName: function (name
|
|
829
|
+
_serializeObjectsFromPinName: function _serializeObjectsFromPinName(name
|
|
830
830
|
/*: string*/
|
|
831
831
|
) {
|
|
832
832
|
var _this3 = this;
|
|
@@ -835,7 +835,7 @@ var LocalDatastore = {
|
|
|
835
835
|
var _context5, _concatInstanceProper, _context6;
|
|
836
836
|
|
|
837
837
|
var localDatastore, allObjects, key, pinName, pinned, promises, objects;
|
|
838
|
-
return _regeneratorRuntime().wrap(function (_context7) {
|
|
838
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context7) {
|
|
839
839
|
while (1) {
|
|
840
840
|
switch (_context7.prev = _context7.next) {
|
|
841
841
|
case 0:
|
|
@@ -895,7 +895,7 @@ var LocalDatastore = {
|
|
|
895
895
|
// Replaces object pointers with pinned pointers
|
|
896
896
|
// The object pointers may contain old data
|
|
897
897
|
// Uses Breadth First Search Algorithm
|
|
898
|
-
_serializeObject: function (objectKey
|
|
898
|
+
_serializeObject: function _serializeObject(objectKey
|
|
899
899
|
/*: string*/
|
|
900
900
|
, localDatastore
|
|
901
901
|
/*: any*/
|
|
@@ -904,7 +904,7 @@ var LocalDatastore = {
|
|
|
904
904
|
|
|
905
905
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
906
906
|
var LDS, root, queue, meta, uniqueId, nodeId, subTreeRoot, field, value, key, pointer;
|
|
907
|
-
return _regeneratorRuntime().wrap(function (_context8) {
|
|
907
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context8) {
|
|
908
908
|
while (1) {
|
|
909
909
|
switch (_context8.prev = _context8.next) {
|
|
910
910
|
case 0:
|
|
@@ -970,7 +970,7 @@ var LocalDatastore = {
|
|
|
970
970
|
},
|
|
971
971
|
// Called when an object is save / fetched
|
|
972
972
|
// Update object pin value
|
|
973
|
-
_updateObjectIfPinned: function (object
|
|
973
|
+
_updateObjectIfPinned: function _updateObjectIfPinned(object
|
|
974
974
|
/*: ParseObject*/
|
|
975
975
|
)
|
|
976
976
|
/*: Promise<void>*/
|
|
@@ -979,7 +979,7 @@ var LocalDatastore = {
|
|
|
979
979
|
|
|
980
980
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
981
981
|
var objectKey, pinned;
|
|
982
|
-
return _regeneratorRuntime().wrap(function (_context9) {
|
|
982
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context9) {
|
|
983
983
|
while (1) {
|
|
984
984
|
switch (_context9.prev = _context9.next) {
|
|
985
985
|
case 0:
|
|
@@ -1019,14 +1019,14 @@ var LocalDatastore = {
|
|
|
1019
1019
|
// Called when object is destroyed
|
|
1020
1020
|
// Unpin object and remove all references from pin names
|
|
1021
1021
|
// TODO: Destroy children?
|
|
1022
|
-
_destroyObjectIfPinned: function (object
|
|
1022
|
+
_destroyObjectIfPinned: function _destroyObjectIfPinned(object
|
|
1023
1023
|
/*: ParseObject*/
|
|
1024
1024
|
) {
|
|
1025
1025
|
var _this6 = this;
|
|
1026
1026
|
|
|
1027
1027
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
1028
1028
|
var localDatastore, objectKey, pin, promises, key, pinned;
|
|
1029
|
-
return _regeneratorRuntime().wrap(function (_context10) {
|
|
1029
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context10) {
|
|
1030
1030
|
while (1) {
|
|
1031
1031
|
switch (_context10.prev = _context10.next) {
|
|
1032
1032
|
case 0:
|
|
@@ -1088,7 +1088,7 @@ var LocalDatastore = {
|
|
|
1088
1088
|
}))();
|
|
1089
1089
|
},
|
|
1090
1090
|
// Update pin and references of the unsaved object
|
|
1091
|
-
_updateLocalIdForObject: function (localId
|
|
1091
|
+
_updateLocalIdForObject: function _updateLocalIdForObject(localId
|
|
1092
1092
|
/*: string*/
|
|
1093
1093
|
, object
|
|
1094
1094
|
/*: ParseObject*/
|
|
@@ -1099,7 +1099,7 @@ var LocalDatastore = {
|
|
|
1099
1099
|
var _context11, _context12;
|
|
1100
1100
|
|
|
1101
1101
|
var localKey, objectKey, unsaved, promises, localDatastore, key, pinned;
|
|
1102
|
-
return _regeneratorRuntime().wrap(function (_context13) {
|
|
1102
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context13) {
|
|
1103
1103
|
while (1) {
|
|
1104
1104
|
switch (_context13.prev = _context13.next) {
|
|
1105
1105
|
case 0:
|
|
@@ -1171,7 +1171,7 @@ var LocalDatastore = {
|
|
|
1171
1171
|
* @name Parse.LocalDatastore.updateFromServer
|
|
1172
1172
|
* @static
|
|
1173
1173
|
*/
|
|
1174
|
-
updateFromServer: function () {
|
|
1174
|
+
updateFromServer: function updateFromServer() {
|
|
1175
1175
|
var _this8 = this;
|
|
1176
1176
|
|
|
1177
1177
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
@@ -1179,7 +1179,7 @@ var LocalDatastore = {
|
|
|
1179
1179
|
|
|
1180
1180
|
var localDatastore, keys, key, pointersHash, _i, _keys, _key, _key$split, _key$split2, className, objectId, queryPromises, responses, objects, pinPromises;
|
|
1181
1181
|
|
|
1182
|
-
return _regeneratorRuntime().wrap(function (_context15) {
|
|
1182
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context15) {
|
|
1183
1183
|
while (1) {
|
|
1184
1184
|
switch (_context15.prev = _context15.next) {
|
|
1185
1185
|
case 0:
|
|
@@ -1298,7 +1298,7 @@ var LocalDatastore = {
|
|
|
1298
1298
|
}, _callee8, null, [[24, 35]]);
|
|
1299
1299
|
}))();
|
|
1300
1300
|
},
|
|
1301
|
-
getKeyForObject: function (object
|
|
1301
|
+
getKeyForObject: function getKeyForObject(object
|
|
1302
1302
|
/*: any*/
|
|
1303
1303
|
) {
|
|
1304
1304
|
var _context16, _context17;
|
|
@@ -1307,7 +1307,7 @@ var LocalDatastore = {
|
|
|
1307
1307
|
|
|
1308
1308
|
return (0, _concat.default)(_context16 = (0, _concat.default)(_context17 = "".concat(_LocalDatastoreUtils.OBJECT_PREFIX)).call(_context17, object.className, "_")).call(_context16, objectId);
|
|
1309
1309
|
},
|
|
1310
|
-
getPinName: function (pinName
|
|
1310
|
+
getPinName: function getPinName(pinName
|
|
1311
1311
|
/*: ?string*/
|
|
1312
1312
|
) {
|
|
1313
1313
|
if (!pinName || pinName === _LocalDatastoreUtils.DEFAULT_PIN) {
|
|
@@ -1316,7 +1316,7 @@ var LocalDatastore = {
|
|
|
1316
1316
|
|
|
1317
1317
|
return _LocalDatastoreUtils.PIN_PREFIX + pinName;
|
|
1318
1318
|
},
|
|
1319
|
-
checkIfEnabled: function () {
|
|
1319
|
+
checkIfEnabled: function checkIfEnabled() {
|
|
1320
1320
|
if (!this.isEnabled) {
|
|
1321
1321
|
console.error('Parse.enableLocalDatastore() must be called first');
|
|
1322
1322
|
}
|
|
@@ -488,7 +488,7 @@ var LocalDatastoreController = {
|
|
|
488
488
|
{
|
|
489
489
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
490
490
|
var values, objects;
|
|
491
|
-
return _regeneratorRuntime().wrap(function (_context) {
|
|
491
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
492
492
|
while (1) {
|
|
493
493
|
switch (_context.prev = _context.next) {
|
|
494
494
|
case 0:
|
|
@@ -517,7 +517,7 @@ var LocalDatastoreController = {
|
|
|
517
517
|
}, _callee);
|
|
518
518
|
}))();
|
|
519
519
|
},
|
|
520
|
-
pinWithName: function (name
|
|
520
|
+
pinWithName: function pinWithName(name
|
|
521
521
|
/*: string*/
|
|
522
522
|
, value
|
|
523
523
|
/*: any*/
|
|
@@ -525,17 +525,17 @@ var LocalDatastoreController = {
|
|
|
525
525
|
var values = (0, _stringify.default)(value);
|
|
526
526
|
return _Storage.default.setItemAsync(name, values);
|
|
527
527
|
},
|
|
528
|
-
unPinWithName: function (name
|
|
528
|
+
unPinWithName: function unPinWithName(name
|
|
529
529
|
/*: string*/
|
|
530
530
|
) {
|
|
531
531
|
return _Storage.default.removeItemAsync(name);
|
|
532
532
|
},
|
|
533
|
-
getAllContents: function ()
|
|
533
|
+
getAllContents: function getAllContents()
|
|
534
534
|
/*: Object*/
|
|
535
535
|
{
|
|
536
536
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
537
537
|
var keys;
|
|
538
|
-
return _regeneratorRuntime().wrap(function (_context3) {
|
|
538
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
539
539
|
while (1) {
|
|
540
540
|
switch (_context3.prev = _context3.next) {
|
|
541
541
|
case 0:
|
|
@@ -547,7 +547,7 @@ var LocalDatastoreController = {
|
|
|
547
547
|
return _context3.abrupt("return", (0, _reduce.default)(keys).call(keys, /*#__PURE__*/function () {
|
|
548
548
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(previousPromise, key) {
|
|
549
549
|
var LDS, value;
|
|
550
|
-
return _regeneratorRuntime().wrap(function (_context2) {
|
|
550
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
551
551
|
while (1) {
|
|
552
552
|
switch (_context2.prev = _context2.next) {
|
|
553
553
|
case 0:
|
|
@@ -585,7 +585,7 @@ var LocalDatastoreController = {
|
|
|
585
585
|
}, _callee2);
|
|
586
586
|
}));
|
|
587
587
|
|
|
588
|
-
return function () {
|
|
588
|
+
return function (_x, _x2) {
|
|
589
589
|
return _ref.apply(this, arguments);
|
|
590
590
|
};
|
|
591
591
|
}(), _promise.default.resolve({})));
|
|
@@ -599,12 +599,12 @@ var LocalDatastoreController = {
|
|
|
599
599
|
}))();
|
|
600
600
|
},
|
|
601
601
|
// Used for testing
|
|
602
|
-
getRawStorage: function ()
|
|
602
|
+
getRawStorage: function getRawStorage()
|
|
603
603
|
/*: Object*/
|
|
604
604
|
{
|
|
605
605
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
606
606
|
var keys;
|
|
607
|
-
return _regeneratorRuntime().wrap(function (_context5) {
|
|
607
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
608
608
|
while (1) {
|
|
609
609
|
switch (_context5.prev = _context5.next) {
|
|
610
610
|
case 0:
|
|
@@ -616,7 +616,7 @@ var LocalDatastoreController = {
|
|
|
616
616
|
return _context5.abrupt("return", (0, _reduce.default)(keys).call(keys, /*#__PURE__*/function () {
|
|
617
617
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(previousPromise, key) {
|
|
618
618
|
var LDS, value;
|
|
619
|
-
return _regeneratorRuntime().wrap(function (_context4) {
|
|
619
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
620
620
|
while (1) {
|
|
621
621
|
switch (_context4.prev = _context4.next) {
|
|
622
622
|
case 0:
|
|
@@ -641,7 +641,7 @@ var LocalDatastoreController = {
|
|
|
641
641
|
}, _callee4);
|
|
642
642
|
}));
|
|
643
643
|
|
|
644
|
-
return function () {
|
|
644
|
+
return function (_x3, _x4) {
|
|
645
645
|
return _ref2.apply(this, arguments);
|
|
646
646
|
};
|
|
647
647
|
}(), _promise.default.resolve({})));
|
|
@@ -654,13 +654,15 @@ var LocalDatastoreController = {
|
|
|
654
654
|
}, _callee5);
|
|
655
655
|
}))();
|
|
656
656
|
},
|
|
657
|
-
clear: function ()
|
|
657
|
+
clear: function clear()
|
|
658
658
|
/*: Promise*/
|
|
659
659
|
{
|
|
660
|
+
var _this = this;
|
|
661
|
+
|
|
660
662
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
661
663
|
var keys, toRemove, _iterator, _step, key, promises;
|
|
662
664
|
|
|
663
|
-
return _regeneratorRuntime().wrap(function (_context6) {
|
|
665
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
664
666
|
while (1) {
|
|
665
667
|
switch (_context6.prev = _context6.next) {
|
|
666
668
|
case 0:
|
|
@@ -686,7 +688,7 @@ var LocalDatastoreController = {
|
|
|
686
688
|
_iterator.f();
|
|
687
689
|
}
|
|
688
690
|
|
|
689
|
-
promises = (0, _map.default)(toRemove).call(toRemove,
|
|
691
|
+
promises = (0, _map.default)(toRemove).call(toRemove, _this.unPinWithName);
|
|
690
692
|
return _context6.abrupt("return", _promise.default.all(promises));
|
|
691
693
|
|
|
692
694
|
case 8:
|
|
@@ -402,7 +402,7 @@ var LocalDatastoreController = {
|
|
|
402
402
|
{
|
|
403
403
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
404
404
|
var values, objects;
|
|
405
|
-
return _regeneratorRuntime().wrap(function (_context) {
|
|
405
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
406
406
|
while (1) {
|
|
407
407
|
switch (_context.prev = _context.next) {
|
|
408
408
|
case 0:
|
|
@@ -431,7 +431,7 @@ var LocalDatastoreController = {
|
|
|
431
431
|
}, _callee);
|
|
432
432
|
}))();
|
|
433
433
|
},
|
|
434
|
-
pinWithName: function (name
|
|
434
|
+
pinWithName: function pinWithName(name
|
|
435
435
|
/*: string*/
|
|
436
436
|
, value
|
|
437
437
|
/*: any*/
|
|
@@ -440,7 +440,7 @@ var LocalDatastoreController = {
|
|
|
440
440
|
{
|
|
441
441
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
442
442
|
var values;
|
|
443
|
-
return _regeneratorRuntime().wrap(function (_context2) {
|
|
443
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
444
444
|
while (1) {
|
|
445
445
|
switch (_context2.prev = _context2.next) {
|
|
446
446
|
case 0:
|
|
@@ -467,19 +467,19 @@ var LocalDatastoreController = {
|
|
|
467
467
|
}, _callee2, null, [[0, 6]]);
|
|
468
468
|
}))();
|
|
469
469
|
},
|
|
470
|
-
unPinWithName: function (name
|
|
470
|
+
unPinWithName: function unPinWithName(name
|
|
471
471
|
/*: string*/
|
|
472
472
|
)
|
|
473
473
|
/*: Promise<void>*/
|
|
474
474
|
{
|
|
475
475
|
return RNStorage.removeItemAsync(name);
|
|
476
476
|
},
|
|
477
|
-
getAllContents: function ()
|
|
477
|
+
getAllContents: function getAllContents()
|
|
478
478
|
/*: Promise<Object>*/
|
|
479
479
|
{
|
|
480
480
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
481
481
|
var keys, batch, i, key, LDS, results;
|
|
482
|
-
return _regeneratorRuntime().wrap(function (_context3) {
|
|
482
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
483
483
|
while (1) {
|
|
484
484
|
switch (_context3.prev = _context3.next) {
|
|
485
485
|
case 0:
|
|
@@ -538,12 +538,12 @@ var LocalDatastoreController = {
|
|
|
538
538
|
}))();
|
|
539
539
|
},
|
|
540
540
|
// Used for testing
|
|
541
|
-
getRawStorage: function ()
|
|
541
|
+
getRawStorage: function getRawStorage()
|
|
542
542
|
/*: Promise<Object>*/
|
|
543
543
|
{
|
|
544
544
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
545
545
|
var keys, storage, results;
|
|
546
|
-
return _regeneratorRuntime().wrap(function (_context4) {
|
|
546
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
547
547
|
while (1) {
|
|
548
548
|
switch (_context4.prev = _context4.next) {
|
|
549
549
|
case 0:
|
|
@@ -575,12 +575,12 @@ var LocalDatastoreController = {
|
|
|
575
575
|
}, _callee4);
|
|
576
576
|
}))();
|
|
577
577
|
},
|
|
578
|
-
clear: function ()
|
|
578
|
+
clear: function clear()
|
|
579
579
|
/*: Promise<void>*/
|
|
580
580
|
{
|
|
581
581
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
582
582
|
var keys, batch, i, key;
|
|
583
|
-
return _regeneratorRuntime().wrap(function (_context5) {
|
|
583
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
584
584
|
while (1) {
|
|
585
585
|
switch (_context5.prev = _context5.next) {
|
|
586
586
|
case 0:
|