files.com 1.0.189 → 1.0.192
Sign up to get free protection for your applications and to get access to all the features.
- package/_VERSION +1 -1
- package/docs/Errors.md +186 -0
- package/docs/models/AccountLineItem.md +53 -0
- package/docs/models/Action.md +37 -0
- package/docs/models/ActionNotificationExport.md +82 -0
- package/docs/models/ActionNotificationExportResult.md +49 -0
- package/docs/models/ActionWebhookFailure.md +16 -0
- package/docs/models/ApiKey.md +183 -0
- package/docs/models/App.md +66 -0
- package/docs/models/As2IncomingMessage.md +104 -0
- package/docs/models/As2OutgoingMessage.md +96 -0
- package/docs/models/As2Partner.md +141 -0
- package/docs/models/As2Station.md +142 -0
- package/docs/models/Auto.md +11 -0
- package/docs/models/Automation.md +257 -0
- package/docs/models/AutomationRun.md +61 -0
- package/docs/models/BandwidthSnapshot.md +50 -0
- package/docs/models/Behavior.md +195 -0
- package/docs/models/Bundle.md +330 -0
- package/docs/models/BundleDownload.md +44 -0
- package/docs/models/BundleRecipient.md +76 -0
- package/docs/models/BundleRegistration.md +53 -0
- package/docs/models/Clickwrap.md +120 -0
- package/docs/models/DnsRecord.md +33 -0
- package/docs/models/Errors.md +17 -0
- package/docs/models/ExternalEvent.md +84 -0
- package/docs/models/File.md +339 -0
- package/docs/models/FileAction.md +13 -0
- package/docs/models/FileComment.md +98 -0
- package/docs/models/FileCommentReaction.md +50 -0
- package/docs/models/FileMigration.md +40 -0
- package/docs/models/FileUploadPart.md +39 -0
- package/docs/models/Folder.md +90 -0
- package/docs/models/FormField.md +29 -0
- package/docs/models/FormFieldSet.md +170 -0
- package/docs/models/Group.md +140 -0
- package/docs/models/GroupUser.md +116 -0
- package/docs/models/History.md +151 -0
- package/docs/models/HistoryExport.md +130 -0
- package/docs/models/HistoryExportResult.md +75 -0
- package/docs/models/Image.md +13 -0
- package/docs/models/InboxRecipient.md +76 -0
- package/docs/models/InboxRegistration.md +47 -0
- package/docs/models/InboxUpload.md +42 -0
- package/docs/models/Invoice.md +82 -0
- package/docs/models/InvoiceLineItem.md +27 -0
- package/docs/models/IpAddress.md +51 -0
- package/docs/models/Lock.md +92 -0
- package/docs/models/Message.md +134 -0
- package/docs/models/MessageComment.md +114 -0
- package/docs/models/MessageCommentReaction.md +79 -0
- package/docs/models/MessageReaction.md +79 -0
- package/docs/models/Notification.md +241 -0
- package/docs/models/Payment.md +82 -0
- package/docs/models/PaymentLineItem.md +19 -0
- package/docs/models/Permission.md +94 -0
- package/docs/models/Preview.md +19 -0
- package/docs/models/Priority.md +30 -0
- package/docs/models/Project.md +98 -0
- package/docs/models/PublicIpAddress.md +17 -0
- package/docs/models/PublicKey.md +112 -0
- package/docs/models/RemoteBandwidthSnapshot.md +42 -0
- package/docs/models/RemoteServer.md +385 -0
- package/docs/models/Request.md +97 -0
- package/docs/models/Session.md +50 -0
- package/docs/models/SettingsChange.md +44 -0
- package/docs/models/Site.md +607 -0
- package/docs/models/SsoStrategy.md +139 -0
- package/docs/models/Status.md +30 -0
- package/docs/models/Style.md +76 -0
- package/docs/models/UsageDailySnapshot.md +56 -0
- package/docs/models/UsageSnapshot.md +63 -0
- package/docs/models/User.md +465 -0
- package/docs/models/UserCipherUse.md +39 -0
- package/docs/models/UserRequest.md +80 -0
- package/docs/models/WebhookTest.md +59 -0
- package/lib/Api.js +12 -11
- package/lib/Errors.js +3127 -0
- package/lib/models/AccountLineItem.js +8 -0
- package/lib/models/Action.js +8 -0
- package/lib/models/ActionNotificationExport.js +21 -13
- package/lib/models/ActionNotificationExportResult.js +13 -5
- package/lib/models/ActionWebhookFailure.js +12 -4
- package/lib/models/ApiKey.js +33 -25
- package/lib/models/App.js +10 -2
- package/lib/models/As2IncomingMessage.js +11 -3
- package/lib/models/As2OutgoingMessage.js +11 -3
- package/lib/models/As2Partner.js +34 -26
- package/lib/models/As2Station.js +32 -24
- package/lib/models/Auto.js +8 -0
- package/lib/models/Automation.js +51 -43
- package/lib/models/AutomationRun.js +16 -8
- package/lib/models/BandwidthSnapshot.js +10 -2
- package/lib/models/Behavior.js +46 -38
- package/lib/models/Bundle.js +51 -43
- package/lib/models/BundleDownload.js +12 -4
- package/lib/models/BundleRecipient.js +22 -14
- package/lib/models/BundleRegistration.js +12 -4
- package/lib/models/Clickwrap.js +31 -23
- package/lib/models/DnsRecord.js +10 -2
- package/lib/models/Errors.js +8 -0
- package/lib/models/ExternalEvent.js +18 -10
- package/lib/models/File.js +68 -60
- package/lib/models/FileAction.js +8 -0
- package/lib/models/FileComment.js +27 -19
- package/lib/models/FileCommentReaction.js +18 -10
- package/lib/models/FileMigration.js +11 -3
- package/lib/models/FileUploadPart.js +8 -0
- package/lib/models/Folder.js +19 -11
- package/lib/models/FormField.js +8 -0
- package/lib/models/FormFieldSet.js +27 -19
- package/lib/models/Group.js +30 -22
- package/lib/models/GroupUser.js +32 -24
- package/lib/models/History.js +42 -34
- package/lib/models/HistoryExport.js +34 -26
- package/lib/models/HistoryExportResult.js +13 -5
- package/lib/models/Image.js +8 -0
- package/lib/models/InboxRecipient.js +22 -14
- package/lib/models/InboxRegistration.js +11 -3
- package/lib/models/InboxUpload.js +12 -4
- package/lib/models/Invoice.js +13 -5
- package/lib/models/InvoiceLineItem.js +8 -0
- package/lib/models/IpAddress.js +12 -4
- package/lib/models/Lock.js +24 -16
- package/lib/models/Message.js +37 -29
- package/lib/models/MessageComment.js +29 -21
- package/lib/models/MessageCommentReaction.js +24 -16
- package/lib/models/MessageReaction.js +24 -16
- package/lib/models/Notification.js +38 -30
- package/lib/models/Payment.js +13 -5
- package/lib/models/PaymentLineItem.js +8 -0
- package/lib/models/Permission.js +23 -15
- package/lib/models/Preview.js +8 -0
- package/lib/models/Priority.js +13 -5
- package/lib/models/Project.js +25 -17
- package/lib/models/PublicIpAddress.js +8 -0
- package/lib/models/PublicKey.js +29 -21
- package/lib/models/RemoteBandwidthSnapshot.js +10 -2
- package/lib/models/RemoteServer.js +226 -196
- package/lib/models/Request.js +27 -19
- package/lib/models/Session.js +13 -5
- package/lib/models/SettingsChange.js +10 -2
- package/lib/models/Site.js +65 -57
- package/lib/models/SsoStrategy.js +17 -9
- package/lib/models/Status.js +8 -0
- package/lib/models/Style.js +20 -12
- package/lib/models/UsageDailySnapshot.js +10 -2
- package/lib/models/UsageSnapshot.js +10 -2
- package/lib/models/User.js +85 -77
- package/lib/models/UserCipherUse.js +11 -3
- package/lib/models/UserRequest.js +24 -16
- package/lib/models/WebhookTest.js +16 -8
- package/package.json +1 -1
- package/src/Api.js +4 -8
- package/src/Errors.js +223 -0
- package/src/models/AccountLineItem.js +1 -0
- package/src/models/Action.js +1 -0
- package/src/models/ActionNotificationExport.js +14 -13
- package/src/models/ActionNotificationExportResult.js +6 -5
- package/src/models/ActionWebhookFailure.js +5 -4
- package/src/models/ApiKey.js +26 -25
- package/src/models/App.js +3 -2
- package/src/models/As2IncomingMessage.js +4 -3
- package/src/models/As2OutgoingMessage.js +4 -3
- package/src/models/As2Partner.js +27 -26
- package/src/models/As2Station.js +25 -24
- package/src/models/Auto.js +1 -0
- package/src/models/Automation.js +51 -50
- package/src/models/AutomationRun.js +9 -8
- package/src/models/BandwidthSnapshot.js +3 -2
- package/src/models/Behavior.js +39 -38
- package/src/models/Bundle.js +44 -43
- package/src/models/BundleDownload.js +5 -4
- package/src/models/BundleRecipient.js +15 -14
- package/src/models/BundleRegistration.js +5 -4
- package/src/models/Clickwrap.js +24 -23
- package/src/models/DnsRecord.js +3 -2
- package/src/models/Errors.js +1 -0
- package/src/models/ExternalEvent.js +11 -10
- package/src/models/File.js +61 -60
- package/src/models/FileAction.js +1 -0
- package/src/models/FileComment.js +20 -19
- package/src/models/FileCommentReaction.js +11 -10
- package/src/models/FileMigration.js +4 -3
- package/src/models/FileUploadPart.js +1 -0
- package/src/models/Folder.js +12 -11
- package/src/models/FormField.js +1 -0
- package/src/models/FormFieldSet.js +20 -19
- package/src/models/Group.js +23 -22
- package/src/models/GroupUser.js +25 -24
- package/src/models/History.js +35 -34
- package/src/models/HistoryExport.js +27 -26
- package/src/models/HistoryExportResult.js +6 -5
- package/src/models/Image.js +1 -0
- package/src/models/InboxRecipient.js +15 -14
- package/src/models/InboxRegistration.js +4 -3
- package/src/models/InboxUpload.js +5 -4
- package/src/models/Invoice.js +6 -5
- package/src/models/InvoiceLineItem.js +1 -0
- package/src/models/IpAddress.js +5 -4
- package/src/models/Lock.js +17 -16
- package/src/models/Message.js +30 -29
- package/src/models/MessageComment.js +22 -21
- package/src/models/MessageCommentReaction.js +17 -16
- package/src/models/MessageReaction.js +17 -16
- package/src/models/Notification.js +31 -30
- package/src/models/Payment.js +6 -5
- package/src/models/PaymentLineItem.js +1 -0
- package/src/models/Permission.js +16 -15
- package/src/models/Preview.js +1 -0
- package/src/models/Priority.js +6 -5
- package/src/models/Project.js +18 -17
- package/src/models/PublicIpAddress.js +1 -0
- package/src/models/PublicKey.js +22 -21
- package/src/models/RemoteBandwidthSnapshot.js +3 -2
- package/src/models/RemoteServer.js +120 -103
- package/src/models/Request.js +20 -19
- package/src/models/Session.js +6 -5
- package/src/models/SettingsChange.js +3 -2
- package/src/models/Site.js +58 -57
- package/src/models/SsoStrategy.js +10 -9
- package/src/models/Status.js +1 -0
- package/src/models/Style.js +13 -12
- package/src/models/UsageDailySnapshot.js +3 -2
- package/src/models/UsageSnapshot.js +3 -2
- package/src/models/User.js +78 -77
- package/src/models/UserCipherUse.js +4 -3
- package/src/models/UserRequest.js +17 -16
- package/src/models/WebhookTest.js +9 -8
- package/test/src/index.js +46 -0
package/src/models/Bundle.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import Api from '../Api'
|
2
|
+
import * as errors from '../Errors'
|
2
3
|
import Logger from '../Logger'
|
3
4
|
import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
|
4
5
|
|
@@ -230,32 +231,32 @@ class Bundle {
|
|
230
231
|
// recipients - array(object) - A list of recipients to share this bundle with. Required unless `to` is used.
|
231
232
|
share = async (params = {}) => {
|
232
233
|
if (!this.attributes.id) {
|
233
|
-
throw new
|
234
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
234
235
|
}
|
235
236
|
|
236
237
|
if (!isObject(params)) {
|
237
|
-
throw new
|
238
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
238
239
|
}
|
239
240
|
|
240
241
|
params.id = this.attributes.id
|
241
242
|
if (params['id'] && !isInt(params['id'])) {
|
242
|
-
throw new
|
243
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
243
244
|
}
|
244
245
|
if (params['to'] && !isArray(params['to'])) {
|
245
|
-
throw new
|
246
|
+
throw new errors.InvalidParameterError(`Bad parameter: to must be of type Array, received ${getType(to)}`)
|
246
247
|
}
|
247
248
|
if (params['note'] && !isString(params['note'])) {
|
248
|
-
throw new
|
249
|
+
throw new errors.InvalidParameterError(`Bad parameter: note must be of type String, received ${getType(note)}`)
|
249
250
|
}
|
250
251
|
if (params['recipients'] && !isArray(params['recipients'])) {
|
251
|
-
throw new
|
252
|
+
throw new errors.InvalidParameterError(`Bad parameter: recipients must be of type Array, received ${getType(recipients)}`)
|
252
253
|
}
|
253
254
|
|
254
255
|
if (!params['id']) {
|
255
256
|
if (this.attributes.id) {
|
256
257
|
params['id'] = this.id
|
257
258
|
} else {
|
258
|
-
throw new
|
259
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
259
260
|
}
|
260
261
|
}
|
261
262
|
|
@@ -285,53 +286,53 @@ class Bundle {
|
|
285
286
|
// watermark_attachment_file - file - Preview watermark image applied to all bundle items.
|
286
287
|
update = async (params = {}) => {
|
287
288
|
if (!this.attributes.id) {
|
288
|
-
throw new
|
289
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
289
290
|
}
|
290
291
|
|
291
292
|
if (!isObject(params)) {
|
292
|
-
throw new
|
293
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
293
294
|
}
|
294
295
|
|
295
296
|
params.id = this.attributes.id
|
296
297
|
if (params['id'] && !isInt(params['id'])) {
|
297
|
-
throw new
|
298
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
298
299
|
}
|
299
300
|
if (params['paths'] && !isArray(params['paths'])) {
|
300
|
-
throw new
|
301
|
+
throw new errors.InvalidParameterError(`Bad parameter: paths must be of type Array, received ${getType(paths)}`)
|
301
302
|
}
|
302
303
|
if (params['password'] && !isString(params['password'])) {
|
303
|
-
throw new
|
304
|
+
throw new errors.InvalidParameterError(`Bad parameter: password must be of type String, received ${getType(password)}`)
|
304
305
|
}
|
305
306
|
if (params['form_field_set_id'] && !isInt(params['form_field_set_id'])) {
|
306
|
-
throw new
|
307
|
+
throw new errors.InvalidParameterError(`Bad parameter: form_field_set_id must be of type Int, received ${getType(form_field_set_id)}`)
|
307
308
|
}
|
308
309
|
if (params['clickwrap_id'] && !isInt(params['clickwrap_id'])) {
|
309
|
-
throw new
|
310
|
+
throw new errors.InvalidParameterError(`Bad parameter: clickwrap_id must be of type Int, received ${getType(clickwrap_id)}`)
|
310
311
|
}
|
311
312
|
if (params['code'] && !isString(params['code'])) {
|
312
|
-
throw new
|
313
|
+
throw new errors.InvalidParameterError(`Bad parameter: code must be of type String, received ${getType(code)}`)
|
313
314
|
}
|
314
315
|
if (params['description'] && !isString(params['description'])) {
|
315
|
-
throw new
|
316
|
+
throw new errors.InvalidParameterError(`Bad parameter: description must be of type String, received ${getType(description)}`)
|
316
317
|
}
|
317
318
|
if (params['expires_at'] && !isString(params['expires_at'])) {
|
318
|
-
throw new
|
319
|
+
throw new errors.InvalidParameterError(`Bad parameter: expires_at must be of type String, received ${getType(expires_at)}`)
|
319
320
|
}
|
320
321
|
if (params['inbox_id'] && !isInt(params['inbox_id'])) {
|
321
|
-
throw new
|
322
|
+
throw new errors.InvalidParameterError(`Bad parameter: inbox_id must be of type Int, received ${getType(inbox_id)}`)
|
322
323
|
}
|
323
324
|
if (params['max_uses'] && !isInt(params['max_uses'])) {
|
324
|
-
throw new
|
325
|
+
throw new errors.InvalidParameterError(`Bad parameter: max_uses must be of type Int, received ${getType(max_uses)}`)
|
325
326
|
}
|
326
327
|
if (params['note'] && !isString(params['note'])) {
|
327
|
-
throw new
|
328
|
+
throw new errors.InvalidParameterError(`Bad parameter: note must be of type String, received ${getType(note)}`)
|
328
329
|
}
|
329
330
|
|
330
331
|
if (!params['id']) {
|
331
332
|
if (this.attributes.id) {
|
332
333
|
params['id'] = this.id
|
333
334
|
} else {
|
334
|
-
throw new
|
335
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
335
336
|
}
|
336
337
|
}
|
337
338
|
|
@@ -342,23 +343,23 @@ class Bundle {
|
|
342
343
|
|
343
344
|
delete = async (params = {}) => {
|
344
345
|
if (!this.attributes.id) {
|
345
|
-
throw new
|
346
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
346
347
|
}
|
347
348
|
|
348
349
|
if (!isObject(params)) {
|
349
|
-
throw new
|
350
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
350
351
|
}
|
351
352
|
|
352
353
|
params.id = this.attributes.id
|
353
354
|
if (params['id'] && !isInt(params['id'])) {
|
354
|
-
throw new
|
355
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
355
356
|
}
|
356
357
|
|
357
358
|
if (!params['id']) {
|
358
359
|
if (this.attributes.id) {
|
359
360
|
params['id'] = this.id
|
360
361
|
} else {
|
361
|
-
throw new
|
362
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
362
363
|
}
|
363
364
|
}
|
364
365
|
|
@@ -393,15 +394,15 @@ class Bundle {
|
|
393
394
|
// filter_lteq - object - If set, return records where the specified field is less than or equal to the supplied value. Valid fields are `created_at`.
|
394
395
|
static list = async (params = {}, options = {}) => {
|
395
396
|
if (params['user_id'] && !isInt(params['user_id'])) {
|
396
|
-
throw new
|
397
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
397
398
|
}
|
398
399
|
|
399
400
|
if (params['cursor'] && !isString(params['cursor'])) {
|
400
|
-
throw new
|
401
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
401
402
|
}
|
402
403
|
|
403
404
|
if (params['per_page'] && !isInt(params['per_page'])) {
|
404
|
-
throw new
|
405
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
405
406
|
}
|
406
407
|
|
407
408
|
const response = await Api.sendRequest(`/bundles`, 'GET', params, options)
|
@@ -416,17 +417,17 @@ class Bundle {
|
|
416
417
|
// id (required) - int64 - Bundle ID.
|
417
418
|
static find = async (id, params = {}, options = {}) => {
|
418
419
|
if (!isObject(params)) {
|
419
|
-
throw new
|
420
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
420
421
|
}
|
421
422
|
|
422
423
|
params['id'] = id
|
423
424
|
|
424
425
|
if (!params['id']) {
|
425
|
-
throw new
|
426
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
426
427
|
}
|
427
428
|
|
428
429
|
if (params['id'] && !isInt(params['id'])) {
|
429
|
-
throw new
|
430
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
430
431
|
}
|
431
432
|
|
432
433
|
const response = await Api.sendRequest(`/bundles/${params['id']}`, 'GET', params, options)
|
@@ -458,51 +459,51 @@ class Bundle {
|
|
458
459
|
// watermark_attachment_file - file - Preview watermark image applied to all bundle items.
|
459
460
|
static create = async (params = {}, options = {}) => {
|
460
461
|
if (!params['paths']) {
|
461
|
-
throw new
|
462
|
+
throw new errors.MissingParameterError('Parameter missing: paths')
|
462
463
|
}
|
463
464
|
|
464
465
|
if (params['user_id'] && !isInt(params['user_id'])) {
|
465
|
-
throw new
|
466
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
466
467
|
}
|
467
468
|
|
468
469
|
if (params['paths'] && !isArray(params['paths'])) {
|
469
|
-
throw new
|
470
|
+
throw new errors.InvalidParameterError(`Bad parameter: paths must be of type Array, received ${getType(paths)}`)
|
470
471
|
}
|
471
472
|
|
472
473
|
if (params['password'] && !isString(params['password'])) {
|
473
|
-
throw new
|
474
|
+
throw new errors.InvalidParameterError(`Bad parameter: password must be of type String, received ${getType(password)}`)
|
474
475
|
}
|
475
476
|
|
476
477
|
if (params['form_field_set_id'] && !isInt(params['form_field_set_id'])) {
|
477
|
-
throw new
|
478
|
+
throw new errors.InvalidParameterError(`Bad parameter: form_field_set_id must be of type Int, received ${getType(form_field_set_id)}`)
|
478
479
|
}
|
479
480
|
|
480
481
|
if (params['expires_at'] && !isString(params['expires_at'])) {
|
481
|
-
throw new
|
482
|
+
throw new errors.InvalidParameterError(`Bad parameter: expires_at must be of type String, received ${getType(expires_at)}`)
|
482
483
|
}
|
483
484
|
|
484
485
|
if (params['max_uses'] && !isInt(params['max_uses'])) {
|
485
|
-
throw new
|
486
|
+
throw new errors.InvalidParameterError(`Bad parameter: max_uses must be of type Int, received ${getType(max_uses)}`)
|
486
487
|
}
|
487
488
|
|
488
489
|
if (params['description'] && !isString(params['description'])) {
|
489
|
-
throw new
|
490
|
+
throw new errors.InvalidParameterError(`Bad parameter: description must be of type String, received ${getType(description)}`)
|
490
491
|
}
|
491
492
|
|
492
493
|
if (params['note'] && !isString(params['note'])) {
|
493
|
-
throw new
|
494
|
+
throw new errors.InvalidParameterError(`Bad parameter: note must be of type String, received ${getType(note)}`)
|
494
495
|
}
|
495
496
|
|
496
497
|
if (params['code'] && !isString(params['code'])) {
|
497
|
-
throw new
|
498
|
+
throw new errors.InvalidParameterError(`Bad parameter: code must be of type String, received ${getType(code)}`)
|
498
499
|
}
|
499
500
|
|
500
501
|
if (params['clickwrap_id'] && !isInt(params['clickwrap_id'])) {
|
501
|
-
throw new
|
502
|
+
throw new errors.InvalidParameterError(`Bad parameter: clickwrap_id must be of type Int, received ${getType(clickwrap_id)}`)
|
502
503
|
}
|
503
504
|
|
504
505
|
if (params['inbox_id'] && !isInt(params['inbox_id'])) {
|
505
|
-
throw new
|
506
|
+
throw new errors.InvalidParameterError(`Bad parameter: inbox_id must be of type Int, received ${getType(inbox_id)}`)
|
506
507
|
}
|
507
508
|
|
508
509
|
const response = await Api.sendRequest(`/bundles`, 'POST', params, options)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import Api from '../Api'
|
2
|
+
import * as errors from '../Errors'
|
2
3
|
import Logger from '../Logger'
|
3
4
|
import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
|
4
5
|
|
@@ -49,19 +50,19 @@ class BundleDownload {
|
|
49
50
|
// bundle_registration_id - int64 - BundleRegistration ID
|
50
51
|
static list = async (params = {}, options = {}) => {
|
51
52
|
if (params['cursor'] && !isString(params['cursor'])) {
|
52
|
-
throw new
|
53
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
53
54
|
}
|
54
55
|
|
55
56
|
if (params['per_page'] && !isInt(params['per_page'])) {
|
56
|
-
throw new
|
57
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
57
58
|
}
|
58
59
|
|
59
60
|
if (params['bundle_id'] && !isInt(params['bundle_id'])) {
|
60
|
-
throw new
|
61
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_id must be of type Int, received ${getType(bundle_id)}`)
|
61
62
|
}
|
62
63
|
|
63
64
|
if (params['bundle_registration_id'] && !isInt(params['bundle_registration_id'])) {
|
64
|
-
throw new
|
65
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_registration_id must be of type Int, received ${getType(bundle_registration_id)}`)
|
65
66
|
}
|
66
67
|
|
67
68
|
const response = await Api.sendRequest(`/bundle_downloads`, 'GET', params, options)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import Api from '../Api'
|
2
|
+
import * as errors from '../Errors'
|
2
3
|
import Logger from '../Logger'
|
3
4
|
import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
|
4
5
|
|
@@ -81,7 +82,7 @@ class BundleRecipient {
|
|
81
82
|
|
82
83
|
save = () => {
|
83
84
|
if (this.attributes['id']) {
|
84
|
-
throw new
|
85
|
+
throw new errors.NotImplementedError('The BundleRecipient object doesn\'t support updates.')
|
85
86
|
} else {
|
86
87
|
const newObject = BundleRecipient.create(this.attributes, this.options)
|
87
88
|
this.attributes = { ...newObject.attributes }
|
@@ -103,23 +104,23 @@ class BundleRecipient {
|
|
103
104
|
// bundle_id (required) - int64 - List recipients for the bundle with this ID.
|
104
105
|
static list = async (params = {}, options = {}) => {
|
105
106
|
if (!params['bundle_id']) {
|
106
|
-
throw new
|
107
|
+
throw new errors.MissingParameterError('Parameter missing: bundle_id')
|
107
108
|
}
|
108
109
|
|
109
110
|
if (params['user_id'] && !isInt(params['user_id'])) {
|
110
|
-
throw new
|
111
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
111
112
|
}
|
112
113
|
|
113
114
|
if (params['cursor'] && !isString(params['cursor'])) {
|
114
|
-
throw new
|
115
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
115
116
|
}
|
116
117
|
|
117
118
|
if (params['per_page'] && !isInt(params['per_page'])) {
|
118
|
-
throw new
|
119
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
119
120
|
}
|
120
121
|
|
121
122
|
if (params['bundle_id'] && !isInt(params['bundle_id'])) {
|
122
|
-
throw new
|
123
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_id must be of type Int, received ${getType(bundle_id)}`)
|
123
124
|
}
|
124
125
|
|
125
126
|
const response = await Api.sendRequest(`/bundle_recipients`, 'GET', params, options)
|
@@ -140,35 +141,35 @@ class BundleRecipient {
|
|
140
141
|
// share_after_create - boolean - Set to true to share the link with the recipient upon creation.
|
141
142
|
static create = async (params = {}, options = {}) => {
|
142
143
|
if (!params['bundle_id']) {
|
143
|
-
throw new
|
144
|
+
throw new errors.MissingParameterError('Parameter missing: bundle_id')
|
144
145
|
}
|
145
146
|
|
146
147
|
if (!params['recipient']) {
|
147
|
-
throw new
|
148
|
+
throw new errors.MissingParameterError('Parameter missing: recipient')
|
148
149
|
}
|
149
150
|
|
150
151
|
if (params['user_id'] && !isInt(params['user_id'])) {
|
151
|
-
throw new
|
152
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
152
153
|
}
|
153
154
|
|
154
155
|
if (params['bundle_id'] && !isInt(params['bundle_id'])) {
|
155
|
-
throw new
|
156
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_id must be of type Int, received ${getType(bundle_id)}`)
|
156
157
|
}
|
157
158
|
|
158
159
|
if (params['recipient'] && !isString(params['recipient'])) {
|
159
|
-
throw new
|
160
|
+
throw new errors.InvalidParameterError(`Bad parameter: recipient must be of type String, received ${getType(recipient)}`)
|
160
161
|
}
|
161
162
|
|
162
163
|
if (params['name'] && !isString(params['name'])) {
|
163
|
-
throw new
|
164
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(name)}`)
|
164
165
|
}
|
165
166
|
|
166
167
|
if (params['company'] && !isString(params['company'])) {
|
167
|
-
throw new
|
168
|
+
throw new errors.InvalidParameterError(`Bad parameter: company must be of type String, received ${getType(company)}`)
|
168
169
|
}
|
169
170
|
|
170
171
|
if (params['note'] && !isString(params['note'])) {
|
171
|
-
throw new
|
172
|
+
throw new errors.InvalidParameterError(`Bad parameter: note must be of type String, received ${getType(note)}`)
|
172
173
|
}
|
173
174
|
|
174
175
|
const response = await Api.sendRequest(`/bundle_recipients`, 'POST', params, options)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import Api from '../Api'
|
2
|
+
import * as errors from '../Errors'
|
2
3
|
import Logger from '../Logger'
|
3
4
|
import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
|
4
5
|
|
@@ -66,19 +67,19 @@ class BundleRegistration {
|
|
66
67
|
// bundle_id - int64 - ID of the associated Bundle
|
67
68
|
static list = async (params = {}, options = {}) => {
|
68
69
|
if (params['user_id'] && !isInt(params['user_id'])) {
|
69
|
-
throw new
|
70
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
70
71
|
}
|
71
72
|
|
72
73
|
if (params['cursor'] && !isString(params['cursor'])) {
|
73
|
-
throw new
|
74
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
74
75
|
}
|
75
76
|
|
76
77
|
if (params['per_page'] && !isInt(params['per_page'])) {
|
77
|
-
throw new
|
78
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
78
79
|
}
|
79
80
|
|
80
81
|
if (params['bundle_id'] && !isInt(params['bundle_id'])) {
|
81
|
-
throw new
|
82
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_id must be of type Int, received ${getType(bundle_id)}`)
|
82
83
|
}
|
83
84
|
|
84
85
|
const response = await Api.sendRequest(`/bundle_registrations`, 'GET', params, options)
|
package/src/models/Clickwrap.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import Api from '../Api'
|
2
|
+
import * as errors from '../Errors'
|
2
3
|
import Logger from '../Logger'
|
3
4
|
import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
|
4
5
|
|
@@ -73,38 +74,38 @@ class Clickwrap {
|
|
73
74
|
// use_with_users - string - Use this Clickwrap for User Registrations? Note: This only applies to User Registrations where the User is invited to your Files.com site using an E-Mail invitation process where they then set their own password.
|
74
75
|
update = async (params = {}) => {
|
75
76
|
if (!this.attributes.id) {
|
76
|
-
throw new
|
77
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
77
78
|
}
|
78
79
|
|
79
80
|
if (!isObject(params)) {
|
80
|
-
throw new
|
81
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
81
82
|
}
|
82
83
|
|
83
84
|
params.id = this.attributes.id
|
84
85
|
if (params['id'] && !isInt(params['id'])) {
|
85
|
-
throw new
|
86
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
86
87
|
}
|
87
88
|
if (params['name'] && !isString(params['name'])) {
|
88
|
-
throw new
|
89
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(name)}`)
|
89
90
|
}
|
90
91
|
if (params['body'] && !isString(params['body'])) {
|
91
|
-
throw new
|
92
|
+
throw new errors.InvalidParameterError(`Bad parameter: body must be of type String, received ${getType(body)}`)
|
92
93
|
}
|
93
94
|
if (params['use_with_bundles'] && !isString(params['use_with_bundles'])) {
|
94
|
-
throw new
|
95
|
+
throw new errors.InvalidParameterError(`Bad parameter: use_with_bundles must be of type String, received ${getType(use_with_bundles)}`)
|
95
96
|
}
|
96
97
|
if (params['use_with_inboxes'] && !isString(params['use_with_inboxes'])) {
|
97
|
-
throw new
|
98
|
+
throw new errors.InvalidParameterError(`Bad parameter: use_with_inboxes must be of type String, received ${getType(use_with_inboxes)}`)
|
98
99
|
}
|
99
100
|
if (params['use_with_users'] && !isString(params['use_with_users'])) {
|
100
|
-
throw new
|
101
|
+
throw new errors.InvalidParameterError(`Bad parameter: use_with_users must be of type String, received ${getType(use_with_users)}`)
|
101
102
|
}
|
102
103
|
|
103
104
|
if (!params['id']) {
|
104
105
|
if (this.attributes.id) {
|
105
106
|
params['id'] = this.id
|
106
107
|
} else {
|
107
|
-
throw new
|
108
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
108
109
|
}
|
109
110
|
}
|
110
111
|
|
@@ -115,23 +116,23 @@ class Clickwrap {
|
|
115
116
|
|
116
117
|
delete = async (params = {}) => {
|
117
118
|
if (!this.attributes.id) {
|
118
|
-
throw new
|
119
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
119
120
|
}
|
120
121
|
|
121
122
|
if (!isObject(params)) {
|
122
|
-
throw new
|
123
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
123
124
|
}
|
124
125
|
|
125
126
|
params.id = this.attributes.id
|
126
127
|
if (params['id'] && !isInt(params['id'])) {
|
127
|
-
throw new
|
128
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
128
129
|
}
|
129
130
|
|
130
131
|
if (!params['id']) {
|
131
132
|
if (this.attributes.id) {
|
132
133
|
params['id'] = this.id
|
133
134
|
} else {
|
134
|
-
throw new
|
135
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
135
136
|
}
|
136
137
|
}
|
137
138
|
|
@@ -158,11 +159,11 @@ class Clickwrap {
|
|
158
159
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
159
160
|
static list = async (params = {}, options = {}) => {
|
160
161
|
if (params['cursor'] && !isString(params['cursor'])) {
|
161
|
-
throw new
|
162
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
162
163
|
}
|
163
164
|
|
164
165
|
if (params['per_page'] && !isInt(params['per_page'])) {
|
165
|
-
throw new
|
166
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
166
167
|
}
|
167
168
|
|
168
169
|
const response = await Api.sendRequest(`/clickwraps`, 'GET', params, options)
|
@@ -177,17 +178,17 @@ class Clickwrap {
|
|
177
178
|
// id (required) - int64 - Clickwrap ID.
|
178
179
|
static find = async (id, params = {}, options = {}) => {
|
179
180
|
if (!isObject(params)) {
|
180
|
-
throw new
|
181
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
181
182
|
}
|
182
183
|
|
183
184
|
params['id'] = id
|
184
185
|
|
185
186
|
if (!params['id']) {
|
186
|
-
throw new
|
187
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
187
188
|
}
|
188
189
|
|
189
190
|
if (params['id'] && !isInt(params['id'])) {
|
190
|
-
throw new
|
191
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
191
192
|
}
|
192
193
|
|
193
194
|
const response = await Api.sendRequest(`/clickwraps/${params['id']}`, 'GET', params, options)
|
@@ -206,23 +207,23 @@ class Clickwrap {
|
|
206
207
|
// use_with_users - string - Use this Clickwrap for User Registrations? Note: This only applies to User Registrations where the User is invited to your Files.com site using an E-Mail invitation process where they then set their own password.
|
207
208
|
static create = async (params = {}, options = {}) => {
|
208
209
|
if (params['name'] && !isString(params['name'])) {
|
209
|
-
throw new
|
210
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(name)}`)
|
210
211
|
}
|
211
212
|
|
212
213
|
if (params['body'] && !isString(params['body'])) {
|
213
|
-
throw new
|
214
|
+
throw new errors.InvalidParameterError(`Bad parameter: body must be of type String, received ${getType(body)}`)
|
214
215
|
}
|
215
216
|
|
216
217
|
if (params['use_with_bundles'] && !isString(params['use_with_bundles'])) {
|
217
|
-
throw new
|
218
|
+
throw new errors.InvalidParameterError(`Bad parameter: use_with_bundles must be of type String, received ${getType(use_with_bundles)}`)
|
218
219
|
}
|
219
220
|
|
220
221
|
if (params['use_with_inboxes'] && !isString(params['use_with_inboxes'])) {
|
221
|
-
throw new
|
222
|
+
throw new errors.InvalidParameterError(`Bad parameter: use_with_inboxes must be of type String, received ${getType(use_with_inboxes)}`)
|
222
223
|
}
|
223
224
|
|
224
225
|
if (params['use_with_users'] && !isString(params['use_with_users'])) {
|
225
|
-
throw new
|
226
|
+
throw new errors.InvalidParameterError(`Bad parameter: use_with_users must be of type String, received ${getType(use_with_users)}`)
|
226
227
|
}
|
227
228
|
|
228
229
|
const response = await Api.sendRequest(`/clickwraps`, 'POST', params, options)
|
package/src/models/DnsRecord.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import Api from '../Api'
|
2
|
+
import * as errors from '../Errors'
|
2
3
|
import Logger from '../Logger'
|
3
4
|
import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
|
4
5
|
|
@@ -40,11 +41,11 @@ class DnsRecord {
|
|
40
41
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
41
42
|
static list = async (params = {}, options = {}) => {
|
42
43
|
if (params['cursor'] && !isString(params['cursor'])) {
|
43
|
-
throw new
|
44
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
44
45
|
}
|
45
46
|
|
46
47
|
if (params['per_page'] && !isInt(params['per_page'])) {
|
47
|
-
throw new
|
48
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
48
49
|
}
|
49
50
|
|
50
51
|
const response = await Api.sendRequest(`/dns_records`, 'GET', params, options)
|
package/src/models/Errors.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import Api from '../Api'
|
2
|
+
import * as errors from '../Errors'
|
2
3
|
import Logger from '../Logger'
|
3
4
|
import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
|
4
5
|
|
@@ -98,7 +99,7 @@ class ExternalEvent {
|
|
98
99
|
|
99
100
|
save = () => {
|
100
101
|
if (this.attributes['id']) {
|
101
|
-
throw new
|
102
|
+
throw new errors.NotImplementedError('The ExternalEvent object doesn\'t support updates.')
|
102
103
|
} else {
|
103
104
|
const newObject = ExternalEvent.create(this.attributes, this.options)
|
104
105
|
this.attributes = { ...newObject.attributes }
|
@@ -118,11 +119,11 @@ class ExternalEvent {
|
|
118
119
|
// filter_lteq - object - If set, return records where the specified field is less than or equal to the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type`, `status` or `folder_behavior_id`. Valid field combinations are `[ event_type, status, created_at ]`, `[ event_type, created_at ]` or `[ status, created_at ]`.
|
119
120
|
static list = async (params = {}, options = {}) => {
|
120
121
|
if (params['cursor'] && !isString(params['cursor'])) {
|
121
|
-
throw new
|
122
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
122
123
|
}
|
123
124
|
|
124
125
|
if (params['per_page'] && !isInt(params['per_page'])) {
|
125
|
-
throw new
|
126
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
126
127
|
}
|
127
128
|
|
128
129
|
const response = await Api.sendRequest(`/external_events`, 'GET', params, options)
|
@@ -137,17 +138,17 @@ class ExternalEvent {
|
|
137
138
|
// id (required) - int64 - External Event ID.
|
138
139
|
static find = async (id, params = {}, options = {}) => {
|
139
140
|
if (!isObject(params)) {
|
140
|
-
throw new
|
141
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
141
142
|
}
|
142
143
|
|
143
144
|
params['id'] = id
|
144
145
|
|
145
146
|
if (!params['id']) {
|
146
|
-
throw new
|
147
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
147
148
|
}
|
148
149
|
|
149
150
|
if (params['id'] && !isInt(params['id'])) {
|
150
|
-
throw new
|
151
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
151
152
|
}
|
152
153
|
|
153
154
|
const response = await Api.sendRequest(`/external_events/${params['id']}`, 'GET', params, options)
|
@@ -163,19 +164,19 @@ class ExternalEvent {
|
|
163
164
|
// body (required) - string - Event body
|
164
165
|
static create = async (params = {}, options = {}) => {
|
165
166
|
if (!params['status']) {
|
166
|
-
throw new
|
167
|
+
throw new errors.MissingParameterError('Parameter missing: status')
|
167
168
|
}
|
168
169
|
|
169
170
|
if (!params['body']) {
|
170
|
-
throw new
|
171
|
+
throw new errors.MissingParameterError('Parameter missing: body')
|
171
172
|
}
|
172
173
|
|
173
174
|
if (params['status'] && !isString(params['status'])) {
|
174
|
-
throw new
|
175
|
+
throw new errors.InvalidParameterError(`Bad parameter: status must be of type String, received ${getType(status)}`)
|
175
176
|
}
|
176
177
|
|
177
178
|
if (params['body'] && !isString(params['body'])) {
|
178
|
-
throw new
|
179
|
+
throw new errors.InvalidParameterError(`Bad parameter: body must be of type String, received ${getType(body)}`)
|
179
180
|
}
|
180
181
|
|
181
182
|
const response = await Api.sendRequest(`/external_events`, 'POST', params, options)
|