File tree Expand file tree Collapse file tree 7 files changed +290
-150
lines changed Expand file tree Collapse file tree 7 files changed +290
-150
lines changed Original file line number Diff line number Diff line change
1
+ version : 2.1
2
+ parameters :
3
+ node-version :
4
+ type : string
5
+ default : " 16.13.2"
6
+ orbs :
7
+ node : circleci/node@5.0.0
8
+ slack : circleci/slack@4.5.3
9
+ commands :
10
+ notify_on_failure :
11
+ steps :
12
+ - slack/notify :
13
+ event : fail
14
+ custom : |
15
+ {
16
+ "blocks": [
17
+ {
18
+ "type": "section",
19
+ "fields": [
20
+ {
21
+ "type": "mrkdwn",
22
+ "text": ":red_circle: *$CIRCLE_PROJECT_REPONAME*:*$CIRCLE_TAG* build failed"
23
+ }
24
+ ]
25
+ },
26
+ {
27
+ "type": "actions",
28
+ "elements": [
29
+ {
30
+ "type": "button",
31
+ "text": {
32
+ "type": "plain_text",
33
+ "text": "View Job"
34
+ },
35
+ "url": "${CIRCLE_BUILD_URL}"
36
+ }
37
+ ]
38
+ }
39
+ ]
40
+ }
41
+ notify_on_pass :
42
+ steps :
43
+ - slack/notify :
44
+ event : pass
45
+ custom : |
46
+ {
47
+ "blocks": [
48
+ {
49
+ "type": "section",
50
+ "fields": [
51
+ {
52
+ "type": "mrkdwn",
53
+ "text": ":tada: *$CIRCLE_PROJECT_REPONAME*:*$CIRCLE_TAG* was successfully built and published"
54
+ }
55
+ ]
56
+ },
57
+ {
58
+ "type": "actions",
59
+ "elements": [
60
+ {
61
+ "type": "button",
62
+ "text": {
63
+ "type": "plain_text",
64
+ "text": "View Job"
65
+ },
66
+ "url": "${CIRCLE_BUILD_URL}"
67
+ }
68
+ ]
69
+ }
70
+ ]
71
+ }
72
+ jobs :
73
+ test :
74
+ docker :
75
+ - image : circleci/node:14-stretch
76
+ steps :
77
+ - checkout
78
+ - node/install :
79
+ node-version : << pipeline.parameters.node-version >>
80
+ - run :
81
+ name : Audit Dependencies
82
+ command : npm audit --audit-level=high
83
+ - node/install-packages :
84
+ cache-path : ./node_modules
85
+ override-ci-command : npm install
86
+ - run :
87
+ name : Running Mocha Tests
88
+ command : npm test
89
+ build :
90
+ docker :
91
+ - image : circleci/node:14-stretch
92
+ user : root
93
+ steps :
94
+ - checkout
95
+ - node/install :
96
+ node-version : << pipeline.parameters.node-version >>
97
+ - setup_remote_docker :
98
+ version : 19.03.13
99
+ docker_layer_caching : true
100
+ # build and push Docker image
101
+ - run :
102
+ name : Install component-build-helper lib
103
+ command : npm install -g @elastic.io/component-build-helper
104
+ - run :
105
+ name : Build and publish docker image
106
+ command : build_component_docker
107
+ - notify_on_failure
108
+ - notify_on_pass
109
+ workflows :
110
+ test :
111
+ jobs :
112
+ - test :
113
+ name : " Running tests"
114
+ filters :
115
+ tags :
116
+ ignore : /.*/
117
+ publish_release :
118
+ jobs :
119
+ - build :
120
+ name : " Build and publish docker image"
121
+ filters :
122
+ branches :
123
+ ignore : /.*/
124
+ tags :
125
+ only : /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/
Original file line number Diff line number Diff line change
1
+ ## 3.1.2 (April 13, 2022)
2
+ * Update ` component-commons-library ` to read and upload attachments through ` Maester `
3
+ * Update ` elasticio-sailor-nodejs ` to v2.6.27
4
+ * Fix dependencies
5
+
1
6
## 3.1.1 (March 15, 2022)
2
7
* Added component pusher build script
3
8
Original file line number Diff line number Diff line change 2
2
"title" : " CSV" ,
3
3
"description" : " A comma-separated values (CSV) file stores tabular data (numbers and text) in plain-text form" ,
4
4
"docsUrl" : " https://github.com/elasticio/csv-component" ,
5
- "version" : " 3.1.1 " ,
5
+ "version" : " 3.1.2 " ,
6
6
"actions" : {
7
7
"read_action" : {
8
8
"main" : " ./lib/actions/read.js" ,
85
85
"dynamicMetadata" : true
86
86
}
87
87
}
88
- }
88
+ }
Original file line number Diff line number Diff line change @@ -45,15 +45,16 @@ async function proceedData(data, cfg) {
45
45
}
46
46
47
47
const attachmentProcessor = new AttachmentProcessor ( )
48
- let attachment
48
+ let uploadResult
49
49
try {
50
- attachment = await attachmentProcessor . uploadAttachment ( csvString )
50
+ uploadResult = await attachmentProcessor . uploadAttachment ( csvString , 'stream' )
51
51
} catch ( err ) {
52
52
this . logger . error ( `Upload attachment failed: ${ err } ` )
53
53
this . emit ( 'error' , `Upload attachment failed: ${ err } ` )
54
54
}
55
+ const attachmentUrl = `${ uploadResult . config . url } ${ uploadResult . data . objectId } ?storage_type=maester` ;
55
56
const body = {
56
- attachmentUrl : attachment . config . url ,
57
+ attachmentUrl,
57
58
type : '.csv' ,
58
59
size : Buffer . byteLength ( csvString ) ,
59
60
attachmentCreationTime : new Date ( ) ,
You can’t perform that action at this time.
0 commit comments