files.com 1.0.236 → 1.0.237

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. package/_VERSION +1 -1
  2. package/docs/models/BundleNotification.md +35 -0
  3. package/lib/Api.js +153 -159
  4. package/lib/isomorphic/File.node.js +24 -28
  5. package/lib/models/ActionNotificationExport.js +97 -101
  6. package/lib/models/ActionNotificationExportResult.js +44 -46
  7. package/lib/models/ActionWebhookFailure.js +42 -44
  8. package/lib/models/ApiKey.js +271 -287
  9. package/lib/models/App.js +26 -28
  10. package/lib/models/As2IncomingMessage.js +32 -34
  11. package/lib/models/As2OutgoingMessage.js +32 -34
  12. package/lib/models/As2Partner.js +231 -241
  13. package/lib/models/As2Station.js +219 -229
  14. package/lib/models/Automation.js +333 -343
  15. package/lib/models/AutomationRun.js +75 -79
  16. package/lib/models/BandwidthSnapshot.js +26 -28
  17. package/lib/models/Behavior.js +323 -337
  18. package/lib/models/Bundle.js +375 -387
  19. package/lib/models/BundleDownload.js +38 -40
  20. package/lib/models/BundleNotification.js +223 -173
  21. package/lib/models/BundleRecipient.js +104 -108
  22. package/lib/models/BundleRegistration.js +38 -40
  23. package/lib/models/Clickwrap.js +213 -223
  24. package/lib/models/DnsRecord.js +26 -28
  25. package/lib/models/ExternalEvent.js +93 -99
  26. package/lib/models/File.js +726 -766
  27. package/lib/models/FileComment.js +180 -188
  28. package/lib/models/FileCommentReaction.js +84 -88
  29. package/lib/models/FileMigration.js +31 -33
  30. package/lib/models/Folder.js +94 -98
  31. package/lib/models/FormFieldSet.js +189 -199
  32. package/lib/models/Group.js +207 -217
  33. package/lib/models/GroupUser.js +230 -238
  34. package/lib/models/History.js +266 -276
  35. package/lib/models/HistoryExport.js +175 -179
  36. package/lib/models/HistoryExportResult.js +44 -46
  37. package/lib/models/InboxRecipient.js +104 -108
  38. package/lib/models/InboxRegistration.js +32 -34
  39. package/lib/models/InboxUpload.js +38 -40
  40. package/lib/models/Invoice.js +57 -61
  41. package/lib/models/IpAddress.js +78 -84
  42. package/lib/models/Lock.js +148 -154
  43. package/lib/models/Message.js +267 -277
  44. package/lib/models/MessageComment.js +207 -217
  45. package/lib/models/MessageCommentReaction.js +147 -155
  46. package/lib/models/MessageReaction.js +147 -155
  47. package/lib/models/Notification.js +255 -265
  48. package/lib/models/Payment.js +57 -61
  49. package/lib/models/Permission.js +128 -134
  50. package/lib/models/Priority.js +45 -47
  51. package/lib/models/Project.js +183 -193
  52. package/lib/models/PublicKey.js +207 -217
  53. package/lib/models/RemoteBandwidthSnapshot.js +26 -28
  54. package/lib/models/RemoteServer.js +805 -819
  55. package/lib/models/Request.js +166 -174
  56. package/lib/models/Session.js +47 -51
  57. package/lib/models/SettingsChange.js +26 -28
  58. package/lib/models/SftpHostKey.js +177 -187
  59. package/lib/models/Site.js +412 -418
  60. package/lib/models/SsoStrategy.js +99 -105
  61. package/lib/models/Style.js +127 -133
  62. package/lib/models/UsageDailySnapshot.js +26 -28
  63. package/lib/models/UsageSnapshot.js +26 -28
  64. package/lib/models/User.js +587 -603
  65. package/lib/models/UserCipherUse.js +32 -34
  66. package/lib/models/UserRequest.js +147 -155
  67. package/lib/models/WebhookTest.js +54 -56
  68. package/package.json +1 -1
  69. package/src/models/BundleNotification.js +39 -1
package/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.236
1
+ 1.0.237
@@ -7,6 +7,7 @@
7
7
  "bundle_id": 1,
