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