files.com 1.2.249 → 1.2.250
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/_VERSION +1 -1
- package/lib/Api.js +72 -71
- package/lib/Files.js +1 -1
- package/lib/isomorphic/File.node.js +5 -5
- package/lib/models/ActionNotificationExport.js +38 -38
- package/lib/models/ActionNotificationExportResult.js +14 -14
- package/lib/models/ApiKey.js +100 -100
- package/lib/models/ApiRequestLog.js +8 -8
- package/lib/models/App.js +8 -8
- package/lib/models/As2IncomingMessage.js +10 -10
- package/lib/models/As2OutgoingMessage.js +10 -10
- package/lib/models/As2Partner.js +101 -101
- package/lib/models/As2Station.js +81 -81
- package/lib/models/Automation.js +167 -167
- package/lib/models/AutomationLog.js +8 -8
- package/lib/models/AutomationRun.js +24 -24
- package/lib/models/BandwidthSnapshot.js +8 -8
- package/lib/models/Behavior.js +106 -106
- package/lib/models/Bundle.js +143 -143
- package/lib/models/BundleAction.js +10 -10
- package/lib/models/BundleDownload.js +12 -12
- package/lib/models/BundleNotification.js +69 -69
- package/lib/models/BundleRecipient.js +40 -40
- package/lib/models/BundleRegistration.js +12 -12
- package/lib/models/Clickwrap.js +79 -79
- package/lib/models/DnsRecord.js +8 -8
- package/lib/models/EmailIncomingMessage.js +8 -8
- package/lib/models/EmailLog.js +8 -8
- package/lib/models/ExavaultApiRequestLog.js +8 -8
- package/lib/models/ExternalEvent.js +36 -36
- package/lib/models/File.js +269 -269
- package/lib/models/FileComment.js +70 -70
- package/lib/models/FileCommentReaction.js +34 -34
- package/lib/models/FileMigration.js +10 -10
- package/lib/models/FileMigrationLog.js +8 -8
- package/lib/models/Folder.js +36 -36
- package/lib/models/FormFieldSet.js +71 -71
- package/lib/models/FtpActionLog.js +8 -8
- package/lib/models/GpgKey.js +81 -81
- package/lib/models/Group.js +83 -83
- package/lib/models/GroupUser.js +89 -89
- package/lib/models/History.js +88 -88
- package/lib/models/HistoryExport.js +64 -64
- package/lib/models/HistoryExportResult.js +14 -14
- package/lib/models/InboxRecipient.js +36 -36
- package/lib/models/InboxRegistration.js +10 -10
- package/lib/models/InboxUpload.js +8 -8
- package/lib/models/Invoice.js +18 -18
- package/lib/models/IpAddress.js +32 -32
- package/lib/models/Lock.js +51 -51
- package/lib/models/Message.js +100 -100
- package/lib/models/MessageComment.js +78 -78
- package/lib/models/MessageCommentReaction.js +54 -54
- package/lib/models/MessageReaction.js +54 -54
- package/lib/models/Notification.js +91 -91
- package/lib/models/OutboundConnectionLog.js +8 -8
- package/lib/models/Payment.js +18 -18
- package/lib/models/Permission.js +54 -54
- package/lib/models/Priority.js +14 -14
- package/lib/models/Project.js +70 -70
- package/lib/models/PublicHostingRequestLog.js +8 -8
- package/lib/models/PublicKey.js +78 -78
- package/lib/models/RemoteBandwidthSnapshot.js +8 -8
- package/lib/models/RemoteServer.js +362 -362
- package/lib/models/Request.js +60 -60
- package/lib/models/Restore.js +24 -24
- package/lib/models/Session.js +21 -21
- package/lib/models/SettingsChange.js +8 -8
- package/lib/models/SftpActionLog.js +8 -8
- package/lib/models/SftpHostKey.js +67 -67
- package/lib/models/ShareGroup.js +79 -79
- package/lib/models/SiemHttpDestination.js +158 -158
- package/lib/models/Site.js +150 -150
- package/lib/models/Snapshot.js +85 -85
- package/lib/models/SsoStrategy.js +32 -32
- package/lib/models/Style.js +48 -48
- package/lib/models/SyncLog.js +8 -8
- package/lib/models/UsageDailySnapshot.js +8 -8
- package/lib/models/UsageSnapshot.js +8 -8
- package/lib/models/User.js +215 -215
- package/lib/models/UserCipherUse.js +10 -10
- package/lib/models/UserLifecycleRule.js +92 -92
- package/lib/models/UserRequest.js +56 -56
- package/lib/models/UserSftpClientUse.js +10 -10
- package/lib/models/WebDavActionLog.js +8 -8
- package/lib/models/WebhookTest.js +24 -24
- package/package.json +1 -1
- package/src/Files.js +1 -1
package/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.250
|
package/lib/Api.js
CHANGED
|
@@ -20,7 +20,7 @@ var _utils = require("./utils");
|
|
|
20
20
|
var _Api;
|
|
21
21
|
var _excluded = ["timeoutSecs"],
|
|
22
22
|
_excluded2 = ["getAgentForUrl"];
|
|
23
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var
|
|
23
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
|
|
24
24
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25
25
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
26
|
var fetchWithTimeout = function fetchWithTimeout(url) {
|
|
@@ -44,43 +44,44 @@ var _fetchWithRetry = /*#__PURE__*/function () {
|
|
|
44
44
|
maxRetryDelaySecs,
|
|
45
45
|
nextRetries,
|
|
46
46
|
delaySecs,
|
|
47
|
-
_args = arguments
|
|
48
|
-
|
|
47
|
+
_args = arguments,
|
|
48
|
+
_t;
|
|
49
|
+
return _regenerator.default.wrap(function (_context) {
|
|
49
50
|
while (1) switch (_context.prev = _context.next) {
|
|
50
51
|
case 0:
|
|
51
52
|
retries = _args.length > 2 && _args[2] !== undefined ? _args[2] : 0;
|
|
52
53
|
maxRetries = _Files.default.getMaxNetworkRetries();
|
|
53
54
|
minRetryDelaySecs = _Files.default.getMinNetworkRetryDelay();
|
|
54
55
|
maxRetryDelaySecs = _Files.default.getMaxNetworkRetryDelay();
|
|
55
|
-
_context.prev =
|
|
56
|
-
_context.next =
|
|
56
|
+
_context.prev = 1;
|
|
57
|
+
_context.next = 2;
|
|
57
58
|
return fetchWithTimeout(url, options);
|
|
58
|
-
case
|
|
59
|
+
case 2:
|
|
59
60
|
return _context.abrupt("return", _context.sent);
|
|
60
|
-
case
|
|
61
|
-
_context.prev =
|
|
62
|
-
|
|
63
|
-
_Logger.default.info("Request #".concat(retries + 1, " failed: ").concat(
|
|
61
|
+
case 3:
|
|
62
|
+
_context.prev = 3;
|
|
63
|
+
_t = _context["catch"](1);
|
|
64
|
+
_Logger.default.info("Request #".concat(retries + 1, " failed: ").concat(_t.message));
|
|
64
65
|
if (!(retries >= maxRetries)) {
|
|
65
|
-
_context.next =
|
|
66
|
+
_context.next = 4;
|
|
66
67
|
break;
|
|
67
68
|
}
|
|
68
|
-
throw
|
|
69
|
-
case
|
|
69
|
+
throw _t;
|
|
70
|
+
case 4:
|
|
70
71
|
nextRetries = retries + 1;
|
|
71
72
|
_Logger.default.info("Retrying request (retry ".concat(nextRetries, " of ").concat(maxRetries, ")"));
|
|
72
73
|
delaySecs = Math.min(minRetryDelaySecs * Math.pow(2, retries), maxRetryDelaySecs); // exponential backoff
|
|
73
|
-
_context.next =
|
|
74
|
+
_context.next = 5;
|
|
74
75
|
return new Promise(function (resolve) {
|
|
75
76
|
setTimeout(resolve, delaySecs * 1000);
|
|
76
77
|
});
|
|
77
|
-
case
|
|
78
|
+
case 5:
|
|
78
79
|
return _context.abrupt("return", _fetchWithRetry(url, options, nextRetries));
|
|
79
|
-
case
|
|
80
|
+
case 6:
|
|
80
81
|
case "end":
|
|
81
82
|
return _context.stop();
|
|
82
83
|
}
|
|
83
|
-
}, _callee, null, [[
|
|
84
|
+
}, _callee, null, [[1, 3]]);
|
|
84
85
|
}));
|
|
85
86
|
return function fetchWithRetry(_x, _x2) {
|
|
86
87
|
return _ref2.apply(this, arguments);
|
|
@@ -92,19 +93,19 @@ var Api = /*#__PURE__*/(0, _createClass2.default)(function Api() {
|
|
|
92
93
|
_Api = Api;
|
|
93
94
|
(0, _defineProperty2.default)(Api, "_sendVerbatim", /*#__PURE__*/function () {
|
|
94
95
|
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(path, verb, optionsRaw) {
|
|
95
|
-
var _ref4, getAgentForUrl, options, isExternal, baseUrl, url, agent, response, headers, contentType, data, normalizedResponse;
|
|
96
|
-
return _regenerator.default.wrap(function
|
|
96
|
+
var _ref4, getAgentForUrl, options, isExternal, baseUrl, url, agent, response, headers, contentType, data, normalizedResponse, _t2;
|
|
97
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
97
98
|
while (1) switch (_context2.prev = _context2.next) {
|
|
98
99
|
case 0:
|
|
99
100
|
_ref4 = optionsRaw || {}, getAgentForUrl = _ref4.getAgentForUrl, options = (0, _objectWithoutProperties2.default)(_ref4, _excluded2);
|
|
100
101
|
isExternal = /^[a-zA-Z]+:\/\//.test(path);
|
|
101
102
|
baseUrl = _Files.default.getBaseUrl();
|
|
102
103
|
if (!(!isExternal && !baseUrl)) {
|
|
103
|
-
_context2.next =
|
|
104
|
+
_context2.next = 1;
|
|
104
105
|
break;
|
|
105
106
|
}
|
|
106
107
|
throw new errors.ConfigurationError('Base URL has not been set - use Files.setBaseUrl() to set it');
|
|
107
|
-
case
|
|
108
|
+
case 1:
|
|
108
109
|
url = isExternal ? path : "".concat(baseUrl).concat(_Files.default.getEndpointPrefix()).concat(path);
|
|
109
110
|
_Logger.default.debug("Sending request: ".concat(verb, " ").concat(url));
|
|
110
111
|
_Logger.default.debug('Sending options:', _objectSpread(_objectSpread({
|
|
@@ -114,15 +115,15 @@ _Api = Api;
|
|
|
114
115
|
'X-FilesAPI-Key': '<redacted>'
|
|
115
116
|
})
|
|
116
117
|
}));
|
|
117
|
-
_context2.prev =
|
|
118
|
+
_context2.prev = 2;
|
|
118
119
|
agent = (getAgentForUrl === null || getAgentForUrl === void 0 ? void 0 : getAgentForUrl(url)) || (options === null || options === void 0 ? void 0 : options.agent) || (options === null || options === void 0 ? void 0 : options.httpsAgent) || (options === null || options === void 0 ? void 0 : options.httpAgent);
|
|
119
|
-
_context2.next =
|
|
120
|
+
_context2.next = 3;
|
|
120
121
|
return _fetchWithRetry(url, _objectSpread({
|
|
121
122
|
agent: agent,
|
|
122
123
|
method: verb,
|
|
123
124
|
timeoutSecs: _Files.default.getNetworkTimeout()
|
|
124
125
|
}, options));
|
|
125
|
-
case
|
|
126
|
+
case 3:
|
|
126
127
|
response = _context2.sent;
|
|
127
128
|
headers = Object.fromEntries(response.headers.entries());
|
|
128
129
|
_Logger.default.debug("Status: ".concat(response.status, " ").concat(response.statusText));
|
|
@@ -132,49 +133,49 @@ _Api = Api;
|
|
|
132
133
|
}
|
|
133
134
|
contentType = headers['content-type'] || '';
|
|
134
135
|
if (!contentType.includes('application/json')) {
|
|
135
|
-
_context2.next =
|
|
136
|
+
_context2.next = 7;
|
|
136
137
|
break;
|
|
137
138
|
}
|
|
138
139
|
if (!(headers['content-length'] === '0')) {
|
|
139
|
-
_context2.next =
|
|
140
|
+
_context2.next = 4;
|
|
140
141
|
break;
|
|
141
142
|
}
|
|
142
143
|
data = response.body;
|
|
143
|
-
_context2.next =
|
|
144
|
+
_context2.next = 6;
|
|
144
145
|
break;
|
|
145
|
-
case
|
|
146
|
-
_context2.next =
|
|
146
|
+
case 4:
|
|
147
|
+
_context2.next = 5;
|
|
147
148
|
return response.json();
|
|
148
|
-
case
|
|
149
|
+
case 5:
|
|
149
150
|
data = _context2.sent;
|
|
150
|
-
case
|
|
151
|
-
_context2.next =
|
|
151
|
+
case 6:
|
|
152
|
+
_context2.next = 12;
|
|
152
153
|
break;
|
|
153
|
-
case
|
|
154
|
+
case 7:
|
|
154
155
|
if (!contentType.includes('text/')) {
|
|
155
|
-
_context2.next =
|
|
156
|
+
_context2.next = 9;
|
|
156
157
|
break;
|
|
157
158
|
}
|
|
158
|
-
_context2.next =
|
|
159
|
+
_context2.next = 8;
|
|
159
160
|
return response.text();
|
|
160
|
-
case
|
|
161
|
+
case 8:
|
|
161
162
|
data = _context2.sent;
|
|
162
|
-
_context2.next =
|
|
163
|
+
_context2.next = 12;
|
|
163
164
|
break;
|
|
164
|
-
case
|
|
165
|
+
case 9:
|
|
165
166
|
if (!contentType.includes('multipart/form-data')) {
|
|
166
|
-
_context2.next =
|
|
167
|
+
_context2.next = 11;
|
|
167
168
|
break;
|
|
168
169
|
}
|
|
169
|
-
_context2.next =
|
|
170
|
+
_context2.next = 10;
|
|
170
171
|
return response.formData();
|
|
171
|
-
case
|
|
172
|
+
case 10:
|
|
172
173
|
data = _context2.sent;
|
|
173
|
-
_context2.next =
|
|
174
|
+
_context2.next = 12;
|
|
174
175
|
break;
|
|
175
|
-
case
|
|
176
|
+
case 11:
|
|
176
177
|
data = response.body;
|
|
177
|
-
case
|
|
178
|
+
case 12:
|
|
178
179
|
normalizedResponse = {
|
|
179
180
|
data: data,
|
|
180
181
|
headers: headers,
|
|
@@ -182,24 +183,24 @@ _Api = Api;
|
|
|
182
183
|
status: response.status
|
|
183
184
|
};
|
|
184
185
|
if (response.ok) {
|
|
185
|
-
_context2.next =
|
|
186
|
+
_context2.next = 13;
|
|
186
187
|
break;
|
|
187
188
|
}
|
|
188
189
|
throw {
|
|
189
190
|
response: normalizedResponse
|
|
190
191
|
};
|
|
191
|
-
case
|
|
192
|
+
case 13:
|
|
192
193
|
return _context2.abrupt("return", normalizedResponse);
|
|
193
|
-
case
|
|
194
|
-
_context2.prev =
|
|
195
|
-
|
|
196
|
-
errors.handleErrorResponse(
|
|
194
|
+
case 14:
|
|
195
|
+
_context2.prev = 14;
|
|
196
|
+
_t2 = _context2["catch"](2);
|
|
197
|
+
errors.handleErrorResponse(_t2);
|
|
197
198
|
return _context2.abrupt("return", null);
|
|
198
|
-
case
|
|
199
|
+
case 15:
|
|
199
200
|
case "end":
|
|
200
201
|
return _context2.stop();
|
|
201
202
|
}
|
|
202
|
-
}, _callee2, null, [[
|
|
203
|
+
}, _callee2, null, [[2, 14]]);
|
|
203
204
|
}));
|
|
204
205
|
return function (_x3, _x4, _x5) {
|
|
205
206
|
return _ref3.apply(this, arguments);
|
|
@@ -216,17 +217,17 @@ _Api = Api;
|
|
|
216
217
|
var _ref5 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(path, verb, params, options, response, metadata) {
|
|
217
218
|
var _options$autoPaginate;
|
|
218
219
|
var _response$headers, nextCursor, _ref6, autoPaginateCount, previousAutoPaginateData, nextPage, nextParams, nextMetadata;
|
|
219
|
-
return _regenerator.default.wrap(function
|
|
220
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
220
221
|
while (1) switch (_context3.prev = _context3.next) {
|
|
221
222
|
case 0:
|
|
222
223
|
if (!((_options$autoPaginate = options.autoPaginate) !== null && _options$autoPaginate !== void 0 ? _options$autoPaginate : _Files.default.getAutoPaginate())) {
|
|
223
|
-
_context3.next =
|
|
224
|
+
_context3.next = 2;
|
|
224
225
|
break;
|
|
225
226
|
}
|
|
226
227
|
nextCursor = response === null || response === void 0 || (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers['x-files-cursor'];
|
|
227
228
|
_ref6 = metadata || {}, autoPaginateCount = _ref6.autoPaginateCount, previousAutoPaginateData = _ref6.previousAutoPaginateData;
|
|
228
229
|
if (!nextCursor) {
|
|
229
|
-
_context3.next =
|
|
230
|
+
_context3.next = 1;
|
|
230
231
|
break;
|
|
231
232
|
}
|
|
232
233
|
nextPage = (Number(params === null || params === void 0 ? void 0 : params.page) || 1) + 1;
|
|
@@ -239,18 +240,18 @@ _Api = Api;
|
|
|
239
240
|
previousAutoPaginateData: [].concat((0, _toConsumableArray2.default)(previousAutoPaginateData || []), (0, _toConsumableArray2.default)((response === null || response === void 0 ? void 0 : response.data) || []))
|
|
240
241
|
};
|
|
241
242
|
return _context3.abrupt("return", _Api.sendRequest(path, verb, nextParams, options, nextMetadata));
|
|
242
|
-
case
|
|
243
|
+
case 1:
|
|
243
244
|
if (!previousAutoPaginateData) {
|
|
244
|
-
_context3.next =
|
|
245
|
+
_context3.next = 2;
|
|
245
246
|
break;
|
|
246
247
|
}
|
|
247
248
|
return _context3.abrupt("return", _objectSpread(_objectSpread({}, response), {}, {
|
|
248
249
|
autoPaginateRequests: autoPaginateCount,
|
|
249
250
|
data: [].concat((0, _toConsumableArray2.default)(previousAutoPaginateData), (0, _toConsumableArray2.default)((response === null || response === void 0 ? void 0 : response.data) || []))
|
|
250
251
|
}));
|
|
251
|
-
case
|
|
252
|
+
case 2:
|
|
252
253
|
return _context3.abrupt("return", response);
|
|
253
|
-
case
|
|
254
|
+
case 3:
|
|
254
255
|
case "end":
|
|
255
256
|
return _context3.stop();
|
|
256
257
|
}
|
|
@@ -288,7 +289,7 @@ _Api = Api;
|
|
|
288
289
|
pairs,
|
|
289
290
|
response,
|
|
290
291
|
_args4 = arguments;
|
|
291
|
-
return _regenerator.default.wrap(function
|
|
292
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
292
293
|
while (1) switch (_context4.prev = _context4.next) {
|
|
293
294
|
case 0:
|
|
294
295
|
params = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : null;
|
|
@@ -304,32 +305,32 @@ _Api = Api;
|
|
|
304
305
|
});
|
|
305
306
|
isExternal = /^[a-zA-Z]+:\/\//.test(path);
|
|
306
307
|
if (isExternal) {
|
|
307
|
-
_context4.next =
|
|
308
|
+
_context4.next = 3;
|
|
308
309
|
break;
|
|
309
310
|
}
|
|
310
311
|
sessionId = options.sessionId || _Files.default.getSessionId();
|
|
311
312
|
if (!sessionId) {
|
|
312
|
-
_context4.next =
|
|
313
|
+
_context4.next = 1;
|
|
313
314
|
break;
|
|
314
315
|
}
|
|
315
316
|
headers['X-FilesAPI-Auth'] = sessionId;
|
|
316
|
-
_context4.next =
|
|
317
|
+
_context4.next = 3;
|
|
317
318
|
break;
|
|
318
|
-
case
|
|
319
|
+
case 1:
|
|
319
320
|
isCreatingSession = path === '/sessions' && verb.toUpperCase() === 'POST'; // api key cannot be used when creating a session
|
|
320
321
|
if (isCreatingSession) {
|
|
321
|
-
_context4.next =
|
|
322
|
+
_context4.next = 3;
|
|
322
323
|
break;
|
|
323
324
|
}
|
|
324
325
|
apiKey = options.apiKey || _Files.default.getApiKey();
|
|
325
326
|
if (apiKey) {
|
|
326
|
-
_context4.next =
|
|
327
|
+
_context4.next = 2;
|
|
327
328
|
break;
|
|
328
329
|
}
|
|
329
330
|
throw new errors.ConfigurationError('API key has not been set - use Files.setApiKey() to set it');
|
|
330
|
-
case
|
|
331
|
+
case 2:
|
|
331
332
|
headers['X-FilesAPI-Key'] = apiKey;
|
|
332
|
-
case
|
|
333
|
+
case 3:
|
|
333
334
|
updatedOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
334
335
|
headers: headers
|
|
335
336
|
});
|
|
@@ -371,12 +372,12 @@ _Api = Api;
|
|
|
371
372
|
})
|
|
372
373
|
}));
|
|
373
374
|
}
|
|
374
|
-
_context4.next =
|
|
375
|
+
_context4.next = 4;
|
|
375
376
|
return _Api._sendVerbatim(requestPath, verb, updatedOptions);
|
|
376
|
-
case
|
|
377
|
+
case 4:
|
|
377
378
|
response = _context4.sent;
|
|
378
379
|
return _context4.abrupt("return", _Api._autoPaginate(path, verb, params, updatedOptions, response, metadata));
|
|
379
|
-
case
|
|
380
|
+
case 5:
|
|
380
381
|
case "end":
|
|
381
382
|
return _context4.stop();
|
|
382
383
|
}
|
package/lib/Files.js
CHANGED
|
@@ -12,7 +12,7 @@ var apiKey;
|
|
|
12
12
|
var baseUrl = 'https://app.files.com';
|
|
13
13
|
var sessionId = null;
|
|
14
14
|
var language = null;
|
|
15
|
-
var version = '1.2.
|
|
15
|
+
var version = '1.2.250';
|
|
16
16
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
|
17
17
|
var logLevel = _Logger.LogLevel.INFO;
|
|
18
18
|
var debugRequest = false;
|
|
@@ -15,7 +15,7 @@ var openDiskFileWriteStream = exports.openDiskFileWriteStream = function openDis
|
|
|
15
15
|
};
|
|
16
16
|
var saveUrlToStream = exports.saveUrlToStream = /*#__PURE__*/function () {
|
|
17
17
|
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(url, stream) {
|
|
18
|
-
return _regenerator.default.wrap(function
|
|
18
|
+
return _regenerator.default.wrap(function (_context) {
|
|
19
19
|
while (1) switch (_context.prev = _context.next) {
|
|
20
20
|
case 0:
|
|
21
21
|
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
|
@@ -43,7 +43,7 @@ var saveUrlToStream = exports.saveUrlToStream = /*#__PURE__*/function () {
|
|
|
43
43
|
}();
|
|
44
44
|
var saveUrlToString = exports.saveUrlToString = /*#__PURE__*/function () {
|
|
45
45
|
var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(url) {
|
|
46
|
-
return _regenerator.default.wrap(function
|
|
46
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
47
47
|
while (1) switch (_context2.prev = _context2.next) {
|
|
48
48
|
case 0:
|
|
49
49
|
return _context2.abrupt("return", new Promise(function (resolve, reject) {
|
|
@@ -73,13 +73,13 @@ var saveUrlToString = exports.saveUrlToString = /*#__PURE__*/function () {
|
|
|
73
73
|
var saveUrlToFile = exports.saveUrlToFile = /*#__PURE__*/function () {
|
|
74
74
|
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(url, destinationPath) {
|
|
75
75
|
var stream;
|
|
76
|
-
return _regenerator.default.wrap(function
|
|
76
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
77
77
|
while (1) switch (_context3.prev = _context3.next) {
|
|
78
78
|
case 0:
|
|
79
79
|
stream = openDiskFileWriteStream(destinationPath);
|
|
80
|
-
_context3.next =
|
|
80
|
+
_context3.next = 1;
|
|
81
81
|
return saveUrlToStream(url, stream);
|
|
82
|
-
case
|
|
82
|
+
case 1:
|
|
83
83
|
case "end":
|
|
84
84
|
return _context3.stop();
|
|
85
85
|
}
|
|
@@ -132,22 +132,22 @@ var ActionNotificationExport = /*#__PURE__*/(0, _createClass2.default)(function
|
|
|
132
132
|
});
|
|
133
133
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
134
134
|
var newObject;
|
|
135
|
-
return _regenerator.default.wrap(function
|
|
135
|
+
return _regenerator.default.wrap(function (_context) {
|
|
136
136
|
while (1) switch (_context.prev = _context.next) {
|
|
137
137
|
case 0:
|
|
138
138
|
if (!_this.attributes.id) {
|
|
139
|
-
_context.next =
|
|
139
|
+
_context.next = 1;
|
|
140
140
|
break;
|
|
141
141
|
}
|
|
142
142
|
throw new errors.NotImplementedError('The ActionNotificationExport object doesn\'t support updates.');
|
|
143
|
-
case
|
|
144
|
-
_context.next =
|
|
143
|
+
case 1:
|
|
144
|
+
_context.next = 2;
|
|
145
145
|
return ActionNotificationExport.create(_this.attributes, _this.options);
|
|
146
|
-
case
|
|
146
|
+
case 2:
|
|
147
147
|
newObject = _context.sent;
|
|
148
148
|
_this.attributes = _objectSpread({}, newObject.attributes);
|
|
149
149
|
return _context.abrupt("return", true);
|
|
150
|
-
case
|
|
150
|
+
case 3:
|
|
151
151
|
case "end":
|
|
152
152
|
return _context.stop();
|
|
153
153
|
}
|
|
@@ -175,36 +175,36 @@ _ActionNotificationExport = ActionNotificationExport;
|
|
|
175
175
|
options,
|
|
176
176
|
response,
|
|
177
177
|
_args2 = arguments;
|
|
178
|
-
return _regenerator.default.wrap(function
|
|
178
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
179
179
|
while (1) switch (_context2.prev = _context2.next) {
|
|
180
180
|
case 0:
|
|
181
181
|
params = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
|
|
182
182
|
options = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {};
|
|
183
183
|
if ((0, _utils.isObject)(params)) {
|
|
184
|
-
_context2.next =
|
|
184
|
+
_context2.next = 1;
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
187
187
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
188
|
-
case
|
|
188
|
+
case 1:
|
|
189
189
|
params.id = id;
|
|
190
190
|
if (params.id) {
|
|
191
|
-
_context2.next =
|
|
191
|
+
_context2.next = 2;
|
|
192
192
|
break;
|
|
193
193
|
}
|
|
194
194
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
195
|
-
case
|
|
195
|
+
case 2:
|
|
196
196
|
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
197
|
-
_context2.next =
|
|
197
|
+
_context2.next = 3;
|
|
198
198
|
break;
|
|
199
199
|
}
|
|
200
200
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
201
|
-
case
|
|
202
|
-
_context2.next =
|
|
201
|
+
case 3:
|
|
202
|
+
_context2.next = 4;
|
|
203
203
|
return _Api.default.sendRequest("/action_notification_exports/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
|
204
|
-
case
|
|
204
|
+
case 4:
|
|
205
205
|
response = _context2.sent;
|
|
206
206
|
return _context2.abrupt("return", new _ActionNotificationExport(response === null || response === void 0 ? void 0 : response.data, options));
|
|
207
|
-
case
|
|
207
|
+
case 5:
|
|
208
208
|
case "end":
|
|
209
209
|
return _context2.stop();
|
|
210
210
|
}
|
|
@@ -235,71 +235,71 @@ _ActionNotificationExport = ActionNotificationExport;
|
|
|
235
235
|
options,
|
|
236
236
|
response,
|
|
237
237
|
_args3 = arguments;
|
|
238
|
-
return _regenerator.default.wrap(function
|
|
238
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
239
239
|
while (1) switch (_context3.prev = _context3.next) {
|
|
240
240
|
case 0:
|
|
241
241
|
params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
|
242
242
|
options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
|
|
243
243
|
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
|
244
|
-
_context3.next =
|
|
244
|
+
_context3.next = 1;
|
|
245
245
|
break;
|
|
246
246
|
}
|
|
247
247
|
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
|
248
|
-
case
|
|
248
|
+
case 1:
|
|
249
249
|
if (!(params.start_at && !(0, _utils.isString)(params.start_at))) {
|
|
250
|
-
_context3.next =
|
|
250
|
+
_context3.next = 2;
|
|
251
251
|
break;
|
|
252
252
|
}
|
|
253
253
|
throw new errors.InvalidParameterError("Bad parameter: start_at must be of type String, received ".concat((0, _utils.getType)(params.start_at)));
|
|
254
|
-
case
|
|
254
|
+
case 2:
|
|
255
255
|
if (!(params.end_at && !(0, _utils.isString)(params.end_at))) {
|
|
256
|
-
_context3.next =
|
|
256
|
+
_context3.next = 3;
|
|
257
257
|
break;
|
|
258
258
|
}
|
|
259
259
|
throw new errors.InvalidParameterError("Bad parameter: end_at must be of type String, received ".concat((0, _utils.getType)(params.end_at)));
|
|
260
|
-
case
|
|
260
|
+
case 3:
|
|
261
261
|
if (!(params.query_message && !(0, _utils.isString)(params.query_message))) {
|
|
262
|
-
_context3.next =
|
|
262
|
+
_context3.next = 4;
|
|
263
263
|
break;
|
|
264
264
|
}
|
|
265
265
|
throw new errors.InvalidParameterError("Bad parameter: query_message must be of type String, received ".concat((0, _utils.getType)(params.query_message)));
|
|
266
|
-
case
|
|
266
|
+
case 4:
|
|
267
267
|
if (!(params.query_request_method && !(0, _utils.isString)(params.query_request_method))) {
|
|
268
|
-
_context3.next =
|
|
268
|
+
_context3.next = 5;
|
|
269
269
|
break;
|
|
270
270
|
}
|
|
271
271
|
throw new errors.InvalidParameterError("Bad parameter: query_request_method must be of type String, received ".concat((0, _utils.getType)(params.query_request_method)));
|
|
272
|
-
case
|
|
272
|
+
case 5:
|
|
273
273
|
if (!(params.query_request_url && !(0, _utils.isString)(params.query_request_url))) {
|
|
274
|
-
_context3.next =
|
|
274
|
+
_context3.next = 6;
|
|
275
275
|
break;
|
|
276
276
|
}
|
|
277
277
|
throw new errors.InvalidParameterError("Bad parameter: query_request_url must be of type String, received ".concat((0, _utils.getType)(params.query_request_url)));
|
|
278
|
-
case
|
|
278
|
+
case 6:
|
|
279
279
|
if (!(params.query_status && !(0, _utils.isString)(params.query_status))) {
|
|
280
|
-
_context3.next =
|
|
280
|
+
_context3.next = 7;
|
|
281
281
|
break;
|
|
282
282
|
}
|
|
283
283
|
throw new errors.InvalidParameterError("Bad parameter: query_status must be of type String, received ".concat((0, _utils.getType)(params.query_status)));
|
|
284
|
-
case
|
|
284
|
+
case 7:
|
|
285
285
|
if (!(params.query_path && !(0, _utils.isString)(params.query_path))) {
|
|
286
|
-
_context3.next =
|
|
286
|
+
_context3.next = 8;
|
|
287
287
|
break;
|
|
288
288
|
}
|
|
289
289
|
throw new errors.InvalidParameterError("Bad parameter: query_path must be of type String, received ".concat((0, _utils.getType)(params.query_path)));
|
|
290
|
-
case
|
|
290
|
+
case 8:
|
|
291
291
|
if (!(params.query_folder && !(0, _utils.isString)(params.query_folder))) {
|
|
292
|
-
_context3.next =
|
|
292
|
+
_context3.next = 9;
|
|
293
293
|
break;
|
|
294
294
|
}
|
|
295
295
|
throw new errors.InvalidParameterError("Bad parameter: query_folder must be of type String, received ".concat((0, _utils.getType)(params.query_folder)));
|
|
296
|
-
case
|
|
297
|
-
_context3.next =
|
|
296
|
+
case 9:
|
|
297
|
+
_context3.next = 10;
|
|
298
298
|
return _Api.default.sendRequest('/action_notification_exports', 'POST', params, options);
|
|
299
|
-
case
|
|
299
|
+
case 10:
|
|
300
300
|
response = _context3.sent;
|
|
301
301
|
return _context3.abrupt("return", new _ActionNotificationExport(response === null || response === void 0 ? void 0 : response.data, options));
|
|
302
|
-
case
|
|
302
|
+
case 11:
|
|
303
303
|
case "end":
|
|
304
304
|
return _context3.stop();
|
|
305
305
|
}
|
|
@@ -97,49 +97,49 @@ _ActionNotificationExportResult = ActionNotificationExportResult;
|
|
|
97
97
|
options,
|
|
98
98
|
response,
|
|
99
99
|
_args = arguments;
|
|
100
|
-
return _regenerator.default.wrap(function
|
|
100
|
+
return _regenerator.default.wrap(function (_context) {
|
|
101
101
|
while (1) switch (_context.prev = _context.next) {
|
|
102
102
|
case 0:
|
|
103
103
|
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
104
104
|
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
105
105
|
if (params.action_notification_export_id) {
|
|
106
|
-
_context.next =
|
|
106
|
+
_context.next = 1;
|
|
107
107
|
break;
|
|
108
108
|
}
|
|
109
109
|
throw new errors.MissingParameterError('Parameter missing: action_notification_export_id');
|
|
110
|
-
case
|
|
110
|
+
case 1:
|
|
111
111
|
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
|
112
|
-
_context.next =
|
|
112
|
+
_context.next = 2;
|
|
113
113
|
break;
|
|
114
114
|
}
|
|
115
115
|
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
|
116
|
-
case
|
|
116
|
+
case 2:
|
|
117
117
|
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
118
|
-
_context.next =
|
|
118
|
+
_context.next = 3;
|
|
119
119
|
break;
|
|
120
120
|
}
|
|
121
121
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
122
|
-
case
|
|
122
|
+
case 3:
|
|
123
123
|
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
124
|
-
_context.next =
|
|
124
|
+
_context.next = 4;
|
|
125
125
|
break;
|
|
126
126
|
}
|
|
127
127
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
128
|
-
case
|
|
128
|
+
case 4:
|
|
129
129
|
if (!(params.action_notification_export_id && !(0, _utils.isInt)(params.action_notification_export_id))) {
|
|
130
|
-
_context.next =
|
|
130
|
+
_context.next = 5;
|
|
131
131
|
break;
|
|
132
132
|
}
|
|
133
133
|
throw new errors.InvalidParameterError("Bad parameter: action_notification_export_id must be of type Int, received ".concat((0, _utils.getType)(params.action_notification_export_id)));
|
|
134
|
-
case
|
|
135
|
-
_context.next =
|
|
134
|
+
case 5:
|
|
135
|
+
_context.next = 6;
|
|
136
136
|
return _Api.default.sendRequest('/action_notification_export_results', 'GET', params, options);
|
|
137
|
-
case
|
|
137
|
+
case 6:
|
|
138
138
|
response = _context.sent;
|
|
139
139
|
return _context.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
|
140
140
|
return new _ActionNotificationExportResult(obj, options);
|
|
141
141
|
})) || []);
|
|
142
|
-
case
|
|
142
|
+
case 7:
|
|
143
143
|
case "end":
|
|
144
144
|
return _context.stop();
|
|
145
145
|
}
|