parse 4.3.1 → 5.0.0-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 +13 -14
- package/dist/parse.js +37 -48
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +37 -48
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/LiveQueryClient.js +2 -2
- package/lib/browser/ObjectStateMutations.js +11 -17
- package/lib/browser/ParseOp.js +13 -20
- package/lib/browser/SingleInstanceStateController.js +6 -4
- package/lib/browser/UniqueInstanceStateController.js +2 -2
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/LiveQueryClient.js +2 -2
- package/lib/node/ObjectStateMutations.js +6 -12
- package/lib/node/ParseOp.js +2 -8
- package/lib/node/SingleInstanceStateController.js +10 -4
- package/lib/node/UniqueInstanceStateController.js +2 -2
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/LiveQueryClient.js +2 -2
- package/lib/react-native/ObjectStateMutations.js +11 -17
- package/lib/react-native/ParseOp.js +2 -8
- package/lib/react-native/SingleInstanceStateController.js +4 -2
- package/lib/react-native/UniqueInstanceStateController.js +2 -2
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/LiveQueryClient.js +2 -2
- package/lib/weapp/ObjectStateMutations.js +11 -17
- package/lib/weapp/ParseOp.js +13 -20
- package/lib/weapp/SingleInstanceStateController.js +6 -4
- package/lib/weapp/UniqueInstanceStateController.js +2 -2
- package/package.json +5 -5
package/lib/weapp/ParseOp.js
CHANGED
|
@@ -466,18 +466,11 @@ var RelationOp = /*#__PURE__*/function (_Op7) {
|
|
|
466
466
|
}
|
|
467
467
|
}, {
|
|
468
468
|
key: "applyTo",
|
|
469
|
-
value: function (value /*: mixed*/,
|
|
469
|
+
value: function (value /*: mixed*/, parent /*: ParseObject*/, key /*:: ?: string*/) /*: ?ParseRelation*/{
|
|
470
470
|
if (!value) {
|
|
471
|
-
|
|
472
|
-
if (!object || !key) {
|
|
471
|
+
if (!parent || !key) {
|
|
473
472
|
throw new Error('Cannot apply a RelationOp without either a previous value, or an object and a key');
|
|
474
473
|
}
|
|
475
|
-
var parent = new _ParseObject.default(object.className);
|
|
476
|
-
if (object.id && (0, _indexOf.default)(_context3 = object.id).call(_context3, 'local') === 0) {
|
|
477
|
-
parent._localId = object.id;
|
|
478
|
-
} else if (object.id) {
|
|
479
|
-
parent.id = object.id;
|
|
480
|
-
}
|
|
481
474
|
var relation = new _ParseRelation.default(parent, key);
|
|
482
475
|
relation.targetClassName = this._targetClassName;
|
|
483
476
|
return relation;
|
|
@@ -507,31 +500,31 @@ var RelationOp = /*#__PURE__*/function (_Op7) {
|
|
|
507
500
|
} else if (previous instanceof SetOp && previous._value instanceof _ParseRelation.default) {
|
|
508
501
|
return this;
|
|
509
502
|
} else if (previous instanceof RelationOp) {
|
|
510
|
-
var _context4, _context5, _context6, _context7, _context8
|
|
503
|
+
var _context3, _context4, _context5, _context6, _context7, _context8;
|
|
511
504
|
if (previous._targetClassName && previous._targetClassName !== this._targetClassName) {
|
|
512
505
|
throw new Error('Related object must be of class ' + previous._targetClassName + ', but ' + (this._targetClassName || 'null') + ' was passed in.');
|
|
513
506
|
}
|
|
514
|
-
var newAdd = (0, _concat.default)(
|
|
515
|
-
(0, _forEach.default)(
|
|
507
|
+
var newAdd = (0, _concat.default)(_context3 = previous.relationsToAdd).call(_context3, []);
|
|
508
|
+
(0, _forEach.default)(_context4 = this.relationsToRemove).call(_context4, function (r) {
|
|
516
509
|
var index = (0, _indexOf.default)(newAdd).call(newAdd, r);
|
|
517
510
|
if (index > -1) {
|
|
518
511
|
(0, _splice.default)(newAdd).call(newAdd, index, 1);
|
|
519
512
|
}
|
|
520
513
|
});
|
|
521
|
-
(0, _forEach.default)(
|
|
514
|
+
(0, _forEach.default)(_context5 = this.relationsToAdd).call(_context5, function (r) {
|
|
522
515
|
var index = (0, _indexOf.default)(newAdd).call(newAdd, r);
|
|
523
516
|
if (index < 0) {
|
|
524
517
|
newAdd.push(r);
|
|
525
518
|
}
|
|
526
519
|
});
|
|
527
|
-
var newRemove = (0, _concat.default)(
|
|
528
|
-
(0, _forEach.default)(
|
|
520
|
+
var newRemove = (0, _concat.default)(_context6 = previous.relationsToRemove).call(_context6, []);
|
|
521
|
+
(0, _forEach.default)(_context7 = this.relationsToAdd).call(_context7, function (r) {
|
|
529
522
|
var index = (0, _indexOf.default)(newRemove).call(newRemove, r);
|
|
530
523
|
if (index > -1) {
|
|
531
524
|
(0, _splice.default)(newRemove).call(newRemove, index, 1);
|
|
532
525
|
}
|
|
533
526
|
});
|
|
534
|
-
(0, _forEach.default)(
|
|
527
|
+
(0, _forEach.default)(_context8 = this.relationsToRemove).call(_context8, function (r) {
|
|
535
528
|
var index = (0, _indexOf.default)(newRemove).call(newRemove, r);
|
|
536
529
|
if (index < 0) {
|
|
537
530
|
newRemove.push(r);
|
|
@@ -558,16 +551,16 @@ var RelationOp = /*#__PURE__*/function (_Op7) {
|
|
|
558
551
|
var removes = null;
|
|
559
552
|
var pointers = null;
|
|
560
553
|
if (this.relationsToAdd.length > 0) {
|
|
561
|
-
var
|
|
562
|
-
pointers = (0, _map.default)(
|
|
554
|
+
var _context9;
|
|
555
|
+
pointers = (0, _map.default)(_context9 = this.relationsToAdd).call(_context9, idToPointer);
|
|
563
556
|
adds = {
|
|
564
557
|
__op: 'AddRelation',
|
|
565
558
|
objects: pointers
|
|
566
559
|
};
|
|
567
560
|
}
|
|
568
561
|
if (this.relationsToRemove.length > 0) {
|
|
569
|
-
var
|
|
570
|
-
pointers = (0, _map.default)(
|
|
562
|
+
var _context10;
|
|
563
|
+
pointers = (0, _map.default)(_context10 = this.relationsToRemove).call(_context10, idToPointer);
|
|
571
564
|
removes = {
|
|
572
565
|
__op: 'RemoveRelation',
|
|
573
566
|
objects: pointers
|
|
@@ -4,6 +4,7 @@ var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
|
|
4
4
|
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
5
5
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
6
6
|
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
7
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
7
8
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
9
|
value: true
|
|
9
10
|
});
|
|
@@ -25,6 +26,7 @@ exports.removeState = removeState;
|
|
|
25
26
|
exports.setPendingOp = setPendingOp;
|
|
26
27
|
exports.setServerData = setServerData;
|
|
27
28
|
var ObjectStateMutations = _interopRequireWildcard(require("./ObjectStateMutations"));
|
|
29
|
+
var _ParseObject = _interopRequireDefault(require("./ParseObject"));
|
|
28
30
|
function _getRequireWildcardCache(nodeInterop) {
|
|
29
31
|
if (typeof _WeakMap !== "function") return null;
|
|
30
32
|
var cacheBabelInterop = new _WeakMap();
|
|
@@ -148,15 +150,15 @@ function getObjectCache(obj /*: ObjectIdentifier*/) /*: ObjectCache*/{
|
|
|
148
150
|
}
|
|
149
151
|
return {};
|
|
150
152
|
}
|
|
151
|
-
function estimateAttribute(obj /*:
|
|
153
|
+
function estimateAttribute(obj /*: ParseObject*/, attr /*: string*/) /*: mixed*/{
|
|
152
154
|
var serverData = getServerData(obj);
|
|
153
155
|
var pendingOps = getPendingOps(obj);
|
|
154
|
-
return ObjectStateMutations.estimateAttribute(serverData, pendingOps, obj
|
|
156
|
+
return ObjectStateMutations.estimateAttribute(serverData, pendingOps, obj, attr);
|
|
155
157
|
}
|
|
156
|
-
function estimateAttributes(obj /*:
|
|
158
|
+
function estimateAttributes(obj /*: ParseObject*/) /*: AttributeMap*/{
|
|
157
159
|
var serverData = getServerData(obj);
|
|
158
160
|
var pendingOps = getPendingOps(obj);
|
|
159
|
-
return ObjectStateMutations.estimateAttributes(serverData, pendingOps, obj
|
|
161
|
+
return ObjectStateMutations.estimateAttributes(serverData, pendingOps, obj);
|
|
160
162
|
}
|
|
161
163
|
function commitServerChanges(obj /*: ObjectIdentifier*/, changes /*: AttributeMap*/) {
|
|
162
164
|
var state = initializeState(obj);
|
|
@@ -147,12 +147,12 @@ function getObjectCache(obj /*: ParseObject*/) /*: ObjectCache*/{
|
|
|
147
147
|
function estimateAttribute(obj /*: ParseObject*/, attr /*: string*/) /*: mixed*/{
|
|
148
148
|
var serverData = getServerData(obj);
|
|
149
149
|
var pendingOps = getPendingOps(obj);
|
|
150
|
-
return ObjectStateMutations.estimateAttribute(serverData, pendingOps, obj
|
|
150
|
+
return ObjectStateMutations.estimateAttribute(serverData, pendingOps, obj, attr);
|
|
151
151
|
}
|
|
152
152
|
function estimateAttributes(obj /*: ParseObject*/) /*: AttributeMap*/{
|
|
153
153
|
var serverData = getServerData(obj);
|
|
154
154
|
var pendingOps = getPendingOps(obj);
|
|
155
|
-
return ObjectStateMutations.estimateAttributes(serverData, pendingOps, obj
|
|
155
|
+
return ObjectStateMutations.estimateAttributes(serverData, pendingOps, obj);
|
|
156
156
|
}
|
|
157
157
|
function commitServerChanges(obj /*: ParseObject*/, changes /*: AttributeMap*/) {
|
|
158
158
|
var state = initializeState(obj);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parse",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-alpha.2",
|
|
4
4
|
"description": "Parse JavaScript SDK",
|
|
5
5
|
"homepage": "https://parseplatform.org",
|
|
6
6
|
"keywords": [
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"idb-keyval": "6.2.1",
|
|
34
34
|
"react-native-crypto-js": "1.0.0",
|
|
35
35
|
"uuid": "9.0.1",
|
|
36
|
-
"ws": "8.
|
|
36
|
+
"ws": "8.16.0",
|
|
37
37
|
"xmlhttprequest": "1.8.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"gulp-uglify": "3.0.2",
|
|
76
76
|
"gulp-watch": "5.0.1",
|
|
77
77
|
"husky": "8.0.3",
|
|
78
|
-
"jasmine": "5.
|
|
78
|
+
"jasmine": "5.1.0",
|
|
79
79
|
"jasmine-reporters": "2.5.2",
|
|
80
80
|
"jasmine-spec-reporter": "7.0.0",
|
|
81
81
|
"jest": "29.5.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"lint-staged": "13.2.2",
|
|
86
86
|
"metro-react-native-babel-preset": "0.76.4",
|
|
87
87
|
"mongodb-runner": "5.4.3",
|
|
88
|
-
"parse-server": "
|
|
88
|
+
"parse-server": "7.0.0-alpha.26",
|
|
89
89
|
"prettier": "3.0.2",
|
|
90
90
|
"puppeteer": "20.4.0",
|
|
91
91
|
"regenerator-runtime": "0.13.11",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
]
|
|
132
132
|
},
|
|
133
133
|
"engines": {
|
|
134
|
-
"node": ">=
|
|
134
|
+
"node": ">=18 <21"
|
|
135
135
|
},
|
|
136
136
|
"jest": {
|
|
137
137
|
"automock": true,
|