parse 4.0.0-alpha.7 → 4.0.0-alpha.9
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 +3942 -6528
- package/dist/parse.min.js +7 -6
- package/dist/parse.weapp.js +3103 -6459
- 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 +549 -935
- 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 +10 -14
- 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 +225 -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 +549 -935
- 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,38 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse");
|
|
8
|
-
|
|
9
|
-
var _Promise = 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");
|
|
5
|
+
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
|
|
18
6
|
|
|
19
|
-
var
|
|
7
|
+
var _splice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/splice"));
|
|
20
8
|
|
|
21
|
-
var
|
|
9
|
+
var _findIndex = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find-index"));
|
|
22
10
|
|
|
23
|
-
var
|
|
11
|
+
var _setInterval2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-interval"));
|
|
24
12
|
|
|
25
13
|
var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
|
|
26
14
|
|
|
27
|
-
var
|
|
15
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
|
|
28
16
|
|
|
29
17
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toConsumableArray"));
|
|
30
18
|
|
|
31
|
-
var _findIndex = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find-index"));
|
|
32
|
-
|
|
33
|
-
var _splice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/splice"));
|
|
34
|
-
|
|
35
|
-
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
|
|
36
|
-
|
|
37
19
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
|
38
20
|
|
|
39
21
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
@@ -43,364 +25,12 @@ var _ParseObject = _interopRequireDefault(require("./ParseObject"));
|
|
|
43
25
|
var _ParseQuery = _interopRequireDefault(require("./ParseQuery"));
|
|
44
26
|
|
|
45
27
|
var _Storage = _interopRequireDefault(require("./Storage"));
|
|
28
|
+
/**
|
|
29
|
+
* https://github.com/francimedia/parse-js-local-storage
|
|
30
|
+
*
|
|
31
|
+
* @flow
|
|
32
|
+
*/
|
|
46
33
|
|
|
47
|
-
function _regeneratorRuntime() {
|
|
48
|
-
"use strict";
|
|
49
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
50
|
-
|
|
51
|
-
_regeneratorRuntime = function () {
|
|
52
|
-
return exports;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
var exports = {},
|
|
56
|
-
Op = Object.prototype,
|
|
57
|
-
hasOwn = Op.hasOwnProperty,
|
|
58
|
-
$Symbol = "function" == typeof _Symbol ? _Symbol : {},
|
|
59
|
-
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
60
|
-
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
61
|
-
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
62
|
-
|
|
63
|
-
function define(obj, key, value) {
|
|
64
|
-
return _Object$defineProperty(obj, key, {
|
|
65
|
-
value: value,
|
|
66
|
-
enumerable: !0,
|
|
67
|
-
configurable: !0,
|
|
68
|
-
writable: !0
|
|
69
|
-
}), obj[key];
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
try {
|
|
73
|
-
define({}, "");
|
|
74
|
-
} catch (err) {
|
|
75
|
-
define = function (obj, key, value) {
|
|
76
|
-
return obj[key] = value;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
81
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
82
|
-
generator = _Object$create(protoGenerator.prototype),
|
|
83
|
-
context = new Context(tryLocsList || []);
|
|
84
|
-
|
|
85
|
-
return generator._invoke = function (innerFn, self, context) {
|
|
86
|
-
var state = "suspendedStart";
|
|
87
|
-
return function (method, arg) {
|
|
88
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
89
|
-
|
|
90
|
-
if ("completed" === state) {
|
|
91
|
-
if ("throw" === method) throw arg;
|
|
92
|
-
return doneResult();
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
for (context.method = method, context.arg = arg;;) {
|
|
96
|
-
var delegate = context.delegate;
|
|
97
|
-
|
|
98
|
-
if (delegate) {
|
|
99
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
100
|
-
|
|
101
|
-
if (delegateResult) {
|
|
102
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
103
|
-
return delegateResult;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
108
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
109
|
-
context.dispatchException(context.arg);
|
|
110
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
111
|
-
state = "executing";
|
|
112
|
-
var record = tryCatch(innerFn, self, context);
|
|
113
|
-
|
|
114
|
-
if ("normal" === record.type) {
|
|
115
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
116
|
-
return {
|
|
117
|
-
value: record.arg,
|
|
118
|
-
done: context.done
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
}(innerFn, self, context), generator;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function tryCatch(fn, obj, arg) {
|
|
129
|
-
try {
|
|
130
|
-
return {
|
|
131
|
-
type: "normal",
|
|
132
|
-
arg: fn.call(obj, arg)
|
|
133
|
-
};
|
|
134
|
-
} catch (err) {
|
|
135
|
-
return {
|
|
136
|
-
type: "throw",
|
|
137
|
-
arg: err
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
exports.wrap = wrap;
|
|
143
|
-
var ContinueSentinel = {};
|
|
144
|
-
|
|
145
|
-
function Generator() {}
|
|
146
|
-
|
|
147
|
-
function GeneratorFunction() {}
|
|
148
|
-
|
|
149
|
-
function GeneratorFunctionPrototype() {}
|
|
150
|
-
|
|
151
|
-
var IteratorPrototype = {};
|
|
152
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
153
|
-
return this;
|
|
154
|
-
});
|
|
155
|
-
var getProto = _Object$getPrototypeOf,
|
|
156
|
-
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
157
|
-
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
158
|
-
|
|
159
|
-
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype);
|
|
160
|
-
|
|
161
|
-
function defineIteratorMethods(prototype) {
|
|
162
|
-
var _context9;
|
|
163
|
-
|
|
164
|
-
_forEachInstanceProperty(_context9 = ["next", "throw", "return"]).call(_context9, function (method) {
|
|
165
|
-
define(prototype, method, function (arg) {
|
|
166
|
-
return this._invoke(method, arg);
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
172
|
-
function invoke(method, arg, resolve, reject) {
|
|
173
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
174
|
-
|
|
175
|
-
if ("throw" !== record.type) {
|
|
176
|
-
var result = record.arg,
|
|
177
|
-
value = result.value;
|
|
178
|
-
return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
179
|
-
invoke("next", value, resolve, reject);
|
|
180
|
-
}, function (err) {
|
|
181
|
-
invoke("throw", err, resolve, reject);
|
|
182
|
-
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
183
|
-
result.value = unwrapped, resolve(result);
|
|
184
|
-
}, function (error) {
|
|
185
|
-
return invoke("throw", error, resolve, reject);
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
reject(record.arg);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
var previousPromise;
|
|
193
|
-
|
|
194
|
-
this._invoke = function (method, arg) {
|
|
195
|
-
function callInvokeWithMethodAndArg() {
|
|
196
|
-
return new PromiseImpl(function (resolve, reject) {
|
|
197
|
-
invoke(method, arg, resolve, reject);
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
206
|
-
var method = delegate.iterator[context.method];
|
|
207
|
-
|
|
208
|
-
if (undefined === method) {
|
|
209
|
-
if (context.delegate = null, "throw" === context.method) {
|
|
210
|
-
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
211
|
-
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
return ContinueSentinel;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
218
|
-
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
219
|
-
var info = record.arg;
|
|
220
|
-
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);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function pushTryEntry(locs) {
|
|
224
|
-
var entry = {
|
|
225
|
-
tryLoc: locs[0]
|
|
226
|
-
};
|
|
227
|
-
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function resetTryEntry(entry) {
|
|
231
|
-
var record = entry.completion || {};
|
|
232
|
-
record.type = "normal", delete record.arg, entry.completion = record;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
function Context(tryLocsList) {
|
|
236
|
-
this.tryEntries = [{
|
|
237
|
-
tryLoc: "root"
|
|
238
|
-
}], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
function values(iterable) {
|
|
242
|
-
if (iterable) {
|
|
243
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
244
|
-
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
245
|
-
if ("function" == typeof iterable.next) return iterable;
|
|
246
|
-
|
|
247
|
-
if (!isNaN(iterable.length)) {
|
|
248
|
-
var i = -1,
|
|
249
|
-
next = function next() {
|
|
250
|
-
for (; ++i < iterable.length;) {
|
|
251
|
-
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
return next.value = undefined, next.done = !0, next;
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
return next.next = next;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
return {
|
|
262
|
-
next: doneResult
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
function doneResult() {
|
|
267
|
-
return {
|
|
268
|
-
value: undefined,
|
|
269
|
-
done: !0
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
274
|
-
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
275
|
-
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
276
|
-
}, exports.mark = function (genFun) {
|
|
277
|
-
return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun;
|
|
278
|
-
}, exports.awrap = function (arg) {
|
|
279
|
-
return {
|
|
280
|
-
__await: arg
|
|
281
|
-
};
|
|
282
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
283
|
-
return this;
|
|
284
|
-
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
285
|
-
void 0 === PromiseImpl && (PromiseImpl = _Promise);
|
|
286
|
-
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
287
|
-
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
288
|
-
return result.done ? result.value : iter.next();
|
|
289
|
-
});
|
|
290
|
-
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
291
|
-
return this;
|
|
292
|
-
}), define(Gp, "toString", function () {
|
|
293
|
-
return "[object Generator]";
|
|
294
|
-
}), exports.keys = function (object) {
|
|
295
|
-
var keys = [];
|
|
296
|
-
|
|
297
|
-
for (var key in object) {
|
|
298
|
-
keys.push(key);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
return _reverseInstanceProperty(keys).call(keys), function next() {
|
|
302
|
-
for (; keys.length;) {
|
|
303
|
-
var key = keys.pop();
|
|
304
|
-
if (key in object) return next.value = key, next.done = !1, next;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
return next.done = !0, next;
|
|
308
|
-
};
|
|
309
|
-
}, exports.values = values, Context.prototype = {
|
|
310
|
-
constructor: Context,
|
|
311
|
-
reset: function (skipTempReset) {
|
|
312
|
-
var _context10;
|
|
313
|
-
|
|
314
|
-
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(_context10 = this.tryEntries).call(_context10, resetTryEntry), !skipTempReset) for (var name in this) {
|
|
315
|
-
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined);
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
stop: function () {
|
|
319
|
-
this.done = !0;
|
|
320
|
-
var rootRecord = this.tryEntries[0].completion;
|
|
321
|
-
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
322
|
-
return this.rval;
|
|
323
|
-
},
|
|
324
|
-
dispatchException: function (exception) {
|
|
325
|
-
if (this.done) throw exception;
|
|
326
|
-
var context = this;
|
|
327
|
-
|
|
328
|
-
function handle(loc, caught) {
|
|
329
|
-
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
333
|
-
var entry = this.tryEntries[i],
|
|
334
|
-
record = entry.completion;
|
|
335
|
-
if ("root" === entry.tryLoc) return handle("end");
|
|
336
|
-
|
|
337
|
-
if (entry.tryLoc <= this.prev) {
|
|
338
|
-
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
339
|
-
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
340
|
-
|
|
341
|
-
if (hasCatch && hasFinally) {
|
|
342
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
343
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
344
|
-
} else if (hasCatch) {
|
|
345
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
346
|
-
} else {
|
|
347
|
-
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
348
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
abrupt: function (type, arg) {
|
|
354
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
355
|
-
var entry = this.tryEntries[i];
|
|
356
|
-
|
|
357
|
-
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
358
|
-
var finallyEntry = entry;
|
|
359
|
-
break;
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
364
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
365
|
-
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
366
|
-
},
|
|
367
|
-
complete: function (record, afterLoc) {
|
|
368
|
-
if ("throw" === record.type) throw record.arg;
|
|
369
|
-
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;
|
|
370
|
-
},
|
|
371
|
-
finish: function (finallyLoc) {
|
|
372
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
373
|
-
var entry = this.tryEntries[i];
|
|
374
|
-
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
375
|
-
}
|
|
376
|
-
},
|
|
377
|
-
catch: function (tryLoc) {
|
|
378
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
379
|
-
var entry = this.tryEntries[i];
|
|
380
|
-
|
|
381
|
-
if (entry.tryLoc === tryLoc) {
|
|
382
|
-
var record = entry.completion;
|
|
383
|
-
|
|
384
|
-
if ("throw" === record.type) {
|
|
385
|
-
var thrown = record.arg;
|
|
386
|
-
resetTryEntry(entry);
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
return thrown;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
throw new Error("illegal catch attempt");
|
|
394
|
-
},
|
|
395
|
-
delegateYield: function (iterable, resultName, nextLoc) {
|
|
396
|
-
return this.delegate = {
|
|
397
|
-
iterator: values(iterable),
|
|
398
|
-
resultName: resultName,
|
|
399
|
-
nextLoc: nextLoc
|
|
400
|
-
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
401
|
-
}
|
|
402
|
-
}, exports;
|
|
403
|
-
}
|
|
404
34
|
|
|
405
35
|
var QUEUE_KEY = 'Parse/Eventually/Queue';
|
|
406
36
|
var queueCache = [];
|
|
@@ -507,55 +137,53 @@ var EventuallyQueue = {
|
|
|
507
137
|
{
|
|
508
138
|
var _this = this;
|
|
509
139
|
|
|
510
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
140
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
511
141
|
var queueData, queueId, index, prop;
|
|
512
|
-
return
|
|
513
|
-
while (1) {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
if
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
object.set(prop, queueData[index].object[prop]);
|
|
529
|
-
}
|
|
142
|
+
return _regenerator.default.wrap(function (_context) {
|
|
143
|
+
while (1) switch (_context.prev = _context.next) {
|
|
144
|
+
case 0:
|
|
145
|
+
_context.next = 2;
|
|
146
|
+
return _this.getQueue();
|
|
147
|
+
|
|
148
|
+
case 2:
|
|
149
|
+
queueData = _context.sent;
|
|
150
|
+
queueId = _this.generateQueueId(action, object);
|
|
151
|
+
index = _this.queueItemExists(queueData, queueId);
|
|
152
|
+
|
|
153
|
+
if (index > -1) {
|
|
154
|
+
// Add cached values to new object if they don't exist
|
|
155
|
+
for (prop in queueData[index].object) {
|
|
156
|
+
if (typeof object.get(prop) === 'undefined') {
|
|
157
|
+
object.set(prop, queueData[index].object[prop]);
|
|
530
158
|
}
|
|
531
|
-
} else {
|
|
532
|
-
index = queueData.length;
|
|
533
159
|
}
|
|
160
|
+
} else {
|
|
161
|
+
index = queueData.length;
|
|
162
|
+
}
|
|
534
163
|
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
164
|
+
queueData[index] = {
|
|
165
|
+
queueId: queueId,
|
|
166
|
+
action: action,
|
|
167
|
+
object: object.toJSON(),
|
|
168
|
+
serverOptions: serverOptions,
|
|
169
|
+
id: object.id,
|
|
170
|
+
className: object.className,
|
|
171
|
+
hash: object.get('hash'),
|
|
172
|
+
createdAt: new Date()
|
|
173
|
+
};
|
|
174
|
+
return _context.abrupt("return", _this.setQueue(queueData));
|
|
546
175
|
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
}
|
|
176
|
+
case 8:
|
|
177
|
+
case "end":
|
|
178
|
+
return _context.stop();
|
|
551
179
|
}
|
|
552
180
|
}, _callee);
|
|
553
181
|
}))();
|
|
554
182
|
},
|
|
555
|
-
store: function
|
|
183
|
+
store: function (data) {
|
|
556
184
|
return _Storage.default.setItemAsync(QUEUE_KEY, (0, _stringify.default)(data));
|
|
557
185
|
},
|
|
558
|
-
load: function
|
|
186
|
+
load: function () {
|
|
559
187
|
return _Storage.default.getItemAsync(QUEUE_KEY);
|
|
560
188
|
},
|
|
561
189
|
|
|
@@ -567,47 +195,45 @@ var EventuallyQueue = {
|
|
|
567
195
|
* @returns {Promise<Array>}
|
|
568
196
|
* @static
|
|
569
197
|
*/
|
|
570
|
-
getQueue: function
|
|
198
|
+
getQueue: function ()
|
|
571
199
|
/*: Promise<Array>*/
|
|
572
200
|
{
|
|
573
201
|
var _this2 = this;
|
|
574
202
|
|
|
575
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
576
|
-
return
|
|
577
|
-
while (1) {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
}
|
|
203
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
204
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
205
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
206
|
+
case 0:
|
|
207
|
+
if (!dirtyCache) {
|
|
208
|
+
_context2.next = 10;
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
584
211
|
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
212
|
+
_context2.t0 = JSON;
|
|
213
|
+
_context2.next = 4;
|
|
214
|
+
return _this2.load();
|
|
588
215
|
|
|
589
|
-
|
|
590
|
-
|
|
216
|
+
case 4:
|
|
217
|
+
_context2.t1 = _context2.sent;
|
|
591
218
|
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
219
|
+
if (_context2.t1) {
|
|
220
|
+
_context2.next = 7;
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
596
223
|
|
|
597
|
-
|
|
224
|
+
_context2.t1 = '[]';
|
|
598
225
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
226
|
+
case 7:
|
|
227
|
+
_context2.t2 = _context2.t1;
|
|
228
|
+
queueCache = _context2.t0.parse.call(_context2.t0, _context2.t2);
|
|
229
|
+
dirtyCache = false;
|
|
603
230
|
|
|
604
|
-
|
|
605
|
-
|
|
231
|
+
case 10:
|
|
232
|
+
return _context2.abrupt("return", queueCache);
|
|
606
233
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
}
|
|
234
|
+
case 11:
|
|
235
|
+
case "end":
|
|
236
|
+
return _context2.stop();
|
|
611
237
|
}
|
|
612
238
|
}, _callee2);
|
|
613
239
|
}))();
|
|
@@ -621,7 +247,7 @@ var EventuallyQueue = {
|
|
|
621
247
|
* @static
|
|
622
248
|
* @ignore
|
|
623
249
|
*/
|
|
624
|
-
setQueue: function
|
|
250
|
+
setQueue: function (queue
|
|
625
251
|
/*: Queue*/
|
|
626
252
|
)
|
|
627
253
|
/*: Promise<void>*/
|
|
@@ -638,39 +264,37 @@ var EventuallyQueue = {
|
|
|
638
264
|
* @static
|
|
639
265
|
* @ignore
|
|
640
266
|
*/
|
|
641
|
-
remove: function
|
|
267
|
+
remove: function (queueId
|
|
642
268
|
/*: string*/
|
|
643
269
|
)
|
|
644
270
|
/*: Promise<void>*/
|
|
645
271
|
{
|
|
646
272
|
var _this3 = this;
|
|
647
273
|
|
|
648
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
274
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
649
275
|
var queueData, index;
|
|
650
|
-
return
|
|
651
|
-
while (1) {
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
return _this3.getQueue();
|
|
656
|
-
|
|
657
|
-
case 2:
|
|
658
|
-
queueData = _context3.sent;
|
|
659
|
-
index = _this3.queueItemExists(queueData, queueId);
|
|
276
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
277
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
278
|
+
case 0:
|
|
279
|
+
_context3.next = 2;
|
|
280
|
+
return _this3.getQueue();
|
|
660
281
|
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
}
|
|
282
|
+
case 2:
|
|
283
|
+
queueData = _context3.sent;
|
|
284
|
+
index = _this3.queueItemExists(queueData, queueId);
|
|
665
285
|
|
|
666
|
-
|
|
286
|
+
if (!(index > -1)) {
|
|
667
287
|
_context3.next = 8;
|
|
668
|
-
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
669
290
|
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
291
|
+
(0, _splice.default)(queueData).call(queueData, index, 1);
|
|
292
|
+
_context3.next = 8;
|
|
293
|
+
return _this3.setQueue(queueData);
|
|
294
|
+
|
|
295
|
+
case 8:
|
|
296
|
+
case "end":
|
|
297
|
+
return _context3.stop();
|
|
674
298
|
}
|
|
675
299
|
}, _callee3);
|
|
676
300
|
}))();
|
|
@@ -684,7 +308,7 @@ var EventuallyQueue = {
|
|
|
684
308
|
* @returns {Promise} A promise that is fulfilled when queue is cleared.
|
|
685
309
|
* @static
|
|
686
310
|
*/
|
|
687
|
-
clear: function
|
|
311
|
+
clear: function ()
|
|
688
312
|
/*: Promise*/
|
|
689
313
|
{
|
|
690
314
|
queueCache = [];
|
|
@@ -700,7 +324,7 @@ var EventuallyQueue = {
|
|
|
700
324
|
* @static
|
|
701
325
|
* @ignore
|
|
702
326
|
*/
|
|
703
|
-
queueItemExists: function
|
|
327
|
+
queueItemExists: function (queue
|
|
704
328
|
/*: Queue*/
|
|
705
329
|
, queueId
|
|
706
330
|
/*: string*/
|
|
@@ -720,28 +344,26 @@ var EventuallyQueue = {
|
|
|
720
344
|
* @returns {number}
|
|
721
345
|
* @static
|
|
722
346
|
*/
|
|
723
|
-
length: function
|
|
347
|
+
length: function ()
|
|
724
348
|
/*: number*/
|
|
725
349
|
{
|
|
726
350
|
var _this4 = this;
|
|
727
351
|
|
|
728
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
352
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
729
353
|
var queueData;
|
|
730
|
-
return
|
|
731
|
-
while (1) {
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
return _context4.stop();
|
|
744
|
-
}
|
|
354
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
355
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
356
|
+
case 0:
|
|
357
|
+
_context4.next = 2;
|
|
358
|
+
return _this4.getQueue();
|
|
359
|
+
|
|
360
|
+
case 2:
|
|
361
|
+
queueData = _context4.sent;
|
|
362
|
+
return _context4.abrupt("return", queueData.length);
|
|
363
|
+
|
|
364
|
+
case 4:
|
|
365
|
+
case "end":
|
|
366
|
+
return _context4.stop();
|
|
745
367
|
}
|
|
746
368
|
}, _callee4);
|
|
747
369
|
}))();
|
|
@@ -755,85 +377,83 @@ var EventuallyQueue = {
|
|
|
755
377
|
* @returns {Promise<boolean>} Returns true if queue was sent successfully.
|
|
756
378
|
* @static
|
|
757
379
|
*/
|
|
758
|
-
sendQueue: function
|
|
380
|
+
sendQueue: function ()
|
|
759
381
|
/*: Promise<boolean>*/
|
|
760
382
|
{
|
|
761
383
|
var _this5 = this;
|
|
762
384
|
|
|
763
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
385
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
764
386
|
var queue, queueData, i, queueObject, id, hash, className, ObjectType;
|
|
765
|
-
return
|
|
766
|
-
while (1) {
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
387
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
388
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
389
|
+
case 0:
|
|
390
|
+
_context5.next = 2;
|
|
391
|
+
return _this5.getQueue();
|
|
392
|
+
|
|
393
|
+
case 2:
|
|
394
|
+
queue = _context5.sent;
|
|
395
|
+
queueData = (0, _toConsumableArray2.default)(queue);
|
|
396
|
+
|
|
397
|
+
if (!(queueData.length === 0)) {
|
|
398
|
+
_context5.next = 6;
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
775
401
|
|
|
776
|
-
|
|
777
|
-
_context5.next = 6;
|
|
778
|
-
break;
|
|
779
|
-
}
|
|
402
|
+
return _context5.abrupt("return", false);
|
|
780
403
|
|
|
781
|
-
|
|
404
|
+
case 6:
|
|
405
|
+
i = 0;
|
|
782
406
|
|
|
783
|
-
|
|
784
|
-
|
|
407
|
+
case 7:
|
|
408
|
+
if (!(i < queueData.length)) {
|
|
409
|
+
_context5.next = 26;
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
785
412
|
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
break;
|
|
790
|
-
}
|
|
413
|
+
queueObject = queueData[i];
|
|
414
|
+
id = queueObject.id, hash = queueObject.hash, className = queueObject.className;
|
|
415
|
+
ObjectType = _ParseObject.default.extend(className);
|
|
791
416
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
417
|
+
if (!id) {
|
|
418
|
+
_context5.next = 16;
|
|
419
|
+
break;
|
|
420
|
+
}
|
|
795
421
|
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
break;
|
|
799
|
-
}
|
|
422
|
+
_context5.next = 14;
|
|
423
|
+
return _this5.process.byId(ObjectType, queueObject);
|
|
800
424
|
|
|
801
|
-
|
|
802
|
-
|
|
425
|
+
case 14:
|
|
426
|
+
_context5.next = 23;
|
|
427
|
+
break;
|
|
803
428
|
|
|
804
|
-
|
|
805
|
-
|
|
429
|
+
case 16:
|
|
430
|
+
if (!hash) {
|
|
431
|
+
_context5.next = 21;
|
|
806
432
|
break;
|
|
433
|
+
}
|
|
807
434
|
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
_context5.next = 21;
|
|
811
|
-
break;
|
|
812
|
-
}
|
|
435
|
+
_context5.next = 19;
|
|
436
|
+
return _this5.process.byHash(ObjectType, queueObject);
|
|
813
437
|
|
|
814
|
-
|
|
815
|
-
|
|
438
|
+
case 19:
|
|
439
|
+
_context5.next = 23;
|
|
440
|
+
break;
|
|
816
441
|
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
442
|
+
case 21:
|
|
443
|
+
_context5.next = 23;
|
|
444
|
+
return _this5.process.create(ObjectType, queueObject);
|
|
820
445
|
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
446
|
+
case 23:
|
|
447
|
+
i += 1;
|
|
448
|
+
_context5.next = 7;
|
|
449
|
+
break;
|
|
824
450
|
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
_context5.next = 7;
|
|
828
|
-
break;
|
|
829
|
-
|
|
830
|
-
case 26:
|
|
831
|
-
return _context5.abrupt("return", true);
|
|
451
|
+
case 26:
|
|
452
|
+
return _context5.abrupt("return", true);
|
|
832
453
|
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
}
|
|
454
|
+
case 27:
|
|
455
|
+
case "end":
|
|
456
|
+
return _context5.stop();
|
|
837
457
|
}
|
|
838
458
|
}, _callee5);
|
|
839
459
|
}))();
|
|
@@ -848,7 +468,7 @@ var EventuallyQueue = {
|
|
|
848
468
|
* @static
|
|
849
469
|
* @ignore
|
|
850
470
|
*/
|
|
851
|
-
sendQueueCallback: function
|
|
471
|
+
sendQueueCallback: function (object
|
|
852
472
|
/*: ParseObject*/
|
|
853
473
|
, queueObject
|
|
854
474
|
/*: QueueObject*/
|
|
@@ -857,91 +477,89 @@ var EventuallyQueue = {
|
|
|
857
477
|
{
|
|
858
478
|
var _this6 = this;
|
|
859
479
|
|
|
860
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
861
|
-
return
|
|
862
|
-
while (1) {
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
}
|
|
480
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
481
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
482
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
483
|
+
case 0:
|
|
484
|
+
if (object) {
|
|
485
|
+
_context6.next = 2;
|
|
486
|
+
break;
|
|
487
|
+
}
|
|
869
488
|
|
|
870
|
-
|
|
489
|
+
return _context6.abrupt("return", _this6.remove(queueObject.queueId));
|
|
871
490
|
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
491
|
+
case 2:
|
|
492
|
+
_context6.t0 = queueObject.action;
|
|
493
|
+
_context6.next = _context6.t0 === 'save' ? 5 : _context6.t0 === 'destroy' ? 20 : 33;
|
|
494
|
+
break;
|
|
495
|
+
|
|
496
|
+
case 5:
|
|
497
|
+
if (!(typeof object.updatedAt !== 'undefined' && object.updatedAt > new Date(queueObject.object.createdAt))) {
|
|
498
|
+
_context6.next = 7;
|
|
875
499
|
break;
|
|
500
|
+
}
|
|
876
501
|
|
|
877
|
-
|
|
878
|
-
if (!(typeof object.updatedAt !== 'undefined' && object.updatedAt > new Date(queueObject.object.createdAt))) {
|
|
879
|
-
_context6.next = 7;
|
|
880
|
-
break;
|
|
881
|
-
}
|
|
502
|
+
return _context6.abrupt("return", _this6.remove(queueObject.queueId));
|
|
882
503
|
|
|
883
|
-
|
|
504
|
+
case 7:
|
|
505
|
+
_context6.prev = 7;
|
|
506
|
+
_context6.next = 10;
|
|
507
|
+
return object.save(queueObject.object, queueObject.serverOptions);
|
|
884
508
|
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
return object.save(queueObject.object, queueObject.serverOptions);
|
|
509
|
+
case 10:
|
|
510
|
+
_context6.next = 12;
|
|
511
|
+
return _this6.remove(queueObject.queueId);
|
|
889
512
|
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
513
|
+
case 12:
|
|
514
|
+
_context6.next = 19;
|
|
515
|
+
break;
|
|
893
516
|
|
|
894
|
-
|
|
517
|
+
case 14:
|
|
518
|
+
_context6.prev = 14;
|
|
519
|
+
_context6.t1 = _context6["catch"](7);
|
|
520
|
+
|
|
521
|
+
if (!(_context6.t1.message !== 'XMLHttpRequest failed: "Unable to connect to the Parse API"')) {
|
|
895
522
|
_context6.next = 19;
|
|
896
523
|
break;
|
|
524
|
+
}
|
|
897
525
|
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
_context6.t1 = _context6["catch"](7);
|
|
526
|
+
_context6.next = 19;
|
|
527
|
+
return _this6.remove(queueObject.queueId);
|
|
901
528
|
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
break;
|
|
905
|
-
}
|
|
529
|
+
case 19:
|
|
530
|
+
return _context6.abrupt("break", 33);
|
|
906
531
|
|
|
907
|
-
|
|
908
|
-
|
|
532
|
+
case 20:
|
|
533
|
+
_context6.prev = 20;
|
|
534
|
+
_context6.next = 23;
|
|
535
|
+
return object.destroy(queueObject.serverOptions);
|
|
909
536
|
|
|
910
|
-
|
|
911
|
-
|
|
537
|
+
case 23:
|
|
538
|
+
_context6.next = 25;
|
|
539
|
+
return _this6.remove(queueObject.queueId);
|
|
912
540
|
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
return object.destroy(queueObject.serverOptions);
|
|
541
|
+
case 25:
|
|
542
|
+
_context6.next = 32;
|
|
543
|
+
break;
|
|
917
544
|
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
545
|
+
case 27:
|
|
546
|
+
_context6.prev = 27;
|
|
547
|
+
_context6.t2 = _context6["catch"](20);
|
|
921
548
|
|
|
922
|
-
|
|
549
|
+
if (!(_context6.t2.message !== 'XMLHttpRequest failed: "Unable to connect to the Parse API"')) {
|
|
923
550
|
_context6.next = 32;
|
|
924
551
|
break;
|
|
552
|
+
}
|
|
925
553
|
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
_context6.t2 = _context6["catch"](20);
|
|
929
|
-
|
|
930
|
-
if (!(_context6.t2.message !== 'XMLHttpRequest failed: "Unable to connect to the Parse API"')) {
|
|
931
|
-
_context6.next = 32;
|
|
932
|
-
break;
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
_context6.next = 32;
|
|
936
|
-
return _this6.remove(queueObject.queueId);
|
|
554
|
+
_context6.next = 32;
|
|
555
|
+
return _this6.remove(queueObject.queueId);
|
|
937
556
|
|
|
938
|
-
|
|
939
|
-
|
|
557
|
+
case 32:
|
|
558
|
+
return _context6.abrupt("break", 33);
|
|
940
559
|
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
}
|
|
560
|
+
case 33:
|
|
561
|
+
case "end":
|
|
562
|
+
return _context6.stop();
|
|
945
563
|
}
|
|
946
564
|
}, _callee6, null, [[7, 14], [20, 27]]);
|
|
947
565
|
}))();
|
|
@@ -956,7 +574,7 @@ var EventuallyQueue = {
|
|
|
956
574
|
* @param [ms] Milliseconds to ping the server. Default 2000ms
|
|
957
575
|
* @static
|
|
958
576
|
*/
|
|
959
|
-
poll: function
|
|
577
|
+
poll: function () {
|
|
960
578
|
var _this7 = this;
|
|
961
579
|
|
|
962
580
|
var ms
|
|
@@ -991,7 +609,7 @@ var EventuallyQueue = {
|
|
|
991
609
|
* @name Parse.EventuallyQueue.stopPoll
|
|
992
610
|
* @static
|
|
993
611
|
*/
|
|
994
|
-
stopPoll: function
|
|
612
|
+
stopPoll: function () {
|
|
995
613
|
clearInterval(polling);
|
|
996
614
|
polling = undefined;
|
|
997
615
|
},
|
|
@@ -1004,80 +622,76 @@ var EventuallyQueue = {
|
|
|
1004
622
|
* @returns {boolean}
|
|
1005
623
|
* @static
|
|
1006
624
|
*/
|
|
1007
|
-
isPolling: function
|
|
625
|
+
isPolling: function ()
|
|
1008
626
|
/*: boolean*/
|
|
1009
627
|
{
|
|
1010
628
|
return !!polling;
|
|
1011
629
|
},
|
|
1012
|
-
_setPolling: function
|
|
630
|
+
_setPolling: function (flag
|
|
1013
631
|
/*: boolean*/
|
|
1014
632
|
) {
|
|
1015
633
|
polling = flag;
|
|
1016
634
|
},
|
|
1017
635
|
process: {
|
|
1018
|
-
create: function
|
|
636
|
+
create: function (ObjectType, queueObject) {
|
|
1019
637
|
var object = new ObjectType();
|
|
1020
638
|
return EventuallyQueue.sendQueueCallback(object, queueObject);
|
|
1021
639
|
},
|
|
1022
|
-
byId: function
|
|
1023
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
640
|
+
byId: function (ObjectType, queueObject) {
|
|
641
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
1024
642
|
var sessionToken, query, results;
|
|
1025
|
-
return
|
|
1026
|
-
while (1) {
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
return _context7.stop();
|
|
1044
|
-
}
|
|
643
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
644
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
645
|
+
case 0:
|
|
646
|
+
sessionToken = queueObject.serverOptions.sessionToken;
|
|
647
|
+
query = new _ParseQuery.default(ObjectType);
|
|
648
|
+
query.equalTo('objectId', queueObject.id);
|
|
649
|
+
_context7.next = 5;
|
|
650
|
+
return (0, _find.default)(query).call(query, {
|
|
651
|
+
sessionToken: sessionToken
|
|
652
|
+
});
|
|
653
|
+
|
|
654
|
+
case 5:
|
|
655
|
+
results = _context7.sent;
|
|
656
|
+
return _context7.abrupt("return", EventuallyQueue.sendQueueCallback(results[0], queueObject));
|
|
657
|
+
|
|
658
|
+
case 7:
|
|
659
|
+
case "end":
|
|
660
|
+
return _context7.stop();
|
|
1045
661
|
}
|
|
1046
662
|
}, _callee7);
|
|
1047
663
|
}))();
|
|
1048
664
|
},
|
|
1049
|
-
byHash: function
|
|
1050
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
665
|
+
byHash: function (ObjectType, queueObject) {
|
|
666
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
1051
667
|
var sessionToken, query, results;
|
|
1052
|
-
return
|
|
1053
|
-
while (1) {
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
results = _context8.sent;
|
|
1066
|
-
|
|
1067
|
-
if (!(results.length > 0)) {
|
|
1068
|
-
_context8.next = 8;
|
|
1069
|
-
break;
|
|
1070
|
-
}
|
|
668
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
669
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
670
|
+
case 0:
|
|
671
|
+
sessionToken = queueObject.serverOptions.sessionToken;
|
|
672
|
+
query = new _ParseQuery.default(ObjectType);
|
|
673
|
+
query.equalTo('hash', queueObject.hash);
|
|
674
|
+
_context8.next = 5;
|
|
675
|
+
return (0, _find.default)(query).call(query, {
|
|
676
|
+
sessionToken: sessionToken
|
|
677
|
+
});
|
|
678
|
+
|
|
679
|
+
case 5:
|
|
680
|
+
results = _context8.sent;
|
|
1071
681
|
|
|
1072
|
-
|
|
682
|
+
if (!(results.length > 0)) {
|
|
683
|
+
_context8.next = 8;
|
|
684
|
+
break;
|
|
685
|
+
}
|
|
1073
686
|
|
|
1074
|
-
|
|
1075
|
-
return _context8.abrupt("return", EventuallyQueue.process.create(ObjectType, queueObject));
|
|
687
|
+
return _context8.abrupt("return", EventuallyQueue.sendQueueCallback(results[0], queueObject));
|
|
1076
688
|
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
689
|
+
case 8:
|
|
690
|
+
return _context8.abrupt("return", EventuallyQueue.process.create(ObjectType, queueObject));
|
|
691
|
+
|
|
692
|
+
case 9:
|
|
693
|
+
case "end":
|
|
694
|
+
return _context8.stop();
|
|
1081
695
|
}
|
|
1082
696
|
}, _callee8);
|
|
1083
697
|
}))();
|