-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update sailor version 2.6.18
- Loading branch information
Showing
8 changed files
with
308 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
'extends': 'airbnb-base', | ||
'env': { | ||
'mocha': true | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
Oops, something went wrong.