files.com 1.0.231 → 1.0.233
Sign up to get free protection for your applications and to get access to all the features.
- package/_VERSION +1 -1
- package/docs/models/BundleNotification.md +84 -0
- package/docs/models/Site.md +8 -0
- package/docs/models/User.md +8 -2
- package/lib/models/BundleNotification.js +293 -0
- package/lib/models/Site.js +89 -71
- package/lib/models/User.js +12 -0
- package/package.json +1 -1
- package/src/models/BundleNotification.js +177 -0
- package/src/models/Site.js +16 -0
- package/src/models/User.js +14 -0
package/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.233
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# BundleNotification
|
2
|
+
|
3
|
+
## Example BundleNotification Object
|
4
|
+
|
5
|
+
```
|
6
|
+
{
|
7
|
+
"bundle_id": 1,
|
8
|
+
"id": 1,
|
9
|
+
"notify_on_registration": true,
|
10
|
+
"user_id": 1
|
11
|
+
}
|
12
|
+
```
|
13
|
+
|
14
|
+
* `bundle_id` (int64): Bundle ID to notify on
|
15
|
+
* `id` (int64): Bundle Notification ID
|
16
|
+
* `notify_on_registration` (boolean): Triggers bundle notification when a registration action occurs for it.
|
17
|
+
* `user_id` (int64): The id of the user to notify.
|
18
|
+
|
19
|
+
---
|
20
|
+
|
21
|
+
## List Bundle Notifications
|
22
|
+
|
23
|
+
```
|
24
|
+
await BundleNotification.list({
|
25
|
+
'user_id': 1,
|
26
|
+
'per_page': 1,
|
27
|
+
'bundle_id': 1,
|
28
|
+
})
|
29
|
+
```
|
30
|
+
|
31
|
+
|
32
|
+
### Parameters
|
33
|
+
|
34
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
35
|
+
* `cursor` (string): Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
|
36
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
37
|
+
* `bundle_id` (int64): Bundle ID to notify on
|
38
|
+
|
39
|
+
---
|
40
|
+
|
41
|
+
## Show Bundle Notification
|
42
|
+
|
43
|
+
```
|
44
|
+
await BundleNotification.find(id)
|
45
|
+
```
|
46
|
+
|
47
|
+
|
48
|
+
### Parameters
|
49
|
+
|
50
|
+
* `id` (int64): Required - Bundle Notification ID.
|
51
|
+
|
52
|
+
---
|
53
|
+
|
54
|
+
## Create Bundle Notification
|
55
|
+
|
56
|
+
```
|
57
|
+
await BundleNotification.create({
|
58
|
+
'user_id': 1,
|
59
|
+
'notify_on_registration': true,
|
60
|
+
'bundle_id': 1,
|
61
|
+
})
|
62
|
+
```
|
63
|
+
|
64
|
+
|
65
|
+
### Parameters
|
66
|
+
|
67
|
+
* `user_id` (int64): Required - The id of the user to notify.
|
68
|
+
* `notify_on_registration` (boolean): Triggers bundle notification when a registration action occurs for it.
|
69
|
+
* `bundle_id` (int64): Required - Bundle ID to notify on
|
70
|
+
|
71
|
+
---
|
72
|
+
|
73
|
+
## Delete Bundle Notification
|
74
|
+
|
75
|
+
```
|
76
|
+
const [bundle_notification] = await BundleNotification.list()
|
77
|
+
|
78
|
+
await bundle_notification.delete()
|
79
|
+
```
|
80
|
+
|
81
|
+
### Parameters
|
82
|
+
|
83
|
+
* `id` (int64): Required - Bundle Notification ID.
|
84
|
+
|
package/docs/models/Site.md
CHANGED
@@ -16,10 +16,12 @@
|
|
16
16
|
"allowed_countries": "US,DE",
|
17
17
|
"allowed_ips": "example",
|
18
18
|
"ask_about_overwrites": true,
|
19
|
+
"bundle_activity_notifications": "never",
|
19
20
|
"bundle_expiration": 1,
|
20
21
|
"bundle_password_required": true,
|
21
22
|
"bundle_registration_notifications": "never",
|
22
23
|
"bundle_require_share_recipient": true,
|
24
|
+
"bundle_upload_receipt_notifications": "never",
|
23
25
|
"bundle_watermark_attachment": "",
|
24
26
|
"bundle_watermark_value": {
|
25
27
|
"key": "example value"
|
@@ -159,10 +161,12 @@
|
|
159
161
|
* `allowed_countries` (string): Comma seperated list of allowed Country codes
|
160
162
|
* `allowed_ips` (string): List of allowed IP addresses
|
161
163
|
* `ask_about_overwrites` (boolean): If false, rename conflicting files instead of asking for overwrite confirmation. Only applies to web interface.
|
164
|
+
* `bundle_activity_notifications` (string): Do Bundle owners receive activity notifications?
|
162
165
|
* `bundle_expiration` (int64): Site-wide Bundle expiration in days
|
163
166
|
* `bundle_password_required` (boolean): Do Bundles require password protection?
|
164
167
|
* `bundle_registration_notifications` (string): Do Bundle owners receive registration notification?
|
165
168
|
* `bundle_require_share_recipient` (boolean): Do Bundles require recipients for sharing?
|
169
|
+
* `bundle_upload_receipt_notifications` (string): Do Bundle uploaders receive upload confirmation notifications?
|
166
170
|
* `bundle_watermark_attachment` (Image): Preview watermark image applied to all bundle items.
|
167
171
|
* `bundle_watermark_value` (object): Preview watermark settings applied to all bundle items. Uses the same keys as Behavior.value
|
168
172
|
* `color2_left` (string): Page link and button color
|
@@ -371,6 +375,8 @@ await Site.update({
|
|
371
375
|
'bundle_password_required': true,
|
372
376
|
'bundle_require_share_recipient': true,
|
373
377
|
'bundle_registration_notifications': "never",
|
378
|
+
'bundle_activity_notifications': "never",
|
379
|
+
'bundle_upload_receipt_notifications': "never",
|
374
380
|
'password_requirements_apply_to_bundles': true,
|
375
381
|
'opt_out_global': true,
|
376
382
|
'use_provided_modified_at': true,
|
@@ -497,6 +503,8 @@ await Site.update({
|
|
497
503
|
* `bundle_password_required` (boolean): Do Bundles require password protection?
|
498
504
|
* `bundle_require_share_recipient` (boolean): Do Bundles require recipients for sharing?
|
499
505
|
* `bundle_registration_notifications` (string): Do Bundle owners receive registration notification?
|
506
|
+
* `bundle_activity_notifications` (string): Do Bundle owners receive activity notifications?
|
507
|
+
* `bundle_upload_receipt_notifications` (string): Do Bundle uploaders receive upload confirmation notifications?
|
500
508
|
* `password_requirements_apply_to_bundles` (boolean): Require bundles' passwords, and passwords for other items (inboxes, public shares, etc.) to conform to the same requirements as users' passwords?
|
501
509
|
* `opt_out_global` (boolean): Use servers in the USA only?
|
502
510
|
* `use_provided_modified_at` (boolean): Allow uploaders to set `provided_modified_at` for uploaded files?
|
package/docs/models/User.md
CHANGED
@@ -63,7 +63,9 @@
|
|
63
63
|
"time_zone": "Pacific Time (US & Canada)",
|
64
64
|
"type_of_2fa": "yubi",
|
65
65
|
"updated_at": "2000-01-01T01:00:00Z",
|
66
|
-
"user_root": "example"
|
66
|
+
"user_root": "example",
|
67
|
+
"days_remaining_until_password_expire": "2000-01-01T01:00:00Z",
|
68
|
+
"password_expire_at": "2000-01-01T01:00:00Z"
|
67
69
|
}
|
68
70
|
```
|
69
71
|
|
@@ -125,6 +127,8 @@
|
|
125
127
|
* `type_of_2fa` (string): Type(s) of 2FA methods in use. Will be either `sms`, `totp`, `u2f`, `yubi`, or multiple values sorted alphabetically and joined by an underscore.
|
126
128
|
* `updated_at` (date-time): User record most recently updated at. Note this may be incremented because of internal or external updates.
|
127
129
|
* `user_root` (string): Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set.) Note that this is not used for API, Desktop, or Web interface.
|
130
|
+
* `days_remaining_until_password_expire` (date-time): Number of days remaining until password expires
|
131
|
+
* `password_expire_at` (date-time): Password expiration datetime
|
128
132
|
* `avatar_file` (file): An image file for your user avatar.
|
129
133
|
* `avatar_delete` (boolean): If true, the avatar will be deleted.
|
130
134
|
* `change_password` (string): Used for changing a password on an existing user.
|
@@ -479,7 +483,9 @@ await user.update({
|
|
479
483
|
"time_zone": "Pacific Time (US & Canada)",
|
480
484
|
"type_of_2fa": "yubi",
|
481
485
|
"updated_at": "2000-01-01T01:00:00Z",
|
482
|
-
"user_root": "example"
|
486
|
+
"user_root": "example",
|
487
|
+
"days_remaining_until_password_expire": "2000-01-01T01:00:00Z",
|
488
|
+
"password_expire_at": "2000-01-01T01:00:00Z"
|
483
489
|
}
|
484
490
|
```
|
485
491
|
|
@@ -0,0 +1,293 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports.default = void 0;
|
7
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
11
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
13
|
+
var _Api = _interopRequireDefault(require("../Api"));
|
14
|
+
var errors = _interopRequireWildcard(require("../Errors"));
|
15
|
+
var _Logger = _interopRequireDefault(require("../Logger"));
|
16
|
+
var _utils = require("../utils");
|
17
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
19
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
21
|
+
/**
|
22
|
+
* Class BundleNotification
|
23
|
+
*/
|
24
|
+
var BundleNotification = /*#__PURE__*/(0, _createClass2.default)(function BundleNotification() {
|
25
|
+
var _this = this;
|
26
|
+
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
27
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
28
|
+
(0, _classCallCheck2.default)(this, BundleNotification);
|
29
|
+
(0, _defineProperty2.default)(this, "attributes", {});
|
30
|
+
(0, _defineProperty2.default)(this, "options", {});
|
31
|
+
(0, _defineProperty2.default)(this, "isLoaded", function () {
|
32
|
+
return !!_this.attributes.id;
|
33
|
+
});
|
34
|
+
(0, _defineProperty2.default)(this, "getBundleId", function () {
|
35
|
+
return _this.attributes.bundle_id;
|
36
|
+
});
|
37
|
+
(0, _defineProperty2.default)(this, "setBundleId", function (value) {
|
38
|
+
_this.attributes.bundle_id = value;
|
39
|
+
});
|
40
|
+
(0, _defineProperty2.default)(this, "getId", function () {
|
41
|
+
return _this.attributes.id;
|
42
|
+
});
|
43
|
+
(0, _defineProperty2.default)(this, "setId", function (value) {
|
44
|
+
_this.attributes.id = value;
|
45
|
+
});
|
46
|
+
(0, _defineProperty2.default)(this, "getNotifyOnRegistration", function () {
|
47
|
+
return _this.attributes.notify_on_registration;
|
48
|
+
});
|
49
|
+
(0, _defineProperty2.default)(this, "setNotifyOnRegistration", function (value) {
|
50
|
+
_this.attributes.notify_on_registration = value;
|
51
|
+
});
|
52
|
+
(0, _defineProperty2.default)(this, "getUserId", function () {
|
53
|
+
return _this.attributes.user_id;
|
54
|
+
});
|
55
|
+
(0, _defineProperty2.default)(this, "setUserId", function (value) {
|
56
|
+
_this.attributes.user_id = value;
|
57
|
+
});
|
58
|
+
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
59
|
+
var params,
|
60
|
+
response,
|
61
|
+
_args = arguments;
|
62
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
63
|
+
while (1) {
|
64
|
+
switch (_context.prev = _context.next) {
|
65
|
+
case 0:
|
66
|
+
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
67
|
+
if (_this.attributes.id) {
|
68
|
+
_context.next = 3;
|
69
|
+
break;
|
70
|
+
}
|
71
|
+
throw new errors.EmptyPropertyError('Current object has no id');
|
72
|
+
case 3:
|
73
|
+
if ((0, _utils.isObject)(params)) {
|
74
|
+
_context.next = 5;
|
75
|
+
break;
|
76
|
+
}
|
77
|
+
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
78
|
+
case 5:
|
79
|
+
params.id = _this.attributes.id;
|
80
|
+
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
81
|
+
_context.next = 8;
|
82
|
+
break;
|
83
|
+
}
|
84
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(id)));
|
85
|
+
case 8:
|
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;
|
95
|
+
_context.next = 14;
|
96
|
+
break;
|
97
|
+
case 13:
|
98
|
+
throw new errors.MissingParameterError('Parameter missing: id');
|
99
|
+
case 14:
|
100
|
+
_context.next = 16;
|
101
|
+
return _Api.default.sendRequest("/bundle_notifications/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
|
102
|
+
case 16:
|
103
|
+
response = _context.sent;
|
104
|
+
return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
|
105
|
+
case 18:
|
106
|
+
case "end":
|
107
|
+
return _context.stop();
|
108
|
+
}
|
109
|
+
}
|
110
|
+
}, _callee);
|
111
|
+
})));
|
112
|
+
(0, _defineProperty2.default)(this, "destroy", function () {
|
113
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
114
|
+
return _this.delete(params);
|
115
|
+
});
|
116
|
+
(0, _defineProperty2.default)(this, "save", function () {
|
117
|
+
if (_this.attributes['id']) {
|
118
|
+
throw new errors.NotImplementedError('The BundleNotification object doesn\'t support updates.');
|
119
|
+
} else {
|
120
|
+
var newObject = BundleNotification.create(_this.attributes, _this.options);
|
121
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
122
|
+
return true;
|
123
|
+
}
|
124
|
+
});
|
125
|
+
Object.entries(attributes).forEach(function (_ref2) {
|
126
|
+
var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
|
127
|
+
key = _ref3[0],
|
128
|
+
value = _ref3[1];
|
129
|
+
var normalizedKey = key.replace('?', '');
|
130
|
+
_this.attributes[normalizedKey] = value;
|
131
|
+
Object.defineProperty(_this, normalizedKey, {
|
132
|
+
value: value,
|
133
|
+
writable: false
|
134
|
+
});
|
135
|
+
});
|
136
|
+
this.options = _objectSpread({}, options);
|
137
|
+
});
|
138
|
+
(0, _defineProperty2.default)(BundleNotification, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
139
|
+
var _response$data;
|
140
|
+
var params,
|
141
|
+
options,
|
142
|
+
response,
|
143
|
+
_args2 = arguments;
|
144
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
145
|
+
while (1) {
|
146
|
+
switch (_context2.prev = _context2.next) {
|
147
|
+
case 0:
|
148
|
+
params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
|
149
|
+
options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
|
150
|
+
if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
|
151
|
+
_context2.next = 4;
|
152
|
+
break;
|
153
|
+
}
|
154
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
|
155
|
+
case 4:
|
156
|
+
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
157
|
+
_context2.next = 6;
|
158
|
+
break;
|
159
|
+
}
|
160
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
161
|
+
case 6:
|
162
|
+
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
163
|
+
_context2.next = 8;
|
164
|
+
break;
|
165
|
+
}
|
166
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
167
|
+
case 8:
|
168
|
+
if (!(params['bundle_id'] && !(0, _utils.isInt)(params['bundle_id']))) {
|
169
|
+
_context2.next = 10;
|
170
|
+
break;
|
171
|
+
}
|
172
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_id must be of type Int, received ".concat((0, _utils.getType)(params['bundle_id'])));
|
173
|
+
case 10:
|
174
|
+
_context2.next = 12;
|
175
|
+
return _Api.default.sendRequest("/bundle_notifications", 'GET', params, options);
|
176
|
+
case 12:
|
177
|
+
response = _context2.sent;
|
178
|
+
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) {
|
179
|
+
return new BundleNotification(obj, options);
|
180
|
+
})) || []);
|
181
|
+
case 14:
|
182
|
+
case "end":
|
183
|
+
return _context2.stop();
|
184
|
+
}
|
185
|
+
}
|
186
|
+
}, _callee2);
|
187
|
+
})));
|
188
|
+
(0, _defineProperty2.default)(BundleNotification, "all", function () {
|
189
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
190
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
191
|
+
return BundleNotification.list(params, options);
|
192
|
+
});
|
193
|
+
(0, _defineProperty2.default)(BundleNotification, "find", /*#__PURE__*/function () {
|
194
|
+
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(id) {
|
195
|
+
var params,
|
196
|
+
options,
|
197
|
+
response,
|
198
|
+
_args3 = arguments;
|
199
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
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) {
|
253
|
+
case 0:
|
254
|
+
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
255
|
+
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
256
|
+
if (params['user_id']) {
|
257
|
+
_context4.next = 4;
|
258
|
+
break;
|
259
|
+
}
|
260
|
+
throw new errors.MissingParameterError('Parameter missing: user_id');
|
261
|
+
case 4:
|
262
|
+
if (params['bundle_id']) {
|
263
|
+
_context4.next = 6;
|
264
|
+
break;
|
265
|
+
}
|
266
|
+
throw new errors.MissingParameterError('Parameter missing: bundle_id');
|
267
|
+
case 6:
|
268
|
+
if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
|
269
|
+
_context4.next = 8;
|
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;
|
276
|
+
break;
|
277
|
+
}
|
278
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_id must be of type Int, received ".concat((0, _utils.getType)(params['bundle_id'])));
|
279
|
+
case 10:
|
280
|
+
_context4.next = 12;
|
281
|
+
return _Api.default.sendRequest("/bundle_notifications", 'POST', params, options);
|
282
|
+
case 12:
|
283
|
+
response = _context4.sent;
|
284
|
+
return _context4.abrupt("return", new BundleNotification(response === null || response === void 0 ? void 0 : response.data, options));
|
285
|
+
case 14:
|
286
|
+
case "end":
|
287
|
+
return _context4.stop();
|
288
|
+
}
|
289
|
+
}
|
290
|
+
}, _callee4);
|
291
|
+
})));
|
292
|
+
var _default = BundleNotification;
|
293
|
+
exports.default = _default;
|
package/lib/models/Site.js
CHANGED
@@ -67,6 +67,9 @@ var Site = /*#__PURE__*/(0, _createClass2.default)(function Site() {
|
|
67
67
|
(0, _defineProperty2.default)(this, "getAskAboutOverwrites", function () {
|
68
68
|
return _this.attributes.ask_about_overwrites;
|
69
69
|
});
|
70
|
+
(0, _defineProperty2.default)(this, "getBundleActivityNotifications", function () {
|
71
|
+
return _this.attributes.bundle_activity_notifications;
|
72
|
+
});
|
70
73
|
(0, _defineProperty2.default)(this, "getBundleExpiration", function () {
|
71
74
|
return _this.attributes.bundle_expiration;
|
72
75
|
});
|
@@ -79,6 +82,9 @@ var Site = /*#__PURE__*/(0, _createClass2.default)(function Site() {
|
|
79
82
|
(0, _defineProperty2.default)(this, "getBundleRequireShareRecipient", function () {
|
80
83
|
return _this.attributes.bundle_require_share_recipient;
|
81
84
|
});
|
85
|
+
(0, _defineProperty2.default)(this, "getBundleUploadReceiptNotifications", function () {
|
86
|
+
return _this.attributes.bundle_upload_receipt_notifications;
|
87
|
+
});
|
82
88
|
(0, _defineProperty2.default)(this, "getBundleWatermarkAttachment", function () {
|
83
89
|
return _this.attributes.bundle_watermark_attachment;
|
84
90
|
});
|
@@ -673,216 +679,228 @@ var Site = /*#__PURE__*/(0, _createClass2.default)(function Site() {
|
|
673
679
|
}
|
674
680
|
throw new errors.InvalidParameterError("Bad parameter: bundle_registration_notifications must be of type String, received ".concat((0, _utils.getType)(params['bundle_registration_notifications'])));
|
675
681
|
case 56:
|
676
|
-
if (!(params['
|
682
|
+
if (!(params['bundle_activity_notifications'] && !(0, _utils.isString)(params['bundle_activity_notifications']))) {
|
677
683
|
_context3.next = 58;
|
678
684
|
break;
|
679
685
|
}
|
680
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
686
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_activity_notifications must be of type String, received ".concat((0, _utils.getType)(params['bundle_activity_notifications'])));
|
681
687
|
case 58:
|
682
|
-
if (!(params['
|
688
|
+
if (!(params['bundle_upload_receipt_notifications'] && !(0, _utils.isString)(params['bundle_upload_receipt_notifications']))) {
|
683
689
|
_context3.next = 60;
|
684
690
|
break;
|
685
691
|
}
|
686
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
692
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_upload_receipt_notifications must be of type String, received ".concat((0, _utils.getType)(params['bundle_upload_receipt_notifications'])));
|
687
693
|
case 60:
|
688
|
-
if (!(params['
|
694
|
+
if (!(params['disable_users_from_inactivity_period_days'] && !(0, _utils.isInt)(params['disable_users_from_inactivity_period_days']))) {
|
689
695
|
_context3.next = 62;
|
690
696
|
break;
|
691
697
|
}
|
692
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
698
|
+
throw new errors.InvalidParameterError("Bad parameter: disable_users_from_inactivity_period_days must be of type Int, received ".concat((0, _utils.getType)(params['disable_users_from_inactivity_period_days'])));
|
693
699
|
case 62:
|
694
|
-
if (!(params['
|
700
|
+
if (!(params['sftp_host_key_type'] && !(0, _utils.isString)(params['sftp_host_key_type']))) {
|
695
701
|
_context3.next = 64;
|
696
702
|
break;
|
697
703
|
}
|
698
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
704
|
+
throw new errors.InvalidParameterError("Bad parameter: sftp_host_key_type must be of type String, received ".concat((0, _utils.getType)(params['sftp_host_key_type'])));
|
699
705
|
case 64:
|
700
|
-
if (!(params['
|
706
|
+
if (!(params['active_sftp_host_key_id'] && !(0, _utils.isInt)(params['active_sftp_host_key_id']))) {
|
701
707
|
_context3.next = 66;
|
702
708
|
break;
|
703
709
|
}
|
704
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
710
|
+
throw new errors.InvalidParameterError("Bad parameter: active_sftp_host_key_id must be of type Int, received ".concat((0, _utils.getType)(params['active_sftp_host_key_id'])));
|
705
711
|
case 66:
|
706
|
-
if (!(params['
|
712
|
+
if (!(params['require_2fa_user_type'] && !(0, _utils.isString)(params['require_2fa_user_type']))) {
|
707
713
|
_context3.next = 68;
|
708
714
|
break;
|
709
715
|
}
|
710
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
716
|
+
throw new errors.InvalidParameterError("Bad parameter: require_2fa_user_type must be of type String, received ".concat((0, _utils.getType)(params['require_2fa_user_type'])));
|
711
717
|
case 68:
|
712
|
-
if (!(params['
|
718
|
+
if (!(params['color2_top'] && !(0, _utils.isString)(params['color2_top']))) {
|
713
719
|
_context3.next = 70;
|
714
720
|
break;
|
715
721
|
}
|
716
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
722
|
+
throw new errors.InvalidParameterError("Bad parameter: color2_top must be of type String, received ".concat((0, _utils.getType)(params['color2_top'])));
|
717
723
|
case 70:
|
718
|
-
if (!(params['
|
724
|
+
if (!(params['color2_left'] && !(0, _utils.isString)(params['color2_left']))) {
|
719
725
|
_context3.next = 72;
|
720
726
|
break;
|
721
727
|
}
|
722
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
728
|
+
throw new errors.InvalidParameterError("Bad parameter: color2_left must be of type String, received ".concat((0, _utils.getType)(params['color2_left'])));
|
723
729
|
case 72:
|
724
|
-
if (!(params['
|
730
|
+
if (!(params['color2_link'] && !(0, _utils.isString)(params['color2_link']))) {
|
725
731
|
_context3.next = 74;
|
726
732
|
break;
|
727
733
|
}
|
728
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
734
|
+
throw new errors.InvalidParameterError("Bad parameter: color2_link must be of type String, received ".concat((0, _utils.getType)(params['color2_link'])));
|
729
735
|
case 74:
|
730
|
-
if (!(params['
|
736
|
+
if (!(params['color2_text'] && !(0, _utils.isString)(params['color2_text']))) {
|
731
737
|
_context3.next = 76;
|
732
738
|
break;
|
733
739
|
}
|
734
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
740
|
+
throw new errors.InvalidParameterError("Bad parameter: color2_text must be of type String, received ".concat((0, _utils.getType)(params['color2_text'])));
|
735
741
|
case 76:
|
736
|
-
if (!(params['
|
742
|
+
if (!(params['color2_top_text'] && !(0, _utils.isString)(params['color2_top_text']))) {
|
737
743
|
_context3.next = 78;
|
738
744
|
break;
|
739
745
|
}
|
740
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
746
|
+
throw new errors.InvalidParameterError("Bad parameter: color2_top_text must be of type String, received ".concat((0, _utils.getType)(params['color2_top_text'])));
|
741
747
|
case 78:
|
742
|
-
if (!(params['
|
748
|
+
if (!(params['site_header'] && !(0, _utils.isString)(params['site_header']))) {
|
743
749
|
_context3.next = 80;
|
744
750
|
break;
|
745
751
|
}
|
746
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
752
|
+
throw new errors.InvalidParameterError("Bad parameter: site_header must be of type String, received ".concat((0, _utils.getType)(params['site_header'])));
|
747
753
|
case 80:
|
748
|
-
if (!(params['
|
754
|
+
if (!(params['site_footer'] && !(0, _utils.isString)(params['site_footer']))) {
|
749
755
|
_context3.next = 82;
|
750
756
|
break;
|
751
757
|
}
|
752
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
758
|
+
throw new errors.InvalidParameterError("Bad parameter: site_footer must be of type String, received ".concat((0, _utils.getType)(params['site_footer'])));
|
753
759
|
case 82:
|
754
|
-
if (!(params['
|
760
|
+
if (!(params['login_help_text'] && !(0, _utils.isString)(params['login_help_text']))) {
|
755
761
|
_context3.next = 84;
|
756
762
|
break;
|
757
763
|
}
|
758
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
764
|
+
throw new errors.InvalidParameterError("Bad parameter: login_help_text must be of type String, received ".concat((0, _utils.getType)(params['login_help_text'])));
|
759
765
|
case 84:
|
760
|
-
if (!(params['
|
766
|
+
if (!(params['smtp_address'] && !(0, _utils.isString)(params['smtp_address']))) {
|
761
767
|
_context3.next = 86;
|
762
768
|
break;
|
763
769
|
}
|
764
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
770
|
+
throw new errors.InvalidParameterError("Bad parameter: smtp_address must be of type String, received ".concat((0, _utils.getType)(params['smtp_address'])));
|
765
771
|
case 86:
|
766
|
-
if (!(params['
|
772
|
+
if (!(params['smtp_authentication'] && !(0, _utils.isString)(params['smtp_authentication']))) {
|
767
773
|
_context3.next = 88;
|
768
774
|
break;
|
769
775
|
}
|
770
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
776
|
+
throw new errors.InvalidParameterError("Bad parameter: smtp_authentication must be of type String, received ".concat((0, _utils.getType)(params['smtp_authentication'])));
|
771
777
|
case 88:
|
772
|
-
if (!(params['
|
778
|
+
if (!(params['smtp_from'] && !(0, _utils.isString)(params['smtp_from']))) {
|
773
779
|
_context3.next = 90;
|
774
780
|
break;
|
775
781
|
}
|
776
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
782
|
+
throw new errors.InvalidParameterError("Bad parameter: smtp_from must be of type String, received ".concat((0, _utils.getType)(params['smtp_from'])));
|
777
783
|
case 90:
|
778
|
-
if (!(params['
|
784
|
+
if (!(params['smtp_username'] && !(0, _utils.isString)(params['smtp_username']))) {
|
779
785
|
_context3.next = 92;
|
780
786
|
break;
|
781
787
|
}
|
782
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
788
|
+
throw new errors.InvalidParameterError("Bad parameter: smtp_username must be of type String, received ".concat((0, _utils.getType)(params['smtp_username'])));
|
783
789
|
case 92:
|
784
|
-
if (!(params['
|
790
|
+
if (!(params['smtp_port'] && !(0, _utils.isInt)(params['smtp_port']))) {
|
785
791
|
_context3.next = 94;
|
786
792
|
break;
|
787
793
|
}
|
788
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
794
|
+
throw new errors.InvalidParameterError("Bad parameter: smtp_port must be of type Int, received ".concat((0, _utils.getType)(params['smtp_port'])));
|
789
795
|
case 94:
|
790
|
-
if (!(params['
|
796
|
+
if (!(params['ldap_type'] && !(0, _utils.isString)(params['ldap_type']))) {
|
791
797
|
_context3.next = 96;
|
792
798
|
break;
|
793
799
|
}
|
794
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
800
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_type must be of type String, received ".concat((0, _utils.getType)(params['ldap_type'])));
|
795
801
|
case 96:
|
796
|
-
if (!(params['
|
802
|
+
if (!(params['ldap_host'] && !(0, _utils.isString)(params['ldap_host']))) {
|
797
803
|
_context3.next = 98;
|
798
804
|
break;
|
799
805
|
}
|
800
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
806
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_host must be of type String, received ".concat((0, _utils.getType)(params['ldap_host'])));
|
801
807
|
case 98:
|
802
|
-
if (!(params['
|
808
|
+
if (!(params['ldap_host_2'] && !(0, _utils.isString)(params['ldap_host_2']))) {
|
803
809
|
_context3.next = 100;
|
804
810
|
break;
|
805
811
|
}
|
806
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
812
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_host_2 must be of type String, received ".concat((0, _utils.getType)(params['ldap_host_2'])));
|
807
813
|
case 100:
|
808
|
-
if (!(params['
|
814
|
+
if (!(params['ldap_host_3'] && !(0, _utils.isString)(params['ldap_host_3']))) {
|
809
815
|
_context3.next = 102;
|
810
816
|
break;
|
811
817
|
}
|
812
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
818
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_host_3 must be of type String, received ".concat((0, _utils.getType)(params['ldap_host_3'])));
|
813
819
|
case 102:
|
814
|
-
if (!(params['
|
820
|
+
if (!(params['ldap_port'] && !(0, _utils.isInt)(params['ldap_port']))) {
|
815
821
|
_context3.next = 104;
|
816
822
|
break;
|
817
823
|
}
|
818
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
824
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_port must be of type Int, received ".concat((0, _utils.getType)(params['ldap_port'])));
|
819
825
|
case 104:
|
820
|
-
if (!(params['
|
826
|
+
if (!(params['ldap_username'] && !(0, _utils.isString)(params['ldap_username']))) {
|
821
827
|
_context3.next = 106;
|
822
828
|
break;
|
823
829
|
}
|
824
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
830
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_username must be of type String, received ".concat((0, _utils.getType)(params['ldap_username'])));
|
825
831
|
case 106:
|
826
|
-
if (!(params['
|
832
|
+
if (!(params['ldap_username_field'] && !(0, _utils.isString)(params['ldap_username_field']))) {
|
827
833
|
_context3.next = 108;
|
828
834
|
break;
|
829
835
|
}
|
830
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
836
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_username_field must be of type String, received ".concat((0, _utils.getType)(params['ldap_username_field'])));
|
831
837
|
case 108:
|
832
|
-
if (!(params['
|
838
|
+
if (!(params['ldap_domain'] && !(0, _utils.isString)(params['ldap_domain']))) {
|
833
839
|
_context3.next = 110;
|
834
840
|
break;
|
835
841
|
}
|
836
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
842
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_domain must be of type String, received ".concat((0, _utils.getType)(params['ldap_domain'])));
|
837
843
|
case 110:
|
838
|
-
if (!(params['
|
844
|
+
if (!(params['ldap_user_action'] && !(0, _utils.isString)(params['ldap_user_action']))) {
|
839
845
|
_context3.next = 112;
|
840
846
|
break;
|
841
847
|
}
|
842
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
848
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_user_action must be of type String, received ".concat((0, _utils.getType)(params['ldap_user_action'])));
|
843
849
|
case 112:
|
844
|
-
if (!(params['
|
850
|
+
if (!(params['ldap_group_action'] && !(0, _utils.isString)(params['ldap_group_action']))) {
|
845
851
|
_context3.next = 114;
|
846
852
|
break;
|
847
853
|
}
|
848
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
854
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_group_action must be of type String, received ".concat((0, _utils.getType)(params['ldap_group_action'])));
|
849
855
|
case 114:
|
850
|
-
if (!(params['
|
856
|
+
if (!(params['ldap_user_include_groups'] && !(0, _utils.isString)(params['ldap_user_include_groups']))) {
|
851
857
|
_context3.next = 116;
|
852
858
|
break;
|
853
859
|
}
|
854
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
860
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_user_include_groups must be of type String, received ".concat((0, _utils.getType)(params['ldap_user_include_groups'])));
|
855
861
|
case 116:
|
856
|
-
if (!(params['
|
862
|
+
if (!(params['ldap_group_exclusion'] && !(0, _utils.isString)(params['ldap_group_exclusion']))) {
|
857
863
|
_context3.next = 118;
|
858
864
|
break;
|
859
865
|
}
|
860
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
866
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_group_exclusion must be of type String, received ".concat((0, _utils.getType)(params['ldap_group_exclusion'])));
|
861
867
|
case 118:
|
862
|
-
if (!(params['
|
868
|
+
if (!(params['ldap_group_inclusion'] && !(0, _utils.isString)(params['ldap_group_inclusion']))) {
|
863
869
|
_context3.next = 120;
|
864
870
|
break;
|
865
871
|
}
|
866
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
872
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_group_inclusion must be of type String, received ".concat((0, _utils.getType)(params['ldap_group_inclusion'])));
|
867
873
|
case 120:
|
868
|
-
if (!(params['
|
874
|
+
if (!(params['ldap_base_dn'] && !(0, _utils.isString)(params['ldap_base_dn']))) {
|
869
875
|
_context3.next = 122;
|
870
876
|
break;
|
871
877
|
}
|
872
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
878
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_base_dn must be of type String, received ".concat((0, _utils.getType)(params['ldap_base_dn'])));
|
873
879
|
case 122:
|
874
|
-
if (!(params['
|
880
|
+
if (!(params['ldap_password_change'] && !(0, _utils.isString)(params['ldap_password_change']))) {
|
875
881
|
_context3.next = 124;
|
876
882
|
break;
|
877
883
|
}
|
878
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
884
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_password_change must be of type String, received ".concat((0, _utils.getType)(params['ldap_password_change'])));
|
879
885
|
case 124:
|
880
|
-
|
881
|
-
|
886
|
+
if (!(params['ldap_password_change_confirmation'] && !(0, _utils.isString)(params['ldap_password_change_confirmation']))) {
|
887
|
+
_context3.next = 126;
|
888
|
+
break;
|
889
|
+
}
|
890
|
+
throw new errors.InvalidParameterError("Bad parameter: ldap_password_change_confirmation must be of type String, received ".concat((0, _utils.getType)(params['ldap_password_change_confirmation'])));
|
882
891
|
case 126:
|
892
|
+
if (!(params['smtp_password'] && !(0, _utils.isString)(params['smtp_password']))) {
|
893
|
+
_context3.next = 128;
|
894
|
+
break;
|
895
|
+
}
|
896
|
+
throw new errors.InvalidParameterError("Bad parameter: smtp_password must be of type String, received ".concat((0, _utils.getType)(params['smtp_password'])));
|
897
|
+
case 128:
|
898
|
+
_context3.next = 130;
|
899
|
+
return _Api.default.sendRequest("/site", 'PATCH', params, options);
|
900
|
+
case 130:
|
883
901
|
response = _context3.sent;
|
884
902
|
return _context3.abrupt("return", new Site(response === null || response === void 0 ? void 0 : response.data, options));
|
885
|
-
case
|
903
|
+
case 132:
|
886
904
|
case "end":
|
887
905
|
return _context3.stop();
|
888
906
|
}
|
package/lib/models/User.js
CHANGED
@@ -373,6 +373,18 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
|
|
373
373
|
(0, _defineProperty2.default)(this, "setUserRoot", function (value) {
|
374
374
|
_this.attributes.user_root = value;
|
375
375
|
});
|
376
|
+
(0, _defineProperty2.default)(this, "getDaysRemainingUntilPasswordExpire", function () {
|
377
|
+
return _this.attributes.days_remaining_until_password_expire;
|
378
|
+
});
|
379
|
+
(0, _defineProperty2.default)(this, "setDaysRemainingUntilPasswordExpire", function (value) {
|
380
|
+
_this.attributes.days_remaining_until_password_expire = value;
|
381
|
+
});
|
382
|
+
(0, _defineProperty2.default)(this, "getPasswordExpireAt", function () {
|
383
|
+
return _this.attributes.password_expire_at;
|
384
|
+
});
|
385
|
+
(0, _defineProperty2.default)(this, "setPasswordExpireAt", function (value) {
|
386
|
+
_this.attributes.password_expire_at = value;
|
387
|
+
});
|
376
388
|
(0, _defineProperty2.default)(this, "getAvatarFile", function () {
|
377
389
|
return _this.attributes.avatar_file;
|
378
390
|
});
|
package/package.json
CHANGED
@@ -0,0 +1,177 @@
|
|
1
|
+
import Api from '../Api'
|
2
|
+
import * as errors from '../Errors'
|
3
|
+
import Logger from '../Logger'
|
4
|
+
import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Class BundleNotification
|
8
|
+
*/
|
9
|
+
class BundleNotification {
|
10
|
+
attributes = {}
|
11
|
+
options = {}
|
12
|
+
|
13
|
+
constructor(attributes = {}, options = {}) {
|
14
|
+
Object.entries(attributes).forEach(([key, value]) => {
|
15
|
+
const normalizedKey = key.replace('?', '')
|
16
|
+
|
17
|
+
this.attributes[normalizedKey] = value
|
18
|
+
|
19
|
+
Object.defineProperty(this, normalizedKey, { value, writable: false })
|
20
|
+
})
|
21
|
+
|
22
|
+
this.options = { ...options }
|
23
|
+
}
|
24
|
+
|
25
|
+
isLoaded = () => !!this.attributes.id
|
26
|
+
// int64 # Bundle ID to notify on
|
27
|
+
getBundleId = () => this.attributes.bundle_id
|
28
|
+
|
29
|
+
setBundleId = value => {
|
30
|
+
this.attributes.bundle_id = value
|
31
|
+
}
|
32
|
+
|
33
|
+
// int64 # Bundle Notification ID
|
34
|
+
getId = () => this.attributes.id
|
35
|
+
|
36
|
+
setId = value => {
|
37
|
+
this.attributes.id = value
|
38
|
+
}
|
39
|
+
|
40
|
+
// boolean # Triggers bundle notification when a registration action occurs for it.
|
41
|
+
getNotifyOnRegistration = () => this.attributes.notify_on_registration
|
42
|
+
|
43
|
+
setNotifyOnRegistration = value => {
|
44
|
+
this.attributes.notify_on_registration = value
|
45
|
+
}
|
46
|
+
|
47
|
+
// int64 # The id of the user to notify.
|
48
|
+
getUserId = () => this.attributes.user_id
|
49
|
+
|
50
|
+
setUserId = value => {
|
51
|
+
this.attributes.user_id = value
|
52
|
+
}
|
53
|
+
|
54
|
+
|
55
|
+
delete = async (params = {}) => {
|
56
|
+
if (!this.attributes.id) {
|
57
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
58
|
+
}
|
59
|
+
|
60
|
+
if (!isObject(params)) {
|
61
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
62
|
+
}
|
63
|
+
|
64
|
+
params.id = this.attributes.id
|
65
|
+
if (params['id'] && !isInt(params['id'])) {
|
66
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
67
|
+
}
|
68
|
+
|
69
|
+
if (!params['id']) {
|
70
|
+
if (this.attributes.id) {
|
71
|
+
params['id'] = this.id
|
72
|
+
} else {
|
73
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
const response = await Api.sendRequest(`/bundle_notifications/${encodeURIComponent(params['id'])}`, 'DELETE', params, this.options)
|
78
|
+
|
79
|
+
return response?.data
|
80
|
+
}
|
81
|
+
|
82
|
+
destroy = (params = {}) =>
|
83
|
+
this.delete(params)
|
84
|
+
|
85
|
+
save = () => {
|
86
|
+
if (this.attributes['id']) {
|
87
|
+
throw new errors.NotImplementedError('The BundleNotification object doesn\'t support updates.')
|
88
|
+
} else {
|
89
|
+
const newObject = BundleNotification.create(this.attributes, this.options)
|
90
|
+
this.attributes = { ...newObject.attributes }
|
91
|
+
return true
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
// Parameters:
|
96
|
+
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
97
|
+
// cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
|
98
|
+
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
99
|
+
// bundle_id - int64 - Bundle ID to notify on
|
100
|
+
static list = async (params = {}, options = {}) => {
|
101
|
+
if (params['user_id'] && !isInt(params['user_id'])) {
|
102
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params['user_id'])}`)
|
103
|
+
}
|
104
|
+
|
105
|
+
if (params['cursor'] && !isString(params['cursor'])) {
|
106
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params['cursor'])}`)
|
107
|
+
}
|
108
|
+
|
109
|
+
if (params['per_page'] && !isInt(params['per_page'])) {
|
110
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params['per_page'])}`)
|
111
|
+
}
|
112
|
+
|
113
|
+
if (params['bundle_id'] && !isInt(params['bundle_id'])) {
|
114
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_id must be of type Int, received ${getType(params['bundle_id'])}`)
|
115
|
+
}
|
116
|
+
|
117
|
+
const response = await Api.sendRequest(`/bundle_notifications`, 'GET', params, options)
|
118
|
+
|
119
|
+
return response?.data?.map(obj => new BundleNotification(obj, options)) || []
|
120
|
+
}
|
121
|
+
|
122
|
+
static all = (params = {}, options = {}) =>
|
123
|
+
BundleNotification.list(params, options)
|
124
|
+
|
125
|
+
// Parameters:
|
126
|
+
// id (required) - int64 - Bundle Notification ID.
|
127
|
+
static find = async (id, params = {}, options = {}) => {
|
128
|
+
if (!isObject(params)) {
|
129
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
130
|
+
}
|
131
|
+
|
132
|
+
params['id'] = id
|
133
|
+
|
134
|
+
if (!params['id']) {
|
135
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
136
|
+
}
|
137
|
+
|
138
|
+
if (params['id'] && !isInt(params['id'])) {
|
139
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
140
|
+
}
|
141
|
+
|
142
|
+
const response = await Api.sendRequest(`/bundle_notifications/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
143
|
+
|
144
|
+
return new BundleNotification(response?.data, options)
|
145
|
+
}
|
146
|
+
|
147
|
+
static get = (id, params = {}, options = {}) =>
|
148
|
+
BundleNotification.find(id, params, options)
|
149
|
+
|
150
|
+
// Parameters:
|
151
|
+
// user_id (required) - int64 - The id of the user to notify.
|
152
|
+
// notify_on_registration - boolean - Triggers bundle notification when a registration action occurs for it.
|
153
|
+
// bundle_id (required) - int64 - Bundle ID to notify on
|
154
|
+
static create = async (params = {}, options = {}) => {
|
155
|
+
if (!params['user_id']) {
|
156
|
+
throw new errors.MissingParameterError('Parameter missing: user_id')
|
157
|
+
}
|
158
|
+
|
159
|
+
if (!params['bundle_id']) {
|
160
|
+
throw new errors.MissingParameterError('Parameter missing: bundle_id')
|
161
|
+
}
|
162
|
+
|
163
|
+
if (params['user_id'] && !isInt(params['user_id'])) {
|
164
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params['user_id'])}`)
|
165
|
+
}
|
166
|
+
|
167
|
+
if (params['bundle_id'] && !isInt(params['bundle_id'])) {
|
168
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_id must be of type Int, received ${getType(params['bundle_id'])}`)
|
169
|
+
}
|
170
|
+
|
171
|
+
const response = await Api.sendRequest(`/bundle_notifications`, 'POST', params, options)
|
172
|
+
|
173
|
+
return new BundleNotification(response?.data, options)
|
174
|
+
}
|
175
|
+
}
|
176
|
+
|
177
|
+
export default BundleNotification
|
package/src/models/Site.js
CHANGED
@@ -59,6 +59,9 @@ class Site {
|
|
59
59
|
// boolean # If false, rename conflicting files instead of asking for overwrite confirmation. Only applies to web interface.
|
60
60
|
getAskAboutOverwrites = () => this.attributes.ask_about_overwrites
|
61
61
|
|
62
|
+
// string # Do Bundle owners receive activity notifications?
|
63
|
+
getBundleActivityNotifications = () => this.attributes.bundle_activity_notifications
|
64
|
+
|
62
65
|
// int64 # Site-wide Bundle expiration in days
|
63
66
|
getBundleExpiration = () => this.attributes.bundle_expiration
|
64
67
|
|
@@ -71,6 +74,9 @@ class Site {
|
|
71
74
|
// boolean # Do Bundles require recipients for sharing?
|
72
75
|
getBundleRequireShareRecipient = () => this.attributes.bundle_require_share_recipient
|
73
76
|
|
77
|
+
// string # Do Bundle uploaders receive upload confirmation notifications?
|
78
|
+
getBundleUploadReceiptNotifications = () => this.attributes.bundle_upload_receipt_notifications
|
79
|
+
|
74
80
|
// Image # Preview watermark image applied to all bundle items.
|
75
81
|
getBundleWatermarkAttachment = () => this.attributes.bundle_watermark_attachment
|
76
82
|
|
@@ -512,6 +518,8 @@ class Site {
|
|
512
518
|
// bundle_password_required - boolean - Do Bundles require password protection?
|
513
519
|
// bundle_require_share_recipient - boolean - Do Bundles require recipients for sharing?
|
514
520
|
// bundle_registration_notifications - string - Do Bundle owners receive registration notification?
|
521
|
+
// bundle_activity_notifications - string - Do Bundle owners receive activity notifications?
|
522
|
+
// bundle_upload_receipt_notifications - string - Do Bundle uploaders receive upload confirmation notifications?
|
515
523
|
// password_requirements_apply_to_bundles - boolean - Require bundles' passwords, and passwords for other items (inboxes, public shares, etc.) to conform to the same requirements as users' passwords?
|
516
524
|
// opt_out_global - boolean - Use servers in the USA only?
|
517
525
|
// use_provided_modified_at - boolean - Allow uploaders to set `provided_modified_at` for uploaded files?
|
@@ -689,6 +697,14 @@ class Site {
|
|
689
697
|
throw new errors.InvalidParameterError(`Bad parameter: bundle_registration_notifications must be of type String, received ${getType(params['bundle_registration_notifications'])}`)
|
690
698
|
}
|
691
699
|
|
700
|
+
if (params['bundle_activity_notifications'] && !isString(params['bundle_activity_notifications'])) {
|
701
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_activity_notifications must be of type String, received ${getType(params['bundle_activity_notifications'])}`)
|
702
|
+
}
|
703
|
+
|
704
|
+
if (params['bundle_upload_receipt_notifications'] && !isString(params['bundle_upload_receipt_notifications'])) {
|
705
|
+
throw new errors.InvalidParameterError(`Bad parameter: bundle_upload_receipt_notifications must be of type String, received ${getType(params['bundle_upload_receipt_notifications'])}`)
|
706
|
+
}
|
707
|
+
|
692
708
|
if (params['disable_users_from_inactivity_period_days'] && !isInt(params['disable_users_from_inactivity_period_days'])) {
|
693
709
|
throw new errors.InvalidParameterError(`Bad parameter: disable_users_from_inactivity_period_days must be of type Int, received ${getType(params['disable_users_from_inactivity_period_days'])}`)
|
694
710
|
}
|
package/src/models/User.js
CHANGED
@@ -421,6 +421,20 @@ class User {
|
|
421
421
|
this.attributes.user_root = value
|
422
422
|
}
|
423
423
|
|
424
|
+
// date-time # Number of days remaining until password expires
|
425
|
+
getDaysRemainingUntilPasswordExpire = () => this.attributes.days_remaining_until_password_expire
|
426
|
+
|
427
|
+
setDaysRemainingUntilPasswordExpire = value => {
|
428
|
+
this.attributes.days_remaining_until_password_expire = value
|
429
|
+
}
|
430
|
+
|
431
|
+
// date-time # Password expiration datetime
|
432
|
+
getPasswordExpireAt = () => this.attributes.password_expire_at
|
433
|
+
|
434
|
+
setPasswordExpireAt = value => {
|
435
|
+
this.attributes.password_expire_at = value
|
436
|
+
}
|
437
|
+
|
424
438
|
// file # An image file for your user avatar.
|
425
439
|
getAvatarFile = () => this.attributes.avatar_file
|
426
440
|
|