parse 4.0.0-alpha.7 → 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 +3935 -6527
- package/dist/parse.min.js +7 -6
- package/dist/parse.weapp.js +3096 -6458
- 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 +542 -934
- 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 +5 -12
- 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 +223 -878
- package/lib/react-native/ParseQuery.js +207 -643
- package/lib/react-native/ParseSchema.js +3 -3
- package/lib/react-native/ParseUser.js +118 -573
- package/lib/react-native/RESTController.js +1 -29
- package/lib/react-native/uuid.js +5 -1
- package/lib/weapp/Analytics.js +4 -11
- package/lib/weapp/AnonymousUtils.js +2 -9
- package/lib/weapp/Cloud.js +4 -11
- package/lib/weapp/CloudCode.js +0 -1
- package/lib/weapp/CoreManager.js +3 -10
- package/lib/weapp/EventEmitter.js +0 -7
- package/lib/weapp/EventuallyQueue.js +282 -668
- package/lib/weapp/FacebookUtils.js +2 -9
- package/lib/weapp/InstallationController.js +0 -7
- package/lib/weapp/LiveQueryClient.js +35 -26
- package/lib/weapp/LiveQuerySubscription.js +5 -4
- package/lib/weapp/LocalDatastore.js +472 -864
- package/lib/weapp/LocalDatastoreController.js +161 -547
- package/lib/weapp/LocalDatastoreController.react-native.js +156 -537
- package/lib/weapp/LocalDatastoreUtils.js +2 -9
- package/lib/weapp/ObjectStateMutations.js +25 -25
- package/lib/weapp/OfflineQuery.js +31 -33
- package/lib/weapp/Parse.js +4 -13
- package/lib/weapp/ParseACL.js +9 -16
- package/lib/weapp/ParseCLP.js +46 -48
- package/lib/weapp/ParseConfig.js +6 -13
- package/lib/weapp/ParseError.js +2 -11
- package/lib/weapp/ParseFile.js +107 -482
- package/lib/weapp/ParseGeoPoint.js +4 -11
- package/lib/weapp/ParseHooks.js +2 -2
- package/lib/weapp/ParseInstallation.js +2 -2
- package/lib/weapp/ParseLiveQuery.js +104 -480
- package/lib/weapp/ParseObject.js +542 -934
- 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/browser/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;
|
|
@@ -622,48 +250,46 @@ var ParseFile = /*#__PURE__*/function () {
|
|
|
622
250
|
(0, _createClass2.default)(ParseFile, [{
|
|
623
251
|
key: "getData",
|
|
624
252
|
value: function () {
|
|
625
|
-
var _getData = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
253
|
+
var _getData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
626
254
|
var _this = this;
|
|
627
255
|
|
|
628
256
|
var options, controller, result;
|
|
629
|
-
return
|
|
630
|
-
while (1) {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
}
|
|
257
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
258
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
259
|
+
case 0:
|
|
260
|
+
if (!this._data) {
|
|
261
|
+
_context4.next = 2;
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
637
264
|
|
|
638
|
-
|
|
265
|
+
return _context4.abrupt("return", this._data);
|
|
639
266
|
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
267
|
+
case 2:
|
|
268
|
+
if (this._url) {
|
|
269
|
+
_context4.next = 4;
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
throw new Error('Cannot retrieve data for unsaved ParseFile.');
|
|
274
|
+
|
|
275
|
+
case 4:
|
|
276
|
+
options = {
|
|
277
|
+
requestTask: function (task) {
|
|
278
|
+
return _this._requestTask = task;
|
|
644
279
|
}
|
|
280
|
+
};
|
|
281
|
+
controller = _CoreManager.default.getFileController();
|
|
282
|
+
_context4.next = 8;
|
|
283
|
+
return controller.download(this._url, options);
|
|
645
284
|
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
controller = _CoreManager.default.getFileController();
|
|
655
|
-
_context4.next = 8;
|
|
656
|
-
return controller.download(this._url, options);
|
|
657
|
-
|
|
658
|
-
case 8:
|
|
659
|
-
result = _context4.sent;
|
|
660
|
-
this._data = result.base64;
|
|
661
|
-
return _context4.abrupt("return", this._data);
|
|
662
|
-
|
|
663
|
-
case 11:
|
|
664
|
-
case "end":
|
|
665
|
-
return _context4.stop();
|
|
666
|
-
}
|
|
285
|
+
case 8:
|
|
286
|
+
result = _context4.sent;
|
|
287
|
+
this._data = result.base64;
|
|
288
|
+
return _context4.abrupt("return", this._data);
|
|
289
|
+
|
|
290
|
+
case 11:
|
|
291
|
+
case "end":
|
|
292
|
+
return _context4.stop();
|
|
667
293
|
}
|
|
668
294
|
}, _callee, this);
|
|
669
295
|
}));
|
|
@@ -694,7 +320,7 @@ var ParseFile = /*#__PURE__*/function () {
|
|
|
694
320
|
* after you get the file from a Parse.Object.
|
|
695
321
|
*
|
|
696
322
|
* @param {object} options An object to specify url options
|
|
697
|
-
* @returns {string}
|
|
323
|
+
* @returns {string | undefined}
|
|
698
324
|
*/
|
|
699
325
|
|
|
700
326
|
}, {
|
|
@@ -746,7 +372,7 @@ var ParseFile = /*#__PURE__*/function () {
|
|
|
746
372
|
* Saves the file to the Parse cloud.
|
|
747
373
|
*
|
|
748
374
|
* @param {object} options
|
|
749
|
-
*
|
|
375
|
+
* Valid options are:<ul>
|
|
750
376
|
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
|
|
751
377
|
* be used for this request.
|
|
752
378
|
* <li>sessionToken: A valid session token, used for making a request on
|
|
@@ -763,14 +389,16 @@ var ParseFile = /*#__PURE__*/function () {
|
|
|
763
389
|
* });
|
|
764
390
|
* </pre>
|
|
765
391
|
* </ul>
|
|
766
|
-
* @returns {Promise} Promise that is resolved when the save finishes.
|
|
392
|
+
* @returns {Promise | undefined} Promise that is resolved when the save finishes.
|
|
767
393
|
*/
|
|
768
394
|
|
|
769
395
|
}, {
|
|
770
396
|
key: "save",
|
|
771
397
|
value: function (options
|
|
772
398
|
/*:: ?: FullOptions*/
|
|
773
|
-
)
|
|
399
|
+
)
|
|
400
|
+
/*: ?Promise*/
|
|
401
|
+
{
|
|
774
402
|
var _this2 = this;
|
|
775
403
|
|
|
776
404
|
options = options || {};
|
|
@@ -845,7 +473,7 @@ var ParseFile = /*#__PURE__*/function () {
|
|
|
845
473
|
* In Cloud Code and Node only with Master Key.
|
|
846
474
|
*
|
|
847
475
|
* @param {object} options
|
|
848
|
-
*
|
|
476
|
+
* Valid options are:<ul>
|
|
849
477
|
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
|
|
850
478
|
* be used for this request.
|
|
851
479
|
* <pre>
|
|
@@ -1024,7 +652,7 @@ var ParseFile = /*#__PURE__*/function () {
|
|
|
1024
652
|
|
|
1025
653
|
var DefaultController = {
|
|
1026
654
|
saveFile: function () {
|
|
1027
|
-
var _saveFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
655
|
+
var _saveFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(name
|
|
1028
656
|
/*: string*/
|
|
1029
657
|
, source
|
|
1030
658
|
/*: FileSource*/
|
|
@@ -1033,68 +661,66 @@ var DefaultController = {
|
|
|
1033
661
|
) {
|
|
1034
662
|
var base64Data, _base64Data$split, _base64Data$split2, first, second, data, newSource;
|
|
1035
663
|
|
|
1036
|
-
return
|
|
1037
|
-
while (1) {
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
}
|
|
664
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
665
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
666
|
+
case 0:
|
|
667
|
+
if (!(source.format !== 'file')) {
|
|
668
|
+
_context7.next = 2;
|
|
669
|
+
break;
|
|
670
|
+
}
|
|
1044
671
|
|
|
1045
|
-
|
|
672
|
+
throw new Error('saveFile can only be used with File-type sources.');
|
|
1046
673
|
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
674
|
+
case 2:
|
|
675
|
+
_context7.next = 4;
|
|
676
|
+
return new _promise.default(function (res, rej) {
|
|
677
|
+
// eslint-disable-next-line no-undef
|
|
678
|
+
var reader = new FileReader();
|
|
1052
679
|
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
680
|
+
reader.onload = function () {
|
|
681
|
+
return res(reader.result);
|
|
682
|
+
};
|
|
1056
683
|
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
684
|
+
reader.onerror = function (error) {
|
|
685
|
+
return rej(error);
|
|
686
|
+
};
|
|
1060
687
|
|
|
1061
|
-
|
|
1062
|
-
|
|
688
|
+
reader.readAsDataURL(source.file);
|
|
689
|
+
});
|
|
1063
690
|
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
691
|
+
case 4:
|
|
692
|
+
base64Data = _context7.sent; // we only want the data after the comma
|
|
693
|
+
// For example: "data:application/pdf;base64,JVBERi0xLjQKJ..." we would only want "JVBERi0xLjQKJ..."
|
|
1067
694
|
|
|
1068
|
-
|
|
1069
|
-
|
|
695
|
+
_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
|
|
696
|
+
// use the entire string instead
|
|
1070
697
|
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
698
|
+
data = second ? second : first;
|
|
699
|
+
newSource = {
|
|
700
|
+
format: 'base64',
|
|
701
|
+
base64: data,
|
|
702
|
+
type: source.type || (source.file ? source.file.type : null)
|
|
703
|
+
};
|
|
704
|
+
_context7.next = 10;
|
|
705
|
+
return DefaultController.saveBase64(name, newSource, options);
|
|
1079
706
|
|
|
1080
|
-
|
|
1081
|
-
|
|
707
|
+
case 10:
|
|
708
|
+
return _context7.abrupt("return", _context7.sent);
|
|
1082
709
|
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
}
|
|
710
|
+
case 11:
|
|
711
|
+
case "end":
|
|
712
|
+
return _context7.stop();
|
|
1087
713
|
}
|
|
1088
714
|
}, _callee2);
|
|
1089
715
|
}));
|
|
1090
716
|
|
|
1091
|
-
function saveFile(
|
|
717
|
+
function saveFile() {
|
|
1092
718
|
return _saveFile.apply(this, arguments);
|
|
1093
719
|
}
|
|
1094
720
|
|
|
1095
721
|
return saveFile;
|
|
1096
722
|
}(),
|
|
1097
|
-
saveBase64: function
|
|
723
|
+
saveBase64: function (name
|
|
1098
724
|
/*: string*/
|
|
1099
725
|
, source
|
|
1100
726
|
/*: FileSource*/
|
|
@@ -1121,17 +747,16 @@ var DefaultController = {
|
|
|
1121
747
|
data._ContentType = source.type;
|
|
1122
748
|
}
|
|
1123
749
|
|
|
1124
|
-
|
|
1125
|
-
return _CoreManager.default.getRESTController().request('POST', path, data, options);
|
|
750
|
+
return _CoreManager.default.getRESTController().request('POST', 'files/' + name, data, options);
|
|
1126
751
|
},
|
|
1127
|
-
download: function
|
|
752
|
+
download: function (uri, options) {
|
|
1128
753
|
if (XHR) {
|
|
1129
754
|
return this.downloadAjax(uri, options);
|
|
1130
755
|
} else {
|
|
1131
756
|
return _promise.default.reject('Cannot make a request: No definition of XMLHttpRequest was found.');
|
|
1132
757
|
}
|
|
1133
758
|
},
|
|
1134
|
-
downloadAjax: function
|
|
759
|
+
downloadAjax: function (uri, options) {
|
|
1135
760
|
return new _promise.default(function (resolve, reject) {
|
|
1136
761
|
var xhr = new XHR();
|
|
1137
762
|
xhr.open('GET', uri, true);
|
|
@@ -1161,7 +786,7 @@ var DefaultController = {
|
|
|
1161
786
|
xhr.send();
|
|
1162
787
|
});
|
|
1163
788
|
},
|
|
1164
|
-
deleteFile: function
|
|
789
|
+
deleteFile: function (name
|
|
1165
790
|
/*: string*/
|
|
1166
791
|
, options
|
|
1167
792
|
/*:: ?: FullOptions*/
|
|
@@ -1190,12 +815,12 @@ var DefaultController = {
|
|
|
1190
815
|
}
|
|
1191
816
|
});
|
|
1192
817
|
},
|
|
1193
|
-
_setXHR: function
|
|
818
|
+
_setXHR: function (xhr
|
|
1194
819
|
/*: any*/
|
|
1195
820
|
) {
|
|
1196
821
|
XHR = xhr;
|
|
1197
822
|
},
|
|
1198
|
-
_getXHR: function
|
|
823
|
+
_getXHR: function () {
|
|
1199
824
|
return XHR;
|
|
1200
825
|
}
|
|
1201
826
|
};
|