files.com 1.2.249 → 1.2.251
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_VERSION +1 -1
- package/docs/models/User.md +4 -1
- package/lib/Api.js +72 -71
- package/lib/Files.js +1 -1
- package/lib/isomorphic/File.node.js +5 -5
- package/lib/models/ActionNotificationExport.js +38 -38
- package/lib/models/ActionNotificationExportResult.js +14 -14
- package/lib/models/ApiKey.js +100 -100
- package/lib/models/ApiRequestLog.js +8 -8
- package/lib/models/App.js +8 -8
- package/lib/models/As2IncomingMessage.js +10 -10
- package/lib/models/As2OutgoingMessage.js +10 -10
- package/lib/models/As2Partner.js +101 -101
- package/lib/models/As2Station.js +81 -81
- package/lib/models/Automation.js +167 -167
- package/lib/models/AutomationLog.js +8 -8
- package/lib/models/AutomationRun.js +24 -24
- package/lib/models/BandwidthSnapshot.js +8 -8
- package/lib/models/Behavior.js +106 -106
- package/lib/models/Bundle.js +143 -143
- package/lib/models/BundleAction.js +10 -10
- package/lib/models/BundleDownload.js +12 -12
- package/lib/models/BundleNotification.js +69 -69
- package/lib/models/BundleRecipient.js +40 -40
- package/lib/models/BundleRegistration.js +12 -12
- package/lib/models/Clickwrap.js +79 -79
- package/lib/models/DnsRecord.js +8 -8
- package/lib/models/EmailIncomingMessage.js +8 -8
- package/lib/models/EmailLog.js +8 -8
- package/lib/models/ExavaultApiRequestLog.js +8 -8
- package/lib/models/ExternalEvent.js +36 -36
- package/lib/models/File.js +269 -269
- package/lib/models/FileComment.js +70 -70
- package/lib/models/FileCommentReaction.js +34 -34
- package/lib/models/FileMigration.js +10 -10
- package/lib/models/FileMigrationLog.js +8 -8
- package/lib/models/Folder.js +36 -36
- package/lib/models/FormFieldSet.js +71 -71
- package/lib/models/FtpActionLog.js +8 -8
- package/lib/models/GpgKey.js +81 -81
- package/lib/models/Group.js +83 -83
- package/lib/models/GroupUser.js +89 -89
- package/lib/models/History.js +88 -88
- package/lib/models/HistoryExport.js +64 -64
- package/lib/models/HistoryExportResult.js +14 -14
- package/lib/models/InboxRecipient.js +36 -36
- package/lib/models/InboxRegistration.js +10 -10
- package/lib/models/InboxUpload.js +8 -8
- package/lib/models/Invoice.js +18 -18
- package/lib/models/IpAddress.js +32 -32
- package/lib/models/Lock.js +51 -51
- package/lib/models/Message.js +100 -100
- package/lib/models/MessageComment.js +78 -78
- package/lib/models/MessageCommentReaction.js +54 -54
- package/lib/models/MessageReaction.js +54 -54
- package/lib/models/Notification.js +91 -91
- package/lib/models/OutboundConnectionLog.js +8 -8
- package/lib/models/Payment.js +18 -18
- package/lib/models/Permission.js +54 -54
- package/lib/models/Priority.js +14 -14
- package/lib/models/Project.js +70 -70
- package/lib/models/PublicHostingRequestLog.js +8 -8
- package/lib/models/PublicKey.js +78 -78
- package/lib/models/RemoteBandwidthSnapshot.js +8 -8
- package/lib/models/RemoteServer.js +362 -362
- package/lib/models/Request.js +60 -60
- package/lib/models/Restore.js +24 -24
- package/lib/models/Session.js +21 -21
- package/lib/models/SettingsChange.js +8 -8
- package/lib/models/SftpActionLog.js +8 -8
- package/lib/models/SftpHostKey.js +67 -67
- package/lib/models/ShareGroup.js +79 -79
- package/lib/models/SiemHttpDestination.js +158 -158
- package/lib/models/Site.js +150 -150
- package/lib/models/Snapshot.js +85 -85
- package/lib/models/SsoStrategy.js +32 -32
- package/lib/models/Style.js +48 -48
- package/lib/models/SyncLog.js +8 -8
- package/lib/models/UsageDailySnapshot.js +8 -8
- package/lib/models/UsageSnapshot.js +8 -8
- package/lib/models/User.js +223 -215
- package/lib/models/UserCipherUse.js +10 -10
- package/lib/models/UserLifecycleRule.js +92 -92
- package/lib/models/UserRequest.js +56 -56
- package/lib/models/UserSftpClientUse.js +10 -10
- package/lib/models/WebDavActionLog.js +8 -8
- package/lib/models/WebhookTest.js +24 -24
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/User.js +6 -0
|
@@ -56,46 +56,46 @@ var MessageReaction = /*#__PURE__*/(0, _createClass2.default)(function MessageRe
|
|
|
56
56
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
57
57
|
var params,
|
|
58
58
|
_args = arguments;
|
|
59
|
-
return _regenerator.default.wrap(function
|
|
59
|
+
return _regenerator.default.wrap(function (_context) {
|
|
60
60
|
while (1) switch (_context.prev = _context.next) {
|
|
61
61
|
case 0:
|
|
62
62
|
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
63
63
|
if (_this.attributes.id) {
|
|
64
|
-
_context.next =
|
|
64
|
+
_context.next = 1;
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
67
|
throw new errors.EmptyPropertyError('Current object has no id');
|
|
68
|
-
case
|
|
68
|
+
case 1:
|
|
69
69
|
if ((0, _utils.isObject)(params)) {
|
|
70
|
-
_context.next =
|
|
70
|
+
_context.next = 2;
|
|
71
71
|
break;
|
|
72
72
|
}
|
|
73
73
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
74
|
-
case
|
|
74
|
+
case 2:
|
|
75
75
|
params.id = _this.attributes.id;
|
|
76
76
|
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
77
|
-
_context.next =
|
|
77
|
+
_context.next = 3;
|
|
78
78
|
break;
|
|
79
79
|
}
|
|
80
80
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
81
|
-
case
|
|
81
|
+
case 3:
|
|
82
82
|
if (params.id) {
|
|
83
|
-
_context.next =
|
|
83
|
+
_context.next = 5;
|
|
84
84
|
break;
|
|
85
85
|
}
|
|
86
86
|
if (!_this.attributes.id) {
|
|
87
|
-
_context.next =
|
|
87
|
+
_context.next = 4;
|
|
88
88
|
break;
|
|
89
89
|
}
|
|
90
90
|
params.id = _this.id;
|
|
91
|
-
_context.next =
|
|
91
|
+
_context.next = 5;
|
|
92
92
|
break;
|
|
93
|
-
case
|
|
93
|
+
case 4:
|
|
94
94
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
95
|
-
case
|
|
96
|
-
_context.next =
|
|
95
|
+
case 5:
|
|
96
|
+
_context.next = 6;
|
|
97
97
|
return _Api.default.sendRequest("/message_reactions/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
|
98
|
-
case
|
|
98
|
+
case 6:
|
|
99
99
|
case "end":
|
|
100
100
|
return _context.stop();
|
|
101
101
|
}
|
|
@@ -107,22 +107,22 @@ var MessageReaction = /*#__PURE__*/(0, _createClass2.default)(function MessageRe
|
|
|
107
107
|
});
|
|
108
108
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
109
109
|
var newObject;
|
|
110
|
-
return _regenerator.default.wrap(function
|
|
110
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
111
111
|
while (1) switch (_context2.prev = _context2.next) {
|
|
112
112
|
case 0:
|
|
113
113
|
if (!_this.attributes.id) {
|
|
114
|
-
_context2.next =
|
|
114
|
+
_context2.next = 1;
|
|
115
115
|
break;
|
|
116
116
|
}
|
|
117
117
|
throw new errors.NotImplementedError('The MessageReaction object doesn\'t support updates.');
|
|
118
|
-
case
|
|
119
|
-
_context2.next =
|
|
118
|
+
case 1:
|
|
119
|
+
_context2.next = 2;
|
|
120
120
|
return MessageReaction.create(_this.attributes, _this.options);
|
|
121
|
-
case
|
|
121
|
+
case 2:
|
|
122
122
|
newObject = _context2.sent;
|
|
123
123
|
_this.attributes = _objectSpread({}, newObject.attributes);
|
|
124
124
|
return _context2.abrupt("return", true);
|
|
125
|
-
case
|
|
125
|
+
case 3:
|
|
126
126
|
case "end":
|
|
127
127
|
return _context2.stop();
|
|
128
128
|
}
|
|
@@ -153,49 +153,49 @@ _MessageReaction = MessageReaction;
|
|
|
153
153
|
options,
|
|
154
154
|
response,
|
|
155
155
|
_args3 = arguments;
|
|
156
|
-
return _regenerator.default.wrap(function
|
|
156
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
157
157
|
while (1) switch (_context3.prev = _context3.next) {
|
|
158
158
|
case 0:
|
|
159
159
|
params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
|
160
160
|
options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
|
|
161
161
|
if (params.message_id) {
|
|
162
|
-
_context3.next =
|
|
162
|
+
_context3.next = 1;
|
|
163
163
|
break;
|
|
164
164
|
}
|
|
165
165
|
throw new errors.MissingParameterError('Parameter missing: message_id');
|
|
166
|
-
case
|
|
166
|
+
case 1:
|
|
167
167
|
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
|
168
|
-
_context3.next =
|
|
168
|
+
_context3.next = 2;
|
|
169
169
|
break;
|
|
170
170
|
}
|
|
171
171
|
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
|
172
|
-
case
|
|
172
|
+
case 2:
|
|
173
173
|
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
174
|
-
_context3.next =
|
|
174
|
+
_context3.next = 3;
|
|
175
175
|
break;
|
|
176
176
|
}
|
|
177
177
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
178
|
-
case
|
|
178
|
+
case 3:
|
|
179
179
|
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
180
|
-
_context3.next =
|
|
180
|
+
_context3.next = 4;
|
|
181
181
|
break;
|
|
182
182
|
}
|
|
183
183
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
184
|
-
case
|
|
184
|
+
case 4:
|
|
185
185
|
if (!(params.message_id && !(0, _utils.isInt)(params.message_id))) {
|
|
186
|
-
_context3.next =
|
|
186
|
+
_context3.next = 5;
|
|
187
187
|
break;
|
|
188
188
|
}
|
|
189
189
|
throw new errors.InvalidParameterError("Bad parameter: message_id must be of type Int, received ".concat((0, _utils.getType)(params.message_id)));
|
|
190
|
-
case
|
|
191
|
-
_context3.next =
|
|
190
|
+
case 5:
|
|
191
|
+
_context3.next = 6;
|
|
192
192
|
return _Api.default.sendRequest('/message_reactions', 'GET', params, options);
|
|
193
|
-
case
|
|
193
|
+
case 6:
|
|
194
194
|
response = _context3.sent;
|
|
195
195
|
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) {
|
|
196
196
|
return new _MessageReaction(obj, options);
|
|
197
197
|
})) || []);
|
|
198
|
-
case
|
|
198
|
+
case 7:
|
|
199
199
|
case "end":
|
|
200
200
|
return _context3.stop();
|
|
201
201
|
}
|
|
@@ -214,36 +214,36 @@ _MessageReaction = MessageReaction;
|
|
|
214
214
|
options,
|
|
215
215
|
response,
|
|
216
216
|
_args4 = arguments;
|
|
217
|
-
return _regenerator.default.wrap(function
|
|
217
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
218
218
|
while (1) switch (_context4.prev = _context4.next) {
|
|
219
219
|
case 0:
|
|
220
220
|
params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
|
221
221
|
options = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
|
|
222
222
|
if ((0, _utils.isObject)(params)) {
|
|
223
|
-
_context4.next =
|
|
223
|
+
_context4.next = 1;
|
|
224
224
|
break;
|
|
225
225
|
}
|
|
226
226
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
227
|
-
case
|
|
227
|
+
case 1:
|
|
228
228
|
params.id = id;
|
|
229
229
|
if (params.id) {
|
|
230
|
-
_context4.next =
|
|
230
|
+
_context4.next = 2;
|
|
231
231
|
break;
|
|
232
232
|
}
|
|
233
233
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
234
|
-
case
|
|
234
|
+
case 2:
|
|
235
235
|
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
236
|
-
_context4.next =
|
|
236
|
+
_context4.next = 3;
|
|
237
237
|
break;
|
|
238
238
|
}
|
|
239
239
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
240
|
-
case
|
|
241
|
-
_context4.next =
|
|
240
|
+
case 3:
|
|
241
|
+
_context4.next = 4;
|
|
242
242
|
return _Api.default.sendRequest("/message_reactions/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
|
243
|
-
case
|
|
243
|
+
case 4:
|
|
244
244
|
response = _context4.sent;
|
|
245
245
|
return _context4.abrupt("return", new _MessageReaction(response === null || response === void 0 ? void 0 : response.data, options));
|
|
246
|
-
case
|
|
246
|
+
case 5:
|
|
247
247
|
case "end":
|
|
248
248
|
return _context4.stop();
|
|
249
249
|
}
|
|
@@ -266,35 +266,35 @@ _MessageReaction = MessageReaction;
|
|
|
266
266
|
options,
|
|
267
267
|
response,
|
|
268
268
|
_args5 = arguments;
|
|
269
|
-
return _regenerator.default.wrap(function
|
|
269
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
270
270
|
while (1) switch (_context5.prev = _context5.next) {
|
|
271
271
|
case 0:
|
|
272
272
|
params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
|
273
273
|
options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
|
274
274
|
if (params.emoji) {
|
|
275
|
-
_context5.next =
|
|
275
|
+
_context5.next = 1;
|
|
276
276
|
break;
|
|
277
277
|
}
|
|
278
278
|
throw new errors.MissingParameterError('Parameter missing: emoji');
|
|
279
|
-
case
|
|
279
|
+
case 1:
|
|
280
280
|
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
|
281
|
-
_context5.next =
|
|
281
|
+
_context5.next = 2;
|
|
282
282
|
break;
|
|
283
283
|
}
|
|
284
284
|
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
|
285
|
-
case
|
|
285
|
+
case 2:
|
|
286
286
|
if (!(params.emoji && !(0, _utils.isString)(params.emoji))) {
|
|
287
|
-
_context5.next =
|
|
287
|
+
_context5.next = 3;
|
|
288
288
|
break;
|
|
289
289
|
}
|
|
290
290
|
throw new errors.InvalidParameterError("Bad parameter: emoji must be of type String, received ".concat((0, _utils.getType)(params.emoji)));
|
|
291
|
-
case
|
|
292
|
-
_context5.next =
|
|
291
|
+
case 3:
|
|
292
|
+
_context5.next = 4;
|
|
293
293
|
return _Api.default.sendRequest('/message_reactions', 'POST', params, options);
|
|
294
|
-
case
|
|
294
|
+
case 4:
|
|
295
295
|
response = _context5.sent;
|
|
296
296
|
return _context5.abrupt("return", new _MessageReaction(response === null || response === void 0 ? void 0 : response.data, options));
|
|
297
|
-
case
|
|
297
|
+
case 5:
|
|
298
298
|
case "end":
|
|
299
299
|
return _context5.stop();
|
|
300
300
|
}
|
|
@@ -204,79 +204,79 @@ var Notification = /*#__PURE__*/(0, _createClass2.default)(function Notification
|
|
|
204
204
|
var params,
|
|
205
205
|
response,
|
|
206
206
|
_args = arguments;
|
|
207
|
-
return _regenerator.default.wrap(function
|
|
207
|
+
return _regenerator.default.wrap(function (_context) {
|
|
208
208
|
while (1) switch (_context.prev = _context.next) {
|
|
209
209
|
case 0:
|
|
210
210
|
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
211
211
|
if (_this.attributes.id) {
|
|
212
|
-
_context.next =
|
|
212
|
+
_context.next = 1;
|
|
213
213
|
break;
|
|
214
214
|
}
|
|
215
215
|
throw new errors.EmptyPropertyError('Current object has no id');
|
|
216
|
-
case
|
|
216
|
+
case 1:
|
|
217
217
|
if ((0, _utils.isObject)(params)) {
|
|
218
|
-
_context.next =
|
|
218
|
+
_context.next = 2;
|
|
219
219
|
break;
|
|
220
220
|
}
|
|
221
221
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
222
|
-
case
|
|
222
|
+
case 2:
|
|
223
223
|
params.id = _this.attributes.id;
|
|
224
224
|
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
225
|
-
_context.next =
|
|
225
|
+
_context.next = 3;
|
|
226
226
|
break;
|
|
227
227
|
}
|
|
228
228
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
229
|
-
case
|
|
229
|
+
case 3:
|
|
230
230
|
if (!(params.send_interval && !(0, _utils.isString)(params.send_interval))) {
|
|
231
|
-
_context.next =
|
|
231
|
+
_context.next = 4;
|
|
232
232
|
break;
|
|
233
233
|
}
|
|
234
234
|
throw new errors.InvalidParameterError("Bad parameter: send_interval must be of type String, received ".concat((0, _utils.getType)(params.send_interval)));
|
|
235
|
-
case
|
|
235
|
+
case 4:
|
|
236
236
|
if (!(params.message && !(0, _utils.isString)(params.message))) {
|
|
237
|
-
_context.next =
|
|
237
|
+
_context.next = 5;
|
|
238
238
|
break;
|
|
239
239
|
}
|
|
240
240
|
throw new errors.InvalidParameterError("Bad parameter: message must be of type String, received ".concat((0, _utils.getType)(params.message)));
|
|
241
|
-
case
|
|
241
|
+
case 5:
|
|
242
242
|
if (!(params.triggering_filenames && !(0, _utils.isArray)(params.triggering_filenames))) {
|
|
243
|
-
_context.next =
|
|
243
|
+
_context.next = 6;
|
|
244
244
|
break;
|
|
245
245
|
}
|
|
246
246
|
throw new errors.InvalidParameterError("Bad parameter: triggering_filenames must be of type Array, received ".concat((0, _utils.getType)(params.triggering_filenames)));
|
|
247
|
-
case
|
|
247
|
+
case 6:
|
|
248
248
|
if (!(params.triggering_group_ids && !(0, _utils.isArray)(params.triggering_group_ids))) {
|
|
249
|
-
_context.next =
|
|
249
|
+
_context.next = 7;
|
|
250
250
|
break;
|
|
251
251
|
}
|
|
252
252
|
throw new errors.InvalidParameterError("Bad parameter: triggering_group_ids must be of type Array, received ".concat((0, _utils.getType)(params.triggering_group_ids)));
|
|
253
|
-
case
|
|
253
|
+
case 7:
|
|
254
254
|
if (!(params.triggering_user_ids && !(0, _utils.isArray)(params.triggering_user_ids))) {
|
|
255
|
-
_context.next =
|
|
255
|
+
_context.next = 8;
|
|
256
256
|
break;
|
|
257
257
|
}
|
|
258
258
|
throw new errors.InvalidParameterError("Bad parameter: triggering_user_ids must be of type Array, received ".concat((0, _utils.getType)(params.triggering_user_ids)));
|
|
259
|
-
case
|
|
259
|
+
case 8:
|
|
260
260
|
if (params.id) {
|
|
261
|
-
_context.next =
|
|
261
|
+
_context.next = 10;
|
|
262
262
|
break;
|
|
263
263
|
}
|
|
264
264
|
if (!_this.attributes.id) {
|
|
265
|
-
_context.next =
|
|
265
|
+
_context.next = 9;
|
|
266
266
|
break;
|
|
267
267
|
}
|
|
268
268
|
params.id = _this.id;
|
|
269
|
-
_context.next =
|
|
269
|
+
_context.next = 10;
|
|
270
270
|
break;
|
|
271
|
-
case
|
|
271
|
+
case 9:
|
|
272
272
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
273
|
-
case
|
|
274
|
-
_context.next =
|
|
273
|
+
case 10:
|
|
274
|
+
_context.next = 11;
|
|
275
275
|
return _Api.default.sendRequest("/notifications/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
|
276
|
-
case
|
|
276
|
+
case 11:
|
|
277
277
|
response = _context.sent;
|
|
278
278
|
return _context.abrupt("return", new Notification(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
|
279
|
-
case
|
|
279
|
+
case 12:
|
|
280
280
|
case "end":
|
|
281
281
|
return _context.stop();
|
|
282
282
|
}
|
|
@@ -285,46 +285,46 @@ var Notification = /*#__PURE__*/(0, _createClass2.default)(function Notification
|
|
|
285
285
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
286
286
|
var params,
|
|
287
287
|
_args2 = arguments;
|
|
288
|
-
return _regenerator.default.wrap(function
|
|
288
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
289
289
|
while (1) switch (_context2.prev = _context2.next) {
|
|
290
290
|
case 0:
|
|
291
291
|
params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
|
|
292
292
|
if (_this.attributes.id) {
|
|
293
|
-
_context2.next =
|
|
293
|
+
_context2.next = 1;
|
|
294
294
|
break;
|
|
295
295
|
}
|
|
296
296
|
throw new errors.EmptyPropertyError('Current object has no id');
|
|
297
|
-
case
|
|
297
|
+
case 1:
|
|
298
298
|
if ((0, _utils.isObject)(params)) {
|
|
299
|
-
_context2.next =
|
|
299
|
+
_context2.next = 2;
|
|
300
300
|
break;
|
|
301
301
|
}
|
|
302
302
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
303
|
-
case
|
|
303
|
+
case 2:
|
|
304
304
|
params.id = _this.attributes.id;
|
|
305
305
|
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
306
|
-
_context2.next =
|
|
306
|
+
_context2.next = 3;
|
|
307
307
|
break;
|
|
308
308
|
}
|
|
309
309
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
310
|
-
case
|
|
310
|
+
case 3:
|
|
311
311
|
if (params.id) {
|
|
312
|
-
_context2.next =
|
|
312
|
+
_context2.next = 5;
|
|
313
313
|
break;
|
|
314
314
|
}
|
|
315
315
|
if (!_this.attributes.id) {
|
|
316
|
-
_context2.next =
|
|
316
|
+
_context2.next = 4;
|
|
317
317
|
break;
|
|
318
318
|
}
|
|
319
319
|
params.id = _this.id;
|
|
320
|
-
_context2.next =
|
|
320
|
+
_context2.next = 5;
|
|
321
321
|
break;
|
|
322
|
-
case
|
|
322
|
+
case 4:
|
|
323
323
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
324
|
-
case
|
|
325
|
-
_context2.next =
|
|
324
|
+
case 5:
|
|
325
|
+
_context2.next = 6;
|
|
326
326
|
return _Api.default.sendRequest("/notifications/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
|
327
|
-
case
|
|
327
|
+
case 6:
|
|
328
328
|
case "end":
|
|
329
329
|
return _context2.stop();
|
|
330
330
|
}
|
|
@@ -336,27 +336,27 @@ var Notification = /*#__PURE__*/(0, _createClass2.default)(function Notification
|
|
|
336
336
|
});
|
|
337
337
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
338
338
|
var _newObject, newObject;
|
|
339
|
-
return _regenerator.default.wrap(function
|
|
339
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
340
340
|
while (1) switch (_context3.prev = _context3.next) {
|
|
341
341
|
case 0:
|
|
342
342
|
if (!_this.attributes.id) {
|
|
343
|
-
_context3.next =
|
|
343
|
+
_context3.next = 2;
|
|
344
344
|
break;
|
|
345
345
|
}
|
|
346
|
-
_context3.next =
|
|
346
|
+
_context3.next = 1;
|
|
347
347
|
return _this.update(_this.attributes);
|
|
348
|
-
case
|
|
348
|
+
case 1:
|
|
349
349
|
_newObject = _context3.sent;
|
|
350
350
|
_this.attributes = _objectSpread({}, _newObject.attributes);
|
|
351
351
|
return _context3.abrupt("return", true);
|
|
352
|
-
case
|
|
353
|
-
_context3.next =
|
|
352
|
+
case 2:
|
|
353
|
+
_context3.next = 3;
|
|
354
354
|
return Notification.create(_this.attributes, _this.options);
|
|
355
|
-
case
|
|
355
|
+
case 3:
|
|
356
356
|
newObject = _context3.sent;
|
|
357
357
|
_this.attributes = _objectSpread({}, newObject.attributes);
|
|
358
358
|
return _context3.abrupt("return", true);
|
|
359
|
-
case
|
|
359
|
+
case 4:
|
|
360
360
|
case "end":
|
|
361
361
|
return _context3.stop();
|
|
362
362
|
}
|
|
@@ -391,43 +391,43 @@ _Notification = Notification;
|
|
|
391
391
|
options,
|
|
392
392
|
response,
|
|
393
393
|
_args4 = arguments;
|
|
394
|
-
return _regenerator.default.wrap(function
|
|
394
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
395
395
|
while (1) switch (_context4.prev = _context4.next) {
|
|
396
396
|
case 0:
|
|
397
397
|
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
|
398
398
|
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
|
399
399
|
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
400
|
-
_context4.next =
|
|
400
|
+
_context4.next = 1;
|
|
401
401
|
break;
|
|
402
402
|
}
|
|
403
403
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
404
|
-
case
|
|
404
|
+
case 1:
|
|
405
405
|
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
406
|
-
_context4.next =
|
|
406
|
+
_context4.next = 2;
|
|
407
407
|
break;
|
|
408
408
|
}
|
|
409
409
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
410
|
-
case
|
|
410
|
+
case 2:
|
|
411
411
|
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
412
|
-
_context4.next =
|
|
412
|
+
_context4.next = 3;
|
|
413
413
|
break;
|
|
414
414
|
}
|
|
415
415
|
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
416
|
-
case
|
|
416
|
+
case 3:
|
|
417
417
|
if (!(params.group_id && !(0, _utils.isString)(params.group_id))) {
|
|
418
|
-
_context4.next =
|
|
418
|
+
_context4.next = 4;
|
|
419
419
|
break;
|
|
420
420
|
}
|
|
421
421
|
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type String, received ".concat((0, _utils.getType)(params.group_id)));
|
|
422
|
-
case
|
|
423
|
-
_context4.next =
|
|
422
|
+
case 4:
|
|
423
|
+
_context4.next = 5;
|
|
424
424
|
return _Api.default.sendRequest('/notifications', 'GET', params, options);
|
|
425
|
-
case
|
|
425
|
+
case 5:
|
|
426
426
|
response = _context4.sent;
|
|
427
427
|
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) {
|
|
428
428
|
return new _Notification(obj, options);
|
|
429
429
|
})) || []);
|
|
430
|
-
case
|
|
430
|
+
case 6:
|
|
431
431
|
case "end":
|
|
432
432
|
return _context4.stop();
|
|
433
433
|
}
|
|
@@ -446,36 +446,36 @@ _Notification = Notification;
|
|
|
446
446
|
options,
|
|
447
447
|
response,
|
|
448
448
|
_args5 = arguments;
|
|
449
|
-
return _regenerator.default.wrap(function
|
|
449
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
450
450
|
while (1) switch (_context5.prev = _context5.next) {
|
|
451
451
|
case 0:
|
|
452
452
|
params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
|
453
453
|
options = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
|
|
454
454
|
if ((0, _utils.isObject)(params)) {
|
|
455
|
-
_context5.next =
|
|
455
|
+
_context5.next = 1;
|
|
456
456
|
break;
|
|
457
457
|
}
|
|
458
458
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
459
|
-
case
|
|
459
|
+
case 1:
|
|
460
460
|
params.id = id;
|
|
461
461
|
if (params.id) {
|
|
462
|
-
_context5.next =
|
|
462
|
+
_context5.next = 2;
|
|
463
463
|
break;
|
|
464
464
|
}
|
|
465
465
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
466
|
-
case
|
|
466
|
+
case 2:
|
|
467
467
|
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
468
|
-
_context5.next =
|
|
468
|
+
_context5.next = 3;
|
|
469
469
|
break;
|
|
470
470
|
}
|
|
471
471
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
472
|
-
case
|
|
473
|
-
_context5.next =
|
|
472
|
+
case 3:
|
|
473
|
+
_context5.next = 4;
|
|
474
474
|
return _Api.default.sendRequest("/notifications/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
|
475
|
-
case
|
|
475
|
+
case 4:
|
|
476
476
|
response = _context5.sent;
|
|
477
477
|
return _context5.abrupt("return", new _Notification(response === null || response === void 0 ? void 0 : response.data, options));
|
|
478
|
-
case
|
|
478
|
+
case 5:
|
|
479
479
|
case "end":
|
|
480
480
|
return _context5.stop();
|
|
481
481
|
}
|
|
@@ -513,71 +513,71 @@ _Notification = Notification;
|
|
|
513
513
|
options,
|
|
514
514
|
response,
|
|
515
515
|
_args6 = arguments;
|
|
516
|
-
return _regenerator.default.wrap(function
|
|
516
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
517
517
|
while (1) switch (_context6.prev = _context6.next) {
|
|
518
518
|
case 0:
|
|
519
519
|
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
|
520
520
|
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
|
521
521
|
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
|
522
|
-
_context6.next =
|
|
522
|
+
_context6.next = 1;
|
|
523
523
|
break;
|
|
524
524
|
}
|
|
525
525
|
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
|
526
|
-
case
|
|
526
|
+
case 1:
|
|
527
527
|
if (!(params.send_interval && !(0, _utils.isString)(params.send_interval))) {
|
|
528
|
-
_context6.next =
|
|
528
|
+
_context6.next = 2;
|
|
529
529
|
break;
|
|
530
530
|
}
|
|
531
531
|
throw new errors.InvalidParameterError("Bad parameter: send_interval must be of type String, received ".concat((0, _utils.getType)(params.send_interval)));
|
|
532
|
-
case
|
|
532
|
+
case 2:
|
|
533
533
|
if (!(params.message && !(0, _utils.isString)(params.message))) {
|
|
534
|
-
_context6.next =
|
|
534
|
+
_context6.next = 3;
|
|
535
535
|
break;
|
|
536
536
|
}
|
|
537
537
|
throw new errors.InvalidParameterError("Bad parameter: message must be of type String, received ".concat((0, _utils.getType)(params.message)));
|
|
538
|
-
case
|
|
538
|
+
case 3:
|
|
539
539
|
if (!(params.triggering_filenames && !(0, _utils.isArray)(params.triggering_filenames))) {
|
|
540
|
-
_context6.next =
|
|
540
|
+
_context6.next = 4;
|
|
541
541
|
break;
|
|
542
542
|
}
|
|
543
543
|
throw new errors.InvalidParameterError("Bad parameter: triggering_filenames must be of type Array, received ".concat((0, _utils.getType)(params.triggering_filenames)));
|
|
544
|
-
case
|
|
544
|
+
case 4:
|
|
545
545
|
if (!(params.triggering_group_ids && !(0, _utils.isArray)(params.triggering_group_ids))) {
|
|
546
|
-
_context6.next =
|
|
546
|
+
_context6.next = 5;
|
|
547
547
|
break;
|
|
548
548
|
}
|
|
549
549
|
throw new errors.InvalidParameterError("Bad parameter: triggering_group_ids must be of type Array, received ".concat((0, _utils.getType)(params.triggering_group_ids)));
|
|
550
|
-
case
|
|
550
|
+
case 5:
|
|
551
551
|
if (!(params.triggering_user_ids && !(0, _utils.isArray)(params.triggering_user_ids))) {
|
|
552
|
-
_context6.next =
|
|
552
|
+
_context6.next = 6;
|
|
553
553
|
break;
|
|
554
554
|
}
|
|
555
555
|
throw new errors.InvalidParameterError("Bad parameter: triggering_user_ids must be of type Array, received ".concat((0, _utils.getType)(params.triggering_user_ids)));
|
|
556
|
-
case
|
|
556
|
+
case 6:
|
|
557
557
|
if (!(params.group_id && !(0, _utils.isInt)(params.group_id))) {
|
|
558
|
-
_context6.next =
|
|
558
|
+
_context6.next = 7;
|
|
559
559
|
break;
|
|
560
560
|
}
|
|
561
561
|
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params.group_id)));
|
|
562
|
-
case
|
|
562
|
+
case 7:
|
|
563
563
|
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
564
|
-
_context6.next =
|
|
564
|
+
_context6.next = 8;
|
|
565
565
|
break;
|
|
566
566
|
}
|
|
567
567
|
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
568
|
-
case
|
|
568
|
+
case 8:
|
|
569
569
|
if (!(params.username && !(0, _utils.isString)(params.username))) {
|
|
570
|
-
_context6.next =
|
|
570
|
+
_context6.next = 9;
|
|
571
571
|
break;
|
|
572
572
|
}
|
|
573
573
|
throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(params.username)));
|
|
574
|
-
case
|
|
575
|
-
_context6.next =
|
|
574
|
+
case 9:
|
|
575
|
+
_context6.next = 10;
|
|
576
576
|
return _Api.default.sendRequest('/notifications', 'POST', params, options);
|
|
577
|
-
case
|
|
577
|
+
case 10:
|
|
578
578
|
response = _context6.sent;
|
|
579
579
|
return _context6.abrupt("return", new _Notification(response === null || response === void 0 ? void 0 : response.data, options));
|
|
580
|
-
case
|
|
580
|
+
case 11:
|
|
581
581
|
case "end":
|
|
582
582
|
return _context6.stop();
|
|
583
583
|
}
|