files.com 1.0.421 → 1.0.422
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.js +179 -0
- package/_VERSION +1 -1
- package/lib/Api.js +14 -13
- package/lib/Errors.js +4 -2
- package/lib/Files.js +6 -6
- package/lib/Logger.js +20 -12
- package/lib/models/AccountLineItem.js +2 -2
- package/lib/models/Action.js +2 -2
- package/lib/models/ActionNotificationExport.js +2 -1
- package/lib/models/ActionNotificationExportResult.js +2 -1
- package/lib/models/ActionWebhookFailure.js +3 -3
- package/lib/models/ApiKey.js +8 -7
- package/lib/models/App.js +2 -1
- package/lib/models/As2IncomingMessage.js +2 -1
- package/lib/models/As2OutgoingMessage.js +2 -1
- package/lib/models/As2Partner.js +8 -7
- package/lib/models/As2Station.js +8 -7
- package/lib/models/Auto.js +2 -2
- package/lib/models/Automation.js +21 -20
- package/lib/models/AutomationRun.js +2 -1
- package/lib/models/BandwidthSnapshot.js +2 -1
- package/lib/models/Behavior.js +9 -8
- package/lib/models/Bundle.js +21 -20
- package/lib/models/BundleDownload.js +2 -1
- package/lib/models/BundleNotification.js +4 -3
- package/lib/models/BundleRecipient.js +2 -1
- package/lib/models/BundleRegistration.js +2 -1
- package/lib/models/Clickwrap.js +9 -8
- package/lib/models/DnsRecord.js +2 -1
- package/lib/models/EmailIncomingMessage.js +2 -1
- package/lib/models/Errors.js +2 -2
- package/lib/models/ExternalEvent.js +2 -1
- package/lib/models/File.js +51 -42
- package/lib/models/FileAction.js +2 -2
- package/lib/models/FileComment.js +5 -4
- package/lib/models/FileCommentReaction.js +3 -2
- package/lib/models/FileMigration.js +2 -1
- package/lib/models/FileUploadPart.js +2 -2
- package/lib/models/Folder.js +10 -7
- package/lib/models/FormField.js +2 -2
- package/lib/models/FormFieldSet.js +6 -5
- package/lib/models/GpgKey.js +8 -7
- package/lib/models/Group.js +8 -7
- package/lib/models/GroupUser.js +8 -7
- package/lib/models/History.js +19 -8
- package/lib/models/HistoryExport.js +2 -1
- package/lib/models/HistoryExportResult.js +2 -1
- package/lib/models/Image.js +2 -2
- package/lib/models/InboxRecipient.js +2 -1
- package/lib/models/InboxRegistration.js +2 -1
- package/lib/models/InboxUpload.js +2 -1
- package/lib/models/Invoice.js +8 -3
- package/lib/models/InvoiceLineItem.js +2 -2
- package/lib/models/IpAddress.js +8 -3
- package/lib/models/Lock.js +4 -3
- package/lib/models/Message.js +7 -6
- package/lib/models/MessageComment.js +5 -4
- package/lib/models/MessageCommentReaction.js +3 -2
- package/lib/models/MessageReaction.js +3 -2
- package/lib/models/Notification.js +9 -8
- package/lib/models/Payment.js +8 -3
- package/lib/models/PaymentLineItem.js +2 -2
- package/lib/models/Permission.js +3 -2
- package/lib/models/Preview.js +2 -2
- package/lib/models/Priority.js +2 -1
- package/lib/models/Project.js +5 -4
- package/lib/models/PublicIpAddress.js +2 -2
- package/lib/models/PublicKey.js +5 -4
- package/lib/models/RemoteBandwidthSnapshot.js +2 -1
- package/lib/models/RemoteServer.js +81 -76
- package/lib/models/RemoteServerConfigurationFile.js +2 -2
- package/lib/models/Request.js +3 -2
- package/lib/models/Session.js +2 -1
- package/lib/models/SettingsChange.js +2 -1
- package/lib/models/SftpHostKey.js +6 -5
- package/lib/models/ShareGroup.js +7 -6
- package/lib/models/ShareGroupMember.js +2 -2
- package/lib/models/Site.js +5 -2
- package/lib/models/Snapshot.js +7 -6
- package/lib/models/SsoStrategy.js +3 -2
- package/lib/models/Status.js +2 -2
- package/lib/models/Style.js +4 -3
- package/lib/models/UsageDailySnapshot.js +2 -1
- package/lib/models/UsageSnapshot.js +2 -1
- package/lib/models/User.js +33 -32
- package/lib/models/UserCipherUse.js +2 -1
- package/lib/models/UserRequest.js +3 -2
- package/lib/models/WebhookTest.js +2 -1
- package/lib/utils/pathNormalizer.js +2 -2
- package/lib/utils/pathNormalizer.test.js +1 -1
- package/lib/utils.js +2 -0
- package/package.json +7 -1
- package/src/Api.js +17 -13
- package/src/Errors.js +2 -1
- package/src/Files.js +16 -6
- package/src/Logger.js +16 -16
- package/src/isomorphic/File.node.js +7 -7
- package/src/models/AccountLineItem.js +3 -2
- package/src/models/Action.js +3 -2
- package/src/models/ActionNotificationExport.js +5 -2
- package/src/models/ActionNotificationExportResult.js +4 -2
- package/src/models/ActionWebhookFailure.js +4 -3
- package/src/models/ApiKey.js +15 -8
- package/src/models/App.js +4 -2
- package/src/models/As2IncomingMessage.js +4 -2
- package/src/models/As2OutgoingMessage.js +4 -2
- package/src/models/As2Partner.js +13 -8
- package/src/models/As2Station.js +13 -8
- package/src/models/Auto.js +3 -2
- package/src/models/Automation.js +26 -21
- package/src/models/AutomationRun.js +5 -2
- package/src/models/BandwidthSnapshot.js +4 -2
- package/src/models/Behavior.js +15 -9
- package/src/models/Bundle.js +26 -21
- package/src/models/BundleDownload.js +4 -2
- package/src/models/BundleNotification.js +9 -4
- package/src/models/BundleRecipient.js +5 -2
- package/src/models/BundleRegistration.js +4 -2
- package/src/models/Clickwrap.js +14 -9
- package/src/models/DnsRecord.js +4 -2
- package/src/models/EmailIncomingMessage.js +4 -2
- package/src/models/Errors.js +3 -2
- package/src/models/ExternalEvent.js +6 -2
- package/src/models/File.js +39 -28
- package/src/models/FileAction.js +3 -2
- package/src/models/FileComment.js +9 -5
- package/src/models/FileCommentReaction.js +5 -3
- package/src/models/FileMigration.js +4 -2
- package/src/models/FileUploadPart.js +3 -2
- package/src/models/Folder.js +5 -3
- package/src/models/FormField.js +3 -2
- package/src/models/FormFieldSet.js +11 -6
- package/src/models/GpgKey.js +13 -8
- package/src/models/Group.js +13 -8
- package/src/models/GroupUser.js +12 -8
- package/src/models/History.js +10 -4
- package/src/models/HistoryExport.js +5 -2
- package/src/models/HistoryExportResult.js +4 -2
- package/src/models/Image.js +3 -2
- package/src/models/InboxRecipient.js +5 -2
- package/src/models/InboxRegistration.js +4 -2
- package/src/models/InboxUpload.js +4 -2
- package/src/models/Invoice.js +5 -2
- package/src/models/InvoiceLineItem.js +3 -2
- package/src/models/IpAddress.js +6 -2
- package/src/models/Lock.js +7 -4
- package/src/models/Message.js +12 -7
- package/src/models/MessageComment.js +10 -5
- package/src/models/MessageCommentReaction.js +7 -3
- package/src/models/MessageReaction.js +7 -3
- package/src/models/Notification.js +14 -9
- package/src/models/Payment.js +5 -2
- package/src/models/PaymentLineItem.js +3 -2
- package/src/models/Permission.js +6 -3
- package/src/models/Preview.js +3 -2
- package/src/models/Priority.js +4 -2
- package/src/models/Project.js +10 -5
- package/src/models/PublicIpAddress.js +3 -2
- package/src/models/PublicKey.js +10 -5
- package/src/models/RemoteBandwidthSnapshot.js +4 -2
- package/src/models/RemoteServer.js +82 -75
- package/src/models/RemoteServerConfigurationFile.js +3 -2
- package/src/models/Request.js +7 -3
- package/src/models/Session.js +4 -2
- package/src/models/SettingsChange.js +4 -2
- package/src/models/SftpHostKey.js +11 -6
- package/src/models/ShareGroup.js +12 -7
- package/src/models/ShareGroupMember.js +3 -2
- package/src/models/Site.js +6 -2
- package/src/models/Snapshot.js +12 -7
- package/src/models/SsoStrategy.js +6 -3
- package/src/models/Status.js +3 -2
- package/src/models/Style.js +7 -4
- package/src/models/UsageDailySnapshot.js +4 -2
- package/src/models/UsageSnapshot.js +4 -2
- package/src/models/User.js +38 -33
- package/src/models/UserCipherUse.js +4 -2
- package/src/models/UserRequest.js +7 -3
- package/src/models/WebhookTest.js +4 -2
- package/src/utils/pathNormalizer.js +1 -1
- package/src/utils/pathNormalizer.test.js +2 -2
- package/src/utils.js +6 -5
- package/test.sh +10 -0
package/src/models/Behavior.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class Behavior
|
@@ -106,22 +107,22 @@ class Behavior {
|
|
106
107
|
|
107
108
|
params.id = this.attributes.id
|
108
109
|
if (params['id'] && !isInt(params['id'])) {
|
109
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
110
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
110
111
|
}
|
111
112
|
if (params['value'] && !isString(params['value'])) {
|
112
|
-
throw new errors.InvalidParameterError(`Bad parameter: value must be of type String, received ${getType(value)}`)
|
113
|
+
throw new errors.InvalidParameterError(`Bad parameter: value must be of type String, received ${getType(params['value'])}`)
|
113
114
|
}
|
114
115
|
if (params['name'] && !isString(params['name'])) {
|
115
|
-
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(name)}`)
|
116
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params['name'])}`)
|
116
117
|
}
|
117
118
|
if (params['description'] && !isString(params['description'])) {
|
118
|
-
throw new errors.InvalidParameterError(`Bad parameter: description must be of type String, received ${getType(description)}`)
|
119
|
+
throw new errors.InvalidParameterError(`Bad parameter: description must be of type String, received ${getType(params['description'])}`)
|
119
120
|
}
|
120
121
|
if (params['behavior'] && !isString(params['behavior'])) {
|
121
|
-
throw new errors.InvalidParameterError(`Bad parameter: behavior must be of type String, received ${getType(behavior)}`)
|
122
|
+
throw new errors.InvalidParameterError(`Bad parameter: behavior must be of type String, received ${getType(params['behavior'])}`)
|
122
123
|
}
|
123
124
|
if (params['path'] && !isString(params['path'])) {
|
124
|
-
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(path)}`)
|
125
|
+
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params['path'])}`)
|
125
126
|
}
|
126
127
|
|
127
128
|
if (!params['id']) {
|
@@ -134,6 +135,7 @@ class Behavior {
|
|
134
135
|
|
135
136
|
const response = await Api.sendRequest(`/behaviors/${encodeURIComponent(params['id'])}`, 'PATCH', params, this.options)
|
136
137
|
|
138
|
+
|
137
139
|
return new Behavior(response?.data, this.options)
|
138
140
|
}
|
139
141
|
|
@@ -148,7 +150,7 @@ class Behavior {
|
|
148
150
|
|
149
151
|
params.id = this.attributes.id
|
150
152
|
if (params['id'] && !isInt(params['id'])) {
|
151
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
153
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
152
154
|
}
|
153
155
|
|
154
156
|
if (!params['id']) {
|
@@ -194,6 +196,7 @@ class Behavior {
|
|
194
196
|
|
195
197
|
const response = await Api.sendRequest(`/behaviors`, 'GET', params, options)
|
196
198
|
|
199
|
+
|
197
200
|
return response?.data?.map(obj => new Behavior(obj, options)) || []
|
198
201
|
}
|
199
202
|
|
@@ -219,6 +222,7 @@ class Behavior {
|
|
219
222
|
|
220
223
|
const response = await Api.sendRequest(`/behaviors/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
221
224
|
|
225
|
+
|
222
226
|
return new Behavior(response?.data, options)
|
223
227
|
}
|
224
228
|
|
@@ -267,6 +271,7 @@ class Behavior {
|
|
267
271
|
|
268
272
|
const response = await Api.sendRequest(`/behaviors/folders/${encodeURIComponent(params['path'])}`, 'GET', params, options)
|
269
273
|
|
274
|
+
|
270
275
|
return response?.data?.map(obj => new Behavior(obj, options)) || []
|
271
276
|
}
|
272
277
|
|
@@ -308,6 +313,7 @@ class Behavior {
|
|
308
313
|
|
309
314
|
const response = await Api.sendRequest(`/behaviors`, 'POST', params, options)
|
310
315
|
|
316
|
+
|
311
317
|
return new Behavior(response?.data, options)
|
312
318
|
}
|
313
319
|
|
package/src/models/Bundle.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class Bundle
|
@@ -338,16 +339,16 @@ class Bundle {
|
|
338
339
|
|
339
340
|
params.id = this.attributes.id
|
340
341
|
if (params['id'] && !isInt(params['id'])) {
|
341
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
342
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
342
343
|
}
|
343
344
|
if (params['to'] && !isArray(params['to'])) {
|
344
|
-
throw new errors.InvalidParameterError(`Bad parameter: to must be of type Array, received ${getType(to)}`)
|
345
|
+
throw new errors.InvalidParameterError(`Bad parameter: to must be of type Array, received ${getType(params['to'])}`)
|
345
346
|
}
|
346
347
|
if (params['note'] && !isString(params['note'])) {
|
347
|
-
throw new errors.InvalidParameterError(`Bad parameter: note must be of type String, received ${getType(note)}`)
|
348
|
+
throw new errors.InvalidParameterError(`Bad parameter: note must be of type String, received ${getType(params['note'])}`)
|
348
349
|
}
|
349
350
|
if (params['recipients'] && !isArray(params['recipients'])) {
|
350
|
-
throw new errors.InvalidParameterError(`Bad parameter: recipients must be of type Array, received ${getType(recipients)}`)
|
351
|
+
throw new errors.InvalidParameterError(`Bad parameter: recipients must be of type Array, received ${getType(params['recipients'])}`)
|
351
352
|
}
|
352
353
|
|
353
354
|
if (!params['id']) {
|
@@ -400,46 +401,46 @@ class Bundle {
|
|
400
401
|
|
401
402
|
params.id = this.attributes.id
|
402
403
|
if (params['id'] && !isInt(params['id'])) {
|
403
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
404
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
404
405
|
}
|
405
406
|
if (params['paths'] && !isArray(params['paths'])) {
|
406
|
-
throw new errors.InvalidParameterError(`Bad parameter: paths must be of type Array, received ${getType(paths)}`)
|
407
|
+
throw new errors.InvalidParameterError(`Bad parameter: paths must be of type Array, received ${getType(params['paths'])}`)
|
407
408
|
}
|
408
409
|
if (params['password'] && !isString(params['password'])) {
|
409
|
-
throw new errors.InvalidParameterError(`Bad parameter: password must be of type String, received ${getType(password)}`)
|
410
|
+
throw new errors.InvalidParameterError(`Bad parameter: password must be of type String, received ${getType(params['password'])}`)
|
410
411
|
}
|
411
412
|
if (params['form_field_set_id'] && !isInt(params['form_field_set_id'])) {
|
412
|
-
throw new errors.InvalidParameterError(`Bad parameter: form_field_set_id must be of type Int, received ${getType(form_field_set_id)}`)
|
413
|
+
throw new errors.InvalidParameterError(`Bad parameter: form_field_set_id must be of type Int, received ${getType(params['form_field_set_id'])}`)
|
413
414
|
}
|
414
415
|
if (params['clickwrap_id'] && !isInt(params['clickwrap_id'])) {
|
415
|
-
throw new errors.InvalidParameterError(`Bad parameter: clickwrap_id must be of type Int, received ${getType(clickwrap_id)}`)
|
416
|
+
throw new errors.InvalidParameterError(`Bad parameter: clickwrap_id must be of type Int, received ${getType(params['clickwrap_id'])}`)
|
416
417
|
}
|
417
418
|
if (params['code'] && !isString(params['code'])) {
|
418
|
-
throw new errors.InvalidParameterError(`Bad parameter: code must be of type String, received ${getType(code)}`)
|
419
|
+
throw new errors.InvalidParameterError(`Bad parameter: code must be of type String, received ${getType(params['code'])}`)
|
419
420
|
}
|
420
421
|
if (params['description'] && !isString(params['description'])) {
|
421
|
-
throw new errors.InvalidParameterError(`Bad parameter: description must be of type String, received ${getType(description)}`)
|
422
|
+
throw new errors.InvalidParameterError(`Bad parameter: description must be of type String, received ${getType(params['description'])}`)
|
422
423
|
}
|
423
424
|
if (params['expires_at'] && !isString(params['expires_at'])) {
|
424
|
-
throw new errors.InvalidParameterError(`Bad parameter: expires_at must be of type String, received ${getType(expires_at)}`)
|
425
|
+
throw new errors.InvalidParameterError(`Bad parameter: expires_at must be of type String, received ${getType(params['expires_at'])}`)
|
425
426
|
}
|
426
427
|
if (params['inbox_id'] && !isInt(params['inbox_id'])) {
|
427
|
-
throw new errors.InvalidParameterError(`Bad parameter: inbox_id must be of type Int, received ${getType(inbox_id)}`)
|
428
|
+
throw new errors.InvalidParameterError(`Bad parameter: inbox_id must be of type Int, received ${getType(params['inbox_id'])}`)
|
428
429
|
}
|
429
430
|
if (params['max_uses'] && !isInt(params['max_uses'])) {
|
430
|
-
throw new errors.InvalidParameterError(`Bad parameter: max_uses must be of type Int, received ${getType(max_uses)}`)
|
431
|
+
throw new errors.InvalidParameterError(`Bad parameter: max_uses must be of type Int, received ${getType(params['max_uses'])}`)
|
431
432
|
}
|
432
433
|
if (params['note'] && !isString(params['note'])) {
|
433
|
-
throw new errors.InvalidParameterError(`Bad parameter: note must be of type String, received ${getType(note)}`)
|
434
|
+
throw new errors.InvalidParameterError(`Bad parameter: note must be of type String, received ${getType(params['note'])}`)
|
434
435
|
}
|
435
436
|
if (params['path_template'] && !isString(params['path_template'])) {
|
436
|
-
throw new errors.InvalidParameterError(`Bad parameter: path_template must be of type String, received ${getType(path_template)}`)
|
437
|
+
throw new errors.InvalidParameterError(`Bad parameter: path_template must be of type String, received ${getType(params['path_template'])}`)
|
437
438
|
}
|
438
439
|
if (params['permissions'] && !isString(params['permissions'])) {
|
439
|
-
throw new errors.InvalidParameterError(`Bad parameter: permissions must be of type String, received ${getType(permissions)}`)
|
440
|
+
throw new errors.InvalidParameterError(`Bad parameter: permissions must be of type String, received ${getType(params['permissions'])}`)
|
440
441
|
}
|
441
442
|
if (params['start_access_on_date'] && !isString(params['start_access_on_date'])) {
|
442
|
-
throw new errors.InvalidParameterError(`Bad parameter: start_access_on_date must be of type String, received ${getType(start_access_on_date)}`)
|
443
|
+
throw new errors.InvalidParameterError(`Bad parameter: start_access_on_date must be of type String, received ${getType(params['start_access_on_date'])}`)
|
443
444
|
}
|
444
445
|
|
445
446
|
if (!params['id']) {
|
@@ -452,6 +453,7 @@ class Bundle {
|
|
452
453
|
|
453
454
|
const response = await Api.sendRequest(`/bundles/${encodeURIComponent(params['id'])}`, 'PATCH', params, this.options)
|
454
455
|
|
456
|
+
|
455
457
|
return new Bundle(response?.data, this.options)
|
456
458
|
}
|
457
459
|
|
@@ -466,7 +468,7 @@ class Bundle {
|
|
466
468
|
|
467
469
|
params.id = this.attributes.id
|
468
470
|
if (params['id'] && !isInt(params['id'])) {
|
469
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
471
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
470
472
|
}
|
471
473
|
|
472
474
|
if (!params['id']) {
|
@@ -520,6 +522,7 @@ class Bundle {
|
|
520
522
|
|
521
523
|
const response = await Api.sendRequest(`/bundles`, 'GET', params, options)
|
522
524
|
|
525
|
+
|
523
526
|
return response?.data?.map(obj => new Bundle(obj, options)) || []
|
524
527
|
}
|
525
528
|
|
@@ -545,6 +548,7 @@ class Bundle {
|
|
545
548
|
|
546
549
|
const response = await Api.sendRequest(`/bundles/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
547
550
|
|
551
|
+
|
548
552
|
return new Bundle(response?.data, options)
|
549
553
|
}
|
550
554
|
|
@@ -645,6 +649,7 @@ class Bundle {
|
|
645
649
|
|
646
650
|
const response = await Api.sendRequest(`/bundles`, 'POST', params, options)
|
647
651
|
|
652
|
+
|
648
653
|
return new Bundle(response?.data, options)
|
649
654
|
}
|
650
655
|
}
|
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class BundleDownload
|
@@ -66,6 +67,7 @@ class BundleDownload {
|
|
66
67
|
|
67
68
|
const response = await Api.sendRequest(`/bundle_downloads`, 'GET', params, options)
|
68
69
|
|
70
|
+
|
69
71
|
return response?.data?.map(obj => new BundleDownload(obj, options)) || []
|
70
72
|
}
|
71
73
|
|
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class BundleNotification
|
@@ -73,7 +74,7 @@ class BundleNotification {
|
|
73
74
|
|
74
75
|
params.id = this.attributes.id
|
75
76
|
if (params['id'] && !isInt(params['id'])) {
|
76
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
77
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
77
78
|
}
|
78
79
|
|
79
80
|
if (!params['id']) {
|
@@ -86,6 +87,7 @@ class BundleNotification {
|
|
86
87
|
|
87
88
|
const response = await Api.sendRequest(`/bundle_notifications/${encodeURIComponent(params['id'])}`, 'PATCH', params, this.options)
|
88
89
|
|
90
|
+
|
89
91
|
return new BundleNotification(response?.data, this.options)
|
90
92
|
}
|
91
93
|
|
@@ -100,7 +102,7 @@ class BundleNotification {
|
|
100
102
|
|
101
103
|
params.id = this.attributes.id
|
102
104
|
if (params['id'] && !isInt(params['id'])) {
|
103
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
105
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
104
106
|
}
|
105
107
|
|
106
108
|
if (!params['id']) {
|
@@ -150,6 +152,7 @@ class BundleNotification {
|
|
150
152
|
|
151
153
|
const response = await Api.sendRequest(`/bundle_notifications`, 'GET', params, options)
|
152
154
|
|
155
|
+
|
153
156
|
return response?.data?.map(obj => new BundleNotification(obj, options)) || []
|
154
157
|
}
|
155
158
|
|
@@ -175,6 +178,7 @@ class BundleNotification {
|
|
175
178
|
|
176
179
|
const response = await Api.sendRequest(`/bundle_notifications/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
177
180
|
|
181
|
+
|
178
182
|
return new BundleNotification(response?.data, options)
|
179
183
|
}
|
180
184
|
|
@@ -201,6 +205,7 @@ class BundleNotification {
|
|
201
205
|
|
202
206
|
const response = await Api.sendRequest(`/bundle_notifications`, 'POST', params, options)
|
203
207
|
|
208
|
+
|
204
209
|
return new BundleNotification(response?.data, options)
|
205
210
|
}
|
206
211
|
}
|
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class BundleRecipient
|
@@ -120,6 +121,7 @@ class BundleRecipient {
|
|
120
121
|
|
121
122
|
const response = await Api.sendRequest(`/bundle_recipients`, 'GET', params, options)
|
122
123
|
|
124
|
+
|
123
125
|
return response?.data?.map(obj => new BundleRecipient(obj, options)) || []
|
124
126
|
}
|
125
127
|
|
@@ -169,6 +171,7 @@ class BundleRecipient {
|
|
169
171
|
|
170
172
|
const response = await Api.sendRequest(`/bundle_recipients`, 'POST', params, options)
|
171
173
|
|
174
|
+
|
172
175
|
return new BundleRecipient(response?.data, options)
|
173
176
|
}
|
174
177
|
}
|
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class BundleRegistration
|
@@ -87,6 +88,7 @@ class BundleRegistration {
|
|
87
88
|
|
88
89
|
const response = await Api.sendRequest(`/bundle_registrations`, 'GET', params, options)
|
89
90
|
|
91
|
+
|
90
92
|
return response?.data?.map(obj => new BundleRegistration(obj, options)) || []
|
91
93
|
}
|
92
94
|
|
package/src/models/Clickwrap.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class Clickwrap
|
@@ -83,22 +84,22 @@ class Clickwrap {
|
|
83
84
|
|
84
85
|
params.id = this.attributes.id
|
85
86
|
if (params['id'] && !isInt(params['id'])) {
|
86
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
87
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
87
88
|
}
|
88
89
|
if (params['name'] && !isString(params['name'])) {
|
89
|
-
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(name)}`)
|
90
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params['name'])}`)
|
90
91
|
}
|
91
92
|
if (params['body'] && !isString(params['body'])) {
|
92
|
-
throw new errors.InvalidParameterError(`Bad parameter: body must be of type String, received ${getType(body)}`)
|
93
|
+
throw new errors.InvalidParameterError(`Bad parameter: body must be of type String, received ${getType(params['body'])}`)
|
93
94
|
}
|
94
95
|
if (params['use_with_bundles'] && !isString(params['use_with_bundles'])) {
|
95
|
-
throw new errors.InvalidParameterError(`Bad parameter: use_with_bundles must be of type String, received ${getType(use_with_bundles)}`)
|
96
|
+
throw new errors.InvalidParameterError(`Bad parameter: use_with_bundles must be of type String, received ${getType(params['use_with_bundles'])}`)
|
96
97
|
}
|
97
98
|
if (params['use_with_inboxes'] && !isString(params['use_with_inboxes'])) {
|
98
|
-
throw new errors.InvalidParameterError(`Bad parameter: use_with_inboxes must be of type String, received ${getType(use_with_inboxes)}`)
|
99
|
+
throw new errors.InvalidParameterError(`Bad parameter: use_with_inboxes must be of type String, received ${getType(params['use_with_inboxes'])}`)
|
99
100
|
}
|
100
101
|
if (params['use_with_users'] && !isString(params['use_with_users'])) {
|
101
|
-
throw new errors.InvalidParameterError(`Bad parameter: use_with_users must be of type String, received ${getType(use_with_users)}`)
|
102
|
+
throw new errors.InvalidParameterError(`Bad parameter: use_with_users must be of type String, received ${getType(params['use_with_users'])}`)
|
102
103
|
}
|
103
104
|
|
104
105
|
if (!params['id']) {
|
@@ -111,6 +112,7 @@ class Clickwrap {
|
|
111
112
|
|
112
113
|
const response = await Api.sendRequest(`/clickwraps/${encodeURIComponent(params['id'])}`, 'PATCH', params, this.options)
|
113
114
|
|
115
|
+
|
114
116
|
return new Clickwrap(response?.data, this.options)
|
115
117
|
}
|
116
118
|
|
@@ -125,7 +127,7 @@ class Clickwrap {
|
|
125
127
|
|
126
128
|
params.id = this.attributes.id
|
127
129
|
if (params['id'] && !isInt(params['id'])) {
|
128
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
130
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
129
131
|
}
|
130
132
|
|
131
133
|
if (!params['id']) {
|
@@ -168,6 +170,7 @@ class Clickwrap {
|
|
168
170
|
|
169
171
|
const response = await Api.sendRequest(`/clickwraps`, 'GET', params, options)
|
170
172
|
|
173
|
+
|
171
174
|
return response?.data?.map(obj => new Clickwrap(obj, options)) || []
|
172
175
|
}
|
173
176
|
|
@@ -193,6 +196,7 @@ class Clickwrap {
|
|
193
196
|
|
194
197
|
const response = await Api.sendRequest(`/clickwraps/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
195
198
|
|
199
|
+
|
196
200
|
return new Clickwrap(response?.data, options)
|
197
201
|
}
|
198
202
|
|
@@ -228,6 +232,7 @@ class Clickwrap {
|
|
228
232
|
|
229
233
|
const response = await Api.sendRequest(`/clickwraps`, 'POST', params, options)
|
230
234
|
|
235
|
+
|
231
236
|
return new Clickwrap(response?.data, options)
|
232
237
|
}
|
233
238
|
}
|
package/src/models/DnsRecord.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class DnsRecord
|
@@ -50,6 +51,7 @@ class DnsRecord {
|
|
50
51
|
|
51
52
|
const response = await Api.sendRequest(`/dns_records`, 'GET', params, options)
|
52
53
|
|
54
|
+
|
53
55
|
return response?.data?.map(obj => new DnsRecord(obj, options)) || []
|
54
56
|
}
|
55
57
|
|
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class EmailIncomingMessage
|
@@ -69,6 +70,7 @@ class EmailIncomingMessage {
|
|
69
70
|
|
70
71
|
const response = await Api.sendRequest(`/email_incoming_messages`, 'GET', params, options)
|
71
72
|
|
73
|
+
|
72
74
|
return response?.data?.map(obj => new EmailIncomingMessage(obj, options)) || []
|
73
75
|
}
|
74
76
|
|
package/src/models/Errors.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class Errors
|
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class ExternalEvent
|
@@ -128,6 +129,7 @@ class ExternalEvent {
|
|
128
129
|
|
129
130
|
const response = await Api.sendRequest(`/external_events`, 'GET', params, options)
|
130
131
|
|
132
|
+
|
131
133
|
return response?.data?.map(obj => new ExternalEvent(obj, options)) || []
|
132
134
|
}
|
133
135
|
|
@@ -153,6 +155,7 @@ class ExternalEvent {
|
|
153
155
|
|
154
156
|
const response = await Api.sendRequest(`/external_events/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
155
157
|
|
158
|
+
|
156
159
|
return new ExternalEvent(response?.data, options)
|
157
160
|
}
|
158
161
|
|
@@ -181,6 +184,7 @@ class ExternalEvent {
|
|
181
184
|
|
182
185
|
const response = await Api.sendRequest(`/external_events`, 'POST', params, options)
|
183
186
|
|
187
|
+
|
184
188
|
return new ExternalEvent(response?.data, options)
|
185
189
|
}
|
186
190
|
}
|