files.com 1.0.222 → 1.0.223
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/Bundle.md +14 -0
- package/lib/models/Bundle.js +43 -19
- package/package.json +1 -1
- package/src/models/Bundle.js +25 -0
package/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.223
|
package/docs/models/Bundle.md
CHANGED
@@ -19,9 +19,11 @@
|
|
19
19
|
"skip_company": true,
|
20
20
|
"id": 1,
|
21
21
|
"created_at": "2000-01-01T01:00:00Z",
|
22
|
+
"dont_separate_submissions_by_folder": true,
|
22
23
|
"expires_at": "2000-01-01T01:00:00Z",
|
23
24
|
"max_uses": 1,
|
24
25
|
"note": "The internal note on the bundle.",
|
26
|
+
"path_template": "{{name}}_{{ip}}",
|
25
27
|
"user_id": 1,
|
26
28
|
"username": "user",
|
27
29
|
"clickwrap_id": 1,
|
@@ -52,9 +54,11 @@
|
|
52
54
|
* `skip_company` (boolean): BundleRegistrations can be saved without providing company?
|
53
55
|
* `id` (int64): Bundle ID
|
54
56
|
* `created_at` (date-time): Bundle created at date/time
|
57
|
+
* `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.
|
55
58
|
* `expires_at` (date-time): Bundle expiration date/time
|
56
59
|
* `max_uses` (int64): Maximum number of times bundle can be accessed
|
57
60
|
* `note` (string): Bundle internal note
|
61
|
+
* `path_template` (string): Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
|
58
62
|
* `user_id` (int64): Bundle creator user ID
|
59
63
|
* `username` (string): Bundle creator username
|
60
64
|
* `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
|
@@ -116,11 +120,13 @@ await Bundle.create({
|
|
116
120
|
'paths': ["file.txt"],
|
117
121
|
'password': "Password",
|
118
122
|
'form_field_set_id': 1,
|
123
|
+
'dont_separate_submissions_by_folder': true,
|
119
124
|
'expires_at': "2000-01-01T01:00:00Z",
|
120
125
|
'max_uses': 1,
|
121
126
|
'description': "The public description of the bundle.",
|
122
127
|
'note': "The internal note on the bundle.",
|
123
128
|
'code': "abc123",
|
129
|
+
'path_template': "{{name}}_{{ip}}",
|
124
130
|
'permissions': "read",
|
125
131
|
'preview_only': true,
|
126
132
|
'require_registration': true,
|
@@ -140,11 +146,13 @@ await Bundle.create({
|
|
140
146
|
* `paths` (array(string)): Required - A list of paths to include in this bundle.
|
141
147
|
* `password` (string): Password for this bundle.
|
142
148
|
* `form_field_set_id` (int64): Id of Form Field Set to use with this bundle
|
149
|
+
* `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.
|
143
150
|
* `expires_at` (string): Bundle expiration date/time
|
144
151
|
* `max_uses` (int64): Maximum number of times bundle can be accessed
|
145
152
|
* `description` (string): Public description
|
146
153
|
* `note` (string): Bundle internal note
|
147
154
|
* `code` (string): Bundle code. This code forms the end part of the Public URL.
|
155
|
+
* `path_template` (string): Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
|
148
156
|
* `permissions` (string): Permissions that apply to Folders in this Share Link.
|
149
157
|
* `preview_only` (boolean): Restrict users to previewing files only?
|
150
158
|
* `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
|
@@ -192,10 +200,12 @@ await bundle.update({
|
|
192
200
|
'clickwrap_id': 1,
|
193
201
|
'code': "abc123",
|
194
202
|
'description': "The public description of the bundle.",
|
203
|
+
'dont_separate_submissions_by_folder': true,
|
195
204
|
'expires_at': "2000-01-01T01:00:00Z",
|
196
205
|
'inbox_id': 1,
|
197
206
|
'max_uses': 1,
|
198
207
|
'note': "The internal note on the bundle.",
|
208
|
+
'path_template': "{{name}}_{{ip}}",
|
199
209
|
'permissions': "read",
|
200
210
|
'preview_only': true,
|
201
211
|
'require_registration': true,
|
@@ -216,10 +226,12 @@ await bundle.update({
|
|
216
226
|
* `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
|
217
227
|
* `code` (string): Bundle code. This code forms the end part of the Public URL.
|
218
228
|
* `description` (string): Public description
|
229
|
+
* `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.
|
219
230
|
* `expires_at` (string): Bundle expiration date/time
|
220
231
|
* `inbox_id` (int64): ID of the associated inbox, if available.
|
221
232
|
* `max_uses` (int64): Maximum number of times bundle can be accessed
|
222
233
|
* `note` (string): Bundle internal note
|
234
|
+
* `path_template` (string): Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
|
223
235
|
* `permissions` (string): Permissions that apply to Folders in this Share Link.
|
224
236
|
* `preview_only` (boolean): Restrict users to previewing files only?
|
225
237
|
* `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
|
@@ -249,9 +261,11 @@ await bundle.update({
|
|
249
261
|
"skip_company": true,
|
250
262
|
"id": 1,
|
251
263
|
"created_at": "2000-01-01T01:00:00Z",
|
264
|
+
"dont_separate_submissions_by_folder": true,
|
252
265
|
"expires_at": "2000-01-01T01:00:00Z",
|
253
266
|
"max_uses": 1,
|
254
267
|
"note": "The internal note on the bundle.",
|
268
|
+
"path_template": "{{name}}_{{ip}}",
|
255
269
|
"user_id": 1,
|
256
270
|
"username": "user",
|
257
271
|
"clickwrap_id": 1,
|
package/lib/models/Bundle.js
CHANGED
@@ -117,6 +117,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
117
117
|
(0, _defineProperty2.default)(this, "getCreatedAt", function () {
|
118
118
|
return _this.attributes.created_at;
|
119
119
|
});
|
120
|
+
(0, _defineProperty2.default)(this, "getDontSeparateSubmissionsByFolder", function () {
|
121
|
+
return _this.attributes.dont_separate_submissions_by_folder;
|
122
|
+
});
|
123
|
+
(0, _defineProperty2.default)(this, "setDontSeparateSubmissionsByFolder", function (value) {
|
124
|
+
_this.attributes.dont_separate_submissions_by_folder = value;
|
125
|
+
});
|
120
126
|
(0, _defineProperty2.default)(this, "getExpiresAt", function () {
|
121
127
|
return _this.attributes.expires_at;
|
122
128
|
});
|
@@ -135,6 +141,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
135
141
|
(0, _defineProperty2.default)(this, "setNote", function (value) {
|
136
142
|
_this.attributes.note = value;
|
137
143
|
});
|
144
|
+
(0, _defineProperty2.default)(this, "getPathTemplate", function () {
|
145
|
+
return _this.attributes.path_template;
|
146
|
+
});
|
147
|
+
(0, _defineProperty2.default)(this, "setPathTemplate", function (value) {
|
148
|
+
_this.attributes.path_template = value;
|
149
|
+
});
|
138
150
|
(0, _defineProperty2.default)(this, "getUserId", function () {
|
139
151
|
return _this.attributes.user_id;
|
140
152
|
});
|
@@ -367,32 +379,38 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
367
379
|
}
|
368
380
|
throw new errors.InvalidParameterError("Bad parameter: note must be of type String, received ".concat((0, _utils.getType)(note)));
|
369
381
|
case 28:
|
370
|
-
if (!(params['
|
382
|
+
if (!(params['path_template'] && !(0, _utils.isString)(params['path_template']))) {
|
371
383
|
_context2.next = 30;
|
372
384
|
break;
|
373
385
|
}
|
374
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
386
|
+
throw new errors.InvalidParameterError("Bad parameter: path_template must be of type String, received ".concat((0, _utils.getType)(path_template)));
|
375
387
|
case 30:
|
388
|
+
if (!(params['permissions'] && !(0, _utils.isString)(params['permissions']))) {
|
389
|
+
_context2.next = 32;
|
390
|
+
break;
|
391
|
+
}
|
392
|
+
throw new errors.InvalidParameterError("Bad parameter: permissions must be of type String, received ".concat((0, _utils.getType)(permissions)));
|
393
|
+
case 32:
|
376
394
|
if (params['id']) {
|
377
|
-
_context2.next =
|
395
|
+
_context2.next = 38;
|
378
396
|
break;
|
379
397
|
}
|
380
398
|
if (!_this.attributes.id) {
|
381
|
-
_context2.next =
|
399
|
+
_context2.next = 37;
|
382
400
|
break;
|
383
401
|
}
|
384
402
|
params['id'] = _this.id;
|
385
|
-
_context2.next =
|
403
|
+
_context2.next = 38;
|
386
404
|
break;
|
387
|
-
case
|
405
|
+
case 37:
|
388
406
|
throw new errors.MissingParameterError('Parameter missing: id');
|
389
|
-
case 36:
|
390
|
-
_context2.next = 38;
|
391
|
-
return _Api.default.sendRequest("/bundles/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
|
392
407
|
case 38:
|
408
|
+
_context2.next = 40;
|
409
|
+
return _Api.default.sendRequest("/bundles/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
|
410
|
+
case 40:
|
393
411
|
response = _context2.sent;
|
394
412
|
return _context2.abrupt("return", new Bundle(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
395
|
-
case
|
413
|
+
case 42:
|
396
414
|
case "end":
|
397
415
|
return _context2.stop();
|
398
416
|
}
|
@@ -651,30 +669,36 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
651
669
|
}
|
652
670
|
throw new errors.InvalidParameterError("Bad parameter: code must be of type String, received ".concat((0, _utils.getType)(params['code'])));
|
653
671
|
case 22:
|
654
|
-
if (!(params['
|
672
|
+
if (!(params['path_template'] && !(0, _utils.isString)(params['path_template']))) {
|
655
673
|
_context6.next = 24;
|
656
674
|
break;
|
657
675
|
}
|
658
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
676
|
+
throw new errors.InvalidParameterError("Bad parameter: path_template must be of type String, received ".concat((0, _utils.getType)(params['path_template'])));
|
659
677
|
case 24:
|
660
|
-
if (!(params['
|
678
|
+
if (!(params['permissions'] && !(0, _utils.isString)(params['permissions']))) {
|
661
679
|
_context6.next = 26;
|
662
680
|
break;
|
663
681
|
}
|
664
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
682
|
+
throw new errors.InvalidParameterError("Bad parameter: permissions must be of type String, received ".concat((0, _utils.getType)(params['permissions'])));
|
665
683
|
case 26:
|
666
|
-
if (!(params['
|
684
|
+
if (!(params['clickwrap_id'] && !(0, _utils.isInt)(params['clickwrap_id']))) {
|
667
685
|
_context6.next = 28;
|
668
686
|
break;
|
669
687
|
}
|
670
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
688
|
+
throw new errors.InvalidParameterError("Bad parameter: clickwrap_id must be of type Int, received ".concat((0, _utils.getType)(params['clickwrap_id'])));
|
671
689
|
case 28:
|
672
|
-
|
673
|
-
|
690
|
+
if (!(params['inbox_id'] && !(0, _utils.isInt)(params['inbox_id']))) {
|
691
|
+
_context6.next = 30;
|
692
|
+
break;
|
693
|
+
}
|
694
|
+
throw new errors.InvalidParameterError("Bad parameter: inbox_id must be of type Int, received ".concat((0, _utils.getType)(params['inbox_id'])));
|
674
695
|
case 30:
|
696
|
+
_context6.next = 32;
|
697
|
+
return _Api.default.sendRequest("/bundles", 'POST', params, options);
|
698
|
+
case 32:
|
675
699
|
response = _context6.sent;
|
676
700
|
return _context6.abrupt("return", new Bundle(response === null || response === void 0 ? void 0 : response.data, options));
|
677
|
-
case
|
701
|
+
case 34:
|
678
702
|
case "end":
|
679
703
|
return _context6.stop();
|
680
704
|
}
|
package/package.json
CHANGED
package/src/models/Bundle.js
CHANGED
@@ -124,6 +124,13 @@ class Bundle {
|
|
124
124
|
// date-time # Bundle created at date/time
|
125
125
|
getCreatedAt = () => this.attributes.created_at
|
126
126
|
|
127
|
+
// 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.
|
128
|
+
getDontSeparateSubmissionsByFolder = () => this.attributes.dont_separate_submissions_by_folder
|
129
|
+
|
130
|
+
setDontSeparateSubmissionsByFolder = value => {
|
131
|
+
this.attributes.dont_separate_submissions_by_folder = value
|
132
|
+
}
|
133
|
+
|
127
134
|
// date-time # Bundle expiration date/time
|
128
135
|
getExpiresAt = () => this.attributes.expires_at
|
129
136
|
|
@@ -145,6 +152,13 @@ class Bundle {
|
|
145
152
|
this.attributes.note = value
|
146
153
|
}
|
147
154
|
|
155
|
+
// string # Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
|
156
|
+
getPathTemplate = () => this.attributes.path_template
|
157
|
+
|
158
|
+
setPathTemplate = value => {
|
159
|
+
this.attributes.path_template = value
|
160
|
+
}
|
161
|
+
|
148
162
|
// int64 # Bundle creator user ID
|
149
163
|
getUserId = () => this.attributes.user_id
|
150
164
|
|
@@ -279,10 +293,12 @@ class Bundle {
|
|
279
293
|
// clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
|
280
294
|
// code - string - Bundle code. This code forms the end part of the Public URL.
|
281
295
|
// description - string - Public description
|
296
|
+
// 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.
|
282
297
|
// expires_at - string - Bundle expiration date/time
|
283
298
|
// inbox_id - int64 - ID of the associated inbox, if available.
|
284
299
|
// max_uses - int64 - Maximum number of times bundle can be accessed
|
285
300
|
// note - string - Bundle internal note
|
301
|
+
// path_template - string - Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
|
286
302
|
// permissions - string - Permissions that apply to Folders in this Share Link.
|
287
303
|
// preview_only - boolean - Restrict users to previewing files only?
|
288
304
|
// require_registration - boolean - Show a registration page that captures the downloader's name and email address?
|
@@ -335,6 +351,9 @@ class Bundle {
|
|
335
351
|
if (params['note'] && !isString(params['note'])) {
|
336
352
|
throw new errors.InvalidParameterError(`Bad parameter: note must be of type String, received ${getType(note)}`)
|
337
353
|
}
|
354
|
+
if (params['path_template'] && !isString(params['path_template'])) {
|
355
|
+
throw new errors.InvalidParameterError(`Bad parameter: path_template must be of type String, received ${getType(path_template)}`)
|
356
|
+
}
|
338
357
|
if (params['permissions'] && !isString(params['permissions'])) {
|
339
358
|
throw new errors.InvalidParameterError(`Bad parameter: permissions must be of type String, received ${getType(permissions)}`)
|
340
359
|
}
|
@@ -454,11 +473,13 @@ class Bundle {
|
|
454
473
|
// paths (required) - array(string) - A list of paths to include in this bundle.
|
455
474
|
// password - string - Password for this bundle.
|
456
475
|
// form_field_set_id - int64 - Id of Form Field Set to use with this bundle
|
476
|
+
// 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.
|
457
477
|
// expires_at - string - Bundle expiration date/time
|
458
478
|
// max_uses - int64 - Maximum number of times bundle can be accessed
|
459
479
|
// description - string - Public description
|
460
480
|
// note - string - Bundle internal note
|
461
481
|
// code - string - Bundle code. This code forms the end part of the Public URL.
|
482
|
+
// path_template - string - Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
|
462
483
|
// permissions - string - Permissions that apply to Folders in this Share Link.
|
463
484
|
// preview_only - boolean - Restrict users to previewing files only?
|
464
485
|
// require_registration - boolean - Show a registration page that captures the downloader's name and email address?
|
@@ -510,6 +531,10 @@ class Bundle {
|
|
510
531
|
throw new errors.InvalidParameterError(`Bad parameter: code must be of type String, received ${getType(params['code'])}`)
|
511
532
|
}
|
512
533
|
|
534
|
+
if (params['path_template'] && !isString(params['path_template'])) {
|
535
|
+
throw new errors.InvalidParameterError(`Bad parameter: path_template must be of type String, received ${getType(params['path_template'])}`)
|
536
|
+
}
|
537
|
+
|
513
538
|
if (params['permissions'] && !isString(params['permissions'])) {
|
514
539
|
throw new errors.InvalidParameterError(`Bad parameter: permissions must be of type String, received ${getType(params['permissions'])}`)
|
515
540
|
}
|