parse 4.0.0-alpha.7 → 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 +3935 -6527
- package/dist/parse.min.js +7 -6
- package/dist/parse.weapp.js +3096 -6458
- 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 +542 -934
- 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 +5 -12
- 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 +223 -878
- 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 +542 -934
- 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
|
@@ -2,6 +2,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
2
2
|
|
|
3
3
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
4
4
|
|
|
5
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
6
|
+
|
|
5
7
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
6
8
|
|
|
7
9
|
var _ParseObject = _interopRequireDefault(require("./ParseObject"));
|
|
@@ -10,357 +12,6 @@ var _ParseQuery = _interopRequireDefault(require("./ParseQuery"));
|
|
|
10
12
|
|
|
11
13
|
var _Storage = _interopRequireDefault(require("./Storage"));
|
|
12
14
|
|
|
13
|
-
function _regeneratorRuntime() {
|
|
14
|
-
"use strict";
|
|
15
|
-
|
|
16
|
-
_regeneratorRuntime = function () {
|
|
17
|
-
return exports;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
var exports = {},
|
|
21
|
-
Op = Object.prototype,
|
|
22
|
-
hasOwn = Op.hasOwnProperty,
|
|
23
|
-
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
24
|
-
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
25
|
-
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
26
|
-
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
27
|
-
|
|
28
|
-
function define(obj, key, value) {
|
|
29
|
-
return Object.defineProperty(obj, key, {
|
|
30
|
-
value: value,
|
|
31
|
-
enumerable: !0,
|
|
32
|
-
configurable: !0,
|
|
33
|
-
writable: !0
|
|
34
|
-
}), obj[key];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
try {
|
|
38
|
-
define({}, "");
|
|
39
|
-
} catch (err) {
|
|
40
|
-
define = function (obj, key, value) {
|
|
41
|
-
return obj[key] = value;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
46
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
47
|
-
generator = Object.create(protoGenerator.prototype),
|
|
48
|
-
context = new Context(tryLocsList || []);
|
|
49
|
-
return generator._invoke = function (innerFn, self, context) {
|
|
50
|
-
var state = "suspendedStart";
|
|
51
|
-
return function (method, arg) {
|
|
52
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
53
|
-
|
|
54
|
-
if ("completed" === state) {
|
|
55
|
-
if ("throw" === method) throw arg;
|
|
56
|
-
return doneResult();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
for (context.method = method, context.arg = arg;;) {
|
|
60
|
-
var delegate = context.delegate;
|
|
61
|
-
|
|
62
|
-
if (delegate) {
|
|
63
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
64
|
-
|
|
65
|
-
if (delegateResult) {
|
|
66
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
67
|
-
return delegateResult;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
72
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
73
|
-
context.dispatchException(context.arg);
|
|
74
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
75
|
-
state = "executing";
|
|
76
|
-
var record = tryCatch(innerFn, self, context);
|
|
77
|
-
|
|
78
|
-
if ("normal" === record.type) {
|
|
79
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
80
|
-
return {
|
|
81
|
-
value: record.arg,
|
|
82
|
-
done: context.done
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}(innerFn, self, context), generator;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function tryCatch(fn, obj, arg) {
|
|
93
|
-
try {
|
|
94
|
-
return {
|
|
95
|
-
type: "normal",
|
|
96
|
-
arg: fn.call(obj, arg)
|
|
97
|
-
};
|
|
98
|
-
} catch (err) {
|
|
99
|
-
return {
|
|
100
|
-
type: "throw",
|
|
101
|
-
arg: err
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
exports.wrap = wrap;
|
|
107
|
-
var ContinueSentinel = {};
|
|
108
|
-
|
|
109
|
-
function Generator() {}
|
|
110
|
-
|
|
111
|
-
function GeneratorFunction() {}
|
|
112
|
-
|
|
113
|
-
function GeneratorFunctionPrototype() {}
|
|
114
|
-
|
|
115
|
-
var IteratorPrototype = {};
|
|
116
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
117
|
-
return this;
|
|
118
|
-
});
|
|
119
|
-
var getProto = Object.getPrototypeOf,
|
|
120
|
-
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
121
|
-
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
122
|
-
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
123
|
-
|
|
124
|
-
function defineIteratorMethods(prototype) {
|
|
125
|
-
["next", "throw", "return"].forEach(function (method) {
|
|
126
|
-
define(prototype, method, function (arg) {
|
|
127
|
-
return this._invoke(method, arg);
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
133
|
-
function invoke(method, arg, resolve, reject) {
|
|
134
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
135
|
-
|
|
136
|
-
if ("throw" !== record.type) {
|
|
137
|
-
var result = record.arg,
|
|
138
|
-
value = result.value;
|
|
139
|
-
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
140
|
-
invoke("next", value, resolve, reject);
|
|
141
|
-
}, function (err) {
|
|
142
|
-
invoke("throw", err, resolve, reject);
|
|
143
|
-
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
144
|
-
result.value = unwrapped, resolve(result);
|
|
145
|
-
}, function (error) {
|
|
146
|
-
return invoke("throw", error, resolve, reject);
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
reject(record.arg);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
var previousPromise;
|
|
154
|
-
|
|
155
|
-
this._invoke = function (method, arg) {
|
|
156
|
-
function callInvokeWithMethodAndArg() {
|
|
157
|
-
return new PromiseImpl(function (resolve, reject) {
|
|
158
|
-
invoke(method, arg, resolve, reject);
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
167
|
-
var method = delegate.iterator[context.method];
|
|
168
|
-
|
|
169
|
-
if (undefined === method) {
|
|
170
|
-
if (context.delegate = null, "throw" === context.method) {
|
|
171
|
-
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
172
|
-
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
return ContinueSentinel;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
179
|
-
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
180
|
-
var info = record.arg;
|
|
181
|
-
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);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
function pushTryEntry(locs) {
|
|
185
|
-
var entry = {
|
|
186
|
-
tryLoc: locs[0]
|
|
187
|
-
};
|
|
188
|
-
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
function resetTryEntry(entry) {
|
|
192
|
-
var record = entry.completion || {};
|
|
193
|
-
record.type = "normal", delete record.arg, entry.completion = record;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
function Context(tryLocsList) {
|
|
197
|
-
this.tryEntries = [{
|
|
198
|
-
tryLoc: "root"
|
|
199
|
-
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
function values(iterable) {
|
|
203
|
-
if (iterable) {
|
|
204
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
205
|
-
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
206
|
-
if ("function" == typeof iterable.next) return iterable;
|
|
207
|
-
|
|
208
|
-
if (!isNaN(iterable.length)) {
|
|
209
|
-
var i = -1,
|
|
210
|
-
next = function next() {
|
|
211
|
-
for (; ++i < iterable.length;) {
|
|
212
|
-
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
return next.value = undefined, next.done = !0, next;
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
return next.next = next;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return {
|
|
223
|
-
next: doneResult
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
function doneResult() {
|
|
228
|
-
return {
|
|
229
|
-
value: undefined,
|
|
230
|
-
done: !0
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
235
|
-
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
236
|
-
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
237
|
-
}, exports.mark = function (genFun) {
|
|
238
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
239
|
-
}, exports.awrap = function (arg) {
|
|
240
|
-
return {
|
|
241
|
-
__await: arg
|
|
242
|
-
};
|
|
243
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
244
|
-
return this;
|
|
245
|
-
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
246
|
-
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
247
|
-
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
248
|
-
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
249
|
-
return result.done ? result.value : iter.next();
|
|
250
|
-
});
|
|
251
|
-
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
252
|
-
return this;
|
|
253
|
-
}), define(Gp, "toString", function () {
|
|
254
|
-
return "[object Generator]";
|
|
255
|
-
}), exports.keys = function (object) {
|
|
256
|
-
var keys = [];
|
|
257
|
-
|
|
258
|
-
for (var key in object) {
|
|
259
|
-
keys.push(key);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
return keys.reverse(), function next() {
|
|
263
|
-
for (; keys.length;) {
|
|
264
|
-
var key = keys.pop();
|
|
265
|
-
if (key in object) return next.value = key, next.done = !1, next;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
return next.done = !0, next;
|
|
269
|
-
};
|
|
270
|
-
}, exports.values = values, Context.prototype = {
|
|
271
|
-
constructor: Context,
|
|
272
|
-
reset: function (skipTempReset) {
|
|
273
|
-
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) {
|
|
274
|
-
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
stop: function () {
|
|
278
|
-
this.done = !0;
|
|
279
|
-
var rootRecord = this.tryEntries[0].completion;
|
|
280
|
-
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
281
|
-
return this.rval;
|
|
282
|
-
},
|
|
283
|
-
dispatchException: function (exception) {
|
|
284
|
-
if (this.done) throw exception;
|
|
285
|
-
var context = this;
|
|
286
|
-
|
|
287
|
-
function handle(loc, caught) {
|
|
288
|
-
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
292
|
-
var entry = this.tryEntries[i],
|
|
293
|
-
record = entry.completion;
|
|
294
|
-
if ("root" === entry.tryLoc) return handle("end");
|
|
295
|
-
|
|
296
|
-
if (entry.tryLoc <= this.prev) {
|
|
297
|
-
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
298
|
-
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
299
|
-
|
|
300
|
-
if (hasCatch && hasFinally) {
|
|
301
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
302
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
303
|
-
} else if (hasCatch) {
|
|
304
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
305
|
-
} else {
|
|
306
|
-
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
307
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
},
|
|
312
|
-
abrupt: function (type, arg) {
|
|
313
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
314
|
-
var entry = this.tryEntries[i];
|
|
315
|
-
|
|
316
|
-
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
317
|
-
var finallyEntry = entry;
|
|
318
|
-
break;
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
323
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
324
|
-
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
325
|
-
},
|
|
326
|
-
complete: function (record, afterLoc) {
|
|
327
|
-
if ("throw" === record.type) throw record.arg;
|
|
328
|
-
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;
|
|
329
|
-
},
|
|
330
|
-
finish: function (finallyLoc) {
|
|
331
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
332
|
-
var entry = this.tryEntries[i];
|
|
333
|
-
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
334
|
-
}
|
|
335
|
-
},
|
|
336
|
-
catch: function (tryLoc) {
|
|
337
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
338
|
-
var entry = this.tryEntries[i];
|
|
339
|
-
|
|
340
|
-
if (entry.tryLoc === tryLoc) {
|
|
341
|
-
var record = entry.completion;
|
|
342
|
-
|
|
343
|
-
if ("throw" === record.type) {
|
|
344
|
-
var thrown = record.arg;
|
|
345
|
-
resetTryEntry(entry);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
return thrown;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
throw new Error("illegal catch attempt");
|
|
353
|
-
},
|
|
354
|
-
delegateYield: function (iterable, resultName, nextLoc) {
|
|
355
|
-
return this.delegate = {
|
|
356
|
-
iterator: values(iterable),
|
|
357
|
-
resultName: resultName,
|
|
358
|
-
nextLoc: nextLoc
|
|
359
|
-
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
360
|
-
}
|
|
361
|
-
}, exports;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
15
|
var QUEUE_KEY = 'Parse/Eventually/Queue';
|
|
365
16
|
var queueCache = [];
|
|
366
17
|
var dirtyCache = true;
|
|
@@ -385,49 +36,41 @@ var EventuallyQueue = {
|
|
|
385
36
|
|
|
386
37
|
return [action, className, id, uniqueId].join('_');
|
|
387
38
|
},
|
|
388
|
-
enqueue: function (
|
|
389
|
-
var
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
queueId = this.generateQueueId(action, object);
|
|
400
|
-
index = this.queueItemExists(queueData, queueId);
|
|
401
|
-
|
|
402
|
-
if (index > -1) {
|
|
403
|
-
for (prop in queueData[index].object) {
|
|
404
|
-
if (typeof object.get(prop) === 'undefined') {
|
|
405
|
-
object.set(prop, queueData[index].object[prop]);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
} else {
|
|
409
|
-
index = queueData.length;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
queueData[index] = {
|
|
413
|
-
queueId: queueId,
|
|
414
|
-
action: action,
|
|
415
|
-
object: object.toJSON(),
|
|
416
|
-
serverOptions: serverOptions,
|
|
417
|
-
id: object.id,
|
|
418
|
-
className: object.className,
|
|
419
|
-
hash: object.get('hash'),
|
|
420
|
-
createdAt: new Date()
|
|
421
|
-
};
|
|
422
|
-
return _context.abrupt("return", this.setQueue(queueData));
|
|
423
|
-
|
|
424
|
-
case 8:
|
|
425
|
-
case "end":
|
|
426
|
-
return _context.stop();
|
|
39
|
+
enqueue: function () {
|
|
40
|
+
var _enqueue = (0, _asyncToGenerator2.default)(function* (action, object, serverOptions) {
|
|
41
|
+
var queueData = yield this.getQueue();
|
|
42
|
+
var queueId = this.generateQueueId(action, object);
|
|
43
|
+
var index = this.queueItemExists(queueData, queueId);
|
|
44
|
+
|
|
45
|
+
if (index > -1) {
|
|
46
|
+
for (var prop in queueData[index].object) {
|
|
47
|
+
if (typeof object.get(prop) === 'undefined') {
|
|
48
|
+
object.set(prop, queueData[index].object[prop]);
|
|
49
|
+
}
|
|
427
50
|
}
|
|
51
|
+
} else {
|
|
52
|
+
index = queueData.length;
|
|
428
53
|
}
|
|
429
|
-
|
|
430
|
-
|
|
54
|
+
|
|
55
|
+
queueData[index] = {
|
|
56
|
+
queueId: queueId,
|
|
57
|
+
action: action,
|
|
58
|
+
object: object.toJSON(),
|
|
59
|
+
serverOptions: serverOptions,
|
|
60
|
+
id: object.id,
|
|
61
|
+
className: object.className,
|
|
62
|
+
hash: object.get('hash'),
|
|
63
|
+
createdAt: new Date()
|
|
64
|
+
};
|
|
65
|
+
return this.setQueue(queueData);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
function enqueue() {
|
|
69
|
+
return _enqueue.apply(this, arguments);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return enqueue;
|
|
73
|
+
}(),
|
|
431
74
|
store: function (data) {
|
|
432
75
|
return _Storage.default.setItemAsync(QUEUE_KEY, JSON.stringify(data));
|
|
433
76
|
},
|
|
@@ -435,77 +78,42 @@ var EventuallyQueue = {
|
|
|
435
78
|
return _Storage.default.getItemAsync(QUEUE_KEY);
|
|
436
79
|
},
|
|
437
80
|
getQueue: function () {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
_context2.next = 10;
|
|
444
|
-
break;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
_context2.t0 = JSON;
|
|
448
|
-
_context2.next = 4;
|
|
449
|
-
return _regeneratorRuntime().awrap(this.load());
|
|
450
|
-
|
|
451
|
-
case 4:
|
|
452
|
-
_context2.t1 = _context2.sent;
|
|
453
|
-
|
|
454
|
-
if (_context2.t1) {
|
|
455
|
-
_context2.next = 7;
|
|
456
|
-
break;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
_context2.t1 = '[]';
|
|
81
|
+
var _getQueue = (0, _asyncToGenerator2.default)(function* () {
|
|
82
|
+
if (dirtyCache) {
|
|
83
|
+
queueCache = JSON.parse((yield this.load()) || '[]');
|
|
84
|
+
dirtyCache = false;
|
|
85
|
+
}
|
|
460
86
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
queueCache = _context2.t0.parse.call(_context2.t0, _context2.t2);
|
|
464
|
-
dirtyCache = false;
|
|
87
|
+
return queueCache;
|
|
88
|
+
});
|
|
465
89
|
|
|
466
|
-
|
|
467
|
-
|
|
90
|
+
function getQueue() {
|
|
91
|
+
return _getQueue.apply(this, arguments);
|
|
92
|
+
}
|
|
468
93
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
return _context2.stop();
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
}, null, this, null, Promise);
|
|
475
|
-
},
|
|
94
|
+
return getQueue;
|
|
95
|
+
}(),
|
|
476
96
|
setQueue: function (queue) {
|
|
477
97
|
queueCache = queue;
|
|
478
98
|
return this.store(queueCache);
|
|
479
99
|
},
|
|
480
|
-
remove: function (
|
|
481
|
-
var
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
queueData = _context3.sent;
|
|
491
|
-
index = this.queueItemExists(queueData, queueId);
|
|
492
|
-
|
|
493
|
-
if (!(index > -1)) {
|
|
494
|
-
_context3.next = 8;
|
|
495
|
-
break;
|
|
496
|
-
}
|
|
100
|
+
remove: function () {
|
|
101
|
+
var _remove = (0, _asyncToGenerator2.default)(function* (queueId) {
|
|
102
|
+
var queueData = yield this.getQueue();
|
|
103
|
+
var index = this.queueItemExists(queueData, queueId);
|
|
104
|
+
|
|
105
|
+
if (index > -1) {
|
|
106
|
+
queueData.splice(index, 1);
|
|
107
|
+
yield this.setQueue(queueData);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
497
110
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
111
|
+
function remove() {
|
|
112
|
+
return _remove.apply(this, arguments);
|
|
113
|
+
}
|
|
501
114
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
return _context3.stop();
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
}, null, this, null, Promise);
|
|
508
|
-
},
|
|
115
|
+
return remove;
|
|
116
|
+
}(),
|
|
509
117
|
clear: function () {
|
|
510
118
|
queueCache = [];
|
|
511
119
|
return this.store([]);
|
|
@@ -516,190 +124,95 @@ var EventuallyQueue = {
|
|
|
516
124
|
});
|
|
517
125
|
},
|
|
518
126
|
length: function () {
|
|
519
|
-
var
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
case 0:
|
|
524
|
-
_context4.next = 2;
|
|
525
|
-
return _regeneratorRuntime().awrap(this.getQueue());
|
|
526
|
-
|
|
527
|
-
case 2:
|
|
528
|
-
queueData = _context4.sent;
|
|
529
|
-
return _context4.abrupt("return", queueData.length);
|
|
530
|
-
|
|
531
|
-
case 4:
|
|
532
|
-
case "end":
|
|
533
|
-
return _context4.stop();
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
}, null, this, null, Promise);
|
|
537
|
-
},
|
|
538
|
-
sendQueue: function () {
|
|
539
|
-
var queue, queueData, i, queueObject, id, hash, className, ObjectType;
|
|
540
|
-
return _regeneratorRuntime().async(function (_context5) {
|
|
541
|
-
while (1) {
|
|
542
|
-
switch (_context5.prev = _context5.next) {
|
|
543
|
-
case 0:
|
|
544
|
-
_context5.next = 2;
|
|
545
|
-
return _regeneratorRuntime().awrap(this.getQueue());
|
|
546
|
-
|
|
547
|
-
case 2:
|
|
548
|
-
queue = _context5.sent;
|
|
549
|
-
queueData = (0, _toConsumableArray2.default)(queue);
|
|
550
|
-
|
|
551
|
-
if (!(queueData.length === 0)) {
|
|
552
|
-
_context5.next = 6;
|
|
553
|
-
break;
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
return _context5.abrupt("return", false);
|
|
557
|
-
|
|
558
|
-
case 6:
|
|
559
|
-
i = 0;
|
|
560
|
-
|
|
561
|
-
case 7:
|
|
562
|
-
if (!(i < queueData.length)) {
|
|
563
|
-
_context5.next = 26;
|
|
564
|
-
break;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
queueObject = queueData[i];
|
|
568
|
-
id = queueObject.id, hash = queueObject.hash, className = queueObject.className;
|
|
569
|
-
ObjectType = _ParseObject.default.extend(className);
|
|
570
|
-
|
|
571
|
-
if (!id) {
|
|
572
|
-
_context5.next = 16;
|
|
573
|
-
break;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
_context5.next = 14;
|
|
577
|
-
return _regeneratorRuntime().awrap(this.process.byId(ObjectType, queueObject));
|
|
578
|
-
|
|
579
|
-
case 14:
|
|
580
|
-
_context5.next = 23;
|
|
581
|
-
break;
|
|
582
|
-
|
|
583
|
-
case 16:
|
|
584
|
-
if (!hash) {
|
|
585
|
-
_context5.next = 21;
|
|
586
|
-
break;
|
|
587
|
-
}
|
|
127
|
+
var _length = (0, _asyncToGenerator2.default)(function* () {
|
|
128
|
+
var queueData = yield this.getQueue();
|
|
129
|
+
return queueData.length;
|
|
130
|
+
});
|
|
588
131
|
|
|
589
|
-
|
|
590
|
-
|
|
132
|
+
function length() {
|
|
133
|
+
return _length.apply(this, arguments);
|
|
134
|
+
}
|
|
591
135
|
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
136
|
+
return length;
|
|
137
|
+
}(),
|
|
138
|
+
sendQueue: function () {
|
|
139
|
+
var _sendQueue = (0, _asyncToGenerator2.default)(function* () {
|
|
140
|
+
var queue = yield this.getQueue();
|
|
141
|
+
var queueData = (0, _toConsumableArray2.default)(queue);
|
|
595
142
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
143
|
+
if (queueData.length === 0) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
599
146
|
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
147
|
+
for (var i = 0; i < queueData.length; i += 1) {
|
|
148
|
+
var queueObject = queueData[i];
|
|
149
|
+
var id = queueObject.id,
|
|
150
|
+
hash = queueObject.hash,
|
|
151
|
+
className = queueObject.className;
|
|
604
152
|
|
|
605
|
-
|
|
606
|
-
return _context5.abrupt("return", true);
|
|
153
|
+
var ObjectType = _ParseObject.default.extend(className);
|
|
607
154
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
155
|
+
if (id) {
|
|
156
|
+
yield this.process.byId(ObjectType, queueObject);
|
|
157
|
+
} else if (hash) {
|
|
158
|
+
yield this.process.byHash(ObjectType, queueObject);
|
|
159
|
+
} else {
|
|
160
|
+
yield this.process.create(ObjectType, queueObject);
|
|
611
161
|
}
|
|
612
162
|
}
|
|
613
|
-
}, null, this, null, Promise);
|
|
614
|
-
},
|
|
615
|
-
sendQueueCallback: function (object, queueObject) {
|
|
616
|
-
return _regeneratorRuntime().async(function (_context6) {
|
|
617
|
-
while (1) {
|
|
618
|
-
switch (_context6.prev = _context6.next) {
|
|
619
|
-
case 0:
|
|
620
|
-
if (object) {
|
|
621
|
-
_context6.next = 2;
|
|
622
|
-
break;
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
return _context6.abrupt("return", this.remove(queueObject.queueId));
|
|
626
|
-
|
|
627
|
-
case 2:
|
|
628
|
-
_context6.t0 = queueObject.action;
|
|
629
|
-
_context6.next = _context6.t0 === 'save' ? 5 : _context6.t0 === 'destroy' ? 20 : 33;
|
|
630
|
-
break;
|
|
631
|
-
|
|
632
|
-
case 5:
|
|
633
|
-
if (!(typeof object.updatedAt !== 'undefined' && object.updatedAt > new Date(queueObject.object.createdAt))) {
|
|
634
|
-
_context6.next = 7;
|
|
635
|
-
break;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
return _context6.abrupt("return", this.remove(queueObject.queueId));
|
|
639
163
|
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
_context6.next = 10;
|
|
643
|
-
return _regeneratorRuntime().awrap(object.save(queueObject.object, queueObject.serverOptions));
|
|
164
|
+
return true;
|
|
165
|
+
});
|
|
644
166
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
167
|
+
function sendQueue() {
|
|
168
|
+
return _sendQueue.apply(this, arguments);
|
|
169
|
+
}
|
|
648
170
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
171
|
+
return sendQueue;
|
|
172
|
+
}(),
|
|
173
|
+
sendQueueCallback: function () {
|
|
174
|
+
var _sendQueueCallback = (0, _asyncToGenerator2.default)(function* (object, queueObject) {
|
|
175
|
+
if (!object) {
|
|
176
|
+
return this.remove(queueObject.queueId);
|
|
177
|
+
}
|
|
652
178
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
179
|
+
switch (queueObject.action) {
|
|
180
|
+
case 'save':
|
|
181
|
+
if (typeof object.updatedAt !== 'undefined' && object.updatedAt > new Date(queueObject.object.createdAt)) {
|
|
182
|
+
return this.remove(queueObject.queueId);
|
|
183
|
+
}
|
|
656
184
|
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
185
|
+
try {
|
|
186
|
+
yield object.save(queueObject.object, queueObject.serverOptions);
|
|
187
|
+
yield this.remove(queueObject.queueId);
|
|
188
|
+
} catch (e) {
|
|
189
|
+
if (e.message !== 'XMLHttpRequest failed: "Unable to connect to the Parse API"') {
|
|
190
|
+
yield this.remove(queueObject.queueId);
|
|
660
191
|
}
|
|
192
|
+
}
|
|
661
193
|
|
|
662
|
-
|
|
663
|
-
return _regeneratorRuntime().awrap(this.remove(queueObject.queueId));
|
|
664
|
-
|
|
665
|
-
case 19:
|
|
666
|
-
return _context6.abrupt("break", 33);
|
|
667
|
-
|
|
668
|
-
case 20:
|
|
669
|
-
_context6.prev = 20;
|
|
670
|
-
_context6.next = 23;
|
|
671
|
-
return _regeneratorRuntime().awrap(object.destroy(queueObject.serverOptions));
|
|
672
|
-
|
|
673
|
-
case 23:
|
|
674
|
-
_context6.next = 25;
|
|
675
|
-
return _regeneratorRuntime().awrap(this.remove(queueObject.queueId));
|
|
676
|
-
|
|
677
|
-
case 25:
|
|
678
|
-
_context6.next = 32;
|
|
679
|
-
break;
|
|
680
|
-
|
|
681
|
-
case 27:
|
|
682
|
-
_context6.prev = 27;
|
|
683
|
-
_context6.t2 = _context6["catch"](20);
|
|
194
|
+
break;
|
|
684
195
|
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
196
|
+
case 'destroy':
|
|
197
|
+
try {
|
|
198
|
+
yield object.destroy(queueObject.serverOptions);
|
|
199
|
+
yield this.remove(queueObject.queueId);
|
|
200
|
+
} catch (e) {
|
|
201
|
+
if (e.message !== 'XMLHttpRequest failed: "Unable to connect to the Parse API"') {
|
|
202
|
+
yield this.remove(queueObject.queueId);
|
|
688
203
|
}
|
|
204
|
+
}
|
|
689
205
|
|
|
690
|
-
|
|
691
|
-
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
});
|
|
692
209
|
|
|
693
|
-
|
|
694
|
-
|
|
210
|
+
function sendQueueCallback() {
|
|
211
|
+
return _sendQueueCallback.apply(this, arguments);
|
|
212
|
+
}
|
|
695
213
|
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
return _context6.stop();
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
}, null, this, [[7, 14], [20, 27]], Promise);
|
|
702
|
-
},
|
|
214
|
+
return sendQueueCallback;
|
|
215
|
+
}(),
|
|
703
216
|
poll: function () {
|
|
704
217
|
var _this = this;
|
|
705
218
|
|
|
@@ -740,65 +253,45 @@ var EventuallyQueue = {
|
|
|
740
253
|
var object = new ObjectType();
|
|
741
254
|
return EventuallyQueue.sendQueueCallback(object, queueObject);
|
|
742
255
|
},
|
|
743
|
-
byId: function (
|
|
744
|
-
var
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
while (1) {
|
|
772
|
-
switch (_context8.prev = _context8.next) {
|
|
773
|
-
case 0:
|
|
774
|
-
sessionToken = queueObject.serverOptions.sessionToken;
|
|
775
|
-
query = new _ParseQuery.default(ObjectType);
|
|
776
|
-
query.equalTo('hash', queueObject.hash);
|
|
777
|
-
_context8.next = 5;
|
|
778
|
-
return _regeneratorRuntime().awrap(query.find({
|
|
779
|
-
sessionToken: sessionToken
|
|
780
|
-
}));
|
|
781
|
-
|
|
782
|
-
case 5:
|
|
783
|
-
results = _context8.sent;
|
|
784
|
-
|
|
785
|
-
if (!(results.length > 0)) {
|
|
786
|
-
_context8.next = 8;
|
|
787
|
-
break;
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
return _context8.abrupt("return", EventuallyQueue.sendQueueCallback(results[0], queueObject));
|
|
791
|
-
|
|
792
|
-
case 8:
|
|
793
|
-
return _context8.abrupt("return", EventuallyQueue.process.create(ObjectType, queueObject));
|
|
794
|
-
|
|
795
|
-
case 9:
|
|
796
|
-
case "end":
|
|
797
|
-
return _context8.stop();
|
|
798
|
-
}
|
|
256
|
+
byId: function () {
|
|
257
|
+
var _byId = (0, _asyncToGenerator2.default)(function* (ObjectType, queueObject) {
|
|
258
|
+
var sessionToken = queueObject.serverOptions.sessionToken;
|
|
259
|
+
var query = new _ParseQuery.default(ObjectType);
|
|
260
|
+
query.equalTo('objectId', queueObject.id);
|
|
261
|
+
var results = yield query.find({
|
|
262
|
+
sessionToken: sessionToken
|
|
263
|
+
});
|
|
264
|
+
return EventuallyQueue.sendQueueCallback(results[0], queueObject);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
function byId() {
|
|
268
|
+
return _byId.apply(this, arguments);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return byId;
|
|
272
|
+
}(),
|
|
273
|
+
byHash: function () {
|
|
274
|
+
var _byHash = (0, _asyncToGenerator2.default)(function* (ObjectType, queueObject) {
|
|
275
|
+
var sessionToken = queueObject.serverOptions.sessionToken;
|
|
276
|
+
var query = new _ParseQuery.default(ObjectType);
|
|
277
|
+
query.equalTo('hash', queueObject.hash);
|
|
278
|
+
var results = yield query.find({
|
|
279
|
+
sessionToken: sessionToken
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
if (results.length > 0) {
|
|
283
|
+
return EventuallyQueue.sendQueueCallback(results[0], queueObject);
|
|
799
284
|
}
|
|
800
|
-
|
|
801
|
-
|
|
285
|
+
|
|
286
|
+
return EventuallyQueue.process.create(ObjectType, queueObject);
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
function byHash() {
|
|
290
|
+
return _byHash.apply(this, arguments);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
return byHash;
|
|
294
|
+
}()
|
|
802
295
|
}
|
|
803
296
|
};
|
|
804
297
|
module.exports = EventuallyQueue;
|