Skip to content

Commit 79a87bc

Browse files
[Bot] push changes from Files.com
1 parent f2e1663 commit 79a87bc

7 files changed

Lines changed: 74 additions & 29 deletions

File tree

_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.647
1+
1.2.648

docs/models/Notification.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"*.jpg",
3636
"notify_file.txt"
3737
],
38+
"workspace_id": 1,
3839
"unsubscribed": true,
3940
"unsubscribed_reason": "example",
4041
"user_id": 1,
@@ -63,6 +64,7 @@
6364
* `subject` (string): Custom subject line to use for notification emails
6465
* `message` (string): Custom message to include in notification emails
6566
* `triggering_filenames` (array(string)): Array of filenames (possibly with wildcards) to scope trigger
67+
* `workspace_id` (int64): Workspace ID. `0` means the default workspace.
6668
* `unsubscribed` (boolean): Is the user unsubscribed from this notification?
6769
* `unsubscribed_reason` (string): The reason that the user unsubscribed
6870
* `user_id` (int64): Notification user ID
@@ -85,8 +87,8 @@ await Notification.list({
8587

8688
* `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.
8789
* `per_page` (int64): Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
88-
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `path`, `user_id` or `group_id`.
89-
* `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `path`, `user_id` or `group_id`.
90+
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id`, `path`, `user_id` or `group_id`.
91+
* `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `path`, `user_id`, `workspace_id` or `group_id`. Valid field combinations are `[ workspace_id, path ]`, `[ workspace_id, user_id ]`, `[ workspace_id, group_id ]` or `[ workspace_id, user_id, path ]`.
9092
* `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `path`.
9193
* `path` (string): Show notifications for this Path.
9294
* `include_ancestors` (boolean): If `include_ancestors` is `true` and `path` is specified, include notifications for any parent paths. Ignored if `path` is not specified.
@@ -126,6 +128,7 @@ await Notification.create({
126128
'triggering_group_ids': [1],
127129
'triggering_user_ids': [1],
128130
'trigger_by_share_recipients': true,
131+
'workspace_id': 1,
129132
'group_id': 1,
130133
'group_ids': [1],
131134
'username': "User",
@@ -150,6 +153,7 @@ await Notification.create({
150153
* `triggering_group_ids` (array(int64)): If set, will only notify on actions made by a member of one of the specified groups
151154
* `triggering_user_ids` (array(int64)): If set, will only notify on actions made one of the specified users
152155
* `trigger_by_share_recipients` (boolean): Notify when actions are performed by a share recipient?
156+
* `workspace_id` (int64): Workspace ID. `0` means the default workspace.
153157
* `group_id` (int64): The ID of the group to notify. Provide `user_id`, `username` or `group_id`.
154158
* `group_ids` (string): Group IDs when the notification requires multiple groups. If sent as a string, it should be comma-delimited.
155159
* `path` (string): Path
@@ -177,6 +181,7 @@ await notification.update({
177181
'triggering_group_ids': [1],
178182
'triggering_user_ids': [1],
179183
'trigger_by_share_recipients': true,
184+
'workspace_id': 1,
180185
})
181186
```
182187

@@ -197,6 +202,7 @@ await notification.update({
197202
* `triggering_group_ids` (array(int64)): If set, will only notify on actions made by a member of one of the specified groups
198203
* `triggering_user_ids` (array(int64)): If set, will only notify on actions made one of the specified users
199204
* `trigger_by_share_recipients` (boolean): Notify when actions are performed by a share recipient?
205+
* `workspace_id` (int64): Workspace ID. `0` means the default workspace.
200206

201207
### Example Response
202208

@@ -233,6 +239,7 @@ await notification.update({
233239
"*.jpg",
234240
"notify_file.txt"
235241
],
242+
"workspace_id": 1,
236243
"unsubscribed": true,
237244
"unsubscribed_reason": "example",
238245
"user_id": 1,

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

lib/models/Notification.js

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,13 @@ var Notification = /*#__PURE__*/(0, _createClass2.default)(function Notification
172172
(0, _defineProperty2.default)(this, "setTriggeringFilenames", function (value) {
173173
_this.attributes.triggering_filenames = value;
174174
});
175+
// int64 # Workspace ID. `0` means the default workspace.
176+
(0, _defineProperty2.default)(this, "getWorkspaceId", function () {
177+
return _this.attributes.workspace_id;
178+
});
179+
(0, _defineProperty2.default)(this, "setWorkspaceId", function (value) {
180+
_this.attributes.workspace_id = value;
181+
});
175182
// boolean # Is the user unsubscribed from this notification?
176183
(0, _defineProperty2.default)(this, "getUnsubscribed", function () {
177184
return _this.attributes.unsubscribed;
@@ -222,6 +229,7 @@ var Notification = /*#__PURE__*/(0, _createClass2.default)(function Notification
222229
// triggering_group_ids - array(int64) - If set, will only notify on actions made by a member of one of the specified groups
223230
// triggering_user_ids - array(int64) - If set, will only notify on actions made one of the specified users
224231
// trigger_by_share_recipients - boolean - Notify when actions are performed by a share recipient?
232+
// workspace_id - int64 - Workspace ID. `0` means the default workspace.
225233
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
226234
var params,
227235
response,
@@ -285,26 +293,32 @@ var Notification = /*#__PURE__*/(0, _createClass2.default)(function Notification
285293
}
286294
throw new errors.InvalidParameterError("Bad parameter: triggering_user_ids must be of type Array, received ".concat((0, _utils.getType)(params.triggering_user_ids)));
287295
case 9:
296+
if (!(params.workspace_id && !(0, _utils.isInt)(params.workspace_id))) {
297+
_context.next = 10;
298+
break;
299+
}
300+
throw new errors.InvalidParameterError("Bad parameter: workspace_id must be of type Int, received ".concat((0, _utils.getType)(params.workspace_id)));
301+
case 10:
288302
if (params.id) {
289-
_context.next = 11;
303+
_context.next = 12;
290304
break;
291305
}
292306
if (!_this.attributes.id) {
293-
_context.next = 10;
307+
_context.next = 11;
294308
break;
295309
}
296310
params.id = _this.id;
297-
_context.next = 11;
311+
_context.next = 12;
298312
break;
299-
case 10:
300-
throw new errors.MissingParameterError('Parameter missing: id');
301313
case 11:
302-
_context.next = 12;
303-
return _Api.default.sendRequest("/notifications/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
314+
throw new errors.MissingParameterError('Parameter missing: id');
304315
case 12:
316+
_context.next = 13;
317+
return _Api.default.sendRequest("/notifications/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
318+
case 13:
305319
response = _context.sent;
306320
return _context.abrupt("return", new Notification(response === null || response === void 0 ? void 0 : response.data, _this.options));
307-
case 13:
321+
case 14:
308322
case "end":
309323
return _context.stop();
310324
}
@@ -407,8 +421,8 @@ _Notification = Notification;
407421
// Parameters:
408422
// 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.
409423
// per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
410-
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `path`, `user_id` or `group_id`.
411-
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `path`, `user_id` or `group_id`.
424+
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id`, `path`, `user_id` or `group_id`.
425+
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `path`, `user_id`, `workspace_id` or `group_id`. Valid field combinations are `[ workspace_id, path ]`, `[ workspace_id, user_id ]`, `[ workspace_id, group_id ]` or `[ workspace_id, user_id, path ]`.
412426
// filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `path`.
413427
// path - string - Show notifications for this Path.
414428
// include_ancestors - boolean - If `include_ancestors` is `true` and `path` is specified, include notifications for any parent paths. Ignored if `path` is not specified.
@@ -534,6 +548,7 @@ _Notification = Notification;
534548
// triggering_group_ids - array(int64) - If set, will only notify on actions made by a member of one of the specified groups
535549
// triggering_user_ids - array(int64) - If set, will only notify on actions made one of the specified users
536550
// trigger_by_share_recipients - boolean - Notify when actions are performed by a share recipient?
551+
// workspace_id - int64 - Workspace ID. `0` means the default workspace.
537552
// group_id - int64 - The ID of the group to notify. Provide `user_id`, `username` or `group_id`.
538553
// group_ids - string - Group IDs when the notification requires multiple groups. If sent as a string, it should be comma-delimited.
539554
// path - string - Path
@@ -590,36 +605,42 @@ _Notification = Notification;
590605
}
591606
throw new errors.InvalidParameterError("Bad parameter: triggering_user_ids must be of type Array, received ".concat((0, _utils.getType)(params.triggering_user_ids)));
592607
case 7:
593-
if (!(params.group_id && !(0, _utils.isInt)(params.group_id))) {
608+
if (!(params.workspace_id && !(0, _utils.isInt)(params.workspace_id))) {
594609
_context6.next = 8;
595610
break;
596611
}
597-
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params.group_id)));
612+
throw new errors.InvalidParameterError("Bad parameter: workspace_id must be of type Int, received ".concat((0, _utils.getType)(params.workspace_id)));
598613
case 8:
599-
if (!(params.group_ids && !(0, _utils.isString)(params.group_ids))) {
614+
if (!(params.group_id && !(0, _utils.isInt)(params.group_id))) {
600615
_context6.next = 9;
601616
break;
602617
}
603-
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params.group_ids)));
618+
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params.group_id)));
604619
case 9:
605-
if (!(params.path && !(0, _utils.isString)(params.path))) {
620+
if (!(params.group_ids && !(0, _utils.isString)(params.group_ids))) {
606621
_context6.next = 10;
607622
break;
608623
}
609-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
624+
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params.group_ids)));
610625
case 10:
611-
if (!(params.username && !(0, _utils.isString)(params.username))) {
626+
if (!(params.path && !(0, _utils.isString)(params.path))) {
612627
_context6.next = 11;
613628
break;
614629
}
615-
throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(params.username)));
630+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
616631
case 11:
617-
_context6.next = 12;
618-
return _Api.default.sendRequest('/notifications', 'POST', params, options);
632+
if (!(params.username && !(0, _utils.isString)(params.username))) {
633+
_context6.next = 12;
634+
break;
635+
}
636+
throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(params.username)));
619637
case 12:
638+
_context6.next = 13;
639+
return _Api.default.sendRequest('/notifications', 'POST', params, options);
640+
case 13:
620641
response = _context6.sent;
621642
return _context6.abrupt("return", new _Notification(response === null || response === void 0 ? void 0 : response.data, options));
622-
case 13:
643+
case 14:
623644
case "end":
624645
return _context6.stop();
625646
}

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

1212
let logLevel = LogLevel.INFO

src/models/Notification.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ class Notification {
168168
this.attributes.triggering_filenames = value
169169
}
170170

171+
// int64 # Workspace ID. `0` means the default workspace.
172+
getWorkspaceId = () => this.attributes.workspace_id
173+
174+
setWorkspaceId = value => {
175+
this.attributes.workspace_id = value
176+
}
177+
171178
// boolean # Is the user unsubscribed from this notification?
172179
getUnsubscribed = () => this.attributes.unsubscribed
173180

@@ -218,6 +225,7 @@ class Notification {
218225
// triggering_group_ids - array(int64) - If set, will only notify on actions made by a member of one of the specified groups
219226
// triggering_user_ids - array(int64) - If set, will only notify on actions made one of the specified users
220227
// trigger_by_share_recipients - boolean - Notify when actions are performed by a share recipient?
228+
// workspace_id - int64 - Workspace ID. `0` means the default workspace.
221229
update = async (params = {}) => {
222230
if (!this.attributes.id) {
223231
throw new errors.EmptyPropertyError('Current object has no id')
@@ -256,6 +264,10 @@ class Notification {
256264
throw new errors.InvalidParameterError(`Bad parameter: triggering_user_ids must be of type Array, received ${getType(params.triggering_user_ids)}`)
257265
}
258266

267+
if (params.workspace_id && !isInt(params.workspace_id)) {
268+
throw new errors.InvalidParameterError(`Bad parameter: workspace_id must be of type Int, received ${getType(params.workspace_id)}`)
269+
}
270+
259271
if (!params.id) {
260272
if (this.attributes.id) {
261273
params.id = this.id
@@ -312,8 +324,8 @@ class Notification {
312324
// Parameters:
313325
// 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.
314326
// per_page - int64 - Number of records to show per page. (Max: 10000, 1,000 or less is recommended).
315-
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `path`, `user_id` or `group_id`.
316-
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `path`, `user_id` or `group_id`.
327+
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `workspace_id`, `path`, `user_id` or `group_id`.
328+
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `path`, `user_id`, `workspace_id` or `group_id`. Valid field combinations are `[ workspace_id, path ]`, `[ workspace_id, user_id ]`, `[ workspace_id, group_id ]` or `[ workspace_id, user_id, path ]`.
317329
// filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `path`.
318330
// path - string - Show notifications for this Path.
319331
// include_ancestors - boolean - If `include_ancestors` is `true` and `path` is specified, include notifications for any parent paths. Ignored if `path` is not specified.
@@ -384,6 +396,7 @@ class Notification {
384396
// triggering_group_ids - array(int64) - If set, will only notify on actions made by a member of one of the specified groups
385397
// triggering_user_ids - array(int64) - If set, will only notify on actions made one of the specified users
386398
// trigger_by_share_recipients - boolean - Notify when actions are performed by a share recipient?
399+
// workspace_id - int64 - Workspace ID. `0` means the default workspace.
387400
// group_id - int64 - The ID of the group to notify. Provide `user_id`, `username` or `group_id`.
388401
// group_ids - string - Group IDs when the notification requires multiple groups. If sent as a string, it should be comma-delimited.
389402
// path - string - Path
@@ -417,6 +430,10 @@ class Notification {
417430
throw new errors.InvalidParameterError(`Bad parameter: triggering_user_ids must be of type Array, received ${getType(params.triggering_user_ids)}`)
418431
}
419432

433+
if (params.workspace_id && !isInt(params.workspace_id)) {
434+
throw new errors.InvalidParameterError(`Bad parameter: workspace_id must be of type Int, received ${getType(params.workspace_id)}`)
435+
}
436+
420437
if (params.group_id && !isInt(params.group_id)) {
421438
throw new errors.InvalidParameterError(`Bad parameter: group_id must be of type Int, received ${getType(params.group_id)}`)
422439
}

0 commit comments

Comments
 (0)