UNPKG

@walkeros/server-destination-aws

Version:

AWS server destination for walkerOS

1 lines 2.19 kB
var e,t,s=Object.getOwnPropertyNames,r=(e={"package.json"(e,t){t.exports={name:"@walkeros/core",description:"Core types and platform-agnostic utilities for walkerOS",version:"0.0.8",main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",license:"MIT",files:["dist/**"],scripts:{build:"tsup --silent",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",dev:"jest --watchAll --colors",lint:'tsc && eslint "**/*.ts*"',test:"jest",update:"npx npm-check-updates -u && npm update"},dependencies:{},devDependencies:{},repository:{url:"git+https://github.com/elbwalker/walkerOS.git",directory:"packages/core"},author:"elbwalker <hello@elbwalker.com>",homepage:"https://github.com/elbwalker/walkerOS#readme",bugs:{url:"https://github.com/elbwalker/walkerOS/issues"},keywords:["walker","walkerOS","analytics","tracking","data collection","measurement","data privacy","privacy friendly","web analytics","product analytics","core","types","utils"],funding:[{type:"GitHub Sponsors",url:"https://github.com/sponsors/elbwalker"}]}}},function(){return t||(0,e[s(e)[0]])((t={exports:{}}).exports,t),t.exports});var{version:n}=r();import{FirehoseClient as i,PutRecordBatchCommand as o}from"@aws-sdk/client-firehose";function a(e){const{streamName:t,region:s="eu-central-1",config:r={}}=e;t||function(e){throw new Error(String(e))}("Firehose: Config custom streamName missing"),r.region||(r.region=s);return{streamName:t,client:e.client||new i(r),region:s}}var c=async function(e,{config:t,collector:s,wrap:r}){const{firehose:n}=t.settings||{};n&&async function(e,t){const{client:s,streamName:r}=t;if(!s)return{queue:e};const n=e.map(({event:e})=>({Data:Buffer.from(JSON.stringify(e))}));await s.send(new o({DeliveryStreamName:r,Records:n}))}([{event:e}],n)},l={},p={type:"aws-firehose",config:{},async init({config:e}){const t=function(e={}){const t=e.settings||{};return t.firehose&&(t.firehose=a(t.firehose)),{settings:t}}(e);return typeof t.settings==typeof{}&&t},push:async(e,{config:t,collector:s,wrap:r})=>await c(e,{config:t,collector:s,wrap:r})},u={};export{l as DestinationFirehose,p as destinationFirehose,u as destinationFirehoseExamples};//# sourceMappingURL=index.mjs.map