files.com 1.1.15 → 1.1.17

Sign up to get free protection for your applications and to get access to all the features.
package/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.15
1
+ 1.1.17
@@ -85,10 +85,10 @@ await ApiKey.find(id)
85
85
  ```
86
86
  await ApiKey.create({
87
87
  'user_id': 1,
88
- 'name': "My Main API Key",
89
88
  'description': "example",
90
89
  'expires_at': "2000-01-01T01:00:00Z",
91
90
  'permission_set': "full",
91
+ 'name': "My Main API Key",
92
92
  })
93
93
  ```
94
94
 
@@ -96,10 +96,10 @@ await ApiKey.create({
96
96
  ### Parameters
97
97
 
98
98
  * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
99
- * `name` (string): Internal name for the API Key. For your use.
100
99
  * `description` (string): User-supplied description of API key.
101
100
  * `expires_at` (string): API Key expiration date
102
101
  * `permission_set` (string): Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
102
+ * `name` (string): Required - Internal name for the API Key. For your use.
103
103
 
104
104
  ---
105
105
 
@@ -137,20 +137,20 @@ await ApiKey.deleteCurrent
137
137
  const [api_key] = await ApiKey.list()
138
138
 
139
139
  await api_key.update({
140
- 'name': "My Main API Key",
141
140
  'description': "example",
142
141
  'expires_at': "2000-01-01T01:00:00Z",
143
142
  'permission_set': "full",
143
+ 'name': "My Main API Key",
144
144
  })
145
145
  ```
146
146
 
147
147
  ### Parameters
148
148
 
149
149
  * `id` (int64): Required - Api Key ID.
150
- * `name` (string): Internal name for the API Key. For your use.
151
150
  * `description` (string): User-supplied description of API key.
152
151
  * `expires_at` (string): API Key expiration date
153
152
  * `permission_set` (string): Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
153
+ * `name` (string): Internal name for the API Key. For your use.
154
154
 
155
155
  ### Example Response
156
156
 
@@ -88,7 +88,7 @@ await Automation.list({
88
88
 
89
89
  * `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.
90
90
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
91
- * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction (e.g. `sort_by[automation]=desc`). Valid fields are `automation`, `disabled` or `last_modified_at`.
91
+ * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction (e.g. `sort_by[automation]=desc`). Valid fields are `automation`, `disabled`, `last_modified_at` or `name`.
92
92
  * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `disabled`, `last_modified_at` or `automation`. Valid field combinations are `[ automation, disabled ]` and `[ disabled, automation ]`.
93
93
  * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `last_modified_at`.
94
94
  * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `last_modified_at`.
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.1.15';
14
+ var version = '1.1.17';
15
15
  var userAgent = "Files.com JavaScript SDK v".concat(version);
16
16
  var logLevel = _Logger.LogLevel.INFO;
17
17
  var debugRequest = false;
@@ -115,10 +115,10 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() {
115
115
  _this.attributes.user_id = value;
116
116
  });
117
117
  // Parameters:
118
- // name - string - Internal name for the API Key. For your use.
119
118
  // description - string - User-supplied description of API key.
120
119
  // expires_at - string - API Key expiration date
121
120
  // permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
121
+ // name - string - Internal name for the API Key. For your use.
122
122
  (0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
123
123
  var params,
124
124
  response,
@@ -146,29 +146,29 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() {
146
146
  }
147
147
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
148
148
  case 8:
149
- if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
149
+ if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
150
150
  _context.next = 10;
151
151
  break;
152
152
  }
153
- throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
153
+ throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params['description'])));
154
154
  case 10:
155
- if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
155
+ if (!(params['expires_at'] && !(0, _utils.isString)(params['expires_at']))) {
156
156
  _context.next = 12;
157
157
  break;
158
158
  }
159
- throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params['description'])));
159
+ throw new errors.InvalidParameterError("Bad parameter: expires_at must be of type String, received ".concat((0, _utils.getType)(params['expires_at'])));
160
160
  case 12:
161
- if (!(params['expires_at'] && !(0, _utils.isString)(params['expires_at']))) {
161
+ if (!(params['permission_set'] && !(0, _utils.isString)(params['permission_set']))) {
162
162
  _context.next = 14;
163
163
  break;
164
164
  }
165
- throw new errors.InvalidParameterError("Bad parameter: expires_at must be of type String, received ".concat((0, _utils.getType)(params['expires_at'])));
165
+ throw new errors.InvalidParameterError("Bad parameter: permission_set must be of type String, received ".concat((0, _utils.getType)(params['permission_set'])));
166
166
  case 14:
167
- if (!(params['permission_set'] && !(0, _utils.isString)(params['permission_set']))) {
167
+ if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
168
168
  _context.next = 16;
169
169
  break;
170
170
  }
171
- throw new errors.InvalidParameterError("Bad parameter: permission_set must be of type String, received ".concat((0, _utils.getType)(params['permission_set'])));
171
+ throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
172
172
  case 16:
173
173
  if (params['id']) {
174
174
  _context.next = 22;
@@ -423,10 +423,10 @@ _class = ApiKey;
423
423
  });
424
424
  // Parameters:
425
425
  // user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
426
- // name - string - Internal name for the API Key. For your use.
427
426
  // description - string - User-supplied description of API key.
428
427
  // expires_at - string - API Key expiration date
429
428
  // permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
429
+ // name (required) - string - Internal name for the API Key. For your use.
430
430
  (0, _defineProperty2.default)(ApiKey, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
431
431
  var params,
432
432
  options,
@@ -437,17 +437,17 @@ _class = ApiKey;
437
437
  case 0:
438
438
  params = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
439
439
  options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
440
- if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
440
+ if (params['name']) {
441
441
  _context7.next = 4;
442
442
  break;
443
443
  }
444
- throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
444
+ throw new errors.MissingParameterError('Parameter missing: name');
445
445
  case 4:
446
- if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
446
+ if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
447
447
  _context7.next = 6;
448
448
  break;
449
449
  }
