resend-cli 2.19.0 → 2.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.cjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cli.cjs
CHANGED
|
@@ -24,7 +24,7 @@ Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[t]?this._life
|
|
|
24
24
|
`),this.outputHelp({error:!0}));let i=o||{},r=i.exitCode||1,n=i.code||"commander.error";this._exit(r,n,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in J.env){let o=t.attributeName();(this.getOptionValue(o)===void 0||["default","config","env"].includes(this.getOptionValueSource(o)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,J.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new em(this.options),o=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&o(i.attributeName())&&t.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(r=>!o(r)).forEach(r=>{this.setOptionValueWithSource(r,i.implied[r],"implied")})})}missingArgument(t){let o=`error: missing required argument '${t}'`;this.error(o,{code:"commander.missingArgument"})}optionMissingArgument(t){let o=`error: option '${t.flags}' argument missing`;this.error(o,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let o=`error: required option '${t.flags}' not specified`;this.error(o,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,o){let i=s=>{let a=s.attributeName(),l=this.getOptionValue(a),d=this.options.find(m=>m.negate&&a===m.attributeName()),c=this.options.find(m=>!m.negate&&a===m.attributeName());return d&&(d.presetArg===void 0&&l===!1||d.presetArg!==void 0&&l===d.presetArg)?d:c||s},r=s=>{let a=i(s),l=a.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},n=`error: ${r(t)} cannot be used with ${r(o)}`;this.error(n,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let o="";if(t.startsWith("--")&&this._showSuggestionAfterError){let r=[],n=this;do{let s=n.createHelp().visibleOptions(n).filter(a=>a.long).map(a=>a.long);r=r.concat(s),n=n.parent}while(n&&!n._enablePositionalOptions);o=Yr(t,r)}let i=`error: unknown option '${t}'${o}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let o=this.registeredArguments.length,i=o===1?"":"s",n=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${o} argument${i} but got ${t.length}.`;this.error(n,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],o="";if(this._showSuggestionAfterError){let r=[];this.createHelp().visibleCommands(this).forEach(n=>{r.push(n.name()),n.alias()&&r.push(n.alias())}),o=Yr(t,r)}let i=`error: unknown command '${t}'${o}`;this.error(i,{code:"commander.unknownCommand"})}version(t,o,i){if(t===void 0)return this._version;this._version=t,o=o||"-V, --version",i=i||"output the version number";let r=this.createOption(o,i);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on("option:"+r.name(),()=>{this._outputConfiguration.writeOut(`${t}
|
|
25
25
|
`),this._exit(0,"commander.version",t)}),this}description(t,o){return t===void 0&&o===void 0?this._description:(this._description=t,o&&(this._argsDescription=o),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let o=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(o=this.commands[this.commands.length-1]),t===o._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(t);if(i){let r=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${r}'`)}return o._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(o=>this.alias(o)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let o=this.registeredArguments.map(i=>Yu(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?o:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=et.basename(t,et.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let o=this.createHelp(),i=this._getOutputContext(t);o.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let r=o.formatHelp(this,o);return i.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(t){t=t||{};let o=!!t.error,i,r,n;return o?(i=a=>this._outputConfiguration.writeErr(a),r=this._outputConfiguration.getErrHasColors(),n=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),r=this._outputConfiguration.getOutHasColors(),n=this._outputConfiguration.getOutHelpWidth()),{error:o,write:a=>(r||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:r,helpWidth:n}}outputHelp(t){let o;typeof t=="function"&&(o=t,t=void 0);let i=this._getOutputContext(t),r={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",r)),this.emit("beforeHelp",r);let n=this.helpInformation({error:i.error});if(o&&(n=o(n),typeof n!="string"&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(n),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",r),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",r))}helpOption(t,o){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",o??"display help for command"),(t||o)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let o=Number(J.exitCode??0);o===0&&t&&typeof t!="function"&&t.error&&(o=1),this._exit(o,"commander.help","(outputHelp)")}addHelpText(t,o){let i=["beforeAll","before","after","afterAll"];if(!i.includes(t))throw new Error(`Unexpected value for position to addHelpText.
|
|
26
26
|
Expecting one of '${i.join("', '")}'`);let r=`${t}Help`;return this.on(r,n=>{let s;typeof o=="function"?s=o({error:n.error,command:n.command}):s=o,s&&n.write(`${s}
|
|
27
|
-
`)}),this}_outputHelpIfRequested(t){let o=this._getHelpOption();o&&t.find(r=>o.is(r))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Xr(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let o,i="127.0.0.1",r="9229",n;return(n=t.match(/^(--inspect(-brk)?)$/))!==null?o=n[1]:(n=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(o=n[1],/^\d+$/.test(n[3])?r=n[3]:i=n[3]):(n=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(o=n[1],i=n[3],r=n[4]),o&&r!=="0"?`${o}=${i}:${parseInt(r)+1}`:t})}function Hi(){if(J.env.NO_COLOR||J.env.FORCE_COLOR==="0"||J.env.FORCE_COLOR==="false")return!1;if(J.env.FORCE_COLOR||J.env.CLICOLOR_FORCE!==void 0)return!0}Qi.Command=Gi;Qi.useColor=Hi});var rn=Fe($e=>{var{Argument:en}=So(),{Command:Ni}=Zr(),{CommanderError:tm,InvalidArgumentError:tn}=to(),{Help:om}=Bi(),{Option:on}=ji();$e.program=new Ni;$e.createCommand=e=>new Ni(e);$e.createOption=(e,t)=>new on(e,t);$e.createArgument=(e,t)=>new en(e,t);$e.Command=Ni;$e.Option=on;$e.Argument=en;$e.Help=om;$e.CommanderError=tm;$e.InvalidArgumentError=tn;$e.InvalidOptionArgumentError=tn});var sn=Fe((Be,nn)=>{var Me=rn();Be=nn.exports={};Be.program=new Me.Command;Be.Argument=Me.Argument;Be.Command=Me.Command;Be.CommanderError=Me.CommanderError;Be.Help=Me.Help;Be.InvalidArgumentError=Me.InvalidArgumentError;Be.InvalidOptionArgumentError=Me.InvalidArgumentError;Be.Option=Me.Option;Be.createCommand=e=>new Me.Command(e);Be.createOption=(e,t)=>new Me.Option(e,t);Be.createArgument=(e,t)=>new Me.Argument(e,t)});var Ve=Fe((ch,Mi)=>{var ko=process||{},cn=ko.argv||[],xo=ko.env||{},im=!(xo.NO_COLOR||cn.includes("--no-color"))&&(!!xo.FORCE_COLOR||cn.includes("--color")||ko.platform==="win32"||(ko.stdout||{}).isTTY&&xo.TERM!=="dumb"||!!xo.CI),rm=(e,t,o=e)=>i=>{let r=""+i,n=r.indexOf(t,e.length);return~n?e+nm(r,t,o,n)+t:e+r+t},nm=(e,t,o,i)=>{let r="",n=0;do r+=e.substring(n,i)+o,n=i+t.length,i=e.indexOf(t,n);while(~i);return r+e.substring(n)},dn=(e=im)=>{let t=e?rm:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};Mi.exports=dn();Mi.exports.createColors=dn});var Vi=Fe((bh,Kn)=>{"use strict";var Ji={to(e,t){return t?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`},move(e,t){let o="";return e<0?o+=`\x1B[${-e}D`:e>0&&(o+=`\x1B[${e}C`),t<0?o+=`\x1B[${-t}A`:t>0&&(o+=`\x1B[${t}B`),o},up:(e=1)=>`\x1B[${e}A`,down:(e=1)=>`\x1B[${e}B`,forward:(e=1)=>`\x1B[${e}C`,backward:(e=1)=>`\x1B[${e}D`,nextLine:(e=1)=>"\x1B[E".repeat(e),prevLine:(e=1)=>"\x1B[F".repeat(e),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},wm={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},vm={screen:"\x1B[2J",up:(e=1)=>"\x1B[1J".repeat(e),down:(e=1)=>"\x1B[J".repeat(e),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(e){let t="";for(let o=0;o<e;o++)t+=this.line+(o<e-1?Ji.up():"");return e&&(t+=Ji.left),t}};Kn.exports={cursor:Ji,scroll:wm,erase:vm,beep:"\x07"}});var Zi,Nn=he(()=>{Zi={name:"resend-cli",version:"2.19.0",description:"The official CLI for Resend",license:"MIT",repository:{type:"git",url:"https://github.com/resend/resend-cli"},homepage:"https://github.com/resend/resend-cli#readme",keywords:["cli","resend","email","api","tanstack-intent"],engines:{node:">=22"},packageManager:"pnpm@11.8.0",files:["dist/cli.cjs","skills/"],type:"module",bin:{resend:"./dist/cli.cjs"},scripts:{dev:"tsx src/cli.ts","dev:watch":"tsx --watch src/cli.ts",build:"node scripts/build.mjs","build:bin":"pnpm build && pkg dist/cli.cjs --config package.json --compress Brotli --target node24 --output dist/resend",lint:"biome check .","lint:fix":"biome check --write .",typecheck:"tsc --noEmit",test:"vitest run","test:e2e":"vitest run --config vitest.config.e2e.ts",prepack:"pnpm install && pnpm build && node scripts/verify-bundle.mjs"},dependencies:{"@clack/prompts":"1.4.0","@commander-js/extra-typings":"14.0.0",commander:"14.0.3",esbuild:"0.28.1","esbuild-wasm":"0.28.0",picocolors:"1.1.1",resend:"6.26.0"},pkg:{scripts:["node_modules/esbuild-wasm/bin/esbuild","node_modules/esbuild-wasm/wasm_exec.js","node_modules/esbuild-wasm/wasm_exec_node.js"],assets:["node_modules/esbuild-wasm/esbuild.wasm"]},devDependencies:{"@biomejs/biome":"2.4.11","@types/node":"24.12.4","@yao-pkg/pkg":"6.20.0",tsx:"4.22.4",typescript:"5.9.3",vitest:"4.1.9"}}});var ne,Mn,vt=he(()=>{"use strict";Nn();ne=Zi.version,Mn=Zi.name});var ts=Fe(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.timingSafeEqual=void 0;function es(e,t=""){if(!e)throw new Error(t)}function up(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),es(e instanceof DataView),es(t instanceof DataView);let o=e.byteLength,i=0,r=-1;for(;++r<o;)i|=e.getUint8(r)^t.getUint8(r);return i===0}Ho.timingSafeEqual=up});var rs=Fe(Ie=>{"use strict";var mp=Ie&&Ie.__extends||(function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var n in r)r.hasOwnProperty(n)&&(i[n]=r[n])},e(t,o)};return function(t,o){e(t,o);function i(){this.constructor=t}t.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)}})();Object.defineProperty(Ie,"__esModule",{value:!0});var le=256,lr=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var o="",i=0;i<t.length-2;i+=3){var r=t[i]<<16|t[i+1]<<8|t[i+2];o+=this._encodeByte(r>>>18&63),o+=this._encodeByte(r>>>12&63),o+=this._encodeByte(r>>>6&63),o+=this._encodeByte(r>>>0&63)}var n=t.length-i;if(n>0){var r=t[i]<<16|(n===2?t[i+1]<<8:0);o+=this._encodeByte(r>>>18&63),o+=this._encodeByte(r>>>12&63),n===2?o+=this._encodeByte(r>>>6&63):o+=this._paddingCharacter||"",o+=this._paddingCharacter||""}return o},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var o=this._getPaddingLength(t),i=t.length-o,r=new Uint8Array(this.maxDecodedLength(i)),n=0,s=0,a=0,l=0,d=0,c=0,m=0;s<i-4;s+=4)l=this._decodeChar(t.charCodeAt(s+0)),d=this._decodeChar(t.charCodeAt(s+1)),c=this._decodeChar(t.charCodeAt(s+2)),m=this._decodeChar(t.charCodeAt(s+3)),r[n++]=l<<2|d>>>4,r[n++]=d<<4|c>>>2,r[n++]=c<<6|m,a|=l&le,a|=d&le,a|=c&le,a|=m≤if(s<i-1&&(l=this._decodeChar(t.charCodeAt(s)),d=this._decodeChar(t.charCodeAt(s+1)),r[n++]=l<<2|d>>>4,a|=l&le,a|=d&le),s<i-2&&(c=this._decodeChar(t.charCodeAt(s+2)),r[n++]=d<<4|c>>>2,a|=c&le),s<i-3&&(m=this._decodeChar(t.charCodeAt(s+3)),r[n++]=c<<6|m,a|=m&le),a!==0)throw new Error("Base64Coder: incorrect characters for decoding");return r},e.prototype._encodeByte=function(t){var o=t;return o+=65,o+=25-t>>>8&6,o+=51-t>>>8&-75,o+=61-t>>>8&-15,o+=62-t>>>8&3,String.fromCharCode(o)},e.prototype._decodeChar=function(t){var o=le;return o+=(42-t&t-44)>>>8&-le+t-43+62,o+=(46-t&t-48)>>>8&-le+t-47+63,o+=(47-t&t-58)>>>8&-le+t-48+52,o+=(64-t&t-91)>>>8&-le+t-65+0,o+=(96-t&t-123)>>>8&-le+t-97+26,o},e.prototype._getPaddingLength=function(t){var o=0;if(this._paddingCharacter){for(var i=t.length-1;i>=0&&t[i]===this._paddingCharacter;i--)o++;if(t.length<4||o>2)throw new Error("Base64Coder: incorrect padding")}return o},e})();Ie.Coder=lr;var co=new lr;function pp(e){return co.encode(e)}Ie.encode=pp;function fp(e){return co.decode(e)}Ie.decode=fp;var os=(function(e){mp(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(o){var i=o;return i+=65,i+=25-o>>>8&6,i+=51-o>>>8&-75,i+=61-o>>>8&-13,i+=62-o>>>8&49,String.fromCharCode(i)},t.prototype._decodeChar=function(o){var i=le;return i+=(44-o&o-46)>>>8&-le+o-45+62,i+=(94-o&o-96)>>>8&-le+o-95+63,i+=(47-o&o-58)>>>8&-le+o-48+52,i+=(64-o&o-91)>>>8&-le+o-65+0,i+=(96-o&o-123)>>>8&-le+o-97+26,i},t})(lr);Ie.URLSafeCoder=os;var is=new os;function gp(e){return is.encode(e)}Ie.encodeURLSafe=gp;function hp(e){return is.decode(e)}Ie.decodeURLSafe=hp;Ie.encodedLength=function(e){return co.encodedLength(e)};Ie.maxDecodedLength=function(e){return co.maxDecodedLength(e)};Ie.decodedLength=function(e){return co.decodedLength(e)}});var ss=Fe((ns,Qo)=>{(function(e,t){var o={};t(o);var i=o.default;for(var r in o)i[r]=o[r];typeof Qo=="object"&&typeof Qo.exports=="object"?Qo.exports=i:typeof define=="function"&&define.amd?define(function(){return i}):e.sha256=i})(ns,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function o(m,f,b,h,A){for(var U,v,S,K,x,D,I,G,E,N,Ce,ie,Ut;A>=64;){for(U=f[0],v=f[1],S=f[2],K=f[3],x=f[4],D=f[5],I=f[6],G=f[7],N=0;N<16;N++)Ce=h+N*4,m[N]=(b[Ce]&255)<<24|(b[Ce+1]&255)<<16|(b[Ce+2]&255)<<8|b[Ce+3]&255;for(N=16;N<64;N++)E=m[N-2],ie=(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10,E=m[N-15],Ut=(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3,m[N]=(ie+m[N-7]|0)+(Ut+m[N-16]|0);for(N=0;N<64;N++)ie=(((x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7))+(x&D^~x&I)|0)+(G+(t[N]+m[N]|0)|0)|0,Ut=((U>>>2|U<<30)^(U>>>13|U<<19)^(U>>>22|U<<10))+(U&v^U&S^v&S)|0,G=I,I=D,D=x,x=K+ie|0,K=S,S=v,v=U,U=ie+Ut|0;f[0]+=U,f[1]+=v,f[2]+=S,f[3]+=K,f[4]+=x,f[5]+=D,f[6]+=I,f[7]+=G,h+=64,A-=64}return h}var i=(function(){function m(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return m.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},m.prototype.clean=function(){for(var f=0;f<this.buffer.length;f++)this.buffer[f]=0;for(var f=0;f<this.temp.length;f++)this.temp[f]=0;this.reset()},m.prototype.update=function(f,b){if(b===void 0&&(b=f.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var h=0;if(this.bytesHashed+=b,this.bufferLength>0){for(;this.bufferLength<64&&b>0;)this.buffer[this.bufferLength++]=f[h++],b--;this.bufferLength===64&&(o(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(b>=64&&(h=o(this.temp,this.state,f,h,b),b%=64);b>0;)this.buffer[this.bufferLength++]=f[h++],b--;return this},m.prototype.finish=function(f){if(!this.finished){var b=this.bytesHashed,h=this.bufferLength,A=b/536870912|0,U=b<<3,v=b%64<56?64:128;this.buffer[h]=128;for(var S=h+1;S<v-8;S++)this.buffer[S]=0;this.buffer[v-8]=A>>>24&255,this.buffer[v-7]=A>>>16&255,this.buffer[v-6]=A>>>8&255,this.buffer[v-5]=A>>>0&255,this.buffer[v-4]=U>>>24&255,this.buffer[v-3]=U>>>16&255,this.buffer[v-2]=U>>>8&255,this.buffer[v-1]=U>>>0&255,o(this.temp,this.state,this.buffer,0,v),this.finished=!0}for(var S=0;S<8;S++)f[S*4+0]=this.state[S]>>>24&255,f[S*4+1]=this.state[S]>>>16&255,f[S*4+2]=this.state[S]>>>8&255,f[S*4+3]=this.state[S]>>>0&255;return this},m.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},m.prototype._saveState=function(f){for(var b=0;b<this.state.length;b++)f[b]=this.state[b]},m.prototype._restoreState=function(f,b){for(var h=0;h<this.state.length;h++)this.state[h]=f[h];this.bytesHashed=b,this.finished=!1,this.bufferLength=0},m})();e.Hash=i;var r=(function(){function m(f){this.inner=new i,this.outer=new i,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var b=new Uint8Array(this.blockSize);if(f.length>this.blockSize)new i().update(f).finish(b).clean();else for(var h=0;h<f.length;h++)b[h]=f[h];for(var h=0;h<b.length;h++)b[h]^=54;this.inner.update(b);for(var h=0;h<b.length;h++)b[h]^=106;this.outer.update(b),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var h=0;h<b.length;h++)b[h]=0}return m.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},m.prototype.clean=function(){for(var f=0;f<this.istate.length;f++)this.ostate[f]=this.istate[f]=0;this.inner.clean(),this.outer.clean()},m.prototype.update=function(f){return this.inner.update(f),this},m.prototype.finish=function(f){return this.outer.finished?this.outer.finish(f):(this.inner.finish(f),this.outer.update(f,this.digestLength).finish(f)),this},m.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},m})();e.HMAC=r;function n(m){var f=new i().update(m),b=f.digest();return f.clean(),b}e.hash=n,e.default=n;function s(m,f){var b=new r(m).update(f),h=b.digest();return b.clean(),h}e.hmac=s;function a(m,f,b,h){var A=h[0];if(A===0)throw new Error("hkdf: cannot expand more");f.reset(),A>1&&f.update(m),b&&f.update(b),f.update(h),f.finish(m),h[0]++}var l=new Uint8Array(e.digestLength);function d(m,f,b,h){f===void 0&&(f=l),h===void 0&&(h=32);for(var A=new Uint8Array([1]),U=s(f,m),v=new r(U),S=new Uint8Array(v.digestLength),K=S.length,x=new Uint8Array(h),D=0;D<h;D++)K===S.length&&(a(S,v,b,A),K=0),x[D]=S[K++];return v.clean(),S.fill(0),A.fill(0),x}e.hkdf=d;function c(m,f,b,h){for(var A=new r(m),U=A.digestLength,v=new Uint8Array(4),S=new Uint8Array(U),K=new Uint8Array(U),x=new Uint8Array(h),D=0;D*U<h;D++){var I=D+1;v[0]=I>>>24&255,v[1]=I>>>16&255,v[2]=I>>>8&255,v[3]=I>>>0&255,A.reset(),A.update(f),A.update(v),A.finish(K);for(var G=0;G<U;G++)S[G]=K[G];for(var G=2;G<=b;G++){A.reset(),A.update(K).finish(K);for(var E=0;E<U;E++)S[E]^=K[E]}for(var G=0;G<U&&D*U+G<h;G++)x[D*U+G]=S[G]}for(var D=0;D<U;D++)S[D]=K[D]=0;for(var D=0;D<4;D++)v[D]=0;return A.clean(),x}e.pbkdf2=c})});var cs=Fe(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.Webhook=Tt.WebhookVerificationError=void 0;var Ap=ts(),as=rs(),bp=ss(),ls=300,cr=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},ut=class e extends cr{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};Tt.WebhookVerificationError=ut;var No=class e{constructor(t,o){if(!t)throw new Error("Secret can't be empty.");if(o?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,i=>i.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=as.decode(t)}}verify(t,o){let i={};for(let f of Object.keys(o))i[f.toLowerCase()]=o[f];let r=i["webhook-id"],n=i["webhook-signature"],s=i["webhook-timestamp"];if(!n||!r||!s)throw new ut("Missing required headers");let a=this.verifyTimestamp(s),d=this.sign(r,a,t).split(",")[1],c=n.split(" "),m=new globalThis.TextEncoder;for(let f of c){let[b,h]=f.split(",");if(b==="v1"&&(0,Ap.timingSafeEqual)(m.encode(h),m.encode(d)))return JSON.parse(t.toString())}throw new ut("No matching signature found")}sign(t,o,i){if(typeof i!="string")if(i.constructor.name==="Buffer")i=i.toString();else throw new Error("Expected payload to be of type string or Buffer.");let r=new TextEncoder,n=Math.floor(o.getTime()/1e3),s=r.encode(`${t}.${n}.${i}`);return`v1,${as.encode(bp.hmac(this.key,s))}`}verifyTimestamp(t){let o=Math.floor(Date.now()/1e3),i=parseInt(t,10);if(isNaN(i))throw new ut("Invalid Signature Headers");if(o-i>ls)throw new ut("Message timestamp too old");if(i>o+ls)throw new ut("Message timestamp too new");return new Date(i*1e3)}};Tt.Webhook=No;No.prefix="whsec_"});var Mo,Us=he(()=>{"use strict";Mo=class extends Error{constructor(t){super(`Credentials file is corrupted or contains invalid JSON: ${t}
|
|
27
|
+
`)}),this}_outputHelpIfRequested(t){let o=this._getHelpOption();o&&t.find(r=>o.is(r))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Xr(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let o,i="127.0.0.1",r="9229",n;return(n=t.match(/^(--inspect(-brk)?)$/))!==null?o=n[1]:(n=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(o=n[1],/^\d+$/.test(n[3])?r=n[3]:i=n[3]):(n=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(o=n[1],i=n[3],r=n[4]),o&&r!=="0"?`${o}=${i}:${parseInt(r)+1}`:t})}function Hi(){if(J.env.NO_COLOR||J.env.FORCE_COLOR==="0"||J.env.FORCE_COLOR==="false")return!1;if(J.env.FORCE_COLOR||J.env.CLICOLOR_FORCE!==void 0)return!0}Qi.Command=Gi;Qi.useColor=Hi});var rn=Fe($e=>{var{Argument:en}=So(),{Command:Ni}=Zr(),{CommanderError:tm,InvalidArgumentError:tn}=to(),{Help:om}=Bi(),{Option:on}=ji();$e.program=new Ni;$e.createCommand=e=>new Ni(e);$e.createOption=(e,t)=>new on(e,t);$e.createArgument=(e,t)=>new en(e,t);$e.Command=Ni;$e.Option=on;$e.Argument=en;$e.Help=om;$e.CommanderError=tm;$e.InvalidArgumentError=tn;$e.InvalidOptionArgumentError=tn});var sn=Fe((Be,nn)=>{var Me=rn();Be=nn.exports={};Be.program=new Me.Command;Be.Argument=Me.Argument;Be.Command=Me.Command;Be.CommanderError=Me.CommanderError;Be.Help=Me.Help;Be.InvalidArgumentError=Me.InvalidArgumentError;Be.InvalidOptionArgumentError=Me.InvalidArgumentError;Be.Option=Me.Option;Be.createCommand=e=>new Me.Command(e);Be.createOption=(e,t)=>new Me.Option(e,t);Be.createArgument=(e,t)=>new Me.Argument(e,t)});var Ve=Fe((ch,Mi)=>{var ko=process||{},cn=ko.argv||[],xo=ko.env||{},im=!(xo.NO_COLOR||cn.includes("--no-color"))&&(!!xo.FORCE_COLOR||cn.includes("--color")||ko.platform==="win32"||(ko.stdout||{}).isTTY&&xo.TERM!=="dumb"||!!xo.CI),rm=(e,t,o=e)=>i=>{let r=""+i,n=r.indexOf(t,e.length);return~n?e+nm(r,t,o,n)+t:e+r+t},nm=(e,t,o,i)=>{let r="",n=0;do r+=e.substring(n,i)+o,n=i+t.length,i=e.indexOf(t,n);while(~i);return r+e.substring(n)},dn=(e=im)=>{let t=e?rm:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};Mi.exports=dn();Mi.exports.createColors=dn});var Vi=Fe((bh,Kn)=>{"use strict";var Ji={to(e,t){return t?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`},move(e,t){let o="";return e<0?o+=`\x1B[${-e}D`:e>0&&(o+=`\x1B[${e}C`),t<0?o+=`\x1B[${-t}A`:t>0&&(o+=`\x1B[${t}B`),o},up:(e=1)=>`\x1B[${e}A`,down:(e=1)=>`\x1B[${e}B`,forward:(e=1)=>`\x1B[${e}C`,backward:(e=1)=>`\x1B[${e}D`,nextLine:(e=1)=>"\x1B[E".repeat(e),prevLine:(e=1)=>"\x1B[F".repeat(e),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},wm={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},vm={screen:"\x1B[2J",up:(e=1)=>"\x1B[1J".repeat(e),down:(e=1)=>"\x1B[J".repeat(e),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(e){let t="";for(let o=0;o<e;o++)t+=this.line+(o<e-1?Ji.up():"");return e&&(t+=Ji.left),t}};Kn.exports={cursor:Ji,scroll:wm,erase:vm,beep:"\x07"}});var Zi,Nn=he(()=>{Zi={name:"resend-cli",version:"2.19.1",description:"The official CLI for Resend",license:"MIT",repository:{type:"git",url:"https://github.com/resend/resend-cli"},homepage:"https://github.com/resend/resend-cli#readme",keywords:["cli","resend","email","api","tanstack-intent"],engines:{node:">=22"},packageManager:"pnpm@11.8.0",files:["dist/cli.cjs","skills/"],type:"module",bin:{resend:"./dist/cli.cjs"},scripts:{dev:"tsx src/cli.ts","dev:watch":"tsx --watch src/cli.ts",build:"node scripts/build.mjs","build:bin":"pnpm build && pkg dist/cli.cjs --config package.json --compress Brotli --target node24 --output dist/resend",lint:"biome check .","lint:fix":"biome check --write .",typecheck:"tsc --noEmit",test:"vitest run","test:e2e":"vitest run --config vitest.config.e2e.ts",prepack:"pnpm install && pnpm build && node scripts/verify-bundle.mjs"},dependencies:{"@clack/prompts":"1.4.0","@commander-js/extra-typings":"14.0.0",commander:"14.0.3",esbuild:"0.28.1","esbuild-wasm":"0.28.0",picocolors:"1.1.1",resend:"6.26.0"},pkg:{scripts:["node_modules/esbuild-wasm/bin/esbuild","node_modules/esbuild-wasm/wasm_exec.js","node_modules/esbuild-wasm/wasm_exec_node.js"],assets:["node_modules/esbuild-wasm/esbuild.wasm"]},devDependencies:{"@biomejs/biome":"2.4.11","@types/node":"24.12.4","@yao-pkg/pkg":"6.20.0",tsx:"4.22.4",typescript:"5.9.3",vitest:"4.1.9"}}});var ne,Mn,vt=he(()=>{"use strict";Nn();ne=Zi.version,Mn=Zi.name});var ts=Fe(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.timingSafeEqual=void 0;function es(e,t=""){if(!e)throw new Error(t)}function up(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),es(e instanceof DataView),es(t instanceof DataView);let o=e.byteLength,i=0,r=-1;for(;++r<o;)i|=e.getUint8(r)^t.getUint8(r);return i===0}Ho.timingSafeEqual=up});var rs=Fe(Ie=>{"use strict";var mp=Ie&&Ie.__extends||(function(){var e=function(t,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var n in r)r.hasOwnProperty(n)&&(i[n]=r[n])},e(t,o)};return function(t,o){e(t,o);function i(){this.constructor=t}t.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)}})();Object.defineProperty(Ie,"__esModule",{value:!0});var le=256,lr=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var o="",i=0;i<t.length-2;i+=3){var r=t[i]<<16|t[i+1]<<8|t[i+2];o+=this._encodeByte(r>>>18&63),o+=this._encodeByte(r>>>12&63),o+=this._encodeByte(r>>>6&63),o+=this._encodeByte(r>>>0&63)}var n=t.length-i;if(n>0){var r=t[i]<<16|(n===2?t[i+1]<<8:0);o+=this._encodeByte(r>>>18&63),o+=this._encodeByte(r>>>12&63),n===2?o+=this._encodeByte(r>>>6&63):o+=this._paddingCharacter||"",o+=this._paddingCharacter||""}return o},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var o=this._getPaddingLength(t),i=t.length-o,r=new Uint8Array(this.maxDecodedLength(i)),n=0,s=0,a=0,l=0,d=0,c=0,m=0;s<i-4;s+=4)l=this._decodeChar(t.charCodeAt(s+0)),d=this._decodeChar(t.charCodeAt(s+1)),c=this._decodeChar(t.charCodeAt(s+2)),m=this._decodeChar(t.charCodeAt(s+3)),r[n++]=l<<2|d>>>4,r[n++]=d<<4|c>>>2,r[n++]=c<<6|m,a|=l&le,a|=d&le,a|=c&le,a|=m≤if(s<i-1&&(l=this._decodeChar(t.charCodeAt(s)),d=this._decodeChar(t.charCodeAt(s+1)),r[n++]=l<<2|d>>>4,a|=l&le,a|=d&le),s<i-2&&(c=this._decodeChar(t.charCodeAt(s+2)),r[n++]=d<<4|c>>>2,a|=c&le),s<i-3&&(m=this._decodeChar(t.charCodeAt(s+3)),r[n++]=c<<6|m,a|=m&le),a!==0)throw new Error("Base64Coder: incorrect characters for decoding");return r},e.prototype._encodeByte=function(t){var o=t;return o+=65,o+=25-t>>>8&6,o+=51-t>>>8&-75,o+=61-t>>>8&-15,o+=62-t>>>8&3,String.fromCharCode(o)},e.prototype._decodeChar=function(t){var o=le;return o+=(42-t&t-44)>>>8&-le+t-43+62,o+=(46-t&t-48)>>>8&-le+t-47+63,o+=(47-t&t-58)>>>8&-le+t-48+52,o+=(64-t&t-91)>>>8&-le+t-65+0,o+=(96-t&t-123)>>>8&-le+t-97+26,o},e.prototype._getPaddingLength=function(t){var o=0;if(this._paddingCharacter){for(var i=t.length-1;i>=0&&t[i]===this._paddingCharacter;i--)o++;if(t.length<4||o>2)throw new Error("Base64Coder: incorrect padding")}return o},e})();Ie.Coder=lr;var co=new lr;function pp(e){return co.encode(e)}Ie.encode=pp;function fp(e){return co.decode(e)}Ie.decode=fp;var os=(function(e){mp(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(o){var i=o;return i+=65,i+=25-o>>>8&6,i+=51-o>>>8&-75,i+=61-o>>>8&-13,i+=62-o>>>8&49,String.fromCharCode(i)},t.prototype._decodeChar=function(o){var i=le;return i+=(44-o&o-46)>>>8&-le+o-45+62,i+=(94-o&o-96)>>>8&-le+o-95+63,i+=(47-o&o-58)>>>8&-le+o-48+52,i+=(64-o&o-91)>>>8&-le+o-65+0,i+=(96-o&o-123)>>>8&-le+o-97+26,i},t})(lr);Ie.URLSafeCoder=os;var is=new os;function gp(e){return is.encode(e)}Ie.encodeURLSafe=gp;function hp(e){return is.decode(e)}Ie.decodeURLSafe=hp;Ie.encodedLength=function(e){return co.encodedLength(e)};Ie.maxDecodedLength=function(e){return co.maxDecodedLength(e)};Ie.decodedLength=function(e){return co.decodedLength(e)}});var ss=Fe((ns,Qo)=>{(function(e,t){var o={};t(o);var i=o.default;for(var r in o)i[r]=o[r];typeof Qo=="object"&&typeof Qo.exports=="object"?Qo.exports=i:typeof define=="function"&&define.amd?define(function(){return i}):e.sha256=i})(ns,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function o(m,f,b,h,A){for(var U,v,S,K,x,D,I,G,E,N,Ce,ie,Ut;A>=64;){for(U=f[0],v=f[1],S=f[2],K=f[3],x=f[4],D=f[5],I=f[6],G=f[7],N=0;N<16;N++)Ce=h+N*4,m[N]=(b[Ce]&255)<<24|(b[Ce+1]&255)<<16|(b[Ce+2]&255)<<8|b[Ce+3]&255;for(N=16;N<64;N++)E=m[N-2],ie=(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10,E=m[N-15],Ut=(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3,m[N]=(ie+m[N-7]|0)+(Ut+m[N-16]|0);for(N=0;N<64;N++)ie=(((x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7))+(x&D^~x&I)|0)+(G+(t[N]+m[N]|0)|0)|0,Ut=((U>>>2|U<<30)^(U>>>13|U<<19)^(U>>>22|U<<10))+(U&v^U&S^v&S)|0,G=I,I=D,D=x,x=K+ie|0,K=S,S=v,v=U,U=ie+Ut|0;f[0]+=U,f[1]+=v,f[2]+=S,f[3]+=K,f[4]+=x,f[5]+=D,f[6]+=I,f[7]+=G,h+=64,A-=64}return h}var i=(function(){function m(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return m.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},m.prototype.clean=function(){for(var f=0;f<this.buffer.length;f++)this.buffer[f]=0;for(var f=0;f<this.temp.length;f++)this.temp[f]=0;this.reset()},m.prototype.update=function(f,b){if(b===void 0&&(b=f.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var h=0;if(this.bytesHashed+=b,this.bufferLength>0){for(;this.bufferLength<64&&b>0;)this.buffer[this.bufferLength++]=f[h++],b--;this.bufferLength===64&&(o(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(b>=64&&(h=o(this.temp,this.state,f,h,b),b%=64);b>0;)this.buffer[this.bufferLength++]=f[h++],b--;return this},m.prototype.finish=function(f){if(!this.finished){var b=this.bytesHashed,h=this.bufferLength,A=b/536870912|0,U=b<<3,v=b%64<56?64:128;this.buffer[h]=128;for(var S=h+1;S<v-8;S++)this.buffer[S]=0;this.buffer[v-8]=A>>>24&255,this.buffer[v-7]=A>>>16&255,this.buffer[v-6]=A>>>8&255,this.buffer[v-5]=A>>>0&255,this.buffer[v-4]=U>>>24&255,this.buffer[v-3]=U>>>16&255,this.buffer[v-2]=U>>>8&255,this.buffer[v-1]=U>>>0&255,o(this.temp,this.state,this.buffer,0,v),this.finished=!0}for(var S=0;S<8;S++)f[S*4+0]=this.state[S]>>>24&255,f[S*4+1]=this.state[S]>>>16&255,f[S*4+2]=this.state[S]>>>8&255,f[S*4+3]=this.state[S]>>>0&255;return this},m.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},m.prototype._saveState=function(f){for(var b=0;b<this.state.length;b++)f[b]=this.state[b]},m.prototype._restoreState=function(f,b){for(var h=0;h<this.state.length;h++)this.state[h]=f[h];this.bytesHashed=b,this.finished=!1,this.bufferLength=0},m})();e.Hash=i;var r=(function(){function m(f){this.inner=new i,this.outer=new i,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var b=new Uint8Array(this.blockSize);if(f.length>this.blockSize)new i().update(f).finish(b).clean();else for(var h=0;h<f.length;h++)b[h]=f[h];for(var h=0;h<b.length;h++)b[h]^=54;this.inner.update(b);for(var h=0;h<b.length;h++)b[h]^=106;this.outer.update(b),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var h=0;h<b.length;h++)b[h]=0}return m.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},m.prototype.clean=function(){for(var f=0;f<this.istate.length;f++)this.ostate[f]=this.istate[f]=0;this.inner.clean(),this.outer.clean()},m.prototype.update=function(f){return this.inner.update(f),this},m.prototype.finish=function(f){return this.outer.finished?this.outer.finish(f):(this.inner.finish(f),this.outer.update(f,this.digestLength).finish(f)),this},m.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},m})();e.HMAC=r;function n(m){var f=new i().update(m),b=f.digest();return f.clean(),b}e.hash=n,e.default=n;function s(m,f){var b=new r(m).update(f),h=b.digest();return b.clean(),h}e.hmac=s;function a(m,f,b,h){var A=h[0];if(A===0)throw new Error("hkdf: cannot expand more");f.reset(),A>1&&f.update(m),b&&f.update(b),f.update(h),f.finish(m),h[0]++}var l=new Uint8Array(e.digestLength);function d(m,f,b,h){f===void 0&&(f=l),h===void 0&&(h=32);for(var A=new Uint8Array([1]),U=s(f,m),v=new r(U),S=new Uint8Array(v.digestLength),K=S.length,x=new Uint8Array(h),D=0;D<h;D++)K===S.length&&(a(S,v,b,A),K=0),x[D]=S[K++];return v.clean(),S.fill(0),A.fill(0),x}e.hkdf=d;function c(m,f,b,h){for(var A=new r(m),U=A.digestLength,v=new Uint8Array(4),S=new Uint8Array(U),K=new Uint8Array(U),x=new Uint8Array(h),D=0;D*U<h;D++){var I=D+1;v[0]=I>>>24&255,v[1]=I>>>16&255,v[2]=I>>>8&255,v[3]=I>>>0&255,A.reset(),A.update(f),A.update(v),A.finish(K);for(var G=0;G<U;G++)S[G]=K[G];for(var G=2;G<=b;G++){A.reset(),A.update(K).finish(K);for(var E=0;E<U;E++)S[E]^=K[E]}for(var G=0;G<U&&D*U+G<h;G++)x[D*U+G]=S[G]}for(var D=0;D<U;D++)S[D]=K[D]=0;for(var D=0;D<4;D++)v[D]=0;return A.clean(),x}e.pbkdf2=c})});var cs=Fe(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.Webhook=Tt.WebhookVerificationError=void 0;var Ap=ts(),as=rs(),bp=ss(),ls=300,cr=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},ut=class e extends cr{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};Tt.WebhookVerificationError=ut;var No=class e{constructor(t,o){if(!t)throw new Error("Secret can't be empty.");if(o?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,i=>i.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=as.decode(t)}}verify(t,o){let i={};for(let f of Object.keys(o))i[f.toLowerCase()]=o[f];let r=i["webhook-id"],n=i["webhook-signature"],s=i["webhook-timestamp"];if(!n||!r||!s)throw new ut("Missing required headers");let a=this.verifyTimestamp(s),d=this.sign(r,a,t).split(",")[1],c=n.split(" "),m=new globalThis.TextEncoder;for(let f of c){let[b,h]=f.split(",");if(b==="v1"&&(0,Ap.timingSafeEqual)(m.encode(h),m.encode(d)))return JSON.parse(t.toString())}throw new ut("No matching signature found")}sign(t,o,i){if(typeof i!="string")if(i.constructor.name==="Buffer")i=i.toString();else throw new Error("Expected payload to be of type string or Buffer.");let r=new TextEncoder,n=Math.floor(o.getTime()/1e3),s=r.encode(`${t}.${n}.${i}`);return`v1,${as.encode(bp.hmac(this.key,s))}`}verifyTimestamp(t){let o=Math.floor(Date.now()/1e3),i=parseInt(t,10);if(isNaN(i))throw new ut("Invalid Signature Headers");if(o-i>ls)throw new ut("Message timestamp too old");if(i>o+ls)throw new ut("Message timestamp too new");return new Date(i*1e3)}};Tt.Webhook=No;No.prefix="whsec_"});var Mo,Us=he(()=>{"use strict";Mo=class extends Error{constructor(t){super(`Credentials file is corrupted or contains invalid JSON: ${t}
|
|
28
28
|
The file has been preserved for manual inspection.
|
|
29
29
|
To fix: either repair the JSON manually, or delete the file and run: resend login`),this.name="CorruptedCredentialsError"}}});var ur={};eo(ur,{FileBackend:()=>dr});var dr,mr=he(()=>{"use strict";Ae();dr=class{name="plaintext file";isSecure=!1;async get(t,o){let i=ve();if(!i)return null;let r=i.profiles[o];return(r?.type==="api_key"?r.api_key:null)??null}async set(t,o,i){pr(i,o)}async delete(t,o){try{return ws(o),!0}catch{return!1}}async isAvailable(){return!0}}});var Ss={};eo(Ss,{MacOSBackend:()=>gr});function fr(e,t){return new Promise(o=>{(0,vs.execFile)(e,t,{timeout:5e3},(i,r,n)=>{let s=i&&"code"in i?i.code:0;o({stdout:r??"",stderr:n??"",code:s})})})}var vs,gr,Ks=he(()=>{"use strict";vs=require("node:child_process");gr=class{name="macOS Keychain";isSecure=!0;async get(t,o){let{stdout:i,stderr:r,code:n}=await fr("/usr/bin/security",["find-generic-password","-s",t,"-a",o,"-w"]);if(n===44)return null;if(n!==0)throw new Error(`Failed to read from macOS Keychain (exit code ${n}): ${r.trim()}`);return i.trim()||null}async set(t,o,i){let{code:r,stderr:n}=await fr("/usr/bin/security",["add-generic-password","-s",t,"-a",o,"-w",i,"-U"]);if(r!==0)throw new Error(`Failed to store credential in macOS Keychain: ${n.trim()}`)}async delete(t,o){let{code:i}=await fr("/usr/bin/security",["delete-generic-password","-s",t,"-a",o]);return i===0}async isAvailable(){return process.platform==="darwin"}}});var xs={};eo(xs,{LinuxBackend:()=>hr});function qo(e,t,o){return new Promise(i=>{(0,Lo.execFile)(e,t,{timeout:o?.timeout??5e3},(r,n,s)=>{let a=r&&"code"in r?r.code:0;i({stdout:n??"",stderr:s??"",code:a})})})}function nf(e,t,o){return new Promise(i=>{let r=(0,Lo.spawn)(e,t,{stdio:["pipe","ignore","pipe"],timeout:5e3}),n="";r.stderr?.on("data",s=>{n+=s.toString()}),r.on("close",s=>{i({code:s,stderr:n})}),r.on("error",()=>{i({code:1,stderr:"Failed to spawn process"})}),r.stdin?.on("error",()=>{}),r.stdin?.write(o),r.stdin?.end()})}var Lo,hr,ks=he(()=>{"use strict";Lo=require("node:child_process");hr=class{name="Secret Service (libsecret)";isSecure=!0;async get(t,o){let{stdout:i,code:r}=await qo("secret-tool",["lookup","service",t,"account",o]);return r!==0||!i.trim()?null:i.trim()}async set(t,o,i){let{code:r,stderr:n}=await nf("secret-tool",["store",`--label=Resend CLI (${o})`,"service",t,"account",o],i);if(r!==0)throw new Error(`Failed to store credential in Secret Service: ${n.trim()}`)}async delete(t,o){let{code:i}=await qo("secret-tool",["clear","service",t,"account",o]);return i===0}async isAvailable(){if(process.platform!=="linux"||(await qo("which",["secret-tool"])).code!==0)return!1;let o=await qo("secret-tool",["lookup","service","__resend_cli_probe__"],{timeout:3e3});return o.code===0||o.code===1}}});var Fs={};eo(Fs,{WindowsBackend:()=>Ar});function Wo(e){return new Promise(t=>{(0,Jo.execFile)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e],{timeout:1e4},(o,i,r)=>{let n=o&&"code"in o?o.code:0;t({stdout:i??"",stderr:r??"",code:n})})})}function sf(e,t){return new Promise(o=>{let i=(0,Jo.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e],{stdio:["pipe","pipe","pipe"],timeout:1e4}),r="",n="";i.stdout?.on("data",s=>{r+=s.toString()}),i.stderr?.on("data",s=>{n+=s.toString()}),i.on("close",s=>{o({stdout:r,stderr:n,code:s})}),i.on("error",()=>{o({stdout:"",stderr:"Failed to spawn process",code:1})}),i.stdin?.on("error",()=>{}),i.stdin?.write(t),i.stdin?.end()})}function mt(e){return e.replace(/'/g,"''")}var Jo,mo,Ar,Rs=he(()=>{"use strict";Jo=require("node:child_process");mo=`
|
|
30
30
|
try { $null = [Windows.Security.Credentials.PasswordVault] } catch {
|
|
@@ -350,7 +350,7 @@ Lifecycle:
|
|
|
350
350
|
5. resend automations runs <id> (inspect runs)
|
|
351
351
|
6. resend automations open <id> (view in dashboard)`,examples:["resend automations list",'resend automations create --name "Welcome Flow" --file workflow.json',"resend automations get <id>","resend automations update <id> --status enabled","resend automations duplicate <id>","resend automations stop <id>","resend automations delete <id> --yes","resend automations runs <automation-id>","resend automations runs get --automation-id <id> --run-id <id>","resend automations open <id>"]})).addCommand(ka).addCommand(Da).addCommand(Ea,{isDefault:!0}).addCommand(Pa).addCommand(Ra).addCommand(_a).addCommand(ja).addCommand(Ba).addCommand(Ia);function Dr(e){switch(e){case"draft":return"\u25CB Draft";case"queued":return"\u23F3 Queued";case"scheduled":return"\u{1F4C5} Scheduled";case"sent":return"\u2713 Sent";default:return e}}var Xe={resource:"broadcast",resourcePlural:"broadcasts",fetchItems:(e,{limit:t,after:o})=>e.broadcasts.list({limit:t,...o&&{after:o}}),display:e=>({label:e.name??"(untitled)",hint:e.id})};function Ga(e){return{resource:"broadcast",resourcePlural:"broadcasts",fetchItems:(t,{limit:o,after:i})=>t.broadcasts.list({limit:o,...i&&{after:i}}),display:t=>({label:t.name??"(untitled)",hint:`${Dr(t.status)} ${t.id}`}),filter:e}}var Ha=Ga(e=>e.status==="draft"),Qa=Ga(e=>e.status==="queued"||e.status==="scheduled");function Na(e){let t=e.map(o=>[o.name??"(untitled)",o.status,o.created_at,o.id]);return _(["Name","Status","Created","ID"],t,"(no broadcasts)")}function Ma(e){let t=e.map(o=>[o.email,o.contact_id??"-",o.count!==void 0&&o.count!==null?String(o.count):"-",o.bounce_type??"-",o.clicked_links&&o.clicked_links.length>0?o.clicked_links.map(i=>`${i.url} (${i.clicks})`).join(", "):"-",o.id]);return _(["Email","Contact ID","Count","Bounce Type","Clicked Links","ID"],t,"(no recipients)")}function qa(e){let t=e.map(o=>[o.url,String(o.clicks),String(o.unique_clicks)]);return _(["URL","Clicks","Unique Clicks"],t,"(no clicked links)")}var La=new u("cancel").description("Cancel a queued or scheduled broadcast").argument("[id]","Broadcast ID").addHelpText("after",p({context:`Only queued or scheduled broadcasts can be cancelled; draft and sent broadcasts cannot.
|
|
352
352
|
Cancelling a scheduled broadcast stops the scheduled delivery. Cancelling a queued
|
|
353
|
-
broadcast stops it mid-send \u2014 emails already sent are not affected.`,output:' {"object":"broadcast","id":"<id>"}',errorCodes:["auth_error","cancel_error"],examples:["resend broadcasts cancel d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6","resend broadcasts cancel d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --json"]})).action(async(e,t,o)=>{let i=o.optsWithGlobals(),r=await C(e,Qa,i);await B({loading:"Cancelling broadcast...",sdkCall:n=>n.broadcasts.cancel(r),errorCode:"cancel_error",successMsg:"Broadcast cancelled"},i)});var Wa=new u("clicked-links").description("List the links clicked in a broadcast, ranked by total clicks").argument("[id]","Broadcast ID").option("--limit <n>","Maximum number of results to return (1-100)","10").option("--after <cursor>","Cursor for forward pagination \u2014 list items after this ID").option("--before <cursor>","Cursor for backward pagination \u2014 list items before this ID").addHelpText("after",p({output:' {"object":"list","has_more":false,"data":[{"id":"...","url":"...","clicks":42,"unique_clicks":30}]}',errorCodes:["auth_error","invalid_limit","invalid_pagination","list_error"],examples:["resend broadcasts clicked-links d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6","resend broadcasts clicked-links d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --limit 5","resend broadcasts clicked-links d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --after b2Zmc2V0OjA","resend broadcasts clicked-links d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --json"]})).action(async(e,t,o)=>{let i=o.optsWithGlobals(),r=await C(e,Xe,i),n=O(t.limit,i),s=$(n,t.after,t.before,i);await F({loading:"Fetching clicked links...",sdkCall:a=>a.broadcasts.clickedLinks(r,s),onInteractive:a=>{console.log(qa(a.data)),T(a,`broadcasts clicked-links ${r}`,{limit:n,before:t.before,apiKey:i.apiKey,profile:i.profile})}},i)});async function di(e){try{let{data:t,error:o}=await e.domains.list();return o||!t?[]:t.data.filter(i=>i.status==="verified"&&i.capabilities.sending==="enabled").map(i=>i.name)}catch{return[]}}var Qf=["
|
|
353
|
+
broadcast stops it mid-send \u2014 emails already sent are not affected.`,output:' {"object":"broadcast","id":"<id>"}',errorCodes:["auth_error","cancel_error"],examples:["resend broadcasts cancel d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6","resend broadcasts cancel d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --json"]})).action(async(e,t,o)=>{let i=o.optsWithGlobals(),r=await C(e,Qa,i);await B({loading:"Cancelling broadcast...",sdkCall:n=>n.broadcasts.cancel(r),errorCode:"cancel_error",successMsg:"Broadcast cancelled"},i)});var Wa=new u("clicked-links").description("List the links clicked in a broadcast, ranked by total clicks").argument("[id]","Broadcast ID").option("--limit <n>","Maximum number of results to return (1-100)","10").option("--after <cursor>","Cursor for forward pagination \u2014 list items after this ID").option("--before <cursor>","Cursor for backward pagination \u2014 list items before this ID").addHelpText("after",p({output:' {"object":"list","has_more":false,"data":[{"id":"...","url":"...","clicks":42,"unique_clicks":30}]}',errorCodes:["auth_error","invalid_limit","invalid_pagination","list_error"],examples:["resend broadcasts clicked-links d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6","resend broadcasts clicked-links d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --limit 5","resend broadcasts clicked-links d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --after b2Zmc2V0OjA","resend broadcasts clicked-links d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --json"]})).action(async(e,t,o)=>{let i=o.optsWithGlobals(),r=await C(e,Xe,i),n=O(t.limit,i),s=$(n,t.after,t.before,i);await F({loading:"Fetching clicked links...",sdkCall:a=>a.broadcasts.clickedLinks(r,s),onInteractive:a=>{console.log(qa(a.data)),T(a,`broadcasts clicked-links ${r}`,{limit:n,before:t.before,apiKey:i.apiKey,profile:i.profile})}},i)});async function di(e){try{let{data:t,error:o}=await e.domains.list();return o||!t?[]:t.data.filter(i=>i.status==="verified"&&i.capabilities.sending==="enabled").map(i=>i.name)}catch{return[]}}var Qf=["hello","support"];async function ui(e){let t;if(e.length===1)t=e[0];else{let r=await re({message:"Select a verified domain",options:e.map(n=>({value:n,label:n}))});k(r)&&R("Send cancelled."),t=r}let o=Qf.map(r=>({value:`${r}@${t}`,label:`${r}@${t}`}));o.push({value:null,label:"Custom address..."});let i=await re({message:`From address (@${t})`,options:o});if(k(i)&&R("Send cancelled."),i===null){let r=await z({message:"From address",placeholder:`e.g. you@${t}`,validate:n=>n?.includes("@")?void 0:"Enter a valid email address"});return k(r)&&R("Send cancelled."),r}return i}var Mt=require("node:fs"),il=require("node:path");var mi=require("node:fs"),Za=require("node:os"),Nt=ue(require("node:path"),1);function Ja(){return"pkg"in process?require("esbuild-wasm"):require("esbuild")}var za=require("node:fs"),Ya=ue(require("node:path"),1);function Va(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Xa=e=>({name:"rendering-utilities-exporter",setup:t=>{t.onLoad({filter:new RegExp(e.map(o=>Va(o)).join("|"))},async({path:o})=>({contents:`${await za.promises.readFile(o,"utf8")};
|
|
354
354
|
export { render } from 'react-email-module-that-will-export-render'
|
|
355
355
|
export { createElement as reactEmailCreateReactElement } from 'react';
|
|
356
356
|
`,loader:Ya.default.extname(o).slice(1)})),t.onResolve({filter:/^react-email-module-that-will-export-render$/},async o=>{let i={kind:"import-statement",importer:o.importer,resolveDir:o.resolveDir,namespace:o.namespace},r=await t.resolve("react-email",i);return r.errors.length===0||(r=await t.resolve("@react-email/components",i),r.errors.length===0)||(r=await t.resolve("@react-email/render",i),r.errors.length>0&&r.errors[0]&&(r.errors[0].text="Failed to import `render` from `react-email` (6.0+), `@react-email/components` (5.x), or `@react-email/render`. Install one of them in your project.")),r})}});async function el(e){let t=Nt.default.resolve(e),o=(0,mi.mkdtempSync)(Nt.default.join((0,Za.tmpdir)(),"resend-react-email-"));try{let{build:n}=Ja();await n({bundle:!0,entryPoints:[t],format:"cjs",jsx:"automatic",logLevel:"silent",outExtension:{".js":".cjs"},outdir:o,platform:"node",plugins:[Xa([t])],write:!0})}catch(n){throw(0,mi.rmSync)(o,{recursive:!0,force:!0}),n}let i=Nt.default.basename(t,Nt.default.extname(t));return{cjsPath:Nt.default.join(o,`${i}.cjs`),tmpDir:o}}var tl=require("node:module");async function ol(e){let t=(0,tl.createRequire)(e);delete t.cache[e];let o=t(e);return o.render(o.reactEmailCreateReactElement(o.default,{}),{})}var Er=e=>{e&&(0,Mt.rmSync)(e,{recursive:!0,force:!0})},Qe=async(e,t)=>{if(e.trim()==="")return g({message:"--react-email path cannot be empty",code:"react_email_build_error"},{json:t.json});let o=(0,il.resolve)(e);if(!(0,Mt.existsSync)(o))return g({message:`File not found: ${e}`,code:"react_email_build_error"},{json:t.json});if(!(0,Mt.statSync)(o).isFile())return g({message:`--react-email path must be a file, got a directory: ${e}`,code:"react_email_build_error"},{json:t.json});let i=se("Bundling React Email template...",t.quiet),r;try{let n=await el(e);r=n.tmpDir,i.stop("Bundled React Email template");let s=se("Rendering React Email template...",t.quiet);try{let a=await ol(n.cjsPath);return s.stop("Rendered React Email template"),Er(r),a}catch(a){return s.fail("Failed to render React Email template"),Er(r),g({message:q(a,"Failed to render React Email template"),code:"react_email_render_error"},{json:t.json})}}catch(n){return i.fail("Failed to bundle React Email template"),Er(r),g({message:q(n,"Failed to bundle React Email template"),code:"react_email_build_error"},{json:t.json})}};V();var De={resource:"segment",resourcePlural:"segments",fetchItems:(e,{limit:t,after:o})=>e.segments.list({limit:t,...o&&{after:o}}),display:e=>({label:e.name,hint:e.id})};function pi(e){let t=e.map(o=>[o.name,o.id,o.created_at]);return _(["Name","ID","Created"],t,"(no segments)")}var At={resource:"topic",resourcePlural:"topics",fetchItems:e=>e.topics.list().then(t=>({...t,data:t.data?{data:t.data.data,has_more:!1}:null})),display:e=>({label:e.name,hint:e.id})};function rl(e){let t=e.map(o=>[o.name,o.description??"",o.id,o.created_at]);return _(["Name","Description","ID","Created"],t,"(no topics)")}var nl=new u("create").description("Create a broadcast draft (or send immediately with --send)").option("--from <address>","Sender address \u2014 required").option("--subject <subject>","Email subject \u2014 required").option("--segment-id <id>","Target segment ID \u2014 required").option("--html <html>","HTML body (supports {{{FIRST_NAME|fallback}}} triple-brace variable interpolation)").option("--html-file <path>",'Path to an HTML file for the body (use "-" for stdin, supports {{{FIRST_NAME|fallback}}} variable interpolation)').option("--text <text>","Plain-text body").option("--text-file <path>",'Path to a plain-text file for the body (use "-" for stdin)').option("--react-email <path>","Path to a React Email template (.tsx) to bundle, render, and use as HTML body").option("--name <name>","Internal label for the broadcast (optional)").option("--reply-to <address>","Reply-to address (optional)").option("--preview-text <text>","Preview text shown in inbox below the subject line (optional)").option("--topic-id <id>","Associate with a topic for subscription filtering (optional)").option("--send","Send immediately on create instead of saving as draft").option("--scheduled-at <datetime>",'Schedule delivery \u2014 ISO 8601 or natural language e.g. "in 1 hour", "tomorrow at 9am ET" (only valid with --send)').option("--dry-run","Validate input and print the create request JSON without calling the API (interactive: type segment/topic IDs; lists are not fetched)").addHelpText("after",p({context:`Non-interactive: --from, --subject, and --segment-id are required.
|