Skip to content

Commit 5b20d23

Browse files
[Bot] push changes from Files.com
1 parent 74cb347 commit 5b20d23

10 files changed

Lines changed: 405 additions & 4 deletions

File tree

_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.624
1+
1.2.625

docs/models/Site.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ await Site.update({
700700
'bundle_watermark_attachment_delete': false,
701701
'login_page_background_image_delete': false,
702702
'disable_2fa_with_delay': false,
703+
'redirect_old_subdomain': false,
703704
})
704705
```
705706

@@ -881,4 +882,5 @@ await Site.update({
881882
* `disable_2fa_with_delay` (boolean): If set to true, we will begin the process of disabling 2FA on this site.
882883
* `ldap_password_change` (string): New LDAP password.
883884
* `ldap_password_change_confirmation` (string): Confirm new LDAP password.
885+
* `redirect_old_subdomain` (boolean): If true, and if changing the site subdomain, then create a redirect from the previous Files.com subdomain to the new Files.com subdomain.
884886
* `smtp_password` (string): Password for SMTP server.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# SiteSubdomainRedirect
2+
3+
## Example SiteSubdomainRedirect Object
4+
5+
```
6+
{
7+
"id": 1,
8+
"subdomain": "old-company",
9+
"created_at": "2000-01-01T01:00:00Z",
10+
"updated_at": "2000-01-01T01:00:00Z"
11+
}
12+
```
13+
14+
* `id` (int64): Site subdomain redirect ID.
15+
* `subdomain` (string): Files.com subdomain that continues to route to the current site subdomain.
16+
* `created_at` (date-time): When this redirect was created.
17+
* `updated_at` (date-time): When this redirect was last updated.
18+
19+
---
20+
21+
## List Site Subdomain Redirects
22+
23+
```
24+
await SiteSubdomainRedirect.list
25+
```
26+
27+
28+
### Parameters
29+
30+
* `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
31+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
32+
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `id`.
33+
34+
---
35+
36+
## Show Site Subdomain Redirect
37+
38+
```
39+
await SiteSubdomainRedirect.find(id)
40+
```
41+
42+
43+
### Parameters
44+
45+
* `id` (int64): Required - Site Subdomain Redirect ID.
46+
47+
---
48+
49+
## Delete Site Subdomain Redirect
50+
51+
```
52+
const site_subdomain_redirect = await SiteSubdomainRedirect.find(id)
53+
54+
await site_subdomain_redirect.delete()
55+
```
56+
57+
### Parameters
58+
59+
* `id` (int64): Required - Site Subdomain Redirect ID.
60+

lib/Files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var apiKey;
1212
var baseUrl = 'https://app.files.com';
1313
var sessionId = null;
1414
var language = null;
15-
var version = '1.2.624';
15+
var version = '1.2.625';
1616
var userAgent = "Files.com JavaScript SDK v".concat(version);
1717
var logLevel = _Logger.LogLevel.INFO;
1818
var debugRequest = false;