450
- throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
450
+ throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
451
451
  case 6:
452
452
  if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
453
453
  _context7.next = 8;
@@ -467,12 +467,18 @@ _class = ApiKey;
467
467
  }
468
468
  throw new errors.InvalidParameterError("Bad parameter: permission_set must be of type String, received ".concat((0, _utils.getType)(params['permission_set'])));
469
469
  case 12:
470
- _context7.next = 14;
471
- return _Api.default.sendRequest("/api_keys", 'POST', params, options);
470
+ if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
471
+ _context7.next = 14;
472
+ break;
473
+ }
474
+ throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
472
475
  case 14:
476
+ _context7.next = 16;
477
+ return _Api.default.sendRequest("/api_keys", 'POST', params, options);
478
+ case 16:
473
479
  response = _context7.sent;
474
480
  return _context7.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
475
- case 16:
481
+ case 18:
476
482
  case "end":
477
483
  return _context7.stop();
478
484
  }
@@ -531,7 +531,7 @@ _class = Automation;
531
531
  // Parameters:
532
532
  // 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.
533
533
  // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
534
- // sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction (e.g. `sort_by[automation]=desc`). Valid fields are `automation`, `disabled` or `last_modified_at`.
534
+ // sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction (e.g. `sort_by[automation]=desc`). Valid fields are `automation`, `disabled`, `last_modified_at` or `name`.
535
535
  // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `disabled`, `last_modified_at` or `automation`. Valid field combinations are `[ automation, disabled ]` and `[ disabled, automation ]`.
536
536
  // filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `last_modified_at`.
537
537
  // filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `last_modified_at`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.1.15",
3
+ "version": "1.1.17",
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.1.15'
8
+ const version = '1.1.17'
9
9
  let userAgent = `Files.com JavaScript SDK v${version}`
10
10
 
11
11
  let logLevel = LogLevel.INFO
@@ -106,10 +106,10 @@ class ApiKey {
106
106
 
107
107
 
108
108
  // Parameters:
109
- // name - string - Internal name for the API Key. For your use.
110
109
  // description - string - User-supplied description of API key.
111
110
  // expires_at - string - API Key expiration date
112
111
  // permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
112
+ // name - string - Internal name for the API Key. For your use.
113
113
  update = async (params = {}) => {
114
114
  if (!this.attributes.id) {
115
115
  throw new errors.EmptyPropertyError('Current object has no id')
@@ -123,9 +123,6 @@ class ApiKey {
123
123
  if (params['id'] && !isInt(params['id'])) {
124
124
  throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
125
125
  }
126
- if (params['name'] && !isString(params['name'])) {
127
- throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params['name'])}`)
128
- }
129
126
  if (params['description'] && !isString(params['description'])) {
130
127
  throw new errors.InvalidParameterError(`Bad parameter: description must be of type String, received ${getType(params['description'])}`)
131
128
  }
@@ -135,6 +132,9 @@ class ApiKey {
135
132
  if (params['permission_set'] && !isString(params['permission_set'])) {
136
133
  throw new errors.InvalidParameterError(`Bad parameter: permission_set must be of type String, received ${getType(params['permission_set'])}`)
137
134
  }
135
+ if (params['name'] && !isString(params['name'])) {
136
+ throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params['name'])}`)
137
+ }
138
138
 
139
139
  if (!params['id']) {
140
140
  if (this.attributes.id) {
@@ -259,17 +259,17 @@ class ApiKey {
259
259
 
260
260
  // Parameters:
261
261
  // user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
262
- // name - string - Internal name for the API Key. For your use.
263
262
  // description - string - User-supplied description of API key.
264
263
  // expires_at - string - API Key expiration date
265
264
  // permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
265
+ // name (required) - string - Internal name for the API Key. For your use.
266
266
  static create = async (params = {}, options = {}) => {
267
- if (params['user_id'] && !isInt(params['user_id'])) {
268
- throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params['user_id'])}`)
267
+ if (!params['name']) {
268
+ throw new errors.MissingParameterError('Parameter missing: name')
269
269
  }
270
270
 
271
- if (params['name'] && !isString(params['name'])) {
272
- throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params['name'])}`)
271
+ if (params['user_id'] && !isInt(params['user_id'])) {
272
+ throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params['user_id'])}`)
273
273
  }
274
274
 
275
275
  if (params['description'] && !isString(params['description'])) {
@@ -284,6 +284,10 @@ class ApiKey {
284
284
  throw new errors.InvalidParameterError(`Bad parameter: permission_set must be of type String, received ${getType(params['permission_set'])}`)
285
285
  }
286
286
 
287
+ if (params['name'] && !isString(params['name'])) {
288
+ throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params['name'])}`)
289
+ }
290
+
287
291
  const response = await Api.sendRequest(`/api_keys`, 'POST', params, options)
288
292
 
289
293
 
@@ -370,7 +370,7 @@ class Automation {
370
370
  // Parameters:
371
371
  // 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.
372
372
  // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
373
- // sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction (e.g. `sort_by[automation]=desc`). Valid fields are `automation`, `disabled` or `last_modified_at`.
373
+ // sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction (e.g. `sort_by[automation]=desc`). Valid fields are `automation`, `disabled`, `last_modified_at` or `name`.
374
374
  // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `disabled`, `last_modified_at` or `automation`. Valid field combinations are `[ automation, disabled ]` and `[ disabled, automation ]`.
375
375
  // filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `last_modified_at`.
376
376
  // filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `last_modified_at`.