parse 5.1.0-alpha.7 → 5.1.0-alpha.8
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 +21 -25
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +21 -25
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/ParseObject.js +19 -23
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/ParseObject.js +0 -4
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/ParseObject.js +19 -23
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/ParseObject.js +19 -23
- package/package.json +1 -1
|
@@ -192,7 +192,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
|
|
|
192
192
|
SERVER_AUTH_TOKEN: null,
|
|
193
193
|
LIVEQUERY_SERVER_URL: null,
|
|
194
194
|
ENCRYPTED_KEY: null,
|
|
195
|
-
VERSION: 'js' + "5.1.0-alpha.
|
|
195
|
+
VERSION: 'js' + "5.1.0-alpha.8",
|
|
196
196
|
APPLICATION_ID: null,
|
|
197
197
|
JAVASCRIPT_KEY: null,
|
|
198
198
|
MASTER_KEY: null,
|
|
@@ -623,10 +623,6 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
623
623
|
json[_attr5] = (0, _encode.default)(attrs[_attr5], false, false, seen, offline);
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
|
-
var pending = this._getPendingOps();
|
|
627
|
-
for (var _attr6 in pending[0]) {
|
|
628
|
-
json[_attr6] = pending[0][_attr6].toJSON(offline);
|
|
629
|
-
}
|
|
630
626
|
if (this.id) {
|
|
631
627
|
json.objectId = this.id;
|
|
632
628
|
}
|
|
@@ -695,13 +691,13 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
695
691
|
var pendingOps = this._getPendingOps();
|
|
696
692
|
var keys = {};
|
|
697
693
|
for (var i = 0; i < pendingOps.length; i++) {
|
|
698
|
-
for (var
|
|
699
|
-
keys[
|
|
694
|
+
for (var _attr6 in pendingOps[i]) {
|
|
695
|
+
keys[_attr6] = true;
|
|
700
696
|
}
|
|
701
697
|
}
|
|
702
698
|
var dirtyObjects = this._getDirtyObjectAttributes();
|
|
703
|
-
for (var
|
|
704
|
-
keys[
|
|
699
|
+
for (var _attr7 in dirtyObjects) {
|
|
700
|
+
keys[_attr7] = true;
|
|
705
701
|
}
|
|
706
702
|
return (0, _keys.default)(keys);
|
|
707
703
|
}
|
|
@@ -906,11 +902,11 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
906
902
|
|
|
907
903
|
// Calculate new values
|
|
908
904
|
var newValues = {};
|
|
909
|
-
for (var
|
|
910
|
-
if (newOps[
|
|
911
|
-
newValues[
|
|
912
|
-
} else if (!(newOps[
|
|
913
|
-
newValues[
|
|
905
|
+
for (var _attr8 in newOps) {
|
|
906
|
+
if (newOps[_attr8] instanceof _ParseOp.RelationOp) {
|
|
907
|
+
newValues[_attr8] = newOps[_attr8].applyTo(currentAttributes[_attr8], this, _attr8);
|
|
908
|
+
} else if (!(newOps[_attr8] instanceof _ParseOp.UnsetOp)) {
|
|
909
|
+
newValues[_attr8] = newOps[_attr8].applyTo(currentAttributes[_attr8]);
|
|
914
910
|
}
|
|
915
911
|
}
|
|
916
912
|
|
|
@@ -929,9 +925,9 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
929
925
|
var pendingOps = this._getPendingOps();
|
|
930
926
|
var last = pendingOps.length - 1;
|
|
931
927
|
var stateController = _CoreManager.default.getObjectStateController();
|
|
932
|
-
for (var
|
|
933
|
-
var nextOp = newOps[
|
|
934
|
-
stateController.setPendingOp(this._getStateIdentifier(),
|
|
928
|
+
for (var _attr9 in newOps) {
|
|
929
|
+
var nextOp = newOps[_attr9].mergeWith(pendingOps[last][_attr9]);
|
|
930
|
+
stateController.setPendingOp(this._getStateIdentifier(), _attr9, nextOp);
|
|
935
931
|
}
|
|
936
932
|
return this;
|
|
937
933
|
}
|
|
@@ -1345,9 +1341,9 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1345
1341
|
if (typeof this.constructor.readOnlyAttributes === 'function') {
|
|
1346
1342
|
readonly = (0, _concat.default)(readonly).call(readonly, this.constructor.readOnlyAttributes());
|
|
1347
1343
|
}
|
|
1348
|
-
for (var
|
|
1349
|
-
if ((0, _indexOf.default)(readonly).call(readonly,
|
|
1350
|
-
erasable[
|
|
1344
|
+
for (var _attr10 in attributes) {
|
|
1345
|
+
if ((0, _indexOf.default)(readonly).call(readonly, _attr10) < 0) {
|
|
1346
|
+
erasable[_attr10] = true;
|
|
1351
1347
|
}
|
|
1352
1348
|
}
|
|
1353
1349
|
return this.set(erasable, {
|
|
@@ -2193,11 +2189,11 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2193
2189
|
var constructor = classMap[json.className];
|
|
2194
2190
|
var o = constructor ? new constructor(json.className) : new ParseObject(json.className);
|
|
2195
2191
|
var otherAttributes = {};
|
|
2196
|
-
for (var
|
|
2197
|
-
if (
|
|
2198
|
-
otherAttributes[
|
|
2192
|
+
for (var _attr11 in json) {
|
|
2193
|
+
if (_attr11 !== 'className' && _attr11 !== '__type') {
|
|
2194
|
+
otherAttributes[_attr11] = json[_attr11];
|
|
2199
2195
|
if (dirty) {
|
|
2200
|
-
o.set(
|
|
2196
|
+
o.set(_attr11, json[_attr11]);
|
|
2201
2197
|
}
|
|
2202
2198
|
}
|
|
2203
2199
|
}
|
package/lib/node/CoreManager.js
CHANGED
|
@@ -188,7 +188,7 @@ const config /*: Config & { [key: string]: mixed }*/ = {
|
|
|
188
188
|
SERVER_AUTH_TOKEN: null,
|
|
189
189
|
LIVEQUERY_SERVER_URL: null,
|
|
190
190
|
ENCRYPTED_KEY: null,
|
|
191
|
-
VERSION: 'js' + "5.1.0-alpha.
|
|
191
|
+
VERSION: 'js' + "5.1.0-alpha.8",
|
|
192
192
|
APPLICATION_ID: null,
|
|
193
193
|
JAVASCRIPT_KEY: null,
|
|
194
194
|
MASTER_KEY: null,
|
package/lib/node/ParseObject.js
CHANGED
|
@@ -473,10 +473,6 @@ class ParseObject {
|
|
|
473
473
|
json[attr] = (0, _encode.default)(attrs[attr], false, false, seen, offline);
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
const pending = this._getPendingOps();
|
|
477
|
-
for (const attr in pending[0]) {
|
|
478
|
-
json[attr] = pending[0][attr].toJSON(offline);
|
|
479
|
-
}
|
|
480
476
|
if (this.id) {
|
|
481
477
|
json.objectId = this.id;
|
|
482
478
|
}
|
|
@@ -391,10 +391,6 @@ var ParseObject = function () {
|
|
|
391
391
|
json[_attr5] = (0, _encode.default)(attrs[_attr5], false, false, seen, offline);
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
var pending = this._getPendingOps();
|
|
395
|
-
for (var _attr6 in pending[0]) {
|
|
396
|
-
json[_attr6] = pending[0][_attr6].toJSON(offline);
|
|
397
|
-
}
|
|
398
394
|
if (this.id) {
|
|
399
395
|
json.objectId = this.id;
|
|
400
396
|
}
|
|
@@ -441,13 +437,13 @@ var ParseObject = function () {
|
|
|
441
437
|
var pendingOps = this._getPendingOps();
|
|
442
438
|
var keys = {};
|
|
443
439
|
for (var i = 0; i < pendingOps.length; i++) {
|
|
444
|
-
for (var
|
|
445
|
-
keys[
|
|
440
|
+
for (var _attr6 in pendingOps[i]) {
|
|
441
|
+
keys[_attr6] = true;
|
|
446
442
|
}
|
|
447
443
|
}
|
|
448
444
|
var dirtyObjects = this._getDirtyObjectAttributes();
|
|
449
|
-
for (var
|
|
450
|
-
keys[
|
|
445
|
+
for (var _attr7 in dirtyObjects) {
|
|
446
|
+
keys[_attr7] = true;
|
|
451
447
|
}
|
|
452
448
|
return Object.keys(keys);
|
|
453
449
|
}
|
|
@@ -570,11 +566,11 @@ var ParseObject = function () {
|
|
|
570
566
|
}
|
|
571
567
|
var currentAttributes = this.attributes;
|
|
572
568
|
var newValues = {};
|
|
573
|
-
for (var
|
|
574
|
-
if (newOps[
|
|
575
|
-
newValues[
|
|
576
|
-
} else if (!(newOps[
|
|
577
|
-
newValues[
|
|
569
|
+
for (var _attr8 in newOps) {
|
|
570
|
+
if (newOps[_attr8] instanceof _ParseOp.RelationOp) {
|
|
571
|
+
newValues[_attr8] = newOps[_attr8].applyTo(currentAttributes[_attr8], this, _attr8);
|
|
572
|
+
} else if (!(newOps[_attr8] instanceof _ParseOp.UnsetOp)) {
|
|
573
|
+
newValues[_attr8] = newOps[_attr8].applyTo(currentAttributes[_attr8]);
|
|
578
574
|
}
|
|
579
575
|
}
|
|
580
576
|
if (!options.ignoreValidation) {
|
|
@@ -589,9 +585,9 @@ var ParseObject = function () {
|
|
|
589
585
|
var pendingOps = this._getPendingOps();
|
|
590
586
|
var last = pendingOps.length - 1;
|
|
591
587
|
var stateController = _CoreManager.default.getObjectStateController();
|
|
592
|
-
for (var
|
|
593
|
-
var nextOp = newOps[
|
|
594
|
-
stateController.setPendingOp(this._getStateIdentifier(),
|
|
588
|
+
for (var _attr9 in newOps) {
|
|
589
|
+
var nextOp = newOps[_attr9].mergeWith(pendingOps[last][_attr9]);
|
|
590
|
+
stateController.setPendingOp(this._getStateIdentifier(), _attr9, nextOp);
|
|
595
591
|
}
|
|
596
592
|
return this;
|
|
597
593
|
}
|
|
@@ -799,9 +795,9 @@ var ParseObject = function () {
|
|
|
799
795
|
if (typeof this.constructor.readOnlyAttributes === 'function') {
|
|
800
796
|
readonly = readonly.concat(this.constructor.readOnlyAttributes());
|
|
801
797
|
}
|
|
802
|
-
for (var
|
|
803
|
-
if (readonly.indexOf(
|
|
804
|
-
erasable[
|
|
798
|
+
for (var _attr10 in attributes) {
|
|
799
|
+
if (readonly.indexOf(_attr10) < 0) {
|
|
800
|
+
erasable[_attr10] = true;
|
|
805
801
|
}
|
|
806
802
|
}
|
|
807
803
|
return this.set(erasable, {
|
|
@@ -1136,11 +1132,11 @@ var ParseObject = function () {
|
|
|
1136
1132
|
var constructor = classMap[json.className];
|
|
1137
1133
|
var o = constructor ? new constructor(json.className) : new ParseObject(json.className);
|
|
1138
1134
|
var otherAttributes = {};
|
|
1139
|
-
for (var
|
|
1140
|
-
if (
|
|
1141
|
-
otherAttributes[
|
|
1135
|
+
for (var _attr11 in json) {
|
|
1136
|
+
if (_attr11 !== 'className' && _attr11 !== '__type') {
|
|
1137
|
+
otherAttributes[_attr11] = json[_attr11];
|
|
1142
1138
|
if (dirty) {
|
|
1143
|
-
o.set(
|
|
1139
|
+
o.set(_attr11, json[_attr11]);
|
|
1144
1140
|
}
|
|
1145
1141
|
}
|
|
1146
1142
|
}
|
package/lib/weapp/CoreManager.js
CHANGED
|
@@ -192,7 +192,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
|
|
|
192
192
|
SERVER_AUTH_TOKEN: null,
|
|
193
193
|
LIVEQUERY_SERVER_URL: null,
|
|
194
194
|
ENCRYPTED_KEY: null,
|
|
195
|
-
VERSION: 'js' + "5.1.0-alpha.
|
|
195
|
+
VERSION: 'js' + "5.1.0-alpha.8",
|
|
196
196
|
APPLICATION_ID: null,
|
|
197
197
|
JAVASCRIPT_KEY: null,
|
|
198
198
|
MASTER_KEY: null,
|
package/lib/weapp/ParseObject.js
CHANGED
|
@@ -623,10 +623,6 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
623
623
|
json[_attr5] = (0, _encode.default)(attrs[_attr5], false, false, seen, offline);
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
|
-
var pending = this._getPendingOps();
|
|
627
|
-
for (var _attr6 in pending[0]) {
|
|
628
|
-
json[_attr6] = pending[0][_attr6].toJSON(offline);
|
|
629
|
-
}
|
|
630
626
|
if (this.id) {
|
|
631
627
|
json.objectId = this.id;
|
|
632
628
|
}
|
|
@@ -695,13 +691,13 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
695
691
|
var pendingOps = this._getPendingOps();
|
|
696
692
|
var keys = {};
|
|
697
693
|
for (var i = 0; i < pendingOps.length; i++) {
|
|
698
|
-
for (var
|
|
699
|
-
keys[
|
|
694
|
+
for (var _attr6 in pendingOps[i]) {
|
|
695
|
+
keys[_attr6] = true;
|
|
700
696
|
}
|
|
701
697
|
}
|
|
702
698
|
var dirtyObjects = this._getDirtyObjectAttributes();
|
|
703
|
-
for (var
|
|
704
|
-
keys[
|
|
699
|
+
for (var _attr7 in dirtyObjects) {
|
|
700
|
+
keys[_attr7] = true;
|
|
705
701
|
}
|
|
706
702
|
return (0, _keys.default)(keys);
|
|
707
703
|
}
|
|
@@ -906,11 +902,11 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
906
902
|
|
|
907
903
|
// Calculate new values
|
|
908
904
|
var newValues = {};
|
|
909
|
-
for (var
|
|
910
|
-
if (newOps[
|
|
911
|
-
newValues[
|
|
912
|
-
} else if (!(newOps[
|
|
913
|
-
newValues[
|
|
905
|
+
for (var _attr8 in newOps) {
|
|
906
|
+
if (newOps[_attr8] instanceof _ParseOp.RelationOp) {
|
|
907
|
+
newValues[_attr8] = newOps[_attr8].applyTo(currentAttributes[_attr8], this, _attr8);
|
|
908
|
+
} else if (!(newOps[_attr8] instanceof _ParseOp.UnsetOp)) {
|
|
909
|
+
newValues[_attr8] = newOps[_attr8].applyTo(currentAttributes[_attr8]);
|
|
914
910
|
}
|
|
915
911
|
}
|
|
916
912
|
|
|
@@ -929,9 +925,9 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
929
925
|
var pendingOps = this._getPendingOps();
|
|
930
926
|
var last = pendingOps.length - 1;
|
|
931
927
|
var stateController = _CoreManager.default.getObjectStateController();
|
|
932
|
-
for (var
|
|
933
|
-
var nextOp = newOps[
|
|
934
|
-
stateController.setPendingOp(this._getStateIdentifier(),
|
|
928
|
+
for (var _attr9 in newOps) {
|
|
929
|
+
var nextOp = newOps[_attr9].mergeWith(pendingOps[last][_attr9]);
|
|
930
|
+
stateController.setPendingOp(this._getStateIdentifier(), _attr9, nextOp);
|
|
935
931
|
}
|
|
936
932
|
return this;
|
|
937
933
|
}
|
|
@@ -1345,9 +1341,9 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1345
1341
|
if (typeof this.constructor.readOnlyAttributes === 'function') {
|
|
1346
1342
|
readonly = (0, _concat.default)(readonly).call(readonly, this.constructor.readOnlyAttributes());
|
|
1347
1343
|
}
|
|
1348
|
-
for (var
|
|
1349
|
-
if ((0, _indexOf.default)(readonly).call(readonly,
|
|
1350
|
-
erasable[
|
|
1344
|
+
for (var _attr10 in attributes) {
|
|
1345
|
+
if ((0, _indexOf.default)(readonly).call(readonly, _attr10) < 0) {
|
|
1346
|
+
erasable[_attr10] = true;
|
|
1351
1347
|
}
|
|
1352
1348
|
}
|
|
1353
1349
|
return this.set(erasable, {
|
|
@@ -2193,11 +2189,11 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
2193
2189
|
var constructor = classMap[json.className];
|
|
2194
2190
|
var o = constructor ? new constructor(json.className) : new ParseObject(json.className);
|
|
2195
2191
|
var otherAttributes = {};
|
|
2196
|
-
for (var
|
|
2197
|
-
if (
|
|
2198
|
-
otherAttributes[
|
|
2192
|
+
for (var _attr11 in json) {
|
|
2193
|
+
if (_attr11 !== 'className' && _attr11 !== '__type') {
|
|
2194
|
+
otherAttributes[_attr11] = json[_attr11];
|
|
2199
2195
|
if (dirty) {
|
|
2200
|
-
o.set(
|
|
2196
|
+
o.set(_attr11, json[_attr11]);
|
|
2201
2197
|
}
|
|
2202
2198
|
}
|
|
2203
2199
|
}
|