UNPKG

@walkeros/server-destination-aws

Version:

AWS server destination for walkerOS

1 lines 2.61 kB
"use strict";var e,t,r,s=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,a={};((e,t)=>{for(var r in t)s(e,r,{get:t[r],enumerable:!0})})(a,{DestinationFirehose:()=>d,destinationFirehose:()=>g,destinationFirehoseExamples:()=>w}),module.exports=(e=a,((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let c of o(t))i.call(e,c)||c===r||s(e,c,{get:()=>t[c],enumerable:!(a=n(t,c))||a.enumerable});return e})(s({},"__esModule",{value:!0}),e));var c=Object.getOwnPropertyNames,l=(t={"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 r||(0,t[c(t)[0]])((r={exports:{}}).exports,r),r.exports});var{version:p}=l();var u=require("@aws-sdk/client-firehose");function m(e){const{streamName:t,region:r="eu-central-1",config:s={}}=e;t||function(e){throw new Error(String(e))}("Firehose: Config custom streamName missing"),s.region||(s.region=r);return{streamName:t,client:e.client||new u.FirehoseClient(s),region:r}}var f=async function(e,{config:t,collector:r,wrap:s}){const{firehose:n}=t.settings||{};n&&async function(e,t){const{client:r,streamName:s}=t;if(!r)return{queue:e};const n=e.map(({event:e})=>({Data:Buffer.from(JSON.stringify(e))}));await r.send(new u.PutRecordBatchCommand({DeliveryStreamName:s,Records:n}))}([{event:e}],n)},d={},g={type:"aws-firehose",config:{},async init({config:e}){const t=function(e={}){const t=e.settings||{};return t.firehose&&(t.firehose=m(t.firehose)),{settings:t}}(e);return typeof t.settings==typeof{}&&t},push:async(e,{config:t,collector:r,wrap:s})=>await f(e,{config:t,collector:r,wrap:s})},w={};//# sourceMappingURL=index.js.map