parse 4.0.0-alpha.6 → 4.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +167 -25
- package/NOTICE +10 -0
- package/README.md +1 -3
- package/dist/parse.js +3991 -6551
- package/dist/parse.min.js +7 -6
- package/dist/parse.weapp.js +3152 -6482
- 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 +598 -958
- 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 +45 -34
- 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 +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/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 +598 -958
- 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
package/lib/weapp/ParseFile.js
CHANGED
|
@@ -1,38 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
6
|
-
|
|
7
|
-
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
8
|
-
|
|
9
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
10
|
-
|
|
11
|
-
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
12
|
-
|
|
13
|
-
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
14
|
-
|
|
15
3
|
var _Object$keys2 = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
16
4
|
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse");
|
|
20
|
-
|
|
21
|
-
var _Promise2 = require("@babel/runtime-corejs3/core-js-stable/promise");
|
|
5
|
+
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
|
22
6
|
|
|
23
|
-
var
|
|
7
|
+
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
|
24
8
|
|
|
25
|
-
var
|
|
9
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
26
10
|
|
|
27
11
|
var _forEachInstanceProperty2 = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
|
28
12
|
|
|
29
|
-
var _Object$
|
|
13
|
+
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
|
30
14
|
|
|
31
|
-
var _Object$
|
|
15
|
+
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
|
32
16
|
|
|
33
17
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
34
18
|
|
|
35
|
-
var
|
|
19
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
36
20
|
|
|
37
21
|
_Object$defineProperty(exports, "__esModule", {
|
|
38
22
|
value: true
|
|
@@ -40,23 +24,25 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
40
24
|
|
|
41
25
|
exports.default = void 0;
|
|
42
26
|
|
|
43
|
-
var
|
|
27
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
|
|
44
28
|
|
|
45
|
-
var
|
|
29
|
+
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/is-array"));
|
|
46
30
|
|
|
47
|
-
var
|
|
31
|
+
var _slice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/slice"));
|
|
32
|
+
|
|
33
|
+
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
48
34
|
|
|
49
35
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
50
36
|
|
|
51
|
-
var
|
|
37
|
+
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
52
38
|
|
|
53
|
-
var
|
|
39
|
+
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
54
40
|
|
|
55
|
-
var
|
|
41
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
|
56
42
|
|
|
57
|
-
var
|
|
43
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
58
44
|
|
|
59
|
-
var
|
|
45
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
|
60
46
|
|
|
61
47
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
62
48
|
|
|
@@ -82,12 +68,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
82
68
|
|
|
83
69
|
function _objectSpread(target) {
|
|
84
70
|
for (var i = 1; i < arguments.length; i++) {
|
|
85
|
-
var
|
|
71
|
+
var _context8, _context9;
|
|
86
72
|
|
|
87
73
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
88
|
-
i % 2 ? _forEachInstanceProperty2(
|
|
74
|
+
i % 2 ? _forEachInstanceProperty2(_context8 = ownKeys(Object(source), !0)).call(_context8, function (key) {
|
|
89
75
|
(0, _defineProperty2.default)(target, key, source[key]);
|
|
90
|
-
}) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty2(
|
|
76
|
+
}) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty2(_context9 = ownKeys(Object(source))).call(_context9, function (key) {
|
|
91
77
|
_Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key));
|
|
92
78
|
});
|
|
93
79
|
}
|
|
@@ -95,364 +81,6 @@ function _objectSpread(target) {
|
|
|
95
81
|
return target;
|
|
96
82
|
}
|
|
97
83
|
|
|
98
|
-
function _regeneratorRuntime() {
|
|
99
|
-
"use strict";
|
|
100
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
101
|
-
|
|
102
|
-
_regeneratorRuntime = function () {
|
|
103
|
-
return exports;
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
var exports = {},
|
|
107
|
-
Op = Object.prototype,
|
|
108
|
-
hasOwn = Op.hasOwnProperty,
|
|
109
|
-
$Symbol = "function" == typeof _Symbol ? _Symbol : {},
|
|
110
|
-
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
111
|
-
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
112
|
-
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
113
|
-
|
|
114
|
-
function define(obj, key, value) {
|
|
115
|
-
return _Object$defineProperty(obj, key, {
|
|
116
|
-
value: value,
|
|
117
|
-
enumerable: !0,
|
|
118
|
-
configurable: !0,
|
|
119
|
-
writable: !0
|
|
120
|
-
}), obj[key];
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
try {
|
|
124
|
-
define({}, "");
|
|
125
|
-
} catch (err) {
|
|
126
|
-
define = function (obj, key, value) {
|
|
127
|
-
return obj[key] = value;
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
132
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
133
|
-
generator = _Object$create(protoGenerator.prototype),
|
|
134
|
-
context = new Context(tryLocsList || []);
|
|
135
|
-
|
|
136
|
-
return generator._invoke = function (innerFn, self, context) {
|
|
137
|
-
var state = "suspendedStart";
|
|
138
|
-
return function (method, arg) {
|
|
139
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
140
|
-
|
|
141
|
-
if ("completed" === state) {
|
|
142
|
-
if ("throw" === method) throw arg;
|
|
143
|
-
return doneResult();
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
for (context.method = method, context.arg = arg;;) {
|
|
147
|
-
var delegate = context.delegate;
|
|
148
|
-
|
|
149
|
-
if (delegate) {
|
|
150
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
151
|
-
|
|
152
|
-
if (delegateResult) {
|
|
153
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
154
|
-
return delegateResult;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
159
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
160
|
-
context.dispatchException(context.arg);
|
|
161
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
162
|
-
state = "executing";
|
|
163
|
-
var record = tryCatch(innerFn, self, context);
|
|
164
|
-
|
|
165
|
-
if ("normal" === record.type) {
|
|
166
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
167
|
-
return {
|
|
168
|
-
value: record.arg,
|
|
169
|
-
done: context.done
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
}(innerFn, self, context), generator;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
function tryCatch(fn, obj, arg) {
|
|
180
|
-
try {
|
|
181
|
-
return {
|
|
182
|
-
type: "normal",
|
|
183
|
-
arg: fn.call(obj, arg)
|
|
184
|
-
};
|
|
185
|
-
} catch (err) {
|
|
186
|
-
return {
|
|
187
|
-
type: "throw",
|
|
188
|
-
arg: err
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
exports.wrap = wrap;
|
|
194
|
-
var ContinueSentinel = {};
|
|
195
|
-
|
|
196
|
-
function Generator() {}
|
|
197
|
-
|
|
198
|
-
function GeneratorFunction() {}
|
|
199
|
-
|
|
200
|
-
function GeneratorFunctionPrototype() {}
|
|
201
|
-
|
|
202
|
-
var IteratorPrototype = {};
|
|
203
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
204
|
-
return this;
|
|
205
|
-
});
|
|
206
|
-
var getProto = _Object$getPrototypeOf,
|
|
207
|
-
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
208
|
-
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
209
|
-
|
|
210
|
-
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype);
|
|
211
|
-
|
|
212
|
-
function defineIteratorMethods(prototype) {
|
|
213
|
-
var _context8;
|
|
214
|
-
|
|
215
|
-
_forEachInstanceProperty2(_context8 = ["next", "throw", "return"]).call(_context8, function (method) {
|
|
216
|
-
define(prototype, method, function (arg) {
|
|
217
|
-
return this._invoke(method, arg);
|
|
218
|
-
});
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
223
|
-
function invoke(method, arg, resolve, reject) {
|
|
224
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
225
|
-
|
|
226
|
-
if ("throw" !== record.type) {
|
|
227
|
-
var result = record.arg,
|
|
228
|
-
value = result.value;
|
|
229
|
-
return value && "object" == _typeof3(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
230
|
-
invoke("next", value, resolve, reject);
|
|
231
|
-
}, function (err) {
|
|
232
|
-
invoke("throw", err, resolve, reject);
|
|
233
|
-
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
234
|
-
result.value = unwrapped, resolve(result);
|
|
235
|
-
}, function (error) {
|
|
236
|
-
return invoke("throw", error, resolve, reject);
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
reject(record.arg);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
var previousPromise;
|
|
244
|
-
|
|
245
|
-
this._invoke = function (method, arg) {
|
|
246
|
-
function callInvokeWithMethodAndArg() {
|
|
247
|
-
return new PromiseImpl(function (resolve, reject) {
|
|
248
|
-
invoke(method, arg, resolve, reject);
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
257
|
-
var method = delegate.iterator[context.method];
|
|
258
|
-
|
|
259
|
-
if (undefined === method) {
|
|
260
|
-
if (context.delegate = null, "throw" === context.method) {
|
|
261
|
-
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
262
|
-
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
return ContinueSentinel;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
269
|
-
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
270
|
-
var info = record.arg;
|
|
271
|
-
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);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
function pushTryEntry(locs) {
|
|
275
|
-
var entry = {
|
|
276
|
-
tryLoc: locs[0]
|
|
277
|
-
};
|
|
278
|
-
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
function resetTryEntry(entry) {
|
|
282
|
-
var record = entry.completion || {};
|
|
283
|
-
record.type = "normal", delete record.arg, entry.completion = record;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
function Context(tryLocsList) {
|
|
287
|
-
this.tryEntries = [{
|
|
288
|
-
tryLoc: "root"
|
|
289
|
-
}], _forEachInstanceProperty2(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
function values(iterable) {
|
|
293
|
-
if (iterable) {
|
|
294
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
295
|
-
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
296
|
-
if ("function" == typeof iterable.next) return iterable;
|
|
297
|
-
|
|
298
|
-
if (!isNaN(iterable.length)) {
|
|
299
|
-
var i = -1,
|
|
300
|
-
next = function next() {
|
|
301
|
-
for (; ++i < iterable.length;) {
|
|
302
|
-
if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return next.value = undefined, next.done = !0, next;
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
return next.next = next;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
return {
|
|
313
|
-
next: doneResult
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
function doneResult() {
|
|
318
|
-
return {
|
|
319
|
-
value: undefined,
|
|
320
|
-
done: !0
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
325
|
-
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
326
|
-
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
327
|
-
}, exports.mark = function (genFun) {
|
|
328
|
-
return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun;
|
|
329
|
-
}, exports.awrap = function (arg) {
|
|
330
|
-
return {
|
|
331
|
-
__await: arg
|
|
332
|
-
};
|
|
333
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
334
|
-
return this;
|
|
335
|
-
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
336
|
-
void 0 === PromiseImpl && (PromiseImpl = _Promise2);
|
|
337
|
-
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
338
|
-
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
339
|
-
return result.done ? result.value : iter.next();
|
|
340
|
-
});
|
|
341
|
-
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
342
|
-
return this;
|
|
343
|
-
}), define(Gp, "toString", function () {
|
|
344
|
-
return "[object Generator]";
|
|
345
|
-
}), exports.keys = function (object) {
|
|
346
|
-
var keys = [];
|
|
347
|
-
|
|
348
|
-
for (var key in object) {
|
|
349
|
-
keys.push(key);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
return _reverseInstanceProperty(keys).call(keys), function next() {
|
|
353
|
-
for (; keys.length;) {
|
|
354
|
-
var key = keys.pop();
|
|
355
|
-
if (key in object) return next.value = key, next.done = !1, next;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
return next.done = !0, next;
|
|
359
|
-
};
|
|
360
|
-
}, exports.values = values, Context.prototype = {
|
|
361
|
-
constructor: Context,
|
|
362
|
-
reset: function (skipTempReset) {
|
|
363
|
-
var _context9;
|
|
364
|
-
|
|
365
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty2(_context9 = this.tryEntries).call(_context9, resetTryEntry), !skipTempReset) for (var name in this) {
|
|
366
|
-
"t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty2(name).call(name, 1)) && (this[name] = undefined);
|
|
367
|
-
}
|
|
368
|
-
},
|
|
369
|
-
stop: function () {
|
|
370
|
-
this.done = !0;
|
|
371
|
-
var rootRecord = this.tryEntries[0].completion;
|
|
372
|
-
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
373
|
-
return this.rval;
|
|
374
|
-
},
|
|
375
|
-
dispatchException: function (exception) {
|
|
376
|
-
if (this.done) throw exception;
|
|
377
|
-
var context = this;
|
|
378
|
-
|
|
379
|
-
function handle(loc, caught) {
|
|
380
|
-
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
384
|
-
var entry = this.tryEntries[i],
|
|
385
|
-
record = entry.completion;
|
|
386
|
-
if ("root" === entry.tryLoc) return handle("end");
|
|
387
|
-
|
|
388
|
-
if (entry.tryLoc <= this.prev) {
|
|
389
|
-
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
390
|
-
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
391
|
-
|
|
392
|
-
if (hasCatch && hasFinally) {
|
|
393
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
394
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
395
|
-
} else if (hasCatch) {
|
|
396
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
397
|
-
} else {
|
|
398
|
-
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
399
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
},
|
|
404
|
-
abrupt: function (type, arg) {
|
|
405
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
406
|
-
var entry = this.tryEntries[i];
|
|
407
|
-
|
|
408
|
-
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
409
|
-
var finallyEntry = entry;
|
|
410
|
-
break;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
415
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
416
|
-
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
417
|
-
},
|
|
418
|
-
complete: function (record, afterLoc) {
|
|
419
|
-
if ("throw" === record.type) throw record.arg;
|
|
420
|
-
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;
|
|
421
|
-
},
|
|
422
|
-
finish: function (finallyLoc) {
|
|
423
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
424
|
-
var entry = this.tryEntries[i];
|
|
425
|
-
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
426
|
-
}
|
|
427
|
-
},
|
|
428
|
-
catch: function (tryLoc) {
|
|
429
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
430
|
-
var entry = this.tryEntries[i];
|
|
431
|
-
|
|
432
|
-
if (entry.tryLoc === tryLoc) {
|
|
433
|
-
var record = entry.completion;
|
|
434
|
-
|
|
435
|
-
if ("throw" === record.type) {
|
|
436
|
-
var thrown = record.arg;
|
|
437
|
-
resetTryEntry(entry);
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
return thrown;
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
throw new Error("illegal catch attempt");
|
|
445
|
-
},
|
|
446
|
-
delegateYield: function (iterable, resultName, nextLoc) {
|
|
447
|
-
return this.delegate = {
|
|
448
|
-
iterator: values(iterable),
|
|
449
|
-
resultName: resultName,
|
|
450
|
-
nextLoc: nextLoc
|
|
451
|
-
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
452
|
-
}
|
|
453
|
-
}, exports;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
84
|
var ParseError = require('./ParseError').default;
|
|
457
85
|
|
|
458
86
|
var XHR = null;
|
|
@@ -624,48 +252,46 @@ var ParseFile = /*#__PURE__*/function () {
|
|
|
624
252
|
(0, _createClass2.default)(ParseFile, [{
|
|
625
253
|
key: "getData",
|
|
626
254
|
value: function () {
|
|
627
|
-
var _getData = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
255
|
+
var _getData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
628
256
|
var _this = this;
|
|
629
257
|
|
|
630
258
|
var options, controller, result;
|
|
631
|
-
return
|
|
632
|
-
while (1) {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
}
|
|
259
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
260
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
261
|
+
case 0:
|
|
262
|
+
if (!this._data) {
|
|
263
|
+
_context4.next = 2;
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
639
266
|
|
|
640
|
-
|
|
267
|
+
return _context4.abrupt("return", this._data);
|
|
641
268
|
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
269
|
+
case 2:
|
|
270
|
+
if (this._url) {
|
|
271
|
+
_context4.next = 4;
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
throw new Error('Cannot retrieve data for unsaved ParseFile.');
|
|
276
|
+
|
|
277
|
+
case 4:
|
|
278
|
+
options = {
|
|
279
|
+
requestTask: function (task) {
|
|
280
|
+
return _this._requestTask = task;
|
|
646
281
|
}
|
|
282
|
+
};
|
|
283
|
+
controller = _CoreManager.default.getFileController();
|
|
284
|
+
_context4.next = 8;
|
|
285
|
+
return controller.download(this._url, options);
|
|
647
286
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
controller = _CoreManager.default.getFileController();
|
|
657
|
-
_context4.next = 8;
|
|
658
|
-
return controller.download(this._url, options);
|
|
659
|
-
|
|
660
|
-
case 8:
|
|
661
|
-
result = _context4.sent;
|
|
662
|
-
this._data = result.base64;
|
|
663
|
-
return _context4.abrupt("return", this._data);
|
|
664
|
-
|
|
665
|
-
case 11:
|
|
666
|
-
case "end":
|
|
667
|
-
return _context4.stop();
|
|
668
|
-
}
|
|
287
|
+
case 8:
|
|
288
|
+
result = _context4.sent;
|
|
289
|
+
this._data = result.base64;
|
|
290
|
+
return _context4.abrupt("return", this._data);
|
|
291
|
+
|
|
292
|
+
case 11:
|
|
293
|
+
case "end":
|
|
294
|
+
return _context4.stop();
|
|
669
295
|
}
|
|
670
296
|
}, _callee, this);
|
|
671
297
|
}));
|
|
@@ -696,7 +322,7 @@ var ParseFile = /*#__PURE__*/function () {
|
|
|
696
322
|
* after you get the file from a Parse.Object.
|
|
697
323
|
*
|
|
698
324
|
* @param {object} options An object to specify url options
|
|
699
|
-
* @returns {string}
|
|
325
|
+
* @returns {string | undefined}
|
|
700
326
|
*/
|
|
701
327
|
|
|
702
328
|
}, {
|
|
@@ -748,7 +374,7 @@ var ParseFile = /*#__PURE__*/function () {
|
|
|
748
374
|
* Saves the file to the Parse cloud.
|
|
749
375
|
*
|
|
750
376
|
* @param {object} options
|
|
751
|
-
*
|
|
377
|
+
* Valid options are:<ul>
|
|
752
378
|
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
|
|
753
379
|
* be used for this request.
|
|
754
380
|
* <li>sessionToken: A valid session token, used for making a request on
|
|
@@ -765,14 +391,16 @@ var ParseFile = /*#__PURE__*/function () {
|
|
|
765
391
|
* });
|
|
766
392
|
* </pre>
|
|
767
393
|
* </ul>
|
|
768
|
-
* @returns {Promise} Promise that is resolved when the save finishes.
|
|
394
|
+
* @returns {Promise | undefined} Promise that is resolved when the save finishes.
|
|
769
395
|
*/
|
|
770
396
|
|
|
771
397
|
}, {
|
|
772
398
|
key: "save",
|
|
773
399
|
value: function (options
|
|
774
400
|
/*:: ?: FullOptions*/
|
|
775
|
-
)
|
|
401
|
+
)
|
|
402
|
+
/*: ?Promise*/
|
|
403
|
+
{
|
|
776
404
|
var _this2 = this;
|
|
777
405
|
|
|
778
406
|
options = options || {};
|
|
@@ -847,7 +475,7 @@ var ParseFile = /*#__PURE__*/function () {
|
|
|
847
475
|
* In Cloud Code and Node only with Master Key.
|
|
848
476
|
*
|
|
849
477
|
* @param {object} options
|
|
850
|
-
*
|
|
478
|
+
* Valid options are:<ul>
|
|
851
479
|
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
|
|
852
480
|
* be used for this request.
|
|
853
481
|
* <pre>
|
|
@@ -1026,7 +654,7 @@ var ParseFile = /*#__PURE__*/function () {
|
|
|
1026
654
|
|
|
1027
655
|
var DefaultController = {
|
|
1028
656
|
saveFile: function () {
|
|
1029
|
-
var _saveFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
657
|
+
var _saveFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(name
|
|
1030
658
|
/*: string*/
|
|
1031
659
|
, source
|
|
1032
660
|
/*: FileSource*/
|
|
@@ -1035,68 +663,66 @@ var DefaultController = {
|
|
|
1035
663
|
) {
|
|
1036
664
|
var base64Data, _base64Data$split, _base64Data$split2, first, second, data, newSource;
|
|
1037
665
|
|
|
1038
|
-
return
|
|
1039
|
-
while (1) {
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
}
|
|
666
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
667
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
668
|
+
case 0:
|
|
669
|
+
if (!(source.format !== 'file')) {
|
|
670
|
+
_context7.next = 2;
|
|
671
|
+
break;
|
|
672
|
+
}
|
|
1046
673
|
|
|
1047
|
-
|
|
674
|
+
throw new Error('saveFile can only be used with File-type sources.');
|
|
1048
675
|
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
676
|
+
case 2:
|
|
677
|
+
_context7.next = 4;
|
|
678
|
+
return new _promise.default(function (res, rej) {
|
|
679
|
+
// eslint-disable-next-line no-undef
|
|
680
|
+
var reader = new FileReader();
|
|
1054
681
|
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
682
|
+
reader.onload = function () {
|
|
683
|
+
return res(reader.result);
|
|
684
|
+
};
|
|
1058
685
|
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
686
|
+
reader.onerror = function (error) {
|
|
687
|
+
return rej(error);
|
|
688
|
+
};
|
|
1062
689
|
|
|
1063
|
-
|
|
1064
|
-
|
|
690
|
+
reader.readAsDataURL(source.file);
|
|
691
|
+
});
|
|
1065
692
|
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
693
|
+
case 4:
|
|
694
|
+
base64Data = _context7.sent; // we only want the data after the comma
|
|
695
|
+
// For example: "data:application/pdf;base64,JVBERi0xLjQKJ..." we would only want "JVBERi0xLjQKJ..."
|
|
1069
696
|
|
|
1070
|
-
|
|
1071
|
-
|
|
697
|
+
_base64Data$split = base64Data.split(','), _base64Data$split2 = (0, _slicedToArray2.default)(_base64Data$split, 2), first = _base64Data$split2[0], second = _base64Data$split2[1]; // in the event there is no 'data:application/pdf;base64,' at the beginning of the base64 string
|
|
698
|
+
// use the entire string instead
|
|
1072
699
|
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
700
|
+
data = second ? second : first;
|
|
701
|
+
newSource = {
|
|
702
|
+
format: 'base64',
|
|
703
|
+
base64: data,
|
|
704
|
+
type: source.type || (source.file ? source.file.type : null)
|
|
705
|
+
};
|
|
706
|
+
_context7.next = 10;
|
|
707
|
+
return DefaultController.saveBase64(name, newSource, options);
|
|
1081
708
|
|
|
1082
|
-
|
|
1083
|
-
|
|
709
|
+
case 10:
|
|
710
|
+
return _context7.abrupt("return", _context7.sent);
|
|
1084
711
|
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
}
|
|
712
|
+
case 11:
|
|
713
|
+
case "end":
|
|
714
|
+
return _context7.stop();
|
|
1089
715
|
}
|
|
1090
716
|
}, _callee2);
|
|
1091
717
|
}));
|
|
1092
718
|
|
|
1093
|
-
function saveFile(
|
|
719
|
+
function saveFile() {
|
|
1094
720
|
return _saveFile.apply(this, arguments);
|
|
1095
721
|
}
|
|
1096
722
|
|
|
1097
723
|
return saveFile;
|
|
1098
724
|
}(),
|
|
1099
|
-
saveBase64: function
|
|
725
|
+
saveBase64: function (name
|
|
1100
726
|
/*: string*/
|
|
1101
727
|
, source
|
|
1102
728
|
/*: FileSource*/
|
|
@@ -1123,17 +749,16 @@ var DefaultController = {
|
|
|
1123
749
|
data._ContentType = source.type;
|
|
1124
750
|
}
|
|
1125
751
|
|
|
1126
|
-
|
|
1127
|
-
return _CoreManager.default.getRESTController().request('POST', path, data, options);
|
|
752
|
+
return _CoreManager.default.getRESTController().request('POST', 'files/' + name, data, options);
|
|
1128
753
|
},
|
|
1129
|
-
download: function
|
|
754
|
+
download: function (uri, options) {
|
|
1130
755
|
if (XHR) {
|
|
1131
756
|
return this.downloadAjax(uri, options);
|
|
1132
757
|
} else {
|
|
1133
758
|
return _promise.default.reject('Cannot make a request: No definition of XMLHttpRequest was found.');
|
|
1134
759
|
}
|
|
1135
760
|
},
|
|
1136
|
-
downloadAjax: function
|
|
761
|
+
downloadAjax: function (uri, options) {
|
|
1137
762
|
return new _promise.default(function (resolve, reject) {
|
|
1138
763
|
var xhr = new XHR();
|
|
1139
764
|
xhr.open('GET', uri, true);
|
|
@@ -1163,7 +788,7 @@ var DefaultController = {
|
|
|
1163
788
|
xhr.send();
|
|
1164
789
|
});
|
|
1165
790
|
},
|
|
1166
|
-
deleteFile: function
|
|
791
|
+
deleteFile: function (name
|
|
1167
792
|
/*: string*/
|
|
1168
793
|
, options
|
|
1169
794
|
/*:: ?: FullOptions*/
|
|
@@ -1192,12 +817,12 @@ var DefaultController = {
|
|
|
1192
817
|
}
|
|
1193
818
|
});
|
|
1194
819
|
},
|
|
1195
|
-
_setXHR: function
|
|
820
|
+
_setXHR: function (xhr
|
|
1196
821
|
/*: any*/
|
|
1197
822
|
) {
|
|
1198
823
|
XHR = xhr;
|
|
1199
824
|
},
|
|
1200
|
-
_getXHR: function
|
|
825
|
+
_getXHR: function () {
|
|
1201
826
|
return XHR;
|
|
1202
827
|
}
|
|
1203
828
|
};
|