parse 4.0.0-alpha.1 → 4.0.0-alpha.10
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 +34 -30
- package/PATENTS +0 -37
|
@@ -1,72 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
6
|
-
|
|
7
4
|
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
5
|
+
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
8
6
|
/*
|
|
9
|
-
* Copyright (c) 2015-present, Parse, LLC.
|
|
10
|
-
* All rights reserved.
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the BSD-style license found in the
|
|
13
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
14
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
15
|
-
*
|
|
16
7
|
* @flow
|
|
17
8
|
*/
|
|
18
|
-
|
|
19
9
|
/*:: import type { AttributeMap, ObjectCache, OpsMap, State } from './ObjectStateMutations';*/
|
|
20
|
-
|
|
21
10
|
/*:: import type ParseFile from './ParseFile';*/
|
|
22
|
-
|
|
23
11
|
/*:: import type { FileSource } from './ParseFile';*/
|
|
24
|
-
|
|
25
12
|
/*:: import type { Op } from './ParseOp';*/
|
|
26
|
-
|
|
27
13
|
/*:: import type ParseObject from './ParseObject';*/
|
|
28
|
-
|
|
29
14
|
/*:: import type { QueryJSON } from './ParseQuery';*/
|
|
30
|
-
|
|
31
15
|
/*:: import type ParseUser from './ParseUser';*/
|
|
32
|
-
|
|
33
16
|
/*:: import type { AuthData } from './ParseUser';*/
|
|
34
|
-
|
|
35
17
|
/*:: import type { PushData } from './Push';*/
|
|
36
|
-
|
|
37
18
|
/*:: import type { RequestOptions, FullOptions } from './RESTController';*/
|
|
38
|
-
|
|
39
19
|
/*:: type AnalyticsController = {
|
|
40
20
|
track: (name: string, dimensions: { [key: string]: string }) => Promise,
|
|
41
21
|
};*/
|
|
42
|
-
|
|
43
22
|
/*:: type CloudController = {
|
|
44
23
|
run: (name: string, data: mixed, options: RequestOptions) => Promise,
|
|
45
24
|
getJobsData: (options: RequestOptions) => Promise,
|
|
46
25
|
startJob: (name: string, data: mixed, options: RequestOptions) => Promise,
|
|
47
26
|
};*/
|
|
48
|
-
|
|
49
27
|
/*:: type ConfigController = {
|
|
50
28
|
current: () => Promise,
|
|
51
29
|
get: () => Promise,
|
|
52
30
|
save: (attrs: { [key: string]: any }) => Promise,
|
|
53
31
|
};*/
|
|
54
|
-
|
|
55
32
|
/*:: type CryptoController = {
|
|
56
33
|
encrypt: (obj: any, secretKey: string) => string,
|
|
57
34
|
decrypt: (encryptedText: string, secretKey: any) => string,
|
|
58
35
|
};*/
|
|
59
|
-
|
|
60
36
|
/*:: type FileController = {
|
|
61
37
|
saveFile: (name: string, source: FileSource, options: FullOptions) => Promise,
|
|
62
38
|
saveBase64: (name: string, source: FileSource, options: FullOptions) => Promise,
|
|
63
39
|
download: (uri: string) => Promise,
|
|
64
40
|
};*/
|
|
65
|
-
|
|
66
41
|
/*:: type InstallationController = {
|
|
67
42
|
currentInstallationId: () => Promise,
|
|
68
43
|
};*/
|
|
69
|
-
|
|
70
44
|
/*:: type ObjectController = {
|
|
71
45
|
fetch: (
|
|
72
46
|
object: ParseObject | Array<ParseObject>,
|
|
@@ -76,7 +50,6 @@ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
|
76
50
|
save: (object: ParseObject | Array<ParseObject | ParseFile>, options: RequestOptions) => Promise,
|
|
77
51
|
destroy: (object: ParseObject | Array<ParseObject>, options: RequestOptions) => Promise,
|
|
78
52
|
};*/
|
|
79
|
-
|
|
80
53
|
/*:: type ObjectStateController = {
|
|
81
54
|
getState: (obj: any) => ?State,
|
|
82
55
|
initializeState: (obj: any, initial?: State) => State,
|
|
@@ -96,21 +69,17 @@ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
|
96
69
|
clearAllState: () => void,
|
|
97
70
|
duplicateState: (source: any, dest: any) => void,
|
|
98
71
|
};*/
|
|
99
|
-
|
|
100
72
|
/*:: type PushController = {
|
|
101
73
|
send: (data: PushData) => Promise,
|
|
102
74
|
};*/
|
|
103
|
-
|
|
104
75
|
/*:: type QueryController = {
|
|
105
76
|
find: (className: string, params: QueryJSON, options: RequestOptions) => Promise,
|
|
106
77
|
aggregate: (className: string, params: any, options: RequestOptions) => Promise,
|
|
107
78
|
};*/
|
|
108
|
-
|
|
109
79
|
/*:: type RESTController = {
|
|
110
80
|
request: (method: string, path: string, data: mixed, options: RequestOptions) => Promise,
|
|
111
81
|
ajax: (method: string, url: string, data: any, headers?: any, options: FullOptions) => Promise,
|
|
112
82
|
};*/
|
|
113
|
-
|
|
114
83
|
/*:: type SchemaController = {
|
|
115
84
|
purge: (className: string) => Promise,
|
|
116
85
|
get: (className: string, options: RequestOptions) => Promise,
|
|
@@ -119,11 +88,9 @@ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
|
119
88
|
update: (className: string, params: any, options: RequestOptions) => Promise,
|
|
120
89
|
send(className: string, method: string, params: any, options: RequestOptions): Promise,
|
|
121
90
|
};*/
|
|
122
|
-
|
|
123
91
|
/*:: type SessionController = {
|
|
124
92
|
getSession: (token: RequestOptions) => Promise,
|
|
125
93
|
};*/
|
|
126
|
-
|
|
127
94
|
/*:: type StorageController =
|
|
128
95
|
| {
|
|
129
96
|
async: 0,
|
|
@@ -145,7 +112,6 @@ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
|
145
112
|
removeItemAsync: (path: string) => Promise,
|
|
146
113
|
clear: () => void,
|
|
147
114
|
};*/
|
|
148
|
-
|
|
149
115
|
/*:: type LocalDatastoreController = {
|
|
150
116
|
fromPinWithName: (name: string) => ?any,
|
|
151
117
|
pinWithName: (name: string, objects: any) => void,
|
|
@@ -153,7 +119,6 @@ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
|
153
119
|
getAllContents: () => ?any,
|
|
154
120
|
clear: () => void,
|
|
155
121
|
};*/
|
|
156
|
-
|
|
157
122
|
/*:: type UserController = {
|
|
158
123
|
setCurrentUser: (user: ParseUser) => Promise,
|
|
159
124
|
currentUser: () => ?ParseUser,
|
|
@@ -172,7 +137,6 @@ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
|
172
137
|
verifyPassword: (username: string, password: string, options: RequestOptions) => Promise,
|
|
173
138
|
requestEmailVerification: (email: string, options: RequestOptions) => Promise,
|
|
174
139
|
};*/
|
|
175
|
-
|
|
176
140
|
/*:: type HooksController = {
|
|
177
141
|
get: (type: string, functionName?: string, triggerName?: string) => Promise,
|
|
178
142
|
create: (hook: mixed) => Promise,
|
|
@@ -180,7 +144,6 @@ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
|
180
144
|
update: (hook: mixed) => Promise,
|
|
181
145
|
send: (method: string, path: string, body?: mixed) => Promise,
|
|
182
146
|
};*/
|
|
183
|
-
|
|
184
147
|
/*:: type WebSocketController = {
|
|
185
148
|
onopen: () => void,
|
|
186
149
|
onmessage: (message: any) => void,
|
|
@@ -189,7 +152,6 @@ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
|
189
152
|
send: (data: any) => void,
|
|
190
153
|
close: () => void,
|
|
191
154
|
};*/
|
|
192
|
-
|
|
193
155
|
/*:: type Config = {
|
|
194
156
|
AnalyticsController?: AnalyticsController,
|
|
195
157
|
CloudController?: CloudController,
|
|
@@ -209,11 +171,7 @@ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
|
209
171
|
HooksController?: HooksController,
|
|
210
172
|
WebSocketController?: WebSocketController,
|
|
211
173
|
};*/
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
var config
|
|
215
|
-
/*: Config & { [key: string]: mixed }*/
|
|
216
|
-
= {
|
|
174
|
+
var config /*: Config & { [key: string]: mixed }*/ = {
|
|
217
175
|
// Defaults
|
|
218
176
|
IS_NODE: typeof process !== 'undefined' && !!process.versions && !!process.versions.node && !process.versions.electron,
|
|
219
177
|
REQUEST_ATTEMPT_LIMIT: 5,
|
|
@@ -224,7 +182,7 @@ var config
|
|
|
224
182
|
SERVER_AUTH_TOKEN: null,
|
|
225
183
|
LIVEQUERY_SERVER_URL: null,
|
|
226
184
|
ENCRYPTED_KEY: null,
|
|
227
|
-
VERSION: 'js' + "4.0.0-alpha.
|
|
185
|
+
VERSION: 'js' + "4.0.0-alpha.10",
|
|
228
186
|
APPLICATION_ID: null,
|
|
229
187
|
JAVASCRIPT_KEY: null,
|
|
230
188
|
MASTER_KEY: null,
|
|
@@ -235,273 +193,170 @@ var config
|
|
|
235
193
|
IDEMPOTENCY: false,
|
|
236
194
|
ALLOW_CUSTOM_OBJECT_ID: false
|
|
237
195
|
};
|
|
238
|
-
|
|
239
|
-
function requireMethods(name
|
|
240
|
-
/*: string*/
|
|
241
|
-
, methods
|
|
242
|
-
/*: Array<string>*/
|
|
243
|
-
, controller
|
|
244
|
-
/*: any*/
|
|
245
|
-
) {
|
|
196
|
+
function requireMethods(name /*: string*/, methods /*: Array<string>*/, controller /*: any*/) {
|
|
246
197
|
(0, _forEach.default)(methods).call(methods, function (func) {
|
|
247
198
|
if (typeof controller[func] !== 'function') {
|
|
248
199
|
var _context;
|
|
249
|
-
|
|
250
200
|
throw new Error((0, _concat.default)(_context = "".concat(name, " must implement ")).call(_context, func, "()"));
|
|
251
201
|
}
|
|
252
202
|
});
|
|
253
203
|
}
|
|
254
|
-
|
|
255
204
|
module.exports = {
|
|
256
|
-
get: function (key
|
|
257
|
-
/*: string*/
|
|
258
|
-
)
|
|
259
|
-
/*: any*/
|
|
260
|
-
{
|
|
205
|
+
get: function (key /*: string*/) /*: any*/{
|
|
261
206
|
if (config.hasOwnProperty(key)) {
|
|
262
207
|
return config[key];
|
|
263
208
|
}
|
|
264
|
-
|
|
265
209
|
throw new Error('Configuration key not found: ' + key);
|
|
266
210
|
},
|
|
267
|
-
set: function (key
|
|
268
|
-
/*: string*/
|
|
269
|
-
, value
|
|
270
|
-
/*: any*/
|
|
271
|
-
)
|
|
272
|
-
/*: void*/
|
|
273
|
-
{
|
|
211
|
+
set: function (key /*: string*/, value /*: any*/) /*: void*/{
|
|
274
212
|
config[key] = value;
|
|
275
213
|
},
|
|
276
|
-
|
|
277
|
-
/* Specialized Controller Setters/Getters */
|
|
278
|
-
setAnalyticsController: function (controller
|
|
279
|
-
/*: AnalyticsController*/
|
|
280
|
-
) {
|
|
214
|
+
/* Specialized Controller Setters/Getters */setAnalyticsController: function (controller /*: AnalyticsController*/) {
|
|
281
215
|
requireMethods('AnalyticsController', ['track'], controller);
|
|
282
216
|
config['AnalyticsController'] = controller;
|
|
283
217
|
},
|
|
284
|
-
getAnalyticsController: function ()
|
|
285
|
-
/*: AnalyticsController*/
|
|
286
|
-
{
|
|
218
|
+
getAnalyticsController: function () /*: AnalyticsController*/{
|
|
287
219
|
return config['AnalyticsController'];
|
|
288
220
|
},
|
|
289
|
-
setCloudController: function (controller
|
|
290
|
-
/*: CloudController*/
|
|
291
|
-
) {
|
|
221
|
+
setCloudController: function (controller /*: CloudController*/) {
|
|
292
222
|
requireMethods('CloudController', ['run', 'getJobsData', 'startJob'], controller);
|
|
293
223
|
config['CloudController'] = controller;
|
|
294
224
|
},
|
|
295
|
-
getCloudController: function ()
|
|
296
|
-
/*: CloudController*/
|
|
297
|
-
{
|
|
225
|
+
getCloudController: function () /*: CloudController*/{
|
|
298
226
|
return config['CloudController'];
|
|
299
227
|
},
|
|
300
|
-
setConfigController: function (controller
|
|
301
|
-
/*: ConfigController*/
|
|
302
|
-
) {
|
|
228
|
+
setConfigController: function (controller /*: ConfigController*/) {
|
|
303
229
|
requireMethods('ConfigController', ['current', 'get', 'save'], controller);
|
|
304
230
|
config['ConfigController'] = controller;
|
|
305
231
|
},
|
|
306
|
-
getConfigController: function ()
|
|
307
|
-
/*: ConfigController*/
|
|
308
|
-
{
|
|
232
|
+
getConfigController: function () /*: ConfigController*/{
|
|
309
233
|
return config['ConfigController'];
|
|
310
234
|
},
|
|
311
|
-
setCryptoController: function (controller
|
|
312
|
-
/*: CryptoController*/
|
|
313
|
-
) {
|
|
235
|
+
setCryptoController: function (controller /*: CryptoController*/) {
|
|
314
236
|
requireMethods('CryptoController', ['encrypt', 'decrypt'], controller);
|
|
315
237
|
config['CryptoController'] = controller;
|
|
316
238
|
},
|
|
317
|
-
getCryptoController: function ()
|
|
318
|
-
/*: CryptoController*/
|
|
319
|
-
{
|
|
239
|
+
getCryptoController: function () /*: CryptoController*/{
|
|
320
240
|
return config['CryptoController'];
|
|
321
241
|
},
|
|
322
|
-
setFileController: function (controller
|
|
323
|
-
/*: FileController*/
|
|
324
|
-
) {
|
|
242
|
+
setFileController: function (controller /*: FileController*/) {
|
|
325
243
|
requireMethods('FileController', ['saveFile', 'saveBase64'], controller);
|
|
326
244
|
config['FileController'] = controller;
|
|
327
245
|
},
|
|
328
|
-
getFileController: function ()
|
|
329
|
-
/*: FileController*/
|
|
330
|
-
{
|
|
246
|
+
getFileController: function () /*: FileController*/{
|
|
331
247
|
return config['FileController'];
|
|
332
248
|
},
|
|
333
|
-
setInstallationController: function (controller
|
|
334
|
-
/*: InstallationController*/
|
|
335
|
-
) {
|
|
249
|
+
setInstallationController: function (controller /*: InstallationController*/) {
|
|
336
250
|
requireMethods('InstallationController', ['currentInstallationId'], controller);
|
|
337
251
|
config['InstallationController'] = controller;
|
|
338
252
|
},
|
|
339
|
-
getInstallationController: function ()
|
|
340
|
-
/*: InstallationController*/
|
|
341
|
-
{
|
|
253
|
+
getInstallationController: function () /*: InstallationController*/{
|
|
342
254
|
return config['InstallationController'];
|
|
343
255
|
},
|
|
344
|
-
setObjectController: function (controller
|
|
345
|
-
/*: ObjectController*/
|
|
346
|
-
) {
|
|
256
|
+
setObjectController: function (controller /*: ObjectController*/) {
|
|
347
257
|
requireMethods('ObjectController', ['save', 'fetch', 'destroy'], controller);
|
|
348
258
|
config['ObjectController'] = controller;
|
|
349
259
|
},
|
|
350
|
-
getObjectController: function ()
|
|
351
|
-
/*: ObjectController*/
|
|
352
|
-
{
|
|
260
|
+
getObjectController: function () /*: ObjectController*/{
|
|
353
261
|
return config['ObjectController'];
|
|
354
262
|
},
|
|
355
|
-
setObjectStateController: function (controller
|
|
356
|
-
/*: ObjectStateController*/
|
|
357
|
-
) {
|
|
263
|
+
setObjectStateController: function (controller /*: ObjectStateController*/) {
|
|
358
264
|
requireMethods('ObjectStateController', ['getState', 'initializeState', 'removeState', 'getServerData', 'setServerData', 'getPendingOps', 'setPendingOp', 'pushPendingState', 'popPendingState', 'mergeFirstPendingState', 'getObjectCache', 'estimateAttribute', 'estimateAttributes', 'commitServerChanges', 'enqueueTask', 'clearAllState'], controller);
|
|
359
265
|
config['ObjectStateController'] = controller;
|
|
360
266
|
},
|
|
361
|
-
getObjectStateController: function ()
|
|
362
|
-
/*: ObjectStateController*/
|
|
363
|
-
{
|
|
267
|
+
getObjectStateController: function () /*: ObjectStateController*/{
|
|
364
268
|
return config['ObjectStateController'];
|
|
365
269
|
},
|
|
366
|
-
setPushController: function (controller
|
|
367
|
-
/*: PushController*/
|
|
368
|
-
) {
|
|
270
|
+
setPushController: function (controller /*: PushController*/) {
|
|
369
271
|
requireMethods('PushController', ['send'], controller);
|
|
370
272
|
config['PushController'] = controller;
|
|
371
273
|
},
|
|
372
|
-
getPushController: function ()
|
|
373
|
-
/*: PushController*/
|
|
374
|
-
{
|
|
274
|
+
getPushController: function () /*: PushController*/{
|
|
375
275
|
return config['PushController'];
|
|
376
276
|
},
|
|
377
|
-
setQueryController: function (controller
|
|
378
|
-
/*: QueryController*/
|
|
379
|
-
) {
|
|
277
|
+
setQueryController: function (controller /*: QueryController*/) {
|
|
380
278
|
requireMethods('QueryController', ['find', 'aggregate'], controller);
|
|
381
279
|
config['QueryController'] = controller;
|
|
382
280
|
},
|
|
383
|
-
getQueryController: function ()
|
|
384
|
-
/*: QueryController*/
|
|
385
|
-
{
|
|
281
|
+
getQueryController: function () /*: QueryController*/{
|
|
386
282
|
return config['QueryController'];
|
|
387
283
|
},
|
|
388
|
-
setRESTController: function (controller
|
|
389
|
-
/*: RESTController*/
|
|
390
|
-
) {
|
|
284
|
+
setRESTController: function (controller /*: RESTController*/) {
|
|
391
285
|
requireMethods('RESTController', ['request', 'ajax'], controller);
|
|
392
286
|
config['RESTController'] = controller;
|
|
393
287
|
},
|
|
394
|
-
getRESTController: function ()
|
|
395
|
-
/*: RESTController*/
|
|
396
|
-
{
|
|
288
|
+
getRESTController: function () /*: RESTController*/{
|
|
397
289
|
return config['RESTController'];
|
|
398
290
|
},
|
|
399
|
-
setSchemaController: function (controller
|
|
400
|
-
/*: SchemaController*/
|
|
401
|
-
) {
|
|
291
|
+
setSchemaController: function (controller /*: SchemaController*/) {
|
|
402
292
|
requireMethods('SchemaController', ['get', 'create', 'update', 'delete', 'send', 'purge'], controller);
|
|
403
293
|
config['SchemaController'] = controller;
|
|
404
294
|
},
|
|
405
|
-
getSchemaController: function ()
|
|
406
|
-
/*: SchemaController*/
|
|
407
|
-
{
|
|
295
|
+
getSchemaController: function () /*: SchemaController*/{
|
|
408
296
|
return config['SchemaController'];
|
|
409
297
|
},
|
|
410
|
-
setSessionController: function (controller
|
|
411
|
-
/*: SessionController*/
|
|
412
|
-
) {
|
|
298
|
+
setSessionController: function (controller /*: SessionController*/) {
|
|
413
299
|
requireMethods('SessionController', ['getSession'], controller);
|
|
414
300
|
config['SessionController'] = controller;
|
|
415
301
|
},
|
|
416
|
-
getSessionController: function ()
|
|
417
|
-
/*: SessionController*/
|
|
418
|
-
{
|
|
302
|
+
getSessionController: function () /*: SessionController*/{
|
|
419
303
|
return config['SessionController'];
|
|
420
304
|
},
|
|
421
|
-
setStorageController: function (controller
|
|
422
|
-
/*: StorageController*/
|
|
423
|
-
) {
|
|
305
|
+
setStorageController: function (controller /*: StorageController*/) {
|
|
424
306
|
if (controller.async) {
|
|
425
307
|
requireMethods('An async StorageController', ['getItemAsync', 'setItemAsync', 'removeItemAsync', 'getAllKeysAsync'], controller);
|
|
426
308
|
} else {
|
|
427
309
|
requireMethods('A synchronous StorageController', ['getItem', 'setItem', 'removeItem', 'getAllKeys'], controller);
|
|
428
310
|
}
|
|
429
|
-
|
|
430
311
|
config['StorageController'] = controller;
|
|
431
312
|
},
|
|
432
|
-
setLocalDatastoreController: function (controller
|
|
433
|
-
/*: LocalDatastoreController*/
|
|
434
|
-
) {
|
|
313
|
+
setLocalDatastoreController: function (controller /*: LocalDatastoreController*/) {
|
|
435
314
|
requireMethods('LocalDatastoreController', ['pinWithName', 'fromPinWithName', 'unPinWithName', 'getAllContents', 'clear'], controller);
|
|
436
315
|
config['LocalDatastoreController'] = controller;
|
|
437
316
|
},
|
|
438
|
-
getLocalDatastoreController: function ()
|
|
439
|
-
/*: LocalDatastoreController*/
|
|
440
|
-
{
|
|
317
|
+
getLocalDatastoreController: function () /*: LocalDatastoreController*/{
|
|
441
318
|
return config['LocalDatastoreController'];
|
|
442
319
|
},
|
|
443
|
-
setLocalDatastore: function (store
|
|
444
|
-
/*: any*/
|
|
445
|
-
) {
|
|
320
|
+
setLocalDatastore: function (store /*: any*/) {
|
|
446
321
|
config['LocalDatastore'] = store;
|
|
447
322
|
},
|
|
448
323
|
getLocalDatastore: function () {
|
|
449
324
|
return config['LocalDatastore'];
|
|
450
325
|
},
|
|
451
|
-
getStorageController: function ()
|
|
452
|
-
/*: StorageController*/
|
|
453
|
-
{
|
|
326
|
+
getStorageController: function () /*: StorageController*/{
|
|
454
327
|
return config['StorageController'];
|
|
455
328
|
},
|
|
456
|
-
setAsyncStorage: function (storage
|
|
457
|
-
/*: any*/
|
|
458
|
-
) {
|
|
329
|
+
setAsyncStorage: function (storage /*: any*/) {
|
|
459
330
|
config['AsyncStorage'] = storage;
|
|
460
331
|
},
|
|
461
332
|
getAsyncStorage: function () {
|
|
462
333
|
return config['AsyncStorage'];
|
|
463
334
|
},
|
|
464
|
-
setWebSocketController: function (controller
|
|
465
|
-
/*: WebSocketController*/
|
|
466
|
-
) {
|
|
335
|
+
setWebSocketController: function (controller /*: WebSocketController*/) {
|
|
467
336
|
config['WebSocketController'] = controller;
|
|
468
337
|
},
|
|
469
|
-
getWebSocketController: function ()
|
|
470
|
-
/*: WebSocketController*/
|
|
471
|
-
{
|
|
338
|
+
getWebSocketController: function () /*: WebSocketController*/{
|
|
472
339
|
return config['WebSocketController'];
|
|
473
340
|
},
|
|
474
|
-
setUserController: function (controller
|
|
475
|
-
/*: UserController*/
|
|
476
|
-
) {
|
|
341
|
+
setUserController: function (controller /*: UserController*/) {
|
|
477
342
|
requireMethods('UserController', ['setCurrentUser', 'currentUser', 'currentUserAsync', 'signUp', 'logIn', 'become', 'logOut', 'me', 'requestPasswordReset', 'upgradeToRevocableSession', 'requestEmailVerification', 'verifyPassword', 'linkWith'], controller);
|
|
478
343
|
config['UserController'] = controller;
|
|
479
344
|
},
|
|
480
|
-
getUserController: function ()
|
|
481
|
-
/*: UserController*/
|
|
482
|
-
{
|
|
345
|
+
getUserController: function () /*: UserController*/{
|
|
483
346
|
return config['UserController'];
|
|
484
347
|
},
|
|
485
|
-
setLiveQueryController: function (controller
|
|
486
|
-
/*: any*/
|
|
487
|
-
) {
|
|
348
|
+
setLiveQueryController: function (controller /*: any*/) {
|
|
488
349
|
requireMethods('LiveQueryController', ['setDefaultLiveQueryClient', 'getDefaultLiveQueryClient', '_clearCachedDefaultClient'], controller);
|
|
489
350
|
config['LiveQueryController'] = controller;
|
|
490
351
|
},
|
|
491
|
-
getLiveQueryController: function ()
|
|
492
|
-
/*: any*/
|
|
493
|
-
{
|
|
352
|
+
getLiveQueryController: function () /*: any*/{
|
|
494
353
|
return config['LiveQueryController'];
|
|
495
354
|
},
|
|
496
|
-
setHooksController: function (controller
|
|
497
|
-
/*: HooksController*/
|
|
498
|
-
) {
|
|
355
|
+
setHooksController: function (controller /*: HooksController*/) {
|
|
499
356
|
requireMethods('HooksController', ['create', 'get', 'update', 'remove'], controller);
|
|
500
357
|
config['HooksController'] = controller;
|
|
501
358
|
},
|
|
502
|
-
getHooksController: function ()
|
|
503
|
-
/*: HooksController*/
|
|
504
|
-
{
|
|
359
|
+
getHooksController: function () /*: HooksController*/{
|
|
505
360
|
return config['HooksController'];
|
|
506
361
|
}
|
|
507
362
|
};
|
|
@@ -1,32 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
|
|
6
|
-
|
|
7
5
|
var AES;
|
|
8
6
|
var ENC;
|
|
9
7
|
AES = require('crypto-js/aes');
|
|
10
8
|
ENC = require('crypto-js/enc-utf8');
|
|
11
9
|
var CryptoJS;
|
|
12
10
|
var CryptoController = {
|
|
13
|
-
encrypt: function (obj
|
|
14
|
-
/*: any*/
|
|
15
|
-
, secretKey
|
|
16
|
-
/*: string*/
|
|
17
|
-
)
|
|
18
|
-
/*: ?string*/
|
|
19
|
-
{
|
|
11
|
+
encrypt: function (obj /*: any*/, secretKey /*: string*/) /*: ?string*/{
|
|
20
12
|
var encrypted = AES.encrypt((0, _stringify.default)(obj), secretKey);
|
|
21
13
|
return encrypted.toString();
|
|
22
14
|
},
|
|
23
|
-
decrypt: function (encryptedText
|
|
24
|
-
/*: string*/
|
|
25
|
-
, secretKey
|
|
26
|
-
/*: string*/
|
|
27
|
-
)
|
|
28
|
-
/*: ?string*/
|
|
29
|
-
{
|
|
15
|
+
decrypt: function (encryptedText /*: string*/, secretKey /*: string*/) /*: ?string*/{
|
|
30
16
|
var decryptedStr = AES.decrypt(encryptedText, secretKey).toString(ENC);
|
|
31
17
|
return decryptedStr;
|
|
32
18
|
}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
|
-
* Copyright (c) 2015-present, Parse, LLC.
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the BSD-style license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
|
8
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
|
9
|
-
*
|
|
10
4
|
* This is a simple wrapper to unify EventEmitter implementations across platforms.
|
|
11
5
|
*/
|
|
12
|
-
|
|
13
6
|
module.exports = require('events').EventEmitter;
|
|
14
7
|
var EventEmitter;
|