files.com 1.0.281 → 1.0.283

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 CHANGED
@@ -1 +1 @@
1
- 1.0.281
1
+ 1.0.283
@@ -7,6 +7,7 @@
7
7
  "code": "abc123",
8
8
  "url": "https://subdomain.files.com/f/12345678",
9
9
  "description": "The public description of the bundle.",
10
+ "expires_at": "2000-01-01T01:00:00Z",
10
11
  "password_protected": true,
11
12
  "permissions": "read",
12
13
  "preview_only": true,
@@ -35,7 +36,6 @@
35
36
  "id": 1,
36
37
  "created_at": "2000-01-01T01:00:00Z",
37
38
  "dont_separate_submissions_by_folder": true,
38
- "expires_at": "2000-01-01T01:00:00Z",
39
39
  "max_uses": 1,
40
40
  "note": "The internal note on the bundle.",
41
41
  "path_template": "{{name}}_{{ip}}",
@@ -59,6 +59,7 @@
59
59
  * `code` (string): Bundle code. This code forms the end part of the Public URL.
60
60
  * `url` (string): Public URL of Share Link
61
61
  * `description` (string): Public description
62
+ * `expires_at` (date-time): Bundle expiration date/time
62
63
  * `password_protected` (boolean): Is this bundle password protected?
63
64
  * `permissions` (string): Permissions that apply to Folders in this Share Link.
64
65
  * `preview_only` (boolean): DEPRECATED: Restrict users to previewing files only. Use `permissions` instead.
@@ -72,7 +73,6 @@
72
73
  * `id` (int64): Bundle ID
73
74
  * `created_at` (date-time): Bundle created at date/time
74
75
  * `dont_separate_submissions_by_folder` (boolean): Do not create subfolders for files uploaded to this share. Note: there are subtle security pitfalls with allowing anonymous uploads from multiple users to live in the same folder. We strongly discourage use of this option unless absolutely required.
75
- * `expires_at` (date-time): Bundle expiration date/time
76
76
  * `max_uses` (int64): Maximum number of times bundle can be accessed
77
77
  * `note` (string): Bundle internal note
78
78
  * `path_template` (string): Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
