files.com 1.0.147 → 1.0.151

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. package/_VERSION +1 -1
  2. package/lib/Api.js +6 -5
  3. package/lib/Files.js +4 -4
  4. package/lib/Logger.js +4 -3
  5. package/lib/models/AccountLineItem.js +6 -5
  6. package/lib/models/Action.js +6 -5
  7. package/lib/models/ActionNotificationExport.js +6 -5
  8. package/lib/models/ActionNotificationExportResult.js +6 -5
  9. package/lib/models/ActionWebhookFailure.js +6 -5
  10. package/lib/models/ApiKey.js +6 -5
  11. package/lib/models/App.js +6 -5
  12. package/lib/models/As2IncomingMessage.js +160 -0
  13. package/lib/models/As2OutgoingMessage.js +151 -0
  14. package/lib/models/{As2Key.js → As2Partner.js} +109 -91
  15. package/lib/models/As2Station.js +504 -0
  16. package/lib/models/Auto.js +6 -5
  17. package/lib/models/Automation.js +20 -41
  18. package/lib/models/AutomationRun.js +6 -5
  19. package/lib/models/BandwidthSnapshot.js +6 -5
  20. package/lib/models/Behavior.js +6 -5
  21. package/lib/models/Bundle.js +6 -5
  22. package/lib/models/BundleDownload.js +6 -5
  23. package/lib/models/BundleRecipient.js +6 -5
  24. package/lib/models/BundleRegistration.js +6 -5
  25. package/lib/models/Clickwrap.js +6 -5
  26. package/lib/models/DnsRecord.js +6 -5
  27. package/lib/models/Errors.js +6 -5
  28. package/lib/models/ExternalEvent.js +6 -5
  29. package/lib/models/File.js +6 -5
  30. package/lib/models/FileAction.js +6 -5
  31. package/lib/models/FileComment.js +6 -5
  32. package/lib/models/FileCommentReaction.js +6 -5
  33. package/lib/models/FileMigration.js +6 -5
  34. package/lib/models/FileUploadPart.js +6 -5
  35. package/lib/models/Folder.js +6 -5
  36. package/lib/models/FormField.js +6 -5
  37. package/lib/models/FormFieldSet.js +6 -5
  38. package/lib/models/Group.js +6 -5
  39. package/lib/models/GroupUser.js +6 -5
  40. package/lib/models/History.js +6 -5
  41. package/lib/models/HistoryExport.js +6 -5
  42. package/lib/models/HistoryExportResult.js +6 -5
  43. package/lib/models/Image.js +6 -5
  44. package/lib/models/InboxRecipient.js +6 -5
  45. package/lib/models/InboxRegistration.js +6 -5
  46. package/lib/models/InboxUpload.js +6 -5
  47. package/lib/models/Invoice.js +6 -5
  48. package/lib/models/InvoiceLineItem.js +6 -5
  49. package/lib/models/IpAddress.js +6 -5
  50. package/lib/models/Lock.js +6 -5
  51. package/lib/models/Message.js +6 -5
  52. package/lib/models/MessageComment.js +6 -5
  53. package/lib/models/MessageCommentReaction.js +6 -5
  54. package/lib/models/MessageReaction.js +6 -5
  55. package/lib/models/Notification.js +6 -5
  56. package/lib/models/Payment.js +6 -5
  57. package/lib/models/PaymentLineItem.js +6 -5
  58. package/lib/models/Permission.js +6 -5
  59. package/lib/models/Preview.js +6 -5
  60. package/lib/models/Priority.js +6 -5
  61. package/lib/models/Project.js +6 -5
  62. package/lib/models/PublicIpAddress.js +6 -5
  63. package/lib/models/PublicKey.js +6 -5
  64. package/lib/models/RemoteServer.js +6 -5
  65. package/lib/models/Request.js +6 -5
  66. package/lib/models/Session.js +6 -5
  67. package/lib/models/SettingsChange.js +6 -5
  68. package/lib/models/Site.js +6 -5
  69. package/lib/models/SsoStrategy.js +6 -5
  70. package/lib/models/Status.js +6 -5
  71. package/lib/models/Style.js +6 -5
  72. package/lib/models/SyncJob.js +6 -5
  73. package/lib/models/UsageDailySnapshot.js +6 -5
  74. package/lib/models/UsageSnapshot.js +6 -5
  75. package/lib/models/User.js +6 -5
  76. package/lib/models/UserCipherUse.js +6 -5
  77. package/lib/models/UserRequest.js +6 -5
  78. package/lib/models/WebhookTest.js +6 -5
  79. package/package.json +1 -1
  80. package/src/models/App.js +6 -6
  81. package/src/models/As2IncomingMessage.js +94 -0
  82. package/src/models/As2OutgoingMessage.js +85 -0
  83. package/src/models/As2Partner.js +233 -0
  84. package/src/models/As2Station.js +264 -0
  85. package/src/models/Automation.js +0 -16
  86. package/src/models/ExternalEvent.js +6 -6
  87. package/src/models/HistoryExport.js +2 -2
  88. package/src/models/HistoryExportResult.js +1 -1
  89. package/src/models/Permission.js +6 -6
  90. package/src/models/UsageDailySnapshot.js +6 -6
  91. package/src/models/User.js +6 -6
  92. package/src/models/As2Key.js +0 -221
