files.com 1.0.236 → 1.0.237
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/BundleNotification.md +35 -0
- package/lib/Api.js +153 -159
- package/lib/isomorphic/File.node.js +24 -28
- package/lib/models/ActionNotificationExport.js +97 -101
- package/lib/models/ActionNotificationExportResult.js +44 -46
- package/lib/models/ActionWebhookFailure.js +42 -44
- package/lib/models/ApiKey.js +271 -287
- package/lib/models/App.js +26 -28
- package/lib/models/As2IncomingMessage.js +32 -34
- package/lib/models/As2OutgoingMessage.js +32 -34
- package/lib/models/As2Partner.js +231 -241
- package/lib/models/As2Station.js +219 -229
- package/lib/models/Automation.js +333 -343
- package/lib/models/AutomationRun.js +75 -79
- package/lib/models/BandwidthSnapshot.js +26 -28
- package/lib/models/Behavior.js +323 -337
- package/lib/models/Bundle.js +375 -387
- package/lib/models/BundleDownload.js +38 -40
- package/lib/models/BundleNotification.js +223 -173
- package/lib/models/BundleRecipient.js +104 -108
- package/lib/models/BundleRegistration.js +38 -40
- package/lib/models/Clickwrap.js +213 -223
- package/lib/models/DnsRecord.js +26 -28
- package/lib/models/ExternalEvent.js +93 -99
- package/lib/models/File.js +726 -766
- package/lib/models/FileComment.js +180 -188
- package/lib/models/FileCommentReaction.js +84 -88
- package/lib/models/FileMigration.js +31 -33
- package/lib/models/Folder.js +94 -98
- package/lib/models/FormFieldSet.js +189 -199
- package/lib/models/Group.js +207 -217
- package/lib/models/GroupUser.js +230 -238
- package/lib/models/History.js +266 -276
- package/lib/models/HistoryExport.js +175 -179
- package/lib/models/HistoryExportResult.js +44 -46
- package/lib/models/InboxRecipient.js +104 -108
- package/lib/models/InboxRegistration.js +32 -34
- package/lib/models/InboxUpload.js +38 -40
- package/lib/models/Invoice.js +57 -61
- package/lib/models/IpAddress.js +78 -84
- package/lib/models/Lock.js +148 -154
- package/lib/models/Message.js +267 -277
- package/lib/models/MessageComment.js +207 -217
- package/lib/models/MessageCommentReaction.js +147 -155
- package/lib/models/MessageReaction.js +147 -155
- package/lib/models/Notification.js +255 -265
- package/lib/models/Payment.js +57 -61
- package/lib/models/Permission.js +128 -134
- package/lib/models/Priority.js +45 -47
- package/lib/models/Project.js +183 -193
- package/lib/models/PublicKey.js +207 -217
- package/lib/models/RemoteBandwidthSnapshot.js +26 -28
- package/lib/models/RemoteServer.js +805 -819
- package/lib/models/Request.js +166 -174
- package/lib/models/Session.js +47 -51
- package/lib/models/SettingsChange.js +26 -28
- package/lib/models/SftpHostKey.js +177 -187
- package/lib/models/Site.js +412 -418
- package/lib/models/SsoStrategy.js +99 -105
- package/lib/models/Style.js +127 -133
- package/lib/models/UsageDailySnapshot.js +26 -28
- package/lib/models/UsageSnapshot.js +26 -28
- package/lib/models/User.js +587 -603
- package/lib/models/UserCipherUse.js +32 -34
- package/lib/models/UserRequest.js +147 -155
- package/lib/models/WebhookTest.js +54 -56
- package/package.json +1 -1
- package/src/models/BundleNotification.js +39 -1
@@ -69,40 +69,38 @@ var UserCipherUse = /*#__PURE__*/(0, _createClass2.default)(function UserCipherU
|
|
69
69
|
response,
|
70
70
|
_args = arguments;
|
71
71
|
return _regenerator.default.wrap(function _callee$(_context) {
|
72
|
-
while (1) {
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
return
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
return _context.stop();
|
105
|
-
}
|
72
|
+
while (1) switch (_context.prev = _context.next) {
|
73
|
+
case 0:
|
74
|
+
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
75
|
+
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
76
|
+
if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
|
77
|
+
_context.next = 4;
|
78
|
+
break;
|
79
|
+
}
|
80
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
|
81
|
+
case 4:
|
82
|
+
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
83
|
+
_context.next = 6;
|
84
|
+
break;
|
85
|
+
}
|
86
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
87
|
+
case 6:
|
88
|
+
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
89
|
+
_context.next = 8;
|
90
|
+
break;
|
91
|
+
}
|
92
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
93
|
+
case 8:
|
94
|
+
_context.next = 10;
|
95
|
+
return _Api.default.sendRequest("/user_cipher_uses", 'GET', params, options);
|
96
|
+
case 10:
|
97
|
+
response = _context.sent;
|
98
|
+
return _context.abrupt("return", (response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
99
|
+
return new UserCipherUse(obj, options);
|
100
|
+
})) || []);
|
101
|
+
case 12:
|
102
|
+
case "end":
|
103
|
+
return _context.stop();
|
106
104
|
}
|
107
105
|
}, _callee);
|
108
106
|
})));
|
@@ -60,52 +60,50 @@ var UserRequest = /*#__PURE__*/(0, _createClass2.default)(function UserRequest()
|
|
60
60
|
response,
|
61
61
|
_args = arguments;
|
62
62
|
return _regenerator.default.wrap(function _callee$(_context) {
|
63
|
-
while (1) {
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
if (params['id']) {
|
87
|
-
_context.next = 14;
|
88
|
-
break;
|
89
|
-
}
|
90
|
-
if (!_this.attributes.id) {
|
91
|
-
_context.next = 13;
|
92
|
-
break;
|
93
|
-
}
|
94
|
-
params['id'] = _this.id;
|
63
|
+
while (1) switch (_context.prev = _context.next) {
|
64
|
+
case 0:
|
65
|
+
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
66
|
+
if (_this.attributes.id) {
|
67
|
+
_context.next = 3;
|
68
|
+
break;
|
69
|
+
}
|
70
|
+
throw new errors.EmptyPropertyError('Current object has no id');
|
71
|
+
case 3:
|
72
|
+
if ((0, _utils.isObject)(params)) {
|
73
|
+
_context.next = 5;
|
74
|
+
break;
|
75
|
+
}
|
76
|
+
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
77
|
+
case 5:
|
78
|
+
params.id = _this.attributes.id;
|
79
|
+
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
80
|
+
_context.next = 8;
|
81
|
+
break;
|
82
|
+
}
|
83
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(id)));
|
84
|
+
case 8:
|
85
|
+
if (params['id']) {
|
95
86
|
_context.next = 14;
|
96
87
|
break;
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
88
|
+
}
|
89
|
+
if (!_this.attributes.id) {
|
90
|
+
_context.next = 13;
|
91
|
+
break;
|
92
|
+
}
|
93
|
+
params['id'] = _this.id;
|
94
|
+
_context.next = 14;
|
95
|
+
break;
|
96
|
+
case 13:
|
97
|
+
throw new errors.MissingParameterError('Parameter missing: id');
|
98
|
+
case 14:
|
99
|
+
_context.next = 16;
|
100
|
+
return _Api.default.sendRequest("/user_requests/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
|
101
|
+
case 16:
|
102
|
+
response = _context.sent;
|
103
|
+
return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
|
104
|
+
case 18:
|
105
|
+
case "end":
|
106
|
+
return _context.stop();
|
109
107
|
}
|
110
108
|
}, _callee);
|
111
109
|
})));
|
@@ -142,34 +140,32 @@ var UserRequest = /*#__PURE__*/(0, _createClass2.default)(function UserRequest()
|
|
142
140
|
response,
|
143
141
|
_args2 = arguments;
|
144
142
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
145
|
-
while (1) {
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
return
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
return _context2.stop();
|
172
|
-
}
|
143
|
+
while (1) switch (_context2.prev = _context2.next) {
|
144
|
+
case 0:
|
145
|
+
params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
|
146
|
+
options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
|
147
|
+
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
148
|
+
_context2.next = 4;
|
149
|
+
break;
|
150
|
+
}
|
151
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
152
|
+
case 4:
|
153
|
+
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
154
|
+
_context2.next = 6;
|
155
|
+
break;
|
156
|
+
}
|
157
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
158
|
+
case 6:
|
159
|
+
_context2.next = 8;
|
160
|
+
return _Api.default.sendRequest("/user_requests", 'GET', params, options);
|
161
|
+
case 8:
|
162
|
+
response = _context2.sent;
|
163
|
+
return _context2.abrupt("return", (response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
164
|
+
return new UserRequest(obj, options);
|
165
|
+
})) || []);
|
166
|
+
case 10:
|
167
|
+
case "end":
|
168
|
+
return _context2.stop();
|
173
169
|
}
|
174
170
|
}, _callee2);
|
175
171
|
})));
|
@@ -185,39 +181,37 @@ var UserRequest = /*#__PURE__*/(0, _createClass2.default)(function UserRequest()
|
|
185
181
|
response,
|
186
182
|
_args3 = arguments;
|
187
183
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
188
|
-
while (1) {
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
return _context3.stop();
|
220
|
-
}
|
184
|
+
while (1) switch (_context3.prev = _context3.next) {
|
185
|
+
case 0:
|
186
|
+
params = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
|
187
|
+
options = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : {};
|
188
|
+
if ((0, _utils.isObject)(params)) {
|
189
|
+
_context3.next = 4;
|
190
|
+
break;
|
191
|
+
}
|
192
|
+
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
193
|
+
case 4:
|
194
|
+
params['id'] = id;
|
195
|
+
if (params['id']) {
|
196
|
+
_context3.next = 7;
|
197
|
+
break;
|
198
|
+
}
|
199
|
+
throw new errors.MissingParameterError('Parameter missing: id');
|
200
|
+
case 7:
|
201
|
+
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
202
|
+
_context3.next = 9;
|
203
|
+
break;
|
204
|
+
}
|
205
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
|
206
|
+
case 9:
|
207
|
+
_context3.next = 11;
|
208
|
+
return _Api.default.sendRequest("/user_requests/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
|
209
|
+
case 11:
|
210
|
+
response = _context3.sent;
|
211
|
+
return _context3.abrupt("return", new UserRequest(response === null || response === void 0 ? void 0 : response.data, options));
|
212
|
+
case 13:
|
213
|
+
case "end":
|
214
|
+
return _context3.stop();
|
221
215
|
}
|
222
216
|
}, _callee3);
|
223
217
|
}));
|
@@ -236,56 +230,54 @@ var UserRequest = /*#__PURE__*/(0, _createClass2.default)(function UserRequest()
|
|
236
230
|
response,
|
237
231
|
_args4 = arguments;
|
238
232
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
239
|
-
while (1) {
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
return _context4.stop();
|
288
|
-
}
|
233
|
+
while (1) switch (_context4.prev = _context4.next) {
|
234
|
+
case 0:
|
235
|
+
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
236
|
+
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
237
|
+
if (params['name']) {
|
238
|
+
_context4.next = 4;
|
239
|
+
break;
|
240
|
+
}
|
241
|
+
throw new errors.MissingParameterError('Parameter missing: name');
|
242
|
+
case 4:
|
243
|
+
if (params['email']) {
|
244
|
+
_context4.next = 6;
|
245
|
+
break;
|
246
|
+
}
|
247
|
+
throw new errors.MissingParameterError('Parameter missing: email');
|
248
|
+
case 6:
|
249
|
+
if (params['details']) {
|
250
|
+
_context4.next = 8;
|
251
|
+
break;
|
252
|
+
}
|
253
|
+
throw new errors.MissingParameterError('Parameter missing: details');
|
254
|
+
case 8:
|
255
|
+
if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
|
256
|
+
_context4.next = 10;
|
257
|
+
break;
|
258
|
+
}
|
259
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
|
260
|
+
case 10:
|
261
|
+
if (!(params['email'] && !(0, _utils.isString)(params['email']))) {
|
262
|
+
_context4.next = 12;
|
263
|
+
break;
|
264
|
+
}
|
265
|
+
throw new errors.InvalidParameterError("Bad parameter: email must be of type String, received ".concat((0, _utils.getType)(params['email'])));
|
266
|
+
case 12:
|
267
|
+
if (!(params['details'] && !(0, _utils.isString)(params['details']))) {
|
268
|
+
_context4.next = 14;
|
269
|
+
break;
|
270
|
+
}
|
271
|
+
throw new errors.InvalidParameterError("Bad parameter: details must be of type String, received ".concat((0, _utils.getType)(params['details'])));
|
272
|
+
case 14:
|
273
|
+
_context4.next = 16;
|
274
|
+
return _Api.default.sendRequest("/user_requests", 'POST', params, options);
|
275
|
+
case 16:
|
276
|
+
response = _context4.sent;
|
277
|
+
return _context4.abrupt("return", new UserRequest(response === null || response === void 0 ? void 0 : response.data, options));
|
278
|
+
case 18:
|
279
|
+
case "end":
|
280
|
+
return _context4.stop();
|
289
281
|
}
|
290
282
|
}, _callee4);
|
291
283
|
})));
|
@@ -143,62 +143,60 @@ var WebhookTest = /*#__PURE__*/(0, _createClass2.default)(function WebhookTest()
|
|
143
143
|
response,
|
144
144
|
_args = arguments;
|
145
145
|
return _regenerator.default.wrap(function _callee$(_context) {
|
146
|
-
while (1) {
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
return _context.stop();
|
201
|
-
}
|
146
|
+
while (1) switch (_context.prev = _context.next) {
|
147
|
+
case 0:
|
148
|
+
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
149
|
+
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
150
|
+
if (params['url']) {
|
151
|
+
_context.next = 4;
|
152
|
+
break;
|
153
|
+
}
|
154
|
+
throw new errors.MissingParameterError('Parameter missing: url');
|
155
|
+
case 4:
|
156
|
+
if (!(params['url'] && !(0, _utils.isString)(params['url']))) {
|
157
|
+
_context.next = 6;
|
158
|
+
break;
|
159
|
+
}
|
160
|
+
throw new errors.InvalidParameterError("Bad parameter: url must be of type String, received ".concat((0, _utils.getType)(params['url'])));
|
161
|
+
case 6:
|
162
|
+
if (!(params['method'] && !(0, _utils.isString)(params['method']))) {
|
163
|
+
_context.next = 8;
|
164
|
+
break;
|
165
|
+
}
|
166
|
+
throw new errors.InvalidParameterError("Bad parameter: method must be of type String, received ".concat((0, _utils.getType)(params['method'])));
|
167
|
+
case 8:
|
168
|
+
if (!(params['encoding'] && !(0, _utils.isString)(params['encoding']))) {
|
169
|
+
_context.next = 10;
|
170
|
+
break;
|
171
|
+
}
|
172
|
+
throw new errors.InvalidParameterError("Bad parameter: encoding must be of type String, received ".concat((0, _utils.getType)(params['encoding'])));
|
173
|
+
case 10:
|
174
|
+
if (!(params['raw_body'] && !(0, _utils.isString)(params['raw_body']))) {
|
175
|
+
_context.next = 12;
|
176
|
+
break;
|
177
|
+
}
|
178
|
+
throw new errors.InvalidParameterError("Bad parameter: raw_body must be of type String, received ".concat((0, _utils.getType)(params['raw_body'])));
|
179
|
+
case 12:
|
180
|
+
if (!(params['file_form_field'] && !(0, _utils.isString)(params['file_form_field']))) {
|
181
|
+
_context.next = 14;
|
182
|
+
break;
|
183
|
+
}
|
184
|
+
throw new errors.InvalidParameterError("Bad parameter: file_form_field must be of type String, received ".concat((0, _utils.getType)(params['file_form_field'])));
|
185
|
+
case 14:
|
186
|
+
if (!(params['action'] && !(0, _utils.isString)(params['action']))) {
|
187
|
+
_context.next = 16;
|
188
|
+
break;
|
189
|
+
}
|
190
|
+
throw new errors.InvalidParameterError("Bad parameter: action must be of type String, received ".concat((0, _utils.getType)(params['action'])));
|
191
|
+
case 16:
|
192
|
+
_context.next = 18;
|
193
|
+
return _Api.default.sendRequest("/webhook_tests", 'POST', params, options);
|
194
|
+
case 18:
|
195
|
+
response = _context.sent;
|
196
|
+
return _context.abrupt("return", new WebhookTest(response === null || response === void 0 ? void 0 : response.data, options));
|
197
|
+
case 20:
|
198
|
+
case "end":
|
199
|
+
return _context.stop();
|
202
200
|
}
|
203
201
|
}, _callee);
|
204
202
|
})));
|
package/package.json
CHANGED
@@ -44,6 +44,13 @@ class BundleNotification {
|
|
44
44
|
this.attributes.notify_on_registration = value
|
45
45
|
}
|
46
46
|
|
47
|
+
// boolean # Triggers bundle notification when a upload action occurs for it.
|
48
|
+
getNotifyOnUpload = () => this.attributes.notify_on_upload
|
49
|
+
|
50
|
+
setNotifyOnUpload = value => {
|
51
|
+
this.attributes.notify_on_upload = value
|
52
|
+
}
|
53
|
+
|
47
54
|
// int64 # The id of the user to notify.
|
48
55
|
getUserId = () => this.attributes.user_id
|
49
56
|
|
@@ -52,6 +59,36 @@ class BundleNotification {
|
|
52
59
|
}
|
53
60
|
|
54
61
|
|
62
|
+
// Parameters:
|
63
|
+
// notify_on_registration - boolean - Triggers bundle notification when a registration action occurs for it.
|
64
|
+
// notify_on_upload - boolean - Triggers bundle notification when a upload action occurs for it.
|
65
|
+
update = async (params = {}) => {
|
66
|
+
if (!this.attributes.id) {
|
67
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
68
|
+
}
|
69
|
+
|
70
|
+
if (!isObject(params)) {
|
71
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
72
|
+
}
|
73
|
+
|
74
|
+
params.id = this.attributes.id
|
75
|
+
if (params['id'] && !isInt(params['id'])) {
|
76
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
77
|
+
}
|
78
|
+
|
79
|
+
if (!params['id']) {
|
80
|
+
if (this.attributes.id) {
|
81
|
+
params['id'] = this.id
|
82
|
+
} else {
|
83
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
const response = await Api.sendRequest(`/bundle_notifications/${encodeURIComponent(params['id'])}`, 'PATCH', params, this.options)
|
88
|
+
|
89
|
+
return new BundleNotification(response?.data, this.options)
|
90
|
+
}
|
91
|
+
|
55
92
|
delete = async (params = {}) => {
|
56
93
|
if (!this.attributes.id) {
|
57
94
|
throw new errors.EmptyPropertyError('Current object has no id')
|
@@ -84,7 +121,7 @@ class BundleNotification {
|
|
84
121
|
|
85
122
|
save = () => {
|
86
123
|
if (this.attributes['id']) {
|
87
|
-
|
124
|
+
return this.update(this.attributes)
|
88
125
|
} else {
|
89
126
|
const newObject = BundleNotification.create(this.attributes, this.options)
|
90
127
|
this.attributes = { ...newObject.attributes }
|
@@ -150,6 +187,7 @@ class BundleNotification {
|
|
150
187
|
// Parameters:
|
151
188
|
// user_id (required) - int64 - The id of the user to notify.
|
152
189
|
// notify_on_registration - boolean - Triggers bundle notification when a registration action occurs for it.
|
190
|
+
// notify_on_upload - boolean - Triggers bundle notification when a upload action occurs for it.
|
153
191
|
// bundle_id (required) - int64 - Bundle ID to notify on
|
154
192
|
static create = async (params = {}, options = {}) => {
|
155
193
|
if (!params['user_id']) {
|