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
package/lib/browser/Storage.js
CHANGED
|
@@ -12,5 +12,4 @@ var _StorageController3 = _interopRequireDefault(require("./StorageController.we
|
|
|
12
12
|
var _StorageController4 = _interopRequireDefault(require("./StorageController.default"));
|
|
13
13
|
let StorageController = _StorageController4.default;
|
|
14
14
|
StorageController = _StorageController2.default;
|
|
15
|
-
module.exports = StorageController;
|
|
16
15
|
var _default = exports.default = StorageController;
|
package/lib/browser/TaskQueue.js
CHANGED
package/lib/browser/Xhr.weapp.js
CHANGED
package/lib/browser/uuid.js
CHANGED
package/lib/node/Cloud.js
CHANGED
|
@@ -49,6 +49,7 @@ function _interopRequireDefault(e) {
|
|
|
49
49
|
* @returns {Promise} A promise that will be resolved with the result
|
|
50
50
|
* of the function.
|
|
51
51
|
*/
|
|
52
|
+
|
|
52
53
|
function run(name, data, options) {
|
|
53
54
|
if (typeof name !== 'string' || name.length === 0) {
|
|
54
55
|
throw new TypeError('Cloud function name must be a string.');
|
package/lib/node/CoreManager.js
CHANGED
|
@@ -16,9 +16,10 @@ const config = {
|
|
|
16
16
|
SERVER_AUTH_TOKEN: null,
|
|
17
17
|
LIVEQUERY_SERVER_URL: null,
|
|
18
18
|
ENCRYPTED_KEY: null,
|
|
19
|
-
VERSION: 'js' + "6.1.0-alpha.
|
|
19
|
+
VERSION: 'js' + "6.1.0-alpha.3",
|
|
20
20
|
APPLICATION_ID: null,
|
|
21
21
|
JAVASCRIPT_KEY: null,
|
|
22
|
+
MAINTENANCE_KEY: null,
|
|
22
23
|
MASTER_KEY: null,
|
|
23
24
|
USE_MASTER_KEY: false,
|
|
24
25
|
PERFORM_USER_REWRITE: true,
|
|
@@ -251,5 +252,4 @@ const CoreManager = {
|
|
|
251
252
|
return config['ParseUser'];
|
|
252
253
|
}
|
|
253
254
|
};
|
|
254
|
-
module.exports = CoreManager;
|
|
255
255
|
var _default = exports.default = CoreManager;
|
package/lib/node/EventEmitter.js
CHANGED
|
@@ -38,7 +38,7 @@ const EventuallyQueue = {
|
|
|
38
38
|
* @static
|
|
39
39
|
* @see Parse.Object#saveEventually
|
|
40
40
|
*/
|
|
41
|
-
save(object, serverOptions
|
|
41
|
+
save(object, serverOptions) {
|
|
42
42
|
return this.enqueue('save', object, serverOptions);
|
|
43
43
|
},
|
|
44
44
|
/**
|
|
@@ -52,7 +52,7 @@ const EventuallyQueue = {
|
|
|
52
52
|
* @static
|
|
53
53
|
* @see Parse.Object#destroyEventually
|
|
54
54
|
*/
|
|
55
|
-
destroy(object, serverOptions
|
|
55
|
+
destroy(object, serverOptions) {
|
|
56
56
|
return this.enqueue('destroy', object, serverOptions);
|
|
57
57
|
},
|
|
58
58
|
/**
|
|
@@ -102,7 +102,7 @@ const EventuallyQueue = {
|
|
|
102
102
|
queueId,
|
|
103
103
|
action,
|
|
104
104
|
object: object.toJSON(),
|
|
105
|
-
serverOptions,
|
|
105
|
+
serverOptions: serverOptions || {},
|
|
106
106
|
id: object.id,
|
|
107
107
|
className: object.className,
|
|
108
108
|
hash: object.get('hash'),
|
|
@@ -121,7 +121,7 @@ const EventuallyQueue = {
|
|
|
121
121
|
*
|
|
122
122
|
* @function getQueue
|
|
123
123
|
* @name Parse.EventuallyQueue.getQueue
|
|
124
|
-
* @returns {Promise<
|
|
124
|
+
* @returns {Promise<Queue>}
|
|
125
125
|
* @static
|
|
126
126
|
*/
|
|
127
127
|
async getQueue() {
|
|
@@ -276,7 +276,7 @@ const EventuallyQueue = {
|
|
|
276
276
|
* @param [ms] Milliseconds to ping the server. Default 2000ms
|
|
277
277
|
* @static
|
|
278
278
|
*/
|
|
279
|
-
poll(ms
|
|
279
|
+
poll(ms) {
|
|
280
280
|
if (polling) {
|
|
281
281
|
return;
|
|
282
282
|
}
|
|
@@ -290,7 +290,7 @@ const EventuallyQueue = {
|
|
|
290
290
|
return this.sendQueue();
|
|
291
291
|
}
|
|
292
292
|
}).catch(e => e);
|
|
293
|
-
}, ms);
|
|
293
|
+
}, ms || 2000);
|
|
294
294
|
},
|
|
295
295
|
/**
|
|
296
296
|
* Turns off polling.
|
|
@@ -349,5 +349,4 @@ const EventuallyQueue = {
|
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
};
|
|
352
|
-
module.exports = EventuallyQueue;
|
|
353
352
|
var _default = exports.default = EventuallyQueue;
|
|
@@ -93,7 +93,7 @@ function _interopRequireDefault(e) {
|
|
|
93
93
|
*
|
|
94
94
|
* });</pre></p>
|
|
95
95
|
*/
|
|
96
|
-
class
|
|
96
|
+
class LiveQuerySubscription {
|
|
97
97
|
/*
|
|
98
98
|
* @param {string | number} id - subscription id
|
|
99
99
|
* @param {string} query - query to subscribe to
|
|
@@ -106,8 +106,8 @@ class Subscription {
|
|
|
106
106
|
this.subscribePromise = (0, _promiseUtils.resolvingPromise)();
|
|
107
107
|
this.unsubscribePromise = (0, _promiseUtils.resolvingPromise)();
|
|
108
108
|
this.subscribed = false;
|
|
109
|
-
const
|
|
110
|
-
this.emitter = new
|
|
109
|
+
const Emitter = _CoreManager.default.getEventEmitter();
|
|
110
|
+
this.emitter = new Emitter();
|
|
111
111
|
this.on = (eventName, listener) => this.emitter.on(eventName, listener);
|
|
112
112
|
this.emit = (eventName, ...args) => this.emitter.emit(eventName, ...args);
|
|
113
113
|
// adding listener so process does not crash
|
|
@@ -127,4 +127,4 @@ class Subscription {
|
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
var _default = exports.default =
|
|
130
|
+
var _default = exports.default = LiveQuerySubscription;
|
|
@@ -370,7 +370,6 @@ const LocalDatastore = {
|
|
|
370
370
|
return this.isEnabled;
|
|
371
371
|
}
|
|
372
372
|
};
|
|
373
|
-
module.exports = LocalDatastore;
|
|
374
373
|
var _default = exports.default = LocalDatastore;
|
|
375
374
|
_CoreManager.default.setLocalDatastoreController(_LocalDatastoreController.default);
|
|
376
375
|
_CoreManager.default.setLocalDatastore(LocalDatastore);
|
|
@@ -82,5 +82,4 @@ const LocalDatastoreController = {
|
|
|
82
82
|
await _StorageController.default.multiRemove(batch).catch(error => console.error('Error clearing local datastore: ', error));
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
-
module.exports = LocalDatastoreController;
|
|
86
85
|
var _default = exports.default = LocalDatastoreController;
|
package/lib/node/OfflineQuery.js
CHANGED
package/lib/node/Parse.js
CHANGED
|
@@ -130,9 +130,10 @@ const Parse = {
|
|
|
130
130
|
initialize(applicationId, javaScriptKey) {
|
|
131
131
|
Parse._initialize(applicationId, javaScriptKey);
|
|
132
132
|
},
|
|
133
|
-
_initialize(applicationId, javaScriptKey, masterKey) {
|
|
133
|
+
_initialize(applicationId, javaScriptKey, masterKey, maintenanceKey) {
|
|
134
134
|
_CoreManager.default.set('APPLICATION_ID', applicationId);
|
|
135
135
|
_CoreManager.default.set('JAVASCRIPT_KEY', javaScriptKey);
|
|
136
|
+
_CoreManager.default.set('MAINTENANCE_KEY', maintenanceKey);
|
|
136
137
|
_CoreManager.default.set('MASTER_KEY', masterKey);
|
|
137
138
|
_CoreManager.default.set('USE_MASTER_KEY', false);
|
|
138
139
|
_CoreManager.default.setIfNeeded('EventEmitter', _EventEmitter.default);
|
|
@@ -204,6 +205,16 @@ const Parse = {
|
|
|
204
205
|
get masterKey() {
|
|
205
206
|
return _CoreManager.default.get('MASTER_KEY');
|
|
206
207
|
},
|
|
208
|
+
/**
|
|
209
|
+
* @member {string} Parse.maintenanceKey
|
|
210
|
+
* @static
|
|
211
|
+
*/
|
|
212
|
+
set maintenanceKey(value) {
|
|
213
|
+
_CoreManager.default.set('MAINTENANCE_KEY', value);
|
|
214
|
+
},
|
|
215
|
+
get maintenanceKey() {
|
|
216
|
+
return _CoreManager.default.get('MAINTENANCE_KEY');
|
|
217
|
+
},
|
|
207
218
|
/**
|
|
208
219
|
* @member {string} Parse.serverURL
|
|
209
220
|
* @static
|
package/lib/node/ParseACL.js
CHANGED
|
@@ -28,7 +28,7 @@ const PUBLIC_KEY = '*';
|
|
|
28
28
|
*/
|
|
29
29
|
class ParseACL {
|
|
30
30
|
/**
|
|
31
|
-
* @param {(Parse.User | object)} arg1 The user to initialize the ACL for
|
|
31
|
+
* @param {(Parse.User | object | null)} arg1 The user to initialize the ACL for
|
|
32
32
|
*/
|
|
33
33
|
constructor(arg1) {
|
|
34
34
|
this.permissionsById = {};
|
package/lib/node/ParseConfig.js
CHANGED
|
@@ -82,7 +82,7 @@ class ParseConfig {
|
|
|
82
82
|
* @returns {Promise} A promise that is resolved with a newly-created
|
|
83
83
|
* configuration object when the get completes.
|
|
84
84
|
*/
|
|
85
|
-
static get(options
|
|
85
|
+
static get(options) {
|
|
86
86
|
const controller = _CoreManager.default.getConfigController();
|
|
87
87
|
return controller.get(options);
|
|
88
88
|
}
|
|
@@ -163,7 +163,7 @@ const DefaultController = {
|
|
|
163
163
|
return config;
|
|
164
164
|
});
|
|
165
165
|
},
|
|
166
|
-
get(options
|
|
166
|
+
get(options) {
|
|
167
167
|
const RESTController = _CoreManager.default.getRESTController();
|
|
168
168
|
return RESTController.request('GET', 'config', {}, options).then(response => {
|
|
169
169
|
if (!response || !response.params) {
|
|
@@ -44,8 +44,8 @@ function getLiveQueryClient() {
|
|
|
44
44
|
*/
|
|
45
45
|
class LiveQuery {
|
|
46
46
|
constructor() {
|
|
47
|
-
const
|
|
48
|
-
this.emitter = new
|
|
47
|
+
const Emitter = _CoreManager.default.getEventEmitter();
|
|
48
|
+
this.emitter = new Emitter();
|
|
49
49
|
this.on = (eventName, listener) => this.emitter.on(eventName, listener);
|
|
50
50
|
this.emit = (eventName, ...args) => this.emitter.emit(eventName, ...args);
|
|
51
51
|
// adding listener so process does not crash
|
package/lib/node/ParseObject.js
CHANGED
|
@@ -198,7 +198,7 @@ class ParseObject {
|
|
|
198
198
|
id = this._getId();
|
|
199
199
|
}
|
|
200
200
|
return {
|
|
201
|
-
id
|
|
201
|
+
id,
|
|
202
202
|
className: this.className
|
|
203
203
|
};
|
|
204
204
|
} else {
|
|
@@ -423,6 +423,9 @@ class ParseObject {
|
|
|
423
423
|
if (hasOwn(options, 'useMasterKey')) {
|
|
424
424
|
requestOptions.useMasterKey = !!options.useMasterKey;
|
|
425
425
|
}
|
|
426
|
+
if (hasOwn(options, 'useMaintenanceKey')) {
|
|
427
|
+
requestOptions.useMaintenanceKey = !!options.useMaintenanceKey;
|
|
428
|
+
}
|
|
426
429
|
if (hasOwn(options, 'sessionToken') && typeof options.sessionToken === 'string') {
|
|
427
430
|
requestOptions.sessionToken = options.sessionToken;
|
|
428
431
|
}
|
|
@@ -1254,6 +1257,7 @@ class ParseObject {
|
|
|
1254
1257
|
* @returns {Promise} A promise that is fulfilled when the save
|
|
1255
1258
|
* completes.
|
|
1256
1259
|
*/
|
|
1260
|
+
|
|
1257
1261
|
async save(arg1, arg2, arg3) {
|
|
1258
1262
|
let attrs;
|
|
1259
1263
|
let options;
|
|
@@ -1284,9 +1288,8 @@ class ParseObject {
|
|
|
1284
1288
|
const filePromise = unsavedFiles.length ? controller.save(unsavedFiles, saveOptions) : Promise.resolve();
|
|
1285
1289
|
return filePromise.then(() => controller.save(unsavedObjects, saveOptions)).then(savedOjbects => savedOjbects.pop());
|
|
1286
1290
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
});
|
|
1291
|
+
await controller.save(unsaved, saveOptions);
|
|
1292
|
+
return controller.save(this, saveOptions);
|
|
1290
1293
|
}
|
|
1291
1294
|
|
|
1292
1295
|
/**
|
|
@@ -1492,7 +1495,7 @@ class ParseObject {
|
|
|
1492
1495
|
* @static
|
|
1493
1496
|
* @returns {Parse.Object[]}
|
|
1494
1497
|
*/
|
|
1495
|
-
static fetchAll(list, options
|
|
1498
|
+
static fetchAll(list, options) {
|
|
1496
1499
|
const fetchOptions = ParseObject._getRequestOptions(options);
|
|
1497
1500
|
return _CoreManager.default.getObjectController().fetch(list, true, fetchOptions);
|
|
1498
1501
|
}
|
|
@@ -1670,7 +1673,7 @@ class ParseObject {
|
|
|
1670
1673
|
* @returns {Promise} A promise that is fulfilled when the destroyAll
|
|
1671
1674
|
* completes.
|
|
1672
1675
|
*/
|
|
1673
|
-
static destroyAll(list, options
|
|
1676
|
+
static destroyAll(list, options) {
|
|
1674
1677
|
const destroyOptions = ParseObject._getRequestOptions(options);
|
|
1675
1678
|
return _CoreManager.default.getObjectController().destroy(list, destroyOptions);
|
|
1676
1679
|
}
|
|
@@ -1704,7 +1707,7 @@ class ParseObject {
|
|
|
1704
1707
|
* @static
|
|
1705
1708
|
* @returns {Parse.Object[]}
|
|
1706
1709
|
*/
|
|
1707
|
-
static saveAll(list, options
|
|
1710
|
+
static saveAll(list, options) {
|
|
1708
1711
|
const saveOptions = ParseObject._getRequestOptions(options);
|
|
1709
1712
|
return _CoreManager.default.getObjectController().save(list, saveOptions);
|
|
1710
1713
|
}
|
package/lib/node/ParseQuery.js
CHANGED
|
@@ -1093,11 +1093,11 @@ class ParseQuery {
|
|
|
1093
1093
|
* be contained in the provided list of values.
|
|
1094
1094
|
*
|
|
1095
1095
|
* @param {string} key The key to check.
|
|
1096
|
-
* @param {Array<*>}
|
|
1096
|
+
* @param {Array<*>} values The values that will match.
|
|
1097
1097
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
1098
1098
|
*/
|
|
1099
|
-
containedIn(key,
|
|
1100
|
-
return this._addCondition(key, '$in',
|
|
1099
|
+
containedIn(key, values) {
|
|
1100
|
+
return this._addCondition(key, '$in', values);
|
|
1101
1101
|
}
|
|
1102
1102
|
|
|
1103
1103
|
/**
|
|
@@ -1105,11 +1105,11 @@ class ParseQuery {
|
|
|
1105
1105
|
* not be contained in the provided list of values.
|
|
1106
1106
|
*
|
|
1107
1107
|
* @param {string} key The key to check.
|
|
1108
|
-
* @param {Array<*>}
|
|
1108
|
+
* @param {Array<*>} values The values that will not match.
|
|
1109
1109
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
1110
1110
|
*/
|
|
1111
|
-
notContainedIn(key,
|
|
1112
|
-
return this._addCondition(key, '$nin',
|
|
1111
|
+
notContainedIn(key, values) {
|
|
1112
|
+
return this._addCondition(key, '$nin', values);
|
|
1113
1113
|
}
|
|
1114
1114
|
|
|
1115
1115
|
/**
|
|
@@ -1319,7 +1319,7 @@ class ParseQuery {
|
|
|
1319
1319
|
* @param {boolean} options.diacriticSensitive A boolean flag to enable or disable diacritic sensitive search.
|
|
1320
1320
|
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
1321
1321
|
*/
|
|
1322
|
-
fullText(key, value, options
|
|
1322
|
+
fullText(key, value, options) {
|
|
1323
1323
|
options = options || {};
|
|
1324
1324
|
if (!key) {
|
|
1325
1325
|
throw new Error('A key is required.');
|
package/lib/node/ParseRole.js
CHANGED
|
@@ -69,7 +69,7 @@ class ParseRole extends _ParseObject.default {
|
|
|
69
69
|
* @param {string} name The name of the role.
|
|
70
70
|
* @param {object} options Standard options object with success and error
|
|
71
71
|
* callbacks.
|
|
72
|
-
* @returns {
|
|
72
|
+
* @returns {Parse.Object} Returns the object, so you can chain this call.
|
|
73
73
|
*/
|
|
74
74
|
setName(name, options) {
|
|
75
75
|
this._validateName(name);
|
package/lib/node/ParseSchema.js
CHANGED
|
@@ -13,6 +13,7 @@ function _interopRequireDefault(e) {
|
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
const FIELD_TYPES = ['String', 'Number', 'Boolean', 'Bytes', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];
|
|
16
|
+
|
|
16
17
|
/**
|
|
17
18
|
* A Parse.Schema object is for handling schema data from Parse.
|
|
18
19
|
* <p>All the schemas methods require MasterKey.
|
|
@@ -183,8 +184,9 @@ class ParseSchema {
|
|
|
183
184
|
* </ul>
|
|
184
185
|
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
|
|
185
186
|
*/
|
|
186
|
-
addField(name, type, options
|
|
187
|
+
addField(name, type, options) {
|
|
187
188
|
type = type || 'String';
|
|
189
|
+
options = options || {};
|
|
188
190
|
if (!name) {
|
|
189
191
|
throw new Error('field name may not be null.');
|
|
190
192
|
}
|
|
@@ -366,7 +368,7 @@ class ParseSchema {
|
|
|
366
368
|
* @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
|
|
367
369
|
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
|
|
368
370
|
*/
|
|
369
|
-
addPointer(name, targetClass, options
|
|
371
|
+
addPointer(name, targetClass, options) {
|
|
370
372
|
if (!name) {
|
|
371
373
|
throw new Error('field name may not be null.');
|
|
372
374
|
}
|
|
@@ -377,10 +379,10 @@ class ParseSchema {
|
|
|
377
379
|
type: 'Pointer',
|
|
378
380
|
targetClass
|
|
379
381
|
};
|
|
380
|
-
if (typeof options.required === 'boolean') {
|
|
382
|
+
if (typeof (options === null || options === void 0 ? void 0 : options.required) === 'boolean') {
|
|
381
383
|
fieldOptions.required = options.required;
|
|
382
384
|
}
|
|
383
|
-
if (options.defaultValue !== undefined) {
|
|
385
|
+
if ((options === null || options === void 0 ? void 0 : options.defaultValue) !== undefined) {
|
|
384
386
|
fieldOptions.defaultValue = options.defaultValue;
|
|
385
387
|
if (options.defaultValue instanceof _ParseObject.default) {
|
|
386
388
|
fieldOptions.defaultValue = options.defaultValue.toPointer();
|
package/lib/node/ParseUser.js
CHANGED
|
@@ -571,7 +571,7 @@ class ParseUser extends _ParseObject.default {
|
|
|
571
571
|
* either from memory or localStorage, if necessary.
|
|
572
572
|
*
|
|
573
573
|
* @static
|
|
574
|
-
* @returns {Parse.
|
|
574
|
+
* @returns {Parse.User} The currently logged in Parse.User.
|
|
575
575
|
*/
|
|
576
576
|
static current() {
|
|
577
577
|
if (!canUseCurrentUser) {
|
|
@@ -638,8 +638,8 @@ class ParseUser extends _ParseObject.default {
|
|
|
638
638
|
}
|
|
639
639
|
const user = new this();
|
|
640
640
|
user._finishFetch({
|
|
641
|
-
username
|
|
642
|
-
password
|
|
641
|
+
username,
|
|
642
|
+
password
|
|
643
643
|
});
|
|
644
644
|
return user.logIn(options);
|
|
645
645
|
}
|
|
@@ -669,8 +669,8 @@ class ParseUser extends _ParseObject.default {
|
|
|
669
669
|
}
|
|
670
670
|
const user = new this();
|
|
671
671
|
user._finishFetch({
|
|
672
|
-
username
|
|
673
|
-
password
|
|
672
|
+
username,
|
|
673
|
+
password,
|
|
674
674
|
authData
|
|
675
675
|
});
|
|
676
676
|
return user.logIn(options);
|
|
@@ -727,7 +727,7 @@ class ParseUser extends _ParseObject.default {
|
|
|
727
727
|
* @static
|
|
728
728
|
* @returns {Promise} A promise that is fulfilled with the user is fetched.
|
|
729
729
|
*/
|
|
730
|
-
static me(sessionToken, options
|
|
730
|
+
static me(sessionToken, options) {
|
|
731
731
|
const controller = _CoreManager.default.getUserController();
|
|
732
732
|
const meOptions = _ParseObject.default._getRequestOptions(options);
|
|
733
733
|
meOptions.sessionToken = sessionToken;
|
|
@@ -776,7 +776,7 @@ class ParseUser extends _ParseObject.default {
|
|
|
776
776
|
* @returns {Promise} A promise that is resolved when the session is
|
|
777
777
|
* destroyed on the server.
|
|
778
778
|
*/
|
|
779
|
-
static logOut(options
|
|
779
|
+
static logOut(options) {
|
|
780
780
|
const controller = _CoreManager.default.getUserController();
|
|
781
781
|
return controller.logOut(options);
|
|
782
782
|
}
|
|
@@ -1137,7 +1137,7 @@ const DefaultController = {
|
|
|
1137
1137
|
},
|
|
1138
1138
|
logOut(options) {
|
|
1139
1139
|
const RESTController = _CoreManager.default.getRESTController();
|
|
1140
|
-
if (options.sessionToken) {
|
|
1140
|
+
if (options !== null && options !== void 0 && options.sessionToken) {
|
|
1141
1141
|
return RESTController.request('POST', 'logout', {}, options);
|
|
1142
1142
|
}
|
|
1143
1143
|
return DefaultController.currentUserAsync().then(currentUser => {
|
|
@@ -1165,7 +1165,7 @@ const DefaultController = {
|
|
|
1165
1165
|
requestPasswordReset(email, options) {
|
|
1166
1166
|
const RESTController = _CoreManager.default.getRESTController();
|
|
1167
1167
|
return RESTController.request('POST', 'requestPasswordReset', {
|
|
1168
|
-
email
|
|
1168
|
+
email
|
|
1169
1169
|
}, options);
|
|
1170
1170
|
},
|
|
1171
1171
|
async upgradeToRevocableSession(user, options) {
|
|
@@ -1209,7 +1209,7 @@ const DefaultController = {
|
|
|
1209
1209
|
requestEmailVerification(email, options) {
|
|
1210
1210
|
const RESTController = _CoreManager.default.getRESTController();
|
|
1211
1211
|
return RESTController.request('POST', 'verificationEmailRequest', {
|
|
1212
|
-
email
|
|
1212
|
+
email
|
|
1213
1213
|
}, options);
|
|
1214
1214
|
}
|
|
1215
1215
|
};
|
|
@@ -230,6 +230,9 @@ const RESTController = {
|
|
|
230
230
|
throw new Error('Cannot use the Master Key, it has not been provided.');
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
+
if (options.useMaintenanceKey) {
|
|
234
|
+
payload._MaintenanceKey = _CoreManager.default.get('MAINTENANCE_KEY');
|
|
235
|
+
}
|
|
233
236
|
if (_CoreManager.default.get('FORCE_REVOCABLE_SESSION')) {
|
|
234
237
|
payload._RevocableSession = '1';
|
|
235
238
|
}
|
|
@@ -304,5 +307,4 @@ const RESTController = {
|
|
|
304
307
|
return XHR;
|
|
305
308
|
}
|
|
306
309
|
};
|
|
307
|
-
module.exports = RESTController;
|
|
308
310
|
var _default = exports.default = RESTController;
|
package/lib/node/Socket.weapp.js
CHANGED
package/lib/node/Storage.js
CHANGED
package/lib/node/TaskQueue.js
CHANGED
package/lib/node/Xhr.weapp.js
CHANGED