files.com 1.0.240 → 1.0.242

Sign up to get free protection for your applications and to get access to all the features.
package/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.240
1
+ 1.0.242
@@ -438,6 +438,7 @@ await Site.update({
438
438
  'logo_delete': true,
439
439
  'bundle_watermark_attachment_delete': true,
440
440
  'disable_2fa_with_delay': true,
441
+ 'session_expiry_minutes': 1,
441
442
  })
442
443
  ```
443
444
 
@@ -575,3 +576,4 @@ await Site.update({
575
576
  * `ldap_password_change` (string): New LDAP password.
576
577
  * `ldap_password_change_confirmation` (string): Confirm new LDAP password.
577
578
  * `smtp_password` (string): Password for SMTP server.
579
+ * `session_expiry_minutes` (int64): Session expiry in minutes
@@ -869,7 +869,7 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
869
869
  nextFileUploadPart = _context14.sent;
870
870
  concurrentUploads.push(_Api.default.sendFilePart(nextFileUploadPart.upload_uri, 'PUT', buffer));
871
871
  chunks = [firstChunkForNextPart];
872
- length = 1;
872
+ length = firstChunkForNextPart.length;
873
873
  readableStream.resume();
874
874
  _context14.next = 21;
875
875
  break;
@@ -893,12 +893,18 @@ var Site = /*#__PURE__*/(0, _createClass2.default)(function Site() {
893
893
  }
894
894
  throw new errors.InvalidParameterError("Bad parameter: smtp_password must be of type String, received ".concat((0, _utils.getType)(params['smtp_password'])));
895
895
  case 128:
896
- _context3.next = 130;
897
- return _Api.default.sendRequest("/site", 'PATCH', params, options);
896
+ if (!(params['session_expiry_minutes'] && !(0, _utils.isInt)(params['session_expiry_minutes']))) {
897
+ _context3.next = 130;
898
+ break;
899
+ }
900
+ throw new errors.InvalidParameterError("Bad parameter: session_expiry_minutes must be of type Int, received ".concat((0, _utils.getType)(params['session_expiry_minutes'])));
898
901
  case 130:
902
+ _context3.next = 132;
903
+ return _Api.default.sendRequest("/site", 'PATCH', params, options);
904
+ case 132:
899
905
  response = _context3.sent;
900
906
  return _context3.abrupt("return", new Site(response === null || response === void 0 ? void 0 : response.data, options));
901
- case 132:
907
+ case 134:
902
908
  case "end":
903
909
  return _context3.stop();
904
910
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.0.240",
3
+ "version": "1.0.242",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
@@ -116,7 +116,7 @@ class File {
116
116
  concurrentUploads.push(Api.sendFilePart(nextFileUploadPart.upload_uri, 'PUT', buffer))
117
117
 
118
118
  chunks = [firstChunkForNextPart]
119
- length = 1
119
+ length = firstChunkForNextPart.length
120
120
 
121
121
  readableStream.resume()
122
122
  } else {
@@ -591,6 +591,7 @@ class Site {
591
591
  // ldap_password_change - string - New LDAP password.
592
592
  // ldap_password_change_confirmation - string - Confirm new LDAP password.
593
593
  // smtp_password - string - Password for SMTP server.
594
+ // session_expiry_minutes - int64 - Session expiry in minutes
594
595
  static update = async (params = {}, options = {}) => {
595
596
  if (params['name'] && !isString(params['name'])) {
596
597
  throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params['name'])}`)
@@ -844,6 +845,10 @@ class Site {
844
845
  throw new errors.InvalidParameterError(`Bad parameter: smtp_password must be of type String, received ${getType(params['smtp_password'])}`)
845
846
  }
846
847
 
848
+ if (params['session_expiry_minutes'] && !isInt(params['session_expiry_minutes'])) {
849
+ throw new errors.InvalidParameterError(`Bad parameter: session_expiry_minutes must be of type Int, received ${getType(params['session_expiry_minutes'])}`)
850
+ }
851
+
847
852
  const response = await Api.sendRequest(`/site`, 'PATCH', params, options)
848
853
 
849
854
  return new Site(response?.data, options)
package/test/src/index.js CHANGED
@@ -102,6 +102,30 @@ const testSuite = async () => {
102
102
  Logger.info('***** testUploadAndDownload() succeeded! *****')
103
103
  }
104
104
 
105
+ /* to run this test, put a file (or symlink) at huge-file.ext * /
106
+ const testUploadHugeFile = async () => {
107
+ const sourceFilePath = '../huge-file.ext'
108
+
109
+ const displayName = `huge-file__${nonce}.ext`
110
+ const destinationPath = `${SDK_TEST_ROOT_FOLDER}/${displayName}`
111
+
112
+ const file = await File.uploadFile(destinationPath, sourceFilePath)
113
+
114
+ assert(!!file.path)
115
+ assert(file.display_name === displayName)
116
+
117
+ const foundFile = await File.find(destinationPath)
118
+
119
+ assert(foundFile.path === destinationPath)
120
+ assert(foundFile.display_name === displayName)
121
+ assert(typeof foundFile.getDownloadUri() === 'undefined')
122
+
123
+ await file.delete()
124
+
125
+ Logger.info('***** testUploadHugeFile() succeeded! *****')
126
+ }
127
+ /**/
128
+
105
129
  const testSession = async () => {
106
130
  const username = process.env.FILES_SESSION_USERNAME
107
131
  const password = process.env.FILES_SESSION_PASSWORD
@@ -177,6 +201,7 @@ const testSuite = async () => {
177
201
 
178
202
  await testFolderListAutoPagination()
179
203
  await testUploadAndDownload()
204
+ // await testUploadHugeFile() // to run this test, put a file (or symlink) at huge-file.ext
180
205
  await testSession()
181
206
  await testFailure()
182
207
  await testUserListAndUpdate()