files.com 1.0.434 → 1.0.436
Sign up to get free protection for your applications and to get access to all the features.
- package/_VERSION +1 -1
- package/docs/models/Group.md +4 -4
- package/docs/models/User.md +1 -1
- package/lib/Files.js +1 -1
- package/lib/models/Group.js +21 -15
- package/lib/models/User.js +62 -56
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/Group.js +11 -7
- package/src/models/User.js +5 -1
package/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.436
|
package/docs/models/Group.md
CHANGED
@@ -59,20 +59,20 @@ await Group.find(id)
|
|
59
59
|
|
60
60
|
```
|
61
61
|
await Group.create({
|
62
|
-
'name': "owners",
|
63
62
|
'notes': "example",
|
64
63
|
'user_ids': "1",
|
65
64
|
'admin_ids': "1",
|
65
|
+
'name': "name",
|
66
66
|
})
|
67
67
|
```
|
68
68
|
|
69
69
|
|
70
70
|
### Parameters
|
71
71
|
|
72
|
-
* `name` (string): Group name.
|
73
72
|
* `notes` (string): Group notes.
|
74
73
|
* `user_ids` (string): A list of user ids. If sent as a string, should be comma-delimited.
|
75
74
|
* `admin_ids` (string): A list of group admin user ids. If sent as a string, should be comma-delimited.
|
75
|
+
* `name` (string): Required - Group name.
|
76
76
|
|
77
77
|
---
|
78
78
|
|
@@ -82,20 +82,20 @@ await Group.create({
|
|
82
82
|
const [group] = await Group.list()
|
83
83
|
|
84
84
|
await group.update({
|
85
|
-
'name': "owners",
|
86
85
|
'notes': "example",
|
87
86
|
'user_ids': "1",
|
88
87
|
'admin_ids': "1",
|
88
|
+
'name': "owners",
|
89
89
|
})
|
90
90
|
```
|
91
91
|
|
92
92
|
### Parameters
|
93
93
|
|
94
94
|
* `id` (int64): Required - Group ID.
|
95
|
-
* `name` (string): Group name.
|
96
95
|
* `notes` (string): Group notes.
|
97
96
|
* `user_ids` (string): A list of user ids. If sent as a string, should be comma-delimited.
|
98
97
|
* `admin_ids` (string): A list of group admin user ids. If sent as a string, should be comma-delimited.
|
98
|
+
* `name` (string): Group name.
|
99
99
|
|
100
100
|
### Example Response
|
101
101
|
|
package/docs/models/User.md
CHANGED
@@ -279,7 +279,7 @@ await User.create({
|
|
279
279
|
* `require_2fa` (string): 2FA required setting
|
280
280
|
* `time_zone` (string): User time zone
|
281
281
|
* `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.
|
282
|
-
* `username` (string): User's username
|
282
|
+
* `username` (string): Required - User's username
|
283
283
|
|
284
284
|
---
|
285
285
|
|
package/lib/Files.js
CHANGED
@@ -11,7 +11,7 @@ var endpointPrefix = '/api/rest/v1';
|
|
11
11
|
var apiKey;
|
12
12
|
var baseUrl = 'https://app.files.com';
|
13
13
|
var sessionId = null;
|
14
|
-
var version = '1.0.
|
14
|
+
var version = '1.0.436';
|
15
15
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
16
16
|
var logLevel = _Logger.LogLevel.INFO;
|
17
17
|
var debugRequest = false;
|
package/lib/models/Group.js
CHANGED
@@ -76,10 +76,10 @@ var Group = /*#__PURE__*/(0, _createClass2.default)(function Group() {
|
|
76
76
|
_this.attributes.usernames = value;
|
77
77
|
});
|
78
78
|
// Parameters:
|
79
|
-
// name - string - Group name.
|
80
79
|
// notes - string - Group notes.
|
81
80
|
// user_ids - string - A list of user ids. If sent as a string, should be comma-delimited.
|
82
81
|
// admin_ids - string - A list of group admin user ids. If sent as a string, should be comma-delimited.
|
82
|
+
// name - string - Group name.
|
83
83
|
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
84
84
|
var params,
|
85
85
|
response,
|
@@ -107,29 +107,29 @@ var Group = /*#__PURE__*/(0, _createClass2.default)(function Group() {
|
|
107
107
|
}
|
108
108
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
|
109
109
|
case 8:
|
110
|
-
if (!(params['
|
110
|
+
if (!(params['notes'] && !(0, _utils.isString)(params['notes']))) {
|
111
111
|
_context.next = 10;
|
112
112
|
break;
|
113
113
|
}
|
114
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
114
|
+
throw new errors.InvalidParameterError("Bad parameter: notes must be of type String, received ".concat((0, _utils.getType)(params['notes'])));
|
115
115
|
case 10:
|
116
|
-
if (!(params['
|
116
|
+
if (!(params['user_ids'] && !(0, _utils.isString)(params['user_ids']))) {
|
117
117
|
_context.next = 12;
|
118
118
|
break;
|
119
119
|
}
|
120
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
120
|
+
throw new errors.InvalidParameterError("Bad parameter: user_ids must be of type String, received ".concat((0, _utils.getType)(params['user_ids'])));
|
121
121
|
case 12:
|
122
|
-
if (!(params['
|
122
|
+
if (!(params['admin_ids'] && !(0, _utils.isString)(params['admin_ids']))) {
|
123
123
|
_context.next = 14;
|
124
124
|
break;
|
125
125
|
}
|
126
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
126
|
+
throw new errors.InvalidParameterError("Bad parameter: admin_ids must be of type String, received ".concat((0, _utils.getType)(params['admin_ids'])));
|
127
127
|
case 14:
|
128
|
-
if (!(params['
|
128
|
+
if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
|
129
129
|
_context.next = 16;
|
130
130
|
break;
|
131
131
|
}
|
132
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
132
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
|
133
133
|
case 16:
|
134
134
|
if (params['id']) {
|
135
135
|
_context.next = 22;
|
@@ -342,10 +342,10 @@ _class = Group;
|
|
342
342
|
return _class.find(id, params, options);
|
343
343
|
});
|
344
344
|
// Parameters:
|
345
|
-
// name - string - Group name.
|
346
345
|
// notes - string - Group notes.
|
347
346
|
// user_ids - string - A list of user ids. If sent as a string, should be comma-delimited.
|
348
347
|
// admin_ids - string - A list of group admin user ids. If sent as a string, should be comma-delimited.
|
348
|
+
// name (required) - string - Group name.
|
349
349
|
(0, _defineProperty2.default)(Group, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
350
350
|
var params,
|
351
351
|
options,
|
@@ -356,11 +356,11 @@ _class = Group;
|
|
356
356
|
case 0:
|
357
357
|
params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
358
358
|
options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
359
|
-
if (
|
359
|
+
if (params['name']) {
|
360
360
|
_context5.next = 4;
|
361
361
|
break;
|
362
362
|
}
|
363
|
-
throw new errors.
|
363
|
+
throw new errors.MissingParameterError('Parameter missing: name');
|
364
364
|
case 4:
|
365
365
|
if (!(params['notes'] && !(0, _utils.isString)(params['notes']))) {
|
366
366
|
_context5.next = 6;
|
@@ -380,12 +380,18 @@ _class = Group;
|
|
380
380
|
}
|
381
381
|
throw new errors.InvalidParameterError("Bad parameter: admin_ids must be of type String, received ".concat((0, _utils.getType)(params['admin_ids'])));
|
382
382
|
case 10:
|
383
|
-
|
384
|
-
|
383
|
+
if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
|
384
|
+
_context5.next = 12;
|
385
|
+
break;
|
386
|
+
}
|
387
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
|
385
388
|
case 12:
|
389
|
+
_context5.next = 14;
|
390
|
+
return _Api.default.sendRequest("/groups", 'POST', params, options);
|
391
|
+
case 14:
|
386
392
|
response = _context5.sent;
|
387
393
|
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
388
|
-
case
|
394
|
+
case 16:
|
389
395
|
case "end":
|
390
396
|
return _context5.stop();
|
391
397
|
}
|
package/lib/models/User.js
CHANGED
@@ -1181,7 +1181,7 @@ _class = User;
|
|
1181
1181
|
// require_2fa - string - 2FA required setting
|
1182
1182
|
// time_zone - string - User time zone
|
1183
1183
|
// 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.
|
1184
|
-
// username - string - User's username
|
1184
|
+
// username (required) - string - User's username
|
1185
1185
|
(0, _defineProperty2.default)(User, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
1186
1186
|
var params,
|
1187
1187
|
options,
|
@@ -1192,168 +1192,174 @@ _class = User;
|
|
1192
1192
|
case 0:
|
1193
1193
|
params = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
|
1194
1194
|
options = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : {};
|
1195
|
-
if (
|
1195
|
+
if (params['username']) {
|
1196
1196
|
_context8.next = 4;
|
1197
1197
|
break;
|
1198
1198
|
}
|
1199
|
-
throw new errors.
|
1199
|
+
throw new errors.MissingParameterError('Parameter missing: username');
|
1200
1200
|
case 4:
|
1201
|
-
if (!(params['
|
1201
|
+
if (!(params['change_password'] && !(0, _utils.isString)(params['change_password']))) {
|
1202
1202
|
_context8.next = 6;
|
1203
1203
|
break;
|
1204
1204
|
}
|
1205
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1205
|
+
throw new errors.InvalidParameterError("Bad parameter: change_password must be of type String, received ".concat((0, _utils.getType)(params['change_password'])));
|
1206
1206
|
case 6:
|
1207
|
-
if (!(params['
|
1207
|
+
if (!(params['change_password_confirmation'] && !(0, _utils.isString)(params['change_password_confirmation']))) {
|
1208
1208
|
_context8.next = 8;
|
1209
1209
|
break;
|
1210
1210
|
}
|
1211
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1211
|
+
throw new errors.InvalidParameterError("Bad parameter: change_password_confirmation must be of type String, received ".concat((0, _utils.getType)(params['change_password_confirmation'])));
|
1212
1212
|
case 8:
|
1213
|
-
if (!(params['
|
1213
|
+
if (!(params['email'] && !(0, _utils.isString)(params['email']))) {
|
1214
1214
|
_context8.next = 10;
|
1215
1215
|
break;
|
1216
1216
|
}
|
1217
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1217
|
+
throw new errors.InvalidParameterError("Bad parameter: email must be of type String, received ".concat((0, _utils.getType)(params['email'])));
|
1218
1218
|
case 10:
|
1219
|
-
if (!(params['
|
1219
|
+
if (!(params['grant_permission'] && !(0, _utils.isString)(params['grant_permission']))) {
|
1220
1220
|
_context8.next = 12;
|
1221
1221
|
break;
|
1222
1222
|
}
|
1223
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1223
|
+
throw new errors.InvalidParameterError("Bad parameter: grant_permission must be of type String, received ".concat((0, _utils.getType)(params['grant_permission'])));
|
1224
1224
|
case 12:
|
1225
|
-
if (!(params['
|
1225
|
+
if (!(params['group_id'] && !(0, _utils.isInt)(params['group_id']))) {
|
1226
1226
|
_context8.next = 14;
|
1227
1227
|
break;
|
1228
1228
|
}
|
1229
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1229
|
+
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params['group_id'])));
|
1230
1230
|
case 14:
|
1231
|
-
if (!(params['
|
1231
|
+
if (!(params['group_ids'] && !(0, _utils.isString)(params['group_ids']))) {
|
1232
1232
|
_context8.next = 16;
|
1233
1233
|
break;
|
1234
1234
|
}
|
1235
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1235
|
+
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params['group_ids'])));
|
1236
1236
|
case 16:
|
1237
|
-
if (!(params['
|
1237
|
+
if (!(params['imported_password_hash'] && !(0, _utils.isString)(params['imported_password_hash']))) {
|
1238
1238
|
_context8.next = 18;
|
1239
1239
|
break;
|
1240
1240
|
}
|
1241
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1241
|
+
throw new errors.InvalidParameterError("Bad parameter: imported_password_hash must be of type String, received ".concat((0, _utils.getType)(params['imported_password_hash'])));
|
1242
1242
|
case 18:
|
1243
|
-
if (!(params['
|
1243
|
+
if (!(params['password'] && !(0, _utils.isString)(params['password']))) {
|
1244
1244
|
_context8.next = 20;
|
1245
1245
|
break;
|
1246
1246
|
}
|
1247
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1247
|
+
throw new errors.InvalidParameterError("Bad parameter: password must be of type String, received ".concat((0, _utils.getType)(params['password'])));
|
1248
1248
|
case 20:
|
1249
|
-
if (!(params['
|
1249
|
+
if (!(params['password_confirmation'] && !(0, _utils.isString)(params['password_confirmation']))) {
|
1250
1250
|
_context8.next = 22;
|
1251
1251
|
break;
|
1252
1252
|
}
|
1253
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1253
|
+
throw new errors.InvalidParameterError("Bad parameter: password_confirmation must be of type String, received ".concat((0, _utils.getType)(params['password_confirmation'])));
|
1254
1254
|
case 22:
|
1255
|
-
if (!(params['
|
1255
|
+
if (!(params['allowed_ips'] && !(0, _utils.isString)(params['allowed_ips']))) {
|
1256
1256
|
_context8.next = 24;
|
1257
1257
|
break;
|
1258
1258
|
}
|
1259
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1259
|
+
throw new errors.InvalidParameterError("Bad parameter: allowed_ips must be of type String, received ".concat((0, _utils.getType)(params['allowed_ips'])));
|
1260
1260
|
case 24:
|
1261
|
-
if (!(params['
|
1261
|
+
if (!(params['authenticate_until'] && !(0, _utils.isString)(params['authenticate_until']))) {
|
1262
1262
|
_context8.next = 26;
|
1263
1263
|
break;
|
1264
1264
|
}
|
1265
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1265
|
+
throw new errors.InvalidParameterError("Bad parameter: authenticate_until must be of type String, received ".concat((0, _utils.getType)(params['authenticate_until'])));
|
1266
1266
|
case 26:
|
1267
|
-
if (!(params['
|
1267
|
+
if (!(params['authentication_method'] && !(0, _utils.isString)(params['authentication_method']))) {
|
1268
1268
|
_context8.next = 28;
|
1269
1269
|
break;
|
1270
1270
|
}
|
1271
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1271
|
+
throw new errors.InvalidParameterError("Bad parameter: authentication_method must be of type String, received ".concat((0, _utils.getType)(params['authentication_method'])));
|
1272
1272
|
case 28:
|
1273
|
-
if (!(params['
|
1273
|
+
if (!(params['header_text'] && !(0, _utils.isString)(params['header_text']))) {
|
1274
1274
|
_context8.next = 30;
|
1275
1275
|
break;
|
1276
1276
|
}
|
1277
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1277
|
+
throw new errors.InvalidParameterError("Bad parameter: header_text must be of type String, received ".concat((0, _utils.getType)(params['header_text'])));
|
1278
1278
|
case 30:
|
1279
|
-
if (!(params['
|
1279
|
+
if (!(params['language'] && !(0, _utils.isString)(params['language']))) {
|
1280
1280
|
_context8.next = 32;
|
1281
1281
|
break;
|
1282
1282
|
}
|
1283
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1283
|
+
throw new errors.InvalidParameterError("Bad parameter: language must be of type String, received ".concat((0, _utils.getType)(params['language'])));
|
1284
1284
|
case 32:
|
1285
|
-
if (!(params['
|
1285
|
+
if (!(params['notification_daily_send_time'] && !(0, _utils.isInt)(params['notification_daily_send_time']))) {
|
1286
1286
|
_context8.next = 34;
|
1287
1287
|
break;
|
1288
1288
|
}
|
1289
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1289
|
+
throw new errors.InvalidParameterError("Bad parameter: notification_daily_send_time must be of type Int, received ".concat((0, _utils.getType)(params['notification_daily_send_time'])));
|
1290
1290
|
case 34:
|
1291
|
-
if (!(params['
|
1291
|
+
if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
|
1292
1292
|
_context8.next = 36;
|
1293
1293
|
break;
|
1294
1294
|
}
|
1295
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1295
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
|
1296
1296
|
case 36:
|
1297
|
-
if (!(params['
|
1297
|
+
if (!(params['company'] && !(0, _utils.isString)(params['company']))) {
|
1298
1298
|
_context8.next = 38;
|
1299
1299
|
break;
|
1300
1300
|
}
|
1301
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1301
|
+
throw new errors.InvalidParameterError("Bad parameter: company must be of type String, received ".concat((0, _utils.getType)(params['company'])));
|
1302
1302
|
case 38:
|
1303
|
-
if (!(params['
|
1303
|
+
if (!(params['notes'] && !(0, _utils.isString)(params['notes']))) {
|
1304
1304
|
_context8.next = 40;
|
1305
1305
|
break;
|
1306
1306
|
}
|
1307
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1307
|
+
throw new errors.InvalidParameterError("Bad parameter: notes must be of type String, received ".concat((0, _utils.getType)(params['notes'])));
|
1308
1308
|
case 40:
|
1309
|
-
if (!(params['
|
1309
|
+
if (!(params['password_validity_days'] && !(0, _utils.isInt)(params['password_validity_days']))) {
|
1310
1310
|
_context8.next = 42;
|
1311
1311
|
break;
|
1312
1312
|
}
|
1313
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1313
|
+
throw new errors.InvalidParameterError("Bad parameter: password_validity_days must be of type Int, received ".concat((0, _utils.getType)(params['password_validity_days'])));
|
1314
1314
|
case 42:
|
1315
|
-
if (!(params['
|
1315
|
+
if (!(params['require_login_by'] && !(0, _utils.isString)(params['require_login_by']))) {
|
1316
1316
|
_context8.next = 44;
|
1317
1317
|
break;
|
1318
1318
|
}
|
1319
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1319
|
+
throw new errors.InvalidParameterError("Bad parameter: require_login_by must be of type String, received ".concat((0, _utils.getType)(params['require_login_by'])));
|
1320
1320
|
case 44:
|
1321
|
-
if (!(params['
|
1321
|
+
if (!(params['ssl_required'] && !(0, _utils.isString)(params['ssl_required']))) {
|
1322
1322
|
_context8.next = 46;
|
1323
1323
|
break;
|
1324
1324
|
}
|
1325
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1325
|
+
throw new errors.InvalidParameterError("Bad parameter: ssl_required must be of type String, received ".concat((0, _utils.getType)(params['ssl_required'])));
|
1326
1326
|
case 46:
|
1327
|
-
if (!(params['
|
1327
|
+
if (!(params['sso_strategy_id'] && !(0, _utils.isInt)(params['sso_strategy_id']))) {
|
1328
1328
|
_context8.next = 48;
|
1329
1329
|
break;
|
1330
1330
|
}
|
1331
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1331
|
+
throw new errors.InvalidParameterError("Bad parameter: sso_strategy_id must be of type Int, received ".concat((0, _utils.getType)(params['sso_strategy_id'])));
|
1332
1332
|
case 48:
|
1333
|
-
if (!(params['
|
1333
|
+
if (!(params['require_2fa'] && !(0, _utils.isString)(params['require_2fa']))) {
|
1334
1334
|
_context8.next = 50;
|
1335
1335
|
break;
|
1336
1336
|
}
|
1337
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1337
|
+
throw new errors.InvalidParameterError("Bad parameter: require_2fa must be of type String, received ".concat((0, _utils.getType)(params['require_2fa'])));
|
1338
1338
|
case 50:
|
1339
|
-
if (!(params['
|
1339
|
+
if (!(params['time_zone'] && !(0, _utils.isString)(params['time_zone']))) {
|
1340
1340
|
_context8.next = 52;
|
1341
1341
|
break;
|
1342
1342
|
}
|
1343
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1343
|
+
throw new errors.InvalidParameterError("Bad parameter: time_zone must be of type String, received ".concat((0, _utils.getType)(params['time_zone'])));
|
1344
1344
|
case 52:
|
1345
|
-
if (!(params['
|
1345
|
+
if (!(params['user_root'] && !(0, _utils.isString)(params['user_root']))) {
|
1346
1346
|
_context8.next = 54;
|
1347
1347
|
break;
|
1348
1348
|
}
|
1349
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
1349
|
+
throw new errors.InvalidParameterError("Bad parameter: user_root must be of type String, received ".concat((0, _utils.getType)(params['user_root'])));
|
1350
1350
|
case 54:
|
1351
|
-
|
1352
|
-
|
1351
|
+
if (!(params['username'] && !(0, _utils.isString)(params['username']))) {
|
1352
|
+
_context8.next = 56;
|
1353
|
+
break;
|
1354
|
+
}
|
1355
|
+
throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(params['username'])));
|
1353
1356
|
case 56:
|
1357
|
+
_context8.next = 58;
|
1358
|
+
return _Api.default.sendRequest("/users", 'POST', params, options);
|
1359
|
+
case 58:
|
1354
1360
|
response = _context8.sent;
|
1355
1361
|
return _context8.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
1356
|
-
case
|
1362
|
+
case 60:
|
1357
1363
|
case "end":
|
1358
1364
|
return _context8.stop();
|
1359
1365
|
}
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
package/src/models/Group.js
CHANGED
@@ -68,10 +68,10 @@ class Group {
|
|
68
68
|
|
69
69
|
|
70
70
|
// Parameters:
|
71
|
-
// name - string - Group name.
|
72
71
|
// notes - string - Group notes.
|
73
72
|
// user_ids - string - A list of user ids. If sent as a string, should be comma-delimited.
|
74
73
|
// admin_ids - string - A list of group admin user ids. If sent as a string, should be comma-delimited.
|
74
|
+
// name - string - Group name.
|
75
75
|
update = async (params = {}) => {
|
76
76
|
if (!this.attributes.id) {
|
77
77
|
throw new errors.EmptyPropertyError('Current object has no id')
|
@@ -85,9 +85,6 @@ class Group {
|
|
85
85
|
if (params['id'] && !isInt(params['id'])) {
|
86
86
|
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
87
87
|
}
|
88
|
-
if (params['name'] && !isString(params['name'])) {
|
89
|
-
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params['name'])}`)
|
90
|
-
}
|
91
88
|
if (params['notes'] && !isString(params['notes'])) {
|
92
89
|
throw new errors.InvalidParameterError(`Bad parameter: notes must be of type String, received ${getType(params['notes'])}`)
|
93
90
|
}
|
@@ -97,6 +94,9 @@ class Group {
|
|
97
94
|
if (params['admin_ids'] && !isString(params['admin_ids'])) {
|
98
95
|
throw new errors.InvalidParameterError(`Bad parameter: admin_ids must be of type String, received ${getType(params['admin_ids'])}`)
|
99
96
|
}
|
97
|
+
if (params['name'] && !isString(params['name'])) {
|
98
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params['name'])}`)
|
99
|
+
}
|
100
100
|
|
101
101
|
if (!params['id']) {
|
102
102
|
if (this.attributes.id) {
|
@@ -208,13 +208,13 @@ class Group {
|
|
208
208
|
Group.find(id, params, options)
|
209
209
|
|
210
210
|
// Parameters:
|
211
|
-
// name - string - Group name.
|
212
211
|
// notes - string - Group notes.
|
213
212
|
// user_ids - string - A list of user ids. If sent as a string, should be comma-delimited.
|
214
213
|
// admin_ids - string - A list of group admin user ids. If sent as a string, should be comma-delimited.
|
214
|
+
// name (required) - string - Group name.
|
215
215
|
static create = async (params = {}, options = {}) => {
|
216
|
-
if (
|
217
|
-
throw new errors.
|
216
|
+
if (!params['name']) {
|
217
|
+
throw new errors.MissingParameterError('Parameter missing: name')
|
218
218
|
}
|
219
219
|
|
220
220
|
if (params['notes'] && !isString(params['notes'])) {
|
@@ -229,6 +229,10 @@ class Group {
|
|
229
229
|
throw new errors.InvalidParameterError(`Bad parameter: admin_ids must be of type String, received ${getType(params['admin_ids'])}`)
|
230
230
|
}
|
231
231
|
|
232
|
+
if (params['name'] && !isString(params['name'])) {
|
233
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params['name'])}`)
|
234
|
+
}
|
235
|
+
|
232
236
|
const response = await Api.sendRequest(`/groups`, 'POST', params, options)
|
233
237
|
|
234
238
|
|
package/src/models/User.js
CHANGED
@@ -903,8 +903,12 @@ class User {
|
|
903
903
|
// require_2fa - string - 2FA required setting
|
904
904
|
// time_zone - string - User time zone
|
905
905
|
// 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.
|
906
|
-
// username - string - User's username
|
906
|
+
// username (required) - string - User's username
|
907
907
|
static create = async (params = {}, options = {}) => {
|
908
|
+
if (!params['username']) {
|
909
|
+
throw new errors.MissingParameterError('Parameter missing: username')
|
910
|
+
}
|
911
|
+
|
908
912
|
if (params['change_password'] && !isString(params['change_password'])) {
|
909
913
|
throw new errors.InvalidParameterError(`Bad parameter: change_password must be of type String, received ${getType(params['change_password'])}`)
|
910
914
|
}
|