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