backendless 6.7.0 → 6.7.1-dev.2
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/backendless.d.ts +5 -0
- package/dist/backendless.js +20966 -23929
- package/dist/backendless.js.map +1 -1
- package/dist/backendless.min.js +2 -2
- package/es/bl/constants.js +0 -2
- package/es/bl/custom-services.js +40 -65
- package/es/bl/events.js +30 -52
- package/es/bl/index.js +3 -9
- package/es/cache/index.js +125 -189
- package/es/commerce/index.js +78 -119
- package/es/counters/counter.js +0 -8
- package/es/counters/index.js +171 -258
- package/es/data/data-query-builder.js +2 -39
- package/es/data/geo/geo-constructor.js +5 -26
- package/es/data/geo/geo-json-parser.js +0 -7
- package/es/data/geo/geometry.js +4 -13
- package/es/data/geo/linestring.js +4 -21
- package/es/data/geo/point.js +4 -22
- package/es/data/geo/polygon.js +4 -30
- package/es/data/geo/spatial-reference-system.js +1 -7
- package/es/data/geo/wkt-parser.js +0 -10
- package/es/data/geo/wkt-to-geojson.js +4 -44
- package/es/data/group-query-builder.js +0 -23
- package/es/data/index.js +17 -54
- package/es/data/json-update-builder.js +0 -18
- package/es/data/load-relations-query-builder.js +0 -16
- package/es/data/persmission.js +0 -16
- package/es/data/rt-handlers.js +1 -46
- package/es/data/store.js +316 -518
- package/es/decorators/deprecated.js +2 -5
- package/es/decorators/index.js +0 -2
- package/es/device/index.js +3 -8
- package/es/expression.js +29 -0
- package/es/files/index.js +354 -493
- package/es/files/persmission.js +0 -15
- package/es/files/utils.js +32 -55
- package/es/hive/index.js +1 -13
- package/es/hive/stores/base-store.js +14 -50
- package/es/hive/stores/index.js +0 -10
- package/es/hive/stores/key-value.js +4 -37
- package/es/hive/stores/list.js +0 -32
- package/es/hive/stores/map.js +0 -34
- package/es/hive/stores/set.js +0 -29
- package/es/hive/stores/sorted-set.js +19 -94
- package/es/hive/utils.js +0 -2
- package/es/index.js +51 -71
- package/es/local-cache/index.js +0 -10
- package/es/local-cache/local-storage.js +1 -9
- package/es/local-cache/virtual-storage.js +0 -6
- package/es/logging/index.js +21 -46
- package/es/logging/logger.js +0 -6
- package/es/management/data.js +0 -8
- package/es/management/index.js +3 -7
- package/es/messaging/channel/index.js +0 -27
- package/es/messaging/helpers/body-parts.js +3 -6
- package/es/messaging/helpers/delivery-options.js +3 -6
- package/es/messaging/helpers/email-envelope.js +13 -25
- package/es/messaging/helpers/index.js +10 -16
- package/es/messaging/helpers/publish-options.js +3 -6
- package/es/messaging/index.js +213 -317
- package/es/persmission.js +7 -16
- package/es/request/index.js +2 -16
- package/es/rso/connection.js +3 -34
- package/es/rso/index.js +0 -7
- package/es/rt.js +21 -52
- package/es/unit-of-work/constants.js +1 -1
- package/es/unit-of-work/index.js +27 -145
- package/es/unit-of-work/json-adapter.js +14 -35
- package/es/unit-of-work/op-result-value-reference.js +1 -11
- package/es/unit-of-work/op-result.js +2 -13
- package/es/urls.js +18 -15
- package/es/user-agent.js +0 -7
- package/es/users/index.js +345 -552
- package/es/users/roles.js +79 -128
- package/es/users/social/container.js +0 -16
- package/es/users/social/index.js +166 -250
- package/es/users/user.js +2 -9
- package/es/users/utils.js +0 -3
- package/es/utils.js +0 -17
- package/lib/bl/constants.js +0 -2
- package/lib/bl/custom-services.js +40 -65
- package/lib/bl/events.js +30 -52
- package/lib/bl/index.js +3 -9
- package/lib/cache/index.js +125 -189
- package/lib/commerce/index.js +78 -119
- package/lib/counters/counter.js +0 -8
- package/lib/counters/index.js +171 -258
- package/lib/data/data-query-builder.js +2 -39
- package/lib/data/geo/geo-constructor.js +5 -26
- package/lib/data/geo/geo-json-parser.js +0 -7
- package/lib/data/geo/geometry.js +4 -13
- package/lib/data/geo/linestring.js +4 -21
- package/lib/data/geo/point.js +4 -22
- package/lib/data/geo/polygon.js +4 -30
- package/lib/data/geo/spatial-reference-system.js +1 -7
- package/lib/data/geo/wkt-parser.js +0 -10
- package/lib/data/geo/wkt-to-geojson.js +4 -44
- package/lib/data/group-query-builder.js +0 -23
- package/lib/data/index.js +17 -54
- package/lib/data/json-update-builder.js +0 -18
- package/lib/data/load-relations-query-builder.js +0 -16
- package/lib/data/persmission.js +0 -16
- package/lib/data/rt-handlers.js +1 -46
- package/lib/data/store.js +316 -518
- package/lib/decorators/deprecated.js +2 -5
- package/lib/decorators/index.js +0 -2
- package/lib/device/index.js +3 -8
- package/lib/expression.js +29 -0
- package/lib/files/index.js +354 -493
- package/lib/files/persmission.js +0 -15
- package/lib/files/utils.js +32 -55
- package/lib/hive/index.js +1 -13
- package/lib/hive/stores/base-store.js +14 -50
- package/lib/hive/stores/index.js +0 -10
- package/lib/hive/stores/key-value.js +4 -37
- package/lib/hive/stores/list.js +0 -32
- package/lib/hive/stores/map.js +0 -34
- package/lib/hive/stores/set.js +0 -29
- package/lib/hive/stores/sorted-set.js +19 -94
- package/lib/hive/utils.js +0 -2
- package/lib/index.js +51 -71
- package/lib/local-cache/index.js +0 -10
- package/lib/local-cache/local-storage.js +1 -9
- package/lib/local-cache/virtual-storage.js +0 -6
- package/lib/logging/index.js +21 -46
- package/lib/logging/logger.js +0 -6
- package/lib/management/data.js +0 -8
- package/lib/management/index.js +3 -7
- package/lib/messaging/channel/index.js +0 -27
- package/lib/messaging/helpers/body-parts.js +3 -6
- package/lib/messaging/helpers/delivery-options.js +3 -6
- package/lib/messaging/helpers/email-envelope.js +13 -25
- package/lib/messaging/helpers/index.js +10 -16
- package/lib/messaging/helpers/publish-options.js +3 -6
- package/lib/messaging/index.js +213 -317
- package/lib/persmission.js +7 -16
- package/lib/request/index.js +2 -16
- package/lib/rso/connection.js +3 -34
- package/lib/rso/index.js +0 -7
- package/lib/rt.js +21 -52
- package/lib/unit-of-work/constants.js +1 -1
- package/lib/unit-of-work/index.js +27 -145
- package/lib/unit-of-work/json-adapter.js +14 -35
- package/lib/unit-of-work/op-result-value-reference.js +1 -11
- package/lib/unit-of-work/op-result.js +2 -13
- package/lib/urls.js +18 -15
- package/lib/user-agent.js +0 -7
- package/lib/users/index.js +345 -552
- package/lib/users/roles.js +79 -128
- package/lib/users/social/container.js +0 -16
- package/lib/users/social/index.js +166 -250
- package/lib/users/user.js +2 -9
- package/lib/users/utils.js +0 -3
- package/lib/utils.js +0 -17
- package/package.json +16 -16
- package/src/data/store.js +3 -1
- package/src/expression.js +16 -0
- package/src/files/utils.js +1 -1
- package/src/index.js +5 -0
package/lib/files/index.js
CHANGED
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
-
|
|
12
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
|
|
14
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
-
|
|
16
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
|
|
18
12
|
var _utils = _interopRequireDefault(require("./utils"));
|
|
19
|
-
|
|
20
13
|
var _persmission = _interopRequireDefault(require("./persmission"));
|
|
21
|
-
|
|
22
14
|
var Files = /*#__PURE__*/function () {
|
|
23
15
|
function Files(app) {
|
|
24
16
|
(0, _classCallCheck2["default"])(this, Files);
|
|
@@ -29,66 +21,53 @@ var Files = /*#__PURE__*/function () {
|
|
|
29
21
|
WRITE: new _persmission["default"]('WRITE', app)
|
|
30
22
|
};
|
|
31
23
|
}
|
|
32
|
-
|
|
33
24
|
(0, _createClass2["default"])(Files, [{
|
|
34
25
|
key: "saveFile",
|
|
35
26
|
value: function () {
|
|
36
27
|
var _saveFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(filePath, fileName, fileContent, overwrite) {
|
|
37
28
|
var query;
|
|
38
29
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
39
|
-
while (1) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
'Content-Type': 'text/plain'
|
|
75
|
-
},
|
|
76
|
-
query: query,
|
|
77
|
-
data: fileContent
|
|
78
|
-
}));
|
|
79
|
-
|
|
80
|
-
case 12:
|
|
81
|
-
case "end":
|
|
82
|
-
return _context.stop();
|
|
83
|
-
}
|
|
30
|
+
while (1) switch (_context.prev = _context.next) {
|
|
31
|
+
case 0:
|
|
32
|
+
if (!(!filePath || typeof filePath !== 'string')) {
|
|
33
|
+
_context.next = 2;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
throw new Error('"filePath" must be provided and must be a string.');
|
|
37
|
+
case 2:
|
|
38
|
+
if (!(!fileName || typeof fileName !== 'string')) {
|
|
39
|
+
_context.next = 4;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
throw new Error('File Name must be provided and must be a string.');
|
|
43
|
+
case 4:
|
|
44
|
+
_context.next = 6;
|
|
45
|
+
return _utils["default"].toBase64(fileContent);
|
|
46
|
+
case 6:
|
|
47
|
+
fileContent = _context.sent;
|
|
48
|
+
query = {};
|
|
49
|
+
if (typeof overwrite === 'boolean') {
|
|
50
|
+
query.overwrite = overwrite;
|
|
51
|
+
}
|
|
52
|
+
filePath = _utils["default"].trimSlashesInPath(filePath);
|
|
53
|
+
fileName = _utils["default"].sanitizeFileName(fileName);
|
|
54
|
+
return _context.abrupt("return", this.app.request.put({
|
|
55
|
+
url: "".concat(this.app.urls.fileBinaryPath(filePath), "/").concat(fileName),
|
|
56
|
+
headers: {
|
|
57
|
+
'Content-Type': 'text/plain'
|
|
58
|
+
},
|
|
59
|
+
query: query,
|
|
60
|
+
data: fileContent
|
|
61
|
+
}));
|
|
62
|
+
case 12:
|
|
63
|
+
case "end":
|
|
64
|
+
return _context.stop();
|
|
84
65
|
}
|
|
85
66
|
}, _callee, this);
|
|
86
67
|
}));
|
|
87
|
-
|
|
88
68
|
function saveFile(_x, _x2, _x3, _x4) {
|
|
89
69
|
return _saveFile.apply(this, arguments);
|
|
90
70
|
}
|
|
91
|
-
|
|
92
71
|
return saveFile;
|
|
93
72
|
}()
|
|
94
73
|
}, {
|
|
@@ -97,75 +76,60 @@ var Files = /*#__PURE__*/function () {
|
|
|
97
76
|
var _upload = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(file, filePath, overwrite) {
|
|
98
77
|
var query, pathTokens, fileName, sourcePathTokens;
|
|
99
78
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
100
|
-
while (1) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
filePath =
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
fileName = _utils["default"].sanitizeFileName(fileName);
|
|
149
|
-
return _context2.abrupt("return", this.app.request.post({
|
|
150
|
-
url: "".concat(this.app.urls.filePath(filePath), "/").concat(fileName),
|
|
151
|
-
query: query,
|
|
152
|
-
form: {
|
|
153
|
-
file: file
|
|
154
|
-
}
|
|
155
|
-
}));
|
|
156
|
-
|
|
157
|
-
case 13:
|
|
158
|
-
case "end":
|
|
159
|
-
return _context2.stop();
|
|
160
|
-
}
|
|
79
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
80
|
+
case 0:
|
|
81
|
+
query = {};
|
|
82
|
+
if (typeof overwrite === 'boolean') {
|
|
83
|
+
query.overwrite = overwrite;
|
|
84
|
+
}
|
|
85
|
+
filePath = _utils["default"].trimSlashesInPath(filePath);
|
|
86
|
+
pathTokens = _utils["default"].parseFilePath(filePath);
|
|
87
|
+
if (pathTokens.fileName) {
|
|
88
|
+
filePath = pathTokens.filePath;
|
|
89
|
+
fileName = pathTokens.fileName;
|
|
90
|
+
}
|
|
91
|
+
if (!(typeof file === 'string')) {
|
|
92
|
+
_context2.next = 8;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
if (!fileName) {
|
|
96
|
+
sourcePathTokens = _utils["default"].parseFilePath(file);
|
|
97
|
+
fileName = sourcePathTokens.fileName;
|
|
98
|
+
}
|
|
99
|
+
return _context2.abrupt("return", this.app.request.post({
|
|
100
|
+
url: "".concat(this.app.urls.filePath(filePath), "/").concat(fileName),
|
|
101
|
+
query: query,
|
|
102
|
+
data: {
|
|
103
|
+
url: file
|
|
104
|
+
}
|
|
105
|
+
}));
|
|
106
|
+
case 8:
|
|
107
|
+
if (!fileName) {
|
|
108
|
+
fileName = _utils["default"].getFileName(file);
|
|
109
|
+
}
|
|
110
|
+
if (fileName) {
|
|
111
|
+
_context2.next = 11;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
throw new Error('Wrong type of the file source object. Can not get file name');
|
|
115
|
+
case 11:
|
|
116
|
+
fileName = _utils["default"].sanitizeFileName(fileName);
|
|
117
|
+
return _context2.abrupt("return", this.app.request.post({
|
|
118
|
+
url: "".concat(this.app.urls.filePath(filePath), "/").concat(fileName),
|
|
119
|
+
query: query,
|
|
120
|
+
form: {
|
|
121
|
+
file: file
|
|
122
|
+
}
|
|
123
|
+
}));
|
|
124
|
+
case 13:
|
|
125
|
+
case "end":
|
|
126
|
+
return _context2.stop();
|
|
161
127
|
}
|
|
162
128
|
}, _callee2, this);
|
|
163
129
|
}));
|
|
164
|
-
|
|
165
130
|
function upload(_x5, _x6, _x7) {
|
|
166
131
|
return _upload.apply(this, arguments);
|
|
167
132
|
}
|
|
168
|
-
|
|
169
133
|
return upload;
|
|
170
134
|
}()
|
|
171
135
|
}, {
|
|
@@ -173,93 +137,75 @@ var Files = /*#__PURE__*/function () {
|
|
|
173
137
|
value: function () {
|
|
174
138
|
var _append = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(filePath, fileName, fileContent) {
|
|
175
139
|
var pathTokens,
|
|
176
|
-
|
|
140
|
+
_args3 = arguments;
|
|
177
141
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
178
|
-
while (1) {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
if (
|
|
192
|
-
|
|
193
|
-
fileName =
|
|
194
|
-
pathTokens = _utils["default"].parseFilePath(filePath);
|
|
195
|
-
|
|
196
|
-
if (pathTokens.fileName) {
|
|
197
|
-
filePath = pathTokens.filePath;
|
|
198
|
-
fileName = pathTokens.fileName;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
if (fileName) {
|
|
203
|
-
_context3.next = 6;
|
|
204
|
-
break;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
throw new Error('Can not resolve target file name');
|
|
208
|
-
|
|
209
|
-
case 6:
|
|
210
|
-
fileName = _utils["default"].sanitizeFileName(fileName);
|
|
211
|
-
|
|
212
|
-
if (!(typeof fileContent === 'string')) {
|
|
213
|
-
_context3.next = 9;
|
|
214
|
-
break;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
return _context3.abrupt("return", this.app.request.post({
|
|
218
|
-
url: "".concat(this.app.urls.fileAppendPath(filePath), "/").concat(fileName),
|
|
219
|
-
data: {
|
|
220
|
-
url: fileContent
|
|
221
|
-
}
|
|
222
|
-
}));
|
|
223
|
-
|
|
224
|
-
case 9:
|
|
225
|
-
if (!_utils["default"].isBytesArray(fileContent)) {
|
|
226
|
-
_context3.next = 14;
|
|
227
|
-
break;
|
|
142
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
143
|
+
case 0:
|
|
144
|
+
if (!(!filePath || typeof filePath !== 'string')) {
|
|
145
|
+
_context3.next = 2;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
throw new Error('"filePath" must be provided and must be a string.');
|
|
149
|
+
case 2:
|
|
150
|
+
filePath = _utils["default"].trimSlashesInPath(filePath);
|
|
151
|
+
if (_args3.length === 2) {
|
|
152
|
+
fileContent = fileName;
|
|
153
|
+
fileName = undefined;
|
|
154
|
+
pathTokens = _utils["default"].parseFilePath(filePath);
|
|
155
|
+
if (pathTokens.fileName) {
|
|
156
|
+
filePath = pathTokens.filePath;
|
|
157
|
+
fileName = pathTokens.fileName;
|
|
228
158
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
159
|
+
}
|
|
160
|
+
if (fileName) {
|
|
161
|
+
_context3.next = 6;
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
throw new Error('Can not resolve target file name');
|
|
165
|
+
case 6:
|
|
166
|
+
fileName = _utils["default"].sanitizeFileName(fileName);
|
|
167
|
+
if (!(typeof fileContent === 'string')) {
|
|
168
|
+
_context3.next = 9;
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
return _context3.abrupt("return", this.app.request.post({
|
|
172
|
+
url: "".concat(this.app.urls.fileAppendPath(filePath), "/").concat(fileName),
|
|
173
|
+
data: {
|
|
174
|
+
url: fileContent
|
|
175
|
+
}
|
|
176
|
+
}));
|
|
177
|
+
case 9:
|
|
178
|
+
if (!_utils["default"].isBytesArray(fileContent)) {
|
|
179
|
+
_context3.next = 14;
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
_context3.next = 12;
|
|
183
|
+
return _utils["default"].toBase64(fileContent);
|
|
184
|
+
case 12:
|
|
185
|
+
fileContent = _context3.sent;
|
|
186
|
+
return _context3.abrupt("return", this.app.request.put({
|
|
187
|
+
url: "".concat(this.app.urls.fileAppendBinaryPath(filePath), "/").concat(fileName),
|
|
188
|
+
headers: {
|
|
189
|
+
'Content-Type': 'text/plain'
|
|
190
|
+
},
|
|
191
|
+
data: fileContent
|
|
192
|
+
}));
|
|
193
|
+
case 14:
|
|
194
|
+
return _context3.abrupt("return", this.app.request.post({
|
|
195
|
+
url: "".concat(this.app.urls.fileAppendPath(filePath), "/").concat(fileName),
|
|
196
|
+
form: {
|
|
197
|
+
file: fileContent
|
|
198
|
+
}
|
|
199
|
+
}));
|
|
200
|
+
case 15:
|
|
201
|
+
case "end":
|
|
202
|
+
return _context3.stop();
|
|
255
203
|
}
|
|
256
204
|
}, _callee3, this);
|
|
257
205
|
}));
|
|
258
|
-
|
|
259
206
|
function append(_x8, _x9, _x10) {
|
|
260
207
|
return _append.apply(this, arguments);
|
|
261
208
|
}
|
|
262
|
-
|
|
263
209
|
return append;
|
|
264
210
|
}()
|
|
265
211
|
}, {
|
|
@@ -267,69 +213,55 @@ var Files = /*#__PURE__*/function () {
|
|
|
267
213
|
value: function () {
|
|
268
214
|
var _appendText = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(filePath, fileName, textContent) {
|
|
269
215
|
var pathTokens,
|
|
270
|
-
|
|
216
|
+
_args4 = arguments;
|
|
271
217
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
272
|
-
while (1) {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
if (
|
|
286
|
-
|
|
287
|
-
fileName =
|
|
288
|
-
pathTokens = _utils["default"].parseFilePath(filePath);
|
|
289
|
-
|
|
290
|
-
if (pathTokens.fileName) {
|
|
291
|
-
filePath = pathTokens.filePath;
|
|
292
|
-
fileName = pathTokens.fileName;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
if (fileName) {
|
|
297
|
-
_context4.next = 6;
|
|
298
|
-
break;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
throw new Error('Can not resolve target file name');
|
|
302
|
-
|
|
303
|
-
case 6:
|
|
304
|
-
if (!(typeof textContent !== 'string')) {
|
|
305
|
-
_context4.next = 8;
|
|
306
|
-
break;
|
|
218
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
219
|
+
case 0:
|
|
220
|
+
if (!(!filePath || typeof filePath !== 'string')) {
|
|
221
|
+
_context4.next = 2;
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
throw new Error('"filePath" must be provided and must be a string.');
|
|
225
|
+
case 2:
|
|
226
|
+
filePath = _utils["default"].trimSlashesInPath(filePath);
|
|
227
|
+
if (_args4.length === 2) {
|
|
228
|
+
textContent = fileName;
|
|
229
|
+
fileName = undefined;
|
|
230
|
+
pathTokens = _utils["default"].parseFilePath(filePath);
|
|
231
|
+
if (pathTokens.fileName) {
|
|
232
|
+
filePath = pathTokens.filePath;
|
|
233
|
+
fileName = pathTokens.fileName;
|
|
307
234
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
235
|
+
}
|
|
236
|
+
if (fileName) {
|
|
237
|
+
_context4.next = 6;
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
throw new Error('Can not resolve target file name');
|
|
241
|
+
case 6:
|
|
242
|
+
if (!(typeof textContent !== 'string')) {
|
|
243
|
+
_context4.next = 8;
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
throw new Error('"textContent" must be a string');
|
|
247
|
+
case 8:
|
|
248
|
+
fileName = _utils["default"].sanitizeFileName(fileName);
|
|
249
|
+
return _context4.abrupt("return", this.app.request.put({
|
|
250
|
+
url: "".concat(this.app.urls.fileAppendPath(filePath), "/").concat(fileName),
|
|
251
|
+
headers: {
|
|
252
|
+
'Content-Type': 'text/plain'
|
|
253
|
+
},
|
|
254
|
+
data: textContent
|
|
255
|
+
}));
|
|
256
|
+
case 10:
|
|
257
|
+
case "end":
|
|
258
|
+
return _context4.stop();
|
|
325
259
|
}
|
|
326
260
|
}, _callee4, this);
|
|
327
261
|
}));
|
|
328
|
-
|
|
329
262
|
function appendText(_x11, _x12, _x13) {
|
|
330
263
|
return _appendText.apply(this, arguments);
|
|
331
264
|
}
|
|
332
|
-
|
|
333
265
|
return appendText;
|
|
334
266
|
}()
|
|
335
267
|
}, {
|
|
@@ -338,54 +270,41 @@ var Files = /*#__PURE__*/function () {
|
|
|
338
270
|
var _listing = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(filePath, pattern, sub, pagesize, offset) {
|
|
339
271
|
var query;
|
|
340
272
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
341
|
-
while (1) {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
return _context5.abrupt("return", this.app.request.get({
|
|
373
|
-
url: this.app.urls.filePath(filePath),
|
|
374
|
-
query: query
|
|
375
|
-
}));
|
|
376
|
-
|
|
377
|
-
case 9:
|
|
378
|
-
case "end":
|
|
379
|
-
return _context5.stop();
|
|
380
|
-
}
|
|
273
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
274
|
+
case 0:
|
|
275
|
+
query = {};
|
|
276
|
+
if (!(!filePath || typeof filePath !== 'string')) {
|
|
277
|
+
_context5.next = 3;
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
throw new Error('"filePath" must be provided and must be a string.');
|
|
281
|
+
case 3:
|
|
282
|
+
filePath = _utils["default"].trimSlashesInPath(filePath);
|
|
283
|
+
if (pattern && typeof pattern === 'string') {
|
|
284
|
+
query.pattern = pattern;
|
|
285
|
+
}
|
|
286
|
+
if (typeof sub === 'boolean') {
|
|
287
|
+
query.sub = sub;
|
|
288
|
+
}
|
|
289
|
+
if (typeof pagesize === 'number' && pagesize >= 0) {
|
|
290
|
+
query.pagesize = pagesize;
|
|
291
|
+
}
|
|
292
|
+
if (typeof offset === 'number' && offset >= 0) {
|
|
293
|
+
query.offset = offset;
|
|
294
|
+
}
|
|
295
|
+
return _context5.abrupt("return", this.app.request.get({
|
|
296
|
+
url: this.app.urls.filePath(filePath),
|
|
297
|
+
query: query
|
|
298
|
+
}));
|
|
299
|
+
case 9:
|
|
300
|
+
case "end":
|
|
301
|
+
return _context5.stop();
|
|
381
302
|
}
|
|
382
303
|
}, _callee5, this);
|
|
383
304
|
}));
|
|
384
|
-
|
|
385
305
|
function listing(_x14, _x15, _x16, _x17, _x18) {
|
|
386
306
|
return _listing.apply(this, arguments);
|
|
387
307
|
}
|
|
388
|
-
|
|
389
308
|
return listing;
|
|
390
309
|
}()
|
|
391
310
|
}, {
|
|
@@ -393,45 +312,36 @@ var Files = /*#__PURE__*/function () {
|
|
|
393
312
|
value: function () {
|
|
394
313
|
var _renameFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(oldPathName, newName) {
|
|
395
314
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
396
|
-
while (1) {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
-
}));
|
|
422
|
-
|
|
423
|
-
case 5:
|
|
424
|
-
case "end":
|
|
425
|
-
return _context6.stop();
|
|
426
|
-
}
|
|
315
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
316
|
+
case 0:
|
|
317
|
+
if (!(!oldPathName || typeof oldPathName !== 'string')) {
|
|
318
|
+
_context6.next = 2;
|
|
319
|
+
break;
|
|
320
|
+
}
|
|
321
|
+
throw new Error('"oldPathName" must be provided and must be a string.');
|
|
322
|
+
case 2:
|
|
323
|
+
if (!(!newName || typeof newName !== 'string')) {
|
|
324
|
+
_context6.next = 4;
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
throw new Error('New File Name must be provided and must be a string.');
|
|
328
|
+
case 4:
|
|
329
|
+
return _context6.abrupt("return", this.app.request.put({
|
|
330
|
+
url: this.app.urls.fileRename(),
|
|
331
|
+
data: {
|
|
332
|
+
oldPathName: _utils["default"].ensureSlashInPath(oldPathName),
|
|
333
|
+
newName: newName
|
|
334
|
+
}
|
|
335
|
+
}));
|
|
336
|
+
case 5:
|
|
337
|
+
case "end":
|
|
338
|
+
return _context6.stop();
|
|
427
339
|
}
|
|
428
340
|
}, _callee6, this);
|
|
429
341
|
}));
|
|
430
|
-
|
|
431
342
|
function renameFile(_x19, _x20) {
|
|
432
343
|
return _renameFile.apply(this, arguments);
|
|
433
344
|
}
|
|
434
|
-
|
|
435
345
|
return renameFile;
|
|
436
346
|
}()
|
|
437
347
|
}, {
|
|
@@ -439,29 +349,24 @@ var Files = /*#__PURE__*/function () {
|
|
|
439
349
|
value: function () {
|
|
440
350
|
var _moveFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(sourcePath, targetPath) {
|
|
441
351
|
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
442
|
-
while (1) {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
case "end":
|
|
455
|
-
return _context7.stop();
|
|
456
|
-
}
|
|
352
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
353
|
+
case 0:
|
|
354
|
+
return _context7.abrupt("return", this.app.request.put({
|
|
355
|
+
url: this.app.urls.fileMove(),
|
|
356
|
+
data: {
|
|
357
|
+
sourcePath: _utils["default"].ensureSlashInPath(sourcePath),
|
|
358
|
+
targetPath: _utils["default"].ensureSlashInPath(targetPath)
|
|
359
|
+
}
|
|
360
|
+
}));
|
|
361
|
+
case 1:
|
|
362
|
+
case "end":
|
|
363
|
+
return _context7.stop();
|
|
457
364
|
}
|
|
458
365
|
}, _callee7, this);
|
|
459
366
|
}));
|
|
460
|
-
|
|
461
367
|
function moveFile(_x21, _x22) {
|
|
462
368
|
return _moveFile.apply(this, arguments);
|
|
463
369
|
}
|
|
464
|
-
|
|
465
370
|
return moveFile;
|
|
466
371
|
}()
|
|
467
372
|
}, {
|
|
@@ -469,29 +374,24 @@ var Files = /*#__PURE__*/function () {
|
|
|
469
374
|
value: function () {
|
|
470
375
|
var _copyFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(sourcePath, targetPath) {
|
|
471
376
|
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
472
|
-
while (1) {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
case "end":
|
|
485
|
-
return _context8.stop();
|
|
486
|
-
}
|
|
377
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
378
|
+
case 0:
|
|
379
|
+
return _context8.abrupt("return", this.app.request.put({
|
|
380
|
+
url: this.app.urls.fileCopy(),
|
|
381
|
+
data: {
|
|
382
|
+
sourcePath: _utils["default"].ensureSlashInPath(sourcePath),
|
|
383
|
+
targetPath: _utils["default"].ensureSlashInPath(targetPath)
|
|
384
|
+
}
|
|
385
|
+
}));
|
|
386
|
+
case 1:
|
|
387
|
+
case "end":
|
|
388
|
+
return _context8.stop();
|
|
487
389
|
}
|
|
488
390
|
}, _callee8, this);
|
|
489
391
|
}));
|
|
490
|
-
|
|
491
392
|
function copyFile(_x23, _x24) {
|
|
492
393
|
return _copyFile.apply(this, arguments);
|
|
493
394
|
}
|
|
494
|
-
|
|
495
395
|
return copyFile;
|
|
496
396
|
}()
|
|
497
397
|
}, {
|
|
@@ -499,37 +399,29 @@ var Files = /*#__PURE__*/function () {
|
|
|
499
399
|
value: function () {
|
|
500
400
|
var _remove = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(filePath) {
|
|
501
401
|
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
502
|
-
while (1) {
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
}));
|
|
520
|
-
|
|
521
|
-
case 4:
|
|
522
|
-
case "end":
|
|
523
|
-
return _context9.stop();
|
|
524
|
-
}
|
|
402
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
403
|
+
case 0:
|
|
404
|
+
if (!(!filePath || typeof filePath !== 'string')) {
|
|
405
|
+
_context9.next = 2;
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
throw new Error('"filePath" must be provided and must be a string.');
|
|
409
|
+
case 2:
|
|
410
|
+
if (!filePath.startsWith('http://') && !filePath.startsWith('https://')) {
|
|
411
|
+
filePath = this.app.urls.filePath(filePath);
|
|
412
|
+
}
|
|
413
|
+
return _context9.abrupt("return", this.app.request["delete"]({
|
|
414
|
+
url: filePath
|
|
415
|
+
}));
|
|
416
|
+
case 4:
|
|
417
|
+
case "end":
|
|
418
|
+
return _context9.stop();
|
|
525
419
|
}
|
|
526
420
|
}, _callee9, this);
|
|
527
421
|
}));
|
|
528
|
-
|
|
529
422
|
function remove(_x25) {
|
|
530
423
|
return _remove.apply(this, arguments);
|
|
531
424
|
}
|
|
532
|
-
|
|
533
425
|
return remove;
|
|
534
426
|
}()
|
|
535
427
|
}, {
|
|
@@ -537,37 +429,30 @@ var Files = /*#__PURE__*/function () {
|
|
|
537
429
|
value: function () {
|
|
538
430
|
var _exists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(filePath) {
|
|
539
431
|
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
540
|
-
while (1) {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
case 4:
|
|
560
|
-
case "end":
|
|
561
|
-
return _context10.stop();
|
|
562
|
-
}
|
|
432
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
433
|
+
case 0:
|
|
434
|
+
if (!(!filePath || typeof filePath !== 'string')) {
|
|
435
|
+
_context10.next = 2;
|
|
436
|
+
break;
|
|
437
|
+
}
|
|
438
|
+
throw new Error('"filePath" must be provided and must be a string.');
|
|
439
|
+
case 2:
|
|
440
|
+
filePath = _utils["default"].trimSlashesInPath(filePath);
|
|
441
|
+
return _context10.abrupt("return", this.app.request.get({
|
|
442
|
+
url: this.app.urls.filePath(filePath),
|
|
443
|
+
query: {
|
|
444
|
+
action: 'exists'
|
|
445
|
+
}
|
|
446
|
+
}));
|
|
447
|
+
case 4:
|
|
448
|
+
case "end":
|
|
449
|
+
return _context10.stop();
|
|
563
450
|
}
|
|
564
451
|
}, _callee10, this);
|
|
565
452
|
}));
|
|
566
|
-
|
|
567
453
|
function exists(_x26) {
|
|
568
454
|
return _exists.apply(this, arguments);
|
|
569
455
|
}
|
|
570
|
-
|
|
571
456
|
return exists;
|
|
572
457
|
}()
|
|
573
458
|
}, {
|
|
@@ -575,48 +460,39 @@ var Files = /*#__PURE__*/function () {
|
|
|
575
460
|
value: function () {
|
|
576
461
|
var _getFileCount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(filesPath, pattern, sub, countDirectories) {
|
|
577
462
|
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
|
578
|
-
while (1) {
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
}
|
|
606
|
-
}));
|
|
607
|
-
|
|
608
|
-
case 6:
|
|
609
|
-
case "end":
|
|
610
|
-
return _context11.stop();
|
|
611
|
-
}
|
|
463
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
464
|
+
case 0:
|
|
465
|
+
if (!(!filesPath || typeof filesPath !== 'string')) {
|
|
466
|
+
_context11.next = 2;
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
throw new Error('"filesPath" must be provided and must be a string.');
|
|
470
|
+
case 2:
|
|
471
|
+
if (!(pattern && typeof pattern !== 'string')) {
|
|
472
|
+
_context11.next = 4;
|
|
473
|
+
break;
|
|
474
|
+
}
|
|
475
|
+
throw new Error('Files Pattern must be provided and must be a string.');
|
|
476
|
+
case 4:
|
|
477
|
+
filesPath = _utils["default"].trimSlashesInPath(filesPath);
|
|
478
|
+
return _context11.abrupt("return", this.app.request.get({
|
|
479
|
+
url: this.app.urls.filePath(filesPath),
|
|
480
|
+
query: {
|
|
481
|
+
action: 'count',
|
|
482
|
+
pattern: pattern || '*',
|
|
483
|
+
sub: !!sub,
|
|
484
|
+
countDirectories: !!countDirectories
|
|
485
|
+
}
|
|
486
|
+
}));
|
|
487
|
+
case 6:
|
|
488
|
+
case "end":
|
|
489
|
+
return _context11.stop();
|
|
612
490
|
}
|
|
613
491
|
}, _callee11, this);
|
|
614
492
|
}));
|
|
615
|
-
|
|
616
493
|
function getFileCount(_x27, _x28, _x29, _x30) {
|
|
617
494
|
return _getFileCount.apply(this, arguments);
|
|
618
495
|
}
|
|
619
|
-
|
|
620
496
|
return getFileCount;
|
|
621
497
|
}()
|
|
622
498
|
}, {
|
|
@@ -624,34 +500,27 @@ var Files = /*#__PURE__*/function () {
|
|
|
624
500
|
value: function () {
|
|
625
501
|
var _createDirectory = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(directoryPath) {
|
|
626
502
|
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
|
627
|
-
while (1) {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
case 4:
|
|
644
|
-
case "end":
|
|
645
|
-
return _context12.stop();
|
|
646
|
-
}
|
|
503
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
504
|
+
case 0:
|
|
505
|
+
if (!(!directoryPath || typeof directoryPath !== 'string')) {
|
|
506
|
+
_context12.next = 2;
|
|
507
|
+
break;
|
|
508
|
+
}
|
|
509
|
+
throw new Error('Directory "path" must be provided and must be a string.');
|
|
510
|
+
case 2:
|
|
511
|
+
directoryPath = _utils["default"].trimSlashesInPath(directoryPath);
|
|
512
|
+
return _context12.abrupt("return", this.app.request.post({
|
|
513
|
+
url: this.app.urls.directoryPath(directoryPath)
|
|
514
|
+
}));
|
|
515
|
+
case 4:
|
|
516
|
+
case "end":
|
|
517
|
+
return _context12.stop();
|
|
647
518
|
}
|
|
648
519
|
}, _callee12, this);
|
|
649
520
|
}));
|
|
650
|
-
|
|
651
521
|
function createDirectory(_x31) {
|
|
652
522
|
return _createDirectory.apply(this, arguments);
|
|
653
523
|
}
|
|
654
|
-
|
|
655
524
|
return createDirectory;
|
|
656
525
|
}()
|
|
657
526
|
}, {
|
|
@@ -659,38 +528,30 @@ var Files = /*#__PURE__*/function () {
|
|
|
659
528
|
value: function () {
|
|
660
529
|
var _removeDirectory = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(directoryPath) {
|
|
661
530
|
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
|
662
|
-
while (1) {
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
case 4:
|
|
679
|
-
case "end":
|
|
680
|
-
return _context13.stop();
|
|
681
|
-
}
|
|
531
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
532
|
+
case 0:
|
|
533
|
+
if (!(!directoryPath || typeof directoryPath !== 'string')) {
|
|
534
|
+
_context13.next = 2;
|
|
535
|
+
break;
|
|
536
|
+
}
|
|
537
|
+
throw new Error('Directory "path" must be provided and must be a string.');
|
|
538
|
+
case 2:
|
|
539
|
+
directoryPath = _utils["default"].trimSlashesInPath(directoryPath);
|
|
540
|
+
return _context13.abrupt("return", this.app.request["delete"]({
|
|
541
|
+
url: this.app.urls.filePath(directoryPath)
|
|
542
|
+
}));
|
|
543
|
+
case 4:
|
|
544
|
+
case "end":
|
|
545
|
+
return _context13.stop();
|
|
682
546
|
}
|
|
683
547
|
}, _callee13, this);
|
|
684
548
|
}));
|
|
685
|
-
|
|
686
549
|
function removeDirectory(_x32) {
|
|
687
550
|
return _removeDirectory.apply(this, arguments);
|
|
688
551
|
}
|
|
689
|
-
|
|
690
552
|
return removeDirectory;
|
|
691
553
|
}()
|
|
692
554
|
}]);
|
|
693
555
|
return Files;
|
|
694
556
|
}();
|
|
695
|
-
|
|
696
557
|
exports["default"] = Files;
|