files.com 1.0.190 → 1.0.193
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 +3125 -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 +113 -105
- 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 +221 -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 +44 -43
- 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 +106 -105
- 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/Style.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
|
|
@@ -62,23 +63,23 @@ class Style {
|
|
62
63
|
// file (required) - file - Logo for custom branding.
|
63
64
|
update = async (params = {}) => {
|
64
65
|
if (!this.attributes.path) {
|
65
|
-
throw new
|
66
|
+
throw new errors.EmptyPropertyError('Current object has no path')
|
66
67
|
}
|
67
68
|
|
68
69
|
if (!isObject(params)) {
|
69
|
-
throw new
|
70
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
70
71
|
}
|
71
72
|
|
72
73
|
params.path = this.attributes.path
|
73
74
|
if (params['path'] && !isString(params['path'])) {
|
74
|
-
throw new
|
75
|
+
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(path)}`)
|
75
76
|
}
|
76
77
|
|
77
78
|
if (!params['path']) {
|
78
79
|
if (this.attributes.path) {
|
79
80
|
params['path'] = this.path
|
80
81
|
} else {
|
81
|
-
throw new
|
82
|
+
throw new errors.MissingParameterError('Parameter missing: path')
|
82
83
|
}
|
83
84
|
}
|
84
85
|
|
@@ -86,7 +87,7 @@ class Style {
|
|
86
87
|
if (this.attributes.file) {
|
87
88
|
params['file'] = this.file
|
88
89
|
} else {
|
89
|
-
throw new
|
90
|
+
throw new errors.MissingParameterError('Parameter missing: file')
|
90
91
|
}
|
91
92
|
}
|
92
93
|
|
@@ -97,23 +98,23 @@ class Style {
|
|
97
98
|
|
98
99
|
delete = async (params = {}) => {
|
99
100
|
if (!this.attributes.path) {
|
100
|
-
throw new
|
101
|
+
throw new errors.EmptyPropertyError('Current object has no path')
|
101
102
|
}
|
102
103
|
|
103
104
|
if (!isObject(params)) {
|
104
|
-
throw new
|
105
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
105
106
|
}
|
106
107
|
|
107
108
|
params.path = this.attributes.path
|
108
109
|
if (params['path'] && !isString(params['path'])) {
|
109
|
-
throw new
|
110
|
+
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(path)}`)
|
110
111
|
}
|
111
112
|
|
112
113
|
if (!params['path']) {
|
113
114
|
if (this.attributes.path) {
|
114
115
|
params['path'] = this.path
|
115
116
|
} else {
|
116
|
-
throw new
|
117
|
+
throw new errors.MissingParameterError('Parameter missing: path')
|
117
118
|
}
|
118
119
|
}
|
119
120
|
|
@@ -132,17 +133,17 @@ class Style {
|
|
132
133
|
// path (required) - string - Style path.
|
133
134
|
static find = async (path, params = {}, options = {}) => {
|
134
135
|
if (!isObject(params)) {
|
135
|
-
throw new
|
136
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
136
137
|
}
|
137
138
|
|
138
139
|
params['path'] = path
|
139
140
|
|
140
141
|
if (!params['path']) {
|
141
|
-
throw new
|
142
|
+
throw new errors.MissingParameterError('Parameter missing: path')
|
142
143
|
}
|
143
144
|
|
144
145
|
if (params['path'] && !isString(params['path'])) {
|
145
|
-
throw new
|
146
|
+
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(path)}`)
|
146
147
|
}
|
147
148
|
|
148
149
|
const response = await Api.sendRequest(`/styles/${params['path']}`, '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
|
|
@@ -68,11 +69,11 @@ class UsageDailySnapshot {
|
|
68
69
|
// filter_lteq - object - If set, return records where the specified field is less than or equal to the supplied value. Valid fields are `date` and `usage_snapshot_id`. Valid field combinations are `[ usage_snapshot_id, date ]`.
|
69
70
|
static list = async (params = {}, options = {}) => {
|
70
71
|
if (params['cursor'] && !isString(params['cursor'])) {
|
71
|
-
throw new
|
72
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
72
73
|
}
|
73
74
|
|
74
75
|
if (params['per_page'] && !isInt(params['per_page'])) {
|
75
|
-
throw new
|
76
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
76
77
|
}
|
77
78
|
|
78
79
|
const response = await Api.sendRequest(`/usage_daily_snapshots`, '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
|
|
@@ -85,11 +86,11 @@ class UsageSnapshot {
|
|
85
86
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
86
87
|
static list = async (params = {}, options = {}) => {
|
87
88
|
if (params['cursor'] && !isString(params['cursor'])) {
|
88
|
-
throw new
|
89
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
89
90
|
}
|
90
91
|
|
91
92
|
if (params['per_page'] && !isInt(params['per_page'])) {
|
92
|
-
throw new
|
93
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
93
94
|
}
|
94
95
|
|
95
96
|
const response = await Api.sendRequest(`/usage_snapshots`, 'GET', params, options)
|
package/src/models/User.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
|
|
@@ -428,23 +429,23 @@ class User {
|
|
428
429
|
// Unlock user who has been locked out due to failed logins
|
429
430
|
unlock = async (params = {}) => {
|
430
431
|
if (!this.attributes.id) {
|
431
|
-
throw new
|
432
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
432
433
|
}
|
433
434
|
|
434
435
|
if (!isObject(params)) {
|
435
|
-
throw new
|
436
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
436
437
|
}
|
437
438
|
|
438
439
|
params.id = this.attributes.id
|
439
440
|
if (params['id'] && !isInt(params['id'])) {
|
440
|
-
throw new
|
441
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
441
442
|
}
|
442
443
|
|
443
444
|
if (!params['id']) {
|
444
445
|
if (this.attributes.id) {
|
445
446
|
params['id'] = this.id
|
446
447
|
} else {
|
447
|
-
throw new
|
448
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
448
449
|
}
|
449
450
|
}
|
450
451
|
|
@@ -456,23 +457,23 @@ class User {
|
|
456
457
|
// Resend user welcome email
|
457
458
|
resendWelcomeEmail = async (params = {}) => {
|
458
459
|
if (!this.attributes.id) {
|
459
|
-
throw new
|
460
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
460
461
|
}
|
461
462
|
|
462
463
|
if (!isObject(params)) {
|
463
|
-
throw new
|
464
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
464
465
|
}
|
465
466
|
|
466
467
|
params.id = this.attributes.id
|
467
468
|
if (params['id'] && !isInt(params['id'])) {
|
468
|
-
throw new
|
469
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
469
470
|
}
|
470
471
|
|
471
472
|
if (!params['id']) {
|
472
473
|
if (this.attributes.id) {
|
473
474
|
params['id'] = this.id
|
474
475
|
} else {
|
475
|
-
throw new
|
476
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
476
477
|
}
|
477
478
|
}
|
478
479
|
|
@@ -484,23 +485,23 @@ class User {
|
|
484
485
|
// Trigger 2FA Reset process for user who has lost access to their existing 2FA methods
|
485
486
|
user2faReset = async (params = {}) => {
|
486
487
|
if (!this.attributes.id) {
|
487
|
-
throw new
|
488
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
488
489
|
}
|
489
490
|
|
490
491
|
if (!isObject(params)) {
|
491
|
-
throw new
|
492
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
492
493
|
}
|
493
494
|
|
494
495
|
params.id = this.attributes.id
|
495
496
|
if (params['id'] && !isInt(params['id'])) {
|
496
|
-
throw new
|
497
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
497
498
|
}
|
498
499
|
|
499
500
|
if (!params['id']) {
|
500
501
|
if (this.attributes.id) {
|
501
502
|
params['id'] = this.id
|
502
503
|
} else {
|
503
|
-
throw new
|
504
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
504
505
|
}
|
505
506
|
}
|
506
507
|
|
@@ -556,98 +557,98 @@ class User {
|
|
556
557
|
// username - string - User's username
|
557
558
|
update = async (params = {}) => {
|
558
559
|
if (!this.attributes.id) {
|
559
|
-
throw new
|
560
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
560
561
|
}
|
561
562
|
|
562
563
|
if (!isObject(params)) {
|
563
|
-
throw new
|
564
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
564
565
|
}
|
565
566
|
|
566
567
|
params.id = this.attributes.id
|
567
568
|
if (params['id'] && !isInt(params['id'])) {
|
568
|
-
throw new
|
569
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
569
570
|
}
|
570
571
|
if (params['change_password'] && !isString(params['change_password'])) {
|
571
|
-
throw new
|
572
|
+
throw new errors.InvalidParameterError(`Bad parameter: change_password must be of type String, received ${getType(change_password)}`)
|
572
573
|
}
|
573
574
|
if (params['change_password_confirmation'] && !isString(params['change_password_confirmation'])) {
|
574
|
-
throw new
|
575
|
+
throw new errors.InvalidParameterError(`Bad parameter: change_password_confirmation must be of type String, received ${getType(change_password_confirmation)}`)
|
575
576
|
}
|
576
577
|
if (params['email'] && !isString(params['email'])) {
|
577
|
-
throw new
|
578
|
+
throw new errors.InvalidParameterError(`Bad parameter: email must be of type String, received ${getType(email)}`)
|
578
579
|
}
|
579
580
|
if (params['grant_permission'] && !isString(params['grant_permission'])) {
|
580
|
-
throw new
|
581
|
+
throw new errors.InvalidParameterError(`Bad parameter: grant_permission must be of type String, received ${getType(grant_permission)}`)
|
581
582
|
}
|
582
583
|
if (params['group_id'] && !isInt(params['group_id'])) {
|
583
|
-
throw new
|
584
|
+
throw new errors.InvalidParameterError(`Bad parameter: group_id must be of type Int, received ${getType(group_id)}`)
|
584
585
|
}
|
585
586
|
if (params['group_ids'] && !isString(params['group_ids'])) {
|
586
|
-
throw new
|
587
|
+
throw new errors.InvalidParameterError(`Bad parameter: group_ids must be of type String, received ${getType(group_ids)}`)
|
587
588
|
}
|
588
589
|
if (params['imported_password_hash'] && !isString(params['imported_password_hash'])) {
|
589
|
-
throw new
|
590
|
+
throw new errors.InvalidParameterError(`Bad parameter: imported_password_hash must be of type String, received ${getType(imported_password_hash)}`)
|
590
591
|
}
|
591
592
|
if (params['password'] && !isString(params['password'])) {
|
592
|
-
throw new
|
593
|
+
throw new errors.InvalidParameterError(`Bad parameter: password must be of type String, received ${getType(password)}`)
|
593
594
|
}
|
594
595
|
if (params['password_confirmation'] && !isString(params['password_confirmation'])) {
|
595
|
-
throw new
|
596
|
+
throw new errors.InvalidParameterError(`Bad parameter: password_confirmation must be of type String, received ${getType(password_confirmation)}`)
|
596
597
|
}
|
597
598
|
if (params['allowed_ips'] && !isString(params['allowed_ips'])) {
|
598
|
-
throw new
|
599
|
+
throw new errors.InvalidParameterError(`Bad parameter: allowed_ips must be of type String, received ${getType(allowed_ips)}`)
|
599
600
|
}
|
600
601
|
if (params['authenticate_until'] && !isString(params['authenticate_until'])) {
|
601
|
-
throw new
|
602
|
+
throw new errors.InvalidParameterError(`Bad parameter: authenticate_until must be of type String, received ${getType(authenticate_until)}`)
|
602
603
|
}
|
603
604
|
if (params['authentication_method'] && !isString(params['authentication_method'])) {
|
604
|
-
throw new
|
605
|
+
throw new errors.InvalidParameterError(`Bad parameter: authentication_method must be of type String, received ${getType(authentication_method)}`)
|
605
606
|
}
|
606
607
|
if (params['header_text'] && !isString(params['header_text'])) {
|
607
|
-
throw new
|
608
|
+
throw new errors.InvalidParameterError(`Bad parameter: header_text must be of type String, received ${getType(header_text)}`)
|
608
609
|
}
|
609
610
|
if (params['language'] && !isString(params['language'])) {
|
610
|
-
throw new
|
611
|
+
throw new errors.InvalidParameterError(`Bad parameter: language must be of type String, received ${getType(language)}`)
|
611
612
|
}
|
612
613
|
if (params['notification_daily_send_time'] && !isInt(params['notification_daily_send_time'])) {
|
613
|
-
throw new
|
614
|
+
throw new errors.InvalidParameterError(`Bad parameter: notification_daily_send_time must be of type Int, received ${getType(notification_daily_send_time)}`)
|
614
615
|
}
|
615
616
|
if (params['name'] && !isString(params['name'])) {
|
616
|
-
throw new
|
617
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(name)}`)
|
617
618
|
}
|
618
619
|
if (params['company'] && !isString(params['company'])) {
|
619
|
-
throw new
|
620
|
+
throw new errors.InvalidParameterError(`Bad parameter: company must be of type String, received ${getType(company)}`)
|
620
621
|
}
|
621
622
|
if (params['notes'] && !isString(params['notes'])) {
|
622
|
-
throw new
|
623
|
+
throw new errors.InvalidParameterError(`Bad parameter: notes must be of type String, received ${getType(notes)}`)
|
623
624
|
}
|
624
625
|
if (params['password_validity_days'] && !isInt(params['password_validity_days'])) {
|
625
|
-
throw new
|
626
|
+
throw new errors.InvalidParameterError(`Bad parameter: password_validity_days must be of type Int, received ${getType(password_validity_days)}`)
|
626
627
|
}
|
627
628
|
if (params['ssl_required'] && !isString(params['ssl_required'])) {
|
628
|
-
throw new
|
629
|
+
throw new errors.InvalidParameterError(`Bad parameter: ssl_required must be of type String, received ${getType(ssl_required)}`)
|
629
630
|
}
|
630
631
|
if (params['sso_strategy_id'] && !isInt(params['sso_strategy_id'])) {
|
631
|
-
throw new
|
632
|
+
throw new errors.InvalidParameterError(`Bad parameter: sso_strategy_id must be of type Int, received ${getType(sso_strategy_id)}`)
|
632
633
|
}
|
633
634
|
if (params['require_2fa'] && !isString(params['require_2fa'])) {
|
634
|
-
throw new
|
635
|
+
throw new errors.InvalidParameterError(`Bad parameter: require_2fa must be of type String, received ${getType(require_2fa)}`)
|
635
636
|
}
|
636
637
|
if (params['time_zone'] && !isString(params['time_zone'])) {
|
637
|
-
throw new
|
638
|
+
throw new errors.InvalidParameterError(`Bad parameter: time_zone must be of type String, received ${getType(time_zone)}`)
|
638
639
|
}
|
639
640
|
if (params['user_root'] && !isString(params['user_root'])) {
|
640
|
-
throw new
|
641
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_root must be of type String, received ${getType(user_root)}`)
|
641
642
|
}
|
642
643
|
if (params['username'] && !isString(params['username'])) {
|
643
|
-
throw new
|
644
|
+
throw new errors.InvalidParameterError(`Bad parameter: username must be of type String, received ${getType(username)}`)
|
644
645
|
}
|
645
646
|
|
646
647
|
if (!params['id']) {
|
647
648
|
if (this.attributes.id) {
|
648
649
|
params['id'] = this.id
|
649
650
|
} else {
|
650
|
-
throw new
|
651
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
651
652
|
}
|
652
653
|
}
|
653
654
|
|
@@ -658,23 +659,23 @@ class User {
|
|
658
659
|
|
659
660
|
delete = async (params = {}) => {
|
660
661
|
if (!this.attributes.id) {
|
661
|
-
throw new
|
662
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
662
663
|
}
|
663
664
|
|
664
665
|
if (!isObject(params)) {
|
665
|
-
throw new
|
666
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
666
667
|
}
|
667
668
|
|
668
669
|
params.id = this.attributes.id
|
669
670
|
if (params['id'] && !isInt(params['id'])) {
|
670
|
-
throw new
|
671
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
671
672
|
}
|
672
673
|
|
673
674
|
if (!params['id']) {
|
674
675
|
if (this.attributes.id) {
|
675
676
|
params['id'] = this.id
|
676
677
|
} else {
|
677
|
-
throw new
|
678
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
678
679
|
}
|
679
680
|
}
|
680
681
|
|
@@ -717,19 +718,19 @@ class User {
|
|
717
718
|
// search - string - Searches for partial matches of name, username, or email.
|
718
719
|
static list = async (params = {}, options = {}) => {
|
719
720
|
if (params['cursor'] && !isString(params['cursor'])) {
|
720
|
-
throw new
|
721
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
721
722
|
}
|
722
723
|
|
723
724
|
if (params['per_page'] && !isInt(params['per_page'])) {
|
724
|
-
throw new
|
725
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
725
726
|
}
|
726
727
|
|
727
728
|
if (params['ids'] && !isString(params['ids'])) {
|
728
|
-
throw new
|
729
|
+
throw new errors.InvalidParameterError(`Bad parameter: ids must be of type String, received ${getType(ids)}`)
|
729
730
|
}
|
730
731
|
|
731
732
|
if (params['search'] && !isString(params['search'])) {
|
732
|
-
throw new
|
733
|
+
throw new errors.InvalidParameterError(`Bad parameter: search must be of type String, received ${getType(search)}`)
|
733
734
|
}
|
734
735
|
|
735
736
|
const response = await Api.sendRequest(`/users`, 'GET', params, options)
|
@@ -744,17 +745,17 @@ class User {
|
|
744
745
|
// id (required) - int64 - User ID.
|
745
746
|
static find = async (id, params = {}, options = {}) => {
|
746
747
|
if (!isObject(params)) {
|
747
|
-
throw new
|
748
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
748
749
|
}
|
749
750
|
|
750
751
|
params['id'] = id
|
751
752
|
|
752
753
|
if (!params['id']) {
|
753
|
-
throw new
|
754
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
754
755
|
}
|
755
756
|
|
756
757
|
if (params['id'] && !isInt(params['id'])) {
|
757
|
-
throw new
|
758
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
758
759
|
}
|
759
760
|
|
760
761
|
const response = await Api.sendRequest(`/users/${params['id']}`, 'GET', params, options)
|
@@ -812,103 +813,103 @@ class User {
|
|
812
813
|
// username - string - User's username
|
813
814
|
static create = async (params = {}, options = {}) => {
|
814
815
|
if (params['change_password'] && !isString(params['change_password'])) {
|
815
|
-
throw new
|
816
|
+
throw new errors.InvalidParameterError(`Bad parameter: change_password must be of type String, received ${getType(change_password)}`)
|
816
817
|
}
|
817
818
|
|
818
819
|
if (params['change_password_confirmation'] && !isString(params['change_password_confirmation'])) {
|
819
|
-
throw new
|
820
|
+
throw new errors.InvalidParameterError(`Bad parameter: change_password_confirmation must be of type String, received ${getType(change_password_confirmation)}`)
|
820
821
|
}
|
821
822
|
|
822
823
|
if (params['email'] && !isString(params['email'])) {
|
823
|
-
throw new
|
824
|
+
throw new errors.InvalidParameterError(`Bad parameter: email must be of type String, received ${getType(email)}`)
|
824
825
|
}
|
825
826
|
|
826
827
|
if (params['grant_permission'] && !isString(params['grant_permission'])) {
|
827
|
-
throw new
|
828
|
+
throw new errors.InvalidParameterError(`Bad parameter: grant_permission must be of type String, received ${getType(grant_permission)}`)
|
828
829
|
}
|
829
830
|
|
830
831
|
if (params['group_id'] && !isInt(params['group_id'])) {
|
831
|
-
throw new
|
832
|
+
throw new errors.InvalidParameterError(`Bad parameter: group_id must be of type Int, received ${getType(group_id)}`)
|
832
833
|
}
|
833
834
|
|
834
835
|
if (params['group_ids'] && !isString(params['group_ids'])) {
|
835
|
-
throw new
|
836
|
+
throw new errors.InvalidParameterError(`Bad parameter: group_ids must be of type String, received ${getType(group_ids)}`)
|
836
837
|
}
|
837
838
|
|
838
839
|
if (params['imported_password_hash'] && !isString(params['imported_password_hash'])) {
|
839
|
-
throw new
|
840
|
+
throw new errors.InvalidParameterError(`Bad parameter: imported_password_hash must be of type String, received ${getType(imported_password_hash)}`)
|
840
841
|
}
|
841
842
|
|
842
843
|
if (params['password'] && !isString(params['password'])) {
|
843
|
-
throw new
|
844
|
+
throw new errors.InvalidParameterError(`Bad parameter: password must be of type String, received ${getType(password)}`)
|
844
845
|
}
|
845
846
|
|
846
847
|
if (params['password_confirmation'] && !isString(params['password_confirmation'])) {
|
847
|
-
throw new
|
848
|
+
throw new errors.InvalidParameterError(`Bad parameter: password_confirmation must be of type String, received ${getType(password_confirmation)}`)
|
848
849
|
}
|
849
850
|
|
850
851
|
if (params['allowed_ips'] && !isString(params['allowed_ips'])) {
|
851
|
-
throw new
|
852
|
+
throw new errors.InvalidParameterError(`Bad parameter: allowed_ips must be of type String, received ${getType(allowed_ips)}`)
|
852
853
|
}
|
853
854
|
|
854
855
|
if (params['authenticate_until'] && !isString(params['authenticate_until'])) {
|
855
|
-
throw new
|
856
|
+
throw new errors.InvalidParameterError(`Bad parameter: authenticate_until must be of type String, received ${getType(authenticate_until)}`)
|
856
857
|
}
|
857
858
|
|
858
859
|
if (params['authentication_method'] && !isString(params['authentication_method'])) {
|
859
|
-
throw new
|
860
|
+
throw new errors.InvalidParameterError(`Bad parameter: authentication_method must be of type String, received ${getType(authentication_method)}`)
|
860
861
|
}
|
861
862
|
|
862
863
|
if (params['header_text'] && !isString(params['header_text'])) {
|
863
|
-
throw new
|
864
|
+
throw new errors.InvalidParameterError(`Bad parameter: header_text must be of type String, received ${getType(header_text)}`)
|
864
865
|
}
|
865
866
|
|
866
867
|
if (params['language'] && !isString(params['language'])) {
|
867
|
-
throw new
|
868
|
+
throw new errors.InvalidParameterError(`Bad parameter: language must be of type String, received ${getType(language)}`)
|
868
869
|
}
|
869
870
|
|
870
871
|
if (params['notification_daily_send_time'] && !isInt(params['notification_daily_send_time'])) {
|
871
|
-
throw new
|
872
|
+
throw new errors.InvalidParameterError(`Bad parameter: notification_daily_send_time must be of type Int, received ${getType(notification_daily_send_time)}`)
|
872
873
|
}
|
873
874
|
|
874
875
|
if (params['name'] && !isString(params['name'])) {
|
875
|
-
throw new
|
876
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(name)}`)
|
876
877
|
}
|
877
878
|
|
878
879
|
if (params['company'] && !isString(params['company'])) {
|
879
|
-
throw new
|
880
|
+
throw new errors.InvalidParameterError(`Bad parameter: company must be of type String, received ${getType(company)}`)
|
880
881
|
}
|
881
882
|
|
882
883
|
if (params['notes'] && !isString(params['notes'])) {
|
883
|
-
throw new
|
884
|
+
throw new errors.InvalidParameterError(`Bad parameter: notes must be of type String, received ${getType(notes)}`)
|
884
885
|
}
|
885
886
|
|
886
887
|
if (params['password_validity_days'] && !isInt(params['password_validity_days'])) {
|
887
|
-
throw new
|
888
|
+
throw new errors.InvalidParameterError(`Bad parameter: password_validity_days must be of type Int, received ${getType(password_validity_days)}`)
|
888
889
|
}
|
889
890
|
|
890
891
|
if (params['ssl_required'] && !isString(params['ssl_required'])) {
|
891
|
-
throw new
|
892
|
+
throw new errors.InvalidParameterError(`Bad parameter: ssl_required must be of type String, received ${getType(ssl_required)}`)
|
892
893
|
}
|
893
894
|
|
894
895
|
if (params['sso_strategy_id'] && !isInt(params['sso_strategy_id'])) {
|
895
|
-
throw new
|
896
|
+
throw new errors.InvalidParameterError(`Bad parameter: sso_strategy_id must be of type Int, received ${getType(sso_strategy_id)}`)
|
896
897
|
}
|
897
898
|
|
898
899
|
if (params['require_2fa'] && !isString(params['require_2fa'])) {
|
899
|
-
throw new
|
900
|
+
throw new errors.InvalidParameterError(`Bad parameter: require_2fa must be of type String, received ${getType(require_2fa)}`)
|
900
901
|
}
|
901
902
|
|
902
903
|
if (params['time_zone'] && !isString(params['time_zone'])) {
|
903
|
-
throw new
|
904
|
+
throw new errors.InvalidParameterError(`Bad parameter: time_zone must be of type String, received ${getType(time_zone)}`)
|
904
905
|
}
|
905
906
|
|
906
907
|
if (params['user_root'] && !isString(params['user_root'])) {
|
907
|
-
throw new
|
908
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_root must be of type String, received ${getType(user_root)}`)
|
908
909
|
}
|
909
910
|
|
910
911
|
if (params['username'] && !isString(params['username'])) {
|
911
|
-
throw new
|
912
|
+
throw new errors.InvalidParameterError(`Bad parameter: username must be of type String, received ${getType(username)}`)
|
912
913
|
}
|
913
914
|
|
914
915
|
const response = await Api.sendRequest(`/users`, '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
|
|
@@ -47,15 +48,15 @@ class UserCipherUse {
|
|
47
48
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
48
49
|
static list = async (params = {}, options = {}) => {
|
49
50
|
if (params['user_id'] && !isInt(params['user_id'])) {
|
50
|
-
throw new
|
51
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
51
52
|
}
|
52
53
|
|
53
54
|
if (params['cursor'] && !isString(params['cursor'])) {
|
54
|
-
throw new
|
55
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
55
56
|
}
|
56
57
|
|
57
58
|
if (params['per_page'] && !isInt(params['per_page'])) {
|
58
|
-
throw new
|
59
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
59
60
|
}
|
60
61
|
|
61
62
|
const response = await Api.sendRequest(`/user_cipher_uses`, 'GET', params, options)
|