Process every record from kinesis as b64 buffer

pull/218/head
Frostebite 2021-02-07 17:51:38 +00:00
parent b9cb7ebf41
commit 57b8dc34f5
2 changed files with 6 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -144,7 +144,7 @@ class AWS {
for (let index = 0; index < records.Records.length; index++) {
const element = records.Records[index];
core.info(JSON.stringify(element.Data));
core.info(Buffer.from(element.Data.toString('utf8'), 'utf8').toString());
core.info(AWS.ab2str(element.Data));
}
}
}
@ -166,5 +166,9 @@ class AWS {
core.info(`log: ${log}`);
});
}
static ab2str(buf) {
return String.fromCharCode.apply(undefined, new Uint16Array(buf));
}
}
export default AWS;