files.com 1.2.321 → 1.2.323
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/_VERSION +1 -1
- package/docs/models/GpgKey.md +8 -1
- package/docs/models/Partner.md +13 -6
- package/docs/models/Permission.md +2 -0
- package/docs/models/PublicKey.md +1 -0
- package/docs/models/ScimLog.md +13 -0
- package/docs/models/Site.md +1 -0
- package/docs/models/Sync.md +30 -28
- package/docs/models/SyncRun.md +28 -26
- package/docs/models/User.md +8 -1
- package/docs/models/UserLifecycleRule.md +36 -21
- package/lib/Files.js +1 -1
- package/lib/models/GpgKey.js +55 -34
- package/lib/models/Partner.js +34 -13
- package/lib/models/Permission.js +7 -0
- package/lib/models/PublicKey.js +1 -0
- package/lib/models/ScimLog.js +52 -0
- package/lib/models/SyncRun.js +48 -44
- package/lib/models/User.js +49 -28
- package/lib/models/UserLifecycleRule.js +87 -44
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/GpgKey.js +18 -1
- package/src/models/Partner.js +19 -2
- package/src/models/Permission.js +7 -0
- package/src/models/PublicKey.js +1 -0
- package/src/models/ScimLog.js +25 -0
- package/src/models/SyncRun.js +34 -31
- package/src/models/User.js +18 -1
- package/src/models/UserLifecycleRule.js +64 -29
package/src/models/SyncRun.js
CHANGED
|
@@ -31,26 +31,11 @@ class SyncRun {
|
|
|
31
31
|
// int64 # SyncRun ID
|
|
32
32
|
getId = () => this.attributes.id
|
|
33
33
|
|
|
34
|
-
// int64 # ID of the Sync this run belongs to
|
|
35
|
-
getSyncId = () => this.attributes.sync_id
|
|
36
|
-
|
|
37
|
-
// int64 # Site ID
|
|
38
|
-
getSiteId = () => this.attributes.site_id
|
|
39
|
-
|
|
40
|
-
// string # Status of the sync run (success, failure, partial_failure, in_progress, skipped)
|
|
41
|
-
getStatus = () => this.attributes.status
|
|
42
|
-
|
|
43
|
-
// string # Source remote server type, if any
|
|
44
|
-
getSrcRemoteServerType = () => this.attributes.src_remote_server_type
|
|
45
|
-
|
|
46
|
-
// string # Destination remote server type, if any
|
|
47
|
-
getDestRemoteServerType = () => this.attributes.dest_remote_server_type
|
|
48
|
-
|
|
49
34
|
// string # Log or summary body for this run
|
|
50
35
|
getBody = () => this.attributes.body
|
|
51
36
|
|
|
52
|
-
//
|
|
53
|
-
|
|
37
|
+
// int64 # Total bytes synced in this run
|
|
38
|
+
getBytesSynced = () => this.attributes.bytes_synced
|
|
54
39
|
|
|
55
40
|
// int64 # Number of files compared
|
|
56
41
|
getComparedFiles = () => this.attributes.compared_files
|
|
@@ -58,32 +43,50 @@ class SyncRun {
|
|
|
58
43
|
// int64 # Number of folders compared
|
|
59
44
|
getComparedFolders = () => this.attributes.compared_folders
|
|
60
45
|
|
|
46
|
+
// date-time # When this run was completed
|
|
47
|
+
getCompletedAt = () => this.attributes.completed_at
|
|
48
|
+
|
|
49
|
+
// date-time # When this run was created
|
|
50
|
+
getCreatedAt = () => this.attributes.created_at
|
|
51
|
+
|
|
52
|
+
// string # Destination remote server type, if any
|
|
53
|
+
getDestRemoteServerType = () => this.attributes.dest_remote_server_type
|
|
54
|
+
|
|
55
|
+
// boolean # Whether this run was a dry run (no actual changes made)
|
|
56
|
+
getDryRun = () => this.attributes.dry_run
|
|
57
|
+
|
|
61
58
|
// int64 # Number of files that errored
|
|
62
59
|
getErroredFiles = () => this.attributes.errored_files
|
|
63
60
|
|
|
64
|
-
// int64 #
|
|
65
|
-
|
|
61
|
+
// int64 # Estimated bytes count for this run
|
|
62
|
+
getEstimatedBytesCount = () => this.attributes.estimated_bytes_count
|
|
66
63
|
|
|
67
|
-
//
|
|
68
|
-
|
|
64
|
+
// array(string) # Array of errors encountered during the run
|
|
65
|
+
getEventErrors = () => this.attributes.event_errors
|
|
69
66
|
|
|
70
67
|
// string # Link to external log file.
|
|
71
68
|
getLogUrl = () => this.attributes.log_url
|
|
72
69
|
|
|
73
|
-
//
|
|
74
|
-
|
|
70
|
+
// double # Total runtime in seconds
|
|
71
|
+
getRuntime = () => this.attributes.runtime
|
|
75
72
|
|
|
76
|
-
//
|
|
77
|
-
|
|
73
|
+
// int64 # Site ID
|
|
74
|
+
getSiteId = () => this.attributes.site_id
|
|
78
75
|
|
|
79
|
-
//
|
|
80
|
-
|
|
76
|
+
// string # Source remote server type, if any
|
|
77
|
+
getSrcRemoteServerType = () => this.attributes.src_remote_server_type
|
|
81
78
|
|
|
82
|
-
//
|
|
83
|
-
|
|
79
|
+
// string # Status of the sync run (success, failure, partial_failure, in_progress, skipped)
|
|
80
|
+
getStatus = () => this.attributes.status
|
|
84
81
|
|
|
85
|
-
//
|
|
86
|
-
|
|
82
|
+
// int64 # Number of files successfully synced
|
|
83
|
+
getSuccessfulFiles = () => this.attributes.successful_files
|
|
84
|
+
|
|
85
|
+
// int64 # ID of the Sync this run belongs to
|
|
86
|
+
getSyncId = () => this.attributes.sync_id
|
|
87
|
+
|
|
88
|
+
// string # Name of the Sync this run belongs to
|
|
89
|
+
getSyncName = () => this.attributes.sync_name
|
|
87
90
|
|
|
88
91
|
// date-time # When this run was last updated
|
|
89
92
|
getUpdatedAt = () => this.attributes.updated_at
|
package/src/models/User.js
CHANGED
|
@@ -458,6 +458,13 @@ class User {
|
|
|
458
458
|
this.attributes.externally_managed = value
|
|
459
459
|
}
|
|
460
460
|
|
|
461
|
+
// string # Comma-separated list of Tags for this user. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
|
|
462
|
+
getTags = () => this.attributes.tags
|
|
463
|
+
|
|
464
|
+
setTags = value => {
|
|
465
|
+
this.attributes.tags = value
|
|
466
|
+
}
|
|
467
|
+
|
|
461
468
|
// string # User time zone
|
|
462
469
|
getTimeZone = () => this.attributes.time_zone
|
|
463
470
|
|
|
@@ -709,6 +716,7 @@ class User {
|
|
|
709
716
|
// sso_strategy_id - int64 - SSO (Single Sign On) strategy ID for the user, if applicable.
|
|
710
717
|
// subscribe_to_newsletter - boolean - Is the user subscribed to the newsletter?
|
|
711
718
|
// require_2fa - string - 2FA required setting
|
|
719
|
+
// tags - string - Comma-separated list of Tags for this user. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
|
|
712
720
|
// time_zone - string - User time zone
|
|
713
721
|
// user_root - string - Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set). Note that this is not used for API, Desktop, or Web interface.
|
|
714
722
|
// user_home - string - Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
|
|
@@ -828,6 +836,10 @@ class User {
|
|
|
828
836
|
throw new errors.InvalidParameterError(`Bad parameter: require_2fa must be of type String, received ${getType(params.require_2fa)}`)
|
|
829
837
|
}
|
|
830
838
|
|
|
839
|
+
if (params.tags && !isString(params.tags)) {
|
|
840
|
+
throw new errors.InvalidParameterError(`Bad parameter: tags must be of type String, received ${getType(params.tags)}`)
|
|
841
|
+
}
|
|
842
|
+
|
|
831
843
|
if (params.time_zone && !isString(params.time_zone)) {
|
|
832
844
|
throw new errors.InvalidParameterError(`Bad parameter: time_zone must be of type String, received ${getType(params.time_zone)}`)
|
|
833
845
|
}
|
|
@@ -907,7 +919,7 @@ class User {
|
|
|
907
919
|
// cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
|
|
908
920
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
909
921
|
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `authenticate_until`, `email`, `last_desktop_login_at`, `last_login_at`, `name`, `company`, `password_validity_days`, `ssl_required`, `username`, `site_admin` or `disabled`.
|
|
910
|
-
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `username`, `name`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until`, `not_site_admin` or `
|
|
922
|
+
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `username`, `name`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until`, `not_site_admin`, `disabled` or `partner_id`. Valid field combinations are `[ site_admin, username ]`, `[ not_site_admin, username ]` or `[ company, name ]`.
|
|
911
923
|
// filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
|
|
912
924
|
// filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
|
|
913
925
|
// filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `username`, `name`, `email` or `company`. Valid field combinations are `[ company, name ]`.
|
|
@@ -1013,6 +1025,7 @@ class User {
|
|
|
1013
1025
|
// sso_strategy_id - int64 - SSO (Single Sign On) strategy ID for the user, if applicable.
|
|
1014
1026
|
// subscribe_to_newsletter - boolean - Is the user subscribed to the newsletter?
|
|
1015
1027
|
// require_2fa - string - 2FA required setting
|
|
1028
|
+
// tags - string - Comma-separated list of Tags for this user. Tags are used for other features, such as UserLifecycleRules, which can target specific tags. Tags must only contain lowercase letters, numbers, and hyphens.
|
|
1016
1029
|
// time_zone - string - User time zone
|
|
1017
1030
|
// user_root - string - Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set). Note that this is not used for API, Desktop, or Web interface.
|
|
1018
1031
|
// user_home - string - Home folder for FTP/SFTP. Note that this is not used for API, Desktop, or Web interface.
|
|
@@ -1122,6 +1135,10 @@ class User {
|
|
|
1122
1135
|
throw new errors.InvalidParameterError(`Bad parameter: require_2fa must be of type String, received ${getType(params.require_2fa)}`)
|
|
1123
1136
|
}
|
|
1124
1137
|
|
|
1138
|
+
if (params.tags && !isString(params.tags)) {
|
|
1139
|
+
throw new errors.InvalidParameterError(`Bad parameter: tags must be of type String, received ${getType(params.tags)}`)
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1125
1142
|
if (params.time_zone && !isString(params.time_zone)) {
|
|
1126
1143
|
throw new errors.InvalidParameterError(`Bad parameter: time_zone must be of type String, received ${getType(params.time_zone)}`)
|
|
1127
1144
|
}
|
|
@@ -35,7 +35,7 @@ class UserLifecycleRule {
|
|
|
35
35
|
this.attributes.id = value
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
// string # User authentication method for the rule
|
|
38
|
+
// string # User authentication method for which the rule will apply.
|
|
39
39
|
getAuthenticationMethod = () => this.attributes.authentication_method
|
|
40
40
|
|
|
41
41
|
setAuthenticationMethod = value => {
|
|
@@ -49,6 +49,13 @@ class UserLifecycleRule {
|
|
|
49
49
|
this.attributes.group_ids = value
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
// string # Action to take on inactive users (disable or delete)
|
|
53
|
+
getAction = () => this.attributes.action
|
|
54
|
+
|
|
55
|
+
setAction = value => {
|
|
56
|
+
this.attributes.action = value
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
// int64 # Number of days of inactivity before the rule applies
|
|
53
60
|
getInactivityDays = () => this.attributes.inactivity_days
|
|
54
61
|
|
|
@@ -56,34 +63,20 @@ class UserLifecycleRule {
|
|
|
56
63
|
this.attributes.inactivity_days = value
|
|
57
64
|
}
|
|
58
65
|
|
|
59
|
-
// boolean #
|
|
66
|
+
// boolean # If true, the rule will apply to folder admins.
|
|
60
67
|
getIncludeFolderAdmins = () => this.attributes.include_folder_admins
|
|
61
68
|
|
|
62
69
|
setIncludeFolderAdmins = value => {
|
|
63
70
|
this.attributes.include_folder_admins = value
|
|
64
71
|
}
|
|
65
72
|
|
|
66
|
-
// boolean #
|
|
73
|
+
// boolean # If true, the rule will apply to site admins.
|
|
67
74
|
getIncludeSiteAdmins = () => this.attributes.include_site_admins
|
|
68
75
|
|
|
69
76
|
setIncludeSiteAdmins = value => {
|
|
70
77
|
this.attributes.include_site_admins = value
|
|
71
78
|
}
|
|
72
79
|
|
|
73
|
-
// string # Action to take on inactive users (disable or delete)
|
|
74
|
-
getAction = () => this.attributes.action
|
|
75
|
-
|
|
76
|
-
setAction = value => {
|
|
77
|
-
this.attributes.action = value
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// string # State of the users to apply the rule to (inactive or disabled)
|
|
81
|
-
getUserState = () => this.attributes.user_state
|
|
82
|
-
|
|
83
|
-
setUserState = value => {
|
|
84
|
-
this.attributes.user_state = value
|
|
85
|
-
}
|
|
86
|
-
|
|
87
80
|
// string # User Lifecycle Rule name
|
|
88
81
|
getName = () => this.attributes.name
|
|
89
82
|
|
|
@@ -91,6 +84,13 @@ class UserLifecycleRule {
|
|
|
91
84
|
this.attributes.name = value
|
|
92
85
|
}
|
|
93
86
|
|
|
87
|
+
// string # If provided, only users belonging to Partners with this tag at the Partner level will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
|
|
88
|
+
getPartnerTag = () => this.attributes.partner_tag
|
|
89
|
+
|
|
90
|
+
setPartnerTag = value => {
|
|
91
|
+
this.attributes.partner_tag = value
|
|
92
|
+
}
|
|
93
|
+
|
|
94
94
|
// int64 # Site ID
|
|
95
95
|
getSiteId = () => this.attributes.site_id
|
|
96
96
|
|
|
@@ -98,15 +98,31 @@ class UserLifecycleRule {
|
|
|
98
98
|
this.attributes.site_id = value
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
// string # State of the users to apply the rule to (inactive or disabled)
|
|
102
|
+
getUserState = () => this.attributes.user_state
|
|
103
|
+
|
|
104
|
+
setUserState = value => {
|
|
105
|
+
this.attributes.user_state = value
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// string # If provided, only users with this tag will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
|
|
109
|
+
getUserTag = () => this.attributes.user_tag
|
|
110
|
+
|
|
111
|
+
setUserTag = value => {
|
|
112
|
+
this.attributes.user_tag = value
|
|
113
|
+
}
|
|
114
|
+
|
|
101
115
|
// Parameters:
|
|
102
116
|
// action - string - Action to take on inactive users (disable or delete)
|
|
103
|
-
// authentication_method - string - User authentication method for the rule
|
|
117
|
+
// authentication_method - string - User authentication method for which the rule will apply.
|
|
104
118
|
// group_ids - array(int64) - Array of Group IDs to which the rule applies. If empty or not set, the rule applies to all users.
|
|
105
119
|
// inactivity_days - int64 - Number of days of inactivity before the rule applies
|
|
106
|
-
// include_site_admins - boolean -
|
|
107
|
-
// include_folder_admins - boolean -
|
|
108
|
-
// user_state - string - State of the users to apply the rule to (inactive or disabled)
|
|
120
|
+
// include_site_admins - boolean - If true, the rule will apply to site admins.
|
|
121
|
+
// include_folder_admins - boolean - If true, the rule will apply to folder admins.
|
|
109
122
|
// name - string - User Lifecycle Rule name
|
|
123
|
+
// partner_tag - string - If provided, only users belonging to Partners with this tag at the Partner level will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
|
|
124
|
+
// user_state - string - State of the users to apply the rule to (inactive or disabled)
|
|
125
|
+
// user_tag - string - If provided, only users with this tag will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
|
|
110
126
|
update = async (params = {}) => {
|
|
111
127
|
if (!this.attributes.id) {
|
|
112
128
|
throw new errors.EmptyPropertyError('Current object has no id')
|
|
@@ -137,12 +153,20 @@ class UserLifecycleRule {
|
|
|
137
153
|
throw new errors.InvalidParameterError(`Bad parameter: inactivity_days must be of type Int, received ${getType(params.inactivity_days)}`)
|
|
138
154
|
}
|
|
139
155
|
|
|
156
|
+
if (params.name && !isString(params.name)) {
|
|
157
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params.name)}`)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (params.partner_tag && !isString(params.partner_tag)) {
|
|
161
|
+
throw new errors.InvalidParameterError(`Bad parameter: partner_tag must be of type String, received ${getType(params.partner_tag)}`)
|
|
162
|
+
}
|
|
163
|
+
|
|
140
164
|
if (params.user_state && !isString(params.user_state)) {
|
|
141
165
|
throw new errors.InvalidParameterError(`Bad parameter: user_state must be of type String, received ${getType(params.user_state)}`)
|
|
142
166
|
}
|
|
143
167
|
|
|
144
|
-
if (params.
|
|
145
|
-
throw new errors.InvalidParameterError(`Bad parameter:
|
|
168
|
+
if (params.user_tag && !isString(params.user_tag)) {
|
|
169
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_tag must be of type String, received ${getType(params.user_tag)}`)
|
|
146
170
|
}
|
|
147
171
|
|
|
148
172
|
if (!params.id) {
|
|
@@ -201,6 +225,7 @@ class UserLifecycleRule {
|
|
|
201
225
|
// Parameters:
|
|
202
226
|
// cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
|
|
203
227
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
228
|
+
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`.
|
|
204
229
|
static list = async (params = {}, options = {}) => {
|
|
205
230
|
if (params.cursor && !isString(params.cursor)) {
|
|
206
231
|
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
|
|
@@ -245,13 +270,15 @@ class UserLifecycleRule {
|
|
|
245
270
|
|
|
246
271
|
// Parameters:
|
|
247
272
|
// action - string - Action to take on inactive users (disable or delete)
|
|
248
|
-
// authentication_method - string - User authentication method for the rule
|
|
273
|
+
// authentication_method - string - User authentication method for which the rule will apply.
|
|
249
274
|
// group_ids - array(int64) - Array of Group IDs to which the rule applies. If empty or not set, the rule applies to all users.
|
|
250
275
|
// inactivity_days - int64 - Number of days of inactivity before the rule applies
|
|
251
|
-
// include_site_admins - boolean -
|
|
252
|
-
// include_folder_admins - boolean -
|
|
253
|
-
// user_state - string - State of the users to apply the rule to (inactive or disabled)
|
|
276
|
+
// include_site_admins - boolean - If true, the rule will apply to site admins.
|
|
277
|
+
// include_folder_admins - boolean - If true, the rule will apply to folder admins.
|
|
254
278
|
// name - string - User Lifecycle Rule name
|
|
279
|
+
// partner_tag - string - If provided, only users belonging to Partners with this tag at the Partner level will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
|
|
280
|
+
// user_state - string - State of the users to apply the rule to (inactive or disabled)
|
|
281
|
+
// user_tag - string - If provided, only users with this tag will be affected by the rule. Tags must only contain lowercase letters, numbers, and hyphens.
|
|
255
282
|
static create = async (params = {}, options = {}) => {
|
|
256
283
|
if (params.action && !isString(params.action)) {
|
|
257
284
|
throw new errors.InvalidParameterError(`Bad parameter: action must be of type String, received ${getType(params.action)}`)
|
|
@@ -269,12 +296,20 @@ class UserLifecycleRule {
|
|
|
269
296
|
throw new errors.InvalidParameterError(`Bad parameter: inactivity_days must be of type Int, received ${getType(params.inactivity_days)}`)
|
|
270
297
|
}
|
|
271
298
|
|
|
299
|
+
if (params.name && !isString(params.name)) {
|
|
300
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params.name)}`)
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (params.partner_tag && !isString(params.partner_tag)) {
|
|
304
|
+
throw new errors.InvalidParameterError(`Bad parameter: partner_tag must be of type String, received ${getType(params.partner_tag)}`)
|
|
305
|
+
}
|
|
306
|
+
|
|
272
307
|
if (params.user_state && !isString(params.user_state)) {
|
|
273
308
|
throw new errors.InvalidParameterError(`Bad parameter: user_state must be of type String, received ${getType(params.user_state)}`)
|
|
274
309
|
}
|
|
275
310
|
|
|
276
|
-
if (params.
|
|
277
|
-
throw new errors.InvalidParameterError(`Bad parameter:
|
|
311
|
+
if (params.user_tag && !isString(params.user_tag)) {
|
|
312
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_tag must be of type String, received ${getType(params.user_tag)}`)
|
|
278
313
|
}
|
|
279
314
|
|
|
280
315
|
const response = await Api.sendRequest('/user_lifecycle_rules', 'POST', params, options)
|