@wraps.dev/cli 2.2.1 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +3 -2
- package/dist/cli.js +17077 -17036
- package/dist/cli.js.map +1 -1
- package/dist/console/assets/index-BkjyJsJy.js +476 -0
- package/dist/console/assets/index-C0PNzmYT.css +1 -0
- package/dist/console/index.html +2 -2
- package/package.json +3 -2
- package/dist/console/assets/index-DpvjnbMd.css +0 -1
- package/dist/console/assets/index-JCrXm_D5.js +0 -471
- package/dist/lambda/event-processor/.bundled +0 -1
- package/dist/lambda/event-processor/index.mjs +0 -1
- package/dist/lambda/sms-event-processor/.bundled +0 -1
- package/dist/lambda/sms-event-processor/index.mjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Bundled at: 2026-01-08T22:27:09.947Z
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{randomUUID as S}from"node:crypto";import{DynamoDBClient as D,PutItemCommand as w}from"@aws-sdk/client-dynamodb";var k=new D({});async function N(m,g){let p=g.awsRequestId,l=S().slice(0,8),a=(s,o)=>{console.log(JSON.stringify({requestId:p,batchId:l,msg:s,...o}))},y=(s,o,e)=>{console.error(JSON.stringify({requestId:p,batchId:l,msg:s,error:String(o),...e}))};a("Processing SES batch",{recordCount:m.Records.length});let d=process.env.TABLE_NAME;if(!d)throw new Error("TABLE_NAME environment variable not set");for(let s of m.Records)try{let e=JSON.parse(s.body).detail,t=e.eventType||e.notificationType,r=e.mail,c=r.messageId,b=new Date(r.timestamp).getTime(),f=r.source,u=r.destination||[],T=r.commonHeaders?.subject||"";a("Processing email event",{messageId:c,eventType:t,recipientCount:u.length});let i={},n=b;t==="Send"&&e.send?i={tags:r.tags||{}}:t==="Delivery"&&e.delivery?(n=new Date(e.delivery.timestamp).getTime(),i={timestamp:e.delivery.timestamp,processingTimeMillis:e.delivery.processingTimeMillis,recipients:e.delivery.recipients,smtpResponse:e.delivery.smtpResponse,remoteMtaIp:e.delivery.remoteMtaIp}):t==="Open"&&e.open?(n=new Date(e.open.timestamp).getTime(),i={timestamp:e.open.timestamp,userAgent:e.open.userAgent,ipAddress:e.open.ipAddress}):t==="Click"&&e.click?(n=new Date(e.click.timestamp).getTime(),i={timestamp:e.click.timestamp,link:e.click.link,linkTags:e.click.linkTags||{},userAgent:e.click.userAgent,ipAddress:e.click.ipAddress}):t==="Bounce"&&e.bounce?(n=new Date(e.bounce.timestamp).getTime(),i={bounceType:e.bounce.bounceType,bounceSubType:e.bounce.bounceSubType,bouncedRecipients:e.bounce.bouncedRecipients,timestamp:e.bounce.timestamp,feedbackId:e.bounce.feedbackId}):t==="Complaint"&&e.complaint?(n=new Date(e.complaint.timestamp).getTime(),i={complainedRecipients:e.complaint.complainedRecipients,timestamp:e.complaint.timestamp,feedbackId:e.complaint.feedbackId,complaintFeedbackType:e.complaint.complaintFeedbackType,userAgent:e.complaint.userAgent}):t==="Reject"&&e.reject?i={reason:e.reject.reason}:t==="Rendering Failure"&&e.failure?i={errorMessage:e.failure.errorMessage,templateName:e.failure.templateName}:t==="DeliveryDelay"&&e.deliveryDelay?(n=new Date(e.deliveryDelay.timestamp).getTime(),i={timestamp:e.deliveryDelay.timestamp,delayType:e.deliveryDelay.delayType,expirationTime:e.deliveryDelay.expirationTime,delayedRecipients:e.deliveryDelay.delayedRecipients}):t==="Subscription"&&e.subscription&&(n=new Date(e.subscription.timestamp).getTime(),i={contactList:e.subscription.contactList,timestamp:e.subscription.timestamp,source:e.subscription.source,newTopicPreferences:e.subscription.newTopicPreferences,oldTopicPreferences:e.subscription.oldTopicPreferences}),await k.send(new w({TableName:d,Item:{messageId:{S:c},sentAt:{N:n.toString()},accountId:{S:process.env.AWS_ACCOUNT_ID||"unknown"},from:{S:f},to:{L:u.map(v=>({S:v}))},subject:{S:T},eventType:{S:t},eventData:{S:JSON.stringify(e)},additionalData:{S:JSON.stringify(i)},createdAt:{N:Date.now().toString()},expiresAt:{N:(Date.now()+2160*60*60*1e3).toString()}}})),a("Stored event",{eventType:t,messageId:c})}catch(o){y("Error processing record",o,{sqsMessageId:s.messageId})}return{statusCode:200,body:JSON.stringify({message:"Events processed successfully"})}}export{N as handler};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Bundled at: 2026-01-08T22:27:09.949Z
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{DynamoDBClient as p,PutItemCommand as g}from"@aws-sdk/client-dynamodb";var E=new p({});async function u(r){console.log("Processing SMS event from SQS:",JSON.stringify(r,null,2));let i=process.env.TABLE_NAME;if(!i)throw new Error("TABLE_NAME environment variable not set");for(let a of r.Records)try{let e=JSON.parse(a.body),t=e.eventType||e.messageStatus||"UNKNOWN",o=e.messageId,m=e.destinationPhoneNumber,d=e.originationPhoneNumber,n=e.messageBody||"",T=e.isoCountryCode||"US",c=e.messageType||"TRANSACTIONAL",S=e.eventTimestamp?new Date(e.eventTimestamp).getTime():Date.now();console.log("Processing SMS event:",{messageId:o,eventType:t,destinationNumber:m,originationNumber:d});let s={isoCountryCode:T,messageType:c};t==="TEXT_DELIVERED"||t==="TEXT_SUCCESSFUL"?s={...s,deliveryTimestamp:e.deliveryTimestamp,carrierName:e.carrierName,providerResponse:e.providerResponse}:t==="TEXT_FAILED"||t==="TEXT_INVALID"||t==="TEXT_CARRIER_UNREACHABLE"||t==="TEXT_BLOCKED"?s={...s,failureReason:e.failureReason||e.statusMessage,failureCode:e.failureCode||e.statusCode,providerResponse:e.providerResponse}:t==="TEXT_QUEUED"||t==="TEXT_SENT"?s={...s,queuedTimestamp:e.queuedTimestamp,sentTimestamp:e.sentTimestamp}:t==="TEXT_TTL_EXPIRED"&&(s={...s,expirationTimestamp:e.expirationTimestamp,ttlSeconds:e.ttlSeconds});let l=n?Math.ceil(n.length/160):1;await E.send(new g({TableName:i,Item:{messageId:{S:o},sentAt:{N:S.toString()},accountId:{S:process.env.AWS_ACCOUNT_ID||"unknown"},destinationNumber:{S:m||""},originationNumber:{S:d||""},messageBody:{S:n},eventType:{S:t},segments:{N:l.toString()},eventData:{S:JSON.stringify(e)},additionalData:{S:JSON.stringify(s)},createdAt:{N:Date.now().toString()},expiresAt:{N:(Date.now()+2160*60*60*1e3).toString()}}})),console.log(`Stored ${t} event for message ${o}`,s)}catch(e){console.error("Error processing record:",e),console.error("Record:",JSON.stringify(a,null,2))}return{statusCode:200,body:JSON.stringify({message:"SMS events processed successfully"})}}export{u as handler};
|