Skip to content

Commit 99b2d11

Browse files
v1.2.613
[Bot] push changes from Files.com
1 parent d73205a commit 99b2d11

7 files changed

Lines changed: 84 additions & 39 deletions

File tree

_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.612
1+
1.2.613

docs/models/Notification.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"notify_on_upload": true,
3030
"recursive": true,
3131
"send_interval": "fifteen_minutes",
32+
"subject": "Vendor A CSV Activity",
3233
"message": "custom notification email message",
3334
"triggering_filenames": [
3435
"*.jpg",
@@ -59,6 +60,7 @@
5960
* `notify_on_upload` (boolean): Trigger on files created/uploaded/updated/changed in this path?
6061
* `recursive` (boolean): Apply notification recursively? This will enable notifications for each subfolder.
6162
* `send_interval` (string): The time interval that notifications are aggregated to
63+
* `subject` (string): Custom subject line to use for notification emails
6264
* `message` (string): Custom message to include in notification emails
6365
* `triggering_filenames` (array(string)): Array of filenames (possibly with wildcards) to scope trigger
6466
* `unsubscribed` (boolean): Is the user unsubscribed from this notification?
@@ -118,6 +120,7 @@ await Notification.create({
118120
'notify_user_actions': false,
119121
'recursive': false,
120122
'send_interval': "daily",
123+
'subject': "Vendor A CSV Activity",
121124
'message': "custom notification email message",
122125
'triggering_filenames': ["*.jpg","notify_file.txt"],
123126
'triggering_group_ids': [1],
@@ -141,6 +144,7 @@ await Notification.create({
141144
* `notify_user_actions` (boolean): If `true` actions initiated by the user will still result in a notification
142145
* `recursive` (boolean): If `true`, enable notifications for each subfolder in this path
143146
* `send_interval` (string): The time interval that notifications are aggregated by. Can be `five_minutes`, `fifteen_minutes`, `hourly`, or `daily`.
147+
* `subject` (string): Custom subject line to use for notification emails
144148
* `message` (string): Custom message to include in notification emails
145149
* `triggering_filenames` (array(string)): Array of filenames (possibly with wildcards) to scope trigger
146150
* `triggering_group_ids` (array(int64)): If set, will only notify on actions made by a member of one of the specified groups
@@ -167,6 +171,7 @@ await notification.update({
167171
'notify_user_actions': false,
168172
'recursive': false,
169173
'send_interval': "daily",
174+
'subject': "Vendor A CSV Activity",
170175
'message': "custom notification email message",
171176
'triggering_filenames': ["*.jpg","notify_file.txt"],
172177
'triggering_group_ids': [1],
@@ -186,6 +191,7 @@ await notification.update({
186191
* `notify_user_actions` (boolean): If `true` actions initiated by the user will still result in a notification
187192
* `recursive` (boolean): If `true`, enable notifications for each subfolder in this path
188193
* `send_interval` (string): The time interval that notifications are aggregated by. Can be `five_minutes`, `fifteen_minutes`, `hourly`, or `daily`.
194+
* `subject` (string): Custom subject line to use for notification emails
189195
* `message` (string): Custom message to include in notification emails
190196
* `triggering_filenames` (array(string)): Array of filenames (possibly with wildcards) to scope trigger
191197
* `triggering_group_ids` (array(int64)): If set, will only notify on actions made by a member of one of the specified groups
@@ -221,6 +227,7 @@ await notification.update({
221227
"notify_on_upload": true,
222228
"recursive": true,
223229
"send_interval": "fifteen_minutes",
230+
"subject": "Vendor A CSV Activity",
224231
"message": "custom notification email message",
225232
"triggering_filenames": [
226233
"*.jpg",

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.612';
15+
var version = '1.2.613';
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: 56 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ var Notification = /*#__PURE__*/(0, _createClass2.default)(function Notification
151151
(0, _defineProperty2.default)(this, "setSendInterval", function (value) {
152152
_this.attributes.send_interval = value;
153153
});
154+
// string # Custom subject line to use for notification emails
155+
(0, _defineProperty2.default)(this, "getSubject", function () {
156+
return _this.attributes.subject;
157+
});
158+
(0, _defineProperty2.default)(this, "setSubject", function (value) {
159+
_this.attributes.subject = value;
160+
});
154161
// string # Custom message to include in notification emails
155162
(0, _defineProperty2.default)(this, "getMessage", function () {
156163
return _this.attributes.message;
@@ -209,6 +216,7 @@ var Notification = /*#__PURE__*/(0, _createClass2.default)(function Notification
209216
// notify_user_actions - boolean - If `true` actions initiated by the user will still result in a notification
210217
// recursive - boolean - If `true`, enable notifications for each subfolder in this path
211218
// send_interval - string - The time interval that notifications are aggregated by. Can be `five_minutes`, `fifteen_minutes`, `hourly`, or `daily`.
219+
// subject - string - Custom subject line to use for notification emails
212220
// message - string - Custom message to include in notification emails
213221
// triggering_filenames - array(string) - Array of filenames (possibly with wildcards) to scope trigger
214222
// triggering_group_ids - array(int64) - If set, will only notify on actions made by a member of one of the specified groups
@@ -247,50 +255,56 @@ var Notification = /*#__PURE__*/(0, _createClass2.default)(function Notification
247255
}
248256
throw new errors.InvalidParameterError("Bad parameter: send_interval must be of type String, received ".concat((0, _utils.getType)(params.send_interval)));
249257
case 4:
250-
if (!(params.message && !(0, _utils.isString)(params.message))) {
258+
if (!(params.subject && !(0, _utils.isString)(params.subject))) {
251259
_context.next = 5;
252260
break;
253261
}
254-
throw new errors.InvalidParameterError("Bad parameter: message must be of type String, received ".concat((0, _utils.getType)(params.message)));
262+
throw new errors.InvalidParameterError("Bad parameter: subject must be of type String, received ".concat((0, _utils.getType)(params.subject)));
255263
case 5:
256-
if (!(params.triggering_filenames && !(0, _utils.isArray)(params.triggering_filenames))) {
264+
if (!(params.message && !(0, _utils.isString)(params.message))) {
257265
_context.next = 6;
258266
break;
259267
}
260-
throw new errors.InvalidParameterError("Bad parameter: triggering_filenames must be of type Array, received ".concat((0, _utils.getType)(params.triggering_filenames)));
268+
throw new errors.InvalidParameterError("Bad parameter: message must be of type String, received ".concat((0, _utils.getType)(params.message)));
261269
case 6:
262-
if (!(params.triggering_group_ids && !(0, _utils.isArray)(params.triggering_group_ids))) {
270+
if (!(params.triggering_filenames && !(0, _utils.isArray)(params.triggering_filenames))) {
263271
_context.next = 7;
264272
break;
265273
}
266-
throw new errors.InvalidParameterError("Bad parameter: triggering_group_ids must be of type Array, received ".concat((0, _utils.getType)(params.triggering_group_ids)));
274+
throw new errors.InvalidParameterError("Bad parameter: triggering_filenames must be of type Array, received ".concat((0, _utils.getType)(params.triggering_filenames)));
267275
case 7:
268-
if (!(params.triggering_user_ids && !(0, _utils.isArray)(params.triggering_user_ids))) {
276+
if (!(params.triggering_group_ids && !(0, _utils.isArray)(params.triggering_group_ids))) {
269277
_context.next = 8;
270278
break;
271279
}
272-
throw new errors.InvalidParameterError("Bad parameter: triggering_user_ids must be of type Array, received ".concat((0, _utils.getType)(params.triggering_user_ids)));
280+
throw new errors.InvalidParameterError("Bad parameter: triggering_group_ids must be of type Array, received ".concat((0, _utils.getType)(params.triggering_group_ids)));
273281
case 8:
282+
if (!(params.triggering_user_ids && !(0, _utils.isArray)(params.triggering_user_ids))) {
283+
_context.next = 9;
284+
break;
285+
}
286+
throw new errors.InvalidParameterError("Bad parameter: triggering_user_ids must be of type Array, received ".concat((0, _utils.getType)(params.triggering_user_ids)));
287+
case 9:
274288
if (params.id) {
275-
_context.next = 10;
289+
_context.next = 11;
276290
break;
277291
}
278292
if (!_this.attributes.id) {
279-
_context.next = 9;
293+
_context.next = 10;
280294
break;
281295
}
282296
params.id = _this.id;
283-
_context.next = 10;
297+
_context.next = 11;
284298
break;
285-
case 9:
286-
throw new errors.MissingParameterError('Parameter missing: id');
287299
case 10:
288-
_context.next = 11;
289-
return _Api.default.sendRequest("/notifications/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
300+
throw new errors.MissingParameterError('Parameter missing: id');
290301
case 11:
302+
_context.next = 12;
303+
return _Api.default.sendRequest("/notifications/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
304+
case 12:
291305
response = _context.sent;
292306
return _context.abrupt("return", new Notification(response === null || response === void 0 ? void 0 : response.data, _this.options));
293-
case 12:
307+
case 13:
294308
case "end":
295309
return _context.stop();
296310
}
@@ -514,6 +528,7 @@ _Notification = Notification;
514528
// notify_user_actions - boolean - If `true` actions initiated by the user will still result in a notification
515529
// recursive - boolean - If `true`, enable notifications for each subfolder in this path
516530
// send_interval - string - The time interval that notifications are aggregated by. Can be `five_minutes`, `fifteen_minutes`, `hourly`, or `daily`.
531+
// subject - string - Custom subject line to use for notification emails
517532
// message - string - Custom message to include in notification emails
518533
// triggering_filenames - array(string) - Array of filenames (possibly with wildcards) to scope trigger
519534
// triggering_group_ids - array(int64) - If set, will only notify on actions made by a member of one of the specified groups
@@ -545,60 +560,66 @@ _Notification = Notification;
545560
}
546561
throw new errors.InvalidParameterError("Bad parameter: send_interval must be of type String, received ".concat((0, _utils.getType)(params.send_interval)));
547562
case 2:
548-
if (!(params.message && !(0, _utils.isString)(params.message))) {
563+
if (!(params.subject && !(0, _utils.isString)(params.subject))) {
549564
_context6.next = 3;
550565
break;
551566
}
552-
throw new errors.InvalidParameterError("Bad parameter: message must be of type String, received ".concat((0, _utils.getType)(params.message)));
567+
throw new errors.InvalidParameterError("Bad parameter: subject must be of type String, received ".concat((0, _utils.getType)(params.subject)));
553568
case 3:
554-
if (!(params.triggering_filenames && !(0, _utils.isArray)(params.triggering_filenames))) {
569+
if (!(params.message && !(0, _utils.isString)(params.message))) {
555570
_context6.next = 4;
556571
break;
557572
}
558-
throw new errors.InvalidParameterError("Bad parameter: triggering_filenames must be of type Array, received ".concat((0, _utils.getType)(params.triggering_filenames)));
573+
throw new errors.InvalidParameterError("Bad parameter: message must be of type String, received ".concat((0, _utils.getType)(params.message)));
559574
case 4:
560-
if (!(params.triggering_group_ids && !(0, _utils.isArray)(params.triggering_group_ids))) {
575+
if (!(params.triggering_filenames && !(0, _utils.isArray)(params.triggering_filenames))) {
561576
_context6.next = 5;
562577
break;
563578
}
564-
throw new errors.InvalidParameterError("Bad parameter: triggering_group_ids must be of type Array, received ".concat((0, _utils.getType)(params.triggering_group_ids)));
579+
throw new errors.InvalidParameterError("Bad parameter: triggering_filenames must be of type Array, received ".concat((0, _utils.getType)(params.triggering_filenames)));
565580
case 5:
566-
if (!(params.triggering_user_ids && !(0, _utils.isArray)(params.triggering_user_ids))) {
581+
if (!(params.triggering_group_ids && !(0, _utils.isArray)(params.triggering_group_ids))) {
567582
_context6.next = 6;
568583
break;
569584
}
570-
throw new errors.InvalidParameterError("Bad parameter: triggering_user_ids must be of type Array, received ".concat((0, _utils.getType)(params.triggering_user_ids)));
585+
throw new errors.InvalidParameterError("Bad parameter: triggering_group_ids must be of type Array, received ".concat((0, _utils.getType)(params.triggering_group_ids)));
571586
case 6:
572-
if (!(params.group_id && !(0, _utils.isInt)(params.group_id))) {
587+
if (!(params.triggering_user_ids && !(0, _utils.isArray)(params.triggering_user_ids))) {
573588
_context6.next = 7;
574589
break;
575590
}
576-
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params.group_id)));
591+
throw new errors.InvalidParameterError("Bad parameter: triggering_user_ids must be of type Array, received ".concat((0, _utils.getType)(params.triggering_user_ids)));
577592
case 7:
578-
if (!(params.group_ids && !(0, _utils.isString)(params.group_ids))) {
593+
if (!(params.group_id && !(0, _utils.isInt)(params.group_id))) {
579594
_context6.next = 8;
580595
break;
581596
}
582-
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params.group_ids)));
597+
throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params.group_id)));
583598
case 8:
584-
if (!(params.path && !(0, _utils.isString)(params.path))) {
599+
if (!(params.group_ids && !(0, _utils.isString)(params.group_ids))) {
585600
_context6.next = 9;
586601
break;
587602
}
588-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
603+
throw new errors.InvalidParameterError("Bad parameter: group_ids must be of type String, received ".concat((0, _utils.getType)(params.group_ids)));
589604
case 9:
590-
if (!(params.username && !(0, _utils.isString)(params.username))) {
605+
if (!(params.path && !(0, _utils.isString)(params.path))) {
591606
_context6.next = 10;
592607
break;
593608
}
594-
throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(params.username)));
609+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
595610
case 10:
596-
_context6.next = 11;
597-
return _Api.default.sendRequest('/notifications', 'POST', params, options);
611+
if (!(params.username && !(0, _utils.isString)(params.username))) {
612+
_context6.next = 11;
613+
break;
614+
}
615+
throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(params.username)));
598616
case 11:
617+
_context6.next = 12;
618+
return _Api.default.sendRequest('/notifications', 'POST', params, options);
619+
case 12:
599620
response = _context6.sent;
600621
return _context6.abrupt("return", new _Notification(response === null || response === void 0 ? void 0 : response.data, options));
601-
case 12:
622+
case 13:
602623
case "end":
603624
return _context6.stop();
604625
}

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

1212
let logLevel = LogLevel.INFO

src/models/Notification.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ class Notification {
147147
this.attributes.send_interval = value
148148
}
149149

150+
// string # Custom subject line to use for notification emails
151+
getSubject = () => this.attributes.subject
152+
153+
setSubject = value => {
154+
this.attributes.subject = value
155+
}
156+
150157
// string # Custom message to include in notification emails
151158
getMessage = () => this.attributes.message
152159

@@ -205,6 +212,7 @@ class Notification {
205212
// notify_user_actions - boolean - If `true` actions initiated by the user will still result in a notification
206213
// recursive - boolean - If `true`, enable notifications for each subfolder in this path
207214
// send_interval - string - The time interval that notifications are aggregated by. Can be `five_minutes`, `fifteen_minutes`, `hourly`, or `daily`.
215+
// subject - string - Custom subject line to use for notification emails
208216
// message - string - Custom message to include in notification emails
209217
// triggering_filenames - array(string) - Array of filenames (possibly with wildcards) to scope trigger
210218
// triggering_group_ids - array(int64) - If set, will only notify on actions made by a member of one of the specified groups
@@ -228,6 +236,10 @@ class Notification {
228236
throw new errors.InvalidParameterError(`Bad parameter: send_interval must be of type String, received ${getType(params.send_interval)}`)
229237
}
230238

239+
if (params.subject && !isString(params.subject)) {
240+
throw new errors.InvalidParameterError(`Bad parameter: subject must be of type String, received ${getType(params.subject)}`)
241+
}
242+
231243
if (params.message && !isString(params.message)) {
232244
throw new errors.InvalidParameterError(`Bad parameter: message must be of type String, received ${getType(params.message)}`)
233245
}
@@ -366,6 +378,7 @@ class Notification {
366378
// notify_user_actions - boolean - If `true` actions initiated by the user will still result in a notification
367379
// recursive - boolean - If `true`, enable notifications for each subfolder in this path
368380
// send_interval - string - The time interval that notifications are aggregated by. Can be `five_minutes`, `fifteen_minutes`, `hourly`, or `daily`.
381+
// subject - string - Custom subject line to use for notification emails
369382
// message - string - Custom message to include in notification emails
370383
// triggering_filenames - array(string) - Array of filenames (possibly with wildcards) to scope trigger
371384
// triggering_group_ids - array(int64) - If set, will only notify on actions made by a member of one of the specified groups
@@ -384,6 +397,10 @@ class Notification {
384397
throw new errors.InvalidParameterError(`Bad parameter: send_interval must be of type String, received ${getType(params.send_interval)}`)
385398
}
386399

400+
if (params.subject && !isString(params.subject)) {
401+
throw new errors.InvalidParameterError(`Bad parameter: subject must be of type String, received ${getType(params.subject)}`)
402+
}
403+
387404
if (params.message && !isString(params.message)) {
388405
throw new errors.InvalidParameterError(`Bad parameter: message must be of type String, received ${getType(params.message)}`)
389406
}

0 commit comments

Comments
 (0)