files.com 1.0.415 → 1.0.417

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. package/_VERSION +1 -1
  2. package/docs/models/Site.md +4 -0
  3. package/lib/Api.js +1 -2
  4. package/lib/Errors.js +165 -330
  5. package/lib/Files.js +2 -3
  6. package/lib/Logger.js +2 -4
  7. package/lib/isomorphic/File.node.js +6 -11
  8. package/lib/models/AccountLineItem.js +1 -2
  9. package/lib/models/Action.js +1 -2
  10. package/lib/models/ActionNotificationExport.js +1 -2
  11. package/lib/models/ActionNotificationExportResult.js +1 -2
  12. package/lib/models/ActionWebhookFailure.js +1 -2
  13. package/lib/models/ApiKey.js +1 -2
  14. package/lib/models/App.js +1 -2
  15. package/lib/models/As2IncomingMessage.js +1 -2
  16. package/lib/models/As2OutgoingMessage.js +1 -2
  17. package/lib/models/As2Partner.js +1 -2
  18. package/lib/models/As2Station.js +1 -2
  19. package/lib/models/Auto.js +1 -2
  20. package/lib/models/Automation.js +1 -2
  21. package/lib/models/AutomationRun.js +1 -2
  22. package/lib/models/BandwidthSnapshot.js +1 -2
  23. package/lib/models/Behavior.js +1 -2
  24. package/lib/models/Bundle.js +1 -2
  25. package/lib/models/BundleDownload.js +1 -2
  26. package/lib/models/BundleNotification.js +1 -2
  27. package/lib/models/BundleRecipient.js +1 -2
  28. package/lib/models/BundleRegistration.js +1 -2
  29. package/lib/models/Clickwrap.js +1 -2
  30. package/lib/models/DnsRecord.js +1 -2
  31. package/lib/models/EmailIncomingMessage.js +1 -2
  32. package/lib/models/Errors.js +1 -2
  33. package/lib/models/ExternalEvent.js +1 -2
  34. package/lib/models/File.js +1 -2
  35. package/lib/models/FileAction.js +1 -2
  36. package/lib/models/FileComment.js +1 -2
  37. package/lib/models/FileCommentReaction.js +1 -2
  38. package/lib/models/FileMigration.js +1 -2
  39. package/lib/models/FileUploadPart.js +1 -2
  40. package/lib/models/Folder.js +1 -2
  41. package/lib/models/FormField.js +1 -2
  42. package/lib/models/FormFieldSet.js +1 -2
  43. package/lib/models/GpgKey.js +1 -2
  44. package/lib/models/Group.js +1 -2
  45. package/lib/models/GroupUser.js +1 -2
  46. package/lib/models/History.js +1 -2
  47. package/lib/models/HistoryExport.js +1 -2
  48. package/lib/models/HistoryExportResult.js +1 -2
  49. package/lib/models/Image.js +1 -2
  50. package/lib/models/InboxRecipient.js +1 -2
  51. package/lib/models/InboxRegistration.js +1 -2
  52. package/lib/models/InboxUpload.js +1 -2
  53. package/lib/models/Invoice.js +1 -2
  54. package/lib/models/InvoiceLineItem.js +1 -2
  55. package/lib/models/IpAddress.js +1 -2
  56. package/lib/models/Lock.js +1 -2
  57. package/lib/models/Message.js +1 -2
  58. package/lib/models/MessageComment.js +1 -2
  59. package/lib/models/MessageCommentReaction.js +1 -2
  60. package/lib/models/MessageReaction.js +1 -2
  61. package/lib/models/Notification.js +1 -2
  62. package/lib/models/Payment.js +1 -2
  63. package/lib/models/PaymentLineItem.js +1 -2
  64. package/lib/models/Permission.js +1 -2
  65. package/lib/models/Preview.js +1 -2
  66. package/lib/models/Priority.js +1 -2
  67. package/lib/models/Project.js +1 -2
  68. package/lib/models/PublicIpAddress.js +1 -2
  69. package/lib/models/PublicKey.js +1 -2
  70. package/lib/models/RemoteBandwidthSnapshot.js +1 -2
  71. package/lib/models/RemoteServer.js +1 -2
  72. package/lib/models/RemoteServerConfigurationFile.js +1 -2
  73. package/lib/models/Request.js +1 -2
  74. package/lib/models/Session.js +1 -2
  75. package/lib/models/SettingsChange.js +1 -2
  76. package/lib/models/SftpHostKey.js +1 -2
  77. package/lib/models/ShareGroup.js +1 -2
  78. package/lib/models/ShareGroupMember.js +1 -2
  79. package/lib/models/Site.js +91 -81
  80. package/lib/models/Snapshot.js +1 -2
  81. package/lib/models/SsoStrategy.js +1 -2
  82. package/lib/models/Status.js +1 -2
  83. package/lib/models/Style.js +1 -2
  84. package/lib/models/UsageDailySnapshot.js +1 -2
  85. package/lib/models/UsageSnapshot.js +1 -2
  86. package/lib/models/User.js +1 -2
  87. package/lib/models/UserCipherUse.js +1 -2
  88. package/lib/models/UserRequest.js +1 -2
  89. package/lib/models/WebhookTest.js +1 -2
  90. package/lib/utils.js +8 -15
  91. package/package.json +1 -1
  92. package/src/Files.js +1 -1
  93. package/src/models/Site.js +8 -0