lib/models/Site.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,7 @@ _Site = Site;
994994
// disable_2fa_with_delay - boolean - If set to true, we will begin the process of disabling 2FA on this site.
995995
// ldap_password_change - string - New LDAP password.
996996
// ldap_password_change_confirmation - string - Confirm new LDAP password.
997+
// redirect_old_subdomain - boolean - If true, and if changing the site subdomain, then create a redirect from the previous Files.com subdomain to the new Files.com subdomain.
997998
// smtp_password - string - Password for SMTP server.
998999
(0, _defineProperty2.default)(Site, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
9991000
var params,
Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
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 _utils = require("../utils");
16+
var _SiteSubdomainRedirect;
17+
/* eslint-disable no-unused-vars */
18+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
19+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
20+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
21+
/* eslint-enable no-unused-vars */
22+
/**
23+
* Class SiteSubdomainRedirect
24+
*/
25+
var SiteSubdomainRedirect = /*#__PURE__*/(0, _createClass2.default)(function SiteSubdomainRedirect() {
26+
var _this = this;
27+
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
28+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
29+
(0, _classCallCheck2.default)(this, SiteSubdomainRedirect);
30+
(0, _defineProperty2.default)(this, "attributes", {});
31+
(0, _defineProperty2.default)(this, "options", {});
32+
(0, _defineProperty2.default)(this, "isLoaded", function () {
33+
return !!_this.attributes.id;
34+
});
35+
// int64 # Site subdomain redirect ID.
36+
(0, _defineProperty2.default)(this, "getId", function () {
37+
return _this.attributes.id;
38+
});
39+
// string # Files.com subdomain that continues to route to the current site subdomain.
40+
(0, _defineProperty2.default)(this, "getSubdomain", function () {
41+
return _this.attributes.subdomain;
42+
});
43+
// date-time # When this redirect was created.
44+
(0, _defineProperty2.default)(this, "getCreatedAt", function () {
45+
return _this.attributes.created_at;
46+
});
47+
// date-time # When this redirect was last updated.
48+
(0, _defineProperty2.default)(this, "getUpdatedAt", function () {
49+
return _this.attributes.updated_at;
50+
});
51+
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
52+
var params,
53+
_args = arguments;
54+
return _regenerator.default.wrap(function (_context) {
55+
while (1) switch (_context.prev = _context.next) {
56+
case 0:
57+
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
58+
if (_this.attributes.id) {
59+
_context.next = 1;
60+
break;
61+
}
62+
throw new errors.EmptyPropertyError('Current object has no id');
63+
case 1:
64+
if ((0, _utils.isObject)(params)) {
65+
_context.next = 2;
66+
break;
67+
}
68+
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
69+
case 2:
70+
params.id = _this.attributes.id;
71+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
72+
_context.next = 3;
73+
break;
74+
}
75+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
76+
case 3:
77+
if (params.id) {
78+
_context.next = 5;
79+
break;
80+
}
81+
if (!_this.attributes.id) {
82+
_context.next = 4;
83+
break;
84+
}
85+
params.id = _this.id;
86+
_context.next = 5;
87+
break;
88+
case 4:
89+
throw new errors.MissingParameterError('Parameter missing: id');
90+
case 5:
91+
_context.next = 6;
92+
return _Api.default.sendRequest("/site_subdomain_redirects/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
93+
case 6:
94+
case "end":
95+
return _context.stop();
96+
}
97+
}, _callee);
98+
})));
99+
(0, _defineProperty2.default)(this, "destroy", function () {
100+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
101+
return _this.delete(params);
102+
});
103+
Object.entries(attributes).forEach(function (_ref2) {
104+
var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
105+
key = _ref3[0],
106+
value = _ref3[1];
107+
var normalizedKey = key.replace('?', '');
108+
_this.attributes[normalizedKey] = value;
109+
Object.defineProperty(_this, normalizedKey, {
110+
value: value,
111+
writable: false
112+
});
113+
});
114+
this.options = _objectSpread({}, options);
115+
});
116+
_SiteSubdomainRedirect = SiteSubdomainRedirect;
117+
// Parameters:
118+
// cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
119+
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
120+
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `id`.
121+
(0, _defineProperty2.default)(SiteSubdomainRedirect, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
122+
var _response$data;
123+
var params,
124+
options,
125+
response,
126+
_args2 = arguments;
127+
return _regenerator.default.wrap(function (_context2) {
128+
while (1) switch (_context2.prev = _context2.next) {
129+
case 0:
130+
params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
131+
options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
132+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
133+
_context2.next = 1;
134+
break;
135+
}
136+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
137+
case 1:
138+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
139+
_context2.next = 2;
140+
break;
141+
}
142+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
143+
case 2:
144+
_context2.next = 3;
145+
return _Api.default.sendRequest('/site_subdomain_redirects', 'GET', params, options);
146+
case 3:
147+
response = _context2.sent;
148+
return _context2.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
149+
return new _SiteSubdomainRedirect(obj, options);
150+
})) || []);
151+
case 4:
152+
case "end":
153+
return _context2.stop();
154+
}
155+
}, _callee2);
156+
})));
157+
(0, _defineProperty2.default)(SiteSubdomainRedirect, "all", function () {
158+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
159+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
160+
return _SiteSubdomainRedirect.list(params, options);
161+
});
162+
// Parameters:
163+
// id (required) - int64 - Site Subdomain Redirect ID.
164+
(0, _defineProperty2.default)(SiteSubdomainRedirect, "find", /*#__PURE__*/function () {
165+
var _ref5 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(id) {
166+
var params,
167+
options,
168+
response,
169+
_args3 = arguments;
170+
return _regenerator.default.wrap(function (_context3) {
171+
while (1) switch (_context3.prev = _context3.next) {
172+
case 0:
173+
params = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
174+
options = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : {};
175+
if ((0, _utils.isObject)(params)) {
176+
_context3.next = 1;
177+
break;
178+
}
179+
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
180+
case 1:
181+
params.id = id;
182+
if (params.id) {
183+
_context3.next = 2;
184+
break;
185+
}
186+
throw new errors.MissingParameterError('Parameter missing: id');
187+
case 2:
188+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
189+
_context3.next = 3;
190+
break;
191+
}
192+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
193+
case 3:
194+
_context3.next = 4;
195+
return _Api.default.sendRequest("/site_subdomain_redirects/".concat(encodeURIComponent(params.id)), 'GET', params, options);
196+
case 4:
197+
response = _context3.sent;
198+
return _context3.abrupt("return", new _SiteSubdomainRedirect(response === null || response === void 0 ? void 0 : response.data, options));
199+
case 5:
200+
case "end":
201+
return _context3.stop();
202+
}
203+
}, _callee3);
204+
}));
205+
return function (_x) {
206+
return _ref5.apply(this, arguments);
207+
};
208+
}());
209+
(0, _defineProperty2.default)(SiteSubdomainRedirect, "get", function (id) {
210+
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
211+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
212+
return _SiteSubdomainRedirect.find(id, params, options);
213+
});
214+
var _default = exports.default = SiteSubdomainRedirect;
215+
module.exports = SiteSubdomainRedirect;
216+
module.exports.default = SiteSubdomainRedirect;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "files.com",
3-
"version": "1.2.624",
3+
"version": "1.2.625",
44
"description": "Files.com SDK for JavaScript",
55
"keywords": [
66
"files.com",

src/Files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let apiKey
66
let baseUrl = 'https://app.files.com'
77
let sessionId = null
88
let language = null
9-
const version = '1.2.624'
9+
const version = '1.2.625'
1010
let userAgent = `Files.com JavaScript SDK v${version}`
1111

1212
let logLevel = LogLevel.INFO

src/models/Site.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ class Site {
766766
// disable_2fa_with_delay - boolean - If set to true, we will begin the process of disabling 2FA on this site.
767767
// ldap_password_change - string - New LDAP password.
768768
// ldap_password_change_confirmation - string - Confirm new LDAP password.
769+
// redirect_old_subdomain - boolean - If true, and if changing the site subdomain, then create a redirect from the previous Files.com subdomain to the new Files.com subdomain.
769770
// smtp_password - string - Password for SMTP server.
770771
static update = async (params = {}, options = {}) => {
771772
if (params.name && !isString(params.name)) {

0 commit comments

Comments
 (0)