files.com 1.0.220 → 1.0.222
Sign up to get free protection for your applications and to get access to all the features.
- package/_VERSION +1 -1
- package/docs/models/ApiKey.md +3 -0
- package/docs/models/Site.md +8 -0
- package/lib/Api.js +15 -82
- package/lib/Errors.js +9 -962
- package/lib/Files.js +0 -11
- package/lib/Logger.js +0 -24
- package/lib/index.js +0 -5
- package/lib/isomorphic/File.node.js +0 -19
- package/lib/models/AccountLineItem.js +3 -21
- package/lib/models/Action.js +3 -21
- package/lib/models/ActionNotificationExport.js +9 -61
- package/lib/models/ActionNotificationExportResult.js +6 -40
- package/lib/models/ActionWebhookFailure.js +5 -39
- package/lib/models/ApiKey.js +29 -128
- package/lib/models/App.js +6 -34
- package/lib/models/As2IncomingMessage.js +6 -36
- package/lib/models/As2OutgoingMessage.js +6 -36
- package/lib/models/As2Partner.js +16 -112
- package/lib/models/As2Station.js +16 -108
- package/lib/models/Auto.js +3 -21
- package/lib/models/Automation.js +16 -146
- package/lib/models/AutomationRun.js +9 -54
- package/lib/models/BandwidthSnapshot.js +6 -34
- package/lib/models/Behavior.js +22 -151
- package/lib/models/Bundle.js +18 -158
- package/lib/models/BundleDownload.js +6 -38
- package/lib/models/BundleRecipient.js +9 -62
- package/lib/models/BundleRegistration.js +6 -38
- package/lib/models/Clickwrap.js +16 -106
- package/lib/models/DnsRecord.js +6 -34
- package/lib/models/Errors.js +3 -21
- package/lib/models/ExternalEvent.js +12 -62
- package/lib/models/File.js +21 -271
- package/lib/models/FileAction.js +3 -21
- package/lib/models/FileComment.js +13 -94
- package/lib/models/FileCommentReaction.js +8 -55
- package/lib/models/FileMigration.js +6 -37
- package/lib/models/FileUploadPart.js +3 -21
- package/lib/models/Folder.js +9 -63
- package/lib/models/FormField.js +3 -21
- package/lib/models/FormFieldSet.js +16 -98
- package/lib/models/Group.js +16 -104
- package/lib/models/GroupUser.js +13 -108
- package/lib/models/History.js +18 -132
- package/lib/models/HistoryExport.js +9 -87
- package/lib/models/HistoryExportResult.js +6 -40
- package/lib/models/Image.js +3 -21
- package/lib/models/InboxRecipient.js +9 -62
- package/lib/models/InboxRegistration.js +6 -36
- package/lib/models/InboxUpload.js +6 -38
- package/lib/models/Invoice.js +9 -48
- package/lib/models/InvoiceLineItem.js +3 -21
- package/lib/models/IpAddress.js +9 -45
- package/lib/models/Lock.js +11 -82
- package/lib/models/Message.js +16 -124
- package/lib/models/MessageComment.js +16 -104
- package/lib/models/MessageCommentReaction.js +14 -82
- package/lib/models/MessageReaction.js +14 -82
- package/lib/models/Notification.js +16 -120
- package/lib/models/Payment.js +9 -48
- package/lib/models/PaymentLineItem.js +3 -21
- package/lib/models/Permission.js +11 -72
- package/lib/models/Preview.js +3 -21
- package/lib/models/Priority.js +6 -42
- package/lib/models/Project.js +16 -96
- package/lib/models/PublicIpAddress.js +3 -21
- package/lib/models/PublicKey.js +16 -104
- package/lib/models/RemoteBandwidthSnapshot.js +6 -34
- package/lib/models/RemoteServer.js +16 -270
- package/lib/models/Request.js +14 -89
- package/lib/models/Session.js +8 -41
- package/lib/models/SettingsChange.js +6 -34
- package/lib/models/SftpHostKey.js +16 -94
- package/lib/models/Site.js +93 -218
- package/lib/models/SsoStrategy.js +11 -64
- package/lib/models/Status.js +3 -21
- package/lib/models/Style.js +10 -73
- package/lib/models/UsageDailySnapshot.js +6 -34
- package/lib/models/UsageSnapshot.js +6 -34
- package/lib/models/User.js +22 -238
- package/lib/models/UserCipherUse.js +6 -36
- package/lib/models/UserRequest.js +14 -82
- package/lib/models/WebhookTest.js +6 -43
- package/lib/utils.js +0 -16
- package/package.json +1 -1
- package/src/models/ApiKey.js +7 -0
- package/src/models/Site.js +16 -0
package/lib/models/History.js
CHANGED
@@ -1,46 +1,27 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
6
|
-
|
7
5
|
exports.__esModule = true;
|
8
6
|
exports.default = void 0;
|
9
|
-
|
10
7
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
11
|
-
|
12
8
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
13
|
-
|
14
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
15
|
-
|
16
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
17
|
-
|
18
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
19
|
-
|
20
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
21
|
-
|
22
13
|
var _Api = _interopRequireDefault(require("../Api"));
|
23
|
-
|
24
14
|
var errors = _interopRequireWildcard(require("../Errors"));
|
25
|
-
|
26
15
|
var _Logger = _interopRequireDefault(require("../Logger"));
|
27
|
-
|
28
16
|
var _utils = require("../utils");
|
29
|
-
|
30
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
31
|
-
|
32
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
33
|
-
|
34
19
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
35
|
-
|
36
20
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
37
|
-
|
38
21
|
/**
|
39
22
|
* Class History
|
40
|
-
*/
|
41
|
-
var History = /*#__PURE__*/(0, _createClass2.default)(function History() {
|
23
|
+
*/var History = /*#__PURE__*/(0, _createClass2.default)(function History() {
|
42
24
|
var _this = this;
|
43
|
-
|
44
25
|
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
45
26
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
46
27
|
(0, _classCallCheck2.default)(this, History);
|
@@ -90,9 +71,8 @@ var History = /*#__PURE__*/(0, _createClass2.default)(function History() {
|
|
90
71
|
});
|
91
72
|
Object.entries(attributes).forEach(function (_ref) {
|
92
73
|
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
93
|
-
|
94
|
-
|
95
|
-
|
74
|
+
key = _ref2[0],
|
75
|
+
value = _ref2[1];
|
96
76
|
var normalizedKey = key.replace('?', '');
|
97
77
|
_this.attributes[normalizedKey] = value;
|
98
78
|
Object.defineProperty(_this, normalizedKey, {
|
@@ -105,93 +85,72 @@ var History = /*#__PURE__*/(0, _createClass2.default)(function History() {
|
|
105
85
|
(0, _defineProperty2.default)(History, "listForFile", /*#__PURE__*/function () {
|
106
86
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(path) {
|
107
87
|
var _response$data;
|
108
|
-
|
109
88
|
var params,
|
110
|
-
|
111
|
-
|
112
|
-
|
89
|
+
options,
|
90
|
+
response,
|
91
|
+
_args = arguments;
|
113
92
|
return _regenerator.default.wrap(function _callee$(_context) {
|
114
93
|
while (1) {
|
115
94
|
switch (_context.prev = _context.next) {
|
116
95
|
case 0:
|
117
96
|
params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
118
97
|
options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {};
|
119
|
-
|
120
98
|
if ((0, _utils.isObject)(params)) {
|
121
99
|
_context.next = 4;
|
122
100
|
break;
|
123
101
|
}
|
124
|
-
|
125
102
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
126
|
-
|
127
103
|
case 4:
|
128
104
|
params['path'] = path;
|
129
|
-
|
130
105
|
if (params['path']) {
|
131
106
|
_context.next = 7;
|
132
107
|
break;
|
133
108
|
}
|
134
|
-
|
135
109
|
throw new errors.MissingParameterError('Parameter missing: path');
|
136
|
-
|
137
110
|
case 7:
|
138
111
|
if (!(params['start_at'] && !(0, _utils.isString)(params['start_at']))) {
|
139
112
|
_context.next = 9;
|
140
113
|
break;
|
141
114
|
}
|
142
|
-
|
143
115
|
throw new errors.InvalidParameterError("Bad parameter: start_at must be of type String, received ".concat((0, _utils.getType)(params['start_at'])));
|
144
|
-
|
145
116
|
case 9:
|
146
117
|
if (!(params['end_at'] && !(0, _utils.isString)(params['end_at']))) {
|
147
118
|
_context.next = 11;
|
148
119
|
break;
|
149
120
|
}
|
150
|
-
|
151
121
|
throw new errors.InvalidParameterError("Bad parameter: end_at must be of type String, received ".concat((0, _utils.getType)(params['end_at'])));
|
152
|
-
|
153
122
|
case 11:
|
154
123
|
if (!(params['display'] && !(0, _utils.isString)(params['display']))) {
|
155
124
|
_context.next = 13;
|
156
125
|
break;
|
157
126
|
}
|
158
|
-
|
159
127
|
throw new errors.InvalidParameterError("Bad parameter: display must be of type String, received ".concat((0, _utils.getType)(params['display'])));
|
160
|
-
|
161
128
|
case 13:
|
162
129
|
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
163
130
|
_context.next = 15;
|
164
131
|
break;
|
165
132
|
}
|
166
|
-
|
167
133
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
168
|
-
|
169
134
|
case 15:
|
170
135
|
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
171
136
|
_context.next = 17;
|
172
137
|
break;
|
173
138
|
}
|
174
|
-
|
175
139
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
176
|
-
|
177
140
|
case 17:
|
178
141
|
if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
|
179
142
|
_context.next = 19;
|
180
143
|
break;
|
181
144
|
}
|
182
|
-
|
183
145
|
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
|
184
|
-
|
185
146
|
case 19:
|
186
147
|
_context.next = 21;
|
187
148
|
return _Api.default.sendRequest("/history/files/".concat(encodeURIComponent(params['path'])), 'GET', params, options);
|
188
|
-
|
189
149
|
case 21:
|
190
150
|
response = _context.sent;
|
191
151
|
return _context.abrupt("return", (response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
192
152
|
return new Action(obj, options);
|
193
153
|
})) || []);
|
194
|
-
|
195
154
|
case 23:
|
196
155
|
case "end":
|
197
156
|
return _context.stop();
|
@@ -199,7 +158,6 @@ var History = /*#__PURE__*/(0, _createClass2.default)(function History() {
|
|
199
158
|
}
|
200
159
|
}, _callee);
|
201
160
|
}));
|
202
|
-
|
203
161
|
return function (_x) {
|
204
162
|
return _ref3.apply(this, arguments);
|
205
163
|
};
|
@@ -207,93 +165,72 @@ var History = /*#__PURE__*/(0, _createClass2.default)(function History() {
|
|
207
165
|
(0, _defineProperty2.default)(History, "listForFolder", /*#__PURE__*/function () {
|
208
166
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(path) {
|
209
167
|
var _response$data2;
|
210
|
-
|
211
168
|
var params,
|
212
|
-
|
213
|
-
|
214
|
-
|
169
|
+
options,
|
170
|
+
response,
|
171
|
+
_args2 = arguments;
|
215
172
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
216
173
|
while (1) {
|
217
174
|
switch (_context2.prev = _context2.next) {
|
218
175
|
case 0:
|
219
176
|
params = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
|
220
177
|
options = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {};
|
221
|
-
|
222
178
|
if ((0, _utils.isObject)(params)) {
|
223
179
|
_context2.next = 4;
|
224
180
|
break;
|
225
181
|
}
|
226
|
-
|
227
182
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
228
|
-
|
229
183
|
case 4:
|
230
184
|
params['path'] = path;
|
231
|
-
|
232
185
|
if (params['path']) {
|
233
186
|
_context2.next = 7;
|
234
187
|
break;
|
235
188
|
}
|
236
|
-
|
237
189
|
throw new errors.MissingParameterError('Parameter missing: path');
|
238
|
-
|
239
190
|
case 7:
|
240
191
|
if (!(params['start_at'] && !(0, _utils.isString)(params['start_at']))) {
|
241
192
|
_context2.next = 9;
|
242
193
|
break;
|
243
194
|
}
|
244
|
-
|
245
195
|
throw new errors.InvalidParameterError("Bad parameter: start_at must be of type String, received ".concat((0, _utils.getType)(params['start_at'])));
|
246
|
-
|
247
196
|
case 9:
|
248
197
|
if (!(params['end_at'] && !(0, _utils.isString)(params['end_at']))) {
|
249
198
|
_context2.next = 11;
|
250
199
|
break;
|
251
200
|
}
|
252
|
-
|
253
201
|
throw new errors.InvalidParameterError("Bad parameter: end_at must be of type String, received ".concat((0, _utils.getType)(params['end_at'])));
|
254
|
-
|
255
202
|
case 11:
|
256
203
|
if (!(params['display'] && !(0, _utils.isString)(params['display']))) {
|
257
204
|
_context2.next = 13;
|
258
205
|
break;
|
259
206
|
}
|
260
|
-
|
261
207
|
throw new errors.InvalidParameterError("Bad parameter: display must be of type String, received ".concat((0, _utils.getType)(params['display'])));
|
262
|
-
|
263
208
|
case 13:
|
264
209
|
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
265
210
|
_context2.next = 15;
|
266
211
|
break;
|
267
212
|
}
|
268
|
-
|
269
213
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
270
|
-
|
271
214
|
case 15:
|
272
215
|
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
273
216
|
_context2.next = 17;
|
274
217
|
break;
|
275
218
|
}
|
276
|
-
|
277
219
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
278
|
-
|
279
220
|
case 17:
|
280
221
|
if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
|
281
222
|
_context2.next = 19;
|
282
223
|
break;
|
283
224
|
}
|
284
|
-
|
285
225
|
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
|
286
|
-
|
287
226
|
case 19:
|
288
227
|
_context2.next = 21;
|
289
228
|
return _Api.default.sendRequest("/history/folders/".concat(encodeURIComponent(params['path'])), 'GET', params, options);
|
290
|
-
|
291
229
|
case 21:
|
292
230
|
response = _context2.sent;
|
293
231
|
return _context2.abrupt("return", (response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.map(function (obj) {
|
294
232
|
return new Action(obj, options);
|
295
233
|
})) || []);
|
296
|
-
|
297
234
|
case 23:
|
298
235
|
case "end":
|
299
236
|
return _context2.stop();
|
@@ -301,7 +238,6 @@ var History = /*#__PURE__*/(0, _createClass2.default)(function History() {
|
|
301
238
|
}
|
302
239
|
}, _callee2);
|
303
240
|
}));
|
304
|
-
|
305
241
|
return function (_x2) {
|
306
242
|
return _ref4.apply(this, arguments);
|
307
243
|
};
|
@@ -309,93 +245,72 @@ var History = /*#__PURE__*/(0, _createClass2.default)(function History() {
|
|
309
245
|
(0, _defineProperty2.default)(History, "listForUser", /*#__PURE__*/function () {
|
310
246
|
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(user_id) {
|
311
247
|
var _response$data3;
|
312
|
-
|
313
248
|
var params,
|
314
|
-
|
315
|
-
|
316
|
-
|
249
|
+
options,
|
250
|
+
response,
|
251
|
+
_args3 = arguments;
|
317
252
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
318
253
|
while (1) {
|
319
254
|
switch (_context3.prev = _context3.next) {
|
320
255
|
case 0:
|
321
256
|
params = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
|
322
257
|
options = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : {};
|
323
|
-
|
324
258
|
if ((0, _utils.isObject)(params)) {
|
325
259
|
_context3.next = 4;
|
326
260
|
break;
|
327
261
|
}
|
328
|
-
|
329
262
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
330
|
-
|
331
263
|
case 4:
|
332
264
|
params['user_id'] = user_id;
|
333
|
-
|
334
265
|
if (params['user_id']) {
|
335
266
|
_context3.next = 7;
|
336
267
|
break;
|
337
268
|
}
|
338
|
-
|
339
269
|
throw new errors.MissingParameterError('Parameter missing: user_id');
|
340
|
-
|
341
270
|
case 7:
|
342
271
|
if (!(params['start_at'] && !(0, _utils.isString)(params['start_at']))) {
|
343
272
|
_context3.next = 9;
|
344
273
|
break;
|
345
274
|
}
|
346
|
-
|
347
275
|
throw new errors.InvalidParameterError("Bad parameter: start_at must be of type String, received ".concat((0, _utils.getType)(params['start_at'])));
|
348
|
-
|
349
276
|
case 9:
|
350
277
|
if (!(params['end_at'] && !(0, _utils.isString)(params['end_at']))) {
|
351
278
|
_context3.next = 11;
|
352
279
|
break;
|
353
280
|
}
|
354
|
-
|
355
281
|
throw new errors.InvalidParameterError("Bad parameter: end_at must be of type String, received ".concat((0, _utils.getType)(params['end_at'])));
|
356
|
-
|
357
282
|
case 11:
|
358
283
|
if (!(params['display'] && !(0, _utils.isString)(params['display']))) {
|
359
284
|
_context3.next = 13;
|
360
285
|
break;
|
361
286
|
}
|
362
|
-
|
363
287
|
throw new errors.InvalidParameterError("Bad parameter: display must be of type String, received ".concat((0, _utils.getType)(params['display'])));
|
364
|
-
|
365
288
|
case 13:
|
366
289
|
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
367
290
|
_context3.next = 15;
|
368
291
|
break;
|
369
292
|
}
|
370
|
-
|
371
293
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
372
|
-
|
373
294
|
case 15:
|
374
295
|
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
375
296
|
_context3.next = 17;
|
376
297
|
break;
|
377
298
|
}
|
378
|
-
|
379
299
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
380
|
-
|
381
300
|
case 17:
|
382
301
|
if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
|
383
302
|
_context3.next = 19;
|
384
303
|
break;
|
385
304
|
}
|
386
|
-
|
387
305
|
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
|
388
|
-
|
389
306
|
case 19:
|
390
307
|
_context3.next = 21;
|
391
308
|
return _Api.default.sendRequest("/history/users/".concat(encodeURIComponent(params['user_id'])), 'GET', params, options);
|
392
|
-
|
393
309
|
case 21:
|
394
310
|
response = _context3.sent;
|
395
311
|
return _context3.abrupt("return", (response === null || response === void 0 ? void 0 : (_response$data3 = response.data) === null || _response$data3 === void 0 ? void 0 : _response$data3.map(function (obj) {
|
396
312
|
return new Action(obj, options);
|
397
313
|
})) || []);
|
398
|
-
|
399
314
|
case 23:
|
400
315
|
case "end":
|
401
316
|
return _context3.stop();
|
@@ -403,74 +318,59 @@ var History = /*#__PURE__*/(0, _createClass2.default)(function History() {
|
|
403
318
|
}
|
404
319
|
}, _callee3);
|
405
320
|
}));
|
406
|
-
|
407
321
|
return function (_x3) {
|
408
322
|
return _ref5.apply(this, arguments);
|
409
323
|
};
|
410
324
|
}());
|
411
325
|
(0, _defineProperty2.default)(History, "listLogins", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
412
326
|
var _response$data4;
|
413
|
-
|
414
327
|
var params,
|
415
|
-
|
416
|
-
|
417
|
-
|
328
|
+
options,
|
329
|
+
response,
|
330
|
+
_args4 = arguments;
|
418
331
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
419
332
|
while (1) {
|
420
333
|
switch (_context4.prev = _context4.next) {
|
421
334
|
case 0:
|
422
335
|
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
423
336
|
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
424
|
-
|
425
337
|
if (!(params['start_at'] && !(0, _utils.isString)(params['start_at']))) {
|
426
338
|
_context4.next = 4;
|
427
339
|
break;
|
428
340
|
}
|
429
|
-
|
430
341
|
throw new errors.InvalidParameterError("Bad parameter: start_at must be of type String, received ".concat((0, _utils.getType)(params['start_at'])));
|
431
|
-
|
432
342
|
case 4:
|
433
343
|
if (!(params['end_at'] && !(0, _utils.isString)(params['end_at']))) {
|
434
344
|
_context4.next = 6;
|
435
345
|
break;
|
436
346
|
}
|
437
|
-
|
438
347
|
throw new errors.InvalidParameterError("Bad parameter: end_at must be of type String, received ".concat((0, _utils.getType)(params['end_at'])));
|
439
|
-
|
440
348
|
case 6:
|
441
349
|
if (!(params['display'] && !(0, _utils.isString)(params['display']))) {
|
442
350
|
_context4.next = 8;
|
443
351
|
break;
|
444
352
|
}
|
445
|
-
|
446
353
|
throw new errors.InvalidParameterError("Bad parameter: display must be of type String, received ".concat((0, _utils.getType)(params['display'])));
|
447
|
-
|
448
354
|
case 8:
|
449
355
|
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
450
356
|
_context4.next = 10;
|
451
357
|
break;
|
452
358
|
}
|
453
|
-
|
454
359
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
455
|
-
|
456
360
|
case 10:
|
457
361
|
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
458
362
|
_context4.next = 12;
|
459
363
|
break;
|
460
364
|
}
|
461
|
-
|
462
365
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
463
|
-
|
464
366
|
case 12:
|
465
367
|
_context4.next = 14;
|
466
368
|
return _Api.default.sendRequest("/history/login", 'GET', params, options);
|
467
|
-
|
468
369
|
case 14:
|
469
370
|
response = _context4.sent;
|
470
371
|
return _context4.abrupt("return", (response === null || response === void 0 ? void 0 : (_response$data4 = response.data) === null || _response$data4 === void 0 ? void 0 : _response$data4.map(function (obj) {
|
471
372
|
return new Action(obj, options);
|
472
373
|
})) || []);
|
473
|
-
|
474
374
|
case 16:
|
475
375
|
case "end":
|
476
376
|
return _context4.stop();
|
@@ -480,67 +380,53 @@ var History = /*#__PURE__*/(0, _createClass2.default)(function History() {
|
|
480
380
|
})));
|
481
381
|
(0, _defineProperty2.default)(History, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
482
382
|
var _response$data5;
|
483
|
-
|
484
383
|
var params,
|
485
|
-
|
486
|
-
|
487
|
-
|
384
|
+
options,
|
385
|
+
response,
|
386
|
+
_args5 = arguments;
|
488
387
|
return _regenerator.default.wrap(function _callee5$(_context5) {
|
489
388
|
while (1) {
|
490
389
|
switch (_context5.prev = _context5.next) {
|
491
390
|
case 0:
|
492
391
|
params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
493
392
|
options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
494
|
-
|
495
393
|
if (!(params['start_at'] && !(0, _utils.isString)(params['start_at']))) {
|
496
394
|
_context5.next = 4;
|
497
395
|
break;
|
498
396
|
}
|
499
|
-
|
500
397
|
throw new errors.InvalidParameterError("Bad parameter: start_at must be of type String, received ".concat((0, _utils.getType)(params['start_at'])));
|
501
|
-
|
502
398
|
case 4:
|
503
399
|
if (!(params['end_at'] && !(0, _utils.isString)(params['end_at']))) {
|
504
400
|
_context5.next = 6;
|
505
401
|
break;
|
506
402
|
}
|
507
|
-
|
508
403
|
throw new errors.InvalidParameterError("Bad parameter: end_at must be of type String, received ".concat((0, _utils.getType)(params['end_at'])));
|
509
|
-
|
510
404
|
case 6:
|
511
405
|
if (!(params['display'] && !(0, _utils.isString)(params['display']))) {
|
512
406
|
_context5.next = 8;
|
513
407
|
break;
|
514
408
|
}
|
515
|
-
|
516
409
|
throw new errors.InvalidParameterError("Bad parameter: display must be of type String, received ".concat((0, _utils.getType)(params['display'])));
|
517
|
-
|
518
410
|
case 8:
|
519
411
|
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
520
412
|
_context5.next = 10;
|
521
413
|
break;
|
522
414
|
}
|
523
|
-
|
524
415
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
525
|
-
|
526
416
|
case 10:
|
527
417
|
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
528
418
|
_context5.next = 12;
|
529
419
|
break;
|
530
420
|
}
|
531
|
-
|
532
421
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
533
|
-
|
534
422
|
case 12:
|
535
423
|
_context5.next = 14;
|
536
424
|
return _Api.default.sendRequest("/history", 'GET', params, options);
|
537
|
-
|
538
425
|
case 14:
|
539
426
|
response = _context5.sent;
|
540
427
|
return _context5.abrupt("return", (response === null || response === void 0 ? void 0 : (_response$data5 = response.data) === null || _response$data5 === void 0 ? void 0 : _response$data5.map(function (obj) {
|
541
428
|
return new Action(obj, options);
|
542
429
|
})) || []);
|
543
|
-
|
544
430
|
case 16:
|
545
431
|
case "end":
|
546
432
|
return _context5.stop();
|