parse 3.5.0-alpha.3 → 3.5.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/parse.js +5703 -2369
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +5701 -2367
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/EventuallyQueue.js +395 -29
- package/lib/browser/LiveQueryClient.js +2 -6
- package/lib/browser/LocalDatastore.js +392 -18
- package/lib/browser/LocalDatastoreController.js +391 -21
- package/lib/browser/LocalDatastoreController.react-native.js +387 -23
- package/lib/browser/ParseFile.js +388 -22
- package/lib/browser/ParseLiveQuery.js +381 -18
- package/lib/browser/ParseObject.js +405 -41
- package/lib/browser/ParseOp.js +1 -3
- package/lib/browser/ParseQuery.js +396 -47
- package/lib/browser/ParseUser.js +388 -14
- package/lib/browser/StorageController.react-native.js +6 -18
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/ParseObject.js +6 -6
- package/lib/node/ParseQuery.js +1 -3
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/EventuallyQueue.js +376 -27
- package/lib/react-native/LiveQueryClient.js +2 -6
- package/lib/react-native/LocalDatastore.js +374 -26
- package/lib/react-native/LocalDatastoreController.js +365 -16
- package/lib/react-native/LocalDatastoreController.react-native.js +363 -14
- package/lib/react-native/ParseFile.js +359 -16
- package/lib/react-native/ParseLiveQuery.js +357 -8
- package/lib/react-native/ParseObject.js +385 -38
- package/lib/react-native/ParseOp.js +1 -3
- package/lib/react-native/ParseQuery.js +374 -39
- package/lib/react-native/ParseUser.js +368 -19
- package/lib/react-native/StorageController.react-native.js +6 -18
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/EventuallyQueue.js +395 -29
- package/lib/weapp/LiveQueryClient.js +2 -6
- package/lib/weapp/LocalDatastore.js +392 -18
- package/lib/weapp/LocalDatastoreController.js +391 -21
- package/lib/weapp/LocalDatastoreController.react-native.js +387 -23
- package/lib/weapp/ParseFile.js +388 -22
- package/lib/weapp/ParseLiveQuery.js +381 -18
- package/lib/weapp/ParseObject.js +405 -41
- package/lib/weapp/ParseOp.js +1 -3
- package/lib/weapp/ParseQuery.js +396 -47
- package/lib/weapp/ParseUser.js +388 -14
- package/lib/weapp/StorageController.react-native.js +6 -18
- package/package.json +1 -1
|
@@ -2,8 +2,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
2
2
|
|
|
3
3
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
4
4
|
|
|
5
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
6
|
-
|
|
7
5
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
8
6
|
|
|
9
7
|
var _ParseObject = _interopRequireDefault(require("./ParseObject"));
|
|
@@ -12,6 +10,357 @@ var _ParseQuery = _interopRequireDefault(require("./ParseQuery"));
|
|
|
12
10
|
|
|
13
11
|
var _Storage = _interopRequireDefault(require("./Storage"));
|
|
14
12
|
|
|
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
|
+
|
|
15
364
|
var QUEUE_KEY = 'Parse/Eventually/Queue';
|
|
16
365
|
var queueCache = [];
|
|
17
366
|
var dirtyCache = true;
|
|
@@ -38,12 +387,12 @@ var EventuallyQueue = {
|
|
|
38
387
|
},
|
|
39
388
|
enqueue: function (action, object, serverOptions) {
|
|
40
389
|
var queueData, queueId, index, prop;
|
|
41
|
-
return
|
|
390
|
+
return _regeneratorRuntime().async(function (_context) {
|
|
42
391
|
while (1) {
|
|
43
392
|
switch (_context.prev = _context.next) {
|
|
44
393
|
case 0:
|
|
45
394
|
_context.next = 2;
|
|
46
|
-
return
|
|
395
|
+
return _regeneratorRuntime().awrap(this.getQueue());
|
|
47
396
|
|
|
48
397
|
case 2:
|
|
49
398
|
queueData = _context.sent;
|
|
@@ -86,7 +435,7 @@ var EventuallyQueue = {
|
|
|
86
435
|
return _Storage.default.getItemAsync(QUEUE_KEY);
|
|
87
436
|
},
|
|
88
437
|
getQueue: function () {
|
|
89
|
-
return
|
|
438
|
+
return _regeneratorRuntime().async(function (_context2) {
|
|
90
439
|
while (1) {
|
|
91
440
|
switch (_context2.prev = _context2.next) {
|
|
92
441
|
case 0:
|
|
@@ -97,7 +446,7 @@ var EventuallyQueue = {
|
|
|
97
446
|
|
|
98
447
|
_context2.t0 = JSON;
|
|
99
448
|
_context2.next = 4;
|
|
100
|
-
return
|
|
449
|
+
return _regeneratorRuntime().awrap(this.load());
|
|
101
450
|
|
|
102
451
|
case 4:
|
|
103
452
|
_context2.t1 = _context2.sent;
|
|
@@ -130,12 +479,12 @@ var EventuallyQueue = {
|
|
|
130
479
|
},
|
|
131
480
|
remove: function (queueId) {
|
|
132
481
|
var queueData, index;
|
|
133
|
-
return
|
|
482
|
+
return _regeneratorRuntime().async(function (_context3) {
|
|
134
483
|
while (1) {
|
|
135
484
|
switch (_context3.prev = _context3.next) {
|
|
136
485
|
case 0:
|
|
137
486
|
_context3.next = 2;
|
|
138
|
-
return
|
|
487
|
+
return _regeneratorRuntime().awrap(this.getQueue());
|
|
139
488
|
|
|
140
489
|
case 2:
|
|
141
490
|
queueData = _context3.sent;
|
|
@@ -148,7 +497,7 @@ var EventuallyQueue = {
|
|
|
148
497
|
|
|
149
498
|
queueData.splice(index, 1);
|
|
150
499
|
_context3.next = 8;
|
|
151
|
-
return
|
|
500
|
+
return _regeneratorRuntime().awrap(this.setQueue(queueData));
|
|
152
501
|
|
|
153
502
|
case 8:
|
|
154
503
|
case "end":
|
|
@@ -168,12 +517,12 @@ var EventuallyQueue = {
|
|
|
168
517
|
},
|
|
169
518
|
length: function () {
|
|
170
519
|
var queueData;
|
|
171
|
-
return
|
|
520
|
+
return _regeneratorRuntime().async(function (_context4) {
|
|
172
521
|
while (1) {
|
|
173
522
|
switch (_context4.prev = _context4.next) {
|
|
174
523
|
case 0:
|
|
175
524
|
_context4.next = 2;
|
|
176
|
-
return
|
|
525
|
+
return _regeneratorRuntime().awrap(this.getQueue());
|
|
177
526
|
|
|
178
527
|
case 2:
|
|
179
528
|
queueData = _context4.sent;
|
|
@@ -188,12 +537,12 @@ var EventuallyQueue = {
|
|
|
188
537
|
},
|
|
189
538
|
sendQueue: function () {
|
|
190
539
|
var queue, queueData, i, queueObject, id, hash, className, ObjectType;
|
|
191
|
-
return
|
|
540
|
+
return _regeneratorRuntime().async(function (_context5) {
|
|
192
541
|
while (1) {
|
|
193
542
|
switch (_context5.prev = _context5.next) {
|
|
194
543
|
case 0:
|
|
195
544
|
_context5.next = 2;
|
|
196
|
-
return
|
|
545
|
+
return _regeneratorRuntime().awrap(this.getQueue());
|
|
197
546
|
|
|
198
547
|
case 2:
|
|
199
548
|
queue = _context5.sent;
|
|
@@ -225,7 +574,7 @@ var EventuallyQueue = {
|
|
|
225
574
|
}
|
|
226
575
|
|
|
227
576
|
_context5.next = 14;
|
|
228
|
-
return
|
|
577
|
+
return _regeneratorRuntime().awrap(this.process.byId(ObjectType, queueObject));
|
|
229
578
|
|
|
230
579
|
case 14:
|
|
231
580
|
_context5.next = 23;
|
|
@@ -238,7 +587,7 @@ var EventuallyQueue = {
|
|
|
238
587
|
}
|
|
239
588
|
|
|
240
589
|
_context5.next = 19;
|
|
241
|
-
return
|
|
590
|
+
return _regeneratorRuntime().awrap(this.process.byHash(ObjectType, queueObject));
|
|
242
591
|
|
|
243
592
|
case 19:
|
|
244
593
|
_context5.next = 23;
|
|
@@ -246,7 +595,7 @@ var EventuallyQueue = {
|
|
|
246
595
|
|
|
247
596
|
case 21:
|
|
248
597
|
_context5.next = 23;
|
|
249
|
-
return
|
|
598
|
+
return _regeneratorRuntime().awrap(this.process.create(ObjectType, queueObject));
|
|
250
599
|
|
|
251
600
|
case 23:
|
|
252
601
|
i += 1;
|
|
@@ -264,7 +613,7 @@ var EventuallyQueue = {
|
|
|
264
613
|
}, null, this, null, Promise);
|
|
265
614
|
},
|
|
266
615
|
sendQueueCallback: function (object, queueObject) {
|
|
267
|
-
return
|
|
616
|
+
return _regeneratorRuntime().async(function (_context6) {
|
|
268
617
|
while (1) {
|
|
269
618
|
switch (_context6.prev = _context6.next) {
|
|
270
619
|
case 0:
|
|
@@ -291,11 +640,11 @@ var EventuallyQueue = {
|
|
|
291
640
|
case 7:
|
|
292
641
|
_context6.prev = 7;
|
|
293
642
|
_context6.next = 10;
|
|
294
|
-
return
|
|
643
|
+
return _regeneratorRuntime().awrap(object.save(queueObject.object, queueObject.serverOptions));
|
|
295
644
|
|
|
296
645
|
case 10:
|
|
297
646
|
_context6.next = 12;
|
|
298
|
-
return
|
|
647
|
+
return _regeneratorRuntime().awrap(this.remove(queueObject.queueId));
|
|
299
648
|
|
|
300
649
|
case 12:
|
|
301
650
|
_context6.next = 19;
|
|
@@ -311,7 +660,7 @@ var EventuallyQueue = {
|
|
|
311
660
|
}
|
|
312
661
|
|
|
313
662
|
_context6.next = 19;
|
|
314
|
-
return
|
|
663
|
+
return _regeneratorRuntime().awrap(this.remove(queueObject.queueId));
|
|
315
664
|
|
|
316
665
|
case 19:
|
|
317
666
|
return _context6.abrupt("break", 33);
|
|
@@ -319,11 +668,11 @@ var EventuallyQueue = {
|
|
|
319
668
|
case 20:
|
|
320
669
|
_context6.prev = 20;
|
|
321
670
|
_context6.next = 23;
|
|
322
|
-
return
|
|
671
|
+
return _regeneratorRuntime().awrap(object.destroy(queueObject.serverOptions));
|
|
323
672
|
|
|
324
673
|
case 23:
|
|
325
674
|
_context6.next = 25;
|
|
326
|
-
return
|
|
675
|
+
return _regeneratorRuntime().awrap(this.remove(queueObject.queueId));
|
|
327
676
|
|
|
328
677
|
case 25:
|
|
329
678
|
_context6.next = 32;
|
|
@@ -339,7 +688,7 @@ var EventuallyQueue = {
|
|
|
339
688
|
}
|
|
340
689
|
|
|
341
690
|
_context6.next = 32;
|
|
342
|
-
return
|
|
691
|
+
return _regeneratorRuntime().awrap(this.remove(queueObject.queueId));
|
|
343
692
|
|
|
344
693
|
case 32:
|
|
345
694
|
return _context6.abrupt("break", 33);
|
|
@@ -393,7 +742,7 @@ var EventuallyQueue = {
|
|
|
393
742
|
},
|
|
394
743
|
byId: function (ObjectType, queueObject) {
|
|
395
744
|
var sessionToken, query, results;
|
|
396
|
-
return
|
|
745
|
+
return _regeneratorRuntime().async(function (_context7) {
|
|
397
746
|
while (1) {
|
|
398
747
|
switch (_context7.prev = _context7.next) {
|
|
399
748
|
case 0:
|
|
@@ -401,7 +750,7 @@ var EventuallyQueue = {
|
|
|
401
750
|
query = new _ParseQuery.default(ObjectType);
|
|
402
751
|
query.equalTo('objectId', queueObject.id);
|
|
403
752
|
_context7.next = 5;
|
|
404
|
-
return
|
|
753
|
+
return _regeneratorRuntime().awrap(query.find({
|
|
405
754
|
sessionToken: sessionToken
|
|
406
755
|
}));
|
|
407
756
|
|
|
@@ -418,7 +767,7 @@ var EventuallyQueue = {
|
|
|
418
767
|
},
|
|
419
768
|
byHash: function (ObjectType, queueObject) {
|
|
420
769
|
var sessionToken, query, results;
|
|
421
|
-
return
|
|
770
|
+
return _regeneratorRuntime().async(function (_context8) {
|
|
422
771
|
while (1) {
|
|
423
772
|
switch (_context8.prev = _context8.next) {
|
|
424
773
|
case 0:
|
|
@@ -426,7 +775,7 @@ var EventuallyQueue = {
|
|
|
426
775
|
query = new _ParseQuery.default(ObjectType);
|
|
427
776
|
query.equalTo('hash', queueObject.hash);
|
|
428
777
|
_context8.next = 5;
|
|
429
|
-
return
|
|
778
|
+
return _regeneratorRuntime().awrap(query.find({
|
|
430
779
|
sessionToken: sessionToken
|
|
431
780
|
}));
|
|
432
781
|
|
|
@@ -190,8 +190,6 @@ var LiveQueryClient = function (_EventEmitter) {
|
|
|
190
190
|
}, {
|
|
191
191
|
key: "subscribe",
|
|
192
192
|
value: function (query, sessionToken) {
|
|
193
|
-
var _this2 = this;
|
|
194
|
-
|
|
195
193
|
if (!query) {
|
|
196
194
|
return;
|
|
197
195
|
}
|
|
@@ -218,15 +216,13 @@ var LiveQueryClient = function (_EventEmitter) {
|
|
|
218
216
|
this.subscriptions.set(this.requestId, subscription);
|
|
219
217
|
this.requestId += 1;
|
|
220
218
|
this.connectPromise.then(function () {
|
|
221
|
-
|
|
219
|
+
this.socket.send(JSON.stringify(subscribeRequest));
|
|
222
220
|
});
|
|
223
221
|
return subscription;
|
|
224
222
|
}
|
|
225
223
|
}, {
|
|
226
224
|
key: "unsubscribe",
|
|
227
225
|
value: function (subscription) {
|
|
228
|
-
var _this3 = this;
|
|
229
|
-
|
|
230
226
|
if (!subscription) {
|
|
231
227
|
return;
|
|
232
228
|
}
|
|
@@ -237,7 +233,7 @@ var LiveQueryClient = function (_EventEmitter) {
|
|
|
237
233
|
requestId: subscription.id
|
|
238
234
|
};
|
|
239
235
|
this.connectPromise.then(function () {
|
|
240
|
-
|
|
236
|
+
this.socket.send(JSON.stringify(unsubscribeRequest));
|
|
241
237
|
});
|
|
242
238
|
}
|
|
243
239
|
}, {
|