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
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
const StorageController = {
|
|
8
8
|
async: 0,
|
|
9
|
-
getItem(path
|
|
9
|
+
getItem(path) {
|
|
10
|
+
// @ts-ignore
|
|
10
11
|
return wx.getStorageSync(path);
|
|
11
12
|
},
|
|
12
|
-
setItem(path
|
|
13
|
+
setItem(path, value) {
|
|
13
14
|
try {
|
|
15
|
+
// @ts-ignore
|
|
14
16
|
wx.setStorageSync(path, value);
|
|
15
17
|
} catch (e) {
|
|
16
18
|
// Quota exceeded
|
|
17
19
|
}
|
|
18
20
|
},
|
|
19
|
-
removeItem(path
|
|
21
|
+
removeItem(path) {
|
|
22
|
+
// @ts-ignore
|
|
20
23
|
wx.removeStorageSync(path);
|
|
21
24
|
},
|
|
22
25
|
getAllKeys() {
|
|
26
|
+
// @ts-ignore
|
|
23
27
|
const res = wx.getStorageInfoSync();
|
|
24
28
|
return res.keys;
|
|
25
29
|
},
|
|
26
30
|
clear() {
|
|
31
|
+
// @ts-ignore
|
|
27
32
|
wx.clearStorageSync();
|
|
28
33
|
}
|
|
29
34
|
};
|
|
30
|
-
module.exports = StorageController;
|
|
35
|
+
module.exports = StorageController;
|
|
36
|
+
var _default = exports.default = StorageController;
|
package/lib/node/TaskQueue.js
CHANGED
|
@@ -9,7 +9,7 @@ class TaskQueue {
|
|
|
9
9
|
constructor() {
|
|
10
10
|
this.queue = [];
|
|
11
11
|
}
|
|
12
|
-
enqueue(task
|
|
12
|
+
enqueue(task) {
|
|
13
13
|
const taskComplete = (0, _promiseUtils.resolvingPromise)();
|
|
14
14
|
this.queue.push({
|
|
15
15
|
task: task,
|
|
@@ -41,5 +41,4 @@ class TaskQueue {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
module.exports = TaskQueue;
|
|
44
|
-
var _default = TaskQueue;
|
|
45
|
-
exports.default = _default;
|
|
44
|
+
var _default = exports.default = TaskQueue;
|
|
@@ -27,57 +27,37 @@ function _interopRequireDefault(obj) {
|
|
|
27
27
|
default: obj
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
function _getRequireWildcardCache(
|
|
31
|
-
if (typeof WeakMap
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
return (_getRequireWildcardCache = function (
|
|
35
|
-
return
|
|
36
|
-
})(
|
|
37
|
-
}
|
|
38
|
-
function _interopRequireWildcard(
|
|
39
|
-
if (!
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
53
|
-
for (var key in obj) {
|
|
54
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
55
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
56
|
-
if (desc && (desc.get || desc.set)) {
|
|
57
|
-
Object.defineProperty(newObj, key, desc);
|
|
58
|
-
} else {
|
|
59
|
-
newObj[key] = obj[key];
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
newObj.default = obj;
|
|
64
|
-
if (cache) {
|
|
65
|
-
cache.set(obj, newObj);
|
|
30
|
+
function _getRequireWildcardCache(e) {
|
|
31
|
+
if ("function" != typeof WeakMap) return null;
|
|
32
|
+
var r = new WeakMap(),
|
|
33
|
+
t = new WeakMap();
|
|
34
|
+
return (_getRequireWildcardCache = function (e) {
|
|
35
|
+
return e ? t : r;
|
|
36
|
+
})(e);
|
|
37
|
+
}
|
|
38
|
+
function _interopRequireWildcard(e, r) {
|
|
39
|
+
if (!r && e && e.__esModule) return e;
|
|
40
|
+
if (null === e || "object" != typeof e && "function" != typeof e) return {
|
|
41
|
+
default: e
|
|
42
|
+
};
|
|
43
|
+
var t = _getRequireWildcardCache(r);
|
|
44
|
+
if (t && t.has(e)) return t.get(e);
|
|
45
|
+
var n = {
|
|
46
|
+
__proto__: null
|
|
47
|
+
},
|
|
48
|
+
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
49
|
+
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
50
|
+
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
51
|
+
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
|
|
66
52
|
}
|
|
67
|
-
return
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* @flow
|
|
71
|
-
*/
|
|
72
|
-
/*:: import type { Op } from './ParseOp';*/
|
|
73
|
-
/*:: import type ParseObject from './ParseObject';*/
|
|
74
|
-
/*:: import type { AttributeMap, ObjectCache, OpsMap, State } from './ObjectStateMutations';*/
|
|
53
|
+
return n.default = e, t && t.set(e, n), n;
|
|
54
|
+
}
|
|
75
55
|
let objectState = new WeakMap();
|
|
76
|
-
function getState(obj
|
|
56
|
+
function getState(obj) {
|
|
77
57
|
const classData = objectState.get(obj);
|
|
78
58
|
return classData || null;
|
|
79
59
|
}
|
|
80
|
-
function initializeState(obj
|
|
60
|
+
function initializeState(obj, initial) {
|
|
81
61
|
let state = getState(obj);
|
|
82
62
|
if (state) {
|
|
83
63
|
return state;
|
|
@@ -95,7 +75,7 @@ function initializeState(obj /*: ParseObject*/, initial /*:: ?: State*/) /*: Sta
|
|
|
95
75
|
objectState.set(obj, state);
|
|
96
76
|
return state;
|
|
97
77
|
}
|
|
98
|
-
function removeState(obj
|
|
78
|
+
function removeState(obj) {
|
|
99
79
|
const state = getState(obj);
|
|
100
80
|
if (state === null) {
|
|
101
81
|
return null;
|
|
@@ -103,66 +83,66 @@ function removeState(obj /*: ParseObject*/) /*: ?State*/{
|
|
|
103
83
|
objectState.delete(obj);
|
|
104
84
|
return state;
|
|
105
85
|
}
|
|
106
|
-
function getServerData(obj
|
|
86
|
+
function getServerData(obj) {
|
|
107
87
|
const state = getState(obj);
|
|
108
88
|
if (state) {
|
|
109
89
|
return state.serverData;
|
|
110
90
|
}
|
|
111
91
|
return {};
|
|
112
92
|
}
|
|
113
|
-
function setServerData(obj
|
|
93
|
+
function setServerData(obj, attributes) {
|
|
114
94
|
const serverData = initializeState(obj).serverData;
|
|
115
95
|
ObjectStateMutations.setServerData(serverData, attributes);
|
|
116
96
|
}
|
|
117
|
-
function getPendingOps(obj
|
|
97
|
+
function getPendingOps(obj) {
|
|
118
98
|
const state = getState(obj);
|
|
119
99
|
if (state) {
|
|
120
100
|
return state.pendingOps;
|
|
121
101
|
}
|
|
122
102
|
return [{}];
|
|
123
103
|
}
|
|
124
|
-
function setPendingOp(obj
|
|
104
|
+
function setPendingOp(obj, attr, op) {
|
|
125
105
|
const pendingOps = initializeState(obj).pendingOps;
|
|
126
106
|
ObjectStateMutations.setPendingOp(pendingOps, attr, op);
|
|
127
107
|
}
|
|
128
|
-
function pushPendingState(obj
|
|
108
|
+
function pushPendingState(obj) {
|
|
129
109
|
const pendingOps = initializeState(obj).pendingOps;
|
|
130
110
|
ObjectStateMutations.pushPendingState(pendingOps);
|
|
131
111
|
}
|
|
132
|
-
function popPendingState(obj
|
|
112
|
+
function popPendingState(obj) {
|
|
133
113
|
const pendingOps = initializeState(obj).pendingOps;
|
|
134
114
|
return ObjectStateMutations.popPendingState(pendingOps);
|
|
135
115
|
}
|
|
136
|
-
function mergeFirstPendingState(obj
|
|
116
|
+
function mergeFirstPendingState(obj) {
|
|
137
117
|
const pendingOps = getPendingOps(obj);
|
|
138
118
|
ObjectStateMutations.mergeFirstPendingState(pendingOps);
|
|
139
119
|
}
|
|
140
|
-
function getObjectCache(obj
|
|
120
|
+
function getObjectCache(obj) {
|
|
141
121
|
const state = getState(obj);
|
|
142
122
|
if (state) {
|
|
143
123
|
return state.objectCache;
|
|
144
124
|
}
|
|
145
125
|
return {};
|
|
146
126
|
}
|
|
147
|
-
function estimateAttribute(obj
|
|
127
|
+
function estimateAttribute(obj, attr) {
|
|
148
128
|
const serverData = getServerData(obj);
|
|
149
129
|
const pendingOps = getPendingOps(obj);
|
|
150
130
|
return ObjectStateMutations.estimateAttribute(serverData, pendingOps, obj, attr);
|
|
151
131
|
}
|
|
152
|
-
function estimateAttributes(obj
|
|
132
|
+
function estimateAttributes(obj) {
|
|
153
133
|
const serverData = getServerData(obj);
|
|
154
134
|
const pendingOps = getPendingOps(obj);
|
|
155
135
|
return ObjectStateMutations.estimateAttributes(serverData, pendingOps, obj);
|
|
156
136
|
}
|
|
157
|
-
function commitServerChanges(obj
|
|
137
|
+
function commitServerChanges(obj, changes) {
|
|
158
138
|
const state = initializeState(obj);
|
|
159
139
|
ObjectStateMutations.commitServerChanges(state.serverData, state.objectCache, changes);
|
|
160
140
|
}
|
|
161
|
-
function enqueueTask(obj
|
|
141
|
+
function enqueueTask(obj, task) {
|
|
162
142
|
const state = initializeState(obj);
|
|
163
143
|
return state.tasks.enqueue(task);
|
|
164
144
|
}
|
|
165
|
-
function duplicateState(source
|
|
145
|
+
function duplicateState(source, dest) {
|
|
166
146
|
const oldState = initializeState(source);
|
|
167
147
|
const newState = initializeState(dest);
|
|
168
148
|
for (const key in oldState.serverData) {
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _ws = _interopRequireDefault(require("ws"));
|
|
8
|
+
var _Socket = _interopRequireDefault(require("./Socket.weapp"));
|
|
9
|
+
function _interopRequireDefault(obj) {
|
|
10
|
+
return obj && obj.__esModule ? obj : {
|
|
11
|
+
default: obj
|
|
12
|
+
};
|
|
13
|
+
}
|
|
3
14
|
/* global WebSocket */
|
|
15
|
+
|
|
4
16
|
let WebSocketController;
|
|
5
17
|
try {
|
|
6
|
-
WebSocketController =
|
|
18
|
+
WebSocketController = _ws.default;
|
|
7
19
|
} catch (_) {
|
|
8
20
|
// WebSocket unavailable
|
|
9
21
|
}
|
|
10
|
-
module.exports = WebSocketController;
|
|
22
|
+
module.exports = WebSocketController;
|
|
23
|
+
var _default = exports.default = WebSocketController;
|
package/lib/node/Xhr.weapp.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
class XhrWeapp {
|
|
4
8
|
constructor() {
|
|
5
9
|
this.UNSENT = 0;
|
|
6
10
|
this.OPENED = 1;
|
|
@@ -50,6 +54,7 @@ module.exports = class {
|
|
|
50
54
|
this.onreadystatechange();
|
|
51
55
|
}
|
|
52
56
|
send(data) {
|
|
57
|
+
// @ts-ignore
|
|
53
58
|
this.requestTask = wx.request({
|
|
54
59
|
url: this.url,
|
|
55
60
|
method: this.method,
|
|
@@ -66,6 +71,7 @@ module.exports = class {
|
|
|
66
71
|
},
|
|
67
72
|
fail: err => {
|
|
68
73
|
this.requestTask = null;
|
|
74
|
+
// @ts-ignore
|
|
69
75
|
this.onerror(err);
|
|
70
76
|
}
|
|
71
77
|
});
|
|
@@ -75,7 +81,10 @@ module.exports = class {
|
|
|
75
81
|
loaded: res.totalBytesWritten,
|
|
76
82
|
total: res.totalBytesExpectedToWrite
|
|
77
83
|
};
|
|
84
|
+
// @ts-ignore
|
|
78
85
|
this.onprogress(event);
|
|
79
86
|
});
|
|
80
87
|
}
|
|
81
|
-
}
|
|
88
|
+
}
|
|
89
|
+
module.exports = XhrWeapp;
|
|
90
|
+
var _default = exports.default = XhrWeapp;
|
|
@@ -10,7 +10,7 @@ function _interopRequireDefault(obj) {
|
|
|
10
10
|
default: obj
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
function arrayContainsObject(array
|
|
13
|
+
function arrayContainsObject(array, object) {
|
|
14
14
|
if (array.indexOf(object) > -1) {
|
|
15
15
|
return true;
|
|
16
16
|
}
|
|
@@ -12,7 +12,7 @@ function _interopRequireDefault(obj) {
|
|
|
12
12
|
default: obj
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
function canBeSerialized(obj
|
|
15
|
+
function canBeSerialized(obj) {
|
|
16
16
|
const ParseObject = _CoreManager.default.getParseObject();
|
|
17
17
|
if (!(obj instanceof ParseObject)) {
|
|
18
18
|
return true;
|
|
@@ -26,7 +26,7 @@ function canBeSerialized(obj /*: ParseObject*/) /*: boolean*/{
|
|
|
26
26
|
}
|
|
27
27
|
return true;
|
|
28
28
|
}
|
|
29
|
-
function canBeSerializedHelper(value
|
|
29
|
+
function canBeSerializedHelper(value) {
|
|
30
30
|
if (typeof value !== 'object') {
|
|
31
31
|
return true;
|
|
32
32
|
}
|
package/lib/node/decode.js
CHANGED
package/lib/node/encode.js
CHANGED
|
@@ -15,7 +15,7 @@ function _interopRequireDefault(obj) {
|
|
|
15
15
|
default: obj
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function encode(value
|
|
18
|
+
function encode(value, disallowObjects, forcePointers, seen, offline) {
|
|
19
19
|
const ParseObject = _CoreManager.default.getParseObject();
|
|
20
20
|
if (value instanceof ParseObject) {
|
|
21
21
|
if (disallowObjects) {
|
|
@@ -69,6 +69,6 @@ function encode(value /*: any*/, disallowObjects /*: boolean*/, forcePointers /*
|
|
|
69
69
|
}
|
|
70
70
|
return value;
|
|
71
71
|
}
|
|
72
|
-
function _default(value
|
|
72
|
+
function _default(value, disallowObjects, forcePointers, seen, offline) {
|
|
73
73
|
return encode(value, !!disallowObjects, !!forcePointers, seen || [], offline);
|
|
74
74
|
}
|
package/lib/node/equals.js
CHANGED
|
@@ -13,7 +13,7 @@ function _interopRequireDefault(obj) {
|
|
|
13
13
|
default: obj
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
function equals(a
|
|
16
|
+
function equals(a, b) {
|
|
17
17
|
const toString = Object.prototype.toString;
|
|
18
18
|
if (toString.call(a) === '[object Date]' || toString.call(b) === '[object Date]') {
|
|
19
19
|
const dateA = new Date(a);
|
package/lib/node/escape.js
CHANGED
package/lib/node/parseDate.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = parseDate;
|
|
7
|
-
function parseDate(iso8601
|
|
7
|
+
function parseDate(iso8601) {
|
|
8
8
|
const regexp = new RegExp('^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2})' + 'T' + '([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})' + '(.([0-9]+))?' + 'Z$');
|
|
9
9
|
const match = regexp.exec(iso8601);
|
|
10
10
|
if (!match) {
|
package/lib/node/promiseUtils.js
CHANGED
|
@@ -7,19 +7,19 @@ exports.continueWhile = continueWhile;
|
|
|
7
7
|
exports.resolvingPromise = resolvingPromise;
|
|
8
8
|
exports.when = when;
|
|
9
9
|
// Create Deferred Promise
|
|
10
|
-
function resolvingPromise
|
|
11
|
-
let res
|
|
12
|
-
let rej
|
|
10
|
+
function resolvingPromise() {
|
|
11
|
+
let res;
|
|
12
|
+
let rej;
|
|
13
13
|
const promise = new Promise((resolve, reject) => {
|
|
14
14
|
res = resolve;
|
|
15
15
|
rej = reject;
|
|
16
16
|
});
|
|
17
|
-
const defer
|
|
17
|
+
const defer = promise;
|
|
18
18
|
defer.resolve = res;
|
|
19
19
|
defer.reject = rej;
|
|
20
20
|
return defer;
|
|
21
21
|
}
|
|
22
|
-
function when(promises
|
|
22
|
+
function when(promises) {
|
|
23
23
|
let objects;
|
|
24
24
|
const arrayArgument = Array.isArray(promises);
|
|
25
25
|
if (arrayArgument) {
|
|
@@ -48,7 +48,7 @@ function when(promises /*: any*/) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
const chain = function (object
|
|
51
|
+
const chain = function (object, index) {
|
|
52
52
|
if (object && typeof object.then === 'function') {
|
|
53
53
|
object.then(function (result) {
|
|
54
54
|
results[index] = result;
|
|
@@ -68,7 +68,7 @@ function when(promises /*: any*/) {
|
|
|
68
68
|
}
|
|
69
69
|
return promise;
|
|
70
70
|
}
|
|
71
|
-
function continueWhile(test
|
|
71
|
+
function continueWhile(test, emitter) {
|
|
72
72
|
if (test()) {
|
|
73
73
|
return emitter().then(() => {
|
|
74
74
|
return continueWhile(test, emitter);
|
package/lib/node/unique.js
CHANGED
|
@@ -11,8 +11,8 @@ function _interopRequireDefault(obj) {
|
|
|
11
11
|
default: obj
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
function unique
|
|
15
|
-
const uniques
|
|
14
|
+
function unique(arr) {
|
|
15
|
+
const uniques = [];
|
|
16
16
|
arr.forEach(value => {
|
|
17
17
|
const ParseObject = _CoreManager.default.getParseObject();
|
|
18
18
|
if (value instanceof ParseObject) {
|
|
@@ -20,7 +20,7 @@ function _interopRequireDefault(obj) {
|
|
|
20
20
|
* @param {boolean} allowDeepUnsaved
|
|
21
21
|
* @returns {Array}
|
|
22
22
|
*/
|
|
23
|
-
function unsavedChildren(obj
|
|
23
|
+
function unsavedChildren(obj, allowDeepUnsaved) {
|
|
24
24
|
const encountered = {
|
|
25
25
|
objects: {},
|
|
26
26
|
files: []
|
|
@@ -41,7 +41,7 @@ function unsavedChildren(obj /*: ParseObject*/, allowDeepUnsaved /*:: ?: boolean
|
|
|
41
41
|
}
|
|
42
42
|
return unsaved.concat(encountered.files);
|
|
43
43
|
}
|
|
44
|
-
function traverse(obj
|
|
44
|
+
function traverse(obj, encountered, shouldThrow, allowDeepUnsaved) {
|
|
45
45
|
const ParseObject = _CoreManager.default.getParseObject();
|
|
46
46
|
if (obj instanceof ParseObject) {
|
|
47
47
|
if (!obj.id && shouldThrow) {
|
package/lib/node/uuid.js
CHANGED
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _uuid = require("uuid");
|
|
8
|
-
let uuid = _uuid.v4
|
|
9
|
-
|
|
8
|
+
let uuid = _uuid.v4;
|
|
10
9
|
module.exports = uuid;
|
|
11
|
-
var _default = uuid;
|
|
12
|
-
exports.default = _default;
|
|
10
|
+
var _default = exports.default = uuid;
|
|
@@ -11,8 +11,8 @@ function track(name, dimensions) {
|
|
|
11
11
|
if (name.length === 0) {
|
|
12
12
|
throw new TypeError('A name for the custom event must be provided');
|
|
13
13
|
}
|
|
14
|
-
for (var
|
|
15
|
-
if (typeof
|
|
14
|
+
for (var key in dimensions) {
|
|
15
|
+
if (typeof key !== 'string' || typeof dimensions[key] !== 'string') {
|
|
16
16
|
throw new TypeError('track() dimensions expects keys and values of type "string".');
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
exports.default = void 0;
|
|
6
6
|
var _ParseUser = _interopRequireDefault(require("./ParseUser"));
|
|
7
|
-
var
|
|
7
|
+
var _uuid = _interopRequireDefault(require("./uuid"));
|
|
8
8
|
var registered = false;
|
|
9
9
|
var AnonymousUtils = {
|
|
10
10
|
isLinked: function (user) {
|
|
@@ -33,7 +33,7 @@ var AnonymousUtils = {
|
|
|
33
33
|
getAuthData: function () {
|
|
34
34
|
return {
|
|
35
35
|
authData: {
|
|
36
|
-
id:
|
|
36
|
+
id: (0, _uuid.default)()
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
}
|
|
@@ -45,5 +45,4 @@ var AnonymousUtils = {
|
|
|
45
45
|
return provider;
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
var _default = AnonymousUtils;
|
|
49
|
-
exports.default = _default;
|
|
48
|
+
var _default = exports.default = AnonymousUtils;
|
|
@@ -12,7 +12,7 @@ var config = {
|
|
|
12
12
|
SERVER_AUTH_TOKEN: null,
|
|
13
13
|
LIVEQUERY_SERVER_URL: null,
|
|
14
14
|
ENCRYPTED_KEY: null,
|
|
15
|
-
VERSION: 'js' + "5.2.0-alpha.
|
|
15
|
+
VERSION: 'js' + "5.2.0-alpha.2",
|
|
16
16
|
APPLICATION_ID: null,
|
|
17
17
|
JAVASCRIPT_KEY: null,
|
|
18
18
|
MASTER_KEY: null,
|
|
@@ -246,5 +246,4 @@ var CoreManager = {
|
|
|
246
246
|
}
|
|
247
247
|
};
|
|
248
248
|
module.exports = CoreManager;
|
|
249
|
-
var _default = CoreManager;
|
|
250
|
-
exports.default = _default;
|
|
249
|
+
var _default = exports.default = CoreManager;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.default = void 0;
|
|
1
5
|
var AES;
|
|
2
6
|
var ENC;
|
|
3
7
|
var CryptoJS = require('react-native-crypto-js');
|
|
@@ -13,4 +17,5 @@ var CryptoController = {
|
|
|
13
17
|
return decryptedStr;
|
|
14
18
|
}
|
|
15
19
|
};
|
|
16
|
-
module.exports = CryptoController;
|
|
20
|
+
module.exports = CryptoController;
|
|
21
|
+
var _default = exports.default = CryptoController;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.default = void 0;
|
|
1
5
|
var EventEmitter;
|
|
2
6
|
try {
|
|
3
7
|
EventEmitter = require('react-native/Libraries/vendor/emitter/EventEmitter');
|
|
@@ -6,4 +10,5 @@ try {
|
|
|
6
10
|
}
|
|
7
11
|
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
|
|
8
12
|
} catch (_) {}
|
|
9
|
-
module.exports = EventEmitter;
|
|
13
|
+
module.exports = EventEmitter;
|
|
14
|
+
var _default = exports.default = EventEmitter;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.default = void 0;
|
|
1
5
|
var _idbKeyval = require("idb-keyval");
|
|
6
|
+
var IndexedDBStorageController;
|
|
2
7
|
if (typeof window !== 'undefined' && window.indexedDB) {
|
|
3
8
|
try {
|
|
4
9
|
var ParseStore = (0, _idbKeyval.createStore)('parseDB', 'parseStore');
|
|
5
|
-
|
|
10
|
+
IndexedDBStorageController = {
|
|
6
11
|
async: 1,
|
|
7
12
|
getItemAsync: function (path) {
|
|
8
13
|
return (0, _idbKeyval.get)(path, ParseStore);
|
|
@@ -20,10 +25,11 @@ if (typeof window !== 'undefined' && window.indexedDB) {
|
|
|
20
25
|
return (0, _idbKeyval.clear)(ParseStore);
|
|
21
26
|
}
|
|
22
27
|
};
|
|
23
|
-
module.exports = IndexedDBStorageController;
|
|
24
28
|
} catch (_) {
|
|
25
|
-
|
|
29
|
+
IndexedDBStorageController = undefined;
|
|
26
30
|
}
|
|
27
31
|
} else {
|
|
28
|
-
|
|
29
|
-
}
|
|
32
|
+
IndexedDBStorageController = undefined;
|
|
33
|
+
}
|
|
34
|
+
module.exports = IndexedDBStorageController;
|
|
35
|
+
var _default = exports.default = IndexedDBStorageController;
|
|
@@ -95,7 +95,7 @@ var LiveQueryClient = function () {
|
|
|
95
95
|
};
|
|
96
96
|
this.on('error', function () {});
|
|
97
97
|
}
|
|
98
|
-
(0, _createClass2.default)(LiveQueryClient, [{
|
|
98
|
+
return (0, _createClass2.default)(LiveQueryClient, [{
|
|
99
99
|
key: "shouldOpen",
|
|
100
100
|
value: function () {
|
|
101
101
|
return this.state === CLIENT_STATE.INITIALIZED || this.state === CLIENT_STATE.DISCONNECTED;
|
|
@@ -407,7 +407,5 @@ var LiveQueryClient = function () {
|
|
|
407
407
|
}.bind(this), time);
|
|
408
408
|
}
|
|
409
409
|
}]);
|
|
410
|
-
return LiveQueryClient;
|
|
411
410
|
}();
|
|
412
|
-
var _default = LiveQueryClient;
|
|
413
|
-
exports.default = _default;
|
|
411
|
+
var _default = exports.default = LiveQueryClient;
|
|
@@ -31,7 +31,7 @@ var Subscription = function () {
|
|
|
31
31
|
};
|
|
32
32
|
this.on('error', function () {});
|
|
33
33
|
}
|
|
34
|
-
(0, _createClass2.default)(Subscription, [{
|
|
34
|
+
return (0, _createClass2.default)(Subscription, [{
|
|
35
35
|
key: "unsubscribe",
|
|
36
36
|
value: function () {
|
|
37
37
|
var _this2 = this;
|
|
@@ -41,7 +41,5 @@ var Subscription = function () {
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
}]);
|
|
44
|
-
return Subscription;
|
|
45
44
|
}();
|
|
46
|
-
var _default = Subscription;
|
|
47
|
-
exports.default = _default;
|
|
45
|
+
var _default = exports.default = Subscription;
|