files.com 1.2.31 → 1.2.33

Sign up to get free protection for your applications and to get access to all the features.
package/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.31
1
+ 1.2.33
@@ -12,7 +12,8 @@
12
12
  "description": "example",
13
13
  "value": {
14
14
  "key": "example value"
15
- }
15
+ },
16
+ "disable_parent_folder_behavior": true
16
17
  }
17
18
  ```
18
19
 
@@ -23,6 +24,7 @@
23
24
  * `name` (string): Name for this behavior.
24
25
  * `description` (string): Description for this behavior.
25
26
  * `value` (object): Settings for this behavior. See the section above for an example value to provide here. Formatting is different for each Behavior type. May be sent as nested JSON or a single JSON-encoded string. If using XML encoding for the API call, this data must be sent as a JSON-encoded string.
27
+ * `disable_parent_folder_behavior` (boolean): If true, the parent folder's behavior will be disabled for this folder.
26
28
  * `attachment_file` (file): Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
27
29
  * `attachment_delete` (boolean): If true, will delete the file stored in attachment
28
30
 
@@ -170,7 +172,8 @@ await behavior.update({
170
172
  "description": "example",
171
173
  "value": {
172
174
  "key": "example value"
173
- }
175
+ },
176
+ "disable_parent_folder_behavior": true
174
177
  }
175
178
  ```
176
179
 
@@ -59,6 +59,7 @@
59
59
  "max_uses": 1,
60
60
  "note": "The internal note on the bundle.",
61
61
  "path_template": "{{name}}_{{ip}}",
62
+ "path_template_time_zone": "Eastern Time (US & Canada)",
62
63
  "send_email_receipt_to_uploader": true,
63
64
  "snapshot_id": 1,
64
65
  "user_id": 1,
@@ -105,7 +106,8 @@
105
106
  * `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.
106
107
  * `max_uses` (int64): Maximum number of times bundle can be accessed
107
108
  * `note` (string): Bundle internal note
108
- * `path_template` (string): Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
109
+ * `path_template` (string): Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, `strftime` directives, and any custom form data.
110
+ * `path_template_time_zone` (string): Timezone to use when rendering timestamps in path templates.
109
111
  * `send_email_receipt_to_uploader` (boolean): Send delivery receipt to the uploader. Note: For writable share only
110
112
  * `snapshot_id` (int64): ID of the snapshot containing this bundle's contents.
111
113
  * `user_id` (int64): Bundle creator user ID
@@ -179,6 +181,7 @@ await Bundle.create({
179
181
  'note': "The internal note on the bundle.",
180
182
  'code': "abc123",
181
183
  'path_template': "{{name}}_{{ip}}",
184
+ 'path_template_time_zone': "Eastern Time (US & Canada)",
182
185
  'permissions': "read",
183
186
  'preview_only': true,
184
187
  'require_registration': true,
@@ -209,7 +212,8 @@ await Bundle.create({
209
212
  * `description` (string): Public description
210
213
  * `note` (string): Bundle internal note
211
214
  * `code` (string): Bundle code. This code forms the end part of the Public URL.
212
- * `path_template` (string): Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
215
+ * `path_template` (string): Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, `strftime` directives, and any custom form data.
216
+ * `path_template_time_zone` (string): Timezone to use when rendering timestamps in path templates.
213
217
  * `permissions` (string): Permissions that apply to Folders in this Share Link.
214
218
  * `preview_only` (boolean): DEPRECATED: Restrict users to previewing files only. Use `permissions` instead.
215
219
  * `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
