files.com 1.0.474 → 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
@@ -106,7 +106,7 @@ var UserRequest = /*#__PURE__*/(0, _createClass2.default)(function UserRequest()
|
|
106
106
|
return _Api.default.sendRequest("/user_requests/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
|
107
107
|
case 16:
|
108
108
|
response = _context.sent;
|
109
|
-
return _context.abrupt("return"
|
109
|
+
return _context.abrupt("return");
|
110
110
|
case 18:
|
111
111
|
case "end":
|
112
112
|
return _context.stop();
|
@@ -117,19 +117,33 @@ var UserRequest = /*#__PURE__*/(0, _createClass2.default)(function UserRequest()
|
|
117
117
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
118
118
|
return _this.delete(params);
|
119
119
|
});
|
120
|
-
(0, _defineProperty2.default)(this, "save", function () {
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
120
|
+
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
121
|
+
var newObject;
|
122
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
123
|
+
while (1) switch (_context2.prev = _context2.next) {
|
124
|
+
case 0:
|
125
|
+
if (!_this.attributes['id']) {
|
126
|
+
_context2.next = 4;
|
127
|
+
break;
|
128
|
+
}
|
129
|
+
throw new errors.NotImplementedError('The UserRequest object doesn\'t support updates.');
|
130
|
+
case 4:
|
131
|
+
_context2.next = 6;
|
132
|
+
return UserRequest.create(_this.attributes, _this.options);
|
133
|
+
case 6:
|
134
|
+
newObject = _context2.sent;
|
135
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
136
|
+
return _context2.abrupt("return", true);
|
137
|
+
case 9:
|
138
|
+
case "end":
|
139
|
+
return _context2.stop();
|
140
|
+
}
|
141
|
+
}, _callee2);
|
142
|
+
})));
|
143
|
+
Object.entries(attributes).forEach(function (_ref3) {
|
144
|
+
var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
|
145
|
+
key = _ref4[0],
|
146
|
+
value = _ref4[1];
|
133
147
|
var normalizedKey = key.replace('?', '');
|
134
148
|
_this.attributes[normalizedKey] = value;
|
135
149
|
Object.defineProperty(_this, normalizedKey, {
|
@@ -143,41 +157,41 @@ _class = UserRequest;
|
|
143
157
|
// Parameters:
|
144
158
|
// 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.
|
145
159
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
146
|
-
(0, _defineProperty2.default)(UserRequest, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
160
|
+
(0, _defineProperty2.default)(UserRequest, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
147
161
|
var _response$data;
|
148
162
|
var params,
|
149
163
|
options,
|
150
164
|
response,
|
151
|
-
|
152
|
-
return _regenerator.default.wrap(function
|
153
|
-
while (1) switch (
|
165
|
+
_args3 = arguments;
|
166
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
167
|
+
while (1) switch (_context3.prev = _context3.next) {
|
154
168
|
case 0:
|
155
|
-
params =
|
156
|
-
options =
|
169
|
+
params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
170
|
+
options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
|
157
171
|
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
158
|
-
|
172
|
+
_context3.next = 4;
|
159
173
|
break;
|
160
174
|
}
|
161
175
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
162
176
|
case 4:
|
163
177
|
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
164
|
-
|
178
|
+
_context3.next = 6;
|
165
179
|
break;
|
166
180
|
}
|
167
181
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
168
182
|
case 6:
|
169
|
-
|
183
|
+
_context3.next = 8;
|
170
184
|
return _Api.default.sendRequest("/user_requests", 'GET', params, options);
|
171
185
|
case 8:
|
172
|
-
response =
|
173
|
-
return
|
186
|
+
response = _context3.sent;
|
187
|
+
return _context3.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
174
188
|
return new _class(obj, options);
|
175
189
|
})) || []);
|
176
190
|
case 10:
|
177
191
|
case "end":
|
178
|
-
return
|
192
|
+
return _context3.stop();
|
179
193
|
}
|
180
|
-
},
|
194
|
+
}, _callee3);
|
181
195
|
})));
|
182
196
|
(0, _defineProperty2.default)(UserRequest, "all", function () {
|
183
197
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
@@ -187,48 +201,48 @@ _class = UserRequest;
|
|
187
201
|
// Parameters:
|
188
202
|
// id (required) - int64 - User Request ID.
|
189
203
|
(0, _defineProperty2.default)(UserRequest, "find", /*#__PURE__*/function () {
|
190
|
-
var
|
204
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(id) {
|
191
205
|
var params,
|
192
206
|
options,
|
193
207
|
response,
|
194
|
-
|
195
|
-
return _regenerator.default.wrap(function
|
196
|
-
while (1) switch (
|
208
|
+
_args4 = arguments;
|
209
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
210
|
+
while (1) switch (_context4.prev = _context4.next) {
|
197
211
|
case 0:
|
198
|
-
params =
|
199
|
-
options =
|
212
|
+
params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
213
|
+
options = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
|
200
214
|
if ((0, _utils.isObject)(params)) {
|
201
|
-
|
215
|
+
_context4.next = 4;
|
202
216
|
break;
|
203
217
|
}
|
204
218
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
205
219
|
case 4:
|
206
220
|
params['id'] = id;
|
207
221
|
if (params['id']) {
|
208
|
-
|
222
|
+
_context4.next = 7;
|
209
223
|
break;
|
210
224
|
}
|
211
225
|
throw new errors.MissingParameterError('Parameter missing: id');
|
212
226
|
case 7:
|
213
227
|
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
214
|
-
|
228
|
+
_context4.next = 9;
|
215
229
|
break;
|
216
230
|
}
|
217
231
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
|
218
232
|
case 9:
|
219
|
-
|
233
|
+
_context4.next = 11;
|
220
234
|
return _Api.default.sendRequest("/user_requests/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
|
221
235
|
case 11:
|
222
|
-
response =
|
223
|
-
return
|
236
|
+
response = _context4.sent;
|
237
|
+
return _context4.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
224
238
|
case 13:
|
225
239
|
case "end":
|
226
|
-
return
|
240
|
+
return _context4.stop();
|
227
241
|
}
|
228
|
-
},
|
242
|
+
}, _callee4);
|
229
243
|
}));
|
230
244
|
return function (_x) {
|
231
|
-
return
|
245
|
+
return _ref6.apply(this, arguments);
|
232
246
|
};
|
233
247
|
}());
|
234
248
|
(0, _defineProperty2.default)(UserRequest, "get", function (id) {
|
@@ -240,62 +254,62 @@ _class = UserRequest;
|
|
240
254
|
// name (required) - string - Name of user requested
|
241
255
|
// email (required) - string - Email of user requested
|
242
256
|
// details (required) - string - Details of the user request
|
243
|
-
(0, _defineProperty2.default)(UserRequest, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
257
|
+
(0, _defineProperty2.default)(UserRequest, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
244
258
|
var params,
|
245
259
|
options,
|
246
260
|
response,
|
247
|
-
|
248
|
-
return _regenerator.default.wrap(function
|
249
|
-
while (1) switch (
|
261
|
+
_args5 = arguments;
|
262
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
263
|
+
while (1) switch (_context5.prev = _context5.next) {
|
250
264
|
case 0:
|
251
|
-
params =
|
252
|
-
options =
|
265
|
+
params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
266
|
+
options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
253
267
|
if (params['name']) {
|
254
|
-
|
268
|
+
_context5.next = 4;
|
255
269
|
break;
|
256
270
|
}
|
257
271
|
throw new errors.MissingParameterError('Parameter missing: name');
|
258
272
|
case 4:
|
259
273
|
if (params['email']) {
|
260
|
-
|
274
|
+
_context5.next = 6;
|
261
275
|
break;
|
262
276
|
}
|
263
277
|
throw new errors.MissingParameterError('Parameter missing: email');
|
264
278
|
case 6:
|
265
279
|
if (params['details']) {
|
266
|
-
|
280
|
+
_context5.next = 8;
|
267
281
|
break;
|
268
282
|
}
|
269
283
|
throw new errors.MissingParameterError('Parameter missing: details');
|
270
284
|
case 8:
|
271
285
|
if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
|
272
|
-
|
286
|
+
_context5.next = 10;
|
273
287
|
break;
|
274
288
|
}
|
275
289
|
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
|
276
290
|
case 10:
|
277
291
|
if (!(params['email'] && !(0, _utils.isString)(params['email']))) {
|
278
|
-
|
292
|
+
_context5.next = 12;
|
279
293
|
break;
|
280
294
|
}
|
281
295
|
throw new errors.InvalidParameterError("Bad parameter: email must be of type String, received ".concat((0, _utils.getType)(params['email'])));
|
282
296
|
case 12:
|
283
297
|
if (!(params['details'] && !(0, _utils.isString)(params['details']))) {
|
284
|
-
|
298
|
+
_context5.next = 14;
|
285
299
|
break;
|
286
300
|
}
|
287
301
|
throw new errors.InvalidParameterError("Bad parameter: details must be of type String, received ".concat((0, _utils.getType)(params['details'])));
|
288
302
|
case 14:
|
289
|
-
|
303
|
+
_context5.next = 16;
|
290
304
|
return _Api.default.sendRequest("/user_requests", 'POST', params, options);
|
291
305
|
case 16:
|
292
|
-
response =
|
293
|
-
return
|
306
|
+
response = _context5.sent;
|
307
|
+
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
294
308
|
case 18:
|
295
309
|
case "end":
|
296
|
-
return
|
310
|
+
return _context5.stop();
|
297
311
|
}
|
298
|
-
},
|
312
|
+
}, _callee5);
|
299
313
|
})));
|
300
314
|
var _default = exports.default = UserRequest;
|
301
315
|
module.exports = UserRequest;
|
@@ -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"));
|
@@ -138,19 +138,33 @@ var WebhookTest = /*#__PURE__*/(0, _createClass2.default)(function WebhookTest()
|
|
138
138
|
(0, _defineProperty2.default)(this, "setUseDedicatedIps", function (value) {
|
139
139
|
_this.attributes.use_dedicated_ips = value;
|
140
140
|
});
|
141
|
-
(0, _defineProperty2.default)(this, "save", function () {
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
141
|
+
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
142
|
+
var newObject;
|
143
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
144
|
+
while (1) switch (_context.prev = _context.next) {
|
145
|
+
case 0:
|
146
|
+
if (!_this.attributes['id']) {
|
147
|
+
_context.next = 4;
|
148
|
+
break;
|
149
|
+
}
|
150
|
+
throw new errors.NotImplementedError('The WebhookTest object doesn\'t support updates.');
|
151
|
+
case 4:
|
152
|
+
_context.next = 6;
|
153
|
+
return WebhookTest.create(_this.attributes, _this.options);
|
154
|
+
case 6:
|
155
|
+
newObject = _context.sent;
|
156
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
157
|
+
return _context.abrupt("return", true);
|
158
|
+
case 9:
|
159
|
+
case "end":
|
160
|
+
return _context.stop();
|
161
|
+
}
|
162
|
+
}, _callee);
|
163
|
+
})));
|
164
|
+
Object.entries(attributes).forEach(function (_ref2) {
|
165
|
+
var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
|
166
|
+
key = _ref3[0],
|
167
|
+
value = _ref3[1];
|
154
168
|
var normalizedKey = key.replace('?', '');
|
155
169
|
_this.attributes[normalizedKey] = value;
|
156
170
|
Object.defineProperty(_this, normalizedKey, {
|
@@ -172,68 +186,68 @@ _class = WebhookTest;
|
|
172
186
|
// file_form_field - string - Send the file data as a named parameter in the request POST body
|
173
187
|
// action - string - action for test body
|
174
188
|
// use_dedicated_ips - boolean - Use dedicated IPs for sending the webhook?
|
175
|
-
(0, _defineProperty2.default)(WebhookTest, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
189
|
+
(0, _defineProperty2.default)(WebhookTest, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
176
190
|
var params,
|
177
191
|
options,
|
178
192
|
response,
|
179
|
-
|
180
|
-
return _regenerator.default.wrap(function
|
181
|
-
while (1) switch (
|
193
|
+
_args2 = arguments;
|
194
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
195
|
+
while (1) switch (_context2.prev = _context2.next) {
|
182
196
|
case 0:
|
183
|
-
params =
|
184
|
-
options =
|
197
|
+
params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
|
198
|
+
options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
|
185
199
|
if (params['url']) {
|
186
|
-
|
200
|
+
_context2.next = 4;
|
187
201
|
break;
|
188
202
|
}
|
189
203
|
throw new errors.MissingParameterError('Parameter missing: url');
|
190
204
|
case 4:
|
191
205
|
if (!(params['url'] && !(0, _utils.isString)(params['url']))) {
|
192
|
-
|
206
|
+
_context2.next = 6;
|
193
207
|
break;
|
194
208
|
}
|
195
209
|
throw new errors.InvalidParameterError("Bad parameter: url must be of type String, received ".concat((0, _utils.getType)(params['url'])));
|
196
210
|
case 6:
|
197
211
|
if (!(params['method'] && !(0, _utils.isString)(params['method']))) {
|
198
|
-
|
212
|
+
_context2.next = 8;
|
199
213
|
break;
|
200
214
|
}
|
201
215
|
throw new errors.InvalidParameterError("Bad parameter: method must be of type String, received ".concat((0, _utils.getType)(params['method'])));
|
202
216
|
case 8:
|
203
217
|
if (!(params['encoding'] && !(0, _utils.isString)(params['encoding']))) {
|
204
|
-
|
218
|
+
_context2.next = 10;
|
205
219
|
break;
|
206
220
|
}
|
207
221
|
throw new errors.InvalidParameterError("Bad parameter: encoding must be of type String, received ".concat((0, _utils.getType)(params['encoding'])));
|
208
222
|
case 10:
|
209
223
|
if (!(params['raw_body'] && !(0, _utils.isString)(params['raw_body']))) {
|
210
|
-
|
224
|
+
_context2.next = 12;
|
211
225
|
break;
|
212
226
|
}
|
213
227
|
throw new errors.InvalidParameterError("Bad parameter: raw_body must be of type String, received ".concat((0, _utils.getType)(params['raw_body'])));
|
214
228
|
case 12:
|
215
229
|
if (!(params['file_form_field'] && !(0, _utils.isString)(params['file_form_field']))) {
|
216
|
-
|
230
|
+
_context2.next = 14;
|
217
231
|
break;
|
218
232
|
}
|
219
233
|
throw new errors.InvalidParameterError("Bad parameter: file_form_field must be of type String, received ".concat((0, _utils.getType)(params['file_form_field'])));
|
220
234
|
case 14:
|
221
235
|
if (!(params['action'] && !(0, _utils.isString)(params['action']))) {
|
222
|
-
|
236
|
+
_context2.next = 16;
|
223
237
|
break;
|
224
238
|
}
|
225
239
|
throw new errors.InvalidParameterError("Bad parameter: action must be of type String, received ".concat((0, _utils.getType)(params['action'])));
|
226
240
|
case 16:
|
227
|
-
|
241
|
+
_context2.next = 18;
|
228
242
|
return _Api.default.sendRequest("/webhook_tests", 'POST', params, options);
|
229
243
|
case 18:
|
230
|
-
response =
|
231
|
-
return
|
244
|
+
response = _context2.sent;
|
245
|
+
return _context2.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
232
246
|
case 20:
|
233
247
|
case "end":
|
234
|
-
return
|
248
|
+
return _context2.stop();
|
235
249
|
}
|
236
|
-
},
|
250
|
+
}, _callee2);
|
237
251
|
})));
|
238
252
|
var _default = exports.default = WebhookTest;
|
239
253
|
module.exports = WebhookTest;
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
@@ -123,11 +123,11 @@ class ActionNotificationExport {
|
|
123
123
|
}
|
124
124
|
|
125
125
|
|
126
|
-
save = () => {
|
126
|
+
save = async () => {
|
127
127
|
if (this.attributes['id']) {
|
128
128
|
throw new errors.NotImplementedError('The ActionNotificationExport object doesn\'t support updates.')
|
129
129
|
} else {
|
130
|
-
const newObject = ActionNotificationExport.create(this.attributes, this.options)
|
130
|
+
const newObject = await ActionNotificationExport.create(this.attributes, this.options)
|
131
131
|
this.attributes = { ...newObject.attributes }
|
132
132
|
return true
|
133
133
|
}
|
package/src/models/ApiKey.js
CHANGED
@@ -181,17 +181,19 @@ class ApiKey {
|
|
181
181
|
|
182
182
|
const response = await Api.sendRequest(`/api_keys/${encodeURIComponent(params['id'])}`, 'DELETE', params, this.options)
|
183
183
|
|
184
|
-
return
|
184
|
+
return
|
185
185
|
}
|
186
186
|
|
187
187
|
destroy = (params = {}) =>
|
188
188
|
this.delete(params)
|
189
189
|
|
190
|
-
save = () => {
|
190
|
+
save = async () => {
|
191
191
|
if (this.attributes['id']) {
|
192
|
-
|
192
|
+
const newObject = await this.update(this.attributes)
|
193
|
+
this.attributes = { ...newObject.attributes }
|
194
|
+
return true
|
193
195
|
} else {
|
194
|
-
const newObject = ApiKey.create(this.attributes, this.options)
|
196
|
+
const newObject = await ApiKey.create(this.attributes, this.options)
|
195
197
|
this.attributes = { ...newObject.attributes }
|
196
198
|
return true
|
197
199
|
}
|
@@ -326,7 +328,7 @@ class ApiKey {
|
|
326
328
|
static deleteCurrent = async (options = {}) => {
|
327
329
|
const response = await Api.sendRequest(`/api_key`, 'DELETE', {}, options)
|
328
330
|
|
329
|
-
return
|
331
|
+
return
|
330
332
|
}
|
331
333
|
}
|
332
334
|
|
package/src/models/As2Partner.js
CHANGED
@@ -193,17 +193,19 @@ class As2Partner {
|
|
193
193
|
|
194
194
|
const response = await Api.sendRequest(`/as2_partners/${encodeURIComponent(params['id'])}`, 'DELETE', params, this.options)
|
195
195
|
|
196
|
-
return
|
196
|
+
return
|
197
197
|
}
|
198
198
|
|
199
199
|
destroy = (params = {}) =>
|
200
200
|
this.delete(params)
|
201
201
|
|
202
|
-
save = () => {
|
202
|
+
save = async () => {
|
203
203
|
if (this.attributes['id']) {
|
204
|
-
|
204
|
+
const newObject = await this.update(this.attributes)
|
205
|
+
this.attributes = { ...newObject.attributes }
|
206
|
+
return true
|
205
207
|
} else {
|
206
|
-
const newObject = As2Partner.create(this.attributes, this.options)
|
208
|
+
const newObject = await As2Partner.create(this.attributes, this.options)
|
207
209
|
this.attributes = { ...newObject.attributes }
|
208
210
|
return true
|
209
211
|
}
|
package/src/models/As2Station.js
CHANGED
@@ -206,17 +206,19 @@ class As2Station {
|
|
206
206
|
|
207
207
|
const response = await Api.sendRequest(`/as2_stations/${encodeURIComponent(params['id'])}`, 'DELETE', params, this.options)
|
208
208
|
|
209
|
-
return
|
209
|
+
return
|
210
210
|
}
|
211
211
|
|
212
212
|
destroy = (params = {}) =>
|
213
213
|
this.delete(params)
|
214
214
|
|
215
|
-
save = () => {
|
215
|
+
save = async () => {
|
216
216
|
if (this.attributes['id']) {
|
217
|
-
|
217
|
+
const newObject = await this.update(this.attributes)
|
218
|
+
this.attributes = { ...newObject.attributes }
|
219
|
+
return true
|
218
220
|
} else {
|
219
|
-
const newObject = As2Station.create(this.attributes, this.options)
|
221
|
+
const newObject = await As2Station.create(this.attributes, this.options)
|
220
222
|
this.attributes = { ...newObject.attributes }
|
221
223
|
return true
|
222
224
|
}
|
package/src/models/Automation.js
CHANGED
@@ -218,7 +218,7 @@ class Automation {
|
|
218
218
|
|
219
219
|
const response = await Api.sendRequest(`/automations/${encodeURIComponent(params['id'])}/manual_run`, 'POST', params, this.options)
|
220
220
|
|
221
|
-
return
|
221
|
+
return
|
222
222
|
}
|
223
223
|
|
224
224
|
// Parameters:
|
@@ -341,17 +341,19 @@ class Automation {
|
|
341
341
|
|
342
342
|
const response = await Api.sendRequest(`/automations/${encodeURIComponent(params['id'])}`, 'DELETE', params, this.options)
|
343
343
|
|
344
|
-
return
|
344
|
+
return
|
345
345
|
}
|
346
346
|
|
347
347
|
destroy = (params = {}) =>
|
348
348
|
this.delete(params)
|
349
349
|
|
350
|
-
save = () => {
|
350
|
+
save = async () => {
|
351
351
|
if (this.attributes['id']) {
|
352
|
-
|
352
|
+
const newObject = await this.update(this.attributes)
|
353
|
+
this.attributes = { ...newObject.attributes }
|
354
|
+
return true
|
353
355
|
} else {
|
354
|
-
const newObject = Automation.create(this.attributes, this.options)
|
356
|
+
const newObject = await Automation.create(this.attributes, this.options)
|
355
357
|
this.attributes = { ...newObject.attributes }
|
356
358
|
return true
|
357
359
|
}
|
package/src/models/Behavior.js
CHANGED
@@ -163,17 +163,19 @@ class Behavior {
|
|
163
163
|
|
164
164
|
const response = await Api.sendRequest(`/behaviors/${encodeURIComponent(params['id'])}`, 'DELETE', params, this.options)
|
165
165
|
|
166
|
-
return
|
166
|
+
return
|
167
167
|
}
|
168
168
|
|
169
169
|
destroy = (params = {}) =>
|
170
170
|
this.delete(params)
|
171
171
|
|
172
|
-
save = () => {
|
172
|
+
save = async () => {
|
173
173
|
if (this.attributes['id']) {
|
174
|
-
|
174
|
+
const newObject = await this.update(this.attributes)
|
175
|
+
this.attributes = { ...newObject.attributes }
|
176
|
+
return true
|
175
177
|
} else {
|
176
|
-
const newObject = Behavior.create(this.attributes, this.options)
|
178
|
+
const newObject = await Behavior.create(this.attributes, this.options)
|
177
179
|
this.attributes = { ...newObject.attributes }
|
178
180
|
return true
|
179
181
|
}
|
@@ -347,7 +349,7 @@ class Behavior {
|
|
347
349
|
|
348
350
|
const response = await Api.sendRequest(`/behaviors/webhook/test`, 'POST', params, options)
|
349
351
|
|
350
|
-
return
|
352
|
+
return
|
351
353
|
}
|
352
354
|
}
|
353
355
|
|
package/src/models/Bundle.js
CHANGED
@@ -361,7 +361,7 @@ class Bundle {
|
|
361
361
|
|
362
362
|
const response = await Api.sendRequest(`/bundles/${encodeURIComponent(params['id'])}/share`, 'POST', params, this.options)
|
363
363
|
|
364
|
-
return
|
364
|
+
return
|
365
365
|
}
|
366
366
|
|
367
367
|
// Parameters:
|
@@ -481,17 +481,19 @@ class Bundle {
|
|
481
481
|
|
482
482
|
const response = await Api.sendRequest(`/bundles/${encodeURIComponent(params['id'])}`, 'DELETE', params, this.options)
|
483
483
|
|
484
|
-
return
|
484
|
+
return
|
485
485
|
}
|
486
486
|
|
487
487
|
destroy = (params = {}) =>
|
488
488
|
this.delete(params)
|
489
489
|
|
490
|
-
save = () => {
|
490
|
+
save = async () => {
|
491
491
|
if (this.attributes['id']) {
|
492
|
-
|
492
|
+
const newObject = await this.update(this.attributes)
|
493
|
+
this.attributes = { ...newObject.attributes }
|
494
|
+
return true
|
493
495
|
} else {
|
494
|
-
const newObject = Bundle.create(this.attributes, this.options)
|
496
|
+
const newObject = await Bundle.create(this.attributes, this.options)
|
495
497
|
this.attributes = { ...newObject.attributes }
|
496
498
|
return true
|
497
499
|
}
|
@@ -115,17 +115,19 @@ class BundleNotification {
|
|
115
115
|
|
116
116
|
const response = await Api.sendRequest(`/bundle_notifications/${encodeURIComponent(params['id'])}`, 'DELETE', params, this.options)
|
117
117
|
|
118
|
-
return
|
118
|
+
return
|
119
119
|
}
|
120
120
|
|
121
121
|
destroy = (params = {}) =>
|
122
122
|
this.delete(params)
|
123
123
|
|
124
|
-
save = () => {
|
124
|
+
save = async () => {
|
125
125
|
if (this.attributes['id']) {
|
126
|
-
|
126
|
+
const newObject = await this.update(this.attributes)
|
127
|
+
this.attributes = { ...newObject.attributes }
|
128
|
+
return true
|
127
129
|
} else {
|
128
|
-
const newObject = BundleNotification.create(this.attributes, this.options)
|
130
|
+
const newObject = await BundleNotification.create(this.attributes, this.options)
|
129
131
|
this.attributes = { ...newObject.attributes }
|
130
132
|
return true
|
131
133
|
}
|