parse 4.0.0-alpha.6 → 4.0.0-alpha.8
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 +1 -3
- package/dist/parse.js +3991 -6551
- package/dist/parse.min.js +7 -6
- package/dist/parse.weapp.js +3152 -6482
- package/dist/parse.weapp.min.js +7 -6
- package/lib/browser/Analytics.js +4 -11
- package/lib/browser/AnonymousUtils.js +2 -9
- package/lib/browser/Cloud.js +4 -11
- package/lib/browser/CloudCode.js +0 -1
- package/lib/browser/CoreManager.js +3 -10
- package/lib/browser/EventEmitter.js +0 -7
- package/lib/browser/EventuallyQueue.js +282 -668
- package/lib/browser/FacebookUtils.js +2 -9
- package/lib/browser/InstallationController.js +0 -7
- package/lib/browser/LiveQueryClient.js +35 -26
- package/lib/browser/LiveQuerySubscription.js +5 -4
- package/lib/browser/LocalDatastore.js +472 -864
- package/lib/browser/LocalDatastoreController.js +161 -547
- package/lib/browser/LocalDatastoreController.react-native.js +156 -537
- package/lib/browser/LocalDatastoreUtils.js +2 -9
- package/lib/browser/ObjectStateMutations.js +25 -25
- package/lib/browser/OfflineQuery.js +31 -33
- package/lib/browser/Parse.js +4 -13
- package/lib/browser/ParseACL.js +9 -16
- package/lib/browser/ParseCLP.js +46 -48
- package/lib/browser/ParseConfig.js +6 -13
- package/lib/browser/ParseError.js +2 -11
- package/lib/browser/ParseFile.js +107 -482
- package/lib/browser/ParseGeoPoint.js +4 -11
- package/lib/browser/ParseHooks.js +2 -2
- package/lib/browser/ParseInstallation.js +2 -2
- package/lib/browser/ParseLiveQuery.js +104 -480
- package/lib/browser/ParseObject.js +598 -958
- package/lib/browser/ParseOp.js +11 -11
- package/lib/browser/ParsePolygon.js +5 -12
- package/lib/browser/ParseQuery.js +365 -758
- package/lib/browser/ParseRelation.js +2 -9
- package/lib/browser/ParseRole.js +2 -2
- package/lib/browser/ParseSchema.js +2 -9
- package/lib/browser/ParseSession.js +2 -2
- package/lib/browser/ParseUser.js +221 -607
- package/lib/browser/Push.js +2 -9
- package/lib/browser/RESTController.js +12 -19
- package/lib/browser/SingleInstanceStateController.js +4 -11
- package/lib/browser/Storage.js +0 -7
- package/lib/browser/StorageController.browser.js +0 -7
- package/lib/browser/StorageController.default.js +0 -7
- package/lib/browser/StorageController.react-native.js +0 -7
- package/lib/browser/StorageController.weapp.js +0 -7
- package/lib/browser/TaskQueue.js +0 -7
- package/lib/browser/UniqueInstanceStateController.js +8 -15
- package/lib/browser/arrayContainsObject.js +2 -9
- package/lib/browser/canBeSerialized.js +2 -9
- package/lib/browser/decode.js +4 -11
- package/lib/browser/encode.js +8 -15
- package/lib/browser/equals.js +4 -13
- package/lib/browser/escape.js +0 -7
- package/lib/browser/isRevocableSession.js +2 -9
- package/lib/browser/parseDate.js +2 -9
- package/lib/browser/promiseUtils.js +4 -4
- package/lib/browser/unique.js +4 -11
- package/lib/browser/unsavedChildren.js +6 -13
- package/lib/browser/uuid.js +5 -1
- package/lib/node/Analytics.js +0 -7
- package/lib/node/AnonymousUtils.js +0 -7
- package/lib/node/Cloud.js +0 -7
- package/lib/node/CloudCode.js +0 -1
- package/lib/node/CoreManager.js +1 -8
- package/lib/node/EventEmitter.js +0 -7
- package/lib/node/FacebookUtils.js +0 -7
- package/lib/node/InstallationController.js +0 -7
- package/lib/node/LiveQueryClient.js +18 -17
- package/lib/node/LiveQuerySubscription.js +2 -11
- package/lib/node/LocalDatastore.js +0 -7
- package/lib/node/LocalDatastoreController.js +0 -7
- package/lib/node/LocalDatastoreController.react-native.js +0 -7
- package/lib/node/LocalDatastoreUtils.js +0 -7
- package/lib/node/ObjectStateMutations.js +0 -7
- package/lib/node/Parse.js +0 -9
- package/lib/node/ParseACL.js +0 -7
- package/lib/node/ParseCLP.js +0 -7
- package/lib/node/ParseConfig.js +0 -7
- package/lib/node/ParseError.js +0 -9
- package/lib/node/ParseFile.js +7 -12
- package/lib/node/ParseGeoPoint.js +0 -7
- package/lib/node/ParseInstallation.js +0 -7
- package/lib/node/ParseLiveQuery.js +0 -7
- package/lib/node/ParseObject.js +45 -34
- package/lib/node/ParseOp.js +0 -7
- package/lib/node/ParsePolygon.js +0 -7
- package/lib/node/ParseQuery.js +3 -18
- package/lib/node/ParseRelation.js +0 -7
- package/lib/node/ParseRole.js +0 -7
- package/lib/node/ParseSchema.js +0 -7
- package/lib/node/ParseSession.js +0 -7
- package/lib/node/ParseUser.js +0 -7
- package/lib/node/Push.js +0 -7
- package/lib/node/RESTController.js +0 -7
- package/lib/node/SingleInstanceStateController.js +0 -7
- package/lib/node/Storage.js +0 -7
- package/lib/node/StorageController.browser.js +0 -7
- package/lib/node/StorageController.default.js +0 -7
- package/lib/node/StorageController.react-native.js +0 -7
- package/lib/node/StorageController.weapp.js +0 -7
- package/lib/node/TaskQueue.js +0 -7
- package/lib/node/UniqueInstanceStateController.js +0 -7
- package/lib/node/arrayContainsObject.js +0 -7
- package/lib/node/canBeSerialized.js +0 -7
- package/lib/node/decode.js +0 -7
- package/lib/node/encode.js +0 -7
- package/lib/node/equals.js +0 -9
- package/lib/node/escape.js +0 -7
- package/lib/node/isRevocableSession.js +0 -7
- package/lib/node/parseDate.js +0 -7
- package/lib/node/unique.js +0 -7
- package/lib/node/unsavedChildren.js +0 -7
- package/lib/node/uuid.js +7 -1
- package/lib/react-native/CoreManager.js +2 -2
- package/lib/react-native/EventuallyQueue.js +169 -676
- package/lib/react-native/LiveQueryClient.js +16 -50
- package/lib/react-native/LiveQuerySubscription.js +3 -2
- package/lib/react-native/LocalDatastore.js +303 -863
- package/lib/react-native/LocalDatastoreController.js +75 -535
- package/lib/react-native/LocalDatastoreController.react-native.js +95 -503
- package/lib/react-native/ObjectStateMutations.js +2 -31
- package/lib/react-native/OfflineQuery.js +17 -63
- package/lib/react-native/ParseCLP.js +55 -129
- package/lib/react-native/ParseFile.js +63 -468
- package/lib/react-native/ParseLiveQuery.js +60 -455
- package/lib/react-native/ParseObject.js +263 -897
- package/lib/react-native/ParseQuery.js +207 -643
- package/lib/react-native/ParseSchema.js +3 -3
- package/lib/react-native/ParseUser.js +118 -573
- package/lib/react-native/RESTController.js +1 -29
- package/lib/react-native/uuid.js +5 -1
- package/lib/weapp/Analytics.js +4 -11
- package/lib/weapp/AnonymousUtils.js +2 -9
- package/lib/weapp/Cloud.js +4 -11
- package/lib/weapp/CloudCode.js +0 -1
- package/lib/weapp/CoreManager.js +3 -10
- package/lib/weapp/EventEmitter.js +0 -7
- package/lib/weapp/EventuallyQueue.js +282 -668
- package/lib/weapp/FacebookUtils.js +2 -9
- package/lib/weapp/InstallationController.js +0 -7
- package/lib/weapp/LiveQueryClient.js +35 -26
- package/lib/weapp/LiveQuerySubscription.js +5 -4
- package/lib/weapp/LocalDatastore.js +472 -864
- package/lib/weapp/LocalDatastoreController.js +161 -547
- package/lib/weapp/LocalDatastoreController.react-native.js +156 -537
- package/lib/weapp/LocalDatastoreUtils.js +2 -9
- package/lib/weapp/ObjectStateMutations.js +25 -25
- package/lib/weapp/OfflineQuery.js +31 -33
- package/lib/weapp/Parse.js +4 -13
- package/lib/weapp/ParseACL.js +9 -16
- package/lib/weapp/ParseCLP.js +46 -48
- package/lib/weapp/ParseConfig.js +6 -13
- package/lib/weapp/ParseError.js +2 -11
- package/lib/weapp/ParseFile.js +107 -482
- package/lib/weapp/ParseGeoPoint.js +4 -11
- package/lib/weapp/ParseHooks.js +2 -2
- package/lib/weapp/ParseInstallation.js +2 -2
- package/lib/weapp/ParseLiveQuery.js +104 -480
- package/lib/weapp/ParseObject.js +598 -958
- package/lib/weapp/ParseOp.js +11 -11
- package/lib/weapp/ParsePolygon.js +5 -12
- package/lib/weapp/ParseQuery.js +365 -758
- package/lib/weapp/ParseRelation.js +2 -9
- package/lib/weapp/ParseRole.js +2 -2
- package/lib/weapp/ParseSchema.js +2 -9
- package/lib/weapp/ParseSession.js +2 -2
- package/lib/weapp/ParseUser.js +221 -607
- package/lib/weapp/Push.js +2 -9
- package/lib/weapp/RESTController.js +12 -19
- package/lib/weapp/SingleInstanceStateController.js +4 -11
- package/lib/weapp/Storage.js +0 -7
- package/lib/weapp/StorageController.browser.js +0 -7
- package/lib/weapp/StorageController.default.js +0 -7
- package/lib/weapp/StorageController.react-native.js +0 -7
- package/lib/weapp/StorageController.weapp.js +0 -7
- package/lib/weapp/TaskQueue.js +0 -7
- package/lib/weapp/UniqueInstanceStateController.js +8 -15
- package/lib/weapp/arrayContainsObject.js +2 -9
- package/lib/weapp/canBeSerialized.js +2 -9
- package/lib/weapp/decode.js +4 -11
- package/lib/weapp/encode.js +8 -15
- package/lib/weapp/equals.js +4 -13
- package/lib/weapp/escape.js +0 -7
- package/lib/weapp/isRevocableSession.js +2 -9
- package/lib/weapp/parseDate.js +2 -9
- package/lib/weapp/promiseUtils.js +4 -4
- package/lib/weapp/unique.js +4 -11
- package/lib/weapp/unsavedChildren.js +6 -13
- package/lib/weapp/uuid.js +2 -0
- package/package.json +24 -24
- package/PATENTS +0 -37
|
@@ -1,26 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice");
|
|
6
|
-
|
|
7
|
-
var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse");
|
|
8
|
-
|
|
9
|
-
var _Promise2 = require("@babel/runtime-corejs3/core-js-stable/promise");
|
|
10
|
-
|
|
11
|
-
var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/set-prototype-of");
|
|
12
|
-
|
|
13
|
-
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
|
14
|
-
|
|
15
|
-
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
16
|
-
|
|
17
|
-
var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of");
|
|
18
|
-
|
|
19
|
-
var _Object$create = require("@babel/runtime-corejs3/core-js-stable/object/create");
|
|
20
|
-
|
|
21
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
22
4
|
|
|
23
|
-
var
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
24
6
|
|
|
25
7
|
_Object$defineProperty(exports, "__esModule", {
|
|
26
8
|
value: true
|
|
@@ -28,9 +10,11 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
28
10
|
|
|
29
11
|
exports.default = void 0;
|
|
30
12
|
|
|
13
|
+
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
14
|
+
|
|
31
15
|
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
32
16
|
|
|
33
|
-
var
|
|
17
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
|
|
34
18
|
|
|
35
19
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
|
36
20
|
|
|
@@ -41,364 +25,10 @@ var _EventEmitter = _interopRequireDefault(require("./EventEmitter"));
|
|
|
41
25
|
var _LiveQueryClient = _interopRequireDefault(require("./LiveQueryClient"));
|
|
42
26
|
|
|
43
27
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
28
|
+
/**
|
|
29
|
+
* @flow
|
|
30
|
+
*/
|
|
44
31
|
|
|
45
|
-
function _regeneratorRuntime() {
|
|
46
|
-
"use strict";
|
|
47
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
48
|
-
|
|
49
|
-
_regeneratorRuntime = function () {
|
|
50
|
-
return exports;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
var exports = {},
|
|
54
|
-
Op = Object.prototype,
|
|
55
|
-
hasOwn = Op.hasOwnProperty,
|
|
56
|
-
$Symbol = "function" == typeof _Symbol ? _Symbol : {},
|
|
57
|
-
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
58
|
-
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
59
|
-
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
60
|
-
|
|
61
|
-
function define(obj, key, value) {
|
|
62
|
-
return _Object$defineProperty(obj, key, {
|
|
63
|
-
value: value,
|
|
64
|
-
enumerable: !0,
|
|
65
|
-
configurable: !0,
|
|
66
|
-
writable: !0
|
|
67
|
-
}), obj[key];
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
try {
|
|
71
|
-
define({}, "");
|
|
72
|
-
} catch (err) {
|
|
73
|
-
define = function (obj, key, value) {
|
|
74
|
-
return obj[key] = value;
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
79
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
80
|
-
generator = _Object$create(protoGenerator.prototype),
|
|
81
|
-
context = new Context(tryLocsList || []);
|
|
82
|
-
|
|
83
|
-
return generator._invoke = function (innerFn, self, context) {
|
|
84
|
-
var state = "suspendedStart";
|
|
85
|
-
return function (method, arg) {
|
|
86
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
87
|
-
|
|
88
|
-
if ("completed" === state) {
|
|
89
|
-
if ("throw" === method) throw arg;
|
|
90
|
-
return doneResult();
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
for (context.method = method, context.arg = arg;;) {
|
|
94
|
-
var delegate = context.delegate;
|
|
95
|
-
|
|
96
|
-
if (delegate) {
|
|
97
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
98
|
-
|
|
99
|
-
if (delegateResult) {
|
|
100
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
101
|
-
return delegateResult;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
106
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
107
|
-
context.dispatchException(context.arg);
|
|
108
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
109
|
-
state = "executing";
|
|
110
|
-
var record = tryCatch(innerFn, self, context);
|
|
111
|
-
|
|
112
|
-
if ("normal" === record.type) {
|
|
113
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
114
|
-
return {
|
|
115
|
-
value: record.arg,
|
|
116
|
-
done: context.done
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
}(innerFn, self, context), generator;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function tryCatch(fn, obj, arg) {
|
|
127
|
-
try {
|
|
128
|
-
return {
|
|
129
|
-
type: "normal",
|
|
130
|
-
arg: fn.call(obj, arg)
|
|
131
|
-
};
|
|
132
|
-
} catch (err) {
|
|
133
|
-
return {
|
|
134
|
-
type: "throw",
|
|
135
|
-
arg: err
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
exports.wrap = wrap;
|
|
141
|
-
var ContinueSentinel = {};
|
|
142
|
-
|
|
143
|
-
function Generator() {}
|
|
144
|
-
|
|
145
|
-
function GeneratorFunction() {}
|
|
146
|
-
|
|
147
|
-
function GeneratorFunctionPrototype() {}
|
|
148
|
-
|
|
149
|
-
var IteratorPrototype = {};
|
|
150
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
151
|
-
return this;
|
|
152
|
-
});
|
|
153
|
-
var getProto = _Object$getPrototypeOf,
|
|
154
|
-
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
155
|
-
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
156
|
-
|
|
157
|
-
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype);
|
|
158
|
-
|
|
159
|
-
function defineIteratorMethods(prototype) {
|
|
160
|
-
var _context4;
|
|
161
|
-
|
|
162
|
-
_forEachInstanceProperty(_context4 = ["next", "throw", "return"]).call(_context4, function (method) {
|
|
163
|
-
define(prototype, method, function (arg) {
|
|
164
|
-
return this._invoke(method, arg);
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
170
|
-
function invoke(method, arg, resolve, reject) {
|
|
171
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
172
|
-
|
|
173
|
-
if ("throw" !== record.type) {
|
|
174
|
-
var result = record.arg,
|
|
175
|
-
value = result.value;
|
|
176
|
-
return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
177
|
-
invoke("next", value, resolve, reject);
|
|
178
|
-
}, function (err) {
|
|
179
|
-
invoke("throw", err, resolve, reject);
|
|
180
|
-
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
181
|
-
result.value = unwrapped, resolve(result);
|
|
182
|
-
}, function (error) {
|
|
183
|
-
return invoke("throw", error, resolve, reject);
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
reject(record.arg);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
var previousPromise;
|
|
191
|
-
|
|
192
|
-
this._invoke = function (method, arg) {
|
|
193
|
-
function callInvokeWithMethodAndArg() {
|
|
194
|
-
return new PromiseImpl(function (resolve, reject) {
|
|
195
|
-
invoke(method, arg, resolve, reject);
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
204
|
-
var method = delegate.iterator[context.method];
|
|
205
|
-
|
|
206
|
-
if (undefined === method) {
|
|
207
|
-
if (context.delegate = null, "throw" === context.method) {
|
|
208
|
-
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
209
|
-
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
return ContinueSentinel;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
216
|
-
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
217
|
-
var info = record.arg;
|
|
218
|
-
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);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
function pushTryEntry(locs) {
|
|
222
|
-
var entry = {
|
|
223
|
-
tryLoc: locs[0]
|
|
224
|
-
};
|
|
225
|
-
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
function resetTryEntry(entry) {
|
|
229
|
-
var record = entry.completion || {};
|
|
230
|
-
record.type = "normal", delete record.arg, entry.completion = record;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
function Context(tryLocsList) {
|
|
234
|
-
this.tryEntries = [{
|
|
235
|
-
tryLoc: "root"
|
|
236
|
-
}], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
function values(iterable) {
|
|
240
|
-
if (iterable) {
|
|
241
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
242
|
-
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
243
|
-
if ("function" == typeof iterable.next) return iterable;
|
|
244
|
-
|
|
245
|
-
if (!isNaN(iterable.length)) {
|
|
246
|
-
var i = -1,
|
|
247
|
-
next = function next() {
|
|
248
|
-
for (; ++i < iterable.length;) {
|
|
249
|
-
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
return next.value = undefined, next.done = !0, next;
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
return next.next = next;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
return {
|
|
260
|
-
next: doneResult
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
function doneResult() {
|
|
265
|
-
return {
|
|
266
|
-
value: undefined,
|
|
267
|
-
done: !0
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
272
|
-
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
273
|
-
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
274
|
-
}, exports.mark = function (genFun) {
|
|
275
|
-
return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun;
|
|
276
|
-
}, exports.awrap = function (arg) {
|
|
277
|
-
return {
|
|
278
|
-
__await: arg
|
|
279
|
-
};
|
|
280
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
281
|
-
return this;
|
|
282
|
-
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
283
|
-
void 0 === PromiseImpl && (PromiseImpl = _Promise2);
|
|
284
|
-
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
285
|
-
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
286
|
-
return result.done ? result.value : iter.next();
|
|
287
|
-
});
|
|
288
|
-
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
289
|
-
return this;
|
|
290
|
-
}), define(Gp, "toString", function () {
|
|
291
|
-
return "[object Generator]";
|
|
292
|
-
}), exports.keys = function (object) {
|
|
293
|
-
var keys = [];
|
|
294
|
-
|
|
295
|
-
for (var key in object) {
|
|
296
|
-
keys.push(key);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
return _reverseInstanceProperty(keys).call(keys), function next() {
|
|
300
|
-
for (; keys.length;) {
|
|
301
|
-
var key = keys.pop();
|
|
302
|
-
if (key in object) return next.value = key, next.done = !1, next;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return next.done = !0, next;
|
|
306
|
-
};
|
|
307
|
-
}, exports.values = values, Context.prototype = {
|
|
308
|
-
constructor: Context,
|
|
309
|
-
reset: function (skipTempReset) {
|
|
310
|
-
var _context5;
|
|
311
|
-
|
|
312
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context5 = this.tryEntries).call(_context5, resetTryEntry), !skipTempReset) for (var name in this) {
|
|
313
|
-
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined);
|
|
314
|
-
}
|
|
315
|
-
},
|
|
316
|
-
stop: function () {
|
|
317
|
-
this.done = !0;
|
|
318
|
-
var rootRecord = this.tryEntries[0].completion;
|
|
319
|
-
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
320
|
-
return this.rval;
|
|
321
|
-
},
|
|
322
|
-
dispatchException: function (exception) {
|
|
323
|
-
if (this.done) throw exception;
|
|
324
|
-
var context = this;
|
|
325
|
-
|
|
326
|
-
function handle(loc, caught) {
|
|
327
|
-
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
331
|
-
var entry = this.tryEntries[i],
|
|
332
|
-
record = entry.completion;
|
|
333
|
-
if ("root" === entry.tryLoc) return handle("end");
|
|
334
|
-
|
|
335
|
-
if (entry.tryLoc <= this.prev) {
|
|
336
|
-
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
337
|
-
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
338
|
-
|
|
339
|
-
if (hasCatch && hasFinally) {
|
|
340
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
341
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
342
|
-
} else if (hasCatch) {
|
|
343
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
344
|
-
} else {
|
|
345
|
-
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
346
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
},
|
|
351
|
-
abrupt: function (type, arg) {
|
|
352
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
353
|
-
var entry = this.tryEntries[i];
|
|
354
|
-
|
|
355
|
-
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
356
|
-
var finallyEntry = entry;
|
|
357
|
-
break;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
362
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
363
|
-
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
364
|
-
},
|
|
365
|
-
complete: function (record, afterLoc) {
|
|
366
|
-
if ("throw" === record.type) throw record.arg;
|
|
367
|
-
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;
|
|
368
|
-
},
|
|
369
|
-
finish: function (finallyLoc) {
|
|
370
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
371
|
-
var entry = this.tryEntries[i];
|
|
372
|
-
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
373
|
-
}
|
|
374
|
-
},
|
|
375
|
-
catch: function (tryLoc) {
|
|
376
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
377
|
-
var entry = this.tryEntries[i];
|
|
378
|
-
|
|
379
|
-
if (entry.tryLoc === tryLoc) {
|
|
380
|
-
var record = entry.completion;
|
|
381
|
-
|
|
382
|
-
if ("throw" === record.type) {
|
|
383
|
-
var thrown = record.arg;
|
|
384
|
-
resetTryEntry(entry);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
return thrown;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
throw new Error("illegal catch attempt");
|
|
392
|
-
},
|
|
393
|
-
delegateYield: function (iterable, resultName, nextLoc) {
|
|
394
|
-
return this.delegate = {
|
|
395
|
-
iterator: values(iterable),
|
|
396
|
-
resultName: resultName,
|
|
397
|
-
nextLoc: nextLoc
|
|
398
|
-
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
399
|
-
}
|
|
400
|
-
}, exports;
|
|
401
|
-
}
|
|
402
32
|
|
|
403
33
|
function getLiveQueryClient()
|
|
404
34
|
/*: LiveQueryClient*/
|
|
@@ -440,23 +70,21 @@ var LiveQuery = new _EventEmitter.default();
|
|
|
440
70
|
* to the LiveQuery server.
|
|
441
71
|
*/
|
|
442
72
|
|
|
443
|
-
LiveQuery.open = /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
73
|
+
LiveQuery.open = /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
444
74
|
var liveQueryClient;
|
|
445
|
-
return
|
|
446
|
-
while (1) {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
return _context.stop();
|
|
459
|
-
}
|
|
75
|
+
return _regenerator.default.wrap(function (_context) {
|
|
76
|
+
while (1) switch (_context.prev = _context.next) {
|
|
77
|
+
case 0:
|
|
78
|
+
_context.next = 2;
|
|
79
|
+
return getLiveQueryClient();
|
|
80
|
+
|
|
81
|
+
case 2:
|
|
82
|
+
liveQueryClient = _context.sent;
|
|
83
|
+
liveQueryClient.open();
|
|
84
|
+
|
|
85
|
+
case 4:
|
|
86
|
+
case "end":
|
|
87
|
+
return _context.stop();
|
|
460
88
|
}
|
|
461
89
|
}, _callee);
|
|
462
90
|
}));
|
|
@@ -468,23 +96,21 @@ LiveQuery.open = /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_reg
|
|
|
468
96
|
* connection to the LiveQuery server.
|
|
469
97
|
*/
|
|
470
98
|
|
|
471
|
-
LiveQuery.close = /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
99
|
+
LiveQuery.close = /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
472
100
|
var liveQueryClient;
|
|
473
|
-
return
|
|
474
|
-
while (1) {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
return _context2.stop();
|
|
487
|
-
}
|
|
101
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
102
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
103
|
+
case 0:
|
|
104
|
+
_context2.next = 2;
|
|
105
|
+
return getLiveQueryClient();
|
|
106
|
+
|
|
107
|
+
case 2:
|
|
108
|
+
liveQueryClient = _context2.sent;
|
|
109
|
+
liveQueryClient.close();
|
|
110
|
+
|
|
111
|
+
case 4:
|
|
112
|
+
case "end":
|
|
113
|
+
return _context2.stop();
|
|
488
114
|
}
|
|
489
115
|
}, _callee2);
|
|
490
116
|
})); // Register a default onError callback to make sure we do not crash on error
|
|
@@ -494,89 +120,87 @@ var _default = LiveQuery;
|
|
|
494
120
|
exports.default = _default;
|
|
495
121
|
var defaultLiveQueryClient;
|
|
496
122
|
var DefaultLiveQueryController = {
|
|
497
|
-
setDefaultLiveQueryClient: function
|
|
123
|
+
setDefaultLiveQueryClient: function (liveQueryClient
|
|
498
124
|
/*: LiveQueryClient*/
|
|
499
125
|
) {
|
|
500
126
|
defaultLiveQueryClient = liveQueryClient;
|
|
501
127
|
},
|
|
502
|
-
getDefaultLiveQueryClient: function
|
|
128
|
+
getDefaultLiveQueryClient: function ()
|
|
503
129
|
/*: Promise<LiveQueryClient>*/
|
|
504
130
|
{
|
|
505
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
131
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
506
132
|
var _yield$Promise$all, _yield$Promise$all2, currentUser, installationId, sessionToken, liveQueryServerURL, serverURL, protocol, host, applicationId, javascriptKey, masterKey;
|
|
507
133
|
|
|
508
|
-
return
|
|
509
|
-
while (1) {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
return _context3.stop();
|
|
574
|
-
}
|
|
134
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
135
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
136
|
+
case 0:
|
|
137
|
+
if (!defaultLiveQueryClient) {
|
|
138
|
+
_context3.next = 2;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return _context3.abrupt("return", defaultLiveQueryClient);
|
|
143
|
+
|
|
144
|
+
case 2:
|
|
145
|
+
_context3.next = 4;
|
|
146
|
+
return _promise.default.all([_CoreManager.default.getUserController().currentUserAsync(), _CoreManager.default.getInstallationController().currentInstallationId()]);
|
|
147
|
+
|
|
148
|
+
case 4:
|
|
149
|
+
_yield$Promise$all = _context3.sent;
|
|
150
|
+
_yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 2);
|
|
151
|
+
currentUser = _yield$Promise$all2[0];
|
|
152
|
+
installationId = _yield$Promise$all2[1];
|
|
153
|
+
sessionToken = currentUser ? currentUser.getSessionToken() : undefined;
|
|
154
|
+
liveQueryServerURL = _CoreManager.default.get('LIVEQUERY_SERVER_URL');
|
|
155
|
+
|
|
156
|
+
if (!(liveQueryServerURL && (0, _indexOf.default)(liveQueryServerURL).call(liveQueryServerURL, 'ws') !== 0)) {
|
|
157
|
+
_context3.next = 12;
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
throw new Error('You need to set a proper Parse LiveQuery server url before using LiveQueryClient');
|
|
162
|
+
|
|
163
|
+
case 12:
|
|
164
|
+
// If we can not find Parse.liveQueryServerURL, we try to extract it from Parse.serverURL
|
|
165
|
+
if (!liveQueryServerURL) {
|
|
166
|
+
serverURL = _CoreManager.default.get('SERVER_URL');
|
|
167
|
+
protocol = (0, _indexOf.default)(serverURL).call(serverURL, 'https') === 0 ? 'wss://' : 'ws://';
|
|
168
|
+
host = serverURL.replace(/^https?:\/\//, '');
|
|
169
|
+
liveQueryServerURL = protocol + host;
|
|
170
|
+
|
|
171
|
+
_CoreManager.default.set('LIVEQUERY_SERVER_URL', liveQueryServerURL);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
applicationId = _CoreManager.default.get('APPLICATION_ID');
|
|
175
|
+
javascriptKey = _CoreManager.default.get('JAVASCRIPT_KEY');
|
|
176
|
+
masterKey = _CoreManager.default.get('MASTER_KEY');
|
|
177
|
+
defaultLiveQueryClient = new _LiveQueryClient.default({
|
|
178
|
+
applicationId: applicationId,
|
|
179
|
+
serverURL: liveQueryServerURL,
|
|
180
|
+
javascriptKey: javascriptKey,
|
|
181
|
+
masterKey: masterKey,
|
|
182
|
+
sessionToken: sessionToken,
|
|
183
|
+
installationId: installationId
|
|
184
|
+
});
|
|
185
|
+
defaultLiveQueryClient.on('error', function (error) {
|
|
186
|
+
LiveQuery.emit('error', error);
|
|
187
|
+
});
|
|
188
|
+
defaultLiveQueryClient.on('open', function () {
|
|
189
|
+
LiveQuery.emit('open');
|
|
190
|
+
});
|
|
191
|
+
defaultLiveQueryClient.on('close', function () {
|
|
192
|
+
LiveQuery.emit('close');
|
|
193
|
+
});
|
|
194
|
+
return _context3.abrupt("return", defaultLiveQueryClient);
|
|
195
|
+
|
|
196
|
+
case 21:
|
|
197
|
+
case "end":
|
|
198
|
+
return _context3.stop();
|
|
575
199
|
}
|
|
576
200
|
}, _callee3);
|
|
577
201
|
}))();
|
|
578
202
|
},
|
|
579
|
-
_clearCachedDefaultClient: function
|
|
203
|
+
_clearCachedDefaultClient: function () {
|
|
580
204
|
defaultLiveQueryClient = null;
|
|
581
205
|
}
|
|
582
206
|
};
|