files.com 1.2.162 → 1.2.164

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.2.162
1
+ 1.2.164
@@ -49,7 +49,7 @@ await BundleAction.list
49
49
 
50
50
  * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
51
51
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
52
- * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
52
+ * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
53
53
  * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `bundle_id` or `bundle_registration_id`. Valid field combinations are `[ created_at, bundle_id ]`, `[ created_at, bundle_registration_id ]`, `[ bundle_id, bundle_registration_id ]` or `[ created_at, bundle_id, bundle_registration_id ]`.
54
54
  * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
55
55
  * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
@@ -0,0 +1,50 @@
1
+ # Export
2
+
3
+ ## Example Export Object
4
+
5
+ ```
6
+ {
7
+ "id": 1,
8
+ "export_status": "example",
9
+ "export_type": "example",
10
+ "download_uri": "example"
11
+ }
12
+ ```
13
+
14
+ * `id` (int64): ID for this Export
15
+ * `export_status` (string): Status of the Export
16
+ * `export_type` (string): Type of data being exported
17
+ * `download_uri` (string): Link to download Export file.
18
+
19
+ ---
20
+
21
+ ## List Exports
22
+
23
+ ```
24
+ await Export.list({
25
+ 'user_id': 1,
26
+ })
27
+ ```
28
+
29
+
30
+ ### Parameters
31
+
32
+ * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
33
+ * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
34
+ * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
35
+ * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `export_status` and `export_type`.
36
+ * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `export_status` and `export_type`.
37
+ * `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `export_type`.
38
+
39
+ ---
40
+
41
+ ## Show Export
42
+
43
+ ```
44
+ await Export.find(id)
45
+ ```
46
+
47
+
48
+ ### Parameters
49
+
50
+ * `id` (int64): Required - Export ID.
@@ -61,7 +61,7 @@
61
61
  "dav_enabled": true,
62
62
  "dav_user_root_enabled": true,
63
63
  "days_to_retain_backups": 30,
64
- "document_edits_in_bundle_allowed": "example",
64
+ "document_edits_in_bundle_allowed": true,
65
65
  "default_time_zone": "Pacific Time (US & Canada)",
66
66
  "desktop_app": true,
67
67
  "desktop_app_session_ip_pinning": true,
@@ -348,7 +348,7 @@
348
348
  * `dav_enabled` (boolean): Is WebDAV enabled?
349
349
  * `dav_user_root_enabled` (boolean): Use user FTP roots also for WebDAV?
350
350
  * `days_to_retain_backups` (int64): Number of days to keep deleted files
351
- * `document_edits_in_bundle_allowed` (string): If true, allow public viewers of Bundles with full permissions to use document editing integrations.
351
+ * `document_edits_in_bundle_allowed` (boolean): If true, allow public viewers of Bundles with full permissions to use document editing integrations.
352
352
  * `default_time_zone` (string): Site default time zone
353
353
  * `desktop_app` (boolean): Is the desktop app enabled?
354
354
  * `desktop_app_session_ip_pinning` (boolean): Is desktop app session IP pinning enabled?
@@ -571,7 +571,7 @@ await Site.update({
571
571
  'bundle_registration_notifications': "never",
572
572
  'bundle_activity_notifications': "never",
573
573
  'bundle_upload_receipt_notifications': "never",
574
- 'document_edits_in_bundle_allowed': "example",
574
+ 'document_edits_in_bundle_allowed': true,
575
575
  'password_requirements_apply_to_bundles': true,
576
576
  'prevent_root_permissions_for_non_site_admins': true,
577
577
  'opt_out_global': true,
@@ -730,7 +730,7 @@ await Site.update({
730
730
  * `bundle_registration_notifications` (string): Do Bundle owners receive registration notification?
731
731
  * `bundle_activity_notifications` (string): Do Bundle owners receive activity notifications?
732
732
  * `bundle_upload_receipt_notifications` (string): Do Bundle uploaders receive upload confirmation notifications?
733
- * `document_edits_in_bundle_allowed` (string): If true, allow public viewers of Bundles with full permissions to use document editing integrations.
733
+ * `document_edits_in_bundle_allowed` (boolean): If true, allow public viewers of Bundles with full permissions to use document editing integrations.
734
734
  * `password_requirements_apply_to_bundles` (boolean): Require bundles' passwords, and passwords for other items (inboxes, public shares, etc.) to conform to the same requirements as users' passwords?
735
735
  * `prevent_root_permissions_for_non_site_admins` (boolean): If true, we will prevent non-administrators from receiving any permissions directly on the root folder. This is commonly used to prevent the accidental application of permissions.
736
736
  * `opt_out_global` (boolean): Use servers in the USA only?
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.162';
14
+ var version = '1.2.164';
15
15
  var userAgent = "Files.com JavaScript SDK v".concat(version);
16
16
  var logLevel = _Logger.LogLevel.INFO;
17
17
  var debugRequest = false;
@@ -74,7 +74,7 @@ _BundleAction = BundleAction;
74
74
  // Parameters:
75
75
  // cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
76
76
  // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
77
- // sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
77
+ // sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
78
78
  // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `bundle_id` or `bundle_registration_id`. Valid field combinations are `[ created_at, bundle_id ]`, `[ created_at, bundle_registration_id ]`, `[ bundle_id, bundle_registration_id ]` or `[ created_at, bundle_id, bundle_registration_id ]`.
79
79
  // filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
80
80
  // filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ exports.__esModule = true;
6
+ exports.default = void 0;
7
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
8
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
+ var _Api = _interopRequireDefault(require("../Api"));
14
+ var errors = _interopRequireWildcard(require("../Errors"));
15
+ var _utils = require("../utils");
16
+ var _Export;
17
+ /* eslint-disable no-unused-vars */
18
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
19
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
22
+ /* eslint-enable no-unused-vars */
23
+ /**
24
+ * Class Export
25
+ */
26
+ var Export = /*#__PURE__*/(0, _createClass2.default)(function Export() {
27
+ var _this = this;
28
+ var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
29
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
30
+ (0, _classCallCheck2.default)(this, Export);
31
+ (0, _defineProperty2.default)(this, "attributes", {});
32
+ (0, _defineProperty2.default)(this, "options", {});
33
+ (0, _defineProperty2.default)(this, "isLoaded", function () {
34
+ return !!_this.attributes.id;
35
+ });
36
+ // int64 # ID for this Export
37
+ (0, _defineProperty2.default)(this, "getId", function () {
38
+ return _this.attributes.id;
39
+ });
40
+ // string # Status of the Export
41
+ (0, _defineProperty2.default)(this, "getExportStatus", function () {
42
+ return _this.attributes.export_status;
43
+ });
44
+ // string # Type of data being exported
45
+ (0, _defineProperty2.default)(this, "getExportType", function () {
46
+ return _this.attributes.export_type;
47
+ });
48
+ // string # Link to download Export file.
49
+ (0, _defineProperty2.default)(this, "getDownloadUri", function () {
50
+ return _this.attributes.download_uri;
51
+ });
52
+ Object.entries(attributes).forEach(function (_ref) {
53
+ var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
54
+ key = _ref2[0],
55
+ value = _ref2[1];
56
+ var normalizedKey = key.replace('?', '');
57
+ _this.attributes[normalizedKey] = value;
58
+ Object.defineProperty(_this, normalizedKey, {
59
+ value: value,
60
+ writable: false
61
+ });
62
+ });
63
+ this.options = _objectSpread({}, options);
64
+ });
65
+ _Export = Export;
66
+ // Parameters:
67
+ // user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
68
+ // cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
69
+ // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
70
+ // sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `export_status` and `export_type`.
71
+ // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `export_status` and `export_type`.
72
+ // filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `export_type`.
73
+ (0, _defineProperty2.default)(Export, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
74
+ var _response$data;
75
+ var params,
76
+ options,
77
+ response,
78
+ _args = arguments;
79
+ return _regenerator.default.wrap(function _callee$(_context) {
80
+ while (1) switch (_context.prev = _context.next) {
81
+ case 0:
82
+ params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
83
+ options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
84
+ if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
85
+ _context.next = 4;
86
+ break;
87
+ }
88
+ throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
89
+ case 4:
90
+ if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
91
+ _context.next = 6;
92
+ break;
93
+ }
94
+ throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
95
+ case 6:
96
+ if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
97
+ _context.next = 8;
98
+ break;
99
+ }
100
+ throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
101
+ case 8:
102
+ _context.next = 10;
103
+ return _Api.default.sendRequest('/exports', 'GET', params, options);
104
+ case 10:
105
+ response = _context.sent;
106
+ return _context.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
107
+ return new _Export(obj, options);
108
+ })) || []);
109
+ case 12:
110
+ case "end":
111
+ return _context.stop();
112
+ }
113
+ }, _callee);
114
+ })));
115
+ (0, _defineProperty2.default)(Export, "all", function () {
116
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
117
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
118
+ return _Export.list(params, options);
119
+ });
120
+ // Parameters:
121
+ // id (required) - int64 - Export ID.
122
+ (0, _defineProperty2.default)(Export, "find", /*#__PURE__*/function () {
123
+ var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(id) {
124
+ var params,
125
+ options,
126
+ response,
127
+ _args2 = arguments;
128
+ return _regenerator.default.wrap(function _callee2$(_context2) {
129
+ while (1) switch (_context2.prev = _context2.next) {
130
+ case 0:
131
+ params = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
132
+ options = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {};
133
+ if ((0, _utils.isObject)(params)) {
134
+ _context2.next = 4;
135
+ break;
136
+ }
137
+ throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
138
+ case 4:
139
+ params.id = id;
140
+ if (params.id) {
141
+ _context2.next = 7;
142
+ break;
143
+ }
144
+ throw new errors.MissingParameterError('Parameter missing: id');
145
+ case 7:
146
+ if (!(params.id && !(0, _utils.isInt)(params.id))) {
147
+ _context2.next = 9;
148
+ break;
149
+ }
150
+ throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
151
+ case 9:
152
+ _context2.next = 11;
153
+ return _Api.default.sendRequest("/exports/".concat(encodeURIComponent(params.id)), 'GET', params, options);
154
+ case 11:
155
+ response = _context2.sent;
156
+ return _context2.abrupt("return", new _Export(response === null || response === void 0 ? void 0 : response.data, options));
157
+ case 13:
158
+ case "end":
159
+ return _context2.stop();
160
+ }
161
+ }, _callee2);
162
+ }));
163
+ return function (_x) {
164
+ return _ref4.apply(this, arguments);
165
+ };
166
+ }());
167
+ (0, _defineProperty2.default)(Export, "get", function (id) {
168
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
169
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
170
+ return _Export.find(id, params, options);
171
+ });
172
+ var _default = exports.default = Export;
173
+ module.exports = Export;
174
+ module.exports.default = Export;
@@ -225,7 +225,7 @@ var Site = /*#__PURE__*/(0, _createClass2.default)(function Site() {
225
225
  (0, _defineProperty2.default)(this, "getDaysToRetainBackups", function () {
226
226
  return _this.attributes.days_to_retain_backups;
227
227
  });
228
- // string # If true, allow public viewers of Bundles with full permissions to use document editing integrations.
228
+ // boolean # If true, allow public viewers of Bundles with full permissions to use document editing integrations.
229
229
  (0, _defineProperty2.default)(this, "getDocumentEditsInBundleAllowed", function () {
230
230
  return _this.attributes.document_edits_in_bundle_allowed;
231
231
  });
@@ -842,7 +842,7 @@ _Site = Site;
842
842
  // bundle_registration_notifications - string - Do Bundle owners receive registration notification?
843
843
  // bundle_activity_notifications - string - Do Bundle owners receive activity notifications?
844
844
  // bundle_upload_receipt_notifications - string - Do Bundle uploaders receive upload confirmation notifications?
845
- // document_edits_in_bundle_allowed - string - If true, allow public viewers of Bundles with full permissions to use document editing integrations.
845
+ // document_edits_in_bundle_allowed - boolean - If true, allow public viewers of Bundles with full permissions to use document editing integrations.
846
846
  // password_requirements_apply_to_bundles - boolean - Require bundles' passwords, and passwords for other items (inboxes, public shares, etc.) to conform to the same requirements as users' passwords?
847
847
  // prevent_root_permissions_for_non_site_admins - boolean - If true, we will prevent non-administrators from receiving any permissions directly on the root folder. This is commonly used to prevent the accidental application of permissions.
848
848
  // opt_out_global - boolean - Use servers in the USA only?
@@ -1129,234 +1129,228 @@ _Site = Site;
1129
1129
  }
1130
1130
  throw new errors.InvalidParameterError("Bad parameter: bundle_upload_receipt_notifications must be of type String, received ".concat((0, _utils.getType)(params.bundle_upload_receipt_notifications)));
1131
1131
  case 66:
1132
- if (!(params.document_edits_in_bundle_allowed && !(0, _utils.isString)(params.document_edits_in_bundle_allowed))) {
1133
- _context3.next = 68;
1134
- break;
1135
- }
1136
- throw new errors.InvalidParameterError("Bad parameter: document_edits_in_bundle_allowed must be of type String, received ".concat((0, _utils.getType)(params.document_edits_in_bundle_allowed)));
1137
- case 68:
1138
1132
  if (!(params.disable_users_from_inactivity_period_days && !(0, _utils.isInt)(params.disable_users_from_inactivity_period_days))) {
1139
- _context3.next = 70;
1133
+ _context3.next = 68;
1140
1134
  break;
1141
1135
  }
1142
1136
  throw new errors.InvalidParameterError("Bad parameter: disable_users_from_inactivity_period_days must be of type Int, received ".concat((0, _utils.getType)(params.disable_users_from_inactivity_period_days)));
1143
- case 70:
1137
+ case 68:
1144
1138
  if (!(params.sftp_host_key_type && !(0, _utils.isString)(params.sftp_host_key_type))) {
1145
- _context3.next = 72;
1139
+ _context3.next = 70;
1146
1140
  break;
1147
1141
  }
1148
1142
  throw new errors.InvalidParameterError("Bad parameter: sftp_host_key_type must be of type String, received ".concat((0, _utils.getType)(params.sftp_host_key_type)));
1149
- case 72:
1143
+ case 70:
1150
1144
  if (!(params.active_sftp_host_key_id && !(0, _utils.isInt)(params.active_sftp_host_key_id))) {
1151
- _context3.next = 74;
1145
+ _context3.next = 72;
1152
1146
  break;
1153
1147
  }
1154
1148
  throw new errors.InvalidParameterError("Bad parameter: active_sftp_host_key_id must be of type Int, received ".concat((0, _utils.getType)(params.active_sftp_host_key_id)));
1155
- case 74:
1149
+ case 72:
1156
1150
  if (!(params.bundle_recipient_blacklist_domains && !(0, _utils.isArray)(params.bundle_recipient_blacklist_domains))) {
1157
- _context3.next = 76;
1151
+ _context3.next = 74;
1158
1152
  break;
1159
1153
  }
1160
1154
  throw new errors.InvalidParameterError("Bad parameter: bundle_recipient_blacklist_domains must be of type Array, received ".concat((0, _utils.getType)(params.bundle_recipient_blacklist_domains)));
1161
- case 76:
1155
+ case 74:
1162
1156
  if (!(params.require_2fa_user_type && !(0, _utils.isString)(params.require_2fa_user_type))) {
1163
- _context3.next = 78;
1157
+ _context3.next = 76;
1164
1158
  break;
1165
1159
  }
1166
1160
  throw new errors.InvalidParameterError("Bad parameter: require_2fa_user_type must be of type String, received ".concat((0, _utils.getType)(params.require_2fa_user_type)));
1167
- case 78:
1161
+ case 76:
1168
1162
  if (!(params.color2_top && !(0, _utils.isString)(params.color2_top))) {
1169
- _context3.next = 80;
1163
+ _context3.next = 78;
1170
1164
  break;
1171
1165
  }
1172
1166
  throw new errors.InvalidParameterError("Bad parameter: color2_top must be of type String, received ".concat((0, _utils.getType)(params.color2_top)));
1173
- case 80:
1167
+ case 78:
1174
1168
  if (!(params.color2_left && !(0, _utils.isString)(params.color2_left))) {
1175
- _context3.next = 82;
1169
+ _context3.next = 80;
1176
1170
  break;
1177
1171
  }
1178
1172
  throw new errors.InvalidParameterError("Bad parameter: color2_left must be of type String, received ".concat((0, _utils.getType)(params.color2_left)));
1179
- case 82:
1173
+ case 80:
1180
1174
  if (!(params.color2_link && !(0, _utils.isString)(params.color2_link))) {
1181
- _context3.next = 84;
1175
+ _context3.next = 82;
1182
1176
  break;
1183
1177
  }
1184
1178
  throw new errors.InvalidParameterError("Bad parameter: color2_link must be of type String, received ".concat((0, _utils.getType)(params.color2_link)));
1185
- case 84:
1179
+ case 82:
1186
1180
  if (!(params.color2_text && !(0, _utils.isString)(params.color2_text))) {
1187
- _context3.next = 86;
1181
+ _context3.next = 84;
1188
1182
  break;
1189
1183
  }
1190
1184
  throw new errors.InvalidParameterError("Bad parameter: color2_text must be of type String, received ".concat((0, _utils.getType)(params.color2_text)));
1191
- case 86:
1185
+ case 84:
1192
1186
  if (!(params.color2_top_text && !(0, _utils.isString)(params.color2_top_text))) {
1193
- _context3.next = 88;
1187
+ _context3.next = 86;
1194
1188
  break;
1195
1189
  }
1196
1190
  throw new errors.InvalidParameterError("Bad parameter: color2_top_text must be of type String, received ".concat((0, _utils.getType)(params.color2_top_text)));
1197
- case 88:
1191
+ case 86:
1198
1192
  if (!(params.site_header && !(0, _utils.isString)(params.site_header))) {
1199
- _context3.next = 90;
1193
+ _context3.next = 88;
1200
1194
  break;
1201
1195
  }
1202
1196
  throw new errors.InvalidParameterError("Bad parameter: site_header must be of type String, received ".concat((0, _utils.getType)(params.site_header)));
1203
- case 90:
1197
+ case 88:
1204
1198
  if (!(params.site_footer && !(0, _utils.isString)(params.site_footer))) {
1205
- _context3.next = 92;
1199
+ _context3.next = 90;
1206
1200
  break;
1207
1201
  }
1208
1202
  throw new errors.InvalidParameterError("Bad parameter: site_footer must be of type String, received ".concat((0, _utils.getType)(params.site_footer)));
1209
- case 92:
1203
+ case 90:
1210
1204
  if (!(params.login_help_text && !(0, _utils.isString)(params.login_help_text))) {
1211
- _context3.next = 94;
1205
+ _context3.next = 92;
1212
1206
  break;
1213
1207
  }
1214
1208
  throw new errors.InvalidParameterError("Bad parameter: login_help_text must be of type String, received ".concat((0, _utils.getType)(params.login_help_text)));
1215
- case 94:
1209
+ case 92:
1216
1210
  if (!(params.smtp_address && !(0, _utils.isString)(params.smtp_address))) {
1217
- _context3.next = 96;
1211
+ _context3.next = 94;
1218
1212
  break;
1219
1213
  }
1220
1214
  throw new errors.InvalidParameterError("Bad parameter: smtp_address must be of type String, received ".concat((0, _utils.getType)(params.smtp_address)));
1221
- case 96:
1215
+ case 94:
1222
1216
  if (!(params.smtp_authentication && !(0, _utils.isString)(params.smtp_authentication))) {
1223
- _context3.next = 98;
1217
+ _context3.next = 96;
1224
1218
  break;
1225
1219
  }
1226
1220
  throw new errors.InvalidParameterError("Bad parameter: smtp_authentication must be of type String, received ".concat((0, _utils.getType)(params.smtp_authentication)));
1227
- case 98:
1221
+ case 96:
1228
1222
  if (!(params.smtp_from && !(0, _utils.isString)(params.smtp_from))) {
1229
- _context3.next = 100;
1223
+ _context3.next = 98;
1230
1224
  break;
1231
1225
  }
1232
1226
  throw new errors.InvalidParameterError("Bad parameter: smtp_from must be of type String, received ".concat((0, _utils.getType)(params.smtp_from)));
1233
- case 100:
1227
+ case 98:
1234
1228
  if (!(params.smtp_username && !(0, _utils.isString)(params.smtp_username))) {
1235
- _context3.next = 102;
1229
+ _context3.next = 100;
1236
1230
  break;
1237
1231
  }
1238
1232
  throw new errors.InvalidParameterError("Bad parameter: smtp_username must be of type String, received ".concat((0, _utils.getType)(params.smtp_username)));
1239
- case 102:
1233
+ case 100:
1240
1234
  if (!(params.smtp_port && !(0, _utils.isInt)(params.smtp_port))) {
1241
- _context3.next = 104;
1235
+ _context3.next = 102;
1242
1236
  break;
1243
1237
  }
1244
1238
  throw new errors.InvalidParameterError("Bad parameter: smtp_port must be of type Int, received ".concat((0, _utils.getType)(params.smtp_port)));
1245
- case 104:
1239
+ case 102:
1246
1240
  if (!(params.ldap_type && !(0, _utils.isString)(params.ldap_type))) {
1247
- _context3.next = 106;
1241
+ _context3.next = 104;
1248
1242
  break;
1249
1243
  }
1250
1244
  throw new errors.InvalidParameterError("Bad parameter: ldap_type must be of type String, received ".concat((0, _utils.getType)(params.ldap_type)));
1251
- case 106:
1245
+ case 104:
1252
1246
  if (!(params.ldap_host && !(0, _utils.isString)(params.ldap_host))) {
1253
- _context3.next = 108;
1247
+ _context3.next = 106;
1254
1248
  break;
1255
1249
  }
1256
1250
  throw new errors.InvalidParameterError("Bad parameter: ldap_host must be of type String, received ".concat((0, _utils.getType)(params.ldap_host)));
1257
- case 108:
1251
+ case 106:
1258
1252
  if (!(params.ldap_host_2 && !(0, _utils.isString)(params.ldap_host_2))) {
1259
- _context3.next = 110;
1253
+ _context3.next = 108;
1260
1254
  break;
1261
1255
  }
1262
1256
  throw new errors.InvalidParameterError("Bad parameter: ldap_host_2 must be of type String, received ".concat((0, _utils.getType)(params.ldap_host_2)));
1263
- case 110:
1257
+ case 108:
1264
1258
  if (!(params.ldap_host_3 && !(0, _utils.isString)(params.ldap_host_3))) {
1265
- _context3.next = 112;
1259
+ _context3.next = 110;
1266
1260
  break;
1267
1261
  }
1268
1262
  throw new errors.InvalidParameterError("Bad parameter: ldap_host_3 must be of type String, received ".concat((0, _utils.getType)(params.ldap_host_3)));
1269
- case 112:
1263
+ case 110:
1270
1264
  if (!(params.ldap_port && !(0, _utils.isInt)(params.ldap_port))) {
1271
- _context3.next = 114;
1265
+ _context3.next = 112;
1272
1266
  break;
1273
1267
  }
1274
1268
  throw new errors.InvalidParameterError("Bad parameter: ldap_port must be of type Int, received ".concat((0, _utils.getType)(params.ldap_port)));
1275
- case 114:
1269
+ case 112:
1276
1270
  if (!(params.ldap_username && !(0, _utils.isString)(params.ldap_username))) {
1277
- _context3.next = 116;
1271
+ _context3.next = 114;
1278
1272
  break;
1279
1273
  }
1280
1274
  throw new errors.InvalidParameterError("Bad parameter: ldap_username must be of type String, received ".concat((0, _utils.getType)(params.ldap_username)));
1281
- case 116:
1275
+ case 114:
1282
1276
  if (!(params.ldap_username_field && !(0, _utils.isString)(params.ldap_username_field))) {
1283
- _context3.next = 118;
1277
+ _context3.next = 116;
1284
1278
  break;
1285
1279
  }
1286
1280
  throw new errors.InvalidParameterError("Bad parameter: ldap_username_field must be of type String, received ".concat((0, _utils.getType)(params.ldap_username_field)));
1287
- case 118:
1281
+ case 116:
1288
1282
  if (!(params.ldap_domain && !(0, _utils.isString)(params.ldap_domain))) {
1289
- _context3.next = 120;
1283
+ _context3.next = 118;
1290
1284
  break;
1291
1285
  }
1292
1286
  throw new errors.InvalidParameterError("Bad parameter: ldap_domain must be of type String, received ".concat((0, _utils.getType)(params.ldap_domain)));
1293
- case 120:
1287
+ case 118:
1294
1288
  if (!(params.ldap_user_action && !(0, _utils.isString)(params.ldap_user_action))) {
1295
- _context3.next = 122;
1289
+ _context3.next = 120;
1296
1290
  break;
1297
1291
  }
1298
1292
  throw new errors.InvalidParameterError("Bad parameter: ldap_user_action must be of type String, received ".concat((0, _utils.getType)(params.ldap_user_action)));
1299
- case 122:
1293
+ case 120:
1300
1294
  if (!(params.ldap_group_action && !(0, _utils.isString)(params.ldap_group_action))) {
1301
- _context3.next = 124;
1295
+ _context3.next = 122;
1302
1296
  break;
1303
1297
  }
1304
1298
  throw new errors.InvalidParameterError("Bad parameter: ldap_group_action must be of type String, received ".concat((0, _utils.getType)(params.ldap_group_action)));
1305
- case 124:
1299
+ case 122:
1306
1300
  if (!(params.ldap_user_include_groups && !(0, _utils.isString)(params.ldap_user_include_groups))) {
1307
- _context3.next = 126;
1301
+ _context3.next = 124;
1308
1302
  break;
1309
1303
  }
1310
1304
  throw new errors.InvalidParameterError("Bad parameter: ldap_user_include_groups must be of type String, received ".concat((0, _utils.getType)(params.ldap_user_include_groups)));
1311
- case 126:
1305
+ case 124:
1312
1306
  if (!(params.ldap_group_exclusion && !(0, _utils.isString)(params.ldap_group_exclusion))) {
1313
- _context3.next = 128;
1307
+ _context3.next = 126;
1314
1308
  break;
1315
1309
  }
1316
1310
  throw new errors.InvalidParameterError("Bad parameter: ldap_group_exclusion must be of type String, received ".concat((0, _utils.getType)(params.ldap_group_exclusion)));
1317
- case 128:
1311
+ case 126:
1318
1312
  if (!(params.ldap_group_inclusion && !(0, _utils.isString)(params.ldap_group_inclusion))) {
1319
- _context3.next = 130;
1313
+ _context3.next = 128;
1320
1314
  break;
1321
1315
  }
1322
1316
  throw new errors.InvalidParameterError("Bad parameter: ldap_group_inclusion must be of type String, received ".concat((0, _utils.getType)(params.ldap_group_inclusion)));
1323
- case 130:
1317
+ case 128:
1324
1318
  if (!(params.ldap_base_dn && !(0, _utils.isString)(params.ldap_base_dn))) {
1325
- _context3.next = 132;
1319
+ _context3.next = 130;
1326
1320
  break;
1327
1321
  }
1328
1322
  throw new errors.InvalidParameterError("Bad parameter: ldap_base_dn must be of type String, received ".concat((0, _utils.getType)(params.ldap_base_dn)));
1329
- case 132:
1323
+ case 130:
1330
1324
  if (!(params.ldap_password_change && !(0, _utils.isString)(params.ldap_password_change))) {
1331
- _context3.next = 134;
1325
+ _context3.next = 132;
1332
1326
  break;
1333
1327
  }
1334
1328
  throw new errors.InvalidParameterError("Bad parameter: ldap_password_change must be of type String, received ".concat((0, _utils.getType)(params.ldap_password_change)));
1335
- case 134:
1329
+ case 132:
1336
1330
  if (!(params.ldap_password_change_confirmation && !(0, _utils.isString)(params.ldap_password_change_confirmation))) {
1337
- _context3.next = 136;
1331
+ _context3.next = 134;
1338
1332
  break;
1339
1333
  }
1340
1334
  throw new errors.InvalidParameterError("Bad parameter: ldap_password_change_confirmation must be of type String, received ".concat((0, _utils.getType)(params.ldap_password_change_confirmation)));
1341
- case 136:
1335
+ case 134:
1342
1336
  if (!(params.smtp_password && !(0, _utils.isString)(params.smtp_password))) {
1343
- _context3.next = 138;
1337
+ _context3.next = 136;
1344
1338
  break;
1345
1339
  }
1346
1340
  throw new errors.InvalidParameterError("Bad parameter: smtp_password must be of type String, received ".concat((0, _utils.getType)(params.smtp_password)));
1347
- case 138:
1341
+ case 136:
1348
1342
  if (!(params.session_expiry_minutes && !(0, _utils.isInt)(params.session_expiry_minutes))) {
1349
- _context3.next = 140;
1343
+ _context3.next = 138;
1350
1344
  break;
1351
1345
  }
1352
1346
  throw new errors.InvalidParameterError("Bad parameter: session_expiry_minutes must be of type Int, received ".concat((0, _utils.getType)(params.session_expiry_minutes)));
1353
- case 140:
1354
- _context3.next = 142;
1347
+ case 138:
1348
+ _context3.next = 140;
1355
1349
  return _Api.default.sendRequest('/site', 'PATCH', params, options);
1356
- case 142:
1350
+ case 140:
1357
1351
  response = _context3.sent;
1358
1352
  return _context3.abrupt("return", new _Site(response === null || response === void 0 ? void 0 : response.data, options));
1359
- case 144:
1353
+ case 142:
1360
1354
  case "end":
1361
1355
  return _context3.stop();
1362
1356
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.2.162",
3
+ "version": "1.2.164",
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.162'
8
+ const version = '1.2.164'
9
9
  let userAgent = `Files.com JavaScript SDK v${version}`
10
10
 
11
11
  let logLevel = LogLevel.INFO
@@ -49,7 +49,7 @@ class BundleAction {
49
49
  // Parameters:
50
50
  // cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
51
51
  // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
52
- // sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
52
+ // sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
53
53
  // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `bundle_id` or `bundle_registration_id`. Valid field combinations are `[ created_at, bundle_id ]`, `[ created_at, bundle_registration_id ]`, `[ bundle_id, bundle_registration_id ]` or `[ created_at, bundle_id, bundle_registration_id ]`.
54
54
  // filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`.
