files.com 1.2.163 → 1.2.165

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.163
1
+ 1.2.165
@@ -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.
@@ -7,6 +7,7 @@
7
7
  "id": 1,
8
8
  "protocol_cipher": "TLSv1.2; ECDHE-RSA-AES256-GCM-SHA384",
9
9
  "created_at": "2000-01-01T01:00:00Z",
10
+ "insecure": true,
10
11
  "interface": "restapi",
11
12
  "updated_at": "2000-01-01T01:00:00Z",
12
13
  "user_id": 1
@@ -16,6 +17,7 @@
16
17
  * `id` (int64): UserCipherUse ID
17
18
  * `protocol_cipher` (string): The protocol and cipher employed
18
19
  * `created_at` (date-time): The earliest recorded use of this combination of interface and protocol and cipher (for this user)
20
+ * `insecure` (boolean): Is this cipher considered insecure?
19
21
  * `interface` (string): The interface accessed
20
22
  * `updated_at` (date-time): The most recent use of this combination of interface and protocol and cipher (for this user)
21
23
  * `user_id` (int64): ID of the user who performed this access
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.163';
14
+ var version = '1.2.165';
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;
@@ -45,6 +45,10 @@ var UserCipherUse = /*#__PURE__*/(0, _createClass2.default)(function UserCipherU
45
45
  (0, _defineProperty2.default)(this, "getCreatedAt", function () {
46
46
  return _this.attributes.created_at;
47
47
  });
48
+ // boolean # Is this cipher considered insecure?
49
+ (0, _defineProperty2.default)(this, "getInsecure", function () {
50
+ return _this.attributes.insecure;
51
+ });
48
52
  // string # The interface accessed
49
53
  (0, _defineProperty2.default)(this, "getInterface", function () {
50
54
  return _this.attributes.interface;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.2.163",
3
+ "version": "1.2.165",
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.163'
8
+ const version = '1.2.165'
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
@@ -37,6 +37,9 @@ class UserCipherUse {
37
37
  // date-time # The earliest recorded use of this combination of interface and protocol and cipher (for this user)
38
38
  getCreatedAt = () => this.attributes.created_at
39
39
 
40
+ // boolean # Is this cipher considered insecure?
41
+ getInsecure = () => this.attributes.insecure
42
+
40
43
  // string # The interface accessed
41
44
  getInterface = () => this.attributes.interface
42
45