parse 3.5.0-alpha.3 → 3.5.0-alpha.5
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 +5732 -2377
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +5730 -2375
- 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/OfflineQuery.js +29 -8
- 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/OfflineQuery.js +18 -3
- 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/OfflineQuery.js +28 -7
- 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/OfflineQuery.js +29 -8
- 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
|
@@ -9,8 +9,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
|
|
12
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
|
|
14
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
13
|
|
|
16
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -43,6 +41,357 @@ function _objectSpread(target) {
|
|
|
43
41
|
return target;
|
|
44
42
|
}
|
|
45
43
|
|
|
44
|
+
function _regeneratorRuntime() {
|
|
45
|
+
"use strict";
|
|
46
|
+
|
|
47
|
+
_regeneratorRuntime = function () {
|
|
48
|
+
return exports;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var exports = {},
|
|
52
|
+
Op = Object.prototype,
|
|
53
|
+
hasOwn = Op.hasOwnProperty,
|
|
54
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
55
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
56
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
57
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
58
|
+
|
|
59
|
+
function define(obj, key, value) {
|
|
60
|
+
return Object.defineProperty(obj, key, {
|
|
61
|
+
value: value,
|
|
62
|
+
enumerable: !0,
|
|
63
|
+
configurable: !0,
|
|
64
|
+
writable: !0
|
|
65
|
+
}), obj[key];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
try {
|
|
69
|
+
define({}, "");
|
|
70
|
+
} catch (err) {
|
|
71
|
+
define = function (obj, key, value) {
|
|
72
|
+
return obj[key] = value;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
77
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
78
|
+
generator = Object.create(protoGenerator.prototype),
|
|
79
|
+
context = new Context(tryLocsList || []);
|
|
80
|
+
return generator._invoke = function (innerFn, self, context) {
|
|
81
|
+
var state = "suspendedStart";
|
|
82
|
+
return function (method, arg) {
|
|
83
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
84
|
+
|
|
85
|
+
if ("completed" === state) {
|
|
86
|
+
if ("throw" === method) throw arg;
|
|
87
|
+
return doneResult();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
for (context.method = method, context.arg = arg;;) {
|
|
91
|
+
var delegate = context.delegate;
|
|
92
|
+
|
|
93
|
+
if (delegate) {
|
|
94
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
95
|
+
|
|
96
|
+
if (delegateResult) {
|
|
97
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
98
|
+
return delegateResult;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
103
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
104
|
+
context.dispatchException(context.arg);
|
|
105
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
106
|
+
state = "executing";
|
|
107
|
+
var record = tryCatch(innerFn, self, context);
|
|
108
|
+
|
|
109
|
+
if ("normal" === record.type) {
|
|
110
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
111
|
+
return {
|
|
112
|
+
value: record.arg,
|
|
113
|
+
done: context.done
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}(innerFn, self, context), generator;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function tryCatch(fn, obj, arg) {
|
|
124
|
+
try {
|
|
125
|
+
return {
|
|
126
|
+
type: "normal",
|
|
127
|
+
arg: fn.call(obj, arg)
|
|
128
|
+
};
|
|
129
|
+
} catch (err) {
|
|
130
|
+
return {
|
|
131
|
+
type: "throw",
|
|
132
|
+
arg: err
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
exports.wrap = wrap;
|
|
138
|
+
var ContinueSentinel = {};
|
|
139
|
+
|
|
140
|
+
function Generator() {}
|
|
141
|
+
|
|
142
|
+
function GeneratorFunction() {}
|
|
143
|
+
|
|
144
|
+
function GeneratorFunctionPrototype() {}
|
|
145
|
+
|
|
146
|
+
var IteratorPrototype = {};
|
|
147
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
148
|
+
return this;
|
|
149
|
+
});
|
|
150
|
+
var getProto = Object.getPrototypeOf,
|
|
151
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
152
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
153
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
154
|
+
|
|
155
|
+
function defineIteratorMethods(prototype) {
|
|
156
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
157
|
+
define(prototype, method, function (arg) {
|
|
158
|
+
return this._invoke(method, arg);
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
164
|
+
function invoke(method, arg, resolve, reject) {
|
|
165
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
166
|
+
|
|
167
|
+
if ("throw" !== record.type) {
|
|
168
|
+
var result = record.arg,
|
|
169
|
+
value = result.value;
|
|
170
|
+
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
171
|
+
invoke("next", value, resolve, reject);
|
|
172
|
+
}, function (err) {
|
|
173
|
+
invoke("throw", err, resolve, reject);
|
|
174
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
175
|
+
result.value = unwrapped, resolve(result);
|
|
176
|
+
}, function (error) {
|
|
177
|
+
return invoke("throw", error, resolve, reject);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
reject(record.arg);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
var previousPromise;
|
|
185
|
+
|
|
186
|
+
this._invoke = function (method, arg) {
|
|
187
|
+
function callInvokeWithMethodAndArg() {
|
|
188
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
189
|
+
invoke(method, arg, resolve, reject);
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
198
|
+
var method = delegate.iterator[context.method];
|
|
199
|
+
|
|
200
|
+
if (undefined === method) {
|
|
201
|
+
if (context.delegate = null, "throw" === context.method) {
|
|
202
|
+
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
203
|
+
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return ContinueSentinel;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
210
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
211
|
+
var info = record.arg;
|
|
212
|
+
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);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function pushTryEntry(locs) {
|
|
216
|
+
var entry = {
|
|
217
|
+
tryLoc: locs[0]
|
|
218
|
+
};
|
|
219
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function resetTryEntry(entry) {
|
|
223
|
+
var record = entry.completion || {};
|
|
224
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function Context(tryLocsList) {
|
|
228
|
+
this.tryEntries = [{
|
|
229
|
+
tryLoc: "root"
|
|
230
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function values(iterable) {
|
|
234
|
+
if (iterable) {
|
|
235
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
236
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
237
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
238
|
+
|
|
239
|
+
if (!isNaN(iterable.length)) {
|
|
240
|
+
var i = -1,
|
|
241
|
+
next = function next() {
|
|
242
|
+
for (; ++i < iterable.length;) {
|
|
243
|
+
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
return next.value = undefined, next.done = !0, next;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
return next.next = next;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return {
|
|
254
|
+
next: doneResult
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function doneResult() {
|
|
259
|
+
return {
|
|
260
|
+
value: undefined,
|
|
261
|
+
done: !0
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
266
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
267
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
268
|
+
}, exports.mark = function (genFun) {
|
|
269
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
270
|
+
}, exports.awrap = function (arg) {
|
|
271
|
+
return {
|
|
272
|
+
__await: arg
|
|
273
|
+
};
|
|
274
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
275
|
+
return this;
|
|
276
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
277
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
278
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
279
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
280
|
+
return result.done ? result.value : iter.next();
|
|
281
|
+
});
|
|
282
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
283
|
+
return this;
|
|
284
|
+
}), define(Gp, "toString", function () {
|
|
285
|
+
return "[object Generator]";
|
|
286
|
+
}), exports.keys = function (object) {
|
|
287
|
+
var keys = [];
|
|
288
|
+
|
|
289
|
+
for (var key in object) {
|
|
290
|
+
keys.push(key);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
return keys.reverse(), function next() {
|
|
294
|
+
for (; keys.length;) {
|
|
295
|
+
var key = keys.pop();
|
|
296
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
return next.done = !0, next;
|
|
300
|
+
};
|
|
301
|
+
}, exports.values = values, Context.prototype = {
|
|
302
|
+
constructor: Context,
|
|
303
|
+
reset: function (skipTempReset) {
|
|
304
|
+
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) {
|
|
305
|
+
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
stop: function () {
|
|
309
|
+
this.done = !0;
|
|
310
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
311
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
312
|
+
return this.rval;
|
|
313
|
+
},
|
|
314
|
+
dispatchException: function (exception) {
|
|
315
|
+
if (this.done) throw exception;
|
|
316
|
+
var context = this;
|
|
317
|
+
|
|
318
|
+
function handle(loc, caught) {
|
|
319
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
323
|
+
var entry = this.tryEntries[i],
|
|
324
|
+
record = entry.completion;
|
|
325
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
326
|
+
|
|
327
|
+
if (entry.tryLoc <= this.prev) {
|
|
328
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
329
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
330
|
+
|
|
331
|
+
if (hasCatch && hasFinally) {
|
|
332
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
333
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
334
|
+
} else if (hasCatch) {
|
|
335
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
336
|
+
} else {
|
|
337
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
338
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
abrupt: function (type, arg) {
|
|
344
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
345
|
+
var entry = this.tryEntries[i];
|
|
346
|
+
|
|
347
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
348
|
+
var finallyEntry = entry;
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
354
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
355
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
356
|
+
},
|
|
357
|
+
complete: function (record, afterLoc) {
|
|
358
|
+
if ("throw" === record.type) throw record.arg;
|
|
359
|
+
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;
|
|
360
|
+
},
|
|
361
|
+
finish: function (finallyLoc) {
|
|
362
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
363
|
+
var entry = this.tryEntries[i];
|
|
364
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
catch: function (tryLoc) {
|
|
368
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
369
|
+
var entry = this.tryEntries[i];
|
|
370
|
+
|
|
371
|
+
if (entry.tryLoc === tryLoc) {
|
|
372
|
+
var record = entry.completion;
|
|
373
|
+
|
|
374
|
+
if ("throw" === record.type) {
|
|
375
|
+
var thrown = record.arg;
|
|
376
|
+
resetTryEntry(entry);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
return thrown;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
throw new Error("illegal catch attempt");
|
|
384
|
+
},
|
|
385
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
386
|
+
return this.delegate = {
|
|
387
|
+
iterator: values(iterable),
|
|
388
|
+
resultName: resultName,
|
|
389
|
+
nextLoc: nextLoc
|
|
390
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
391
|
+
}
|
|
392
|
+
}, exports;
|
|
393
|
+
}
|
|
394
|
+
|
|
46
395
|
var ParseError = require('./ParseError').default;
|
|
47
396
|
|
|
48
397
|
var XHR = null;
|
|
@@ -120,10 +469,8 @@ var ParseFile = function () {
|
|
|
120
469
|
(0, _createClass2.default)(ParseFile, [{
|
|
121
470
|
key: "getData",
|
|
122
471
|
value: function () {
|
|
123
|
-
var _this = this;
|
|
124
|
-
|
|
125
472
|
var options, controller, result;
|
|
126
|
-
return
|
|
473
|
+
return _regeneratorRuntime().async(function (_context) {
|
|
127
474
|
while (1) {
|
|
128
475
|
switch (_context.prev = _context.next) {
|
|
129
476
|
case 0:
|
|
@@ -145,12 +492,12 @@ var ParseFile = function () {
|
|
|
145
492
|
case 4:
|
|
146
493
|
options = {
|
|
147
494
|
requestTask: function (task) {
|
|
148
|
-
return
|
|
495
|
+
return this._requestTask = task;
|
|
149
496
|
}
|
|
150
497
|
};
|
|
151
498
|
controller = _CoreManager.default.getFileController();
|
|
152
499
|
_context.next = 8;
|
|
153
|
-
return
|
|
500
|
+
return _regeneratorRuntime().awrap(controller.download(this._url, options));
|
|
154
501
|
|
|
155
502
|
case 8:
|
|
156
503
|
result = _context.sent;
|
|
@@ -310,11 +657,9 @@ var ParseFile = function () {
|
|
|
310
657
|
}, {
|
|
311
658
|
key: "setMetadata",
|
|
312
659
|
value: function (metadata) {
|
|
313
|
-
var _this4 = this;
|
|
314
|
-
|
|
315
660
|
if (metadata && typeof metadata === 'object') {
|
|
316
661
|
Object.keys(metadata).forEach(function (key) {
|
|
317
|
-
|
|
662
|
+
this.addMetadata(key, metadata[key]);
|
|
318
663
|
});
|
|
319
664
|
}
|
|
320
665
|
}
|
|
@@ -328,11 +673,9 @@ var ParseFile = function () {
|
|
|
328
673
|
}, {
|
|
329
674
|
key: "setTags",
|
|
330
675
|
value: function (tags) {
|
|
331
|
-
var _this5 = this;
|
|
332
|
-
|
|
333
676
|
if (tags && typeof tags === 'object') {
|
|
334
677
|
Object.keys(tags).forEach(function (key) {
|
|
335
|
-
|
|
678
|
+
this.addTag(key, tags[key]);
|
|
336
679
|
});
|
|
337
680
|
}
|
|
338
681
|
}
|
|
@@ -379,7 +722,7 @@ var DefaultController = {
|
|
|
379
722
|
saveFile: function (name, source, options) {
|
|
380
723
|
var base64Data, _base64Data$split, _base64Data$split2, first, second, data, newSource;
|
|
381
724
|
|
|
382
|
-
return
|
|
725
|
+
return _regeneratorRuntime().async(function (_context2) {
|
|
383
726
|
while (1) {
|
|
384
727
|
switch (_context2.prev = _context2.next) {
|
|
385
728
|
case 0:
|
|
@@ -392,7 +735,7 @@ var DefaultController = {
|
|
|
392
735
|
|
|
393
736
|
case 2:
|
|
394
737
|
_context2.next = 4;
|
|
395
|
-
return
|
|
738
|
+
return _regeneratorRuntime().awrap(new Promise(function (res, rej) {
|
|
396
739
|
var reader = new FileReader();
|
|
397
740
|
|
|
398
741
|
reader.onload = function () {
|
|
@@ -416,7 +759,7 @@ var DefaultController = {
|
|
|
416
759
|
type: source.type || (source.file ? source.file.type : null)
|
|
417
760
|
};
|
|
418
761
|
_context2.next = 10;
|
|
419
|
-
return
|
|
762
|
+
return _regeneratorRuntime().awrap(DefaultController.saveBase64(name, newSource, options));
|
|
420
763
|
|
|
421
764
|
case 10:
|
|
422
765
|
return _context2.abrupt("return", _context2.sent);
|