parse 3.5.1 → 4.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +167 -25
- package/NOTICE +10 -0
- package/README.md +20 -7
- package/dist/parse.js +12838 -21190
- package/dist/parse.min.js +7 -6
- package/dist/parse.weapp.js +7921 -17062
- package/dist/parse.weapp.min.js +7 -6
- package/lib/browser/Analytics.js +2 -27
- package/lib/browser/AnonymousUtils.js +6 -42
- package/lib/browser/Cloud.js +12 -77
- package/lib/browser/CloudCode.js +0 -3
- package/lib/browser/CoreManager.js +46 -191
- package/lib/browser/CryptoController.js +2 -16
- package/lib/browser/EventEmitter.js +1 -8
- package/lib/browser/EventuallyQueue.js +277 -824
- package/lib/browser/FacebookUtils.js +6 -42
- package/lib/browser/IndexedDBStorageController.js +3 -14
- package/lib/browser/InstallationController.js +2 -20
- package/lib/browser/LiveQueryClient.js +105 -213
- package/lib/browser/LiveQuerySubscription.js +10 -39
- package/lib/browser/LocalDatastore.js +451 -1081
- package/lib/browser/LocalDatastoreController.js +145 -602
- package/lib/browser/LocalDatastoreController.react-native.js +137 -573
- package/lib/browser/LocalDatastoreUtils.js +2 -19
- package/lib/browser/ObjectStateMutations.js +18 -121
- package/lib/browser/OfflineQuery.js +61 -222
- package/lib/browser/Parse.js +12 -115
- package/lib/browser/ParseACL.js +33 -148
- package/lib/browser/ParseCLP.js +96 -314
- package/lib/browser/ParseConfig.js +18 -95
- package/lib/browser/ParseError.js +63 -99
- package/lib/browser/ParseFile.js +128 -685
- package/lib/browser/ParseGeoPoint.js +23 -89
- package/lib/browser/ParseHooks.js +1 -34
- package/lib/browser/ParseInstallation.js +4 -32
- package/lib/browser/ParseLiveQuery.js +96 -505
- package/lib/browser/ParseObject.js +665 -1845
- package/lib/browser/ParseOp.js +41 -287
- package/lib/browser/ParsePolygon.js +13 -70
- package/lib/browser/ParseQuery.js +403 -1504
- package/lib/browser/ParseRelation.js +12 -68
- package/lib/browser/ParseRole.js +13 -75
- package/lib/browser/ParseSchema.js +49 -208
- package/lib/browser/ParseSession.js +11 -69
- package/lib/browser/ParseUser.js +274 -1127
- package/lib/browser/Push.js +7 -50
- package/lib/browser/RESTController.js +28 -157
- package/lib/browser/SingleInstanceStateController.js +19 -144
- package/lib/browser/Socket.weapp.js +0 -10
- package/lib/browser/Storage.js +10 -80
- package/lib/browser/StorageController.browser.js +4 -24
- package/lib/browser/StorageController.default.js +4 -24
- package/lib/browser/StorageController.react-native.js +6 -40
- package/lib/browser/StorageController.weapp.js +5 -23
- package/lib/browser/TaskQueue.js +1 -29
- package/lib/browser/UniqueInstanceStateController.js +19 -149
- package/lib/browser/Xhr.weapp.js +0 -17
- package/lib/browser/arrayContainsObject.js +2 -23
- package/lib/browser/canBeSerialized.js +3 -40
- package/lib/browser/decode.js +3 -40
- package/lib/browser/encode.js +9 -77
- package/lib/browser/equals.js +2 -34
- package/lib/browser/escape.js +1 -15
- package/lib/browser/isRevocableSession.js +2 -18
- package/lib/browser/parseDate.js +2 -20
- package/lib/browser/promiseUtils.js +3 -21
- package/lib/browser/unique.js +3 -24
- package/lib/browser/unsavedChildren.js +6 -57
- package/lib/browser/uuid.js +3 -1
- package/lib/node/Analytics.js +1 -25
- package/lib/node/AnonymousUtils.js +5 -44
- package/lib/node/Cloud.js +10 -73
- package/lib/node/CloudCode.js +0 -3
- package/lib/node/CoreManager.js +47 -227
- package/lib/node/CryptoController.js +2 -16
- package/lib/node/EventEmitter.js +1 -8
- package/lib/node/EventuallyQueue.js +16 -123
- package/lib/node/FacebookUtils.js +5 -44
- package/lib/node/IndexedDBStorageController.js +3 -19
- package/lib/node/InstallationController.js +2 -22
- package/lib/node/LiveQueryClient.js +72 -154
- package/lib/node/LiveQuerySubscription.js +7 -26
- package/lib/node/LocalDatastore.js +19 -182
- package/lib/node/LocalDatastoreController.js +6 -45
- package/lib/node/LocalDatastoreController.react-native.js +6 -52
- package/lib/node/LocalDatastoreUtils.js +1 -13
- package/lib/node/ObjectStateMutations.js +18 -134
- package/lib/node/OfflineQuery.js +27 -151
- package/lib/node/Parse.js +11 -108
- package/lib/node/ParseACL.js +32 -157
- package/lib/node/ParseCLP.js +73 -302
- package/lib/node/ParseConfig.js +16 -91
- package/lib/node/ParseError.js +61 -74
- package/lib/node/ParseFile.js +55 -244
- package/lib/node/ParseGeoPoint.js +21 -89
- package/lib/node/ParseHooks.js +0 -35
- package/lib/node/ParseInstallation.js +1 -17
- package/lib/node/ParseLiveQuery.js +10 -43
- package/lib/node/ParseObject.js +234 -997
- package/lib/node/ParseOp.js +31 -262
- package/lib/node/ParsePolygon.js +12 -69
- package/lib/node/ParseQuery.js +169 -888
- package/lib/node/ParseRelation.js +11 -68
- package/lib/node/ParseRole.js +10 -64
- package/lib/node/ParseSchema.js +46 -229
- package/lib/node/ParseSession.js +8 -57
- package/lib/node/ParseUser.js +107 -583
- package/lib/node/Push.js +4 -44
- package/lib/node/RESTController.js +19 -169
- package/lib/node/SingleInstanceStateController.js +17 -137
- package/lib/node/Socket.weapp.js +0 -7
- package/lib/node/Storage.js +10 -90
- package/lib/node/StorageController.browser.js +4 -30
- package/lib/node/StorageController.default.js +5 -28
- package/lib/node/StorageController.react-native.js +6 -47
- package/lib/node/StorageController.weapp.js +6 -28
- package/lib/node/TaskQueue.js +1 -24
- package/lib/node/UniqueInstanceStateController.js +16 -140
- package/lib/node/Xhr.weapp.js +0 -15
- package/lib/node/arrayContainsObject.js +1 -19
- package/lib/node/canBeSerialized.js +2 -35
- package/lib/node/decode.js +1 -33
- package/lib/node/encode.js +3 -61
- package/lib/node/equals.js +0 -27
- package/lib/node/escape.js +1 -13
- package/lib/node/isRevocableSession.js +1 -12
- package/lib/node/parseDate.js +1 -14
- package/lib/node/promiseUtils.js +2 -14
- package/lib/node/unique.js +1 -18
- package/lib/node/unsavedChildren.js +2 -45
- package/lib/node/uuid.js +6 -1
- package/lib/react-native/Analytics.js +0 -9
- package/lib/react-native/AnonymousUtils.js +0 -10
- package/lib/react-native/Cloud.js +0 -26
- package/lib/react-native/CoreManager.js +2 -6
- package/lib/react-native/CryptoController.js +0 -2
- package/lib/react-native/EventEmitter.js +0 -2
- package/lib/react-native/EventuallyQueue.js +156 -711
- package/lib/react-native/FacebookUtils.js +0 -22
- package/lib/react-native/IndexedDBStorageController.js +0 -1
- package/lib/react-native/InstallationController.js +0 -6
- package/lib/react-native/LiveQueryClient.js +46 -157
- package/lib/react-native/LiveQuerySubscription.js +3 -27
- package/lib/react-native/LocalDatastore.js +281 -948
- package/lib/react-native/LocalDatastoreController.js +71 -552
- package/lib/react-native/LocalDatastoreController.react-native.js +91 -526
- package/lib/react-native/LocalDatastoreUtils.js +0 -1
- package/lib/react-native/ObjectStateMutations.js +2 -65
- package/lib/react-native/OfflineQuery.js +25 -196
- package/lib/react-native/Parse.js +0 -65
- package/lib/react-native/ParseACL.js +0 -44
- package/lib/react-native/ParseCLP.js +23 -161
- package/lib/react-native/ParseConfig.js +0 -42
- package/lib/react-native/ParseError.js +1 -21
- package/lib/react-native/ParseFile.js +55 -529
- package/lib/react-native/ParseGeoPoint.js +0 -17
- package/lib/react-native/ParseHooks.js +0 -30
- package/lib/react-native/ParseInstallation.js +1 -23
- package/lib/react-native/ParseLiveQuery.js +55 -472
- package/lib/react-native/ParseObject.js +245 -1246
- package/lib/react-native/ParseOp.js +1 -138
- package/lib/react-native/ParsePolygon.js +0 -24
- package/lib/react-native/ParseQuery.js +182 -874
- package/lib/react-native/ParseRelation.js +0 -25
- package/lib/react-native/ParseRole.js +1 -36
- package/lib/react-native/ParseSchema.js +3 -54
- package/lib/react-native/ParseSession.js +1 -40
- package/lib/react-native/ParseUser.js +95 -773
- package/lib/react-native/Push.js +0 -16
- package/lib/react-native/RESTController.js +12 -109
- package/lib/react-native/SingleInstanceStateController.js +0 -44
- package/lib/react-native/Socket.weapp.js +0 -10
- package/lib/react-native/Storage.js +0 -24
- package/lib/react-native/StorageController.browser.js +0 -2
- package/lib/react-native/StorageController.default.js +0 -1
- package/lib/react-native/StorageController.react-native.js +0 -2
- package/lib/react-native/TaskQueue.js +0 -15
- package/lib/react-native/UniqueInstanceStateController.js +0 -47
- package/lib/react-native/Xhr.weapp.js +0 -16
- package/lib/react-native/arrayContainsObject.js +0 -5
- package/lib/react-native/canBeSerialized.js +0 -18
- package/lib/react-native/decode.js +0 -21
- package/lib/react-native/encode.js +0 -25
- package/lib/react-native/equals.js +0 -18
- package/lib/react-native/escape.js +0 -1
- package/lib/react-native/isRevocableSession.js +0 -1
- package/lib/react-native/parseDate.js +0 -3
- package/lib/react-native/promiseUtils.js +0 -13
- package/lib/react-native/unique.js +0 -4
- package/lib/react-native/unsavedChildren.js +0 -21
- package/lib/react-native/uuid.js +3 -1
- package/lib/weapp/Analytics.js +2 -27
- package/lib/weapp/AnonymousUtils.js +6 -42
- package/lib/weapp/Cloud.js +12 -77
- package/lib/weapp/CloudCode.js +0 -3
- package/lib/weapp/CoreManager.js +46 -191
- package/lib/weapp/CryptoController.js +2 -16
- package/lib/weapp/EventEmitter.js +1 -8
- package/lib/weapp/EventuallyQueue.js +277 -824
- package/lib/weapp/FacebookUtils.js +6 -42
- package/lib/weapp/IndexedDBStorageController.js +3 -14
- package/lib/weapp/InstallationController.js +2 -20
- package/lib/weapp/LiveQueryClient.js +105 -213
- package/lib/weapp/LiveQuerySubscription.js +10 -39
- package/lib/weapp/LocalDatastore.js +451 -1081
- package/lib/weapp/LocalDatastoreController.js +145 -602
- package/lib/weapp/LocalDatastoreController.react-native.js +137 -573
- package/lib/weapp/LocalDatastoreUtils.js +2 -19
- package/lib/weapp/ObjectStateMutations.js +18 -121
- package/lib/weapp/OfflineQuery.js +61 -222
- package/lib/weapp/Parse.js +12 -115
- package/lib/weapp/ParseACL.js +33 -148
- package/lib/weapp/ParseCLP.js +96 -314
- package/lib/weapp/ParseConfig.js +18 -95
- package/lib/weapp/ParseError.js +63 -99
- package/lib/weapp/ParseFile.js +129 -686
- package/lib/weapp/ParseGeoPoint.js +23 -89
- package/lib/weapp/ParseHooks.js +1 -34
- package/lib/weapp/ParseInstallation.js +4 -32
- package/lib/weapp/ParseLiveQuery.js +96 -505
- package/lib/weapp/ParseObject.js +665 -1845
- package/lib/weapp/ParseOp.js +41 -287
- package/lib/weapp/ParsePolygon.js +13 -70
- package/lib/weapp/ParseQuery.js +403 -1504
- package/lib/weapp/ParseRelation.js +12 -68
- package/lib/weapp/ParseRole.js +13 -75
- package/lib/weapp/ParseSchema.js +49 -208
- package/lib/weapp/ParseSession.js +11 -69
- package/lib/weapp/ParseUser.js +274 -1127
- package/lib/weapp/Push.js +7 -50
- package/lib/weapp/RESTController.js +28 -157
- package/lib/weapp/SingleInstanceStateController.js +19 -144
- package/lib/weapp/Socket.weapp.js +0 -10
- package/lib/weapp/Storage.js +10 -80
- package/lib/weapp/StorageController.browser.js +4 -24
- package/lib/weapp/StorageController.default.js +4 -24
- package/lib/weapp/StorageController.react-native.js +6 -40
- package/lib/weapp/StorageController.weapp.js +5 -23
- package/lib/weapp/TaskQueue.js +1 -29
- package/lib/weapp/UniqueInstanceStateController.js +19 -149
- package/lib/weapp/Xhr.weapp.js +0 -17
- package/lib/weapp/arrayContainsObject.js +2 -23
- package/lib/weapp/canBeSerialized.js +3 -40
- package/lib/weapp/decode.js +3 -40
- package/lib/weapp/encode.js +9 -77
- package/lib/weapp/equals.js +2 -34
- package/lib/weapp/escape.js +1 -15
- package/lib/weapp/isRevocableSession.js +2 -18
- package/lib/weapp/parseDate.js +2 -20
- package/lib/weapp/promiseUtils.js +3 -21
- package/lib/weapp/unique.js +3 -24
- package/lib/weapp/unsavedChildren.js +6 -57
- package/lib/weapp/uuid.js +1 -6
- package/package.json +37 -30
- package/PATENTS +0 -37
|
@@ -1,417 +1,25 @@
|
|
|
1
1
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
3
|
value: true
|
|
5
4
|
});
|
|
6
5
|
exports.default = void 0;
|
|
7
|
-
|
|
8
6
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
-
|
|
7
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
8
|
var _EventEmitter = _interopRequireDefault(require("./EventEmitter"));
|
|
11
|
-
|
|
12
9
|
var _LiveQueryClient = _interopRequireDefault(require("./LiveQueryClient"));
|
|
13
|
-
|
|
14
10
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
15
|
-
|
|
16
|
-
function _regeneratorRuntime() {
|
|
17
|
-
"use strict";
|
|
18
|
-
|
|
19
|
-
_regeneratorRuntime = function () {
|
|
20
|
-
return exports;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
var exports = {},
|
|
24
|
-
Op = Object.prototype,
|
|
25
|
-
hasOwn = Op.hasOwnProperty,
|
|
26
|
-
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
27
|
-
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
28
|
-
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
29
|
-
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
30
|
-
|
|
31
|
-
function define(obj, key, value) {
|
|
32
|
-
return Object.defineProperty(obj, key, {
|
|
33
|
-
value: value,
|
|
34
|
-
enumerable: !0,
|
|
35
|
-
configurable: !0,
|
|
36
|
-
writable: !0
|
|
37
|
-
}), obj[key];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
try {
|
|
41
|
-
define({}, "");
|
|
42
|
-
} catch (err) {
|
|
43
|
-
define = function (obj, key, value) {
|
|
44
|
-
return obj[key] = value;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
49
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
50
|
-
generator = Object.create(protoGenerator.prototype),
|
|
51
|
-
context = new Context(tryLocsList || []);
|
|
52
|
-
return generator._invoke = function (innerFn, self, context) {
|
|
53
|
-
var state = "suspendedStart";
|
|
54
|
-
return function (method, arg) {
|
|
55
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
56
|
-
|
|
57
|
-
if ("completed" === state) {
|
|
58
|
-
if ("throw" === method) throw arg;
|
|
59
|
-
return doneResult();
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
for (context.method = method, context.arg = arg;;) {
|
|
63
|
-
var delegate = context.delegate;
|
|
64
|
-
|
|
65
|
-
if (delegate) {
|
|
66
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
67
|
-
|
|
68
|
-
if (delegateResult) {
|
|
69
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
70
|
-
return delegateResult;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
75
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
76
|
-
context.dispatchException(context.arg);
|
|
77
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
78
|
-
state = "executing";
|
|
79
|
-
var record = tryCatch(innerFn, self, context);
|
|
80
|
-
|
|
81
|
-
if ("normal" === record.type) {
|
|
82
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
83
|
-
return {
|
|
84
|
-
value: record.arg,
|
|
85
|
-
done: context.done
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}(innerFn, self, context), generator;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function tryCatch(fn, obj, arg) {
|
|
96
|
-
try {
|
|
97
|
-
return {
|
|
98
|
-
type: "normal",
|
|
99
|
-
arg: fn.call(obj, arg)
|
|
100
|
-
};
|
|
101
|
-
} catch (err) {
|
|
102
|
-
return {
|
|
103
|
-
type: "throw",
|
|
104
|
-
arg: err
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
exports.wrap = wrap;
|
|
110
|
-
var ContinueSentinel = {};
|
|
111
|
-
|
|
112
|
-
function Generator() {}
|
|
113
|
-
|
|
114
|
-
function GeneratorFunction() {}
|
|
115
|
-
|
|
116
|
-
function GeneratorFunctionPrototype() {}
|
|
117
|
-
|
|
118
|
-
var IteratorPrototype = {};
|
|
119
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
120
|
-
return this;
|
|
121
|
-
});
|
|
122
|
-
var getProto = Object.getPrototypeOf,
|
|
123
|
-
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
124
|
-
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
125
|
-
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
126
|
-
|
|
127
|
-
function defineIteratorMethods(prototype) {
|
|
128
|
-
["next", "throw", "return"].forEach(function (method) {
|
|
129
|
-
define(prototype, method, function (arg) {
|
|
130
|
-
return this._invoke(method, arg);
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
136
|
-
function invoke(method, arg, resolve, reject) {
|
|
137
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
138
|
-
|
|
139
|
-
if ("throw" !== record.type) {
|
|
140
|
-
var result = record.arg,
|
|
141
|
-
value = result.value;
|
|
142
|
-
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
143
|
-
invoke("next", value, resolve, reject);
|
|
144
|
-
}, function (err) {
|
|
145
|
-
invoke("throw", err, resolve, reject);
|
|
146
|
-
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
147
|
-
result.value = unwrapped, resolve(result);
|
|
148
|
-
}, function (error) {
|
|
149
|
-
return invoke("throw", error, resolve, reject);
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
reject(record.arg);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
var previousPromise;
|
|
157
|
-
|
|
158
|
-
this._invoke = function (method, arg) {
|
|
159
|
-
function callInvokeWithMethodAndArg() {
|
|
160
|
-
return new PromiseImpl(function (resolve, reject) {
|
|
161
|
-
invoke(method, arg, resolve, reject);
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
170
|
-
var method = delegate.iterator[context.method];
|
|
171
|
-
|
|
172
|
-
if (undefined === method) {
|
|
173
|
-
if (context.delegate = null, "throw" === context.method) {
|
|
174
|
-
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
175
|
-
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
return ContinueSentinel;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
182
|
-
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
183
|
-
var info = record.arg;
|
|
184
|
-
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
function pushTryEntry(locs) {
|
|
188
|
-
var entry = {
|
|
189
|
-
tryLoc: locs[0]
|
|
190
|
-
};
|
|
191
|
-
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function resetTryEntry(entry) {
|
|
195
|
-
var record = entry.completion || {};
|
|
196
|
-
record.type = "normal", delete record.arg, entry.completion = record;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
function Context(tryLocsList) {
|
|
200
|
-
this.tryEntries = [{
|
|
201
|
-
tryLoc: "root"
|
|
202
|
-
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
function values(iterable) {
|
|
206
|
-
if (iterable) {
|
|
207
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
208
|
-
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
209
|
-
if ("function" == typeof iterable.next) return iterable;
|
|
210
|
-
|
|
211
|
-
if (!isNaN(iterable.length)) {
|
|
212
|
-
var i = -1,
|
|
213
|
-
next = function next() {
|
|
214
|
-
for (; ++i < iterable.length;) {
|
|
215
|
-
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
return next.value = undefined, next.done = !0, next;
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
return next.next = next;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
return {
|
|
226
|
-
next: doneResult
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function doneResult() {
|
|
231
|
-
return {
|
|
232
|
-
value: undefined,
|
|
233
|
-
done: !0
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
238
|
-
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
239
|
-
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
240
|
-
}, exports.mark = function (genFun) {
|
|
241
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
242
|
-
}, exports.awrap = function (arg) {
|
|
243
|
-
return {
|
|
244
|
-
__await: arg
|
|
245
|
-
};
|
|
246
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
247
|
-
return this;
|
|
248
|
-
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
249
|
-
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
250
|
-
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
251
|
-
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
252
|
-
return result.done ? result.value : iter.next();
|
|
253
|
-
});
|
|
254
|
-
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
255
|
-
return this;
|
|
256
|
-
}), define(Gp, "toString", function () {
|
|
257
|
-
return "[object Generator]";
|
|
258
|
-
}), exports.keys = function (object) {
|
|
259
|
-
var keys = [];
|
|
260
|
-
|
|
261
|
-
for (var key in object) {
|
|
262
|
-
keys.push(key);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
return keys.reverse(), function next() {
|
|
266
|
-
for (; keys.length;) {
|
|
267
|
-
var key = keys.pop();
|
|
268
|
-
if (key in object) return next.value = key, next.done = !1, next;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
return next.done = !0, next;
|
|
272
|
-
};
|
|
273
|
-
}, exports.values = values, Context.prototype = {
|
|
274
|
-
constructor: Context,
|
|
275
|
-
reset: function (skipTempReset) {
|
|
276
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
|
|
277
|
-
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
278
|
-
}
|
|
279
|
-
},
|
|
280
|
-
stop: function () {
|
|
281
|
-
this.done = !0;
|
|
282
|
-
var rootRecord = this.tryEntries[0].completion;
|
|
283
|
-
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
284
|
-
return this.rval;
|
|
285
|
-
},
|
|
286
|
-
dispatchException: function (exception) {
|
|
287
|
-
if (this.done) throw exception;
|
|
288
|
-
var context = this;
|
|
289
|
-
|
|
290
|
-
function handle(loc, caught) {
|
|
291
|
-
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
295
|
-
var entry = this.tryEntries[i],
|
|
296
|
-
record = entry.completion;
|
|
297
|
-
if ("root" === entry.tryLoc) return handle("end");
|
|
298
|
-
|
|
299
|
-
if (entry.tryLoc <= this.prev) {
|
|
300
|
-
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
301
|
-
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
302
|
-
|
|
303
|
-
if (hasCatch && hasFinally) {
|
|
304
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
305
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
306
|
-
} else if (hasCatch) {
|
|
307
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
308
|
-
} else {
|
|
309
|
-
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
310
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
abrupt: function (type, arg) {
|
|
316
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
317
|
-
var entry = this.tryEntries[i];
|
|
318
|
-
|
|
319
|
-
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
320
|
-
var finallyEntry = entry;
|
|
321
|
-
break;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
326
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
327
|
-
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
328
|
-
},
|
|
329
|
-
complete: function (record, afterLoc) {
|
|
330
|
-
if ("throw" === record.type) throw record.arg;
|
|
331
|
-
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
332
|
-
},
|
|
333
|
-
finish: function (finallyLoc) {
|
|
334
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
335
|
-
var entry = this.tryEntries[i];
|
|
336
|
-
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
337
|
-
}
|
|
338
|
-
},
|
|
339
|
-
catch: function (tryLoc) {
|
|
340
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
341
|
-
var entry = this.tryEntries[i];
|
|
342
|
-
|
|
343
|
-
if (entry.tryLoc === tryLoc) {
|
|
344
|
-
var record = entry.completion;
|
|
345
|
-
|
|
346
|
-
if ("throw" === record.type) {
|
|
347
|
-
var thrown = record.arg;
|
|
348
|
-
resetTryEntry(entry);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
return thrown;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
throw new Error("illegal catch attempt");
|
|
356
|
-
},
|
|
357
|
-
delegateYield: function (iterable, resultName, nextLoc) {
|
|
358
|
-
return this.delegate = {
|
|
359
|
-
iterator: values(iterable),
|
|
360
|
-
resultName: resultName,
|
|
361
|
-
nextLoc: nextLoc
|
|
362
|
-
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
363
|
-
}
|
|
364
|
-
}, exports;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
11
|
function getLiveQueryClient() {
|
|
368
12
|
return _CoreManager.default.getLiveQueryController().getDefaultLiveQueryClient();
|
|
369
13
|
}
|
|
370
|
-
|
|
371
14
|
var LiveQuery = new _EventEmitter.default();
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
return _regeneratorRuntime().awrap(getLiveQueryClient());
|
|
381
|
-
|
|
382
|
-
case 2:
|
|
383
|
-
liveQueryClient = _context.sent;
|
|
384
|
-
liveQueryClient.open();
|
|
385
|
-
|
|
386
|
-
case 4:
|
|
387
|
-
case "end":
|
|
388
|
-
return _context.stop();
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
}, null, null, null, Promise);
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
LiveQuery.close = function () {
|
|
395
|
-
var liveQueryClient;
|
|
396
|
-
return _regeneratorRuntime().async(function (_context2) {
|
|
397
|
-
while (1) {
|
|
398
|
-
switch (_context2.prev = _context2.next) {
|
|
399
|
-
case 0:
|
|
400
|
-
_context2.next = 2;
|
|
401
|
-
return _regeneratorRuntime().awrap(getLiveQueryClient());
|
|
402
|
-
|
|
403
|
-
case 2:
|
|
404
|
-
liveQueryClient = _context2.sent;
|
|
405
|
-
liveQueryClient.close();
|
|
406
|
-
|
|
407
|
-
case 4:
|
|
408
|
-
case "end":
|
|
409
|
-
return _context2.stop();
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
}, null, null, null, Promise);
|
|
413
|
-
};
|
|
414
|
-
|
|
15
|
+
LiveQuery.open = (0, _asyncToGenerator2.default)(function* () {
|
|
16
|
+
var liveQueryClient = yield getLiveQueryClient();
|
|
17
|
+
liveQueryClient.open();
|
|
18
|
+
});
|
|
19
|
+
LiveQuery.close = (0, _asyncToGenerator2.default)(function* () {
|
|
20
|
+
var liveQueryClient = yield getLiveQueryClient();
|
|
21
|
+
liveQueryClient.close();
|
|
22
|
+
});
|
|
415
23
|
LiveQuery.on('error', function () {});
|
|
416
24
|
var _default = LiveQuery;
|
|
417
25
|
exports.default = _default;
|
|
@@ -421,80 +29,55 @@ var DefaultLiveQueryController = {
|
|
|
421
29
|
defaultLiveQueryClient = liveQueryClient;
|
|
422
30
|
},
|
|
423
31
|
getDefaultLiveQueryClient: function () {
|
|
424
|
-
var
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
while (1) {
|
|
428
|
-
switch (_context3.prev = _context3.next) {
|
|
429
|
-
case 0:
|
|
430
|
-
if (!defaultLiveQueryClient) {
|
|
431
|
-
_context3.next = 2;
|
|
432
|
-
break;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
return _context3.abrupt("return", defaultLiveQueryClient);
|
|
436
|
-
|
|
437
|
-
case 2:
|
|
438
|
-
_context3.next = 4;
|
|
439
|
-
return _regeneratorRuntime().awrap(Promise.all([_CoreManager.default.getUserController().currentUserAsync(), _CoreManager.default.getInstallationController().currentInstallationId()]));
|
|
440
|
-
|
|
441
|
-
case 4:
|
|
442
|
-
_await$Promise$all = _context3.sent;
|
|
443
|
-
_await$Promise$all2 = (0, _slicedToArray2.default)(_await$Promise$all, 2);
|
|
444
|
-
currentUser = _await$Promise$all2[0];
|
|
445
|
-
installationId = _await$Promise$all2[1];
|
|
446
|
-
sessionToken = currentUser ? currentUser.getSessionToken() : undefined;
|
|
447
|
-
liveQueryServerURL = _CoreManager.default.get('LIVEQUERY_SERVER_URL');
|
|
448
|
-
|
|
449
|
-
if (!(liveQueryServerURL && liveQueryServerURL.indexOf('ws') !== 0)) {
|
|
450
|
-
_context3.next = 12;
|
|
451
|
-
break;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
throw new Error('You need to set a proper Parse LiveQuery server url before using LiveQueryClient');
|
|
455
|
-
|
|
456
|
-
case 12:
|
|
457
|
-
if (!liveQueryServerURL) {
|
|
458
|
-
serverURL = _CoreManager.default.get('SERVER_URL');
|
|
459
|
-
protocol = serverURL.indexOf('https') === 0 ? 'wss://' : 'ws://';
|
|
460
|
-
host = serverURL.replace(/^https?:\/\//, '');
|
|
461
|
-
liveQueryServerURL = protocol + host;
|
|
462
|
-
|
|
463
|
-
_CoreManager.default.set('LIVEQUERY_SERVER_URL', liveQueryServerURL);
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
applicationId = _CoreManager.default.get('APPLICATION_ID');
|
|
467
|
-
javascriptKey = _CoreManager.default.get('JAVASCRIPT_KEY');
|
|
468
|
-
masterKey = _CoreManager.default.get('MASTER_KEY');
|
|
469
|
-
defaultLiveQueryClient = new _LiveQueryClient.default({
|
|
470
|
-
applicationId: applicationId,
|
|
471
|
-
serverURL: liveQueryServerURL,
|
|
472
|
-
javascriptKey: javascriptKey,
|
|
473
|
-
masterKey: masterKey,
|
|
474
|
-
sessionToken: sessionToken,
|
|
475
|
-
installationId: installationId
|
|
476
|
-
});
|
|
477
|
-
defaultLiveQueryClient.on('error', function (error) {
|
|
478
|
-
LiveQuery.emit('error', error);
|
|
479
|
-
});
|
|
480
|
-
defaultLiveQueryClient.on('open', function () {
|
|
481
|
-
LiveQuery.emit('open');
|
|
482
|
-
});
|
|
483
|
-
defaultLiveQueryClient.on('close', function () {
|
|
484
|
-
LiveQuery.emit('close');
|
|
485
|
-
});
|
|
486
|
-
return _context3.abrupt("return", defaultLiveQueryClient);
|
|
487
|
-
|
|
488
|
-
case 21:
|
|
489
|
-
case "end":
|
|
490
|
-
return _context3.stop();
|
|
491
|
-
}
|
|
32
|
+
var _getDefaultLiveQueryClient = (0, _asyncToGenerator2.default)(function* () {
|
|
33
|
+
if (defaultLiveQueryClient) {
|
|
34
|
+
return defaultLiveQueryClient;
|
|
492
35
|
}
|
|
493
|
-
|
|
494
|
-
|
|
36
|
+
var _yield$Promise$all = yield Promise.all([_CoreManager.default.getUserController().currentUserAsync(), _CoreManager.default.getInstallationController().currentInstallationId()]),
|
|
37
|
+
_yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 2),
|
|
38
|
+
currentUser = _yield$Promise$all2[0],
|
|
39
|
+
installationId = _yield$Promise$all2[1];
|
|
40
|
+
var sessionToken = currentUser ? currentUser.getSessionToken() : undefined;
|
|
41
|
+
var liveQueryServerURL = _CoreManager.default.get('LIVEQUERY_SERVER_URL');
|
|
42
|
+
if (liveQueryServerURL && liveQueryServerURL.indexOf('ws') !== 0) {
|
|
43
|
+
throw new Error('You need to set a proper Parse LiveQuery server url before using LiveQueryClient');
|
|
44
|
+
}
|
|
45
|
+
if (!liveQueryServerURL) {
|
|
46
|
+
var serverURL = _CoreManager.default.get('SERVER_URL');
|
|
47
|
+
var protocol = serverURL.indexOf('https') === 0 ? 'wss://' : 'ws://';
|
|
48
|
+
var host = serverURL.replace(/^https?:\/\//, '');
|
|
49
|
+
liveQueryServerURL = protocol + host;
|
|
50
|
+
_CoreManager.default.set('LIVEQUERY_SERVER_URL', liveQueryServerURL);
|
|
51
|
+
}
|
|
52
|
+
var applicationId = _CoreManager.default.get('APPLICATION_ID');
|
|
53
|
+
var javascriptKey = _CoreManager.default.get('JAVASCRIPT_KEY');
|
|
54
|
+
var masterKey = _CoreManager.default.get('MASTER_KEY');
|
|
55
|
+
defaultLiveQueryClient = new _LiveQueryClient.default({
|
|
56
|
+
applicationId: applicationId,
|
|
57
|
+
serverURL: liveQueryServerURL,
|
|
58
|
+
javascriptKey: javascriptKey,
|
|
59
|
+
masterKey: masterKey,
|
|
60
|
+
sessionToken: sessionToken,
|
|
61
|
+
installationId: installationId
|
|
62
|
+
});
|
|
63
|
+
defaultLiveQueryClient.on('error', function (error) {
|
|
64
|
+
LiveQuery.emit('error', error);
|
|
65
|
+
});
|
|
66
|
+
defaultLiveQueryClient.on('open', function () {
|
|
67
|
+
LiveQuery.emit('open');
|
|
68
|
+
});
|
|
69
|
+
defaultLiveQueryClient.on('close', function () {
|
|
70
|
+
LiveQuery.emit('close');
|
|
71
|
+
});
|
|
72
|
+
return defaultLiveQueryClient;
|
|
73
|
+
});
|
|
74
|
+
function getDefaultLiveQueryClient() {
|
|
75
|
+
return _getDefaultLiveQueryClient.apply(this, arguments);
|
|
76
|
+
}
|
|
77
|
+
return getDefaultLiveQueryClient;
|
|
78
|
+
}(),
|
|
495
79
|
_clearCachedDefaultClient: function () {
|
|
496
80
|
defaultLiveQueryClient = null;
|
|
497
81
|
}
|
|
498
82
|
};
|
|
499
|
-
|
|
500
83
|
_CoreManager.default.setLiveQueryController(DefaultLiveQueryController);
|