@@ -234,7 +234,6 @@ _class = WebhookTest;
234
234
  }
235
235
  }, _callee);
236
236
  })));
237
- var _default = WebhookTest;
238
- exports.default = _default;
237
+ var _default = exports.default = WebhookTest;
239
238
  module.exports = WebhookTest;
240
239
  module.exports.default = WebhookTest;
package/lib/utils.js CHANGED
@@ -4,31 +4,24 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  exports.__esModule = true;
5
5
  exports.isString = exports.isObject = exports.isInt = exports.isEmpty = exports.isBrowser = exports.isArray = exports.getType = void 0;
6
6
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
7
- var isArray = function isArray(value) {
7
+ var isArray = exports.isArray = function isArray(value) {
8
8
  return Array.isArray(value);
9
9
  };
10
- exports.isArray = isArray;
11
- var isInt = function isInt(value) {
10
+ var isInt = exports.isInt = function isInt(value) {
12
11
  return typeof value === 'number';
13
12
  };
14
- exports.isInt = isInt;
15
- var isObject = function isObject(value) {
13
+ var isObject = exports.isObject = function isObject(value) {
16
14
  return value && (0, _typeof2.default)(value) === 'object' && !Array.isArray(value);
17
15
  };
18
- exports.isObject = isObject;
19
- var isString = function isString(value) {
16
+ var isString = exports.isString = function isString(value) {
20
17
  return typeof value === 'string';
21
18
  };
22
- exports.isString = isString;
23
- var isEmpty = function isEmpty(value) {
19
+ var isEmpty = exports.isEmpty = function isEmpty(value) {
24
20
  return !value || isArray(value) && value.length === 0 || isObject(value) && Object.keys(value).length === 0;
25
21
  };
26
- exports.isEmpty = isEmpty;
27
- var getType = function getType(value) {
22
+ var getType = exports.getType = function getType(value) {
28
23
  return isArray(value) ? 'array' : (0, _typeof2.default)(value);
29
24
  };
30
- exports.getType = getType;
31
- var isBrowser = function isBrowser() {
25
+ var isBrowser = exports.isBrowser = function isBrowser() {
32
26
  return typeof self !== 'undefined' && typeof self.document !== 'undefined';
33
- };
34
- exports.isBrowser = isBrowser;
27
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.0.415",
3
+ "version": "1.0.417",
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
- let version = "1.0.415"
8
+ let version = "1.0.417"
9
9
  let userAgent = `Files.com JavaScript SDK v${version}`
10
10
 
11
11
  let logLevel = LogLevel.INFO
@@ -65,6 +65,9 @@ class Site {
65
65
  // int64 # Site-wide Bundle expiration in days
66
66
  getBundleExpiration = () => this.attributes.bundle_expiration
67
67
 
68
+ // string # Custom error message to show when bundle is not found.
69
+ getBundleNotFoundMessage = () => this.attributes.bundle_not_found_message
70
+
68
71
  // boolean # Do Bundles require password protection?
69
72
  getBundlePasswordRequired = () => this.attributes.bundle_password_required
70
73
 
@@ -534,6 +537,7 @@ class Site {
534
537
  // disable_password_reset - boolean - Is password reset disabled?
535
538
  // immutable_files - boolean - Are files protected from modification?
536
539
  // session_pinned_by_ip - boolean - Are sessions locked to the same IP? (i.e. do users need to log in again if they change IPs?)
540
+ // bundle_not_found_message - string - Custom error message to show when bundle is not found.
537
541
  // bundle_password_required - boolean - Do Bundles require password protection?
538
542
  // bundle_require_registration - boolean - Do Bundles require registration?
539
543
  // bundle_require_share_recipient - boolean - Do Bundles require recipients for sharing?
@@ -723,6 +727,10 @@ class Site {
723
727
  throw new errors.InvalidParameterError(`Bad parameter: password_min_length must be of type Int, received ${getType(params['password_min_length'])}`)
724
728
  }
725
729
 
730
+ if (params['bundle_not_found_message'] && !isString(params['bundle_not_found_message'])) {
731
+ throw new errors.InvalidParameterError(`Bad parameter: bundle_not_found_message must be of type String, received ${getType(params['bundle_not_found_message'])}`)
732
+ }
733
+
726
734
  if (params['bundle_registration_notifications'] && !isString(params['bundle_registration_notifications'])) {
727
735
  throw new errors.InvalidParameterError(`Bad parameter: bundle_registration_notifications must be of type String, received ${getType(params['bundle_registration_notifications'])}`)
728
736
  }