forked from elasticio/code-component
-
Notifications
You must be signed in to change notification settings - Fork 3
/
component.json
33 lines (33 loc) · 1.14 KB
/
component.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
"title": "Node.js Code",
"description": "You can write your own code and deploy it as part of integration process.",
"buildType": "docker",
"docsUrl": "http://go2.elastic.io/code-component",
"fields": {
"code": {
"viewClass": "CodeFieldView",
"label": "Code",
"required": true,
"default": "// Please note only Node.js code is supported here\nasync function run(msg, cfg, snapshot) {\n\tthis.logger.info('Incoming message is %j', msg);\n\tconst data = { result : 'Hello world!' };\n\t// You can emit as many data messages as required\n\tawait this.emit('data', { data });\n\tthis.logger.info('Execution finished');\n}"
}
},
"actions": {
"execute": {
"main": "./actions/code.js",
"title": "Executes custom code",
"metadata" : {
"out" : {}
}
}
},
"triggers": {
"executeTrigger": {
"main": "./actions/code.js",
"title": "Executes custom code",
"type": "polling",
"metadata" : {
"out" : {}
}
}
}
}