@@ -141,13 +141,6 @@ class Automation {
141
141
  this.attributes.trigger_actions = value
142
142
  }
143
143
 
144
- // string # If trigger is `action`, this is the path to watch for the specified trigger actions.
145
- getTriggerActionPath = () => this.attributes.trigger_action_path
146
-
147
- setTriggerActionPath = value => {
148
- this.attributes.trigger_action_path = value
149
- }
150
-
151
144
  // object # A Hash of attributes specific to the automation type.
152
145
  getValue = () => this.attributes.value
153
146
 
@@ -179,7 +172,6 @@ class Automation {
179
172
  // name - string - Name for this automation.
180
173
  // trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
181
174
  // trigger_actions - array(string) - If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
182
- // trigger_action_path - string - If trigger is `action`, this is the path to watch for the specified trigger actions.
183
175
  // value - object - A Hash of attributes specific to the automation type.
184
176
  update = async (params = {}) => {
185
177
  if (!this.attributes.id) {
@@ -236,9 +228,6 @@ class Automation {
236
228
  if (params['trigger_actions'] && !isArray(params['trigger_actions'])) {
237
229
  throw new Error(`Bad parameter: trigger_actions must be of type Array, received ${getType(trigger_actions)}`)
238
230
  }
239
- if (params['trigger_action_path'] && !isString(params['trigger_action_path'])) {
240
- throw new Error(`Bad parameter: trigger_action_path must be of type String, received ${getType(trigger_action_path)}`)
241
- }
242
231
 
243
232
  if (!params['id']) {
244
233
  if (this.attributes.id) {
@@ -370,7 +359,6 @@ class Automation {
370
359
  // name - string - Name for this automation.
371
360
  // trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
372
361
  // trigger_actions - array(string) - If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
373
- // trigger_action_path - string - If trigger is `action`, this is the path to watch for the specified trigger actions.
374
362
  // value - object - A Hash of attributes specific to the automation type.
375
363
  static create = async (params = {}, options = {}) => {
376
364
  if (!params['automation']) {
@@ -433,10 +421,6 @@ class Automation {
433
421
  throw new Error(`Bad parameter: trigger_actions must be of type Array, received ${getType(trigger_actions)}`)
434
422
  }
435
423
 
436
- if (params['trigger_action_path'] && !isString(params['trigger_action_path'])) {
437
- throw new Error(`Bad parameter: trigger_action_path must be of type String, received ${getType(trigger_action_path)}`)
438
- }
439
-
440
424
  const response = await Api.sendRequest(`/automations`, 'POST', params, options)
441
425
 
442
426
  return new Automation(response?.data, options)
@@ -110,12 +110,12 @@ class ExternalEvent {
110
110
  // cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
111
111
  // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
112
112
  // sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `remote_server_type`, `site_id`, `folder_behavior_id`, `event_type`, `created_at` or `status`.
113
- // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type`, `status` or `folder_behavior_id`.
114
- // filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type`, `status` or `folder_behavior_id`.
115
- // filter_gteq - object - If set, return records where the specified field is greater than or equal to the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type`, `status` or `folder_behavior_id`.
116
- // filter_like - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type`, `status` or `folder_behavior_id`.
117
- // filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type`, `status` or `folder_behavior_id`.
118
- // filter_lteq - object - If set, return records where the specified field is less than or equal to the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type`, `status` or `folder_behavior_id`.
113
+ // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type`, `status` or `folder_behavior_id`. Valid field combinations are `[ event_type, status, created_at ]`, `[ event_type, created_at ]` or `[ status, created_at ]`.
114
+ // filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type`, `status` or `folder_behavior_id`. Valid field combinations are `[ event_type, status, created_at ]`, `[ event_type, created_at ]` or `[ status, created_at ]`.
115
+ // filter_gteq - object - If set, return records where the specified field is greater than or equal to the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type`, `status` or `folder_behavior_id`. Valid field combinations are `[ event_type, status, created_at ]`, `[ event_type, created_at ]` or `[ status, created_at ]`.
116
+ // filter_like - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type`, `status` or `folder_behavior_id`. Valid field combinations are `[ event_type, status, created_at ]`, `[ event_type, created_at ]` or `[ status, created_at ]`.
117
+ // filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type`, `status` or `folder_behavior_id`. Valid field combinations are `[ event_type, status, created_at ]`, `[ event_type, created_at ]` or `[ status, created_at ]`.
118
+ // filter_lteq - object - If set, return records where the specified field is less than or equal to the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type`, `status` or `folder_behavior_id`. Valid field combinations are `[ event_type, status, created_at ]`, `[ event_type, created_at ]` or `[ status, created_at ]`.
119
119
  static list = async (params = {}, options = {}) => {
120
120
  if (params['cursor'] && !isString(params['cursor'])) {
121
121
  throw new Error(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
@@ -64,7 +64,7 @@ class HistoryExport {
64
64
  this.attributes.query_action = value
65
65
  }
66
66
 
67
- // string # Filter results by this this interface type. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`, `office`, `mobile`
67
+ // string # Filter results by this this interface type. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`, `office`, `mobile`, `as2`
68
68
  getQueryInterface = () => this.attributes.query_interface
69
69
 
70
70
  setQueryInterface = value => {
@@ -245,7 +245,7 @@ class HistoryExport {
245
245
  // start_at - string - Start date/time of export range.
246
246
  // end_at - string - End date/time of export range.
247
247
  // query_action - string - Filter results by this this action type. Valid values: `create`, `read`, `update`, `destroy`, `move`, `login`, `failedlogin`, `copy`, `user_create`, `user_update`, `user_destroy`, `group_create`, `group_update`, `group_destroy`, `permission_create`, `permission_destroy`, `api_key_create`, `api_key_update`, `api_key_destroy`
248
- // query_interface - string - Filter results by this this interface type. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`, `office`, `mobile`
248
+ // query_interface - string - Filter results by this this interface type. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`, `office`, `mobile`, `as2`
249
249
  // query_user_id - string - Return results that are actions performed by the user indiciated by this User ID
250
250
  // query_file_id - string - Return results that are file actions related to the file indicated by this File ID
251
251
  // query_parent_id - string - Return results that are file actions inside the parent folder specified by this folder ID
@@ -61,7 +61,7 @@ class HistoryExportResult {
61
61
  // string # The type of login failure, if applicable. Valid values: `expired_trial`, `account_overdue`, `locked_out`, `ip_mismatch`, `password_mismatch`, `site_mismatch`, `username_not_found`, `none`, `no_ftp_permission`, `no_web_permission`, `no_directory`, `errno_enoent`, `no_sftp_permission`, `no_dav_permission`, `no_restapi_permission`, `key_mismatch`, `region_mismatch`, `expired_access`, `desktop_ip_mismatch`, `desktop_api_key_not_used_quickly_enough`, `disabled`, `country_mismatch`
62
62
  getFailureType = () => this.attributes.failure_type
63
63
 
64
- // string # Inteface through which the action was taken. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`, `office`, `mobile`
64
+ // string # Inteface through which the action was taken. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`, `office`, `mobile`, `as2`
65
65
  getInterface = () => this.attributes.interface
66
66
 
67
67
  // int64 # ID of the object (such as Users, or API Keys) on which the action was taken
@@ -121,12 +121,12 @@ class Permission {
121
121
  // cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
122
122
  // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
123
123
  // sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `group_id`, `path`, `user_id` or `permission`.
124
- // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `group_id`, `user_id` or `path`.
125
- // filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `group_id`, `user_id` or `path`.
126
- // filter_gteq - object - If set, return records where the specified field is greater than or equal to the supplied value. Valid fields are `group_id`, `user_id` or `path`.
127
- // filter_like - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `group_id`, `user_id` or `path`.
128
- // filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `group_id`, `user_id` or `path`.
129
- // filter_lteq - object - If set, return records where the specified field is less than or equal to the supplied value. Valid fields are `group_id`, `user_id` or `path`.
124
+ // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `group_id`, `user_id` or `path`. Valid field combinations are `[ group_id, path ]` and `[ user_id, path ]`.
125
+ // filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `group_id`, `user_id` or `path`. Valid field combinations are `[ group_id, path ]` and `[ user_id, path ]`.
126
+ // filter_gteq - object - If set, return records where the specified field is greater than or equal to the supplied value. Valid fields are `group_id`, `user_id` or `path`. Valid field combinations are `[ group_id, path ]` and `[ user_id, path ]`.
127
+ // filter_like - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `group_id`, `user_id` or `path`. Valid field combinations are `[ group_id, path ]` and `[ user_id, path ]`.
128
+ // filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `group_id`, `user_id` or `path`. Valid field combinations are `[ group_id, path ]` and `[ user_id, path ]`.
129
+ // filter_lteq - object - If set, return records where the specified field is less than or equal to the supplied value. Valid fields are `group_id`, `user_id` or `path`. Valid field combinations are `[ group_id, path ]` and `[ user_id, path ]`.
130
130
  // path - string - DEPRECATED: Permission path. If provided, will scope permissions to this path. Use `filter[path]` instead.
131
131
  // group_id - string - DEPRECATED: Group ID. If provided, will scope permissions to this group. Use `filter[group_id]` instead.`
132
132
  // user_id - string - DEPRECATED: User ID. If provided, will scope permissions to this user. Use `filter[user_id]` instead.`
@@ -39,12 +39,12 @@ class UsageDailySnapshot {
39
39
  // cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
40
40
  // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
41
41
  // sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `date` and `usage_snapshot_id`.
42
- // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `date` and `usage_snapshot_id`.
43
- // filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `date` and `usage_snapshot_id`.
44
- // filter_gteq - object - If set, return records where the specified field is greater than or equal to the supplied value. Valid fields are `date` and `usage_snapshot_id`.
45
- // filter_like - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `date` and `usage_snapshot_id`.
46
- // filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `date` and `usage_snapshot_id`.
47
- // 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`.
42
+ // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `date` and `usage_snapshot_id`. Valid field combinations are `[ usage_snapshot_id, date ]`.
43
+ // filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `date` and `usage_snapshot_id`. Valid field combinations are `[ usage_snapshot_id, date ]`.
44
+ // filter_gteq - object - If set, return records where the specified field is greater than or equal to the supplied value. Valid fields are `date` and `usage_snapshot_id`. Valid field combinations are `[ usage_snapshot_id, date ]`.
45
+ // filter_like - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `date` and `usage_snapshot_id`. Valid field combinations are `[ usage_snapshot_id, date ]`.
46
+ // filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `date` and `usage_snapshot_id`. Valid field combinations are `[ usage_snapshot_id, date ]`.
47
+ // 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 ]`.
48
48
  static list = async (params = {}, options = {}) => {
49
49
  if (params['cursor'] && !isString(params['cursor'])) {
50
50
  throw new Error(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
@@ -690,12 +690,12 @@ class User {
690
690
  // cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
691
691
  // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
692
692
  // sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `authenticate_until`, `email`, `last_desktop_login_at`, `last_login_at`, `username`, `company`, `name`, `site_admin`, `receive_admin_alerts`, `password_validity_days`, `ssl_required` or `not_site_admin`.
693
- // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
694
- // filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
695
- // filter_gteq - object - If set, return records where the specified field is greater than or equal to the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
696
- // filter_like - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
697
- // filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
698
- // filter_lteq - object - If set, return records where the specified field is less than or equal to the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
693
+ // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`. Valid field combinations are `[ not_site_admin, username ]`.
694
+ // filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`. Valid field combinations are `[ not_site_admin, username ]`.
695
+ // filter_gteq - object - If set, return records where the specified field is greater than or equal to the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`. Valid field combinations are `[ not_site_admin, username ]`.
696
+ // filter_like - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`. Valid field combinations are `[ not_site_admin, username ]`.
697
+ // filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`. Valid field combinations are `[ not_site_admin, username ]`.
698
+ // filter_lteq - object - If set, return records where the specified field is less than or equal to the supplied value. Valid fields are `username`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`. Valid field combinations are `[ not_site_admin, username ]`.
699
699
  // ids - string - comma-separated list of User IDs
700
700
  // q[username] - string - List users matching username.
701
701
  // q[email] - string - List users matching email.
@@ -1,221 +0,0 @@
1
- import Api from '../Api'
2
- import Logger from '../Logger'
3
- import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
4
-
5
- /**
6
- * Class As2Key
7
- */
8
- class As2Key {
9
- attributes = {}
10
- options = {}
11
-
12
- constructor(attributes = {}, options = {}) {
13
- Object.entries(attributes).forEach(([key, value]) => {
14
- const normalizedKey = key.replace('?', '')
15
-
16
- this.attributes[normalizedKey] = value
17
-
18
- Object.defineProperty(this, normalizedKey, { value, writable: false })
19
- })
20
-
21
- this.options = { ...options }
22
- }
23
-
24
- isLoaded = () => !!this.attributes.id
25
- // int64 # AS2 Key ID
26
- getId = () => this.attributes.id
27
-
28
- setId = value => {
29
- this.attributes.id = value
30
- }
31
-
32
- // string # AS2 Partnership Name
33
- getAs2PartnershipName = () => this.attributes.as2_partnership_name
34
-
35
- setAs2PartnershipName = value => {
36
- this.attributes.as2_partnership_name = value
37
- }
38
-
39
- // date-time # AS2 Key created at date/time
40
- getCreatedAt = () => this.attributes.created_at
41
-
42
- // string # Public key fingerprint
43
- getFingerprint = () => this.attributes.fingerprint
44
-
45
- setFingerprint = value => {
46
- this.attributes.fingerprint = value
47
- }
48
-
49
- // int64 # User ID. Provide a value of `0` to operate the current session's user.
50
- getUserId = () => this.attributes.user_id
51
-
52
- setUserId = value => {
53
- this.attributes.user_id = value
54
- }
55
-
56
- // string # Actual contents of Public key.
57
- getPublicKey = () => this.attributes.public_key
58
-
59
- setPublicKey = value => {
60
- this.attributes.public_key = value
61
- }
62
-
63
-
64
- // Parameters:
65
- // as2_partnership_name (required) - string - AS2 Partnership Name
66
- update = async (params = {}) => {
67
- if (!this.attributes.id) {
68
- throw new Error('Current object has no id')
69
- }
70
-
71
- if (!isObject(params)) {
72
- throw new Error(`Bad parameter: params must be of type object, received ${getType(params)}`)
73
- }
74
-
75
- params.id = this.attributes.id
76
- if (params['id'] && !isInt(params['id'])) {
77
- throw new Error(`Bad parameter: id must be of type Int, received ${getType(id)}`)
78
- }
79
- if (params['as2_partnership_name'] && !isString(params['as2_partnership_name'])) {
80
- throw new Error(`Bad parameter: as2_partnership_name must be of type String, received ${getType(as2_partnership_name)}`)
81
- }
82
-
83
- if (!params['id']) {
84
- if (this.attributes.id) {
85
- params['id'] = this.id
86
- } else {
87
- throw new Error('Parameter missing: id')
88
- }
89
- }
90
-
91
- if (!params['as2_partnership_name']) {
92
- if (this.attributes.as2_partnership_name) {
93
- params['as2_partnership_name'] = this.as2_partnership_name
94
- } else {
95
- throw new Error('Parameter missing: as2_partnership_name')
96
- }
97
- }
98
-
99
- return Api.sendRequest(`/as2_keys/${params['id']}`, 'PATCH', params, this.options)
100
- }
101
-
102
- delete = async (params = {}) => {
103
- if (!this.attributes.id) {
104
- throw new Error('Current object has no id')
105
- }
106
-
107
- if (!isObject(params)) {
108
- throw new Error(`Bad parameter: params must be of type object, received ${getType(params)}`)
109
- }
110
-
111
- params.id = this.attributes.id
112
- if (params['id'] && !isInt(params['id'])) {
113
- throw new Error(`Bad parameter: id must be of type Int, received ${getType(id)}`)
114
- }
115
-
116
- if (!params['id']) {
117
- if (this.attributes.id) {
118
- params['id'] = this.id
119
- } else {
120
- throw new Error('Parameter missing: id')
121
- }
122
- }
123
-
124
- return Api.sendRequest(`/as2_keys/${params['id']}`, 'DELETE', params, this.options)
125
- }
126
-
127
- destroy = (params = {}) =>
128
- this.delete(params)
129
-
130
- save = () => {
131
- if (this.attributes['id']) {
132
- return this.update(this.attributes)
133
- } else {
134
- const newObject = As2Key.create(this.attributes, this.options)
135
- this.attributes = { ...newObject.attributes }
136
- return true
137
- }
138
- }
139
-
140
- // Parameters:
141
- // user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
142
- // cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
143
- // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
144
- static list = async (params = {}, options = {}) => {
145
- if (params['user_id'] && !isInt(params['user_id'])) {
146
- throw new Error(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
147
- }
148
-
149
- if (params['cursor'] && !isString(params['cursor'])) {
150
- throw new Error(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
151
- }
152
-
153
- if (params['per_page'] && !isInt(params['per_page'])) {
154
- throw new Error(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
155
- }
156
-
157
- const response = await Api.sendRequest(`/as2_keys`, 'GET', params, options)
158
-
159
- return response?.data?.map(obj => new As2Key(obj, options)) || []
160
- }
161
-
162
- static all = (params = {}, options = {}) =>
163
- As2Key.list(params, options)
164
-
165
- // Parameters:
166
- // id (required) - int64 - As2 Key ID.
167
- static find = async (id, params = {}, options = {}) => {
168
- if (!isObject(params)) {
169
- throw new Error(`Bad parameter: params must be of type object, received ${getType(params)}`)
170
- }
171
-
172
- params['id'] = id
173
-
174
- if (!params['id']) {
175
- throw new Error('Parameter missing: id')
176
- }
177
-
178
- if (params['id'] && !isInt(params['id'])) {
179
- throw new Error(`Bad parameter: id must be of type Int, received ${getType(id)}`)
180
- }
181
-
182
- const response = await Api.sendRequest(`/as2_keys/${params['id']}`, 'GET', params, options)
183
-
184
- return new As2Key(response?.data, options)
185
- }
186
-
187
- static get = (id, params = {}, options = {}) =>
188
- As2Key.find(id, params, options)
189
-
190
- // Parameters:
191
- // user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
192
- // as2_partnership_name (required) - string - AS2 Partnership Name
193
- // public_key (required) - string - Actual contents of Public key.
194
- static create = async (params = {}, options = {}) => {
195
- if (!params['as2_partnership_name']) {
196
- throw new Error('Parameter missing: as2_partnership_name')
197
- }
198
-
199
- if (!params['public_key']) {
200
- throw new Error('Parameter missing: public_key')
201
- }
202
-
203
- if (params['user_id'] && !isInt(params['user_id'])) {
204
- throw new Error(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
205
- }
206
-
207
- if (params['as2_partnership_name'] && !isString(params['as2_partnership_name'])) {
208
- throw new Error(`Bad parameter: as2_partnership_name must be of type String, received ${getType(as2_partnership_name)}`)
209
- }
210
-
211
- if (params['public_key'] && !isString(params['public_key'])) {
212
- throw new Error(`Bad parameter: public_key must be of type String, received ${getType(public_key)}`)
213
- }
214
-
215
- const response = await Api.sendRequest(`/as2_keys`, 'POST', params, options)
216
-
217
- return new As2Key(response?.data, options)
218
- }
219
- }
220
-
221
- export default As2Key