parse 5.2.0-alpha.1 → 5.2.0-alpha.2
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 +10102 -15029
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +10093 -15165
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/Analytics.js +7 -11
- package/lib/browser/AnonymousUtils.js +17 -22
- package/lib/browser/Cloud.js +23 -41
- package/lib/browser/CoreManager.js +71 -79
- package/lib/browser/CryptoController.js +14 -9
- package/lib/browser/EventEmitter.js +9 -2
- package/lib/browser/EventuallyQueue.js +156 -357
- package/lib/browser/FacebookUtils.js +23 -28
- package/lib/browser/IndexedDBStorageController.js +18 -14
- package/lib/browser/InstallationController.js +55 -121
- package/lib/browser/LiveQueryClient.js +308 -484
- package/lib/browser/LiveQuerySubscription.js +25 -28
- package/lib/browser/LocalDatastore.js +258 -624
- package/lib/browser/LocalDatastoreController.default.js +42 -226
- package/lib/browser/LocalDatastoreController.js +11 -1
- package/lib/browser/LocalDatastoreController.react-native.js +66 -160
- package/lib/browser/LocalDatastoreUtils.js +4 -7
- package/lib/browser/ObjectStateMutations.js +54 -96
- package/lib/browser/OfflineQuery.js +106 -198
- package/lib/browser/Parse.js +44 -60
- package/lib/browser/ParseACL.js +242 -288
- package/lib/browser/ParseCLP.js +372 -572
- package/lib/browser/ParseConfig.js +115 -138
- package/lib/browser/ParseError.js +85 -182
- package/lib/browser/ParseFile.js +294 -438
- package/lib/browser/ParseGeoPoint.js +121 -146
- package/lib/browser/ParseHooks.js +23 -25
- package/lib/browser/ParseInstallation.js +225 -367
- package/lib/browser/ParseLiveQuery.js +74 -148
- package/lib/browser/ParseObject.js +2014 -2621
- package/lib/browser/ParseOp.js +343 -484
- package/lib/browser/ParsePolygon.js +101 -120
- package/lib/browser/ParseQuery.js +1708 -2052
- package/lib/browser/ParseRelation.js +99 -118
- package/lib/browser/ParseRole.js +88 -140
- package/lib/browser/ParseSchema.js +372 -434
- package/lib/browser/ParseSession.js +62 -110
- package/lib/browser/ParseUser.js +941 -1284
- package/lib/browser/Push.js +15 -38
- package/lib/browser/RESTController.js +85 -124
- package/lib/browser/SingleInstanceStateController.js +57 -86
- package/lib/browser/Socket.weapp.js +50 -33
- package/lib/browser/Storage.js +23 -28
- package/lib/browser/StorageController.browser.js +16 -13
- package/lib/browser/StorageController.default.js +15 -14
- package/lib/browser/StorageController.js +14 -1
- package/lib/browser/StorageController.react-native.js +31 -30
- package/lib/browser/StorageController.weapp.js +19 -13
- package/lib/browser/TaskQueue.js +31 -43
- package/lib/browser/UniqueInstanceStateController.js +65 -86
- package/lib/browser/WebSocketController.js +11 -4
- package/lib/browser/Xhr.weapp.js +90 -78
- package/lib/browser/arrayContainsObject.js +3 -3
- package/lib/browser/canBeSerialized.js +10 -11
- package/lib/browser/decode.js +11 -11
- package/lib/browser/encode.js +11 -11
- package/lib/browser/equals.js +9 -10
- package/lib/browser/escape.js +2 -2
- package/lib/browser/isRevocableSession.js +1 -1
- package/lib/browser/parseDate.js +10 -10
- package/lib/browser/promiseUtils.js +19 -19
- package/lib/browser/unique.js +4 -4
- package/lib/browser/unsavedChildren.js +20 -21
- package/lib/browser/uuid.js +2 -4
- package/lib/node/Analytics.js +2 -6
- package/lib/node/AnonymousUtils.js +7 -12
- package/lib/node/Cloud.js +8 -8
- package/lib/node/CoreManager.js +59 -67
- package/lib/node/CryptoController.js +8 -3
- package/lib/node/EventEmitter.js +7 -1
- package/lib/node/EventuallyQueue.js +17 -36
- package/lib/node/FacebookUtils.js +1 -5
- package/lib/node/IndexedDBStorageController.js +14 -10
- package/lib/node/InstallationController.js +9 -10
- package/lib/node/LiveQueryClient.js +12 -14
- package/lib/node/LiveQuerySubscription.js +3 -4
- package/lib/node/LocalDatastore.js +20 -20
- package/lib/node/LocalDatastoreController.default.js +8 -9
- package/lib/node/LocalDatastoreController.js +14 -1
- package/lib/node/LocalDatastoreController.react-native.js +25 -21
- package/lib/node/LocalDatastoreUtils.js +4 -7
- package/lib/node/ObjectStateMutations.js +9 -19
- package/lib/node/OfflineQuery.js +37 -23
- package/lib/node/Parse.js +33 -47
- package/lib/node/ParseACL.js +18 -27
- package/lib/node/ParseCLP.js +35 -37
- package/lib/node/ParseConfig.js +7 -14
- package/lib/node/ParseError.js +457 -458
- package/lib/node/ParseFile.js +24 -44
- package/lib/node/ParseGeoPoint.js +16 -17
- package/lib/node/ParseHooks.js +13 -15
- package/lib/node/ParseInstallation.js +7 -8
- package/lib/node/ParseLiveQuery.js +6 -11
- package/lib/node/ParseObject.js +139 -170
- package/lib/node/ParseOp.js +32 -44
- package/lib/node/ParsePolygon.js +11 -17
- package/lib/node/ParseQuery.js +97 -120
- package/lib/node/ParseRelation.js +7 -16
- package/lib/node/ParseRole.js +7 -8
- package/lib/node/ParseSchema.js +26 -39
- package/lib/node/ParseSession.js +7 -8
- package/lib/node/ParseUser.js +73 -84
- package/lib/node/Push.js +4 -9
- package/lib/node/RESTController.js +21 -33
- package/lib/node/SingleInstanceStateController.js +41 -69
- package/lib/node/Socket.weapp.js +23 -2
- package/lib/node/Storage.js +11 -16
- package/lib/node/StorageController.browser.js +10 -8
- package/lib/node/StorageController.default.js +9 -9
- package/lib/node/StorageController.js +16 -1
- package/lib/node/StorageController.react-native.js +17 -17
- package/lib/node/StorageController.weapp.js +14 -8
- package/lib/node/TaskQueue.js +2 -3
- package/lib/node/UniqueInstanceStateController.js +40 -60
- package/lib/node/WebSocketController.js +15 -2
- package/lib/node/Xhr.weapp.js +11 -2
- package/lib/node/arrayContainsObject.js +1 -1
- package/lib/node/canBeSerialized.js +2 -2
- package/lib/node/decode.js +1 -1
- package/lib/node/encode.js +2 -2
- package/lib/node/equals.js +1 -1
- package/lib/node/escape.js +1 -1
- package/lib/node/isRevocableSession.js +1 -1
- package/lib/node/parseDate.js +1 -1
- package/lib/node/promiseUtils.js +7 -7
- package/lib/node/unique.js +2 -2
- package/lib/node/unsavedChildren.js +2 -2
- package/lib/node/uuid.js +2 -4
- package/lib/react-native/Analytics.js +2 -2
- package/lib/react-native/AnonymousUtils.js +3 -4
- package/lib/react-native/CoreManager.js +2 -3
- package/lib/react-native/CryptoController.js +6 -1
- package/lib/react-native/EventEmitter.js +6 -1
- package/lib/react-native/EventuallyQueue.js +1 -2
- package/lib/react-native/FacebookUtils.js +1 -2
- package/lib/react-native/IndexedDBStorageController.js +11 -5
- package/lib/react-native/InstallationController.js +1 -2
- package/lib/react-native/LiveQueryClient.js +2 -4
- package/lib/react-native/LiveQuerySubscription.js +2 -4
- package/lib/react-native/LocalDatastore.js +3 -3
- package/lib/react-native/LocalDatastoreController.default.js +1 -2
- package/lib/react-native/LocalDatastoreController.js +11 -1
- package/lib/react-native/LocalDatastoreController.react-native.js +11 -12
- package/lib/react-native/LocalDatastoreUtils.js +3 -6
- package/lib/react-native/OfflineQuery.js +25 -20
- package/lib/react-native/Parse.js +24 -38
- package/lib/react-native/ParseACL.js +4 -6
- package/lib/react-native/ParseCLP.js +2 -4
- package/lib/react-native/ParseConfig.js +4 -6
- package/lib/react-native/ParseError.js +13 -31
- package/lib/react-native/ParseFile.js +3 -4
- package/lib/react-native/ParseGeoPoint.js +2 -4
- package/lib/react-native/ParseInstallation.js +13 -30
- package/lib/react-native/ParseLiveQuery.js +2 -4
- package/lib/react-native/ParseObject.js +77 -87
- package/lib/react-native/ParseOp.js +41 -79
- package/lib/react-native/ParsePolygon.js +2 -4
- package/lib/react-native/ParseQuery.js +43 -45
- package/lib/react-native/ParseRelation.js +2 -4
- package/lib/react-native/ParseRole.js +13 -30
- package/lib/react-native/ParseSchema.js +3 -5
- package/lib/react-native/ParseSession.js +12 -29
- package/lib/react-native/ParseUser.js +24 -49
- package/lib/react-native/RESTController.js +10 -4
- package/lib/react-native/SingleInstanceStateController.js +23 -37
- package/lib/react-native/Socket.weapp.js +9 -4
- package/lib/react-native/Storage.js +1 -2
- package/lib/react-native/StorageController.browser.js +6 -1
- package/lib/react-native/StorageController.default.js +6 -1
- package/lib/react-native/StorageController.js +13 -1
- package/lib/react-native/StorageController.react-native.js +11 -6
- package/lib/react-native/StorageController.weapp.js +6 -1
- package/lib/react-native/TaskQueue.js +2 -4
- package/lib/react-native/UniqueInstanceStateController.js +23 -37
- package/lib/react-native/WebSocketController.js +9 -1
- package/lib/react-native/Xhr.weapp.js +9 -4
- package/lib/react-native/unsavedChildren.js +3 -3
- package/lib/react-native/uuid.js +1 -2
- package/lib/weapp/Analytics.js +7 -11
- package/lib/weapp/AnonymousUtils.js +17 -22
- package/lib/weapp/Cloud.js +23 -41
- package/lib/weapp/CoreManager.js +71 -79
- package/lib/weapp/CryptoController.js +14 -9
- package/lib/weapp/EventEmitter.js +9 -2
- package/lib/weapp/EventuallyQueue.js +156 -357
- package/lib/weapp/FacebookUtils.js +23 -28
- package/lib/weapp/IndexedDBStorageController.js +18 -14
- package/lib/weapp/InstallationController.js +55 -121
- package/lib/weapp/LiveQueryClient.js +308 -484
- package/lib/weapp/LiveQuerySubscription.js +25 -28
- package/lib/weapp/LocalDatastore.js +258 -624
- package/lib/weapp/LocalDatastoreController.default.js +42 -226
- package/lib/weapp/LocalDatastoreController.js +11 -1
- package/lib/weapp/LocalDatastoreController.react-native.js +66 -160
- package/lib/weapp/LocalDatastoreUtils.js +4 -7
- package/lib/weapp/ObjectStateMutations.js +54 -96
- package/lib/weapp/OfflineQuery.js +106 -198
- package/lib/weapp/Parse.js +44 -59
- package/lib/weapp/ParseACL.js +242 -288
- package/lib/weapp/ParseCLP.js +372 -572
- package/lib/weapp/ParseConfig.js +115 -138
- package/lib/weapp/ParseError.js +85 -182
- package/lib/weapp/ParseFile.js +295 -440
- package/lib/weapp/ParseGeoPoint.js +121 -146
- package/lib/weapp/ParseHooks.js +23 -25
- package/lib/weapp/ParseInstallation.js +225 -367
- package/lib/weapp/ParseLiveQuery.js +74 -148
- package/lib/weapp/ParseObject.js +2014 -2621
- package/lib/weapp/ParseOp.js +343 -484
- package/lib/weapp/ParsePolygon.js +101 -120
- package/lib/weapp/ParseQuery.js +1708 -2052
- package/lib/weapp/ParseRelation.js +99 -118
- package/lib/weapp/ParseRole.js +88 -140
- package/lib/weapp/ParseSchema.js +372 -434
- package/lib/weapp/ParseSession.js +62 -110
- package/lib/weapp/ParseUser.js +941 -1284
- package/lib/weapp/Push.js +15 -38
- package/lib/weapp/RESTController.js +86 -125
- package/lib/weapp/SingleInstanceStateController.js +57 -86
- package/lib/weapp/Socket.weapp.js +50 -33
- package/lib/weapp/Storage.js +23 -28
- package/lib/weapp/StorageController.browser.js +16 -13
- package/lib/weapp/StorageController.default.js +15 -14
- package/lib/weapp/StorageController.js +14 -1
- package/lib/weapp/StorageController.react-native.js +31 -30
- package/lib/weapp/StorageController.weapp.js +19 -13
- package/lib/weapp/TaskQueue.js +31 -43
- package/lib/weapp/UniqueInstanceStateController.js +65 -86
- package/lib/weapp/WebSocketController.js +11 -4
- package/lib/weapp/Xhr.weapp.js +90 -78
- package/lib/weapp/arrayContainsObject.js +3 -3
- package/lib/weapp/canBeSerialized.js +10 -11
- package/lib/weapp/decode.js +11 -11
- package/lib/weapp/encode.js +11 -11
- package/lib/weapp/equals.js +9 -10
- package/lib/weapp/escape.js +2 -2
- package/lib/weapp/isRevocableSession.js +1 -1
- package/lib/weapp/parseDate.js +10 -10
- package/lib/weapp/promiseUtils.js +19 -19
- package/lib/weapp/unique.js +4 -4
- package/lib/weapp/unsavedChildren.js +20 -21
- package/lib/weapp/uuid.js +6 -8
- package/package.json +19 -25
package/lib/weapp/CoreManager.js
CHANGED
|
@@ -7,17 +7,9 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
10
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
11
10
|
/** Based on https://github.com/react-native-async-storage/async-storage/blob/main/packages/default-storage-backend/src/types.ts */
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
onmessage: (message: any) => void,
|
|
15
|
-
onclose: (arg?: any) => void,
|
|
16
|
-
onerror: (error: any) => void,
|
|
17
|
-
send: (data: any) => void,
|
|
18
|
-
close: () => void,
|
|
19
|
-
};*/
|
|
20
|
-
var config /*: Config & { [key: string]: any }*/ = {
|
|
11
|
+
|
|
12
|
+
const config = {
|
|
21
13
|
IS_NODE: typeof process !== 'undefined' && !!process.versions && !!process.versions.node && !process.versions.electron,
|
|
22
14
|
REQUEST_ATTEMPT_LIMIT: 5,
|
|
23
15
|
REQUEST_BATCH_SIZE: 20,
|
|
@@ -27,7 +19,7 @@ var config /*: Config & { [key: string]: any }*/ = {
|
|
|
27
19
|
SERVER_AUTH_TOKEN: null,
|
|
28
20
|
LIVEQUERY_SERVER_URL: null,
|
|
29
21
|
ENCRYPTED_KEY: null,
|
|
30
|
-
VERSION: 'js' + "5.2.0-alpha.
|
|
22
|
+
VERSION: 'js' + "5.2.0-alpha.2",
|
|
31
23
|
APPLICATION_ID: null,
|
|
32
24
|
JAVASCRIPT_KEY: null,
|
|
33
25
|
MASTER_KEY: null,
|
|
@@ -39,141 +31,142 @@ var config /*: Config & { [key: string]: any }*/ = {
|
|
|
39
31
|
ALLOW_CUSTOM_OBJECT_ID: false,
|
|
40
32
|
PARSE_ERRORS: []
|
|
41
33
|
};
|
|
42
|
-
function requireMethods(name
|
|
43
|
-
(0, _forEach.default)(methods).call(methods,
|
|
34
|
+
function requireMethods(name, methods, controller) {
|
|
35
|
+
(0, _forEach.default)(methods).call(methods, func => {
|
|
44
36
|
if (typeof controller[func] !== 'function') {
|
|
45
|
-
|
|
46
|
-
throw new Error((0, _concat.default)(_context = "".concat(name, " must implement ")).call(_context, func, "()"));
|
|
37
|
+
throw new Error(`${name} must implement ${func}()`);
|
|
47
38
|
}
|
|
48
39
|
});
|
|
49
40
|
}
|
|
50
|
-
|
|
51
|
-
get: function (key
|
|
41
|
+
const CoreManager = {
|
|
42
|
+
get: function (key) {
|
|
52
43
|
if (config.hasOwnProperty(key)) {
|
|
53
44
|
return config[key];
|
|
54
45
|
}
|
|
55
46
|
throw new Error('Configuration key not found: ' + key);
|
|
56
47
|
},
|
|
57
|
-
set: function (key
|
|
48
|
+
set: function (key, value) {
|
|
58
49
|
config[key] = value;
|
|
59
50
|
},
|
|
60
|
-
setIfNeeded: function (key
|
|
51
|
+
setIfNeeded: function (key, value) {
|
|
61
52
|
if (!config.hasOwnProperty(key)) {
|
|
62
53
|
config[key] = value;
|
|
63
54
|
}
|
|
64
55
|
return config[key];
|
|
65
56
|
},
|
|
66
|
-
/* Specialized Controller Setters/Getters */
|
|
57
|
+
/* Specialized Controller Setters/Getters */
|
|
58
|
+
|
|
59
|
+
setAnalyticsController(controller) {
|
|
67
60
|
requireMethods('AnalyticsController', ['track'], controller);
|
|
68
61
|
config['AnalyticsController'] = controller;
|
|
69
62
|
},
|
|
70
|
-
getAnalyticsController
|
|
63
|
+
getAnalyticsController() {
|
|
71
64
|
return config['AnalyticsController'];
|
|
72
65
|
},
|
|
73
|
-
setCloudController
|
|
66
|
+
setCloudController(controller) {
|
|
74
67
|
requireMethods('CloudController', ['run', 'getJobsData', 'startJob'], controller);
|
|
75
68
|
config['CloudController'] = controller;
|
|
76
69
|
},
|
|
77
|
-
getCloudController
|
|
70
|
+
getCloudController() {
|
|
78
71
|
return config['CloudController'];
|
|
79
72
|
},
|
|
80
|
-
setConfigController
|
|
73
|
+
setConfigController(controller) {
|
|
81
74
|
requireMethods('ConfigController', ['current', 'get', 'save'], controller);
|
|
82
75
|
config['ConfigController'] = controller;
|
|
83
76
|
},
|
|
84
|
-
getConfigController
|
|
77
|
+
getConfigController() {
|
|
85
78
|
return config['ConfigController'];
|
|
86
79
|
},
|
|
87
|
-
setCryptoController
|
|
80
|
+
setCryptoController(controller) {
|
|
88
81
|
requireMethods('CryptoController', ['encrypt', 'decrypt'], controller);
|
|
89
82
|
config['CryptoController'] = controller;
|
|
90
83
|
},
|
|
91
|
-
getCryptoController
|
|
84
|
+
getCryptoController() {
|
|
92
85
|
return config['CryptoController'];
|
|
93
86
|
},
|
|
94
|
-
setEventEmitter
|
|
87
|
+
setEventEmitter(eventEmitter) {
|
|
95
88
|
config['EventEmitter'] = eventEmitter;
|
|
96
89
|
},
|
|
97
|
-
getEventEmitter
|
|
90
|
+
getEventEmitter() {
|
|
98
91
|
return config['EventEmitter'];
|
|
99
92
|
},
|
|
100
|
-
setFileController
|
|
93
|
+
setFileController(controller) {
|
|
101
94
|
requireMethods('FileController', ['saveFile', 'saveBase64'], controller);
|
|
102
95
|
config['FileController'] = controller;
|
|
103
96
|
},
|
|
104
|
-
setEventuallyQueue
|
|
97
|
+
setEventuallyQueue(controller) {
|
|
105
98
|
requireMethods('EventuallyQueue', ['poll', 'save', 'destroy'], controller);
|
|
106
99
|
config['EventuallyQueue'] = controller;
|
|
107
100
|
},
|
|
108
|
-
getEventuallyQueue
|
|
101
|
+
getEventuallyQueue() {
|
|
109
102
|
return config['EventuallyQueue'];
|
|
110
103
|
},
|
|
111
|
-
getFileController
|
|
104
|
+
getFileController() {
|
|
112
105
|
return config['FileController'];
|
|
113
106
|
},
|
|
114
|
-
setInstallationController
|
|
107
|
+
setInstallationController(controller) {
|
|
115
108
|
requireMethods('InstallationController', ['currentInstallationId', 'currentInstallation', 'updateInstallationOnDisk'], controller);
|
|
116
109
|
config['InstallationController'] = controller;
|
|
117
110
|
},
|
|
118
|
-
getInstallationController
|
|
111
|
+
getInstallationController() {
|
|
119
112
|
return config['InstallationController'];
|
|
120
113
|
},
|
|
121
|
-
setLiveQuery
|
|
114
|
+
setLiveQuery(liveQuery) {
|
|
122
115
|
config['LiveQuery'] = liveQuery;
|
|
123
116
|
},
|
|
124
|
-
getLiveQuery
|
|
117
|
+
getLiveQuery() {
|
|
125
118
|
return config['LiveQuery'];
|
|
126
119
|
},
|
|
127
|
-
setObjectController
|
|
120
|
+
setObjectController(controller) {
|
|
128
121
|
requireMethods('ObjectController', ['save', 'fetch', 'destroy'], controller);
|
|
129
122
|
config['ObjectController'] = controller;
|
|
130
123
|
},
|
|
131
|
-
getObjectController
|
|
124
|
+
getObjectController() {
|
|
132
125
|
return config['ObjectController'];
|
|
133
126
|
},
|
|
134
|
-
setObjectStateController
|
|
127
|
+
setObjectStateController(controller) {
|
|
135
128
|
requireMethods('ObjectStateController', ['getState', 'initializeState', 'removeState', 'getServerData', 'setServerData', 'getPendingOps', 'setPendingOp', 'pushPendingState', 'popPendingState', 'mergeFirstPendingState', 'getObjectCache', 'estimateAttribute', 'estimateAttributes', 'commitServerChanges', 'enqueueTask', 'clearAllState'], controller);
|
|
136
129
|
config['ObjectStateController'] = controller;
|
|
137
130
|
},
|
|
138
|
-
getObjectStateController
|
|
131
|
+
getObjectStateController() {
|
|
139
132
|
return config['ObjectStateController'];
|
|
140
133
|
},
|
|
141
|
-
setPushController
|
|
134
|
+
setPushController(controller) {
|
|
142
135
|
requireMethods('PushController', ['send'], controller);
|
|
143
136
|
config['PushController'] = controller;
|
|
144
137
|
},
|
|
145
|
-
getPushController
|
|
138
|
+
getPushController() {
|
|
146
139
|
return config['PushController'];
|
|
147
140
|
},
|
|
148
|
-
setQueryController
|
|
141
|
+
setQueryController(controller) {
|
|
149
142
|
requireMethods('QueryController', ['find', 'aggregate'], controller);
|
|
150
143
|
config['QueryController'] = controller;
|
|
151
144
|
},
|
|
152
|
-
getQueryController
|
|
145
|
+
getQueryController() {
|
|
153
146
|
return config['QueryController'];
|
|
154
147
|
},
|
|
155
|
-
setRESTController
|
|
148
|
+
setRESTController(controller) {
|
|
156
149
|
requireMethods('RESTController', ['request', 'ajax'], controller);
|
|
157
150
|
config['RESTController'] = controller;
|
|
158
151
|
},
|
|
159
|
-
getRESTController
|
|
152
|
+
getRESTController() {
|
|
160
153
|
return config['RESTController'];
|
|
161
154
|
},
|
|
162
|
-
setSchemaController
|
|
155
|
+
setSchemaController(controller) {
|
|
163
156
|
requireMethods('SchemaController', ['get', 'create', 'update', 'delete', 'send', 'purge'], controller);
|
|
164
157
|
config['SchemaController'] = controller;
|
|
165
158
|
},
|
|
166
|
-
getSchemaController
|
|
159
|
+
getSchemaController() {
|
|
167
160
|
return config['SchemaController'];
|
|
168
161
|
},
|
|
169
|
-
setSessionController
|
|
162
|
+
setSessionController(controller) {
|
|
170
163
|
requireMethods('SessionController', ['getSession'], controller);
|
|
171
164
|
config['SessionController'] = controller;
|
|
172
165
|
},
|
|
173
|
-
getSessionController
|
|
166
|
+
getSessionController() {
|
|
174
167
|
return config['SessionController'];
|
|
175
168
|
},
|
|
176
|
-
setStorageController
|
|
169
|
+
setStorageController(controller) {
|
|
177
170
|
if (controller.async) {
|
|
178
171
|
requireMethods('An async StorageController', ['getItemAsync', 'setItemAsync', 'removeItemAsync', 'getAllKeysAsync'], controller);
|
|
179
172
|
} else {
|
|
@@ -181,86 +174,85 @@ var CoreManager = {
|
|
|
181
174
|
}
|
|
182
175
|
config['StorageController'] = controller;
|
|
183
176
|
},
|
|
184
|
-
setLocalDatastoreController
|
|
177
|
+
setLocalDatastoreController(controller) {
|
|
185
178
|
requireMethods('LocalDatastoreController', ['pinWithName', 'fromPinWithName', 'unPinWithName', 'getAllContents', 'clear'], controller);
|
|
186
179
|
config['LocalDatastoreController'] = controller;
|
|
187
180
|
},
|
|
188
|
-
getLocalDatastoreController
|
|
181
|
+
getLocalDatastoreController() {
|
|
189
182
|
return config['LocalDatastoreController'];
|
|
190
183
|
},
|
|
191
|
-
setLocalDatastore
|
|
184
|
+
setLocalDatastore(store) {
|
|
192
185
|
config['LocalDatastore'] = store;
|
|
193
186
|
},
|
|
194
|
-
getLocalDatastore
|
|
187
|
+
getLocalDatastore() {
|
|
195
188
|
return config['LocalDatastore'];
|
|
196
189
|
},
|
|
197
|
-
getStorageController
|
|
190
|
+
getStorageController() {
|
|
198
191
|
return config['StorageController'];
|
|
199
192
|
},
|
|
200
|
-
setAsyncStorage
|
|
193
|
+
setAsyncStorage(storage) {
|
|
201
194
|
config['AsyncStorage'] = storage;
|
|
202
195
|
},
|
|
203
|
-
getAsyncStorage
|
|
196
|
+
getAsyncStorage() {
|
|
204
197
|
return config['AsyncStorage'];
|
|
205
198
|
},
|
|
206
|
-
setWebSocketController
|
|
199
|
+
setWebSocketController(controller) {
|
|
207
200
|
config['WebSocketController'] = controller;
|
|
208
201
|
},
|
|
209
|
-
getWebSocketController
|
|
202
|
+
getWebSocketController() {
|
|
210
203
|
return config['WebSocketController'];
|
|
211
204
|
},
|
|
212
|
-
setUserController
|
|
205
|
+
setUserController(controller) {
|
|
213
206
|
requireMethods('UserController', ['setCurrentUser', 'currentUser', 'currentUserAsync', 'signUp', 'logIn', 'become', 'logOut', 'me', 'requestPasswordReset', 'upgradeToRevocableSession', 'requestEmailVerification', 'verifyPassword', 'linkWith'], controller);
|
|
214
207
|
config['UserController'] = controller;
|
|
215
208
|
},
|
|
216
|
-
getUserController
|
|
209
|
+
getUserController() {
|
|
217
210
|
return config['UserController'];
|
|
218
211
|
},
|
|
219
|
-
setLiveQueryController
|
|
212
|
+
setLiveQueryController(controller) {
|
|
220
213
|
requireMethods('LiveQueryController', ['setDefaultLiveQueryClient', 'getDefaultLiveQueryClient', '_clearCachedDefaultClient'], controller);
|
|
221
214
|
config['LiveQueryController'] = controller;
|
|
222
215
|
},
|
|
223
|
-
getLiveQueryController
|
|
216
|
+
getLiveQueryController() {
|
|
224
217
|
return config['LiveQueryController'];
|
|
225
218
|
},
|
|
226
|
-
setHooksController
|
|
219
|
+
setHooksController(controller) {
|
|
227
220
|
requireMethods('HooksController', ['create', 'get', 'update', 'remove'], controller);
|
|
228
221
|
config['HooksController'] = controller;
|
|
229
222
|
},
|
|
230
|
-
getHooksController
|
|
223
|
+
getHooksController() {
|
|
231
224
|
return config['HooksController'];
|
|
232
225
|
},
|
|
233
|
-
setParseOp
|
|
226
|
+
setParseOp(op) {
|
|
234
227
|
config['ParseOp'] = op;
|
|
235
228
|
},
|
|
236
|
-
getParseOp
|
|
229
|
+
getParseOp() {
|
|
237
230
|
return config['ParseOp'];
|
|
238
231
|
},
|
|
239
|
-
setParseObject
|
|
232
|
+
setParseObject(object) {
|
|
240
233
|
config['ParseObject'] = object;
|
|
241
234
|
},
|
|
242
|
-
getParseObject
|
|
235
|
+
getParseObject() {
|
|
243
236
|
return config['ParseObject'];
|
|
244
237
|
},
|
|
245
|
-
setParseQuery
|
|
238
|
+
setParseQuery(query) {
|
|
246
239
|
config['ParseQuery'] = query;
|
|
247
240
|
},
|
|
248
|
-
getParseQuery
|
|
241
|
+
getParseQuery() {
|
|
249
242
|
return config['ParseQuery'];
|
|
250
243
|
},
|
|
251
|
-
setParseRole
|
|
244
|
+
setParseRole(role) {
|
|
252
245
|
config['ParseRole'] = role;
|
|
253
246
|
},
|
|
254
|
-
getParseRole
|
|
247
|
+
getParseRole() {
|
|
255
248
|
return config['ParseRole'];
|
|
256
249
|
},
|
|
257
|
-
setParseUser
|
|
250
|
+
setParseUser(user) {
|
|
258
251
|
config['ParseUser'] = user;
|
|
259
252
|
},
|
|
260
|
-
getParseUser
|
|
253
|
+
getParseUser() {
|
|
261
254
|
return config['ParseUser'];
|
|
262
255
|
}
|
|
263
256
|
};
|
|
264
257
|
module.exports = CoreManager;
|
|
265
|
-
var _default = CoreManager;
|
|
266
|
-
exports.default = _default;
|
|
258
|
+
var _default = exports.default = CoreManager;
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
4
9
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
|
|
5
|
-
|
|
6
|
-
|
|
10
|
+
let AES;
|
|
11
|
+
let ENC;
|
|
7
12
|
AES = require('crypto-js/aes');
|
|
8
13
|
ENC = require('crypto-js/enc-utf8');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var encrypted = AES.encrypt((0, _stringify.default)(obj), secretKey);
|
|
14
|
+
const CryptoController = {
|
|
15
|
+
encrypt(obj, secretKey) {
|
|
16
|
+
const encrypted = AES.encrypt((0, _stringify.default)(obj), secretKey);
|
|
13
17
|
return encrypted.toString();
|
|
14
18
|
},
|
|
15
|
-
decrypt
|
|
16
|
-
|
|
19
|
+
decrypt(encryptedText, secretKey) {
|
|
20
|
+
const decryptedStr = AES.decrypt(encryptedText, secretKey).toString(ENC);
|
|
17
21
|
return decryptedStr;
|
|
18
22
|
}
|
|
19
23
|
};
|
|
20
|
-
module.exports = CryptoController;
|
|
24
|
+
module.exports = CryptoController;
|
|
25
|
+
var _default = exports.default = CryptoController;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
4
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
3
8
|
/**
|
|
4
9
|
* This is a simple wrapper to unify EventEmitter implementations across platforms.
|
|
5
10
|
*/
|
|
6
|
-
|
|
11
|
+
|
|
12
|
+
let EventEmitter;
|
|
7
13
|
try {
|
|
8
14
|
EventEmitter = require('events').EventEmitter;
|
|
9
15
|
} catch (_) {
|
|
10
16
|
// EventEmitter unavailable
|
|
11
17
|
}
|
|
12
|
-
module.exports = EventEmitter;
|
|
18
|
+
module.exports = EventEmitter;
|
|
19
|
+
var _default = exports.default = EventEmitter;
|