Skip to content

Commit

Permalink
Sailor 2 6 18 (#13)
Browse files Browse the repository at this point in the history
Update sailor version 2.6.18
  • Loading branch information
A3a3e1 authored Oct 28, 2020
1 parent 74d8202 commit c726e6f
Show file tree
Hide file tree
Showing 8 changed files with 308 additions and 75 deletions.
25 changes: 25 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 2
jobs:
test:
docker:
- image: circleci/node:14-stretch
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Installing Dependencies
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- node_modules
- run:
name: Running Mocha Integration Tests
command: npm test

workflows:
version: 2
build_and_test:
jobs:
- test
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
'extends': 'airbnb-base',
'env': {
'mocha': true
}
};
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.0.3 (October 30, 2020)

* Update sailor version to 2.6.18
* Annual audit of the component code to check if it exposes a sensitive data in the logs
* Add circle.ci automation build

## 0.0.2 (December 24, 2019)

* Update sailor version to 2.5.4
Expand Down
14 changes: 6 additions & 8 deletions lib/actions/emitConfig.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
const {messages} = require('elasticio-node');

exports.process = processAction;
const { messages } = require('elasticio-node');

/**
* Executes the action's logic by specifying configuration data as a credential object and emitting it as a message.
*/
function processAction(msg, cfg) {
exports.process = async function process(msg, cfg) {

// Access the configuration data from the field defined in credentials section of component.json
const configData = cfg.configData;
const jsonConfigData = JSON.parse(configData);

if (!configData) {
throw new Error('Config data is required.');
throw new Error('Config data is required');
}

this.logger.info('About to emit config data as a body');
this.emit('data', messages.newMessageWithBody(jsonConfigData));
this.emit('end');
const message = messages.newMessageWithBody(jsonConfigData);
this.logger.info('Successfully emitted data as a body');
await this.emit('data', message);
}
Loading

0 comments on commit c726e6f

Please sign in to comment.