@@ -283,6 +283,7 @@ await bundle.update({
283
283
  "code": "abc123",
284
284
  "url": "https://subdomain.files.com/f/12345678",
285
285
  "description": "The public description of the bundle.",
286
+ "expires_at": "2000-01-01T01:00:00Z",
286
287
  "password_protected": true,
287
288
  "permissions": "read",
288
289
  "preview_only": true,
@@ -311,7 +312,6 @@ await bundle.update({
311
312
  "id": 1,
312
313
  "created_at": "2000-01-01T01:00:00Z",
313
314
  "dont_separate_submissions_by_folder": true,
314
- "expires_at": "2000-01-01T01:00:00Z",
315
315
  "max_uses": 1,
316
316
  "note": "The internal note on the bundle.",
317
317
  "path_template": "{{name}}_{{ip}}",
@@ -52,6 +52,13 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
52
52
  (0, _defineProperty2.default)(this, "setDescription", function (value) {
53
53
  _this.attributes.description = value;
54
54
  });
55
+ // date-time # Bundle expiration date/time
56
+ (0, _defineProperty2.default)(this, "getExpiresAt", function () {
57
+ return _this.attributes.expires_at;
58
+ });
59
+ (0, _defineProperty2.default)(this, "setExpiresAt", function (value) {
60
+ _this.attributes.expires_at = value;
61
+ });
55
62
  // boolean # Is this bundle password protected?
56
63
  (0, _defineProperty2.default)(this, "getPasswordProtected", function () {
57
64
  return _this.attributes.password_protected;
@@ -140,13 +147,6 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
140
147
  (0, _defineProperty2.default)(this, "setDontSeparateSubmissionsByFolder", function (value) {
141
148
  _this.attributes.dont_separate_submissions_by_folder = value;
142
149
  });
143
- // date-time # Bundle expiration date/time
144
- (0, _defineProperty2.default)(this, "getExpiresAt", function () {
145
- return _this.attributes.expires_at;
146
- });
147
- (0, _defineProperty2.default)(this, "setExpiresAt", function (value) {
148
- _this.attributes.expires_at = value;
149
- });
150
150
  // int64 # Maximum number of times bundle can be accessed
151
151
  (0, _defineProperty2.default)(this, "getMaxUses", function () {
152
152
  return _this.attributes.max_uses;
@@ -933,7 +933,7 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
933
933
  });
934
934
  readableStream.on('data', /*#__PURE__*/function () {
935
935
  var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(chunk) {
936
- var nextLength, excessLength, chunkBuffer, tailLength, lastChunkForPart, firstChunkForNextPart, buffer, nextFileUploadPart;
936
+ var nextLength, excessLength, chunkBuffer, tailLength, lastChunkForPart, firstChunkForNextPart, buffer, nextFileUploadPart, uploadPromise;
937
937
  return _regenerator.default.wrap(function _callee15$(_context15) {
938
938
  while (1) switch (_context15.prev = _context15.next) {
939
939
  case 0:
@@ -942,7 +942,7 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
942
942
  excessLength = nextLength - firstFileUploadPart.partsize;
943
943
  chunkBuffer = _safeBuffer.Buffer.from(chunk);
944
944
  if (!(excessLength > 0)) {
945
- _context15.next = 20;
945
+ _context15.next = 26;
946
946
  break;
947
947
  }
948
948
  readableStream.pause();
@@ -957,27 +957,38 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
957
957
  return File._continueUpload(destinationPath, ++part, firstFileUploadPart, options);
958
958
  case 13:
959
959
  nextFileUploadPart = _context15.sent;
960
- concurrentUploads.push(_Api.default.sendFilePart(nextFileUploadPart.upload_uri, 'PUT', buffer));
960
+ uploadPromise = _Api.default.sendFilePart(nextFileUploadPart.upload_uri, 'PUT', buffer);
961
+ if (!firstFileUploadPart.parallel_parts) {
962
+ _context15.next = 19;
963
+ break;
964
+ }
965
+ concurrentUploads.push(uploadPromise);
966
+ _context15.next = 21;
967
+ break;
968
+ case 19:
969
+ _context15.next = 21;
970
+ return uploadPromise;
971
+ case 21:
961
972
  chunks = [firstChunkForNextPart];
962
973
  length = firstChunkForNextPart.length;
963
974
  readableStream.resume();
964
- _context15.next = 22;
975
+ _context15.next = 28;
965
976
  break;
966
- case 20:
977
+ case 26:
967
978
  chunks.push(chunkBuffer);
968
979
  length += chunk.length;
969
- case 22:
970
- _context15.next = 27;
980
+ case 28:
981
+ _context15.next = 33;
971
982
  break;
972
- case 24:
973
- _context15.prev = 24;
983
+ case 30:
984
+ _context15.prev = 30;
974
985
  _context15.t0 = _context15["catch"](0);
975
986
  reject(_context15.t0);
976
- case 27:
987
+ case 33:
977
988
  case "end":
978
989
  return _context15.stop();
979
990
  }
980
- }, _callee15, null, [[0, 24]]);
991
+ }, _callee15, null, [[0, 30]]);
981
992
  }));
982
993
  return function (_x20) {
983
994
  return _ref18.apply(this, arguments);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.0.281",
3
+ "version": "1.0.283",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
@@ -44,6 +44,13 @@ class Bundle {
44
44
  this.attributes.description = value
45
45
  }
46
46
 
47
+ // date-time # Bundle expiration date/time
48
+ getExpiresAt = () => this.attributes.expires_at
49
+
50
+ setExpiresAt = value => {
51
+ this.attributes.expires_at = value
52
+ }
53
+
47
54
  // boolean # Is this bundle password protected?
48
55
  getPasswordProtected = () => this.attributes.password_protected
49
56
 
@@ -131,13 +138,6 @@ class Bundle {
131
138
  this.attributes.dont_separate_submissions_by_folder = value
132
139
  }
133
140
 
134
- // date-time # Bundle expiration date/time
135
- getExpiresAt = () => this.attributes.expires_at
136
-
137
- setExpiresAt = value => {
138
- this.attributes.expires_at = value
139
- }
140
-
141
141
  // int64 # Maximum number of times bundle can be accessed
142
142
  getMaxUses = () => this.attributes.max_uses
143
143
 
@@ -116,7 +116,13 @@ class File {
116
116
  const buffer = Buffer.concat(chunks)
117
117
  const nextFileUploadPart = await File._continueUpload(destinationPath, ++part, firstFileUploadPart, options)
118
118
 
119
- concurrentUploads.push(Api.sendFilePart(nextFileUploadPart.upload_uri, 'PUT', buffer))
119
+ const uploadPromise = Api.sendFilePart(nextFileUploadPart.upload_uri, 'PUT', buffer)
120
+
121
+ if (firstFileUploadPart.parallel_parts) {
122
+ concurrentUploads.push(uploadPromise)
123
+ } else {
124
+ await uploadPromise
125
+ }
120
126
 
121
127
  chunks = [firstChunkForNextPart]
122
128
  length = firstChunkForNextPart.length