parse 4.0.0 → 4.0.1-beta.1
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 +188 -374
- package/dist/parse.min.js +7 -6
- package/dist/parse.weapp.js +188 -374
- package/dist/parse.weapp.min.js +7 -6
- package/lib/browser/Analytics.js +0 -7
- package/lib/browser/AnonymousUtils.js +0 -7
- package/lib/browser/Cloud.js +0 -7
- package/lib/browser/CoreManager.js +1 -8
- package/lib/browser/EventEmitter.js +0 -7
- package/lib/browser/FacebookUtils.js +0 -7
- package/lib/browser/InstallationController.js +0 -7
- package/lib/browser/LocalDatastoreUtils.js +0 -7
- package/lib/browser/OfflineQuery.js +27 -8
- package/lib/browser/Parse.js +0 -9
- package/lib/browser/ParseACL.js +0 -7
- package/lib/browser/ParseConfig.js +0 -7
- package/lib/browser/ParseError.js +0 -9
- package/lib/browser/ParseGeoPoint.js +0 -7
- package/lib/browser/ParseObject.js +158 -126
- package/lib/browser/ParsePolygon.js +0 -7
- package/lib/browser/ParseRelation.js +0 -7
- package/lib/browser/ParseSchema.js +0 -7
- package/lib/browser/Push.js +0 -7
- package/lib/browser/RESTController.js +0 -7
- package/lib/browser/SingleInstanceStateController.js +0 -7
- 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 +0 -7
- package/lib/browser/arrayContainsObject.js +0 -7
- package/lib/browser/canBeSerialized.js +0 -7
- package/lib/browser/decode.js +0 -7
- package/lib/browser/encode.js +0 -7
- package/lib/browser/equals.js +0 -9
- package/lib/browser/escape.js +0 -7
- package/lib/browser/isRevocableSession.js +0 -7
- package/lib/browser/parseDate.js +0 -7
- package/lib/browser/unique.js +0 -7
- package/lib/browser/unsavedChildren.js +0 -7
- package/lib/node/Analytics.js +0 -7
- package/lib/node/AnonymousUtils.js +0 -7
- package/lib/node/Cloud.js +0 -7
- 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 +0 -10
- package/lib/node/LiveQuerySubscription.js +0 -10
- 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/OfflineQuery.js +8 -0
- 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 +0 -7
- 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 +40 -29
- package/lib/node/ParseOp.js +0 -7
- package/lib/node/ParsePolygon.js +0 -7
- package/lib/node/ParseQuery.js +0 -7
- 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/react-native/CoreManager.js +2 -2
- package/lib/react-native/EventuallyQueue.js +169 -676
- package/lib/react-native/LiveQueryClient.js +3 -46
- 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 +24 -60
- package/lib/react-native/ParseCLP.js +55 -129
- package/lib/react-native/ParseFile.js +63 -468
- package/lib/react-native/ParseLiveQuery.js +60 -455
- package/lib/react-native/ParseObject.js +263 -897
- package/lib/react-native/ParseQuery.js +207 -643
- package/lib/react-native/ParseSchema.js +3 -3
- package/lib/react-native/ParseUser.js +118 -573
- package/lib/react-native/RESTController.js +1 -29
- package/lib/weapp/Analytics.js +0 -7
- package/lib/weapp/AnonymousUtils.js +0 -7
- package/lib/weapp/Cloud.js +0 -7
- package/lib/weapp/CoreManager.js +1 -8
- package/lib/weapp/EventEmitter.js +0 -7
- package/lib/weapp/FacebookUtils.js +0 -7
- package/lib/weapp/InstallationController.js +0 -7
- package/lib/weapp/LocalDatastoreUtils.js +0 -7
- package/lib/weapp/OfflineQuery.js +27 -8
- package/lib/weapp/Parse.js +0 -9
- package/lib/weapp/ParseACL.js +0 -7
- package/lib/weapp/ParseConfig.js +0 -7
- package/lib/weapp/ParseError.js +0 -9
- package/lib/weapp/ParseGeoPoint.js +0 -7
- package/lib/weapp/ParseObject.js +158 -126
- package/lib/weapp/ParsePolygon.js +0 -7
- package/lib/weapp/ParseRelation.js +0 -7
- package/lib/weapp/ParseSchema.js +0 -7
- package/lib/weapp/Push.js +0 -7
- package/lib/weapp/RESTController.js +0 -7
- package/lib/weapp/SingleInstanceStateController.js +0 -7
- 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 +0 -7
- package/lib/weapp/arrayContainsObject.js +0 -7
- package/lib/weapp/canBeSerialized.js +0 -7
- package/lib/weapp/decode.js +0 -7
- package/lib/weapp/encode.js +0 -7
- package/lib/weapp/equals.js +0 -9
- package/lib/weapp/escape.js +0 -7
- package/lib/weapp/isRevocableSession.js +0 -7
- package/lib/weapp/parseDate.js +0 -7
- package/lib/weapp/unique.js +0 -7
- package/lib/weapp/unsavedChildren.js +0 -7
- package/package.json +9 -9
- package/PATENTS +0 -37
|
@@ -5,393 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
|
|
10
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
9
|
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
|
|
12
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
13
|
|
|
14
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
15
|
|
|
16
16
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
17
17
|
|
|
18
|
-
function ownKeys(object, enumerableOnly) {
|
|
19
|
-
var keys = Object.keys(object);
|
|
20
|
-
|
|
21
|
-
if (Object.getOwnPropertySymbols) {
|
|
22
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
23
|
-
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
24
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
25
|
-
})), keys.push.apply(keys, symbols);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return keys;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function _objectSpread(target) {
|
|
32
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
33
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
34
|
-
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
35
|
-
(0, _defineProperty2.default)(target, key, source[key]);
|
|
36
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
37
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return target;
|
|
42
|
-
}
|
|
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
|
-
|
|
395
18
|
var ParseError = require('./ParseError').default;
|
|
396
19
|
|
|
397
20
|
var XHR = null;
|
|
@@ -470,50 +93,34 @@ var ParseFile = function () {
|
|
|
470
93
|
(0, _createClass2.default)(ParseFile, [{
|
|
471
94
|
key: "getData",
|
|
472
95
|
value: function () {
|
|
473
|
-
var
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
switch (_context.prev = _context.next) {
|
|
479
|
-
case 0:
|
|
480
|
-
if (!this._data) {
|
|
481
|
-
_context.next = 2;
|
|
482
|
-
break;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
return _context.abrupt("return", this._data);
|
|
486
|
-
|
|
487
|
-
case 2:
|
|
488
|
-
if (this._url) {
|
|
489
|
-
_context.next = 4;
|
|
490
|
-
break;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
throw new Error('Cannot retrieve data for unsaved ParseFile.');
|
|
494
|
-
|
|
495
|
-
case 4:
|
|
496
|
-
options = {
|
|
497
|
-
requestTask: function (task) {
|
|
498
|
-
return _this._requestTask = task;
|
|
499
|
-
}
|
|
500
|
-
};
|
|
501
|
-
controller = _CoreManager.default.getFileController();
|
|
502
|
-
_context.next = 8;
|
|
503
|
-
return _regeneratorRuntime().awrap(controller.download(this._url, options));
|
|
504
|
-
|
|
505
|
-
case 8:
|
|
506
|
-
result = _context.sent;
|
|
507
|
-
this._data = result.base64;
|
|
508
|
-
return _context.abrupt("return", this._data);
|
|
509
|
-
|
|
510
|
-
case 11:
|
|
511
|
-
case "end":
|
|
512
|
-
return _context.stop();
|
|
513
|
-
}
|
|
96
|
+
var _getData = (0, _asyncToGenerator2.default)(function* () {
|
|
97
|
+
var _this = this;
|
|
98
|
+
|
|
99
|
+
if (this._data) {
|
|
100
|
+
return this._data;
|
|
514
101
|
}
|
|
515
|
-
|
|
516
|
-
|
|
102
|
+
|
|
103
|
+
if (!this._url) {
|
|
104
|
+
throw new Error('Cannot retrieve data for unsaved ParseFile.');
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
var controller = _CoreManager.default.getFileController();
|
|
108
|
+
|
|
109
|
+
var result = yield controller.download(this._url, {
|
|
110
|
+
requestTask: function (task) {
|
|
111
|
+
return _this._requestTask = task;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
this._data = result.base64;
|
|
115
|
+
return this._data;
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
function getData() {
|
|
119
|
+
return _getData.apply(this, arguments);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return getData;
|
|
123
|
+
}()
|
|
517
124
|
}, {
|
|
518
125
|
key: "name",
|
|
519
126
|
value: function () {
|
|
@@ -726,58 +333,46 @@ var ParseFile = function () {
|
|
|
726
333
|
}();
|
|
727
334
|
|
|
728
335
|
var DefaultController = {
|
|
729
|
-
saveFile: function (
|
|
730
|
-
var
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
switch (_context2.prev = _context2.next) {
|
|
735
|
-
case 0:
|
|
736
|
-
if (!(source.format !== 'file')) {
|
|
737
|
-
_context2.next = 2;
|
|
738
|
-
break;
|
|
739
|
-
}
|
|
336
|
+
saveFile: function () {
|
|
337
|
+
var _saveFile = (0, _asyncToGenerator2.default)(function* (name, source, options) {
|
|
338
|
+
if (source.format !== 'file') {
|
|
339
|
+
throw new Error('saveFile can only be used with File-type sources.');
|
|
340
|
+
}
|
|
740
341
|
|
|
741
|
-
|
|
342
|
+
var base64Data = yield new Promise(function (res, rej) {
|
|
343
|
+
var reader = new FileReader();
|
|
742
344
|
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
var reader = new FileReader();
|
|
345
|
+
reader.onload = function () {
|
|
346
|
+
return res(reader.result);
|
|
347
|
+
};
|
|
747
348
|
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
349
|
+
reader.onerror = function (error) {
|
|
350
|
+
return rej(error);
|
|
351
|
+
};
|
|
751
352
|
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
};
|
|
353
|
+
reader.readAsDataURL(source.file);
|
|
354
|
+
});
|
|
755
355
|
|
|
756
|
-
|
|
757
|
-
|
|
356
|
+
var _base64Data$split = base64Data.split(','),
|
|
357
|
+
_base64Data$split2 = (0, _slicedToArray2.default)(_base64Data$split, 2),
|
|
358
|
+
first = _base64Data$split2[0],
|
|
359
|
+
second = _base64Data$split2[1];
|
|
758
360
|
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
};
|
|
768
|
-
_context2.next = 10;
|
|
769
|
-
return _regeneratorRuntime().awrap(DefaultController.saveBase64(name, newSource, options));
|
|
361
|
+
var data = second ? second : first;
|
|
362
|
+
var newSource = {
|
|
363
|
+
format: 'base64',
|
|
364
|
+
base64: data,
|
|
365
|
+
type: source.type || (source.file ? source.file.type : null)
|
|
366
|
+
};
|
|
367
|
+
return yield DefaultController.saveBase64(name, newSource, options);
|
|
368
|
+
});
|
|
770
369
|
|
|
771
|
-
|
|
772
|
-
|
|
370
|
+
function saveFile() {
|
|
371
|
+
return _saveFile.apply(this, arguments);
|
|
372
|
+
}
|
|
773
373
|
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
return _context2.stop();
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
}, null, null, null, Promise);
|
|
780
|
-
},
|
|
374
|
+
return saveFile;
|
|
375
|
+
}(),
|
|
781
376
|
saveBase64: function (name, source, options) {
|
|
782
377
|
if (source.format !== 'base64') {
|
|
783
378
|
throw new Error('saveBase64 can only be used with Base64-type sources.');
|
|
@@ -786,8 +381,8 @@ var DefaultController = {
|
|
|
786
381
|
var data = {
|
|
787
382
|
base64: source.base64,
|
|
788
383
|
fileData: {
|
|
789
|
-
metadata:
|
|
790
|
-
tags:
|
|
384
|
+
metadata: Object.assign({}, options.metadata),
|
|
385
|
+
tags: Object.assign({}, options.tags)
|
|
791
386
|
}
|
|
792
387
|
};
|
|
793
388
|
delete options.metadata;
|