files.com 1.0.216 → 1.0.217

Sign up to get free protection for your applications and to get access to all the features.
package/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.216
1
+ 1.0.217
@@ -6,6 +6,7 @@
6
6
  {
7
7
  "id": 1,
8
8
  "descriptive_label": "Site-wide API key for https://site.files.com/ (key ID #1)",
9
+ "description": "",
9
10
  "created_at": "2000-01-01T01:00:00Z",
10
11
  "expires_at": "2000-01-01T01:00:00Z",
11
12
  "key": "[key]",
@@ -20,6 +21,7 @@
20
21
 
21
22
  * `id` (int64): API Key ID
22
23
  * `descriptive_label` (string): Unique label that describes this API key. Useful for external systems where you may have API keys from multiple accounts and want a human-readable label for each key.
24
+ * `description` (string): User-supplied description of API key.
23
25
  * `created_at` (date-time): Time which API Key was created
24
26
  * `expires_at` (date-time): API Key expiration date
25
27
  * `key` (string): API Key actual key string
@@ -96,6 +98,7 @@ await ApiKey.create({
96
98
 
97
99
  * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
98
100
  * `name` (string): Internal name for the API Key. For your use.
101
+ * `description` (string): User-supplied description of API key.
99
102
  * `expires_at` (string): API Key expiration date
100
103
  * `permission_set` (string): Permissions for this API Key. 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.
101
104
  * `path` (string): Folder path restriction for this api key.
@@ -146,6 +149,7 @@ await api_key.update({
146
149
 
147
150
  * `id` (int64): Required - Api Key ID.
148
151
  * `name` (string): Internal name for the API Key. For your use.
152
+ * `description` (string): User-supplied description of API key.
149
153
  * `expires_at` (string): API Key expiration date
150
154
  * `permission_set` (string): Permissions for this API Key. 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.
151
155
 
@@ -155,6 +159,7 @@ await api_key.update({
155
159
  {
156
160
  "id": 1,
157
161
  "descriptive_label": "Site-wide API key for https://site.files.com/ (key ID #1)",
162
+ "description": "",
158
163
  "created_at": "2000-01-01T01:00:00Z",
159
164
  "expires_at": "2000-01-01T01:00:00Z",
160
165
  "key": "[key]",
@@ -61,6 +61,12 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() {
61
61
  (0, _defineProperty2.default)(this, "setDescriptiveLabel", function (value) {
62
62
  _this.attributes.descriptive_label = value;
63
63
  });
64
+ (0, _defineProperty2.default)(this, "getDescription", function () {
65
+ return _this.attributes.description;
66
+ });
67
+ (0, _defineProperty2.default)(this, "setDescription", function (value) {
68
+ _this.attributes.description = value;
69
+ });
64
70
  (0, _defineProperty2.default)(this, "getCreatedAt", function () {
65
71
  return _this.attributes.created_at;
66
72
  });
@@ -156,48 +162,56 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() {
156
162
  throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(name)));
157
163
 
158
164
  case 10:
159
- if (!(params['expires_at'] && !(0, _utils.isString)(params['expires_at']))) {
165
+ if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
160
166
  _context.next = 12;
161
167
  break;
162
168
  }
163
169
 
164
- throw new errors.InvalidParameterError("Bad parameter: expires_at must be of type String, received ".concat((0, _utils.getType)(expires_at)));
170
+ throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(description)));
165
171
 
166
172
  case 12:
167
- if (!(params['permission_set'] && !(0, _utils.isString)(params['permission_set']))) {
173
+ if (!(params['expires_at'] && !(0, _utils.isString)(params['expires_at']))) {
168
174
  _context.next = 14;
169
175
  break;
170
176
  }
171
177
 
172
- throw new errors.InvalidParameterError("Bad parameter: permission_set must be of type String, received ".concat((0, _utils.getType)(permission_set)));
178
+ throw new errors.InvalidParameterError("Bad parameter: expires_at must be of type String, received ".concat((0, _utils.getType)(expires_at)));
173
179
 
174
180
  case 14:
181
+ if (!(params['permission_set'] && !(0, _utils.isString)(params['permission_set']))) {
182
+ _context.next = 16;
183
+ break;
184
+ }
185
+
186
+ throw new errors.InvalidParameterError("Bad parameter: permission_set must be of type String, received ".concat((0, _utils.getType)(permission_set)));
187
+
188
+ case 16:
175
189
  if (params['id']) {
176
- _context.next = 20;
190
+ _context.next = 22;
177
191
  break;
178
192
  }
179
193
 
180
194
  if (!_this.attributes.id) {
181
- _context.next = 19;
195
+ _context.next = 21;
182
196
  break;
183
197
  }
184
198
 
185
199
  params['id'] = _this.id;
186
- _context.next = 20;
200
+ _context.next = 22;
187
201
  break;
188
202
 
189
- case 19:
203
+ case 21:
190
204
  throw new errors.MissingParameterError('Parameter missing: id');
191
205
 
192
- case 20:
193
- _context.next = 22;
206
+ case 22:
207
+ _context.next = 24;
194
208
  return _Api.default.sendRequest("/api_keys/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
195
209
 
196
- case 22:
210
+ case 24:
197
211
  response = _context.sent;
198
212
  return _context.abrupt("return", new ApiKey(response === null || response === void 0 ? void 0 : response.data, _this.options));
199
213
 
200
- case 24:
214
+ case 26:
201
215
  case "end":
202
216
  return _context.stop();
203
217
  }
@@ -472,38 +486,46 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() {
472
486
  throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
473
487
 
474
488
  case 6:
475
- if (!(params['expires_at'] && !(0, _utils.isString)(params['expires_at']))) {
489
+ if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
476
490
  _context6.next = 8;
477
491
  break;
478
492
  }
479
493
 
480
- throw new errors.InvalidParameterError("Bad parameter: expires_at must be of type String, received ".concat((0, _utils.getType)(params['expires_at'])));
494
+ throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params['description'])));
481
495
 
482
496
  case 8:
483
- if (!(params['permission_set'] && !(0, _utils.isString)(params['permission_set']))) {
497
+ if (!(params['expires_at'] && !(0, _utils.isString)(params['expires_at']))) {
484
498
  _context6.next = 10;
485
499
  break;
486
500
  }
487
501
 
488
- throw new errors.InvalidParameterError("Bad parameter: permission_set must be of type String, received ".concat((0, _utils.getType)(params['permission_set'])));
502
+ throw new errors.InvalidParameterError("Bad parameter: expires_at must be of type String, received ".concat((0, _utils.getType)(params['expires_at'])));
489
503
 
490
504
  case 10:
491
- if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
505
+ if (!(params['permission_set'] && !(0, _utils.isString)(params['permission_set']))) {
492
506
  _context6.next = 12;
493
507
  break;
494
508
  }
495
509
 
496
- throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
510
+ throw new errors.InvalidParameterError("Bad parameter: permission_set must be of type String, received ".concat((0, _utils.getType)(params['permission_set'])));
497
511
 
498
512
  case 12:
499
- _context6.next = 14;
500
- return _Api.default.sendRequest("/api_keys", 'POST', params, options);
513
+ if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
514
+ _context6.next = 14;
515
+ break;
516
+ }
517
+
518
+ throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
501
519
 
502
520
  case 14:
521
+ _context6.next = 16;
522
+ return _Api.default.sendRequest("/api_keys", 'POST', params, options);
523
+
524
+ case 16:
503
525
  response = _context6.sent;
504
526
  return _context6.abrupt("return", new ApiKey(response === null || response === void 0 ? void 0 : response.data, options));
505
527
 
506
- case 16:
528
+ case 18:
507
529
  case "end":
508
530
  return _context6.stop();
509
531
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.0.216",
3
+ "version": "1.0.217",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
@@ -37,6 +37,13 @@ class ApiKey {
37
37
  this.attributes.descriptive_label = value
38
38
  }
39
39
 
40
+ // string # User-supplied description of API key.
41
+ getDescription = () => this.attributes.description
42
+
43
+ setDescription = value => {
44
+ this.attributes.description = value
45
+ }
46
+
40
47
  // date-time # Time which API Key was created
41
48
  getCreatedAt = () => this.attributes.created_at
42
49
 
@@ -99,6 +106,7 @@ class ApiKey {
99
106
 
100
107
  // Parameters:
101
108
  // name - string - Internal name for the API Key. For your use.
109
+ // description - string - User-supplied description of API key.
102
110
  // expires_at - string - API Key expiration date
103
111
  // permission_set - string - Permissions for this API Key. 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.
104
112
  update = async (params = {}) => {
@@ -117,6 +125,9 @@ class ApiKey {
117
125
  if (params['name'] && !isString(params['name'])) {
118
126
  throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(name)}`)
119
127
  }
128
+ if (params['description'] && !isString(params['description'])) {
129
+ throw new errors.InvalidParameterError(`Bad parameter: description must be of type String, received ${getType(description)}`)
130
+ }
120
131
  if (params['expires_at'] && !isString(params['expires_at'])) {
121
132
  throw new errors.InvalidParameterError(`Bad parameter: expires_at must be of type String, received ${getType(expires_at)}`)
122
133
  }
@@ -243,6 +254,7 @@ class ApiKey {
243
254
  // Parameters:
244
255
  // user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
245
256
  // name - string - Internal name for the API Key. For your use.
257
+ // description - string - User-supplied description of API key.
246
258
  // expires_at - string - API Key expiration date
247
259
  // permission_set - string - Permissions for this API Key. 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.
248
260
  // path - string - Folder path restriction for this api key.
@@ -255,6 +267,10 @@ class ApiKey {
255
267
  throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params['name'])}`)
256
268
  }
257
269
 
270
+ if (params['description'] && !isString(params['description'])) {
271
+ throw new errors.InvalidParameterError(`Bad parameter: description must be of type String, received ${getType(params['description'])}`)
272
+ }
273
+
258
274
  if (params['expires_at'] && !isString(params['expires_at'])) {
259
275
  throw new errors.InvalidParameterError(`Bad parameter: expires_at must be of type String, received ${getType(params['expires_at'])}`)
260
276
  }