8
8
  "id": 1,
9
9
  "notify_on_registration": true,
10
+ "notify_on_upload": true,
10
11
  "user_id": 1
11
12
  }
12
13
  ```
@@ -14,6 +15,7 @@
14
15
  * `bundle_id` (int64): Bundle ID to notify on
15
16
  * `id` (int64): Bundle Notification ID
16
17
  * `notify_on_registration` (boolean): Triggers bundle notification when a registration action occurs for it.
18
+ * `notify_on_upload` (boolean): Triggers bundle notification when a upload action occurs for it.
17
19
  * `user_id` (int64): The id of the user to notify.
18
20
 
19
21
  ---
@@ -57,6 +59,7 @@ await BundleNotification.find(id)
57
59
  await BundleNotification.create({
58
60
  'user_id': 1,
59
61
  'notify_on_registration': true,
62
+ 'notify_on_upload': true,
60
63
  'bundle_id': 1,
61
64
  })
62
65
  ```
@@ -66,10 +69,42 @@ await BundleNotification.create({
66
69
 
67
70
  * `user_id` (int64): Required - The id of the user to notify.
68
71
  * `notify_on_registration` (boolean): Triggers bundle notification when a registration action occurs for it.
72
+ * `notify_on_upload` (boolean): Triggers bundle notification when a upload action occurs for it.
69
73
  * `bundle_id` (int64): Required - Bundle ID to notify on
70
74
 
71
75
  ---
72
76
 
77
+ ## Update Bundle Notification
78
+
79
+ ```
80
+ const [bundle_notification] = await BundleNotification.list()
81
+
82
+ await bundle_notification.update({
83
+ 'notify_on_registration': true,
84
+ 'notify_on_upload': true,
85
+ })
86
+ ```
87
+
88
+ ### Parameters
89
+
90
+ * `id` (int64): Required - Bundle Notification ID.
91
+ * `notify_on_registration` (boolean): Triggers bundle notification when a registration action occurs for it.
92
+ * `notify_on_upload` (boolean): Triggers bundle notification when a upload action occurs for it.
93
+
94
+ ### Example Response
95
+
96
+ ```json
97
+ {
98
+ "bundle_id": 1,
99
+ "id": 1,
100
+ "notify_on_registration": true,
101
+ "notify_on_upload": true,
102
+ "user_id": 1
103
+ }
104
+ ```
105
+
106
+ ---
107
+
73
108
  ## Delete Bundle Notification
74
109
 
75
110
  ```
package/lib/Api.js CHANGED
@@ -37,53 +37,51 @@ var Api = /*#__PURE__*/(0, _createClass2.default)(function Api() {
37
37
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(path, verb, options) {
38
38
  var isExternal, baseUrl, url, response;
39
39
  return _regenerator.default.wrap(function _callee$(_context) {
40
- while (1) {
41
- switch (_context.prev = _context.next) {
42
- case 0:
43
- isExternal = /^[a-zA-Z]+:\/\//.test(path);
44
- baseUrl = _Files.default.getBaseUrl();
45
- if (!(!isExternal && !baseUrl)) {
46
- _context.next = 4;
47
- break;
48
- }
49
- throw new errors.ConfigurationError('Base URL has not been set - use Files.setBaseUrl() to set it');
50
- case 4:
51
- url = isExternal ? path : "".concat(baseUrl).concat(_Files.default.getEndpointPrefix()).concat(path);
52
- _Logger.default.debug("Sending request: ".concat(verb, " ").concat(url));
53
- _Logger.default.debug('Sending options:', _objectSpread(_objectSpread({}, options), {}, {
54
- headers: _objectSpread(_objectSpread({}, options.headers), {}, {
55
- 'X-FilesAPI-Key': '<redacted>'
56
- })
57
- }));
58
- Api._configureAutoRetry();
59
- _context.prev = 8;
60
- _context.next = 11;
61
- return (0, _axios.default)(_objectSpread({
62
- method: verb,
63
- timeout: _Files.default.getNetworkTimeout() * 1000,
64
- url: url
65
- }, options));
66
- case 11:
67
- response = _context.sent;
68
- _Logger.default.debug("Status: ".concat(response.status, " ").concat(response.statusText));
69
- if (_Files.default.shouldDebugResponseHeaders()) {
70
- _Logger.default.debug('Response Headers: ');
71
- _Logger.default.debug(response.headers);
72
- }
73
- return _context.abrupt("return", {
74
- status: response.status,
75
- reason: response.statusText,
76
- headers: response.headers,
77
- data: response.data
78
- });
79
- case 17:
80
- _context.prev = 17;
81
- _context.t0 = _context["catch"](8);
82
- errors.handleErrorResponse(_context.t0);
83
- case 20:
84
- case "end":
85
- return _context.stop();
86
- }
40
+ while (1) switch (_context.prev = _context.next) {
41
+ case 0:
42
+ isExternal = /^[a-zA-Z]+:\/\//.test(path);
43
+ baseUrl = _Files.default.getBaseUrl();
44
+ if (!(!isExternal && !baseUrl)) {
45
+ _context.next = 4;
46
+ break;
47
+ }
48
+ throw new errors.ConfigurationError('Base URL has not been set - use Files.setBaseUrl() to set it');
49
+ case 4:
50
+ url = isExternal ? path : "".concat(baseUrl).concat(_Files.default.getEndpointPrefix()).concat(path);
51
+ _Logger.default.debug("Sending request: ".concat(verb, " ").concat(url));
52
+ _Logger.default.debug('Sending options:', _objectSpread(_objectSpread({}, options), {}, {
53
+ headers: _objectSpread(_objectSpread({}, options.headers), {}, {
54
+ 'X-FilesAPI-Key': '<redacted>'
55
+ })
56
+ }));
57
+ Api._configureAutoRetry();
58
+ _context.prev = 8;
59
+ _context.next = 11;
60
+ return (0, _axios.default)(_objectSpread({
61
+ method: verb,
62
+ timeout: _Files.default.getNetworkTimeout() * 1000,
63
+ url: url
64
+ }, options));
65
+ case 11:
66
+ response = _context.sent;
67
+ _Logger.default.debug("Status: ".concat(response.status, " ").concat(response.statusText));
68
+ if (_Files.default.shouldDebugResponseHeaders()) {
69
+ _Logger.default.debug('Response Headers: ');
70
+ _Logger.default.debug(response.headers);
71
+ }
72
+ return _context.abrupt("return", {
73
+ status: response.status,
74
+ reason: response.statusText,
75
+ headers: response.headers,
76
+ data: response.data
77
+ });
78
+ case 17:
79
+ _context.prev = 17;
80
+ _context.t0 = _context["catch"](8);
81
+ errors.handleErrorResponse(_context.t0);
82
+ case 20:
83
+ case "end":
84
+ return _context.stop();
87
85
  }
88
86
  }, _callee, null, [[8, 17]]);
89
87
  }));
@@ -106,44 +104,42 @@ var Api = /*#__PURE__*/(0, _createClass2.default)(function Api() {
106
104
  var _options$autoPaginate;
107
105
  var _response$headers, nextCursor, _ref3, autoPaginateCount, previousAutoPaginateData, nextPage, nextParams, nextMetadata;
108
106
  return _regenerator.default.wrap(function _callee2$(_context2) {
109
- while (1) {
110
- switch (_context2.prev = _context2.next) {
111
- case 0:
112
- if (!((_options$autoPaginate = options.autoPaginate) !== null && _options$autoPaginate !== void 0 ? _options$autoPaginate : _Files.default.getAutoPaginate())) {
113
- _context2.next = 12;
114
- break;
115
- }
116
- nextCursor = response === null || response === void 0 ? void 0 : (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers['x-files-cursor'];
117
- _ref3 = metadata || {}, autoPaginateCount = _ref3.autoPaginateCount, previousAutoPaginateData = _ref3.previousAutoPaginateData;
118
- if (!nextCursor) {
119
- _context2.next = 10;
120
- break;
121
- }
122
- nextPage = (Number(params === null || params === void 0 ? void 0 : params.page) || 1) + 1;
123
- nextParams = _objectSpread(_objectSpread({}, params), {}, {
124
- cursor: nextCursor,
125
- page: nextPage
126
- });
127
- nextMetadata = {
128
- autoPaginateCount: (autoPaginateCount || 1) + 1,
129
- previousAutoPaginateData: [].concat((0, _toConsumableArray2.default)(previousAutoPaginateData || []), (0, _toConsumableArray2.default)((response === null || response === void 0 ? void 0 : response.data) || []))
130
- };
131
- return _context2.abrupt("return", Api.sendRequest(path, verb, nextParams, options, nextMetadata));
132
- case 10:
133
- if (!previousAutoPaginateData) {
134
- _context2.next = 12;
135
- break;
136
- }
137
- return _context2.abrupt("return", _objectSpread(_objectSpread({}, response), {}, {
138
- autoPaginateRequests: autoPaginateCount,
139
- data: [].concat((0, _toConsumableArray2.default)(previousAutoPaginateData), (0, _toConsumableArray2.default)((response === null || response === void 0 ? void 0 : response.data) || []))
140
- }));
141
- case 12:
142
- return _context2.abrupt("return", response);
143
- case 13:
144
- case "end":
145
- return _context2.stop();
146
- }
107
+ while (1) switch (_context2.prev = _context2.next) {
108
+ case 0:
109
+ if (!((_options$autoPaginate = options.autoPaginate) !== null && _options$autoPaginate !== void 0 ? _options$autoPaginate : _Files.default.getAutoPaginate())) {
110
+ _context2.next = 12;
111
+ break;
112
+ }
113
+ nextCursor = response === null || response === void 0 ? void 0 : (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers['x-files-cursor'];
114
+ _ref3 = metadata || {}, autoPaginateCount = _ref3.autoPaginateCount, previousAutoPaginateData = _ref3.previousAutoPaginateData;
115
+ if (!nextCursor) {
116
+ _context2.next = 10;
117
+ break;
118
+ }
119
+ nextPage = (Number(params === null || params === void 0 ? void 0 : params.page) || 1) + 1;
120
+ nextParams = _objectSpread(_objectSpread({}, params), {}, {
121
+ cursor: nextCursor,
122
+ page: nextPage
123
+ });
124
+ nextMetadata = {
125
+ autoPaginateCount: (autoPaginateCount || 1) + 1,
126
+ previousAutoPaginateData: [].concat((0, _toConsumableArray2.default)(previousAutoPaginateData || []), (0, _toConsumableArray2.default)((response === null || response === void 0 ? void 0 : response.data) || []))
127
+ };
128
+ return _context2.abrupt("return", Api.sendRequest(path, verb, nextParams, options, nextMetadata));
129
+ case 10:
130
+ if (!previousAutoPaginateData) {
131
+ _context2.next = 12;
132
+ break;
133
+ }
134
+ return _context2.abrupt("return", _objectSpread(_objectSpread({}, response), {}, {
135
+ autoPaginateRequests: autoPaginateCount,
136
+ data: [].concat((0, _toConsumableArray2.default)(previousAutoPaginateData), (0, _toConsumableArray2.default)((response === null || response === void 0 ? void 0 : response.data) || []))
137
+ }));
138
+ case 12:
139
+ return _context2.abrupt("return", response);
140
+ case 13:
141
+ case "end":
142
+ return _context2.stop();
147
143
  }
148
144
  }, _callee2);
149
145
  }));
@@ -168,83 +164,81 @@ var Api = /*#__PURE__*/(0, _createClass2.default)(function Api() {
168
164
  response,
169
165
  _args3 = arguments;
170
166
  return _regenerator.default.wrap(function _callee3$(_context3) {
171
- while (1) {
172
- switch (_context3.prev = _context3.next) {
173
- case 0:
174
- params = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : null;
175
- options = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : {};
176
- metadata = _args3.length > 4 && _args3[4] !== undefined ? _args3[4] : null;
177
- headers = _objectSpread(_objectSpread({
178
- Accept: 'application/json'
179
- }, options.headers), {}, {
180
- 'User-Agent': _Files.default.getUserAgent()
181
- });
182
- isExternal = /^[a-zA-Z]+:\/\//.test(path);
183
- if (isExternal) {
184
- _context3.next = 17;
185
- break;
186
- }
187
- sessionId = options.sessionId || _Files.default.getSessionId();
188
- if (!sessionId) {
189
- _context3.next = 11;
190
- break;
191
- }
192
- headers['X-FilesAPI-Auth'] = sessionId;
167
+ while (1) switch (_context3.prev = _context3.next) {
168
+ case 0:
169
+ params = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : null;
170
+ options = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : {};
171
+ metadata = _args3.length > 4 && _args3[4] !== undefined ? _args3[4] : null;
172
+ headers = _objectSpread(_objectSpread({
173
+ Accept: 'application/json'
174
+ }, options.headers), {}, {
175
+ 'User-Agent': _Files.default.getUserAgent()
176
+ });
177
+ isExternal = /^[a-zA-Z]+:\/\//.test(path);
178
+ if (isExternal) {
193
179
  _context3.next = 17;
194
180
  break;
195
- case 11:
196
- isCreatingSession = path === '/sessions' && verb.toUpperCase() === 'POST'; // api key cannot be used when creating a session
197
- if (isCreatingSession) {
198
- _context3.next = 17;
199
- break;
200
- }
201
- apiKey = options.apiKey || _Files.default.getApiKey();
202
- if (apiKey) {
203
- _context3.next = 16;
204
- break;
205
- }
206
- throw new errors.ConfigurationError('API key has not been set - use Files.setApiKey() to set it');
207
- case 16:
208
- headers['X-FilesAPI-Key'] = apiKey;
209
- case 17:
210
- updatedOptions = _objectSpread(_objectSpread({}, options), {}, {
211
- headers: headers
212
- });
213
- requestPath = path;
214
- hasParams = (0, _utils.isObject)(params) && !(0, _utils.isEmpty)(params);
215
- if (hasParams) {
216
- if (verb.toUpperCase() === 'GET') {
217
- pairs = Object.entries(params).map(function (_ref5) {
218
- var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
219
- key = _ref6[0],
220
- value = _ref6[1];
221
- return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(value));
222
- });
223
- requestPath += path.includes('?') ? '&' : '?';
224
- requestPath += pairs.join('&');
225
- } else {
226
- updatedOptions.data = JSON.stringify(params);
227
- headers['Content-Type'] = 'application/json';
228
- }
229
- }
230
- if (_Files.default.shouldDebugRequest()) {
231
- _Logger.default.debug('Request Options:');
232
- _Logger.default.debug(_objectSpread(_objectSpread({}, updatedOptions), {}, {
233
- data: hasParams ? "payload keys: ".concat(Object.keys(params).join(', ')) : '(none)',
234
- headers: _objectSpread(_objectSpread({}, headers), {}, {
235
- 'X-FilesAPI-Key': '<redacted>'
236
- })
237
- }));
181
+ }
182
+ sessionId = options.sessionId || _Files.default.getSessionId();
183
+ if (!sessionId) {
184
+ _context3.next = 11;
185
+ break;
186
+ }
187
+ headers['X-FilesAPI-Auth'] = sessionId;
188
+ _context3.next = 17;
189
+ break;
190
+ case 11:
191
+ isCreatingSession = path === '/sessions' && verb.toUpperCase() === 'POST'; // api key cannot be used when creating a session
192
+ if (isCreatingSession) {
193
+ _context3.next = 17;
194
+ break;
195
+ }
196
+ apiKey = options.apiKey || _Files.default.getApiKey();
197
+ if (apiKey) {
198
+ _context3.next = 16;
199
+ break;
200
+ }
201
+ throw new errors.ConfigurationError('API key has not been set - use Files.setApiKey() to set it');
202
+ case 16:
203
+ headers['X-FilesAPI-Key'] = apiKey;
204
+ case 17:
205
+ updatedOptions = _objectSpread(_objectSpread({}, options), {}, {
206
+ headers: headers
207
+ });
208
+ requestPath = path;
209
+ hasParams = (0, _utils.isObject)(params) && !(0, _utils.isEmpty)(params);
210
+ if (hasParams) {
211
+ if (verb.toUpperCase() === 'GET') {
212
+ pairs = Object.entries(params).map(function (_ref5) {
213
+ var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
214
+ key = _ref6[0],
215
+ value = _ref6[1];
216
+ return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(value));
217
+ });
218
+ requestPath += path.includes('?') ? '&' : '?';
219
+ requestPath += pairs.join('&');
220
+ } else {
221
+ updatedOptions.data = JSON.stringify(params);
222
+ headers['Content-Type'] = 'application/json';
238
223
  }
239
- _context3.next = 24;
240
- return Api._sendVerbatim(requestPath, verb, updatedOptions);
241
- case 24:
242
- response = _context3.sent;
243
- return _context3.abrupt("return", Api._autoPaginate(path, verb, params, updatedOptions, response, metadata));
244
- case 26:
245
- case "end":
246
- return _context3.stop();
247
- }
224
+ }
225
+ if (_Files.default.shouldDebugRequest()) {
226
+ _Logger.default.debug('Request Options:');
227
+ _Logger.default.debug(_objectSpread(_objectSpread({}, updatedOptions), {}, {
228
+ data: hasParams ? "payload keys: ".concat(Object.keys(params).join(', ')) : '(none)',
229
+ headers: _objectSpread(_objectSpread({}, headers), {}, {
230
+ 'X-FilesAPI-Key': '<redacted>'
231
+ })
232
+ }));
233
+ }
234
+ _context3.next = 24;
235
+ return Api._sendVerbatim(requestPath, verb, updatedOptions);
236
+ case 24:
237
+ response = _context3.sent;
238
+ return _context3.abrupt("return", Api._autoPaginate(path, verb, params, updatedOptions, response, metadata));
239
+ case 26:
240
+ case "end":
241
+ return _context3.stop();
248
242
  }
249
243
  }, _callee3);
250
244
  }));
@@ -18,22 +18,20 @@ exports.openDiskFileWriteStream = openDiskFileWriteStream;
18
18
  var saveUrlToStream = /*#__PURE__*/function () {
19
19
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(url, stream) {
20
20
  return _regenerator.default.wrap(function _callee$(_context) {
21
- while (1) {
22
- switch (_context.prev = _context.next) {
23
- case 0:
24
- return _context.abrupt("return", new Promise(function (resolve, reject) {
25
- var https = require('https');
26
- https.get(url, function (response) {
27
- response.pipe(stream);
28
- stream.on('finish', resolve);
29
- }).on('error', function (error) {
30
- reject(error);
31
- });
32
- }));
33
- case 1:
34
- case "end":
35
- return _context.stop();
36
- }
21
+ while (1) switch (_context.prev = _context.next) {
22
+ case 0:
23
+ return _context.abrupt("return", new Promise(function (resolve, reject) {
24
+ var https = require('https');
25
+ https.get(url, function (response) {
26
+ response.pipe(stream);
27
+ stream.on('finish', resolve);
28
+ }).on('error', function (error) {
29
+ reject(error);
30
+ });
31
+ }));
32
+ case 1:
33
+ case "end":
34
+ return _context.stop();
37
35
  }
38
36
  }, _callee);
39
37
  }));
@@ -46,18 +44,16 @@ var saveUrlToFile = /*#__PURE__*/function () {
46
44
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(url, destinationPath) {
47
45
  var stream;
48
46
  return _regenerator.default.wrap(function _callee2$(_context2) {
49
- while (1) {
50
- switch (_context2.prev = _context2.next) {
51
- case 0:
52
- stream = openDiskFileWriteStream(destinationPath);
53
- _context2.next = 3;
54
- return saveUrlToStream(url, stream);
55
- case 3:
56
- stream.close();
57
- case 4:
58
- case "end":
59
- return _context2.stop();
60
- }
47
+ while (1) switch (_context2.prev = _context2.next) {
48
+ case 0:
49
+ stream = openDiskFileWriteStream(destinationPath);
50
+ _context2.next = 3;
51
+ return saveUrlToStream(url, stream);
52
+ case 3:
53
+ stream.close();
54
+ case 4:
55
+ case "end":
56
+ return _context2.stop();
61
57
  }
62
58
  }, _callee2);
63
59
  }));