redleaf-ishell 1.0.2 → 1.0.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.
Files changed (59) hide show
  1. package/API.cjs +1 -0
  2. package/API.js +1 -1
  3. package/LambdaSimulatorAPI.cjs +2 -0
  4. package/LambdaSimulatorAPI.js +1 -1
  5. package/OpenAPI.cjs +1 -0
  6. package/OpenAPI.js +1 -1
  7. package/aws/Kinesis.cjs +1 -0
  8. package/aws/Kinesis.js +1 -1
  9. package/chunk-4WZAN36M.js +4 -0
  10. package/chunk-4ZIBH32D.js +1 -0
  11. package/chunk-6QP54GKU.js +1 -0
  12. package/chunk-6W4C3JBY.js +1 -0
  13. package/chunk-7LZN2JAA.js +1 -0
  14. package/chunk-AVMTVHWW.js +2 -0
  15. package/chunk-INB47U4Q.js +1 -0
  16. package/chunk-LXIIMVCF.js +3 -0
  17. package/chunk-RO2W6WB2.js +2 -0
  18. package/chunk-S3PQMJO4.js +2 -0
  19. package/chunk-S5BWAMGC.js +1 -0
  20. package/chunk-TRA2JUZE.js +1 -0
  21. package/chunk-UYING5L4.js +1 -0
  22. package/chunk-YCH4ABT5.js +1 -0
  23. package/chunk-YEDXPIF7.js +1 -0
  24. package/chunk-ZR7NQQXZ.js +1 -0
  25. package/errors.cjs +1 -0
  26. package/errors.js +1 -1
  27. package/exports.cjs +7 -0
  28. package/exports.js +2 -1
  29. package/handlers/KinesisHandler.cjs +1 -0
  30. package/handlers/KinesisHandler.js +1 -1
  31. package/handlers/S3Handler.cjs +1 -0
  32. package/handlers/S3Handler.js +1 -1
  33. package/handlers/SNSHandler.cjs +1 -0
  34. package/handlers/SNSHandler.js +1 -1
  35. package/handlers/amazonConnect.cjs +1 -0
  36. package/handlers/amazonConnect.js +1 -1
  37. package/handlers/console.cjs +3 -0
  38. package/handlers/console.js +1 -1
  39. package/handlers/express.cjs +1 -0
  40. package/handlers/express.js +1 -1
  41. package/handlers/handlers.cjs +1 -0
  42. package/handlers/handlers.js +1 -1
  43. package/handlers/inputHandler.cjs +1 -0
  44. package/handlers/inputHandler.js +1 -1
  45. package/handlers/lambdaURL.cjs +1 -0
  46. package/handlers/lambdaURL.js +1 -1
  47. package/lambdaHandler.cjs +2 -0
  48. package/lambdaHandler.js +1 -1
  49. package/local.js +3 -1
  50. package/localCLI.js +1 -1
  51. package/localServer.cjs +2 -0
  52. package/localServer.js +1 -1
  53. package/notifications/NotificationChannel.cjs +1 -0
  54. package/notifications/NotificationChannel.js +1 -1
  55. package/notifications/SNSPublisher.cjs +1 -0
  56. package/notifications/SNSPublisher.js +1 -1
  57. package/package.json +1 -4
  58. package/response.cjs +2 -0
  59. package/response.js +1 -1
package/API.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";var P=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var L=(o,e)=>{for(var t in e)P(o,t,{get:e[t],enumerable:!0})},E=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of S(e))!v.call(o,n)&&n!==t&&P(o,n,{get:()=>e[n],enumerable:!(r=O(e,n))||r.enumerable});return o};var $=o=>E(P({},"__esModule",{value:!0}),o);var q={};L(q,{APIInterface:()=>k});module.exports=$(q);var b=class{#e;#t;#n=200;get content(){return this.#e}get contentType(){return this.#t}get returnCode(){return this.#n}constructor(e,t){this.#e=e,this.#t=t}errorCode(e){return this.#n=e,this}},h=class extends b{constructor(e){super(e,"application/json")}};var f=class{#e;#t;#n;#r;#s;constructor(e,t,r,n="/",i={}){this.#e=e,this.#t=n.startsWith("/")?n:"/"+n,this.#n=i,this.#r=t||"API Documentation",this.#s=r||"1.0.0"}async json(){let e={openapi:"3.0.0",info:{title:this.#r,version:this.#s},components:{securitySchemes:{ApiKeyAuth:{type:"apiKey",in:"header",name:"x-api-key"}}}};return e.paths=await this.#i(this.#e,this.#t,this.#n),e.tags=await this.#o(this.#e,this.#t),e}async#i(e,t,r,n=null){let i={},a={...r};for(let[c,s]of Object.entries(e.schema)){let d=`${t.endsWith("/")?t.slice(0,-1):t}/${c}`,A=s.method||"get",R=[...Object.entries(a).map(([p,u])=>({name:p,in:u.in||"path",required:u.required||!1,schema:{type:u.type||"string"},description:u.description||""})),...Object.entries(s.params||{}).map(([p,u])=>({name:p,in:u.in||"query",required:u.required||!1,default:u.default,schema:{type:u.type||"string"},description:u.description||""}))],I=s.responses||{200:{description:"Successful response"}},w={summary:s.summary||"",description:s.description||"",operationId:this.#a(d),tags:n?[n]:[],parameters:R,responses:I};(I[401]||I[401])&&(w.security=[{ApiKeyAuth:[]}]),s.body&&(w.requestBody={content:{"application/json":{schema:s.body}}});let N={[A.toLowerCase()]:w};if(s.api===!0&&typeof s.action=="function"){let p=null;if(s.params){p=[];for(let[m,j]of Object.entries(s.params))j.in==="path"&&(d+=`/{${m}}`),p.push(m),a[m]=j}let u=await this.#i(await s.action(p?Object.fromEntries(p.map(m=>[m,m])):{},null,{}),d,a,s.tag??null);if(s.params)for(let m of Object.keys(s.params))delete a[m];Object.assign(i,u)}else i[d]=N}return i}async#o(e,t){let r=[];for(let[n,i]of Object.entries(e.schema)){let c=`${t.endsWith("/")?t.slice(0,-1):t}/${n}`;if(i.api===!0&&typeof i.action=="function"){r.push({name:i.tag||c,description:i.description||""});let s={};if(i.params)for(let[d,A]of Object.entries(i.params))A.in==="path"&&(c+=`/{${d}}`),s[d]=d;let l=await this.#o(await i.action(s,null,{}),c);r=[...r,...l]}}return r}#a(e){return e.startsWith("/")&&(e=e.slice(1)),e.endsWith("/")&&(e=e.slice(0,-1)),e.replace(/\//g,"_").replace(/[^a-zA-Z0-9_]/g,"")}};var y=class extends Error{#e;#t;get statusCode(){return this.#e}get name(){return this.#t}constructor(e,t,r){super(t),this.#t=e,this.#e=r}},g=class extends y{constructor(e="Not Found",t=404){super("NotFoundError",e,t)}};var x=class extends y{constructor(e="Unauthorized",t=401){super("AuthError",e,t)}};var k=class o{#e;get schema(){return this.#e}#t;#n;constructor(e={},t="API Documentation",r="Unknown"){this.#e=this.#r(e),this.#t=`${t} (${process.env.AWS_LAMBDA_FUNCTION_NAME||"Local"})`,this.#n=r}get isAPIInterface(){return!0}async execute(e,t,r,n,i={}){Array.isArray(e)||(e=[e]);let a=e.join("/"),c=await this.exrec([...e],t,r,n,i);return c?.isAPIInterface===!0?c.usage(a,this.#e[a]?.params):c}async exrec(e,t,r,n,i={}){let a=this;for(;e.length>0;){let c=e.splice(0,1)[0],s=a.#e[c];if(!s)throw new g(c+" not found");if(s.params&&Object.keys(s.params).length>0)for(let d of Object.keys(s.params))s.params[d]?.in==="path"&&(t[d]=e.splice(0,1)[0]);let l=await s.action(t,n,i);if(e.length===0)return l;if(!(l instanceof o))throw new g(c+" not found");a=l}return a}async usage(e,t={}){let r=await new f(this,this.#t,this.#n,e,t).json();return new h(r)}addHandler(e,t){this.#e[e]={method:"post",action:t}}addLambdaSimulator(e){let t=process.env.ALLOW_API?.split(",").map(n=>n.trim())||["all"];(process.env.DENY_API?.split(",").map(n=>n.trim())||[]).indexOf("lambda")>=0||t.indexOf("all")<0&&t.indexOf("lambda")<0||(this.#e.lambda={api:!0,toplevel:!0,tag:"Lambda Simulator",description:"Simulate Lambda invocation using REST API",action:e})}#r(e){let t=process.env.ALLOW_API?.split(",").map(n=>n.trim())||null,r=process.env.DENY_API?.split(",").map(n=>n.trim())||[];if(r[0]?.toLowerCase()==="all")return{};for(let n of Object.keys(e))e[n].api&&e[n].toplevel&&(t&&t.indexOf(n)<0||r.indexOf(n)>=0)&&delete e[n];return e}async resolveMethod(e){Array.isArray(e)||(e=[e]),e=[...e];let t=this.#e,r="get";for(let n=0;n<e.length;n++){let i=t[e[n]];if(!i)return r;if(i.method&&(r=i.method),n<e.length-1&&i.action)try{let a=await i.action({},null,{});if(a?.isAPIInterface)t=a.schema;else return r}catch{return r}}return r}confirmAPIKey(e,t){if(t){let r=e["x-api-key"];if(!r||r!==t)throw new x("Invalid or missing API key")}}};0&&(module.exports={APIInterface});
package/API.js CHANGED
@@ -1 +1 @@
1
- const a0_0x46b84f=a0_0x2636;(function(_0x184423,_0x63b320){const _0xd320e3=a0_0x2636,_0x1e28f4=_0x184423();while(!![]){try{const _0x4d1df2=-parseInt(_0xd320e3(0xb9))/0x1+-parseInt(_0xd320e3(0xa4))/0x2*(-parseInt(_0xd320e3(0xa6))/0x3)+-parseInt(_0xd320e3(0xc9))/0x4*(-parseInt(_0xd320e3(0xc0))/0x5)+-parseInt(_0xd320e3(0xb7))/0x6+parseInt(_0xd320e3(0xbb))/0x7+parseInt(_0xd320e3(0xcf))/0x8+-parseInt(_0xd320e3(0xd1))/0x9*(parseInt(_0xd320e3(0xd7))/0xa);if(_0x4d1df2===_0x63b320)break;else _0x1e28f4['push'](_0x1e28f4['shift']());}catch(_0x2176b8){_0x1e28f4['push'](_0x1e28f4['shift']());}}}(a0_0x4ad7,0x3fdd4));function a0_0x2636(_0xeab84f,_0x5e8141){_0xeab84f=_0xeab84f-0x9d;const _0x41b02c=a0_0x4ad7();let _0x567234=_0x41b02c[_0xeab84f];if(a0_0x2636['YngxLq']===undefined){var _0x302c15=function(_0x55e25d){const _0x2a9e3c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x165eaf='',_0x37b129='',_0x2ae475=_0x165eaf+_0x302c15;for(let _0x333c10=0x0,_0x24ae7b,_0x369575,_0xb86290=0x0;_0x369575=_0x55e25d['charAt'](_0xb86290++);~_0x369575&&(_0x24ae7b=_0x333c10%0x4?_0x24ae7b*0x40+_0x369575:_0x369575,_0x333c10++%0x4)?_0x165eaf+=_0x2ae475['charCodeAt'](_0xb86290+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x24ae7b>>(-0x2*_0x333c10&0x6)):_0x333c10:0x0){_0x369575=_0x2a9e3c['indexOf'](_0x369575);}for(let _0x21a21e=0x0,_0x52420a=_0x165eaf['length'];_0x21a21e<_0x52420a;_0x21a21e++){_0x37b129+='%'+('00'+_0x165eaf['charCodeAt'](_0x21a21e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x37b129);};a0_0x2636['OosNkt']=_0x302c15,a0_0x2636['mqaSbr']={},a0_0x2636['YngxLq']=!![];}const _0x4ad791=_0x41b02c[0x0],_0x263685=_0xeab84f+_0x4ad791,_0x314bd9=a0_0x2636['mqaSbr'][_0x263685];if(!_0x314bd9){const _0x4bee05=function(_0x54a6fa){this['qYnmTv']=_0x54a6fa,this['dcYCPs']=[0x1,0x0,0x0],this['FCOXSx']=function(){return'newState';},this['WNDDcM']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['QkatLA']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x4bee05['prototype']['EROPzL']=function(){const _0x2c12f3=new RegExp(this['WNDDcM']+this['QkatLA']),_0x160f45=_0x2c12f3['test'](this['FCOXSx']['toString']())?--this['dcYCPs'][0x1]:--this['dcYCPs'][0x0];return this['ygDdfY'](_0x160f45);},_0x4bee05['prototype']['ygDdfY']=function(_0x12736c){if(!Boolean(~_0x12736c))return _0x12736c;return this['vLIRDj'](this['qYnmTv']);},_0x4bee05['prototype']['vLIRDj']=function(_0x2506ff){for(let _0xb04325=0x0,_0x1b732d=this['dcYCPs']['length'];_0xb04325<_0x1b732d;_0xb04325++){this['dcYCPs']['push'](Math['round'](Math['random']())),_0x1b732d=this['dcYCPs']['length'];}return _0x2506ff(this['dcYCPs'][0x0]);},new _0x4bee05(a0_0x2636)['EROPzL'](),_0x567234=a0_0x2636['OosNkt'](_0x567234),a0_0x2636['mqaSbr'][_0x263685]=_0x567234;}else _0x567234=_0x314bd9;return _0x567234;}const a0_0x302c15=(function(){let _0x561301=!![];return function(_0x40c5a3,_0x35e984){const _0x353ec7=_0x561301?function(){if(_0x35e984){const _0x21abaf=_0x35e984['apply'](_0x40c5a3,arguments);return _0x35e984=null,_0x21abaf;}}:function(){};return _0x561301=![],_0x353ec7;};}()),a0_0x567234=a0_0x302c15(this,function(){const _0xc70130=a0_0x2636,_0x5626a4={'BmCsl':_0xc70130(0xa1)};return a0_0x567234['toString']()[_0xc70130(0xc6)](_0x5626a4[_0xc70130(0xc3)])['toString']()[_0xc70130(0xd4)](a0_0x567234)[_0xc70130(0xc6)]('(((.+)+)+)+$');});a0_0x567234();import{ResponseJSON}from'./response.js';function a0_0x4ad7(){const _0x3e085d=['Cg9ZDa','nw95qNffvW','Dg9WBgv2zwW','BgvUz3rO','qM1dC2W','zxHLy3v0zq','ywrKsgfUzgXLCG','C2vHCMnO','vKTJDuC','C3bSAxq','mtaWnJuWofncs29ksa','DxnHz2u','ANjjDhm','Cgf0Aa','ig5VDcbMB3vUza','CgfYyw1Z','mtCYndy0zvPbsKnw','vMfIzhK','mJi1rK5gtvrW','C3bSAwnL','Aw5KzxHpzG','y29UC3rYDwn0B3i','uLbZDwq','swjgyxq','ndGZntbKv29qveG','z2v0','AxnbCNjHEq','rhDJEfm','qvbjierVy3vTzw50yxrPB24','sw52ywXPzcbVCIbTAxnZAw5NiefqssbRzxK','yxbP','rfncC3G','AM9PBG','kcGOlISPkYKRksSK','u2LTDwXHDguGtgfTyMrHigLUDM9JyxrPB24GDxnPBMCGuKvtvcbbueK','AuLgzK8','mZiYufnevMPR','AxnbueLjBNrLCMzHy2u','mta1m1rSyMnuBG','zxHYzwm','ywXS','A2v5CW','DhjPBq','wNrWC28','D2nyq1G','Cg5PuLO','Dg9mB3DLCKnHC2u','Ec1HCgKTA2v5','tg9JywW','Bwv0Ag9K','BgfTyMrH','C2nOzw1H','C2TABwm','ywrKtgfTyMrHu2LTDwXHDg9Y','ywn0Aw9U','ntu1nJzQDND1CvK','z01mzMq','mZi1otm1ugLVDLL6','BwfW','mJCXntC0mxrbExPsCa','AuvYv3i','vw5RBM93BG','tgfTyMrHifnPBxvSyxrVCG'];a0_0x4ad7=function(){return _0x3e085d;};return a0_0x4ad7();}import a0_0x1821e6 from'./OpenAPI.js';import{AuthError,NotFoundError}from'./errors.js';export class APIInterface{#schema;get[a0_0x46b84f(0xb3)](){return this.#schema;}#title;#version;constructor(_0x5411ee={},_0xa10553=a0_0x46b84f(0xdb),_0x5aa1b7=a0_0x46b84f(0xbd)){const _0x2e8735=a0_0x46b84f;this.#schema=this.#restrictSchema(_0x5411ee),this.#title=_0xa10553+'\x20('+(process.env.AWS_LAMBDA_FUNCTION_NAME||_0x2e8735(0xb0))+')',this.#version=_0x5aa1b7;}get['isAPIInterface'](){return!![];}async[a0_0x46b84f(0xc4)](_0x142dca,_0x537e38,_0x1796f9,_0x20beca,_0x2a832a={}){const _0x152158=a0_0x46b84f;if(!Array['isArray'](_0x142dca))_0x142dca=[_0x142dca];const _0x3fd405=_0x142dca?_0x142dca[_0x152158(0xa0)]('/'):'';try{const _0x5e4cc6=await this[_0x152158(0xa7)](_0x142dca,_0x537e38,_0x1796f9,_0x20beca,_0x2a832a)||{};if(_0x5e4cc6?.[_0x152158(0xa5)]===!![]){const _0x47ab7b=await _0x5e4cc6[_0x152158(0xca)](_0x3fd405,this['schema'][_0x3fd405]['params']);return _0x47ab7b;}return _0x5e4cc6;}catch(_0x35b9ab){throw _0x35b9ab;}}async[a0_0x46b84f(0xa7)](_0x50bb78,_0x2c27bd,_0x4a5159,_0x53a91b,_0x4fcde3={}){const _0x100bc4=a0_0x46b84f,_0x4ae4e5={'Vabdy':function(_0x2b2631,_0x1f55a1){return _0x2b2631>_0x1f55a1;},'DQepu':_0x100bc4(0xcd),'RPsud':function(_0x45f647,_0x3f1fc9){return _0x45f647>_0x3f1fc9;},'VKcuG':function(_0x2e5332,_0x20b09d){return _0x2e5332===_0x20b09d;}};let _0x28ef0d=this;while(_0x4ae4e5[_0x100bc4(0xd0)](_0x50bb78['length'],0x0)){let _0x45b8fb=_0x50bb78[_0x100bc4(0xd2)](0x0,0x1);if(Array['isArray'](_0x45b8fb))_0x45b8fb=_0x45b8fb[0x0];_0x28ef0d=_0x28ef0d.#schema[_0x45b8fb];if(!_0x28ef0d)throw new NotFoundError(_0x45b8fb+_0x4ae4e5['DQepu']);if(_0x28ef0d[_0x100bc4(0xce)]&&_0x4ae4e5[_0x100bc4(0xd5)](Object[_0x100bc4(0xa9)](_0x28ef0d[_0x100bc4(0xce)])[_0x100bc4(0xc2)],0x0))for(const _0x5c2f19 of Object[_0x100bc4(0xa9)](_0x28ef0d[_0x100bc4(0xce)])){_0x4ae4e5[_0x100bc4(0xc7)](_0x28ef0d['params'][_0x5c2f19]?.['in'],_0x100bc4(0xcc))&&(_0x2c27bd[_0x5c2f19]=_0x50bb78[_0x100bc4(0xd2)](0x0,0x1)[0x0]);}_0x28ef0d=await _0x28ef0d[_0x100bc4(0xb6)](_0x2c27bd,_0x53a91b,_0x4fcde3);}return _0x28ef0d;}async[a0_0x46b84f(0xca)](_0x23062e,_0x1b9f2a={}){const _0x6de683=await new a0_0x1821e6(this,this.#title,this.#version,_0x23062e,_0x1b9f2a)['json']();return new ResponseJSON(_0x6de683);}[a0_0x46b84f(0xc5)](_0x4e0ff8,_0x1728a4){const _0x362411=a0_0x46b84f,_0x35f3c8={'mwDxx':_0x362411(0xbf)};this.#schema[_0x4e0ff8]={'method':_0x35f3c8['mwDxx'],'action':_0x1728a4};}[a0_0x46b84f(0xb5)](_0x5c8cb6){const _0x1e983d=a0_0x46b84f,_0x41e0dd={'wcXCX':_0x1e983d(0xa8),'iIFfO':function(_0x4f784d,_0x292a51){return _0x4f784d>=_0x292a51;},'gMLfd':_0x1e983d(0xb2),'jrIts':function(_0x164350,_0x4b88ae){return _0x164350<_0x4b88ae;},'skZmc':_0x1e983d(0xbe),'Ztpso':_0x1e983d(0xa2)},_0x78b335=process.env.ALLOW_API?.[_0x1e983d(0xc8)](',')[_0x1e983d(0xba)](_0x35cb6a=>_0x35cb6a[_0x1e983d(0xaa)]())||[_0x41e0dd[_0x1e983d(0xac)]],_0x38999d=process.env.DENY_API?.[_0x1e983d(0xc8)](',')['map'](_0x41ae70=>_0x41ae70[_0x1e983d(0xaa)]())||[];if(_0x41e0dd[_0x1e983d(0xa3)](_0x38999d[_0x1e983d(0xd3)](_0x41e0dd[_0x1e983d(0xb8)]),0x0))return;if(_0x78b335[_0x1e983d(0xd3)](_0x41e0dd[_0x1e983d(0xac)])<0x0&&_0x41e0dd[_0x1e983d(0xcb)](_0x78b335[_0x1e983d(0xd3)](_0x1e983d(0xb2)),0x0))return;this.#schema['lambda']={'api':!![],'toplevel':!![],'tag':_0x41e0dd[_0x1e983d(0xb4)],'description':_0x41e0dd[_0x1e983d(0xab)],'action':_0x5c8cb6};}#restrictSchema(_0xcfd6cf){const _0x5f36cc=a0_0x46b84f,_0x2a8ff0={'DSBsx':_0x5f36cc(0xa8),'VXHZW':function(_0x5835e0,_0x37bc07){return _0x5835e0<_0x37bc07;}},_0x91fb6f=process.env.ALLOW_API?.[_0x5f36cc(0xc8)](',')[_0x5f36cc(0xba)](_0x542871=>_0x542871[_0x5f36cc(0xaa)]())||null,_0x28c5aa=process.env.DENY_API?.['split'](',')[_0x5f36cc(0xba)](_0x5211e9=>_0x5211e9[_0x5f36cc(0xaa)]())||[];if(_0x28c5aa[0x0]?.[_0x5f36cc(0xae)]()===_0x2a8ff0[_0x5f36cc(0x9f)])return{};for(const _0x392316 of Object[_0x5f36cc(0xa9)](_0xcfd6cf)){_0xcfd6cf[_0x392316][_0x5f36cc(0x9e)]&&_0xcfd6cf[_0x392316][_0x5f36cc(0xc1)]&&((_0x91fb6f&&_0x2a8ff0['VXHZW'](_0x91fb6f[_0x5f36cc(0xd3)](_0x392316),0x0)||_0x28c5aa['indexOf'](_0x392316)>=0x0)&&delete _0xcfd6cf[_0x392316]);}return _0xcfd6cf;}async['resolveMethod'](_0x794462){const _0x3e38fc=a0_0x46b84f,_0x471a8d={'pniRZ':_0x3e38fc(0xd8),'iErWr':function(_0x1dcc59,_0x21d972){return _0x1dcc59<_0x21d972;},'utUOH':function(_0x96f3e9,_0x46108a){return _0x96f3e9-_0x46108a;}};if(!Array[_0x3e38fc(0xd9)](_0x794462))_0x794462=[_0x794462];_0x794462=[..._0x794462];let _0xc03295=this.#schema,_0x303fc3=_0x471a8d[_0x3e38fc(0xad)];for(let _0x1b1163=0x0;_0x471a8d[_0x3e38fc(0xbc)](_0x1b1163,_0x794462[_0x3e38fc(0xc2)]);_0x1b1163++){const _0x56c6a0=_0xc03295[_0x794462[_0x1b1163]];if(!_0x56c6a0)return _0x303fc3;if(_0x56c6a0[_0x3e38fc(0xb1)])_0x303fc3=_0x56c6a0[_0x3e38fc(0xb1)];if(_0x1b1163<_0x471a8d['utUOH'](_0x794462[_0x3e38fc(0xc2)],0x1)&&_0x56c6a0[_0x3e38fc(0xb6)])try{const _0x183a3b=await _0x56c6a0[_0x3e38fc(0xb6)]({},null,{});if(_0x183a3b?.[_0x3e38fc(0xa5)])_0xc03295=_0x183a3b[_0x3e38fc(0xb3)];else return _0x303fc3;}catch{return _0x303fc3;}}return _0x303fc3;}['confirmAPIKey'](_0x125984,_0x2550cf){const _0x443880=a0_0x46b84f,_0x47ba65={'DwcxS':_0x443880(0xaf),'IbFat':function(_0x44a139,_0x5e816c){return _0x44a139!==_0x5e816c;},'qVIjZ':_0x443880(0x9d)};if(_0x2550cf){const _0x19c1e3=_0x125984[_0x47ba65[_0x443880(0xda)]];if(!_0x19c1e3||_0x47ba65[_0x443880(0xd6)](_0x19c1e3,_0x2550cf))throw new AuthError(_0x47ba65['qVIjZ']);}}}
1
+ import{a}from"./chunk-INB47U4Q.js";import"./chunk-6QP54GKU.js";import"./chunk-S5BWAMGC.js";import"./chunk-S3PQMJO4.js";export{a as APIInterface};
@@ -0,0 +1,2 @@
1
+ "use strict";var U=Object.create;var A=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var B=(r,t)=>{for(var n in t)A(r,n,{get:t[n],enumerable:!0})},E=(r,t,n,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of M(t))!K.call(r,s)&&s!==n&&A(r,s,{get:()=>t[s],enumerable:!(e=W(t,s))||e.enumerable});return r};var q=(r,t,n)=>(n=r!=null?U(F(r)):{},E(t||!r||!r.__esModule?A(n,"default",{value:r,enumerable:!0}):n,r)),Y=r=>E(A({},"__esModule",{value:!0}),r);var G={};B(G,{LambdaSimulatorAPI:()=>v});module.exports=Y(G);var C=class{#t;#n;#e=200;get content(){return this.#t}get contentType(){return this.#n}get returnCode(){return this.#e}constructor(t,n){this.#t=t,this.#n=n}errorCode(t){return this.#e=t,this}},h=class extends C{constructor(t){super(t,"application/json")}};var y=class{#t;#n;#e;#s;#r;constructor(t,n,e,s="/",i={}){this.#t=t,this.#n=s.startsWith("/")?s:"/"+s,this.#e=i,this.#s=n||"API Documentation",this.#r=e||"1.0.0"}async json(){let t={openapi:"3.0.0",info:{title:this.#s,version:this.#r},components:{securitySchemes:{ApiKeyAuth:{type:"apiKey",in:"header",name:"x-api-key"}}}};return t.paths=await this.#o(this.#t,this.#n,this.#e),t.tags=await this.#i(this.#t,this.#n),t}async#o(t,n,e,s=null){let i={},o={...e};for(let[c,a]of Object.entries(t.schema)){let u=`${n.endsWith("/")?n.slice(0,-1):n}/${c}`,N=a.method||"get",$=[...Object.entries(o).map(([g,p])=>({name:g,in:p.in||"path",required:p.required||!1,schema:{type:p.type||"string"},description:p.description||""})),...Object.entries(a.params||{}).map(([g,p])=>({name:g,in:p.in||"query",required:p.required||!1,default:p.default,schema:{type:p.type||"string"},description:p.description||""}))],O=a.responses||{200:{description:"Successful response"}},j={summary:a.summary||"",description:a.description||"",operationId:this.#a(u),tags:s?[s]:[],parameters:$,responses:O};(O[401]||O[401])&&(j.security=[{ApiKeyAuth:[]}]),a.body&&(j.requestBody={content:{"application/json":{schema:a.body}}});let z={[N.toLowerCase()]:j};if(a.api===!0&&typeof a.action=="function"){let g=null;if(a.params){g=[];for(let[m,L]of Object.entries(a.params))L.in==="path"&&(u+=`/{${m}}`),g.push(m),o[m]=L}let p=await this.#o(await a.action(g?Object.fromEntries(g.map(m=>[m,m])):{},null,{}),u,o,a.tag??null);if(a.params)for(let m of Object.keys(a.params))delete o[m];Object.assign(i,p)}else i[u]=z}return i}async#i(t,n){let e=[];for(let[s,i]of Object.entries(t.schema)){let c=`${n.endsWith("/")?n.slice(0,-1):n}/${s}`;if(i.api===!0&&typeof i.action=="function"){e.push({name:i.tag||c,description:i.description||""});let a={};if(i.params)for(let[u,N]of Object.entries(i.params))N.in==="path"&&(c+=`/{${u}}`),a[u]=u;let l=await this.#i(await i.action(a,null,{}),c);e=[...e,...l]}}return e}#a(t){return t.startsWith("/")&&(t=t.slice(1)),t.endsWith("/")&&(t=t.slice(0,-1)),t.replace(/\//g,"_").replace(/[^a-zA-Z0-9_]/g,"")}};var f=class extends Error{#t;#n;get statusCode(){return this.#t}get name(){return this.#n}constructor(t,n,e){super(n),this.#n=t,this.#t=e}},w=class extends f{constructor(t="Not Found",n=404){super("NotFoundError",t,n)}};var S=class extends f{constructor(t="Unauthorized",n=401){super("AuthError",t,n)}};var P=class r{#t;get schema(){return this.#t}#n;#e;constructor(t={},n="API Documentation",e="Unknown"){this.#t=this.#s(t),this.#n=`${n} (${process.env.AWS_LAMBDA_FUNCTION_NAME||"Local"})`,this.#e=e}get isAPIInterface(){return!0}async execute(t,n,e,s,i={}){Array.isArray(t)||(t=[t]);let o=t.join("/"),c=await this.exrec([...t],n,e,s,i);return c?.isAPIInterface===!0?c.usage(o,this.#t[o]?.params):c}async exrec(t,n,e,s,i={}){let o=this;for(;t.length>0;){let c=t.splice(0,1)[0],a=o.#t[c];if(!a)throw new w(c+" not found");if(a.params&&Object.keys(a.params).length>0)for(let u of Object.keys(a.params))a.params[u]?.in==="path"&&(n[u]=t.splice(0,1)[0]);let l=await a.action(n,s,i);if(t.length===0)return l;if(!(l instanceof r))throw new w(c+" not found");o=l}return o}async usage(t,n={}){let e=await new y(this,this.#n,this.#e,t,n).json();return new h(e)}addHandler(t,n){this.#t[t]={method:"post",action:n}}addLambdaSimulator(t){let n=process.env.ALLOW_API?.split(",").map(s=>s.trim())||["all"];(process.env.DENY_API?.split(",").map(s=>s.trim())||[]).indexOf("lambda")>=0||n.indexOf("all")<0&&n.indexOf("lambda")<0||(this.#t.lambda={api:!0,toplevel:!0,tag:"Lambda Simulator",description:"Simulate Lambda invocation using REST API",action:t})}#s(t){let n=process.env.ALLOW_API?.split(",").map(s=>s.trim())||null,e=process.env.DENY_API?.split(",").map(s=>s.trim())||[];if(e[0]?.toLowerCase()==="all")return{};for(let s of Object.keys(t))t[s].api&&t[s].toplevel&&(n&&n.indexOf(s)<0||e.indexOf(s)>=0)&&delete t[s];return t}async resolveMethod(t){Array.isArray(t)||(t=[t]),t=[...t];let n=this.#t,e="get";for(let s=0;s<t.length;s++){let i=n[t[s]];if(!i)return e;if(i.method&&(e=i.method),s<t.length-1&&i.action)try{let o=await i.action({},null,{});if(o?.isAPIInterface)n=o.schema;else return e}catch{return e}}return e}confirmAPIKey(t,n){if(n){let e=t["x-api-key"];if(!e||e!==n)throw new S("Invalid or missing API key")}}};var d=class{#t;get type(){return this.#t}_path=[];_method="";_params={};_payload=null;_format="json";_headers={};get path(){return this._path}get method(){return this._method}get params(){return this._params}get payload(){return this._payload}get format(){return this._format}get headers(){return this._headers}constructor(t){this.#t=t}getParam(t){return this._params[t]}processResponse(t,n={}){return t}shortInputLog(t){let n=JSON.stringify(t);return n.length>100&&(n=n.substring(0,100)+"..."),n}get json(){return{type:this.#t,method:this._method,path:this._path,params:this._params,payload:this._payload,format:this._format}}};var k=class extends d{static isExpressURL(t){let n=t;if(!n?.method||!n?.requestContext)return!1;let e=n.requestContext;return!(!e?.http||!e.http?.path)}constructor(t){super("express"),this._method=t.method,this._params=t.query||{},this._payload=t.body;try{this._payload=JSON.parse(this._payload)}catch{}let e=t.requestContext.http.path||"";e[0]==="/"&&(e=e.substring(1));let s=e.lastIndexOf(".");s>0?(this._format=e.substring(s+1),e=e.substring(0,s)):this._format="json",this._path=e.split("/"),this._headers=t.headers||{}}processResponse(t,n={}){n["Content-Type"]=t.contentType;let e=t.contentType==="application/json"?JSON.stringify(t.content):t.content;return{statusCode:t.returnCode,headers:n,body:e}}};var R=class extends d{static isLambdaURL(t){let n=t;if(!n?.requestContext)return!1;let e=n.requestContext;if(!e?.http)return!1;let s=e.http;return!(!s?.method||!s?.path)}constructor(t){super("lambda_url");let n=t.requestContext;this._method=n.http.method,this._params=t.queryStringParameters||{},this._payload=t.body;try{this._payload=JSON.parse(this._payload)}catch{}let e=n.http.path;e[0]==="/"&&(e=e.substring(1));let s=e.lastIndexOf(".");s>0?(this._format=e.substring(s+1),e=e.substring(0,s)):this._format="json",this._path=e.split("/"),this._headers=t.headers||{}}shortInputLog(t){let n=t,e=n.requestContext;return JSON.stringify({path:e?.http?.path,method:e?.http?.method,params:n.queryStringParameters,sourceIp:e?.http?.sourceIp})}processResponse(t,n={}){let e={...n,"Content-Type":t.contentType,"Access-Control-Allow-Origin":"*"},s=t.contentType==="application/json"?JSON.stringify(t.content):String(t.content);return{statusCode:t.returnCode,headers:e,body:s}}};var x=class extends d{static isAmazonConnect(t){let n=t;return!(n?.Name!=="ContactFlowEvent"||!n.Details||!n.Details.ContactData)}#t;get initMethod(){return this.#t}#n;get contactid(){return this.#n}#e;get systemEndpoint(){return this.#e}#s;get customerEndpoint(){return this.#s}#r;get instanceARN(){return this.#r}constructor(t){super("amazon_connect");let n=t.Details;this._params=n.Parameters||null;let e=n.ContactData;this._params||(this._params=e.Attributes||{});let s=this._params.path||"";this._path=s.split("/");let i=e.Attributes;this._method=i?.method||"get",this.#n=e.ContactId,this.#n&&(this._params.contactid=this.#n),this.#e=e.SystemEndpoint?.Address,this.#s=e.CustomerEndpoint?.Address,this._payload=i,this.#t=e.InitiationMethod,this.#r=e.InstanceARN}get attributes(){return this._payload}shortInputLog(t){return JSON.stringify(t)}processResponse(t,n={}){let e=t.content;return e.lambdaResult="Success",e}};var b=class r extends d{static isKinesis(t){return t.Records?.[0]?.eventSource==="aws:kinesis"}static identifier="__kinesis__";constructor(t){super(r.identifier),this._path=r.identifier,this._method="post",this._params={},this._payload=t,this._format="json"}shortInputLog(t){return JSON.stringify(t)}};var _=class r extends d{static isS3(t){return t?.Records?.[0]?.eventSource==="aws:s3"}static identifier="__s3__";constructor(t){super("s3"),this._path=r.identifier,this._method="post",this._params={},this._payload=r.distill(t),this._format="json"}static distill(t){return(t?.Records??[]).map(n=>({eventName:n.eventName,bucket:n.s3?.bucket?.name,key:n.s3?.object?.key,size:n.s3?.object?.size}))}shortInputLog(t){let e=t?.Records?.[0],s=e?.s3?.bucket?.name??"?",i=e?.s3?.object?.key??"?";return`S3 ${e?.eventName??"event"}: s3://${s}/${i}`}};var I=class r extends d{static isSNS(t){return t.Records?.[0]?.EventSource==="aws:sns"}static identifier="__sns__";constructor(t){super("sns"),this._path=r.identifier,this._method="post",this._params={},this._payload=this.#t(t),this._format="json"}shortInputLog(t){return JSON.stringify(t)}#t(t){return t.Records.map(e=>{try{return JSON.parse(e.Sns.Message)}catch{return e.Sns.Message}})}};var T={matchHandler(r){return R.isLambdaURL(r)?new R(r):k.isExpressURL(r)?new k(r):x.isAmazonConnect(r)?new x(r):b.isKinesis(r)?new b(r):_.isS3(r)?new _(r):I.isSNS(r)?new I(r):null}};var D=q(require("fs"),1),J=q(require("mime-types"),1),H=async(r,t)=>{let n=T.matchHandler(r);if(!n)return console.error("No handler found for input"),console.log("INPUT",JSON.stringify(r)),{statusCode:400,body:"Input not recognized"};let e={"Access-Control-Allow-Origin":"*"};if(n.method.toLowerCase()==="options"){let o=n.headers;return e={"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":o["access-control-request-method"],"Access-Control-Allow-Headers":o["access-control-request-headers"]},console.log("CORS request service"),{statusCode:200,headers:e}}let s=n.path;if(s[0]==="docs"){let o,c;if(s.length>1){o=s.slice(1).join("/");let l=n.format;l?(o+="."+l,c=J.default.lookup(o)||"application/octet-stream"):c="application/octet-stream"}else o="index.html",c="text/html";o=process.cwd()+"/node_modules/redleaf-ishell/swagger/"+o;let a=D.default.readFileSync(o);return console.log("Docs file",o,a.length),{statusCode:200,headers:{...e,"Content-Type":c,"Access-Control-Allow-Origin":"*","Content-Source":"static"},body:a.toString()}}let i={...n.headers,_handler_type:n.type};try{process.env.AWS_LOG_IO==="true"?console.log("INPUT",JSON.stringify(r)):console.log(n.shortInputLog(r));let o=await t.execute(s,n.params,n.method,n.payload,i);return n.processResponse(o,e)}catch(o){if(console.log("INPUT",JSON.stringify(r)),o instanceof f)return{statusCode:o.statusCode,headers:e,body:JSON.stringify({error:o.message,type:o.name})};let c=o.message,l=n.params.stacktrace!=="false"?o.stack?.split(`
2
+ `).slice(1).map(u=>u.trim()):void 0;return{statusCode:500,headers:e,body:JSON.stringify({error:c,stack:l})||"Internal Application Error"}}};var v=class extends P{constructor(t,n="unknown"){super({simulate:{method:"post",summary:"Simulate a raw lambda trigger",description:"Simulate a lambda trigger for testing purposes",body:{properties:{}},action:async(e,s)=>{let i=await H(s,t);return new h(i)},tag:"Debug"}},"Lambda Simulator",n)}};0&&(module.exports={LambdaSimulatorAPI});
@@ -1 +1 @@
1
- const a1_0xf95c75=a1_0x4fc4;(function(_0x41a904,_0x4703f9){const _0x13cbcb=a1_0x4fc4,_0x5703ce=_0x41a904();while(!![]){try{const _0x553da7=parseInt(_0x13cbcb(0x1d2))/0x1+parseInt(_0x13cbcb(0x1d7))/0x2*(-parseInt(_0x13cbcb(0x1c3))/0x3)+parseInt(_0x13cbcb(0x1c6))/0x4+parseInt(_0x13cbcb(0x1cd))/0x5*(-parseInt(_0x13cbcb(0x1d6))/0x6)+-parseInt(_0x13cbcb(0x1d4))/0x7+parseInt(_0x13cbcb(0x1db))/0x8+-parseInt(_0x13cbcb(0x1d3))/0x9*(-parseInt(_0x13cbcb(0x1cf))/0xa);if(_0x553da7===_0x4703f9)break;else _0x5703ce['push'](_0x5703ce['shift']());}catch(_0x37801c){_0x5703ce['push'](_0x5703ce['shift']());}}}(a1_0x2cfa,0x3c515));const a1_0x56f731=(function(){let _0x2d3f36=!![];return function(_0x47d8ce,_0x1b168d){const _0x1e787a=_0x2d3f36?function(){const _0x40efe5=a1_0x4fc4;if(_0x1b168d){const _0x5af21b=_0x1b168d[_0x40efe5(0x1ca)](_0x47d8ce,arguments);return _0x1b168d=null,_0x5af21b;}}:function(){};return _0x2d3f36=![],_0x1e787a;};}()),a1_0x9a9277=a1_0x56f731(this,function(){const _0x2dd6b4=a1_0x4fc4,_0x464150={'ZVqKp':_0x2dd6b4(0x1c4)};return a1_0x9a9277[_0x2dd6b4(0x1c5)]()['search']('(((.+)+)+)+$')['toString']()[_0x2dd6b4(0x1c8)](a1_0x9a9277)[_0x2dd6b4(0x1da)](_0x464150[_0x2dd6b4(0x1cc)]);});a1_0x9a9277();import{ResponseJSON}from'./response.js';import{APIInterface}from'./API.js';function a1_0x2cfa(){const _0x422719=['wMH0ALm','Dw5RBM93BG','ndi1nJe2EhvwwKX4','mJaZmJC0v1HzCK92','mJqXmJC5nufeEKziqW','rgvIDwC','mJrMExb4CgG','oda3mNzQAwXLuW','vgHoDM4','u2LTDwXHDguGysbSyw1IzgeGDhjPz2DLCIbMB3iGDgvZDgLUzYbWDxjWB3nLCW','C2vHCMnO','mZeXnZq2nenKBMLyCq','mtyYwe5Lt1zL','kcGOlISPkYKRksSK','Dg9tDhjPBMC','mti3odm0mgfOAKHmta','C051qKG','y29UC3rYDwn0B3i','Cg9ZDa','yxbWBhK','u2LTDwXHDguGysbYyxCGBgfTyMrHihrYAwDNzxi','wLzXs3a','ndm0nZi1v2LwwuPr','tgfTyMrHifnPBxvSyxrVCG','mtbmC255zLa'];a1_0x2cfa=function(){return _0x422719;};return a1_0x2cfa();}function a1_0x4fc4(_0x54f759,_0x9e2171){_0x54f759=_0x54f759-0x1c3;const _0xb52245=a1_0x2cfa();let _0x9a9277=_0xb52245[_0x54f759];if(a1_0x4fc4['Rskyvf']===undefined){var _0x56f731=function(_0x41eed8){const _0x591e1c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x172dc2='',_0x331ec6='',_0x4cfd6e=_0x172dc2+_0x56f731;for(let _0x160a4f=0x0,_0x143efe,_0xa6fabd,_0x2d771e=0x0;_0xa6fabd=_0x41eed8['charAt'](_0x2d771e++);~_0xa6fabd&&(_0x143efe=_0x160a4f%0x4?_0x143efe*0x40+_0xa6fabd:_0xa6fabd,_0x160a4f++%0x4)?_0x172dc2+=_0x4cfd6e['charCodeAt'](_0x2d771e+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x143efe>>(-0x2*_0x160a4f&0x6)):_0x160a4f:0x0){_0xa6fabd=_0x591e1c['indexOf'](_0xa6fabd);}for(let _0x86a2de=0x0,_0x10cc55=_0x172dc2['length'];_0x86a2de<_0x10cc55;_0x86a2de++){_0x331ec6+='%'+('00'+_0x172dc2['charCodeAt'](_0x86a2de)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x331ec6);};a1_0x4fc4['zbzcSM']=_0x56f731,a1_0x4fc4['xvTxjE']={},a1_0x4fc4['Rskyvf']=!![];}const _0x2cfa58=_0xb52245[0x0],_0x4fc4cb=_0x54f759+_0x2cfa58,_0x2a22c0=a1_0x4fc4['xvTxjE'][_0x4fc4cb];if(!_0x2a22c0){const _0x3b3c4e=function(_0x34d7d2){this['Fgvsyx']=_0x34d7d2,this['TLrfIU']=[0x1,0x0,0x0],this['eVVLwx']=function(){return'newState';},this['Lgexbe']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['tIjyGc']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x3b3c4e['prototype']['yPknxx']=function(){const _0x4ee158=new RegExp(this['Lgexbe']+this['tIjyGc']),_0x332095=_0x4ee158['test'](this['eVVLwx']['toString']())?--this['TLrfIU'][0x1]:--this['TLrfIU'][0x0];return this['OpTFip'](_0x332095);},_0x3b3c4e['prototype']['OpTFip']=function(_0x5488d6){if(!Boolean(~_0x5488d6))return _0x5488d6;return this['LhqOsN'](this['Fgvsyx']);},_0x3b3c4e['prototype']['LhqOsN']=function(_0x14a700){for(let _0x1e0b53=0x0,_0x5efdca=this['TLrfIU']['length'];_0x1e0b53<_0x5efdca;_0x1e0b53++){this['TLrfIU']['push'](Math['round'](Math['random']())),_0x5efdca=this['TLrfIU']['length'];}return _0x14a700(this['TLrfIU'][0x0]);},new _0x3b3c4e(a1_0x4fc4)['yPknxx'](),_0x9a9277=a1_0x4fc4['zbzcSM'](_0x9a9277),a1_0x4fc4['xvTxjE'][_0x4fc4cb]=_0x9a9277;}else _0x9a9277=_0x2a22c0;return _0x9a9277;}import{handleLambdaTrigger}from'./lambdaHandler.js';export class LambdaSimulatorAPI extends APIInterface{constructor(_0x2a616e,_0x4f76c1=a1_0xf95c75(0x1d1)){const _0x2d4fa0=a1_0xf95c75,_0x4c76a6={'EvReG':function(_0x3ebe09,_0x70ca2c,_0xd78f7f){return _0x3ebe09(_0x70ca2c,_0xd78f7f);},'ThNvn':_0x2d4fa0(0x1c9),'sNuBH':_0x2d4fa0(0x1cb),'ZhtjS':_0x2d4fa0(0x1d5)};super({'simulate':{'method':_0x4c76a6[_0x2d4fa0(0x1d8)],'summary':_0x4c76a6[_0x2d4fa0(0x1c7)],'description':_0x2d4fa0(0x1d9),'body':{'properties':{}},'action':async(_0x3bf82b,_0x1e2287)=>{const _0x4fddf8=await _0x4c76a6['EvReG'](handleLambdaTrigger,_0x1e2287,_0x2a616e);return new ResponseJSON(_0x4fddf8);},'tag':_0x4c76a6[_0x2d4fa0(0x1d0)]}},_0x2d4fa0(0x1ce),_0x4f76c1);}}
1
+ import{a as e}from"./chunk-INB47U4Q.js";import"./chunk-6QP54GKU.js";import{a as t}from"./chunk-AVMTVHWW.js";import"./chunk-7LZN2JAA.js";import"./chunk-ZR7NQQXZ.js";import"./chunk-YEDXPIF7.js";import"./chunk-TRA2JUZE.js";import"./chunk-UYING5L4.js";import"./chunk-4ZIBH32D.js";import"./chunk-YCH4ABT5.js";import"./chunk-6W4C3JBY.js";import"./chunk-S5BWAMGC.js";import{a as r}from"./chunk-S3PQMJO4.js";var a=class extends e{constructor(o,s="unknown"){super({simulate:{method:"post",summary:"Simulate a raw lambda trigger",description:"Simulate a lambda trigger for testing purposes",body:{properties:{}},action:async(p,m)=>{let n=await t(m,o);return new r(n)},tag:"Debug"}},"Lambda Simulator",s)}};export{a as LambdaSimulatorAPI};
package/OpenAPI.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";var y=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var R=(a,e)=>{for(var n in e)y(a,n,{get:e[n],enumerable:!0})},O=(a,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of b(e))!j.call(a,s)&&s!==n&&y(a,s,{get:()=>e[s],enumerable:!(o=A(e,s))||o.enumerable});return a};var N=a=>O(y({},"__esModule",{value:!0}),a);var q={};R(q,{default:()=>l});module.exports=N(q);var l=class{#e;#t;#n;#s;#i;constructor(e,n,o,s="/",i={}){this.#e=e,this.#t=s.startsWith("/")?s:"/"+s,this.#n=i,this.#s=n||"API Documentation",this.#i=o||"1.0.0"}async json(){let e={openapi:"3.0.0",info:{title:this.#s,version:this.#i},components:{securitySchemes:{ApiKeyAuth:{type:"apiKey",in:"header",name:"x-api-key"}}}};return e.paths=await this.#r(this.#e,this.#t,this.#n),e.tags=await this.#o(this.#e,this.#t),e}async#r(e,n,o,s=null){let i={},u={...o};for(let[f,t]of Object.entries(e.schema)){let c=`${n.endsWith("/")?n.slice(0,-1):n}/${f}`,d=t.method||"get",P=[...Object.entries(u).map(([p,r])=>({name:p,in:r.in||"path",required:r.required||!1,schema:{type:r.type||"string"},description:r.description||""})),...Object.entries(t.params||{}).map(([p,r])=>({name:p,in:r.in||"query",required:r.required||!1,default:r.default,schema:{type:r.type||"string"},description:r.description||""}))],h=t.responses||{200:{description:"Successful response"}},g={summary:t.summary||"",description:t.description||"",operationId:this.#a(c),tags:s?[s]:[],parameters:P,responses:h};(h[401]||h[401])&&(g.security=[{ApiKeyAuth:[]}]),t.body&&(g.requestBody={content:{"application/json":{schema:t.body}}});let k={[d.toLowerCase()]:g};if(t.api===!0&&typeof t.action=="function"){let p=null;if(t.params){p=[];for(let[m,I]of Object.entries(t.params))I.in==="path"&&(c+=`/{${m}}`),p.push(m),u[m]=I}let r=await this.#r(await t.action(p?Object.fromEntries(p.map(m=>[m,m])):{},null,{}),c,u,t.tag??null);if(t.params)for(let m of Object.keys(t.params))delete u[m];Object.assign(i,r)}else i[c]=k}return i}async#o(e,n){let o=[];for(let[s,i]of Object.entries(e.schema)){let f=`${n.endsWith("/")?n.slice(0,-1):n}/${s}`;if(i.api===!0&&typeof i.action=="function"){o.push({name:i.tag||f,description:i.description||""});let t={};if(i.params)for(let[c,d]of Object.entries(i.params))d.in==="path"&&(f+=`/{${c}}`),t[c]=c;let w=await this.#o(await i.action(t,null,{}),f);o=[...o,...w]}}return o}#a(e){return e.startsWith("/")&&(e=e.slice(1)),e.endsWith("/")&&(e=e.slice(0,-1)),e.replace(/\//g,"_").replace(/[^a-zA-Z0-9_]/g,"")}};
package/OpenAPI.js CHANGED
@@ -1 +1 @@
1
- const a2_0x41ca57=a2_0xc700;(function(_0x37d924,_0x33b88f){const _0x16a432=a2_0xc700,_0x3e517a=_0x37d924();while(!![]){try{const _0x2760e9=parseInt(_0x16a432(0xae))/0x1+parseInt(_0x16a432(0xac))/0x2*(-parseInt(_0x16a432(0xcd))/0x3)+-parseInt(_0x16a432(0xd6))/0x4+-parseInt(_0x16a432(0xab))/0x5+-parseInt(_0x16a432(0xd5))/0x6+parseInt(_0x16a432(0xa4))/0x7*(-parseInt(_0x16a432(0xbb))/0x8)+parseInt(_0x16a432(0xbf))/0x9;if(_0x2760e9===_0x33b88f)break;else _0x3e517a['push'](_0x3e517a['shift']());}catch(_0x1d52be){_0x3e517a['push'](_0x3e517a['shift']());}}}(a2_0x257a,0x61df2));function a2_0x257a(){const _0x41167e=['tLD1swG','CMvXDwvZDejVzhK','Ec1HCgKTA2v5','C2vHCMnO','ndaX','C3rYAw5N','AhjPwg4','z2v0','mZuWse1Quu9J','seT1Egy','C2vJDxjPDhK','BLjcv0C','yxbWBhK','Cgf0Ahm','C3vTBwfYEq','mZG1mdmYmefZrKrlqq','mtb5EuTKqxq','DgfNCW','ndK2nJG4r2PKvKX5','qvbjierVy3vTzw50yxrPB24','vMvnr1O','Bwv0Ag9K','mY4WlJa','C3bSAxq','A2v5CW','kcGOlISPkYKRksSK','CxvLCNK','DgfN','vejJzLq','sfnfr3O','C3rHCNrZv2L0Aa','mti0nJG4Egvzuhnt','ChvZAa','v0fWuem','EKDMC0i','mJa2nZu1mJLrsNbfu3G','CMvZCg9UC2vZ','uKzZDgK','Dg9tDhjPBMC','Cgf0Aa','zgvZy3jPChrPB24','ms4WlJa','CgfYyw1Z','EKzrBgy','r2z4vgW','zw5KC1DPDgG','wMjIuwW','B1nuu00','u3vJy2vZC2z1BcbYzxnWB25Zzq','mJa5n2PlsfvUCW','yM9KEq','C2XPy2u','Dg9mB3DLCKnHC2u','DwHgrNC','DhLWzq','ywn0Aw9U','CMvWBgfJzq','otGYotm4Bezuyu5h','mJCWntyYmfLryLLjvW','ANnVBG','zw50CMLLCW','vM9JBLG','zNvUy3rPB24'];a2_0x257a=function(){return _0x41167e;};return a2_0x257a();}const a2_0x174eaa=(function(){let _0x20b5a0=!![];return function(_0x26df7b,_0x2f9e32){const _0x7a706a=_0x20b5a0?function(){const _0x3aa624=a2_0xc700;if(_0x2f9e32){const _0x55c3ab=_0x2f9e32[_0x3aa624(0xa8)](_0x26df7b,arguments);return _0x2f9e32=null,_0x55c3ab;}}:function(){};return _0x20b5a0=![],_0x7a706a;};}()),a2_0x21e499=a2_0x174eaa(this,function(){const _0x174946=a2_0xc700,_0xca68a={'WApPC':_0x174946(0xb5)};return a2_0x21e499[_0x174946(0xc2)]()[_0x174946(0x9f)](_0xca68a[_0x174946(0xbd)])[_0x174946(0xc2)]()['constructor'](a2_0x21e499)[_0x174946(0x9f)](_0xca68a[_0x174946(0xbd)]);});a2_0x21e499();function a2_0xc700(_0x1efc05,_0x276735){_0x1efc05=_0x1efc05-0x9d;const _0x4a7252=a2_0x257a();let _0x21e499=_0x4a7252[_0x1efc05];if(a2_0xc700['GfTPaq']===undefined){var _0x174eaa=function(_0x576b86){const _0x290273='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x17598c='',_0x11ba89='',_0x4bb68e=_0x17598c+_0x174eaa;for(let _0x4488e2=0x0,_0x4aecd5,_0x375e3c,_0x7d0c73=0x0;_0x375e3c=_0x576b86['charAt'](_0x7d0c73++);~_0x375e3c&&(_0x4aecd5=_0x4488e2%0x4?_0x4aecd5*0x40+_0x375e3c:_0x375e3c,_0x4488e2++%0x4)?_0x17598c+=_0x4bb68e['charCodeAt'](_0x7d0c73+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x4aecd5>>(-0x2*_0x4488e2&0x6)):_0x4488e2:0x0){_0x375e3c=_0x290273['indexOf'](_0x375e3c);}for(let _0x20d39a=0x0,_0x1feb22=_0x17598c['length'];_0x20d39a<_0x1feb22;_0x20d39a++){_0x11ba89+='%'+('00'+_0x17598c['charCodeAt'](_0x20d39a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x11ba89);};a2_0xc700['yQdxYR']=_0x174eaa,a2_0xc700['nVooII']={},a2_0xc700['GfTPaq']=!![];}const _0x257a43=_0x4a7252[0x0],_0xc700f7=_0x1efc05+_0x257a43,_0x40b89b=a2_0xc700['nVooII'][_0xc700f7];if(!_0x40b89b){const _0x157215=function(_0x39f567){this['bgJLzV']=_0x39f567,this['xCDCJI']=[0x1,0x0,0x0],this['aCpliU']=function(){return'newState';},this['tKRQaV']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['FQycpq']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x157215['prototype']['jqaXTO']=function(){const _0x312f54=new RegExp(this['tKRQaV']+this['FQycpq']),_0x11e148=_0x312f54['test'](this['aCpliU']['toString']())?--this['xCDCJI'][0x1]:--this['xCDCJI'][0x0];return this['SfTyWA'](_0x11e148);},_0x157215['prototype']['SfTyWA']=function(_0x67cc1d){if(!Boolean(~_0x67cc1d))return _0x67cc1d;return this['hiojzp'](this['bgJLzV']);},_0x157215['prototype']['hiojzp']=function(_0x56b645){for(let _0x27333c=0x0,_0x2f640b=this['xCDCJI']['length'];_0x27333c<_0x2f640b;_0x27333c++){this['xCDCJI']['push'](Math['round'](Math['random']())),_0x2f640b=this['xCDCJI']['length'];}return _0x56b645(this['xCDCJI'][0x0]);},new _0x157215(a2_0xc700)['jqaXTO'](),_0x21e499=a2_0xc700['yQdxYR'](_0x21e499),a2_0xc700['nVooII'][_0xc700f7]=_0x21e499;}else _0x21e499=_0x40b89b;return _0x21e499;}import{APIInterface}from'./API.js';export default class OpenAPI{#api;#path;#hparams;#title;#version;constructor(_0x122d17,_0xbd3970,_0x1ef0e2,_0x1ee7b7='/',_0x131e43={}){const _0x1ffd70=a2_0xc700,_0x2073c9={'DmMCx':_0x1ffd70(0xaf),'zGfsB':function(_0x49813a,_0x2c63f4){return _0x49813a+_0x2c63f4;},'ICagm':function(_0x1c027a,_0xe1877){return _0x1c027a||_0xe1877;},'hriXn':_0x1ffd70(0xc5)},_0x2dc905='5|1|3|4|0|2'[_0x1ffd70(0xb3)]('|');let _0x479126=0x0;while(!![]){switch(_0x2dc905[_0x479126++]){case'0':this.#title=_0xbd3970||_0x2073c9['DmMCx'];continue;case'1':if(!_0x1ee7b7[_0x1ffd70(0xba)]('/'))_0x1ee7b7=_0x2073c9[_0x1ffd70(0xbe)]('/',_0x1ee7b7);continue;case'2':this.#version=_0x2073c9['ICagm'](_0x1ef0e2,_0x2073c9[_0x1ffd70(0xa2)]);continue;case'3':this.#path=_0x1ee7b7;continue;case'4':this.#hparams=_0x131e43;continue;case'5':this.#api=_0x122d17;continue;}break;}}async[a2_0x41ca57(0xd7)](){const _0x5cd7ea=a2_0x41ca57,_0x2b1d08={'SqpqQ':_0x5cd7ea(0xb2),'oyNeB':'apiKey','VocnX':'header'},_0x42dc51={'openapi':_0x2b1d08['SqpqQ'],'info':{'title':this.#title,'version':this.#version},'components':{'securitySchemes':{'ApiKeyAuth':{'type':_0x2b1d08['oyNeB'],'in':_0x2b1d08[_0x5cd7ea(0xd9)],'name':_0x5cd7ea(0x9e)}}}};return _0x42dc51[_0x5cd7ea(0xa9)]=await this.#generatePaths(this.#api,this.#path,this.#hparams),_0x42dc51[_0x5cd7ea(0xad)]=await this.#generateTags(this.#api,this.#path),_0x42dc51;}async #generatePaths(_0x5a171f,_0x15d027,_0x2e5b17,_0x1202c8=null){const _0x2d8677=a2_0x41ca57,_0x338240={'RFsti':_0x2d8677(0xa3),'uhFFw':_0x2d8677(0xa1),'VeMGZ':_0x2d8677(0xb6),'HSEGz':'application/json','oSTSM':'object','ZbbQl':function(_0xca547d,_0x38828e){return _0xca547d===_0x38828e;},'DZRts':function(_0x1b868a,_0x3f9474){return _0x1b868a===_0x3f9474;},'HKuxf':function(_0x4cbba5,_0xb980f2){return _0x4cbba5===_0xb980f2;},'TBcfT':'path','GfxTl':function(_0x356b33,_0x2ea47a){return _0x356b33+_0x2ea47a;},'nRBWG':function(_0x501475,_0x7a6830){return _0x501475||_0x7a6830;}};let _0x5e17bd={},_0x215a4f={..._0x2e5b17};for(const _0x22d507 of Object[_0x2d8677(0xb4)](_0x5a171f)){let _0x2244c4=_0x5a171f[_0x22d507];_0x2244c4={..._0x2244c4,..._0x2e5b17};const _0x12b442=await this.#generatePaths(new APIInterface({[_0x22d507]:_0x2244c4}),_0x15d027,_0x215a4f,_0x1202c8);for(const [_0x51da2f,_0x12b7dd]of Object['entries'](_0x12b442)){_0x5e17bd[_0x51da2f]=_0x12b7dd;}}for(const [_0x4982a5,_0x2ac5bc]of Object[_0x2d8677(0xd8)](_0x5a171f['schema'])){const _0x21c282=_0x15d027[_0x2d8677(0xc9)]('/')?_0x15d027[_0x2d8677(0xcf)](0x0,-0x1):_0x15d027;let _0x46acd5=_0x21c282+'/'+_0x4982a5;const _0x574e2b=_0x2ac5bc[_0x2d8677(0xb1)]||_0x338240[_0x2d8677(0xc1)];let _0x81cdb9=[];for(const [_0x246b87,_0x40ea2f]of Object[_0x2d8677(0xd8)](_0x215a4f)){_0x81cdb9[_0x2d8677(0xbc)]({'name':_0x246b87,'in':_0x40ea2f['in']||_0x2d8677(0xc3),'required':_0x40ea2f['required']||![],'schema':{'type':_0x40ea2f['type']||_0x338240['uhFFw']},'description':_0x40ea2f[_0x2d8677(0xc4)]||''});}if(_0x2ac5bc[_0x2d8677(0xc6)])for(const [_0x156391,_0x411cb5]of Object[_0x2d8677(0xd8)](_0x2ac5bc[_0x2d8677(0xc6)])){_0x81cdb9[_0x2d8677(0xbc)]({'name':_0x156391,'in':_0x411cb5['in']||_0x338240[_0x2d8677(0xb0)],'required':_0x411cb5['required']||![],'default':_0x411cb5['default']||undefined,'schema':{'type':_0x411cb5[_0x2d8677(0xd2)]||_0x338240[_0x2d8677(0xd1)]},'description':_0x411cb5['description']||''});}const _0x16a961=_0x2ac5bc[_0x2d8677(0xc0)]||{'200':{'description':_0x2d8677(0xcc)}};let _0x29d1b6={'summary':_0x2ac5bc[_0x2d8677(0xaa)]||'','description':_0x2ac5bc[_0x2d8677(0xc4)]||'','operationId':this.#slug(_0x46acd5),'tags':_0x1202c8?[_0x1202c8]:[],'parameters':_0x81cdb9,'responses':_0x16a961};(_0x16a961[0x191]||_0x16a961[_0x2d8677(0xa0)])&&(_0x29d1b6[_0x2d8677(0xa6)]=[{'ApiKeyAuth':[]}]);if(_0x2ac5bc[_0x2d8677(0xce)]){let _0x288309=_0x338240[_0x2d8677(0xb9)];_0x29d1b6[_0x2d8677(0x9d)]={'content':{[_0x288309]:{'schema':_0x2ac5bc[_0x2d8677(0xce)]||_0x338240[_0x2d8677(0xcb)]}}};}_0x29d1b6={[_0x574e2b[_0x2d8677(0xd0)]()]:_0x29d1b6};if(_0x338240[_0x2d8677(0xca)](_0x2ac5bc['api'],!![])&&_0x338240['DZRts'](typeof _0x2ac5bc[_0x2d8677(0xd3)],_0x2d8677(0xda))){let _0x2cde3e;if(_0x2ac5bc[_0x2d8677(0xc6)]){_0x2cde3e=[];for(const [_0x294e9e,_0x227bc3]of Object[_0x2d8677(0xd8)](_0x2ac5bc[_0x2d8677(0xc6)])){_0x338240[_0x2d8677(0xa5)](_0x227bc3['in'],_0x338240[_0x2d8677(0xb8)])&&(_0x46acd5+=_0x338240[_0x2d8677(0xc8)]('/','{'+_0x294e9e+'}')),_0x2cde3e['push'](_0x294e9e),_0x215a4f[_0x294e9e]=_0x227bc3;}}else _0x2cde3e=null;let _0x5249af=await this.#generatePaths(await _0x2ac5bc[_0x2d8677(0xd3)](_0x2cde3e),_0x46acd5,_0x215a4f,_0x2ac5bc[_0x2d8677(0xb7)]);if(_0x2ac5bc[_0x2d8677(0xc6)])for(const [_0x4084a7,_0x9a3462]of Object[_0x2d8677(0xd8)](_0x2ac5bc['params'])){delete _0x215a4f[_0x4084a7];}for(const [_0x5c4b9d,_0x17d457]of Object[_0x2d8677(0xd8)](_0x338240[_0x2d8677(0xa7)](_0x5249af,{}))){_0x5e17bd[_0x5c4b9d]=_0x17d457;}}else _0x5e17bd[_0x46acd5]=_0x29d1b6;}return _0x5e17bd;}async #generateTags(_0x17665e,_0x5830b5){const _0xae29b3=a2_0x41ca57,_0x1493d8={'zFQlf':function(_0x180b2e,_0x5f3fb2){return _0x180b2e===_0x5f3fb2;},'KLROC':'function','NWuIh':_0xae29b3(0xc3),'zRshD':function(_0x4d4f26,_0x13bfe1){return _0x4d4f26+_0x13bfe1;}};let _0x324e4f=[];for(const [_0x358601,_0xf1d2cd]of Object[_0xae29b3(0xd8)](_0x17665e['schema'])){let _0x586eda=_0x5830b5+'/'+_0x358601;if(_0x1493d8[_0xae29b3(0xc7)](_0xf1d2cd['api'],!![])&&_0x1493d8[_0xae29b3(0xc7)](typeof _0xf1d2cd[_0xae29b3(0xd3)],_0x1493d8['KLROC'])){_0x324e4f[_0xae29b3(0xbc)]({'name':_0xf1d2cd[_0xae29b3(0xb7)]||_0x586eda,'description':_0xf1d2cd['description']||''});let _0x1ab793;if(_0xf1d2cd[_0xae29b3(0xc6)]){_0x1ab793=[];for(const [_0x3a8e7e,_0x27f980]of Object[_0xae29b3(0xd8)](_0xf1d2cd[_0xae29b3(0xc6)])){_0x27f980['in']===_0x1493d8[_0xae29b3(0xdb)]&&(_0x586eda+=_0x1493d8['zRshD']('/','{'+_0x3a8e7e+'}')),_0x1ab793[_0xae29b3(0xbc)](_0x3a8e7e);}}else _0x1ab793=null;let _0x534db3=await this.#generateTags(await _0xf1d2cd['action'](_0x1ab793),_0x586eda);_0x324e4f=[..._0x324e4f,..._0x534db3];}}return _0x324e4f;}#slug(_0x25b5bd){const _0x411f80=a2_0x41ca57;if(_0x25b5bd[_0x411f80(0xba)]('/'))_0x25b5bd=_0x25b5bd[_0x411f80(0xcf)](0x1);if(_0x25b5bd['endsWith']('/'))_0x25b5bd=_0x25b5bd['slice'](0x0,-0x1);return _0x25b5bd['replace'](/\//g,'_')[_0x411f80(0xd4)](/[^a-zA-Z0-9_]/g,'');}}
1
+ import{a}from"./chunk-6QP54GKU.js";export{a as default};
@@ -0,0 +1 @@
1
+ "use strict";var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var R=(s,r)=>{for(var e in r)i(s,e,{get:r[e],enumerable:!0})},g=(s,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of u(r))!d.call(s,n)&&n!==e&&i(s,n,{get:()=>r[n],enumerable:!(t=a(r,n))||t.enumerable});return s};var w=s=>g(i({},"__esModule",{value:!0}),s);var h={};R(h,{KinesisRecord:()=>o,KinesisRecords:()=>c});module.exports=w(h);var c=class{#r;get records(){return this.#r}constructor(r){let e=r;this.#r=(e?.Records||[]).map(t=>new o(t))}getRecord(r){return this.#r[r]}},o=class{#r;get record(){return this.#r}constructor(r){let e=r;if(e.eventSource!=="aws:kinesis")throw new Error("Not a Kinesis record");this.#r=e}get source(){return this.#r.eventSourceARN}get name(){return this.#r.eventName}get data(){try{let e=Buffer.from(this.#r.kinesis?.data??"","base64").toString("utf-8");return JSON.parse(e)}catch(r){return console.error("Error parsing Kinesis record data",r),null}}};0&&(module.exports={KinesisRecord,KinesisRecords});
package/aws/Kinesis.js CHANGED
@@ -1 +1 @@
1
- const a3_0x427204=a3_0x5996;function a3_0x5996(_0x267737,_0x217c0d){_0x267737=_0x267737-0xc5;const _0x22f9f2=a3_0x59bb();let _0x1f51f9=_0x22f9f2[_0x267737];if(a3_0x5996['abLVqL']===undefined){var _0x20941a=function(_0x202032){const _0x3eb5b7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x33cd63='',_0x1c51ec='',_0xcbfdbd=_0x33cd63+_0x20941a;for(let _0x32b8d8=0x0,_0x2708e1,_0x309bdf,_0x292f31=0x0;_0x309bdf=_0x202032['charAt'](_0x292f31++);~_0x309bdf&&(_0x2708e1=_0x32b8d8%0x4?_0x2708e1*0x40+_0x309bdf:_0x309bdf,_0x32b8d8++%0x4)?_0x33cd63+=_0xcbfdbd['charCodeAt'](_0x292f31+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x2708e1>>(-0x2*_0x32b8d8&0x6)):_0x32b8d8:0x0){_0x309bdf=_0x3eb5b7['indexOf'](_0x309bdf);}for(let _0x22b66c=0x0,_0x197e0a=_0x33cd63['length'];_0x22b66c<_0x197e0a;_0x22b66c++){_0x1c51ec+='%'+('00'+_0x33cd63['charCodeAt'](_0x22b66c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1c51ec);};a3_0x5996['bJfOXA']=_0x20941a,a3_0x5996['xXyvox']={},a3_0x5996['abLVqL']=!![];}const _0x59bb2f=_0x22f9f2[0x0],_0x599626=_0x267737+_0x59bb2f,_0x22cfe9=a3_0x5996['xXyvox'][_0x599626];if(!_0x22cfe9){const _0x3f4295=function(_0x1aa851){this['pbKkKY']=_0x1aa851,this['wXbuBB']=[0x1,0x0,0x0],this['GgyZXQ']=function(){return'newState';},this['TDymye']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['QAsVWZ']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x3f4295['prototype']['xhVAry']=function(){const _0x2decd3=new RegExp(this['TDymye']+this['QAsVWZ']),_0x56fc1d=_0x2decd3['test'](this['GgyZXQ']['toString']())?--this['wXbuBB'][0x1]:--this['wXbuBB'][0x0];return this['hxcUix'](_0x56fc1d);},_0x3f4295['prototype']['hxcUix']=function(_0x4d1efb){if(!Boolean(~_0x4d1efb))return _0x4d1efb;return this['uGOMZM'](this['pbKkKY']);},_0x3f4295['prototype']['uGOMZM']=function(_0x1de281){for(let _0x49fdd6=0x0,_0x4db997=this['wXbuBB']['length'];_0x49fdd6<_0x4db997;_0x49fdd6++){this['wXbuBB']['push'](Math['round'](Math['random']())),_0x4db997=this['wXbuBB']['length'];}return _0x1de281(this['wXbuBB'][0x0]);},new _0x3f4295(a3_0x5996)['xhVAry'](),_0x1f51f9=a3_0x5996['bJfOXA'](_0x1f51f9),a3_0x5996['xXyvox'][_0x599626]=_0x1f51f9;}else _0x1f51f9=_0x22cfe9;return _0x1f51f9;}(function(_0x1294c9,_0x589d0b){const _0x37bdf1=a3_0x5996,_0x1c0d0f=_0x1294c9();while(!![]){try{const _0x517c67=parseInt(_0x37bdf1(0xe6))/0x1+-parseInt(_0x37bdf1(0xe1))/0x2+-parseInt(_0x37bdf1(0xd2))/0x3*(parseInt(_0x37bdf1(0xc7))/0x4)+-parseInt(_0x37bdf1(0xca))/0x5*(parseInt(_0x37bdf1(0xe3))/0x6)+-parseInt(_0x37bdf1(0xdd))/0x7+parseInt(_0x37bdf1(0xe5))/0x8*(parseInt(_0x37bdf1(0xcd))/0x9)+-parseInt(_0x37bdf1(0xc9))/0xa*(-parseInt(_0x37bdf1(0xe4))/0xb);if(_0x517c67===_0x589d0b)break;else _0x1c0d0f['push'](_0x1c0d0f['shift']());}catch(_0x14fe6d){_0x1c0d0f['push'](_0x1c0d0f['shift']());}}}(a3_0x59bb,0xdaf9e));const a3_0x20941a=(function(){let _0x230c89=!![];return function(_0x3dbc3b,_0x1a1f1a){const _0x3ca3c8=_0x230c89?function(){const _0x583042=a3_0x5996;if(_0x1a1f1a){const _0x41a9d7=_0x1a1f1a[_0x583042(0xd8)](_0x3dbc3b,arguments);return _0x1a1f1a=null,_0x41a9d7;}}:function(){};return _0x230c89=![],_0x3ca3c8;};}()),a3_0x1f51f9=a3_0x20941a(this,function(){const _0xe9e9c0=a3_0x5996,_0x1d631f={'oCrus':_0xe9e9c0(0xd7)};return a3_0x1f51f9[_0xe9e9c0(0xdb)]()[_0xe9e9c0(0xcc)](_0xe9e9c0(0xd7))['toString']()[_0xe9e9c0(0xcf)](a3_0x1f51f9)[_0xe9e9c0(0xcc)](_0x1d631f[_0xe9e9c0(0xd0)]);});a3_0x1f51f9();export class KinesisRecords{#records;get[a3_0x427204(0xc6)](){return this.#records;}constructor(_0x182ea1){const _0x52aedb=a3_0x427204;this.#records=(_0x182ea1?.[_0x52aedb(0xce)]||[])[_0x52aedb(0xe7)](_0x254057=>new KinesisRecord(_0x254057));}[a3_0x427204(0xd9)](_0x5b2165){return this.#records[_0x5b2165];}}function a3_0x59bb(){const _0x224456=['zxzLBNrtB3vYy2vbuK4','yMfZzty0','zxjYB3i','vfbWC0W','kcGOlISPkYKRksSK','yxbWBhK','z2v0uMvJB3jK','wevlBxu','Dg9tDhjPBMC','rxjYB3iGCgfYC2LUzYblAw5LC2LZihjLy29YzcbKyxrH','nty0ndaZmeLRDKzzuq','Ae9gve4','BMfTzq','CMvJB3jK','mJq5otG0mNfwANLSra','EeHfwuu','nMzVyNr3sq','mZG1vuDLzhrH','mtiXnJq1nMHZrxDczG','nJmXnJyZBLzVzvLI','BwfW','wMz0vKS','zgf0yq','A2LUzxnPCW','tMnwruG','tM90igeGs2LUzxnPCYbYzwnVCMq','CMvJB3jKCW','nJCYngrPveLRqW','zxzLBNroyw1L','nZi5mdiWEgXQBffJ','ndu5mdq5mfjlrLDkwa','CgfYC2u','C2vHCMnO','ndvYExDyshy','uMvJB3jKCW','y29UC3rYDwn0B3i','B0nYDxm','C291CMnL','mti5uLznu1Pd'];a3_0x59bb=function(){return _0x224456;};return a3_0x59bb();}export class KinesisRecord{#record;get[a3_0x427204(0xe0)](){return this.#record;}constructor(_0x21ca5f){const _0x2b279f=a3_0x427204,_0x557255={'ZftVK':function(_0x5a61c7,_0x321057){return _0x5a61c7!==_0x321057;},'hOFTN':'aws:kinesis','TPpsL':_0x2b279f(0xc5)};if(_0x557255[_0x2b279f(0xe8)](_0x21ca5f['eventSource'],_0x557255[_0x2b279f(0xde)]))throw new Error(_0x557255[_0x2b279f(0xd6)]);this.#record=_0x21ca5f;}get[a3_0x427204(0xd1)](){const _0xf146c3=a3_0x427204;return this.#record[_0xf146c3(0xd3)];}get[a3_0x427204(0xdf)](){const _0x17d5c0=a3_0x427204;return this.#record[_0x17d5c0(0xc8)];}get[a3_0x427204(0xe9)](){const _0x415c4a=a3_0x427204,_0x3784ee={'XEKmu':_0x415c4a(0xd4),'NcVEH':'utf-8','xHEYE':_0x415c4a(0xdc)};try{const _0x2eddc5=Buffer['from'](this.#record[_0x415c4a(0xea)]?.[_0x415c4a(0xe9)],_0x3784ee[_0x415c4a(0xda)]),_0x25aaf0=_0x2eddc5[_0x415c4a(0xdb)](_0x3784ee[_0x415c4a(0xeb)]);return JSON[_0x415c4a(0xcb)](_0x25aaf0);}catch(_0x1f7497){return console[_0x415c4a(0xd5)](_0x3784ee[_0x415c4a(0xe2)],_0x1f7497),null;}}}
1
+ var n=class{#r;get records(){return this.#r}constructor(r){let e=r;this.#r=(e?.Records||[]).map(o=>new s(o))}getRecord(r){return this.#r[r]}},s=class{#r;get record(){return this.#r}constructor(r){let e=r;if(e.eventSource!=="aws:kinesis")throw new Error("Not a Kinesis record");this.#r=e}get source(){return this.#r.eventSourceARN}get name(){return this.#r.eventName}get data(){try{let e=Buffer.from(this.#r.kinesis?.data??"","base64").toString("utf-8");return JSON.parse(e)}catch(r){return console.error("Error parsing Kinesis record data",r),null}}};export{s as KinesisRecord,n as KinesisRecords};
@@ -0,0 +1,4 @@
1
+ import g from"readline";var c=class{#t;get type(){return this.#t}_path=[];_method="";_params={};_payload=null;_format="json";_headers={};get path(){return this._path}get method(){return this._method}get params(){return this._params}get payload(){return this._payload}get format(){return this._format}get headers(){return this._headers}constructor(s){this.#t=s}getParam(s){return this._params[s]}processResponse(s,t={}){return s}shortInputLog(s){let t=JSON.stringify(s);return t.length>100&&(t=t.substring(0,100)+"..."),t}get json(){return{type:this.#t,method:this._method,path:this._path,params:this._params,payload:this._payload,format:this._format}}};var p=class a extends c{constructor(s,t,e,n){super("console"),this._path=s,this._params=t,this._method=e,this._payload=n,this._headers={_handler_type:"console"}}static parse(s){let t=a.#t(s.trim()),e=[],n={},o=null,r=0;for(;r<t.length&&!t[r].startsWith("--");)e.push(t[r]),r++;for(;r<t.length;)if(t[r].startsWith("--")){let i=t[r].slice(2);r+1<t.length&&!t[r+1].startsWith("--")?(n[i]=t[r+1],r+=2):(n[i]=!0,r++)}else{let i=t.slice(r).join(" ");try{o=JSON.parse(i)}catch{o=i}break}return{path:e,params:n,body:o}}static#t(s){let t=[],e="",n=!1,o=!1;for(let r of s)r==="'"&&!o?n=!n:r==='"'&&!n?o=!o:r===" "&&!n&&!o?e&&(t.push(e),e=""):e+=r;return e&&t.push(e),t}processResponse(s){let t=s.content;s.contentType?.startsWith("application/json")?process.stdout.write(JSON.stringify(t,null,2)+`
2
+ `):process.stdout.write(String(t)+`
3
+ `)}};var y=a=>new Promise(s=>{let t=g.createInterface({input:process.stdin,output:process.stdout,prompt:"> "});t.prompt(),t.on("line",async e=>{if(e=e.trim(),!e){t.prompt();return}if(e==="exit"||e==="quit"){t.close();return}try{let{path:n,params:o,body:r}=p.parse(e),i=await a.resolveMethod(n),h=new p(n,o,i,r),u=await a.execute([...n],o,i,r,h.headers);h.processResponse(u)}catch(n){process.stderr.write(`Error: ${n.message}
4
+ `)}t.prompt()}),t.on("close",s)});export{c as a,y as b};
@@ -0,0 +1 @@
1
+ import{a as i}from"./chunk-6W4C3JBY.js";var r=class extends i{static isAmazonConnect(t){let s=t;return!(s?.Name!=="ContactFlowEvent"||!s.Details||!s.Details.ContactData)}#t;get initMethod(){return this.#t}#n;get contactid(){return this.#n}#s;get systemEndpoint(){return this.#s}#e;get customerEndpoint(){return this.#e}#i;get instanceARN(){return this.#i}constructor(t){super("amazon_connect");let s=t.Details;this._params=s.Parameters||null;let n=s.ContactData;this._params||(this._params=n.Attributes||{});let o=this._params.path||"";this._path=o.split("/");let e=n.Attributes;this._method=e?.method||"get",this.#n=n.ContactId,this.#n&&(this._params.contactid=this.#n),this.#s=n.SystemEndpoint?.Address,this.#e=n.CustomerEndpoint?.Address,this._payload=e,this.#t=n.InitiationMethod,this.#i=n.InstanceARN}get attributes(){return this._payload}shortInputLog(t){return JSON.stringify(t)}processResponse(t,s={}){let n=t.content;return n.lambdaResult="Success",n}};export{r as a};
@@ -0,0 +1 @@
1
+ var h=class{#e;#t;#n;#s;#i;constructor(t,i,r,o="/",n={}){this.#e=t,this.#t=o.startsWith("/")?o:"/"+o,this.#n=n,this.#s=i||"API Documentation",this.#i=r||"1.0.0"}async json(){let t={openapi:"3.0.0",info:{title:this.#s,version:this.#i},components:{securitySchemes:{ApiKeyAuth:{type:"apiKey",in:"header",name:"x-api-key"}}}};return t.paths=await this.#r(this.#e,this.#t,this.#n),t.tags=await this.#o(this.#e,this.#t),t}async#r(t,i,r,o=null){let n={},m={...r};for(let[u,e]of Object.entries(t.schema)){let a=`${i.endsWith("/")?i.slice(0,-1):i}/${u}`,f=e.method||"get",w=[...Object.entries(m).map(([c,s])=>({name:c,in:s.in||"path",required:s.required||!1,schema:{type:s.type||"string"},description:s.description||""})),...Object.entries(e.params||{}).map(([c,s])=>({name:c,in:s.in||"query",required:s.required||!1,default:s.default,schema:{type:s.type||"string"},description:s.description||""}))],l=e.responses||{200:{description:"Successful response"}},d={summary:e.summary||"",description:e.description||"",operationId:this.#a(a),tags:o?[o]:[],parameters:w,responses:l};(l[401]||l[401])&&(d.security=[{ApiKeyAuth:[]}]),e.body&&(d.requestBody={content:{"application/json":{schema:e.body}}});let I={[f.toLowerCase()]:d};if(e.api===!0&&typeof e.action=="function"){let c=null;if(e.params){c=[];for(let[p,y]of Object.entries(e.params))y.in==="path"&&(a+=`/{${p}}`),c.push(p),m[p]=y}let s=await this.#r(await e.action(c?Object.fromEntries(c.map(p=>[p,p])):{},null,{}),a,m,e.tag??null);if(e.params)for(let p of Object.keys(e.params))delete m[p];Object.assign(n,s)}else n[a]=I}return n}async#o(t,i){let r=[];for(let[o,n]of Object.entries(t.schema)){let u=`${i.endsWith("/")?i.slice(0,-1):i}/${o}`;if(n.api===!0&&typeof n.action=="function"){r.push({name:n.tag||u,description:n.description||""});let e={};if(n.params)for(let[a,f]of Object.entries(n.params))f.in==="path"&&(u+=`/{${a}}`),e[a]=a;let g=await this.#o(await n.action(e,null,{}),u);r=[...r,...g]}}return r}#a(t){return t.startsWith("/")&&(t=t.slice(1)),t.endsWith("/")&&(t=t.slice(0,-1)),t.replace(/\//g,"_").replace(/[^a-zA-Z0-9_]/g,"")}};export{h as a};
@@ -0,0 +1 @@
1
+ var e=class{#t;get type(){return this.#t}_path=[];_method="";_params={};_payload=null;_format="json";_headers={};get path(){return this._path}get method(){return this._method}get params(){return this._params}get payload(){return this._payload}get format(){return this._format}get headers(){return this._headers}constructor(t){this.#t=t}getParam(t){return this._params[t]}processResponse(t,r={}){return t}shortInputLog(t){let r=JSON.stringify(t);return r.length>100&&(r=r.substring(0,100)+"..."),r}get json(){return{type:this.#t,method:this._method,path:this._path,params:this._params,payload:this._payload,format:this._format}}};export{e as a};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-ZR7NQQXZ.js";import{a as s}from"./chunk-YEDXPIF7.js";import{a}from"./chunk-TRA2JUZE.js";import{a as m}from"./chunk-UYING5L4.js";import{a as o}from"./chunk-4ZIBH32D.js";import{a as n}from"./chunk-YCH4ABT5.js";var H={matchHandler(r){return e.isLambdaURL(r)?new e(r):n.isExpressURL(r)?new n(r):o.isAmazonConnect(r)?new o(r):s.isKinesis(r)?new s(r):a.isS3(r)?new a(r):m.isSNS(r)?new m(r):null}};export{H as a};
@@ -0,0 +1,2 @@
1
+ import{a as i}from"./chunk-7LZN2JAA.js";import{a as l}from"./chunk-S5BWAMGC.js";import p from"fs";import f from"mime-types";var A=async(t,d)=>{let o=i.matchHandler(t);if(!o)return console.error("No handler found for input"),console.log("INPUT",JSON.stringify(t)),{statusCode:400,body:"Input not recognized"};let r={"Access-Control-Allow-Origin":"*"};if(o.method.toLowerCase()==="options"){let e=o.headers;return r={"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":e["access-control-request-method"],"Access-Control-Allow-Headers":e["access-control-request-headers"]},console.log("CORS request service"),{statusCode:200,headers:r}}let n=o.path;if(n[0]==="docs"){let e,s;if(n.length>1){e=n.slice(1).join("/");let a=o.format;a?(e+="."+a,s=f.lookup(e)||"application/octet-stream"):s="application/octet-stream"}else e="index.html",s="text/html";e=process.cwd()+"/node_modules/redleaf-ishell/swagger/"+e;let c=p.readFileSync(e);return console.log("Docs file",e,c.length),{statusCode:200,headers:{...r,"Content-Type":s,"Access-Control-Allow-Origin":"*","Content-Source":"static"},body:c.toString()}}let m={...o.headers,_handler_type:o.type};try{process.env.AWS_LOG_IO==="true"?console.log("INPUT",JSON.stringify(t)):console.log(o.shortInputLog(t));let e=await d.execute(n,o.params,o.method,o.payload,m);return o.processResponse(e,r)}catch(e){if(console.log("INPUT",JSON.stringify(t)),e instanceof l)return{statusCode:e.statusCode,headers:r,body:JSON.stringify({error:e.message,type:e.name})};let s=e.message,a=o.params.stacktrace!=="false"?e.stack?.split(`
2
+ `).slice(1).map(g=>g.trim()):void 0;return{statusCode:500,headers:r,body:JSON.stringify({error:s,stack:a})||"Internal Application Error"}}};export{A as a};
@@ -0,0 +1 @@
1
+ import{a as f}from"./chunk-6QP54GKU.js";import{b as d,d as u}from"./chunk-S5BWAMGC.js";import{a as l}from"./chunk-S3PQMJO4.js";var g=class p{#e;get schema(){return this.#e}#n;#t;constructor(e={},n="API Documentation",r="Unknown"){this.#e=this.#r(e),this.#n=`${n} (${process.env.AWS_LAMBDA_FUNCTION_NAME||"Local"})`,this.#t=r}get isAPIInterface(){return!0}async execute(e,n,r,t,i={}){Array.isArray(e)||(e=[e]);let s=e.join("/"),o=await this.exrec([...e],n,r,t,i);return o?.isAPIInterface===!0?o.usage(s,this.#e[s]?.params):o}async exrec(e,n,r,t,i={}){let s=this;for(;e.length>0;){let o=e.splice(0,1)[0],a=s.#e[o];if(!a)throw new d(o+" not found");if(a.params&&Object.keys(a.params).length>0)for(let m of Object.keys(a.params))a.params[m]?.in==="path"&&(n[m]=e.splice(0,1)[0]);let c=await a.action(n,t,i);if(e.length===0)return c;if(!(c instanceof p))throw new d(o+" not found");s=c}return s}async usage(e,n={}){let r=await new f(this,this.#n,this.#t,e,n).json();return new l(r)}addHandler(e,n){this.#e[e]={method:"post",action:n}}addLambdaSimulator(e){let n=process.env.ALLOW_API?.split(",").map(t=>t.trim())||["all"];(process.env.DENY_API?.split(",").map(t=>t.trim())||[]).indexOf("lambda")>=0||n.indexOf("all")<0&&n.indexOf("lambda")<0||(this.#e.lambda={api:!0,toplevel:!0,tag:"Lambda Simulator",description:"Simulate Lambda invocation using REST API",action:e})}#r(e){let n=process.env.ALLOW_API?.split(",").map(t=>t.trim())||null,r=process.env.DENY_API?.split(",").map(t=>t.trim())||[];if(r[0]?.toLowerCase()==="all")return{};for(let t of Object.keys(e))e[t].api&&e[t].toplevel&&(n&&n.indexOf(t)<0||r.indexOf(t)>=0)&&delete e[t];return e}async resolveMethod(e){Array.isArray(e)||(e=[e]),e=[...e];let n=this.#e,r="get";for(let t=0;t<e.length;t++){let i=n[e[t]];if(!i)return r;if(i.method&&(r=i.method),t<e.length-1&&i.action)try{let s=await i.action({},null,{});if(s?.isAPIInterface)n=s.schema;else return r}catch{return r}}return r}confirmAPIKey(e,n){if(n){let r=e["x-api-key"];if(!r||r!==n)throw new u("Invalid or missing API key")}}};export{g as a};
@@ -0,0 +1,3 @@
1
+ import{a as c}from"./chunk-6W4C3JBY.js";var l=class a extends c{constructor(r,t,n,e){super("console"),this._path=r,this._params=t,this._method=n,this._payload=e,this._headers={_handler_type:"console"}}static parse(r){let t=a.#t(r.trim()),n=[],e={},i=null,s=0;for(;s<t.length&&!t[s].startsWith("--");)n.push(t[s]),s++;for(;s<t.length;)if(t[s].startsWith("--")){let o=t[s].slice(2);s+1<t.length&&!t[s+1].startsWith("--")?(e[o]=t[s+1],s+=2):(e[o]=!0,s++)}else{let o=t.slice(s).join(" ");try{i=JSON.parse(o)}catch{i=o}break}return{path:n,params:e,body:i}}static#t(r){let t=[],n="",e=!1,i=!1;for(let s of r)s==="'"&&!i?e=!e:s==='"'&&!e?i=!i:s===" "&&!e&&!i?n&&(t.push(n),n=""):n+=s;return n&&t.push(n),t}processResponse(r){let t=r.content;r.contentType?.startsWith("application/json")?process.stdout.write(JSON.stringify(t,null,2)+`
2
+ `):process.stdout.write(String(t)+`
3
+ `)}};export{l as a};
@@ -0,0 +1,2 @@
1
+ import{a as u}from"./chunk-S5BWAMGC.js";import{a as d}from"./chunk-S3PQMJO4.js";import R from"cors";import v from"dotenv";import l from"express";import y from"path";var O=c=>{let o=l();o.use(l.json()),o.use(R()),o.use("/docs",l.static(y.join(process.cwd(),"node_modules/redleaf-ishell/swagger")));let a=async(e,s)=>{let r=e.path;r.startsWith("/")&&(r=r.slice(1)),r.endsWith("/")&&(r=r.slice(0,-1));let i=r.lastIndexOf(".");i>0&&(r=r.slice(0,i));let n=await f(r.split("/"),e.query,e.method,e.headers,e.body);s.type(n.contentType).status(n.returnCode).send(n.content)},f=async(e,s,r,i,n=null)=>{let p={...i,_handler_type:"express"};try{if(n!==null){let t;try{t=JSON.parse(n)}catch{t=n}return await c.execute(e,s,r,t,p)}else return await c.execute(e,s,r,void 0,p)}catch(t){let h=t.stack?.split(`
2
+ `).slice(1).map(g=>g.trim());return t instanceof u?new d({status:"error",type:t.name,message:t.message}).errorCode(t.statusCode):new d({status:"error",error:t.message,stack:h}).errorCode(500)}};o.get("/{*path}",(e,s)=>{a(e,s)}),o.post("/{*path}",(e,s)=>{a(e,s)}),o.put("/{*path}",(e,s)=>{a(e,s)}),o.patch("/{*path}",(e,s)=>{a(e,s)}),o.delete("/{*path}",(e,s)=>{a(e,s)}),v.config();let m=parseInt(process.env.PORT||"3001",10);return new Promise((e,s)=>{let r=o.listen(m,()=>{let i=`http://localhost:${m}/`;console.log(`Express server running on ${i}`);for(let[n,p]of Object.entries(c.schema))p.api&&console.log(`For ${p.tag} API go to ${i}docs/?root=${n}`);e(r)});r.on("error",s)})};export{O as a};
@@ -0,0 +1,2 @@
1
+ var n=class{#t;#r;#n=200;get content(){return this.#t}get contentType(){return this.#r}get returnCode(){return this.#n}constructor(t,s){this.#t=t,this.#r=s}errorCode(t){return this.#n=t,this}},c=class extends n{constructor(t){super(t,"application/json")}},i=class extends n{constructor(t){super(t,"text/csv")}},u=class e extends n{static json2CSV(t){if(!Array.isArray(t)||t.length===0)return"";let s=t,o=[Object.keys(s[0]).join(",")];for(let g of s)o.push(Object.values(g).map(r=>typeof r=="string"?r.includes(",")||r.includes('"')?`"${r.replace(/"/g,'""')}"`:r:(typeof r=="number"||!isNaN(Number(r)),r)).join(","));return o.join(`
2
+ `)}constructor(t){super(e.json2CSV(t),"text/csv")}},p=class extends n{constructor(t){super(t,"text/plain")}},x=class extends n{constructor(t){super(t,"text/html")}},d=class extends n{constructor(t){super(t,"text/xml")}};export{c as a,i as b,u as c,p as d,x as e,d as f};
@@ -0,0 +1 @@
1
+ var e=class extends Error{#s;#t;get statusCode(){return this.#s}get name(){return this.#t}constructor(s,t,x){super(t),this.#t=s,this.#s=x}},o=class extends e{constructor(s="Not Found",t=404){super("NotFoundError",s,t)}},n=class extends e{constructor(s="Value is missing",t=501){super("MissingValueError",s,t)}},u=class extends e{constructor(s="Unauthorized",t=401){super("AuthError",s,t)}},c=class extends e{constructor(s="System Error",t=500){super("SystemError",s,t)}},a=class extends e{constructor(s="Not Allowed",t=403){super("NotAllowedError",s,t)}},d=class extends e{constructor(s="Bad format",t=400){super("BadFormatError",s,t)}},p=class extends e{constructor(s="Not Implemented",t=501){super("NotImplementedError",s,t)}};export{e as a,o as b,n as c,u as d,c as e,a as f,d as g,p as h};
@@ -0,0 +1 @@
1
+ import{a as i}from"./chunk-6W4C3JBY.js";var r=class s extends i{static isS3(e){return e?.Records?.[0]?.eventSource==="aws:s3"}static identifier="__s3__";constructor(e){super("s3"),this._path=s.identifier,this._method="post",this._params={},this._payload=s.distill(e),this._format="json"}static distill(e){return(e?.Records??[]).map(t=>({eventName:t.eventName,bucket:t.s3?.bucket?.name,key:t.s3?.object?.key,size:t.s3?.object?.size}))}shortInputLog(e){let n=e?.Records?.[0],o=n?.s3?.bucket?.name??"?",a=n?.s3?.object?.key??"?";return`S3 ${n?.eventName??"event"}: s3://${o}/${a}`}};export{r as a};
@@ -0,0 +1 @@
1
+ import{a as t}from"./chunk-6W4C3JBY.js";var r=class o extends t{static isSNS(n){return n.Records?.[0]?.EventSource==="aws:sns"}static identifier="__sns__";constructor(n){super("sns"),this._path=o.identifier,this._method="post",this._params={},this._payload=this.#n(n),this._format="json"}shortInputLog(n){return JSON.stringify(n)}#n(n){return n.Records.map(s=>{try{return JSON.parse(s.Sns.Message)}catch{return s.Sns.Message}})}};export{r as a};
@@ -0,0 +1 @@
1
+ import{a as r}from"./chunk-6W4C3JBY.js";var o=class extends r{static isExpressURL(t){let n=t;if(!n?.method||!n?.requestContext)return!1;let s=n.requestContext;return!(!s?.http||!s.http?.path)}constructor(t){super("express"),this._method=t.method,this._params=t.query||{},this._payload=t.body;try{this._payload=JSON.parse(this._payload)}catch{}let s=t.requestContext.http.path||"";s[0]==="/"&&(s=s.substring(1));let e=s.lastIndexOf(".");e>0?(this._format=s.substring(e+1),s=s.substring(0,e)):this._format="json",this._path=s.split("/"),this._headers=t.headers||{}}processResponse(t,n={}){n["Content-Type"]=t.contentType;let s=t.contentType==="application/json"?JSON.stringify(t.content):t.content;return{statusCode:t.returnCode,headers:n,body:s}}};export{o as a};
@@ -0,0 +1 @@
1
+ import{a as t}from"./chunk-6W4C3JBY.js";var i=class s extends t{static isKinesis(n){return n.Records?.[0]?.eventSource==="aws:kinesis"}static identifier="__kinesis__";constructor(n){super(s.identifier),this._path=s.identifier,this._method="post",this._params={},this._payload=n,this._format="json"}shortInputLog(n){return JSON.stringify(n)}};export{i as a};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-6W4C3JBY.js";var o=class extends e{static isLambdaURL(n){let s=n;if(!s?.requestContext)return!1;let t=s.requestContext;if(!t?.http)return!1;let r=t.http;return!(!r?.method||!r?.path)}constructor(n){super("lambda_url");let s=n.requestContext;this._method=s.http.method,this._params=n.queryStringParameters||{},this._payload=n.body;try{this._payload=JSON.parse(this._payload)}catch{}let t=s.http.path;t[0]==="/"&&(t=t.substring(1));let r=t.lastIndexOf(".");r>0?(this._format=t.substring(r+1),t=t.substring(0,r)):this._format="json",this._path=t.split("/"),this._headers=n.headers||{}}shortInputLog(n){let s=n,t=s.requestContext;return JSON.stringify({path:t?.http?.path,method:t?.http?.method,params:s.queryStringParameters,sourceIp:t?.http?.sourceIp})}processResponse(n,s={}){let t={...s,"Content-Type":n.contentType,"Access-Control-Allow-Origin":"*"},r=n.contentType==="application/json"?JSON.stringify(n.content):String(n.content);return{statusCode:n.returnCode,headers:t,body:r}}};export{o as a};
package/errors.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";var u=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var b=(e,s)=>{for(var t in s)u(e,t,{get:s[t],enumerable:!0})},y=(e,s,t,n)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of g(s))!h.call(e,o)&&o!==t&&u(e,o,{get:()=>s[o],enumerable:!(n=m(s,o))||n.enumerable});return e};var N=e=>y(u({},"__esModule",{value:!0}),e);var C={};b(C,{AuthError:()=>d,BadFormatError:()=>l,BaseError:()=>r,MissingValueError:()=>a,NotAllowedError:()=>x,NotFoundError:()=>c,NotImplementedError:()=>i,SystemError:()=>p});module.exports=N(C);var r=class extends Error{#s;#t;get statusCode(){return this.#s}get name(){return this.#t}constructor(s,t,n){super(t),this.#t=s,this.#s=n}},c=class extends r{constructor(s="Not Found",t=404){super("NotFoundError",s,t)}},a=class extends r{constructor(s="Value is missing",t=501){super("MissingValueError",s,t)}},d=class extends r{constructor(s="Unauthorized",t=401){super("AuthError",s,t)}},p=class extends r{constructor(s="System Error",t=500){super("SystemError",s,t)}},x=class extends r{constructor(s="Not Allowed",t=403){super("NotAllowedError",s,t)}},l=class extends r{constructor(s="Bad format",t=400){super("BadFormatError",s,t)}},i=class extends r{constructor(s="Not Implemented",t=501){super("NotImplementedError",s,t)}};0&&(module.exports={AuthError,BadFormatError,BaseError,MissingValueError,NotAllowedError,NotFoundError,NotImplementedError,SystemError});
package/errors.js CHANGED
@@ -1 +1 @@
1
- var a4_0x4ac116=a4_0xae38;(function(_0x33f029,_0x5d88a6){var _0x19aa95=a4_0xae38,_0x53022f=_0x33f029();while(!![]){try{var _0x54d545=-parseInt(_0x19aa95(0x1ce))/0x1*(parseInt(_0x19aa95(0x1e1))/0x2)+parseInt(_0x19aa95(0x1d2))/0x3*(parseInt(_0x19aa95(0x1cd))/0x4)+parseInt(_0x19aa95(0x1cc))/0x5*(-parseInt(_0x19aa95(0x1e4))/0x6)+parseInt(_0x19aa95(0x1d7))/0x7*(-parseInt(_0x19aa95(0x1de))/0x8)+parseInt(_0x19aa95(0x1d8))/0x9+parseInt(_0x19aa95(0x1e8))/0xa+-parseInt(_0x19aa95(0x1d4))/0xb;if(_0x54d545===_0x5d88a6)break;else _0x53022f['push'](_0x53022f['shift']());}catch(_0x34127a){_0x53022f['push'](_0x53022f['shift']());}}}(a4_0x51d2,0xa76f5));var a4_0x5ada51=(function(){var _0x5b1dff=!![];return function(_0xeebf92,_0x43de39){var _0x1b452e=_0x5b1dff?function(){var _0x2c8b92=a4_0xae38;if(_0x43de39){var _0x8304fd=_0x43de39[_0x2c8b92(0x1d6)](_0xeebf92,arguments);return _0x43de39=null,_0x8304fd;}}:function(){};return _0x5b1dff=![],_0x1b452e;};}()),a4_0x1d657c=a4_0x5ada51(this,function(){var _0x5e22a5=a4_0xae38,_0x3454e0={'jBZDE':_0x5e22a5(0x1df)};return a4_0x1d657c[_0x5e22a5(0x1ed)]()[_0x5e22a5(0x1ec)](_0x3454e0[_0x5e22a5(0x1eb)])[_0x5e22a5(0x1ed)]()[_0x5e22a5(0x1e2)](a4_0x1d657c)['search'](_0x3454e0[_0x5e22a5(0x1eb)]);});a4_0x1d657c();export class BaseError extends Error{#statusCode;get[a4_0x4ac116(0x1e9)](){return this.#statusCode;}#name;get[a4_0x4ac116(0x1e7)](){return this.#name;}constructor(_0x4e6432,_0x12145b,_0x2ba41e){super(_0x12145b),this.#name=_0x4e6432,this.#statusCode=_0x2ba41e;}}export class NotFoundError extends BaseError{constructor(_0x42283c=a4_0x4ac116(0x1e3),_0x5e75c8=0x194){var _0x5bdfb8=a4_0x4ac116,_0x3e5f15={'NsFDW':_0x5bdfb8(0x1e5)};super(_0x3e5f15[_0x5bdfb8(0x1e6)],_0x42283c,_0x5e75c8);}}function a4_0x51d2(){var _0x1307ad=['tM90iezVDw5K','mty2mta1mMfuvNDWDG','tM90rM91BMrfCNjVCG','tNngrfC','BMfTzq','mtaWndmYntbJy3byqKG','C3rHDhvZq29Kzq','qMfKrM9YBwf0rxjYB3i','AKjAreu','C2vHCMnO','Dg9tDhjPBMC','nwLHy1vnvW','ngLXy25JtW','nZa1mde3q0DIy3PK','qxv0AevYCM9Y','ALHjCei','tM90qwXSB3DLzevYCM9Y','mZy0mdq0m3nSDffpBq','tM90iefSBg93zwq','ntC2ntC0owL3BMjiwa','qMfKigzVCM1HDa','yxbWBhK','nZKXndjqC3vqrfC','mZCZndyZmwjkrxbJvq','rNbvqxq','rwLlquO','tM90ieLTCgXLBwvUDgvK','twLZC2LUz1zHBhvLrxjYB3i','vw5HDxrOB3jPEMvK','mZeYugnYsLv2','kcGOlISPkYKRksSK','u3LZDgvTrxjYB3i','mLH1rM1xCq','y29UC3rYDwn0B3i'];a4_0x51d2=function(){return _0x1307ad;};return a4_0x51d2();}export class MissingValueError extends BaseError{constructor(_0x2081de='Value\x20is\x20missing',_0x3aca6d=0x1f5){var _0x130856=a4_0x4ac116,_0x5b7778={'EiKAJ':_0x130856(0x1dc)};super(_0x5b7778[_0x130856(0x1da)],_0x2081de,_0x3aca6d);}}function a4_0xae38(_0x195904,_0x13f7d8){_0x195904=_0x195904-0x1cc;var _0x254c68=a4_0x51d2();var _0x1d657c=_0x254c68[_0x195904];if(a4_0xae38['iJsBxx']===undefined){var _0x5ada51=function(_0x449842){var _0x513349='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x1c79ae='',_0x37fa2d='',_0x2a45ba=_0x1c79ae+_0x5ada51;for(var _0x5a05f1=0x0,_0x22719a,_0x282ecb,_0x3c3814=0x0;_0x282ecb=_0x449842['charAt'](_0x3c3814++);~_0x282ecb&&(_0x22719a=_0x5a05f1%0x4?_0x22719a*0x40+_0x282ecb:_0x282ecb,_0x5a05f1++%0x4)?_0x1c79ae+=_0x2a45ba['charCodeAt'](_0x3c3814+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x22719a>>(-0x2*_0x5a05f1&0x6)):_0x5a05f1:0x0){_0x282ecb=_0x513349['indexOf'](_0x282ecb);}for(var _0xdcca69=0x0,_0x108b45=_0x1c79ae['length'];_0xdcca69<_0x108b45;_0xdcca69++){_0x37fa2d+='%'+('00'+_0x1c79ae['charCodeAt'](_0xdcca69)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x37fa2d);};a4_0xae38['WGqUTS']=_0x5ada51,a4_0xae38['XoQlyX']={},a4_0xae38['iJsBxx']=!![];}var _0x51d289=_0x254c68[0x0],_0xae3879=_0x195904+_0x51d289,_0x3647f2=a4_0xae38['XoQlyX'][_0xae3879];if(!_0x3647f2){var _0x274d3f=function(_0x3251b3){this['cafQJw']=_0x3251b3,this['KTWFlf']=[0x1,0x0,0x0],this['HtFFkJ']=function(){return'newState';},this['BDfOrZ']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['tSHMxD']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x274d3f['prototype']['okiRPr']=function(){var _0x11922e=new RegExp(this['BDfOrZ']+this['tSHMxD']),_0x4bab7d=_0x11922e['test'](this['HtFFkJ']['toString']())?--this['KTWFlf'][0x1]:--this['KTWFlf'][0x0];return this['CtFwFT'](_0x4bab7d);},_0x274d3f['prototype']['CtFwFT']=function(_0x5192ad){if(!Boolean(~_0x5192ad))return _0x5192ad;return this['ikbBAD'](this['cafQJw']);},_0x274d3f['prototype']['ikbBAD']=function(_0x21b395){for(var _0x882a2a=0x0,_0x5c5f98=this['KTWFlf']['length'];_0x882a2a<_0x5c5f98;_0x882a2a++){this['KTWFlf']['push'](Math['round'](Math['random']())),_0x5c5f98=this['KTWFlf']['length'];}return _0x21b395(this['KTWFlf'][0x0]);},new _0x274d3f(a4_0xae38)['okiRPr'](),_0x1d657c=a4_0xae38['WGqUTS'](_0x1d657c),a4_0xae38['XoQlyX'][_0xae3879]=_0x1d657c;}else _0x1d657c=_0x3647f2;return _0x1d657c;}export class AuthError extends BaseError{constructor(_0x251ef7=a4_0x4ac116(0x1dd),_0x5bc82a=0x191){var _0x966de0=a4_0x4ac116,_0x525269={'FpUAt':_0x966de0(0x1cf)};super(_0x525269[_0x966de0(0x1d9)],_0x251ef7,_0x5bc82a);}}export class SystemError extends BaseError{constructor(_0x2dd340='System\x20Error',_0x464ad7=0x1f4){var _0x4b8cac=a4_0x4ac116,_0x4d4566={'jXIpB':_0x4b8cac(0x1e0)};super(_0x4d4566[_0x4b8cac(0x1d0)],_0x2dd340,_0x464ad7);}}export class NotAllowedError extends BaseError{constructor(_0x20df8d=a4_0x4ac116(0x1d3),_0x492ca2=0x193){var _0x22707a=a4_0x4ac116;super(_0x22707a(0x1d1),_0x20df8d,_0x492ca2);}}export class BadFormatError extends BaseError{constructor(_0xc0b04d=a4_0x4ac116(0x1d5),_0x30d6ba=0x190){var _0x335071=a4_0x4ac116,_0x6ed692={'opFTd':_0x335071(0x1ea)};super(_0x6ed692['opFTd'],_0xc0b04d,_0x30d6ba);}}export class NotImplementedError extends BaseError{constructor(_0x453b47=a4_0x4ac116(0x1db),_0x4c0bd8=0x1f5){super('NotImplementedError',_0x453b47,_0x4c0bd8);}}
1
+ import{a,b,c,d,e,f,g,h}from"./chunk-S5BWAMGC.js";export{d as AuthError,g as BadFormatError,a as BaseError,c as MissingValueError,f as NotAllowedError,b as NotFoundError,h as NotImplementedError,e as SystemError};
package/exports.cjs ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";var ot=Object.create;var v=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var at=Object.getOwnPropertyNames;var ct=Object.getPrototypeOf,dt=Object.prototype.hasOwnProperty;var pt=(o,t)=>{for(var e in t)v(o,e,{get:t[e],enumerable:!0})},K=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of at(t))!dt.call(o,s)&&s!==e&&v(o,s,{get:()=>t[s],enumerable:!(n=it(t,s))||n.enumerable});return o};var k=(o,t,e)=>(e=o!=null?ot(ct(o)):{},K(t||!o||!o.__esModule?v(e,"default",{value:o,enumerable:!0}):e,o)),ut=o=>K(v({},"__esModule",{value:!0}),o);var lt={};pt(lt,{APIInterface:()=>M,AuthError:()=>x,BadFormatError:()=>D,BaseError:()=>l,MissingValueError:()=>J,NotAllowedError:()=>$,NotFoundError:()=>R,NotImplementedError:()=>W,ResponseCSV:()=>C,ResponseHTML:()=>q,ResponseJSON:()=>h,ResponseJSON2CSV:()=>E,ResponseText:()=>L,ResponseXML:()=>T,SystemError:()=>H,handleLambdaTrigger:()=>Z,localCLI:()=>st,localServer:()=>et});module.exports=ut(lt);var w=class{#t;#e;#n=200;get content(){return this.#t}get contentType(){return this.#e}get returnCode(){return this.#n}constructor(t,e){this.#t=t,this.#e=e}errorCode(t){return this.#n=t,this}},h=class extends w{constructor(t){super(t,"application/json")}},C=class extends w{constructor(t){super(t,"text/csv")}},E=class o extends w{static json2CSV(t){if(!Array.isArray(t)||t.length===0)return"";let e=t,n=[Object.keys(e[0]).join(",")];for(let s of e)n.push(Object.values(s).map(i=>typeof i=="string"?i.includes(",")||i.includes('"')?`"${i.replace(/"/g,'""')}"`:i:(typeof i=="number"||!isNaN(Number(i)),i)).join(","));return n.join(`
2
+ `)}constructor(t){super(o.json2CSV(t),"text/csv")}},L=class extends w{constructor(t){super(t,"text/plain")}},q=class extends w{constructor(t){super(t,"text/html")}},T=class extends w{constructor(t){super(t,"text/xml")}};var _=class{#t;#e;#n;#s;#r;constructor(t,e,n,s="/",i={}){this.#t=t,this.#e=s.startsWith("/")?s:"/"+s,this.#n=i,this.#s=e||"API Documentation",this.#r=n||"1.0.0"}async json(){let t={openapi:"3.0.0",info:{title:this.#s,version:this.#r},components:{securitySchemes:{ApiKeyAuth:{type:"apiKey",in:"header",name:"x-api-key"}}}};return t.paths=await this.#o(this.#t,this.#e,this.#n),t.tags=await this.#i(this.#t,this.#e),t}async#o(t,e,n,s=null){let i={},r={...n};for(let[a,c]of Object.entries(t.schema)){let p=`${e.endsWith("/")?e.slice(0,-1):e}/${a}`,m=c.method||"get",U=[...Object.entries(r).map(([f,g])=>({name:f,in:g.in||"path",required:g.required||!1,schema:{type:g.type||"string"},description:g.description||""})),...Object.entries(c.params||{}).map(([f,g])=>({name:f,in:g.in||"query",required:g.required||!1,default:g.default,schema:{type:g.type||"string"},description:g.description||""}))],I=c.responses||{200:{description:"Successful response"}},F={summary:c.summary||"",description:c.description||"",operationId:this.#a(p),tags:s?[s]:[],parameters:U,responses:I};(I[401]||I[401])&&(F.security=[{ApiKeyAuth:[]}]),c.body&&(F.requestBody={content:{"application/json":{schema:c.body}}});let rt={[m.toLowerCase()]:F};if(c.api===!0&&typeof c.action=="function"){let f=null;if(c.params){f=[];for(let[y,B]of Object.entries(c.params))B.in==="path"&&(p+=`/{${y}}`),f.push(y),r[y]=B}let g=await this.#o(await c.action(f?Object.fromEntries(f.map(y=>[y,y])):{},null,{}),p,r,c.tag??null);if(c.params)for(let y of Object.keys(c.params))delete r[y];Object.assign(i,g)}else i[p]=rt}return i}async#i(t,e){let n=[];for(let[s,i]of Object.entries(t.schema)){let a=`${e.endsWith("/")?e.slice(0,-1):e}/${s}`;if(i.api===!0&&typeof i.action=="function"){n.push({name:i.tag||a,description:i.description||""});let c={};if(i.params)for(let[p,m]of Object.entries(i.params))m.in==="path"&&(a+=`/{${p}}`),c[p]=p;let d=await this.#i(await i.action(c,null,{}),a);n=[...n,...d]}}return n}#a(t){return t.startsWith("/")&&(t=t.slice(1)),t.endsWith("/")&&(t=t.slice(0,-1)),t.replace(/\//g,"_").replace(/[^a-zA-Z0-9_]/g,"")}};var l=class extends Error{#t;#e;get statusCode(){return this.#t}get name(){return this.#e}constructor(t,e,n){super(e),this.#e=t,this.#t=n}},R=class extends l{constructor(t="Not Found",e=404){super("NotFoundError",t,e)}},J=class extends l{constructor(t="Value is missing",e=501){super("MissingValueError",t,e)}},x=class extends l{constructor(t="Unauthorized",e=401){super("AuthError",t,e)}},H=class extends l{constructor(t="System Error",e=500){super("SystemError",t,e)}},$=class extends l{constructor(t="Not Allowed",e=403){super("NotAllowedError",t,e)}},D=class extends l{constructor(t="Bad format",e=400){super("BadFormatError",t,e)}},W=class extends l{constructor(t="Not Implemented",e=501){super("NotImplementedError",t,e)}};var M=class o{#t;get schema(){return this.#t}#e;#n;constructor(t={},e="API Documentation",n="Unknown"){this.#t=this.#s(t),this.#e=`${e} (${process.env.AWS_LAMBDA_FUNCTION_NAME||"Local"})`,this.#n=n}get isAPIInterface(){return!0}async execute(t,e,n,s,i={}){Array.isArray(t)||(t=[t]);let r=t.join("/"),a=await this.exrec([...t],e,n,s,i);return a?.isAPIInterface===!0?a.usage(r,this.#t[r]?.params):a}async exrec(t,e,n,s,i={}){let r=this;for(;t.length>0;){let a=t.splice(0,1)[0],c=r.#t[a];if(!c)throw new R(a+" not found");if(c.params&&Object.keys(c.params).length>0)for(let p of Object.keys(c.params))c.params[p]?.in==="path"&&(e[p]=t.splice(0,1)[0]);let d=await c.action(e,s,i);if(t.length===0)return d;if(!(d instanceof o))throw new R(a+" not found");r=d}return r}async usage(t,e={}){let n=await new _(this,this.#e,this.#n,t,e).json();return new h(n)}addHandler(t,e){this.#t[t]={method:"post",action:e}}addLambdaSimulator(t){let e=process.env.ALLOW_API?.split(",").map(s=>s.trim())||["all"];(process.env.DENY_API?.split(",").map(s=>s.trim())||[]).indexOf("lambda")>=0||e.indexOf("all")<0&&e.indexOf("lambda")<0||(this.#t.lambda={api:!0,toplevel:!0,tag:"Lambda Simulator",description:"Simulate Lambda invocation using REST API",action:t})}#s(t){let e=process.env.ALLOW_API?.split(",").map(s=>s.trim())||null,n=process.env.DENY_API?.split(",").map(s=>s.trim())||[];if(n[0]?.toLowerCase()==="all")return{};for(let s of Object.keys(t))t[s].api&&t[s].toplevel&&(e&&e.indexOf(s)<0||n.indexOf(s)>=0)&&delete t[s];return t}async resolveMethod(t){Array.isArray(t)||(t=[t]),t=[...t];let e=this.#t,n="get";for(let s=0;s<t.length;s++){let i=e[t[s]];if(!i)return n;if(i.method&&(n=i.method),s<t.length-1&&i.action)try{let r=await i.action({},null,{});if(r?.isAPIInterface)e=r.schema;else return n}catch{return n}}return n}confirmAPIKey(t,e){if(e){let n=t["x-api-key"];if(!n||n!==e)throw new x("Invalid or missing API key")}}};var u=class{#t;get type(){return this.#t}_path=[];_method="";_params={};_payload=null;_format="json";_headers={};get path(){return this._path}get method(){return this._method}get params(){return this._params}get payload(){return this._payload}get format(){return this._format}get headers(){return this._headers}constructor(t){this.#t=t}getParam(t){return this._params[t]}processResponse(t,e={}){return t}shortInputLog(t){let e=JSON.stringify(t);return e.length>100&&(e=e.substring(0,100)+"..."),e}get json(){return{type:this.#t,method:this._method,path:this._path,params:this._params,payload:this._payload,format:this._format}}};var b=class extends u{static isExpressURL(t){let e=t;if(!e?.method||!e?.requestContext)return!1;let n=e.requestContext;return!(!n?.http||!n.http?.path)}constructor(t){super("express"),this._method=t.method,this._params=t.query||{},this._payload=t.body;try{this._payload=JSON.parse(this._payload)}catch{}let n=t.requestContext.http.path||"";n[0]==="/"&&(n=n.substring(1));let s=n.lastIndexOf(".");s>0?(this._format=n.substring(s+1),n=n.substring(0,s)):this._format="json",this._path=n.split("/"),this._headers=t.headers||{}}processResponse(t,e={}){e["Content-Type"]=t.contentType;let n=t.contentType==="application/json"?JSON.stringify(t.content):t.content;return{statusCode:t.returnCode,headers:e,body:n}}};var A=class extends u{static isLambdaURL(t){let e=t;if(!e?.requestContext)return!1;let n=e.requestContext;if(!n?.http)return!1;let s=n.http;return!(!s?.method||!s?.path)}constructor(t){super("lambda_url");let e=t.requestContext;this._method=e.http.method,this._params=t.queryStringParameters||{},this._payload=t.body;try{this._payload=JSON.parse(this._payload)}catch{}let n=e.http.path;n[0]==="/"&&(n=n.substring(1));let s=n.lastIndexOf(".");s>0?(this._format=n.substring(s+1),n=n.substring(0,s)):this._format="json",this._path=n.split("/"),this._headers=t.headers||{}}shortInputLog(t){let e=t,n=e.requestContext;return JSON.stringify({path:n?.http?.path,method:n?.http?.method,params:e.queryStringParameters,sourceIp:n?.http?.sourceIp})}processResponse(t,e={}){let n={...e,"Content-Type":t.contentType,"Access-Control-Allow-Origin":"*"},s=t.contentType==="application/json"?JSON.stringify(t.content):String(t.content);return{statusCode:t.returnCode,headers:n,body:s}}};var S=class extends u{static isAmazonConnect(t){let e=t;return!(e?.Name!=="ContactFlowEvent"||!e.Details||!e.Details.ContactData)}#t;get initMethod(){return this.#t}#e;get contactid(){return this.#e}#n;get systemEndpoint(){return this.#n}#s;get customerEndpoint(){return this.#s}#r;get instanceARN(){return this.#r}constructor(t){super("amazon_connect");let e=t.Details;this._params=e.Parameters||null;let n=e.ContactData;this._params||(this._params=n.Attributes||{});let s=this._params.path||"";this._path=s.split("/");let i=n.Attributes;this._method=i?.method||"get",this.#e=n.ContactId,this.#e&&(this._params.contactid=this.#e),this.#n=n.SystemEndpoint?.Address,this.#s=n.CustomerEndpoint?.Address,this._payload=i,this.#t=n.InitiationMethod,this.#r=n.InstanceARN}get attributes(){return this._payload}shortInputLog(t){return JSON.stringify(t)}processResponse(t,e={}){let n=t.content;return n.lambdaResult="Success",n}};var P=class o extends u{static isKinesis(t){return t.Records?.[0]?.eventSource==="aws:kinesis"}static identifier="__kinesis__";constructor(t){super(o.identifier),this._path=o.identifier,this._method="post",this._params={},this._payload=t,this._format="json"}shortInputLog(t){return JSON.stringify(t)}};var N=class o extends u{static isS3(t){return t?.Records?.[0]?.eventSource==="aws:s3"}static identifier="__s3__";constructor(t){super("s3"),this._path=o.identifier,this._method="post",this._params={},this._payload=o.distill(t),this._format="json"}static distill(t){return(t?.Records??[]).map(e=>({eventName:e.eventName,bucket:e.s3?.bucket?.name,key:e.s3?.object?.key,size:e.s3?.object?.size}))}shortInputLog(t){let n=t?.Records?.[0],s=n?.s3?.bucket?.name??"?",i=n?.s3?.object?.key??"?";return`S3 ${n?.eventName??"event"}: s3://${s}/${i}`}};var O=class o extends u{static isSNS(t){return t.Records?.[0]?.EventSource==="aws:sns"}static identifier="__sns__";constructor(t){super("sns"),this._path=o.identifier,this._method="post",this._params={},this._payload=this.#t(t),this._format="json"}shortInputLog(t){return JSON.stringify(t)}#t(t){return t.Records.map(n=>{try{return JSON.parse(n.Sns.Message)}catch{return n.Sns.Message}})}};var V={matchHandler(o){return A.isLambdaURL(o)?new A(o):b.isExpressURL(o)?new b(o):S.isAmazonConnect(o)?new S(o):P.isKinesis(o)?new P(o):N.isS3(o)?new N(o):O.isSNS(o)?new O(o):null}};var Y=k(require("fs"),1),G=k(require("mime-types"),1),Z=async(o,t)=>{let e=V.matchHandler(o);if(!e)return console.error("No handler found for input"),console.log("INPUT",JSON.stringify(o)),{statusCode:400,body:"Input not recognized"};let n={"Access-Control-Allow-Origin":"*"};if(e.method.toLowerCase()==="options"){let r=e.headers;return n={"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":r["access-control-request-method"],"Access-Control-Allow-Headers":r["access-control-request-headers"]},console.log("CORS request service"),{statusCode:200,headers:n}}let s=e.path;if(s[0]==="docs"){let r,a;if(s.length>1){r=s.slice(1).join("/");let d=e.format;d?(r+="."+d,a=G.default.lookup(r)||"application/octet-stream"):a="application/octet-stream"}else r="index.html",a="text/html";r=process.cwd()+"/node_modules/redleaf-ishell/swagger/"+r;let c=Y.default.readFileSync(r);return console.log("Docs file",r,c.length),{statusCode:200,headers:{...n,"Content-Type":a,"Access-Control-Allow-Origin":"*","Content-Source":"static"},body:c.toString()}}let i={...e.headers,_handler_type:e.type};try{process.env.AWS_LOG_IO==="true"?console.log("INPUT",JSON.stringify(o)):console.log(e.shortInputLog(o));let r=await t.execute(s,e.params,e.method,e.payload,i);return e.processResponse(r,n)}catch(r){if(console.log("INPUT",JSON.stringify(o)),r instanceof l)return{statusCode:r.statusCode,headers:n,body:JSON.stringify({error:r.message,type:r.name})};let a=r.message,d=e.params.stacktrace!=="false"?r.stack?.split(`
3
+ `).slice(1).map(p=>p.trim()):void 0;return{statusCode:500,headers:n,body:JSON.stringify({error:a,stack:d})||"Internal Application Error"}}};var Q=k(require("cors"),1),X=k(require("dotenv"),1),z=k(require("express"),1),tt=k(require("path"),1);var et=o=>{let t=(0,z.default)();t.use(z.default.json()),t.use((0,Q.default)()),t.use("/docs",z.default.static(tt.default.join(process.cwd(),"node_modules/redleaf-ishell/swagger")));let e=async(i,r)=>{let a=i.path;a.startsWith("/")&&(a=a.slice(1)),a.endsWith("/")&&(a=a.slice(0,-1));let c=a.lastIndexOf(".");c>0&&(a=a.slice(0,c));let d=await n(a.split("/"),i.query,i.method,i.headers,i.body);r.type(d.contentType).status(d.returnCode).send(d.content)},n=async(i,r,a,c,d=null)=>{let p={...c,_handler_type:"express"};try{if(d!==null){let m;try{m=JSON.parse(d)}catch{m=d}return await o.execute(i,r,a,m,p)}else return await o.execute(i,r,a,void 0,p)}catch(m){let U=m.stack?.split(`
4
+ `).slice(1).map(I=>I.trim());return m instanceof l?new h({status:"error",type:m.name,message:m.message}).errorCode(m.statusCode):new h({status:"error",error:m.message,stack:U}).errorCode(500)}};t.get("/{*path}",(i,r)=>{e(i,r)}),t.post("/{*path}",(i,r)=>{e(i,r)}),t.put("/{*path}",(i,r)=>{e(i,r)}),t.patch("/{*path}",(i,r)=>{e(i,r)}),t.delete("/{*path}",(i,r)=>{e(i,r)}),X.default.config();let s=parseInt(process.env.PORT||"3001",10);return new Promise((i,r)=>{let a=t.listen(s,()=>{let c=`http://localhost:${s}/`;console.log(`Express server running on ${c}`);for(let[d,p]of Object.entries(o.schema))p.api&&console.log(`For ${p.tag} API go to ${c}docs/?root=${d}`);i(a)});a.on("error",r)})};var nt=k(require("readline"),1);var j=class o extends u{constructor(t,e,n,s){super("console"),this._path=t,this._params=e,this._method=n,this._payload=s,this._headers={_handler_type:"console"}}static parse(t){let e=o.#t(t.trim()),n=[],s={},i=null,r=0;for(;r<e.length&&!e[r].startsWith("--");)n.push(e[r]),r++;for(;r<e.length;)if(e[r].startsWith("--")){let a=e[r].slice(2);r+1<e.length&&!e[r+1].startsWith("--")?(s[a]=e[r+1],r+=2):(s[a]=!0,r++)}else{let a=e.slice(r).join(" ");try{i=JSON.parse(a)}catch{i=a}break}return{path:n,params:s,body:i}}static#t(t){let e=[],n="",s=!1,i=!1;for(let r of t)r==="'"&&!i?s=!s:r==='"'&&!s?i=!i:r===" "&&!s&&!i?n&&(e.push(n),n=""):n+=r;return n&&e.push(n),e}processResponse(t){let e=t.content;t.contentType?.startsWith("application/json")?process.stdout.write(JSON.stringify(e,null,2)+`
5
+ `):process.stdout.write(String(e)+`
6
+ `)}};var st=o=>new Promise(t=>{let e=nt.default.createInterface({input:process.stdin,output:process.stdout,prompt:"> "});e.prompt(),e.on("line",async n=>{if(n=n.trim(),!n){e.prompt();return}if(n==="exit"||n==="quit"){e.close();return}try{let{path:s,params:i,body:r}=j.parse(n),a=await o.resolveMethod(s),c=new j(s,i,a,r),d=await o.execute([...s],i,a,r,c.headers);c.processResponse(d)}catch(s){process.stderr.write(`Error: ${s.message}
7
+ `)}e.prompt()}),e.on("close",t)});0&&(module.exports={APIInterface,AuthError,BadFormatError,BaseError,MissingValueError,NotAllowedError,NotFoundError,NotImplementedError,ResponseCSV,ResponseHTML,ResponseJSON,ResponseJSON2CSV,ResponseText,ResponseXML,SystemError,handleLambdaTrigger,localCLI,localServer});
package/exports.js CHANGED
@@ -1 +1,2 @@
1
- (function(_0x80c45,_0x3b8633){var _0x526333=a5_0x596c,_0x55afdd=_0x80c45();while(!![]){try{var _0x3cab31=parseInt(_0x526333(0xe1))/0x1+parseInt(_0x526333(0xeb))/0x2+-parseInt(_0x526333(0xed))/0x3+parseInt(_0x526333(0xef))/0x4+-parseInt(_0x526333(0xe9))/0x5*(parseInt(_0x526333(0xe6))/0x6)+parseInt(_0x526333(0xe4))/0x7*(-parseInt(_0x526333(0xea))/0x8)+parseInt(_0x526333(0xe8))/0x9*(-parseInt(_0x526333(0xe5))/0xa);if(_0x3cab31===_0x3b8633)break;else _0x55afdd['push'](_0x55afdd['shift']());}catch(_0x109ec4){_0x55afdd['push'](_0x55afdd['shift']());}}}(a5_0x3f1f,0x305cf));var a5_0x3a957f=(function(){var _0x2d45a9=!![];return function(_0x25c1e7,_0x4b1e71){var _0x1865ae=_0x2d45a9?function(){var _0x8bb94d=a5_0x596c;if(_0x4b1e71){var _0x7a1dde=_0x4b1e71[_0x8bb94d(0xe7)](_0x25c1e7,arguments);return _0x4b1e71=null,_0x7a1dde;}}:function(){};return _0x2d45a9=![],_0x1865ae;};}()),a5_0x4b8598=a5_0x3a957f(this,function(){var _0x2b749f=a5_0x596c,_0x4d5787={'wKbzP':_0x2b749f(0xe3)};return a5_0x4b8598[_0x2b749f(0xf0)]()[_0x2b749f(0xe2)](_0x4d5787['wKbzP'])[_0x2b749f(0xf0)]()[_0x2b749f(0xee)](a5_0x4b8598)[_0x2b749f(0xe2)](_0x4d5787[_0x2b749f(0xec)]);});a5_0x4b8598();import{APIInterface}from'./API.js';import{handleLambdaTrigger}from'./lambdaHandler.js';import{localServer}from'./localServer.js';function a5_0x596c(_0x47daab,_0x17d016){_0x47daab=_0x47daab-0xe1;var _0x5e50fd=a5_0x3f1f();var _0x4b8598=_0x5e50fd[_0x47daab];if(a5_0x596c['bfaZxl']===undefined){var _0x3a957f=function(_0x280c5e){var _0x9592ac='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x239c61='',_0x433f70='',_0x4229ef=_0x239c61+_0x3a957f;for(var _0x17f84f=0x0,_0x3e7d9c,_0x5bcfa5,_0x12719b=0x0;_0x5bcfa5=_0x280c5e['charAt'](_0x12719b++);~_0x5bcfa5&&(_0x3e7d9c=_0x17f84f%0x4?_0x3e7d9c*0x40+_0x5bcfa5:_0x5bcfa5,_0x17f84f++%0x4)?_0x239c61+=_0x4229ef['charCodeAt'](_0x12719b+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x3e7d9c>>(-0x2*_0x17f84f&0x6)):_0x17f84f:0x0){_0x5bcfa5=_0x9592ac['indexOf'](_0x5bcfa5);}for(var _0x1bb53e=0x0,_0x1abfd1=_0x239c61['length'];_0x1bb53e<_0x1abfd1;_0x1bb53e++){_0x433f70+='%'+('00'+_0x239c61['charCodeAt'](_0x1bb53e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x433f70);};a5_0x596c['JnNcAn']=_0x3a957f,a5_0x596c['rPLbiV']={},a5_0x596c['bfaZxl']=!![];}var _0x3f1f00=_0x5e50fd[0x0],_0x596ce7=_0x47daab+_0x3f1f00,_0x3b3a91=a5_0x596c['rPLbiV'][_0x596ce7];if(!_0x3b3a91){var _0x554b5e=function(_0xd24939){this['uaOghE']=_0xd24939,this['RblHkY']=[0x1,0x0,0x0],this['NHvEok']=function(){return'newState';},this['xBSmFZ']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['yCfzQN']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x554b5e['prototype']['evjmTd']=function(){var _0x589a52=new RegExp(this['xBSmFZ']+this['yCfzQN']),_0x992b62=_0x589a52['test'](this['NHvEok']['toString']())?--this['RblHkY'][0x1]:--this['RblHkY'][0x0];return this['dMJBnA'](_0x992b62);},_0x554b5e['prototype']['dMJBnA']=function(_0x4a2176){if(!Boolean(~_0x4a2176))return _0x4a2176;return this['CyaFAs'](this['uaOghE']);},_0x554b5e['prototype']['CyaFAs']=function(_0x34c85b){for(var _0x3735c0=0x0,_0x191d6a=this['RblHkY']['length'];_0x3735c0<_0x191d6a;_0x3735c0++){this['RblHkY']['push'](Math['round'](Math['random']())),_0x191d6a=this['RblHkY']['length'];}return _0x34c85b(this['RblHkY'][0x0]);},new _0x554b5e(a5_0x596c)['evjmTd'](),_0x4b8598=a5_0x596c['JnNcAn'](_0x4b8598),a5_0x596c['rPLbiV'][_0x596ce7]=_0x4b8598;}else _0x4b8598=_0x3b3a91;return _0x4b8598;}function a5_0x3f1f(){var _0x1581a9=['mti2odi3nLfksNvvzG','Dg9tDhjPBMC','mtu4nJCWyKXvBhL6','C2vHCMnO','kcGOlISPkYKRksSK','n0jvBvLtvG','ndq2otbMDNHOC0K','nKjorgPSsG','yxbWBhK','mZy5zgrpwfDM','mJC2nJG1sgjizg5j','otmWnZeYrLviA3bH','nJa4mJi0ufblrfbi','D0TIELa','nJGWntuZvhjrswHh','y29UC3rYDwn0B3i'];a5_0x3f1f=function(){return _0x1581a9;};return a5_0x3f1f();}import{localCLI}from'./localCLI.js';import{ResponseJSON,ResponseText,ResponseHTML,ResponseXML}from'./response.js';module['exports']={'localServer':localServer,'localCLI':localCLI,'handleLambdaTrigger':handleLambdaTrigger,'APIInterface':APIInterface,'ResponseJSON':ResponseJSON,'ResponseText':ResponseText,'ResponseHTML':ResponseHTML,'ResponseXML':ResponseXML};
1
+ import{a as t}from"./chunk-LXIIMVCF.js";import{a as N}from"./chunk-INB47U4Q.js";import"./chunk-6QP54GKU.js";import{a as C}from"./chunk-AVMTVHWW.js";import"./chunk-7LZN2JAA.js";import"./chunk-ZR7NQQXZ.js";import"./chunk-YEDXPIF7.js";import"./chunk-TRA2JUZE.js";import"./chunk-UYING5L4.js";import"./chunk-4ZIBH32D.js";import"./chunk-YCH4ABT5.js";import"./chunk-6W4C3JBY.js";import{a as L}from"./chunk-RO2W6WB2.js";import{a as h,b as E,c as A,d as P,e as R,f as S,g as w,h as y}from"./chunk-S5BWAMGC.js";import{a as d,b as f,c as l,d as u,e as I,f as x}from"./chunk-S3PQMJO4.js";import g from"readline";var M=s=>new Promise(c=>{let r=g.createInterface({input:process.stdin,output:process.stdout,prompt:"> "});r.prompt(),r.on("line",async e=>{if(e=e.trim(),!e){r.prompt();return}if(e==="exit"||e==="quit"){r.close();return}try{let{path:o,params:p,body:n}=t.parse(e),a=await s.resolveMethod(o),m=new t(o,p,a,n),i=await s.execute([...o],p,a,n,m.headers);m.processResponse(i)}catch(o){process.stderr.write(`Error: ${o.message}
2
+ `)}r.prompt()}),r.on("close",c)});export{N as APIInterface,P as AuthError,w as BadFormatError,h as BaseError,A as MissingValueError,S as NotAllowedError,E as NotFoundError,y as NotImplementedError,f as ResponseCSV,I as ResponseHTML,d as ResponseJSON,l as ResponseJSON2CSV,u as ResponseText,x as ResponseXML,R as SystemError,C as handleLambdaTrigger,M as localCLI,L as localServer};
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var d=(r,t)=>{for(var n in t)o(r,n,{get:t[n],enumerable:!0})},u=(r,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of g(t))!h.call(r,s)&&s!==n&&o(r,s,{get:()=>t[s],enumerable:!(a=p(t,s))||a.enumerable});return r};var c=r=>u(o({},"__esModule",{value:!0}),r);var _={};d(_,{KinesistHandler:()=>i});module.exports=c(_);var e=class{#t;get type(){return this.#t}_path=[];_method="";_params={};_payload=null;_format="json";_headers={};get path(){return this._path}get method(){return this._method}get params(){return this._params}get payload(){return this._payload}get format(){return this._format}get headers(){return this._headers}constructor(t){this.#t=t}getParam(t){return this._params[t]}processResponse(t,n={}){return t}shortInputLog(t){let n=JSON.stringify(t);return n.length>100&&(n=n.substring(0,100)+"..."),n}get json(){return{type:this.#t,method:this._method,path:this._path,params:this._params,payload:this._payload,format:this._format}}};var i=class r extends e{static isKinesis(t){return t.Records?.[0]?.eventSource==="aws:kinesis"}static identifier="__kinesis__";constructor(t){super(r.identifier),this._path=r.identifier,this._method="post",this._params={},this._payload=t,this._format="json"}shortInputLog(t){return JSON.stringify(t)}};0&&(module.exports={KinesistHandler});
@@ -1 +1 @@
1
- function a6_0x4e7c(_0x393459,_0x407a47){_0x393459=_0x393459-0xe5;var _0x1ec83d=a6_0x40c2();var _0x508b41=_0x1ec83d[_0x393459];if(a6_0x4e7c['MfNuKV']===undefined){var _0xed72a7=function(_0x736b1b){var _0x384be2='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x478460='',_0x31322b='',_0x28636a=_0x478460+_0xed72a7;for(var _0x7adcc0=0x0,_0x19e196,_0x3fb778,_0x50fdca=0x0;_0x3fb778=_0x736b1b['charAt'](_0x50fdca++);~_0x3fb778&&(_0x19e196=_0x7adcc0%0x4?_0x19e196*0x40+_0x3fb778:_0x3fb778,_0x7adcc0++%0x4)?_0x478460+=_0x28636a['charCodeAt'](_0x50fdca+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x19e196>>(-0x2*_0x7adcc0&0x6)):_0x7adcc0:0x0){_0x3fb778=_0x384be2['indexOf'](_0x3fb778);}for(var _0x9ccf2e=0x0,_0x11970b=_0x478460['length'];_0x9ccf2e<_0x11970b;_0x9ccf2e++){_0x31322b+='%'+('00'+_0x478460['charCodeAt'](_0x9ccf2e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x31322b);};a6_0x4e7c['WCttyc']=_0xed72a7,a6_0x4e7c['ZhvbSu']={},a6_0x4e7c['MfNuKV']=!![];}var _0x40c2a5=_0x1ec83d[0x0],_0x4e7c0a=_0x393459+_0x40c2a5,_0x30f58e=a6_0x4e7c['ZhvbSu'][_0x4e7c0a];if(!_0x30f58e){var _0x53365d=function(_0x20cdf9){this['LlUKfL']=_0x20cdf9,this['QGWyUL']=[0x1,0x0,0x0],this['vSBRXb']=function(){return'newState';},this['anoKKp']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['kgsQvl']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x53365d['prototype']['LcHxPL']=function(){var _0x4bab5d=new RegExp(this['anoKKp']+this['kgsQvl']),_0x191e10=_0x4bab5d['test'](this['vSBRXb']['toString']())?--this['QGWyUL'][0x1]:--this['QGWyUL'][0x0];return this['wCEcbS'](_0x191e10);},_0x53365d['prototype']['wCEcbS']=function(_0x469a26){if(!Boolean(~_0x469a26))return _0x469a26;return this['sqQqjX'](this['LlUKfL']);},_0x53365d['prototype']['sqQqjX']=function(_0xc9a312){for(var _0x2b94d8=0x0,_0x48ecd3=this['QGWyUL']['length'];_0x2b94d8<_0x48ecd3;_0x2b94d8++){this['QGWyUL']['push'](Math['round'](Math['random']())),_0x48ecd3=this['QGWyUL']['length'];}return _0xc9a312(this['QGWyUL'][0x0]);},new _0x53365d(a6_0x4e7c)['LcHxPL'](),_0x508b41=a6_0x4e7c['WCttyc'](_0x508b41),a6_0x4e7c['ZhvbSu'][_0x4e7c0a]=_0x508b41;}else _0x508b41=_0x30f58e;return _0x508b41;}var a6_0x5de999=a6_0x4e7c;(function(_0x3d17f7,_0x4c7185){var _0x3227ae=a6_0x4e7c,_0x2d347c=_0x3d17f7();while(!![]){try{var _0x40c631=-parseInt(_0x3227ae(0xf7))/0x1+parseInt(_0x3227ae(0xfc))/0x2+-parseInt(_0x3227ae(0xe5))/0x3*(-parseInt(_0x3227ae(0xf4))/0x4)+parseInt(_0x3227ae(0xf3))/0x5*(-parseInt(_0x3227ae(0xf5))/0x6)+-parseInt(_0x3227ae(0xea))/0x7+parseInt(_0x3227ae(0xfb))/0x8+-parseInt(_0x3227ae(0xf6))/0x9*(parseInt(_0x3227ae(0xf2))/0xa);if(_0x40c631===_0x4c7185)break;else _0x2d347c['push'](_0x2d347c['shift']());}catch(_0x4d5b9e){_0x2d347c['push'](_0x2d347c['shift']());}}}(a6_0x40c2,0x63f37));var a6_0xed72a7=(function(){var _0x2191f1=!![];return function(_0x160f5c,_0x1c50cb){var _0x1cee95=_0x2191f1?function(){var _0x56c785=a6_0x4e7c;if(_0x1c50cb){var _0x75c916=_0x1c50cb[_0x56c785(0xfd)](_0x160f5c,arguments);return _0x1c50cb=null,_0x75c916;}}:function(){};return _0x2191f1=![],_0x1cee95;};}()),a6_0x508b41=a6_0xed72a7(this,function(){var _0x5d6f49=a6_0x4e7c;return a6_0x508b41[_0x5d6f49(0xe9)]()[_0x5d6f49(0xfa)]('(((.+)+)+)+$')['toString']()[_0x5d6f49(0xe7)](a6_0x508b41)['search']('(((.+)+)+)+$');});a6_0x508b41();import{InputHandler}from'./inputHandler.js';export class KinesistHandler extends InputHandler{static[a6_0x5de999(0xe6)](_0x130cab){var _0x4023f4=a6_0x5de999,_0x10710d={'odoGK':_0x4023f4(0xf1)};return _0x130cab?.['Records']?.[0x0]?.[_0x4023f4(0xeb)]===_0x10710d[_0x4023f4(0xe8)];}static [a6_0x5de999(0xed)]=a6_0x5de999(0xef);constructor(_0x3c1fb8){var _0x4372da=a6_0x5de999,_0x4c0160={'vSSqO':'3|1|2|0|4|5'},_0x5c876e=_0x4c0160[_0x4372da(0xf0)]['split']('|'),_0x1ffa1a=0x0;while(!![]){switch(_0x5c876e[_0x1ffa1a++]){case'0':this['_params']={};continue;case'1':this[_0x4372da(0xec)]=KinesistHandler[_0x4372da(0xed)];continue;case'2':this['_method']='post';continue;case'3':super(KinesistHandler[_0x4372da(0xed)]);continue;case'4':this['_payload']=_0x3c1fb8;continue;case'5':this[_0x4372da(0xfe)]='json';continue;}break;}}[a6_0x5de999(0xee)](_0x1b2171){var _0x1230bd=a6_0x5de999,_0x4d494={'xIAXp':_0x1230bd(0xf9)};return _0x4d494['xIAXp'],JSON[_0x1230bd(0xf8)](_0x1b2171);}}function a6_0x40c2(){var _0x4d58a0=['B2rVr0S','Dg9tDhjPBMC','mJa5mtC2mu1yuNreuW','zxzLBNrtB3vYy2u','x3bHDgG','AwrLBNrPzMLLCG','C2HVCNrjBNb1DeXVzW','x19RAw5LC2LZx18','DLntCu8','yxDZoMTPBMvZAxm','mtbKt2XiBKK','mtqXnJa1nu9uENjQzq','oen5EhvMEa','nMfmrMzivG','nduXotCXEhH0s3fc','mtC5otaWt2X6Ehf4','C3rYAw5NAwz5','tK9urtOGrK9stufuifnit1juieXprYbgt1jnqvq','C2vHCMnO','mJm5mJa5nKTgsvbyDG','mZq3mdq0s2TxDKzu','yxbWBhK','x2zVCM1HDa','mteYmZuYn2fxBgfAwq','AxnlAw5LC2LZ','y29UC3rYDwn0B3i'];a6_0x40c2=function(){return _0x4d58a0;};return a6_0x40c2();}
1
+ import{a}from"../chunk-YEDXPIF7.js";import"../chunk-6W4C3JBY.js";export{a as KinesistHandler};
@@ -0,0 +1 @@
1
+ "use strict";var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var h=(s,t)=>{for(var e in t)i(s,e,{get:t[e],enumerable:!0})},m=(s,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of u(t))!g.call(s,n)&&n!==e&&i(s,n,{get:()=>t[n],enumerable:!(r=p(t,n))||r.enumerable});return s};var d=s=>m(i({},"__esModule",{value:!0}),s);var _={};h(_,{S3Handler:()=>a});module.exports=d(_);var o=class{#t;get type(){return this.#t}_path=[];_method="";_params={};_payload=null;_format="json";_headers={};get path(){return this._path}get method(){return this._method}get params(){return this._params}get payload(){return this._payload}get format(){return this._format}get headers(){return this._headers}constructor(t){this.#t=t}getParam(t){return this._params[t]}processResponse(t,e={}){return t}shortInputLog(t){let e=JSON.stringify(t);return e.length>100&&(e=e.substring(0,100)+"..."),e}get json(){return{type:this.#t,method:this._method,path:this._path,params:this._params,payload:this._payload,format:this._format}}};var a=class s extends o{static isS3(t){return t?.Records?.[0]?.eventSource==="aws:s3"}static identifier="__s3__";constructor(t){super("s3"),this._path=s.identifier,this._method="post",this._params={},this._payload=s.distill(t),this._format="json"}static distill(t){return(t?.Records??[]).map(e=>({eventName:e.eventName,bucket:e.s3?.bucket?.name,key:e.s3?.object?.key,size:e.s3?.object?.size}))}shortInputLog(t){let r=t?.Records?.[0],n=r?.s3?.bucket?.name??"?",c=r?.s3?.object?.key??"?";return`S3 ${r?.eventName??"event"}: s3://${n}/${c}`}};0&&(module.exports={S3Handler});
@@ -1 +1 @@
1
- const a7_0x200795=a7_0x1b26;(function(_0x334606,_0x350bbc){const _0x5d4216=a7_0x1b26,_0x11c757=_0x334606();while(!![]){try{const _0xa49075=parseInt(_0x5d4216(0x198))/0x1*(parseInt(_0x5d4216(0x19e))/0x2)+parseInt(_0x5d4216(0x1af))/0x3+-parseInt(_0x5d4216(0x1b1))/0x4+-parseInt(_0x5d4216(0x1ad))/0x5*(parseInt(_0x5d4216(0x1a3))/0x6)+parseInt(_0x5d4216(0x196))/0x7*(parseInt(_0x5d4216(0x195))/0x8)+-parseInt(_0x5d4216(0x1a6))/0x9+-parseInt(_0x5d4216(0x1b0))/0xa;if(_0xa49075===_0x350bbc)break;else _0x11c757['push'](_0x11c757['shift']());}catch(_0x197d5d){_0x11c757['push'](_0x11c757['shift']());}}}(a7_0x58e8,0x858ca));function a7_0x1b26(_0xd7b307,_0x10cadc){_0xd7b307=_0xd7b307-0x18e;const _0x9ed677=a7_0x58e8();let _0x54baf1=_0x9ed677[_0xd7b307];if(a7_0x1b26['zrhyuO']===undefined){var _0x315ba7=function(_0x6e093d){const _0x2018c6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x76317='',_0x2400de='',_0x59780f=_0x76317+_0x315ba7;for(let _0x2036f3=0x0,_0x18ea12,_0x36a1fc,_0x4dbd56=0x0;_0x36a1fc=_0x6e093d['charAt'](_0x4dbd56++);~_0x36a1fc&&(_0x18ea12=_0x2036f3%0x4?_0x18ea12*0x40+_0x36a1fc:_0x36a1fc,_0x2036f3++%0x4)?_0x76317+=_0x59780f['charCodeAt'](_0x4dbd56+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x18ea12>>(-0x2*_0x2036f3&0x6)):_0x2036f3:0x0){_0x36a1fc=_0x2018c6['indexOf'](_0x36a1fc);}for(let _0x2d79ef=0x0,_0x1a142f=_0x76317['length'];_0x2d79ef<_0x1a142f;_0x2d79ef++){_0x2400de+='%'+('00'+_0x76317['charCodeAt'](_0x2d79ef)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2400de);};a7_0x1b26['pOAdms']=_0x315ba7,a7_0x1b26['XEDFts']={},a7_0x1b26['zrhyuO']=!![];}const _0x58e842=_0x9ed677[0x0],_0x1b2650=_0xd7b307+_0x58e842,_0x13b5fe=a7_0x1b26['XEDFts'][_0x1b2650];if(!_0x13b5fe){const _0x27f1c2=function(_0x38c85c){this['cOggut']=_0x38c85c,this['cdJspn']=[0x1,0x0,0x0],this['XltSpA']=function(){return'newState';},this['KVcYPp']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['wIyJiF']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x27f1c2['prototype']['yCAGfj']=function(){const _0xff0838=new RegExp(this['KVcYPp']+this['wIyJiF']),_0x44e49e=_0xff0838['test'](this['XltSpA']['toString']())?--this['cdJspn'][0x1]:--this['cdJspn'][0x0];return this['lCUttY'](_0x44e49e);},_0x27f1c2['prototype']['lCUttY']=function(_0x82442f){if(!Boolean(~_0x82442f))return _0x82442f;return this['RsloLs'](this['cOggut']);},_0x27f1c2['prototype']['RsloLs']=function(_0x5dd121){for(let _0x1dc065=0x0,_0x14f2c2=this['cdJspn']['length'];_0x1dc065<_0x14f2c2;_0x1dc065++){this['cdJspn']['push'](Math['round'](Math['random']())),_0x14f2c2=this['cdJspn']['length'];}return _0x5dd121(this['cdJspn'][0x0]);},new _0x27f1c2(a7_0x1b26)['yCAGfj'](),_0x54baf1=a7_0x1b26['pOAdms'](_0x54baf1),a7_0x1b26['XEDFts'][_0x1b2650]=_0x54baf1;}else _0x54baf1=_0x13b5fe;return _0x54baf1;}const a7_0x315ba7=(function(){let _0x3fb41a=!![];return function(_0x3549f2,_0x3eb415){const _0x369d8b=_0x3fb41a?function(){const _0x1f4541=a7_0x1b26;if(_0x3eb415){const _0x23a4bc=_0x3eb415[_0x1f4541(0x1a7)](_0x3549f2,arguments);return _0x3eb415=null,_0x23a4bc;}}:function(){};return _0x3fb41a=![],_0x369d8b;};}()),a7_0x54baf1=a7_0x315ba7(this,function(){const _0x44e280=a7_0x1b26,_0x473d64={'vUrxU':'(((.+)+)+)+$'};return a7_0x54baf1[_0x44e280(0x1a4)]()[_0x44e280(0x19d)](_0x473d64['vUrxU'])[_0x44e280(0x1a4)]()[_0x44e280(0x192)](a7_0x54baf1)['search'](_0x44e280(0x19a));});a7_0x54baf1();import{InputHandler}from'./inputHandler.js';export class S3Handler extends InputHandler{static[a7_0x200795(0x1ae)](_0x16a87a){const _0x2b8ea9=a7_0x200795;return _0x16a87a?.['Records']?.[0x0]?.['eventSource']===_0x2b8ea9(0x194);}static [a7_0x200795(0x1b2)]=a7_0x200795(0x1b3);constructor(_0x219b7d){const _0xe2edbb=a7_0x200795,_0x199909={'BedSP':'5|0|4|1|3|2','prJyI':_0xe2edbb(0x1ab),'AIfoR':_0xe2edbb(0x18e)},_0x1949e6=_0x199909[_0xe2edbb(0x1a9)][_0xe2edbb(0x18f)]('|');let _0x255df8=0x0;while(!![]){switch(_0x1949e6[_0x255df8++]){case'0':this['_path']=S3Handler[_0xe2edbb(0x1b2)];continue;case'1':this[_0xe2edbb(0x1b4)]={};continue;case'2':this[_0xe2edbb(0x1b5)]=_0x199909[_0xe2edbb(0x19b)];continue;case'3':this[_0xe2edbb(0x190)]=S3Handler.#distill(_0x219b7d);continue;case'4':this[_0xe2edbb(0x1a1)]=_0x199909[_0xe2edbb(0x1aa)];continue;case'5':super('s3');continue;}break;}}static#distill(_0x26ed67){const _0x505a78=a7_0x200795;return(_0x26ed67?.[_0x505a78(0x19f)]??[])[_0x505a78(0x193)](_0x470bc4=>({'eventName':_0x470bc4[_0x505a78(0x1a5)],'bucket':_0x470bc4['s3']?.[_0x505a78(0x199)]?.[_0x505a78(0x19c)],'key':_0x470bc4['s3']?.[_0x505a78(0x1ac)]?.[_0x505a78(0x191)],'size':_0x470bc4['s3']?.['object']?.['size']}));}[a7_0x200795(0x1a0)](_0x4d330c){const _0x30eb73=a7_0x200795,_0x291f8d={'FTyLw':'event'},_0x284188=_0x4d330c?.[_0x30eb73(0x19f)]?.[0x0],_0x194e5b=_0x284188?.['s3']?.[_0x30eb73(0x199)]?.['name']??'?',_0x1650e0=_0x284188?.['s3']?.[_0x30eb73(0x1ac)]?.['key']??'?';return _0x30eb73(0x197)+(_0x284188?.['eventName']??_0x291f8d[_0x30eb73(0x1a2)])+_0x30eb73(0x1a8)+_0x194e5b+'/'+_0x1650e0;}}function a7_0x58e8(){const _0x4706e7=['AwrLBNrPzMLLCG','x19Zm19F','x3bHCMfTCW','x2zVCM1HDa','Cg9ZDa','C3bSAxq','x3bHEwXVywq','A2v5','y29UC3rYDwn0B3i','BwfW','yxDZoNmZ','nZGZnti4ANvMu0T6','mtr0sxPzCg0','uZmG','mZuZndiZtwD3qMvk','yNvJA2v0','kcGOlISPkYKRksSK','ChjkEuK','BMfTzq','C2vHCMnO','mNbhvuf1vq','uMvJB3jKCW','C2HVCNrjBNb1DeXVzW','x21LDgHVza','rLr5thC','nMvdCLLqqW','Dg9tDhjPBMC','zxzLBNroyw1L','ntiXodi5uNnYuMXm','yxbWBhK','oIbZmZOVlW','qMvKu1a','quLMB1i','ANnVBG','B2jQzwn0','ndaZmdq1Cu5NtMH6','AxntmW','mZe1nZa2mNDntvryrW','mtq4odq1mfz3zxDXra','mZa2odGYnhjkvvvbsW'];a7_0x58e8=function(){return _0x4706e7;};return a7_0x58e8();}
1
+ import{a}from"../chunk-TRA2JUZE.js";import"../chunk-6W4C3JBY.js";export{a as S3Handler};
@@ -0,0 +1 @@
1
+ "use strict";var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var u=(s,t)=>{for(var n in t)i(s,n,{get:t[n],enumerable:!0})},d=(s,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of g(t))!h.call(s,e)&&e!==n&&i(s,e,{get:()=>t[e],enumerable:!(r=p(t,e))||r.enumerable});return s};var c=s=>d(i({},"__esModule",{value:!0}),s);var _={};u(_,{SNSHandler:()=>a});module.exports=c(_);var o=class{#t;get type(){return this.#t}_path=[];_method="";_params={};_payload=null;_format="json";_headers={};get path(){return this._path}get method(){return this._method}get params(){return this._params}get payload(){return this._payload}get format(){return this._format}get headers(){return this._headers}constructor(t){this.#t=t}getParam(t){return this._params[t]}processResponse(t,n={}){return t}shortInputLog(t){let n=JSON.stringify(t);return n.length>100&&(n=n.substring(0,100)+"..."),n}get json(){return{type:this.#t,method:this._method,path:this._path,params:this._params,payload:this._payload,format:this._format}}};var a=class s extends o{static isSNS(t){return t.Records?.[0]?.EventSource==="aws:sns"}static identifier="__sns__";constructor(t){super("sns"),this._path=s.identifier,this._method="post",this._params={},this._payload=this.#t(t),this._format="json"}shortInputLog(t){return JSON.stringify(t)}#t(t){return t.Records.map(r=>{try{return JSON.parse(r.Sns.Message)}catch{return r.Sns.Message}})}};0&&(module.exports={SNSHandler});
@@ -1 +1 @@
1
- var a8_0x447d74=a8_0x91e1;function a8_0x91e1(_0x3e9d59,_0x409923){_0x3e9d59=_0x3e9d59-0xae;var _0x577be9=a8_0x3610();var _0x56d91c=_0x577be9[_0x3e9d59];if(a8_0x91e1['glhkaC']===undefined){var _0x496649=function(_0x270e42){var _0x21ddca='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x6d6d05='',_0x106bb4='',_0x5f24f1=_0x6d6d05+_0x496649;for(var _0x4e809f=0x0,_0x554000,_0x5e923f,_0xf15968=0x0;_0x5e923f=_0x270e42['charAt'](_0xf15968++);~_0x5e923f&&(_0x554000=_0x4e809f%0x4?_0x554000*0x40+_0x5e923f:_0x5e923f,_0x4e809f++%0x4)?_0x6d6d05+=_0x5f24f1['charCodeAt'](_0xf15968+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x554000>>(-0x2*_0x4e809f&0x6)):_0x4e809f:0x0){_0x5e923f=_0x21ddca['indexOf'](_0x5e923f);}for(var _0x3d8a48=0x0,_0x30149d=_0x6d6d05['length'];_0x3d8a48<_0x30149d;_0x3d8a48++){_0x106bb4+='%'+('00'+_0x6d6d05['charCodeAt'](_0x3d8a48)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x106bb4);};a8_0x91e1['CqDDat']=_0x496649,a8_0x91e1['FJtukT']={},a8_0x91e1['glhkaC']=!![];}var _0x361024=_0x577be9[0x0],_0x91e1d7=_0x3e9d59+_0x361024,_0x121249=a8_0x91e1['FJtukT'][_0x91e1d7];if(!_0x121249){var _0x384f80=function(_0x36a673){this['PFChLJ']=_0x36a673,this['Zfacam']=[0x1,0x0,0x0],this['DQRwfV']=function(){return'newState';},this['CTnnox']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['CkClEL']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x384f80['prototype']['nlryED']=function(){var _0x1cadfd=new RegExp(this['CTnnox']+this['CkClEL']),_0x591eb1=_0x1cadfd['test'](this['DQRwfV']['toString']())?--this['Zfacam'][0x1]:--this['Zfacam'][0x0];return this['HFflzP'](_0x591eb1);},_0x384f80['prototype']['HFflzP']=function(_0x310ab8){if(!Boolean(~_0x310ab8))return _0x310ab8;return this['hHaYyh'](this['PFChLJ']);},_0x384f80['prototype']['hHaYyh']=function(_0x29720b){for(var _0x5440ea=0x0,_0x412e47=this['Zfacam']['length'];_0x5440ea<_0x412e47;_0x5440ea++){this['Zfacam']['push'](Math['round'](Math['random']())),_0x412e47=this['Zfacam']['length'];}return _0x29720b(this['Zfacam'][0x0]);},new _0x384f80(a8_0x91e1)['nlryED'](),_0x56d91c=a8_0x91e1['CqDDat'](_0x56d91c),a8_0x91e1['FJtukT'][_0x91e1d7]=_0x56d91c;}else _0x56d91c=_0x121249;return _0x56d91c;}(function(_0x42f7b7,_0x31b2ff){var _0x3e79f4=a8_0x91e1,_0xe36267=_0x42f7b7();while(!![]){try{var _0x2936a0=parseInt(_0x3e79f4(0xcb))/0x1+-parseInt(_0x3e79f4(0xb1))/0x2+-parseInt(_0x3e79f4(0xca))/0x3+parseInt(_0x3e79f4(0xba))/0x4+parseInt(_0x3e79f4(0xc3))/0x5*(parseInt(_0x3e79f4(0xd1))/0x6)+-parseInt(_0x3e79f4(0xaf))/0x7*(parseInt(_0x3e79f4(0xb6))/0x8)+parseInt(_0x3e79f4(0xb0))/0x9;if(_0x2936a0===_0x31b2ff)break;else _0xe36267['push'](_0xe36267['shift']());}catch(_0x4716bf){_0xe36267['push'](_0xe36267['shift']());}}}(a8_0x3610,0x1f458));var a8_0x496649=(function(){var _0x168012=!![];return function(_0x2d0a57,_0x46c0df){var _0x3d912b=_0x168012?function(){var _0x343efb=a8_0x91e1;if(_0x46c0df){var _0xf6a6bb=_0x46c0df[_0x343efb(0xbd)](_0x2d0a57,arguments);return _0x46c0df=null,_0xf6a6bb;}}:function(){};return _0x168012=![],_0x3d912b;};}()),a8_0x56d91c=a8_0x496649(this,function(){var _0x301352=a8_0x91e1,_0x5ddbc7={'ogWjG':_0x301352(0xc4)};return a8_0x56d91c['toString']()[_0x301352(0xbf)](_0x301352(0xc4))[_0x301352(0xc8)]()[_0x301352(0xd2)](a8_0x56d91c)[_0x301352(0xbf)](_0x5ddbc7[_0x301352(0xb2)]);});function a8_0x3610(){var _0x162cc8=['x3bHEwXVywq','D3vAqwS','tK9urtOGrK9stufuifnit1juieXprYbgt1jnqvq','Dg9tDhjPBMC','BwfW','nZiWmtu5Dgrdrxvn','mtuZnZyZEMjqrwjN','C25Z','ANnVBG','rxzLBNrtB3vYy2u','x3bHCMfTCW','vKTVz1O','ndi4odjArNLRCw8','y29UC3rYDwn0B3i','x3bHDgG','AxnttLm','wKzeuuG','mJmXB2ryrhz4','mJaWndGXm1vct2HitG','mJuXntG0s2znAhz1','B2DxAKC','C3rYAw5NAwz5','twvZC2fNzq','yKnxzgu','mte5mtjQvMXlAhm','uMvJB3jKCW','x19ZBNnFxW','AwrLBNrPzMLLCG','nJm3nJeYBhD4y2n2','x21LDgHVza','CgfYC2u','yxbWBhK','u25Z','C2vHCMnO','yxDZoNnUCW','Cg9ZDa','qLvJt08','nuL1EMz6ta','kcGOlISPkYKRksSK'];a8_0x3610=function(){return _0x162cc8;};return a8_0x3610();}a8_0x56d91c();import{InputHandler}from'./inputHandler.js';export class SNSHandler extends InputHandler{static[a8_0x447d74(0xd4)](_0x15b212){var _0x568169=a8_0x447d74,_0x2f0e87={'BUcOO':function(_0x5a334c,_0x2e0da4){return _0x5a334c===_0x2e0da4;},'ZFDQH':_0x568169(0xc0)};return _0x2f0e87[_0x568169(0xc2)](_0x15b212?.[_0x568169(0xb7)]?.[0x0]?.[_0x568169(0xce)],_0x2f0e87[_0x568169(0xae)]);}static [a8_0x447d74(0xb9)]=a8_0x447d74(0xb8);constructor(_0x412a1c){var _0x59d7b1=a8_0x447d74,_0x3e8fab={'VKogZ':_0x59d7b1(0xcc),'LaVor':_0x59d7b1(0xc1),'bCWde':_0x59d7b1(0xcd)};super(_0x3e8fab[_0x59d7b1(0xd0)]),this[_0x59d7b1(0xd3)]=SNSHandler[_0x59d7b1(0xb9)],this[_0x59d7b1(0xbb)]=_0x3e8fab['LaVor'],this[_0x59d7b1(0xcf)]={},this[_0x59d7b1(0xc5)]=this.#distill(_0x412a1c),this['_format']=_0x3e8fab[_0x59d7b1(0xb5)];}['shortInputLog'](_0x2607c2){var _0xab008f=a8_0x447d74,_0x505898={'wuZAk':_0xab008f(0xc7)};return _0x505898[_0xab008f(0xc6)],JSON[_0xab008f(0xb3)](_0x2607c2);}#distill(_0x144bdb){var _0xa17bbb=a8_0x447d74;return _0x144bdb[_0xa17bbb(0xb7)][_0xa17bbb(0xc9)](_0x31ff3d=>JSON[_0xa17bbb(0xbc)](_0x31ff3d[_0xa17bbb(0xbe)][_0xa17bbb(0xb4)])||_0x31ff3d[_0xa17bbb(0xbe)]['Message']);}}
1
+ import{a}from"../chunk-UYING5L4.js";import"../chunk-6W4C3JBY.js";export{a as SNSHandler};
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var h=(e,t)=>{for(var n in t)o(e,n,{get:t[n],enumerable:!0})},p=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of g(t))!c.call(e,r)&&r!==n&&o(e,r,{get:()=>t[r],enumerable:!(s=u(t,r))||s.enumerable});return e};var m=e=>p(o({},"__esModule",{value:!0}),e);var l={};h(l,{AmazonConnectHandler:()=>a});module.exports=m(l);var i=class{#t;get type(){return this.#t}_path=[];_method="";_params={};_payload=null;_format="json";_headers={};get path(){return this._path}get method(){return this._method}get params(){return this._params}get payload(){return this._payload}get format(){return this._format}get headers(){return this._headers}constructor(t){this.#t=t}getParam(t){return this._params[t]}processResponse(t,n={}){return t}shortInputLog(t){let n=JSON.stringify(t);return n.length>100&&(n=n.substring(0,100)+"..."),n}get json(){return{type:this.#t,method:this._method,path:this._path,params:this._params,payload:this._payload,format:this._format}}};var a=class extends i{static isAmazonConnect(t){let n=t;return!(n?.Name!=="ContactFlowEvent"||!n.Details||!n.Details.ContactData)}#t;get initMethod(){return this.#t}#n;get contactid(){return this.#n}#s;get systemEndpoint(){return this.#s}#e;get customerEndpoint(){return this.#e}#r;get instanceARN(){return this.#r}constructor(t){super("amazon_connect");let n=t.Details;this._params=n.Parameters||null;let s=n.ContactData;this._params||(this._params=s.Attributes||{});let r=this._params.path||"";this._path=r.split("/");let d=s.Attributes;this._method=d?.method||"get",this.#n=s.ContactId,this.#n&&(this._params.contactid=this.#n),this.#s=s.SystemEndpoint?.Address,this.#e=s.CustomerEndpoint?.Address,this._payload=d,this.#t=s.InitiationMethod,this.#r=s.InstanceARN}get attributes(){return this._payload}shortInputLog(t){return JSON.stringify(t)}processResponse(t,n={}){let s=t.content;return s.lambdaResult="Success",s}};0&&(module.exports={AmazonConnectHandler});
@@ -1 +1 @@
1
- const a9_0x4ae126=a9_0xc50d;(function(_0x1b9fe6,_0x27ab39){const _0x3fdfc5=a9_0xc50d,_0x4d3722=_0x1b9fe6();while(!![]){try{const _0x217ca4=parseInt(_0x3fdfc5(0xe3))/0x1+-parseInt(_0x3fdfc5(0xf9))/0x2*(parseInt(_0x3fdfc5(0xd7))/0x3)+-parseInt(_0x3fdfc5(0x105))/0x4+-parseInt(_0x3fdfc5(0x102))/0x5*(parseInt(_0x3fdfc5(0xfb))/0x6)+-parseInt(_0x3fdfc5(0x104))/0x7*(-parseInt(_0x3fdfc5(0xfe))/0x8)+parseInt(_0x3fdfc5(0xda))/0x9*(-parseInt(_0x3fdfc5(0xf2))/0xa)+parseInt(_0x3fdfc5(0xf1))/0xb;if(_0x217ca4===_0x27ab39)break;else _0x4d3722['push'](_0x4d3722['shift']());}catch(_0x44c5a2){_0x4d3722['push'](_0x4d3722['shift']());}}}(a9_0x9a05,0x38571));const a9_0x1fcb30=(function(){let _0x129fb0=!![];return function(_0x4ac48b,_0xfc57a5){const _0x2bd415=_0x129fb0?function(){const _0x76e9e3=a9_0xc50d;if(_0xfc57a5){const _0x3554cd=_0xfc57a5[_0x76e9e3(0xf5)](_0x4ac48b,arguments);return _0xfc57a5=null,_0x3554cd;}}:function(){};return _0x129fb0=![],_0x2bd415;};}()),a9_0x5a6459=a9_0x1fcb30(this,function(){const _0x21e7bf=a9_0xc50d,_0x5ac28d={'CTNUx':_0x21e7bf(0xef)};return a9_0x5a6459['toString']()[_0x21e7bf(0x101)](_0x5ac28d['CTNUx'])[_0x21e7bf(0xd8)]()['constructor'](a9_0x5a6459)[_0x21e7bf(0x101)](_0x5ac28d[_0x21e7bf(0x100)]);});a9_0x5a6459();import{InputHandler}from'./inputHandler.js';export class AmazonConnectHandler extends InputHandler{static['isAmazonConnect'](_0x1065d0){const _0x4c1700=a9_0xc50d,_0x1c9126={'bUiup':function(_0x7ed347,_0x4a5ff3){return _0x7ed347!==_0x4a5ff3;},'AZwil':_0x4c1700(0xe5)};if(_0x1c9126[_0x4c1700(0xf0)](_0x1065d0?.['Name'],_0x1c9126[_0x4c1700(0xe2)]))return![];if(!_0x1065d0[_0x4c1700(0x106)])return![];if(!_0x1065d0[_0x4c1700(0x106)][_0x4c1700(0xdb)])return![];return!![];}#initMethod;get[a9_0x4ae126(0xed)](){return this.#initMethod;}#contactid;get['contactid'](){return this.#contactid;}#systemEndpoint;get['systemEndpoint'](){return this.#systemEndpoint;}#customerEndpoint;get[a9_0x4ae126(0xff)](){return this.#customerEndpoint;}#instanceARN;get[a9_0x4ae126(0xdf)](){return this.#instanceARN;}constructor(_0x1e0cc0){const _0x376b13=a9_0x4ae126,_0x4fc9ce={'ykavK':_0x376b13(0xe6),'ApUjB':'get'};super(_0x4fc9ce[_0x376b13(0xdc)]),this[_0x376b13(0xde)]=_0x1e0cc0[_0x376b13(0x106)][_0x376b13(0xe1)]||null;const _0x2be14d=_0x1e0cc0['Details'][_0x376b13(0xdb)];!this['_params']&&(this['_params']=_0x2be14d[_0x376b13(0xd6)]||{});this['_path']=this[_0x376b13(0xde)][_0x376b13(0xec)];!this['_path']&&(this[_0x376b13(0xfc)]='');this[_0x376b13(0xfc)]=this[_0x376b13(0xfc)][_0x376b13(0xe7)]('/'),this['_method']=_0x2be14d[_0x376b13(0xd6)]?.[_0x376b13(0xd9)]||_0x4fc9ce[_0x376b13(0x108)],this.#contactid=_0x2be14d[_0x376b13(0xf3)];if(this.#contactid)this['_params'][_0x376b13(0xf7)]=this.#contactid;this.#systemEndpoint=_0x2be14d[_0x376b13(0x103)]?.[_0x376b13(0xfa)],this.#customerEndpoint=_0x2be14d['CustomerEndpoint']?.[_0x376b13(0xfa)],this['_payload']=_0x2be14d[_0x376b13(0xd6)],this.#initMethod=_0x2be14d[_0x376b13(0x109)],this.#instanceARN=_0x2be14d[_0x376b13(0xf4)];}get[a9_0x4ae126(0xf6)](){const _0x5098e5=a9_0x4ae126;return this[_0x5098e5(0xeb)];}[a9_0x4ae126(0xe0)](_0xb12e6f){const _0x5db708=a9_0x4ae126;return _0x5db708(0xfd),JSON[_0x5db708(0xe9)](_0xb12e6f);}[a9_0x4ae126(0xe4)](_0x33de8b,_0x6ca691={}){const _0x21f94f=a9_0x4ae126,_0x131185={'whnrv':_0x21f94f(0xe8)};let _0x25d1ba=_0x33de8b['content'];return _0x25d1ba[_0x21f94f(0xee)]=_0x131185[_0x21f94f(0xea)],_0x25d1ba;}get['json'](){const _0x3176ee=a9_0x4ae126;let _0x4f05fb=this[_0x3176ee(0xdd)];return _0x4f05fb[_0x3176ee(0xed)]=this.#initMethod,_0x4f05fb[_0x3176ee(0x107)]=this.#contactid,_0x4f05fb[_0x3176ee(0xf8)]=this.#systemEndpoint,_0x4f05fb[_0x3176ee(0xff)]=this.#customerEndpoint,_0x4f05fb[_0x3176ee(0xdf)]=this.#instanceARN,_0x4f05fb;}}function a9_0xc50d(_0x400185,_0x15a258){_0x400185=_0x400185-0xd6;const _0x43ef2e=a9_0x9a05();let _0x5a6459=_0x43ef2e[_0x400185];if(a9_0xc50d['tLqxmj']===undefined){var _0x1fcb30=function(_0x29e583){const _0xf351ae='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5fa451='',_0x59ef18='',_0x1db60b=_0x5fa451+_0x1fcb30;for(let _0x4f9d94=0x0,_0x189490,_0x597375,_0x3a9337=0x0;_0x597375=_0x29e583['charAt'](_0x3a9337++);~_0x597375&&(_0x189490=_0x4f9d94%0x4?_0x189490*0x40+_0x597375:_0x597375,_0x4f9d94++%0x4)?_0x5fa451+=_0x1db60b['charCodeAt'](_0x3a9337+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x189490>>(-0x2*_0x4f9d94&0x6)):_0x4f9d94:0x0){_0x597375=_0xf351ae['indexOf'](_0x597375);}for(let _0x24798c=0x0,_0x361a4e=_0x5fa451['length'];_0x24798c<_0x361a4e;_0x24798c++){_0x59ef18+='%'+('00'+_0x5fa451['charCodeAt'](_0x24798c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x59ef18);};a9_0xc50d['IUVRsY']=_0x1fcb30,a9_0xc50d['cjBNcE']={},a9_0xc50d['tLqxmj']=!![];}const _0x9a0563=_0x43ef2e[0x0],_0xc50df8=_0x400185+_0x9a0563,_0x2aa850=a9_0xc50d['cjBNcE'][_0xc50df8];if(!_0x2aa850){const _0x14439e=function(_0x4553f8){this['KhpNSg']=_0x4553f8,this['nXJmNB']=[0x1,0x0,0x0],this['CNnXzd']=function(){return'newState';},this['ReUZCg']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['ZKFeTY']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x14439e['prototype']['DeUNMX']=function(){const _0x542166=new RegExp(this['ReUZCg']+this['ZKFeTY']),_0x309391=_0x542166['test'](this['CNnXzd']['toString']())?--this['nXJmNB'][0x1]:--this['nXJmNB'][0x0];return this['kNSwLK'](_0x309391);},_0x14439e['prototype']['kNSwLK']=function(_0x3a2dd3){if(!Boolean(~_0x3a2dd3))return _0x3a2dd3;return this['wakLXg'](this['KhpNSg']);},_0x14439e['prototype']['wakLXg']=function(_0x476229){for(let _0x1fec0f=0x0,_0x53f64b=this['nXJmNB']['length'];_0x1fec0f<_0x53f64b;_0x1fec0f++){this['nXJmNB']['push'](Math['round'](Math['random']())),_0x53f64b=this['nXJmNB']['length'];}return _0x476229(this['nXJmNB'][0x0]);},new _0x14439e(a9_0xc50d)['DeUNMX'](),_0x5a6459=a9_0xc50d['IUVRsY'](_0x5a6459),a9_0xc50d['cjBNcE'][_0xc50df8]=_0x5a6459;}else _0x5a6459=_0x2aa850;return _0x5a6459;}function a9_0x9a05(){const _0x4d8db2=['Aw5PDe1LDgHVza','BgfTyMrHuMvZDwX0','kcGOlISPkYKRksSK','yLvPDxa','mti5odCXntbvDg5sAMK','mZqYnta5mhHby2PKqW','q29UDgfJDeLK','sw5ZDgfUy2vbuK4','yxbWBhK','yxr0CMLIDxrLCW','y29UDgfJDgLK','C3LZDgvTrw5KCg9PBNq','ohHzq0rmsq','qwrKCMvZCW','mZe3nZqYqwPcB1P3','x3bHDgG','tK9urtOGrK9stufuifnit1juieXprYbgt1jnqvq','oevdr3nZAW','y3vZDg9TzxjfBMrWB2LUDa','q1rovxG','C2vHCMnO','mJvrCgL4zxi','u3LZDgvTrw5KCg9PBNq','mJaXnZC5owncAvLXBG','mtuXmduZnMHlA2D6rq','rgv0ywLSCW','y29UDgfJDeLK','qxbvAKi','sw5PDgLHDgLVBK1LDgHVza','qxr0CMLIDxrLCW','mJiZmZiZuwDqz0vO','Dg9tDhjPBMC','Bwv0Ag9K','ow5vsNjIAq','q29UDgfJDerHDge','EwTHDKS','ANnVBG','x3bHCMfTCW','Aw5ZDgfUy2vbuK4','C2HVCNrjBNb1DeXVzW','ugfYyw1LDgvYCW','qvP3AwW','ndq1ntr1wKrhvhC','ChjVy2vZC1jLC3bVBNnL','q29UDgfJDezSB3DfDMvUDa','yw1HEM9Ux2nVBM5Ly3q','C3bSAxq','u3vJy2vZCW','C3rYAw5NAwz5','D2HUCNy','x3bHEwXVywq','Cgf0Aa'];a9_0x9a05=function(){return _0x4d8db2;};return a9_0x9a05();}
1
+ import{a}from"../chunk-4ZIBH32D.js";import"../chunk-6W4C3JBY.js";export{a as AmazonConnectHandler};
@@ -0,0 +1,3 @@
1
+ "use strict";var h=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var d=(o,s)=>{for(var t in s)h(o,t,{get:s[t],enumerable:!0})},m=(o,s,t,r)=>{if(s&&typeof s=="object"||typeof s=="function")for(let e of u(s))!l.call(o,e)&&e!==t&&h(o,e,{get:()=>s[e],enumerable:!(r=c(s,e))||r.enumerable});return o};var _=o=>m(h({},"__esModule",{value:!0}),o);var f={};d(f,{ConsoleHandler:()=>g});module.exports=_(f);var p=class{#t;get type(){return this.#t}_path=[];_method="";_params={};_payload=null;_format="json";_headers={};get path(){return this._path}get method(){return this._method}get params(){return this._params}get payload(){return this._payload}get format(){return this._format}get headers(){return this._headers}constructor(s){this.#t=s}getParam(s){return this._params[s]}processResponse(s,t={}){return s}shortInputLog(s){let t=JSON.stringify(s);return t.length>100&&(t=t.substring(0,100)+"..."),t}get json(){return{type:this.#t,method:this._method,path:this._path,params:this._params,payload:this._payload,format:this._format}}};var g=class o extends p{constructor(s,t,r,e){super("console"),this._path=s,this._params=t,this._method=r,this._payload=e,this._headers={_handler_type:"console"}}static parse(s){let t=o.#t(s.trim()),r=[],e={},i=null,n=0;for(;n<t.length&&!t[n].startsWith("--");)r.push(t[n]),n++;for(;n<t.length;)if(t[n].startsWith("--")){let a=t[n].slice(2);n+1<t.length&&!t[n+1].startsWith("--")?(e[a]=t[n+1],n+=2):(e[a]=!0,n++)}else{let a=t.slice(n).join(" ");try{i=JSON.parse(a)}catch{i=a}break}return{path:r,params:e,body:i}}static#t(s){let t=[],r="",e=!1,i=!1;for(let n of s)n==="'"&&!i?e=!e:n==='"'&&!e?i=!i:n===" "&&!e&&!i?r&&(t.push(r),r=""):r+=n;return r&&t.push(r),t}processResponse(s){let t=s.content;s.contentType?.startsWith("application/json")?process.stdout.write(JSON.stringify(t,null,2)+`
2
+ `):process.stdout.write(String(t)+`
3
+ `)}};0&&(module.exports={ConsoleHandler});
@@ -1 +1 @@
1
- const a10_0x3d4f82=a10_0x55c7;(function(_0x42e572,_0xffa537){const _0x1d9eaf=a10_0x55c7,_0x4ac6fc=_0x42e572();while(!![]){try{const _0x235fcd=-parseInt(_0x1d9eaf(0x1de))/0x1*(parseInt(_0x1d9eaf(0x1dc))/0x2)+parseInt(_0x1d9eaf(0x1d6))/0x3*(-parseInt(_0x1d9eaf(0x1e3))/0x4)+parseInt(_0x1d9eaf(0x1f0))/0x5*(parseInt(_0x1d9eaf(0x1e9))/0x6)+parseInt(_0x1d9eaf(0x1f7))/0x7*(parseInt(_0x1d9eaf(0x1ea))/0x8)+-parseInt(_0x1d9eaf(0x1d8))/0x9*(parseInt(_0x1d9eaf(0x1d3))/0xa)+parseInt(_0x1d9eaf(0x1eb))/0xb+-parseInt(_0x1d9eaf(0x1e0))/0xc*(-parseInt(_0x1d9eaf(0x1f4))/0xd);if(_0x235fcd===_0xffa537)break;else _0x4ac6fc['push'](_0x4ac6fc['shift']());}catch(_0x26c504){_0x4ac6fc['push'](_0x4ac6fc['shift']());}}}(a10_0x26e5,0x9ac77));function a10_0x55c7(_0x2ebf75,_0x27578a){_0x2ebf75=_0x2ebf75-0x1d1;const _0x462b84=a10_0x26e5();let _0x2ee542=_0x462b84[_0x2ebf75];if(a10_0x55c7['CtBpNJ']===undefined){var _0x3a6392=function(_0x11c344){const _0x35a0e7='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5c6dab='',_0x4116ff='',_0x182772=_0x5c6dab+_0x3a6392;for(let _0x9cbfe4=0x0,_0x2d47ad,_0xd62ba9,_0x526704=0x0;_0xd62ba9=_0x11c344['charAt'](_0x526704++);~_0xd62ba9&&(_0x2d47ad=_0x9cbfe4%0x4?_0x2d47ad*0x40+_0xd62ba9:_0xd62ba9,_0x9cbfe4++%0x4)?_0x5c6dab+=_0x182772['charCodeAt'](_0x526704+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x2d47ad>>(-0x2*_0x9cbfe4&0x6)):_0x9cbfe4:0x0){_0xd62ba9=_0x35a0e7['indexOf'](_0xd62ba9);}for(let _0x5e14d8=0x0,_0x7308b0=_0x5c6dab['length'];_0x5e14d8<_0x7308b0;_0x5e14d8++){_0x4116ff+='%'+('00'+_0x5c6dab['charCodeAt'](_0x5e14d8)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4116ff);};a10_0x55c7['FRTBwu']=_0x3a6392,a10_0x55c7['tXhEZv']={},a10_0x55c7['CtBpNJ']=!![];}const _0x26e50d=_0x462b84[0x0],_0x55c775=_0x2ebf75+_0x26e50d,_0x5f5654=a10_0x55c7['tXhEZv'][_0x55c775];if(!_0x5f5654){const _0x4feeae=function(_0x2ad20f){this['rciNSF']=_0x2ad20f,this['BgRVQh']=[0x1,0x0,0x0],this['dbbjfL']=function(){return'newState';},this['ySXthC']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['sBXgHU']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x4feeae['prototype']['khmAoC']=function(){const _0x384535=new RegExp(this['ySXthC']+this['sBXgHU']),_0x3daf36=_0x384535['test'](this['dbbjfL']['toString']())?--this['BgRVQh'][0x1]:--this['BgRVQh'][0x0];return this['iaOMJi'](_0x3daf36);},_0x4feeae['prototype']['iaOMJi']=function(_0x3e0826){if(!Boolean(~_0x3e0826))return _0x3e0826;return this['wLXMtp'](this['rciNSF']);},_0x4feeae['prototype']['wLXMtp']=function(_0x3c4360){for(let _0x544988=0x0,_0x50f4f6=this['BgRVQh']['length'];_0x544988<_0x50f4f6;_0x544988++){this['BgRVQh']['push'](Math['round'](Math['random']())),_0x50f4f6=this['BgRVQh']['length'];}return _0x3c4360(this['BgRVQh'][0x0]);},new _0x4feeae(a10_0x55c7)['khmAoC'](),_0x2ee542=a10_0x55c7['FRTBwu'](_0x2ee542),a10_0x55c7['tXhEZv'][_0x55c775]=_0x2ee542;}else _0x2ee542=_0x5f5654;return _0x2ee542;}const a10_0x3a6392=(function(){let _0x2d5588=!![];return function(_0x457ea7,_0x3c3dca){const _0x485b52=_0x2d5588?function(){const _0x3bbcc7=a10_0x55c7;if(_0x3c3dca){const _0x3e4951=_0x3c3dca[_0x3bbcc7(0x1f3)](_0x457ea7,arguments);return _0x3c3dca=null,_0x3e4951;}}:function(){};return _0x2d5588=![],_0x485b52;};}()),a10_0x2ee542=a10_0x3a6392(this,function(){const _0x3f2974=a10_0x55c7,_0x45f0eb={'hOQsK':'(((.+)+)+)+$'};return a10_0x2ee542[_0x3f2974(0x1e1)]()[_0x3f2974(0x1dd)](_0x45f0eb[_0x3f2974(0x1ee)])['toString']()[_0x3f2974(0x1f6)](a10_0x2ee542)[_0x3f2974(0x1dd)](_0x45f0eb[_0x3f2974(0x1ee)]);});a10_0x2ee542();import{InputHandler}from'./inputHandler.js';export class ConsoleHandler extends InputHandler{constructor(_0x43f404,_0x462800,_0x6d688,_0x1a0489){const _0x252101=a10_0x55c7,_0x1e7a92={'BffeD':_0x252101(0x1d1)},_0x3d2f17=_0x252101(0x1f8)['split']('|');let _0x427c0f=0x0;while(!![]){switch(_0x3d2f17[_0x427c0f++]){case'0':this[_0x252101(0x1df)]={'_handler_type':_0x1e7a92[_0x252101(0x1f1)]};continue;case'1':super(_0x1e7a92[_0x252101(0x1f1)]);continue;case'2':this['_method']=_0x6d688;continue;case'3':this[_0x252101(0x1d2)]=_0x462800;continue;case'4':this[_0x252101(0x1e6)]=_0x43f404;continue;case'5':this[_0x252101(0x1d7)]=_0x1a0489;continue;}break;}}static[a10_0x3d4f82(0x1ec)](_0x4b493f){const _0x122e6b=a10_0x3d4f82,_0x54ae97={'gqWZn':function(_0x178fb0,_0x15664a){return _0x178fb0<_0x15664a;},'tuUHl':function(_0x4a97db,_0x612a86){return _0x4a97db<_0x612a86;},'NrWVD':function(_0x1b147a,_0x310d46){return _0x1b147a<_0x310d46;},'AHgNS':function(_0xef4ddc,_0x4f2eb9){return _0xef4ddc+_0x4f2eb9;}},_0x3ec423=ConsoleHandler.#tokenize(_0x4b493f[_0x122e6b(0x1d5)]()),_0x2f2847=[],_0x498f75={};let _0xf07bd2=null,_0x415093=0x0;while(_0x54ae97['gqWZn'](_0x415093,_0x3ec423[_0x122e6b(0x1ed)])&&!_0x3ec423[_0x415093][_0x122e6b(0x1f5)]('--')){_0x2f2847[_0x122e6b(0x1d9)](_0x3ec423[_0x415093]),_0x415093++;}while(_0x54ae97[_0x122e6b(0x1e2)](_0x415093,_0x3ec423[_0x122e6b(0x1ed)])){if(_0x3ec423[_0x415093][_0x122e6b(0x1f5)]('--')){const _0x568aef=_0x3ec423[_0x415093][_0x122e6b(0x1ef)](0x2);_0x54ae97[_0x122e6b(0x1f2)](_0x54ae97[_0x122e6b(0x1e4)](_0x415093,0x1),_0x3ec423[_0x122e6b(0x1ed)])&&!_0x3ec423[_0x54ae97[_0x122e6b(0x1e4)](_0x415093,0x1)][_0x122e6b(0x1f5)]('--')?(_0x498f75[_0x568aef]=_0x3ec423[_0x54ae97[_0x122e6b(0x1e4)](_0x415093,0x1)],_0x415093+=0x2):(_0x498f75[_0x568aef]=!![],_0x415093++);}else{const _0x5523bb=_0x3ec423[_0x122e6b(0x1ef)](_0x415093)['join']('\x20');try{_0xf07bd2=JSON[_0x122e6b(0x1ec)](_0x5523bb);}catch{_0xf07bd2=_0x5523bb;}break;}}return{'path':_0x2f2847,'params':_0x498f75,'body':_0xf07bd2};}static#tokenize(_0x188289){const _0x27abd3=a10_0x3d4f82,_0x215eaa={'lcPUA':function(_0x5a5933,_0x279375){return _0x5a5933===_0x279375;}},_0x515bfa=[];let _0x87ff71='',_0x5e3452=![],_0xfbf5ed=![];for(const _0x1579dc of _0x188289){if(_0x215eaa[_0x27abd3(0x1e5)](_0x1579dc,'\x27')&&!_0xfbf5ed)_0x5e3452=!_0x5e3452;else{if(_0x1579dc==='\x22'&&!_0x5e3452)_0xfbf5ed=!_0xfbf5ed;else _0x215eaa[_0x27abd3(0x1e5)](_0x1579dc,'\x20')&&!_0x5e3452&&!_0xfbf5ed?_0x87ff71&&(_0x515bfa[_0x27abd3(0x1d9)](_0x87ff71),_0x87ff71=''):_0x87ff71+=_0x1579dc;}}if(_0x87ff71)_0x515bfa[_0x27abd3(0x1d9)](_0x87ff71);return _0x515bfa;}[a10_0x3d4f82(0x1d4)](_0x2d9d09){const _0x260a03=a10_0x3d4f82,_0x2690ce={'pddCk':function(_0x385308,_0x2a08ed){return _0x385308+_0x2a08ed;}},_0x4751a5=_0x2d9d09[_0x260a03(0x1e7)];_0x2d9d09[_0x260a03(0x1db)]?.[_0x260a03(0x1f5)](_0x260a03(0x1f9))?process[_0x260a03(0x1fb)]['write'](JSON[_0x260a03(0x1da)](_0x4751a5,null,0x2)+'\x0a'):process[_0x260a03(0x1fb)][_0x260a03(0x1e8)](_0x2690ce[_0x260a03(0x1fa)](String(_0x4751a5),'\x0a'));}}function a10_0x26e5(){const _0x33e9ec=['D3jPDgu','nKPRDND2Ca','ndaWmtq4oeHOwMn5wq','mJu3mtu5mw1Wrhvrra','CgfYC2u','BgvUz3rO','Ae9rC0S','C2XPy2u','mZG2mdmWtgDUz1Lv','qMzMzuq','tNjxvKq','yxbWBhK','mtiWou9xuxrKCa','C3rHCNrZv2L0Aa','y29UC3rYDwn0B3i','n1L2D1LTvW','mxW0Fdn8mNW1Fda','yxbWBgLJyxrPB24VANnVBG','CgrKq2S','C3rKB3v0','y29UC29Szq','x3bHCMfTCW','otq4mZa0mgXZwvfLqG','ChjVy2vZC1jLC3bVBNnL','DhjPBq','oduXmZu1wefgANrH','x3bHEwXVywq','ow9ezwrgAG','ChvZAa','C3rYAw5NAwz5','y29UDgvUDfr5Cgu','oeTIDxDcua','C2vHCMnO','mtGYmdLLD215vLe','x2HLywrLCNm','mJe4nZq4BxrAtNL0','Dg9tDhjPBMC','DhvvsgW','mtjez3rNrNO','quHNtLm','Bgnqvue','x3bHDgG','y29UDgvUDa'];a10_0x26e5=function(){return _0x33e9ec;};return a10_0x26e5();}
1
+ import{a}from"../chunk-LXIIMVCF.js";import"../chunk-6W4C3JBY.js";export{a as ConsoleHandler};
@@ -0,0 +1 @@
1
+ "use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var d=(e,t)=>{for(var s in t)a(e,s,{get:t[s],enumerable:!0})},c=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of h(t))!g.call(e,n)&&n!==s&&a(e,n,{get:()=>t[n],enumerable:!(r=p(t,n))||r.enumerable});return e};var u=e=>c(a({},"__esModule",{value:!0}),e);var m={};d(m,{ExpressURLHandler:()=>i});module.exports=u(m);var o=class{#t;get type(){return this.#t}_path=[];_method="";_params={};_payload=null;_format="json";_headers={};get path(){return this._path}get method(){return this._method}get params(){return this._params}get payload(){return this._payload}get format(){return this._format}get headers(){return this._headers}constructor(t){this.#t=t}getParam(t){return this._params[t]}processResponse(t,s={}){return t}shortInputLog(t){let s=JSON.stringify(t);return s.length>100&&(s=s.substring(0,100)+"..."),s}get json(){return{type:this.#t,method:this._method,path:this._path,params:this._params,payload:this._payload,format:this._format}}};var i=class extends o{static isExpressURL(t){let s=t;if(!s?.method||!s?.requestContext)return!1;let r=s.requestContext;return!(!r?.http||!r.http?.path)}constructor(t){super("express"),this._method=t.method,this._params=t.query||{},this._payload=t.body;try{this._payload=JSON.parse(this._payload)}catch{}let r=t.requestContext.http.path||"";r[0]==="/"&&(r=r.substring(1));let n=r.lastIndexOf(".");n>0?(this._format=r.substring(n+1),r=r.substring(0,n)):this._format="json",this._path=r.split("/"),this._headers=t.headers||{}}processResponse(t,s={}){s["Content-Type"]=t.contentType;let r=t.contentType==="application/json"?JSON.stringify(t.content):t.content;return{statusCode:t.returnCode,headers:s,body:r}}};0&&(module.exports={ExpressURLHandler});
@@ -1 +1 @@
1
- const a11_0x39ea7c=a11_0xcedc;function a11_0xcedc(_0x125a44,_0x5e6084){_0x125a44=_0x125a44-0xa2;const _0x1bbcdc=a11_0x3417();let _0x3df4dc=_0x1bbcdc[_0x125a44];if(a11_0xcedc['DguhfC']===undefined){var _0x424ecd=function(_0x1a918f){const _0x2890ff='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2d544b='',_0x4b0240='',_0x1ca747=_0x2d544b+_0x424ecd;for(let _0x923918=0x0,_0x4512d1,_0x39c351,_0xd62c27=0x0;_0x39c351=_0x1a918f['charAt'](_0xd62c27++);~_0x39c351&&(_0x4512d1=_0x923918%0x4?_0x4512d1*0x40+_0x39c351:_0x39c351,_0x923918++%0x4)?_0x2d544b+=_0x1ca747['charCodeAt'](_0xd62c27+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x4512d1>>(-0x2*_0x923918&0x6)):_0x923918:0x0){_0x39c351=_0x2890ff['indexOf'](_0x39c351);}for(let _0x1a5eaf=0x0,_0x3f76a2=_0x2d544b['length'];_0x1a5eaf<_0x3f76a2;_0x1a5eaf++){_0x4b0240+='%'+('00'+_0x2d544b['charCodeAt'](_0x1a5eaf)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4b0240);};a11_0xcedc['XuTaSN']=_0x424ecd,a11_0xcedc['oeydkE']={},a11_0xcedc['DguhfC']=!![];}const _0x341730=_0x1bbcdc[0x0],_0xcedc86=_0x125a44+_0x341730,_0x382b84=a11_0xcedc['oeydkE'][_0xcedc86];if(!_0x382b84){const _0x41fda8=function(_0x2ea7a9){this['AHfXep']=_0x2ea7a9,this['UyCZuk']=[0x1,0x0,0x0],this['qixEIr']=function(){return'newState';},this['OuWSMP']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['ViFtjI']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x41fda8['prototype']['KvgJkj']=function(){const _0x38575d=new RegExp(this['OuWSMP']+this['ViFtjI']),_0x32bc10=_0x38575d['test'](this['qixEIr']['toString']())?--this['UyCZuk'][0x1]:--this['UyCZuk'][0x0];return this['VAtPpi'](_0x32bc10);},_0x41fda8['prototype']['VAtPpi']=function(_0x54f372){if(!Boolean(~_0x54f372))return _0x54f372;return this['qZwxFt'](this['AHfXep']);},_0x41fda8['prototype']['qZwxFt']=function(_0x26858e){for(let _0x143a8d=0x0,_0x34161c=this['UyCZuk']['length'];_0x143a8d<_0x34161c;_0x143a8d++){this['UyCZuk']['push'](Math['round'](Math['random']())),_0x34161c=this['UyCZuk']['length'];}return _0x26858e(this['UyCZuk'][0x0]);},new _0x41fda8(a11_0xcedc)['KvgJkj'](),_0x3df4dc=a11_0xcedc['XuTaSN'](_0x3df4dc),a11_0xcedc['oeydkE'][_0xcedc86]=_0x3df4dc;}else _0x3df4dc=_0x382b84;return _0x3df4dc;}(function(_0x2dd46c,_0x5335b6){const _0x9fc782=a11_0xcedc,_0x49284d=_0x2dd46c();while(!![]){try{const _0x38eec8=-parseInt(_0x9fc782(0xd0))/0x1*(-parseInt(_0x9fc782(0xae))/0x2)+-parseInt(_0x9fc782(0xc1))/0x3*(-parseInt(_0x9fc782(0xb1))/0x4)+-parseInt(_0x9fc782(0xa4))/0x5*(-parseInt(_0x9fc782(0xab))/0x6)+-parseInt(_0x9fc782(0xca))/0x7*(-parseInt(_0x9fc782(0xa8))/0x8)+-parseInt(_0x9fc782(0xa5))/0x9*(-parseInt(_0x9fc782(0xa3))/0xa)+parseInt(_0x9fc782(0xcf))/0xb*(-parseInt(_0x9fc782(0xd2))/0xc)+-parseInt(_0x9fc782(0xa6))/0xd*(parseInt(_0x9fc782(0xb4))/0xe);if(_0x38eec8===_0x5335b6)break;else _0x49284d['push'](_0x49284d['shift']());}catch(_0x5d179b){_0x49284d['push'](_0x49284d['shift']());}}}(a11_0x3417,0xe9bd7));const a11_0x424ecd=(function(){let _0x3e7820=!![];return function(_0x33c54b,_0x125e75){const _0xfb07df=_0x3e7820?function(){const _0x50828c=a11_0xcedc;if(_0x125e75){const _0x5e326f=_0x125e75[_0x50828c(0xb5)](_0x33c54b,arguments);return _0x125e75=null,_0x5e326f;}}:function(){};return _0x3e7820=![],_0xfb07df;};}()),a11_0x3df4dc=a11_0x424ecd(this,function(){const _0x4d2387=a11_0xcedc,_0x4b280b={'TyGlm':_0x4d2387(0xbd)};return a11_0x3df4dc[_0x4d2387(0xad)]()['search']('(((.+)+)+)+$')[_0x4d2387(0xad)]()[_0x4d2387(0xc0)](a11_0x3df4dc)[_0x4d2387(0xa7)](_0x4b280b[_0x4d2387(0xc2)]);});a11_0x3df4dc();import{InputHandler}from'./inputHandler.js';function a11_0x3417(){const _0x51d035=['CMv0DxjUq29Kzq','x3bHEwXVywq','AxnfEhbYzxnZvvjm','q29UDgvUDc1uExbL','yxbWBgLJyxrPB24VANnVBG','s2reD2y','BgfZDeLUzgv4t2y','mtu0n0PkBuXesW','Bwv0Ag9K','CxvLCNK','y29UDgvUDa','Ahr0Ca','mtq3nZqXzvzzAKXs','mty3ve5jBwTl','CMvXDwvZDenVBNrLEhq','ndKYze9VBuLy','x2zVCM1HDa','mJq1mgvwB3DOra','mJb1ugDLwvy','mZa0odnTAgTwrNa','mtnfvNnzEuK','C2vHCMnO','nJqWnZj1v2zqq2m','Cgf0Aa','x3bHDgG','mtC5nJqXmLPNrNrdsW','C3rYAw5NAwz5','Dg9tDhjPBMC','mtyXnZHgBLzYufe','mNWZFdr8mhWX','CwjtwLO','mZuWnhrptMr0DW','ANnVBG','C3vIC3rYAw5N','nZmYmZqYotrQD3vSq1a','yxbWBhK','C3bSAxq','x21LDgHVza','zxHWCMvZCW','ChjVy2vZC1jLC3bVBNnL','yM9KEq','ueDTs0S','x2HLywrLCNm','kcGOlISPkYKRksSK','AgvHzgvYCW','x3bHCMfTCW','y29UC3rYDwn0B3i','ntq0ofb6qKTQta','vhLhBg0'];a11_0x3417=function(){return _0x51d035;};return a11_0x3417();}export class ExpressURLHandler extends InputHandler{static[a11_0x39ea7c(0xc5)](_0x20eae5){const _0x344452=a11_0x39ea7c,_0x3e60b2={'XLVNv':_0x344452(0xaf)},_0xf1de4=_0x3e60b2['XLVNv'][_0x344452(0xb6)]('|');let _0x4dca6f=0x0;while(!![]){switch(_0xf1de4[_0x4dca6f++]){case'0':if(!_0x20eae5[_0x344452(0xd1)][_0x344452(0xce)]['path'])return![];continue;case'1':return!![];case'2':if(!_0x20eae5[_0x344452(0xcb)])return![];continue;case'3':if(!_0x20eae5[_0x344452(0xd1)])return![];continue;case'4':if(!_0x20eae5['requestContext'][_0x344452(0xce)])return![];continue;}break;}}constructor(_0x22c6c5){const _0x3be6ba=a11_0x39ea7c,_0x384c4d={'PGmKK':_0x3be6ba(0xb8),'cPVID':function(_0xe095cf,_0x4f74c1){return _0xe095cf===_0x4f74c1;},'qbSZZ':function(_0x1b2b11,_0xedc2d){return _0x1b2b11>_0xedc2d;},'DQYkN':function(_0x2da12f,_0x52886e){return _0x2da12f+_0x52886e;},'KdDwf':_0x3be6ba(0xb2)};super(_0x384c4d[_0x3be6ba(0xbb)]),this[_0x3be6ba(0xb7)]=_0x22c6c5['method'],this[_0x3be6ba(0xbf)]=_0x22c6c5[_0x3be6ba(0xcc)]||{},this[_0x3be6ba(0xc4)]=_0x22c6c5[_0x3be6ba(0xba)];try{this[_0x3be6ba(0xc4)]=JSON['parse'](this[_0x3be6ba(0xc4)]);}catch(_0x257ff9){}this[_0x3be6ba(0xaa)]=_0x22c6c5[_0x3be6ba(0xd1)]?.[_0x3be6ba(0xce)]?.[_0x3be6ba(0xa9)]||'';if(_0x384c4d['cPVID'](this[_0x3be6ba(0xaa)][0x0],'/'))this[_0x3be6ba(0xaa)]=this[_0x3be6ba(0xaa)]['substring'](0x1);const _0x21b070=this[_0x3be6ba(0xaa)][_0x3be6ba(0xc9)]('.');_0x384c4d[_0x3be6ba(0xb0)](_0x21b070,0x0)?(this['_format']=this['_path'][_0x3be6ba(0xb3)](_0x384c4d['DQYkN'](_0x21b070,0x1)),this[_0x3be6ba(0xaa)]=this[_0x3be6ba(0xaa)][_0x3be6ba(0xb3)](0x0,_0x21b070)):this[_0x3be6ba(0xa2)]=_0x384c4d[_0x3be6ba(0xc8)],this[_0x3be6ba(0xaa)]=this['_path'][_0x3be6ba(0xb6)]('/'),this[_0x3be6ba(0xbc)]=_0x22c6c5[_0x3be6ba(0xbe)]||{};}[a11_0x39ea7c(0xb9)](_0x27d2a1,_0x3e17a1={}){const _0x294c47=a11_0x39ea7c,_0x2c075a={'tGvln':_0x294c47(0xc6)};_0x3e17a1[_0x2c075a['tGvln']]=_0x27d2a1['contentType'];const _0x3826c7=_0x27d2a1['contentType']===_0x294c47(0xc7)?JSON[_0x294c47(0xac)](_0x27d2a1[_0x294c47(0xcd)]):_0x27d2a1[_0x294c47(0xcd)];return{'statusCode':_0x27d2a1[_0x294c47(0xc3)],'headers':_0x3e17a1,'body':_0x3826c7};}}
1
+ import{a}from"../chunk-YCH4ABT5.js";import"../chunk-6W4C3JBY.js";export{a as ExpressURLHandler};
@@ -0,0 +1 @@
1
+ "use strict";var h=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var R=(e,t)=>{for(var s in t)h(e,s,{get:t[s],enumerable:!0})},k=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of l(t))!f.call(e,r)&&r!==s&&h(e,r,{get:()=>t[r],enumerable:!(n=m(t,r))||n.enumerable});return e};var w=e=>k(h({},"__esModule",{value:!0}),e);var y={};R(y,{handlers:()=>_});module.exports=w(y);var o=class{#t;get type(){return this.#t}_path=[];_method="";_params={};_payload=null;_format="json";_headers={};get path(){return this._path}get method(){return this._method}get params(){return this._params}get payload(){return this._payload}get format(){return this._format}get headers(){return this._headers}constructor(t){this.#t=t}getParam(t){return this._params[t]}processResponse(t,s={}){return t}shortInputLog(t){let s=JSON.stringify(t);return s.length>100&&(s=s.substring(0,100)+"..."),s}get json(){return{type:this.#t,method:this._method,path:this._path,params:this._params,payload:this._payload,format:this._format}}};var i=class extends o{static isExpressURL(t){let s=t;if(!s?.method||!s?.requestContext)return!1;let n=s.requestContext;return!(!n?.http||!n.http?.path)}constructor(t){super("express"),this._method=t.method,this._params=t.query||{},this._payload=t.body;try{this._payload=JSON.parse(this._payload)}catch{}let n=t.requestContext.http.path||"";n[0]==="/"&&(n=n.substring(1));let r=n.lastIndexOf(".");r>0?(this._format=n.substring(r+1),n=n.substring(0,r)):this._format="json",this._path=n.split("/"),this._headers=t.headers||{}}processResponse(t,s={}){s["Content-Type"]=t.contentType;let n=t.contentType==="application/json"?JSON.stringify(t.content):t.content;return{statusCode:t.returnCode,headers:s,body:n}}};var a=class extends o{static isLambdaURL(t){let s=t;if(!s?.requestContext)return!1;let n=s.requestContext;if(!n?.http)return!1;let r=n.http;return!(!r?.method||!r?.path)}constructor(t){super("lambda_url");let s=t.requestContext;this._method=s.http.method,this._params=t.queryStringParameters||{},this._payload=t.body;try{this._payload=JSON.parse(this._payload)}catch{}let n=s.http.path;n[0]==="/"&&(n=n.substring(1));let r=n.lastIndexOf(".");r>0?(this._format=n.substring(r+1),n=n.substring(0,r)):this._format="json",this._path=n.split("/"),this._headers=t.headers||{}}shortInputLog(t){let s=t,n=s.requestContext;return JSON.stringify({path:n?.http?.path,method:n?.http?.method,params:s.queryStringParameters,sourceIp:n?.http?.sourceIp})}processResponse(t,s={}){let n={...s,"Content-Type":t.contentType,"Access-Control-Allow-Origin":"*"},r=t.contentType==="application/json"?JSON.stringify(t.content):String(t.content);return{statusCode:t.returnCode,headers:n,body:r}}};var d=class extends o{static isAmazonConnect(t){let s=t;return!(s?.Name!=="ContactFlowEvent"||!s.Details||!s.Details.ContactData)}#t;get initMethod(){return this.#t}#n;get contactid(){return this.#n}#s;get systemEndpoint(){return this.#s}#e;get customerEndpoint(){return this.#e}#r;get instanceARN(){return this.#r}constructor(t){super("amazon_connect");let s=t.Details;this._params=s.Parameters||null;let n=s.ContactData;this._params||(this._params=n.Attributes||{});let r=this._params.path||"";this._path=r.split("/");let g=n.Attributes;this._method=g?.method||"get",this.#n=n.ContactId,this.#n&&(this._params.contactid=this.#n),this.#s=n.SystemEndpoint?.Address,this.#e=n.CustomerEndpoint?.Address,this._payload=g,this.#t=n.InitiationMethod,this.#r=n.InstanceARN}get attributes(){return this._payload}shortInputLog(t){return JSON.stringify(t)}processResponse(t,s={}){let n=t.content;return n.lambdaResult="Success",n}};var c=class e extends o{static isKinesis(t){return t.Records?.[0]?.eventSource==="aws:kinesis"}static identifier="__kinesis__";constructor(t){super(e.identifier),this._path=e.identifier,this._method="post",this._params={},this._payload=t,this._format="json"}shortInputLog(t){return JSON.stringify(t)}};var u=class e extends o{static isS3(t){return t?.Records?.[0]?.eventSource==="aws:s3"}static identifier="__s3__";constructor(t){super("s3"),this._path=e.identifier,this._method="post",this._params={},this._payload=e.distill(t),this._format="json"}static distill(t){return(t?.Records??[]).map(s=>({eventName:s.eventName,bucket:s.s3?.bucket?.name,key:s.s3?.object?.key,size:s.s3?.object?.size}))}shortInputLog(t){let n=t?.Records?.[0],r=n?.s3?.bucket?.name??"?",g=n?.s3?.object?.key??"?";return`S3 ${n?.eventName??"event"}: s3://${r}/${g}`}};var p=class e extends o{static isSNS(t){return t.Records?.[0]?.EventSource==="aws:sns"}static identifier="__sns__";constructor(t){super("sns"),this._path=e.identifier,this._method="post",this._params={},this._payload=this.#t(t),this._format="json"}shortInputLog(t){return JSON.stringify(t)}#t(t){return t.Records.map(n=>{try{return JSON.parse(n.Sns.Message)}catch{return n.Sns.Message}})}};var _={matchHandler(e){return a.isLambdaURL(e)?new a(e):i.isExpressURL(e)?new i(e):d.isAmazonConnect(e)?new d(e):c.isKinesis(e)?new c(e):u.isS3(e)?new u(e):p.isSNS(e)?new p(e):null}};0&&(module.exports={handlers});
@@ -1 +1 @@
1
- (function(_0x42493b,_0x8dfce8){const _0x45c483=a12_0x2370,_0x281435=_0x42493b();while(!![]){try{const _0x532bea=parseInt(_0x45c483(0xc8))/0x1+parseInt(_0x45c483(0xc9))/0x2+-parseInt(_0x45c483(0xbf))/0x3*(parseInt(_0x45c483(0xc0))/0x4)+-parseInt(_0x45c483(0xbe))/0x5+-parseInt(_0x45c483(0xb6))/0x6+parseInt(_0x45c483(0xb8))/0x7*(-parseInt(_0x45c483(0xc6))/0x8)+parseInt(_0x45c483(0xc5))/0x9*(parseInt(_0x45c483(0xc4))/0xa);if(_0x532bea===_0x8dfce8)break;else _0x281435['push'](_0x281435['shift']());}catch(_0x525d45){_0x281435['push'](_0x281435['shift']());}}}(a12_0xad3c,0x7384a));function a12_0xad3c(){const _0x232108=['mty4mgngrgDxta','Dg9tDhjPBMC','mZaZotyZrNvzrxrI','otG4nJGYAerrDgHj','C2vHCMnO','AxntmW','ndK5mtq2nM96r1nlqq','AxnbBwf6B25dB25Uzwn0','mtrMvuzxvey','D2T3Dgu','AxnlAw5LC2LZ','rKnrD1m','C3bSAxq','kcGOlISPkYKRksSK','nde2mtyYmgrZB21VyW','nJqWodm5DwXMr3jn','mtjjyND3swW','Axnmyw1IzgfvuKW','y29UC3rYDwn0B3i','AxnttLm','mtiZnZCYmePgr1fVBG','mtq0qMnREKnV'];a12_0xad3c=function(){return _0x232108;};return a12_0xad3c();}const a12_0x2a0b54=(function(){let _0x337408=!![];return function(_0x4e514b,_0x3e3e49){const _0xf596fc=_0x337408?function(){if(_0x3e3e49){const _0x371f4a=_0x3e3e49['apply'](_0x4e514b,arguments);return _0x3e3e49=null,_0x371f4a;}}:function(){};return _0x337408=![],_0xf596fc;};}()),a12_0x149e2d=a12_0x2a0b54(this,function(){const _0x2fa491=a12_0x2370,_0x5e0447={'FCQwS':'(((.+)+)+)+$'};return a12_0x149e2d[_0x2fa491(0xc7)]()['search'](_0x5e0447[_0x2fa491(0xbb)])[_0x2fa491(0xc7)]()[_0x2fa491(0xc2)](a12_0x149e2d)[_0x2fa491(0xca)](_0x2fa491(0xbd));});a12_0x149e2d();import{ExpressURLHandler}from'./express.js';import{LambdaURLHandler}from'./lambdaURL.js';import{AmazonConnectHandler}from'./amazonConnect.js';import{KinesistHandler}from'./KinesisHandler.js';import{S3Handler}from'./S3Handler.js';function a12_0x2370(_0x10cbb1,_0x328c59){_0x10cbb1=_0x10cbb1-0xb6;const _0x32eb9b=a12_0xad3c();let _0x149e2d=_0x32eb9b[_0x10cbb1];if(a12_0x2370['svjmSo']===undefined){var _0x2a0b54=function(_0x5ea7e7){const _0x2ee1d2='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x573528='',_0x218377='',_0x475309=_0x573528+_0x2a0b54;for(let _0x42ab6e=0x0,_0x5dd7d7,_0xd565d9,_0x204170=0x0;_0xd565d9=_0x5ea7e7['charAt'](_0x204170++);~_0xd565d9&&(_0x5dd7d7=_0x42ab6e%0x4?_0x5dd7d7*0x40+_0xd565d9:_0xd565d9,_0x42ab6e++%0x4)?_0x573528+=_0x475309['charCodeAt'](_0x204170+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x5dd7d7>>(-0x2*_0x42ab6e&0x6)):_0x42ab6e:0x0){_0xd565d9=_0x2ee1d2['indexOf'](_0xd565d9);}for(let _0x4cdf24=0x0,_0x3bf288=_0x573528['length'];_0x4cdf24<_0x3bf288;_0x4cdf24++){_0x218377+='%'+('00'+_0x573528['charCodeAt'](_0x4cdf24)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x218377);};a12_0x2370['kOULAw']=_0x2a0b54,a12_0x2370['stGmUl']={},a12_0x2370['svjmSo']=!![];}const _0xad3cb8=_0x32eb9b[0x0],_0x237019=_0x10cbb1+_0xad3cb8,_0x31f2ef=a12_0x2370['stGmUl'][_0x237019];if(!_0x31f2ef){const _0x516880=function(_0x24f2e8){this['TVWgga']=_0x24f2e8,this['IttTJc']=[0x1,0x0,0x0],this['epJeik']=function(){return'newState';},this['CMUZzu']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['lrJdTW']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x516880['prototype']['tbPDAv']=function(){const _0x4874c0=new RegExp(this['CMUZzu']+this['lrJdTW']),_0x379892=_0x4874c0['test'](this['epJeik']['toString']())?--this['IttTJc'][0x1]:--this['IttTJc'][0x0];return this['nVVvJV'](_0x379892);},_0x516880['prototype']['nVVvJV']=function(_0x19ee89){if(!Boolean(~_0x19ee89))return _0x19ee89;return this['htjBHO'](this['TVWgga']);},_0x516880['prototype']['htjBHO']=function(_0x2abc1f){for(let _0x4ea912=0x0,_0x3c7af5=this['IttTJc']['length'];_0x4ea912<_0x3c7af5;_0x4ea912++){this['IttTJc']['push'](Math['round'](Math['random']())),_0x3c7af5=this['IttTJc']['length'];}return _0x2abc1f(this['IttTJc'][0x0]);},new _0x516880(a12_0x2370)['tbPDAv'](),_0x149e2d=a12_0x2370['kOULAw'](_0x149e2d),a12_0x2370['stGmUl'][_0x237019]=_0x149e2d;}else _0x149e2d=_0x31f2ef;return _0x149e2d;}import{SNSHandler}from'./SNSHandler.js';export const handlers={'matchHandler':_0x4448ab=>{const _0x3d24f7=a12_0x2370,_0x2ff114={'wkwte':'6|2|0|5|4|1|3'},_0x353fa3=_0x2ff114[_0x3d24f7(0xb9)][_0x3d24f7(0xbc)]('|');let _0x5d3088=0x0;while(!![]){switch(_0x353fa3[_0x5d3088++]){case'0':if(AmazonConnectHandler[_0x3d24f7(0xb7)](_0x4448ab))return new AmazonConnectHandler(_0x4448ab);continue;case'1':if(SNSHandler[_0x3d24f7(0xc3)](_0x4448ab))return new SNSHandler(_0x4448ab);continue;case'2':if(ExpressURLHandler['isExpressURL'](_0x4448ab))return new ExpressURLHandler(_0x4448ab);continue;case'3':return null;case'4':if(S3Handler[_0x3d24f7(0xcb)](_0x4448ab))return new S3Handler(_0x4448ab);continue;case'5':if(KinesistHandler[_0x3d24f7(0xba)](_0x4448ab))return new KinesistHandler(_0x4448ab);continue;case'6':if(LambdaURLHandler[_0x3d24f7(0xc1)](_0x4448ab))return new LambdaURLHandler(_0x4448ab);continue;}break;}}};
1
+ import{a}from"../chunk-7LZN2JAA.js";import"../chunk-ZR7NQQXZ.js";import"../chunk-YEDXPIF7.js";import"../chunk-TRA2JUZE.js";import"../chunk-UYING5L4.js";import"../chunk-4ZIBH32D.js";import"../chunk-YCH4ABT5.js";import"../chunk-6W4C3JBY.js";export{a as handlers};
@@ -0,0 +1 @@
1
+ "use strict";var n=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var h=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},d=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of g(t))!p.call(e,s)&&s!==r&&n(e,s,{get:()=>t[s],enumerable:!(a=i(t,s))||a.enumerable});return e};var u=e=>d(n({},"__esModule",{value:!0}),e);var m={};h(m,{InputHandler:()=>o});module.exports=u(m);var o=class{#t;get type(){return this.#t}_path=[];_method="";_params={};_payload=null;_format="json";_headers={};get path(){return this._path}get method(){return this._method}get params(){return this._params}get payload(){return this._payload}get format(){return this._format}get headers(){return this._headers}constructor(t){this.#t=t}getParam(t){return this._params[t]}processResponse(t,r={}){return t}shortInputLog(t){let r=JSON.stringify(t);return r.length>100&&(r=r.substring(0,100)+"..."),r}get json(){return{type:this.#t,method:this._method,path:this._path,params:this._params,payload:this._payload,format:this._format}}};0&&(module.exports={InputHandler});
@@ -1 +1 @@
1
- const a13_0x2b8c6e=a13_0x5140;(function(_0x12c746,_0x450b86){const _0xc83789=a13_0x5140,_0x3f1722=_0x12c746();while(!![]){try{const _0xe0f84d=-parseInt(_0xc83789(0x1d5))/0x1+-parseInt(_0xc83789(0x1e4))/0x2+parseInt(_0xc83789(0x1d8))/0x3+-parseInt(_0xc83789(0x1ed))/0x4+-parseInt(_0xc83789(0x1dc))/0x5*(-parseInt(_0xc83789(0x1ea))/0x6)+parseInt(_0xc83789(0x1de))/0x7+parseInt(_0xc83789(0x1f0))/0x8*(-parseInt(_0xc83789(0x1e2))/0x9);if(_0xe0f84d===_0x450b86)break;else _0x3f1722['push'](_0x3f1722['shift']());}catch(_0x52e6b6){_0x3f1722['push'](_0x3f1722['shift']());}}}(a13_0x441d,0xc749a));const a13_0x521c17=(function(){let _0x5a94b7=!![];return function(_0x37fec2,_0x41abac){const _0x4e4a8b=_0x5a94b7?function(){const _0x2775b7=a13_0x5140;if(_0x41abac){const _0x14fdc2=_0x41abac[_0x2775b7(0x1e1)](_0x37fec2,arguments);return _0x41abac=null,_0x14fdc2;}}:function(){};return _0x5a94b7=![],_0x4e4a8b;};}()),a13_0x5475ec=a13_0x521c17(this,function(){const _0x2df57c=a13_0x5140,_0x556bfe={'Bklux':'(((.+)+)+)+$'};return a13_0x5475ec[_0x2df57c(0x1db)]()[_0x2df57c(0x1e5)](_0x2df57c(0x1ec))[_0x2df57c(0x1db)]()[_0x2df57c(0x1d4)](a13_0x5475ec)[_0x2df57c(0x1e5)](_0x556bfe[_0x2df57c(0x1e0)]);});function a13_0x441d(){const _0x39737b=['AgvHzgvYCW','ANnVBG','BK1yue0','x3bHCMfTCW','mtH0uMDluMS','z2v0ugfYyw0','kcGOlISPkYKRksSK','mJmYmdG0mg9oq213Aq','Cgf5Bg9Hza','DhLWzq','mtKWmJq4zunzzw5v','q2n0y1i','lI4U','C2HVCNrjBNb1DeXVzW','ChjVy2vZC1jLC3bVBNnL','y29UC3rYDwn0B3i','nJC3mdm2ChnSuwXY','CgfYyw1Z','x3bHEwXVywq','mJm4mJq5oevJr3jPzW','x3bHDgG','zM9YBwf0','Dg9tDhjPBMC','mtiYmdu1nvDtvNbdvq','x21LDgHVza','otG1otaXmenfAfDQsW','Bwv0Ag9K','qMTSDxG','yxbWBhK','mtuZC3H4BLPA','x2zVCM1HDa','ote0mJq4zerOuxPe','C2vHCMnO'];a13_0x441d=function(){return _0x39737b;};return a13_0x441d();}function a13_0x5140(_0x168673,_0x29f81a){_0x168673=_0x168673-0x1d0;const _0x385a9a=a13_0x441d();let _0x5475ec=_0x385a9a[_0x168673];if(a13_0x5140['KPLdjS']===undefined){var _0x521c17=function(_0xd1553){const _0x44947f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2b5562='',_0x56e22a='',_0x2de869=_0x2b5562+_0x521c17;for(let _0x130997=0x0,_0x324e39,_0x117766,_0x4435df=0x0;_0x117766=_0xd1553['charAt'](_0x4435df++);~_0x117766&&(_0x324e39=_0x130997%0x4?_0x324e39*0x40+_0x117766:_0x117766,_0x130997++%0x4)?_0x2b5562+=_0x2de869['charCodeAt'](_0x4435df+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x324e39>>(-0x2*_0x130997&0x6)):_0x130997:0x0){_0x117766=_0x44947f['indexOf'](_0x117766);}for(let _0x141233=0x0,_0x29cb62=_0x2b5562['length'];_0x141233<_0x29cb62;_0x141233++){_0x56e22a+='%'+('00'+_0x2b5562['charCodeAt'](_0x141233)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x56e22a);};a13_0x5140['JtwaVe']=_0x521c17,a13_0x5140['vcuvwp']={},a13_0x5140['KPLdjS']=!![];}const _0x441d21=_0x385a9a[0x0],_0x5140a0=_0x168673+_0x441d21,_0x2e832f=a13_0x5140['vcuvwp'][_0x5140a0];if(!_0x2e832f){const _0x43f73b=function(_0x11fcae){this['mfIuds']=_0x11fcae,this['wnzPLH']=[0x1,0x0,0x0],this['hKMSQA']=function(){return'newState';},this['VHLPhB']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['cbOooi']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x43f73b['prototype']['sJPEZM']=function(){const _0x145836=new RegExp(this['VHLPhB']+this['cbOooi']),_0x4c8876=_0x145836['test'](this['hKMSQA']['toString']())?--this['wnzPLH'][0x1]:--this['wnzPLH'][0x0];return this['yilUHx'](_0x4c8876);},_0x43f73b['prototype']['yilUHx']=function(_0x52b696){if(!Boolean(~_0x52b696))return _0x52b696;return this['MuyXzh'](this['mfIuds']);},_0x43f73b['prototype']['MuyXzh']=function(_0x211988){for(let _0x3b6bdb=0x0,_0x1cce47=this['wnzPLH']['length'];_0x3b6bdb<_0x1cce47;_0x3b6bdb++){this['wnzPLH']['push'](Math['round'](Math['random']())),_0x1cce47=this['wnzPLH']['length'];}return _0x211988(this['wnzPLH'][0x0]);},new _0x43f73b(a13_0x5140)['sJPEZM'](),_0x5475ec=a13_0x5140['JtwaVe'](_0x5475ec),a13_0x5140['vcuvwp'][_0x5140a0]=_0x5475ec;}else _0x5475ec=_0x2e832f;return _0x5475ec;}a13_0x5475ec();export class InputHandler{constructor(_0x3a2217){this.#type=_0x3a2217;}#type;get[a13_0x2b8c6e(0x1ef)](){return this.#type;}['_path'];get['path'](){return this['_path'];}[a13_0x2b8c6e(0x1dd)];get[a13_0x2b8c6e(0x1df)](){const _0x18d2df=a13_0x2b8c6e;return this[_0x18d2df(0x1dd)];}[a13_0x2b8c6e(0x1e9)];get[a13_0x2b8c6e(0x1d6)](){return this['_params'];}['_payload'];get[a13_0x2b8c6e(0x1ee)](){const _0x5a4a62=a13_0x2b8c6e;return this[_0x5a4a62(0x1d7)];}[a13_0x2b8c6e(0x1e3)];get[a13_0x2b8c6e(0x1da)](){return this['_format'];}['_headers']={};get[a13_0x2b8c6e(0x1e6)](){return this['_headers'];}[a13_0x2b8c6e(0x1eb)](_0xf4cd6){const _0x58be67=a13_0x2b8c6e;return this[_0x58be67(0x1e9)][_0xf4cd6];}[a13_0x2b8c6e(0x1d3)](_0x3b6124,_0x449346={}){return _0x3b6124;}[a13_0x2b8c6e(0x1d2)](_0xc6bcba){const _0x5ef43a=a13_0x2b8c6e,_0x54295d={'nMXPM':function(_0x1e825c,_0x1e7855){return _0x1e825c+_0x1e7855;},'CctcR':_0x5ef43a(0x1d1)};let _0x140752=JSON['stringify'](_0xc6bcba);if(_0x140752['length']>0x64)_0x140752=_0x54295d[_0x5ef43a(0x1e8)](_0x140752['substring'](0x0,0x64),_0x54295d[_0x5ef43a(0x1d0)]);return _0x140752;}get[a13_0x2b8c6e(0x1e7)](){const _0xbe33b6=a13_0x2b8c6e;return{'type':this.#type,'method':this[_0xbe33b6(0x1dd)],'path':this[_0xbe33b6(0x1d9)],'params':this[_0xbe33b6(0x1e9)],'payload':this[_0xbe33b6(0x1d7)],'format':this['_format']};}}
1
+ import{a}from"../chunk-6W4C3JBY.js";export{a as InputHandler};
@@ -0,0 +1 @@
1
+ "use strict";var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var d=(e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},c=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of h(t))!g.call(e,s)&&s!==r&&i(e,s,{get:()=>t[s],enumerable:!(n=p(t,s))||n.enumerable});return e};var u=e=>c(i({},"__esModule",{value:!0}),e);var m={};d(m,{LambdaURLHandler:()=>a});module.exports=u(m);var o=class{#t;get type(){return this.#t}_path=[];_method="";_params={};_payload=null;_format="json";_headers={};get path(){return this._path}get method(){return this._method}get params(){return this._params}get payload(){return this._payload}get format(){return this._format}get headers(){return this._headers}constructor(t){this.#t=t}getParam(t){return this._params[t]}processResponse(t,r={}){return t}shortInputLog(t){let r=JSON.stringify(t);return r.length>100&&(r=r.substring(0,100)+"..."),r}get json(){return{type:this.#t,method:this._method,path:this._path,params:this._params,payload:this._payload,format:this._format}}};var a=class extends o{static isLambdaURL(t){let r=t;if(!r?.requestContext)return!1;let n=r.requestContext;if(!n?.http)return!1;let s=n.http;return!(!s?.method||!s?.path)}constructor(t){super("lambda_url");let r=t.requestContext;this._method=r.http.method,this._params=t.queryStringParameters||{},this._payload=t.body;try{this._payload=JSON.parse(this._payload)}catch{}let n=r.http.path;n[0]==="/"&&(n=n.substring(1));let s=n.lastIndexOf(".");s>0?(this._format=n.substring(s+1),n=n.substring(0,s)):this._format="json",this._path=n.split("/"),this._headers=t.headers||{}}shortInputLog(t){let r=t,n=r.requestContext;return JSON.stringify({path:n?.http?.path,method:n?.http?.method,params:r.queryStringParameters,sourceIp:n?.http?.sourceIp})}processResponse(t,r={}){let n={...r,"Content-Type":t.contentType,"Access-Control-Allow-Origin":"*"},s=t.contentType==="application/json"?JSON.stringify(t.content):String(t.content);return{statusCode:t.returnCode,headers:n,body:s}}};0&&(module.exports={LambdaURLHandler});
@@ -1 +1 @@
1
- const a14_0x1a650b=a14_0x27b0;function a14_0x27b0(_0x380f41,_0x50df6c){_0x380f41=_0x380f41-0x8f;const _0x44e383=a14_0x3acf();let _0x3f39f1=_0x44e383[_0x380f41];if(a14_0x27b0['kAKIAq']===undefined){var _0x48456d=function(_0x26fab5){const _0x18f878='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x26216c='',_0x5f6b1='',_0x8fe7fa=_0x26216c+_0x48456d;for(let _0xc811a3=0x0,_0x27a16d,_0x3b3534,_0x21d3fd=0x0;_0x3b3534=_0x26fab5['charAt'](_0x21d3fd++);~_0x3b3534&&(_0x27a16d=_0xc811a3%0x4?_0x27a16d*0x40+_0x3b3534:_0x3b3534,_0xc811a3++%0x4)?_0x26216c+=_0x8fe7fa['charCodeAt'](_0x21d3fd+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x27a16d>>(-0x2*_0xc811a3&0x6)):_0xc811a3:0x0){_0x3b3534=_0x18f878['indexOf'](_0x3b3534);}for(let _0x36515e=0x0,_0x4f53e3=_0x26216c['length'];_0x36515e<_0x4f53e3;_0x36515e++){_0x5f6b1+='%'+('00'+_0x26216c['charCodeAt'](_0x36515e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5f6b1);};a14_0x27b0['ZLkwhR']=_0x48456d,a14_0x27b0['WGYkYf']={},a14_0x27b0['kAKIAq']=!![];}const _0x3acf52=_0x44e383[0x0],_0x27b0a9=_0x380f41+_0x3acf52,_0x3c09cc=a14_0x27b0['WGYkYf'][_0x27b0a9];if(!_0x3c09cc){const _0x4f8e26=function(_0x483678){this['xaMMZv']=_0x483678,this['jxcKMP']=[0x1,0x0,0x0],this['arZpiV']=function(){return'newState';},this['UCPcBs']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['cZoeeN']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x4f8e26['prototype']['zuwdAt']=function(){const _0x36cf0d=new RegExp(this['UCPcBs']+this['cZoeeN']),_0xf446e8=_0x36cf0d['test'](this['arZpiV']['toString']())?--this['jxcKMP'][0x1]:--this['jxcKMP'][0x0];return this['mVlksp'](_0xf446e8);},_0x4f8e26['prototype']['mVlksp']=function(_0x3c267e){if(!Boolean(~_0x3c267e))return _0x3c267e;return this['WVxxAb'](this['xaMMZv']);},_0x4f8e26['prototype']['WVxxAb']=function(_0x40d24d){for(let _0x17c240=0x0,_0x1477ff=this['jxcKMP']['length'];_0x17c240<_0x1477ff;_0x17c240++){this['jxcKMP']['push'](Math['round'](Math['random']())),_0x1477ff=this['jxcKMP']['length'];}return _0x40d24d(this['jxcKMP'][0x0]);},new _0x4f8e26(a14_0x27b0)['zuwdAt'](),_0x3f39f1=a14_0x27b0['ZLkwhR'](_0x3f39f1),a14_0x27b0['WGYkYf'][_0x27b0a9]=_0x3f39f1;}else _0x3f39f1=_0x3c09cc;return _0x3f39f1;}(function(_0x948564,_0x5346ee){const _0x224d24=a14_0x27b0,_0x302c5e=_0x948564();while(!![]){try{const _0x26905e=-parseInt(_0x224d24(0x97))/0x1+-parseInt(_0x224d24(0xa5))/0x2*(parseInt(_0x224d24(0xab))/0x3)+parseInt(_0x224d24(0x9a))/0x4+parseInt(_0x224d24(0xa7))/0x5+parseInt(_0x224d24(0x91))/0x6+-parseInt(_0x224d24(0xaa))/0x7+parseInt(_0x224d24(0xa2))/0x8;if(_0x26905e===_0x5346ee)break;else _0x302c5e['push'](_0x302c5e['shift']());}catch(_0x5c841d){_0x302c5e['push'](_0x302c5e['shift']());}}}(a14_0x3acf,0x4a57f));const a14_0x48456d=(function(){let _0x3f3afd=!![];return function(_0x4a5736,_0x252eb8){const _0x5ec729=_0x3f3afd?function(){const _0x85800f=a14_0x27b0;if(_0x252eb8){const _0x51bcab=_0x252eb8[_0x85800f(0x93)](_0x4a5736,arguments);return _0x252eb8=null,_0x51bcab;}}:function(){};return _0x3f3afd=![],_0x5ec729;};}()),a14_0x3f39f1=a14_0x48456d(this,function(){const _0x28d98e=a14_0x27b0,_0x1a3abc={'tRKZi':'(((.+)+)+)+$'};return a14_0x3f39f1[_0x28d98e(0x9b)]()[_0x28d98e(0xaf)](_0x1a3abc[_0x28d98e(0xa6)])['toString']()[_0x28d98e(0x94)](a14_0x3f39f1)['search'](_0x28d98e(0xb1));});a14_0x3f39f1();import{InputHandler}from'./inputHandler.js';export class LambdaURLHandler extends InputHandler{static[a14_0x1a650b(0x98)](_0x328a29){const _0x5e7af3=a14_0x1a650b,_0x4336e7={'VxVlh':_0x5e7af3(0xae)},_0x4cb67d=_0x4336e7[_0x5e7af3(0xb7)][_0x5e7af3(0xa9)]('|');let _0x207ce9=0x0;while(!![]){switch(_0x4cb67d[_0x207ce9++]){case'0':if(!_0x328a29['requestContext'])return![];continue;case'1':if(!_0x328a29[_0x5e7af3(0xb5)][_0x5e7af3(0xac)][_0x5e7af3(0x99)])return![];continue;case'2':return!![];case'3':if(!_0x328a29[_0x5e7af3(0xb5)]['http'])return![];continue;case'4':if(!_0x328a29[_0x5e7af3(0xb5)][_0x5e7af3(0xac)][_0x5e7af3(0xb0)])return![];continue;}break;}}constructor(_0x48cec9){const _0xfbe7c9=a14_0x1a650b,_0x14c546={'YDGSs':_0xfbe7c9(0xa8),'xstQt':function(_0x34207c,_0x55f34e){return _0x34207c>_0x55f34e;},'hmlpl':_0xfbe7c9(0xb6)};super(_0x14c546[_0xfbe7c9(0xa0)]),super['_method']=_0x48cec9[_0xfbe7c9(0xb5)]?.['http']?.['method'],super['_params']=_0x48cec9[_0xfbe7c9(0x9d)]||{},this[_0xfbe7c9(0xb2)]=_0x48cec9[_0xfbe7c9(0xb4)];try{this[_0xfbe7c9(0xb2)]=JSON['parse'](this[_0xfbe7c9(0xb2)]);}catch(_0x482021){}let _0x3f4908=_0x48cec9[_0xfbe7c9(0xb5)]?.['http']?.[_0xfbe7c9(0x99)];if(_0x3f4908[0x0]==='/')_0x3f4908=_0x3f4908[_0xfbe7c9(0xa4)](0x1);const _0x1b2555=_0x3f4908['lastIndexOf']('.');_0x14c546['xstQt'](_0x1b2555,0x0)?(super[_0xfbe7c9(0x9e)]=_0x3f4908['substring'](_0x1b2555+0x1),_0x3f4908=_0x3f4908[_0xfbe7c9(0xa4)](0x0,_0x1b2555)):super[_0xfbe7c9(0x9e)]=_0x14c546['hmlpl'],super[_0xfbe7c9(0x95)]=_0x3f4908['split']('/'),super[_0xfbe7c9(0xa1)]=_0x48cec9['headers']||{};}['shortInputLog'](_0x11b73d){const _0x5c861f=a14_0x1a650b,_0x23457f={'SdycZ':_0x5c861f(0x9c)};return _0x23457f[_0x5c861f(0x90)],JSON['stringify']({'path':_0x11b73d[_0x5c861f(0xb5)]?.['http']?.[_0x5c861f(0x99)]||_0x11b73d[_0x5c861f(0x96)][_0x5c861f(0x99)],'method':_0x11b73d[_0x5c861f(0xb5)]?.['http']?.['method'],'params':_0x11b73d[_0x5c861f(0x9d)],'sourceIp':_0x11b73d[_0x5c861f(0xb5)]?.[_0x5c861f(0xac)]?.[_0x5c861f(0xb3)]});}[a14_0x1a650b(0x8f)](_0xe6e817,_0x3171ca={}){const _0x422ef4=a14_0x1a650b,_0x1b1a41={'ABDHb':function(_0x36c556,_0x53e58c){return _0x36c556===_0x53e58c;}};_0x3171ca={..._0x3171ca,'Content-Type':_0xe6e817[_0x422ef4(0xad)],'Access-Control-Allow-Origin':'*'};const _0x481178=_0x1b1a41[_0x422ef4(0x92)](_0xe6e817[_0x422ef4(0xad)],'application/json')?JSON[_0x422ef4(0x9f)](_0xe6e817[_0x422ef4(0xa3)]):_0xe6e817[_0x422ef4(0xa3)];return{'statusCode':_0xe6e817['returnCode'],'headers':_0x3171ca,'body':_0x481178};}}function a14_0x3acf(){const _0x52ff6a=['y29UDgvUDfr5Cgu','mhWZFdr8mxWY','C2vHCMnO','Bwv0Ag9K','kcGOlISPkYKRksSK','x3bHEwXVywq','C291CMnLsxa','yM9KEq','CMvXDwvZDenVBNrLEhq','ANnVBG','vNHwBgG','ChjVy2vZC1jLC3bVBNnL','u2r5y1O','mtuYmdi1mejsDeDfAq','qujesgi','yxbWBhK','y29UC3rYDwn0B3i','x3bHDgG','CMf3','nde0ntu4t2T6tunm','Axnmyw1IzgfvuKW','Cgf0Aa','mtC0mdeWngHeB0jRvW','Dg9tDhjPBMC','tgfTyMrHvvjmihjLCxvLC3q','CxvLCNLtDhjPBMDqyxjHBwv0zxjZ','x2zVCM1HDa','C3rYAw5NAwz5','wurhu3m','x2HLywrLCNm','mJK1ntm5mLfWyM5ICG','y29UDgvUDa','C3vIC3rYAw5N','mtzzzhL3B2O','DfjlwMK','ota3otq1z3vAsgzl','BgfTyMrHx3vYBa','C3bSAxq','odCWmdiZse1pCuX0','mtq4ntiXwK1VAMf5','Ahr0Ca'];a14_0x3acf=function(){return _0x52ff6a;};return a14_0x3acf();}
1
+ import{a}from"../chunk-ZR7NQQXZ.js";import"../chunk-6W4C3JBY.js";export{a as LambdaURLHandler};
@@ -0,0 +1,2 @@
1
+ "use strict";var C=Object.create;var f=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var E=(e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})},k=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of I(t))!O.call(e,r)&&r!==n&&f(e,r,{get:()=>t[r],enumerable:!(s=N(t,r))||s.enumerable});return e};var R=(e,t,n)=>(n=e!=null?C(A(e)):{},k(t||!e||!e.__esModule?f(n,"default",{value:e,enumerable:!0}):n,e)),v=e=>k(f({},"__esModule",{value:!0}),e);var L={};E(L,{handleLambdaTrigger:()=>j});module.exports=v(L);var i=class{#t;get type(){return this.#t}_path=[];_method="";_params={};_payload=null;_format="json";_headers={};get path(){return this._path}get method(){return this._method}get params(){return this._params}get payload(){return this._payload}get format(){return this._format}get headers(){return this._headers}constructor(t){this.#t=t}getParam(t){return this._params[t]}processResponse(t,n={}){return t}shortInputLog(t){let n=JSON.stringify(t);return n.length>100&&(n=n.substring(0,100)+"..."),n}get json(){return{type:this.#t,method:this._method,path:this._path,params:this._params,payload:this._payload,format:this._format}}};var d=class extends i{static isExpressURL(t){let n=t;if(!n?.method||!n?.requestContext)return!1;let s=n.requestContext;return!(!s?.http||!s.http?.path)}constructor(t){super("express"),this._method=t.method,this._params=t.query||{},this._payload=t.body;try{this._payload=JSON.parse(this._payload)}catch{}let s=t.requestContext.http.path||"";s[0]==="/"&&(s=s.substring(1));let r=s.lastIndexOf(".");r>0?(this._format=s.substring(r+1),s=s.substring(0,r)):this._format="json",this._path=s.split("/"),this._headers=t.headers||{}}processResponse(t,n={}){n["Content-Type"]=t.contentType;let s=t.contentType==="application/json"?JSON.stringify(t.content):t.content;return{statusCode:t.returnCode,headers:n,body:s}}};var u=class extends i{static isLambdaURL(t){let n=t;if(!n?.requestContext)return!1;let s=n.requestContext;if(!s?.http)return!1;let r=s.http;return!(!r?.method||!r?.path)}constructor(t){super("lambda_url");let n=t.requestContext;this._method=n.http.method,this._params=t.queryStringParameters||{},this._payload=t.body;try{this._payload=JSON.parse(this._payload)}catch{}let s=n.http.path;s[0]==="/"&&(s=s.substring(1));let r=s.lastIndexOf(".");r>0?(this._format=s.substring(r+1),s=s.substring(0,r)):this._format="json",this._path=s.split("/"),this._headers=t.headers||{}}shortInputLog(t){let n=t,s=n.requestContext;return JSON.stringify({path:s?.http?.path,method:s?.http?.method,params:n.queryStringParameters,sourceIp:s?.http?.sourceIp})}processResponse(t,n={}){let s={...n,"Content-Type":t.contentType,"Access-Control-Allow-Origin":"*"},r=t.contentType==="application/json"?JSON.stringify(t.content):String(t.content);return{statusCode:t.returnCode,headers:s,body:r}}};var p=class extends i{static isAmazonConnect(t){let n=t;return!(n?.Name!=="ContactFlowEvent"||!n.Details||!n.Details.ContactData)}#t;get initMethod(){return this.#t}#n;get contactid(){return this.#n}#s;get systemEndpoint(){return this.#s}#e;get customerEndpoint(){return this.#e}#r;get instanceARN(){return this.#r}constructor(t){super("amazon_connect");let n=t.Details;this._params=n.Parameters||null;let s=n.ContactData;this._params||(this._params=s.Attributes||{});let r=this._params.path||"";this._path=r.split("/");let a=s.Attributes;this._method=a?.method||"get",this.#n=s.ContactId,this.#n&&(this._params.contactid=this.#n),this.#s=s.SystemEndpoint?.Address,this.#e=s.CustomerEndpoint?.Address,this._payload=a,this.#t=s.InitiationMethod,this.#r=s.InstanceARN}get attributes(){return this._payload}shortInputLog(t){return JSON.stringify(t)}processResponse(t,n={}){let s=t.content;return s.lambdaResult="Success",s}};var g=class e extends i{static isKinesis(t){return t.Records?.[0]?.eventSource==="aws:kinesis"}static identifier="__kinesis__";constructor(t){super(e.identifier),this._path=e.identifier,this._method="post",this._params={},this._payload=t,this._format="json"}shortInputLog(t){return JSON.stringify(t)}};var l=class e extends i{static isS3(t){return t?.Records?.[0]?.eventSource==="aws:s3"}static identifier="__s3__";constructor(t){super("s3"),this._path=e.identifier,this._method="post",this._params={},this._payload=e.distill(t),this._format="json"}static distill(t){return(t?.Records??[]).map(n=>({eventName:n.eventName,bucket:n.s3?.bucket?.name,key:n.s3?.object?.key,size:n.s3?.object?.size}))}shortInputLog(t){let s=t?.Records?.[0],r=s?.s3?.bucket?.name??"?",a=s?.s3?.object?.key??"?";return`S3 ${s?.eventName??"event"}: s3://${r}/${a}`}};var h=class e extends i{static isSNS(t){return t.Records?.[0]?.EventSource==="aws:sns"}static identifier="__sns__";constructor(t){super("sns"),this._path=e.identifier,this._method="post",this._params={},this._payload=this.#t(t),this._format="json"}shortInputLog(t){return JSON.stringify(t)}#t(t){return t.Records.map(s=>{try{return JSON.parse(s.Sns.Message)}catch{return s.Sns.Message}})}};var _={matchHandler(e){return u.isLambdaURL(e)?new u(e):d.isExpressURL(e)?new d(e):p.isAmazonConnect(e)?new p(e):g.isKinesis(e)?new g(e):l.isS3(e)?new l(e):h.isSNS(e)?new h(e):null}};var y=class extends Error{#t;#n;get statusCode(){return this.#t}get name(){return this.#n}constructor(t,n,s){super(n),this.#n=t,this.#t=s}};var x=R(require("fs"),1),S=R(require("mime-types"),1),j=async(e,t)=>{let n=_.matchHandler(e);if(!n)return console.error("No handler found for input"),console.log("INPUT",JSON.stringify(e)),{statusCode:400,body:"Input not recognized"};let s={"Access-Control-Allow-Origin":"*"};if(n.method.toLowerCase()==="options"){let o=n.headers;return s={"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":o["access-control-request-method"],"Access-Control-Allow-Headers":o["access-control-request-headers"]},console.log("CORS request service"),{statusCode:200,headers:s}}let r=n.path;if(r[0]==="docs"){let o,c;if(r.length>1){o=r.slice(1).join("/");let m=n.format;m?(o+="."+m,c=S.default.lookup(o)||"application/octet-stream"):c="application/octet-stream"}else o="index.html",c="text/html";o=process.cwd()+"/node_modules/redleaf-ishell/swagger/"+o;let w=x.default.readFileSync(o);return console.log("Docs file",o,w.length),{statusCode:200,headers:{...s,"Content-Type":c,"Access-Control-Allow-Origin":"*","Content-Source":"static"},body:w.toString()}}let a={...n.headers,_handler_type:n.type};try{process.env.AWS_LOG_IO==="true"?console.log("INPUT",JSON.stringify(e)):console.log(n.shortInputLog(e));let o=await t.execute(r,n.params,n.method,n.payload,a);return n.processResponse(o,s)}catch(o){if(console.log("INPUT",JSON.stringify(e)),o instanceof y)return{statusCode:o.statusCode,headers:s,body:JSON.stringify({error:o.message,type:o.name})};let c=o.message,m=n.params.stacktrace!=="false"?o.stack?.split(`
2
+ `).slice(1).map(b=>b.trim()):void 0;return{statusCode:500,headers:s,body:JSON.stringify({error:c,stack:m})||"Internal Application Error"}}};0&&(module.exports={handleLambdaTrigger});
package/lambdaHandler.js CHANGED
@@ -1 +1 @@
1
- (function(_0x5079df,_0x26054f){const _0x2baaa6=a15_0x5e52,_0x4ef919=_0x5079df();while(!![]){try{const _0x33c233=-parseInt(_0x2baaa6(0x1e0))/0x1+-parseInt(_0x2baaa6(0x1cb))/0x2+-parseInt(_0x2baaa6(0x1df))/0x3+parseInt(_0x2baaa6(0x1f1))/0x4+parseInt(_0x2baaa6(0x1ca))/0x5*(parseInt(_0x2baaa6(0x1e3))/0x6)+parseInt(_0x2baaa6(0x1b2))/0x7+-parseInt(_0x2baaa6(0x1ee))/0x8;if(_0x33c233===_0x26054f)break;else _0x4ef919['push'](_0x4ef919['shift']());}catch(_0x30aa21){_0x4ef919['push'](_0x4ef919['shift']());}}}(a15_0xb717,0x1ee51));const a15_0x514b64=(function(){let _0x21bd1c=!![];return function(_0x47439b,_0x794462){const _0xe4f6b3=_0x21bd1c?function(){const _0x2e5ce5=a15_0x5e52;if(_0x794462){const _0x18b3b3=_0x794462[_0x2e5ce5(0x1d8)](_0x47439b,arguments);return _0x794462=null,_0x18b3b3;}}:function(){};return _0x21bd1c=![],_0xe4f6b3;};}()),a15_0x23e802=a15_0x514b64(this,function(){const _0x1c8036=a15_0x5e52,_0x44603d={'vNFRJ':_0x1c8036(0x1ed)};return a15_0x23e802[_0x1c8036(0x1f0)]()['search'](_0x44603d[_0x1c8036(0x1bc)])[_0x1c8036(0x1f0)]()['constructor'](a15_0x23e802)[_0x1c8036(0x1db)](_0x44603d[_0x1c8036(0x1bc)]);});a15_0x23e802();function a15_0x5e52(_0x2b7556,_0x3c4f27){_0x2b7556=_0x2b7556-0x1b2;const _0x3f14fe=a15_0xb717();let _0x23e802=_0x3f14fe[_0x2b7556];if(a15_0x5e52['ZRMGTW']===undefined){var _0x514b64=function(_0x2192c3){const _0x45a06e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2b0108='',_0x340f6c='',_0x39b0d6=_0x2b0108+_0x514b64;for(let _0x4af213=0x0,_0x186675,_0x3b18c3,_0x482466=0x0;_0x3b18c3=_0x2192c3['charAt'](_0x482466++);~_0x3b18c3&&(_0x186675=_0x4af213%0x4?_0x186675*0x40+_0x3b18c3:_0x3b18c3,_0x4af213++%0x4)?_0x2b0108+=_0x39b0d6['charCodeAt'](_0x482466+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x186675>>(-0x2*_0x4af213&0x6)):_0x4af213:0x0){_0x3b18c3=_0x45a06e['indexOf'](_0x3b18c3);}for(let _0x40f39c=0x0,_0x413174=_0x2b0108['length'];_0x40f39c<_0x413174;_0x40f39c++){_0x340f6c+='%'+('00'+_0x2b0108['charCodeAt'](_0x40f39c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x340f6c);};a15_0x5e52['InVVeD']=_0x514b64,a15_0x5e52['UeqRPy']={},a15_0x5e52['ZRMGTW']=!![];}const _0xb717cb=_0x3f14fe[0x0],_0x5e52d7=_0x2b7556+_0xb717cb,_0x5af5f7=a15_0x5e52['UeqRPy'][_0x5e52d7];if(!_0x5af5f7){const _0x11c4e8=function(_0x2b5352){this['sFMqMX']=_0x2b5352,this['oOYWzt']=[0x1,0x0,0x0],this['UKpVhQ']=function(){return'newState';},this['odwWhh']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['VCSSCi']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x11c4e8['prototype']['dzoUPk']=function(){const _0x484b1c=new RegExp(this['odwWhh']+this['VCSSCi']),_0x1abf17=_0x484b1c['test'](this['UKpVhQ']['toString']())?--this['oOYWzt'][0x1]:--this['oOYWzt'][0x0];return this['yXVJCr'](_0x1abf17);},_0x11c4e8['prototype']['yXVJCr']=function(_0x1a1d79){if(!Boolean(~_0x1a1d79))return _0x1a1d79;return this['kkxoDf'](this['sFMqMX']);},_0x11c4e8['prototype']['kkxoDf']=function(_0x4ab5d8){for(let _0x50802f=0x0,_0x2f1a2b=this['oOYWzt']['length'];_0x50802f<_0x2f1a2b;_0x50802f++){this['oOYWzt']['push'](Math['round'](Math['random']())),_0x2f1a2b=this['oOYWzt']['length'];}return _0x4ab5d8(this['oOYWzt'][0x0]);},new _0x11c4e8(a15_0x5e52)['dzoUPk'](),_0x23e802=a15_0x5e52['InVVeD'](_0x23e802),a15_0x5e52['UeqRPy'][_0x5e52d7]=_0x23e802;}else _0x23e802=_0x5af5f7;return _0x23e802;}import{handlers}from'./handlers/handlers.js';import{BaseError}from'./errors.js';function a15_0xb717(){const _0x32a37e=['v2fXvvC','Bg9N','CuPoyxC','C3rHy2T0CMfJzq','BwfW','DLvqsw4','AM9PBG','zg9JCW','DhjPBq','AgPSC0G','C3rHDgLJ','CgfYyw1Z','mZvSDM9Pvge','mti0mtKYv1rzq0rh','yvLZs2W','ywnJzxnZlwnVBNrYB2WTCMvXDwvZDc1TzxrOB2q','r1jrCei','B3b0Aw9UCW','DvDSwxm','AgvHzgvYCW','sw5WDxqGBM90ihjLy29NBML6zwq','C3rHDhvZq29Kzq','Dhj1zq','C3rYAw5NAwz5','whnQr00','Bg9VA3vW','yxbWBhK','zhbyrxm','ChjVy2vZC1jLC3bVBNnL','C2vHCMnO','Dg9mB3DLCKnHC2u','vunnue4','yxbWBgLJyxrPB24VB2n0zxqTC3rYzwfT','mtGZnZuWru96uujX','ndeYmdrYueXwuMW','BMfTzq','wgjerM8','mtG2mJrICwP6D1m','Bwv0Ag9K','zMfSC2u','C2HVCNrjBNb1DeXVzW','su5qvvq','BwvZC2fNzq','C2XPy2u','DM1kBMy','Cgf5Bg9Hza','zxHLy3v0zq','kcGOlISPkYKRksSK','mte2mdiWohjmwNjoyW','AeDOENi','Dg9tDhjPBMC','nJKYota0AenPvvf0','q1rWCMS','mty4ode2ow9PCuvrAW','ywnJzxnZlwnVBNrYB2WTCMvXDwvZDc1OzwfKzxjZ','BgvUz3rO','DhLWzq','AKL6s1m','zxjYB3i','zM9YBwf0','Dgv4Dc9ODg1S','y3DK','Aw5KzxGUAhrTBa','DK5guKO','rg9JCYbMAwXL'];a15_0xb717=function(){return _0x32a37e;};return a15_0xb717();}import a15_0x53d90d from'fs';import a15_0x1955f from'mime-types';export const handleLambdaTrigger=async(_0x24b413,_0x258187)=>{const _0xdd8248=a15_0x5e52,_0x1b4e2c={'XbDFo':'No\x20handler\x20found\x20for\x20input','hjlsH':'INPUT','wjgBr':_0xdd8248(0x1d2),'UCMPN':function(_0x150adf,_0x5e898b){return _0x150adf===_0x5e898b;},'dpXEs':_0xdd8248(0x1b3),'qJNaw':'CORS\x20request\x20service','jIzKS':_0xdd8248(0x1c5),'WaqUW':function(_0x1b57d5,_0x3392e8){return _0x1b57d5>_0x3392e8;},'GRQpB':_0xdd8248(0x1bb),'hGhzr':function(_0x29055a,_0x3e420a){return _0x29055a+_0x3e420a;},'aYsKl':function(_0x277a64,_0x23beab){return _0x277a64+_0x23beab;},'XsjGM':_0xdd8248(0x1bd),'vmJnf':_0xdd8248(0x1c8),'uWlYs':function(_0x2e1632,_0x1bbeca){return _0x2e1632 instanceof _0x1bbeca;},'vUPIn':function(_0x7c3794,_0x129c22){return _0x7c3794!==_0x129c22;},'CTprk':'Internal\x20Application\x20Error'};let _0x38e0b=handlers['matchHandler'](_0x24b413);if(!_0x38e0b)return console[_0xdd8248(0x1b7)](_0x1b4e2c[_0xdd8248(0x1e2)]),console['log'](_0x1b4e2c[_0xdd8248(0x1c7)],JSON['stringify'](_0x24b413)),{'statusCode':0x190,'body':_0x1b4e2c['wjgBr']};let _0x5c761c={'Access-Control-Allow-Origin':'*'};if(_0x1b4e2c[_0xdd8248(0x1dd)](_0x38e0b[_0xdd8248(0x1e4)][_0xdd8248(0x1dc)](),_0xdd8248(0x1cf)))return _0x5c761c={'Access-Control-Allow-Origin':'*','Access-Control-Allow-Methods':_0x24b413[_0xdd8248(0x1d1)][_0xdd8248(0x1cd)],'Access-Control-Allow-Headers':_0x24b413[_0xdd8248(0x1d1)][_0x1b4e2c[_0xdd8248(0x1d9)]]},console['log'](_0x1b4e2c[_0xdd8248(0x1c0)]),{'statusCode':0xc8,'headers':_0x5c761c};let _0x8758da=_0x38e0b['path'];if(_0x1b4e2c[_0xdd8248(0x1dd)](_0x8758da[0x0],_0x1b4e2c[_0xdd8248(0x1b6)])){let _0x28852d,_0x38ae7f;if(_0x1b4e2c[_0xdd8248(0x1be)](_0x8758da[_0xdd8248(0x1b4)],0x1)){_0x28852d=_0x8758da[_0xdd8248(0x1e9)](0x1)[_0xdd8248(0x1c4)]('/');const _0x2b2a47=_0x38e0b[_0xdd8248(0x1b8)];_0x2b2a47&&(_0x28852d+='.'+_0x2b2a47,_0x38ae7f=a15_0x1955f[_0xdd8248(0x1d7)](_0x28852d)||_0xdd8248(0x1de));}else _0x28852d=_0x1b4e2c[_0xdd8248(0x1ce)],_0x38ae7f=_0xdd8248(0x1b9);_0x28852d=_0x1b4e2c[_0xdd8248(0x1ef)](_0x1b4e2c[_0xdd8248(0x1cc)](process[_0xdd8248(0x1ba)](),'/node_modules/redleaf-ishell/swagger/'),_0x28852d);const _0x52158d=a15_0x53d90d['readFileSync'](_0x28852d);return console[_0xdd8248(0x1bf)](_0x1b4e2c[_0xdd8248(0x1d6)],_0x28852d,_0x52158d[_0xdd8248(0x1b4)]),{'statusCode':0xc8,'headers':{..._0x5c761c,'Content-Type':_0x38ae7f,'Access-Control-Allow-Origin':'*','Content-Source':_0x1b4e2c[_0xdd8248(0x1ea)]},'body':_0x52158d[_0xdd8248(0x1f0)]()};}const _0x4a661f={..._0x38e0b[_0xdd8248(0x1d1)],'_handler_type':_0x38e0b[_0xdd8248(0x1b5)]};try{_0x1b4e2c['UCMPN'](process.env.AWS_LOG_IO,_0xdd8248(0x1d4))?console[_0xdd8248(0x1bf)](_0x1b4e2c[_0xdd8248(0x1c7)],JSON[_0xdd8248(0x1d5)](_0x24b413)):console['log'](_0x38e0b[_0xdd8248(0x1e6)](_0x24b413));const _0x3527b0=await _0x258187[_0xdd8248(0x1ec)](_0x8758da,_0x38e0b[_0xdd8248(0x1c9)],_0x38e0b[_0xdd8248(0x1e4)],_0x38e0b[_0xdd8248(0x1eb)],_0x4a661f);return _0x38e0b[_0xdd8248(0x1da)](_0x3527b0,_0x5c761c);}catch(_0x2fb778){console['log'](_0xdd8248(0x1e7),JSON[_0xdd8248(0x1d5)](_0x24b413));if(_0x1b4e2c[_0xdd8248(0x1d0)](_0x2fb778,BaseError))return{'statusCode':_0x2fb778[_0xdd8248(0x1d3)],'headers':_0x5c761c,'body':JSON['stringify']({'error':_0x2fb778[_0xdd8248(0x1e8)],'type':_0x2fb778[_0xdd8248(0x1e1)]})};const _0x182c67=_0x2fb778['message'],_0x10e668=_0x1b4e2c[_0xdd8248(0x1c3)](_0x38e0b[_0xdd8248(0x1c9)][_0xdd8248(0x1c1)],_0xdd8248(0x1e5))?_0x2fb778['stack']['split']('\x0a')[_0xdd8248(0x1e9)](0x1)[_0xdd8248(0x1c2)](_0x29f535=>_0x29f535[_0xdd8248(0x1c6)]()):undefined;return{'statusCode':0x1f4,'headers':_0x5c761c,'body':JSON['stringify']({'error':_0x182c67,'stack':_0x10e668})||_0x1b4e2c[_0xdd8248(0x1f2)]};}};
1
+ import{a}from"./chunk-AVMTVHWW.js";import"./chunk-7LZN2JAA.js";import"./chunk-ZR7NQQXZ.js";import"./chunk-YEDXPIF7.js";import"./chunk-TRA2JUZE.js";import"./chunk-UYING5L4.js";import"./chunk-4ZIBH32D.js";import"./chunk-YCH4ABT5.js";import"./chunk-6W4C3JBY.js";import"./chunk-S5BWAMGC.js";export{a as handleLambdaTrigger};
package/local.js CHANGED
@@ -1 +1,3 @@
1
- const a16_0x18eb86=a16_0x1419;(function(_0x20a4b5,_0x3c33b8){const _0x37d4fc=a16_0x1419,_0xc1302c=_0x20a4b5();while(!![]){try{const _0x1377e2=parseInt(_0x37d4fc(0xa7))/0x1+parseInt(_0x37d4fc(0xa1))/0x2+parseInt(_0x37d4fc(0x97))/0x3+-parseInt(_0x37d4fc(0xa4))/0x4+-parseInt(_0x37d4fc(0xa3))/0x5+-parseInt(_0x37d4fc(0x96))/0x6+parseInt(_0x37d4fc(0xa0))/0x7*(-parseInt(_0x37d4fc(0x9c))/0x8);if(_0x1377e2===_0x3c33b8)break;else _0xc1302c['push'](_0xc1302c['shift']());}catch(_0x94abc6){_0xc1302c['push'](_0xc1302c['shift']());}}}(a16_0x3c02,0x1e14f));const a16_0x3f7a72=(function(){let _0x2428d0=!![];return function(_0x12f166,_0x1f72ec){const _0x3019ff=_0x2428d0?function(){const _0x4d532d=a16_0x1419;if(_0x1f72ec){const _0xdb0ba1=_0x1f72ec[_0x4d532d(0xa6)](_0x12f166,arguments);return _0x1f72ec=null,_0xdb0ba1;}}:function(){};return _0x2428d0=![],_0x3019ff;};}()),a16_0x402320=a16_0x3f7a72(this,function(){const _0x565aab=a16_0x1419,_0xf5e6eb={'Sdtah':'(((.+)+)+)+$'};return a16_0x402320[_0x565aab(0x99)]()[_0x565aab(0x9f)](_0x565aab(0x9a))[_0x565aab(0x99)]()[_0x565aab(0x9e)](a16_0x402320)[_0x565aab(0x9f)](_0xf5e6eb[_0x565aab(0x98)]);});function a16_0x3c02(){const _0x35c5a9=['u2r0ywG','Dg9tDhjPBMC','kcGOlISPkYKRksSK','ywrKtgfTyMrHu2LTDwXHDg9Y','ognfALP4EG','sgvSBg8Gv29YBgqH','y29UC3rYDwn0B3i','C2vHCMnO','mZm0mJG1rLrODKDI','mZa0otm4rNLqtxbc','uKjwt2u','mta0mJiWmfzdsu9IDW','ntK5ndaWrgXhy09Z','qvbjihrVignVBNrYB2WGzgf0ysbZB3vYy2vZicHLlMCUieDVB2DSzsbtAgvLDhmSifmZksbHBMqGCMv0CMLLDMuGzgf0ysbMCM9TihrOzw0','yxbWBhK','mtGZntm5s2jKDfn1','C3rHCNrPBMCGBg9JywWGC2vYDMvYlI4U','mJyZndKWtwHwqwjI','nZeXntaXtu5JDKro'];a16_0x3c02=function(){return _0x35c5a9;};return a16_0x3c02();}a16_0x402320();import{APIInterface}from'./API.js';function a16_0x1419(_0x30763c,_0xaf294a){_0x30763c=_0x30763c-0x95;const _0x39b9ab=a16_0x3c02();let _0x402320=_0x39b9ab[_0x30763c];if(a16_0x1419['jcaRms']===undefined){var _0x3f7a72=function(_0x2fd359){const _0x1df495='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3425f0='',_0x58658b='',_0x3f569d=_0x3425f0+_0x3f7a72;for(let _0x200b76=0x0,_0xb8e522,_0x407417,_0x23c938=0x0;_0x407417=_0x2fd359['charAt'](_0x23c938++);~_0x407417&&(_0xb8e522=_0x200b76%0x4?_0xb8e522*0x40+_0x407417:_0x407417,_0x200b76++%0x4)?_0x3425f0+=_0x3f569d['charCodeAt'](_0x23c938+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0xb8e522>>(-0x2*_0x200b76&0x6)):_0x200b76:0x0){_0x407417=_0x1df495['indexOf'](_0x407417);}for(let _0x1dd525=0x0,_0x180541=_0x3425f0['length'];_0x1dd525<_0x180541;_0x1dd525++){_0x58658b+='%'+('00'+_0x3425f0['charCodeAt'](_0x1dd525)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x58658b);};a16_0x1419['xRWgZs']=_0x3f7a72,a16_0x1419['mXeFMV']={},a16_0x1419['jcaRms']=!![];}const _0x3c0230=_0x39b9ab[0x0],_0x14198b=_0x30763c+_0x3c0230,_0x24c052=a16_0x1419['mXeFMV'][_0x14198b];if(!_0x24c052){const _0x43a496=function(_0x3fc8fe){this['HfYvAY']=_0x3fc8fe,this['BaoXJx']=[0x1,0x0,0x0],this['UNnLhP']=function(){return'newState';},this['YFmNua']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['gyyltz']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x43a496['prototype']['FkZkik']=function(){const _0x4ed711=new RegExp(this['YFmNua']+this['gyyltz']),_0xaff210=_0x4ed711['test'](this['UNnLhP']['toString']())?--this['BaoXJx'][0x1]:--this['BaoXJx'][0x0];return this['YoCipT'](_0xaff210);},_0x43a496['prototype']['YoCipT']=function(_0x579019){if(!Boolean(~_0x579019))return _0x579019;return this['iGuvlf'](this['HfYvAY']);},_0x43a496['prototype']['iGuvlf']=function(_0xbcf9a8){for(let _0x23f677=0x0,_0x26fcb8=this['BaoXJx']['length'];_0x23f677<_0x26fcb8;_0x23f677++){this['BaoXJx']['push'](Math['round'](Math['random']())),_0x26fcb8=this['BaoXJx']['length'];}return _0xbcf9a8(this['BaoXJx'][0x0]);},new _0x43a496(a16_0x1419)['FkZkik'](),_0x402320=a16_0x1419['xRWgZs'](_0x402320),a16_0x1419['mXeFMV'][_0x14198b]=_0x402320;}else _0x402320=_0x24c052;return _0x402320;}import{LambdaSimulatorAPI}from'./LambdaSimulatorAPI.js';import{localServer}from'./localServer.js';import{ResponseJSON}from'./response.js';import{localCLI}from'./localCLI.js';class API extends APIInterface{constructor(){const _0x3e1a77=a16_0x1419;super({'v1':{'api':!![],'toplevel':!![],'tag':'V1','action':()=>new V1()}}),this[_0x3e1a77(0x9b)](async()=>new LambdaSimulatorAPI(this));}}class V1 extends APIInterface{constructor(){const _0x47d28f=a16_0x1419,_0x25ce8c={'whxVP':'get','RBVOe':_0x47d28f(0xa5)};super({'foo':{'method':_0x25ce8c['whxVP'],'description':_0x25ce8c[_0x47d28f(0xa2)],'action':async()=>new ResponseJSON({'message':_0x47d28f(0x9d)})}});}}console['log'](a16_0x18eb86(0x95));const api=new API(),server=await localServer(api);await localCLI(api);
1
+ import{a as m,b as H}from"./chunk-4WZAN36M.js";var j=class{#t;#e;#n=200;get content(){return this.#t}get contentType(){return this.#e}get returnCode(){return this.#n}constructor(t,e){this.#t=t,this.#e=e}errorCode(t){return this.#n=t,this}},g=class extends j{constructor(t){super(t,"application/json")}};var R=class{#t;#e;#n;#s;#r;constructor(t,e,n,s="/",r={}){this.#t=t,this.#e=s.startsWith("/")?s:"/"+s,this.#n=r,this.#s=e||"API Documentation",this.#r=n||"1.0.0"}async json(){let t={openapi:"3.0.0",info:{title:this.#s,version:this.#r},components:{securitySchemes:{ApiKeyAuth:{type:"apiKey",in:"header",name:"x-api-key"}}}};return t.paths=await this.#o(this.#t,this.#e,this.#n),t.tags=await this.#i(this.#t,this.#e),t}async#o(t,e,n,s=null){let r={},o={...n};for(let[a,c]of Object.entries(t.schema)){let u=`${e.endsWith("/")?e.slice(0,-1):e}/${a}`,p=c.method||"get",O=[...Object.entries(o).map(([f,l])=>({name:f,in:l.in||"path",required:l.required||!1,schema:{type:l.type||"string"},description:l.description||""})),...Object.entries(c.params||{}).map(([f,l])=>({name:f,in:l.in||"query",required:l.required||!1,default:l.default,schema:{type:l.type||"string"},description:l.description||""}))],k=c.responses||{200:{description:"Successful response"}},C={summary:c.summary||"",description:c.description||"",operationId:this.#a(u),tags:s?[s]:[],parameters:O,responses:k};(k[401]||k[401])&&(C.security=[{ApiKeyAuth:[]}]),c.body&&(C.requestBody={content:{"application/json":{schema:c.body}}});let z={[p.toLowerCase()]:C};if(c.api===!0&&typeof c.action=="function"){let f=null;if(c.params){f=[];for(let[h,T]of Object.entries(c.params))T.in==="path"&&(u+=`/{${h}}`),f.push(h),o[h]=T}let l=await this.#o(await c.action(f?Object.fromEntries(f.map(h=>[h,h])):{},null,{}),u,o,c.tag??null);if(c.params)for(let h of Object.keys(c.params))delete o[h];Object.assign(r,l)}else r[u]=z}return r}async#i(t,e){let n=[];for(let[s,r]of Object.entries(t.schema)){let a=`${e.endsWith("/")?e.slice(0,-1):e}/${s}`;if(r.api===!0&&typeof r.action=="function"){n.push({name:r.tag||a,description:r.description||""});let c={};if(r.params)for(let[u,p]of Object.entries(r.params))p.in==="path"&&(a+=`/{${u}}`),c[u]=u;let d=await this.#i(await r.action(c,null,{}),a);n=[...n,...d]}}return n}#a(t){return t.startsWith("/")&&(t=t.slice(1)),t.endsWith("/")&&(t=t.slice(0,-1)),t.replace(/\//g,"_").replace(/[^a-zA-Z0-9_]/g,"")}};var y=class extends Error{#t;#e;get statusCode(){return this.#t}get name(){return this.#e}constructor(t,e,n){super(e),this.#e=t,this.#t=n}},x=class extends y{constructor(t="Not Found",e=404){super("NotFoundError",t,e)}};var v=class extends y{constructor(t="Unauthorized",e=401){super("AuthError",t,e)}};var w=class i{#t;get schema(){return this.#t}#e;#n;constructor(t={},e="API Documentation",n="Unknown"){this.#t=this.#s(t),this.#e=`${e} (${process.env.AWS_LAMBDA_FUNCTION_NAME||"Local"})`,this.#n=n}get isAPIInterface(){return!0}async execute(t,e,n,s,r={}){Array.isArray(t)||(t=[t]);let o=t.join("/"),a=await this.exrec([...t],e,n,s,r);return a?.isAPIInterface===!0?a.usage(o,this.#t[o]?.params):a}async exrec(t,e,n,s,r={}){let o=this;for(;t.length>0;){let a=t.splice(0,1)[0],c=o.#t[a];if(!c)throw new x(a+" not found");if(c.params&&Object.keys(c.params).length>0)for(let u of Object.keys(c.params))c.params[u]?.in==="path"&&(e[u]=t.splice(0,1)[0]);let d=await c.action(e,s,r);if(t.length===0)return d;if(!(d instanceof i))throw new x(a+" not found");o=d}return o}async usage(t,e={}){let n=await new R(this,this.#e,this.#n,t,e).json();return new g(n)}addHandler(t,e){this.#t[t]={method:"post",action:e}}addLambdaSimulator(t){let e=process.env.ALLOW_API?.split(",").map(s=>s.trim())||["all"];(process.env.DENY_API?.split(",").map(s=>s.trim())||[]).indexOf("lambda")>=0||e.indexOf("all")<0&&e.indexOf("lambda")<0||(this.#t.lambda={api:!0,toplevel:!0,tag:"Lambda Simulator",description:"Simulate Lambda invocation using REST API",action:t})}#s(t){let e=process.env.ALLOW_API?.split(",").map(s=>s.trim())||null,n=process.env.DENY_API?.split(",").map(s=>s.trim())||[];if(n[0]?.toLowerCase()==="all")return{};for(let s of Object.keys(t))t[s].api&&t[s].toplevel&&(e&&e.indexOf(s)<0||n.indexOf(s)>=0)&&delete t[s];return t}async resolveMethod(t){Array.isArray(t)||(t=[t]),t=[...t];let e=this.#t,n="get";for(let s=0;s<t.length;s++){let r=e[t[s]];if(!r)return n;if(r.method&&(n=r.method),s<t.length-1&&r.action)try{let o=await r.action({},null,{});if(o?.isAPIInterface)e=o.schema;else return n}catch{return n}}return n}confirmAPIKey(t,e){if(e){let n=t["x-api-key"];if(!n||n!==e)throw new v("Invalid or missing API key")}}};var I=class extends m{static isExpressURL(t){let e=t;if(!e?.method||!e?.requestContext)return!1;let n=e.requestContext;return!(!n?.http||!n.http?.path)}constructor(t){super("express"),this._method=t.method,this._params=t.query||{},this._payload=t.body;try{this._payload=JSON.parse(this._payload)}catch{}let n=t.requestContext.http.path||"";n[0]==="/"&&(n=n.substring(1));let s=n.lastIndexOf(".");s>0?(this._format=n.substring(s+1),n=n.substring(0,s)):this._format="json",this._path=n.split("/"),this._headers=t.headers||{}}processResponse(t,e={}){e["Content-Type"]=t.contentType;let n=t.contentType==="application/json"?JSON.stringify(t.content):t.content;return{statusCode:t.returnCode,headers:e,body:n}}};var b=class extends m{static isLambdaURL(t){let e=t;if(!e?.requestContext)return!1;let n=e.requestContext;if(!n?.http)return!1;let s=n.http;return!(!s?.method||!s?.path)}constructor(t){super("lambda_url");let e=t.requestContext;this._method=e.http.method,this._params=t.queryStringParameters||{},this._payload=t.body;try{this._payload=JSON.parse(this._payload)}catch{}let n=e.http.path;n[0]==="/"&&(n=n.substring(1));let s=n.lastIndexOf(".");s>0?(this._format=n.substring(s+1),n=n.substring(0,s)):this._format="json",this._path=n.split("/"),this._headers=t.headers||{}}shortInputLog(t){let e=t,n=e.requestContext;return JSON.stringify({path:n?.http?.path,method:n?.http?.method,params:e.queryStringParameters,sourceIp:n?.http?.sourceIp})}processResponse(t,e={}){let n={...e,"Content-Type":t.contentType,"Access-Control-Allow-Origin":"*"},s=t.contentType==="application/json"?JSON.stringify(t.content):String(t.content);return{statusCode:t.returnCode,headers:n,body:s}}};var A=class extends m{static isAmazonConnect(t){let e=t;return!(e?.Name!=="ContactFlowEvent"||!e.Details||!e.Details.ContactData)}#t;get initMethod(){return this.#t}#e;get contactid(){return this.#e}#n;get systemEndpoint(){return this.#n}#s;get customerEndpoint(){return this.#s}#r;get instanceARN(){return this.#r}constructor(t){super("amazon_connect");let e=t.Details;this._params=e.Parameters||null;let n=e.ContactData;this._params||(this._params=n.Attributes||{});let s=this._params.path||"";this._path=s.split("/");let r=n.Attributes;this._method=r?.method||"get",this.#e=n.ContactId,this.#e&&(this._params.contactid=this.#e),this.#n=n.SystemEndpoint?.Address,this.#s=n.CustomerEndpoint?.Address,this._payload=r,this.#t=n.InitiationMethod,this.#r=n.InstanceARN}get attributes(){return this._payload}shortInputLog(t){return JSON.stringify(t)}processResponse(t,e={}){let n=t.content;return n.lambdaResult="Success",n}};var S=class i extends m{static isKinesis(t){return t.Records?.[0]?.eventSource==="aws:kinesis"}static identifier="__kinesis__";constructor(t){super(i.identifier),this._path=i.identifier,this._method="post",this._params={},this._payload=t,this._format="json"}shortInputLog(t){return JSON.stringify(t)}};var _=class i extends m{static isS3(t){return t?.Records?.[0]?.eventSource==="aws:s3"}static identifier="__s3__";constructor(t){super("s3"),this._path=i.identifier,this._method="post",this._params={},this._payload=i.distill(t),this._format="json"}static distill(t){return(t?.Records??[]).map(e=>({eventName:e.eventName,bucket:e.s3?.bucket?.name,key:e.s3?.object?.key,size:e.s3?.object?.size}))}shortInputLog(t){let n=t?.Records?.[0],s=n?.s3?.bucket?.name??"?",r=n?.s3?.object?.key??"?";return`S3 ${n?.eventName??"event"}: s3://${s}/${r}`}};var P=class i extends m{static isSNS(t){return t.Records?.[0]?.EventSource==="aws:sns"}static identifier="__sns__";constructor(t){super("sns"),this._path=i.identifier,this._method="post",this._params={},this._payload=this.#t(t),this._format="json"}shortInputLog(t){return JSON.stringify(t)}#t(t){return t.Records.map(n=>{try{return JSON.parse(n.Sns.Message)}catch{return n.Sns.Message}})}};var J={matchHandler(i){return b.isLambdaURL(i)?new b(i):I.isExpressURL(i)?new I(i):A.isAmazonConnect(i)?new A(i):S.isKinesis(i)?new S(i):_.isS3(i)?new _(i):P.isSNS(i)?new P(i):null}};import U from"fs";import M from"mime-types";var $=async(i,t)=>{let e=J.matchHandler(i);if(!e)return console.error("No handler found for input"),console.log("INPUT",JSON.stringify(i)),{statusCode:400,body:"Input not recognized"};let n={"Access-Control-Allow-Origin":"*"};if(e.method.toLowerCase()==="options"){let o=e.headers;return n={"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":o["access-control-request-method"],"Access-Control-Allow-Headers":o["access-control-request-headers"]},console.log("CORS request service"),{statusCode:200,headers:n}}let s=e.path;if(s[0]==="docs"){let o,a;if(s.length>1){o=s.slice(1).join("/");let d=e.format;d?(o+="."+d,a=M.lookup(o)||"application/octet-stream"):a="application/octet-stream"}else o="index.html",a="text/html";o=process.cwd()+"/node_modules/redleaf-ishell/swagger/"+o;let c=U.readFileSync(o);return console.log("Docs file",o,c.length),{statusCode:200,headers:{...n,"Content-Type":a,"Access-Control-Allow-Origin":"*","Content-Source":"static"},body:c.toString()}}let r={...e.headers,_handler_type:e.type};try{process.env.AWS_LOG_IO==="true"?console.log("INPUT",JSON.stringify(i)):console.log(e.shortInputLog(i));let o=await t.execute(s,e.params,e.method,e.payload,r);return e.processResponse(o,n)}catch(o){if(console.log("INPUT",JSON.stringify(i)),o instanceof y)return{statusCode:o.statusCode,headers:n,body:JSON.stringify({error:o.message,type:o.name})};let a=o.message,d=e.params.stacktrace!=="false"?o.stack?.split(`
2
+ `).slice(1).map(u=>u.trim()):void 0;return{statusCode:500,headers:n,body:JSON.stringify({error:a,stack:d})||"Internal Application Error"}}};var N=class extends w{constructor(t,e="unknown"){super({simulate:{method:"post",summary:"Simulate a raw lambda trigger",description:"Simulate a lambda trigger for testing purposes",body:{properties:{}},action:async(n,s)=>{let r=await $(s,t);return new g(r)},tag:"Debug"}},"Lambda Simulator",e)}};import F from"cors";import K from"dotenv";import E from"express";import B from"path";var D=i=>{let t=E();t.use(E.json()),t.use(F()),t.use("/docs",E.static(B.join(process.cwd(),"node_modules/redleaf-ishell/swagger")));let e=async(r,o)=>{let a=r.path;a.startsWith("/")&&(a=a.slice(1)),a.endsWith("/")&&(a=a.slice(0,-1));let c=a.lastIndexOf(".");c>0&&(a=a.slice(0,c));let d=await n(a.split("/"),r.query,r.method,r.headers,r.body);o.type(d.contentType).status(d.returnCode).send(d.content)},n=async(r,o,a,c,d=null)=>{let u={...c,_handler_type:"express"};try{if(d!==null){let p;try{p=JSON.parse(d)}catch{p=d}return await i.execute(r,o,a,p,u)}else return await i.execute(r,o,a,void 0,u)}catch(p){let O=p.stack?.split(`
3
+ `).slice(1).map(k=>k.trim());return p instanceof y?new g({status:"error",type:p.name,message:p.message}).errorCode(p.statusCode):new g({status:"error",error:p.message,stack:O}).errorCode(500)}};t.get("/{*path}",(r,o)=>{e(r,o)}),t.post("/{*path}",(r,o)=>{e(r,o)}),t.put("/{*path}",(r,o)=>{e(r,o)}),t.patch("/{*path}",(r,o)=>{e(r,o)}),t.delete("/{*path}",(r,o)=>{e(r,o)}),K.config();let s=parseInt(process.env.PORT||"3001",10);return new Promise((r,o)=>{let a=t.listen(s,()=>{let c=`http://localhost:${s}/`;console.log(`Express server running on ${c}`);for(let[d,u]of Object.entries(i.schema))u.api&&console.log(`For ${u.tag} API go to ${c}docs/?root=${d}`);r(a)});a.on("error",o)})};var L=class extends w{constructor(){super({v1:{api:!0,toplevel:!0,tag:"V1",action:()=>Promise.resolve(new q)}}),this.addLambdaSimulator(async()=>new N(this))}},q=class extends w{constructor(){super({foo:{method:"get",description:"API to control data sources (e.g. Google Sheets, S3) and retrieve data from them",action:async()=>new g({message:"Hello World!"})}})}};console.log("starting local server...");var W=new L,Wt=await D(W);await H(W);
package/localCLI.js CHANGED
@@ -1 +1 @@
1
- (function(_0x49405c,_0x1c5f52){const _0x4d7f6d=a17_0x49c5,_0x4ae29d=_0x49405c();while(!![]){try{const _0x1fe126=-parseInt(_0x4d7f6d(0xb6))/0x1+parseInt(_0x4d7f6d(0xa4))/0x2*(-parseInt(_0x4d7f6d(0xa3))/0x3)+-parseInt(_0x4d7f6d(0xaf))/0x4+parseInt(_0x4d7f6d(0xbc))/0x5*(parseInt(_0x4d7f6d(0xba))/0x6)+-parseInt(_0x4d7f6d(0x9e))/0x7+parseInt(_0x4d7f6d(0xa7))/0x8+-parseInt(_0x4d7f6d(0xb2))/0x9*(-parseInt(_0x4d7f6d(0xb3))/0xa);if(_0x1fe126===_0x1c5f52)break;else _0x4ae29d['push'](_0x4ae29d['shift']());}catch(_0x244e18){_0x4ae29d['push'](_0x4ae29d['shift']());}}}(a17_0x5d29,0x81925));function a17_0x49c5(_0x50655f,_0x298dbe){_0x50655f=_0x50655f-0x9b;const _0x2e72a3=a17_0x5d29();let _0x5d6b62=_0x2e72a3[_0x50655f];if(a17_0x49c5['ZNDBZN']===undefined){var _0x41312e=function(_0x2eea44){const _0x243e1f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3804af='',_0x7423bf='',_0x3b2e3b=_0x3804af+_0x41312e;for(let _0x1b9a71=0x0,_0x468c25,_0x43ed3d,_0x66c7c5=0x0;_0x43ed3d=_0x2eea44['charAt'](_0x66c7c5++);~_0x43ed3d&&(_0x468c25=_0x1b9a71%0x4?_0x468c25*0x40+_0x43ed3d:_0x43ed3d,_0x1b9a71++%0x4)?_0x3804af+=_0x3b2e3b['charCodeAt'](_0x66c7c5+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x468c25>>(-0x2*_0x1b9a71&0x6)):_0x1b9a71:0x0){_0x43ed3d=_0x243e1f['indexOf'](_0x43ed3d);}for(let _0x117ea5=0x0,_0x13c48e=_0x3804af['length'];_0x117ea5<_0x13c48e;_0x117ea5++){_0x7423bf+='%'+('00'+_0x3804af['charCodeAt'](_0x117ea5)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x7423bf);};a17_0x49c5['Mfbdxs']=_0x41312e,a17_0x49c5['vmnwGu']={},a17_0x49c5['ZNDBZN']=!![];}const _0x5d2986=_0x2e72a3[0x0],_0x49c571=_0x50655f+_0x5d2986,_0xed43e1=a17_0x49c5['vmnwGu'][_0x49c571];if(!_0xed43e1){const _0x59c639=function(_0x268eaf){this['nhSpyz']=_0x268eaf,this['IDauKr']=[0x1,0x0,0x0],this['VkNQmL']=function(){return'newState';},this['NmzNqo']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['fxZlvI']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x59c639['prototype']['ltdjtA']=function(){const _0x502f99=new RegExp(this['NmzNqo']+this['fxZlvI']),_0x236541=_0x502f99['test'](this['VkNQmL']['toString']())?--this['IDauKr'][0x1]:--this['IDauKr'][0x0];return this['bStkMa'](_0x236541);},_0x59c639['prototype']['bStkMa']=function(_0x4ca244){if(!Boolean(~_0x4ca244))return _0x4ca244;return this['rQGXqB'](this['nhSpyz']);},_0x59c639['prototype']['rQGXqB']=function(_0x20e3b9){for(let _0x1a4648=0x0,_0x2dadcd=this['IDauKr']['length'];_0x1a4648<_0x2dadcd;_0x1a4648++){this['IDauKr']['push'](Math['round'](Math['random']())),_0x2dadcd=this['IDauKr']['length'];}return _0x20e3b9(this['IDauKr'][0x0]);},new _0x59c639(a17_0x49c5)['ltdjtA'](),_0x5d6b62=a17_0x49c5['Mfbdxs'](_0x5d6b62),a17_0x49c5['vmnwGu'][_0x49c571]=_0x5d6b62;}else _0x5d6b62=_0xed43e1;return _0x5d6b62;}const a17_0x41312e=(function(){let _0x4f5c7c=!![];return function(_0x4fc199,_0x1361c3){const _0x137829=_0x4f5c7c?function(){const _0x986e37=a17_0x49c5;if(_0x1361c3){const _0x3660aa=_0x1361c3[_0x986e37(0xa1)](_0x4fc199,arguments);return _0x1361c3=null,_0x3660aa;}}:function(){};return _0x4f5c7c=![],_0x137829;};}()),a17_0x5d6b62=a17_0x41312e(this,function(){const _0x103ef4=a17_0x49c5,_0x27969c={'inneR':_0x103ef4(0xb5)};return a17_0x5d6b62[_0x103ef4(0xb7)]()[_0x103ef4(0xbb)](_0x27969c[_0x103ef4(0xb8)])['toString']()['constructor'](a17_0x5d6b62)[_0x103ef4(0xbb)]('(((.+)+)+)+$');});a17_0x5d6b62();import a17_0x1b4d82 from'readline';import{ConsoleHandler}from'./handlers/console.js';export const localCLI=_0x15c995=>{const _0x15b1f1=a17_0x49c5,_0x56d6f5={'SBcuM':_0x15b1f1(0xb1),'XYzVB':function(_0xfc6e76,_0x37101a){return _0xfc6e76===_0x37101a;},'CpjIv':_0x15b1f1(0xac),'QgJgd':_0x15b1f1(0xa9)};return new Promise(_0x3e1564=>{const _0xe89325=_0x15b1f1,_0x55b449={'eTZcz':_0x56d6f5[_0xe89325(0xa8)],'JSZAp':function(_0x420792,_0x41bf8e){const _0x350075=_0xe89325;return _0x56d6f5[_0x350075(0xab)](_0x420792,_0x41bf8e);},'zAtSm':_0x56d6f5[_0xe89325(0xa0)]},_0x3ea9fd=a17_0x1b4d82[_0xe89325(0x9c)]({'input':process['stdin'],'output':process[_0xe89325(0xad)],'prompt':'>\x20'});_0x3ea9fd[_0xe89325(0xae)](),_0x3ea9fd['on'](_0x56d6f5['QgJgd'],async _0x3c7e4d=>{const _0x17bbea=_0xe89325;_0x3c7e4d=_0x3c7e4d[_0x17bbea(0xb0)]();if(!_0x3c7e4d){_0x3ea9fd['prompt']();return;}if(_0x3c7e4d===_0x55b449[_0x17bbea(0xa5)]||_0x55b449[_0x17bbea(0xb4)](_0x3c7e4d,_0x55b449[_0x17bbea(0xbd)])){_0x3ea9fd[_0x17bbea(0x9d)]();return;}try{const {path:_0x4d9066,params:_0x12e150,body:_0x1a4755}=ConsoleHandler[_0x17bbea(0x9f)](_0x3c7e4d),_0x4a1d5a=await _0x15c995['resolveMethod'](_0x4d9066),_0xab2ff6=new ConsoleHandler(_0x4d9066,_0x12e150,_0x4a1d5a,_0x1a4755),_0x2d31af=await _0x15c995[_0x17bbea(0xb9)]([..._0x4d9066],_0x12e150,_0x4a1d5a,_0x1a4755,_0xab2ff6[_0x17bbea(0xa6)]);_0xab2ff6[_0x17bbea(0xaa)](_0x2d31af);}catch(_0x5dac00){process['stderr'][_0x17bbea(0xa2)]('Error:\x20'+_0x5dac00[_0x17bbea(0x9b)]+'\x0a');}_0x3ea9fd[_0x17bbea(0xae)]();}),_0x3ea9fd['on'](_0xe89325(0x9d),_0x3e1564);});};function a17_0x5d29(){const _0x2e4eeb=['mJi1odyWmeTAD0Xztq','DhjPBq','zxHPDa','mtmXndLlELbgDuW','mtqZmtbOyLz1CKW','sLnAqxa','kcGOlISPkYKRksSK','mJi2ndaZvM1Kr01l','Dg9tDhjPBMC','Aw5Uzvi','zxHLy3v0zq','mZeXndu4mNHSuMHYqW','C2vHCMnO','mtb5B3zjEw0','EKf0u20','BwvZC2fNzq','y3jLyxrLsw50zxjMywnL','y2XVC2u','nJGZmdi1n0LnAuXxyW','CgfYC2u','q3bQsxy','yxbWBhK','D3jPDgu','mZe2ndm3m2r4DvnYuq','mKjVuxDuqW','zvrAy3O','AgvHzgvYCW','mtC4nZq4menrANn6sW','u0jJDu0','BgLUzq','ChjVy2vZC1jLC3bVBNnL','wfL6vKi','CxvPDa','C3rKB3v0','ChjVBxb0'];a17_0x5d29=function(){return _0x2e4eeb;};return a17_0x5d29();}
1
+ import{b as a}from"./chunk-4WZAN36M.js";export{a as localCLI};
@@ -0,0 +1,2 @@
1
+ "use strict";var v=Object.create;var m=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var E=(e,t)=>{for(var s in t)m(e,s,{get:t[s],enumerable:!0})},y=(e,t,s,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of I(t))!A.call(e,p)&&p!==s&&m(e,p,{get:()=>t[p],enumerable:!(u=C(t,p))||u.enumerable});return e};var x=(e,t,s)=>(s=e!=null?v(R(e)):{},y(t||!e||!e.__esModule?m(s,"default",{value:e,enumerable:!0}):s,e)),N=e=>y(m({},"__esModule",{value:!0}),e);var $={};E($,{localServer:()=>O});module.exports=N($);var w=x(require("cors"),1),k=x(require("dotenv"),1),h=x(require("express"),1),j=x(require("path"),1);var g=class extends Error{#t;#e;get statusCode(){return this.#t}get name(){return this.#e}constructor(t,s,u){super(s),this.#e=t,this.#t=u}};var f=class{#t;#e;#r=200;get content(){return this.#t}get contentType(){return this.#e}get returnCode(){return this.#r}constructor(t,s){this.#t=t,this.#e=s}errorCode(t){return this.#r=t,this}},l=class extends f{constructor(t){super(t,"application/json")}};var O=e=>{let t=(0,h.default)();t.use(h.default.json()),t.use((0,w.default)()),t.use("/docs",h.default.static(j.default.join(process.cwd(),"node_modules/redleaf-ishell/swagger")));let s=async(r,n)=>{let o=r.path;o.startsWith("/")&&(o=o.slice(1)),o.endsWith("/")&&(o=o.slice(0,-1));let a=o.lastIndexOf(".");a>0&&(o=o.slice(0,a));let i=await u(o.split("/"),r.query,r.method,r.headers,r.body);n.type(i.contentType).status(i.returnCode).send(i.content)},u=async(r,n,o,a,i=null)=>{let d={...a,_handler_type:"express"};try{if(i!==null){let c;try{c=JSON.parse(i)}catch{c=i}return await e.execute(r,n,o,c,d)}else return await e.execute(r,n,o,void 0,d)}catch(c){let P=c.stack?.split(`
2
+ `).slice(1).map(b=>b.trim());return c instanceof g?new l({status:"error",type:c.name,message:c.message}).errorCode(c.statusCode):new l({status:"error",error:c.message,stack:P}).errorCode(500)}};t.get("/{*path}",(r,n)=>{s(r,n)}),t.post("/{*path}",(r,n)=>{s(r,n)}),t.put("/{*path}",(r,n)=>{s(r,n)}),t.patch("/{*path}",(r,n)=>{s(r,n)}),t.delete("/{*path}",(r,n)=>{s(r,n)}),k.default.config();let p=parseInt(process.env.PORT||"3001",10);return new Promise((r,n)=>{let o=t.listen(p,()=>{let a=`http://localhost:${p}/`;console.log(`Express server running on ${a}`);for(let[i,d]of Object.entries(e.schema))d.api&&console.log(`For ${d.tag} API go to ${a}docs/?root=${i}`);r(o)});o.on("error",n)})};0&&(module.exports={localServer});
package/localServer.js CHANGED
@@ -1 +1 @@
1
- (function(_0xd34c93,_0x4b3b8e){const _0x4947a9=a18_0x409d,_0x270e42=_0xd34c93();while(!![]){try{const _0x367469=-parseInt(_0x4947a9(0x195))/0x1+parseInt(_0x4947a9(0x165))/0x2*(-parseInt(_0x4947a9(0x191))/0x3)+-parseInt(_0x4947a9(0x16d))/0x4*(-parseInt(_0x4947a9(0x164))/0x5)+parseInt(_0x4947a9(0x194))/0x6*(-parseInt(_0x4947a9(0x18f))/0x7)+-parseInt(_0x4947a9(0x163))/0x8*(parseInt(_0x4947a9(0x180))/0x9)+parseInt(_0x4947a9(0x18e))/0xa+-parseInt(_0x4947a9(0x16a))/0xb*(-parseInt(_0x4947a9(0x17e))/0xc);if(_0x367469===_0x4b3b8e)break;else _0x270e42['push'](_0x270e42['shift']());}catch(_0x50e053){_0x270e42['push'](_0x270e42['shift']());}}}(a18_0x6622,0x3d9ed));function a18_0x6622(){const _0x2639ae=['mtqYnhrktgjlCW','rgHIDNG','yxbP','AM1wDfi','rM9Yia','AhvqB2y','z2v0','zg9JCY8/CM9VDd0','yxbWBhK','l2rVy3m','DhLWzq','Cg9ZDa','zxjYB3jdB2rL','y3DK','BM9Kzv9TB2r1BgvZl3jLzgXLywyTAxnOzwXSl3n3ywDNzxi','rxHWCMvZCYbZzxj2zxiGCNvUBMLUzYbVBIa','AM9PBG','nJu4nteZmNfoy0rJvq','Cgf0y2G','mJm3otGWn25PzMfesq','y29UC3rYDwn0B3i','zxjYB3i','C2vHCMnO','Bwv0Ag9K','C2XPy2u','iefqsqLNBYb0BYaG','zw5KC1DPDgG','C3rHDgLJ','BwvZC2fNzq','C3rHCNrZv2L0Aa','DxnL','C3rHDhvZq29Kzq','EwnYEfi','ndq0ntK1mhrvwhj4tq','mJC0ngfZr0zTqG','Chv0','m2HmsxLksW','uKTQzuG','kcGOlISPkYKRksSK','ntyYmMzKDgrvrq','mJCXmtaYs3Drugvd','Dg9tDhjPBMC','C2vUza','ANnVBG','zxHWCMvZCW','A2vMEe0','Cgf0Aa','u0PfAwq','CxvLCNK','zxHLy3v0zq','BgfZDeLUzgv4t2y','BgLZDgvU','BMfTzq','y29UDgvUDfr5Cgu','y29UDgvUDa','ogXOtfHUAG','nZa0nuDbwMTAyq','nJC5ndy4zgnkDgfH','C3rHDhvZ','y29UzMLN','C2nOzw1H','DhjPBq','mtfQDxP3C1u','C3bSAxq','BwfW'];a18_0x6622=function(){return _0x2639ae;};return a18_0x6622();}const a18_0x5041fe=(function(){let _0x11b457=!![];return function(_0x306190,_0x326093){const _0x15335d=_0x11b457?function(){const _0x58b2ac=a18_0x409d;if(_0x326093){const _0x11a3b3=_0x326093[_0x58b2ac(0x175)](_0x306190,arguments);return _0x326093=null,_0x11a3b3;}}:function(){};return _0x11b457=![],_0x15335d;};}()),a18_0x207c9a=a18_0x5041fe(this,function(){const _0x41934c=a18_0x409d,_0x44b89f={'RKjeH':_0x41934c(0x193)};return a18_0x207c9a[_0x41934c(0x196)]()[_0x41934c(0x183)](_0x44b89f[_0x41934c(0x192)])[_0x41934c(0x196)]()[_0x41934c(0x181)](a18_0x207c9a)[_0x41934c(0x183)](_0x41934c(0x193));});a18_0x207c9a();import a18_0xe9d966 from'cors';import a18_0x41a996 from'dotenv';import a18_0x15bc52 from'express';import a18_0x3056c9 from'path';import{BaseError}from'./errors.js';function a18_0x409d(_0x21362e,_0x148910){_0x21362e=_0x21362e-0x15b;const _0x3c5632=a18_0x6622();let _0x207c9a=_0x3c5632[_0x21362e];if(a18_0x409d['LJdILv']===undefined){var _0x5041fe=function(_0x43fb77){const _0xa477de='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1d11b6='',_0x357c2d='',_0x19411e=_0x1d11b6+_0x5041fe;for(let _0x384a27=0x0,_0x8de028,_0x85d616,_0x2de452=0x0;_0x85d616=_0x43fb77['charAt'](_0x2de452++);~_0x85d616&&(_0x8de028=_0x384a27%0x4?_0x8de028*0x40+_0x85d616:_0x85d616,_0x384a27++%0x4)?_0x1d11b6+=_0x19411e['charCodeAt'](_0x2de452+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x8de028>>(-0x2*_0x384a27&0x6)):_0x384a27:0x0){_0x85d616=_0xa477de['indexOf'](_0x85d616);}for(let _0xdb00f7=0x0,_0x24dfb5=_0x1d11b6['length'];_0xdb00f7<_0x24dfb5;_0xdb00f7++){_0x357c2d+='%'+('00'+_0x1d11b6['charCodeAt'](_0xdb00f7)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x357c2d);};a18_0x409d['vzqdvy']=_0x5041fe,a18_0x409d['obxiOX']={},a18_0x409d['LJdILv']=!![];}const _0x6622bb=_0x3c5632[0x0],_0x409daa=_0x21362e+_0x6622bb,_0x2ce0fb=a18_0x409d['obxiOX'][_0x409daa];if(!_0x2ce0fb){const _0x98b8dc=function(_0x23c933){this['bYmKDi']=_0x23c933,this['vdpwIs']=[0x1,0x0,0x0],this['IlpPNL']=function(){return'newState';},this['RYecUG']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['vERpeL']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x98b8dc['prototype']['gvUBZT']=function(){const _0x3a80bf=new RegExp(this['RYecUG']+this['vERpeL']),_0x27dee6=_0x3a80bf['test'](this['IlpPNL']['toString']())?--this['vdpwIs'][0x1]:--this['vdpwIs'][0x0];return this['domHNH'](_0x27dee6);},_0x98b8dc['prototype']['domHNH']=function(_0x528b1b){if(!Boolean(~_0x528b1b))return _0x528b1b;return this['HzkjWr'](this['bYmKDi']);},_0x98b8dc['prototype']['HzkjWr']=function(_0x47d8d2){for(let _0x3d60ef=0x0,_0x5af2dc=this['vdpwIs']['length'];_0x3d60ef<_0x5af2dc;_0x3d60ef++){this['vdpwIs']['push'](Math['round'](Math['random']())),_0x5af2dc=this['vdpwIs']['length'];}return _0x47d8d2(this['vdpwIs'][0x0]);},new _0x98b8dc(a18_0x409d)['gvUBZT'](),_0x207c9a=a18_0x409d['vzqdvy'](_0x207c9a),a18_0x409d['obxiOX'][_0x409daa]=_0x207c9a;}else _0x207c9a=_0x2ce0fb;return _0x207c9a;}import{ResponseJSON}from'./response.js';export const localServer=_0x363a89=>{const _0xae1813=a18_0x409d,_0x2f3fe4={'Dhbvx':function(_0x4e2666,_0xe479ca){return _0x4e2666>_0xe479ca;},'SJEid':function(_0x52606f,_0x536a93,_0x5aec46,_0x3a9575,_0x1a237f,_0x50c1c2){return _0x52606f(_0x536a93,_0x5aec46,_0x3a9575,_0x1a237f,_0x50c1c2);},'jmVtR':_0xae1813(0x199),'kefxM':function(_0x322bea,_0x41d5db){return _0x322bea instanceof _0x41d5db;},'huPof':'error','ycrxR':function(_0x5c2f8c,_0x310d97){return _0x5c2f8c(_0x310d97);},'dPQBv':function(_0x430096){return _0x430096();},'hMbvb':_0xae1813(0x176),'NQEfH':_0xae1813(0x17b)},_0x35e0b8=a18_0x15bc52();_0x35e0b8[_0xae1813(0x18b)](a18_0x15bc52[_0xae1813(0x198)]()),_0x35e0b8[_0xae1813(0x18b)](_0x2f3fe4['dPQBv'](a18_0xe9d966)),_0x35e0b8[_0xae1813(0x18b)](_0x2f3fe4['hMbvb'],a18_0x15bc52[_0xae1813(0x188)](a18_0x3056c9[_0xae1813(0x17d)](process[_0xae1813(0x17a)](),_0x2f3fe4['NQEfH']))),_0x35e0b8[_0xae1813(0x173)](/.*/,async(_0xcab65f,_0xf3a793)=>_0x2a55c5(_0xcab65f,_0xf3a793)),_0x35e0b8[_0xae1813(0x178)](/.*/,async(_0x53b33f,_0x485eab)=>_0x2a55c5(_0x53b33f,_0x485eab)),_0x35e0b8[_0xae1813(0x190)](/.*/,async(_0x454bca,_0xdaf20d)=>_0x2a55c5(_0x454bca,_0xdaf20d)),_0x35e0b8[_0xae1813(0x17f)](/.*/,async(_0x29ac50,_0x5100fc)=>_0x2a55c5(_0x29ac50,_0x5100fc)),_0x35e0b8['delete'](/.*/,async(_0x34faa0,_0x5413f4)=>_0x2a55c5(_0x34faa0,_0x5413f4));const _0x2a55c5=async(_0x23ec2b,_0x4bdbd0)=>{const _0x1e077a=_0xae1813;let _0x49d4a5=_0x23ec2b[_0x1e077a(0x19b)];if(_0x49d4a5[_0x1e077a(0x18a)]('/'))_0x49d4a5=_0x49d4a5[_0x1e077a(0x185)](0x1);if(_0x49d4a5[_0x1e077a(0x187)]('/'))_0x49d4a5=_0x49d4a5[_0x1e077a(0x185)](0x0,-0x1);const _0x450c23=_0x49d4a5[_0x1e077a(0x15e)]('.');_0x2f3fe4[_0x1e077a(0x16e)](_0x450c23,0x0)&&(_0x49d4a5=_0x49d4a5[_0x1e077a(0x185)](0x0,_0x450c23));const _0x3e43fb=await _0x2f3fe4[_0x1e077a(0x15b)](_0x31972f,_0x49d4a5['split']('/'),_0x23ec2b[_0x1e077a(0x15c)],_0x23ec2b[_0x1e077a(0x184)],_0x23ec2b['headers'],_0x23ec2b['body']),_0x301567=_0x3e43fb['returnCode'];_0x4bdbd0[_0x1e077a(0x177)](_0x3e43fb[_0x1e077a(0x161)])[_0x1e077a(0x166)](_0x301567)[_0x1e077a(0x197)](_0x3e43fb[_0x1e077a(0x162)]);},_0x31972f=async(_0x86ddba,_0x52ff54,_0x5d0882,_0x2edfbf,_0x2c92a9=null)=>{const _0x39c8d7=_0xae1813,_0x299d90={..._0x2edfbf,'_handler_type':_0x2f3fe4[_0x39c8d7(0x170)]};try{if(_0x2c92a9!==null){let _0x3fa188;try{_0x3fa188=JSON['parse'](_0x2c92a9);}catch(_0x499b06){_0x3fa188=_0x2c92a9;}return await _0x363a89['execute'](_0x86ddba,_0x52ff54,_0x5d0882,_0x3fa188,_0x299d90);}else return await _0x363a89[_0x39c8d7(0x15d)](_0x86ddba,_0x52ff54,_0x5d0882,undefined,_0x299d90);}catch(_0x531c63){const _0x6d2756=_0x531c63['stack'][_0x39c8d7(0x16b)]('\x0a')['slice'](0x1)[_0x39c8d7(0x16c)](_0x18e96a=>_0x18e96a[_0x39c8d7(0x169)]());if(_0x2f3fe4[_0x39c8d7(0x19a)](_0x531c63,BaseError))return new ResponseJSON({'status':_0x39c8d7(0x182),'type':_0x531c63[_0x39c8d7(0x160)],'message':_0x531c63[_0x39c8d7(0x189)]})[_0x39c8d7(0x179)](_0x531c63[_0x39c8d7(0x18c)]);const _0x1ebc71=_0x531c63[_0x39c8d7(0x189)];return new ResponseJSON({'status':_0x2f3fe4[_0x39c8d7(0x172)],'error':_0x1ebc71,'stack':_0x6d2756})[_0x39c8d7(0x179)](0x1f4);}};a18_0x41a996[_0xae1813(0x167)]();const _0x3c2537=process.env.PORT||0xbb9;return new Promise((_0xc2262,_0x5c317f)=>{const _0x18bf9a=_0xae1813,_0x1d91d5=_0x35e0b8[_0x18bf9a(0x15f)](_0x3c2537,()=>{const _0x138b94=_0x18bf9a,_0x165bf3='http://localhost:'+_0x3c2537+'/';console['log'](_0x138b94(0x17c)+_0x165bf3);for(const _0x582b44 of Object['keys'](_0x363a89[_0x138b94(0x168)])){const _0x387b17=_0x363a89['schema'][_0x582b44];if(_0x387b17[_0x138b94(0x16f)])console['log'](_0x138b94(0x171)+_0x387b17['tag']+_0x138b94(0x186)+_0x165bf3+_0x138b94(0x174)+_0x582b44);}_0x2f3fe4[_0x138b94(0x18d)](_0xc2262,_0x1d91d5);});_0x1d91d5['on'](_0x2f3fe4[_0x18bf9a(0x172)],_0x5c317f);});};
1
+ import{a}from"./chunk-RO2W6WB2.js";import"./chunk-S5BWAMGC.js";import"./chunk-S3PQMJO4.js";export{a as localServer};
@@ -0,0 +1 @@
1
+ "use strict";var i=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var g=(t,n)=>{for(var s in n)i(t,s,{get:n[s],enumerable:!0})},y=(t,n,s,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of u(n))!c.call(t,r)&&r!==s&&i(t,r,{get:()=>n[r],enumerable:!(o=a(n,r))||o.enumerable});return t};var d=t=>y(i({},"__esModule",{value:!0}),t);var h={};g(h,{NotificationChannel:()=>l});module.exports=d(h);var l=class{#n;get url(){return this.#n}constructor(n=null){this.#n=n}async notify(n,s=null){let o;try{o=JSON.stringify(n)}catch{o=String(n)}let r={text:o};s&&(r.thread={threadKey:s});try{return{status:"sent",response:await fetch(this.#n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)})}}catch(e){return console.error("Failed to send notification",e),{status:"not_sent",reason:e.message}}}};0&&(module.exports={NotificationChannel});
@@ -1 +1 @@
1
- const a19_0x53ff2c=a19_0x19df;(function(_0x46a331,_0x3ba0dc){const _0x15040a=a19_0x19df,_0x3e8e28=_0x46a331();while(!![]){try{const _0x48d7e2=-parseInt(_0x15040a(0x170))/0x1+-parseInt(_0x15040a(0x179))/0x2+parseInt(_0x15040a(0x169))/0x3*(parseInt(_0x15040a(0x16e))/0x4)+parseInt(_0x15040a(0x16f))/0x5+-parseInt(_0x15040a(0x178))/0x6*(parseInt(_0x15040a(0x16d))/0x7)+-parseInt(_0x15040a(0x16c))/0x8*(-parseInt(_0x15040a(0x167))/0x9)+parseInt(_0x15040a(0x166))/0xa;if(_0x48d7e2===_0x3ba0dc)break;else _0x3e8e28['push'](_0x3e8e28['shift']());}catch(_0x234cb7){_0x3e8e28['push'](_0x3e8e28['shift']());}}}(a19_0x404f,0x40258));function a19_0x19df(_0x5f19d1,_0x3de0cd){_0x5f19d1=_0x5f19d1-0x165;const _0x2b1b58=a19_0x404f();let _0x72bd1a=_0x2b1b58[_0x5f19d1];if(a19_0x19df['noUuJM']===undefined){var _0x36dc5a=function(_0x8b8598){const _0x3c94fe='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x552cc1='',_0x54a6b3='',_0x71fe43=_0x552cc1+_0x36dc5a;for(let _0x8d2d46=0x0,_0x354a58,_0x408e95,_0xad6764=0x0;_0x408e95=_0x8b8598['charAt'](_0xad6764++);~_0x408e95&&(_0x354a58=_0x8d2d46%0x4?_0x354a58*0x40+_0x408e95:_0x408e95,_0x8d2d46++%0x4)?_0x552cc1+=_0x71fe43['charCodeAt'](_0xad6764+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x354a58>>(-0x2*_0x8d2d46&0x6)):_0x8d2d46:0x0){_0x408e95=_0x3c94fe['indexOf'](_0x408e95);}for(let _0x331d2d=0x0,_0x11c2b9=_0x552cc1['length'];_0x331d2d<_0x11c2b9;_0x331d2d++){_0x54a6b3+='%'+('00'+_0x552cc1['charCodeAt'](_0x331d2d)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x54a6b3);};a19_0x19df['bAxmKS']=_0x36dc5a,a19_0x19df['EZRBQC']={},a19_0x19df['noUuJM']=!![];}const _0x404f92=_0x2b1b58[0x0],_0x19df9a=_0x5f19d1+_0x404f92,_0xfd7467=a19_0x19df['EZRBQC'][_0x19df9a];if(!_0xfd7467){const _0x3e6a00=function(_0x597ff7){this['MKOexb']=_0x597ff7,this['LOBTKM']=[0x1,0x0,0x0],this['ymMNVq']=function(){return'newState';},this['PmSFCY']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['pjodAo']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x3e6a00['prototype']['jScCap']=function(){const _0x31f0fc=new RegExp(this['PmSFCY']+this['pjodAo']),_0x28e5a7=_0x31f0fc['test'](this['ymMNVq']['toString']())?--this['LOBTKM'][0x1]:--this['LOBTKM'][0x0];return this['HKgvkA'](_0x28e5a7);},_0x3e6a00['prototype']['HKgvkA']=function(_0x4214d2){if(!Boolean(~_0x4214d2))return _0x4214d2;return this['BFUyFm'](this['MKOexb']);},_0x3e6a00['prototype']['BFUyFm']=function(_0xcb1f88){for(let _0x34dad5=0x0,_0x15df30=this['LOBTKM']['length'];_0x34dad5<_0x15df30;_0x34dad5++){this['LOBTKM']['push'](Math['round'](Math['random']())),_0x15df30=this['LOBTKM']['length'];}return _0xcb1f88(this['LOBTKM'][0x0]);},new _0x3e6a00(a19_0x19df)['jScCap'](),_0x72bd1a=a19_0x19df['bAxmKS'](_0x72bd1a),a19_0x19df['EZRBQC'][_0x19df9a]=_0x72bd1a;}else _0x72bd1a=_0xfd7467;return _0x72bd1a;}const a19_0x36dc5a=(function(){let _0x443a6f=!![];return function(_0x5d9b47,_0x4930b5){const _0x135f4a=_0x443a6f?function(){const _0x4812e3=a19_0x19df;if(_0x4930b5){const _0x1826d4=_0x4930b5[_0x4812e3(0x168)](_0x5d9b47,arguments);return _0x4930b5=null,_0x1826d4;}}:function(){};return _0x443a6f=![],_0x135f4a;};}()),a19_0x72bd1a=a19_0x36dc5a(this,function(){const _0x5df49f=a19_0x19df,_0x56806c={'zfSLf':_0x5df49f(0x17b)};return a19_0x72bd1a[_0x5df49f(0x177)]()['search'](_0x5df49f(0x17b))[_0x5df49f(0x177)]()['constructor'](a19_0x72bd1a)[_0x5df49f(0x165)](_0x56806c[_0x5df49f(0x17d)]);});a19_0x72bd1a();function a19_0x404f(){const _0x41be18=['mty3mKP3vwzsqW','nZa0mNjHzLjxwq','mtzutgDRwhG','mJiYotGWEuLSufb6','mZyZmde1u2HADxD4','suv6A1G','BwvZC2fNzq','swnMAfG','zxjYB3i','ue9tva','DgHYzwfK','Dg9tDhjPBMC','mJK1mK5JquXWBG','otqXmta0rgLHBM5s','DxjS','kcGOlISPkYKRksSK','rMfPBgvKihrVihnLBMqGBM90AwzPy2f0Aw9U','EMzttgy','C3rYAw5NAwz5','wvjIwKW','yxbWBgLJyxrPB24VANnVBG','wuzSCem','C2vHCMnO','otGXmdu0mhfltLrcwG','mJa5n016CuDOyG','yxbWBhK','mZG3nJG3qvP5qNLY','BM90Awz5','BM90x3nLBNq'];a19_0x404f=function(){return _0x41be18;};return a19_0x404f();}export class NotificationChannel{#notificationUrl;get[a19_0x53ff2c(0x17a)](){return this.#notificationUrl;}constructor(_0x1bc0e4=null){this.#notificationUrl=_0x1bc0e4;}async[a19_0x53ff2c(0x16a)](_0xf92a5e,_0x588429=null){const _0xc64a5d=a19_0x53ff2c,_0x3ec5f6={'YFlpC':_0xc64a5d(0x175),'IcfhX':_0xc64a5d(0x180),'YRbZL':_0xc64a5d(0x17c),'IEzkX':_0xc64a5d(0x16b)};try{_0xf92a5e=JSON[_0xc64a5d(0x17e)](_0xf92a5e);}catch{};let _0x318228={'text':_0xf92a5e};if(_0x588429)_0x318228[_0xc64a5d(0x176)]={'threadKey':_0x588429};try{const _0x51ac9b=await fetch(this[_0xc64a5d(0x17a)],{'method':_0x3ec5f6[_0xc64a5d(0x181)],'headers':{'Content-Type':_0x3ec5f6[_0xc64a5d(0x173)]},'body':JSON['stringify'](_0x318228)});return{'status':'sent','response':_0x51ac9b};}catch(_0x1ecb59){return console[_0xc64a5d(0x174)](_0x3ec5f6[_0xc64a5d(0x17f)],_0x1ecb59),{'status':_0x3ec5f6[_0xc64a5d(0x171)],'reason':_0x1ecb59[_0xc64a5d(0x172)]};}}}
1
+ var e=class{#n;get url(){return this.#n}constructor(n=null){this.#n=n}async notify(n,s=null){let t;try{t=JSON.stringify(n)}catch{t=String(n)}let o={text:t};s&&(o.thread={threadKey:s});try{return{status:"sent",response:await fetch(this.#n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})}}catch(r){return console.error("Failed to send notification",r),{status:"not_sent",reason:r.message}}}};export{e as NotificationChannel};
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var S=(t,n)=>{for(var e in n)o(t,e,{get:n[e],enumerable:!0})},u=(t,n,e,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of p(n))!m.call(t,i)&&i!==e&&o(t,i,{get:()=>n[i],enumerable:!(s=a(n,i))||s.enumerable});return t};var N=t=>u(o({},"__esModule",{value:!0}),t);var g={};S(g,{SNSPublisher:()=>c});module.exports=N(g);var r=require("@aws-sdk/client-sns"),l=require("@aws-sdk/credential-providers"),c=class{#n;get topic(){return this.#n}#t;get client(){return this.#t}constructor(n=null){this.#n=(process.env.SNS_ARN_PREFIX??"")+(n??"");let e=!!process.env.AWS_LAMBDA_FUNCTION_NAME,s={region:process.env.AWS_REGION};e||(s.credentials=(0,l.fromIni)({profile:process.env.AWS_PROFILE})),this.#t=new r.SNSClient(s)}async publish(n){let e=new r.PublishCommand({TopicArn:this.#n,Message:JSON.stringify(n)});return await this.#t.send(e)}};0&&(module.exports={SNSPublisher});
@@ -1 +1 @@
1
- const a20_0x2c6ece=a20_0x3093;(function(_0x22a5a7,_0xed5480){const _0x446502=a20_0x3093,_0x20133c=_0x22a5a7();while(!![]){try{const _0xbb0b1=parseInt(_0x446502(0x7b))/0x1+parseInt(_0x446502(0x86))/0x2*(-parseInt(_0x446502(0x81))/0x3)+-parseInt(_0x446502(0x8f))/0x4+parseInt(_0x446502(0x8e))/0x5*(-parseInt(_0x446502(0x88))/0x6)+parseInt(_0x446502(0x7c))/0x7*(parseInt(_0x446502(0x89))/0x8)+parseInt(_0x446502(0x7d))/0x9*(parseInt(_0x446502(0x7a))/0xa)+parseInt(_0x446502(0x83))/0xb;if(_0xbb0b1===_0xed5480)break;else _0x20133c['push'](_0x20133c['shift']());}catch(_0x4961ab){_0x20133c['push'](_0x20133c['shift']());}}}(a20_0x4c3e,0x4d5cb));function a20_0x3093(_0x1f7c66,_0x12094a){_0x1f7c66=_0x1f7c66-0x79;const _0x1df6b8=a20_0x4c3e();let _0x2eaf53=_0x1df6b8[_0x1f7c66];if(a20_0x3093['XjoGpX']===undefined){var _0x740eca=function(_0x2c66e9){const _0x30f8d2='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x22b8a0='',_0x3c9e22='',_0xeba218=_0x22b8a0+_0x740eca;for(let _0x303198=0x0,_0x3554c3,_0x2664e4,_0x997b9c=0x0;_0x2664e4=_0x2c66e9['charAt'](_0x997b9c++);~_0x2664e4&&(_0x3554c3=_0x303198%0x4?_0x3554c3*0x40+_0x2664e4:_0x2664e4,_0x303198++%0x4)?_0x22b8a0+=_0xeba218['charCodeAt'](_0x997b9c+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x3554c3>>(-0x2*_0x303198&0x6)):_0x303198:0x0){_0x2664e4=_0x30f8d2['indexOf'](_0x2664e4);}for(let _0x5c1421=0x0,_0x97c83e=_0x22b8a0['length'];_0x5c1421<_0x97c83e;_0x5c1421++){_0x3c9e22+='%'+('00'+_0x22b8a0['charCodeAt'](_0x5c1421)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3c9e22);};a20_0x3093['jhymry']=_0x740eca,a20_0x3093['IUuYNU']={},a20_0x3093['XjoGpX']=!![];}const _0x4c3e07=_0x1df6b8[0x0],_0x309354=_0x1f7c66+_0x4c3e07,_0x368020=a20_0x3093['IUuYNU'][_0x309354];if(!_0x368020){const _0x4c1654=function(_0x197b68){this['JmlUjm']=_0x197b68,this['dgIgpS']=[0x1,0x0,0x0],this['IBEnWw']=function(){return'newState';},this['hkBjEl']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['ZefIKo']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x4c1654['prototype']['YdnNtv']=function(){const _0x4a9f09=new RegExp(this['hkBjEl']+this['ZefIKo']),_0x3641f5=_0x4a9f09['test'](this['IBEnWw']['toString']())?--this['dgIgpS'][0x1]:--this['dgIgpS'][0x0];return this['FAnxJP'](_0x3641f5);},_0x4c1654['prototype']['FAnxJP']=function(_0x5f4787){if(!Boolean(~_0x5f4787))return _0x5f4787;return this['XMTxOS'](this['JmlUjm']);},_0x4c1654['prototype']['XMTxOS']=function(_0x5541c0){for(let _0x43029f=0x0,_0x363528=this['dgIgpS']['length'];_0x43029f<_0x363528;_0x43029f++){this['dgIgpS']['push'](Math['round'](Math['random']())),_0x363528=this['dgIgpS']['length'];}return _0x5541c0(this['dgIgpS'][0x0]);},new _0x4c1654(a20_0x3093)['YdnNtv'](),_0x2eaf53=a20_0x3093['jhymry'](_0x2eaf53),a20_0x3093['IUuYNU'][_0x309354]=_0x2eaf53;}else _0x2eaf53=_0x368020;return _0x2eaf53;}function a20_0x4c3e(){const _0x3711f9=['BLb0BhC','mJq3nZK1zgnqqvLl','mte2odq1mLfJBePkCG','Dg9tDhjPBMC','mJblELn0zxi','ndaYmJCYB215ELzf','mJeWntuZDNnIBNLA','mJi2otu4ngL5BvLgvW','yxbWBhK','C2vHCMnO','Ewj4re4','mtCXDxzQzMjq','kcGOlISPkYKRksSK','mJqZodu2oePVvxHoBG','ChvIBgLZAa','y3jLzgvUDgLHBhm','ntm2nNnAqNL4Ca','C3rYAw5NAwz5','ndHNz3j2vMG','ogrkCwfyrG','y2XPzw50','y29UC3rYDwn0B3i','Dg9WAwm'];a20_0x4c3e=function(){return _0x3711f9;};return a20_0x4c3e();}const a20_0x740eca=(function(){let _0x1d5f36=!![];return function(_0x541610,_0xbe85c8){const _0x3397c3=_0x1d5f36?function(){const _0x238349=a20_0x3093;if(_0xbe85c8){const _0x14fec0=_0xbe85c8[_0x238349(0x7e)](_0x541610,arguments);return _0xbe85c8=null,_0x14fec0;}}:function(){};return _0x1d5f36=![],_0x3397c3;};}()),a20_0x2eaf53=a20_0x740eca(this,function(){const _0x5debc2=a20_0x3093,_0x221ff8={'ybxDN':_0x5debc2(0x82)};return a20_0x2eaf53[_0x5debc2(0x79)]()[_0x5debc2(0x7f)]('(((.+)+)+)+$')[_0x5debc2(0x79)]()[_0x5debc2(0x8b)](a20_0x2eaf53)[_0x5debc2(0x7f)](_0x221ff8[_0x5debc2(0x80)]);});a20_0x2eaf53();import{PublishCommand,SNSClient}from'@aws-sdk/client-sns';import{fromIni}from'@aws-sdk/credential-providers';export class SNSPublisher{#topic;get[a20_0x2c6ece(0x8c)](){return this.#topic;}#client;get[a20_0x2c6ece(0x8a)](){return this.#client;}constructor(_0x5d26dc=null){const _0x8b3dc9=a20_0x2c6ece,_0x565418={'nPtlw':function(_0x10d5e5,_0x3481c4){return _0x10d5e5(_0x3481c4);}};this.#topic=process.env.SNS_ARN_PREFIX+(_0x5d26dc??'');let _0xb1b6ad={'region':this['region']};const _0x1effab=!!process.env.AWS_LAMBDA_FUNCTION_NAME;!_0x1effab&&(_0xb1b6ad[_0x8b3dc9(0x85)]=_0x565418[_0x8b3dc9(0x8d)](fromIni,{'profile':process.env.AWS_PROFILE})),this.#client=new SNSClient(_0xb1b6ad);}async[a20_0x2c6ece(0x84)](_0x4e42bc){const _0x1b6090=a20_0x2c6ece,_0xa4d9c8=new PublishCommand({'TopicArn':this.#topic,'Message':JSON[_0x1b6090(0x87)](_0x4e42bc)});return await this.#client['send'](_0xa4d9c8);}}
1
+ import{PublishCommand as i,SNSClient as r}from"@aws-sdk/client-sns";import{fromIni as o}from"@aws-sdk/credential-providers";var s=class{#n;get topic(){return this.#n}#t;get client(){return this.#t}constructor(n=null){this.#n=(process.env.SNS_ARN_PREFIX??"")+(n??"");let t=!!process.env.AWS_LAMBDA_FUNCTION_NAME,e={region:process.env.AWS_REGION};t||(e.credentials=o({profile:process.env.AWS_PROFILE})),this.#t=new r(e)}async publish(n){let t=new i({TopicArn:this.#n,Message:JSON.stringify(n)});return await this.#t.send(t)}};export{s as SNSPublisher};
package/package.json CHANGED
@@ -1,10 +1,7 @@
1
1
  {
2
2
  "name": "redleaf-ishell",
3
- "version": "1.0.2",
4
- "description": "",
3
+ "version": "1.0.3",
5
4
  "type": "module",
6
- "author": "",
7
- "license": "ISC",
8
5
  "dependencies": {
9
6
  "@aws-sdk/client-sns": "^3.758.0",
10
7
  "@aws-sdk/credential-providers": "^3.758.0",
package/response.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var f=(r,t)=>{for(var n in t)i(r,n,{get:t[n],enumerable:!0})},j=(r,t,n,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of l(t))!y.call(r,o)&&o!==n&&i(r,o,{get:()=>t[o],enumerable:!(c=h(t,o))||c.enumerable});return r};var k=r=>j(i({},"__esModule",{value:!0}),r);var m={};f(m,{ResponseCSV:()=>p,ResponseHTML:()=>g,ResponseJSON:()=>u,ResponseJSON2CSV:()=>x,ResponseText:()=>d,ResponseXML:()=>a});module.exports=k(m);var s=class{#t;#r;#n=200;get content(){return this.#t}get contentType(){return this.#r}get returnCode(){return this.#n}constructor(t,n){this.#t=t,this.#r=n}errorCode(t){return this.#n=t,this}},u=class extends s{constructor(t){super(t,"application/json")}},p=class extends s{constructor(t){super(t,"text/csv")}},x=class r extends s{static json2CSV(t){if(!Array.isArray(t)||t.length===0)return"";let n=t,c=[Object.keys(n[0]).join(",")];for(let o of n)c.push(Object.values(o).map(e=>typeof e=="string"?e.includes(",")||e.includes('"')?`"${e.replace(/"/g,'""')}"`:e:(typeof e=="number"||!isNaN(Number(e)),e)).join(","));return c.join(`
2
+ `)}constructor(t){super(r.json2CSV(t),"text/csv")}},d=class extends s{constructor(t){super(t,"text/plain")}},g=class extends s{constructor(t){super(t,"text/html")}},a=class extends s{constructor(t){super(t,"text/xml")}};0&&(module.exports={ResponseCSV,ResponseHTML,ResponseJSON,ResponseJSON2CSV,ResponseText,ResponseXML});
package/response.js CHANGED
@@ -1 +1 @@
1
- const a21_0x53a169=a21_0x5176;(function(_0x3c6cec,_0x16677c){const _0x373c65=a21_0x5176,_0x19a528=_0x3c6cec();while(!![]){try{const _0x5cc1eb=parseInt(_0x373c65(0x95))/0x1*(parseInt(_0x373c65(0xa7))/0x2)+-parseInt(_0x373c65(0x9c))/0x3*(-parseInt(_0x373c65(0xaa))/0x4)+-parseInt(_0x373c65(0xa3))/0x5*(-parseInt(_0x373c65(0xa9))/0x6)+-parseInt(_0x373c65(0xa5))/0x7+parseInt(_0x373c65(0xb0))/0x8+-parseInt(_0x373c65(0xa6))/0x9*(-parseInt(_0x373c65(0xae))/0xa)+parseInt(_0x373c65(0xa4))/0xb*(-parseInt(_0x373c65(0x97))/0xc);if(_0x5cc1eb===_0x16677c)break;else _0x19a528['push'](_0x19a528['shift']());}catch(_0x31c89b){_0x19a528['push'](_0x19a528['shift']());}}}(a21_0x47b8,0xbb111));const a21_0x41271c=(function(){let _0xff693a=!![];return function(_0x286e1e,_0x46adde){const _0x400ef7=_0xff693a?function(){const _0x3ba226=a21_0x5176;if(_0x46adde){const _0xdf7278=_0x46adde[_0x3ba226(0xab)](_0x286e1e,arguments);return _0x46adde=null,_0xdf7278;}}:function(){};return _0xff693a=![],_0x400ef7;};}()),a21_0x34f7c9=a21_0x41271c(this,function(){const _0x2c7631=a21_0x5176,_0x2d2004={'zbEEp':'(((.+)+)+)+$'};return a21_0x34f7c9[_0x2c7631(0x9a)]()[_0x2c7631(0x96)](_0x2d2004['zbEEp'])[_0x2c7631(0x9a)]()['constructor'](a21_0x34f7c9)[_0x2c7631(0x96)](_0x2d2004[_0x2c7631(0xb4)]);});a21_0x34f7c9();class Response{#content;get['content'](){return this.#content;}#contentType;get[a21_0x53a169(0xa1)](){return this.#contentType;}#returnCode=0xc8;get[a21_0x53a169(0x9d)](){return this.#returnCode;}constructor(_0x580c25,_0x2054dc){this.#content=_0x580c25,this.#contentType=_0x2054dc;}['errorCode']=_0x4f512c=>{return this.#returnCode=_0x4f512c,this;};}function a21_0x5176(_0x1974fb,_0x1cbf86){_0x1974fb=_0x1974fb-0x91;const _0x4383cb=a21_0x47b8();let _0x34f7c9=_0x4383cb[_0x1974fb];if(a21_0x5176['EYmlTe']===undefined){var _0x41271c=function(_0x1d9c66){const _0x581e06='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2a7137='',_0x19d766='',_0x44c0d2=_0x2a7137+_0x41271c;for(let _0x382a55=0x0,_0x57ee2d,_0x5d6c1e,_0x900ffa=0x0;_0x5d6c1e=_0x1d9c66['charAt'](_0x900ffa++);~_0x5d6c1e&&(_0x57ee2d=_0x382a55%0x4?_0x57ee2d*0x40+_0x5d6c1e:_0x5d6c1e,_0x382a55++%0x4)?_0x2a7137+=_0x44c0d2['charCodeAt'](_0x900ffa+0xa)-0xa!==0x0?String['fromCharCode'](0xff&_0x57ee2d>>(-0x2*_0x382a55&0x6)):_0x382a55:0x0){_0x5d6c1e=_0x581e06['indexOf'](_0x5d6c1e);}for(let _0xa4b81f=0x0,_0x31a468=_0x2a7137['length'];_0xa4b81f<_0x31a468;_0xa4b81f++){_0x19d766+='%'+('00'+_0x2a7137['charCodeAt'](_0xa4b81f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x19d766);};a21_0x5176['AUhwDD']=_0x41271c,a21_0x5176['kmHeBJ']={},a21_0x5176['EYmlTe']=!![];}const _0x47b84a=_0x4383cb[0x0],_0x517656=_0x1974fb+_0x47b84a,_0x351cb4=a21_0x5176['kmHeBJ'][_0x517656];if(!_0x351cb4){const _0x42bbc2=function(_0x5adab9){this['qCvhWI']=_0x5adab9,this['TaqtPM']=[0x1,0x0,0x0],this['OrMddS']=function(){return'newState';},this['xQiCwI']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['DTXcwc']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x42bbc2['prototype']['ZyHkar']=function(){const _0x2cb69b=new RegExp(this['xQiCwI']+this['DTXcwc']),_0x3e3fbe=_0x2cb69b['test'](this['OrMddS']['toString']())?--this['TaqtPM'][0x1]:--this['TaqtPM'][0x0];return this['DvKPZD'](_0x3e3fbe);},_0x42bbc2['prototype']['DvKPZD']=function(_0x124b28){if(!Boolean(~_0x124b28))return _0x124b28;return this['quYZsk'](this['qCvhWI']);},_0x42bbc2['prototype']['quYZsk']=function(_0x549063){for(let _0x40ed3d=0x0,_0x3d8318=this['TaqtPM']['length'];_0x40ed3d<_0x3d8318;_0x40ed3d++){this['TaqtPM']['push'](Math['round'](Math['random']())),_0x3d8318=this['TaqtPM']['length'];}return _0x549063(this['TaqtPM'][0x0]);},new _0x42bbc2(a21_0x5176)['ZyHkar'](),_0x34f7c9=a21_0x5176['AUhwDD'](_0x34f7c9),a21_0x5176['kmHeBJ'][_0x517656]=_0x34f7c9;}else _0x34f7c9=_0x351cb4;return _0x34f7c9;}export class ResponseJSON extends Response{constructor(_0x4545d3){const _0x5dc730=a21_0x53a169,_0x2860ab={'hwiJr':_0x5dc730(0x98)};super(_0x4545d3,_0x2860ab[_0x5dc730(0xb2)]);}}function a21_0x47b8(){const _0x206b1b=['mtaZndi1oxnwAer1zW','CMv0DxjUq29Kzq','AM9PBG','Aw5JBhvKzxm','vKzwtue','y29UDgvUDfr5Cgu','CMvWBgfJzq','nuTguMfPwG','ntaYmZeZoxHStfnVDa','mJiZotuYngv4Bu5XrG','nJy2ourmDgf6ua','mty0mJHNr21vBMq','C3rYAw5N','mtu3nJy4nKzhz0P5uG','ogrVyxvIva','yxbWBhK','wM5LDem','yNLcCMu','mtqYnZbuz2DVCuu','DMfSDwvZ','odiZnZi4ywP5A0Lx','BwfW','AhDPsNi','ANnVBJjdu1y','EMjfrxa','Dgv4Dc9WBgfPBG','Dgv4Dc94BwW','vKfOC2C','A2v5CW','mtuZz1nnA3LV','C2vHCMnO','nJbTufrHDxi','yxbWBgLJyxrPB24VANnVBG','Dgv4Dc9JC3y','Dg9tDhjPBMC','AxnbCNjHEq'];a21_0x47b8=function(){return _0x206b1b;};return a21_0x47b8();}export class ResponseCSV extends Response{constructor(_0x1e3ea6){const _0x12bfdc=a21_0x53a169,_0x3421f7={'iuJel':_0x12bfdc(0x99)};super(_0x1e3ea6,_0x3421f7['iuJel']);}}export class ResponseJSON2CSV extends Response{static['json2CSV'](_0x2370cd){const _0x2d5a82=a21_0x53a169,_0x4534a9={'byBre':function(_0x2daea0,_0x48d80b){return _0x2daea0===_0x48d80b;},'ZnetC':_0x2d5a82(0xa8)};if(!Array[_0x2d5a82(0x9b)](_0x2370cd)||_0x2370cd['length']===0x0)return'';const _0x1f77ad=[Object[_0x2d5a82(0x94)](_0x2370cd[0x0])[_0x2d5a82(0x9e)](',')];for(const _0x143a51 of _0x2370cd){_0x1f77ad['push'](Object[_0x2d5a82(0xaf)](_0x143a51)[_0x2d5a82(0xb1)](_0x197ee3=>{const _0x5c82aa=_0x2d5a82;if(_0x4534a9[_0x5c82aa(0xad)](typeof _0x197ee3,_0x4534a9[_0x5c82aa(0xac)])){if(_0x197ee3['includes'](',')||_0x197ee3[_0x5c82aa(0x9f)]('\x22'))return'\x22'+_0x197ee3[_0x5c82aa(0xa2)](/"/g,'\x22\x22')+'\x22';return _0x197ee3;}else return!isNaN(_0x197ee3)?_0x197ee3:_0x197ee3;})['join'](','));}return _0x1f77ad[_0x2d5a82(0x9e)]('\x0a');}constructor(_0x66aa1a){const _0x5c4904=a21_0x53a169,_0x3fb918={'VFVMA':_0x5c4904(0x99)};super(ResponseJSON2CSV[_0x5c4904(0xb3)](_0x66aa1a),_0x3fb918[_0x5c4904(0xa0)]);}}export class ResponseText extends Response{constructor(_0x2d1d69){const _0x3f10fa=a21_0x53a169;super(_0x2d1d69,_0x3f10fa(0x91));}}export class ResponseHTML extends Response{constructor(_0x28c955){const _0x72375c=a21_0x53a169,_0x3736c8={'VAhsg':'text/html'};super(_0x28c955,_0x3736c8[_0x72375c(0x93)]);}}export class ResponseXML extends Response{constructor(_0x4bc478){const _0x47ad3c=a21_0x53a169,_0x2ec625={'WuvBH':_0x47ad3c(0x92)};super(_0x4bc478,_0x2ec625['WuvBH']);}}
1
+ import{a,b,c,d,e,f}from"./chunk-S3PQMJO4.js";export{b as ResponseCSV,e as ResponseHTML,a as ResponseJSON,c as ResponseJSON2CSV,d as ResponseText,f as ResponseXML};