@@ -268,6 +272,7 @@ await bundle.update({
268
272
  'max_uses': 1,
269
273
  'note': "The internal note on the bundle.",
270
274
  'path_template': "{{name}}_{{ip}}",
275
+ 'path_template_time_zone': "Eastern Time (US & Canada)",
271
276
  'permissions': "read",
272
277
  'preview_only': true,
273
278
  'require_registration': true,
@@ -297,7 +302,8 @@ await bundle.update({
297
302
  * `inbox_id` (int64): ID of the associated inbox, if available.
298
303
  * `max_uses` (int64): Maximum number of times bundle can be accessed
299
304
  * `note` (string): Bundle internal note
300
- * `path_template` (string): Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
305
+ * `path_template` (string): Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, `strftime` directives, and any custom form data.
306
+ * `path_template_time_zone` (string): Timezone to use when rendering timestamps in path templates.
301
307
  * `permissions` (string): Permissions that apply to Folders in this Share Link.
302
308
  * `preview_only` (boolean): DEPRECATED: Restrict users to previewing files only. Use `permissions` instead.
303
309
  * `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
@@ -369,6 +375,7 @@ await bundle.update({
369
375
  "max_uses": 1,
370
376
  "note": "The internal note on the bundle.",
371
377
  "path_template": "{{name}}_{{ip}}",
378
+ "path_template_time_zone": "Eastern Time (US & Canada)",
372
379
  "send_email_receipt_to_uploader": true,
373
380
  "snapshot_id": 1,
374
381
  "user_id": 1,
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.2.31';
14
+ var version = '1.2.33';
15
15
  var userAgent = "Files.com JavaScript SDK v".concat(version);
16
16
  var logLevel = _Logger.LogLevel.INFO;
17
17
  var debugRequest = false;
@@ -82,6 +82,13 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
82
82
  (0, _defineProperty2.default)(this, "setValue", function (value) {
83
83
  _this.attributes.value = value;
84
84
  });
85
+ // boolean # If true, the parent folder's behavior will be disabled for this folder.
86
+ (0, _defineProperty2.default)(this, "getDisableParentFolderBehavior", function () {
87
+ return _this.attributes.disable_parent_folder_behavior;
88
+ });
89
+ (0, _defineProperty2.default)(this, "setDisableParentFolderBehavior", function (value) {
90
+ _this.attributes.disable_parent_folder_behavior = value;
91
+ });
85
92
  // file # Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
86
93
  (0, _defineProperty2.default)(this, "getAttachmentFile", function () {
87
94
  return _this.attributes.attachment_file;
@@ -212,13 +212,20 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
212
212
  (0, _defineProperty2.default)(this, "setNote", function (value) {
213
213
  _this.attributes.note = value;
214
214
  });
215
- // string # Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
215
+ // string # Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, `strftime` directives, and any custom form data.
216
216
  (0, _defineProperty2.default)(this, "getPathTemplate", function () {
217
217
  return _this.attributes.path_template;
218
218
  });
219
219
  (0, _defineProperty2.default)(this, "setPathTemplate", function (value) {
220
220
  _this.attributes.path_template = value;
221
221
  });
222
+ // string # Timezone to use when rendering timestamps in path templates.
223
+ (0, _defineProperty2.default)(this, "getPathTemplateTimeZone", function () {
224
+ return _this.attributes.path_template_time_zone;
225
+ });
226
+ (0, _defineProperty2.default)(this, "setPathTemplateTimeZone", function (value) {
227
+ _this.attributes.path_template_time_zone = value;
228
+ });
222
229
  // boolean # Send delivery receipt to the uploader. Note: For writable share only
223
230
  (0, _defineProperty2.default)(this, "getSendEmailReceiptToUploader", function () {
224
231
  return _this.attributes.send_email_receipt_to_uploader;
@@ -417,7 +424,8 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
417
424
  // inbox_id - int64 - ID of the associated inbox, if available.
418
425
  // max_uses - int64 - Maximum number of times bundle can be accessed
419
426
  // note - string - Bundle internal note
420
- // path_template - string - Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
427
+ // path_template - string - Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, `strftime` directives, and any custom form data.
428
+ // path_template_time_zone - string - Timezone to use when rendering timestamps in path templates.
421
429
  // permissions - string - Permissions that apply to Folders in this Share Link.
422
430
  // preview_only - boolean - DEPRECATED: Restrict users to previewing files only. Use `permissions` instead.
423
431
  // require_registration - boolean - Show a registration page that captures the downloader's name and email address?
@@ -522,38 +530,44 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
522
530
  }
523
531
  throw new errors.InvalidParameterError("Bad parameter: path_template must be of type String, received ".concat((0, _utils.getType)(params.path_template)));
524
532
  case 30:
525
- if (!(params.permissions && !(0, _utils.isString)(params.permissions))) {
533
+ if (!(params.path_template_time_zone && !(0, _utils.isString)(params.path_template_time_zone))) {
526
534
  _context2.next = 32;
527
535
  break;
528
536
  }
529
- throw new errors.InvalidParameterError("Bad parameter: permissions must be of type String, received ".concat((0, _utils.getType)(params.permissions)));
537
+ throw new errors.InvalidParameterError("Bad parameter: path_template_time_zone must be of type String, received ".concat((0, _utils.getType)(params.path_template_time_zone)));
530
538
  case 32:
531
- if (!(params.start_access_on_date && !(0, _utils.isString)(params.start_access_on_date))) {
539
+ if (!(params.permissions && !(0, _utils.isString)(params.permissions))) {
532
540
  _context2.next = 34;
533
541
  break;
534
542
  }
535
- throw new errors.InvalidParameterError("Bad parameter: start_access_on_date must be of type String, received ".concat((0, _utils.getType)(params.start_access_on_date)));
543
+ throw new errors.InvalidParameterError("Bad parameter: permissions must be of type String, received ".concat((0, _utils.getType)(params.permissions)));
536
544
  case 34:
545
+ if (!(params.start_access_on_date && !(0, _utils.isString)(params.start_access_on_date))) {
546
+ _context2.next = 36;
547
+ break;
548
+ }
549
+ throw new errors.InvalidParameterError("Bad parameter: start_access_on_date must be of type String, received ".concat((0, _utils.getType)(params.start_access_on_date)));
550
+ case 36:
537
551
  if (params.id) {
538
- _context2.next = 40;
552
+ _context2.next = 42;
539
553
  break;
540
554
  }
541
555
  if (!_this.attributes.id) {
542
- _context2.next = 39;
556
+ _context2.next = 41;
543
557
  break;
544
558
  }
545
559
  params.id = _this.id;
546
- _context2.next = 40;
560
+ _context2.next = 42;
547
561
  break;
548
- case 39:
562
+ case 41:
549
563
  throw new errors.MissingParameterError('Parameter missing: id');
550
- case 40:
551
- _context2.next = 42;
552
- return _Api.default.sendRequest("/bundles/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
553
564
  case 42:
565
+ _context2.next = 44;
566
+ return _Api.default.sendRequest("/bundles/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
567
+ case 44:
554
568
  response = _context2.sent;
555
569
  return _context2.abrupt("return", new Bundle(response === null || response === void 0 ? void 0 : response.data, _this.options));
556
- case 44:
570
+ case 46:
557
571
  case "end":
558
572
  return _context2.stop();
559
573
  }
@@ -775,7 +789,8 @@ _Bundle = Bundle;
775
789
  // description - string - Public description
776
790
  // note - string - Bundle internal note
777
791
  // code - string - Bundle code. This code forms the end part of the Public URL.
778
- // path_template - string - Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
792
+ // path_template - string - Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, `strftime` directives, and any custom form data.
793
+ // path_template_time_zone - string - Timezone to use when rendering timestamps in path templates.
779
794
  // permissions - string - Permissions that apply to Folders in this Share Link.
780
795
  // preview_only - boolean - DEPRECATED: Restrict users to previewing files only. Use `permissions` instead.
781
796
  // require_registration - boolean - Show a registration page that captures the downloader's name and email address?
@@ -865,42 +880,48 @@ _Bundle = Bundle;
865
880
  }
866
881
  throw new errors.InvalidParameterError("Bad parameter: path_template must be of type String, received ".concat((0, _utils.getType)(params.path_template)));
867
882
  case 24:
868
- if (!(params.permissions && !(0, _utils.isString)(params.permissions))) {
883
+ if (!(params.path_template_time_zone && !(0, _utils.isString)(params.path_template_time_zone))) {
869
884
  _context7.next = 26;
870
885
  break;
871
886
  }
872
- throw new errors.InvalidParameterError("Bad parameter: permissions must be of type String, received ".concat((0, _utils.getType)(params.permissions)));
887
+ throw new errors.InvalidParameterError("Bad parameter: path_template_time_zone must be of type String, received ".concat((0, _utils.getType)(params.path_template_time_zone)));
873
888
  case 26:
874
- if (!(params.clickwrap_id && !(0, _utils.isInt)(params.clickwrap_id))) {
889
+ if (!(params.permissions && !(0, _utils.isString)(params.permissions))) {
875
890
  _context7.next = 28;
876
891
  break;
877
892
  }
878
- throw new errors.InvalidParameterError("Bad parameter: clickwrap_id must be of type Int, received ".concat((0, _utils.getType)(params.clickwrap_id)));
893
+ throw new errors.InvalidParameterError("Bad parameter: permissions must be of type String, received ".concat((0, _utils.getType)(params.permissions)));
879
894
  case 28:
880
- if (!(params.inbox_id && !(0, _utils.isInt)(params.inbox_id))) {
895
+ if (!(params.clickwrap_id && !(0, _utils.isInt)(params.clickwrap_id))) {
881
896
  _context7.next = 30;
882
897
  break;
883
898
  }
884
- throw new errors.InvalidParameterError("Bad parameter: inbox_id must be of type Int, received ".concat((0, _utils.getType)(params.inbox_id)));
899
+ throw new errors.InvalidParameterError("Bad parameter: clickwrap_id must be of type Int, received ".concat((0, _utils.getType)(params.clickwrap_id)));
885
900
  case 30:
886
- if (!(params.start_access_on_date && !(0, _utils.isString)(params.start_access_on_date))) {
901
+ if (!(params.inbox_id && !(0, _utils.isInt)(params.inbox_id))) {
887
902
  _context7.next = 32;
888
903
  break;
889
904
  }
890
- throw new errors.InvalidParameterError("Bad parameter: start_access_on_date must be of type String, received ".concat((0, _utils.getType)(params.start_access_on_date)));
905
+ throw new errors.InvalidParameterError("Bad parameter: inbox_id must be of type Int, received ".concat((0, _utils.getType)(params.inbox_id)));
891
906
  case 32:
892
- if (!(params.snapshot_id && !(0, _utils.isInt)(params.snapshot_id))) {
907
+ if (!(params.start_access_on_date && !(0, _utils.isString)(params.start_access_on_date))) {
893
908
  _context7.next = 34;
894
909
  break;
895
910
  }
896
- throw new errors.InvalidParameterError("Bad parameter: snapshot_id must be of type Int, received ".concat((0, _utils.getType)(params.snapshot_id)));
911
+ throw new errors.InvalidParameterError("Bad parameter: start_access_on_date must be of type String, received ".concat((0, _utils.getType)(params.start_access_on_date)));
897
912
  case 34:
898
- _context7.next = 36;
899
- return _Api.default.sendRequest('/bundles', 'POST', params, options);
913
+ if (!(params.snapshot_id && !(0, _utils.isInt)(params.snapshot_id))) {
914
+ _context7.next = 36;
915
+ break;
916
+ }
917
+ throw new errors.InvalidParameterError("Bad parameter: snapshot_id must be of type Int, received ".concat((0, _utils.getType)(params.snapshot_id)));
900
918
  case 36:
919
+ _context7.next = 38;
920
+ return _Api.default.sendRequest('/bundles', 'POST', params, options);
921
+ case 38:
901
922
  response = _context7.sent;
902
923
  return _context7.abrupt("return", new _Bundle(response === null || response === void 0 ? void 0 : response.data, options));
903
- case 38:
924
+ case 40:
904
925
  case "end":
905
926
  return _context7.stop();
906
927
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.2.31",
3
+ "version": "1.2.33",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
package/src/Files.js CHANGED
@@ -5,7 +5,7 @@ const endpointPrefix = '/api/rest/v1'
5
5
  let apiKey
6
6
  let baseUrl = 'https://app.files.com'
7
7
  let sessionId = null
8
- const version = '1.2.31'
8
+ const version = '1.2.33'
9
9
  let userAgent = `Files.com JavaScript SDK v${version}`
10
10
 
11
11
  let logLevel = LogLevel.INFO
@@ -77,6 +77,13 @@ class Behavior {
77
77
  this.attributes.value = value
78
78
  }
79
79
 
80
+ // boolean # If true, the parent folder's behavior will be disabled for this folder.
81
+ getDisableParentFolderBehavior = () => this.attributes.disable_parent_folder_behavior
82
+
83
+ setDisableParentFolderBehavior = value => {
84
+ this.attributes.disable_parent_folder_behavior = value
85
+ }
86
+
80
87
  // file # Certain behaviors may require a file, for instance, the "watermark" behavior requires a watermark image
81
88
  getAttachmentFile = () => this.attributes.attachment_file
82
89
 
@@ -206,13 +206,20 @@ class Bundle {
206
206
  this.attributes.note = value
207
207
  }
208
208
 
209
- // string # Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
209
+ // string # Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, `strftime` directives, and any custom form data.
210
210
  getPathTemplate = () => this.attributes.path_template
211
211
 
212
212
  setPathTemplate = value => {
213
213
  this.attributes.path_template = value
214
214
  }
215
215
 
216
+ // string # Timezone to use when rendering timestamps in path templates.
217
+ getPathTemplateTimeZone = () => this.attributes.path_template_time_zone
218
+
219
+ setPathTemplateTimeZone = value => {
220
+ this.attributes.path_template_time_zone = value
221
+ }
222
+
216
223
  // boolean # Send delivery receipt to the uploader. Note: For writable share only
217
224
  getSendEmailReceiptToUploader = () => this.attributes.send_email_receipt_to_uploader
218
225
 
@@ -382,7 +389,8 @@ class Bundle {
382
389
  // inbox_id - int64 - ID of the associated inbox, if available.
383
390
  // max_uses - int64 - Maximum number of times bundle can be accessed
384
391
  // note - string - Bundle internal note
385
- // path_template - string - Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
392
+ // path_template - string - Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, `strftime` directives, and any custom form data.
393
+ // path_template_time_zone - string - Timezone to use when rendering timestamps in path templates.
386
394
  // permissions - string - Permissions that apply to Folders in this Share Link.
387
395
  // preview_only - boolean - DEPRECATED: Restrict users to previewing files only. Use `permissions` instead.
388
396
  // require_registration - boolean - Show a registration page that captures the downloader's name and email address?
@@ -452,6 +460,10 @@ class Bundle {
452
460
  throw new errors.InvalidParameterError(`Bad parameter: path_template must be of type String, received ${getType(params.path_template)}`)
453
461
  }
454
462
 
463
+ if (params.path_template_time_zone && !isString(params.path_template_time_zone)) {
464
+ throw new errors.InvalidParameterError(`Bad parameter: path_template_time_zone must be of type String, received ${getType(params.path_template_time_zone)}`)
465
+ }
466
+
455
467
  if (params.permissions && !isString(params.permissions)) {
456
468
  throw new errors.InvalidParameterError(`Bad parameter: permissions must be of type String, received ${getType(params.permissions)}`)
457
469
  }
@@ -582,7 +594,8 @@ class Bundle {
582
594
  // description - string - Public description
583
595
  // note - string - Bundle internal note
584
596
  // code - string - Bundle code. This code forms the end part of the Public URL.
585
- // path_template - string - Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
597
+ // path_template - string - Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, `strftime` directives, and any custom form data.
598
+ // path_template_time_zone - string - Timezone to use when rendering timestamps in path templates.
586
599
  // permissions - string - Permissions that apply to Folders in this Share Link.
587
600
  // preview_only - boolean - DEPRECATED: Restrict users to previewing files only. Use `permissions` instead.
588
601
  // require_registration - boolean - Show a registration page that captures the downloader's name and email address?
@@ -641,6 +654,10 @@ class Bundle {
641
654
  throw new errors.InvalidParameterError(`Bad parameter: path_template must be of type String, received ${getType(params.path_template)}`)
642
655
  }
643
656
 
657
+ if (params.path_template_time_zone && !isString(params.path_template_time_zone)) {
658
+ throw new errors.InvalidParameterError(`Bad parameter: path_template_time_zone must be of type String, received ${getType(params.path_template_time_zone)}`)
659
+ }
660
+
644
661
  if (params.permissions && !isString(params.permissions)) {
645
662
  throw new errors.InvalidParameterError(`Bad parameter: permissions must be of type String, received ${getType(params.permissions)}`)
646
663
  }