files.com 1.0.473 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/_VERSION +1 -1
- package/lib/Files.js +1 -1
- package/lib/models/ActionNotificationExport.js +63 -49
- package/lib/models/ActionWebhookFailure.js +1 -1
- package/lib/models/ApiKey.js +113 -94
- package/lib/models/As2Partner.js +81 -62
- package/lib/models/As2Station.js +79 -60
- package/lib/models/Automation.js +90 -71
- package/lib/models/Behavior.js +114 -95
- package/lib/models/Bundle.js +90 -71
- package/lib/models/BundleNotification.js +75 -56
- package/lib/models/BundleRecipient.js +61 -47
- package/lib/models/Clickwrap.js +77 -58
- package/lib/models/ExternalEvent.js +71 -57
- package/lib/models/File.js +166 -154
- package/lib/models/FileComment.js +65 -46
- package/lib/models/FileCommentReaction.js +44 -30
- package/lib/models/Folder.js +58 -46
- package/lib/models/FormFieldSet.js +76 -57
- package/lib/models/GpgKey.js +79 -60
- package/lib/models/Group.js +78 -59
- package/lib/models/GroupUser.js +63 -44
- package/lib/models/HistoryExport.js +76 -62
- package/lib/models/InboxRecipient.js +61 -47
- package/lib/models/Lock.js +56 -44
- package/lib/models/Message.js +82 -63
- package/lib/models/MessageComment.js +78 -59
- package/lib/models/MessageCommentReaction.js +73 -59
- package/lib/models/MessageReaction.js +73 -59
- package/lib/models/Notification.js +84 -65
- package/lib/models/Permission.js +60 -46
- package/lib/models/Project.js +74 -55
- package/lib/models/PublicKey.js +78 -59
- package/lib/models/RemoteServer.js +147 -128
- package/lib/models/Request.js +76 -62
- package/lib/models/Session.js +53 -39
- package/lib/models/SftpHostKey.js +74 -55
- package/lib/models/ShareGroup.js +79 -60
- package/lib/models/Snapshot.js +75 -56
- package/lib/models/SsoStrategy.js +1 -1
- package/lib/models/Style.js +37 -23
- package/lib/models/User.js +104 -85
- package/lib/models/UserRequest.js +73 -59
- package/lib/models/WebhookTest.js +46 -32
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/ActionNotificationExport.js +2 -2
- package/src/models/ActionWebhookFailure.js +1 -1
- package/src/models/ApiKey.js +7 -5
- package/src/models/As2Partner.js +6 -4
- package/src/models/As2Station.js +6 -4
- package/src/models/Automation.js +7 -5
- package/src/models/Behavior.js +7 -5
- package/src/models/Bundle.js +7 -5
- package/src/models/BundleNotification.js +6 -4
- package/src/models/BundleRecipient.js +2 -2
- package/src/models/Clickwrap.js +6 -4
- package/src/models/ExternalEvent.js +2 -2
- package/src/models/File.js +3 -3
- package/src/models/FileComment.js +6 -4
- package/src/models/FileCommentReaction.js +3 -3
- package/src/models/Folder.js +2 -2
- package/src/models/FormFieldSet.js +6 -4
- package/src/models/GpgKey.js +6 -4
- package/src/models/Group.js +6 -4
- package/src/models/GroupUser.js +6 -4
- package/src/models/HistoryExport.js +2 -2
- package/src/models/InboxRecipient.js +2 -2
- package/src/models/Lock.js +3 -3
- package/src/models/Message.js +6 -4
- package/src/models/MessageComment.js +6 -4
- package/src/models/MessageCommentReaction.js +3 -3
- package/src/models/MessageReaction.js +3 -3
- package/src/models/Notification.js +6 -4
- package/src/models/Permission.js +3 -3
- package/src/models/Project.js +6 -4
- package/src/models/PublicKey.js +6 -4
- package/src/models/RemoteServer.js +6 -4
- package/src/models/Request.js +3 -3
- package/src/models/Session.js +3 -3
- package/src/models/SftpHostKey.js +6 -4
- package/src/models/ShareGroup.js +6 -4
- package/src/models/Snapshot.js +6 -4
- package/src/models/SsoStrategy.js +1 -1
- package/src/models/Style.js +6 -3
- package/src/models/User.js +9 -7
- package/src/models/UserRequest.js +3 -3
- package/src/models/WebhookTest.js +2 -2
package/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0
|
1
|
+
1.1.0
|
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.0
|
14
|
+
var version = '1.1.0';
|
15
15
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
16
16
|
var logLevel = _Logger.LogLevel.INFO;
|
17
17
|
var debugRequest = false;
|
@@ -5,8 +5,8 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
5
|
exports.__esModule = true;
|
6
6
|
exports.default = void 0;
|
7
7
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
8
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
9
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
11
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
@@ -131,19 +131,33 @@ var ActionNotificationExport = /*#__PURE__*/(0, _createClass2.default)(function
|
|
131
131
|
(0, _defineProperty2.default)(this, "setUserId", function (value) {
|
132
132
|
_this.attributes.user_id = value;
|
133
133
|
});
|
134
|
-
(0, _defineProperty2.default)(this, "save", function () {
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
134
|
+
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
135
|
+
var newObject;
|
136
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
137
|
+
while (1) switch (_context.prev = _context.next) {
|
138
|
+
case 0:
|
139
|
+
if (!_this.attributes['id']) {
|
140
|
+
_context.next = 4;
|
141
|
+
break;
|
142
|
+
}
|
143
|
+
throw new errors.NotImplementedError('The ActionNotificationExport object doesn\'t support updates.');
|
144
|
+
case 4:
|
145
|
+
_context.next = 6;
|
146
|
+
return ActionNotificationExport.create(_this.attributes, _this.options);
|
147
|
+
case 6:
|
148
|
+
newObject = _context.sent;
|
149
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
150
|
+
return _context.abrupt("return", true);
|
151
|
+
case 9:
|
152
|
+
case "end":
|
153
|
+
return _context.stop();
|
154
|
+
}
|
155
|
+
}, _callee);
|
156
|
+
})));
|
157
|
+
Object.entries(attributes).forEach(function (_ref2) {
|
158
|
+
var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
|
159
|
+
key = _ref3[0],
|
160
|
+
value = _ref3[1];
|
147
161
|
var normalizedKey = key.replace('?', '');
|
148
162
|
_this.attributes[normalizedKey] = value;
|
149
163
|
Object.defineProperty(_this, normalizedKey, {
|
@@ -157,48 +171,48 @@ _class = ActionNotificationExport;
|
|
157
171
|
// Parameters:
|
158
172
|
// id (required) - int64 - Action Notification Export ID.
|
159
173
|
(0, _defineProperty2.default)(ActionNotificationExport, "find", /*#__PURE__*/function () {
|
160
|
-
var
|
174
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(id) {
|
161
175
|
var params,
|
162
176
|
options,
|
163
177
|
response,
|
164
|
-
|
165
|
-
return _regenerator.default.wrap(function
|
166
|
-
while (1) switch (
|
178
|
+
_args2 = arguments;
|
179
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
180
|
+
while (1) switch (_context2.prev = _context2.next) {
|
167
181
|
case 0:
|
168
|
-
params =
|
169
|
-
options =
|
182
|
+
params = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
|
183
|
+
options = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {};
|
170
184
|
if ((0, _utils.isObject)(params)) {
|
171
|
-
|
185
|
+
_context2.next = 4;
|
172
186
|
break;
|
173
187
|
}
|
174
188
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
175
189
|
case 4:
|
176
190
|
params['id'] = id;
|
177
191
|
if (params['id']) {
|
178
|
-
|
192
|
+
_context2.next = 7;
|
179
193
|
break;
|
180
194
|
}
|
181
195
|
throw new errors.MissingParameterError('Parameter missing: id');
|
182
196
|
case 7:
|
183
197
|
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
184
|
-
|
198
|
+
_context2.next = 9;
|
185
199
|
break;
|
186
200
|
}
|
187
201
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
|
188
202
|
case 9:
|
189
|
-
|
203
|
+
_context2.next = 11;
|
190
204
|
return _Api.default.sendRequest("/action_notification_exports/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
|
191
205
|
case 11:
|
192
|
-
response =
|
193
|
-
return
|
206
|
+
response = _context2.sent;
|
207
|
+
return _context2.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
194
208
|
case 13:
|
195
209
|
case "end":
|
196
|
-
return
|
210
|
+
return _context2.stop();
|
197
211
|
}
|
198
|
-
},
|
212
|
+
}, _callee2);
|
199
213
|
}));
|
200
214
|
return function (_x) {
|
201
|
-
return
|
215
|
+
return _ref4.apply(this, arguments);
|
202
216
|
};
|
203
217
|
}());
|
204
218
|
(0, _defineProperty2.default)(ActionNotificationExport, "get", function (id) {
|
@@ -217,80 +231,80 @@ _class = ActionNotificationExport;
|
|
217
231
|
// query_success - boolean - true if the webhook request succeeded (i.e. returned a 200 or 204 response status). false otherwise.
|
218
232
|
// query_path - string - Return notifications that were triggered by actions on this specific path.
|
219
233
|
// query_folder - string - Return notifications that were triggered by actions in this folder.
|
220
|
-
(0, _defineProperty2.default)(ActionNotificationExport, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
234
|
+
(0, _defineProperty2.default)(ActionNotificationExport, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
221
235
|
var params,
|
222
236
|
options,
|
223
237
|
response,
|
224
|
-
|
225
|
-
return _regenerator.default.wrap(function
|
226
|
-
while (1) switch (
|
238
|
+
_args3 = arguments;
|
239
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
240
|
+
while (1) switch (_context3.prev = _context3.next) {
|
227
241
|
case 0:
|
228
|
-
params =
|
229
|
-
options =
|
242
|
+
params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
243
|
+
options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
|
230
244
|
if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
|
231
|
-
|
245
|
+
_context3.next = 4;
|
232
246
|
break;
|
233
247
|
}
|
234
248
|
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
|
235
249
|
case 4:
|
236
250
|
if (!(params['start_at'] && !(0, _utils.isString)(params['start_at']))) {
|
237
|
-
|
251
|
+
_context3.next = 6;
|
238
252
|
break;
|
239
253
|
}
|
240
254
|
throw new errors.InvalidParameterError("Bad parameter: start_at must be of type String, received ".concat((0, _utils.getType)(params['start_at'])));
|
241
255
|
case 6:
|
242
256
|
if (!(params['end_at'] && !(0, _utils.isString)(params['end_at']))) {
|
243
|
-
|
257
|
+
_context3.next = 8;
|
244
258
|
break;
|
245
259
|
}
|
246
260
|
throw new errors.InvalidParameterError("Bad parameter: end_at must be of type String, received ".concat((0, _utils.getType)(params['end_at'])));
|
247
261
|
case 8:
|
248
262
|
if (!(params['query_message'] && !(0, _utils.isString)(params['query_message']))) {
|
249
|
-
|
263
|
+
_context3.next = 10;
|
250
264
|
break;
|
251
265
|
}
|
252
266
|
throw new errors.InvalidParameterError("Bad parameter: query_message must be of type String, received ".concat((0, _utils.getType)(params['query_message'])));
|
253
267
|
case 10:
|
254
268
|
if (!(params['query_request_method'] && !(0, _utils.isString)(params['query_request_method']))) {
|
255
|
-
|
269
|
+
_context3.next = 12;
|
256
270
|
break;
|
257
271
|
}
|
258
272
|
throw new errors.InvalidParameterError("Bad parameter: query_request_method must be of type String, received ".concat((0, _utils.getType)(params['query_request_method'])));
|
259
273
|
case 12:
|
260
274
|
if (!(params['query_request_url'] && !(0, _utils.isString)(params['query_request_url']))) {
|
261
|
-
|
275
|
+
_context3.next = 14;
|
262
276
|
break;
|
263
277
|
}
|
264
278
|
throw new errors.InvalidParameterError("Bad parameter: query_request_url must be of type String, received ".concat((0, _utils.getType)(params['query_request_url'])));
|
265
279
|
case 14:
|
266
280
|
if (!(params['query_status'] && !(0, _utils.isString)(params['query_status']))) {
|
267
|
-
|
281
|
+
_context3.next = 16;
|
268
282
|
break;
|
269
283
|
}
|
270
284
|
throw new errors.InvalidParameterError("Bad parameter: query_status must be of type String, received ".concat((0, _utils.getType)(params['query_status'])));
|
271
285
|
case 16:
|
272
286
|
if (!(params['query_path'] && !(0, _utils.isString)(params['query_path']))) {
|
273
|
-
|
287
|
+
_context3.next = 18;
|
274
288
|
break;
|
275
289
|
}
|
276
290
|
throw new errors.InvalidParameterError("Bad parameter: query_path must be of type String, received ".concat((0, _utils.getType)(params['query_path'])));
|
277
291
|
case 18:
|
278
292
|
if (!(params['query_folder'] && !(0, _utils.isString)(params['query_folder']))) {
|
279
|
-
|
293
|
+
_context3.next = 20;
|
280
294
|
break;
|
281
295
|
}
|
282
296
|
throw new errors.InvalidParameterError("Bad parameter: query_folder must be of type String, received ".concat((0, _utils.getType)(params['query_folder'])));
|
283
297
|
case 20:
|
284
|
-
|
298
|
+
_context3.next = 22;
|
285
299
|
return _Api.default.sendRequest("/action_notification_exports", 'POST', params, options);
|
286
300
|
case 22:
|
287
|
-
response =
|
288
|
-
return
|
301
|
+
response = _context3.sent;
|
302
|
+
return _context3.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
289
303
|
case 24:
|
290
304
|
case "end":
|
291
|
-
return
|
305
|
+
return _context3.stop();
|
292
306
|
}
|
293
|
-
},
|
307
|
+
}, _callee3);
|
294
308
|
})));
|
295
309
|
var _default = exports.default = ActionNotificationExport;
|
296
310
|
module.exports = ActionNotificationExport;
|
@@ -77,7 +77,7 @@ var ActionWebhookFailure = /*#__PURE__*/(0, _createClass2.default)(function Acti
|
|
77
77
|
return _Api.default.sendRequest("/action_webhook_failures/".concat(encodeURIComponent(params['id']), "/retry"), 'POST', params, _this.options);
|
78
78
|
case 16:
|
79
79
|
response = _context.sent;
|
80
|
-
return _context.abrupt("return"
|
80
|
+
return _context.abrupt("return");
|
81
81
|
case 18:
|
82
82
|
case "end":
|
83
83
|
return _context.stop();
|
package/lib/models/ApiKey.js
CHANGED
@@ -247,7 +247,7 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() {
|
|
247
247
|
return _Api.default.sendRequest("/api_keys/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
|
248
248
|
case 16:
|
249
249
|
response = _context2.sent;
|
250
|
-
return _context2.abrupt("return"
|
250
|
+
return _context2.abrupt("return");
|
251
251
|
case 18:
|
252
252
|
case "end":
|
253
253
|
return _context2.stop();
|
@@ -258,19 +258,38 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() {
|
|
258
258
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
259
259
|
return _this.delete(params);
|
260
260
|
});
|
261
|
-
(0, _defineProperty2.default)(this, "save", function () {
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
261
|
+
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
262
|
+
var newObject, _newObject;
|
263
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
264
|
+
while (1) switch (_context3.prev = _context3.next) {
|
265
|
+
case 0:
|
266
|
+
if (!_this.attributes['id']) {
|
267
|
+
_context3.next = 8;
|
268
|
+
break;
|
269
|
+
}
|
270
|
+
_context3.next = 3;
|
271
|
+
return _this.update(_this.attributes);
|
272
|
+
case 3:
|
273
|
+
newObject = _context3.sent;
|
274
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
275
|
+
return _context3.abrupt("return", true);
|
276
|
+
case 8:
|
277
|
+
_context3.next = 10;
|
278
|
+
return ApiKey.create(_this.attributes, _this.options);
|
279
|
+
case 10:
|
280
|
+
_newObject = _context3.sent;
|
281
|
+
_this.attributes = _objectSpread({}, _newObject.attributes);
|
282
|
+
return _context3.abrupt("return", true);
|
283
|
+
case 13:
|
284
|
+
case "end":
|
285
|
+
return _context3.stop();
|
286
|
+
}
|
287
|
+
}, _callee3);
|
288
|
+
})));
|
289
|
+
Object.entries(attributes).forEach(function (_ref4) {
|
290
|
+
var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
|
291
|
+
key = _ref5[0],
|
292
|
+
value = _ref5[1];
|
274
293
|
var normalizedKey = key.replace('?', '');
|
275
294
|
_this.attributes[normalizedKey] = value;
|
276
295
|
Object.defineProperty(_this, normalizedKey, {
|
@@ -291,117 +310,117 @@ _class = ApiKey;
|
|
291
310
|
// filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `expires_at`.
|
292
311
|
// filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `expires_at`.
|
293
312
|
// filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `expires_at`.
|
294
|
-
(0, _defineProperty2.default)(ApiKey, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
313
|
+
(0, _defineProperty2.default)(ApiKey, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
295
314
|
var _response$data;
|
296
315
|
var params,
|
297
316
|
options,
|
298
317
|
response,
|
299
|
-
|
300
|
-
return _regenerator.default.wrap(function
|
301
|
-
while (1) switch (
|
318
|
+
_args4 = arguments;
|
319
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
320
|
+
while (1) switch (_context4.prev = _context4.next) {
|
302
321
|
case 0:
|
303
|
-
params =
|
304
|
-
options =
|
322
|
+
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
323
|
+
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
305
324
|
if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
|
306
|
-
|
325
|
+
_context4.next = 4;
|
307
326
|
break;
|
308
327
|
}
|
309
328
|
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
|
310
329
|
case 4:
|
311
330
|
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
312
|
-
|
331
|
+
_context4.next = 6;
|
313
332
|
break;
|
314
333
|
}
|
315
334
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
316
335
|
case 6:
|
317
336
|
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
318
|
-
|
337
|
+
_context4.next = 8;
|
319
338
|
break;
|
320
339
|
}
|
321
340
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
322
341
|
case 8:
|
323
|
-
|
342
|
+
_context4.next = 10;
|
324
343
|
return _Api.default.sendRequest("/api_keys", 'GET', params, options);
|
325
344
|
case 10:
|
326
|
-
response =
|
327
|
-
return
|
345
|
+
response = _context4.sent;
|
346
|
+
return _context4.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
328
347
|
return new _class(obj, options);
|
329
348
|
})) || []);
|
330
349
|
case 12:
|
331
350
|
case "end":
|
332
|
-
return
|
351
|
+
return _context4.stop();
|
333
352
|
}
|
334
|
-
},
|
353
|
+
}, _callee4);
|
335
354
|
})));
|
336
355
|
(0, _defineProperty2.default)(ApiKey, "all", function () {
|
337
356
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
338
357
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
339
358
|
return _class.list(params, options);
|
340
359
|
});
|
341
|
-
(0, _defineProperty2.default)(ApiKey, "findCurrent", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
360
|
+
(0, _defineProperty2.default)(ApiKey, "findCurrent", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
342
361
|
var options,
|
343
362
|
response,
|
344
|
-
|
345
|
-
return _regenerator.default.wrap(function
|
346
|
-
while (1) switch (
|
363
|
+
_args5 = arguments;
|
364
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
365
|
+
while (1) switch (_context5.prev = _context5.next) {
|
347
366
|
case 0:
|
348
|
-
options =
|
349
|
-
|
367
|
+
options = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
368
|
+
_context5.next = 3;
|
350
369
|
return _Api.default.sendRequest("/api_key", 'GET', {}, options);
|
351
370
|
case 3:
|
352
|
-
response =
|
353
|
-
return
|
371
|
+
response = _context5.sent;
|
372
|
+
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
354
373
|
case 5:
|
355
374
|
case "end":
|
356
|
-
return
|
375
|
+
return _context5.stop();
|
357
376
|
}
|
358
|
-
},
|
377
|
+
}, _callee5);
|
359
378
|
})));
|
360
379
|
// Parameters:
|
361
380
|
// id (required) - int64 - Api Key ID.
|
362
381
|
(0, _defineProperty2.default)(ApiKey, "find", /*#__PURE__*/function () {
|
363
|
-
var
|
382
|
+
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(id) {
|
364
383
|
var params,
|
365
384
|
options,
|
366
385
|
response,
|
367
|
-
|
368
|
-
return _regenerator.default.wrap(function
|
369
|
-
while (1) switch (
|
386
|
+
_args6 = arguments;
|
387
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
388
|
+
while (1) switch (_context6.prev = _context6.next) {
|
370
389
|
case 0:
|
371
|
-
params =
|
372
|
-
options =
|
390
|
+
params = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
391
|
+
options = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : {};
|
373
392
|
if ((0, _utils.isObject)(params)) {
|
374
|
-
|
393
|
+
_context6.next = 4;
|
375
394
|
break;
|
376
395
|
}
|
377
396
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
378
397
|
case 4:
|
379
398
|
params['id'] = id;
|
380
399
|
if (params['id']) {
|
381
|
-
|
400
|
+
_context6.next = 7;
|
382
401
|
break;
|
383
402
|
}
|
384
403
|
throw new errors.MissingParameterError('Parameter missing: id');
|
385
404
|
case 7:
|
386
405
|
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
387
|
-
|
406
|
+
_context6.next = 9;
|
388
407
|
break;
|
389
408
|
}
|
390
409
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
|
391
410
|
case 9:
|
392
|
-
|
411
|
+
_context6.next = 11;
|
393
412
|
return _Api.default.sendRequest("/api_keys/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
|
394
413
|
case 11:
|
395
|
-
response =
|
396
|
-
return
|
414
|
+
response = _context6.sent;
|
415
|
+
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
397
416
|
case 13:
|
398
417
|
case "end":
|
399
|
-
return
|
418
|
+
return _context6.stop();
|
400
419
|
}
|
401
|
-
},
|
420
|
+
}, _callee6);
|
402
421
|
}));
|
403
422
|
return function (_x) {
|
404
|
-
return
|
423
|
+
return _ref8.apply(this, arguments);
|
405
424
|
};
|
406
425
|
}());
|
407
426
|
(0, _defineProperty2.default)(ApiKey, "get", function (id) {
|
@@ -416,124 +435,124 @@ _class = ApiKey;
|
|
416
435
|
// expires_at - string - API Key expiration date
|
417
436
|
// 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.
|
418
437
|
// path - string - Folder path restriction for this api key.
|
419
|
-
(0, _defineProperty2.default)(ApiKey, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
438
|
+
(0, _defineProperty2.default)(ApiKey, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
420
439
|
var params,
|
421
440
|
options,
|
422
441
|
response,
|
423
|
-
|
424
|
-
return _regenerator.default.wrap(function
|
425
|
-
while (1) switch (
|
442
|
+
_args7 = arguments;
|
443
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
444
|
+
while (1) switch (_context7.prev = _context7.next) {
|
426
445
|
case 0:
|
427
|
-
params =
|
428
|
-
options =
|
446
|
+
params = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
|
447
|
+
options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
|
429
448
|
if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
|
430
|
-
|
449
|
+
_context7.next = 4;
|
431
450
|
break;
|
432
451
|
}
|
433
452
|
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
|
434
453
|
case 4:
|
435
454
|
if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
|
436
|
-
|
455
|
+
_context7.next = 6;
|
437
456
|
break;
|
438
457
|
}
|
439
458
|
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
|
440
459
|
case 6:
|
441
460
|
if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
|
442
|
-
|
461
|
+
_context7.next = 8;
|
443
462
|
break;
|
444
463
|
}
|
445
464
|
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params['description'])));
|
446
465
|
case 8:
|
447
466
|
if (!(params['expires_at'] && !(0, _utils.isString)(params['expires_at']))) {
|
448
|
-
|
467
|
+
_context7.next = 10;
|
449
468
|
break;
|
450
469
|
}
|
451
470
|
throw new errors.InvalidParameterError("Bad parameter: expires_at must be of type String, received ".concat((0, _utils.getType)(params['expires_at'])));
|
452
471
|
case 10:
|
453
472
|
if (!(params['permission_set'] && !(0, _utils.isString)(params['permission_set']))) {
|
454
|
-
|
473
|
+
_context7.next = 12;
|
455
474
|
break;
|
456
475
|
}
|
457
476
|
throw new errors.InvalidParameterError("Bad parameter: permission_set must be of type String, received ".concat((0, _utils.getType)(params['permission_set'])));
|
458
477
|
case 12:
|
459
478
|
if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
|
460
|
-
|
479
|
+
_context7.next = 14;
|
461
480
|
break;
|
462
481
|
}
|
463
482
|
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
|
464
483
|
case 14:
|
465
|
-
|
484
|
+
_context7.next = 16;
|
466
485
|
return _Api.default.sendRequest("/api_keys", 'POST', params, options);
|
467
486
|
case 16:
|
468
|
-
response =
|
469
|
-
return
|
487
|
+
response = _context7.sent;
|
488
|
+
return _context7.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
470
489
|
case 18:
|
471
490
|
case "end":
|
472
|
-
return
|
491
|
+
return _context7.stop();
|
473
492
|
}
|
474
|
-
},
|
493
|
+
}, _callee7);
|
475
494
|
})));
|
476
495
|
// Parameters:
|
477
496
|
// expires_at - string - API Key expiration date
|
478
497
|
// name - string - Internal name for the API Key. For your use.
|
479
498
|
// 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.
|
480
|
-
(0, _defineProperty2.default)(ApiKey, "updateCurrent", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
499
|
+
(0, _defineProperty2.default)(ApiKey, "updateCurrent", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
481
500
|
var params,
|
482
501
|
options,
|
483
502
|
response,
|
484
|
-
|
485
|
-
return _regenerator.default.wrap(function
|
486
|
-
while (1) switch (
|
503
|
+
_args8 = arguments;
|
504
|
+
return _regenerator.default.wrap(function _callee8$(_context8) {
|
505
|
+
while (1) switch (_context8.prev = _context8.next) {
|
487
506
|
case 0:
|
488
|
-
params =
|
489
|
-
options =
|
507
|
+
params = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
|
508
|
+
options = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : {};
|
490
509
|
if (!(params['expires_at'] && !(0, _utils.isString)(params['expires_at']))) {
|
491
|
-
|
510
|
+
_context8.next = 4;
|
492
511
|
break;
|
493
512
|
}
|
494
513
|
throw new errors.InvalidParameterError("Bad parameter: expires_at must be of type String, received ".concat((0, _utils.getType)(params['expires_at'])));
|
495
514
|
case 4:
|
496
515
|
if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
|
497
|
-
|
516
|
+
_context8.next = 6;
|
498
517
|
break;
|
499
518
|
}
|
500
519
|
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
|
501
520
|
case 6:
|
502
521
|
if (!(params['permission_set'] && !(0, _utils.isString)(params['permission_set']))) {
|
503
|
-
|
522
|
+
_context8.next = 8;
|
504
523
|
break;
|
505
524
|
}
|
506
525
|
throw new errors.InvalidParameterError("Bad parameter: permission_set must be of type String, received ".concat((0, _utils.getType)(params['permission_set'])));
|
507
526
|
case 8:
|
508
|
-
|
527
|
+
_context8.next = 10;
|
509
528
|
return _Api.default.sendRequest("/api_key", 'PATCH', params, options);
|
510
529
|
case 10:
|
511
|
-
response =
|
512
|
-
return
|
530
|
+
response = _context8.sent;
|
531
|
+
return _context8.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
513
532
|
case 12:
|
514
533
|
case "end":
|
515
|
-
return
|
534
|
+
return _context8.stop();
|
516
535
|
}
|
517
|
-
},
|
536
|
+
}, _callee8);
|
518
537
|
})));
|
519
|
-
(0, _defineProperty2.default)(ApiKey, "deleteCurrent", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
538
|
+
(0, _defineProperty2.default)(ApiKey, "deleteCurrent", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
520
539
|
var options,
|
521
540
|
response,
|
522
|
-
|
523
|
-
return _regenerator.default.wrap(function
|
524
|
-
while (1) switch (
|
541
|
+
_args9 = arguments;
|
542
|
+
return _regenerator.default.wrap(function _callee9$(_context9) {
|
543
|
+
while (1) switch (_context9.prev = _context9.next) {
|
525
544
|
case 0:
|
526
|
-
options =
|
527
|
-
|
545
|
+
options = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
|
546
|
+
_context9.next = 3;
|
528
547
|
return _Api.default.sendRequest("/api_key", 'DELETE', {}, options);
|
529
548
|
case 3:
|
530
|
-
response =
|
531
|
-
return
|
549
|
+
response = _context9.sent;
|
550
|
+
return _context9.abrupt("return");
|
532
551
|
case 5:
|
533
552
|
case "end":
|
534
|
-
return
|
553
|
+
return _context9.stop();
|
535
554
|
}
|
536
|
-
},
|
555
|
+
}, _callee9);
|
537
556
|
})));
|
538
557
|
var _default = exports.default = ApiKey;
|
539
558
|
module.exports = ApiKey;
|