parse 5.1.1-alpha.1 → 5.2.0-alpha.1
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 +1411 -1216
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +1414 -1219
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/Cloud.js +7 -11
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/EventuallyQueue.js +1 -1
- package/lib/browser/InstallationController.js +3 -3
- package/lib/browser/LiveQueryClient.js +102 -60
- package/lib/browser/LocalDatastore.js +189 -147
- package/lib/browser/LocalDatastoreController.default.js +14 -9
- package/lib/browser/LocalDatastoreController.react-native.js +14 -12
- package/lib/browser/LocalDatastoreUtils.js +0 -5
- package/lib/browser/ObjectStateMutations.js +57 -21
- package/lib/browser/Parse.js +2 -2
- package/lib/browser/ParseCLP.js +9 -17
- package/lib/browser/ParseFile.js +27 -31
- package/lib/browser/ParseGeoPoint.js +9 -3
- package/lib/browser/ParseHooks.js +13 -13
- package/lib/browser/ParseInstallation.js +14 -0
- package/lib/browser/ParseObject.js +15 -13
- package/lib/browser/ParseOp.js +17 -17
- package/lib/browser/ParsePolygon.js +1 -1
- package/lib/browser/ParseQuery.js +147 -149
- package/lib/browser/ParseRole.js +5 -9
- package/lib/browser/ParseSchema.js +1 -1
- package/lib/browser/ParseUser.js +66 -51
- package/lib/browser/Push.js +5 -10
- package/lib/browser/RESTController.js +1 -1
- package/lib/browser/SingleInstanceStateController.js +1 -1
- package/lib/browser/TaskQueue.js +10 -10
- package/lib/browser/UniqueInstanceStateController.js +1 -1
- package/lib/node/Cloud.js +7 -11
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/EventuallyQueue.js +1 -1
- package/lib/node/InstallationController.js +3 -3
- package/lib/node/LiveQueryClient.js +14 -24
- package/lib/node/LocalDatastore.js +7 -11
- package/lib/node/LocalDatastoreController.default.js +12 -10
- package/lib/node/LocalDatastoreController.react-native.js +13 -12
- package/lib/node/LocalDatastoreUtils.js +0 -5
- package/lib/node/ObjectStateMutations.js +45 -19
- package/lib/node/Parse.js +2 -2
- package/lib/node/ParseCLP.js +8 -18
- package/lib/node/ParseFile.js +27 -40
- package/lib/node/ParseGeoPoint.js +9 -3
- package/lib/node/ParseHooks.js +13 -13
- package/lib/node/ParseInstallation.js +14 -0
- package/lib/node/ParseObject.js +15 -13
- package/lib/node/ParseOp.js +21 -21
- package/lib/node/ParsePolygon.js +1 -1
- package/lib/node/ParseQuery.js +84 -107
- package/lib/node/ParseRole.js +3 -8
- package/lib/node/ParseSchema.js +4 -4
- package/lib/node/ParseUser.js +42 -37
- package/lib/node/Push.js +3 -8
- package/lib/node/RESTController.js +1 -1
- package/lib/node/SingleInstanceStateController.js +1 -1
- package/lib/node/TaskQueue.js +9 -11
- package/lib/node/UniqueInstanceStateController.js +1 -1
- package/lib/react-native/Cloud.js +0 -1
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/LiveQueryClient.js +49 -32
- package/lib/react-native/LocalDatastore.js +38 -14
- package/lib/react-native/LocalDatastoreController.default.js +7 -1
- package/lib/react-native/LocalDatastoreController.react-native.js +7 -1
- package/lib/react-native/ObjectStateMutations.js +30 -9
- package/lib/react-native/ParseCLP.js +3 -3
- package/lib/react-native/ParseFile.js +7 -6
- package/lib/react-native/ParseObject.js +4 -3
- package/lib/react-native/ParseQuery.js +45 -37
- package/lib/react-native/ParseRole.js +1 -1
- package/lib/react-native/ParseUser.js +22 -16
- package/lib/react-native/TaskQueue.js +8 -2
- package/lib/weapp/Cloud.js +7 -11
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/EventuallyQueue.js +1 -1
- package/lib/weapp/InstallationController.js +3 -3
- package/lib/weapp/LiveQueryClient.js +102 -60
- package/lib/weapp/LocalDatastore.js +189 -147
- package/lib/weapp/LocalDatastoreController.default.js +14 -9
- package/lib/weapp/LocalDatastoreController.react-native.js +14 -12
- package/lib/weapp/LocalDatastoreUtils.js +0 -5
- package/lib/weapp/ObjectStateMutations.js +57 -21
- package/lib/weapp/Parse.js +2 -2
- package/lib/weapp/ParseCLP.js +9 -17
- package/lib/weapp/ParseFile.js +27 -31
- package/lib/weapp/ParseGeoPoint.js +9 -3
- package/lib/weapp/ParseHooks.js +13 -13
- package/lib/weapp/ParseInstallation.js +14 -0
- package/lib/weapp/ParseObject.js +15 -13
- package/lib/weapp/ParseOp.js +17 -17
- package/lib/weapp/ParsePolygon.js +1 -1
- package/lib/weapp/ParseQuery.js +147 -149
- package/lib/weapp/ParseRole.js +5 -9
- package/lib/weapp/ParseSchema.js +1 -1
- package/lib/weapp/ParseUser.js +66 -51
- package/lib/weapp/Push.js +5 -10
- package/lib/weapp/RESTController.js +1 -1
- package/lib/weapp/SingleInstanceStateController.js +1 -1
- package/lib/weapp/TaskQueue.js +10 -10
- package/lib/weapp/UniqueInstanceStateController.js +1 -1
- package/package.json +5 -6
package/lib/weapp/ParseHooks.js
CHANGED
|
@@ -30,60 +30,60 @@ function getFunctions() {
|
|
|
30
30
|
function getTriggers() {
|
|
31
31
|
return _CoreManager.default.getHooksController().get('triggers');
|
|
32
32
|
}
|
|
33
|
-
function getFunction(name) {
|
|
33
|
+
function getFunction(name /*: string*/) {
|
|
34
34
|
return _CoreManager.default.getHooksController().get('functions', name);
|
|
35
35
|
}
|
|
36
|
-
function getTrigger(className
|
|
36
|
+
function getTrigger(className /*: string*/, triggerName /*: string*/) {
|
|
37
37
|
return _CoreManager.default.getHooksController().get('triggers', className, triggerName);
|
|
38
38
|
}
|
|
39
|
-
function createFunction(functionName
|
|
39
|
+
function createFunction(functionName /*: string*/, url /*: string*/) {
|
|
40
40
|
return create({
|
|
41
41
|
functionName: functionName,
|
|
42
42
|
url: url
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
function createTrigger(className
|
|
45
|
+
function createTrigger(className /*: string*/, triggerName /*: string*/, url /*: string*/) {
|
|
46
46
|
return create({
|
|
47
47
|
className: className,
|
|
48
48
|
triggerName: triggerName,
|
|
49
49
|
url: url
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
function create(hook) {
|
|
52
|
+
function create(hook /*: HookDeclaration*/) {
|
|
53
53
|
return _CoreManager.default.getHooksController().create(hook);
|
|
54
54
|
}
|
|
55
|
-
function updateFunction(functionName
|
|
55
|
+
function updateFunction(functionName /*: string*/, url /*: string*/) {
|
|
56
56
|
return update({
|
|
57
57
|
functionName: functionName,
|
|
58
58
|
url: url
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
|
-
function updateTrigger(className
|
|
61
|
+
function updateTrigger(className /*: string*/, triggerName /*: string*/, url /*: string*/) {
|
|
62
62
|
return update({
|
|
63
63
|
className: className,
|
|
64
64
|
triggerName: triggerName,
|
|
65
65
|
url: url
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
function update(hook) {
|
|
68
|
+
function update(hook /*: HookDeclaration*/) {
|
|
69
69
|
return _CoreManager.default.getHooksController().update(hook);
|
|
70
70
|
}
|
|
71
|
-
function removeFunction(functionName) {
|
|
71
|
+
function removeFunction(functionName /*: string*/) {
|
|
72
72
|
return remove({
|
|
73
73
|
functionName: functionName
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
function removeTrigger(className
|
|
76
|
+
function removeTrigger(className /*: string*/, triggerName /*: string*/) {
|
|
77
77
|
return remove({
|
|
78
78
|
className: className,
|
|
79
79
|
triggerName: triggerName
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
function remove(hook) {
|
|
82
|
+
function remove(hook /*: HookDeleteArg*/) {
|
|
83
83
|
return _CoreManager.default.getHooksController().remove(hook);
|
|
84
84
|
}
|
|
85
85
|
var DefaultController = {
|
|
86
|
-
get: function (type
|
|
86
|
+
get: function (type /*: string*/, functionName /*:: ?: string*/, triggerName /*:: ?: string*/) {
|
|
87
87
|
var url = '/hooks/' + type;
|
|
88
88
|
if (functionName) {
|
|
89
89
|
url += '/' + functionName;
|
|
@@ -143,7 +143,7 @@ var DefaultController = {
|
|
|
143
143
|
}
|
|
144
144
|
return this.sendRequest('PUT', url, hook);
|
|
145
145
|
},
|
|
146
|
-
sendRequest: function (method
|
|
146
|
+
sendRequest: function (method /*: string*/, url /*: string*/, body /*:: ?: any*/) {
|
|
147
147
|
return _CoreManager.default.getRESTController().request(method, url, body, {
|
|
148
148
|
useMasterKey: true
|
|
149
149
|
}).then(function (res) {
|
|
@@ -89,6 +89,7 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
89
89
|
*
|
|
90
90
|
* @property {string} appIdentifier
|
|
91
91
|
* @static
|
|
92
|
+
* @returns {string}
|
|
92
93
|
*/
|
|
93
94
|
(0, _createClass2.default)(ParseInstallation, [{
|
|
94
95
|
key: "appIdentifier",
|
|
@@ -101,6 +102,7 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
101
102
|
*
|
|
102
103
|
* @property {string} appVersion
|
|
103
104
|
* @static
|
|
105
|
+
* @returns {string}
|
|
104
106
|
*/
|
|
105
107
|
}, {
|
|
106
108
|
key: "appVersion",
|
|
@@ -113,6 +115,7 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
113
115
|
*
|
|
114
116
|
* @property {string} appName
|
|
115
117
|
* @static
|
|
118
|
+
* @returns {string}
|
|
116
119
|
*/
|
|
117
120
|
}, {
|
|
118
121
|
key: "appName",
|
|
@@ -127,6 +130,7 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
127
130
|
*
|
|
128
131
|
* @property {number} badge
|
|
129
132
|
* @static
|
|
133
|
+
* @returns {number}
|
|
130
134
|
*/
|
|
131
135
|
}, {
|
|
132
136
|
key: "badge",
|
|
@@ -139,6 +143,7 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
139
143
|
*
|
|
140
144
|
* @property {string[]} channels
|
|
141
145
|
* @static
|
|
146
|
+
* @returns {string[]}
|
|
142
147
|
*/
|
|
143
148
|
}, {
|
|
144
149
|
key: "channels",
|
|
@@ -151,6 +156,7 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
151
156
|
*
|
|
152
157
|
* @property {string} deviceToken
|
|
153
158
|
* @static
|
|
159
|
+
* @returns {string}
|
|
154
160
|
*/
|
|
155
161
|
}, {
|
|
156
162
|
key: "deviceToken",
|
|
@@ -163,6 +169,7 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
163
169
|
*
|
|
164
170
|
* @property {string} deviceType
|
|
165
171
|
* @static
|
|
172
|
+
* @returns {string}
|
|
166
173
|
*/
|
|
167
174
|
}, {
|
|
168
175
|
key: "deviceType",
|
|
@@ -175,6 +182,7 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
175
182
|
*
|
|
176
183
|
* @property {string} GCMSenderId
|
|
177
184
|
* @static
|
|
185
|
+
* @returns {string}
|
|
178
186
|
*/
|
|
179
187
|
}, {
|
|
180
188
|
key: "GCMSenderId",
|
|
@@ -187,6 +195,7 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
187
195
|
*
|
|
188
196
|
* @property {string} installationId
|
|
189
197
|
* @static
|
|
198
|
+
* @returns {string}
|
|
190
199
|
*/
|
|
191
200
|
}, {
|
|
192
201
|
key: "installationId",
|
|
@@ -199,6 +208,7 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
199
208
|
*
|
|
200
209
|
* @property {string} localeIdentifier
|
|
201
210
|
* @static
|
|
211
|
+
* @returns {string}
|
|
202
212
|
*/
|
|
203
213
|
}, {
|
|
204
214
|
key: "localeIdentifier",
|
|
@@ -211,6 +221,7 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
211
221
|
*
|
|
212
222
|
* @property {string} parseVersion
|
|
213
223
|
* @static
|
|
224
|
+
* @returns {string}
|
|
214
225
|
*/
|
|
215
226
|
}, {
|
|
216
227
|
key: "parseVersion",
|
|
@@ -223,6 +234,7 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
223
234
|
*
|
|
224
235
|
* @property {string} pushType
|
|
225
236
|
* @static
|
|
237
|
+
* @returns {string}
|
|
226
238
|
*/
|
|
227
239
|
}, {
|
|
228
240
|
key: "pushType",
|
|
@@ -235,6 +247,7 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
235
247
|
*
|
|
236
248
|
* @property {string} timeZone
|
|
237
249
|
* @static
|
|
250
|
+
* @returns {string}
|
|
238
251
|
*/
|
|
239
252
|
}, {
|
|
240
253
|
key: "timeZone",
|
|
@@ -256,6 +269,7 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
256
269
|
*
|
|
257
270
|
* @property {object} DEVICE_TYPES
|
|
258
271
|
* @static
|
|
272
|
+
* @returns {object}
|
|
259
273
|
*/
|
|
260
274
|
}, {
|
|
261
275
|
key: "fetch",
|
package/lib/weapp/ParseObject.js
CHANGED
|
@@ -242,6 +242,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
242
242
|
* @param {string} className The class name for the object
|
|
243
243
|
* @param {object} attributes The initial set of data to store in the object.
|
|
244
244
|
* @param {object} options The options for this object instance.
|
|
245
|
+
* @param {boolean} [options.ignoreValidation=false] Set to `true` ignore any attribute validation errors.
|
|
245
246
|
*/
|
|
246
247
|
function ParseObject(className /*:: ?: string | { className: string, [attr: string]: any }*/, attributes /*:: ?: { [attr: string]: any }*/, options /*:: ?: { ignoreValidation: boolean }*/) {
|
|
247
248
|
(0, _classCallCheck2.default)(this, ParseObject);
|
|
@@ -1426,7 +1427,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1426
1427
|
*/
|
|
1427
1428
|
}, {
|
|
1428
1429
|
key: "fetchWithInclude",
|
|
1429
|
-
value: function (keys /*:
|
|
1430
|
+
value: function (keys /*: string | Array<string | Array<string>>*/, options /*: RequestOptions*/) /*: Promise<any>*/{
|
|
1430
1431
|
options = options || {};
|
|
1431
1432
|
options.include = keys;
|
|
1432
1433
|
return this.fetch(options);
|
|
@@ -1951,7 +1952,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1951
1952
|
*/
|
|
1952
1953
|
}, {
|
|
1953
1954
|
key: "fetchAllWithInclude",
|
|
1954
|
-
value: function (list /*: Array<ParseObject>*/, keys /*:
|
|
1955
|
+
value: function (list /*: Array<ParseObject>*/, keys /*: string | Array<string | Array<string>>*/, options /*: RequestOptions*/) {
|
|
1955
1956
|
options = options || {};
|
|
1956
1957
|
options.include = keys;
|
|
1957
1958
|
return ParseObject.fetchAll(list, options);
|
|
@@ -1989,7 +1990,7 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
1989
1990
|
*/
|
|
1990
1991
|
}, {
|
|
1991
1992
|
key: "fetchAllIfNeededWithInclude",
|
|
1992
|
-
value: function (list /*: Array<ParseObject>*/, keys /*:
|
|
1993
|
+
value: function (list /*: Array<ParseObject>*/, keys /*: string | Array<string | Array<string>>*/, options /*: RequestOptions*/) {
|
|
1993
1994
|
options = options || {};
|
|
1994
1995
|
options.include = keys;
|
|
1995
1996
|
return ParseObject.fetchAllIfNeeded(list, options);
|
|
@@ -2585,11 +2586,11 @@ var DefaultController = {
|
|
|
2585
2586
|
if (target.length < 1) {
|
|
2586
2587
|
return _promise.default.resolve([]);
|
|
2587
2588
|
}
|
|
2588
|
-
var objs = [];
|
|
2589
|
-
var ids = [];
|
|
2590
|
-
var className = null;
|
|
2591
|
-
var results = [];
|
|
2592
|
-
var error = null;
|
|
2589
|
+
var objs /*: ParseObject[]*/ = [];
|
|
2590
|
+
var ids /*: string[]*/ = [];
|
|
2591
|
+
var className /*: string | null*/ = null;
|
|
2592
|
+
var results /*: ParseObject[]*/ = [];
|
|
2593
|
+
var error /*: ParseError | null*/ = null;
|
|
2593
2594
|
(0, _forEach.default)(target).call(target, function (el) {
|
|
2594
2595
|
if (error) {
|
|
2595
2596
|
return;
|
|
@@ -2850,7 +2851,7 @@ var DefaultController = {
|
|
|
2850
2851
|
}, _callee10);
|
|
2851
2852
|
}))();
|
|
2852
2853
|
},
|
|
2853
|
-
save: function (target /*: ParseObject | null | Array<ParseObject | ParseFile>*/, options /*: RequestOptions*/) /*: Promise<ParseObject | Array<ParseObject> | ParseFile>*/{
|
|
2854
|
+
save: function (target /*: ParseObject | null | Array<ParseObject | ParseFile>*/, options /*: RequestOptions*/) /*: Promise<ParseObject | Array<ParseObject> | ParseFile | undefined>*/{
|
|
2854
2855
|
var batchSize = options && options.batchSize ? options.batchSize : _CoreManager.default.get('REQUEST_BATCH_SIZE');
|
|
2855
2856
|
var localDatastore = _CoreManager.default.getLocalDatastore();
|
|
2856
2857
|
var mapIdForPin = {};
|
|
@@ -2865,12 +2866,13 @@ var DefaultController = {
|
|
|
2865
2866
|
}
|
|
2866
2867
|
var unsaved = (0, _concat.default)(target).call(target);
|
|
2867
2868
|
for (var i = 0; i < target.length; i++) {
|
|
2868
|
-
|
|
2869
|
-
|
|
2869
|
+
var target_i = target[i];
|
|
2870
|
+
if (target_i instanceof ParseObject) {
|
|
2871
|
+
unsaved = (0, _concat.default)(unsaved).call(unsaved, (0, _unsavedChildren.default)(target_i, true));
|
|
2870
2872
|
}
|
|
2871
2873
|
}
|
|
2872
2874
|
unsaved = (0, _unique.default)(unsaved);
|
|
2873
|
-
var filesSaved /*: Array<ParseFile>*/ = [];
|
|
2875
|
+
var filesSaved /*: Array<Promise<ParseFile> | undefined>*/ = [];
|
|
2874
2876
|
var pending /*: Array<ParseObject>*/ = [];
|
|
2875
2877
|
(0, _forEach.default)(unsaved).call(unsaved, function (el) {
|
|
2876
2878
|
if (el instanceof _ParseFile.default) {
|
|
@@ -3042,7 +3044,7 @@ var DefaultController = {
|
|
|
3042
3044
|
return _promise.default.reject(error);
|
|
3043
3045
|
});
|
|
3044
3046
|
}
|
|
3045
|
-
return _promise.default.resolve();
|
|
3047
|
+
return _promise.default.resolve(undefined);
|
|
3046
3048
|
}
|
|
3047
3049
|
};
|
|
3048
3050
|
_CoreManager.default.setParseObject(ParseObject);
|
package/lib/weapp/ParseOp.js
CHANGED
|
@@ -109,13 +109,13 @@ var Op = /*#__PURE__*/function () {
|
|
|
109
109
|
key: "applyTo",
|
|
110
110
|
value:
|
|
111
111
|
// Empty parent class
|
|
112
|
-
function () /*:
|
|
112
|
+
function () /*: any*/{} /* eslint-disable-line @typescript-eslint/no-unused-vars */
|
|
113
113
|
}, {
|
|
114
114
|
key: "mergeWith",
|
|
115
|
-
value: function () /*: ?Op*/{} /* eslint-disable-line no-unused-vars */
|
|
115
|
+
value: function () /*: ?Op*/{} /* eslint-disable-line @typescript-eslint/no-unused-vars */
|
|
116
116
|
}, {
|
|
117
117
|
key: "toJSON",
|
|
118
|
-
value: function () /*:
|
|
118
|
+
value: function () /*: any*/{}
|
|
119
119
|
}]);
|
|
120
120
|
return Op;
|
|
121
121
|
}();
|
|
@@ -123,7 +123,7 @@ exports.Op = Op;
|
|
|
123
123
|
var SetOp = /*#__PURE__*/function (_Op) {
|
|
124
124
|
(0, _inherits2.default)(SetOp, _Op);
|
|
125
125
|
var _super = _createSuper(SetOp);
|
|
126
|
-
function SetOp(value /*:
|
|
126
|
+
function SetOp(value /*: any*/) {
|
|
127
127
|
var _this;
|
|
128
128
|
(0, _classCallCheck2.default)(this, SetOp);
|
|
129
129
|
_this = _super.call(this);
|
|
@@ -133,7 +133,7 @@ var SetOp = /*#__PURE__*/function (_Op) {
|
|
|
133
133
|
}
|
|
134
134
|
(0, _createClass2.default)(SetOp, [{
|
|
135
135
|
key: "applyTo",
|
|
136
|
-
value: function () /*:
|
|
136
|
+
value: function () /*: any*/{
|
|
137
137
|
return this._value;
|
|
138
138
|
}
|
|
139
139
|
}, {
|
|
@@ -194,7 +194,7 @@ var IncrementOp = /*#__PURE__*/function (_Op3) {
|
|
|
194
194
|
}
|
|
195
195
|
(0, _createClass2.default)(IncrementOp, [{
|
|
196
196
|
key: "applyTo",
|
|
197
|
-
value: function (value /*: ?
|
|
197
|
+
value: function (value /*: ?any*/) /*: number*/{
|
|
198
198
|
if (typeof value === 'undefined') {
|
|
199
199
|
return this._amount;
|
|
200
200
|
}
|
|
@@ -235,7 +235,7 @@ exports.IncrementOp = IncrementOp;
|
|
|
235
235
|
var AddOp = /*#__PURE__*/function (_Op4) {
|
|
236
236
|
(0, _inherits2.default)(AddOp, _Op4);
|
|
237
237
|
var _super4 = _createSuper(AddOp);
|
|
238
|
-
function AddOp(value /*:
|
|
238
|
+
function AddOp(value /*: any | Array<any>*/) {
|
|
239
239
|
var _this3;
|
|
240
240
|
(0, _classCallCheck2.default)(this, AddOp);
|
|
241
241
|
_this3 = _super4.call(this);
|
|
@@ -245,7 +245,7 @@ var AddOp = /*#__PURE__*/function (_Op4) {
|
|
|
245
245
|
}
|
|
246
246
|
(0, _createClass2.default)(AddOp, [{
|
|
247
247
|
key: "applyTo",
|
|
248
|
-
value: function (value /*:
|
|
248
|
+
value: function (value /*: any*/) /*: Array<any>*/{
|
|
249
249
|
if (value == null) {
|
|
250
250
|
return this._value;
|
|
251
251
|
}
|
|
@@ -273,7 +273,7 @@ var AddOp = /*#__PURE__*/function (_Op4) {
|
|
|
273
273
|
}
|
|
274
274
|
}, {
|
|
275
275
|
key: "toJSON",
|
|
276
|
-
value: function () /*: { __op: string, objects:
|
|
276
|
+
value: function () /*: { __op: string, objects: any }*/{
|
|
277
277
|
return {
|
|
278
278
|
__op: 'Add',
|
|
279
279
|
objects: (0, _encode.default)(this._value, false, true)
|
|
@@ -286,7 +286,7 @@ exports.AddOp = AddOp;
|
|
|
286
286
|
var AddUniqueOp = /*#__PURE__*/function (_Op5) {
|
|
287
287
|
(0, _inherits2.default)(AddUniqueOp, _Op5);
|
|
288
288
|
var _super5 = _createSuper(AddUniqueOp);
|
|
289
|
-
function AddUniqueOp(value /*:
|
|
289
|
+
function AddUniqueOp(value /*: any | Array<any>*/) {
|
|
290
290
|
var _this4;
|
|
291
291
|
(0, _classCallCheck2.default)(this, AddUniqueOp);
|
|
292
292
|
_this4 = _super5.call(this);
|
|
@@ -296,7 +296,7 @@ var AddUniqueOp = /*#__PURE__*/function (_Op5) {
|
|
|
296
296
|
}
|
|
297
297
|
(0, _createClass2.default)(AddUniqueOp, [{
|
|
298
298
|
key: "applyTo",
|
|
299
|
-
value: function (value /*:
|
|
299
|
+
value: function (value /*: any | Array<any>*/) /*: Array<any>*/{
|
|
300
300
|
if (value == null) {
|
|
301
301
|
return this._value || [];
|
|
302
302
|
}
|
|
@@ -338,7 +338,7 @@ var AddUniqueOp = /*#__PURE__*/function (_Op5) {
|
|
|
338
338
|
}
|
|
339
339
|
}, {
|
|
340
340
|
key: "toJSON",
|
|
341
|
-
value: function () /*: { __op: string, objects:
|
|
341
|
+
value: function () /*: { __op: string, objects: any }*/{
|
|
342
342
|
return {
|
|
343
343
|
__op: 'AddUnique',
|
|
344
344
|
objects: (0, _encode.default)(this._value, false, true)
|
|
@@ -351,7 +351,7 @@ exports.AddUniqueOp = AddUniqueOp;
|
|
|
351
351
|
var RemoveOp = /*#__PURE__*/function (_Op6) {
|
|
352
352
|
(0, _inherits2.default)(RemoveOp, _Op6);
|
|
353
353
|
var _super6 = _createSuper(RemoveOp);
|
|
354
|
-
function RemoveOp(value /*:
|
|
354
|
+
function RemoveOp(value /*: any | Array<any>*/) {
|
|
355
355
|
var _this5;
|
|
356
356
|
(0, _classCallCheck2.default)(this, RemoveOp);
|
|
357
357
|
_this5 = _super6.call(this);
|
|
@@ -361,7 +361,7 @@ var RemoveOp = /*#__PURE__*/function (_Op6) {
|
|
|
361
361
|
}
|
|
362
362
|
(0, _createClass2.default)(RemoveOp, [{
|
|
363
363
|
key: "applyTo",
|
|
364
|
-
value: function (value /*:
|
|
364
|
+
value: function (value /*: any | Array<any>*/) /*: Array<any>*/{
|
|
365
365
|
if (value == null) {
|
|
366
366
|
return [];
|
|
367
367
|
}
|
|
@@ -421,7 +421,7 @@ var RemoveOp = /*#__PURE__*/function (_Op6) {
|
|
|
421
421
|
}
|
|
422
422
|
}, {
|
|
423
423
|
key: "toJSON",
|
|
424
|
-
value: function () /*: { __op: string, objects:
|
|
424
|
+
value: function () /*: { __op: string, objects: any }*/{
|
|
425
425
|
return {
|
|
426
426
|
__op: 'Remove',
|
|
427
427
|
objects: (0, _encode.default)(this._value, false, true)
|
|
@@ -469,7 +469,7 @@ var RelationOp = /*#__PURE__*/function (_Op7) {
|
|
|
469
469
|
}
|
|
470
470
|
}, {
|
|
471
471
|
key: "applyTo",
|
|
472
|
-
value: function (value /*:
|
|
472
|
+
value: function (value /*: any*/, parent /*: ParseObject*/, key /*:: ?: string*/) /*: ?ParseRelation*/{
|
|
473
473
|
if (!value) {
|
|
474
474
|
if (!parent || !key) {
|
|
475
475
|
throw new Error('Cannot apply a RelationOp without either a previous value, or an object and a key');
|
|
@@ -541,7 +541,7 @@ var RelationOp = /*#__PURE__*/function (_Op7) {
|
|
|
541
541
|
}
|
|
542
542
|
}, {
|
|
543
543
|
key: "toJSON",
|
|
544
|
-
value: function () /*: { __op?: string, objects?:
|
|
544
|
+
value: function () /*: { __op?: string, objects?: any, ops?: any }*/{
|
|
545
545
|
var _this7 = this;
|
|
546
546
|
var idToPointer = function (id) {
|
|
547
547
|
return {
|
|
@@ -82,7 +82,7 @@ var ParsePolygon = /*#__PURE__*/function () {
|
|
|
82
82
|
*/
|
|
83
83
|
}, {
|
|
84
84
|
key: "equals",
|
|
85
|
-
value: function (other /*:
|
|
85
|
+
value: function (other /*: any*/) /*: boolean*/{
|
|
86
86
|
if (!(other instanceof ParsePolygon) || this.coordinates.length !== other.coordinates.length) {
|
|
87
87
|
return false;
|
|
88
88
|
}
|