files.com 1.0.226 → 1.0.228

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,58 @@
1
+ import Api from '../Api'
2
+ import * as errors from '../Errors'
3
+ import Logger from '../Logger'
4
+ import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
5
+
6
+ /**
7
+ * Class RemoteServerConfigurationFile
8
+ */
9
+ class RemoteServerConfigurationFile {
10
+ attributes = {}
11
+ options = {}
12
+
13
+ constructor(attributes = {}, options = {}) {
14
+ Object.entries(attributes).forEach(([key, value]) => {
15
+ const normalizedKey = key.replace('?', '')
16
+
17
+ this.attributes[normalizedKey] = value
18
+
19
+ Object.defineProperty(this, normalizedKey, { value, writable: false })
20
+ })
21
+
22
+ this.options = { ...options }
23
+ }
24
+
25
+ isLoaded = () => !!this.attributes.id
26
+ // int64 # Agent ID
27
+ getId = () => this.attributes.id
28
+
29
+ // string #
30
+ getPermissionSet = () => this.attributes.permission_set
31
+
32
+ // string # Files Agent API Token
33
+ getApiToken = () => this.attributes.api_token
34
+
35
+ // string # Agent local root path
36
+ getRoot = () => this.attributes.root
37
+
38
+ // int64 # Incoming port for files agent connections
39
+ getPort = () => this.attributes.port
40
+
41
+ // string
42
+ getHostname = () => this.attributes.hostname
43
+
44
+ // string # public key
45
+ getPublicKey = () => this.attributes.public_key
46
+
47
+ // string # private key
48
+ getPrivateKey = () => this.attributes.private_key
49
+
50
+ // string # either running or shutdown
51
+ getStatus = () => this.attributes.status
52
+
53
+ // string # agent config version
54
+ getConfigVersion = () => this.attributes.config_version
55
+
56
+ }
57
+
58
+ export default RemoteServerConfigurationFile
@@ -65,6 +65,9 @@ class Site {
65
65
  // boolean # Do Bundles require password protection?
66
66
  getBundlePasswordRequired = () => this.attributes.bundle_password_required
67
67
 
68
+ // string # Do Bundle owners receive registration notification?
69
+ getBundleRegistrationNotifications = () => this.attributes.bundle_registration_notifications
70
+
68
71
  // boolean # Do Bundles require recipients for sharing?
69
72
  getBundleRequireShareRecipient = () => this.attributes.bundle_require_share_recipient
70
73
 
@@ -508,6 +511,7 @@ class Site {
508
511
  // session_pinned_by_ip - boolean - Are sessions locked to the same IP? (i.e. do users need to log in again if they change IPs?)
509
512
  // bundle_password_required - boolean - Do Bundles require password protection?
510
513
  // bundle_require_share_recipient - boolean - Do Bundles require recipients for sharing?
514
+ // bundle_registration_notifications - string - Do Bundle owners receive registration notification?
511
515
  // password_requirements_apply_to_bundles - boolean - Require bundles' passwords, and passwords for other items (inboxes, public shares, etc.) to conform to the same requirements as users' passwords?
512
516
  // opt_out_global - boolean - Use servers in the USA only?
513
517
  // use_provided_modified_at - boolean - Allow uploaders to set `provided_modified_at` for uploaded files?
@@ -681,6 +685,10 @@ class Site {
681
685
  throw new errors.InvalidParameterError(`Bad parameter: password_min_length must be of type Int, received ${getType(params['password_min_length'])}`)
682
686
  }
683
687
 
688
+ if (params['bundle_registration_notifications'] && !isString(params['bundle_registration_notifications'])) {
689
+ throw new errors.InvalidParameterError(`Bad parameter: bundle_registration_notifications must be of type String, received ${getType(params['bundle_registration_notifications'])}`)
690
+ }
691
+
684
692
  if (params['disable_users_from_inactivity_period_days'] && !isInt(params['disable_users_from_inactivity_period_days'])) {
685
693
  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'])}`)
686
694
  }