parse 4.0.0-alpha.1 → 4.0.0-alpha.11
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/LICENSE +167 -25
- package/NOTICE +10 -0
- package/README.md +6 -5
- package/dist/parse.js +12838 -21190
- package/dist/parse.min.js +7 -6
- package/dist/parse.weapp.js +7921 -17062
- package/dist/parse.weapp.min.js +7 -6
- package/lib/browser/Analytics.js +2 -27
- package/lib/browser/AnonymousUtils.js +6 -42
- package/lib/browser/Cloud.js +12 -77
- package/lib/browser/CloudCode.js +0 -3
- package/lib/browser/CoreManager.js +46 -191
- package/lib/browser/CryptoController.js +2 -16
- package/lib/browser/EventEmitter.js +1 -8
- package/lib/browser/EventuallyQueue.js +277 -824
- package/lib/browser/FacebookUtils.js +6 -42
- package/lib/browser/IndexedDBStorageController.js +3 -14
- package/lib/browser/InstallationController.js +2 -20
- package/lib/browser/LiveQueryClient.js +105 -213
- package/lib/browser/LiveQuerySubscription.js +10 -39
- package/lib/browser/LocalDatastore.js +451 -1081
- package/lib/browser/LocalDatastoreController.js +145 -602
- package/lib/browser/LocalDatastoreController.react-native.js +137 -573
- package/lib/browser/LocalDatastoreUtils.js +2 -19
- package/lib/browser/ObjectStateMutations.js +18 -121
- package/lib/browser/OfflineQuery.js +61 -222
- package/lib/browser/Parse.js +12 -115
- package/lib/browser/ParseACL.js +33 -148
- package/lib/browser/ParseCLP.js +96 -314
- package/lib/browser/ParseConfig.js +18 -95
- package/lib/browser/ParseError.js +63 -99
- package/lib/browser/ParseFile.js +128 -685
- package/lib/browser/ParseGeoPoint.js +23 -89
- package/lib/browser/ParseHooks.js +1 -34
- package/lib/browser/ParseInstallation.js +4 -32
- package/lib/browser/ParseLiveQuery.js +96 -505
- package/lib/browser/ParseObject.js +665 -1845
- package/lib/browser/ParseOp.js +41 -287
- package/lib/browser/ParsePolygon.js +13 -70
- package/lib/browser/ParseQuery.js +403 -1504
- package/lib/browser/ParseRelation.js +12 -68
- package/lib/browser/ParseRole.js +13 -75
- package/lib/browser/ParseSchema.js +49 -208
- package/lib/browser/ParseSession.js +11 -69
- package/lib/browser/ParseUser.js +274 -1127
- package/lib/browser/Push.js +7 -50
- package/lib/browser/RESTController.js +28 -157
- package/lib/browser/SingleInstanceStateController.js +19 -144
- package/lib/browser/Socket.weapp.js +0 -10
- package/lib/browser/Storage.js +10 -80
- package/lib/browser/StorageController.browser.js +4 -24
- package/lib/browser/StorageController.default.js +4 -24
- package/lib/browser/StorageController.react-native.js +6 -40
- package/lib/browser/StorageController.weapp.js +5 -23
- package/lib/browser/TaskQueue.js +1 -29
- package/lib/browser/UniqueInstanceStateController.js +19 -149
- package/lib/browser/Xhr.weapp.js +0 -17
- package/lib/browser/arrayContainsObject.js +2 -23
- package/lib/browser/canBeSerialized.js +3 -40
- package/lib/browser/decode.js +3 -40
- package/lib/browser/encode.js +9 -77
- package/lib/browser/equals.js +2 -34
- package/lib/browser/escape.js +1 -15
- package/lib/browser/isRevocableSession.js +2 -18
- package/lib/browser/parseDate.js +2 -20
- package/lib/browser/promiseUtils.js +3 -21
- package/lib/browser/unique.js +3 -24
- package/lib/browser/unsavedChildren.js +6 -57
- package/lib/browser/uuid.js +3 -1
- package/lib/node/Analytics.js +1 -25
- package/lib/node/AnonymousUtils.js +5 -44
- package/lib/node/Cloud.js +10 -73
- package/lib/node/CloudCode.js +0 -3
- package/lib/node/CoreManager.js +47 -227
- package/lib/node/CryptoController.js +2 -16
- package/lib/node/EventEmitter.js +1 -8
- package/lib/node/EventuallyQueue.js +16 -123
- package/lib/node/FacebookUtils.js +5 -44
- package/lib/node/IndexedDBStorageController.js +3 -19
- package/lib/node/InstallationController.js +2 -22
- package/lib/node/LiveQueryClient.js +72 -154
- package/lib/node/LiveQuerySubscription.js +7 -26
- package/lib/node/LocalDatastore.js +19 -182
- package/lib/node/LocalDatastoreController.js +6 -45
- package/lib/node/LocalDatastoreController.react-native.js +6 -52
- package/lib/node/LocalDatastoreUtils.js +1 -13
- package/lib/node/ObjectStateMutations.js +13 -100
- package/lib/node/OfflineQuery.js +27 -151
- package/lib/node/Parse.js +11 -108
- package/lib/node/ParseACL.js +32 -157
- package/lib/node/ParseCLP.js +69 -269
- package/lib/node/ParseConfig.js +16 -91
- package/lib/node/ParseError.js +61 -74
- package/lib/node/ParseFile.js +49 -212
- package/lib/node/ParseGeoPoint.js +21 -89
- package/lib/node/ParseHooks.js +0 -35
- package/lib/node/ParseInstallation.js +1 -17
- package/lib/node/ParseLiveQuery.js +10 -43
- package/lib/node/ParseObject.js +229 -964
- package/lib/node/ParseOp.js +31 -262
- package/lib/node/ParsePolygon.js +12 -69
- package/lib/node/ParseQuery.js +169 -888
- package/lib/node/ParseRelation.js +11 -68
- package/lib/node/ParseRole.js +10 -64
- package/lib/node/ParseSchema.js +46 -229
- package/lib/node/ParseSession.js +8 -57
- package/lib/node/ParseUser.js +107 -583
- package/lib/node/Push.js +4 -44
- package/lib/node/RESTController.js +18 -127
- package/lib/node/SingleInstanceStateController.js +17 -137
- package/lib/node/Socket.weapp.js +0 -7
- package/lib/node/Storage.js +10 -90
- package/lib/node/StorageController.browser.js +4 -30
- package/lib/node/StorageController.default.js +5 -28
- package/lib/node/StorageController.react-native.js +6 -47
- package/lib/node/StorageController.weapp.js +6 -28
- package/lib/node/TaskQueue.js +1 -24
- package/lib/node/UniqueInstanceStateController.js +16 -140
- package/lib/node/Xhr.weapp.js +0 -15
- package/lib/node/arrayContainsObject.js +1 -19
- package/lib/node/canBeSerialized.js +2 -35
- package/lib/node/decode.js +1 -33
- package/lib/node/encode.js +3 -61
- package/lib/node/equals.js +0 -27
- package/lib/node/escape.js +1 -13
- package/lib/node/isRevocableSession.js +1 -12
- package/lib/node/parseDate.js +1 -14
- package/lib/node/promiseUtils.js +2 -14
- package/lib/node/unique.js +1 -18
- package/lib/node/unsavedChildren.js +2 -45
- package/lib/node/uuid.js +6 -1
- package/lib/react-native/Analytics.js +0 -9
- package/lib/react-native/AnonymousUtils.js +0 -10
- package/lib/react-native/Cloud.js +0 -26
- package/lib/react-native/CoreManager.js +2 -6
- package/lib/react-native/CryptoController.js +0 -2
- package/lib/react-native/EventEmitter.js +0 -2
- package/lib/react-native/EventuallyQueue.js +156 -711
- package/lib/react-native/FacebookUtils.js +0 -22
- package/lib/react-native/IndexedDBStorageController.js +0 -1
- package/lib/react-native/InstallationController.js +0 -6
- package/lib/react-native/LiveQueryClient.js +46 -157
- package/lib/react-native/LiveQuerySubscription.js +3 -27
- package/lib/react-native/LocalDatastore.js +281 -948
- package/lib/react-native/LocalDatastoreController.js +71 -552
- package/lib/react-native/LocalDatastoreController.react-native.js +91 -526
- package/lib/react-native/LocalDatastoreUtils.js +0 -1
- package/lib/react-native/ObjectStateMutations.js +2 -65
- package/lib/react-native/OfflineQuery.js +25 -196
- package/lib/react-native/Parse.js +0 -65
- package/lib/react-native/ParseACL.js +0 -44
- package/lib/react-native/ParseCLP.js +23 -161
- package/lib/react-native/ParseConfig.js +0 -42
- package/lib/react-native/ParseError.js +1 -21
- package/lib/react-native/ParseFile.js +55 -529
- package/lib/react-native/ParseGeoPoint.js +0 -17
- package/lib/react-native/ParseHooks.js +0 -30
- package/lib/react-native/ParseInstallation.js +1 -23
- package/lib/react-native/ParseLiveQuery.js +55 -472
- package/lib/react-native/ParseObject.js +245 -1246
- package/lib/react-native/ParseOp.js +1 -138
- package/lib/react-native/ParsePolygon.js +0 -24
- package/lib/react-native/ParseQuery.js +182 -874
- package/lib/react-native/ParseRelation.js +0 -25
- package/lib/react-native/ParseRole.js +1 -36
- package/lib/react-native/ParseSchema.js +3 -54
- package/lib/react-native/ParseSession.js +1 -40
- package/lib/react-native/ParseUser.js +95 -773
- package/lib/react-native/Push.js +0 -16
- package/lib/react-native/RESTController.js +12 -109
- package/lib/react-native/SingleInstanceStateController.js +0 -44
- package/lib/react-native/Socket.weapp.js +0 -10
- package/lib/react-native/Storage.js +0 -24
- package/lib/react-native/StorageController.browser.js +0 -2
- package/lib/react-native/StorageController.default.js +0 -1
- package/lib/react-native/StorageController.react-native.js +0 -2
- package/lib/react-native/TaskQueue.js +0 -15
- package/lib/react-native/UniqueInstanceStateController.js +0 -47
- package/lib/react-native/Xhr.weapp.js +0 -16
- package/lib/react-native/arrayContainsObject.js +0 -5
- package/lib/react-native/canBeSerialized.js +0 -18
- package/lib/react-native/decode.js +0 -21
- package/lib/react-native/encode.js +0 -25
- package/lib/react-native/equals.js +0 -18
- package/lib/react-native/escape.js +0 -1
- package/lib/react-native/isRevocableSession.js +0 -1
- package/lib/react-native/parseDate.js +0 -3
- package/lib/react-native/promiseUtils.js +0 -13
- package/lib/react-native/unique.js +0 -4
- package/lib/react-native/unsavedChildren.js +0 -21
- package/lib/react-native/uuid.js +3 -1
- package/lib/weapp/Analytics.js +2 -27
- package/lib/weapp/AnonymousUtils.js +6 -42
- package/lib/weapp/Cloud.js +12 -77
- package/lib/weapp/CloudCode.js +0 -3
- package/lib/weapp/CoreManager.js +46 -191
- package/lib/weapp/CryptoController.js +2 -16
- package/lib/weapp/EventEmitter.js +1 -8
- package/lib/weapp/EventuallyQueue.js +277 -824
- package/lib/weapp/FacebookUtils.js +6 -42
- package/lib/weapp/IndexedDBStorageController.js +3 -14
- package/lib/weapp/InstallationController.js +2 -20
- package/lib/weapp/LiveQueryClient.js +105 -213
- package/lib/weapp/LiveQuerySubscription.js +10 -39
- package/lib/weapp/LocalDatastore.js +451 -1081
- package/lib/weapp/LocalDatastoreController.js +145 -602
- package/lib/weapp/LocalDatastoreController.react-native.js +137 -573
- package/lib/weapp/LocalDatastoreUtils.js +2 -19
- package/lib/weapp/ObjectStateMutations.js +18 -121
- package/lib/weapp/OfflineQuery.js +61 -222
- package/lib/weapp/Parse.js +12 -115
- package/lib/weapp/ParseACL.js +33 -148
- package/lib/weapp/ParseCLP.js +96 -314
- package/lib/weapp/ParseConfig.js +18 -95
- package/lib/weapp/ParseError.js +63 -99
- package/lib/weapp/ParseFile.js +129 -686
- package/lib/weapp/ParseGeoPoint.js +23 -89
- package/lib/weapp/ParseHooks.js +1 -34
- package/lib/weapp/ParseInstallation.js +4 -32
- package/lib/weapp/ParseLiveQuery.js +96 -505
- package/lib/weapp/ParseObject.js +665 -1845
- package/lib/weapp/ParseOp.js +41 -287
- package/lib/weapp/ParsePolygon.js +13 -70
- package/lib/weapp/ParseQuery.js +403 -1504
- package/lib/weapp/ParseRelation.js +12 -68
- package/lib/weapp/ParseRole.js +13 -75
- package/lib/weapp/ParseSchema.js +49 -208
- package/lib/weapp/ParseSession.js +11 -69
- package/lib/weapp/ParseUser.js +274 -1127
- package/lib/weapp/Push.js +7 -50
- package/lib/weapp/RESTController.js +28 -157
- package/lib/weapp/SingleInstanceStateController.js +19 -144
- package/lib/weapp/Socket.weapp.js +0 -10
- package/lib/weapp/Storage.js +10 -80
- package/lib/weapp/StorageController.browser.js +4 -24
- package/lib/weapp/StorageController.default.js +4 -24
- package/lib/weapp/StorageController.react-native.js +6 -40
- package/lib/weapp/StorageController.weapp.js +5 -23
- package/lib/weapp/TaskQueue.js +1 -29
- package/lib/weapp/UniqueInstanceStateController.js +19 -149
- package/lib/weapp/Xhr.weapp.js +0 -17
- package/lib/weapp/arrayContainsObject.js +2 -23
- package/lib/weapp/canBeSerialized.js +3 -40
- package/lib/weapp/decode.js +3 -40
- package/lib/weapp/encode.js +9 -77
- package/lib/weapp/equals.js +2 -34
- package/lib/weapp/escape.js +1 -15
- package/lib/weapp/isRevocableSession.js +2 -18
- package/lib/weapp/parseDate.js +2 -20
- package/lib/weapp/promiseUtils.js +3 -21
- package/lib/weapp/unique.js +3 -24
- package/lib/weapp/unsavedChildren.js +6 -57
- package/lib/weapp/uuid.js +1 -6
- package/package.json +35 -31
- package/PATENTS +0 -37
package/lib/node/Parse.js
CHANGED
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _decode = _interopRequireDefault(require("./decode"));
|
|
4
|
-
|
|
5
4
|
var _encode = _interopRequireDefault(require("./encode"));
|
|
6
|
-
|
|
7
5
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
8
|
-
|
|
9
6
|
var _CryptoController = _interopRequireDefault(require("./CryptoController"));
|
|
10
|
-
|
|
11
7
|
var _EventuallyQueue = _interopRequireDefault(require("./EventuallyQueue"));
|
|
12
|
-
|
|
13
8
|
var _InstallationController = _interopRequireDefault(require("./InstallationController"));
|
|
14
|
-
|
|
15
9
|
var ParseOp = _interopRequireWildcard(require("./ParseOp"));
|
|
16
|
-
|
|
17
10
|
var _RESTController = _interopRequireDefault(require("./RESTController"));
|
|
18
|
-
|
|
19
11
|
function _getRequireWildcardCache(nodeInterop) {
|
|
20
12
|
if (typeof WeakMap !== "function") return null;
|
|
21
13
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -24,31 +16,24 @@ function _getRequireWildcardCache(nodeInterop) {
|
|
|
24
16
|
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
25
17
|
})(nodeInterop);
|
|
26
18
|
}
|
|
27
|
-
|
|
28
19
|
function _interopRequireWildcard(obj, nodeInterop) {
|
|
29
20
|
if (!nodeInterop && obj && obj.__esModule) {
|
|
30
21
|
return obj;
|
|
31
22
|
}
|
|
32
|
-
|
|
33
23
|
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
34
24
|
return {
|
|
35
25
|
default: obj
|
|
36
26
|
};
|
|
37
27
|
}
|
|
38
|
-
|
|
39
28
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
40
|
-
|
|
41
29
|
if (cache && cache.has(obj)) {
|
|
42
30
|
return cache.get(obj);
|
|
43
31
|
}
|
|
44
|
-
|
|
45
32
|
var newObj = {};
|
|
46
33
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
47
|
-
|
|
48
34
|
for (var key in obj) {
|
|
49
35
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
50
36
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
51
|
-
|
|
52
37
|
if (desc && (desc.get || desc.set)) {
|
|
53
38
|
Object.defineProperty(newObj, key, desc);
|
|
54
39
|
} else {
|
|
@@ -56,30 +41,17 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
56
41
|
}
|
|
57
42
|
}
|
|
58
43
|
}
|
|
59
|
-
|
|
60
44
|
newObj.default = obj;
|
|
61
|
-
|
|
62
45
|
if (cache) {
|
|
63
46
|
cache.set(obj, newObj);
|
|
64
47
|
}
|
|
65
|
-
|
|
66
48
|
return newObj;
|
|
67
49
|
}
|
|
68
|
-
|
|
69
50
|
function _interopRequireDefault(obj) {
|
|
70
51
|
return obj && obj.__esModule ? obj : {
|
|
71
52
|
default: obj
|
|
72
53
|
};
|
|
73
54
|
}
|
|
74
|
-
/**
|
|
75
|
-
* Copyright (c) 2015-present, Parse, LLC.
|
|
76
|
-
* All rights reserved.
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the BSD-style license found in the
|
|
79
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
80
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
55
|
/**
|
|
84
56
|
* Contains all Parse API classes and functions.
|
|
85
57
|
*
|
|
@@ -88,8 +60,6 @@ function _interopRequireDefault(obj) {
|
|
|
88
60
|
* @class
|
|
89
61
|
* @hideconstructor
|
|
90
62
|
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
63
|
const Parse = {
|
|
94
64
|
/**
|
|
95
65
|
* Call this method first to set up your authentication tokens for Parse.
|
|
@@ -99,30 +69,15 @@ const Parse = {
|
|
|
99
69
|
* @param {string} [masterKey] Your Parse Master Key. (Node.js only!)
|
|
100
70
|
* @static
|
|
101
71
|
*/
|
|
102
|
-
initialize(applicationId
|
|
103
|
-
/*: string*/
|
|
104
|
-
, javaScriptKey
|
|
105
|
-
/*: string*/
|
|
106
|
-
) {
|
|
72
|
+
initialize(applicationId /*: string*/, javaScriptKey /*: string*/) {
|
|
107
73
|
Parse._initialize(applicationId, javaScriptKey);
|
|
108
74
|
},
|
|
109
|
-
|
|
110
|
-
_initialize(applicationId
|
|
111
|
-
/*: string*/
|
|
112
|
-
, javaScriptKey
|
|
113
|
-
/*: string*/
|
|
114
|
-
, masterKey
|
|
115
|
-
/*: string*/
|
|
116
|
-
) {
|
|
75
|
+
_initialize(applicationId /*: string*/, javaScriptKey /*: string*/, masterKey /*: string*/) {
|
|
117
76
|
_CoreManager.default.set('APPLICATION_ID', applicationId);
|
|
118
|
-
|
|
119
77
|
_CoreManager.default.set('JAVASCRIPT_KEY', javaScriptKey);
|
|
120
|
-
|
|
121
78
|
_CoreManager.default.set('MASTER_KEY', masterKey);
|
|
122
|
-
|
|
123
79
|
_CoreManager.default.set('USE_MASTER_KEY', false);
|
|
124
80
|
},
|
|
125
|
-
|
|
126
81
|
/**
|
|
127
82
|
* Call this method to set your AsyncStorage engine
|
|
128
83
|
* Starting Parse@1.11, the ParseSDK do not provide a React AsyncStorage as the ReactNative module
|
|
@@ -131,12 +86,9 @@ const Parse = {
|
|
|
131
86
|
* @param {AsyncStorage} storage a react native async storage.
|
|
132
87
|
* @static
|
|
133
88
|
*/
|
|
134
|
-
setAsyncStorage(storage
|
|
135
|
-
/*: any*/
|
|
136
|
-
) {
|
|
89
|
+
setAsyncStorage(storage /*: any*/) {
|
|
137
90
|
_CoreManager.default.setAsyncStorage(storage);
|
|
138
91
|
},
|
|
139
|
-
|
|
140
92
|
/**
|
|
141
93
|
* Call this method to set your LocalDatastoreStorage engine
|
|
142
94
|
* If using React-Native use {@link Parse.setAsyncStorage Parse.setAsyncStorage()}
|
|
@@ -144,12 +96,9 @@ const Parse = {
|
|
|
144
96
|
* @param {LocalDatastoreController} controller a data storage.
|
|
145
97
|
* @static
|
|
146
98
|
*/
|
|
147
|
-
setLocalDatastoreController(controller
|
|
148
|
-
/*: any*/
|
|
149
|
-
) {
|
|
99
|
+
setLocalDatastoreController(controller /*: any*/) {
|
|
150
100
|
_CoreManager.default.setLocalDatastoreController(controller);
|
|
151
101
|
},
|
|
152
|
-
|
|
153
102
|
/**
|
|
154
103
|
* Returns information regarding the current server's health
|
|
155
104
|
*
|
|
@@ -159,7 +108,6 @@ const Parse = {
|
|
|
159
108
|
getServerHealth() {
|
|
160
109
|
return _CoreManager.default.getRESTController().request('GET', 'health');
|
|
161
110
|
},
|
|
162
|
-
|
|
163
111
|
/**
|
|
164
112
|
* @member {string} Parse.applicationId
|
|
165
113
|
* @static
|
|
@@ -167,11 +115,9 @@ const Parse = {
|
|
|
167
115
|
set applicationId(value) {
|
|
168
116
|
_CoreManager.default.set('APPLICATION_ID', value);
|
|
169
117
|
},
|
|
170
|
-
|
|
171
118
|
get applicationId() {
|
|
172
119
|
return _CoreManager.default.get('APPLICATION_ID');
|
|
173
120
|
},
|
|
174
|
-
|
|
175
121
|
/**
|
|
176
122
|
* @member {string} Parse.javaScriptKey
|
|
177
123
|
* @static
|
|
@@ -179,11 +125,9 @@ const Parse = {
|
|
|
179
125
|
set javaScriptKey(value) {
|
|
180
126
|
_CoreManager.default.set('JAVASCRIPT_KEY', value);
|
|
181
127
|
},
|
|
182
|
-
|
|
183
128
|
get javaScriptKey() {
|
|
184
129
|
return _CoreManager.default.get('JAVASCRIPT_KEY');
|
|
185
130
|
},
|
|
186
|
-
|
|
187
131
|
/**
|
|
188
132
|
* @member {string} Parse.masterKey
|
|
189
133
|
* @static
|
|
@@ -191,11 +135,9 @@ const Parse = {
|
|
|
191
135
|
set masterKey(value) {
|
|
192
136
|
_CoreManager.default.set('MASTER_KEY', value);
|
|
193
137
|
},
|
|
194
|
-
|
|
195
138
|
get masterKey() {
|
|
196
139
|
return _CoreManager.default.get('MASTER_KEY');
|
|
197
140
|
},
|
|
198
|
-
|
|
199
141
|
/**
|
|
200
142
|
* @member {string} Parse.serverURL
|
|
201
143
|
* @static
|
|
@@ -203,11 +145,9 @@ const Parse = {
|
|
|
203
145
|
set serverURL(value) {
|
|
204
146
|
_CoreManager.default.set('SERVER_URL', value);
|
|
205
147
|
},
|
|
206
|
-
|
|
207
148
|
get serverURL() {
|
|
208
149
|
return _CoreManager.default.get('SERVER_URL');
|
|
209
150
|
},
|
|
210
|
-
|
|
211
151
|
/**
|
|
212
152
|
* @member {string} Parse.serverAuthToken
|
|
213
153
|
* @static
|
|
@@ -215,11 +155,9 @@ const Parse = {
|
|
|
215
155
|
set serverAuthToken(value) {
|
|
216
156
|
_CoreManager.default.set('SERVER_AUTH_TOKEN', value);
|
|
217
157
|
},
|
|
218
|
-
|
|
219
158
|
get serverAuthToken() {
|
|
220
159
|
return _CoreManager.default.get('SERVER_AUTH_TOKEN');
|
|
221
160
|
},
|
|
222
|
-
|
|
223
161
|
/**
|
|
224
162
|
* @member {string} Parse.serverAuthType
|
|
225
163
|
* @static
|
|
@@ -227,11 +165,9 @@ const Parse = {
|
|
|
227
165
|
set serverAuthType(value) {
|
|
228
166
|
_CoreManager.default.set('SERVER_AUTH_TYPE', value);
|
|
229
167
|
},
|
|
230
|
-
|
|
231
168
|
get serverAuthType() {
|
|
232
169
|
return _CoreManager.default.get('SERVER_AUTH_TYPE');
|
|
233
170
|
},
|
|
234
|
-
|
|
235
171
|
/**
|
|
236
172
|
* @member {string} Parse.liveQueryServerURL
|
|
237
173
|
* @static
|
|
@@ -239,11 +175,9 @@ const Parse = {
|
|
|
239
175
|
set liveQueryServerURL(value) {
|
|
240
176
|
_CoreManager.default.set('LIVEQUERY_SERVER_URL', value);
|
|
241
177
|
},
|
|
242
|
-
|
|
243
178
|
get liveQueryServerURL() {
|
|
244
179
|
return _CoreManager.default.get('LIVEQUERY_SERVER_URL');
|
|
245
180
|
},
|
|
246
|
-
|
|
247
181
|
/**
|
|
248
182
|
* @member {string} Parse.encryptedUser
|
|
249
183
|
* @static
|
|
@@ -251,11 +185,9 @@ const Parse = {
|
|
|
251
185
|
set encryptedUser(value) {
|
|
252
186
|
_CoreManager.default.set('ENCRYPTED_USER', value);
|
|
253
187
|
},
|
|
254
|
-
|
|
255
188
|
get encryptedUser() {
|
|
256
189
|
return _CoreManager.default.get('ENCRYPTED_USER');
|
|
257
190
|
},
|
|
258
|
-
|
|
259
191
|
/**
|
|
260
192
|
* @member {string} Parse.secret
|
|
261
193
|
* @static
|
|
@@ -263,11 +195,9 @@ const Parse = {
|
|
|
263
195
|
set secret(value) {
|
|
264
196
|
_CoreManager.default.set('ENCRYPTED_KEY', value);
|
|
265
197
|
},
|
|
266
|
-
|
|
267
198
|
get secret() {
|
|
268
199
|
return _CoreManager.default.get('ENCRYPTED_KEY');
|
|
269
200
|
},
|
|
270
|
-
|
|
271
201
|
/**
|
|
272
202
|
* @member {boolean} Parse.idempotency
|
|
273
203
|
* @static
|
|
@@ -275,11 +205,9 @@ const Parse = {
|
|
|
275
205
|
set idempotency(value) {
|
|
276
206
|
_CoreManager.default.set('IDEMPOTENCY', value);
|
|
277
207
|
},
|
|
278
|
-
|
|
279
208
|
get idempotency() {
|
|
280
209
|
return _CoreManager.default.get('IDEMPOTENCY');
|
|
281
210
|
},
|
|
282
|
-
|
|
283
211
|
/**
|
|
284
212
|
* @member {boolean} Parse.allowCustomObjectId
|
|
285
213
|
* @static
|
|
@@ -287,11 +215,9 @@ const Parse = {
|
|
|
287
215
|
set allowCustomObjectId(value) {
|
|
288
216
|
_CoreManager.default.set('ALLOW_CUSTOM_OBJECT_ID', value);
|
|
289
217
|
},
|
|
290
|
-
|
|
291
218
|
get allowCustomObjectId() {
|
|
292
219
|
return _CoreManager.default.get('ALLOW_CUSTOM_OBJECT_ID');
|
|
293
220
|
}
|
|
294
|
-
|
|
295
221
|
};
|
|
296
222
|
Parse.ACL = require('./ParseACL').default;
|
|
297
223
|
Parse.Analytics = require('./Analytics');
|
|
@@ -328,24 +254,19 @@ Parse.Storage = require('./Storage');
|
|
|
328
254
|
Parse.User = require('./ParseUser').default;
|
|
329
255
|
Parse.LiveQuery = require('./ParseLiveQuery').default;
|
|
330
256
|
Parse.LiveQueryClient = require('./LiveQueryClient').default;
|
|
331
|
-
|
|
332
257
|
Parse._request = function (...args) {
|
|
333
258
|
return _CoreManager.default.getRESTController().request.apply(null, args);
|
|
334
259
|
};
|
|
335
|
-
|
|
336
260
|
Parse._ajax = function (...args) {
|
|
337
261
|
return _CoreManager.default.getRESTController().ajax.apply(null, args);
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
|
|
262
|
+
};
|
|
263
|
+
// We attempt to match the signatures of the legacy versions of these methods
|
|
341
264
|
Parse._decode = function (_, value) {
|
|
342
265
|
return (0, _decode.default)(value);
|
|
343
266
|
};
|
|
344
|
-
|
|
345
267
|
Parse._encode = function (value, _, disallowObjects) {
|
|
346
268
|
return (0, _encode.default)(value, disallowObjects);
|
|
347
269
|
};
|
|
348
|
-
|
|
349
270
|
Parse._getInstallationId = function () {
|
|
350
271
|
return _CoreManager.default.getInstallationController().currentInstallationId();
|
|
351
272
|
};
|
|
@@ -357,19 +278,13 @@ Parse._getInstallationId = function () {
|
|
|
357
278
|
* @param [ms] Milliseconds to ping the server. Default 2000ms
|
|
358
279
|
* @static
|
|
359
280
|
*/
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
Parse.enableLocalDatastore = function (polling = true, ms
|
|
363
|
-
/*: number*/
|
|
364
|
-
= 2000) {
|
|
281
|
+
Parse.enableLocalDatastore = function (polling = true, ms /*: number*/ = 2000) {
|
|
365
282
|
if (!Parse.applicationId) {
|
|
366
283
|
console.log("'enableLocalDataStore' must be called after 'initialize'");
|
|
367
284
|
return;
|
|
368
285
|
}
|
|
369
|
-
|
|
370
286
|
if (!Parse.LocalDatastore.isEnabled) {
|
|
371
287
|
Parse.LocalDatastore.isEnabled = true;
|
|
372
|
-
|
|
373
288
|
if (polling) {
|
|
374
289
|
_EventuallyQueue.default.poll(ms);
|
|
375
290
|
}
|
|
@@ -381,8 +296,6 @@ Parse.enableLocalDatastore = function (polling = true, ms
|
|
|
381
296
|
* @static
|
|
382
297
|
* @returns {boolean}
|
|
383
298
|
*/
|
|
384
|
-
|
|
385
|
-
|
|
386
299
|
Parse.isLocalDatastoreEnabled = function () {
|
|
387
300
|
return Parse.LocalDatastore.isEnabled;
|
|
388
301
|
};
|
|
@@ -396,54 +309,44 @@ Parse.isLocalDatastoreEnabled = function () {
|
|
|
396
309
|
* @static
|
|
397
310
|
* @returns {object}
|
|
398
311
|
*/
|
|
399
|
-
|
|
400
|
-
|
|
401
312
|
Parse.dumpLocalDatastore = function () {
|
|
402
313
|
if (!Parse.LocalDatastore.isEnabled) {
|
|
403
314
|
console.log('Parse.enableLocalDatastore() must be called first'); // eslint-disable-line no-console
|
|
404
|
-
|
|
405
315
|
return Promise.resolve({});
|
|
406
316
|
} else {
|
|
407
317
|
return Parse.LocalDatastore._getAllContents();
|
|
408
318
|
}
|
|
409
319
|
};
|
|
320
|
+
|
|
410
321
|
/**
|
|
411
322
|
* Enable the current user encryption.
|
|
412
323
|
* This must be called before login any user.
|
|
413
324
|
*
|
|
414
325
|
* @static
|
|
415
326
|
*/
|
|
416
|
-
|
|
417
|
-
|
|
418
327
|
Parse.enableEncryptedUser = function () {
|
|
419
328
|
Parse.encryptedUser = true;
|
|
420
329
|
};
|
|
330
|
+
|
|
421
331
|
/**
|
|
422
332
|
* Flag that indicates whether Encrypted User is enabled.
|
|
423
333
|
*
|
|
424
334
|
* @static
|
|
425
335
|
* @returns {boolean}
|
|
426
336
|
*/
|
|
427
|
-
|
|
428
|
-
|
|
429
337
|
Parse.isEncryptedUserEnabled = function () {
|
|
430
338
|
return Parse.encryptedUser;
|
|
431
339
|
};
|
|
432
|
-
|
|
433
340
|
_CoreManager.default.setCryptoController(_CryptoController.default);
|
|
434
|
-
|
|
435
341
|
_CoreManager.default.setInstallationController(_InstallationController.default);
|
|
436
|
-
|
|
437
342
|
_CoreManager.default.setRESTController(_RESTController.default);
|
|
438
|
-
|
|
439
343
|
Parse.initialize = Parse._initialize;
|
|
440
344
|
Parse.Cloud = Parse.Cloud || {};
|
|
441
|
-
|
|
442
345
|
Parse.Cloud.useMasterKey = function () {
|
|
443
346
|
_CoreManager.default.set('USE_MASTER_KEY', true);
|
|
444
347
|
};
|
|
348
|
+
Parse.Hooks = require('./ParseHooks');
|
|
445
349
|
|
|
446
|
-
|
|
447
|
-
|
|
350
|
+
// For legacy requires, of the form `var Parse = require('parse').Parse`
|
|
448
351
|
Parse.Parse = Parse;
|
|
449
352
|
module.exports = Parse;
|