files.com 1.1.18 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +0 -3
- package/_VERSION +1 -1
- package/docs/Errors.md +1 -0
- package/lib/Api.js +1 -1
- package/lib/Errors.js +957 -933
- package/lib/Files.js +1 -1
- package/lib/models/ActionNotificationExport.js +25 -25
- package/lib/models/ActionNotificationExportResult.js +10 -10
- package/lib/models/ActionWebhookFailure.js +5 -9
- package/lib/models/ApiKey.js +62 -70
- package/lib/models/App.js +5 -5
- package/lib/models/As2IncomingMessage.js +7 -7
- package/lib/models/As2OutgoingMessage.js +7 -7
- package/lib/models/As2Partner.js +54 -58
- package/lib/models/As2Station.js +51 -55
- package/lib/models/Automation.js +102 -110
- package/lib/models/AutomationRun.js +13 -13
- package/lib/models/BandwidthSnapshot.js +5 -5
- package/lib/models/Behavior.js +77 -85
- package/lib/models/Bundle.js +102 -110
- package/lib/models/BundleDownload.js +9 -9
- package/lib/models/BundleNotification.js +37 -41
- package/lib/models/BundleRecipient.js +22 -22
- package/lib/models/BundleRegistration.js +7 -7
- package/lib/models/Clickwrap.js +52 -56
- package/lib/models/DnsRecord.js +5 -5
- package/lib/models/EmailIncomingMessage.js +5 -5
- package/lib/models/ExternalEvent.js +18 -18
- package/lib/models/File.js +89 -93
- package/lib/models/FileComment.js +41 -45
- package/lib/models/FileCommentReaction.js +15 -19
- package/lib/models/FileMigration.js +5 -5
- package/lib/models/Folder.js +24 -24
- package/lib/models/FormFieldSet.js +44 -48
- package/lib/models/GpgKey.js +53 -57
- package/lib/models/Group.js +51 -55
- package/lib/models/GroupUser.js +53 -57
- package/lib/models/History.js +72 -72
- package/lib/models/HistoryExport.js +51 -51
- package/lib/models/HistoryExportResult.js +10 -10
- package/lib/models/InboxRecipient.js +22 -22
- package/lib/models/InboxRegistration.js +7 -7
- package/lib/models/InboxUpload.js +9 -9
- package/lib/models/Invoice.js +12 -12
- package/lib/models/IpAddress.js +17 -17
- package/lib/models/Lock.js +27 -31
- package/lib/models/Message.js +60 -64
- package/lib/models/MessageComment.js +46 -50
- package/lib/models/MessageCommentReaction.js +27 -31
- package/lib/models/MessageReaction.js +27 -31
- package/lib/models/Notification.js +66 -70
- package/lib/models/Payment.js +12 -12
- package/lib/models/Permission.js +28 -32
- package/lib/models/Priority.js +9 -9
- package/lib/models/Project.js +39 -43
- package/lib/models/PublicKey.js +46 -50
- package/lib/models/RemoteBandwidthSnapshot.js +5 -5
- package/lib/models/RemoteServer.js +306 -310
- package/lib/models/Request.js +33 -37
- package/lib/models/Session.js +11 -15
- package/lib/models/SettingsChange.js +5 -5
- package/lib/models/SftpHostKey.js +40 -44
- package/lib/models/ShareGroup.js +50 -54
- package/lib/models/Site.js +138 -138
- package/lib/models/Snapshot.js +44 -48
- package/lib/models/SsoStrategy.js +15 -19
- package/lib/models/Style.js +17 -21
- package/lib/models/UsageDailySnapshot.js +5 -5
- package/lib/models/UsageSnapshot.js +5 -5
- package/lib/models/User.js +156 -172
- package/lib/models/UserCipherUse.js +7 -7
- package/lib/models/UserRequest.js +26 -30
- package/lib/models/WebhookTest.js +15 -15
- package/package.json +6 -2
- package/src/Api.js +2 -1
- package/src/Errors.js +189 -177
- package/src/Files.js +1 -1
- package/src/models/AccountLineItem.js +5 -2
- package/src/models/Action.js +5 -2
- package/src/models/ActionNotificationExport.js +36 -35
- package/src/models/ActionNotificationExportResult.js +15 -13
- package/src/models/ActionWebhookFailure.js +9 -8
- package/src/models/ApiKey.js +69 -72
- package/src/models/App.js +10 -8
- package/src/models/As2IncomingMessage.js +12 -10
- package/src/models/As2OutgoingMessage.js +12 -10
- package/src/models/As2Partner.js +61 -60
- package/src/models/As2Station.js +58 -57
- package/src/models/Auto.js +5 -2
- package/src/models/Automation.js +121 -110
- package/src/models/AutomationRun.js +18 -17
- package/src/models/BandwidthSnapshot.js +10 -8
- package/src/models/Behavior.js +85 -86
- package/src/models/Bundle.js +121 -110
- package/src/models/BundleDownload.js +14 -12
- package/src/models/BundleNotification.js +40 -43
- package/src/models/BundleRecipient.js +33 -32
- package/src/models/BundleRegistration.js +12 -10
- package/src/models/Clickwrap.js +60 -58
- package/src/models/DnsRecord.js +10 -8
- package/src/models/EmailIncomingMessage.js +10 -8
- package/src/models/Errors.js +5 -2
- package/src/models/ExternalEvent.js +29 -29
- package/src/models/File.js +116 -108
- package/src/models/FileAction.js +5 -2
- package/src/models/FileComment.js +45 -46
- package/src/models/FileCommentReaction.js +26 -26
- package/src/models/FileMigration.js +10 -8
- package/src/models/FileUploadPart.js +5 -2
- package/src/models/Folder.js +32 -29
- package/src/models/FormField.js +5 -2
- package/src/models/FormFieldSet.js +49 -50
- package/src/models/GpgKey.js +60 -59
- package/src/models/Group.js +58 -57
- package/src/models/GroupUser.js +60 -58
- package/src/models/History.js +77 -74
- package/src/models/HistoryExport.js +62 -61
- package/src/models/HistoryExportResult.js +15 -13
- package/src/models/Image.js +5 -2
- package/src/models/InboxRecipient.js +33 -32
- package/src/models/InboxRegistration.js +12 -10
- package/src/models/InboxUpload.js +14 -12
- package/src/models/Invoice.js +17 -14
- package/src/models/InvoiceLineItem.js +5 -2
- package/src/models/IpAddress.js +22 -20
- package/src/models/Lock.js +36 -36
- package/src/models/Message.js +66 -66
- package/src/models/MessageComment.js +50 -52
- package/src/models/MessageCommentReaction.js +38 -40
- package/src/models/MessageReaction.js +38 -40
- package/src/models/Notification.js +74 -72
- package/src/models/Payment.js +17 -14
- package/src/models/PaymentLineItem.js +5 -2
- package/src/models/Permission.js +39 -40
- package/src/models/Preview.js +5 -2
- package/src/models/Priority.js +14 -12
- package/src/models/Project.js +43 -45
- package/src/models/PublicIpAddress.js +5 -2
- package/src/models/PublicKey.js +50 -52
- package/src/models/RemoteBandwidthSnapshot.js +10 -8
- package/src/models/RemoteServer.js +380 -312
- package/src/models/RemoteServerConfigurationFile.js +5 -2
- package/src/models/Request.js +44 -46
- package/src/models/Session.js +22 -22
- package/src/models/SettingsChange.js +10 -8
- package/src/models/SftpHostKey.js +45 -46
- package/src/models/ShareGroup.js +56 -56
- package/src/models/ShareGroupMember.js +5 -2
- package/src/models/Site.js +143 -142
- package/src/models/Snapshot.js +50 -50
- package/src/models/SsoStrategy.js +20 -21
- package/src/models/Status.js +5 -2
- package/src/models/Style.js +22 -23
- package/src/models/UsageDailySnapshot.js +10 -8
- package/src/models/UsageSnapshot.js +10 -8
- package/src/models/User.js +185 -168
- package/src/models/UserCipherUse.js +12 -10
- package/src/models/UserRequest.js +37 -39
- package/src/models/WebhookTest.js +26 -24
- package/test/Api.test.js +163 -0
- package/test/{package.json → integration/package.json} +1 -1
- package/test/{src → integration/src}/index.js +1 -1
- package/test.sh +2 -1
- /package/test/{.babelrc → integration/.babelrc} +0 -0
- /package/test/{index.js → integration/index.js} +0 -0
package/src/models/Site.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
import Api from '../Api'
|
|
3
3
|
import * as errors from '../Errors'
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
getType, isArray, isInt, isObject, isString,
|
|
6
|
+
} from '../utils'
|
|
5
7
|
/* eslint-enable no-unused-vars */
|
|
6
8
|
|
|
7
9
|
/**
|
|
@@ -9,6 +11,7 @@ import { getType, isArray, isInt, isObject, isString } from '../utils'
|
|
|
9
11
|
*/
|
|
10
12
|
class Site {
|
|
11
13
|
attributes = {}
|
|
14
|
+
|
|
12
15
|
options = {}
|
|
13
16
|
|
|
14
17
|
constructor(attributes = {}, options = {}) {
|
|
@@ -24,6 +27,7 @@ class Site {
|
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
isLoaded = () => !!this.attributes.id
|
|
30
|
+
|
|
27
31
|
// string # Site name
|
|
28
32
|
getName = () => this.attributes.name
|
|
29
33
|
|
|
@@ -474,18 +478,16 @@ class Site {
|
|
|
474
478
|
// boolean # Allow group admins set password authentication method
|
|
475
479
|
getGroupAdminsCanSetUserPassword = () => this.attributes.group_admins_can_set_user_password
|
|
476
480
|
|
|
477
|
-
|
|
478
481
|
static get = async (options = {}) => {
|
|
479
|
-
const response = await Api.sendRequest(
|
|
482
|
+
const response = await Api.sendRequest('/site', 'GET', {}, options)
|
|
480
483
|
|
|
481
|
-
|
|
482
484
|
return new Site(response?.data, options)
|
|
483
485
|
}
|
|
484
486
|
|
|
485
487
|
static getUsage = async (options = {}) => {
|
|
486
|
-
const response = await Api.sendRequest(
|
|
488
|
+
const response = await Api.sendRequest('/site/usage', 'GET', {}, options)
|
|
487
489
|
|
|
488
|
-
const UsageSnapshot = require(
|
|
490
|
+
const UsageSnapshot = require('./UsageSnapshot.js').default
|
|
489
491
|
return new UsageSnapshot(response?.data, options)
|
|
490
492
|
}
|
|
491
493
|
|
|
@@ -635,277 +637,276 @@ class Site {
|
|
|
635
637
|
// smtp_password - string - Password for SMTP server.
|
|
636
638
|
// session_expiry_minutes - int64 - Session expiry in minutes
|
|
637
639
|
static update = async (params = {}, options = {}) => {
|
|
638
|
-
if (params
|
|
639
|
-
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params
|
|
640
|
+
if (params.name && !isString(params.name)) {
|
|
641
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params.name)}`)
|
|
640
642
|
}
|
|
641
643
|
|
|
642
|
-
if (params
|
|
643
|
-
throw new errors.InvalidParameterError(`Bad parameter: subdomain must be of type String, received ${getType(params
|
|
644
|
+
if (params.subdomain && !isString(params.subdomain)) {
|
|
645
|
+
throw new errors.InvalidParameterError(`Bad parameter: subdomain must be of type String, received ${getType(params.subdomain)}`)
|
|
644
646
|
}
|
|
645
647
|
|
|
646
|
-
if (params
|
|
647
|
-
throw new errors.InvalidParameterError(`Bad parameter: domain must be of type String, received ${getType(params
|
|
648
|
+
if (params.domain && !isString(params.domain)) {
|
|
649
|
+
throw new errors.InvalidParameterError(`Bad parameter: domain must be of type String, received ${getType(params.domain)}`)
|
|
648
650
|
}
|
|
649
651
|
|
|
650
|
-
if (params
|
|
651
|
-
throw new errors.InvalidParameterError(`Bad parameter: domain_letsencrypt_chain must be of type String, received ${getType(params
|
|
652
|
+
if (params.domain_letsencrypt_chain && !isString(params.domain_letsencrypt_chain)) {
|
|
653
|
+
throw new errors.InvalidParameterError(`Bad parameter: domain_letsencrypt_chain must be of type String, received ${getType(params.domain_letsencrypt_chain)}`)
|
|
652
654
|
}
|
|
653
655
|
|
|
654
|
-
if (params
|
|
655
|
-
throw new errors.InvalidParameterError(`Bad parameter: email must be of type String, received ${getType(params
|
|
656
|
+
if (params.email && !isString(params.email)) {
|
|
657
|
+
throw new errors.InvalidParameterError(`Bad parameter: email must be of type String, received ${getType(params.email)}`)
|
|
656
658
|
}
|
|
657
659
|
|
|
658
|
-
if (params
|
|
659
|
-
throw new errors.InvalidParameterError(`Bad parameter: reply_to_email must be of type String, received ${getType(params
|
|
660
|
+
if (params.reply_to_email && !isString(params.reply_to_email)) {
|
|
661
|
+
throw new errors.InvalidParameterError(`Bad parameter: reply_to_email must be of type String, received ${getType(params.reply_to_email)}`)
|
|
660
662
|
}
|
|
661
663
|
|
|
662
|
-
if (params
|
|
663
|
-
throw new errors.InvalidParameterError(`Bad parameter: bundle_expiration must be of type Int, received ${getType(params
|
|
664
|
+
if (params.bundle_expiration && !isInt(params.bundle_expiration)) {
|
|
665
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_expiration must be of type Int, received ${getType(params.bundle_expiration)}`)
|
|
664
666
|
}
|
|
665
667
|
|
|
666
|
-
if (params
|
|
667
|
-
throw new errors.InvalidParameterError(`Bad parameter: welcome_email_cc must be of type String, received ${getType(params
|
|
668
|
+
if (params.welcome_email_cc && !isString(params.welcome_email_cc)) {
|
|
669
|
+
throw new errors.InvalidParameterError(`Bad parameter: welcome_email_cc must be of type String, received ${getType(params.welcome_email_cc)}`)
|
|
668
670
|
}
|
|
669
671
|
|
|
670
|
-
if (params
|
|
671
|
-
throw new errors.InvalidParameterError(`Bad parameter: welcome_email_subject must be of type String, received ${getType(params
|
|
672
|
+
if (params.welcome_email_subject && !isString(params.welcome_email_subject)) {
|
|
673
|
+
throw new errors.InvalidParameterError(`Bad parameter: welcome_email_subject must be of type String, received ${getType(params.welcome_email_subject)}`)
|
|
672
674
|
}
|
|
673
675
|
|
|
674
|
-
if (params
|
|
675
|
-
throw new errors.InvalidParameterError(`Bad parameter: welcome_custom_text must be of type String, received ${getType(params
|
|
676
|
+
if (params.welcome_custom_text && !isString(params.welcome_custom_text)) {
|
|
677
|
+
throw new errors.InvalidParameterError(`Bad parameter: welcome_custom_text must be of type String, received ${getType(params.welcome_custom_text)}`)
|
|
676
678
|
}
|
|
677
679
|
|
|
678
|
-
if (params
|
|
679
|
-
throw new errors.InvalidParameterError(`Bad parameter: language must be of type String, received ${getType(params
|
|
680
|
+
if (params.language && !isString(params.language)) {
|
|
681
|
+
throw new errors.InvalidParameterError(`Bad parameter: language must be of type String, received ${getType(params.language)}`)
|
|
680
682
|
}
|
|
681
683
|
|
|
682
|
-
if (params
|
|
683
|
-
throw new errors.InvalidParameterError(`Bad parameter: default_time_zone must be of type String, received ${getType(params
|
|
684
|
+
if (params.default_time_zone && !isString(params.default_time_zone)) {
|
|
685
|
+
throw new errors.InvalidParameterError(`Bad parameter: default_time_zone must be of type String, received ${getType(params.default_time_zone)}`)
|
|
684
686
|
}
|
|
685
687
|
|
|
686
|
-
if (params
|
|
687
|
-
throw new errors.InvalidParameterError(`Bad parameter: desktop_app_session_lifetime must be of type Int, received ${getType(params
|
|
688
|
+
if (params.desktop_app_session_lifetime && !isInt(params.desktop_app_session_lifetime)) {
|
|
689
|
+
throw new errors.InvalidParameterError(`Bad parameter: desktop_app_session_lifetime must be of type Int, received ${getType(params.desktop_app_session_lifetime)}`)
|
|
688
690
|
}
|
|
689
691
|
|
|
690
|
-
if (params
|
|
691
|
-
throw new errors.InvalidParameterError(`Bad parameter: mobile_app_session_lifetime must be of type Int, received ${getType(params
|
|
692
|
+
if (params.mobile_app_session_lifetime && !isInt(params.mobile_app_session_lifetime)) {
|
|
693
|
+
throw new errors.InvalidParameterError(`Bad parameter: mobile_app_session_lifetime must be of type Int, received ${getType(params.mobile_app_session_lifetime)}`)
|
|
692
694
|
}
|
|
693
695
|
|
|
694
|
-
if (params
|
|
695
|
-
throw new errors.InvalidParameterError(`Bad parameter: welcome_screen must be of type String, received ${getType(params
|
|
696
|
+
if (params.welcome_screen && !isString(params.welcome_screen)) {
|
|
697
|
+
throw new errors.InvalidParameterError(`Bad parameter: welcome_screen must be of type String, received ${getType(params.welcome_screen)}`)
|
|
696
698
|
}
|
|
697
699
|
|
|
698
|
-
if (params
|
|
699
|
-
throw new errors.InvalidParameterError(`Bad parameter: office_integration_type must be of type String, received ${getType(params
|
|
700
|
+
if (params.office_integration_type && !isString(params.office_integration_type)) {
|
|
701
|
+
throw new errors.InvalidParameterError(`Bad parameter: office_integration_type must be of type String, received ${getType(params.office_integration_type)}`)
|
|
700
702
|
}
|
|
701
703
|
|
|
702
|
-
if (params
|
|
703
|
-
throw new errors.InvalidParameterError(`Bad parameter: motd_text must be of type String, received ${getType(params
|
|
704
|
+
if (params.motd_text && !isString(params.motd_text)) {
|
|
705
|
+
throw new errors.InvalidParameterError(`Bad parameter: motd_text must be of type String, received ${getType(params.motd_text)}`)
|
|
704
706
|
}
|
|
705
707
|
|
|
706
|
-
if (params
|
|
707
|
-
throw new errors.InvalidParameterError(`Bad parameter: user_lockout_tries must be of type Int, received ${getType(params
|
|
708
|
+
if (params.user_lockout_tries && !isInt(params.user_lockout_tries)) {
|
|
709
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_lockout_tries must be of type Int, received ${getType(params.user_lockout_tries)}`)
|
|
708
710
|
}
|
|
709
711
|
|
|
710
|
-
if (params
|
|
711
|
-
throw new errors.InvalidParameterError(`Bad parameter: user_lockout_within must be of type Int, received ${getType(params
|
|
712
|
+
if (params.user_lockout_within && !isInt(params.user_lockout_within)) {
|
|
713
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_lockout_within must be of type Int, received ${getType(params.user_lockout_within)}`)
|
|
712
714
|
}
|
|
713
715
|
|
|
714
|
-
if (params
|
|
715
|
-
throw new errors.InvalidParameterError(`Bad parameter: user_lockout_lock_period must be of type Int, received ${getType(params
|
|
716
|
+
if (params.user_lockout_lock_period && !isInt(params.user_lockout_lock_period)) {
|
|
717
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_lockout_lock_period must be of type Int, received ${getType(params.user_lockout_lock_period)}`)
|
|
716
718
|
}
|
|
717
719
|
|
|
718
|
-
if (params
|
|
719
|
-
throw new errors.InvalidParameterError(`Bad parameter: allowed_countries must be of type String, received ${getType(params
|
|
720
|
+
if (params.allowed_countries && !isString(params.allowed_countries)) {
|
|
721
|
+
throw new errors.InvalidParameterError(`Bad parameter: allowed_countries must be of type String, received ${getType(params.allowed_countries)}`)
|
|
720
722
|
}
|
|
721
723
|
|
|
722
|
-
if (params
|
|
723
|
-
throw new errors.InvalidParameterError(`Bad parameter: allowed_ips must be of type String, received ${getType(params
|
|
724
|
+
if (params.allowed_ips && !isString(params.allowed_ips)) {
|
|
725
|
+
throw new errors.InvalidParameterError(`Bad parameter: allowed_ips must be of type String, received ${getType(params.allowed_ips)}`)
|
|
724
726
|
}
|
|
725
727
|
|
|
726
|
-
if (params
|
|
727
|
-
throw new errors.InvalidParameterError(`Bad parameter: disallowed_countries must be of type String, received ${getType(params
|
|
728
|
+
if (params.disallowed_countries && !isString(params.disallowed_countries)) {
|
|
729
|
+
throw new errors.InvalidParameterError(`Bad parameter: disallowed_countries must be of type String, received ${getType(params.disallowed_countries)}`)
|
|
728
730
|
}
|
|
729
731
|
|
|
730
|
-
if (params
|
|
731
|
-
throw new errors.InvalidParameterError(`Bad parameter: days_to_retain_backups must be of type Int, received ${getType(params
|
|
732
|
+
if (params.days_to_retain_backups && !isInt(params.days_to_retain_backups)) {
|
|
733
|
+
throw new errors.InvalidParameterError(`Bad parameter: days_to_retain_backups must be of type Int, received ${getType(params.days_to_retain_backups)}`)
|
|
732
734
|
}
|
|
733
735
|
|
|
734
|
-
if (params
|
|
735
|
-
throw new errors.InvalidParameterError(`Bad parameter: max_prior_passwords must be of type Int, received ${getType(params
|
|
736
|
+
if (params.max_prior_passwords && !isInt(params.max_prior_passwords)) {
|
|
737
|
+
throw new errors.InvalidParameterError(`Bad parameter: max_prior_passwords must be of type Int, received ${getType(params.max_prior_passwords)}`)
|
|
736
738
|
}
|
|
737
739
|
|
|
738
|
-
if (params
|
|
739
|
-
throw new errors.InvalidParameterError(`Bad parameter: password_validity_days must be of type Int, received ${getType(params
|
|
740
|
+
if (params.password_validity_days && !isInt(params.password_validity_days)) {
|
|
741
|
+
throw new errors.InvalidParameterError(`Bad parameter: password_validity_days must be of type Int, received ${getType(params.password_validity_days)}`)
|
|
740
742
|
}
|
|
741
743
|
|
|
742
|
-
if (params
|
|
743
|
-
throw new errors.InvalidParameterError(`Bad parameter: password_min_length must be of type Int, received ${getType(params
|
|
744
|
+
if (params.password_min_length && !isInt(params.password_min_length)) {
|
|
745
|
+
throw new errors.InvalidParameterError(`Bad parameter: password_min_length must be of type Int, received ${getType(params.password_min_length)}`)
|
|
744
746
|
}
|
|
745
747
|
|
|
746
|
-
if (params
|
|
747
|
-
throw new errors.InvalidParameterError(`Bad parameter: bundle_not_found_message must be of type String, received ${getType(params
|
|
748
|
+
if (params.bundle_not_found_message && !isString(params.bundle_not_found_message)) {
|
|
749
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_not_found_message must be of type String, received ${getType(params.bundle_not_found_message)}`)
|
|
748
750
|
}
|
|
749
751
|
|
|
750
|
-
if (params
|
|
751
|
-
throw new errors.InvalidParameterError(`Bad parameter: bundle_registration_notifications must be of type String, received ${getType(params
|
|
752
|
+
if (params.bundle_registration_notifications && !isString(params.bundle_registration_notifications)) {
|
|
753
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_registration_notifications must be of type String, received ${getType(params.bundle_registration_notifications)}`)
|
|
752
754
|
}
|
|
753
755
|
|
|
754
|
-
if (params
|
|
755
|
-
throw new errors.InvalidParameterError(`Bad parameter: bundle_activity_notifications must be of type String, received ${getType(params
|
|
756
|
+
if (params.bundle_activity_notifications && !isString(params.bundle_activity_notifications)) {
|
|
757
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_activity_notifications must be of type String, received ${getType(params.bundle_activity_notifications)}`)
|
|
756
758
|
}
|
|
757
759
|
|
|
758
|
-
if (params
|
|
759
|
-
throw new errors.InvalidParameterError(`Bad parameter: bundle_upload_receipt_notifications must be of type String, received ${getType(params
|
|
760
|
+
if (params.bundle_upload_receipt_notifications && !isString(params.bundle_upload_receipt_notifications)) {
|
|
761
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_upload_receipt_notifications must be of type String, received ${getType(params.bundle_upload_receipt_notifications)}`)
|
|
760
762
|
}
|
|
761
763
|
|
|
762
|
-
if (params
|
|
763
|
-
throw new errors.InvalidParameterError(`Bad parameter: disable_users_from_inactivity_period_days must be of type Int, received ${getType(params
|
|
764
|
+
if (params.disable_users_from_inactivity_period_days && !isInt(params.disable_users_from_inactivity_period_days)) {
|
|
765
|
+
throw new errors.InvalidParameterError(`Bad parameter: disable_users_from_inactivity_period_days must be of type Int, received ${getType(params.disable_users_from_inactivity_period_days)}`)
|
|
764
766
|
}
|
|
765
767
|
|
|
766
|
-
if (params
|
|
767
|
-
throw new errors.InvalidParameterError(`Bad parameter: sftp_host_key_type must be of type String, received ${getType(params
|
|
768
|
+
if (params.sftp_host_key_type && !isString(params.sftp_host_key_type)) {
|
|
769
|
+
throw new errors.InvalidParameterError(`Bad parameter: sftp_host_key_type must be of type String, received ${getType(params.sftp_host_key_type)}`)
|
|
768
770
|
}
|
|
769
771
|
|
|
770
|
-
if (params
|
|
771
|
-
throw new errors.InvalidParameterError(`Bad parameter: active_sftp_host_key_id must be of type Int, received ${getType(params
|
|
772
|
+
if (params.active_sftp_host_key_id && !isInt(params.active_sftp_host_key_id)) {
|
|
773
|
+
throw new errors.InvalidParameterError(`Bad parameter: active_sftp_host_key_id must be of type Int, received ${getType(params.active_sftp_host_key_id)}`)
|
|
772
774
|
}
|
|
773
775
|
|
|
774
|
-
if (params
|
|
775
|
-
throw new errors.InvalidParameterError(`Bad parameter: bundle_recipient_blacklist_domains must be of type Array, received ${getType(params
|
|
776
|
+
if (params.bundle_recipient_blacklist_domains && !isArray(params.bundle_recipient_blacklist_domains)) {
|
|
777
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_recipient_blacklist_domains must be of type Array, received ${getType(params.bundle_recipient_blacklist_domains)}`)
|
|
776
778
|
}
|
|
777
779
|
|
|
778
|
-
if (params
|
|
779
|
-
throw new errors.InvalidParameterError(`Bad parameter: require_2fa_user_type must be of type String, received ${getType(params
|
|
780
|
+
if (params.require_2fa_user_type && !isString(params.require_2fa_user_type)) {
|
|
781
|
+
throw new errors.InvalidParameterError(`Bad parameter: require_2fa_user_type must be of type String, received ${getType(params.require_2fa_user_type)}`)
|
|
780
782
|
}
|
|
781
783
|
|
|
782
|
-
if (params
|
|
783
|
-
throw new errors.InvalidParameterError(`Bad parameter: color2_top must be of type String, received ${getType(params
|
|
784
|
+
if (params.color2_top && !isString(params.color2_top)) {
|
|
785
|
+
throw new errors.InvalidParameterError(`Bad parameter: color2_top must be of type String, received ${getType(params.color2_top)}`)
|
|
784
786
|
}
|
|
785
787
|
|
|
786
|
-
if (params
|
|
787
|
-
throw new errors.InvalidParameterError(`Bad parameter: color2_left must be of type String, received ${getType(params
|
|
788
|
+
if (params.color2_left && !isString(params.color2_left)) {
|
|
789
|
+
throw new errors.InvalidParameterError(`Bad parameter: color2_left must be of type String, received ${getType(params.color2_left)}`)
|
|
788
790
|
}
|
|
789
791
|
|
|
790
|
-
if (params
|
|
791
|
-
throw new errors.InvalidParameterError(`Bad parameter: color2_link must be of type String, received ${getType(params
|
|
792
|
+
if (params.color2_link && !isString(params.color2_link)) {
|
|
793
|
+
throw new errors.InvalidParameterError(`Bad parameter: color2_link must be of type String, received ${getType(params.color2_link)}`)
|
|
792
794
|
}
|
|
793
795
|
|
|
794
|
-
if (params
|
|
795
|
-
throw new errors.InvalidParameterError(`Bad parameter: color2_text must be of type String, received ${getType(params
|
|
796
|
+
if (params.color2_text && !isString(params.color2_text)) {
|
|
797
|
+
throw new errors.InvalidParameterError(`Bad parameter: color2_text must be of type String, received ${getType(params.color2_text)}`)
|
|
796
798
|
}
|
|
797
799
|
|
|
798
|
-
if (params
|
|
799
|
-
throw new errors.InvalidParameterError(`Bad parameter: color2_top_text must be of type String, received ${getType(params
|
|
800
|
+
if (params.color2_top_text && !isString(params.color2_top_text)) {
|
|
801
|
+
throw new errors.InvalidParameterError(`Bad parameter: color2_top_text must be of type String, received ${getType(params.color2_top_text)}`)
|
|
800
802
|
}
|
|
801
803
|
|
|
802
|
-
if (params
|
|
803
|
-
throw new errors.InvalidParameterError(`Bad parameter: site_header must be of type String, received ${getType(params
|
|
804
|
+
if (params.site_header && !isString(params.site_header)) {
|
|
805
|
+
throw new errors.InvalidParameterError(`Bad parameter: site_header must be of type String, received ${getType(params.site_header)}`)
|
|
804
806
|
}
|
|
805
807
|
|
|
806
|
-
if (params
|
|
807
|
-
throw new errors.InvalidParameterError(`Bad parameter: site_footer must be of type String, received ${getType(params
|
|
808
|
+
if (params.site_footer && !isString(params.site_footer)) {
|
|
809
|
+
throw new errors.InvalidParameterError(`Bad parameter: site_footer must be of type String, received ${getType(params.site_footer)}`)
|
|
808
810
|
}
|
|
809
811
|
|
|
810
|
-
if (params
|
|
811
|
-
throw new errors.InvalidParameterError(`Bad parameter: login_help_text must be of type String, received ${getType(params
|
|
812
|
+
if (params.login_help_text && !isString(params.login_help_text)) {
|
|
813
|
+
throw new errors.InvalidParameterError(`Bad parameter: login_help_text must be of type String, received ${getType(params.login_help_text)}`)
|
|
812
814
|
}
|
|
813
815
|
|
|
814
|
-
if (params
|
|
815
|
-
throw new errors.InvalidParameterError(`Bad parameter: smtp_address must be of type String, received ${getType(params
|
|
816
|
+
if (params.smtp_address && !isString(params.smtp_address)) {
|
|
817
|
+
throw new errors.InvalidParameterError(`Bad parameter: smtp_address must be of type String, received ${getType(params.smtp_address)}`)
|
|
816
818
|
}
|
|
817
819
|
|
|
818
|
-
if (params
|
|
819
|
-
throw new errors.InvalidParameterError(`Bad parameter: smtp_authentication must be of type String, received ${getType(params
|
|
820
|
+
if (params.smtp_authentication && !isString(params.smtp_authentication)) {
|
|
821
|
+
throw new errors.InvalidParameterError(`Bad parameter: smtp_authentication must be of type String, received ${getType(params.smtp_authentication)}`)
|
|
820
822
|
}
|
|
821
823
|
|
|
822
|
-
if (params
|
|
823
|
-
throw new errors.InvalidParameterError(`Bad parameter: smtp_from must be of type String, received ${getType(params
|
|
824
|
+
if (params.smtp_from && !isString(params.smtp_from)) {
|
|
825
|
+
throw new errors.InvalidParameterError(`Bad parameter: smtp_from must be of type String, received ${getType(params.smtp_from)}`)
|
|
824
826
|
}
|
|
825
827
|
|
|
826
|
-
if (params
|
|
827
|
-
throw new errors.InvalidParameterError(`Bad parameter: smtp_username must be of type String, received ${getType(params
|
|
828
|
+
if (params.smtp_username && !isString(params.smtp_username)) {
|
|
829
|
+
throw new errors.InvalidParameterError(`Bad parameter: smtp_username must be of type String, received ${getType(params.smtp_username)}`)
|
|
828
830
|
}
|
|
829
831
|
|
|
830
|
-
if (params
|
|
831
|
-
throw new errors.InvalidParameterError(`Bad parameter: smtp_port must be of type Int, received ${getType(params
|
|
832
|
+
if (params.smtp_port && !isInt(params.smtp_port)) {
|
|
833
|
+
throw new errors.InvalidParameterError(`Bad parameter: smtp_port must be of type Int, received ${getType(params.smtp_port)}`)
|
|
832
834
|
}
|
|
833
835
|
|
|
834
|
-
if (params
|
|
835
|
-
throw new errors.InvalidParameterError(`Bad parameter: ldap_type must be of type String, received ${getType(params
|
|
836
|
+
if (params.ldap_type && !isString(params.ldap_type)) {
|
|
837
|
+
throw new errors.InvalidParameterError(`Bad parameter: ldap_type must be of type String, received ${getType(params.ldap_type)}`)
|
|
836
838
|
}
|
|
837
839
|
|
|
838
|
-
if (params
|
|
839
|
-
throw new errors.InvalidParameterError(`Bad parameter: ldap_host must be of type String, received ${getType(params
|
|
840
|
+
if (params.ldap_host && !isString(params.ldap_host)) {
|
|
841
|
+
throw new errors.InvalidParameterError(`Bad parameter: ldap_host must be of type String, received ${getType(params.ldap_host)}`)
|
|
840
842
|
}
|
|
841
843
|
|
|
842
|
-
if (params
|
|
843
|
-
throw new errors.InvalidParameterError(`Bad parameter: ldap_host_2 must be of type String, received ${getType(params
|
|
844
|
+
if (params.ldap_host_2 && !isString(params.ldap_host_2)) {
|
|
845
|
+
throw new errors.InvalidParameterError(`Bad parameter: ldap_host_2 must be of type String, received ${getType(params.ldap_host_2)}`)
|
|
844
846
|
}
|
|
845
847
|
|
|
846
|
-
if (params
|
|
847
|
-
throw new errors.InvalidParameterError(`Bad parameter: ldap_host_3 must be of type String, received ${getType(params
|
|
848
|
+
if (params.ldap_host_3 && !isString(params.ldap_host_3)) {
|
|
849
|
+
throw new errors.InvalidParameterError(`Bad parameter: ldap_host_3 must be of type String, received ${getType(params.ldap_host_3)}`)
|
|
848
850
|
}
|
|
849
851
|
|
|
850
|
-
if (params
|
|
851
|
-
throw new errors.InvalidParameterError(`Bad parameter: ldap_port must be of type Int, received ${getType(params
|
|
852
|
+
if (params.ldap_port && !isInt(params.ldap_port)) {
|
|
853
|
+
throw new errors.InvalidParameterError(`Bad parameter: ldap_port must be of type Int, received ${getType(params.ldap_port)}`)
|
|
852
854
|
}
|
|
853
855
|
|
|
854
|
-
if (params
|
|
855
|
-
throw new errors.InvalidParameterError(`Bad parameter: ldap_username must be of type String, received ${getType(params
|
|
856
|
+
if (params.ldap_username && !isString(params.ldap_username)) {
|
|
857
|
+
throw new errors.InvalidParameterError(`Bad parameter: ldap_username must be of type String, received ${getType(params.ldap_username)}`)
|
|
856
858
|
}
|
|
857
859
|
|
|
858
|
-
if (params
|
|
859
|
-
throw new errors.InvalidParameterError(`Bad parameter: ldap_username_field must be of type String, received ${getType(params
|
|
860
|
+
if (params.ldap_username_field && !isString(params.ldap_username_field)) {
|
|
861
|
+
throw new errors.InvalidParameterError(`Bad parameter: ldap_username_field must be of type String, received ${getType(params.ldap_username_field)}`)
|
|
860
862
|
}
|
|
861
863
|
|
|
862
|
-
if (params
|
|
863
|
-
throw new errors.InvalidParameterError(`Bad parameter: ldap_domain must be of type String, received ${getType(params
|
|
864
|
+
if (params.ldap_domain && !isString(params.ldap_domain)) {
|
|
865
|
+
throw new errors.InvalidParameterError(`Bad parameter: ldap_domain must be of type String, received ${getType(params.ldap_domain)}`)
|
|
864
866
|
}
|
|
865
867
|
|
|
866
|
-
if (params
|
|
867
|
-
throw new errors.InvalidParameterError(`Bad parameter: ldap_user_action must be of type String, received ${getType(params
|
|
868
|
+
if (params.ldap_user_action && !isString(params.ldap_user_action)) {
|
|
869
|
+
throw new errors.InvalidParameterError(`Bad parameter: ldap_user_action must be of type String, received ${getType(params.ldap_user_action)}`)
|
|
868
870
|
}
|
|
869
871
|
|
|
870
|
-
if (params
|
|
871
|
-
throw new errors.InvalidParameterError(`Bad parameter: ldap_group_action must be of type String, received ${getType(params
|
|
872
|
+
if (params.ldap_group_action && !isString(params.ldap_group_action)) {
|
|
873
|
+
throw new errors.InvalidParameterError(`Bad parameter: ldap_group_action must be of type String, received ${getType(params.ldap_group_action)}`)
|
|
872
874
|
}
|
|
873
875
|
|
|
874
|
-
if (params
|
|
875
|
-
throw new errors.InvalidParameterError(`Bad parameter: ldap_user_include_groups must be of type String, received ${getType(params
|
|
876
|
+
if (params.ldap_user_include_groups && !isString(params.ldap_user_include_groups)) {
|
|
877
|
+
throw new errors.InvalidParameterError(`Bad parameter: ldap_user_include_groups must be of type String, received ${getType(params.ldap_user_include_groups)}`)
|
|
876
878
|
}
|
|
877
879
|
|
|
878
|
-
if (params
|
|
879
|
-
throw new errors.InvalidParameterError(`Bad parameter: ldap_group_exclusion must be of type String, received ${getType(params
|
|
880
|
+
if (params.ldap_group_exclusion && !isString(params.ldap_group_exclusion)) {
|
|
881
|
+
throw new errors.InvalidParameterError(`Bad parameter: ldap_group_exclusion must be of type String, received ${getType(params.ldap_group_exclusion)}`)
|
|
880
882
|
}
|
|
881
883
|
|
|
882
|
-
if (params
|
|
883
|
-
throw new errors.InvalidParameterError(`Bad parameter: ldap_group_inclusion must be of type String, received ${getType(params
|
|
884
|
+
if (params.ldap_group_inclusion && !isString(params.ldap_group_inclusion)) {
|
|
885
|
+
throw new errors.InvalidParameterError(`Bad parameter: ldap_group_inclusion must be of type String, received ${getType(params.ldap_group_inclusion)}`)
|
|
884
886
|
}
|
|
885
887
|
|
|
886
|
-
if (params
|
|
887
|
-
throw new errors.InvalidParameterError(`Bad parameter: ldap_base_dn must be of type String, received ${getType(params
|
|
888
|
+
if (params.ldap_base_dn && !isString(params.ldap_base_dn)) {
|
|
889
|
+
throw new errors.InvalidParameterError(`Bad parameter: ldap_base_dn must be of type String, received ${getType(params.ldap_base_dn)}`)
|
|
888
890
|
}
|
|
889
891
|
|
|
890
|
-
if (params
|
|
891
|
-
throw new errors.InvalidParameterError(`Bad parameter: ldap_password_change must be of type String, received ${getType(params
|
|
892
|
+
if (params.ldap_password_change && !isString(params.ldap_password_change)) {
|
|
893
|
+
throw new errors.InvalidParameterError(`Bad parameter: ldap_password_change must be of type String, received ${getType(params.ldap_password_change)}`)
|
|
892
894
|
}
|
|
893
895
|
|
|
894
|
-
if (params
|
|
895
|
-
throw new errors.InvalidParameterError(`Bad parameter: ldap_password_change_confirmation must be of type String, received ${getType(params
|
|
896
|
+
if (params.ldap_password_change_confirmation && !isString(params.ldap_password_change_confirmation)) {
|
|
897
|
+
throw new errors.InvalidParameterError(`Bad parameter: ldap_password_change_confirmation must be of type String, received ${getType(params.ldap_password_change_confirmation)}`)
|
|
896
898
|
}
|
|
897
899
|
|
|
898
|
-
if (params
|
|
899
|
-
throw new errors.InvalidParameterError(`Bad parameter: smtp_password must be of type String, received ${getType(params
|
|
900
|
+
if (params.smtp_password && !isString(params.smtp_password)) {
|
|
901
|
+
throw new errors.InvalidParameterError(`Bad parameter: smtp_password must be of type String, received ${getType(params.smtp_password)}`)
|
|
900
902
|
}
|
|
901
903
|
|
|
902
|
-
if (params
|
|
903
|
-
throw new errors.InvalidParameterError(`Bad parameter: session_expiry_minutes must be of type Int, received ${getType(params
|
|
904
|
+
if (params.session_expiry_minutes && !isInt(params.session_expiry_minutes)) {
|
|
905
|
+
throw new errors.InvalidParameterError(`Bad parameter: session_expiry_minutes must be of type Int, received ${getType(params.session_expiry_minutes)}`)
|
|
904
906
|
}
|
|
905
907
|
|
|
906
|
-
const response = await Api.sendRequest(
|
|
908
|
+
const response = await Api.sendRequest('/site', 'PATCH', params, options)
|
|
907
909
|
|
|
908
|
-
|
|
909
910
|
return new Site(response?.data, options)
|
|
910
911
|
}
|
|
911
912
|
}
|