files.com 1.2.269 → 1.2.271
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 +12 -0
- package/docs/models/PublicKey.md +23 -3
- package/docs/models/RemoteMountBackend.md +4 -1
- package/lib/Files.js +1 -1
- package/lib/models/GpgKey.js +53 -3
- package/lib/models/PublicKey.js +75 -17
- package/lib/models/RemoteMountBackend.js +8 -7
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/GpgKey.js +44 -0
- package/src/models/PublicKey.js +63 -9
- package/src/models/RemoteMountBackend.js +8 -7
package/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.271
|
package/docs/models/GpgKey.md
CHANGED
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
* `public_key` (string): Your GPG public key
|
|
22
22
|
* `private_key` (string): Your GPG private key.
|
|
23
23
|
* `private_key_password` (string): Your GPG private key password. Only required for password protected keys.
|
|
24
|
+
* `generate_expires_at` (string): Expiration date of the key. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
25
|
+
* `generate_keypair` (boolean): If true, generate a new GPG key pair. Can not be used with `public_key`/`private_key`
|
|
26
|
+
* `generate_full_name` (string): Full name of the key owner. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
27
|
+
* `generate_email` (string): Email address of the key owner. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
24
28
|
|
|
25
29
|
---
|
|
26
30
|
|
|
@@ -64,6 +68,10 @@ await GpgKey.create({
|
|
|
64
68
|
'private_key': "ab236cfe4a195f0226bc2e674afdd6b0",
|
|
65
69
|
'private_key_password': "[your GPG private key password]",
|
|
66
70
|
'name': "key name",
|
|
71
|
+
'generate_expires_at': "2025-06-19 12:00:00",
|
|
72
|
+
'generate_keypair': false,
|
|
73
|
+
'generate_full_name': "John Doe",
|
|
74
|
+
'generate_email': "jdoe@example.com",
|
|
67
75
|
})
|
|
68
76
|
```
|
|
69
77
|
|
|
@@ -75,6 +83,10 @@ await GpgKey.create({
|
|
|
75
83
|
* `private_key` (string): Your GPG private key.
|
|
76
84
|
* `private_key_password` (string): Your GPG private key password. Only required for password protected keys.
|
|
77
85
|
* `name` (string): Required - Your GPG key name.
|
|
86
|
+
* `generate_expires_at` (string): Expiration date of the key. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
87
|
+
* `generate_keypair` (boolean): If true, generate a new GPG key pair. Can not be used with `public_key`/`private_key`
|
|
88
|
+
* `generate_full_name` (string): Full name of the key owner. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
89
|
+
* `generate_email` (string): Email address of the key owner. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
78
90
|
|
|
79
91
|
---
|
|
80
92
|
|
package/docs/models/PublicKey.md
CHANGED
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
"created_at": "2000-01-01T01:00:00Z",
|
|
10
10
|
"fingerprint": "43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8",
|
|
11
11
|
"fingerprint_sha256": "V5Q5t/ghT3R8Tol5GX9385bzmpygWVRnLuI9EXNrjCX",
|
|
12
|
+
"status": "complete",
|
|
12
13
|
"last_login_at": "2000-01-01T01:00:00Z",
|
|
14
|
+
"private_key": "example",
|
|
15
|
+
"public_key": "example",
|
|
13
16
|
"username": "User",
|
|
14
17
|
"user_id": 1
|
|
15
18
|
}
|
|
@@ -20,10 +23,16 @@
|
|
|
20
23
|
* `created_at` (date-time): Public key created at date/time
|
|
21
24
|
* `fingerprint` (string): Public key fingerprint (MD5)
|
|
22
25
|
* `fingerprint_sha256` (string): Public key fingerprint (SHA256)
|
|
26
|
+
* `status` (string): Can be invalid, not_generated, generating, complete
|
|
23
27
|
* `last_login_at` (date-time): Key's most recent login time via SFTP
|
|
28
|
+
* `private_key` (string): Private key generated for the user.
|
|
29
|
+
* `public_key` (string): Public key generated for the user.
|
|
24
30
|
* `username` (string): Username of the user this public key is associated with
|
|
25
31
|
* `user_id` (int64): User ID this public key is associated with
|
|
26
|
-
* `
|
|
32
|
+
* `generate_keypair` (boolean): If true, generate a new SSH key pair. Can not be used with `public_key`
|
|
33
|
+
* `generate_private_key_password` (string): Password for the private key. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
34
|
+
* `generate_algorithm` (string): Type of key to generate. One of rsa, dsa, ecdsa, ed25519. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
35
|
+
* `generate_length` (int64): Length of key to generate. If algorithm is ecdsa, this is the signature size. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
27
36
|
|
|
28
37
|
---
|
|
29
38
|
|
|
@@ -68,7 +77,11 @@ await PublicKey.find(id)
|
|
|
68
77
|
await PublicKey.create({
|
|
69
78
|
'user_id': 1,
|
|
70
79
|
'title': "My Main Key",
|
|
71
|
-
'public_key': "
|
|
80
|
+
'public_key': "example",
|
|
81
|
+
'generate_keypair': false,
|
|
82
|
+
'generate_private_key_password': "[your private key password]",
|
|
83
|
+
'generate_algorithm': "rsa",
|
|
84
|
+
'generate_length': 4096,
|
|
72
85
|
})
|
|
73
86
|
```
|
|
74
87
|
|
|
@@ -77,7 +90,11 @@ await PublicKey.create({
|
|
|
77
90
|
|
|
78
91
|
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
|
79
92
|
* `title` (string): Required - Internal reference for key.
|
|
80
|
-
* `public_key` (string):
|
|
93
|
+
* `public_key` (string): Actual contents of SSH key.
|
|
94
|
+
* `generate_keypair` (boolean): If true, generate a new SSH key pair. Can not be used with `public_key`
|
|
95
|
+
* `generate_private_key_password` (string): Password for the private key. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
96
|
+
* `generate_algorithm` (string): Type of key to generate. One of rsa, dsa, ecdsa, ed25519. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
97
|
+
* `generate_length` (int64): Length of key to generate. If algorithm is ecdsa, this is the signature size. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
81
98
|
|
|
82
99
|
---
|
|
83
100
|
|
|
@@ -105,7 +122,10 @@ await public_key.update({
|
|
|
105
122
|
"created_at": "2000-01-01T01:00:00Z",
|
|
106
123
|
"fingerprint": "43:51:43:a1:b5:fc:8b:b7:0a:3a:a9:b1:0f:66:73:a8",
|
|
107
124
|
"fingerprint_sha256": "V5Q5t/ghT3R8Tol5GX9385bzmpygWVRnLuI9EXNrjCX",
|
|
125
|
+
"status": "complete",
|
|
108
126
|
"last_login_at": "2000-01-01T01:00:00Z",
|
|
127
|
+
"private_key": "example",
|
|
128
|
+
"public_key": "example",
|
|
109
129
|
"username": "User",
|
|
110
130
|
"user_id": 1
|
|
111
131
|
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"fall": 1,
|
|
10
10
|
"health_check_enabled": true,
|
|
11
11
|
"health_check_type": "active",
|
|
12
|
+
"id": 1,
|
|
12
13
|
"interval": 60,
|
|
13
14
|
"min_free_cpu": 1.0,
|
|
14
15
|
"min_free_mem": 1.0,
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
* `fall` (int64): Number of consecutive failures before considering the backend unhealthy.
|
|
28
29
|
* `health_check_enabled` (boolean): True if health checks are enabled for this backend.
|
|
29
30
|
* `health_check_type` (string): Type of health check to perform.
|
|
31
|
+
* `id` (int64): Unique identifier for this backend.
|
|
30
32
|
* `interval` (int64): Interval in seconds between health checks.
|
|
31
33
|
* `min_free_cpu` (double): Minimum free CPU percentage required for this backend to be considered healthy.
|
|
32
34
|
* `min_free_mem` (double): Minimum free memory percentage required for this backend to be considered healthy.
|
|
@@ -37,7 +39,6 @@
|
|
|
37
39
|
* `rise` (int64): Number of consecutive successes before considering the backend healthy.
|
|
38
40
|
* `status` (string): Status of this backend.
|
|
39
41
|
* `undergoing_maintenance` (boolean): True if this backend is undergoing maintenance.
|
|
40
|
-
* `id` (int64): Remote Mount Backend ID.
|
|
41
42
|
|
|
42
43
|
---
|
|
43
44
|
|
|
@@ -52,6 +53,7 @@ await RemoteMountBackend.list
|
|
|
52
53
|
|
|
53
54
|
* `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.
|
|
54
55
|
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
56
|
+
* `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `remote_server_mount_id`.
|
|
55
57
|
|
|
56
58
|
---
|
|
57
59
|
|
|
@@ -170,6 +172,7 @@ await remote_mount_backend.update({
|
|
|
170
172
|
"fall": 1,
|
|
171
173
|
"health_check_enabled": true,
|
|
172
174
|
"health_check_type": "active",
|
|
175
|
+
"id": 1,
|
|
173
176
|
"interval": 60,
|
|
174
177
|
"min_free_cpu": 1.0,
|
|
175
178
|
"min_free_mem": 1.0,
|
package/lib/Files.js
CHANGED
|
@@ -12,7 +12,7 @@ var apiKey;
|
|
|
12
12
|
var baseUrl = 'https://app.files.com';
|
|
13
13
|
var sessionId = null;
|
|
14
14
|
var language = null;
|
|
15
|
-
var version = '1.2.
|
|
15
|
+
var version = '1.2.271';
|
|
16
16
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
|
17
17
|
var logLevel = _Logger.LogLevel.INFO;
|
|
18
18
|
var debugRequest = false;
|
package/lib/models/GpgKey.js
CHANGED
|
@@ -81,6 +81,34 @@ var GpgKey = /*#__PURE__*/(0, _createClass2.default)(function GpgKey() {
|
|
|
81
81
|
(0, _defineProperty2.default)(this, "setPrivateKeyPassword", function (value) {
|
|
82
82
|
_this.attributes.private_key_password = value;
|
|
83
83
|
});
|
|
84
|
+
// string # Expiration date of the key. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
85
|
+
(0, _defineProperty2.default)(this, "getGenerateExpiresAt", function () {
|
|
86
|
+
return _this.attributes.generate_expires_at;
|
|
87
|
+
});
|
|
88
|
+
(0, _defineProperty2.default)(this, "setGenerateExpiresAt", function (value) {
|
|
89
|
+
_this.attributes.generate_expires_at = value;
|
|
90
|
+
});
|
|
91
|
+
// boolean # If true, generate a new GPG key pair. Can not be used with `public_key`/`private_key`
|
|
92
|
+
(0, _defineProperty2.default)(this, "getGenerateKeypair", function () {
|
|
93
|
+
return _this.attributes.generate_keypair;
|
|
94
|
+
});
|
|
95
|
+
(0, _defineProperty2.default)(this, "setGenerateKeypair", function (value) {
|
|
96
|
+
_this.attributes.generate_keypair = value;
|
|
97
|
+
});
|
|
98
|
+
// string # Full name of the key owner. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
99
|
+
(0, _defineProperty2.default)(this, "getGenerateFullName", function () {
|
|
100
|
+
return _this.attributes.generate_full_name;
|
|
101
|
+
});
|
|
102
|
+
(0, _defineProperty2.default)(this, "setGenerateFullName", function (value) {
|
|
103
|
+
_this.attributes.generate_full_name = value;
|
|
104
|
+
});
|
|
105
|
+
// string # Email address of the key owner. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
106
|
+
(0, _defineProperty2.default)(this, "getGenerateEmail", function () {
|
|
107
|
+
return _this.attributes.generate_email;
|
|
108
|
+
});
|
|
109
|
+
(0, _defineProperty2.default)(this, "setGenerateEmail", function (value) {
|
|
110
|
+
_this.attributes.generate_email = value;
|
|
111
|
+
});
|
|
84
112
|
// Parameters:
|
|
85
113
|
// public_key - string - Your GPG public key
|
|
86
114
|
// private_key - string - Your GPG private key.
|
|
@@ -366,6 +394,10 @@ _GpgKey = GpgKey;
|
|
|
366
394
|
// private_key - string - Your GPG private key.
|
|
367
395
|
// private_key_password - string - Your GPG private key password. Only required for password protected keys.
|
|
368
396
|
// name (required) - string - Your GPG key name.
|
|
397
|
+
// generate_expires_at - string - Expiration date of the key. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
398
|
+
// generate_keypair - boolean - If true, generate a new GPG key pair. Can not be used with `public_key`/`private_key`
|
|
399
|
+
// generate_full_name - string - Full name of the key owner. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
400
|
+
// generate_email - string - Email address of the key owner. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
369
401
|
(0, _defineProperty2.default)(GpgKey, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
370
402
|
var params,
|
|
371
403
|
options,
|
|
@@ -412,12 +444,30 @@ _GpgKey = GpgKey;
|
|
|
412
444
|
}
|
|
413
445
|
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
|
414
446
|
case 6:
|
|
415
|
-
|
|
416
|
-
|
|
447
|
+
if (!(params.generate_expires_at && !(0, _utils.isString)(params.generate_expires_at))) {
|
|
448
|
+
_context6.next = 7;
|
|
449
|
+
break;
|
|
450
|
+
}
|
|
451
|
+
throw new errors.InvalidParameterError("Bad parameter: generate_expires_at must be of type String, received ".concat((0, _utils.getType)(params.generate_expires_at)));
|
|
417
452
|
case 7:
|
|
453
|
+
if (!(params.generate_full_name && !(0, _utils.isString)(params.generate_full_name))) {
|
|
454
|
+
_context6.next = 8;
|
|
455
|
+
break;
|
|
456
|
+
}
|
|
457
|
+
throw new errors.InvalidParameterError("Bad parameter: generate_full_name must be of type String, received ".concat((0, _utils.getType)(params.generate_full_name)));
|
|
458
|
+
case 8:
|
|
459
|
+
if (!(params.generate_email && !(0, _utils.isString)(params.generate_email))) {
|
|
460
|
+
_context6.next = 9;
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
throw new errors.InvalidParameterError("Bad parameter: generate_email must be of type String, received ".concat((0, _utils.getType)(params.generate_email)));
|
|
464
|
+
case 9:
|
|
465
|
+
_context6.next = 10;
|
|
466
|
+
return _Api.default.sendRequest('/gpg_keys', 'POST', params, options);
|
|
467
|
+
case 10:
|
|
418
468
|
response = _context6.sent;
|
|
419
469
|
return _context6.abrupt("return", new _GpgKey(response === null || response === void 0 ? void 0 : response.data, options));
|
|
420
|
-
case
|
|
470
|
+
case 11:
|
|
421
471
|
case "end":
|
|
422
472
|
return _context6.stop();
|
|
423
473
|
}
|
package/lib/models/PublicKey.js
CHANGED
|
@@ -64,6 +64,13 @@ var PublicKey = /*#__PURE__*/(0, _createClass2.default)(function PublicKey() {
|
|
|
64
64
|
(0, _defineProperty2.default)(this, "setFingerprintSha256", function (value) {
|
|
65
65
|
_this.attributes.fingerprint_sha256 = value;
|
|
66
66
|
});
|
|
67
|
+
// string # Can be invalid, not_generated, generating, complete
|
|
68
|
+
(0, _defineProperty2.default)(this, "getStatus", function () {
|
|
69
|
+
return _this.attributes.status;
|
|
70
|
+
});
|
|
71
|
+
(0, _defineProperty2.default)(this, "setStatus", function (value) {
|
|
72
|
+
_this.attributes.status = value;
|
|
73
|
+
});
|
|
67
74
|
// date-time # Key's most recent login time via SFTP
|
|
68
75
|
(0, _defineProperty2.default)(this, "getLastLoginAt", function () {
|
|
69
76
|
return _this.attributes.last_login_at;
|
|
@@ -71,6 +78,20 @@ var PublicKey = /*#__PURE__*/(0, _createClass2.default)(function PublicKey() {
|
|
|
71
78
|
(0, _defineProperty2.default)(this, "setLastLoginAt", function (value) {
|
|
72
79
|
_this.attributes.last_login_at = value;
|
|
73
80
|
});
|
|
81
|
+
// string # Private key generated for the user.
|
|
82
|
+
(0, _defineProperty2.default)(this, "getPrivateKey", function () {
|
|
83
|
+
return _this.attributes.private_key;
|
|
84
|
+
});
|
|
85
|
+
(0, _defineProperty2.default)(this, "setPrivateKey", function (value) {
|
|
86
|
+
_this.attributes.private_key = value;
|
|
87
|
+
});
|
|
88
|
+
// string # Public key generated for the user.
|
|
89
|
+
(0, _defineProperty2.default)(this, "getPublicKey", function () {
|
|
90
|
+
return _this.attributes.public_key;
|
|
91
|
+
});
|
|
92
|
+
(0, _defineProperty2.default)(this, "setPublicKey", function (value) {
|
|
93
|
+
_this.attributes.public_key = value;
|
|
94
|
+
});
|
|
74
95
|
// string # Username of the user this public key is associated with
|
|
75
96
|
(0, _defineProperty2.default)(this, "getUsername", function () {
|
|
76
97
|
return _this.attributes.username;
|
|
@@ -85,12 +106,33 @@ var PublicKey = /*#__PURE__*/(0, _createClass2.default)(function PublicKey() {
|
|
|
85
106
|
(0, _defineProperty2.default)(this, "setUserId", function (value) {
|
|
86
107
|
_this.attributes.user_id = value;
|
|
87
108
|
});
|
|
88
|
-
//
|
|
89
|
-
(0, _defineProperty2.default)(this, "
|
|
90
|
-
return _this.attributes.
|
|
109
|
+
// boolean # If true, generate a new SSH key pair. Can not be used with `public_key`
|
|
110
|
+
(0, _defineProperty2.default)(this, "getGenerateKeypair", function () {
|
|
111
|
+
return _this.attributes.generate_keypair;
|
|
91
112
|
});
|
|
92
|
-
(0, _defineProperty2.default)(this, "
|
|
93
|
-
_this.attributes.
|
|
113
|
+
(0, _defineProperty2.default)(this, "setGenerateKeypair", function (value) {
|
|
114
|
+
_this.attributes.generate_keypair = value;
|
|
115
|
+
});
|
|
116
|
+
// string # Password for the private key. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
117
|
+
(0, _defineProperty2.default)(this, "getGeneratePrivateKeyPassword", function () {
|
|
118
|
+
return _this.attributes.generate_private_key_password;
|
|
119
|
+
});
|
|
120
|
+
(0, _defineProperty2.default)(this, "setGeneratePrivateKeyPassword", function (value) {
|
|
121
|
+
_this.attributes.generate_private_key_password = value;
|
|
122
|
+
});
|
|
123
|
+
// string # Type of key to generate. One of rsa, dsa, ecdsa, ed25519. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
124
|
+
(0, _defineProperty2.default)(this, "getGenerateAlgorithm", function () {
|
|
125
|
+
return _this.attributes.generate_algorithm;
|
|
126
|
+
});
|
|
127
|
+
(0, _defineProperty2.default)(this, "setGenerateAlgorithm", function (value) {
|
|
128
|
+
_this.attributes.generate_algorithm = value;
|
|
129
|
+
});
|
|
130
|
+
// int64 # Length of key to generate. If algorithm is ecdsa, this is the signature size. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
131
|
+
(0, _defineProperty2.default)(this, "getGenerateLength", function () {
|
|
132
|
+
return _this.attributes.generate_length;
|
|
133
|
+
});
|
|
134
|
+
(0, _defineProperty2.default)(this, "setGenerateLength", function (value) {
|
|
135
|
+
_this.attributes.generate_length = value;
|
|
94
136
|
});
|
|
95
137
|
// Parameters:
|
|
96
138
|
// title (required) - string - Internal reference for key.
|
|
@@ -371,7 +413,11 @@ _PublicKey = PublicKey;
|
|
|
371
413
|
// Parameters:
|
|
372
414
|
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
373
415
|
// title (required) - string - Internal reference for key.
|
|
374
|
-
// public_key
|
|
416
|
+
// public_key - string - Actual contents of SSH key.
|
|
417
|
+
// generate_keypair - boolean - If true, generate a new SSH key pair. Can not be used with `public_key`
|
|
418
|
+
// generate_private_key_password - string - Password for the private key. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
419
|
+
// generate_algorithm - string - Type of key to generate. One of rsa, dsa, ecdsa, ed25519. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
420
|
+
// generate_length - int64 - Length of key to generate. If algorithm is ecdsa, this is the signature size. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
375
421
|
(0, _defineProperty2.default)(PublicKey, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
376
422
|
var params,
|
|
377
423
|
options,
|
|
@@ -388,36 +434,48 @@ _PublicKey = PublicKey;
|
|
|
388
434
|
}
|
|
389
435
|
throw new errors.MissingParameterError('Parameter missing: title');
|
|
390
436
|
case 1:
|
|
391
|
-
if (params.
|
|
437
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
|
392
438
|
_context6.next = 2;
|
|
393
439
|
break;
|
|
394
440
|
}
|
|
395
|
-
throw new errors.
|
|
441
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
|
396
442
|
case 2:
|
|
397
|
-
if (!(params.
|
|
443
|
+
if (!(params.title && !(0, _utils.isString)(params.title))) {
|
|
398
444
|
_context6.next = 3;
|
|
399
445
|
break;
|
|
400
446
|
}
|
|
401
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
447
|
+
throw new errors.InvalidParameterError("Bad parameter: title must be of type String, received ".concat((0, _utils.getType)(params.title)));
|
|
402
448
|
case 3:
|
|
403
|
-
if (!(params.
|
|
449
|
+
if (!(params.public_key && !(0, _utils.isString)(params.public_key))) {
|
|
404
450
|
_context6.next = 4;
|
|
405
451
|
break;
|
|
406
452
|
}
|
|
407
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
453
|
+
throw new errors.InvalidParameterError("Bad parameter: public_key must be of type String, received ".concat((0, _utils.getType)(params.public_key)));
|
|
408
454
|
case 4:
|
|
409
|
-
if (!(params.
|
|
455
|
+
if (!(params.generate_private_key_password && !(0, _utils.isString)(params.generate_private_key_password))) {
|
|
410
456
|
_context6.next = 5;
|
|
411
457
|
break;
|
|
412
458
|
}
|
|
413
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
459
|
+
throw new errors.InvalidParameterError("Bad parameter: generate_private_key_password must be of type String, received ".concat((0, _utils.getType)(params.generate_private_key_password)));
|
|
414
460
|
case 5:
|
|
415
|
-
|
|
416
|
-
|
|
461
|
+
if (!(params.generate_algorithm && !(0, _utils.isString)(params.generate_algorithm))) {
|
|
462
|
+
_context6.next = 6;
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
throw new errors.InvalidParameterError("Bad parameter: generate_algorithm must be of type String, received ".concat((0, _utils.getType)(params.generate_algorithm)));
|
|
417
466
|
case 6:
|
|
467
|
+
if (!(params.generate_length && !(0, _utils.isInt)(params.generate_length))) {
|
|
468
|
+
_context6.next = 7;
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
471
|
+
throw new errors.InvalidParameterError("Bad parameter: generate_length must be of type Int, received ".concat((0, _utils.getType)(params.generate_length)));
|
|
472
|
+
case 7:
|
|
473
|
+
_context6.next = 8;
|
|
474
|
+
return _Api.default.sendRequest('/public_keys', 'POST', params, options);
|
|
475
|
+
case 8:
|
|
418
476
|
response = _context6.sent;
|
|
419
477
|
return _context6.abrupt("return", new _PublicKey(response === null || response === void 0 ? void 0 : response.data, options));
|
|
420
|
-
case
|
|
478
|
+
case 9:
|
|
421
479
|
case "end":
|
|
422
480
|
return _context6.stop();
|
|
423
481
|
}
|
|
@@ -67,6 +67,13 @@ var RemoteMountBackend = /*#__PURE__*/(0, _createClass2.default)(function Remote
|
|
|
67
67
|
(0, _defineProperty2.default)(this, "setHealthCheckType", function (value) {
|
|
68
68
|
_this.attributes.health_check_type = value;
|
|
69
69
|
});
|
|
70
|
+
// int64 # Unique identifier for this backend.
|
|
71
|
+
(0, _defineProperty2.default)(this, "getId", function () {
|
|
72
|
+
return _this.attributes.id;
|
|
73
|
+
});
|
|
74
|
+
(0, _defineProperty2.default)(this, "setId", function (value) {
|
|
75
|
+
_this.attributes.id = value;
|
|
76
|
+
});
|
|
70
77
|
// int64 # Interval in seconds between health checks.
|
|
71
78
|
(0, _defineProperty2.default)(this, "getInterval", function () {
|
|
72
79
|
return _this.attributes.interval;
|
|
@@ -137,13 +144,6 @@ var RemoteMountBackend = /*#__PURE__*/(0, _createClass2.default)(function Remote
|
|
|
137
144
|
(0, _defineProperty2.default)(this, "setUndergoingMaintenance", function (value) {
|
|
138
145
|
_this.attributes.undergoing_maintenance = value;
|
|
139
146
|
});
|
|
140
|
-
// int64 # Remote Mount Backend ID.
|
|
141
|
-
(0, _defineProperty2.default)(this, "getId", function () {
|
|
142
|
-
return _this.attributes.id;
|
|
143
|
-
});
|
|
144
|
-
(0, _defineProperty2.default)(this, "setId", function (value) {
|
|
145
|
-
_this.attributes.id = value;
|
|
146
|
-
});
|
|
147
147
|
// Reset backend status to healthy
|
|
148
148
|
(0, _defineProperty2.default)(this, "resetStatus", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
149
149
|
var params,
|
|
@@ -452,6 +452,7 @@ _RemoteMountBackend = RemoteMountBackend;
|
|
|
452
452
|
// Parameters:
|
|
453
453
|
// 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.
|
|
454
454
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
455
|
+
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `remote_server_mount_id`.
|
|
455
456
|
(0, _defineProperty2.default)(RemoteMountBackend, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
456
457
|
var _response$data;
|
|
457
458
|
var params,
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
package/src/models/GpgKey.js
CHANGED
|
@@ -77,6 +77,34 @@ class GpgKey {
|
|
|
77
77
|
this.attributes.private_key_password = value
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
// string # Expiration date of the key. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
81
|
+
getGenerateExpiresAt = () => this.attributes.generate_expires_at
|
|
82
|
+
|
|
83
|
+
setGenerateExpiresAt = value => {
|
|
84
|
+
this.attributes.generate_expires_at = value
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// boolean # If true, generate a new GPG key pair. Can not be used with `public_key`/`private_key`
|
|
88
|
+
getGenerateKeypair = () => this.attributes.generate_keypair
|
|
89
|
+
|
|
90
|
+
setGenerateKeypair = value => {
|
|
91
|
+
this.attributes.generate_keypair = value
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// string # Full name of the key owner. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
95
|
+
getGenerateFullName = () => this.attributes.generate_full_name
|
|
96
|
+
|
|
97
|
+
setGenerateFullName = value => {
|
|
98
|
+
this.attributes.generate_full_name = value
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// string # Email address of the key owner. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
102
|
+
getGenerateEmail = () => this.attributes.generate_email
|
|
103
|
+
|
|
104
|
+
setGenerateEmail = value => {
|
|
105
|
+
this.attributes.generate_email = value
|
|
106
|
+
}
|
|
107
|
+
|
|
80
108
|
// Parameters:
|
|
81
109
|
// public_key - string - Your GPG public key
|
|
82
110
|
// private_key - string - Your GPG private key.
|
|
@@ -222,6 +250,10 @@ class GpgKey {
|
|
|
222
250
|
// private_key - string - Your GPG private key.
|
|
223
251
|
// private_key_password - string - Your GPG private key password. Only required for password protected keys.
|
|
224
252
|
// name (required) - string - Your GPG key name.
|
|
253
|
+
// generate_expires_at - string - Expiration date of the key. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
254
|
+
// generate_keypair - boolean - If true, generate a new GPG key pair. Can not be used with `public_key`/`private_key`
|
|
255
|
+
// generate_full_name - string - Full name of the key owner. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
256
|
+
// generate_email - string - Email address of the key owner. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
225
257
|
static create = async (params = {}, options = {}) => {
|
|
226
258
|
if (!params.name) {
|
|
227
259
|
throw new errors.MissingParameterError('Parameter missing: name')
|
|
@@ -247,6 +279,18 @@ class GpgKey {
|
|
|
247
279
|
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params.name)}`)
|
|
248
280
|
}
|
|
249
281
|
|
|
282
|
+
if (params.generate_expires_at && !isString(params.generate_expires_at)) {
|
|
283
|
+
throw new errors.InvalidParameterError(`Bad parameter: generate_expires_at must be of type String, received ${getType(params.generate_expires_at)}`)
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if (params.generate_full_name && !isString(params.generate_full_name)) {
|
|
287
|
+
throw new errors.InvalidParameterError(`Bad parameter: generate_full_name must be of type String, received ${getType(params.generate_full_name)}`)
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if (params.generate_email && !isString(params.generate_email)) {
|
|
291
|
+
throw new errors.InvalidParameterError(`Bad parameter: generate_email must be of type String, received ${getType(params.generate_email)}`)
|
|
292
|
+
}
|
|
293
|
+
|
|
250
294
|
const response = await Api.sendRequest('/gpg_keys', 'POST', params, options)
|
|
251
295
|
|
|
252
296
|
return new GpgKey(response?.data, options)
|
package/src/models/PublicKey.js
CHANGED
|
@@ -59,6 +59,13 @@ class PublicKey {
|
|
|
59
59
|
this.attributes.fingerprint_sha256 = value
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
// string # Can be invalid, not_generated, generating, complete
|
|
63
|
+
getStatus = () => this.attributes.status
|
|
64
|
+
|
|
65
|
+
setStatus = value => {
|
|
66
|
+
this.attributes.status = value
|
|
67
|
+
}
|
|
68
|
+
|
|
62
69
|
// date-time # Key's most recent login time via SFTP
|
|
63
70
|
getLastLoginAt = () => this.attributes.last_login_at
|
|
64
71
|
|
|
@@ -66,6 +73,20 @@ class PublicKey {
|
|
|
66
73
|
this.attributes.last_login_at = value
|
|
67
74
|
}
|
|
68
75
|
|
|
76
|
+
// string # Private key generated for the user.
|
|
77
|
+
getPrivateKey = () => this.attributes.private_key
|
|
78
|
+
|
|
79
|
+
setPrivateKey = value => {
|
|
80
|
+
this.attributes.private_key = value
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// string # Public key generated for the user.
|
|
84
|
+
getPublicKey = () => this.attributes.public_key
|
|
85
|
+
|
|
86
|
+
setPublicKey = value => {
|
|
87
|
+
this.attributes.public_key = value
|
|
88
|
+
}
|
|
89
|
+
|
|
69
90
|
// string # Username of the user this public key is associated with
|
|
70
91
|
getUsername = () => this.attributes.username
|
|
71
92
|
|
|
@@ -80,11 +101,32 @@ class PublicKey {
|
|
|
80
101
|
this.attributes.user_id = value
|
|
81
102
|
}
|
|
82
103
|
|
|
83
|
-
//
|
|
84
|
-
|
|
104
|
+
// boolean # If true, generate a new SSH key pair. Can not be used with `public_key`
|
|
105
|
+
getGenerateKeypair = () => this.attributes.generate_keypair
|
|
85
106
|
|
|
86
|
-
|
|
87
|
-
this.attributes.
|
|
107
|
+
setGenerateKeypair = value => {
|
|
108
|
+
this.attributes.generate_keypair = value
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// string # Password for the private key. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
112
|
+
getGeneratePrivateKeyPassword = () => this.attributes.generate_private_key_password
|
|
113
|
+
|
|
114
|
+
setGeneratePrivateKeyPassword = value => {
|
|
115
|
+
this.attributes.generate_private_key_password = value
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// string # Type of key to generate. One of rsa, dsa, ecdsa, ed25519. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
119
|
+
getGenerateAlgorithm = () => this.attributes.generate_algorithm
|
|
120
|
+
|
|
121
|
+
setGenerateAlgorithm = value => {
|
|
122
|
+
this.attributes.generate_algorithm = value
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// int64 # Length of key to generate. If algorithm is ecdsa, this is the signature size. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
126
|
+
getGenerateLength = () => this.attributes.generate_length
|
|
127
|
+
|
|
128
|
+
setGenerateLength = value => {
|
|
129
|
+
this.attributes.generate_length = value
|
|
88
130
|
}
|
|
89
131
|
|
|
90
132
|
// Parameters:
|
|
@@ -226,16 +268,16 @@ class PublicKey {
|
|
|
226
268
|
// Parameters:
|
|
227
269
|
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
228
270
|
// title (required) - string - Internal reference for key.
|
|
229
|
-
// public_key
|
|
271
|
+
// public_key - string - Actual contents of SSH key.
|
|
272
|
+
// generate_keypair - boolean - If true, generate a new SSH key pair. Can not be used with `public_key`
|
|
273
|
+
// generate_private_key_password - string - Password for the private key. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
274
|
+
// generate_algorithm - string - Type of key to generate. One of rsa, dsa, ecdsa, ed25519. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
275
|
+
// generate_length - int64 - Length of key to generate. If algorithm is ecdsa, this is the signature size. Used for the generation of the key. Will be ignored if `generate_keypair` is false.
|
|
230
276
|
static create = async (params = {}, options = {}) => {
|
|
231
277
|
if (!params.title) {
|
|
232
278
|
throw new errors.MissingParameterError('Parameter missing: title')
|
|
233
279
|
}
|
|
234
280
|
|
|
235
|
-
if (!params.public_key) {
|
|
236
|
-
throw new errors.MissingParameterError('Parameter missing: public_key')
|
|
237
|
-
}
|
|
238
|
-
|
|
239
281
|
if (params.user_id && !isInt(params.user_id)) {
|
|
240
282
|
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params.user_id)}`)
|
|
241
283
|
}
|
|
@@ -248,6 +290,18 @@ class PublicKey {
|
|
|
248
290
|
throw new errors.InvalidParameterError(`Bad parameter: public_key must be of type String, received ${getType(params.public_key)}`)
|
|
249
291
|
}
|
|
250
292
|
|
|
293
|
+
if (params.generate_private_key_password && !isString(params.generate_private_key_password)) {
|
|
294
|
+
throw new errors.InvalidParameterError(`Bad parameter: generate_private_key_password must be of type String, received ${getType(params.generate_private_key_password)}`)
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (params.generate_algorithm && !isString(params.generate_algorithm)) {
|
|
298
|
+
throw new errors.InvalidParameterError(`Bad parameter: generate_algorithm must be of type String, received ${getType(params.generate_algorithm)}`)
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (params.generate_length && !isInt(params.generate_length)) {
|
|
302
|
+
throw new errors.InvalidParameterError(`Bad parameter: generate_length must be of type Int, received ${getType(params.generate_length)}`)
|
|
303
|
+
}
|
|
304
|
+
|
|
251
305
|
const response = await Api.sendRequest('/public_keys', 'POST', params, options)
|
|
252
306
|
|
|
253
307
|
return new PublicKey(response?.data, options)
|
|
@@ -63,6 +63,13 @@ class RemoteMountBackend {
|
|
|
63
63
|
this.attributes.health_check_type = value
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
// int64 # Unique identifier for this backend.
|
|
67
|
+
getId = () => this.attributes.id
|
|
68
|
+
|
|
69
|
+
setId = value => {
|
|
70
|
+
this.attributes.id = value
|
|
71
|
+
}
|
|
72
|
+
|
|
66
73
|
// int64 # Interval in seconds between health checks.
|
|
67
74
|
getInterval = () => this.attributes.interval
|
|
68
75
|
|
|
@@ -133,13 +140,6 @@ class RemoteMountBackend {
|
|
|
133
140
|
this.attributes.undergoing_maintenance = value
|
|
134
141
|
}
|
|
135
142
|
|
|
136
|
-
// int64 # Remote Mount Backend ID.
|
|
137
|
-
getId = () => this.attributes.id
|
|
138
|
-
|
|
139
|
-
setId = value => {
|
|
140
|
-
this.attributes.id = value
|
|
141
|
-
}
|
|
142
|
-
|
|
143
143
|
// Reset backend status to healthy
|
|
144
144
|
resetStatus = async (params = {}) => {
|
|
145
145
|
if (!this.attributes.id) {
|
|
@@ -310,6 +310,7 @@ class RemoteMountBackend {
|
|
|
310
310
|
// Parameters:
|
|
311
311
|
// 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.
|
|
312
312
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
313
|
+
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `remote_server_mount_id`.
|
|
313
314
|
static list = async (params = {}, options = {}) => {
|
|
314
315
|
if (params.cursor && !isString(params.cursor)) {
|
|
315
316
|
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
|