55
55
  // filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`.
@@ -0,0 +1,100 @@
1
+ /* eslint-disable no-unused-vars */
2
+ import Api from '../Api'
3
+ import * as errors from '../Errors'
4
+ import {
5
+ getType, isArray, isInt, isObject, isString,
6
+ } from '../utils'
7
+ /* eslint-enable no-unused-vars */
8
+
9
+ /**
10
+ * Class Export
11
+ */
12
+ class Export {
13
+ attributes = {}
14
+
15
+ options = {}
16
+
17
+ constructor(attributes = {}, options = {}) {
18
+ Object.entries(attributes).forEach(([key, value]) => {
19
+ const normalizedKey = key.replace('?', '')
20
+
21
+ this.attributes[normalizedKey] = value
22
+
23
+ Object.defineProperty(this, normalizedKey, { value, writable: false })
24
+ })
25
+
26
+ this.options = { ...options }
27
+ }
28
+
29
+ isLoaded = () => !!this.attributes.id
30
+
31
+ // int64 # ID for this Export
32
+ getId = () => this.attributes.id
33
+
34
+ // string # Status of the Export
35
+ getExportStatus = () => this.attributes.export_status
36
+
37
+ // string # Type of data being exported
38
+ getExportType = () => this.attributes.export_type
39
+
40
+ // string # Link to download Export file.
41
+ getDownloadUri = () => this.attributes.download_uri
42
+
43
+ // Parameters:
44
+ // user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
45
+ // cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
46
+ // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
47
+ // sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `export_status` and `export_type`.
48
+ // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `export_status` and `export_type`.
49
+ // filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `export_type`.
50
+ static list = async (params = {}, options = {}) => {
51
+ if (params.user_id && !isInt(params.user_id)) {
52
+ throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params.user_id)}`)
53
+ }
54
+
55
+ if (params.cursor && !isString(params.cursor)) {
56
+ throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
57
+ }
58
+
59
+ if (params.per_page && !isInt(params.per_page)) {
60
+ throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`)
61
+ }
62
+
63
+ const response = await Api.sendRequest('/exports', 'GET', params, options)
64
+
65
+ return response?.data?.map(obj => new Export(obj, options)) || []
66
+ }
67
+
68
+ static all = (params = {}, options = {}) =>
69
+ Export.list(params, options)
70
+
71
+ // Parameters:
72
+ // id (required) - int64 - Export ID.
73
+ static find = async (id, params = {}, options = {}) => {
74
+ if (!isObject(params)) {
75
+ throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
76
+ }
77
+
78
+ params.id = id
79
+
80
+ if (!params.id) {
81
+ throw new errors.MissingParameterError('Parameter missing: id')
82
+ }
83
+
84
+ if (params.id && !isInt(params.id)) {
85
+ throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params.id)}`)
86
+ }
87
+
88
+ const response = await Api.sendRequest(`/exports/${encodeURIComponent(params.id)}`, 'GET', params, options)
89
+
90
+ return new Export(response?.data, options)
91
+ }
92
+
93
+ static get = (id, params = {}, options = {}) =>
94
+ Export.find(id, params, options)
95
+ }
96
+
97
+ export default Export
98
+
99
+ module.exports = Export
100
+ module.exports.default = Export
@@ -172,7 +172,7 @@ class Site {
172
172
  // int64 # Number of days to keep deleted files
173
173
  getDaysToRetainBackups = () => this.attributes.days_to_retain_backups
174
174
 
175
- // string # If true, allow public viewers of Bundles with full permissions to use document editing integrations.
175
+ // boolean # If true, allow public viewers of Bundles with full permissions to use document editing integrations.
176
176
  getDocumentEditsInBundleAllowed = () => this.attributes.document_edits_in_bundle_allowed
177
177
 
178
178
  // string # Site default time zone
@@ -627,7 +627,7 @@ class Site {
627
627
  // bundle_registration_notifications - string - Do Bundle owners receive registration notification?
628
628
  // bundle_activity_notifications - string - Do Bundle owners receive activity notifications?
629
629
  // bundle_upload_receipt_notifications - string - Do Bundle uploaders receive upload confirmation notifications?
630
- // document_edits_in_bundle_allowed - string - If true, allow public viewers of Bundles with full permissions to use document editing integrations.
630
+ // document_edits_in_bundle_allowed - boolean - If true, allow public viewers of Bundles with full permissions to use document editing integrations.
631
631
  // password_requirements_apply_to_bundles - boolean - Require bundles' passwords, and passwords for other items (inboxes, public shares, etc.) to conform to the same requirements as users' passwords?
632
632
  // prevent_root_permissions_for_non_site_admins - boolean - If true, we will prevent non-administrators from receiving any permissions directly on the root folder. This is commonly used to prevent the accidental application of permissions.
633
633
  // opt_out_global - boolean - Use servers in the USA only?
@@ -841,10 +841,6 @@ class Site {
841
841
  throw new errors.InvalidParameterError(`Bad parameter: bundle_upload_receipt_notifications must be of type String, received ${getType(params.bundle_upload_receipt_notifications)}`)
842
842
  }
843
843
 
844
- if (params.document_edits_in_bundle_allowed && !isString(params.document_edits_in_bundle_allowed)) {
845
- throw new errors.InvalidParameterError(`Bad parameter: document_edits_in_bundle_allowed must be of type String, received ${getType(params.document_edits_in_bundle_allowed)}`)
846
- }
847
-
848
844
  if (params.disable_users_from_inactivity_period_days && !isInt(params.disable_users_from_inactivity_period_days)) {
849
845
  throw new errors.InvalidParameterError(`Bad parameter: disable_users_from_inactivity_period_days must be of type Int, received ${getType(params.disable_users_from_inactivity_period_days)}`)
850
846
  }