Skip to content

Commit cf6172e

Browse files
[Bot] push changes from Files.com
1 parent 15b41ba commit cf6172e

7 files changed

Lines changed: 48 additions & 40 deletions

File tree

_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.599
1+
1.2.600

docs/models/Style.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"id": 1,
88
"path": "example",
99
"logo": "https://mysite.files.com/...",
10+
"logo_click_href": "https://www.example.com",
1011
"thumbnail": {
1112
"name": "My logo",
1213
"uri": "https://mysite.files.com/.../my_image.png"
@@ -17,8 +18,9 @@
1718
* `id` (int64): Style ID
1819
* `path` (string): Folder path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
1920
* `logo` (Image): Logo
21+
* `logo_click_href` (string): URL to open when a public visitor clicks the logo
2022
* `thumbnail` (Image): Logo thumbnail
21-
* `file` (file): Logo for custom branding.
23+
* `file` (file): Logo for custom branding. Required when creating a new style.
2224

2325
---
2426

@@ -41,14 +43,15 @@ await Style.find(path)
4143
const style = await Style.find(path)
4244
4345
await style.update({
44-
'file': "file",
46+
'logo_click_href': "https://www.example.com",
4547
})
4648
```
4749

4850
### Parameters
4951

5052
* `path` (string): Required - Style path.
51-
* `file` (file): Required - Logo for custom branding.
53+
* `file` (file): Logo for custom branding. Required when creating a new style.
54+
* `logo_click_href` (string): URL to open when a public visitor clicks the logo.
5255

5356
### Example Response
5457

@@ -57,6 +60,7 @@ await style.update({
5760
"id": 1,
5861
"path": "example",
5962
"logo": "https://mysite.files.com/...",
63+
"logo_click_href": "https://www.example.com",
6064
"thumbnail": {
6165
"name": "My logo",
6266
"uri": "https://mysite.files.com/.../my_image.png"

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.599';
15+
var version = '1.2.600';
1616
var userAgent = "Files.com JavaScript SDK v".concat(version);
1717
var logLevel = _Logger.LogLevel.INFO;
1818
var debugRequest = false;

lib/models/Style.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,30 @@ var Style = /*#__PURE__*/(0, _createClass2.default)(function Style() {
5353
(0, _defineProperty2.default)(this, "setLogo", function (value) {
5454
_this.attributes.logo = value;
5555
});
56+
// string # URL to open when a public visitor clicks the logo
57+
(0, _defineProperty2.default)(this, "getLogoClickHref", function () {
58+
return _this.attributes.logo_click_href;
59+
});
60+
(0, _defineProperty2.default)(this, "setLogoClickHref", function (value) {
61+
_this.attributes.logo_click_href = value;
62+
});
5663
// Image # Logo thumbnail
5764
(0, _defineProperty2.default)(this, "getThumbnail", function () {
5865
return _this.attributes.thumbnail;
5966
});
6067
(0, _defineProperty2.default)(this, "setThumbnail", function (value) {
6168
_this.attributes.thumbnail = value;
6269
});
63-
// file # Logo for custom branding.
70+
// file # Logo for custom branding. Required when creating a new style.
6471
(0, _defineProperty2.default)(this, "getFile", function () {
6572
return _this.attributes.file;
6673
});
6774
(0, _defineProperty2.default)(this, "setFile", function (value) {
6875
_this.attributes.file = value;
6976
});
7077
// Parameters:
71-
// file (required) - file - Logo for custom branding.
78+
// file - file - Logo for custom branding. Required when creating a new style.
79+
// logo_click_href - string - URL to open when a public visitor clicks the logo.
7280
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
7381
var params,
7482
response,
@@ -96,40 +104,32 @@ var Style = /*#__PURE__*/(0, _createClass2.default)(function Style() {
96104
}
97105
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
98106
case 3:
99-
if (params.path) {
100-
_context.next = 5;
101-
break;
102-
}
103-
if (!_this.attributes.path) {
107+
if (!(params.logo_click_href && !(0, _utils.isString)(params.logo_click_href))) {
104108
_context.next = 4;
105109
break;
106110
}
107-
params.path = _this.path;
108-
_context.next = 5;
109-
break;
111+
throw new errors.InvalidParameterError("Bad parameter: logo_click_href must be of type String, received ".concat((0, _utils.getType)(params.logo_click_href)));
110112
case 4:
111-
throw new errors.MissingParameterError('Parameter missing: path');
112-
case 5:
113-
if (params.file) {
114-
_context.next = 7;
113+
if (params.path) {
114+
_context.next = 6;
115115
break;
116116
}
117-
if (!_this.attributes.file) {
118-
_context.next = 6;
117+
if (!_this.attributes.path) {
118+
_context.next = 5;
119119
break;
120120
}
121-
params.file = _this.file;
122-
_context.next = 7;
121+
params.path = _this.path;
122+
_context.next = 6;
123123
break;
124+
case 5:
125+
throw new errors.MissingParameterError('Parameter missing: path');
124126
case 6:
125-
throw new errors.MissingParameterError('Parameter missing: file');
126-
case 7:
127-
_context.next = 8;
127+
_context.next = 7;
128128
return _Api.default.sendRequest("/styles/".concat(encodeURIComponent(params.path)), 'PATCH', params, _this.options);
129-
case 8:
129+
case 7:
130130
response = _context.sent;
131131
return _context.abrupt("return", new Style(response === null || response === void 0 ? void 0 : response.data, _this.options));
132-
case 9:
132+
case 8:
133133
case "end":
134134
return _context.stop();
135135
}

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.599",
3+
"version": "1.2.600",
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.599'
9+
const version = '1.2.600'
1010
let userAgent = `Files.com JavaScript SDK v${version}`
1111

1212
let logLevel = LogLevel.INFO

src/models/Style.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,30 @@ class Style {
4949
this.attributes.logo = value
5050
}
5151

52+
// string # URL to open when a public visitor clicks the logo
53+
getLogoClickHref = () => this.attributes.logo_click_href
54+
55+
setLogoClickHref = value => {
56+
this.attributes.logo_click_href = value
57+
}
58+
5259
// Image # Logo thumbnail
5360
getThumbnail = () => this.attributes.thumbnail
5461

5562
setThumbnail = value => {
5663
this.attributes.thumbnail = value
5764
}
5865

59-
// file # Logo for custom branding.
66+
// file # Logo for custom branding. Required when creating a new style.
6067
getFile = () => this.attributes.file
6168

6269
setFile = value => {
6370
this.attributes.file = value
6471
}
6572

6673
// Parameters:
67-
// file (required) - file - Logo for custom branding.
74+
// file - file - Logo for custom branding. Required when creating a new style.
75+
// logo_click_href - string - URL to open when a public visitor clicks the logo.
6876
update = async (params = {}) => {
6977
if (!this.attributes.path) {
7078
throw new errors.EmptyPropertyError('Current object has no path')
@@ -79,6 +87,10 @@ class Style {
7987
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params.path)}`)
8088
}
8189

90+
if (params.logo_click_href && !isString(params.logo_click_href)) {
91+
throw new errors.InvalidParameterError(`Bad parameter: logo_click_href must be of type String, received ${getType(params.logo_click_href)}`)
92+
}
93+
8294
if (!params.path) {
8395
if (this.attributes.path) {
8496
params.path = this.path
@@ -87,14 +99,6 @@ class Style {
8799
}
88100
}
89101

90-
if (!params.file) {
91-
if (this.attributes.file) {
92-
params.file = this.file
93-
} else {
94-
throw new errors.MissingParameterError('Parameter missing: file')
95-
}
96-
}
97-
98102
const response = await Api.sendRequest(`/styles/${encodeURIComponent(params.path)}`, 'PATCH', params, this.options)
99103

100104
return new Style(response?.data, this.options)

0 commit comments

Comments
 (0)