parse 6.1.0-alpha.1 → 6.1.0-alpha.3
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 +0 -8
- package/dist/parse.js +93 -105
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +93 -105
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/Cloud.js +1 -0
- package/lib/browser/CoreManager.js +2 -2
- package/lib/browser/CryptoController.js +0 -1
- package/lib/browser/EventEmitter.js +0 -1
- package/lib/browser/EventuallyQueue.js +6 -10
- package/lib/browser/IndexedDBStorageController.js +0 -1
- package/lib/browser/InstallationController.js +0 -1
- package/lib/browser/LiveQuerySubscription.js +4 -4
- package/lib/browser/LocalDatastore.js +0 -1
- package/lib/browser/LocalDatastoreController.default.js +0 -1
- package/lib/browser/LocalDatastoreController.js +0 -1
- package/lib/browser/LocalDatastoreController.react-native.js +0 -1
- package/lib/browser/OfflineQuery.js +0 -1
- package/lib/browser/Parse.js +12 -1
- package/lib/browser/ParseACL.js +1 -1
- package/lib/browser/ParseConfig.js +2 -4
- package/lib/browser/ParseInstallation.js +0 -1
- package/lib/browser/ParseLiveQuery.js +2 -2
- package/lib/browser/ParseObject.js +10 -10
- package/lib/browser/ParseQuery.js +26 -25
- package/lib/browser/ParseRole.js +1 -1
- package/lib/browser/ParseSchema.js +6 -6
- package/lib/browser/ParseUser.js +10 -12
- package/lib/browser/RESTController.js +7 -3
- package/lib/browser/Socket.weapp.js +0 -1
- package/lib/browser/Storage.js +0 -1
- package/lib/browser/StorageController.browser.js +0 -1
- package/lib/browser/StorageController.default.js +0 -1
- package/lib/browser/StorageController.js +0 -1
- package/lib/browser/StorageController.react-native.js +0 -1
- package/lib/browser/StorageController.weapp.js +0 -1
- package/lib/browser/TaskQueue.js +0 -1
- package/lib/browser/WebSocketController.js +0 -1
- package/lib/browser/Xhr.weapp.js +0 -1
- package/lib/browser/uuid.js +0 -1
- package/lib/node/Cloud.js +1 -0
- package/lib/node/CoreManager.js +2 -2
- package/lib/node/CryptoController.js +0 -1
- package/lib/node/EventEmitter.js +0 -1
- package/lib/node/EventuallyQueue.js +6 -7
- package/lib/node/IndexedDBStorageController.js +0 -1
- package/lib/node/InstallationController.js +0 -1
- package/lib/node/LiveQuerySubscription.js +4 -4
- package/lib/node/LocalDatastore.js +0 -1
- package/lib/node/LocalDatastoreController.default.js +0 -1
- package/lib/node/LocalDatastoreController.js +0 -1
- package/lib/node/LocalDatastoreController.react-native.js +0 -1
- package/lib/node/OfflineQuery.js +0 -1
- package/lib/node/Parse.js +12 -1
- package/lib/node/ParseACL.js +1 -1
- package/lib/node/ParseConfig.js +2 -2
- package/lib/node/ParseInstallation.js +0 -1
- package/lib/node/ParseLiveQuery.js +2 -2
- package/lib/node/ParseObject.js +10 -7
- package/lib/node/ParseQuery.js +7 -7
- package/lib/node/ParseRole.js +1 -1
- package/lib/node/ParseSchema.js +6 -4
- package/lib/node/ParseUser.js +10 -10
- package/lib/node/RESTController.js +3 -1
- package/lib/node/Socket.weapp.js +0 -1
- package/lib/node/Storage.js +0 -1
- package/lib/node/StorageController.browser.js +0 -1
- package/lib/node/StorageController.default.js +0 -1
- package/lib/node/StorageController.js +0 -1
- package/lib/node/StorageController.react-native.js +0 -1
- package/lib/node/StorageController.weapp.js +0 -1
- package/lib/node/TaskQueue.js +0 -1
- package/lib/node/WebSocketController.js +0 -1
- package/lib/node/Xhr.weapp.js +0 -1
- package/lib/node/uuid.js +0 -1
- package/lib/react-native/CoreManager.js +2 -2
- package/lib/react-native/CryptoController.js +0 -1
- package/lib/react-native/EventEmitter.js +0 -1
- package/lib/react-native/EventuallyQueue.js +5 -9
- package/lib/react-native/IndexedDBStorageController.js +0 -1
- package/lib/react-native/InstallationController.js +0 -1
- package/lib/react-native/LiveQuerySubscription.js +7 -7
- package/lib/react-native/LocalDatastore.js +0 -1
- package/lib/react-native/LocalDatastoreController.default.js +0 -1
- package/lib/react-native/LocalDatastoreController.js +0 -1
- package/lib/react-native/LocalDatastoreController.react-native.js +0 -1
- package/lib/react-native/OfflineQuery.js +0 -1
- package/lib/react-native/Parse.js +8 -1
- package/lib/react-native/ParseConfig.js +2 -4
- package/lib/react-native/ParseInstallation.js +0 -1
- package/lib/react-native/ParseLiveQuery.js +2 -2
- package/lib/react-native/ParseObject.js +16 -18
- package/lib/react-native/ParseQuery.js +5 -6
- package/lib/react-native/ParseSchema.js +5 -6
- package/lib/react-native/ParseUser.js +3 -5
- package/lib/react-native/RESTController.js +3 -1
- package/lib/react-native/Socket.weapp.js +0 -1
- package/lib/react-native/Storage.js +0 -1
- package/lib/react-native/StorageController.browser.js +0 -1
- package/lib/react-native/StorageController.default.js +0 -1
- package/lib/react-native/StorageController.js +0 -1
- package/lib/react-native/StorageController.react-native.js +0 -1
- package/lib/react-native/StorageController.weapp.js +0 -1
- package/lib/react-native/TaskQueue.js +0 -1
- package/lib/react-native/WebSocketController.js +0 -1
- package/lib/react-native/Xhr.weapp.js +0 -1
- package/lib/react-native/uuid.js +0 -1
- package/lib/weapp/Cloud.js +1 -0
- package/lib/weapp/CoreManager.js +2 -2
- package/lib/weapp/CryptoController.js +0 -1
- package/lib/weapp/EventEmitter.js +0 -1
- package/lib/weapp/EventuallyQueue.js +6 -10
- package/lib/weapp/IndexedDBStorageController.js +0 -1
- package/lib/weapp/InstallationController.js +0 -1
- package/lib/weapp/LiveQuerySubscription.js +4 -4
- package/lib/weapp/LocalDatastore.js +0 -1
- package/lib/weapp/LocalDatastoreController.default.js +0 -1
- package/lib/weapp/LocalDatastoreController.js +0 -1
- package/lib/weapp/LocalDatastoreController.react-native.js +0 -1
- package/lib/weapp/OfflineQuery.js +0 -1
- package/lib/weapp/Parse.js +12 -1
- package/lib/weapp/ParseACL.js +1 -1
- package/lib/weapp/ParseConfig.js +2 -4
- package/lib/weapp/ParseInstallation.js +0 -1
- package/lib/weapp/ParseLiveQuery.js +2 -2
- package/lib/weapp/ParseObject.js +10 -10
- package/lib/weapp/ParseQuery.js +26 -25
- package/lib/weapp/ParseRole.js +1 -1
- package/lib/weapp/ParseSchema.js +6 -6
- package/lib/weapp/ParseUser.js +10 -12
- package/lib/weapp/RESTController.js +7 -3
- package/lib/weapp/Socket.weapp.js +0 -1
- package/lib/weapp/Storage.js +0 -1
- package/lib/weapp/StorageController.browser.js +0 -1
- package/lib/weapp/StorageController.default.js +0 -1
- package/lib/weapp/StorageController.js +0 -1
- package/lib/weapp/StorageController.react-native.js +0 -1
- package/lib/weapp/StorageController.weapp.js +0 -1
- package/lib/weapp/TaskQueue.js +0 -1
- package/lib/weapp/WebSocketController.js +0 -1
- package/lib/weapp/Xhr.weapp.js +0 -1
- package/lib/weapp/uuid.js +0 -1
- package/package.json +15 -12
- package/types/Analytics.d.ts +42 -0
- package/types/AnonymousUtils.d.ts +84 -0
- package/types/Cloud.d.ts +65 -0
- package/types/CloudCode.d.ts +307 -0
- package/types/CoreManager.d.ts +325 -0
- package/types/CryptoController.d.ts +5 -0
- package/types/EventEmitter.d.ts +5 -0
- package/types/EventuallyQueue.d.ts +168 -0
- package/types/FacebookUtils.d.ts +107 -0
- package/types/IndexedDBStorageController.d.ts +2 -0
- package/types/InstallationController.d.ts +10 -0
- package/types/LiveQueryClient.d.ts +128 -0
- package/types/LiveQuerySubscription.d.ts +103 -0
- package/types/LocalDatastore.d.ts +56 -0
- package/types/LocalDatastoreController.d.ts +2 -0
- package/types/LocalDatastoreController.default.d.ts +9 -0
- package/types/LocalDatastoreController.react-native.d.ts +9 -0
- package/types/LocalDatastoreUtils.d.ts +5 -0
- package/types/ObjectStateMutations.d.ts +28 -0
- package/types/OfflineQuery.d.ts +20 -0
- package/types/Parse.d.ts +633 -0
- package/types/ParseACL.d.ts +141 -0
- package/types/ParseCLP.d.ts +293 -0
- package/types/ParseConfig.d.ts +77 -0
- package/types/ParseError.d.ts +476 -0
- package/types/ParseFile.d.ts +192 -0
- package/types/ParseGeoPoint.d.ts +104 -0
- package/types/ParseHooks.d.ts +27 -0
- package/types/ParseInstallation.d.ts +179 -0
- package/types/ParseLiveQuery.d.ts +48 -0
- package/types/ParseObject.d.ts +1072 -0
- package/types/ParseOp.d.ts +78 -0
- package/types/ParsePolygon.d.ts +69 -0
- package/types/ParseQuery.d.ts +961 -0
- package/types/ParseRelation.d.ts +56 -0
- package/types/ParseRole.d.ts +79 -0
- package/types/ParseSchema.d.ts +286 -0
- package/types/ParseSession.d.ts +45 -0
- package/types/ParseUser.d.ts +517 -0
- package/types/Push.d.ts +62 -0
- package/types/RESTController.d.ts +35 -0
- package/types/SingleInstanceStateController.d.ts +24 -0
- package/types/Socket.weapp.d.ts +10 -0
- package/types/Storage.d.ts +14 -0
- package/types/StorageController.browser.d.ts +9 -0
- package/types/StorageController.d.ts +2 -0
- package/types/StorageController.default.d.ts +9 -0
- package/types/StorageController.react-native.d.ts +11 -0
- package/types/StorageController.weapp.d.ts +9 -0
- package/types/TaskQueue.d.ts +11 -0
- package/types/UniqueInstanceStateController.d.ts +20 -0
- package/types/WebSocketController.d.ts +2 -0
- package/types/Xhr.weapp.d.ts +29 -0
- package/types/arrayContainsObject.d.ts +2 -0
- package/types/canBeSerialized.d.ts +2 -0
- package/types/decode.d.ts +1 -0
- package/types/encode.d.ts +1 -0
- package/types/equals.d.ts +1 -0
- package/types/escape.d.ts +1 -0
- package/types/index.d.ts +66 -0
- package/types/isRevocableSession.d.ts +1 -0
- package/types/node.d.ts +3 -0
- package/types/parseDate.d.ts +1 -0
- package/types/promiseUtils.d.ts +9 -0
- package/types/react-native.d.ts +3 -0
- package/types/tests.ts +2256 -0
- package/types/tsconfig.json +25 -0
- package/types/unique.d.ts +1 -0
- package/types/unsavedChildren.d.ts +11 -0
- package/types/uuid.d.ts +2 -0
|
@@ -12,9 +12,10 @@ var config = {
|
|
|
12
12
|
SERVER_AUTH_TOKEN: null,
|
|
13
13
|
LIVEQUERY_SERVER_URL: null,
|
|
14
14
|
ENCRYPTED_KEY: null,
|
|
15
|
-
VERSION: 'js' + "6.1.0-alpha.
|
|
15
|
+
VERSION: 'js' + "6.1.0-alpha.3",
|
|
16
16
|
APPLICATION_ID: null,
|
|
17
17
|
JAVASCRIPT_KEY: null,
|
|
18
|
+
MAINTENANCE_KEY: null,
|
|
18
19
|
MASTER_KEY: null,
|
|
19
20
|
USE_MASTER_KEY: false,
|
|
20
21
|
PERFORM_USER_REWRITE: true,
|
|
@@ -245,5 +246,4 @@ var CoreManager = {
|
|
|
245
246
|
return config['ParseUser'];
|
|
246
247
|
}
|
|
247
248
|
};
|
|
248
|
-
module.exports = CoreManager;
|
|
249
249
|
var _default = exports.default = CoreManager;
|
|
@@ -15,12 +15,10 @@ var queueCache = [];
|
|
|
15
15
|
var dirtyCache = true;
|
|
16
16
|
var polling = undefined;
|
|
17
17
|
var EventuallyQueue = {
|
|
18
|
-
save: function (object) {
|
|
19
|
-
var serverOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
18
|
+
save: function (object, serverOptions) {
|
|
20
19
|
return this.enqueue('save', object, serverOptions);
|
|
21
20
|
},
|
|
22
|
-
destroy: function (object) {
|
|
23
|
-
var serverOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
21
|
+
destroy: function (object, serverOptions) {
|
|
24
22
|
return this.enqueue('destroy', object, serverOptions);
|
|
25
23
|
},
|
|
26
24
|
generateQueueId: function (action, object) {
|
|
@@ -49,7 +47,7 @@ var EventuallyQueue = {
|
|
|
49
47
|
queueId: queueId,
|
|
50
48
|
action: action,
|
|
51
49
|
object: object.toJSON(),
|
|
52
|
-
serverOptions: serverOptions,
|
|
50
|
+
serverOptions: serverOptions || {},
|
|
53
51
|
id: object.id,
|
|
54
52
|
className: object.className,
|
|
55
53
|
hash: object.get('hash'),
|
|
@@ -182,9 +180,8 @@ var EventuallyQueue = {
|
|
|
182
180
|
}
|
|
183
181
|
return sendQueueCallback;
|
|
184
182
|
}(),
|
|
185
|
-
poll: function () {
|
|
183
|
+
poll: function (ms) {
|
|
186
184
|
var _this = this;
|
|
187
|
-
var ms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000;
|
|
188
185
|
if (polling) {
|
|
189
186
|
return;
|
|
190
187
|
}
|
|
@@ -199,7 +196,7 @@ var EventuallyQueue = {
|
|
|
199
196
|
}).catch(function (e) {
|
|
200
197
|
return e;
|
|
201
198
|
});
|
|
202
|
-
}, ms);
|
|
199
|
+
}, ms || 2000);
|
|
203
200
|
},
|
|
204
201
|
stopPoll: function () {
|
|
205
202
|
clearInterval(polling);
|
|
@@ -251,5 +248,4 @@ var EventuallyQueue = {
|
|
|
251
248
|
}()
|
|
252
249
|
}
|
|
253
250
|
};
|
|
254
|
-
module.exports = EventuallyQueue;
|
|
255
251
|
var _default = exports.default = EventuallyQueue;
|
|
@@ -7,18 +7,18 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
7
7
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
8
8
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
9
9
|
var _promiseUtils = require("./promiseUtils");
|
|
10
|
-
var
|
|
11
|
-
function
|
|
10
|
+
var LiveQuerySubscription = function () {
|
|
11
|
+
function LiveQuerySubscription(id, query, sessionToken) {
|
|
12
12
|
var _this = this;
|
|
13
|
-
(0, _classCallCheck2.default)(this,
|
|
13
|
+
(0, _classCallCheck2.default)(this, LiveQuerySubscription);
|
|
14
14
|
this.id = id;
|
|
15
15
|
this.query = query;
|
|
16
16
|
this.sessionToken = sessionToken;
|
|
17
17
|
this.subscribePromise = (0, _promiseUtils.resolvingPromise)();
|
|
18
18
|
this.unsubscribePromise = (0, _promiseUtils.resolvingPromise)();
|
|
19
19
|
this.subscribed = false;
|
|
20
|
-
var
|
|
21
|
-
this.emitter = new
|
|
20
|
+
var Emitter = _CoreManager.default.getEventEmitter();
|
|
21
|
+
this.emitter = new Emitter();
|
|
22
22
|
this.on = function (eventName, listener) {
|
|
23
23
|
return _this.emitter.on(eventName, listener);
|
|
24
24
|
};
|
|
@@ -31,7 +31,7 @@ var Subscription = function () {
|
|
|
31
31
|
};
|
|
32
32
|
this.on('error', function () {});
|
|
33
33
|
}
|
|
34
|
-
return (0, _createClass2.default)(
|
|
34
|
+
return (0, _createClass2.default)(LiveQuerySubscription, [{
|
|
35
35
|
key: "unsubscribe",
|
|
36
36
|
value: function () {
|
|
37
37
|
var _this2 = this;
|
|
@@ -42,4 +42,4 @@ var Subscription = function () {
|
|
|
42
42
|
}
|
|
43
43
|
}]);
|
|
44
44
|
}();
|
|
45
|
-
var _default = exports.default =
|
|
45
|
+
var _default = exports.default = LiveQuerySubscription;
|
|
@@ -408,7 +408,6 @@ var LocalDatastore = {
|
|
|
408
408
|
return this.isEnabled;
|
|
409
409
|
}
|
|
410
410
|
};
|
|
411
|
-
module.exports = LocalDatastore;
|
|
412
411
|
var _default = exports.default = LocalDatastore;
|
|
413
412
|
_CoreManager.default.setLocalDatastoreController(_LocalDatastoreController.default);
|
|
414
413
|
_CoreManager.default.setLocalDatastore(LocalDatastore);
|
|
@@ -7,5 +7,4 @@ var _LocalDatastoreController = _interopRequireDefault(require("./LocalDatastore
|
|
|
7
7
|
var _LocalDatastoreController2 = _interopRequireDefault(require("./LocalDatastoreController.default"));
|
|
8
8
|
var LocalDatastoreController = _LocalDatastoreController2.default;
|
|
9
9
|
LocalDatastoreController = _LocalDatastoreController.default;
|
|
10
|
-
module.exports = LocalDatastoreController;
|
|
11
10
|
var _default = exports.default = LocalDatastoreController;
|
|
@@ -112,9 +112,10 @@ var Parse = {
|
|
|
112
112
|
initialize: function (applicationId, javaScriptKey) {
|
|
113
113
|
Parse._initialize(applicationId, javaScriptKey);
|
|
114
114
|
},
|
|
115
|
-
_initialize: function (applicationId, javaScriptKey, masterKey) {
|
|
115
|
+
_initialize: function (applicationId, javaScriptKey, masterKey, maintenanceKey) {
|
|
116
116
|
_CoreManager.default.set('APPLICATION_ID', applicationId);
|
|
117
117
|
_CoreManager.default.set('JAVASCRIPT_KEY', javaScriptKey);
|
|
118
|
+
_CoreManager.default.set('MAINTENANCE_KEY', maintenanceKey);
|
|
118
119
|
_CoreManager.default.set('MASTER_KEY', masterKey);
|
|
119
120
|
_CoreManager.default.set('USE_MASTER_KEY', false);
|
|
120
121
|
_CoreManager.default.setIfNeeded('EventEmitter', _EventEmitter.default);
|
|
@@ -153,6 +154,12 @@ var Parse = {
|
|
|
153
154
|
get masterKey() {
|
|
154
155
|
return _CoreManager.default.get('MASTER_KEY');
|
|
155
156
|
},
|
|
157
|
+
set maintenanceKey(value) {
|
|
158
|
+
_CoreManager.default.set('MAINTENANCE_KEY', value);
|
|
159
|
+
},
|
|
160
|
+
get maintenanceKey() {
|
|
161
|
+
return _CoreManager.default.get('MAINTENANCE_KEY');
|
|
162
|
+
},
|
|
156
163
|
set serverURL(value) {
|
|
157
164
|
_CoreManager.default.set('SERVER_URL', value);
|
|
158
165
|
},
|
|
@@ -45,8 +45,7 @@ var ParseConfig = function () {
|
|
|
45
45
|
}
|
|
46
46
|
}, {
|
|
47
47
|
key: "get",
|
|
48
|
-
value: function () {
|
|
49
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
48
|
+
value: function (options) {
|
|
50
49
|
var controller = _CoreManager.default.getConfigController();
|
|
51
50
|
return controller.get(options);
|
|
52
51
|
}
|
|
@@ -110,8 +109,7 @@ var DefaultController = {
|
|
|
110
109
|
return config;
|
|
111
110
|
});
|
|
112
111
|
},
|
|
113
|
-
get: function () {
|
|
114
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
112
|
+
get: function (options) {
|
|
115
113
|
var RESTController = _CoreManager.default.getRESTController();
|
|
116
114
|
return RESTController.request('GET', 'config', {}, options).then(function (response) {
|
|
117
115
|
if (!response || !response.params) {
|
|
@@ -194,5 +194,4 @@ var ParseInstallation = function (_ParseObject) {
|
|
|
194
194
|
}]);
|
|
195
195
|
}(_ParseObject2.default);
|
|
196
196
|
_ParseObject2.default.registerSubclass('_Installation', ParseInstallation);
|
|
197
|
-
module.exports = ParseInstallation;
|
|
198
197
|
var _default = exports.default = ParseInstallation;
|
|
@@ -16,8 +16,8 @@ var LiveQuery = function () {
|
|
|
16
16
|
function LiveQuery() {
|
|
17
17
|
var _this = this;
|
|
18
18
|
(0, _classCallCheck2.default)(this, LiveQuery);
|
|
19
|
-
var
|
|
20
|
-
this.emitter = new
|
|
19
|
+
var Emitter = _CoreManager.default.getEventEmitter();
|
|
20
|
+
this.emitter = new Emitter();
|
|
21
21
|
this.on = function (eventName, listener) {
|
|
22
22
|
return _this.emitter.on(eventName, listener);
|
|
23
23
|
};
|
|
@@ -740,9 +740,9 @@ var ParseObject = function () {
|
|
|
740
740
|
if (Object.hasOwn(attrs, 'ACL') && !(attrs.ACL instanceof _ParseACL.default)) {
|
|
741
741
|
return new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'ACL must be a Parse ACL.');
|
|
742
742
|
}
|
|
743
|
-
for (var
|
|
744
|
-
if (!/^[A-Za-z_][0-9A-Za-z_.]*$/.test(
|
|
745
|
-
return new _ParseError.default(_ParseError.default.INVALID_KEY_NAME, `Invalid key name: ${
|
|
743
|
+
for (var _key in attrs) {
|
|
744
|
+
if (!/^[A-Za-z_][0-9A-Za-z_.]*$/.test(_key)) {
|
|
745
|
+
return new _ParseError.default(_ParseError.default.INVALID_KEY_NAME, `Invalid key name: ${_key}`);
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
748
|
return false;
|
|
@@ -765,14 +765,14 @@ var ParseObject = function () {
|
|
|
765
765
|
key: "revert",
|
|
766
766
|
value: function () {
|
|
767
767
|
var keysToRevert;
|
|
768
|
-
for (var _len = arguments.length, keys = new Array(_len),
|
|
769
|
-
keys[
|
|
768
|
+
for (var _len = arguments.length, keys = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {
|
|
769
|
+
keys[_key2] = arguments[_key2];
|
|
770
770
|
}
|
|
771
771
|
if (keys.length) {
|
|
772
772
|
keysToRevert = [];
|
|
773
|
-
for (var
|
|
774
|
-
if (typeof
|
|
775
|
-
keysToRevert.push(
|
|
773
|
+
for (var _key3 of keys) {
|
|
774
|
+
if (typeof _key3 === 'string') {
|
|
775
|
+
keysToRevert.push(_key3);
|
|
776
776
|
} else {
|
|
777
777
|
throw new Error('Parse.Object#revert expects either no, or a list of string, arguments.');
|
|
778
778
|
}
|
|
@@ -835,7 +835,6 @@ var ParseObject = function () {
|
|
|
835
835
|
key: "save",
|
|
836
836
|
value: function () {
|
|
837
837
|
var _save = (0, _asyncToGenerator2.default)(function* (arg1, arg2, arg3) {
|
|
838
|
-
var _this = this;
|
|
839
838
|
var attrs;
|
|
840
839
|
var options;
|
|
841
840
|
if (typeof arg1 === 'object' || typeof arg1 === 'undefined') {
|
|
@@ -871,9 +870,8 @@ var ParseObject = function () {
|
|
|
871
870
|
return savedOjbects.pop();
|
|
872
871
|
});
|
|
873
872
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
});
|
|
873
|
+
yield controller.save(unsaved, saveOptions);
|
|
874
|
+
return controller.save(this, saveOptions);
|
|
877
875
|
});
|
|
878
876
|
function save() {
|
|
879
877
|
return _save.apply(this, arguments);
|
|
@@ -981,6 +979,9 @@ var ParseObject = function () {
|
|
|
981
979
|
if (hasOwn(options, 'useMasterKey')) {
|
|
982
980
|
requestOptions.useMasterKey = !!options.useMasterKey;
|
|
983
981
|
}
|
|
982
|
+
if (hasOwn(options, 'useMaintenanceKey')) {
|
|
983
|
+
requestOptions.useMaintenanceKey = !!options.useMaintenanceKey;
|
|
984
|
+
}
|
|
984
985
|
if (hasOwn(options, 'sessionToken') && typeof options.sessionToken === 'string') {
|
|
985
986
|
requestOptions.sessionToken = options.sessionToken;
|
|
986
987
|
}
|
|
@@ -1015,8 +1016,7 @@ var ParseObject = function () {
|
|
|
1015
1016
|
}
|
|
1016
1017
|
}, {
|
|
1017
1018
|
key: "fetchAll",
|
|
1018
|
-
value: function (list) {
|
|
1019
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1019
|
+
value: function (list, options) {
|
|
1020
1020
|
var fetchOptions = ParseObject._getRequestOptions(options);
|
|
1021
1021
|
return _CoreManager.default.getObjectController().fetch(list, true, fetchOptions);
|
|
1022
1022
|
}
|
|
@@ -1059,15 +1059,13 @@ var ParseObject = function () {
|
|
|
1059
1059
|
}
|
|
1060
1060
|
}, {
|
|
1061
1061
|
key: "destroyAll",
|
|
1062
|
-
value: function (list) {
|
|
1063
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1062
|
+
value: function (list, options) {
|
|
1064
1063
|
var destroyOptions = ParseObject._getRequestOptions(options);
|
|
1065
1064
|
return _CoreManager.default.getObjectController().destroy(list, destroyOptions);
|
|
1066
1065
|
}
|
|
1067
1066
|
}, {
|
|
1068
1067
|
key: "saveAll",
|
|
1069
|
-
value: function (list) {
|
|
1070
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1068
|
+
value: function (list, options) {
|
|
1071
1069
|
var saveOptions = ParseObject._getRequestOptions(options);
|
|
1072
1070
|
return _CoreManager.default.getObjectController().save(list, saveOptions);
|
|
1073
1071
|
}
|
|
@@ -734,13 +734,13 @@ var ParseQuery = function () {
|
|
|
734
734
|
}
|
|
735
735
|
}, {
|
|
736
736
|
key: "containedIn",
|
|
737
|
-
value: function (key,
|
|
738
|
-
return this._addCondition(key, '$in',
|
|
737
|
+
value: function (key, values) {
|
|
738
|
+
return this._addCondition(key, '$in', values);
|
|
739
739
|
}
|
|
740
740
|
}, {
|
|
741
741
|
key: "notContainedIn",
|
|
742
|
-
value: function (key,
|
|
743
|
-
return this._addCondition(key, '$nin',
|
|
742
|
+
value: function (key, values) {
|
|
743
|
+
return this._addCondition(key, '$nin', values);
|
|
744
744
|
}
|
|
745
745
|
}, {
|
|
746
746
|
key: "containedBy",
|
|
@@ -840,8 +840,7 @@ var ParseQuery = function () {
|
|
|
840
840
|
}
|
|
841
841
|
}, {
|
|
842
842
|
key: "fullText",
|
|
843
|
-
value: function (key, value) {
|
|
844
|
-
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
843
|
+
value: function (key, value, options) {
|
|
845
844
|
options = options || {};
|
|
846
845
|
if (!key) {
|
|
847
846
|
throw new Error('A key is required.');
|
|
@@ -95,9 +95,9 @@ var ParseSchema = function () {
|
|
|
95
95
|
}
|
|
96
96
|
}, {
|
|
97
97
|
key: "addField",
|
|
98
|
-
value: function (name, type) {
|
|
99
|
-
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
98
|
+
value: function (name, type, options) {
|
|
100
99
|
type = type || 'String';
|
|
100
|
+
options = options || {};
|
|
101
101
|
if (!name) {
|
|
102
102
|
throw new Error('field name may not be null.');
|
|
103
103
|
}
|
|
@@ -202,8 +202,7 @@ var ParseSchema = function () {
|
|
|
202
202
|
}
|
|
203
203
|
}, {
|
|
204
204
|
key: "addPointer",
|
|
205
|
-
value: function (name, targetClass) {
|
|
206
|
-
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
205
|
+
value: function (name, targetClass, options) {
|
|
207
206
|
if (!name) {
|
|
208
207
|
throw new Error('field name may not be null.');
|
|
209
208
|
}
|
|
@@ -214,10 +213,10 @@ var ParseSchema = function () {
|
|
|
214
213
|
type: 'Pointer',
|
|
215
214
|
targetClass: targetClass
|
|
216
215
|
};
|
|
217
|
-
if (typeof options.required === 'boolean') {
|
|
216
|
+
if (typeof (options == null ? void 0 : options.required) === 'boolean') {
|
|
218
217
|
fieldOptions.required = options.required;
|
|
219
218
|
}
|
|
220
|
-
if (options.defaultValue !== undefined) {
|
|
219
|
+
if ((options == null ? void 0 : options.defaultValue) !== undefined) {
|
|
221
220
|
fieldOptions.defaultValue = options.defaultValue;
|
|
222
221
|
if (options.defaultValue instanceof _ParseObject.default) {
|
|
223
222
|
fieldOptions.defaultValue = options.defaultValue.toPointer();
|
|
@@ -533,8 +533,7 @@ var ParseUser = function (_ParseObject) {
|
|
|
533
533
|
}
|
|
534
534
|
}, {
|
|
535
535
|
key: "me",
|
|
536
|
-
value: function (sessionToken) {
|
|
537
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
536
|
+
value: function (sessionToken, options) {
|
|
538
537
|
var controller = _CoreManager.default.getUserController();
|
|
539
538
|
var meOptions = _ParseObject2.default._getRequestOptions(options);
|
|
540
539
|
meOptions.sessionToken = sessionToken;
|
|
@@ -556,8 +555,7 @@ var ParseUser = function (_ParseObject) {
|
|
|
556
555
|
}
|
|
557
556
|
}, {
|
|
558
557
|
key: "logOut",
|
|
559
|
-
value: function () {
|
|
560
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
558
|
+
value: function (options) {
|
|
561
559
|
var controller = _CoreManager.default.getUserController();
|
|
562
560
|
return controller.logOut(options);
|
|
563
561
|
}
|
|
@@ -832,7 +830,7 @@ var DefaultController = {
|
|
|
832
830
|
},
|
|
833
831
|
logOut: function (options) {
|
|
834
832
|
var RESTController = _CoreManager.default.getRESTController();
|
|
835
|
-
if (options.sessionToken) {
|
|
833
|
+
if (options != null && options.sessionToken) {
|
|
836
834
|
return RESTController.request('POST', 'logout', {}, options);
|
|
837
835
|
}
|
|
838
836
|
return DefaultController.currentUserAsync().then(function (currentUser) {
|
|
@@ -209,6 +209,9 @@ var RESTController = {
|
|
|
209
209
|
throw new Error('Cannot use the Master Key, it has not been provided.');
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
+
if (options.useMaintenanceKey) {
|
|
213
|
+
payload._MaintenanceKey = _CoreManager.default.get('MAINTENANCE_KEY');
|
|
214
|
+
}
|
|
212
215
|
if (_CoreManager.default.get('FORCE_REVOCABLE_SESSION')) {
|
|
213
216
|
payload._RevocableSession = '1';
|
|
214
217
|
}
|
|
@@ -278,5 +281,4 @@ var RESTController = {
|
|
|
278
281
|
return XHR;
|
|
279
282
|
}
|
|
280
283
|
};
|
|
281
|
-
module.exports = RESTController;
|
|
282
284
|
var _default = exports.default = RESTController;
|
|
@@ -9,5 +9,4 @@ var _StorageController3 = _interopRequireDefault(require("./StorageController.we
|
|
|
9
9
|
var _StorageController4 = _interopRequireDefault(require("./StorageController.default"));
|
|
10
10
|
var StorageController = _StorageController4.default;
|
|
11
11
|
StorageController = _StorageController.default;
|
|
12
|
-
module.exports = StorageController;
|
|
13
12
|
var _default = exports.default = StorageController;
|
package/lib/react-native/uuid.js
CHANGED
package/lib/weapp/Cloud.js
CHANGED
|
@@ -48,6 +48,7 @@ var _ParseObject = _interopRequireDefault(require("./ParseObject"));
|
|
|
48
48
|
* @returns {Promise} A promise that will be resolved with the result
|
|
49
49
|
* of the function.
|
|
50
50
|
*/
|
|
51
|
+
|
|
51
52
|
function run(name, data, options) {
|
|
52
53
|
if (typeof name !== 'string' || name.length === 0) {
|
|
53
54
|
throw new TypeError('Cloud function name must be a string.');
|
package/lib/weapp/CoreManager.js
CHANGED
|
@@ -19,9 +19,10 @@ const config = {
|
|
|
19
19
|
SERVER_AUTH_TOKEN: null,
|
|
20
20
|
LIVEQUERY_SERVER_URL: null,
|
|
21
21
|
ENCRYPTED_KEY: null,
|
|
22
|
-
VERSION: 'js' + "6.1.0-alpha.
|
|
22
|
+
VERSION: 'js' + "6.1.0-alpha.3",
|
|
23
23
|
APPLICATION_ID: null,
|
|
24
24
|
JAVASCRIPT_KEY: null,
|
|
25
|
+
MAINTENANCE_KEY: null,
|
|
25
26
|
MASTER_KEY: null,
|
|
26
27
|
USE_MASTER_KEY: false,
|
|
27
28
|
PERFORM_USER_REWRITE: true,
|
|
@@ -254,5 +255,4 @@ const CoreManager = {
|
|
|
254
255
|
return config['ParseUser'];
|
|
255
256
|
}
|
|
256
257
|
};
|
|
257
|
-
module.exports = CoreManager;
|
|
258
258
|
var _default = exports.default = CoreManager;
|
|
@@ -40,8 +40,7 @@ const EventuallyQueue = {
|
|
|
40
40
|
* @static
|
|
41
41
|
* @see Parse.Object#saveEventually
|
|
42
42
|
*/
|
|
43
|
-
save(object) {
|
|
44
|
-
let serverOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
43
|
+
save(object, serverOptions) {
|
|
45
44
|
return this.enqueue('save', object, serverOptions);
|
|
46
45
|
},
|
|
47
46
|
/**
|
|
@@ -55,8 +54,7 @@ const EventuallyQueue = {
|
|
|
55
54
|
* @static
|
|
56
55
|
* @see Parse.Object#destroyEventually
|
|
57
56
|
*/
|
|
58
|
-
destroy(object) {
|
|
59
|
-
let serverOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
57
|
+
destroy(object, serverOptions) {
|
|
60
58
|
return this.enqueue('destroy', object, serverOptions);
|
|
61
59
|
},
|
|
62
60
|
/**
|
|
@@ -106,7 +104,7 @@ const EventuallyQueue = {
|
|
|
106
104
|
queueId,
|
|
107
105
|
action,
|
|
108
106
|
object: object.toJSON(),
|
|
109
|
-
serverOptions,
|
|
107
|
+
serverOptions: serverOptions || {},
|
|
110
108
|
id: object.id,
|
|
111
109
|
className: object.className,
|
|
112
110
|
hash: object.get('hash'),
|
|
@@ -125,7 +123,7 @@ const EventuallyQueue = {
|
|
|
125
123
|
*
|
|
126
124
|
* @function getQueue
|
|
127
125
|
* @name Parse.EventuallyQueue.getQueue
|
|
128
|
-
* @returns {Promise<
|
|
126
|
+
* @returns {Promise<Queue>}
|
|
129
127
|
* @static
|
|
130
128
|
*/
|
|
131
129
|
async getQueue() {
|
|
@@ -280,8 +278,7 @@ const EventuallyQueue = {
|
|
|
280
278
|
* @param [ms] Milliseconds to ping the server. Default 2000ms
|
|
281
279
|
* @static
|
|
282
280
|
*/
|
|
283
|
-
poll() {
|
|
284
|
-
let ms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000;
|
|
281
|
+
poll(ms) {
|
|
285
282
|
if (polling) {
|
|
286
283
|
return;
|
|
287
284
|
}
|
|
@@ -296,7 +293,7 @@ const EventuallyQueue = {
|
|
|
296
293
|
return this.sendQueue();
|
|
297
294
|
}
|
|
298
295
|
}).catch(e => e);
|
|
299
|
-
}, ms);
|
|
296
|
+
}, ms || 2000);
|
|
300
297
|
},
|
|
301
298
|
/**
|
|
302
299
|
* Turns off polling.
|
|
@@ -355,5 +352,4 @@ const EventuallyQueue = {
|
|
|
355
352
|
}
|
|
356
353
|
}
|
|
357
354
|
};
|
|
358
|
-
module.exports = EventuallyQueue;
|
|
359
355
|
var _default = exports.default = EventuallyQueue;
|