Skip to content

Commit 7819aae

Browse files
author
Olha Virolainen
authored
Update sailor 2 6 19 (#34)
Update Sailor version to 2.6.19
1 parent 220fc72 commit 7819aae

File tree

11 files changed

+332
-837
lines changed

11 files changed

+332
-837
lines changed

.circleci/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ jobs:
77
- checkout
88
- restore_cache:
99
key: dependency-cache-{{ checksum "package.json" }}
10+
- run:
11+
name: Audit Dependencies
12+
command: npm audit --audit-level=high
1013
- run:
1114
name: Installing Dependencies
1215
command: npm install

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 1.0.2 (November 27, 2020)
2+
3+
* Update Sailor version to 2.6.19
4+
* Annual audit of the component code to check if it exposes a sensitive data in the logs
5+
* Annual npm vulnerabilities audit
6+
17
# 1.0.1 (July 31, 2020)
28

39
* Fix retrieving mail folders issue

component.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"type": "polling",
4545
"help": {
4646
"description": "Contacts",
47-
"link": "/components/outlook/triggers#contacts"
47+
"link": "/components/outlook/#contacts"
4848
},
4949
"metadata": {
5050
"in": {},
@@ -56,7 +56,7 @@
5656
"main": "./lib/triggers/readMail.js",
5757
"help": {
5858
"description": "Poll for New Mail",
59-
"link": "/components/outlook/triggers#poll-for-new-mail"
59+
"link": "/components/outlook/#poll-for-new-mail"
6060
},
6161
"type": "polling",
6262
"fields": {
@@ -101,7 +101,7 @@
101101
"main": "./lib/actions/checkAvailability.js",
102102
"help": {
103103
"description": "Action for checking availability",
104-
"link": "/components/outlook/actions#check-availability"
104+
"link": "/components/outlook/#check-availability"
105105
},
106106
"metadata": {
107107
"in": "./lib/schemas/checkAvailability.in.json",
@@ -113,7 +113,7 @@
113113
"main": "./lib/actions/findNextAvailableTime.js",
114114
"help": {
115115
"description": "Action for calculating next availability time",
116-
"link": "/components/outlook/actions#find-next-available-time"
116+
"link": "/components/outlook/#find-next-available-time"
117117
},
118118
"metadata": {
119119
"in": "./lib/schemas/findNextAvailableTime.in.json",
@@ -125,7 +125,7 @@
125125
"main": "./lib/actions/createEvent.js",
126126
"help": {
127127
"description": "Action for creating new event",
128-
"link": "/components/outlook/actions#create-event"
128+
"link": "/components/outlook/#create-event"
129129
},
130130
"fields": {
131131
"calendarId": {
@@ -304,7 +304,7 @@
304304
"main": "./lib/actions/moveMail.js",
305305
"help": {
306306
"description": "Action for moving message between folders or soft-deleting message if the `Destination Mail Folder` folder isn't specified",
307-
"link": "/components/outlook/actions#move-mail"
307+
"link": "/components/outlook/#move-mail"
308308
},
309309
"fields": {
310310
"originalMailFolders": {

lib/actions/createEvent.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@ const { Client } = require('../Client');
77
exports.process = async function process(msg, cfg) {
88
const client = new Client(this, cfg);
99
const { calendarId } = cfg;
10-
this.logger.info(`About to create event in calendar with id=${calendarId}`);
10+
this.logger.info('About to create event in specified calendar...');
1111
const postRequestBody = await processEventData(this.logger, cfg, msg.body);
12-
this.logger.trace('Created postRequestBody: %j', postRequestBody);
12+
this.logger.debug('postRequestBody is created');
1313
try {
1414
const data = await client.createEvent(calendarId, postRequestBody);
15-
this.logger.info(`Successfully created event with ID=${data.id}`);
15+
this.logger.info('Successfully created event');
1616
const messageBody = _.omitBy(data, (value, key) => key.startsWith('@odata.'));
1717
messageBody.calendarId = cfg.calendarId;
1818
this.logger.info('Emitting data ...');
19-
this.logger.trace('Emitting data: %j', messageBody);
2019
await this.emit('data', messages.newMessageWithBody(messageBody));
2120
} catch (e) {
2221
this.logger.error('Oops! Error occurred');
@@ -29,7 +28,7 @@ exports.getCalendars = async function getCalendars(cfg) {
2928
const client = new Client(this, cfg);
3029
this.logger.info('Getting calendar data ...');
3130
const items = await client.getMyCalendars();
32-
this.logger.trace('Found calendars: %j', items);
31+
this.logger.debug('Found %s calendar(s)', items.length);
3332
this.logger.info('Processing calendar data ...');
3433
const result = {};
3534
items.forEach((item) => {

lib/actions/moveMail.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exports.process = async function process(msg, cfg) {
1313
currentFolder = await client.getMailFolderById(destinationId);
1414
} else {
1515
const deleteditemsFolder = await client.getDeleteditemsFolder();
16-
this.logger.trace('Found deleteditemsFolder: %j', deleteditemsFolder);
16+
this.logger.trace('deleteditemsFolder found');
1717
currentFolder = deleteditemsFolder;
1818
destinationId = deleteditemsFolder.id;
1919
}

lib/triggers/contacts.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ const { Client } = require('../Client');
1111
* @param snapshot - snapshot that stores the data between the runs
1212
*/
1313
exports.process = async function process(msg, cfg, snapshot) {
14-
this.logger.info('Snapshot is %j', snapshot);
14+
this.logger.info('Contacts trigger starting...');
1515

1616
const client = new Client(this, cfg);
1717
// Should be in ISO-Date format
1818
snapshot.lastModifiedDateTime = snapshot.lastModifiedDateTime || new Date(0).toISOString();
1919
this.logger.info('Selecting contacts that was modified since %s', snapshot.lastModifiedDateTime);
2020
const result = await client.getMyLatestContacts(snapshot.lastModifiedDateTime);
21-
this.logger.trace('Result %j', result);
2221
this.logger.info('Found %s contacts', result.length);
2322
if (result.length > 0) {
2423
result.forEach((elem) => {

lib/triggers/readMail.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,23 @@ const { Client } = require('../Client');
44
const { getFolders } = require('../utils/selectViewModels');
55

66
exports.process = async function process(msg, cfg, snapshot) {
7-
this.logger.trace('Incoming configuration: %j', cfg);
8-
this.logger.trace('Incoming message: %j', msg);
9-
this.logger.trace('Incoming snapshot: %j', snapshot);
7+
this.logger.info('Poll for New Mail trigger starting...');
108
const {
119
folderId, startTime, pollOnlyUnreadMail, emitBehavior = 'emitIndividually',
1210
} = cfg;
1311
snapshot.lastModifiedDateTime = snapshot.lastModifiedDateTime || startTime || new Date(0).toISOString();
14-
this.logger.info(`Getting message from folder with id: ${folderId} starting from: ${snapshot.lastModifiedDateTime}, pollOnlyUnreadMail ${pollOnlyUnreadMail || false}`);
12+
this.logger.info(`Getting message from specified folder, starting from: ${snapshot.lastModifiedDateTime}, pollOnlyUnreadMail ${pollOnlyUnreadMail || false}`);
1513
const client = new Client(this, cfg);
1614
const results = await client.getLatestMessages(folderId, snapshot.lastModifiedDateTime, pollOnlyUnreadMail);
17-
this.logger.trace('Results: %j', results);
15+
this.logger.debug('Results are received');
1816
if (results.length > 0) {
1917
this.logger.info(`New Mails found, going to emit, Emit Behavior: ${emitBehavior}...`);
2018
switch (emitBehavior) {
2119
case 'emitIndividually':
2220
this.logger.info('Starting to emit individually found mails...');
2321
// eslint-disable-next-line no-restricted-syntax
2422
for (const result of results) {
25-
this.logger.trace('Emit Mail: %j', result);
23+
this.logger.debug('Emit Mail...');
2624
// eslint-disable-next-line no-await-in-loop
2725
await this.emit('data', messages.newMessageWithBody(result));
2826
}

lib/utils/selectViewModels.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ exports.getFolders = async function getFolders(cfg) {
1515
const client = new Client(this, cfg);
1616
this.logger.info('Getting list of folders...');
1717
const items = await client.getMailFolders();
18-
this.logger.trace('Found folders: %j', items);
1918
this.logger.info('Processing list of folders...');
2019
const result = {};
2120
for (const item of items) {
@@ -24,6 +23,6 @@ exports.getFolders = async function getFolders(cfg) {
2423
await getChildFolders(client, item.id, result);
2524
}
2625
}
27-
this.logger.trace('Result: %j', result);
26+
this.logger.debug('Return result...');
2827
return result;
2928
};

0 commit comments

Comments
 (0)