files.com 1.0.235 → 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/Bundle.md +9 -2
- package/docs/models/BundleNotification.md +35 -0
- package/docs/models/BundleRegistration.md +3 -1
- package/docs/models/InboxRegistration.md +3 -1
- package/docs/models/Site.md +2 -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 +381 -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 +41 -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 +35 -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 +415 -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/Bundle.js +10 -1
- package/src/models/BundleNotification.js +39 -1
- package/src/models/BundleRegistration.js +3 -0
- package/src/models/InboxRegistration.js +3 -0
- package/src/models/Site.js +3 -0
@@ -63,46 +63,44 @@ var BundleDownload = /*#__PURE__*/(0, _createClass2.default)(function BundleDown
|
|
63
63
|
response,
|
64
64
|
_args = arguments;
|
65
65
|
return _regenerator.default.wrap(function _callee$(_context) {
|
66
|
-
while (1) {
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
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
|
-
}
|
66
|
+
while (1) switch (_context.prev = _context.next) {
|
67
|
+
case 0:
|
68
|
+
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
69
|
+
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
70
|
+
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
71
|
+
_context.next = 4;
|
72
|
+
break;
|
73
|
+
}
|
74
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
75
|
+
case 4:
|
76
|
+
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
77
|
+
_context.next = 6;
|
78
|
+
break;
|
79
|
+
}
|
80
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
81
|
+
case 6:
|
82
|
+
if (!(params['bundle_id'] && !(0, _utils.isInt)(params['bundle_id']))) {
|
83
|
+
_context.next = 8;
|
84
|
+
break;
|
85
|
+
}
|
86
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_id must be of type Int, received ".concat((0, _utils.getType)(params['bundle_id'])));
|
87
|
+
case 8:
|
88
|
+
if (!(params['bundle_registration_id'] && !(0, _utils.isInt)(params['bundle_registration_id']))) {
|
89
|
+
_context.next = 10;
|
90
|
+
break;
|
91
|
+
}
|
92
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_registration_id must be of type Int, received ".concat((0, _utils.getType)(params['bundle_registration_id'])));
|
93
|
+
case 10:
|
94
|
+
_context.next = 12;
|
95
|
+
return _Api.default.sendRequest("/bundle_downloads", 'GET', params, options);
|
96
|
+
case 12:
|
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 BundleDownload(obj, options);
|
100
|
+
})) || []);
|
101
|
+
case 14:
|
102
|
+
case "end":
|
103
|
+
return _context.stop();
|
106
104
|
}
|
107
105
|
}, _callee);
|
108
106
|
})));
|
@@ -49,83 +49,139 @@ var BundleNotification = /*#__PURE__*/(0, _createClass2.default)(function Bundle
|
|
49
49
|
(0, _defineProperty2.default)(this, "setNotifyOnRegistration", function (value) {
|
50
50
|
_this.attributes.notify_on_registration = value;
|
51
51
|
});
|
52
|
+
(0, _defineProperty2.default)(this, "getNotifyOnUpload", function () {
|
53
|
+
return _this.attributes.notify_on_upload;
|
54
|
+
});
|
55
|
+
(0, _defineProperty2.default)(this, "setNotifyOnUpload", function (value) {
|
56
|
+
_this.attributes.notify_on_upload = value;
|
57
|
+
});
|
52
58
|
(0, _defineProperty2.default)(this, "getUserId", function () {
|
53
59
|
return _this.attributes.user_id;
|
54
60
|
});
|
55
61
|
(0, _defineProperty2.default)(this, "setUserId", function (value) {
|
56
62
|
_this.attributes.user_id = value;
|
57
63
|
});
|
58
|
-
(0, _defineProperty2.default)(this, "
|
64
|
+
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
59
65
|
var params,
|
60
66
|
response,
|
61
67
|
_args = arguments;
|
62
68
|
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;
|
69
|
+
while (1) switch (_context.prev = _context.next) {
|
70
|
+
case 0:
|
71
|
+
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
72
|
+
if (_this.attributes.id) {
|
73
|
+
_context.next = 3;
|
74
|
+
break;
|
75
|
+
}
|
76
|
+
throw new errors.EmptyPropertyError('Current object has no id');
|
77
|
+
case 3:
|
78
|
+
if ((0, _utils.isObject)(params)) {
|
79
|
+
_context.next = 5;
|
80
|
+
break;
|
81
|
+
}
|
82
|
+
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
83
|
+
case 5:
|
84
|
+
params.id = _this.attributes.id;
|
85
|
+
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
86
|
+
_context.next = 8;
|
87
|
+
break;
|
88
|
+
}
|
89
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(id)));
|
90
|
+
case 8:
|
91
|
+
if (params['id']) {
|
95
92
|
_context.next = 14;
|
96
93
|
break;
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
94
|
+
}
|
95
|
+
if (!_this.attributes.id) {
|
96
|
+
_context.next = 13;
|
97
|
+
break;
|
98
|
+
}
|
99
|
+
params['id'] = _this.id;
|
100
|
+
_context.next = 14;
|
101
|
+
break;
|
102
|
+
case 13:
|
103
|
+
throw new errors.MissingParameterError('Parameter missing: id');
|
104
|
+
case 14:
|
105
|
+
_context.next = 16;
|
106
|
+
return _Api.default.sendRequest("/bundle_notifications/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
|
107
|
+
case 16:
|
108
|
+
response = _context.sent;
|
109
|
+
return _context.abrupt("return", new BundleNotification(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
110
|
+
case 18:
|
111
|
+
case "end":
|
112
|
+
return _context.stop();
|
109
113
|
}
|
110
114
|
}, _callee);
|
111
115
|
})));
|
116
|
+
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
117
|
+
var params,
|
118
|
+
response,
|
119
|
+
_args2 = arguments;
|
120
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
121
|
+
while (1) switch (_context2.prev = _context2.next) {
|
122
|
+
case 0:
|
123
|
+
params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
|
124
|
+
if (_this.attributes.id) {
|
125
|
+
_context2.next = 3;
|
126
|
+
break;
|
127
|
+
}
|
128
|
+
throw new errors.EmptyPropertyError('Current object has no id');
|
129
|
+
case 3:
|
130
|
+
if ((0, _utils.isObject)(params)) {
|
131
|
+
_context2.next = 5;
|
132
|
+
break;
|
133
|
+
}
|
134
|
+
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
135
|
+
case 5:
|
136
|
+
params.id = _this.attributes.id;
|
137
|
+
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
138
|
+
_context2.next = 8;
|
139
|
+
break;
|
140
|
+
}
|
141
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(id)));
|
142
|
+
case 8:
|
143
|
+
if (params['id']) {
|
144
|
+
_context2.next = 14;
|
145
|
+
break;
|
146
|
+
}
|
147
|
+
if (!_this.attributes.id) {
|
148
|
+
_context2.next = 13;
|
149
|
+
break;
|
150
|
+
}
|
151
|
+
params['id'] = _this.id;
|
152
|
+
_context2.next = 14;
|
153
|
+
break;
|
154
|
+
case 13:
|
155
|
+
throw new errors.MissingParameterError('Parameter missing: id');
|
156
|
+
case 14:
|
157
|
+
_context2.next = 16;
|
158
|
+
return _Api.default.sendRequest("/bundle_notifications/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
|
159
|
+
case 16:
|
160
|
+
response = _context2.sent;
|
161
|
+
return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
|
162
|
+
case 18:
|
163
|
+
case "end":
|
164
|
+
return _context2.stop();
|
165
|
+
}
|
166
|
+
}, _callee2);
|
167
|
+
})));
|
112
168
|
(0, _defineProperty2.default)(this, "destroy", function () {
|
113
169
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
114
170
|
return _this.delete(params);
|
115
171
|
});
|
116
172
|
(0, _defineProperty2.default)(this, "save", function () {
|
117
173
|
if (_this.attributes['id']) {
|
118
|
-
|
174
|
+
return _this.update(_this.attributes);
|
119
175
|
} else {
|
120
176
|
var newObject = BundleNotification.create(_this.attributes, _this.options);
|
121
177
|
_this.attributes = _objectSpread({}, newObject.attributes);
|
122
178
|
return true;
|
123
179
|
}
|
124
180
|
});
|
125
|
-
Object.entries(attributes).forEach(function (
|
126
|
-
var
|
127
|
-
key =
|
128
|
-
value =
|
181
|
+
Object.entries(attributes).forEach(function (_ref3) {
|
182
|
+
var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
|
183
|
+
key = _ref4[0],
|
184
|
+
value = _ref4[1];
|
129
185
|
var normalizedKey = key.replace('?', '');
|
130
186
|
_this.attributes[normalizedKey] = value;
|
131
187
|
Object.defineProperty(_this, normalizedKey, {
|
@@ -135,55 +191,53 @@ var BundleNotification = /*#__PURE__*/(0, _createClass2.default)(function Bundle
|
|
135
191
|
});
|
136
192
|
this.options = _objectSpread({}, options);
|
137
193
|
});
|
138
|
-
(0, _defineProperty2.default)(BundleNotification, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
194
|
+
(0, _defineProperty2.default)(BundleNotification, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
139
195
|
var _response$data;
|
140
196
|
var params,
|
141
197
|
options,
|
142
198
|
response,
|
143
|
-
|
144
|
-
return _regenerator.default.wrap(function
|
145
|
-
while (1) {
|
146
|
-
|
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
|
-
return
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
return _context2.stop();
|
184
|
-
}
|
199
|
+
_args3 = arguments;
|
200
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
201
|
+
while (1) switch (_context3.prev = _context3.next) {
|
202
|
+
case 0:
|
203
|
+
params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
204
|
+
options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
|
205
|
+
if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
|
206
|
+
_context3.next = 4;
|
207
|
+
break;
|
208
|
+
}
|
209
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
|
210
|
+
case 4:
|
211
|
+
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
212
|
+
_context3.next = 6;
|
213
|
+
break;
|
214
|
+
}
|
215
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
216
|
+
case 6:
|
217
|
+
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
218
|
+
_context3.next = 8;
|
219
|
+
break;
|
220
|
+
}
|
221
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
222
|
+
case 8:
|
223
|
+
if (!(params['bundle_id'] && !(0, _utils.isInt)(params['bundle_id']))) {
|
224
|
+
_context3.next = 10;
|
225
|
+
break;
|
226
|
+
}
|
227
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_id must be of type Int, received ".concat((0, _utils.getType)(params['bundle_id'])));
|
228
|
+
case 10:
|
229
|
+
_context3.next = 12;
|
230
|
+
return _Api.default.sendRequest("/bundle_notifications", 'GET', params, options);
|
231
|
+
case 12:
|
232
|
+
response = _context3.sent;
|
233
|
+
return _context3.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) {
|
234
|
+
return new BundleNotification(obj, options);
|
235
|
+
})) || []);
|
236
|
+
case 14:
|
237
|
+
case "end":
|
238
|
+
return _context3.stop();
|
185
239
|
}
|
186
|
-
},
|
240
|
+
}, _callee3);
|
187
241
|
})));
|
188
242
|
(0, _defineProperty2.default)(BundleNotification, "all", function () {
|
189
243
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
@@ -191,103 +245,99 @@ var BundleNotification = /*#__PURE__*/(0, _createClass2.default)(function Bundle
|
|
191
245
|
return BundleNotification.list(params, options);
|
192
246
|
});
|
193
247
|
(0, _defineProperty2.default)(BundleNotification, "find", /*#__PURE__*/function () {
|
194
|
-
var
|
248
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(id) {
|
195
249
|
var params,
|
196
250
|
options,
|
197
251
|
response,
|
198
|
-
|
199
|
-
return _regenerator.default.wrap(function
|
200
|
-
while (1) {
|
201
|
-
switch (_context3.prev = _context3.next) {
|
202
|
-
case 0:
|
203
|
-
params = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
|
204
|
-
options = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : {};
|
205
|
-
if ((0, _utils.isObject)(params)) {
|
206
|
-
_context3.next = 4;
|
207
|
-
break;
|
208
|
-
}
|
209
|
-
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
210
|
-
case 4:
|
211
|
-
params['id'] = id;
|
212
|
-
if (params['id']) {
|
213
|
-
_context3.next = 7;
|
214
|
-
break;
|
215
|
-
}
|
216
|
-
throw new errors.MissingParameterError('Parameter missing: id');
|
217
|
-
case 7:
|
218
|
-
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
219
|
-
_context3.next = 9;
|
220
|
-
break;
|
221
|
-
}
|
222
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
|
223
|
-
case 9:
|
224
|
-
_context3.next = 11;
|
225
|
-
return _Api.default.sendRequest("/bundle_notifications/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
|
226
|
-
case 11:
|
227
|
-
response = _context3.sent;
|
228
|
-
return _context3.abrupt("return", new BundleNotification(response === null || response === void 0 ? void 0 : response.data, options));
|
229
|
-
case 13:
|
230
|
-
case "end":
|
231
|
-
return _context3.stop();
|
232
|
-
}
|
233
|
-
}
|
234
|
-
}, _callee3);
|
235
|
-
}));
|
236
|
-
return function (_x) {
|
237
|
-
return _ref5.apply(this, arguments);
|
238
|
-
};
|
239
|
-
}());
|
240
|
-
(0, _defineProperty2.default)(BundleNotification, "get", function (id) {
|
241
|
-
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
242
|
-
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
243
|
-
return BundleNotification.find(id, params, options);
|
244
|
-
});
|
245
|
-
(0, _defineProperty2.default)(BundleNotification, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
246
|
-
var params,
|
247
|
-
options,
|
248
|
-
response,
|
249
|
-
_args4 = arguments;
|
250
|
-
return _regenerator.default.wrap(function _callee4$(_context4) {
|
251
|
-
while (1) {
|
252
|
-
switch (_context4.prev = _context4.next) {
|
252
|
+
_args4 = arguments;
|
253
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
254
|
+
while (1) switch (_context4.prev = _context4.next) {
|
253
255
|
case 0:
|
254
|
-
params = _args4.length >
|
255
|
-
options = _args4.length >
|
256
|
-
if (params
|
256
|
+
params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
257
|
+
options = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
|
258
|
+
if ((0, _utils.isObject)(params)) {
|
257
259
|
_context4.next = 4;
|
258
260
|
break;
|
259
261
|
}
|
260
|
-
throw new errors.
|
262
|
+
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
261
263
|
case 4:
|
262
|
-
|
263
|
-
|
264
|
+
params['id'] = id;
|
265
|
+
if (params['id']) {
|
266
|
+
_context4.next = 7;
|
264
267
|
break;
|
265
268
|
}
|
266
|
-
throw new errors.MissingParameterError('Parameter missing:
|
267
|
-
case
|
268
|
-
if (!(params['
|
269
|
-
_context4.next =
|
270
|
-
break;
|
271
|
-
}
|
272
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
|
273
|
-
case 8:
|
274
|
-
if (!(params['bundle_id'] && !(0, _utils.isInt)(params['bundle_id']))) {
|
275
|
-
_context4.next = 10;
|
269
|
+
throw new errors.MissingParameterError('Parameter missing: id');
|
270
|
+
case 7:
|
271
|
+
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
272
|
+
_context4.next = 9;
|
276
273
|
break;
|
277
274
|
}
|
278
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
279
|
-
case
|
280
|
-
_context4.next =
|
281
|
-
return _Api.default.sendRequest("/bundle_notifications", '
|
282
|
-
case
|
275
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
|
276
|
+
case 9:
|
277
|
+
_context4.next = 11;
|
278
|
+
return _Api.default.sendRequest("/bundle_notifications/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
|
279
|
+
case 11:
|
283
280
|
response = _context4.sent;
|
284
281
|
return _context4.abrupt("return", new BundleNotification(response === null || response === void 0 ? void 0 : response.data, options));
|
285
|
-
case
|
282
|
+
case 13:
|
286
283
|
case "end":
|
287
284
|
return _context4.stop();
|
288
285
|
}
|
286
|
+
}, _callee4);
|
287
|
+
}));
|
288
|
+
return function (_x) {
|
289
|
+
return _ref6.apply(this, arguments);
|
290
|
+
};
|
291
|
+
}());
|
292
|
+
(0, _defineProperty2.default)(BundleNotification, "get", function (id) {
|
293
|
+
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
294
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
295
|
+
return BundleNotification.find(id, params, options);
|
296
|
+
});
|
297
|
+
(0, _defineProperty2.default)(BundleNotification, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
298
|
+
var params,
|
299
|
+
options,
|
300
|
+
response,
|
301
|
+
_args5 = arguments;
|
302
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
303
|
+
while (1) switch (_context5.prev = _context5.next) {
|
304
|
+
case 0:
|
305
|
+
params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
306
|
+
options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
307
|
+
if (params['user_id']) {
|
308
|
+
_context5.next = 4;
|
309
|
+
break;
|
310
|
+
}
|
311
|
+
throw new errors.MissingParameterError('Parameter missing: user_id');
|
312
|
+
case 4:
|
313
|
+
if (params['bundle_id']) {
|
314
|
+
_context5.next = 6;
|
315
|
+
break;
|
316
|
+
}
|
317
|
+
throw new errors.MissingParameterError('Parameter missing: bundle_id');
|
318
|
+
case 6:
|
319
|
+
if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
|
320
|
+
_context5.next = 8;
|
321
|
+
break;
|
322
|
+
}
|
323
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
|
324
|
+
case 8:
|
325
|
+
if (!(params['bundle_id'] && !(0, _utils.isInt)(params['bundle_id']))) {
|
326
|
+
_context5.next = 10;
|
327
|
+
break;
|
328
|
+
}
|
329
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_id must be of type Int, received ".concat((0, _utils.getType)(params['bundle_id'])));
|
330
|
+
case 10:
|
331
|
+
_context5.next = 12;
|
332
|
+
return _Api.default.sendRequest("/bundle_notifications", 'POST', params, options);
|
333
|
+
case 12:
|
334
|
+
response = _context5.sent;
|
335
|
+
return _context5.abrupt("return", new BundleNotification(response === null || response === void 0 ? void 0 : response.data, options));
|
336
|
+
case 14:
|
337
|
+
case "end":
|
338
|
+
return _context5.stop();
|
289
339
|
}
|
290
|
-
},
|
340
|
+
}, _callee5);
|
291
341
|
})));
|
292
342
|
var _default = BundleNotification;
|
293
343
|
exports.default = _default;
|