resend-cli 2.3.0 → 2.5.0
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/dist/cli.cjs +313 -297
- package/package.json +2 -2
- package/skills/resend-cli/SKILL.md +18 -10
- package/skills/resend-cli/references/auth.md +2 -0
- package/skills/resend-cli/references/domains.md +40 -0
- package/skills/resend-cli/references/emails.md +2 -0
- package/skills/resend-cli/references/error-codes.md +2 -2
- package/skills/resend-cli/references/workflows.md +12 -10
package/dist/cli.cjs
CHANGED
|
@@ -1,166 +1,165 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
3
|
-
`)}displayWidth(
|
|
4
|
-
`+" ".repeat(r+
|
|
5
|
-
${s}`)}boxWrap(
|
|
6
|
-
`)}};function
|
|
2
|
+
"use strict";var Yc=Object.create;var an=Object.defineProperty;var Qc=Object.getOwnPropertyDescriptor;var Xc=Object.getOwnPropertyNames;var Zc=Object.getPrototypeOf,eu=Object.prototype.hasOwnProperty;var xe=(t,e)=>()=>(t&&(e=t(t=0)),e);var Ae=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Vt=(t,e)=>{for(var r in e)an(t,r,{get:e[r],enumerable:!0})},tu=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Xc(e))!eu.call(t,i)&&i!==r&&an(t,i,{get:()=>e[i],enumerable:!(n=Qc(e,i))||n.enumerable});return t};var pe=(t,e,r)=>(r=t!=null?Yc(Zc(t)):{},tu(e||!t||!t.__esModule?an(r,"default",{value:t,enumerable:!0}):r,t));var Kt=Ae(cn=>{var mr=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},ln=class extends mr{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};cn.CommanderError=mr;cn.InvalidArgumentError=ln});var pr=Ae(dn=>{var{InvalidArgumentError:ru}=Kt(),un=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new ru(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function nu(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}dn.Argument=un;dn.humanReadableArgName=nu});var fn=Ae(pn=>{var{humanReadableArgName:iu}=pr(),mn=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>iu(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,r,n){return r.length===0?[]:[n.styleTitle(e),...r,""]}groupItems(e,r,n){let i=new Map;return e.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[])}),r.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function o(u,m){return r.formatItem(u,n,m,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let l=r.visibleArguments(e).map(u=>o(r.styleArgumentTerm(r.argumentTerm(u)),r.styleArgumentDescription(r.argumentDescription(u))));if(s=s.concat(this.formatItemList("Arguments:",l,r)),this.groupItems(e.options,r.visibleOptions(e),u=>u.helpGroupHeading??"Options:").forEach((u,m)=>{let y=u.map(g=>o(r.styleOptionTerm(r.optionTerm(g)),r.styleOptionDescription(r.optionDescription(g))));s=s.concat(this.formatItemList(m,y,r))}),r.showGlobalOptions){let u=r.visibleGlobalOptions(e).map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList("Global Options:",u,r))}return this.groupItems(e.commands,r.visibleCommands(e),u=>u.helpGroup()||"Commands:").forEach((u,m)=>{let y=u.map(g=>o(r.styleSubcommandTerm(r.subcommandTerm(g)),r.styleSubcommandDescription(r.subcommandDescription(g))));s=s.concat(this.formatItemList(m,y,r))}),s.join(`
|
|
3
|
+
`)}displayWidth(e){return xi(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,i){let s=" ".repeat(2);if(!n)return s+e;let a=e.padEnd(r+e.length-i.displayWidth(e)),l=2,c=(this.helpWidth??80)-r-l-2,u;return c<this.minWidthToWrap||i.preformatted(n)?u=n:u=i.boxWrap(n,c).replace(/\n/g,`
|
|
4
|
+
`+" ".repeat(r+l)),s+a+" ".repeat(l)+u.replace(/\n/g,`
|
|
5
|
+
${s}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,o=[];return n.forEach(s=>{let a=s.match(i);if(a===null){o.push("");return}let l=[a.shift()],d=this.displayWidth(l[0]);a.forEach(c=>{let u=this.displayWidth(c);if(d+u<=r){l.push(c),d+=u;return}o.push(l.join(""));let m=c.trimStart();l=[m],d=this.displayWidth(m)}),o.push(l.join(""))}),o.join(`
|
|
6
|
+
`)}};function xi(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}pn.Help=mn;pn.stripColor=xi});var yn=Ae(bn=>{var{InvalidArgumentError:ou}=Kt(),hn=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=su(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new ou(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Ai(this.name().replace(/^no-/,"")):Ai(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},gn=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function Ai(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function su(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(r=o.shift()),!e&&n.test(o[0])&&(e=o.shift()),!e&&i.test(o[0])&&(e=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
|
|
7
7
|
- a short flag is a single dash and a single character
|
|
8
8
|
- either use a single dash and a single character (for a short flag)
|
|
9
|
-
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):
|
|
10
|
-
- too many short flags`):
|
|
9
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a}
|
|
10
|
+
- too many short flags`):i.test(s)?new Error(`${a}
|
|
11
11
|
- too many long flags`):new Error(`${a}
|
|
12
|
-
- unrecognised flag format`)}if(
|
|
13
|
-
(Did you mean one of ${
|
|
14
|
-
(Did you mean ${
|
|
15
|
-
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=
|
|
16
|
-
Expecting one of '${
|
|
17
|
-
- already used by option '${r.flags}'`)}this._initOptionGroup(
|
|
18
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(
|
|
19
|
-
- if '${
|
|
12
|
+
- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}bn.Option=hn;bn.DualOptions=gn});var $i=Ae(ki=>{function au(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function lu(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=au(t,s),l=Math.max(t.length,s.length);(l-a)/l>o&&(a<i?(i=a,n=[s]):a===i&&n.push(s))}),n.sort((s,a)=>s.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?`
|
|
13
|
+
(Did you mean one of ${n.join(", ")}?)`:n.length===1?`
|
|
14
|
+
(Did you mean ${n[0]}?)`:""}ki.suggestSimilar=lu});var Ti=Ae(xn=>{var cu=require("node:events").EventEmitter,vn=require("node:child_process"),Je=require("node:path"),fr=require("node:fs"),W=require("node:process"),{Argument:uu,humanReadableArgName:du}=pr(),{CommanderError:Cn}=Kt(),{Help:mu,stripColor:pu}=fn(),{Option:Ei,DualOptions:fu}=yn(),{suggestSimilar:Di}=$i(),wn=class t extends cu{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>W.stdout.write(r),writeErr:r=>W.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>W.stdout.isTTY?W.stdout.columns:void 0,getErrHelpWidth:()=>W.stderr.isTTY?W.stderr.columns:void 0,getOutHasColors:()=>_n()??(W.stdout.isTTY&&W.stdout.hasColors?.()),getErrHasColors:()=>_n()??(W.stderr.isTTY&&W.stderr.hasColors?.()),stripColor:r=>pu(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),l=this.createCommand(s);return i&&(l.description(i),l._executableHandler=!0),o.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(o.noHelp||o.hidden),l._executableFile=o.executableFile||null,a&&l.arguments(a),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),i?this:l}createCommand(e){return new t(e)}createHelp(){return Object.assign(new mu,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
15
|
+
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new uu(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=e??"help [command]",[,i,o]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
|
|
16
|
+
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new Cn(e,r,n)),W.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new Ei(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
17
|
+
- already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let l=this.getOptionValue(n);o!==null&&e.parseArg?o=this._callParseArg(e,o,l,s):o!==null&&e.variadic&&(o=e._collectValue(o,l)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,r,n,i,o){if(typeof r=="object"&&r instanceof Ei)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(l,d)=>{let c=a.exec(l);return c?c[0]:d},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){W.versions?.electron&&(r.from="electron");let i=W.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=W.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":W.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
18
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,r,n){if(fr.existsSync(e))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
|
|
19
|
+
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
20
20
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
21
|
-
- ${
|
|
21
|
+
- ${i}`;throw new Error(o)}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(c,u){let m=Je.resolve(c,u);if(fr.existsSync(m))return m;if(i.includes(Je.extname(u)))return;let y=i.find(g=>fr.existsSync(`${m}${g}`));if(y)return`${m}${y}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let c;try{c=fr.realpathSync(this._scriptPath)}catch{c=this._scriptPath}a=Je.resolve(Je.dirname(c),a)}if(a){let c=o(a,s);if(!c&&!e._executableFile&&this._scriptPath){let u=Je.basename(this._scriptPath,Je.extname(this._scriptPath));u!==this._name&&(c=o(a,`${u}-${e._name}`))}s=c||s}n=i.includes(Je.extname(s));let l;W.platform!=="win32"?n?(r.unshift(s),r=Si(W.execArgv).concat(r),l=vn.spawn(W.argv[0],r,{stdio:"inherit"})):l=vn.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,e._name),r.unshift(s),r=Si(W.execArgv).concat(r),l=vn.spawn(W.execPath,r,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(u=>{W.on(u,()=>{l.killed===!1&&l.exitCode===null&&l.kill(u)})});let d=this._exitCallback;l.on("close",c=>{c=c??1,d?d(new Cn(c,"commander.executeSubCommandAsync","(close)")):W.exit(c)}),l.on("error",c=>{if(c.code==="ENOENT")this._checkForMissingExecutable(s,a,e._name);else if(c.code==="EACCES")throw new Error(`'${s}' not executable`);if(!d)W.exit(1);else{let u=new Cn(1,"commander.executeSubCommandAsync","(error)");u.nestedError=c,d(u)}}),this.runningCommand=l}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,o)=>{let s=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,i,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let o=n.defaultValue;n.variadic?i<this.args.length?(o=this.args.slice(i),n.parseArg&&(o=o.reduce((s,a)=>e(n,a,s),n.defaultValue))):o===void 0&&(o=[]):i<this.args.length&&(o=this.args[i],n.parseArg&&(o=e(n,o,n.defaultValue))),r[i]=o}),this.processedArgs=r}_chainOrCall(e,r){return e?.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),r==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{i=this._chainOrCall(i,()=>o(this,r))}),i}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(o=>n.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],i=r;function o(c){return c.length>1&&c[0]==="-"}let s=c=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(c)?!this._getCommandAndAncestors().some(u=>u.options.map(m=>m.short).some(m=>/^-\d$/.test(m))):!1,a=null,l=null,d=0;for(;d<e.length||l;){let c=l??e[d++];if(l=null,c==="--"){i===n&&i.push(c),i.push(...e.slice(d));break}if(a&&(!o(c)||s(c))){this.emit(`option:${a.name()}`,c);continue}if(a=null,o(c)){let u=this._findOption(c);if(u){if(u.required){let m=e[d++];m===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,m)}else if(u.optional){let m=null;d<e.length&&(!o(e[d])||s(e[d]))&&(m=e[d++]),this.emit(`option:${u.name()}`,m)}else this.emit(`option:${u.name()}`);a=u.variadic?u:null;continue}}if(c.length>2&&c[0]==="-"&&c[1]!=="-"){let u=this._findOption(`-${c[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,c.slice(2)):(this.emit(`option:${u.name()}`),l=`-${c.slice(2)}`);continue}}if(/^--[^=]+=/.test(c)){let u=c.indexOf("="),m=this._findOption(c.slice(0,u));if(m&&(m.required||m.optional)){this.emit(`option:${m.name()}`,c.slice(u+1));continue}}if(i===r&&o(c)&&!(this.commands.length===0&&s(c))&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(c)){r.push(c),n.push(...e.slice(d));break}else if(this._getHelpCommand()&&c===this._getHelpCommand().name()){r.push(c,...e.slice(d));break}else if(this._defaultCommandName){n.push(c,...e.slice(d));break}}if(this._passThroughOptions){i.push(c,...e.slice(d));break}i.push(c)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;n<r;n++){let i=this.options[n].attributeName();e[i]=i===this._versionOptionName?this._version:this[i]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
|
|
22
22
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
23
23
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
24
|
-
`),this.outputHelp({error:!0}));let
|
|
25
|
-
`),this._exit(0,"commander.version",
|
|
26
|
-
Expecting one of '${
|
|
27
|
-
`)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Ic(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,i="127.0.0.1",n="9229",o;return(o=t.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?n=o[3]:i=o[3]):(o=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],i=o[3],n=o[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:t})}function mu(){if(V.env.NO_COLOR||V.env.FORCE_COLOR==="0"||V.env.FORCE_COLOR==="false")return!1;if(V.env.FORCE_COLOR||V.env.CLICOLOR_FORCE!==void 0)return!0}pu.Command=du;pu.useColor=mu});var Rc=f(Ve=>{var{Argument:jc}=ai(),{Command:fu}=$c(),{CommanderError:N0,InvalidArgumentError:Dc}=zr(),{Help:G0}=nu(),{Option:qc}=uu();Ve.program=new fu;Ve.createCommand=e=>new fu(e);Ve.createOption=(e,t)=>new qc(e,t);Ve.createArgument=(e,t)=>new jc(e,t);Ve.Command=fu;Ve.Option=qc;Ve.Argument=jc;Ve.Help=G0;Ve.CommanderError=N0;Ve.InvalidArgumentError=Dc;Ve.InvalidOptionArgumentError=Dc});var zc=f((Le,Mc)=>{var ot=Rc();Le=Mc.exports={};Le.program=new ot.Command;Le.Argument=ot.Argument;Le.Command=ot.Command;Le.CommanderError=ot.CommanderError;Le.Help=ot.Help;Le.InvalidArgumentError=ot.InvalidArgumentError;Le.InvalidOptionArgumentError=ot.InvalidArgumentError;Le.Option=ot.Option;Le.createCommand=e=>new ot.Command(e);Le.createOption=(e,t)=>new ot.Option(e,t);Le.createArgument=(e,t)=>new ot.Argument(e,t)});var yt=f((Nx,hu)=>{var ci=process||{},Hc=ci.argv||[],li=ci.env||{},U0=!(li.NO_COLOR||Hc.includes("--no-color"))&&(!!li.FORCE_COLOR||Hc.includes("--color")||ci.platform==="win32"||(ci.stdout||{}).isTTY&&li.TERM!=="dumb"||!!li.CI),W0=(e,t,r=e)=>i=>{let n=""+i,o=n.indexOf(t,e.length);return~o?e+V0(n,t,r,o)+t:e+n+t},V0=(e,t,r,i)=>{let n="",o=0;do n+=e.substring(o,i)+r,o=i+t.length,i=e.indexOf(t,o);while(~i);return n+e.substring(o)},Bc=(e=U0)=>{let t=e?W0:()=>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")}};hu.exports=Bc();hu.exports.createColors=Bc});var yu=f((Xx,id)=>{"use strict";var vu={to(e,t){return t?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`},move(e,t){let r="";return e<0?r+=`\x1B[${-e}D`:e>0&&(r+=`\x1B[${e}C`),t<0?r+=`\x1B[${-t}A`:t>0&&(r+=`\x1B[${t}B`),r},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"},d2={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},m2={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 r=0;r<e;r++)t+=this.line+(r<e-1?vu.up():"");return e&&(t+=vu.left),t}};id.exports={cursor:vu,scroll:d2,erase:m2,beep:"\x07"}});var ku,_d=De(()=>{ku={name:"resend-cli",version:"2.3.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.2.2",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.0","esbuild-wasm":"0.28.0",picocolors:"1.1.1",resend:"6.12.3"},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.19.0",tsx:"4.22.3",typescript:"5.9.3",vitest:"4.1.7"}}});var se,vd,Mt=De(()=>{"use strict";_d();se=ku.version,vd=ku.name});var wi=f(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.ApplicationInSerializer=void 0;Si.ApplicationInSerializer={_fromJsonObject(e){return{metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid}},_toJsonObject(e){return{metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid}}}});var qu=f(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.ApplicationOutSerializer=void 0;xi.ApplicationOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),id:e.id,metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{createdAt:e.createdAt,id:e.id,metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:e.updatedAt}}}});var Pd=f(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.ApplicationPatchSerializer=void 0;ki.ApplicationPatchSerializer={_fromJsonObject(e){return{metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,uid:e.uid}},_toJsonObject(e){return{metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,uid:e.uid}}}});var Id=f(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.ListResponseApplicationOutSerializer=void 0;var Td=qu();Ai.ListResponseApplicationOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Td.ApplicationOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Td.ApplicationOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Mu=f(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.ApiException=void 0;var Ru=class extends Error{constructor(t,r,i){super(`HTTP-Code: ${t}
|
|
28
|
-
Headers: ${JSON.stringify(i)}`),this.code=t,this.body=r,this.headers={},i.forEach((n,o)=>{this.headers[o]=n})}};Ei.ApiException=Ru});var ie=f(Ye=>{"use strict";var Vr=Ye&&Ye.__awaiter||function(e,t,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{d(i.next(l))}catch(c){s(c)}}function u(l){try{d(i.throw(l))}catch(c){s(c)}}function d(l){l.done?o(l.value):n(l.value).then(a,u)}d((i=i.apply(e,t||[])).next())})};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.SvixRequest=Ye.HttpMethod=Ye.LIB_VERSION=void 0;var zu=Mu();Ye.LIB_VERSION="1.92.2";var B2=`svix-libs/${Ye.LIB_VERSION}/javascript`,L2;(function(e){e.GET="GET",e.HEAD="HEAD",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.CONNECT="CONNECT",e.OPTIONS="OPTIONS",e.TRACE="TRACE",e.PATCH="PATCH"})(L2=Ye.HttpMethod||(Ye.HttpMethod={}));var Ju=class{constructor(t,r){this.method=t,this.path=r,this.queryParams={},this.headerParams={}}setPathParam(t,r){let i=this.path.replace(`{${t}}`,encodeURIComponent(r));if(this.path===i)throw new Error(`path parameter ${t} not found`);this.path=i}setQueryParams(t){for(let[r,i]of Object.entries(t))this.setQueryParam(r,i)}setQueryParam(t,r){if(r!=null)if(typeof r=="string")this.queryParams[t]=r;else if(typeof r=="boolean"||typeof r=="number")this.queryParams[t]=r.toString();else if(r instanceof Date)this.queryParams[t]=r.toISOString();else if(Array.isArray(r))r.length>0&&(this.queryParams[t]=r.join(","));else{let i=r;throw new Error(`query parameter ${t} has unsupported type`)}}setHeaderParam(t,r){r!==void 0&&(this.headerParams[t]=r)}setBody(t){this.body=JSON.stringify(t)}send(t,r){return Vr(this,void 0,void 0,function*(){let i=yield this.sendInner(t);if(i.status===204)return null;let n=yield i.text();return r(JSON.parse(n))})}sendNoResponseBody(t){return Vr(this,void 0,void 0,function*(){yield this.sendInner(t)})}sendInner(t){var r,i;return Vr(this,void 0,void 0,function*(){let n=new URL(t.baseUrl+this.path);for(let[u,d]of Object.entries(this.queryParams))n.searchParams.set(u,d);this.headerParams["idempotency-key"]===void 0&&this.method.toUpperCase()==="POST"&&(this.headerParams["idempotency-key"]=`auto_${crypto.randomUUID()}`);let o=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER);this.body!=null&&(this.headerParams["content-type"]="application/json");let s="credentials"in Request.prototype,a=yield $d(n,{method:this.method.toString(),body:this.body,headers:Object.assign({accept:"application/json, */*;q=0.8",authorization:`Bearer ${t.token}`,"user-agent":B2,"svix-req-id":o.toString()},this.headerParams),credentials:s?"same-origin":void 0,signal:t.timeout!==void 0?AbortSignal.timeout(t.timeout):void 0},t.retryScheduleInMs,(r=t.retryScheduleInMs)===null||r===void 0?void 0:r[0],((i=t.retryScheduleInMs)===null||i===void 0?void 0:i.length)||t.numRetries,t.fetch);return N2(a)})}};Ye.SvixRequest=Ju;function N2(e){return Vr(this,void 0,void 0,function*(){if(e.status<300)return e;let t=yield e.text();throw e.status===422?new zu.ApiException(e.status,JSON.parse(t),e.headers):e.status>=400&&e.status<=499?new zu.ApiException(e.status,JSON.parse(t),e.headers):new zu.ApiException(e.status,t,e.headers)})}function $d(e,t,r,i=50,n=2,o=fetch,s=1){return Vr(this,void 0,void 0,function*(){let a=u=>new Promise(d=>setTimeout(d,u));try{let u=yield o(e,t);if(n<=0||u.status<500)return u}catch(u){if(n<=0)throw u}return yield a(i),t.headers["svix-retry-count"]=s.toString(),i=r?.[s]||i*2,yield $d(e,t,r,i,--n,o,++s)})}});var jd=f(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.Application=void 0;var Fu=wi(),Kr=qu(),G2=Pd(),U2=Id(),Re=ie(),Hu=class{constructor(t){this.requestCtx=t}list(t){let r=new Re.SvixRequest(Re.HttpMethod.GET,"/api/v1/app");return r.setQueryParams({exclude_apps_with_no_endpoints:t?.excludeAppsWithNoEndpoints,exclude_apps_with_disabled_endpoints:t?.excludeAppsWithDisabledEndpoints,exclude_apps_with_svix_play_endpoints:t?.excludeAppsWithSvixPlayEndpoints,limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,U2.ListResponseApplicationOutSerializer._fromJsonObject)}create(t,r){let i=new Re.SvixRequest(Re.HttpMethod.POST,"/api/v1/app");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(Fu.ApplicationInSerializer._toJsonObject(t)),i.send(this.requestCtx,Kr.ApplicationOutSerializer._fromJsonObject)}getOrCreate(t,r){let i=new Re.SvixRequest(Re.HttpMethod.POST,"/api/v1/app");return i.setQueryParam("get_if_exists",!0),i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(Fu.ApplicationInSerializer._toJsonObject(t)),i.send(this.requestCtx,Kr.ApplicationOutSerializer._fromJsonObject)}get(t){let r=new Re.SvixRequest(Re.HttpMethod.GET,"/api/v1/app/{app_id}");return r.setPathParam("app_id",t),r.send(this.requestCtx,Kr.ApplicationOutSerializer._fromJsonObject)}update(t,r){let i=new Re.SvixRequest(Re.HttpMethod.PUT,"/api/v1/app/{app_id}");return i.setPathParam("app_id",t),i.setBody(Fu.ApplicationInSerializer._toJsonObject(r)),i.send(this.requestCtx,Kr.ApplicationOutSerializer._fromJsonObject)}delete(t){let r=new Re.SvixRequest(Re.HttpMethod.DELETE,"/api/v1/app/{app_id}");return r.setPathParam("app_id",t),r.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new Re.SvixRequest(Re.HttpMethod.PATCH,"/api/v1/app/{app_id}");return i.setPathParam("app_id",t),i.setBody(G2.ApplicationPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Kr.ApplicationOutSerializer._fromJsonObject)}};Pi.Application=Hu});var Dd=f(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.ApiTokenOutSerializer=void 0;Ti.ApiTokenOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),expiresAt:e.expiresAt?new Date(e.expiresAt):null,id:e.id,name:e.name,scopes:e.scopes,token:e.token}},_toJsonObject(e){return{createdAt:e.createdAt,expiresAt:e.expiresAt,id:e.id,name:e.name,scopes:e.scopes,token:e.token}}}});var Bu=f(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.AppPortalCapabilitySerializer=Ft.AppPortalCapability=void 0;var W2;(function(e){e.ViewBase="ViewBase",e.ViewEndpointSecret="ViewEndpointSecret",e.ManageEndpointSecret="ManageEndpointSecret",e.ManageTransformations="ManageTransformations",e.CreateAttempts="CreateAttempts",e.ManageEndpoint="ManageEndpoint"})(W2=Ft.AppPortalCapability||(Ft.AppPortalCapability={}));Ft.AppPortalCapabilitySerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Md=f(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.AppPortalAccessInSerializer=void 0;var qd=Bu(),Rd=wi();Ii.AppPortalAccessInSerializer={_fromJsonObject(e){var t;return{application:e.application!=null?Rd.ApplicationInSerializer._fromJsonObject(e.application):void 0,capabilities:(t=e.capabilities)===null||t===void 0?void 0:t.map(r=>qd.AppPortalCapabilitySerializer._fromJsonObject(r)),expiry:e.expiry,featureFlags:e.featureFlags,readOnly:e.readOnly,sessionId:e.sessionId}},_toJsonObject(e){var t;return{application:e.application!=null?Rd.ApplicationInSerializer._toJsonObject(e.application):void 0,capabilities:(t=e.capabilities)===null||t===void 0?void 0:t.map(r=>qd.AppPortalCapabilitySerializer._toJsonObject(r)),expiry:e.expiry,featureFlags:e.featureFlags,readOnly:e.readOnly,sessionId:e.sessionId}}}});var zd=f($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.AppPortalAccessOutSerializer=void 0;$i.AppPortalAccessOutSerializer={_fromJsonObject(e){return{token:e.token,url:e.url}},_toJsonObject(e){return{token:e.token,url:e.url}}}});var Jd=f(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.ApplicationTokenExpireInSerializer=void 0;ji.ApplicationTokenExpireInSerializer={_fromJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}},_toJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}}}});var Fd=f(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.RotatePollerTokenInSerializer=void 0;Di.RotatePollerTokenInSerializer={_fromJsonObject(e){return{expiry:e.expiry,oldTokenExpiry:e.oldTokenExpiry}},_toJsonObject(e){return{expiry:e.expiry,oldTokenExpiry:e.oldTokenExpiry}}}});var Hd=f(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.StreamPortalAccessInSerializer=void 0;qi.StreamPortalAccessInSerializer={_fromJsonObject(e){return{expiry:e.expiry,featureFlags:e.featureFlags,sessionId:e.sessionId}},_toJsonObject(e){return{expiry:e.expiry,featureFlags:e.featureFlags,sessionId:e.sessionId}}}});var Bd=f(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.StreamTokenExpireInSerializer=void 0;Ri.StreamTokenExpireInSerializer={_fromJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}},_toJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}}}});var Lu=f(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.DashboardAccessOutSerializer=void 0;Mi.DashboardAccessOutSerializer={_fromJsonObject(e){return{token:e.token,url:e.url}},_toJsonObject(e){return{token:e.token,url:e.url}}}});var Gd=f(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.Authentication=void 0;var Ld=Dd(),V2=Md(),Nd=zd(),K2=Jd(),Y2=Fd(),Q2=Hd(),Z2=Bd(),X2=Lu(),be=ie(),Nu=class{constructor(t){this.requestCtx=t}appPortalAccess(t,r,i){let n=new be.SvixRequest(be.HttpMethod.POST,"/api/v1/auth/app-portal-access/{app_id}");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(V2.AppPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,Nd.AppPortalAccessOutSerializer._fromJsonObject)}expireAll(t,r,i){let n=new be.SvixRequest(be.HttpMethod.POST,"/api/v1/auth/app/{app_id}/expire-all");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(K2.ApplicationTokenExpireInSerializer._toJsonObject(r)),n.sendNoResponseBody(this.requestCtx)}dashboardAccess(t,r){let i=new be.SvixRequest(be.HttpMethod.POST,"/api/v1/auth/dashboard-access/{app_id}");return i.setPathParam("app_id",t),i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.send(this.requestCtx,X2.DashboardAccessOutSerializer._fromJsonObject)}logout(t){let r=new be.SvixRequest(be.HttpMethod.POST,"/api/v1/auth/logout");return r.setHeaderParam("idempotency-key",t?.idempotencyKey),r.sendNoResponseBody(this.requestCtx)}streamLogout(t){let r=new be.SvixRequest(be.HttpMethod.POST,"/api/v1/auth/stream-logout");return r.setHeaderParam("idempotency-key",t?.idempotencyKey),r.sendNoResponseBody(this.requestCtx)}streamPortalAccess(t,r,i){let n=new be.SvixRequest(be.HttpMethod.POST,"/api/v1/auth/stream-portal-access/{stream_id}");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(Q2.StreamPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,Nd.AppPortalAccessOutSerializer._fromJsonObject)}streamExpireAll(t,r,i){let n=new be.SvixRequest(be.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/expire-all");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(Z2.StreamTokenExpireInSerializer._toJsonObject(r)),n.sendNoResponseBody(this.requestCtx)}getStreamPollerToken(t,r){let i=new be.SvixRequest(be.HttpMethod.GET,"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.send(this.requestCtx,Ld.ApiTokenOutSerializer._fromJsonObject)}rotateStreamPollerToken(t,r,i,n){let o=new be.SvixRequest(be.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token/rotate");return o.setPathParam("stream_id",t),o.setPathParam("sink_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(Y2.RotatePollerTokenInSerializer._toJsonObject(i)),o.send(this.requestCtx,Ld.ApiTokenOutSerializer._fromJsonObject)}};zi.Authentication=Nu});var xt=f(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.BackgroundTaskStatusSerializer=Ht.BackgroundTaskStatus=void 0;var eC;(function(e){e.Running="running",e.Finished="finished",e.Failed="failed"})(eC=Ht.BackgroundTaskStatus||(Ht.BackgroundTaskStatus={}));Ht.BackgroundTaskStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var kt=f(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.BackgroundTaskTypeSerializer=Bt.BackgroundTaskType=void 0;var tC;(function(e){e.EndpointReplay="endpoint.replay",e.EndpointRecover="endpoint.recover",e.ApplicationStats="application.stats",e.MessageBroadcast="message.broadcast",e.SdkGenerate="sdk.generate",e.EventTypeAggregate="event-type.aggregate",e.ApplicationPurgeContent="application.purge_content",e.EndpointBulkReplay="endpoint.bulk-replay"})(tC=Bt.BackgroundTaskType||(Bt.BackgroundTaskType={}));Bt.BackgroundTaskTypeSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Gu=f(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.BackgroundTaskOutSerializer=void 0;var Ud=xt(),Wd=kt();Ji.BackgroundTaskOutSerializer={_fromJsonObject(e){return{data:e.data,id:e.id,status:Ud.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:Wd.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{data:e.data,id:e.id,status:Ud.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:Wd.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var Kd=f(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.ListResponseBackgroundTaskOutSerializer=void 0;var Vd=Gu();Fi.ListResponseBackgroundTaskOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Vd.BackgroundTaskOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Vd.BackgroundTaskOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Yd=f(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.BackgroundTask=void 0;var rC=Gu(),iC=Kd(),Hi=ie(),Uu=class{constructor(t){this.requestCtx=t}list(t){let r=new Hi.SvixRequest(Hi.HttpMethod.GET,"/api/v1/background-task");return r.setQueryParams({status:t?.status,task:t?.task,limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,iC.ListResponseBackgroundTaskOutSerializer._fromJsonObject)}listByEndpoint(t){return this.list(t)}get(t){let r=new Hi.SvixRequest(Hi.HttpMethod.GET,"/api/v1/background-task/{task_id}");return r.setPathParam("task_id",t),r.send(this.requestCtx,rC.BackgroundTaskOutSerializer._fromJsonObject)}};Bi.BackgroundTask=Uu});var lr=f(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.ConnectorKindSerializer=Lt.ConnectorKind=void 0;var nC;(function(e){e.Custom="Custom",e.AgenticCommerceProtocol="AgenticCommerceProtocol",e.CloseCrm="CloseCRM",e.CustomerIo="CustomerIO",e.Discord="Discord",e.Hubspot="Hubspot",e.Inngest="Inngest",e.Loops="Loops",e.Otel="Otel",e.Resend="Resend",e.Salesforce="Salesforce",e.Segment="Segment",e.Sendgrid="Sendgrid",e.Slack="Slack",e.Teams="Teams",e.TriggerDev="TriggerDev",e.Windmill="Windmill",e.Zapier="Zapier"})(nC=Lt.ConnectorKind||(Lt.ConnectorKind={}));Lt.ConnectorKindSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Li=f(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.ConnectorProductSerializer=Nt.ConnectorProduct=void 0;var oC;(function(e){e.Dispatch="Dispatch",e.Stream="Stream"})(oC=Nt.ConnectorProduct||(Nt.ConnectorProduct={}));Nt.ConnectorProductSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Wu=f(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.ConnectorInSerializer=void 0;var Qd=lr(),Zd=Li();Ni.ConnectorInSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?Qd.ConnectorKindSerializer._fromJsonObject(e.kind):void 0,logo:e.logo,name:e.name,productType:e.productType!=null?Zd.ConnectorProductSerializer._fromJsonObject(e.productType):void 0,transformation:e.transformation,uid:e.uid}},_toJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?Qd.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,productType:e.productType!=null?Zd.ConnectorProductSerializer._toJsonObject(e.productType):void 0,transformation:e.transformation,uid:e.uid}}}});var Ui=f(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.ConnectorOutSerializer=void 0;var Xd=lr(),em=Li();Gi.ConnectorOutSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,createdAt:new Date(e.createdAt),description:e.description,featureFlags:e.featureFlags,id:e.id,instructions:e.instructions,kind:Xd.ConnectorKindSerializer._fromJsonObject(e.kind),logo:e.logo,name:e.name,orgId:e.orgId,productType:em.ConnectorProductSerializer._fromJsonObject(e.productType),transformation:e.transformation,transformationUpdatedAt:new Date(e.transformationUpdatedAt),uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,createdAt:e.createdAt,description:e.description,featureFlags:e.featureFlags,id:e.id,instructions:e.instructions,kind:Xd.ConnectorKindSerializer._toJsonObject(e.kind),logo:e.logo,name:e.name,orgId:e.orgId,productType:em.ConnectorProductSerializer._toJsonObject(e.productType),transformation:e.transformation,transformationUpdatedAt:e.transformationUpdatedAt,uid:e.uid,updatedAt:e.updatedAt}}}});var rm=f(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.ConnectorPatchSerializer=void 0;var tm=lr();Wi.ConnectorPatchSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?tm.ConnectorKindSerializer._fromJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}},_toJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?tm.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}}}});var nm=f(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.ConnectorUpdateSerializer=void 0;var im=lr();Vi.ConnectorUpdateSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?im.ConnectorKindSerializer._fromJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}},_toJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?im.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}}}});var sm=f(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.ListResponseConnectorOutSerializer=void 0;var om=Ui();Ki.ListResponseConnectorOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>om.ConnectorOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>om.ConnectorOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var am=f(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.Connector=void 0;var sC=Wu(),Yi=Ui(),aC=rm(),uC=nm(),lC=sm(),Qe=ie(),Vu=class{constructor(t){this.requestCtx=t}list(t){let r=new Qe.SvixRequest(Qe.HttpMethod.GET,"/api/v1/connector");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order,product_type:t?.productType}),r.send(this.requestCtx,lC.ListResponseConnectorOutSerializer._fromJsonObject)}create(t,r){let i=new Qe.SvixRequest(Qe.HttpMethod.POST,"/api/v1/connector");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(sC.ConnectorInSerializer._toJsonObject(t)),i.send(this.requestCtx,Yi.ConnectorOutSerializer._fromJsonObject)}get(t){let r=new Qe.SvixRequest(Qe.HttpMethod.GET,"/api/v1/connector/{connector_id}");return r.setPathParam("connector_id",t),r.send(this.requestCtx,Yi.ConnectorOutSerializer._fromJsonObject)}update(t,r){let i=new Qe.SvixRequest(Qe.HttpMethod.PUT,"/api/v1/connector/{connector_id}");return i.setPathParam("connector_id",t),i.setBody(uC.ConnectorUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,Yi.ConnectorOutSerializer._fromJsonObject)}delete(t){let r=new Qe.SvixRequest(Qe.HttpMethod.DELETE,"/api/v1/connector/{connector_id}");return r.setPathParam("connector_id",t),r.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new Qe.SvixRequest(Qe.HttpMethod.PATCH,"/api/v1/connector/{connector_id}");return i.setPathParam("connector_id",t),i.setBody(aC.ConnectorPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Yi.ConnectorOutSerializer._fromJsonObject)}};Qi.Connector=Vu});var cr=f(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.MessageStatusSerializer=Gt.MessageStatus=void 0;var cC;(function(e){e[e.Success=0]="Success",e[e.Pending=1]="Pending",e[e.Fail=2]="Fail",e[e.Sending=3]="Sending"})(cC=Gt.MessageStatus||(Gt.MessageStatus={}));Gt.MessageStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Ku=f(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.StatusCodeClassSerializer=Ut.StatusCodeClass=void 0;var dC;(function(e){e[e.CodeNone=0]="CodeNone",e[e.Code1xx=100]="Code1xx",e[e.Code2xx=200]="Code2xx",e[e.Code3xx=300]="Code3xx",e[e.Code4xx=400]="Code4xx",e[e.Code5xx=500]="Code5xx"})(dC=Ut.StatusCodeClass||(Ut.StatusCodeClass={}));Ut.StatusCodeClassSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var cm=f(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.BulkReplayInSerializer=void 0;var um=cr(),lm=Ku();Zi.BulkReplayInSerializer={_fromJsonObject(e){return{channel:e.channel,eventTypes:e.eventTypes,since:new Date(e.since),status:e.status!=null?um.MessageStatusSerializer._fromJsonObject(e.status):void 0,statusCodeClass:e.statusCodeClass!=null?lm.StatusCodeClassSerializer._fromJsonObject(e.statusCodeClass):void 0,tag:e.tag,until:e.until?new Date(e.until):null}},_toJsonObject(e){return{channel:e.channel,eventTypes:e.eventTypes,since:e.since,status:e.status!=null?um.MessageStatusSerializer._toJsonObject(e.status):void 0,statusCodeClass:e.statusCodeClass!=null?lm.StatusCodeClassSerializer._toJsonObject(e.statusCodeClass):void 0,tag:e.tag,until:e.until}}}});var dm=f(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.EndpointHeadersInSerializer=void 0;Xi.EndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var Yu=f(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.EndpointHeadersOutSerializer=void 0;en.EndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var mm=f(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.EndpointHeadersPatchInSerializer=void 0;tn.EndpointHeadersPatchInSerializer={_fromJsonObject(e){return{deleteHeaders:e.deleteHeaders,headers:e.headers}},_toJsonObject(e){return{deleteHeaders:e.deleteHeaders,headers:e.headers}}}});var pm=f(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.EndpointInSerializer=void 0;rn.EndpointInSerializer={_fromJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,headers:e.headers,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,headers:e.headers,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}}}});var Qu=f(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.EndpointOutSerializer=void 0;nn.EndpointOutSerializer={_fromJsonObject(e){return{channels:e.channels,createdAt:new Date(e.createdAt),description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:new Date(e.updatedAt),url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,createdAt:e.createdAt,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:e.updatedAt,url:e.url,version:e.version}}}});var fm=f(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.EndpointPatchSerializer=void 0;on.EndpointPatchSerializer={_fromJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}}}});var hm=f(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.EndpointSecretOutSerializer=void 0;sn.EndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Zu=f(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.EndpointSecretRotateInSerializer=void 0;an.EndpointSecretRotateInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var gm=f(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.EndpointStatsSerializer=void 0;un.EndpointStatsSerializer={_fromJsonObject(e){return{fail:e.fail,pending:e.pending,sending:e.sending,success:e.success}},_toJsonObject(e){return{fail:e.fail,pending:e.pending,sending:e.sending,success:e.success}}}});var bm=f(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.EndpointTransformationInSerializer=void 0;ln.EndpointTransformationInSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var _m=f(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.EndpointTransformationOutSerializer=void 0;cn.EndpointTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled,updatedAt:e.updatedAt?new Date(e.updatedAt):null}},_toJsonObject(e){return{code:e.code,enabled:e.enabled,updatedAt:e.updatedAt}}}});var vm=f(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.EndpointTransformationPatchSerializer=void 0;dn.EndpointTransformationPatchSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var ym=f(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.EndpointUpdateSerializer=void 0;mn.EndpointUpdateSerializer={_fromJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}}}});var Cm=f(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.EventExampleInSerializer=void 0;pn.EventExampleInSerializer={_fromJsonObject(e){return{eventType:e.eventType,exampleIndex:e.exampleIndex}},_toJsonObject(e){return{eventType:e.eventType,exampleIndex:e.exampleIndex}}}});var Sm=f(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.ListResponseEndpointOutSerializer=void 0;var Om=Qu();fn.ListResponseEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Om.EndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Om.EndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Yr=f(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.MessageOutSerializer=void 0;hn.MessageOutSerializer={_fromJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,id:e.id,payload:e.payload,tags:e.tags,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,id:e.id,payload:e.payload,tags:e.tags,timestamp:e.timestamp}}}});var wm=f(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.RecoverInSerializer=void 0;gn.RecoverInSerializer={_fromJsonObject(e){return{since:new Date(e.since),until:e.until?new Date(e.until):null}},_toJsonObject(e){return{since:e.since,until:e.until}}}});var Am=f(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.RecoverOutSerializer=void 0;var xm=xt(),km=kt();bn.RecoverOutSerializer={_fromJsonObject(e){return{id:e.id,status:xm.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:km.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:xm.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:km.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var Em=f(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.ReplayInSerializer=void 0;_n.ReplayInSerializer={_fromJsonObject(e){return{since:new Date(e.since),until:e.until?new Date(e.until):null}},_toJsonObject(e){return{since:e.since,until:e.until}}}});var Im=f(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.ReplayOutSerializer=void 0;var Pm=xt(),Tm=kt();vn.ReplayOutSerializer={_fromJsonObject(e){return{id:e.id,status:Pm.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:Tm.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:Pm.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:Tm.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var jm=f(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.Endpoint=void 0;var mC=cm(),pC=dm(),fC=Yu(),hC=mm(),gC=pm(),yn=Qu(),bC=fm(),_C=hm(),vC=Zu(),yC=gm(),CC=bm(),OC=_m(),SC=vm(),wC=ym(),xC=Cm(),kC=Sm(),AC=Yr(),EC=wm(),PC=Am(),TC=Em(),$m=Im(),R=ie(),Xu=class{constructor(t){this.requestCtx=t}list(t,r){let i=new R.SvixRequest(R.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint");return i.setPathParam("app_id",t),i.setQueryParams({limit:r?.limit,iterator:r?.iterator,order:r?.order}),i.send(this.requestCtx,kC.ListResponseEndpointOutSerializer._fromJsonObject)}create(t,r,i){let n=new R.SvixRequest(R.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(gC.EndpointInSerializer._toJsonObject(r)),n.send(this.requestCtx,yn.EndpointOutSerializer._fromJsonObject)}get(t,r){let i=new R.SvixRequest(R.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return i.setPathParam("app_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,yn.EndpointOutSerializer._fromJsonObject)}update(t,r,i){let n=new R.SvixRequest(R.HttpMethod.PUT,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(wC.EndpointUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,yn.EndpointOutSerializer._fromJsonObject)}delete(t,r){let i=new R.SvixRequest(R.HttpMethod.DELETE,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return i.setPathParam("app_id",t),i.setPathParam("endpoint_id",r),i.sendNoResponseBody(this.requestCtx)}patch(t,r,i){let n=new R.SvixRequest(R.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(bC.EndpointPatchSerializer._toJsonObject(i)),n.send(this.requestCtx,yn.EndpointOutSerializer._fromJsonObject)}bulkReplay(t,r,i,n){let o=new R.SvixRequest(R.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/bulk-replay");return o.setPathParam("app_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(mC.BulkReplayInSerializer._toJsonObject(i)),o.send(this.requestCtx,$m.ReplayOutSerializer._fromJsonObject)}getHeaders(t,r){let i=new R.SvixRequest(R.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return i.setPathParam("app_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,fC.EndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(t,r,i){let n=new R.SvixRequest(R.HttpMethod.PUT,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(pC.EndpointHeadersInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}headersUpdate(t,r,i){return this.updateHeaders(t,r,i)}patchHeaders(t,r,i){let n=new R.SvixRequest(R.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(hC.EndpointHeadersPatchInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}headersPatch(t,r,i){return this.patchHeaders(t,r,i)}recover(t,r,i,n){let o=new R.SvixRequest(R.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover");return o.setPathParam("app_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(EC.RecoverInSerializer._toJsonObject(i)),o.send(this.requestCtx,PC.RecoverOutSerializer._fromJsonObject)}replayMissing(t,r,i,n){let o=new R.SvixRequest(R.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing");return o.setPathParam("app_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(TC.ReplayInSerializer._toJsonObject(i)),o.send(this.requestCtx,$m.ReplayOutSerializer._fromJsonObject)}getSecret(t,r){let i=new R.SvixRequest(R.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret");return i.setPathParam("app_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,_C.EndpointSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i,n){let o=new R.SvixRequest(R.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate");return o.setPathParam("app_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(vC.EndpointSecretRotateInSerializer._toJsonObject(i)),o.sendNoResponseBody(this.requestCtx)}sendExample(t,r,i,n){let o=new R.SvixRequest(R.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example");return o.setPathParam("app_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(xC.EventExampleInSerializer._toJsonObject(i)),o.send(this.requestCtx,AC.MessageOutSerializer._fromJsonObject)}getStats(t,r,i){let n=new R.SvixRequest(R.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setQueryParams({since:i?.since,until:i?.until}),n.send(this.requestCtx,yC.EndpointStatsSerializer._fromJsonObject)}transformationGet(t,r){let i=new R.SvixRequest(R.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return i.setPathParam("app_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,OC.EndpointTransformationOutSerializer._fromJsonObject)}patchTransformation(t,r,i){let n=new R.SvixRequest(R.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(SC.EndpointTransformationPatchSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}transformationPartialUpdate(t,r,i){let n=new R.SvixRequest(R.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(CC.EndpointTransformationInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}};Cn.Endpoint=Xu});var el=f(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.EventTypeInSerializer=void 0;On.EventTypeInSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas}}}});var Rm=f(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.EnvironmentInSerializer=void 0;var Dm=Wu(),qm=el();Sn.EnvironmentInSerializer={_fromJsonObject(e){var t,r;return{connectors:(t=e.connectors)===null||t===void 0?void 0:t.map(i=>Dm.ConnectorInSerializer._fromJsonObject(i)),eventTypes:(r=e.eventTypes)===null||r===void 0?void 0:r.map(i=>qm.EventTypeInSerializer._fromJsonObject(i)),settings:e.settings}},_toJsonObject(e){var t,r;return{connectors:(t=e.connectors)===null||t===void 0?void 0:t.map(i=>Dm.ConnectorInSerializer._toJsonObject(i)),eventTypes:(r=e.eventTypes)===null||r===void 0?void 0:r.map(i=>qm.EventTypeInSerializer._toJsonObject(i)),settings:e.settings}}}});var xn=f(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.EventTypeOutSerializer=void 0;wn.EventTypeOutSerializer={_fromJsonObject(e){return{archived:e.archived,createdAt:new Date(e.createdAt),deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{archived:e.archived,createdAt:e.createdAt,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas,updatedAt:e.updatedAt}}}});var Jm=f(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.EnvironmentOutSerializer=void 0;var Mm=Ui(),zm=xn();kn.EnvironmentOutSerializer={_fromJsonObject(e){return{connectors:e.connectors.map(t=>Mm.ConnectorOutSerializer._fromJsonObject(t)),createdAt:new Date(e.createdAt),eventTypes:e.eventTypes.map(t=>zm.EventTypeOutSerializer._fromJsonObject(t)),settings:e.settings,version:e.version}},_toJsonObject(e){return{connectors:e.connectors.map(t=>Mm.ConnectorOutSerializer._toJsonObject(t)),createdAt:e.createdAt,eventTypes:e.eventTypes.map(t=>zm.EventTypeOutSerializer._toJsonObject(t)),settings:e.settings,version:e.version}}}});var Fm=f(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.Environment=void 0;var IC=Rm(),$C=Jm(),An=ie(),tl=class{constructor(t){this.requestCtx=t}export(t){let r=new An.SvixRequest(An.HttpMethod.POST,"/api/v1/environment/export");return r.setHeaderParam("idempotency-key",t?.idempotencyKey),r.send(this.requestCtx,$C.EnvironmentOutSerializer._fromJsonObject)}import(t,r){let i=new An.SvixRequest(An.HttpMethod.POST,"/api/v1/environment/import");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(IC.EnvironmentInSerializer._toJsonObject(t)),i.sendNoResponseBody(this.requestCtx)}};En.Environment=tl});var Hm=f(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.EventTypeImportOpenApiInSerializer=void 0;Pn.EventTypeImportOpenApiInSerializer={_fromJsonObject(e){return{dryRun:e.dryRun,replaceAll:e.replaceAll,spec:e.spec,specRaw:e.specRaw}},_toJsonObject(e){return{dryRun:e.dryRun,replaceAll:e.replaceAll,spec:e.spec,specRaw:e.specRaw}}}});var Bm=f(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.EventTypeFromOpenApiSerializer=void 0;Tn.EventTypeFromOpenApiSerializer={_fromJsonObject(e){return{deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas}},_toJsonObject(e){return{deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas}}}});var Nm=f(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.EventTypeImportOpenApiOutDataSerializer=void 0;var Lm=Bm();In.EventTypeImportOpenApiOutDataSerializer={_fromJsonObject(e){var t;return{modified:e.modified,toModify:(t=e.to_modify)===null||t===void 0?void 0:t.map(r=>Lm.EventTypeFromOpenApiSerializer._fromJsonObject(r))}},_toJsonObject(e){var t;return{modified:e.modified,to_modify:(t=e.toModify)===null||t===void 0?void 0:t.map(r=>Lm.EventTypeFromOpenApiSerializer._toJsonObject(r))}}}});var Um=f($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.EventTypeImportOpenApiOutSerializer=void 0;var Gm=Nm();$n.EventTypeImportOpenApiOutSerializer={_fromJsonObject(e){return{data:Gm.EventTypeImportOpenApiOutDataSerializer._fromJsonObject(e.data)}},_toJsonObject(e){return{data:Gm.EventTypeImportOpenApiOutDataSerializer._toJsonObject(e.data)}}}});var Wm=f(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.EventTypePatchSerializer=void 0;jn.EventTypePatchSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,schemas:e.schemas}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,schemas:e.schemas}}}});var Vm=f(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.EventTypeUpdateSerializer=void 0;Dn.EventTypeUpdateSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,schemas:e.schemas}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,schemas:e.schemas}}}});var Ym=f(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.ListResponseEventTypeOutSerializer=void 0;var Km=xn();qn.ListResponseEventTypeOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Km.EventTypeOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Km.EventTypeOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Qm=f(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.EventType=void 0;var jC=Hm(),DC=Um(),qC=el(),Rn=xn(),RC=Wm(),MC=Vm(),zC=Ym(),Me=ie(),rl=class{constructor(t){this.requestCtx=t}list(t){let r=new Me.SvixRequest(Me.HttpMethod.GET,"/api/v1/event-type");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order,include_archived:t?.includeArchived,with_content:t?.withContent}),r.send(this.requestCtx,zC.ListResponseEventTypeOutSerializer._fromJsonObject)}create(t,r){let i=new Me.SvixRequest(Me.HttpMethod.POST,"/api/v1/event-type");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(qC.EventTypeInSerializer._toJsonObject(t)),i.send(this.requestCtx,Rn.EventTypeOutSerializer._fromJsonObject)}importOpenapi(t,r){let i=new Me.SvixRequest(Me.HttpMethod.POST,"/api/v1/event-type/import/openapi");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(jC.EventTypeImportOpenApiInSerializer._toJsonObject(t)),i.send(this.requestCtx,DC.EventTypeImportOpenApiOutSerializer._fromJsonObject)}get(t){let r=new Me.SvixRequest(Me.HttpMethod.GET,"/api/v1/event-type/{event_type_name}");return r.setPathParam("event_type_name",t),r.send(this.requestCtx,Rn.EventTypeOutSerializer._fromJsonObject)}update(t,r){let i=new Me.SvixRequest(Me.HttpMethod.PUT,"/api/v1/event-type/{event_type_name}");return i.setPathParam("event_type_name",t),i.setBody(MC.EventTypeUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,Rn.EventTypeOutSerializer._fromJsonObject)}delete(t,r){let i=new Me.SvixRequest(Me.HttpMethod.DELETE,"/api/v1/event-type/{event_type_name}");return i.setPathParam("event_type_name",t),i.setQueryParams({expunge:r?.expunge}),i.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new Me.SvixRequest(Me.HttpMethod.PATCH,"/api/v1/event-type/{event_type_name}");return i.setPathParam("event_type_name",t),i.setBody(RC.EventTypePatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Rn.EventTypeOutSerializer._fromJsonObject)}};Mn.EventType=rl});var Xm=f(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.Health=void 0;var Zm=ie(),il=class{constructor(t){this.requestCtx=t}get(){return new Zm.SvixRequest(Zm.HttpMethod.GET,"/api/v1/health").sendNoResponseBody(this.requestCtx)}};zn.Health=il});var ep=f(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.IngestSourceConsumerPortalAccessInSerializer=void 0;Jn.IngestSourceConsumerPortalAccessInSerializer={_fromJsonObject(e){return{expiry:e.expiry,readOnly:e.readOnly}},_toJsonObject(e){return{expiry:e.expiry,readOnly:e.readOnly}}}});var tp=f(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.IngestEndpointHeadersInSerializer=void 0;Fn.IngestEndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var rp=f(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.IngestEndpointHeadersOutSerializer=void 0;Hn.IngestEndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var ip=f(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.IngestEndpointInSerializer=void 0;Bn.IngestEndpointInSerializer={_fromJsonObject(e){return{description:e.description,disabled:e.disabled,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,uid:e.uid,url:e.url}},_toJsonObject(e){return{description:e.description,disabled:e.disabled,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,uid:e.uid,url:e.url}}}});var nl=f(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.IngestEndpointOutSerializer=void 0;Ln.IngestEndpointOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),description:e.description,disabled:e.disabled,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,updatedAt:new Date(e.updatedAt),url:e.url}},_toJsonObject(e){return{createdAt:e.createdAt,description:e.description,disabled:e.disabled,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,updatedAt:e.updatedAt,url:e.url}}}});var np=f(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.IngestEndpointSecretInSerializer=void 0;Nn.IngestEndpointSecretInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var op=f(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.IngestEndpointSecretOutSerializer=void 0;Gn.IngestEndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var sp=f(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.IngestEndpointTransformationOutSerializer=void 0;Un.IngestEndpointTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var ap=f(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.IngestEndpointTransformationPatchSerializer=void 0;Wn.IngestEndpointTransformationPatchSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var up=f(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.IngestEndpointUpdateSerializer=void 0;Vn.IngestEndpointUpdateSerializer={_fromJsonObject(e){return{description:e.description,disabled:e.disabled,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,url:e.url}},_toJsonObject(e){return{description:e.description,disabled:e.disabled,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,url:e.url}}}});var cp=f(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.ListResponseIngestEndpointOutSerializer=void 0;var lp=nl();Kn.ListResponseIngestEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>lp.IngestEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>lp.IngestEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var dp=f(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.IngestEndpoint=void 0;var JC=tp(),FC=rp(),HC=ip(),ol=nl(),BC=np(),LC=op(),NC=sp(),GC=ap(),UC=up(),WC=cp(),ae=ie(),sl=class{constructor(t){this.requestCtx=t}list(t,r){let i=new ae.SvixRequest(ae.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint");return i.setPathParam("source_id",t),i.setQueryParams({limit:r?.limit,iterator:r?.iterator,order:r?.order}),i.send(this.requestCtx,WC.ListResponseIngestEndpointOutSerializer._fromJsonObject)}create(t,r,i){let n=new ae.SvixRequest(ae.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint");return n.setPathParam("source_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(HC.IngestEndpointInSerializer._toJsonObject(r)),n.send(this.requestCtx,ol.IngestEndpointOutSerializer._fromJsonObject)}get(t,r){let i=new ae.SvixRequest(ae.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return i.setPathParam("source_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,ol.IngestEndpointOutSerializer._fromJsonObject)}update(t,r,i){let n=new ae.SvixRequest(ae.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return n.setPathParam("source_id",t),n.setPathParam("endpoint_id",r),n.setBody(UC.IngestEndpointUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,ol.IngestEndpointOutSerializer._fromJsonObject)}delete(t,r){let i=new ae.SvixRequest(ae.HttpMethod.DELETE,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return i.setPathParam("source_id",t),i.setPathParam("endpoint_id",r),i.sendNoResponseBody(this.requestCtx)}getHeaders(t,r){let i=new ae.SvixRequest(ae.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers");return i.setPathParam("source_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,FC.IngestEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(t,r,i){let n=new ae.SvixRequest(ae.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers");return n.setPathParam("source_id",t),n.setPathParam("endpoint_id",r),n.setBody(JC.IngestEndpointHeadersInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}getSecret(t,r){let i=new ae.SvixRequest(ae.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret");return i.setPathParam("source_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,LC.IngestEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i,n){let o=new ae.SvixRequest(ae.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate");return o.setPathParam("source_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(BC.IngestEndpointSecretInSerializer._toJsonObject(i)),o.sendNoResponseBody(this.requestCtx)}getTransformation(t,r){let i=new ae.SvixRequest(ae.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation");return i.setPathParam("source_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,NC.IngestEndpointTransformationOutSerializer._fromJsonObject)}setTransformation(t,r,i){let n=new ae.SvixRequest(ae.HttpMethod.PATCH,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation");return n.setPathParam("source_id",t),n.setPathParam("endpoint_id",r),n.setBody(GC.IngestEndpointTransformationPatchSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}};Yn.IngestEndpoint=sl});var mp=f(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.AdobeSignConfigSerializer=void 0;Qn.AdobeSignConfigSerializer={_fromJsonObject(e){return{clientId:e.clientId}},_toJsonObject(e){return{clientId:e.clientId}}}});var pp=f(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.AirwallexConfigSerializer=void 0;Zn.AirwallexConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var fp=f(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.CheckbookConfigSerializer=void 0;Xn.CheckbookConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var al=f(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.CronConfigSerializer=void 0;eo.CronConfigSerializer={_fromJsonObject(e){return{contentType:e.contentType,payload:e.payload,schedule:e.schedule}},_toJsonObject(e){return{contentType:e.contentType,payload:e.payload,schedule:e.schedule}}}});var hp=f(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.DocusignConfigSerializer=void 0;to.DocusignConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var gp=f(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.EasypostConfigSerializer=void 0;ro.EasypostConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var bp=f(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.GithubConfigSerializer=void 0;io.GithubConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var _p=f(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.HubspotConfigSerializer=void 0;no.HubspotConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var vp=f(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.MetaConfigSerializer=void 0;oo.MetaConfigSerializer={_fromJsonObject(e){return{secret:e.secret,verifyToken:e.verifyToken}},_toJsonObject(e){return{secret:e.secret,verifyToken:e.verifyToken}}}});var yp=f(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.OrumIoConfigSerializer=void 0;so.OrumIoConfigSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var Cp=f(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.PandaDocConfigSerializer=void 0;ao.PandaDocConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Op=f(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.PortIoConfigSerializer=void 0;uo.PortIoConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Sp=f(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.RutterConfigSerializer=void 0;lo.RutterConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var wp=f(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.SegmentConfigSerializer=void 0;co.SegmentConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var xp=f(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.ShopifyConfigSerializer=void 0;mo.ShopifyConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var kp=f(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.SlackConfigSerializer=void 0;po.SlackConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Ap=f(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.StripeConfigSerializer=void 0;fo.StripeConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Ep=f(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.SvixConfigSerializer=void 0;ho.SvixConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Pp=f(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.TelnyxConfigSerializer=void 0;go.TelnyxConfigSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var Tp=f(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.VapiConfigSerializer=void 0;bo.VapiConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Ip=f(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.VeriffConfigSerializer=void 0;_o.VeriffConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var $p=f(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.ZoomConfigSerializer=void 0;vo.ZoomConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var ef=f(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.IngestSourceInSerializer=void 0;var jp=mp(),Dp=pp(),qp=fp(),Rp=al(),Mp=hp(),zp=gp(),Jp=bp(),Fp=_p(),Hp=vp(),Bp=yp(),Lp=Cp(),Np=Op(),Gp=Sp(),Up=wp(),Wp=xp(),Vp=kp(),Kp=Ap(),H=Ep(),Yp=Pp(),Qp=Tp(),Zp=Ip(),Xp=$p();yo.IngestSourceInSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"generic-webhook":return{};case"cron":return Rp.CronConfigSerializer._fromJsonObject(e.config);case"adobe-sign":return jp.AdobeSignConfigSerializer._fromJsonObject(e.config);case"beehiiv":return H.SvixConfigSerializer._fromJsonObject(e.config);case"brex":return H.SvixConfigSerializer._fromJsonObject(e.config);case"checkbook":return qp.CheckbookConfigSerializer._fromJsonObject(e.config);case"clerk":return H.SvixConfigSerializer._fromJsonObject(e.config);case"docusign":return Mp.DocusignConfigSerializer._fromJsonObject(e.config);case"easypost":return zp.EasypostConfigSerializer._fromJsonObject(e.config);case"github":return Jp.GithubConfigSerializer._fromJsonObject(e.config);case"guesty":return H.SvixConfigSerializer._fromJsonObject(e.config);case"hubspot":return Fp.HubspotConfigSerializer._fromJsonObject(e.config);case"incident-io":return H.SvixConfigSerializer._fromJsonObject(e.config);case"lithic":return H.SvixConfigSerializer._fromJsonObject(e.config);case"meta":return Hp.MetaConfigSerializer._fromJsonObject(e.config);case"nash":return H.SvixConfigSerializer._fromJsonObject(e.config);case"orum-io":return Bp.OrumIoConfigSerializer._fromJsonObject(e.config);case"panda-doc":return Lp.PandaDocConfigSerializer._fromJsonObject(e.config);case"port-io":return Np.PortIoConfigSerializer._fromJsonObject(e.config);case"pleo":return H.SvixConfigSerializer._fromJsonObject(e.config);case"psi-fi":return H.SvixConfigSerializer._fromJsonObject(e.config);case"replicate":return H.SvixConfigSerializer._fromJsonObject(e.config);case"resend":return H.SvixConfigSerializer._fromJsonObject(e.config);case"rutter":return Gp.RutterConfigSerializer._fromJsonObject(e.config);case"safebase":return H.SvixConfigSerializer._fromJsonObject(e.config);case"sardine":return H.SvixConfigSerializer._fromJsonObject(e.config);case"segment":return Up.SegmentConfigSerializer._fromJsonObject(e.config);case"shopify":return Wp.ShopifyConfigSerializer._fromJsonObject(e.config);case"slack":return Vp.SlackConfigSerializer._fromJsonObject(e.config);case"stripe":return Kp.StripeConfigSerializer._fromJsonObject(e.config);case"stych":return H.SvixConfigSerializer._fromJsonObject(e.config);case"svix":return H.SvixConfigSerializer._fromJsonObject(e.config);case"zoom":return Xp.ZoomConfigSerializer._fromJsonObject(e.config);case"telnyx":return Yp.TelnyxConfigSerializer._fromJsonObject(e.config);case"vapi":return Qp.VapiConfigSerializer._fromJsonObject(e.config);case"open-ai":return H.SvixConfigSerializer._fromJsonObject(e.config);case"render":return H.SvixConfigSerializer._fromJsonObject(e.config);case"veriff":return Zp.VeriffConfigSerializer._fromJsonObject(e.config);case"airwallex":return Dp.AirwallexConfigSerializer._fromJsonObject(e.config);default:throw new Error(`Unexpected type: ${i}`)}}return{type:t,config:r(t),metadata:e.metadata,name:e.name,uid:e.uid}},_toJsonObject(e){let t;switch(e.type){case"generic-webhook":t={};break;case"cron":t=Rp.CronConfigSerializer._toJsonObject(e.config);break;case"adobe-sign":t=jp.AdobeSignConfigSerializer._toJsonObject(e.config);break;case"beehiiv":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"brex":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"checkbook":t=qp.CheckbookConfigSerializer._toJsonObject(e.config);break;case"clerk":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"docusign":t=Mp.DocusignConfigSerializer._toJsonObject(e.config);break;case"easypost":t=zp.EasypostConfigSerializer._toJsonObject(e.config);break;case"github":t=Jp.GithubConfigSerializer._toJsonObject(e.config);break;case"guesty":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"hubspot":t=Fp.HubspotConfigSerializer._toJsonObject(e.config);break;case"incident-io":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"lithic":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"meta":t=Hp.MetaConfigSerializer._toJsonObject(e.config);break;case"nash":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"orum-io":t=Bp.OrumIoConfigSerializer._toJsonObject(e.config);break;case"panda-doc":t=Lp.PandaDocConfigSerializer._toJsonObject(e.config);break;case"port-io":t=Np.PortIoConfigSerializer._toJsonObject(e.config);break;case"pleo":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"psi-fi":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"replicate":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"resend":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"rutter":t=Gp.RutterConfigSerializer._toJsonObject(e.config);break;case"safebase":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"sardine":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"segment":t=Up.SegmentConfigSerializer._toJsonObject(e.config);break;case"shopify":t=Wp.ShopifyConfigSerializer._toJsonObject(e.config);break;case"slack":t=Vp.SlackConfigSerializer._toJsonObject(e.config);break;case"stripe":t=Kp.StripeConfigSerializer._toJsonObject(e.config);break;case"stych":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"svix":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"zoom":t=Xp.ZoomConfigSerializer._toJsonObject(e.config);break;case"telnyx":t=Yp.TelnyxConfigSerializer._toJsonObject(e.config);break;case"vapi":t=Qp.VapiConfigSerializer._toJsonObject(e.config);break;case"open-ai":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"render":t=H.SvixConfigSerializer._toJsonObject(e.config);break;case"veriff":t=Zp.VeriffConfigSerializer._toJsonObject(e.config);break;case"airwallex":t=Dp.AirwallexConfigSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,metadata:e.metadata,name:e.name,uid:e.uid}}}});var tf=f(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.AdobeSignConfigOutSerializer=void 0;Co.AdobeSignConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var rf=f(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.AirwallexConfigOutSerializer=void 0;Oo.AirwallexConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var nf=f(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.CheckbookConfigOutSerializer=void 0;So.CheckbookConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var of=f(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.DocusignConfigOutSerializer=void 0;wo.DocusignConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var sf=f(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.EasypostConfigOutSerializer=void 0;xo.EasypostConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var af=f(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.GithubConfigOutSerializer=void 0;ko.GithubConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var uf=f(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.HubspotConfigOutSerializer=void 0;Ao.HubspotConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var lf=f(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.MetaConfigOutSerializer=void 0;Eo.MetaConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var cf=f(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.OrumIoConfigOutSerializer=void 0;Po.OrumIoConfigOutSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var df=f(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.PandaDocConfigOutSerializer=void 0;To.PandaDocConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var mf=f(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.PortIoConfigOutSerializer=void 0;Io.PortIoConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var pf=f($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.RutterConfigOutSerializer=void 0;$o.RutterConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var ff=f(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.SegmentConfigOutSerializer=void 0;jo.SegmentConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var hf=f(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.ShopifyConfigOutSerializer=void 0;Do.ShopifyConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var gf=f(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.SlackConfigOutSerializer=void 0;qo.SlackConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var bf=f(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.StripeConfigOutSerializer=void 0;Ro.StripeConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var _f=f(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.SvixConfigOutSerializer=void 0;Mo.SvixConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var vf=f(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.TelnyxConfigOutSerializer=void 0;zo.TelnyxConfigOutSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var yf=f(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.VapiConfigOutSerializer=void 0;Jo.VapiConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Cf=f(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.VeriffConfigOutSerializer=void 0;Fo.VeriffConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Of=f(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.ZoomConfigOutSerializer=void 0;Ho.ZoomConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var ul=f(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.IngestSourceOutSerializer=void 0;var Sf=tf(),wf=rf(),xf=nf(),kf=al(),Af=of(),Ef=sf(),Pf=af(),Tf=uf(),If=lf(),$f=cf(),jf=df(),Df=mf(),qf=pf(),Rf=ff(),Mf=hf(),zf=gf(),Jf=bf(),B=_f(),Ff=vf(),Hf=yf(),Bf=Cf(),Lf=Of();Bo.IngestSourceOutSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"generic-webhook":return{};case"cron":return kf.CronConfigSerializer._fromJsonObject(e.config);case"adobe-sign":return Sf.AdobeSignConfigOutSerializer._fromJsonObject(e.config);case"beehiiv":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"brex":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"checkbook":return xf.CheckbookConfigOutSerializer._fromJsonObject(e.config);case"clerk":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"docusign":return Af.DocusignConfigOutSerializer._fromJsonObject(e.config);case"easypost":return Ef.EasypostConfigOutSerializer._fromJsonObject(e.config);case"github":return Pf.GithubConfigOutSerializer._fromJsonObject(e.config);case"guesty":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"hubspot":return Tf.HubspotConfigOutSerializer._fromJsonObject(e.config);case"incident-io":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"lithic":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"meta":return If.MetaConfigOutSerializer._fromJsonObject(e.config);case"nash":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"orum-io":return $f.OrumIoConfigOutSerializer._fromJsonObject(e.config);case"panda-doc":return jf.PandaDocConfigOutSerializer._fromJsonObject(e.config);case"port-io":return Df.PortIoConfigOutSerializer._fromJsonObject(e.config);case"psi-fi":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"pleo":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"replicate":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"resend":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"rutter":return qf.RutterConfigOutSerializer._fromJsonObject(e.config);case"safebase":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"sardine":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"segment":return Rf.SegmentConfigOutSerializer._fromJsonObject(e.config);case"shopify":return Mf.ShopifyConfigOutSerializer._fromJsonObject(e.config);case"slack":return zf.SlackConfigOutSerializer._fromJsonObject(e.config);case"stripe":return Jf.StripeConfigOutSerializer._fromJsonObject(e.config);case"stych":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"svix":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"zoom":return Lf.ZoomConfigOutSerializer._fromJsonObject(e.config);case"telnyx":return Ff.TelnyxConfigOutSerializer._fromJsonObject(e.config);case"vapi":return Hf.VapiConfigOutSerializer._fromJsonObject(e.config);case"open-ai":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"render":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"veriff":return Bf.VeriffConfigOutSerializer._fromJsonObject(e.config);case"airwallex":return wf.AirwallexConfigOutSerializer._fromJsonObject(e.config);default:throw new Error(`Unexpected type: ${i}`)}}return{type:t,config:r(t),createdAt:new Date(e.createdAt),id:e.id,ingestUrl:e.ingestUrl,metadata:e.metadata,name:e.name,uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){let t;switch(e.type){case"generic-webhook":t={};break;case"cron":t=kf.CronConfigSerializer._toJsonObject(e.config);break;case"adobe-sign":t=Sf.AdobeSignConfigOutSerializer._toJsonObject(e.config);break;case"beehiiv":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"brex":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"checkbook":t=xf.CheckbookConfigOutSerializer._toJsonObject(e.config);break;case"clerk":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"docusign":t=Af.DocusignConfigOutSerializer._toJsonObject(e.config);break;case"easypost":t=Ef.EasypostConfigOutSerializer._toJsonObject(e.config);break;case"github":t=Pf.GithubConfigOutSerializer._toJsonObject(e.config);break;case"guesty":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"hubspot":t=Tf.HubspotConfigOutSerializer._toJsonObject(e.config);break;case"incident-io":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"lithic":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"meta":t=If.MetaConfigOutSerializer._toJsonObject(e.config);break;case"nash":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"orum-io":t=$f.OrumIoConfigOutSerializer._toJsonObject(e.config);break;case"panda-doc":t=jf.PandaDocConfigOutSerializer._toJsonObject(e.config);break;case"port-io":t=Df.PortIoConfigOutSerializer._toJsonObject(e.config);break;case"psi-fi":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"pleo":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"replicate":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"resend":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"rutter":t=qf.RutterConfigOutSerializer._toJsonObject(e.config);break;case"safebase":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"sardine":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"segment":t=Rf.SegmentConfigOutSerializer._toJsonObject(e.config);break;case"shopify":t=Mf.ShopifyConfigOutSerializer._toJsonObject(e.config);break;case"slack":t=zf.SlackConfigOutSerializer._toJsonObject(e.config);break;case"stripe":t=Jf.StripeConfigOutSerializer._toJsonObject(e.config);break;case"stych":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"svix":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"zoom":t=Lf.ZoomConfigOutSerializer._toJsonObject(e.config);break;case"telnyx":t=Ff.TelnyxConfigOutSerializer._toJsonObject(e.config);break;case"vapi":t=Hf.VapiConfigOutSerializer._toJsonObject(e.config);break;case"open-ai":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"render":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"veriff":t=Bf.VeriffConfigOutSerializer._toJsonObject(e.config);break;case"airwallex":t=wf.AirwallexConfigOutSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,createdAt:e.createdAt,id:e.id,ingestUrl:e.ingestUrl,metadata:e.metadata,name:e.name,uid:e.uid,updatedAt:e.updatedAt}}}});var Gf=f(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.ListResponseIngestSourceOutSerializer=void 0;var Nf=ul();Lo.ListResponseIngestSourceOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Nf.IngestSourceOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Nf.IngestSourceOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Uf=f(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.RotateTokenOutSerializer=void 0;No.RotateTokenOutSerializer={_fromJsonObject(e){return{ingestUrl:e.ingestUrl}},_toJsonObject(e){return{ingestUrl:e.ingestUrl}}}});var Vf=f(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.IngestSource=void 0;var Wf=ef(),ll=ul(),VC=Gf(),KC=Uf(),Ze=ie(),cl=class{constructor(t){this.requestCtx=t}list(t){let r=new Ze.SvixRequest(Ze.HttpMethod.GET,"/ingest/api/v1/source");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,VC.ListResponseIngestSourceOutSerializer._fromJsonObject)}create(t,r){let i=new Ze.SvixRequest(Ze.HttpMethod.POST,"/ingest/api/v1/source");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(Wf.IngestSourceInSerializer._toJsonObject(t)),i.send(this.requestCtx,ll.IngestSourceOutSerializer._fromJsonObject)}get(t){let r=new Ze.SvixRequest(Ze.HttpMethod.GET,"/ingest/api/v1/source/{source_id}");return r.setPathParam("source_id",t),r.send(this.requestCtx,ll.IngestSourceOutSerializer._fromJsonObject)}update(t,r){let i=new Ze.SvixRequest(Ze.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}");return i.setPathParam("source_id",t),i.setBody(Wf.IngestSourceInSerializer._toJsonObject(r)),i.send(this.requestCtx,ll.IngestSourceOutSerializer._fromJsonObject)}delete(t){let r=new Ze.SvixRequest(Ze.HttpMethod.DELETE,"/ingest/api/v1/source/{source_id}");return r.setPathParam("source_id",t),r.sendNoResponseBody(this.requestCtx)}rotateToken(t,r){let i=new Ze.SvixRequest(Ze.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/token/rotate");return i.setPathParam("source_id",t),i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.send(this.requestCtx,KC.RotateTokenOutSerializer._fromJsonObject)}};Go.IngestSource=cl});var Yf=f(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.Ingest=void 0;var YC=Lu(),QC=ep(),ZC=dp(),XC=Vf(),Kf=ie(),dl=class{constructor(t){this.requestCtx=t}get endpoint(){return new ZC.IngestEndpoint(this.requestCtx)}get source(){return new XC.IngestSource(this.requestCtx)}dashboard(t,r,i){let n=new Kf.SvixRequest(Kf.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/dashboard");return n.setPathParam("source_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(QC.IngestSourceConsumerPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,YC.DashboardAccessOutSerializer._fromJsonObject)}};Uo.Ingest=dl});var Qf=f(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.IntegrationInSerializer=void 0;Wo.IntegrationInSerializer={_fromJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}}}});var Zf=f(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.IntegrationKeyOutSerializer=void 0;Vo.IntegrationKeyOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var ml=f(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.IntegrationOutSerializer=void 0;Ko.IntegrationOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),featureFlags:e.featureFlags,id:e.id,name:e.name,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{createdAt:e.createdAt,featureFlags:e.featureFlags,id:e.id,name:e.name,updatedAt:e.updatedAt}}}});var Xf=f(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.IntegrationUpdateSerializer=void 0;Yo.IntegrationUpdateSerializer={_fromJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}}}});var th=f(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.ListResponseIntegrationOutSerializer=void 0;var eh=ml();Qo.ListResponseIntegrationOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>eh.IntegrationOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>eh.IntegrationOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var ih=f(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.Integration=void 0;var eO=Qf(),rh=Zf(),pl=ml(),tO=Xf(),rO=th(),ze=ie(),fl=class{constructor(t){this.requestCtx=t}list(t,r){let i=new ze.SvixRequest(ze.HttpMethod.GET,"/api/v1/app/{app_id}/integration");return i.setPathParam("app_id",t),i.setQueryParams({limit:r?.limit,iterator:r?.iterator,order:r?.order}),i.send(this.requestCtx,rO.ListResponseIntegrationOutSerializer._fromJsonObject)}create(t,r,i){let n=new ze.SvixRequest(ze.HttpMethod.POST,"/api/v1/app/{app_id}/integration");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(eO.IntegrationInSerializer._toJsonObject(r)),n.send(this.requestCtx,pl.IntegrationOutSerializer._fromJsonObject)}get(t,r){let i=new ze.SvixRequest(ze.HttpMethod.GET,"/api/v1/app/{app_id}/integration/{integ_id}");return i.setPathParam("app_id",t),i.setPathParam("integ_id",r),i.send(this.requestCtx,pl.IntegrationOutSerializer._fromJsonObject)}update(t,r,i){let n=new ze.SvixRequest(ze.HttpMethod.PUT,"/api/v1/app/{app_id}/integration/{integ_id}");return n.setPathParam("app_id",t),n.setPathParam("integ_id",r),n.setBody(tO.IntegrationUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,pl.IntegrationOutSerializer._fromJsonObject)}delete(t,r){let i=new ze.SvixRequest(ze.HttpMethod.DELETE,"/api/v1/app/{app_id}/integration/{integ_id}");return i.setPathParam("app_id",t),i.setPathParam("integ_id",r),i.sendNoResponseBody(this.requestCtx)}getKey(t,r){let i=new ze.SvixRequest(ze.HttpMethod.GET,"/api/v1/app/{app_id}/integration/{integ_id}/key");return i.setPathParam("app_id",t),i.setPathParam("integ_id",r),i.send(this.requestCtx,rh.IntegrationKeyOutSerializer._fromJsonObject)}rotateKey(t,r,i){let n=new ze.SvixRequest(ze.HttpMethod.POST,"/api/v1/app/{app_id}/integration/{integ_id}/key/rotate");return n.setPathParam("app_id",t),n.setPathParam("integ_id",r),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.send(this.requestCtx,rh.IntegrationKeyOutSerializer._fromJsonObject)}};Zo.Integration=fl});var sh=f(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.ExpungeAllContentsOutSerializer=void 0;var nh=xt(),oh=kt();Xo.ExpungeAllContentsOutSerializer={_fromJsonObject(e){return{id:e.id,status:nh.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:oh.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:nh.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:oh.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var uh=f(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.ListResponseMessageOutSerializer=void 0;var ah=Yr();es.ListResponseMessageOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>ah.MessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>ah.MessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var lh=f(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.MessagePrecheckInSerializer=void 0;ts.MessagePrecheckInSerializer={_fromJsonObject(e){return{channels:e.channels,eventType:e.eventType}},_toJsonObject(e){return{channels:e.channels,eventType:e.eventType}}}});var ch=f(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.MessagePrecheckOutSerializer=void 0;rs.MessagePrecheckOutSerializer={_fromJsonObject(e){return{active:e.active}},_toJsonObject(e){return{active:e.active}}}});var dh=f(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.PollingEndpointConsumerSeekInSerializer=void 0;is.PollingEndpointConsumerSeekInSerializer={_fromJsonObject(e){return{after:new Date(e.after)}},_toJsonObject(e){return{after:e.after}}}});var mh=f(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.PollingEndpointConsumerSeekOutSerializer=void 0;ns.PollingEndpointConsumerSeekOutSerializer={_fromJsonObject(e){return{iterator:e.iterator}},_toJsonObject(e){return{iterator:e.iterator}}}});var ph=f(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.PollingEndpointMessageOutSerializer=void 0;os.PollingEndpointMessageOutSerializer={_fromJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,headers:e.headers,id:e.id,payload:e.payload,tags:e.tags,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,headers:e.headers,id:e.id,payload:e.payload,tags:e.tags,timestamp:e.timestamp}}}});var hh=f(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.PollingEndpointOutSerializer=void 0;var fh=ph();ss.PollingEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>fh.PollingEndpointMessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator}},_toJsonObject(e){return{data:e.data.map(t=>fh.PollingEndpointMessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator}}}});var bh=f(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.MessagePoller=void 0;var iO=dh(),nO=mh(),gh=hh(),dr=ie(),hl=class{constructor(t){this.requestCtx=t}poll(t,r,i){let n=new dr.SvixRequest(dr.HttpMethod.GET,"/api/v1/app/{app_id}/poller/{sink_id}");return n.setPathParam("app_id",t),n.setPathParam("sink_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator,event_type:i?.eventType,channel:i?.channel,after:i?.after}),n.send(this.requestCtx,gh.PollingEndpointOutSerializer._fromJsonObject)}consumerPoll(t,r,i,n){let o=new dr.SvixRequest(dr.HttpMethod.GET,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}");return o.setPathParam("app_id",t),o.setPathParam("sink_id",r),o.setPathParam("consumer_id",i),o.setQueryParams({limit:n?.limit,iterator:n?.iterator}),o.send(this.requestCtx,gh.PollingEndpointOutSerializer._fromJsonObject)}consumerSeek(t,r,i,n,o){let s=new dr.SvixRequest(dr.HttpMethod.POST,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}/seek");return s.setPathParam("app_id",t),s.setPathParam("sink_id",r),s.setPathParam("consumer_id",i),s.setHeaderParam("idempotency-key",o?.idempotencyKey),s.setBody(iO.PollingEndpointConsumerSeekInSerializer._toJsonObject(n)),s.send(this.requestCtx,nO.PollingEndpointConsumerSeekOutSerializer._fromJsonObject)}};as.MessagePoller=hl});var vh=f(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.MessageInSerializer=void 0;var _h=wi();us.MessageInSerializer={_fromJsonObject(e){return{application:e.application!=null?_h.ApplicationInSerializer._fromJsonObject(e.application):void 0,channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,payload:e.payload,payloadRetentionHours:e.payloadRetentionHours,payloadRetentionPeriod:e.payloadRetentionPeriod,tags:e.tags,transformationsParams:e.transformationsParams}},_toJsonObject(e){return{application:e.application!=null?_h.ApplicationInSerializer._toJsonObject(e.application):void 0,channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,payload:e.payload,payloadRetentionHours:e.payloadRetentionHours,payloadRetentionPeriod:e.payloadRetentionPeriod,tags:e.tags,transformationsParams:e.transformationsParams}}}});var bl=f(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.messageInRaw=mr.Message=void 0;var oO=sh(),sO=uh(),yh=Yr(),aO=lh(),uO=ch(),lO=bh(),Xe=ie(),cO=vh(),gl=class{constructor(t){this.requestCtx=t}get poller(){return new lO.MessagePoller(this.requestCtx)}list(t,r){let i=new Xe.SvixRequest(Xe.HttpMethod.GET,"/api/v1/app/{app_id}/msg");return i.setPathParam("app_id",t),i.setQueryParams({limit:r?.limit,iterator:r?.iterator,channel:r?.channel,before:r?.before,after:r?.after,with_content:r?.withContent,tag:r?.tag,event_types:r?.eventTypes}),i.send(this.requestCtx,sO.ListResponseMessageOutSerializer._fromJsonObject)}create(t,r,i){let n=new Xe.SvixRequest(Xe.HttpMethod.POST,"/api/v1/app/{app_id}/msg");return n.setPathParam("app_id",t),n.setQueryParams({with_content:i?.withContent}),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(cO.MessageInSerializer._toJsonObject(r)),n.send(this.requestCtx,yh.MessageOutSerializer._fromJsonObject)}expungeAllContents(t,r){let i=new Xe.SvixRequest(Xe.HttpMethod.POST,"/api/v1/app/{app_id}/msg/expunge-all-contents");return i.setPathParam("app_id",t),i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.send(this.requestCtx,oO.ExpungeAllContentsOutSerializer._fromJsonObject)}precheck(t,r,i){let n=new Xe.SvixRequest(Xe.HttpMethod.POST,"/api/v1/app/{app_id}/msg/precheck/active");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(aO.MessagePrecheckInSerializer._toJsonObject(r)),n.send(this.requestCtx,uO.MessagePrecheckOutSerializer._fromJsonObject)}get(t,r,i){let n=new Xe.SvixRequest(Xe.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}");return n.setPathParam("app_id",t),n.setPathParam("msg_id",r),n.setQueryParams({with_content:i?.withContent}),n.send(this.requestCtx,yh.MessageOutSerializer._fromJsonObject)}expungeContent(t,r){let i=new Xe.SvixRequest(Xe.HttpMethod.DELETE,"/api/v1/app/{app_id}/msg/{msg_id}/content");return i.setPathParam("app_id",t),i.setPathParam("msg_id",r),i.sendNoResponseBody(this.requestCtx)}};mr.Message=gl;function dO(e,t,r){return{eventType:e,payload:{},transformationsParams:{rawPayload:t,headers:r?{"content-type":r}:void 0}}}mr.messageInRaw=dO});var _l=f(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.EmptyResponseSerializer=void 0;ls.EmptyResponseSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Qr=f(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.MessageStatusTextSerializer=Wt.MessageStatusText=void 0;var mO;(function(e){e.Success="success",e.Pending="pending",e.Fail="fail",e.Sending="sending"})(mO=Wt.MessageStatusText||(Wt.MessageStatusText={}));Wt.MessageStatusTextSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Sh=f(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.EndpointMessageOutSerializer=void 0;var Ch=cr(),Oh=Qr();cs.EndpointMessageOutSerializer={_fromJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,id:e.id,nextAttempt:e.nextAttempt?new Date(e.nextAttempt):null,payload:e.payload,status:Ch.MessageStatusSerializer._fromJsonObject(e.status),statusText:Oh.MessageStatusTextSerializer._fromJsonObject(e.statusText),tags:e.tags,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,id:e.id,nextAttempt:e.nextAttempt,payload:e.payload,status:Ch.MessageStatusSerializer._toJsonObject(e.status),statusText:Oh.MessageStatusTextSerializer._toJsonObject(e.statusText),tags:e.tags,timestamp:e.timestamp}}}});var xh=f(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.ListResponseEndpointMessageOutSerializer=void 0;var wh=Sh();ds.ListResponseEndpointMessageOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>wh.EndpointMessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>wh.EndpointMessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var vl=f(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.MessageAttemptTriggerTypeSerializer=Vt.MessageAttemptTriggerType=void 0;var pO;(function(e){e[e.Scheduled=0]="Scheduled",e[e.Manual=1]="Manual"})(pO=Vt.MessageAttemptTriggerType||(Vt.MessageAttemptTriggerType={}));Vt.MessageAttemptTriggerTypeSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var yl=f(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.MessageAttemptOutSerializer=void 0;var kh=vl(),Ah=Yr(),Eh=cr(),Ph=Qr();ms.MessageAttemptOutSerializer={_fromJsonObject(e){return{endpointId:e.endpointId,id:e.id,msg:e.msg!=null?Ah.MessageOutSerializer._fromJsonObject(e.msg):void 0,msgId:e.msgId,response:e.response,responseDurationMs:e.responseDurationMs,responseStatusCode:e.responseStatusCode,status:Eh.MessageStatusSerializer._fromJsonObject(e.status),statusText:Ph.MessageStatusTextSerializer._fromJsonObject(e.statusText),timestamp:new Date(e.timestamp),triggerType:kh.MessageAttemptTriggerTypeSerializer._fromJsonObject(e.triggerType),url:e.url}},_toJsonObject(e){return{endpointId:e.endpointId,id:e.id,msg:e.msg!=null?Ah.MessageOutSerializer._toJsonObject(e.msg):void 0,msgId:e.msgId,response:e.response,responseDurationMs:e.responseDurationMs,responseStatusCode:e.responseStatusCode,status:Eh.MessageStatusSerializer._toJsonObject(e.status),statusText:Ph.MessageStatusTextSerializer._toJsonObject(e.statusText),timestamp:e.timestamp,triggerType:kh.MessageAttemptTriggerTypeSerializer._toJsonObject(e.triggerType),url:e.url}}}});var Ih=f(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.ListResponseMessageAttemptOutSerializer=void 0;var Th=yl();ps.ListResponseMessageAttemptOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Th.MessageAttemptOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Th.MessageAttemptOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Dh=f(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.MessageEndpointOutSerializer=void 0;var $h=cr(),jh=Qr();fs.MessageEndpointOutSerializer={_fromJsonObject(e){return{channels:e.channels,createdAt:new Date(e.createdAt),description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,nextAttempt:e.nextAttempt?new Date(e.nextAttempt):null,rateLimit:e.rateLimit,status:$h.MessageStatusSerializer._fromJsonObject(e.status),statusText:jh.MessageStatusTextSerializer._fromJsonObject(e.statusText),throttleRate:e.throttleRate,uid:e.uid,updatedAt:new Date(e.updatedAt),url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,createdAt:e.createdAt,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,nextAttempt:e.nextAttempt,rateLimit:e.rateLimit,status:$h.MessageStatusSerializer._toJsonObject(e.status),statusText:jh.MessageStatusTextSerializer._toJsonObject(e.statusText),throttleRate:e.throttleRate,uid:e.uid,updatedAt:e.updatedAt,url:e.url,version:e.version}}}});var Rh=f(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.ListResponseMessageEndpointOutSerializer=void 0;var qh=Dh();hs.ListResponseMessageEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>qh.MessageEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>qh.MessageEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var zh=f(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.MessageAttempt=void 0;var fO=_l(),hO=xh(),Mh=Ih(),gO=Rh(),bO=yl(),Je=ie(),Cl=class{constructor(t){this.requestCtx=t}listByEndpoint(t,r,i){let n=new Je.SvixRequest(Je.HttpMethod.GET,"/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator,status:i?.status,status_code_class:i?.statusCodeClass,channel:i?.channel,tag:i?.tag,before:i?.before,after:i?.after,with_content:i?.withContent,with_msg:i?.withMsg,event_types:i?.eventTypes}),n.send(this.requestCtx,Mh.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listByMsg(t,r,i){let n=new Je.SvixRequest(Je.HttpMethod.GET,"/api/v1/app/{app_id}/attempt/msg/{msg_id}");return n.setPathParam("app_id",t),n.setPathParam("msg_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator,status:i?.status,status_code_class:i?.statusCodeClass,channel:i?.channel,tag:i?.tag,endpoint_id:i?.endpointId,before:i?.before,after:i?.after,with_content:i?.withContent,event_types:i?.eventTypes}),n.send(this.requestCtx,Mh.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listAttemptedMessages(t,r,i){let n=new Je.SvixRequest(Je.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator,channel:i?.channel,tag:i?.tag,status:i?.status,before:i?.before,after:i?.after,with_content:i?.withContent,event_types:i?.eventTypes}),n.send(this.requestCtx,hO.ListResponseEndpointMessageOutSerializer._fromJsonObject)}get(t,r,i){let n=new Je.SvixRequest(Je.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}");return n.setPathParam("app_id",t),n.setPathParam("msg_id",r),n.setPathParam("attempt_id",i),n.send(this.requestCtx,bO.MessageAttemptOutSerializer._fromJsonObject)}expungeContent(t,r,i){let n=new Je.SvixRequest(Je.HttpMethod.DELETE,"/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content");return n.setPathParam("app_id",t),n.setPathParam("msg_id",r),n.setPathParam("attempt_id",i),n.sendNoResponseBody(this.requestCtx)}listAttemptedDestinations(t,r,i){let n=new Je.SvixRequest(Je.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}/endpoint");return n.setPathParam("app_id",t),n.setPathParam("msg_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator}),n.send(this.requestCtx,gO.ListResponseMessageEndpointOutSerializer._fromJsonObject)}resend(t,r,i,n){let o=new Je.SvixRequest(Je.HttpMethod.POST,"/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend");return o.setPathParam("app_id",t),o.setPathParam("msg_id",r),o.setPathParam("endpoint_id",i),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.send(this.requestCtx,fO.EmptyResponseSerializer._fromJsonObject)}};gs.MessageAttempt=Cl});var Ol=f(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.OperationalWebhookEndpointOutSerializer=void 0;bs.OperationalWebhookEndpointOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,updatedAt:new Date(e.updatedAt),url:e.url}},_toJsonObject(e){return{createdAt:e.createdAt,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,updatedAt:e.updatedAt,url:e.url}}}});var Fh=f(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.ListResponseOperationalWebhookEndpointOutSerializer=void 0;var Jh=Ol();_s.ListResponseOperationalWebhookEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Jh.OperationalWebhookEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Jh.OperationalWebhookEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Hh=f(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.OperationalWebhookEndpointHeadersInSerializer=void 0;vs.OperationalWebhookEndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var Bh=f(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.OperationalWebhookEndpointHeadersOutSerializer=void 0;ys.OperationalWebhookEndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var Lh=f(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.OperationalWebhookEndpointInSerializer=void 0;Cs.OperationalWebhookEndpointInSerializer={_fromJsonObject(e){return{description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,uid:e.uid,url:e.url}},_toJsonObject(e){return{description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,uid:e.uid,url:e.url}}}});var Nh=f(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.OperationalWebhookEndpointSecretInSerializer=void 0;Os.OperationalWebhookEndpointSecretInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Gh=f(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.OperationalWebhookEndpointSecretOutSerializer=void 0;Ss.OperationalWebhookEndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Uh=f(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.OperationalWebhookEndpointUpdateSerializer=void 0;ws.OperationalWebhookEndpointUpdateSerializer={_fromJsonObject(e){return{description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,url:e.url}},_toJsonObject(e){return{description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,url:e.url}}}});var xl=f(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.OperationalWebhookEndpoint=void 0;var _O=Fh(),vO=Hh(),yO=Bh(),CO=Lh(),Sl=Ol(),OO=Nh(),SO=Gh(),wO=Uh(),_e=ie(),wl=class{constructor(t){this.requestCtx=t}list(t){let r=new _e.SvixRequest(_e.HttpMethod.GET,"/api/v1/operational-webhook/endpoint");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,_O.ListResponseOperationalWebhookEndpointOutSerializer._fromJsonObject)}create(t,r){let i=new _e.SvixRequest(_e.HttpMethod.POST,"/api/v1/operational-webhook/endpoint");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(CO.OperationalWebhookEndpointInSerializer._toJsonObject(t)),i.send(this.requestCtx,Sl.OperationalWebhookEndpointOutSerializer._fromJsonObject)}get(t){let r=new _e.SvixRequest(_e.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return r.setPathParam("endpoint_id",t),r.send(this.requestCtx,Sl.OperationalWebhookEndpointOutSerializer._fromJsonObject)}update(t,r){let i=new _e.SvixRequest(_e.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return i.setPathParam("endpoint_id",t),i.setBody(wO.OperationalWebhookEndpointUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,Sl.OperationalWebhookEndpointOutSerializer._fromJsonObject)}delete(t){let r=new _e.SvixRequest(_e.HttpMethod.DELETE,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return r.setPathParam("endpoint_id",t),r.sendNoResponseBody(this.requestCtx)}getHeaders(t){let r=new _e.SvixRequest(_e.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return r.setPathParam("endpoint_id",t),r.send(this.requestCtx,yO.OperationalWebhookEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(t,r){let i=new _e.SvixRequest(_e.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return i.setPathParam("endpoint_id",t),i.setBody(vO.OperationalWebhookEndpointHeadersInSerializer._toJsonObject(r)),i.sendNoResponseBody(this.requestCtx)}getSecret(t){let r=new _e.SvixRequest(_e.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret");return r.setPathParam("endpoint_id",t),r.send(this.requestCtx,SO.OperationalWebhookEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i){let n=new _e.SvixRequest(_e.HttpMethod.POST,"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret/rotate");return n.setPathParam("endpoint_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(OO.OperationalWebhookEndpointSecretInSerializer._toJsonObject(r)),n.sendNoResponseBody(this.requestCtx)}};xs.OperationalWebhookEndpoint=wl});var Wh=f(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.OperationalWebhook=void 0;var xO=xl(),kl=class{constructor(t){this.requestCtx=t}get endpoint(){return new xO.OperationalWebhookEndpoint(this.requestCtx)}};ks.OperationalWebhook=kl});var Yh=f(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.AggregateEventTypesOutSerializer=void 0;var Vh=xt(),Kh=kt();As.AggregateEventTypesOutSerializer={_fromJsonObject(e){return{id:e.id,status:Vh.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:Kh.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:Vh.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:Kh.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var Qh=f(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.AppUsageStatsInSerializer=void 0;Es.AppUsageStatsInSerializer={_fromJsonObject(e){return{appIds:e.appIds,since:new Date(e.since),until:new Date(e.until)}},_toJsonObject(e){return{appIds:e.appIds,since:e.since,until:e.until}}}});var eg=f(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.AppUsageStatsOutSerializer=void 0;var Zh=xt(),Xh=kt();Ps.AppUsageStatsOutSerializer={_fromJsonObject(e){return{id:e.id,status:Zh.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:Xh.BackgroundTaskTypeSerializer._fromJsonObject(e.task),unresolvedAppIds:e.unresolvedAppIds,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:Zh.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:Xh.BackgroundTaskTypeSerializer._toJsonObject(e.task),unresolvedAppIds:e.unresolvedAppIds,updatedAt:e.updatedAt}}}});var tg=f(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.Statistics=void 0;var kO=Yh(),AO=Qh(),EO=eg(),Ts=ie(),Al=class{constructor(t){this.requestCtx=t}aggregateAppStats(t,r){let i=new Ts.SvixRequest(Ts.HttpMethod.POST,"/api/v1/stats/usage/app");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(AO.AppUsageStatsInSerializer._toJsonObject(t)),i.send(this.requestCtx,EO.AppUsageStatsOutSerializer._fromJsonObject)}aggregateEventTypes(){return new Ts.SvixRequest(Ts.HttpMethod.PUT,"/api/v1/stats/usage/event-types").send(this.requestCtx,kO.AggregateEventTypesOutSerializer._fromJsonObject)}};Is.Statistics=Al});var rg=f($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.HttpSinkHeadersPatchInSerializer=void 0;$s.HttpSinkHeadersPatchInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var ig=f(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.SinkTransformationOutSerializer=void 0;js.SinkTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var El=f(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.StreamEventTypeOutSerializer=void 0;Ds.StreamEventTypeOutSerializer={_fromJsonObject(e){return{archived:e.archived,createdAt:new Date(e.createdAt),deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{archived:e.archived,createdAt:e.createdAt,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name,updatedAt:e.updatedAt}}}});var og=f(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.ListResponseStreamEventTypeOutSerializer=void 0;var ng=El();qs.ListResponseStreamEventTypeOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>ng.StreamEventTypeOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>ng.StreamEventTypeOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var sg=f(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.StreamEventTypeInSerializer=void 0;Rs.StreamEventTypeInSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name}}}});var ag=f(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.StreamEventTypePatchSerializer=void 0;Ms.StreamEventTypePatchSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name}}}});var lg=f(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.StreamingEventType=void 0;var PO=og(),ug=sg(),zs=El(),TO=ag(),et=ie(),Pl=class{constructor(t){this.requestCtx=t}list(t){let r=new et.SvixRequest(et.HttpMethod.GET,"/api/v1/stream/event-type");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order,include_archived:t?.includeArchived}),r.send(this.requestCtx,PO.ListResponseStreamEventTypeOutSerializer._fromJsonObject)}create(t,r){let i=new et.SvixRequest(et.HttpMethod.POST,"/api/v1/stream/event-type");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(ug.StreamEventTypeInSerializer._toJsonObject(t)),i.send(this.requestCtx,zs.StreamEventTypeOutSerializer._fromJsonObject)}get(t){let r=new et.SvixRequest(et.HttpMethod.GET,"/api/v1/stream/event-type/{name}");return r.setPathParam("name",t),r.send(this.requestCtx,zs.StreamEventTypeOutSerializer._fromJsonObject)}update(t,r){let i=new et.SvixRequest(et.HttpMethod.PUT,"/api/v1/stream/event-type/{name}");return i.setPathParam("name",t),i.setBody(ug.StreamEventTypeInSerializer._toJsonObject(r)),i.send(this.requestCtx,zs.StreamEventTypeOutSerializer._fromJsonObject)}delete(t,r){let i=new et.SvixRequest(et.HttpMethod.DELETE,"/api/v1/stream/event-type/{name}");return i.setPathParam("name",t),i.setQueryParams({expunge:r?.expunge}),i.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new et.SvixRequest(et.HttpMethod.PATCH,"/api/v1/stream/event-type/{name}");return i.setPathParam("name",t),i.setBody(TO.StreamEventTypePatchSerializer._toJsonObject(r)),i.send(this.requestCtx,zs.StreamEventTypeOutSerializer._fromJsonObject)}};Js.StreamingEventType=Pl});var cg=f(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.EventInSerializer=void 0;Fs.EventInSerializer={_fromJsonObject(e){return{eventType:e.eventType,payload:e.payload}},_toJsonObject(e){return{eventType:e.eventType,payload:e.payload}}}});var Tl=f(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.StreamInSerializer=void 0;Hs.StreamInSerializer={_fromJsonObject(e){return{metadata:e.metadata,name:e.name,uid:e.uid}},_toJsonObject(e){return{metadata:e.metadata,name:e.name,uid:e.uid}}}});var pg=f(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.CreateStreamEventsInSerializer=void 0;var dg=cg(),mg=Tl();Bs.CreateStreamEventsInSerializer={_fromJsonObject(e){return{events:e.events.map(t=>dg.EventInSerializer._fromJsonObject(t)),stream:e.stream!=null?mg.StreamInSerializer._fromJsonObject(e.stream):void 0}},_toJsonObject(e){return{events:e.events.map(t=>dg.EventInSerializer._toJsonObject(t)),stream:e.stream!=null?mg.StreamInSerializer._toJsonObject(e.stream):void 0}}}});var fg=f(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.CreateStreamEventsOutSerializer=void 0;Ls.CreateStreamEventsOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var hg=f(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.EventOutSerializer=void 0;Ns.EventOutSerializer={_fromJsonObject(e){return{eventType:e.eventType,payload:e.payload,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{eventType:e.eventType,payload:e.payload,timestamp:e.timestamp}}}});var bg=f(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.EventStreamOutSerializer=void 0;var gg=hg();Gs.EventStreamOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>gg.EventOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator}},_toJsonObject(e){return{data:e.data.map(t=>gg.EventOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator}}}});var _g=f(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.StreamingEvents=void 0;var IO=pg(),$O=fg(),jO=bg(),Us=ie(),Il=class{constructor(t){this.requestCtx=t}create(t,r,i){let n=new Us.SvixRequest(Us.HttpMethod.POST,"/api/v1/stream/{stream_id}/events");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(IO.CreateStreamEventsInSerializer._toJsonObject(r)),n.send(this.requestCtx,$O.CreateStreamEventsOutSerializer._fromJsonObject)}get(t,r,i){let n=new Us.SvixRequest(Us.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/events");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator,after:i?.after}),n.send(this.requestCtx,jO.EventStreamOutSerializer._fromJsonObject)}};Ws.StreamingEvents=Il});var $l=f(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.AzureBlobStorageConfigSerializer=void 0;Vs.AzureBlobStorageConfigSerializer={_fromJsonObject(e){return{accessKey:e.accessKey,account:e.account,container:e.container}},_toJsonObject(e){return{accessKey:e.accessKey,account:e.account,container:e.container}}}});var jl=f(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.GoogleCloudStorageConfigSerializer=void 0;Ks.GoogleCloudStorageConfigSerializer={_fromJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}},_toJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}}}});var Dl=f(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.S3ConfigSerializer=void 0;Ys.S3ConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey}}}});var ql=f(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.SinkHttpConfigSerializer=void 0;Qs.SinkHttpConfigSerializer={_fromJsonObject(e){return{headers:e.headers,key:e.key,url:e.url}},_toJsonObject(e){return{headers:e.headers,key:e.key,url:e.url}}}});var Rl=f(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.SinkOtelV1ConfigSerializer=void 0;Zs.SinkOtelV1ConfigSerializer={_fromJsonObject(e){return{headers:e.headers,url:e.url}},_toJsonObject(e){return{headers:e.headers,url:e.url}}}});var Ml=f(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.SinkStatusSerializer=Kt.SinkStatus=void 0;var DO;(function(e){e.Enabled="enabled",e.Paused="paused",e.Disabled="disabled",e.Retrying="retrying"})(DO=Kt.SinkStatus||(Kt.SinkStatus={}));Kt.SinkStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var zl=f(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.StreamSinkOutSerializer=void 0;var vg=$l(),yg=jl(),Cg=Dl(),Og=ql(),Sg=Rl(),wg=Ml();Xs.StreamSinkOutSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return vg.AzureBlobStorageConfigSerializer._fromJsonObject(e.config);case"otelTracing":return Sg.SinkOtelV1ConfigSerializer._fromJsonObject(e.config);case"http":return Og.SinkHttpConfigSerializer._fromJsonObject(e.config);case"amazonS3":return Cg.S3ConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return yg.GoogleCloudStorageConfigSerializer._fromJsonObject(e.config);default:throw new Error(`Unexpected type: ${i}`)}}return{type:t,config:r(t),batchSize:e.batchSize,createdAt:new Date(e.createdAt),currentIterator:e.currentIterator,eventTypes:e.eventTypes,failureReason:e.failureReason,id:e.id,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,nextRetryAt:e.nextRetryAt?new Date(e.nextRetryAt):null,status:wg.SinkStatusSerializer._fromJsonObject(e.status),uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){let t;switch(e.type){case"poller":t={};break;case"azureBlobStorage":t=vg.AzureBlobStorageConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=Sg.SinkOtelV1ConfigSerializer._toJsonObject(e.config);break;case"http":t=Og.SinkHttpConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=Cg.S3ConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=yg.GoogleCloudStorageConfigSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,batchSize:e.batchSize,createdAt:e.createdAt,currentIterator:e.currentIterator,eventTypes:e.eventTypes,failureReason:e.failureReason,id:e.id,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,nextRetryAt:e.nextRetryAt,status:wg.SinkStatusSerializer._toJsonObject(e.status),uid:e.uid,updatedAt:e.updatedAt}}}});var kg=f(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.ListResponseStreamSinkOutSerializer=void 0;var xg=zl();ea.ListResponseStreamSinkOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>xg.StreamSinkOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>xg.StreamSinkOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Ag=f(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.SinkSecretOutSerializer=void 0;ta.SinkSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Eg=f(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.SinkTransformInSerializer=void 0;ra.SinkTransformInSerializer={_fromJsonObject(e){return{code:e.code}},_toJsonObject(e){return{code:e.code}}}});var ia=f(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.SinkStatusInSerializer=Yt.SinkStatusIn=void 0;var qO;(function(e){e.Enabled="enabled",e.Disabled="disabled"})(qO=Yt.SinkStatusIn||(Yt.SinkStatusIn={}));Yt.SinkStatusInSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var qg=f(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.StreamSinkInSerializer=void 0;var Pg=$l(),Tg=jl(),Ig=Dl(),$g=ql(),jg=Rl(),Dg=ia();na.StreamSinkInSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return Pg.AzureBlobStorageConfigSerializer._fromJsonObject(e.config);case"otelTracing":return jg.SinkOtelV1ConfigSerializer._fromJsonObject(e.config);case"http":return $g.SinkHttpConfigSerializer._fromJsonObject(e.config);case"amazonS3":return Ig.S3ConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return Tg.GoogleCloudStorageConfigSerializer._fromJsonObject(e.config);default:throw new Error(`Unexpected type: ${i}`)}}return{type:t,config:r(t),batchSize:e.batchSize,eventTypes:e.eventTypes,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,status:e.status!=null?Dg.SinkStatusInSerializer._fromJsonObject(e.status):void 0,uid:e.uid}},_toJsonObject(e){let t;switch(e.type){case"poller":t={};break;case"azureBlobStorage":t=Pg.AzureBlobStorageConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=jg.SinkOtelV1ConfigSerializer._toJsonObject(e.config);break;case"http":t=$g.SinkHttpConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=Ig.S3ConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=Tg.GoogleCloudStorageConfigSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,batchSize:e.batchSize,eventTypes:e.eventTypes,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,status:e.status!=null?Dg.SinkStatusInSerializer._toJsonObject(e.status):void 0,uid:e.uid}}}});var Rg=f(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.AmazonS3PatchConfigSerializer=void 0;oa.AmazonS3PatchConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey}}}});var Mg=f(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.AzureBlobStoragePatchConfigSerializer=void 0;sa.AzureBlobStoragePatchConfigSerializer={_fromJsonObject(e){return{accessKey:e.accessKey,account:e.account,container:e.container}},_toJsonObject(e){return{accessKey:e.accessKey,account:e.account,container:e.container}}}});var zg=f(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.GoogleCloudStoragePatchConfigSerializer=void 0;aa.GoogleCloudStoragePatchConfigSerializer={_fromJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}},_toJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}}}});var Jg=f(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.HttpPatchConfigSerializer=void 0;ua.HttpPatchConfigSerializer={_fromJsonObject(e){return{url:e.url}},_toJsonObject(e){return{url:e.url}}}});var Fg=f(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.OtelTracingPatchConfigSerializer=void 0;la.OtelTracingPatchConfigSerializer={_fromJsonObject(e){return{url:e.url}},_toJsonObject(e){return{url:e.url}}}});var Wg=f(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.StreamSinkPatchSerializer=void 0;var Hg=Rg(),Bg=Mg(),Lg=zg(),Ng=Jg(),Gg=Fg(),Ug=ia();ca.StreamSinkPatchSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return Bg.AzureBlobStoragePatchConfigSerializer._fromJsonObject(e.config);case"otelTracing":return Gg.OtelTracingPatchConfigSerializer._fromJsonObject(e.config);case"http":return Ng.HttpPatchConfigSerializer._fromJsonObject(e.config);case"amazonS3":return Hg.AmazonS3PatchConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return Lg.GoogleCloudStoragePatchConfigSerializer._fromJsonObject(e.config);default:throw new Error(`Unexpected type: ${i}`)}}return{type:t,config:r(t),batchSize:e.batchSize,eventTypes:e.eventTypes,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,status:e.status!=null?Ug.SinkStatusInSerializer._fromJsonObject(e.status):void 0,uid:e.uid}},_toJsonObject(e){let t;switch(e.type){case"poller":t={};break;case"azureBlobStorage":t=Bg.AzureBlobStoragePatchConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=Gg.OtelTracingPatchConfigSerializer._toJsonObject(e.config);break;case"http":t=Ng.HttpPatchConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=Hg.AmazonS3PatchConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=Lg.GoogleCloudStoragePatchConfigSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,batchSize:e.batchSize,eventTypes:e.eventTypes,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,status:e.status!=null?Ug.SinkStatusInSerializer._toJsonObject(e.status):void 0,uid:e.uid}}}});var Yg=f(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.StreamingSink=void 0;var Vg=_l(),RO=Zu(),MO=kg(),zO=Ag(),JO=Eg(),Kg=qg(),da=zl(),FO=Wg(),ve=ie(),Jl=class{constructor(t){this.requestCtx=t}list(t,r){let i=new ve.SvixRequest(ve.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink");return i.setPathParam("stream_id",t),i.setQueryParams({limit:r?.limit,iterator:r?.iterator,order:r?.order}),i.send(this.requestCtx,MO.ListResponseStreamSinkOutSerializer._fromJsonObject)}create(t,r,i){let n=new ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(Kg.StreamSinkInSerializer._toJsonObject(r)),n.send(this.requestCtx,da.StreamSinkOutSerializer._fromJsonObject)}get(t,r){let i=new ve.SvixRequest(ve.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.send(this.requestCtx,da.StreamSinkOutSerializer._fromJsonObject)}update(t,r,i){let n=new ve.SvixRequest(ve.HttpMethod.PUT,"/api/v1/stream/{stream_id}/sink/{sink_id}");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(Kg.StreamSinkInSerializer._toJsonObject(i)),n.send(this.requestCtx,da.StreamSinkOutSerializer._fromJsonObject)}delete(t,r){let i=new ve.SvixRequest(ve.HttpMethod.DELETE,"/api/v1/stream/{stream_id}/sink/{sink_id}");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.sendNoResponseBody(this.requestCtx)}patch(t,r,i){let n=new ve.SvixRequest(ve.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(FO.StreamSinkPatchSerializer._toJsonObject(i)),n.send(this.requestCtx,da.StreamSinkOutSerializer._fromJsonObject)}getSecret(t,r){let i=new ve.SvixRequest(ve.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/secret");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.send(this.requestCtx,zO.SinkSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i,n){let o=new ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink/{sink_id}/secret/rotate");return o.setPathParam("stream_id",t),o.setPathParam("sink_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(RO.EndpointSecretRotateInSerializer._toJsonObject(i)),o.send(this.requestCtx,Vg.EmptyResponseSerializer._fromJsonObject)}transformationPartialUpdate(t,r,i){let n=new ve.SvixRequest(ve.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(JO.SinkTransformInSerializer._toJsonObject(i)),n.send(this.requestCtx,Vg.EmptyResponseSerializer._fromJsonObject)}};ma.StreamingSink=Jl});var Fl=f(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.StreamOutSerializer=void 0;pa.StreamOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),id:e.id,metadata:e.metadata,name:e.name,uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{createdAt:e.createdAt,id:e.id,metadata:e.metadata,name:e.name,uid:e.uid,updatedAt:e.updatedAt}}}});var Zg=f(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.ListResponseStreamOutSerializer=void 0;var Qg=Fl();fa.ListResponseStreamOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Qg.StreamOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Qg.StreamOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Xg=f(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.StreamPatchSerializer=void 0;ha.StreamPatchSerializer={_fromJsonObject(e){return{description:e.description,metadata:e.metadata,uid:e.uid}},_toJsonObject(e){return{description:e.description,metadata:e.metadata,uid:e.uid}}}});var tb=f(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.StreamingStream=void 0;var HO=Zg(),eb=Tl(),ga=Fl(),BO=Xg(),tt=ie(),Hl=class{constructor(t){this.requestCtx=t}list(t){let r=new tt.SvixRequest(tt.HttpMethod.GET,"/api/v1/stream");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,HO.ListResponseStreamOutSerializer._fromJsonObject)}create(t,r){let i=new tt.SvixRequest(tt.HttpMethod.POST,"/api/v1/stream");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(eb.StreamInSerializer._toJsonObject(t)),i.send(this.requestCtx,ga.StreamOutSerializer._fromJsonObject)}get(t){let r=new tt.SvixRequest(tt.HttpMethod.GET,"/api/v1/stream/{stream_id}");return r.setPathParam("stream_id",t),r.send(this.requestCtx,ga.StreamOutSerializer._fromJsonObject)}update(t,r){let i=new tt.SvixRequest(tt.HttpMethod.PUT,"/api/v1/stream/{stream_id}");return i.setPathParam("stream_id",t),i.setBody(eb.StreamInSerializer._toJsonObject(r)),i.send(this.requestCtx,ga.StreamOutSerializer._fromJsonObject)}delete(t){let r=new tt.SvixRequest(tt.HttpMethod.DELETE,"/api/v1/stream/{stream_id}");return r.setPathParam("stream_id",t),r.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new tt.SvixRequest(tt.HttpMethod.PATCH,"/api/v1/stream/{stream_id}");return i.setPathParam("stream_id",t),i.setBody(BO.StreamPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,ga.StreamOutSerializer._fromJsonObject)}};ba.StreamingStream=Hl});var ib=f(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.Streaming=void 0;var rb=Yu(),LO=rg(),NO=ig(),GO=lg(),UO=_g(),WO=Yg(),VO=tb(),pr=ie(),Bl=class{constructor(t){this.requestCtx=t}get event_type(){return new GO.StreamingEventType(this.requestCtx)}get events(){return new UO.StreamingEvents(this.requestCtx)}get sink(){return new WO.StreamingSink(this.requestCtx)}get stream(){return new VO.StreamingStream(this.requestCtx)}sinkHeadersGet(t,r){let i=new pr.SvixRequest(pr.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.send(this.requestCtx,rb.EndpointHeadersOutSerializer._fromJsonObject)}sinkHeadersPatch(t,r,i){let n=new pr.SvixRequest(pr.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(LO.HttpSinkHeadersPatchInSerializer._toJsonObject(i)),n.send(this.requestCtx,rb.EndpointHeadersOutSerializer._fromJsonObject)}sinkTransformationGet(t,r){let i=new pr.SvixRequest(pr.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.send(this.requestCtx,NO.SinkTransformationOutSerializer._fromJsonObject)}};_a.Streaming=Bl});var nb=f(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.HTTPValidationError=At.ValidationError=At.HttpErrorOut=void 0;var fr=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};At.HttpErrorOut=fr;fr.discriminator=void 0;fr.mapping=void 0;fr.attributeTypeMap=[{name:"code",baseName:"code",type:"string",format:""},{name:"detail",baseName:"detail",type:"string",format:""}];var hr=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};At.ValidationError=hr;hr.discriminator=void 0;hr.mapping=void 0;hr.attributeTypeMap=[{name:"loc",baseName:"loc",type:"Array<string>",format:""},{name:"msg",baseName:"msg",type:"string",format:""},{name:"type",baseName:"type",type:"string",format:""}];var gr=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};At.HTTPValidationError=gr;gr.discriminator=void 0;gr.mapping=void 0;gr.attributeTypeMap=[{name:"detail",baseName:"detail",type:"Array<ValidationError>",format:""}]});var sb=f(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.timingSafeEqual=void 0;function ob(e,t=""){if(!e)throw new Error(t)}function KO(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)),ob(e instanceof DataView),ob(t instanceof DataView);let r=e.byteLength,i=0,n=-1;for(;++n<r;)i|=e.getUint8(n)^t.getUint8(n);return i===0}va.timingSafeEqual=KO});var lb=f(Ge=>{"use strict";var YO=Ge&&Ge.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},e(t,r)};return function(t,r){e(t,r);function i(){this.constructor=t}t.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})();Object.defineProperty(Ge,"__esModule",{value:!0});var ce=256,Ll=(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 r="",i=0;i<t.length-2;i+=3){var n=t[i]<<16|t[i+1]<<8|t[i+2];r+=this._encodeByte(n>>>18&63),r+=this._encodeByte(n>>>12&63),r+=this._encodeByte(n>>>6&63),r+=this._encodeByte(n>>>0&63)}var o=t.length-i;if(o>0){var n=t[i]<<16|(o===2?t[i+1]<<8:0);r+=this._encodeByte(n>>>18&63),r+=this._encodeByte(n>>>12&63),o===2?r+=this._encodeByte(n>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},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 r=this._getPaddingLength(t),i=t.length-r,n=new Uint8Array(this.maxDecodedLength(i)),o=0,s=0,a=0,u=0,d=0,l=0,c=0;s<i-4;s+=4)u=this._decodeChar(t.charCodeAt(s+0)),d=this._decodeChar(t.charCodeAt(s+1)),l=this._decodeChar(t.charCodeAt(s+2)),c=this._decodeChar(t.charCodeAt(s+3)),n[o++]=u<<2|d>>>4,n[o++]=d<<4|l>>>2,n[o++]=l<<6|c,a|=u&ce,a|=d&ce,a|=l&ce,a|=c&ce;if(s<i-1&&(u=this._decodeChar(t.charCodeAt(s)),d=this._decodeChar(t.charCodeAt(s+1)),n[o++]=u<<2|d>>>4,a|=u&ce,a|=d&ce),s<i-2&&(l=this._decodeChar(t.charCodeAt(s+2)),n[o++]=d<<4|l>>>2,a|=l&ce),s<i-3&&(c=this._decodeChar(t.charCodeAt(s+3)),n[o++]=l<<6|c,a|=c&ce),a!==0)throw new Error("Base64Coder: incorrect characters for decoding");return n},e.prototype._encodeByte=function(t){var r=t;return r+=65,r+=25-t>>>8&6,r+=51-t>>>8&-75,r+=61-t>>>8&-15,r+=62-t>>>8&3,String.fromCharCode(r)},e.prototype._decodeChar=function(t){var r=ce;return r+=(42-t&t-44)>>>8&-ce+t-43+62,r+=(46-t&t-48)>>>8&-ce+t-47+63,r+=(47-t&t-58)>>>8&-ce+t-48+52,r+=(64-t&t-91)>>>8&-ce+t-65+0,r+=(96-t&t-123)>>>8&-ce+t-97+26,r},e.prototype._getPaddingLength=function(t){var r=0;if(this._paddingCharacter){for(var i=t.length-1;i>=0&&t[i]===this._paddingCharacter;i--)r++;if(t.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},e})();Ge.Coder=Ll;var Zr=new Ll;function QO(e){return Zr.encode(e)}Ge.encode=QO;function ZO(e){return Zr.decode(e)}Ge.decode=ZO;var ab=(function(e){YO(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(r){var i=r;return i+=65,i+=25-r>>>8&6,i+=51-r>>>8&-75,i+=61-r>>>8&-13,i+=62-r>>>8&49,String.fromCharCode(i)},t.prototype._decodeChar=function(r){var i=ce;return i+=(44-r&r-46)>>>8&-ce+r-45+62,i+=(94-r&r-96)>>>8&-ce+r-95+63,i+=(47-r&r-58)>>>8&-ce+r-48+52,i+=(64-r&r-91)>>>8&-ce+r-65+0,i+=(96-r&r-123)>>>8&-ce+r-97+26,i},t})(Ll);Ge.URLSafeCoder=ab;var ub=new ab;function XO(e){return ub.encode(e)}Ge.encodeURLSafe=XO;function eS(e){return ub.decode(e)}Ge.decodeURLSafe=eS;Ge.encodedLength=function(e){return Zr.encodedLength(e)};Ge.maxDecodedLength=function(e){return Zr.maxDecodedLength(e)};Ge.decodedLength=function(e){return Zr.decodedLength(e)}});var db=f((cb,ya)=>{(function(e,t){var r={};t(r);var i=r.default;for(var n in r)i[n]=r[n];typeof ya=="object"&&typeof ya.exports=="object"?ya.exports=i:typeof define=="function"&&define.amd?define(function(){return i}):e.sha256=i})(cb,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 r(c,m,v,b,_){for(var S,x,w,A,M,P,$,I,E,j,Ae,oe,qt;_>=64;){for(S=m[0],x=m[1],w=m[2],A=m[3],M=m[4],P=m[5],$=m[6],I=m[7],j=0;j<16;j++)Ae=b+j*4,c[j]=(v[Ae]&255)<<24|(v[Ae+1]&255)<<16|(v[Ae+2]&255)<<8|v[Ae+3]&255;for(j=16;j<64;j++)E=c[j-2],oe=(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10,E=c[j-15],qt=(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3,c[j]=(oe+c[j-7]|0)+(qt+c[j-16]|0);for(j=0;j<64;j++)oe=(((M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7))+(M&P^~M&$)|0)+(I+(t[j]+c[j]|0)|0)|0,qt=((S>>>2|S<<30)^(S>>>13|S<<19)^(S>>>22|S<<10))+(S&x^S&w^x&w)|0,I=$,$=P,P=M,M=A+oe|0,A=w,w=x,x=S,S=oe+qt|0;m[0]+=S,m[1]+=x,m[2]+=w,m[3]+=A,m[4]+=M,m[5]+=P,m[6]+=$,m[7]+=I,b+=64,_-=64}return b}var i=(function(){function c(){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 c.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},c.prototype.clean=function(){for(var m=0;m<this.buffer.length;m++)this.buffer[m]=0;for(var m=0;m<this.temp.length;m++)this.temp[m]=0;this.reset()},c.prototype.update=function(m,v){if(v===void 0&&(v=m.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var b=0;if(this.bytesHashed+=v,this.bufferLength>0){for(;this.bufferLength<64&&v>0;)this.buffer[this.bufferLength++]=m[b++],v--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(v>=64&&(b=r(this.temp,this.state,m,b,v),v%=64);v>0;)this.buffer[this.bufferLength++]=m[b++],v--;return this},c.prototype.finish=function(m){if(!this.finished){var v=this.bytesHashed,b=this.bufferLength,_=v/536870912|0,S=v<<3,x=v%64<56?64:128;this.buffer[b]=128;for(var w=b+1;w<x-8;w++)this.buffer[w]=0;this.buffer[x-8]=_>>>24&255,this.buffer[x-7]=_>>>16&255,this.buffer[x-6]=_>>>8&255,this.buffer[x-5]=_>>>0&255,this.buffer[x-4]=S>>>24&255,this.buffer[x-3]=S>>>16&255,this.buffer[x-2]=S>>>8&255,this.buffer[x-1]=S>>>0&255,r(this.temp,this.state,this.buffer,0,x),this.finished=!0}for(var w=0;w<8;w++)m[w*4+0]=this.state[w]>>>24&255,m[w*4+1]=this.state[w]>>>16&255,m[w*4+2]=this.state[w]>>>8&255,m[w*4+3]=this.state[w]>>>0&255;return this},c.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},c.prototype._saveState=function(m){for(var v=0;v<this.state.length;v++)m[v]=this.state[v]},c.prototype._restoreState=function(m,v){for(var b=0;b<this.state.length;b++)this.state[b]=m[b];this.bytesHashed=v,this.finished=!1,this.bufferLength=0},c})();e.Hash=i;var n=(function(){function c(m){this.inner=new i,this.outer=new i,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var v=new Uint8Array(this.blockSize);if(m.length>this.blockSize)new i().update(m).finish(v).clean();else for(var b=0;b<m.length;b++)v[b]=m[b];for(var b=0;b<v.length;b++)v[b]^=54;this.inner.update(v);for(var b=0;b<v.length;b++)v[b]^=106;this.outer.update(v),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var b=0;b<v.length;b++)v[b]=0}return c.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},c.prototype.clean=function(){for(var m=0;m<this.istate.length;m++)this.ostate[m]=this.istate[m]=0;this.inner.clean(),this.outer.clean()},c.prototype.update=function(m){return this.inner.update(m),this},c.prototype.finish=function(m){return this.outer.finished?this.outer.finish(m):(this.inner.finish(m),this.outer.update(m,this.digestLength).finish(m)),this},c.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},c})();e.HMAC=n;function o(c){var m=new i().update(c),v=m.digest();return m.clean(),v}e.hash=o,e.default=o;function s(c,m){var v=new n(c).update(m),b=v.digest();return v.clean(),b}e.hmac=s;function a(c,m,v,b){var _=b[0];if(_===0)throw new Error("hkdf: cannot expand more");m.reset(),_>1&&m.update(c),v&&m.update(v),m.update(b),m.finish(c),b[0]++}var u=new Uint8Array(e.digestLength);function d(c,m,v,b){m===void 0&&(m=u),b===void 0&&(b=32);for(var _=new Uint8Array([1]),S=s(m,c),x=new n(S),w=new Uint8Array(x.digestLength),A=w.length,M=new Uint8Array(b),P=0;P<b;P++)A===w.length&&(a(w,x,v,_),A=0),M[P]=w[A++];return x.clean(),w.fill(0),_.fill(0),M}e.hkdf=d;function l(c,m,v,b){for(var _=new n(c),S=_.digestLength,x=new Uint8Array(4),w=new Uint8Array(S),A=new Uint8Array(S),M=new Uint8Array(b),P=0;P*S<b;P++){var $=P+1;x[0]=$>>>24&255,x[1]=$>>>16&255,x[2]=$>>>8&255,x[3]=$>>>0&255,_.reset(),_.update(m),_.update(x),_.finish(A);for(var I=0;I<S;I++)w[I]=A[I];for(var I=2;I<=v;I++){_.reset(),_.update(A).finish(A);for(var E=0;E<S;E++)w[E]^=A[E]}for(var I=0;I<S&&P*S+I<b;I++)M[P*S+I]=w[I]}for(var P=0;P<S;P++)w[P]=A[P]=0;for(var P=0;P<4;P++)x[P]=0;return _.clean(),M}e.pbkdf2=l})});var Gl=f(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.Webhook=br.WebhookVerificationError=void 0;var tS=sb(),mb=lb(),rS=db(),pb=300,Nl=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},Et=class e extends Nl{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};br.WebhookVerificationError=Et;var Ca=class e{constructor(t,r){if(!t)throw new Error("Secret can't be empty.");if(r?.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=mb.decode(t)}}verify(t,r){let i={};for(let m of Object.keys(r))i[m.toLowerCase()]=r[m];let n=i["webhook-id"],o=i["webhook-signature"],s=i["webhook-timestamp"];if(!o||!n||!s)throw new Et("Missing required headers");let a=this.verifyTimestamp(s),d=this.sign(n,a,t).split(",")[1],l=o.split(" "),c=new globalThis.TextEncoder;for(let m of l){let[v,b]=m.split(",");if(v==="v1"&&(0,tS.timingSafeEqual)(c.encode(b),c.encode(d)))return JSON.parse(t.toString())}throw new Et("No matching signature found")}sign(t,r,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 n=new TextEncoder,o=Math.floor(r.getTime()/1e3),s=n.encode(`${t}.${o}.${i}`);return`v1,${mb.encode(rS.hmac(this.key,s))}`}verifyTimestamp(t){let r=Math.floor(Date.now()/1e3),i=parseInt(t,10);if(isNaN(i))throw new Et("Invalid Signature Headers");if(r-i>pb)throw new Et("Message timestamp too old");if(i>r+pb)throw new Et("Message timestamp too new");return new Date(i*1e3)}};br.Webhook=Ca;Ca.prefix="whsec_"});var fb=f(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.Webhook=_r.WebhookVerificationError=void 0;var iS=Gl(),nS=Gl();Object.defineProperty(_r,"WebhookVerificationError",{enumerable:!0,get:function(){return nS.WebhookVerificationError}});var Ul=class{constructor(t,r){this.inner=new iS.Webhook(t,r)}verify(t,r){var i,n,o,s,a,u;let d={};for(let l of Object.keys(r))d[l.toLowerCase()]=r[l];return d["webhook-id"]=(n=(i=d["svix-id"])!==null&&i!==void 0?i:d["webhook-id"])!==null&&n!==void 0?n:"",d["webhook-signature"]=(s=(o=d["svix-signature"])!==null&&o!==void 0?o:d["webhook-signature"])!==null&&s!==void 0?s:"",d["webhook-timestamp"]=(u=(a=d["svix-timestamp"])!==null&&a!==void 0?a:d["webhook-timestamp"])!==null&&u!==void 0?u:"",this.inner.verify(t,d)}sign(t,r,i){return this.inner.sign(t,r,i)}};_r.Webhook=Ul});var hb=f(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.EndpointDisabledTriggerSerializer=Qt.EndpointDisabledTrigger=void 0;var oS;(function(e){e.Manual="manual",e.Automatic="automatic"})(oS=Qt.EndpointDisabledTrigger||(Qt.EndpointDisabledTrigger={}));Qt.EndpointDisabledTriggerSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var gb=f(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.OrderingSerializer=Zt.Ordering=void 0;var sS;(function(e){e.Ascending="ascending",e.Descending="descending"})(sS=Zt.Ordering||(Zt.Ordering={}));Zt.OrderingSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var bb=f(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.StatusCodeClass=Z.SinkStatusIn=Z.SinkStatus=Z.Ordering=Z.MessageStatusText=Z.MessageStatus=Z.MessageAttemptTriggerType=Z.EndpointDisabledTrigger=Z.ConnectorProduct=Z.ConnectorKind=Z.BackgroundTaskType=Z.BackgroundTaskStatus=Z.AppPortalCapability=void 0;var aS=Bu();Object.defineProperty(Z,"AppPortalCapability",{enumerable:!0,get:function(){return aS.AppPortalCapability}});var uS=xt();Object.defineProperty(Z,"BackgroundTaskStatus",{enumerable:!0,get:function(){return uS.BackgroundTaskStatus}});var lS=kt();Object.defineProperty(Z,"BackgroundTaskType",{enumerable:!0,get:function(){return lS.BackgroundTaskType}});var cS=lr();Object.defineProperty(Z,"ConnectorKind",{enumerable:!0,get:function(){return cS.ConnectorKind}});var dS=Li();Object.defineProperty(Z,"ConnectorProduct",{enumerable:!0,get:function(){return dS.ConnectorProduct}});var mS=hb();Object.defineProperty(Z,"EndpointDisabledTrigger",{enumerable:!0,get:function(){return mS.EndpointDisabledTrigger}});var pS=vl();Object.defineProperty(Z,"MessageAttemptTriggerType",{enumerable:!0,get:function(){return pS.MessageAttemptTriggerType}});var fS=cr();Object.defineProperty(Z,"MessageStatus",{enumerable:!0,get:function(){return fS.MessageStatus}});var hS=Qr();Object.defineProperty(Z,"MessageStatusText",{enumerable:!0,get:function(){return hS.MessageStatusText}});var gS=gb();Object.defineProperty(Z,"Ordering",{enumerable:!0,get:function(){return gS.Ordering}});var bS=Ml();Object.defineProperty(Z,"SinkStatus",{enumerable:!0,get:function(){return bS.SinkStatus}});var _S=ia();Object.defineProperty(Z,"SinkStatusIn",{enumerable:!0,get:function(){return _S.SinkStatusIn}});var vS=Ku();Object.defineProperty(Z,"StatusCodeClass",{enumerable:!0,get:function(){return vS.StatusCodeClass}})});var vb=f(de=>{"use strict";var yS=de&&de.__createBinding||(Object.create?(function(e,t,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}):(function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]})),_b=de&&de.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&yS(t,e,r)};Object.defineProperty(de,"__esModule",{value:!0});de.Svix=de.messageInRaw=de.ValidationError=de.HttpErrorOut=de.HTTPValidationError=de.ApiException=void 0;var CS=jd(),OS=Gd(),SS=Yd(),wS=am(),xS=jm(),kS=Fm(),AS=Qm(),ES=Xm(),PS=Yf(),TS=ih(),IS=bl(),$S=zh(),jS=Wh(),DS=tg(),qS=ib(),RS=xl(),MS=Mu();Object.defineProperty(de,"ApiException",{enumerable:!0,get:function(){return MS.ApiException}});var Vl=nb();Object.defineProperty(de,"HTTPValidationError",{enumerable:!0,get:function(){return Vl.HTTPValidationError}});Object.defineProperty(de,"HttpErrorOut",{enumerable:!0,get:function(){return Vl.HttpErrorOut}});Object.defineProperty(de,"ValidationError",{enumerable:!0,get:function(){return Vl.ValidationError}});_b(fb(),de);_b(bb(),de);var zS=bl();Object.defineProperty(de,"messageInRaw",{enumerable:!0,get:function(){return zS.messageInRaw}});var JS=[{region:"us",url:"https://api.us.svix.com"},{region:"eu",url:"https://api.eu.svix.com"},{region:"in",url:"https://api.in.svix.com"},{region:"ca",url:"https://api.ca.svix.com"},{region:"au",url:"https://api.au.svix.com"}],Wl=class{constructor(t,r={}){var i,n,o;let s=(i=JS.find(u=>u.region===t.split(".")[1]))===null||i===void 0?void 0:i.url,a=(o=(n=r.serverUrl)!==null&&n!==void 0?n:s)!==null&&o!==void 0?o:"https://api.svix.com";if(r.retryScheduleInMs){this.requestCtx={baseUrl:a,token:t,timeout:r.requestTimeout,retryScheduleInMs:r.retryScheduleInMs,fetch:r.fetch};return}if(r.numRetries){this.requestCtx={baseUrl:a,token:t,timeout:r.requestTimeout,numRetries:r.numRetries,fetch:r.fetch};return}this.requestCtx={baseUrl:a,token:t,timeout:r.requestTimeout,fetch:r.fetch}}get application(){return new CS.Application(this.requestCtx)}get authentication(){return new OS.Authentication(this.requestCtx)}get backgroundTask(){return new SS.BackgroundTask(this.requestCtx)}get connector(){return new wS.Connector(this.requestCtx)}get endpoint(){return new xS.Endpoint(this.requestCtx)}get environment(){return new kS.Environment(this.requestCtx)}get eventType(){return new AS.EventType(this.requestCtx)}get health(){return new ES.Health(this.requestCtx)}get ingest(){return new PS.Ingest(this.requestCtx)}get integration(){return new TS.Integration(this.requestCtx)}get message(){return new IS.Message(this.requestCtx)}get messageAttempt(){return new $S.MessageAttempt(this.requestCtx)}get operationalWebhook(){return new jS.OperationalWebhook(this.requestCtx)}get statistics(){return new DS.Statistics(this.requestCtx)}get streaming(){return new qS.Streaming(this.requestCtx)}get operationalWebhookEndpoint(){return new RS.OperationalWebhookEndpoint(this.requestCtx)}};de.Svix=Wl});var Sa,Tb=De(()=>{"use strict";Sa=class extends Error{constructor(t){super(`Credentials file is corrupted or contains invalid JSON: ${t}
|
|
24
|
+
`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in W.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,W.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new fu(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),l=this.getOptionValue(a),d=this.options.find(u=>u.negate&&a===u.attributeName()),c=this.options.find(u=>!u.negate&&a===u.attributeName());return d&&(d.presetArg===void 0&&l===!1||d.presetArg!==void 0&&l===d.presetArg)?d:c||s},i=s=>{let a=n(s),l=a.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=Di(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=Di(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
25
|
+
`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>du(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=Je.basename(e,Je.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,o;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(W.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
|
|
26
|
+
Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s}
|
|
27
|
+
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Si(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function _n(){if(W.env.NO_COLOR||W.env.FORCE_COLOR==="0"||W.env.FORCE_COLOR==="false")return!1;if(W.env.FORCE_COLOR||W.env.CLICOLOR_FORCE!==void 0)return!0}xn.Command=wn;xn.useColor=_n});var ji=Ae(Re=>{var{Argument:Oi}=pr(),{Command:An}=Ti(),{CommanderError:hu,InvalidArgumentError:Ii}=Kt(),{Help:gu}=fn(),{Option:Pi}=yn();Re.program=new An;Re.createCommand=t=>new An(t);Re.createOption=(t,e)=>new Pi(t,e);Re.createArgument=(t,e)=>new Oi(t,e);Re.Command=An;Re.Option=Pi;Re.Argument=Oi;Re.Help=gu;Re.CommanderError=hu;Re.InvalidArgumentError=Ii;Re.InvalidOptionArgumentError=Ii});var Fi=Ae((Te,Ri)=>{var Le=ji();Te=Ri.exports={};Te.program=new Le.Command;Te.Argument=Le.Argument;Te.Command=Le.Command;Te.CommanderError=Le.CommanderError;Te.Help=Le.Help;Te.InvalidArgumentError=Le.InvalidArgumentError;Te.InvalidOptionArgumentError=Le.InvalidArgumentError;Te.Option=Le.Option;Te.createCommand=t=>new Le.Command(t);Te.createOption=(t,e)=>new Le.Option(t,e);Te.createArgument=(t,e)=>new Le.Argument(t,e)});var et=Ae((Rp,kn)=>{var gr=process||{},Hi=gr.argv||[],hr=gr.env||{},bu=!(hr.NO_COLOR||Hi.includes("--no-color"))&&(!!hr.FORCE_COLOR||Hi.includes("--color")||gr.platform==="win32"||(gr.stdout||{}).isTTY&&hr.TERM!=="dumb"||!!hr.CI),yu=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+vu(i,e,r,o)+e:t+i+e},vu=(t,e,r,n)=>{let i="",o=0;do i+=t.substring(o,n)+r,o=n+e.length,n=t.indexOf(e,o);while(~n);return i+t.substring(o)},Li=(t=bu)=>{let e=t?yu:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};kn.exports=Li();kn.exports.createColors=Li});var Tn=Ae((Up,to)=>{"use strict";var Sn={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Fu={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Bu={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Sn.up():"");return t&&(e+=Sn.left),e}};to.exports={cursor:Sn,scroll:Fu,erase:Bu,beep:"\x07"}});var Fn,bo=xe(()=>{Fn={name:"resend-cli",version:"2.5.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.2.2",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.0","esbuild-wasm":"0.28.0",picocolors:"1.1.1",resend:"6.14.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.19.0",tsx:"4.22.3",typescript:"5.9.3",vitest:"4.1.7"}}});var te,yo,ht=xe(()=>{"use strict";bo();te=Fn.version,yo=Fn.name});var So=Ae(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.timingSafeEqual=void 0;function Do(t,e=""){if(!t)throw new Error(e)}function pd(t,e){if(t.byteLength!==e.byteLength)return!1;t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),Do(t instanceof DataView),Do(e instanceof DataView);let r=t.byteLength,n=0,i=-1;for(;++i<r;)n|=t.getUint8(i)^e.getUint8(i);return n===0}Sr.timingSafeEqual=pd});var Io=Ae(Ie=>{"use strict";var fd=Ie&&Ie.__extends||(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(Ie,"__esModule",{value:!0});var ne=256,Wn=(function(){function t(e){e===void 0&&(e="="),this._paddingCharacter=e}return t.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(e*8+5)/6|0},t.prototype.encode=function(e){for(var r="",n=0;n<e.length-2;n+=3){var i=e[n]<<16|e[n+1]<<8|e[n+2];r+=this._encodeByte(i>>>18&63),r+=this._encodeByte(i>>>12&63),r+=this._encodeByte(i>>>6&63),r+=this._encodeByte(i>>>0&63)}var o=e.length-n;if(o>0){var i=e[n]<<16|(o===2?e[n+1]<<8:0);r+=this._encodeByte(i>>>18&63),r+=this._encodeByte(i>>>12&63),o===2?r+=this._encodeByte(i>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},t.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(e*6+7)/8|0},t.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},t.prototype.decode=function(e){if(e.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(e),n=e.length-r,i=new Uint8Array(this.maxDecodedLength(n)),o=0,s=0,a=0,l=0,d=0,c=0,u=0;s<n-4;s+=4)l=this._decodeChar(e.charCodeAt(s+0)),d=this._decodeChar(e.charCodeAt(s+1)),c=this._decodeChar(e.charCodeAt(s+2)),u=this._decodeChar(e.charCodeAt(s+3)),i[o++]=l<<2|d>>>4,i[o++]=d<<4|c>>>2,i[o++]=c<<6|u,a|=l&ne,a|=d&ne,a|=c&ne,a|=u≠if(s<n-1&&(l=this._decodeChar(e.charCodeAt(s)),d=this._decodeChar(e.charCodeAt(s+1)),i[o++]=l<<2|d>>>4,a|=l&ne,a|=d&ne),s<n-2&&(c=this._decodeChar(e.charCodeAt(s+2)),i[o++]=d<<4|c>>>2,a|=c&ne),s<n-3&&(u=this._decodeChar(e.charCodeAt(s+3)),i[o++]=c<<6|u,a|=u&ne),a!==0)throw new Error("Base64Coder: incorrect characters for decoding");return i},t.prototype._encodeByte=function(e){var r=e;return r+=65,r+=25-e>>>8&6,r+=51-e>>>8&-75,r+=61-e>>>8&-15,r+=62-e>>>8&3,String.fromCharCode(r)},t.prototype._decodeChar=function(e){var r=ne;return r+=(42-e&e-44)>>>8&-ne+e-43+62,r+=(46-e&e-48)>>>8&-ne+e-47+63,r+=(47-e&e-58)>>>8&-ne+e-48+52,r+=(64-e&e-91)>>>8&-ne+e-65+0,r+=(96-e&e-123)>>>8&-ne+e-97+26,r},t.prototype._getPaddingLength=function(e){var r=0;if(this._paddingCharacter){for(var n=e.length-1;n>=0&&e[n]===this._paddingCharacter;n--)r++;if(e.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},t})();Ie.Coder=Wn;var nr=new Wn;function hd(t){return nr.encode(t)}Ie.encode=hd;function gd(t){return nr.decode(t)}Ie.decode=gd;var To=(function(t){fd(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._encodeByte=function(r){var n=r;return n+=65,n+=25-r>>>8&6,n+=51-r>>>8&-75,n+=61-r>>>8&-13,n+=62-r>>>8&49,String.fromCharCode(n)},e.prototype._decodeChar=function(r){var n=ne;return n+=(44-r&r-46)>>>8&-ne+r-45+62,n+=(94-r&r-96)>>>8&-ne+r-95+63,n+=(47-r&r-58)>>>8&-ne+r-48+52,n+=(64-r&r-91)>>>8&-ne+r-65+0,n+=(96-r&r-123)>>>8&-ne+r-97+26,n},e})(Wn);Ie.URLSafeCoder=To;var Oo=new To;function bd(t){return Oo.encode(t)}Ie.encodeURLSafe=bd;function yd(t){return Oo.decode(t)}Ie.decodeURLSafe=yd;Ie.encodedLength=function(t){return nr.encodedLength(t)};Ie.maxDecodedLength=function(t){return nr.maxDecodedLength(t)};Ie.decodedLength=function(t){return nr.decodedLength(t)}});var jo=Ae((Po,Tr)=>{(function(t,e){var r={};e(r);var n=r.default;for(var i in r)n[i]=r[i];typeof Tr=="object"&&typeof Tr.exports=="object"?Tr.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(Po,function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=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 r(u,m,y,g,b){for(var _,A,x,$,F,D,O,T,E,I,ge,Z,pt;b>=64;){for(_=m[0],A=m[1],x=m[2],$=m[3],F=m[4],D=m[5],O=m[6],T=m[7],I=0;I<16;I++)ge=g+I*4,u[I]=(y[ge]&255)<<24|(y[ge+1]&255)<<16|(y[ge+2]&255)<<8|y[ge+3]&255;for(I=16;I<64;I++)E=u[I-2],Z=(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10,E=u[I-15],pt=(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3,u[I]=(Z+u[I-7]|0)+(pt+u[I-16]|0);for(I=0;I<64;I++)Z=(((F>>>6|F<<26)^(F>>>11|F<<21)^(F>>>25|F<<7))+(F&D^~F&O)|0)+(T+(e[I]+u[I]|0)|0)|0,pt=((_>>>2|_<<30)^(_>>>13|_<<19)^(_>>>22|_<<10))+(_&A^_&x^A&x)|0,T=O,O=D,D=F,F=$+Z|0,$=x,x=A,A=_,_=Z+pt|0;m[0]+=_,m[1]+=A,m[2]+=x,m[3]+=$,m[4]+=F,m[5]+=D,m[6]+=O,m[7]+=T,g+=64,b-=64}return g}var n=(function(){function u(){this.digestLength=t.digestLength,this.blockSize=t.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 u.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},u.prototype.clean=function(){for(var m=0;m<this.buffer.length;m++)this.buffer[m]=0;for(var m=0;m<this.temp.length;m++)this.temp[m]=0;this.reset()},u.prototype.update=function(m,y){if(y===void 0&&(y=m.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var g=0;if(this.bytesHashed+=y,this.bufferLength>0){for(;this.bufferLength<64&&y>0;)this.buffer[this.bufferLength++]=m[g++],y--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(y>=64&&(g=r(this.temp,this.state,m,g,y),y%=64);y>0;)this.buffer[this.bufferLength++]=m[g++],y--;return this},u.prototype.finish=function(m){if(!this.finished){var y=this.bytesHashed,g=this.bufferLength,b=y/536870912|0,_=y<<3,A=y%64<56?64:128;this.buffer[g]=128;for(var x=g+1;x<A-8;x++)this.buffer[x]=0;this.buffer[A-8]=b>>>24&255,this.buffer[A-7]=b>>>16&255,this.buffer[A-6]=b>>>8&255,this.buffer[A-5]=b>>>0&255,this.buffer[A-4]=_>>>24&255,this.buffer[A-3]=_>>>16&255,this.buffer[A-2]=_>>>8&255,this.buffer[A-1]=_>>>0&255,r(this.temp,this.state,this.buffer,0,A),this.finished=!0}for(var x=0;x<8;x++)m[x*4+0]=this.state[x]>>>24&255,m[x*4+1]=this.state[x]>>>16&255,m[x*4+2]=this.state[x]>>>8&255,m[x*4+3]=this.state[x]>>>0&255;return this},u.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},u.prototype._saveState=function(m){for(var y=0;y<this.state.length;y++)m[y]=this.state[y]},u.prototype._restoreState=function(m,y){for(var g=0;g<this.state.length;g++)this.state[g]=m[g];this.bytesHashed=y,this.finished=!1,this.bufferLength=0},u})();t.Hash=n;var i=(function(){function u(m){this.inner=new n,this.outer=new n,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var y=new Uint8Array(this.blockSize);if(m.length>this.blockSize)new n().update(m).finish(y).clean();else for(var g=0;g<m.length;g++)y[g]=m[g];for(var g=0;g<y.length;g++)y[g]^=54;this.inner.update(y);for(var g=0;g<y.length;g++)y[g]^=106;this.outer.update(y),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var g=0;g<y.length;g++)y[g]=0}return u.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},u.prototype.clean=function(){for(var m=0;m<this.istate.length;m++)this.ostate[m]=this.istate[m]=0;this.inner.clean(),this.outer.clean()},u.prototype.update=function(m){return this.inner.update(m),this},u.prototype.finish=function(m){return this.outer.finished?this.outer.finish(m):(this.inner.finish(m),this.outer.update(m,this.digestLength).finish(m)),this},u.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},u})();t.HMAC=i;function o(u){var m=new n().update(u),y=m.digest();return m.clean(),y}t.hash=o,t.default=o;function s(u,m){var y=new i(u).update(m),g=y.digest();return y.clean(),g}t.hmac=s;function a(u,m,y,g){var b=g[0];if(b===0)throw new Error("hkdf: cannot expand more");m.reset(),b>1&&m.update(u),y&&m.update(y),m.update(g),m.finish(u),g[0]++}var l=new Uint8Array(t.digestLength);function d(u,m,y,g){m===void 0&&(m=l),g===void 0&&(g=32);for(var b=new Uint8Array([1]),_=s(m,u),A=new i(_),x=new Uint8Array(A.digestLength),$=x.length,F=new Uint8Array(g),D=0;D<g;D++)$===x.length&&(a(x,A,y,b),$=0),F[D]=x[$++];return A.clean(),x.fill(0),b.fill(0),F}t.hkdf=d;function c(u,m,y,g){for(var b=new i(u),_=b.digestLength,A=new Uint8Array(4),x=new Uint8Array(_),$=new Uint8Array(_),F=new Uint8Array(g),D=0;D*_<g;D++){var O=D+1;A[0]=O>>>24&255,A[1]=O>>>16&255,A[2]=O>>>8&255,A[3]=O>>>0&255,b.reset(),b.update(m),b.update(A),b.finish($);for(var T=0;T<_;T++)x[T]=$[T];for(var T=2;T<=y;T++){b.reset(),b.update($).finish($);for(var E=0;E<_;E++)x[E]^=$[E]}for(var T=0;T<_&&D*_+T<g;T++)F[D*_+T]=x[T]}for(var D=0;D<_;D++)x[D]=$[D]=0;for(var D=0;D<4;D++)A[D]=0;return b.clean(),F}t.pbkdf2=c})});var Bo=Ae(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.Webhook=Et.WebhookVerificationError=void 0;var vd=So(),Ro=Io(),Cd=jo(),Fo=300,Vn=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="ExtendableError",this.stack=new Error(e).stack}},ot=class t extends Vn{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};Et.WebhookVerificationError=ot;var Or=class t{constructor(e,r){if(!e)throw new Error("Secret can't be empty.");if(r?.format==="raw")e instanceof Uint8Array?this.key=e:this.key=Uint8Array.from(e,n=>n.charCodeAt(0));else{if(typeof e!="string")throw new Error("Expected secret to be of type string");e.startsWith(t.prefix)&&(e=e.substring(t.prefix.length)),this.key=Ro.decode(e)}}verify(e,r){let n={};for(let m of Object.keys(r))n[m.toLowerCase()]=r[m];let i=n["webhook-id"],o=n["webhook-signature"],s=n["webhook-timestamp"];if(!o||!i||!s)throw new ot("Missing required headers");let a=this.verifyTimestamp(s),d=this.sign(i,a,e).split(",")[1],c=o.split(" "),u=new globalThis.TextEncoder;for(let m of c){let[y,g]=m.split(",");if(y==="v1"&&(0,vd.timingSafeEqual)(u.encode(g),u.encode(d)))return JSON.parse(e.toString())}throw new ot("No matching signature found")}sign(e,r,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let i=new TextEncoder,o=Math.floor(r.getTime()/1e3),s=i.encode(`${e}.${o}.${n}`);return`v1,${Ro.encode(Cd.hmac(this.key,s))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new ot("Invalid Signature Headers");if(r-n>Fo)throw new ot("Message timestamp too old");if(n>r+Fo)throw new ot("Message timestamp too new");return new Date(n*1e3)}};Et.Webhook=Or;Or.prefix="whsec_"});var Ir,zo=xe(()=>{"use strict";Ir=class extends Error{constructor(e){super(`Credentials file is corrupted or contains invalid JSON: ${e}
|
|
29
28
|
The file has been preserved for manual inspection.
|
|
30
|
-
To fix: either repair the JSON manually, or delete the file and run: resend login`),this.name="CorruptedCredentialsError"}}});var
|
|
29
|
+
To fix: either repair the JSON manually, or delete the file and run: resend login`),this.name="CorruptedCredentialsError"}}});var zn={};Vt(zn,{FileBackend:()=>Kn});var Kn,Jn=xe(()=>{"use strict";ye();Kn=class{name="plaintext file";isSecure=!1;async get(e,r){let n=$e();return n?n.profiles[r]?.api_key??null:null}async set(e,r,n){Yn(n,r)}async delete(e,r){try{return Jo(r),!0}catch{return!1}}async isAvailable(){return!0}}});var Qo={};Vt(Qo,{MacOSBackend:()=>Xn});function Qn(t,e){return new Promise(r=>{(0,Yo.execFile)(t,e,{timeout:5e3},(n,i,o)=>{let s=n&&"code"in n?n.code:0;r({stdout:i??"",stderr:o??"",code:s})})})}var Yo,Xn,Xo=xe(()=>{"use strict";Yo=require("node:child_process");Xn=class{name="macOS Keychain";isSecure=!0;async get(e,r){let{stdout:n,stderr:i,code:o}=await Qn("/usr/bin/security",["find-generic-password","-s",e,"-a",r,"-w"]);if(o===44)return null;if(o!==0)throw new Error(`Failed to read from macOS Keychain (exit code ${o}): ${i.trim()}`);return n.trim()||null}async set(e,r,n){let{code:i,stderr:o}=await Qn("/usr/bin/security",["add-generic-password","-s",e,"-a",r,"-w",n,"-U"]);if(i!==0)throw new Error(`Failed to store credential in macOS Keychain: ${o.trim()}`)}async delete(e,r){let{code:n}=await Qn("/usr/bin/security",["delete-generic-password","-s",e,"-a",r]);return n===0}async isAvailable(){return process.platform==="darwin"}}});var Zo={};Vt(Zo,{LinuxBackend:()=>Zn});function Pr(t,e,r){return new Promise(n=>{(0,jr.execFile)(t,e,{timeout:r?.timeout??5e3},(i,o,s)=>{let a=i&&"code"in i?i.code:0;n({stdout:o??"",stderr:s??"",code:a})})})}function Xd(t,e,r){return new Promise(n=>{let i=(0,jr.spawn)(t,e,{stdio:["pipe","ignore","pipe"],timeout:5e3}),o="";i.stderr?.on("data",s=>{o+=s.toString()}),i.on("close",s=>{n({code:s,stderr:o})}),i.on("error",()=>{n({code:1,stderr:"Failed to spawn process"})}),i.stdin?.on("error",()=>{}),i.stdin?.write(r),i.stdin?.end()})}var jr,Zn,es=xe(()=>{"use strict";jr=require("node:child_process");Zn=class{name="Secret Service (libsecret)";isSecure=!0;async get(e,r){let{stdout:n,code:i}=await Pr("secret-tool",["lookup","service",e,"account",r]);return i!==0||!n.trim()?null:n.trim()}async set(e,r,n){let{code:i,stderr:o}=await Xd("secret-tool",["store",`--label=Resend CLI (${r})`,"service",e,"account",r],n);if(i!==0)throw new Error(`Failed to store credential in Secret Service: ${o.trim()}`)}async delete(e,r){let{code:n}=await Pr("secret-tool",["clear","service",e,"account",r]);return n===0}async isAvailable(){if(process.platform!=="linux"||(await Pr("which",["secret-tool"])).code!==0)return!1;let r=await Pr("secret-tool",["lookup","service","__resend_cli_probe__"],{timeout:3e3});return r.code===0||r.code===1}}});var ts={};Vt(ts,{WindowsBackend:()=>ei});function Rr(t){return new Promise(e=>{(0,Fr.execFile)("powershell.exe",["-NoProfile","-NonInteractive","-Command",t],{timeout:1e4},(r,n,i)=>{let o=r&&"code"in r?r.code:0;e({stdout:n??"",stderr:i??"",code:o})})})}function Zd(t,e){return new Promise(r=>{let n=(0,Fr.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",t],{stdio:["pipe","pipe","pipe"],timeout:1e4}),i="",o="";n.stdout?.on("data",s=>{i+=s.toString()}),n.stderr?.on("data",s=>{o+=s.toString()}),n.on("close",s=>{r({stdout:i,stderr:o,code:s})}),n.on("error",()=>{r({stdout:"",stderr:"Failed to spawn process",code:1})}),n.stdin?.on("error",()=>{}),n.stdin?.write(e),n.stdin?.end()})}function st(t){return t.replace(/'/g,"''")}var Fr,or,ei,rs=xe(()=>{"use strict";Fr=require("node:child_process");or=`
|
|
31
30
|
try { $null = [Windows.Security.Credentials.PasswordVault] } catch {
|
|
32
31
|
[void][Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime]
|
|
33
32
|
}
|
|
34
|
-
`,
|
|
33
|
+
`,ei=class{name="Windows Credential Manager";isSecure=!0;async get(e,r){let n=`${or}
|
|
35
34
|
$v = New-Object Windows.Security.Credentials.PasswordVault
|
|
36
35
|
try {
|
|
37
|
-
$c = $v.Retrieve('${
|
|
36
|
+
$c = $v.Retrieve('${st(e)}', '${st(r)}')
|
|
38
37
|
$c.RetrievePassword()
|
|
39
38
|
Write-Output $c.Password
|
|
40
39
|
} catch {
|
|
41
40
|
exit 1
|
|
42
41
|
}
|
|
43
|
-
`,{stdout:
|
|
42
|
+
`,{stdout:i,code:o}=await Rr(n);return o!==0||!i.trim()?null:i.trim()}async set(e,r,n){let i=`${or}
|
|
44
43
|
$v = New-Object Windows.Security.Credentials.PasswordVault
|
|
45
44
|
try {
|
|
46
|
-
$c = $v.Retrieve('${
|
|
45
|
+
$c = $v.Retrieve('${st(e)}', '${st(r)}')
|
|
47
46
|
$v.Remove($c)
|
|
48
47
|
} catch {}
|
|
49
|
-
`;await
|
|
48
|
+
`;await Rr(i);let o=`${or}
|
|
50
49
|
$secret = [Console]::In.ReadLine()
|
|
51
50
|
$v = New-Object Windows.Security.Credentials.PasswordVault
|
|
52
|
-
$c = New-Object Windows.Security.Credentials.PasswordCredential('${
|
|
51
|
+
$c = New-Object Windows.Security.Credentials.PasswordCredential('${st(e)}', '${st(r)}', $secret)
|
|
53
52
|
$v.Add($c)
|
|
54
|
-
`,{code:s,stderr:a}=await
|
|
53
|
+
`,{code:s,stderr:a}=await Zd(o,n);if(s!==0)throw new Error(`Failed to store credential in Windows Credential Manager: ${a.trim()}`)}async delete(e,r){let n=`${or}
|
|
55
54
|
$v = New-Object Windows.Security.Credentials.PasswordVault
|
|
56
55
|
try {
|
|
57
|
-
$c = $v.Retrieve('${
|
|
56
|
+
$c = $v.Retrieve('${st(e)}', '${st(r)}')
|
|
58
57
|
$v.Remove($c)
|
|
59
58
|
} catch {
|
|
60
59
|
exit 1
|
|
61
60
|
}
|
|
62
|
-
`,{code:
|
|
63
|
-
`,384),(0,
|
|
64
|
-
Create a full access key at https://resend.com/api-keys`;
|
|
65
|
-
`)}async function
|
|
61
|
+
`,{code:i}=await Rr(n);return i===0}async isAvailable(){if(process.platform!=="win32")return!1;let{code:e}=await Rr(`${or} $null = New-Object Windows.Security.Credentials.PasswordVault`);return e===0}}});async function at(){if(We)return We;let t=process.env.RESEND_CREDENTIAL_STORE;if(t==="file"){let{FileBackend:r}=await Promise.resolve().then(()=>(Jn(),zn));return We=new r,We}if(t==="secure_storage"){let r=await ns();if(r)return We=r,We}if(!t){let r=await ns();if(r)return We=r,We}let{FileBackend:e}=await Promise.resolve().then(()=>(Jn(),zn));return We=new e,We}async function ns(){if(process.platform==="darwin"){let{MacOSBackend:t}=await Promise.resolve().then(()=>(Xo(),Qo)),e=new t;if(await e.isAvailable())return e}else if(process.platform==="linux"){let{LinuxBackend:t}=await Promise.resolve().then(()=>(es(),Zo)),e=new t;if(await e.isAvailable())return e}else if(process.platform==="win32"){let{WindowsBackend:t}=await Promise.resolve().then(()=>(rs(),ts)),e=new t;if(await e.isAvailable())return e}return null}var Ye,We,ti=xe(()=>{"use strict";Ye="resend-cli",We=null});function lt(t,e){(0,ve.mkdirSync)((0,ss.dirname)(t),{recursive:!0});let r=rm(t);try{let n=e();return n instanceof Promise?n.finally(()=>ri(t,r)):(ri(t,r),n)}catch(n){throw ri(t,r),n}}var os,ve,ss,em,tm,is,rm,ri,nm,im,as=xe(()=>{"use strict";os=require("node:crypto"),ve=require("node:fs"),ss=require("node:path"),em=1e4,tm=50,is=200;rm=t=>{let e=(0,os.randomUUID)();for(let r=0;r<is;r++)try{let n=(0,ve.openSync)(t,"wx");try{(0,ve.writeSync)(n,e)}finally{(0,ve.closeSync)(n)}return e}catch(n){if(n.code!=="EEXIST")throw n;if(nm(t)){try{(0,ve.unlinkSync)(t)}catch{}continue}im(tm)}throw new Error(`Could not acquire lock on ${t} after ${is} retries. If no other resend process is running, delete the lock file manually.`)},ri=(t,e)=>{try{if((0,ve.readFileSync)(t,"utf-8")!==e)return;(0,ve.unlinkSync)(t)}catch{}},nm=t=>{try{let e=(0,ve.statSync)(t);return Date.now()-e.mtimeMs>em}catch{return!0}},im=t=>{Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,t)}});var ls,Ce,cs,us,om,ds=xe(()=>{"use strict";ls=require("node:crypto"),Ce=require("node:fs"),cs=require("node:path"),us=(t,e,r)=>{let n=`${t}.tmp.${process.pid}.${(0,ls.randomUUID)()}`;try{let i=(0,Ce.openSync)(n,"w",r);try{(0,Ce.writeSync)(i,e),(0,Ce.fsyncSync)(i)}finally{(0,Ce.closeSync)(i)}(0,Ce.renameSync)(n,t),om((0,cs.dirname)(t))}catch(i){try{(0,Ce.unlinkSync)(n)}catch{}throw i}},om=t=>{if(process.platform!=="win32")try{let e=(0,Ce.openSync)(t,"r");try{(0,Ce.fsyncSync)(e)}finally{(0,Ce.closeSync)(e)}}catch{}}});function Be(){return process.env.XDG_CONFIG_HOME?(0,St.join)(process.env.XDG_CONFIG_HOME,"resend"):process.platform==="win32"&&process.env.APPDATA?(0,St.join)(process.env.APPDATA,"resend"):(0,St.join)((0,ms.homedir)(),".config","resend")}function yt(){return(0,St.join)(Be(),"credentials.json")}function ni(){try{return $e()}catch{return null}}function $e(){let t=yt();if(!(0,Pe.existsSync)(t))return null;let e=(0,Pe.readFileSync)(t,"utf-8");if(e.trim().length===0)return null;let r;try{r=JSON.parse(e)}catch{throw new Ir(t)}if(typeof r=="object"&&r!==null&&"api_key"in r&&!("profiles"in r)&&!("teams"in r))return{active_profile:"default",profiles:{default:{api_key:r.api_key}}};if("profiles"in r){let n=r.storage==="keychain"?"secure_storage":r.storage;return{active_profile:r.active_profile??"default",...n?{storage:n}:{},profiles:r.profiles}}return"teams"in r?{active_profile:r.active_team??"default",profiles:r.teams}:null}function Ct(t){let e=Be();(0,Pe.mkdirSync)(e,{recursive:!0,mode:448});let r=yt();return us(r,`${JSON.stringify(t,null,2)}
|
|
62
|
+
`,384),(0,Pe.chmodSync)(r,384),r}function Br(t){if(t)return t;let e=process.env.RESEND_PROFILE;if(e)return e;let r=$e();return r?.active_profile?r.active_profile:"default"}function Yn(t,e,r){let n=e||"default",i=se(n);if(i)throw new Error(i);return lt(vt(),()=>{let o=$e()||{active_profile:"default",profiles:{}},s={...o.profiles,[n]:{api_key:t,...r&&{permission:r}}},a={...o,profiles:s,...Object.keys(s).length===1?{active_profile:n}:{}};return Ct(a)})}function Jo(t){return lt(vt(),()=>{let e=$e();if(!e)throw new Error("No credentials file found.");let r=t||Br();if(!e.profiles[r])throw new Error(`Profile "${r}" not found. Available profiles: ${Object.keys(e.profiles).join(", ")}`);let{[r]:n,...i}=e.profiles;if(Object.keys(i).length===0){let s=yt();return(0,Pe.unlinkSync)(s),s}let o=e.active_profile===r?Object.keys(i)[0]||"default":e.active_profile;return Ct({...e,active_profile:o,profiles:i})})}function Nr(t){let e=se(t);if(e)throw new Error(e);lt(vt(),()=>{let r=$e();if(!r)throw new Error("No credentials file found. Run: resend login");if(!r.profiles[t])throw new Error(`Profile "${t}" not found. Available profiles: ${Object.keys(r.profiles).join(", ")}`);Ct({...r,active_profile:t})})}function we(){let t=$e();return t?Object.keys(t.profiles).map(e=>({name:e,active:e===t.active_profile})):[]}function se(t){if(!t||t.length===0)return"Profile name must not be empty";if(t.length>64)return"Profile name must be 64 characters or fewer";if(!/^[a-zA-Z0-9._-]+$/.test(t))return"Profile name must contain only letters, numbers, dots, dashes, and underscores"}function wt(t){return t.length<=7?`${t.slice(0,3)}...`:`${t.slice(0,3)}...${t.slice(-4)}`}async function _t(t,e){if(t)return{key:t,source:"flag"};let r=process.env.RESEND_API_KEY;if(r)return{key:r,source:"env"};let n=$e(),i=e||process.env.RESEND_PROFILE||n?.active_profile||"default";if(n?.storage==="secure_storage"&&n.profiles[i]){let s=await(await at()).get(Ye,i);if(s){let a=n.profiles[i]?.permission;return{key:s,source:"secure_storage",profile:i,permission:a}}}if(n){let o=n.profiles[i];if(o?.api_key)return{key:o.api_key,source:"config",profile:i,permission:o.permission}}return null}async function ps(t,e,r){let n=e||"default",i=se(n);if(i)throw new Error(i);let o=await at();return o.isSecure?{configPath:await lt(vt(),async()=>{await o.set(Ye,n,t);let a=$e()||{active_profile:"default",profiles:{}},l={...a.profiles,[n]:{...r&&{permission:r}}};return Ct({...a,storage:"secure_storage",profiles:l,...Object.keys(l).length===1?{active_profile:n}:{}})}),backend:o}:{configPath:Yn(t,n,r),backend:o}}async function Hr(t){return lt(vt(),async()=>{let e=$e(),r=t||process.env.RESEND_PROFILE||e?.active_profile||"default";if(!e?.profiles[r])throw new Error(e?`Profile "${r}" not found. Available profiles: ${Object.keys(e.profiles).join(", ")}`:"No credentials file found.");if(e.storage==="secure_storage"){let s=await at();if(s.isSecure&&!await s.delete(Ye,r))throw new Error(`Failed to remove API key for profile "${r}" from ${s.name}. Credential may still exist in secure storage.`)}let{[r]:n,...i}=e.profiles;if(Object.keys(i).length===0){let s=yt();return(0,Pe.unlinkSync)(s),s}let o=e.active_profile===r?Object.keys(i)[0]||"default":e.active_profile;return Ct({...e,active_profile:o,profiles:i})})}async function fs(){return lt(vt(),async()=>{let t=ni(),e=yt();if(t?.storage==="secure_storage"){let r=await at();if(r.isSecure){let n=Object.keys(t.profiles),i=await Promise.all(n.map(s=>r.delete(Ye,s))),o=n.filter((s,a)=>!i[a]);if(o.length>0){let s=Object.fromEntries(Object.entries(t.profiles).filter(([l])=>!i[n.indexOf(l)])),a=Object.keys(s);throw Ct({...t,active_profile:t.active_profile&&s[t.active_profile]?t.active_profile:a[0]??"default",profiles:s}),new Error(`Failed to remove API keys from ${r.name} for profiles: ${o.join(", ")}. Credentials may still exist in secure storage.`)}}}return(0,Pe.existsSync)(e)&&(0,Pe.unlinkSync)(e),e})}async function Lr(t,e){if(t===e)return;let r=se(e);if(r)throw new Error(r);await lt(vt(),async()=>{let n=$e();if(!n)throw new Error("No credentials file found. Run: resend login");if(!n.profiles[t])throw new Error(`Profile "${t}" not found. Available profiles: ${Object.keys(n.profiles).join(", ")}`);if(n.profiles[e])throw new Error(`Profile "${e}" already exists.`);if(n.storage==="secure_storage"){let s=await at();if(s.isSecure){let a=await s.get(Ye,t);if(a&&(await s.set(Ye,e,a),!await s.delete(Ye,t))){let d=await s.delete(Ye,e);throw new Error(d?`Failed to remove old credential "${t}" from ${s.name} during rename. The rename has been rolled back.`:`Failed to remove old credential "${t}" from ${s.name} during rename. Rollback also failed \u2014 credential "${e}" may still exist in secure storage.`)}}}let{[t]:i,...o}=n.profiles;Ct({...n,active_profile:n.active_profile===t?e:n.active_profile,profiles:{...o,[e]:i}})})}var Pe,ms,St,Tt,vt,ye=xe(()=>{"use strict";Pe=require("node:fs"),ms=require("node:os"),St=require("node:path");zo();ti();as();ds();Tt=`Sending-only keys work with: emails send, emails batch, broadcasts send.
|
|
63
|
+
Create a full access key at https://resend.com/api-keys`;vt=()=>(0,St.join)(Be(),"credentials.json.lock")});function w(){return!(!process.stdin.isTTY||!process.stdout.isTTY||process.env.CI==="true"||process.env.CI==="1"||process.env.GITHUB_ACTIONS||process.env.TERM==="dumb")}var Qe,z=xe(()=>{"use strict";Qe=process.platform!=="win32"||!!process.env.WT_SESSION||process.env.TERM_PROGRAM==="vscode"});function Za(){return(0,Xa.join)(Be(),"update-state.json")}function Rm(){try{return JSON.parse((0,Gt.readFileSync)(Za(),"utf-8"))}catch{return null}}function Fm(t){(0,Gt.mkdirSync)(Be(),{recursive:!0,mode:448}),(0,Gt.writeFileSync)(Za(),JSON.stringify(t),{mode:384})}function tn(t,e){let r=d=>d.replace(/^v/,"").split(".").map(Number),[n,i,o]=r(t),[s,a,l]=r(e);return s!==n?s>n:a!==i?a>i:l>o}async function fi(){try{let t=await fetch(pi,{headers:{Accept:"application/vnd.github.v3+json"},signal:AbortSignal.timeout(5e3)});if(!t.ok)return null;let e=await t.json();if(e.prerelease||e.draft)return null;let r=e.tag_name?.replace(/^v/,"");return!r||!/^\d+\.\d+\.\d+$/.test(r)?null:r}catch{return null}}function Bm(t){return!!(t?.json||process.env.RESEND_NO_UPDATE_NOTIFIER==="1"||process.env.CI==="true"||process.env.CI==="1"||process.env.GITHUB_ACTIONS||!process.stdout.isTTY)}function el(){let t=rn();return t.startsWith("npm")?"npm":t.startsWith("brew")?"homebrew":t.startsWith("curl")||t.startsWith("irm")?"install-script":"manual"}function rn(){let t=process.execPath||process.argv[0]||"",e=process.argv[1]||"";return process.env.npm_execpath||/node_modules/.test(e)||/node_modules/.test(t)?"npm install -g resend-cli":/\/(Cellar|homebrew)\//i.test(t)?"brew update && brew upgrade resend":/[/\\]\.resend[/\\]bin[/\\]/.test(t)?process.platform==="win32"?"irm https://resend.com/install.ps1 | iex":"curl -fsSL https://resend.com/install.sh | bash":"https://github.com/resend/resend-cli/releases/latest"}function Qa(t){let e=rn(),r=e.startsWith("http"),n="\x1B[2m",i="\x1B[33m",o="\x1B[36m",s="\x1B[0m",a=["",`${n}Update available: ${i}v${te}${s}${n} \u2192 ${o}v${t}${s}`,`${n}${r?"Visit":"Run"}: ${o}${e}${s}`];return process.platform==="win32"&&a.push(`${n}Or download from: ${o}https://github.com/resend/resend-cli/releases/latest${s}`),a.push(""),a.join(`
|
|
64
|
+
`)}async function tl(t){if(Bm(t))return;let e=Rm(),r=Date.now();if(e&&r-e.lastChecked<jm){tn(te,e.latestVersion)&&process.stderr.write(Qa(e.latestVersion));return}let n=await fi();n&&(Fm({lastChecked:r,latestVersion:n}),tn(te,n)&&process.stderr.write(Qa(n)))}var Gt,Xa,jm,pi,dr=xe(()=>{"use strict";Gt=require("node:fs"),Xa=require("node:path");ye();ht();jm=3600*1e3,pi="https://api.github.com/repos/resend/resend-cli/releases/latest"});var Vc={};Vt(Vc,{flushFromFile:()=>bp,flushPayload:()=>Wc,getOrCreateAnonymousId:()=>Uc,getSpoolDir:()=>vi,isDisabled:()=>qc,trackCommand:()=>Ci});function mp(){return dp[process.platform]??process.platform}function vi(){let t=(0,Me.join)(Be(),"telemetry-spool");return(0,U.mkdirSync)(t,{recursive:!0,mode:448}),t}function qc(){return!Mc||process.env.DO_NOT_TRACK==="1"||process.env.RESEND_TELEMETRY_DISABLED==="1"}function Uc(){let t=Be(),e=(0,Me.join)(t,"telemetry-id");try{let n=(0,U.readFileSync)(e,"utf-8").trim();if(n)return n}catch{}let r=crypto.randomUUID();return(0,U.mkdirSync)(t,{recursive:!0,mode:448}),(0,U.writeFileSync)(e,r,{mode:384}),r}function pp(t){if(!t)return;let e=Be(),r=(0,Me.join)(e,"telemetry-notice-shown");(0,U.existsSync)(r)||((0,U.mkdirSync)(e,{recursive:!0,mode:448}),(0,U.writeFileSync)(r,"",{mode:384}),process.stderr.write(`
|
|
66
65
|
Resend collects anonymous CLI usage data to improve the tool.
|
|
67
66
|
To opt out: export RESEND_TELEMETRY_DISABLED=1
|
|
68
67
|
|
|
69
|
-
`))}function
|
|
68
|
+
`))}function Ci(t,e){if(!qc())try{let r=w()&&!e.json;pp(r);let n=Uc(),i={command:t,cli_version:te,os:mp(),node_version:process.version,interactive:r,install_method:el()};e.flags?.length&&(i.flags=e.flags),e.globalFlags?.length&&(i.global_flags=e.globalFlags);let o=crypto.randomUUID(),s=JSON.stringify({api_key:Mc,distinct_id:n,event:"cli.used",properties:i,_nonce:o}),a=vi(),l=(0,Me.join)(a,`resend-telemetry-${crypto.randomUUID()}.json`),d=(0,U.openSync)(l,U.constants.O_CREAT|U.constants.O_EXCL|U.constants.O_WRONLY|(U.constants.O_NOFOLLOW??0),384);try{(0,U.writeFileSync)(d,s)}finally{(0,U.closeSync)(d)}let c="pkg"in process,u=c?["telemetry","flush",l]:process.execArgv.concat([process.argv[1],"telemetry","flush",l]);(0,Gc.spawn)(process.execPath,u,{detached:!0,stdio:"ignore",env:{...process.env,RESEND_TELEMETRY_DISABLED:"1",...c?{PKG_EXECPATH:""}:{}}}).unref()}catch{}}async function Wc(t){let e=JSON.parse(t);if(!fp(e))throw new Error("invalid telemetry payload schema");let{_nonce:r,...n}=e,i=JSON.stringify(n),o=await fetch(up,{method:"POST",headers:{"Content-Type":"application/json"},body:i,signal:AbortSignal.timeout(3e3)});if(!o.ok)throw new Error(`telemetry flush failed: ${o.status}`)}async function bp(t){let e=(0,Me.join)(t),r=vi(),n=(0,Me.basename)(e);if((0,Me.dirname)(e)!==r||!gp.test(n)||(0,U.realpathSync)((0,Me.dirname)(e))!==(0,U.realpathSync)(r))throw new Error("invalid telemetry flush path");let i=(0,U.openSync)(e,U.constants.O_RDONLY|U.constants.O_NOFOLLOW),o;try{let s=(0,U.fstatSync)(i);if(!s.isFile()||s.nlink!==1)throw new Error("invalid telemetry flush path");o=(0,U.readFileSync)(i,"utf-8")}finally{(0,U.closeSync)(i)}try{await Wc(o)}finally{(0,U.unlinkSync)(e)}}var Gc,U,Me,Mc,up,dp,Lc,fp,hp,gp,wi=xe(()=>{"use strict";Gc=require("node:child_process"),U=require("node:fs"),Me=require("node:path");ye();z();dr();ht();Mc="phc_AgEBpcQTRsBl3UgQX2U8XvimTlgdXG6YEhfvJl2cUfc",up="https://us.i.posthog.com/capture/",dp={darwin:"macOS",win32:"Windows",linux:"Linux"};Lc=new Set(["api_key","distinct_id","event","properties","_nonce"]),fp=t=>{if(typeof t!="object"||t===null||Array.isArray(t))return!1;let e=t,r=Object.keys(e);return r.length!==Lc.size||r.some(n=>!Lc.has(n))?!1:typeof e.api_key=="string"&&typeof e.distinct_id=="string"&&e.event==="cli.used"&&typeof e.properties=="object"&&e.properties!==null&&!Array.isArray(e.properties)&&typeof e._nonce=="string"&&e._nonce.length>0};hp="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",gp=new RegExp(`^resend-telemetry-${hp}\\.json$`)});var Bi=pe(Fi(),1),{program:$p,createCommand:Ep,createArgument:Dp,createOption:Sp,CommanderError:Tp,InvalidArgumentError:Op,InvalidOptionArgumentError:Ip,Command:p,Argument:Ni,Option:ee,Help:Pp}=Bi.default;var Wt=pe(et(),1);var Cu=`Global options:
|
|
70
69
|
--api-key <key> API key (or set RESEND_API_KEY env var)
|
|
71
70
|
-p, --profile <name> Profile to use (overrides RESEND_PROFILE)
|
|
72
71
|
--json Force JSON output (also auto-enabled when stdout is piped)
|
|
73
|
-
-q, --quiet Suppress spinners and status output (implies --json)`,
|
|
72
|
+
-q, --quiet Suppress spinners and status output (implies --json)`,wu=`Global options:
|
|
74
73
|
-p, --profile <name> Profile to use
|
|
75
74
|
--json Force JSON output
|
|
76
|
-
-q, --quiet Suppress spinners and status output (implies --json)`,
|
|
77
|
-
${
|
|
78
|
-
${
|
|
79
|
-
Codes: ${
|
|
80
|
-
${
|
|
75
|
+
-q, --quiet Suppress spinners and status output (implies --json)`,_u=' {"error":{"message":"<message>","code":"<code>"}}';function f(t){let e=[];return t.context!=null&&e.push(t.context),e.push(t.setup?wu:Cu),t.output!=null&&e.push(`Output (--json or piped):
|
|
76
|
+
${t.output}`),t.errorCodes!=null&&e.push(`Errors (exit code 1, JSON on stderr when using --json or non-TTY):
|
|
77
|
+
${_u}
|
|
78
|
+
Codes: ${t.errorCodes.join(" | ")}`),e.push(`Examples:
|
|
79
|
+
${t.examples.map(r=>` $ ${r}`).join(`
|
|
81
80
|
`)}`),`
|
|
82
|
-
${
|
|
83
|
-
|
|
84
|
-
`)}`}var
|
|
85
|
-
`),
|
|
86
|
-
`){o&&(
|
|
87
|
-
`&&(
|
|
88
|
-
`)}var
|
|
89
|
-
`),
|
|
90
|
-
`),
|
|
91
|
-
`).map((a,
|
|
92
|
-
`)}var
|
|
93
|
-
`),
|
|
94
|
-
`).length-1;this.output.write(
|
|
95
|
-
`);this.output.write(s[o]),this._prevFrame=
|
|
81
|
+
${e.join(`
|
|
82
|
+
|
|
83
|
+
`)}`}var vr=require("node:util"),zt=require("node:process");var ro=pe(require("node:readline"),1);var Gi=(()=>{let t=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return e=>{let r=0;for(t.lastIndex=0;t.test(e);)r+=1;return e.length-r}})(),Mi=t=>t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510,qi=t=>t===8987||t===9001||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t>=131072&&t<=196605||t>=196608&&t<=262141;var xu=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Au=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Ui=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,ku=/\t{1,1000}/y,Wi=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,$u=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Eu=/\p{M}+/gu,Du={limit:1/0,ellipsis:""},Vi=(t,e={},r={})=>{let n=e.limit??1/0,i=e.ellipsis??"",o=e?.ellipsisWidth??(i?Vi(i,Du,r).width:0),s=0,a=r.controlWidth??0,l=r.tabWidth??8,d=r.emojiWidth??2,c=2,u=r.regularWidth??1,m=r.wideWidth??c,y=[[$u,u],[xu,s],[Au,a],[ku,l],[Wi,d],[Ui,m]],g=0,b=0,_=t.length,A=0,x=!1,$=_,F=Math.max(0,n-o),D=0,O=0,T=0,E=0;e:for(;;){if(O>D||b>=_&&b>g){let I=t.slice(D,O)||t.slice(g,b);A=0;for(let ge of I.replaceAll(Eu,"")){let Z=ge.codePointAt(0)||0;if(Mi(Z)?E=c:qi(Z)?E=m:E=u,T+E>F&&($=Math.min($,Math.max(D,g)+A)),T+E>n){x=!0;break e}A+=ge.length,T+=E}D=O=0}if(b>=_)break e;for(let I=0,ge=y.length;I<ge;I++){let[Z,pt]=y[I];if(Z.lastIndex=b,Z.test(t)){if(A=Z===Ui?Gi(t.slice(b,Z.lastIndex)):Z===Wi?1:Z.lastIndex-b,E=A*pt,T+E>F&&($=Math.min($,b+Math.floor((F-T)/pt))),T+E>n){x=!0;break e}T+=E,D=g,O=b,b=g=Z.lastIndex;continue e}}b+=1}return{width:x?F:T,index:x?$:_,truncated:x,ellipsed:x&&n>=o}},Ki=Vi;var Su={limit:1/0,ellipsis:"",ellipsisWidth:0},Tu=(t,e={})=>Ki(t,Su,e).width,qe=Tu;var br="\x1B",Xi="\x9B",Ou=39,En="\x07",Zi="[",Iu="]",eo="m",Dn=`${Iu}8;;`,zi=new RegExp(`(?:\\${Zi}(?<code>\\d+)m|\\${Dn}(?<uri>.*)${En})`,"y"),Ji=t=>{if(t>=30&&t<=37||t>=90&&t<=97)return 39;if(t>=40&&t<=47||t>=100&&t<=107)return 49;if(t===1||t===2)return 22;if(t===3)return 23;if(t===4)return 24;if(t===7)return 27;if(t===8)return 28;if(t===9)return 29;if(t===0)return 0},Yi=t=>`${br}${Zi}${t}${eo}`,Qi=t=>`${br}${Dn}${t}${En}`,$n=(t,e,r)=>{let n=e[Symbol.iterator](),i=!1,o=!1,s=t.at(-1),a=s===void 0?0:qe(s),l=n.next(),d=n.next(),c=0;for(;!l.done;){let u=l.value,m=qe(u);a+m<=r?t[t.length-1]+=u:(t.push(u),a=0),(u===br||u===Xi)&&(i=!0,o=e.startsWith(Dn,c+1)),i?o?u===En&&(i=!1,o=!1):u===eo&&(i=!1):(a+=m,a===r&&!d.done&&(t.push(""),a=0)),l=d,d=n.next(),c+=u.length}s=t.at(-1),!a&&s!==void 0&&s.length&&t.length>1&&(t[t.length-2]+=t.pop())},Pu=t=>{let e=t.split(" "),r=e.length;for(;r&&!qe(e[r-1]);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},ju=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=t.split(" "),a=[""],l=0;for(let u=0;u<s.length;u++){let m=s[u];if(r.trim!==!1){let g=a.at(-1)??"",b=g.trimStart();g.length!==b.length&&(a[a.length-1]=b,l=qe(b))}u!==0&&(l>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),l=0),(l||r.trim===!1)&&(a[a.length-1]+=" ",l++));let y=qe(m);if(r.hard&&y>e){let g=e-l,b=1+Math.floor((y-g-1)/e);Math.floor((y-1)/e)<b&&a.push(""),$n(a,m,e),l=qe(a.at(-1)??"");continue}if(l+y>e&&l&&y){if(r.wordWrap===!1&&l<e){$n(a,m,e),l=qe(a.at(-1)??"");continue}a.push(""),l=0}if(l+y>e&&r.wordWrap===!1){$n(a,m,e),l=qe(a.at(-1)??"");continue}a[a.length-1]+=m,l+=y}r.trim!==!1&&(a=a.map(u=>Pu(u)));let d=a.join(`
|
|
84
|
+
`),c=!1;for(let u=0;u<d.length;u++){let m=d[u];if(n+=m,c)c=!1;else if(c=m>="\uD800"&&m<="\uDBFF",c)continue;if(m===br||m===Xi){zi.lastIndex=u+1;let g=zi.exec(d)?.groups;if(g?.code!==void 0){let b=Number.parseFloat(g.code);i=b===Ou?void 0:b}else g?.uri!==void 0&&(o=g.uri.length===0?void 0:g.uri)}if(d[u+1]===`
|
|
85
|
+
`){o&&(n+=Qi(""));let y=i?Ji(i):void 0;i&&y&&(n+=Yi(y))}else m===`
|
|
86
|
+
`&&(i&&Ji(i)&&(n+=Yi(i)),o&&(n+=Qi(o)))}return n},Ru=/\r?\n/;function At(t,e,r){return String(t).normalize().split(Ru).map(n=>ju(n,e,r)).join(`
|
|
87
|
+
`)}var Oe=pe(Tn(),1);function ft(t,e,r){if(!r.some(s=>!s.disabled))return t;let n=t+e,i=Math.max(r.length-1,0),o=n<0?i:n>i?0:n;return r[o].disabled?ft(o,e<0?-1:1,r):o}var Nu=["up","down","left","right","space","enter","cancel"],Hu=["January","February","March","April","May","June","July","August","September","October","November","December"],be={actions:new Set(Nu),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...Hu],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(t,e)=>`There are only ${t} days in ${e}`,afterMin:t=>`Date must be on or after ${t.toISOString().slice(0,10)}`,beforeMax:t=>`Date must be on or before ${t.toISOString().slice(0,10)}`}}};function no(t,e){if(typeof t=="string")return be.aliases.get(t)===e;for(let r of t)if(r!==void 0&&no(r,e))return!0;return!1}function Lu(t,e){if(t===e)return;let r=t.split(`
|
|
88
|
+
`),n=e.split(`
|
|
89
|
+
`),i=Math.max(r.length,n.length),o=[];for(let s=0;s<i;s++)r[s]!==n[s]&&o.push(s);return{lines:o,numLinesBefore:r.length,numLinesAfter:n.length,numLines:i}}var Vp=globalThis.process.platform.startsWith("win"),On=Symbol("clack:cancel");function k(t){return t===On}function yr(t,e){let r=t;r.isTTY&&r.setRawMode(e)}var In=t=>"columns"in t&&typeof t.columns=="number"?t.columns:80,Pn=t=>"rows"in t&&typeof t.rows=="number"?t.rows:20;function tt(t,e,r,n=r,i=r,o){let s=In(t??zt.stdout);return At(e,s-r.length,{hard:!0,trim:!1}).split(`
|
|
90
|
+
`).map((a,l,d)=>{let c=o?o(a,l):a;return l===0?`${n}${c}`:l===d.length-1?`${i}${c}`:`${r}${c}`}).join(`
|
|
91
|
+
`)}var Jt=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(t,e=!0){let{input:r=zt.stdin,output:n=zt.stdout,render:i,signal:o,...s}=t;this.opts=s,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=e,this._abortSignal=o,this.input=r,this.output=n}unsubscribe(){this._subscribers.clear()}setSubscriber(t,e){let r=this._subscribers.get(t)??[];r.push(e),this._subscribers.set(t,r)}on(t,e){this.setSubscriber(t,{cb:e})}once(t,e){this.setSubscriber(t,{cb:e,once:!0})}emit(t,...e){let r=this._subscribers.get(t)??[],n=[];for(let i of r)i.cb(...e),i.once&&n.push(()=>r.splice(r.indexOf(i),1));for(let i of n)i()}prompt(){return new Promise(t=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(On);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=ro.default.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),yr(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(Oe.cursor.show),this.output.off("resize",this.render),yr(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(Oe.cursor.show),this.output.off("resize",this.render),yr(this.input,!1),t(On)})})}_isActionKey(t,e){return t===" "}_shouldSubmit(t,e){return!0}_setValue(t){this.value=t,this.emit("value",this.value)}_setUserInput(t,e){this.userInput=t??"",this.emit("userInput",this.userInput),e&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(t,e){if(this._track&&e.name!=="return"&&(e.name&&this._isActionKey(t,e)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),e?.name&&(!this._track&&be.aliases.has(e.name)&&this.emit("cursor",be.aliases.get(e.name)),be.actions.has(e.name)&&this.emit("cursor",e.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),this.emit("key",t?.toLowerCase(),e),e?.name==="return"&&this._shouldSubmit(t,e)){if(this.opts.validate){let r=this.opts.validate(this.value);r&&(this.error=r instanceof Error?r.message:r,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}no([t,e?.name,e?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
92
|
+
`),yr(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let t=At(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
93
|
+
`).length-1;this.output.write(Oe.cursor.move(-999,t*-1))}render(){let t=At(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(Oe.cursor.hide);else{let e=Lu(this._prevFrame,t),r=Pn(this.output);if(this.restoreCursor(),e){let n=Math.max(0,e.numLinesAfter-r),i=Math.max(0,e.numLinesBefore-r),o=e.lines.find(s=>s>=n);if(o===void 0){this._prevFrame=t;return}if(e.lines.length===1){this.output.write(Oe.cursor.move(0,o-i)),this.output.write(Oe.erase.lines(1));let s=t.split(`
|
|
94
|
+
`);this.output.write(s[o]),this._prevFrame=t,this.output.write(Oe.cursor.move(0,s.length-o-1));return}else if(e.lines.length>1){if(n<i)o=n;else{let a=o-i;a>0&&this.output.write(Oe.cursor.move(0,a))}this.output.write(Oe.erase.down());let s=t.split(`
|
|
96
95
|
`).slice(o);this.output.write(s.join(`
|
|
97
|
-
`)),this._prevFrame=
|
|
98
|
-
`);
|
|
96
|
+
`)),this._prevFrame=t;return}}this.output.write(Oe.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}};var Cr=class extends Jt{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(Oe.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var io=class extends Jt{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(t=>t.disabled!==!0)}toggleAll(){let t=this._enabledOptions,e=this.value!==void 0&&this.value.length===t.length;this.value=e?[]:t.map(r=>r.value)}toggleInvert(){let t=this.value;if(!t)return;let e=this._enabledOptions.filter(r=>!t.includes(r.value));this.value=e.map(r=>r.value)}toggleValue(){this.value===void 0&&(this.value=[]);let t=this.value.includes(this._value);this.value=t?this.value.filter(e=>e!==this._value):[...this.value,this._value]}constructor(t){super(t,!1),this.options=t.options,this.value=[...t.initialValues??[]];let e=Math.max(this.options.findIndex(({value:r})=>r===t.cursorAt),0);this.cursor=this.options[e].disabled?ft(e,1,this.options):e,this.on("key",r=>{r==="a"&&this.toggleAll(),r==="i"&&this.toggleInvert()}),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=ft(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=ft(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}},wr=class extends Jt{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let e=this.userInput;if(this.cursor>=e.length)return`${this.masked}${(0,vr.styleText)(["inverse","hidden"],"_")}`;let r=this.masked,n=r.slice(0,this.cursor),i=r.slice(this.cursor);return`${n}${(0,vr.styleText)("inverse",i[0])}${i.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:e,...r}){super(r),this._mask=e??"\u2022",this.on("userInput",n=>{this._setValue(n)})}},_r=class extends Jt{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(e){super(e,!1),this.options=e.options;let r=this.options.findIndex(({value:i})=>i===e.initialValue),n=r===-1?0:r;this.cursor=this.options[n].disabled?ft(n,1,this.options):n,this.changeValue(),this.on("cursor",i=>{switch(i){case"left":case"up":this.cursor=ft(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=ft(this.cursor,1,this.options);break}this.changeValue()})}};var xr=class extends Jt{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let e=this.userInput;if(this.cursor>=e.length)return`${this.userInput}\u2588`;let r=e.slice(0,this.cursor),[n,...i]=e.slice(this.cursor);return`${r}${(0,vr.styleText)("inverse",n)}${i.join("")}`}get cursor(){return this._cursor}constructor(e){super({...e,initialUserInput:e.initialUserInput??e.initialValue}),this.on("userInput",r=>{this._setValue(r)}),this.on("finalize",()=>{this.value||(this.value=e.defaultValue),this.value===void 0&&(this.value="")})}};var v=require("node:util"),Fe=pe(require("node:process"),1);var lo=pe(Tn(),1);function Gu(){return Fe.default.platform!=="win32"?Fe.default.env.TERM!=="linux":!!Fe.default.env.CI||!!Fe.default.env.WT_SESSION||!!Fe.default.env.TERMINUS_SUBLIME||Fe.default.env.ConEmuTask==="{cmd::Cmder}"||Fe.default.env.TERM_PROGRAM==="Terminus-Sublime"||Fe.default.env.TERM_PROGRAM==="vscode"||Fe.default.env.TERM==="xterm-256color"||Fe.default.env.TERM==="alacritty"||Fe.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Mu=Gu();var K=(t,e)=>Mu?t:e,qu=K("\u25C6","*"),Uu=K("\u25A0","x"),Wu=K("\u25B2","x"),co=K("\u25C7","o"),Vu=K("\u250C","T"),j=K("\u2502","|"),Ue=K("\u2514","\u2014"),af=K("\u2510","T"),lf=K("\u2518","\u2014"),jn=K("\u25CF",">"),kr=K("\u25CB"," "),Ku=K("\u25FB","[\u2022]"),oo=K("\u25FC","[+]"),so=K("\u25FB","[ ]"),zu=K("\u25AA","\u2022"),cf=K("\u2500","-"),uf=K("\u256E","+"),df=K("\u251C","+"),mf=K("\u256F","+"),pf=K("\u2570","+"),ff=K("\u256D","+"),Ju=K("\u25CF","\u2022"),Yu=K("\u25C6","*"),Qu=K("\u25B2","!"),Xu=K("\u25A0","x"),Qt=t=>{switch(t){case"initial":case"active":return(0,v.styleText)("cyan",qu);case"cancel":return(0,v.styleText)("red",Uu);case"error":return(0,v.styleText)("yellow",Wu);case"submit":return(0,v.styleText)("green",co)}},uo=t=>{switch(t){case"initial":case"active":return(0,v.styleText)("cyan",j);case"cancel":return(0,v.styleText)("red",j);case"error":return(0,v.styleText)("yellow",j);case"submit":return(0,v.styleText)("green",j)}},ao=(t,e,r,n,i,o=!1)=>{let s=e,a=0;if(o)for(let l=n-1;l>=r&&(s-=t[l].length,a++,!(s<=i));l--);else for(let l=r;l<n&&(s-=t[l].length,a++,!(s<=i));l++);return{lineCount:s,removals:a}},Rn=({cursor:t,options:e,style:r,output:n=process.stdout,maxItems:i=Number.POSITIVE_INFINITY,columnPadding:o=0,rowPadding:s=4})=>{let a=In(n)-o,l=Pn(n),d=(0,v.styleText)("dim","..."),c=Math.max(l-s,0),u=Math.max(Math.min(i,c),5),m=0;t>=u-3&&(m=Math.max(Math.min(t-u+3,e.length-u),0));let y=u<e.length&&m>0,g=u<e.length&&m+u<e.length,b=Math.min(m+u,e.length),_=[],A=0;y&&A++,g&&A++;let x=m+(y?1:0),$=b-(g?1:0);for(let D=x;D<$;D++){let O=At(r(e[D],D===t),a,{hard:!0,trim:!1}).split(`
|
|
97
|
+
`);_.push(O),A+=O.length}if(A>c){let D=0,O=0,T=A,E=t-x,I=c,ge=()=>ao(_,T,0,E,I),Z=()=>ao(_,T,E+1,_.length,I,!0);y?({lineCount:T,removals:D}=ge(),T>I&&(g||(I-=1),{lineCount:T,removals:O}=Z())):(g||(I-=1),{lineCount:T,removals:O}=Z(),T>I&&(I-=1,{lineCount:T,removals:D}=ge())),D>0&&(y=!0,_.splice(0,D)),O>0&&(g=!0,_.splice(_.length-O,O))}let F=[];y&&F.push(d);for(let D of _)for(let O of D)F.push(O);return g&&F.push(d),F};var rt=t=>{let e=t.active??"Yes",r=t.inactive??"No";return new Cr({active:e,inactive:r,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue??!0,render(){let n=t.withGuide??be.withGuide,i=`${Qt(this.state)} `,o=n?`${(0,v.styleText)("gray",j)} `:"",s=tt(t.output,t.message,o,i),a=`${n?`${(0,v.styleText)("gray",j)}
|
|
99
98
|
`:""}${s}
|
|
100
|
-
`,
|
|
101
|
-
${(0,
|
|
102
|
-
${(0,
|
|
103
|
-
`:` ${(0,
|
|
104
|
-
${
|
|
105
|
-
`}}}}).prompt()};var
|
|
106
|
-
`);if(
|
|
99
|
+
`,l=this.value?e:r;switch(this.state){case"submit":{let d=n?`${(0,v.styleText)("gray",j)} `:"";return`${a}${d}${(0,v.styleText)("dim",l)}`}case"cancel":{let d=n?`${(0,v.styleText)("gray",j)} `:"";return`${a}${d}${(0,v.styleText)(["strikethrough","dim"],l)}${n?`
|
|
100
|
+
${(0,v.styleText)("gray",j)}`:""}`}default:{let d=n?`${(0,v.styleText)("cyan",j)} `:"",c=n?(0,v.styleText)("cyan",Ue):"";return`${a}${d}${this.value?`${(0,v.styleText)("green",jn)} ${e}`:`${(0,v.styleText)("dim",kr)} ${(0,v.styleText)("dim",e)}`}${t.vertical?n?`
|
|
101
|
+
${(0,v.styleText)("cyan",j)} `:`
|
|
102
|
+
`:` ${(0,v.styleText)("dim","/")} `}${this.value?`${(0,v.styleText)("dim",kr)} ${(0,v.styleText)("dim",r)}`:`${(0,v.styleText)("green",jn)} ${r}`}
|
|
103
|
+
${c}
|
|
104
|
+
`}}}}).prompt()};var mo=async(t,e)=>{let r={},n=Object.keys(t);for(let i of n){let o=t[i],s=await o({results:r})?.catch(a=>{throw a});if(typeof e?.onCancel=="function"&&k(s)){r[i]="canceled",e.onCancel({results:r});continue}r[i]=s}return r};var Q={message:(t=[],{symbol:e=(0,v.styleText)("gray",j),secondarySymbol:r=(0,v.styleText)("gray",j),output:n=process.stdout,spacing:i=1,withGuide:o}={})=>{let s=[],a=o??be.withGuide,l=a?r:"",d=a?`${e} `:"",c=a?`${r} `:"";for(let m=0;m<i;m++)s.push(l);let u=Array.isArray(t)?t:t.split(`
|
|
105
|
+
`);if(u.length>0){let[m,...y]=u;m.length>0?s.push(`${d}${m}`):s.push(a?e:"");for(let g of y)g.length>0?s.push(`${c}${g}`):s.push(a?r:"")}n.write(`${s.join(`
|
|
107
106
|
`)}
|
|
108
|
-
`)},info:(e
|
|
109
|
-
|
|
110
|
-
`)},
|
|
111
|
-
`)}
|
|
112
|
-
${(0,
|
|
113
|
-
|
|
114
|
-
`)};var
|
|
115
|
-
`).map(r=>
|
|
116
|
-
`),
|
|
117
|
-
${(0,
|
|
118
|
-
`:""}${
|
|
119
|
-
`,s=this.value??[],a=(
|
|
120
|
-
${(0,
|
|
121
|
-
`).map((m,
|
|
122
|
-
`),
|
|
123
|
-
`).length,
|
|
124
|
-
`).length+1;return`${o}${
|
|
125
|
-
${
|
|
107
|
+
`)},info:(t,e)=>{Q.message(t,{...e,symbol:(0,v.styleText)("blue",Ju)})},success:(t,e)=>{Q.message(t,{...e,symbol:(0,v.styleText)("green",Yu)})},step:(t,e)=>{Q.message(t,{...e,symbol:(0,v.styleText)("green",co)})},warn:(t,e)=>{Q.message(t,{...e,symbol:(0,v.styleText)("yellow",Qu)})},warning:(t,e)=>{Q.warn(t,e)},error:(t,e)=>{Q.message(t,{...e,symbol:(0,v.styleText)("red",Xu)})}},po=(t="",e)=>{let r=e?.output??process.stdout,n=e?.withGuide??be.withGuide?`${(0,v.styleText)("gray",Ue)} `:"";r.write(`${n}${(0,v.styleText)("red",t)}
|
|
108
|
+
|
|
109
|
+
`)},fo=(t="",e)=>{let r=e?.output??process.stdout,n=e?.withGuide??be.withGuide?`${(0,v.styleText)("gray",Vu)} `:"";r.write(`${n}${t}
|
|
110
|
+
`)},$r=(t="",e)=>{let r=e?.output??process.stdout,n=e?.withGuide??be.withGuide?`${(0,v.styleText)("gray",j)}
|
|
111
|
+
${(0,v.styleText)("gray",Ue)} `:"";r.write(`${n}${t}
|
|
112
|
+
|
|
113
|
+
`)};var Yt=(t,e)=>t.split(`
|
|
114
|
+
`).map(r=>e(r)).join(`
|
|
115
|
+
`),ho=t=>{let e=(n,i)=>{let o=n.label??String(n.value);return i==="disabled"?`${(0,v.styleText)("gray",so)} ${Yt(o,s=>(0,v.styleText)(["strikethrough","gray"],s))}${n.hint?` ${(0,v.styleText)("dim",`(${n.hint??"disabled"})`)}`:""}`:i==="active"?`${(0,v.styleText)("cyan",Ku)} ${o}${n.hint?` ${(0,v.styleText)("dim",`(${n.hint})`)}`:""}`:i==="selected"?`${(0,v.styleText)("green",oo)} ${Yt(o,s=>(0,v.styleText)("dim",s))}${n.hint?` ${(0,v.styleText)("dim",`(${n.hint})`)}`:""}`:i==="cancelled"?`${Yt(o,s=>(0,v.styleText)(["strikethrough","dim"],s))}`:i==="active-selected"?`${(0,v.styleText)("green",oo)} ${o}${n.hint?` ${(0,v.styleText)("dim",`(${n.hint})`)}`:""}`:i==="submitted"?`${Yt(o,s=>(0,v.styleText)("dim",s))}`:`${(0,v.styleText)("dim",so)} ${Yt(o,s=>(0,v.styleText)("dim",s))}`},r=t.required??!0;return new io({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValues:t.initialValues,required:r,cursorAt:t.cursorAt,validate(n){if(r&&(n===void 0||n.length===0))return`Please select at least one option.
|
|
116
|
+
${(0,v.styleText)("reset",(0,v.styleText)("dim",`Press ${(0,v.styleText)(["gray","bgWhite","inverse"]," space ")} to select, ${(0,v.styleText)("gray",(0,v.styleText)("bgWhite",(0,v.styleText)("inverse"," enter ")))} to submit`))}`},render(){let n=t.withGuide??be.withGuide,i=tt(t.output,t.message,n?`${uo(this.state)} `:"",`${Qt(this.state)} `),o=`${n?`${(0,v.styleText)("gray",j)}
|
|
117
|
+
`:""}${i}
|
|
118
|
+
`,s=this.value??[],a=(l,d)=>{if(l.disabled)return e(l,"disabled");let c=s.includes(l.value);return d&&c?e(l,"active-selected"):c?e(l,"selected"):e(l,d?"active":"inactive")};switch(this.state){case"submit":{let l=this.options.filter(({value:c})=>s.includes(c)).map(c=>e(c,"submitted")).join((0,v.styleText)("dim",", "))||(0,v.styleText)("dim","none"),d=tt(t.output,l,n?`${(0,v.styleText)("gray",j)} `:"");return`${o}${d}`}case"cancel":{let l=this.options.filter(({value:c})=>s.includes(c)).map(c=>e(c,"cancelled")).join((0,v.styleText)("dim",", "));if(l.trim()==="")return`${o}${(0,v.styleText)("gray",j)}`;let d=tt(t.output,l,n?`${(0,v.styleText)("gray",j)} `:"");return`${o}${d}${n?`
|
|
119
|
+
${(0,v.styleText)("gray",j)}`:""}`}case"error":{let l=n?`${(0,v.styleText)("yellow",j)} `:"",d=this.error.split(`
|
|
120
|
+
`).map((m,y)=>y===0?`${n?`${(0,v.styleText)("yellow",Ue)} `:""}${(0,v.styleText)("yellow",m)}`:` ${m}`).join(`
|
|
121
|
+
`),c=o.split(`
|
|
122
|
+
`).length,u=d.split(`
|
|
123
|
+
`).length+1;return`${o}${l}${Rn({output:t.output,options:this.options,cursor:this.cursor,maxItems:t.maxItems,columnPadding:l.length,rowPadding:c+u,style:a}).join(`
|
|
124
|
+
${l}`)}
|
|
126
125
|
${d}
|
|
127
|
-
`}default:{let
|
|
128
|
-
`).length,
|
|
129
|
-
${
|
|
130
|
-
${
|
|
131
|
-
`}}}}).prompt()};var
|
|
132
|
-
`:""}${
|
|
133
|
-
`,
|
|
126
|
+
`}default:{let l=n?`${(0,v.styleText)("cyan",j)} `:"",d=o.split(`
|
|
127
|
+
`).length,c=n?2:1;return`${o}${l}${Rn({output:t.output,options:this.options,cursor:this.cursor,maxItems:t.maxItems,columnPadding:l.length,rowPadding:d+c,style:a}).join(`
|
|
128
|
+
${l}`)}
|
|
129
|
+
${n?(0,v.styleText)("cyan",Ue):""}
|
|
130
|
+
`}}}}).prompt()};var go=t=>new wr({validate:t.validate,mask:t.mask??zu,signal:t.signal,input:t.input,output:t.output,render(){let e=t.withGuide??be.withGuide,r=`${e?`${(0,v.styleText)("gray",j)}
|
|
131
|
+
`:""}${Qt(this.state)} ${t.message}
|
|
132
|
+
`,n=this.userInputWithCursor,i=this.masked;switch(this.state){case"error":{let o=e?`${(0,v.styleText)("yellow",j)} `:"",s=e?`${(0,v.styleText)("yellow",Ue)} `:"",a=i??"";return t.clearOnError&&this.clear(),`${r.trim()}
|
|
134
133
|
${o}${a}
|
|
135
|
-
${s}${(0,
|
|
136
|
-
`}case"submit":{let o=
|
|
137
|
-
${(0,
|
|
134
|
+
${s}${(0,v.styleText)("yellow",this.error)}
|
|
135
|
+
`}case"submit":{let o=e?`${(0,v.styleText)("gray",j)} `:"",s=i?(0,v.styleText)("dim",i):"";return`${r}${o}${s}`}case"cancel":{let o=e?`${(0,v.styleText)("gray",j)} `:"",s=i?(0,v.styleText)(["strikethrough","dim"],i):"";return`${r}${o}${s}${i&&e?`
|
|
136
|
+
${(0,v.styleText)("gray",j)}`:""}`}default:{let o=e?`${(0,v.styleText)("cyan",j)} `:"",s=e?(0,v.styleText)("cyan",Ue):"";return`${r}${o}${n}
|
|
138
137
|
${s}
|
|
139
|
-
`}}}}).prompt();var
|
|
140
|
-
`)?
|
|
141
|
-
`).map(r=>
|
|
142
|
-
`):t
|
|
138
|
+
`}}}}).prompt();var hf={light:K("\u2500","-"),heavy:K("\u2501","="),block:K("\u2588","#")};var Ar=(t,e)=>t.includes(`
|
|
139
|
+
`)?t.split(`
|
|
140
|
+
`).map(r=>e(r)).join(`
|
|
141
|
+
`):e(t),ie=t=>{let e=(r,n)=>{let i=r.label??String(r.value);switch(n){case"disabled":return`${(0,v.styleText)("gray",kr)} ${Ar(i,o=>(0,v.styleText)("gray",o))}${r.hint?` ${(0,v.styleText)("dim",`(${r.hint??"disabled"})`)}`:""}`;case"selected":return`${Ar(i,o=>(0,v.styleText)("dim",o))}`;case"active":return`${(0,v.styleText)("green",jn)} ${i}${r.hint?` ${(0,v.styleText)("dim",`(${r.hint})`)}`:""}`;case"cancelled":return`${Ar(i,o=>(0,v.styleText)(["strikethrough","dim"],o))}`;default:return`${(0,v.styleText)("dim",kr)} ${Ar(i,o=>(0,v.styleText)("dim",o))}`}};return new _r({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue,render(){let r=t.withGuide??be.withGuide,n=`${Qt(this.state)} `,i=`${uo(this.state)} `,o=tt(t.output,t.message,i,n),s=`${r?`${(0,v.styleText)("gray",j)}
|
|
143
142
|
`:""}${o}
|
|
144
|
-
`;switch(this.state){case"submit":{let a=r?`${(0,
|
|
145
|
-
${(0,
|
|
146
|
-
`).length,
|
|
143
|
+
`;switch(this.state){case"submit":{let a=r?`${(0,v.styleText)("gray",j)} `:"",l=tt(t.output,e(this.options[this.cursor],"selected"),a);return`${s}${l}`}case"cancel":{let a=r?`${(0,v.styleText)("gray",j)} `:"",l=tt(t.output,e(this.options[this.cursor],"cancelled"),a);return`${s}${l}${r?`
|
|
144
|
+
${(0,v.styleText)("gray",j)}`:""}`}default:{let a=r?`${(0,v.styleText)("cyan",j)} `:"",l=r?(0,v.styleText)("cyan",Ue):"",d=s.split(`
|
|
145
|
+
`).length,c=r?2:1;return`${s}${a}${Rn({output:t.output,cursor:this.cursor,options:this.options,maxItems:t.maxItems,columnPadding:a.length,rowPadding:d+c,style:(u,m)=>e(u,u.disabled?"disabled":m?"active":"inactive")}).join(`
|
|
147
146
|
${a}`)}
|
|
148
|
-
${
|
|
149
|
-
`}}}}).prompt()};var
|
|
150
|
-
`:""}${
|
|
151
|
-
`,
|
|
152
|
-
${a}${
|
|
153
|
-
${
|
|
154
|
-
`}case"submit":{let s=o?` ${(0,
|
|
155
|
-
${a}`:""}`}default:{let s=
|
|
147
|
+
${l}
|
|
148
|
+
`}}}}).prompt()};var gf=`${(0,v.styleText)("gray",j)} `;var Y=t=>new xr({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,output:t.output,signal:t.signal,input:t.input,render(){let e=t?.withGuide??be.withGuide,r=`${`${e?`${(0,v.styleText)("gray",j)}
|
|
149
|
+
`:""}${Qt(this.state)} `}${t.message}
|
|
150
|
+
`,n=t.placeholder?(0,v.styleText)("inverse",t.placeholder[0])+(0,v.styleText)("dim",t.placeholder.slice(1)):(0,v.styleText)(["inverse","hidden"],"_"),i=this.userInput?this.userInputWithCursor:n,o=this.value??"";switch(this.state){case"error":{let s=this.error?` ${(0,v.styleText)("yellow",this.error)}`:"",a=e?`${(0,v.styleText)("yellow",j)} `:"",l=e?(0,v.styleText)("yellow",Ue):"";return`${r.trim()}
|
|
151
|
+
${a}${i}
|
|
152
|
+
${l}${s}
|
|
153
|
+
`}case"submit":{let s=o?` ${(0,v.styleText)("dim",o)}`:"",a=e?(0,v.styleText)("gray",j):"";return`${r}${a}${s}`}case"cancel":{let s=o?` ${(0,v.styleText)(["strikethrough","dim"],o)}`:"",a=e?(0,v.styleText)("gray",j):"";return`${r}${a}${s}${o.trim()?`
|
|
154
|
+
${a}`:""}`}default:{let s=e?`${(0,v.styleText)("cyan",j)} `:"",a=e?(0,v.styleText)("cyan",Ue):"";return`${r}${s}${i}
|
|
156
155
|
${a}
|
|
157
|
-
`}}}}).prompt();var
|
|
158
|
-
`)}finalize(){return
|
|
159
|
-
`;if(r=this.remainder+r,r.length<this.maxChunkSize){this.remainder=r;return}this.remainder="";let
|
|
160
|
-
-- `)?r?
|
|
161
|
-
`+
|
|
162
|
-
`+r,this.headerLines.splice(
|
|
163
|
-
`,"𝔑":"\u{1D511}","⁠":"\u2060"," ":"\xA0","ℕ":"\u2115","⫬":"\u2AEC","≢":"\u2262","≭":"\u226D","∦":"\u2226","∉":"\u2209","≠":"\u2260","≂̸":"\u2242\u0338","∄":"\u2204","≯":"\u226F","≱":"\u2271","≧̸":"\u2267\u0338","≫̸":"\u226B\u0338","≹":"\u2279","⩾̸":"\u2A7E\u0338","≵":"\u2275","≎̸":"\u224E\u0338","≏̸":"\u224F\u0338","⋪":"\u22EA","⧏̸":"\u29CF\u0338","⋬":"\u22EC","≮":"\u226E","≰":"\u2270","≸":"\u2278","≪̸":"\u226A\u0338","⩽̸":"\u2A7D\u0338","≴":"\u2274","⪢̸":"\u2AA2\u0338","⪡̸":"\u2AA1\u0338","⊀":"\u2280","⪯̸":"\u2AAF\u0338","⋠":"\u22E0","∌":"\u220C","⋫":"\u22EB","⧐̸":"\u29D0\u0338","⋭":"\u22ED","⊏̸":"\u228F\u0338","⋢":"\u22E2","⊐̸":"\u2290\u0338","⋣":"\u22E3","⊂⃒":"\u2282\u20D2","⊈":"\u2288","⊁":"\u2281","⪰̸":"\u2AB0\u0338","⋡":"\u22E1","≿̸":"\u227F\u0338","⊃⃒":"\u2283\u20D2","⊉":"\u2289","≁":"\u2241","≄":"\u2244","≇":"\u2247","≉":"\u2249","∤":"\u2224","𝒩":"\u{1D4A9}","Ñ":"\xD1","Ñ":"\xD1","Ν":"\u039D","Œ":"\u0152","Ó":"\xD3","Ó":"\xD3","Ô":"\xD4","Ô":"\xD4","О":"\u041E","Ő":"\u0150","𝔒":"\u{1D512}","Ò":"\xD2","Ò":"\xD2","Ō":"\u014C","Ω":"\u03A9","Ο":"\u039F","𝕆":"\u{1D546}","“":"\u201C","‘":"\u2018","⩔":"\u2A54","𝒪":"\u{1D4AA}","Ø":"\xD8","Ø":"\xD8","Õ":"\xD5","Õ":"\xD5","⨷":"\u2A37","Ö":"\xD6","Ö":"\xD6","‾":"\u203E","⏞":"\u23DE","⎴":"\u23B4","⏜":"\u23DC","∂":"\u2202","П":"\u041F","𝔓":"\u{1D513}","Φ":"\u03A6","Π":"\u03A0","±":"\xB1","ℌ":"\u210C","ℙ":"\u2119","⪻":"\u2ABB","≺":"\u227A","⪯":"\u2AAF","≼":"\u227C","≾":"\u227E","″":"\u2033","∏":"\u220F","∷":"\u2237","∝":"\u221D","𝒫":"\u{1D4AB}","Ψ":"\u03A8",""":'"',""":'"',"𝔔":"\u{1D514}","ℚ":"\u211A","𝒬":"\u{1D4AC}","⤐":"\u2910","®":"\xAE","®":"\xAE","Ŕ":"\u0154","⟫":"\u27EB","↠":"\u21A0","⤖":"\u2916","Ř":"\u0158","Ŗ":"\u0156","Р":"\u0420","ℜ":"\u211C","∋":"\u220B","⇋":"\u21CB","⥯":"\u296F","ℜ":"\u211C","Ρ":"\u03A1","⟩":"\u27E9","→":"\u2192","⇥":"\u21E5","⇄":"\u21C4","⌉":"\u2309","⟧":"\u27E7","⥝":"\u295D","⇂":"\u21C2","⥕":"\u2955","⌋":"\u230B","⊢":"\u22A2","↦":"\u21A6","⥛":"\u295B","⊳":"\u22B3","⧐":"\u29D0","⊵":"\u22B5","⥏":"\u294F","⥜":"\u295C","↾":"\u21BE","⥔":"\u2954","⇀":"\u21C0","⥓":"\u2953","⇒":"\u21D2","ℝ":"\u211D","⥰":"\u2970","⇛":"\u21DB","ℛ":"\u211B","↱":"\u21B1","⧴":"\u29F4","Щ":"\u0429","Ш":"\u0428","Ь":"\u042C","Ś":"\u015A","⪼":"\u2ABC","Š":"\u0160","Ş":"\u015E","Ŝ":"\u015C","С":"\u0421","𝔖":"\u{1D516}","↓":"\u2193","←":"\u2190","→":"\u2192","↑":"\u2191","Σ":"\u03A3","∘":"\u2218","𝕊":"\u{1D54A}","√":"\u221A","□":"\u25A1","⊓":"\u2293","⊏":"\u228F","⊑":"\u2291","⊐":"\u2290","⊒":"\u2292","⊔":"\u2294","𝒮":"\u{1D4AE}","⋆":"\u22C6","⋐":"\u22D0","⋐":"\u22D0","⊆":"\u2286","≻":"\u227B","⪰":"\u2AB0","≽":"\u227D","≿":"\u227F","∋":"\u220B","∑":"\u2211","⋑":"\u22D1","⊃":"\u2283","⊇":"\u2287","⋑":"\u22D1","Þ":"\xDE","Þ":"\xDE","™":"\u2122","Ћ":"\u040B","Ц":"\u0426","	":" ","Τ":"\u03A4","Ť":"\u0164","Ţ":"\u0162","Т":"\u0422","𝔗":"\u{1D517}","∴":"\u2234","Θ":"\u0398","  ":"\u205F\u200A"," ":"\u2009","∼":"\u223C","≃":"\u2243","≅":"\u2245","≈":"\u2248","𝕋":"\u{1D54B}","⃛":"\u20DB","𝒯":"\u{1D4AF}","Ŧ":"\u0166","Ú":"\xDA","Ú":"\xDA","↟":"\u219F","⥉":"\u2949","Ў":"\u040E","Ŭ":"\u016C","Û":"\xDB","Û":"\xDB","У":"\u0423","Ű":"\u0170","𝔘":"\u{1D518}","Ù":"\xD9","Ù":"\xD9","Ū":"\u016A","_":"_","⏟":"\u23DF","⎵":"\u23B5","⏝":"\u23DD","⋃":"\u22C3","⊎":"\u228E","Ų":"\u0172","𝕌":"\u{1D54C}","↑":"\u2191","⤒":"\u2912","⇅":"\u21C5","↕":"\u2195","⥮":"\u296E","⊥":"\u22A5","↥":"\u21A5","⇑":"\u21D1","⇕":"\u21D5","↖":"\u2196","↗":"\u2197","ϒ":"\u03D2","Υ":"\u03A5","Ů":"\u016E","𝒰":"\u{1D4B0}","Ũ":"\u0168","Ü":"\xDC","Ü":"\xDC","⊫":"\u22AB","⫫":"\u2AEB","В":"\u0412","⊩":"\u22A9","⫦":"\u2AE6","⋁":"\u22C1","‖":"\u2016","‖":"\u2016","∣":"\u2223","|":"|","❘":"\u2758","≀":"\u2240"," ":"\u200A","𝔙":"\u{1D519}","𝕍":"\u{1D54D}","𝒱":"\u{1D4B1}","⊪":"\u22AA","Ŵ":"\u0174","⋀":"\u22C0","𝔚":"\u{1D51A}","𝕎":"\u{1D54E}","𝒲":"\u{1D4B2}","𝔛":"\u{1D51B}","Ξ":"\u039E","𝕏":"\u{1D54F}","𝒳":"\u{1D4B3}","Я":"\u042F","Ї":"\u0407","Ю":"\u042E","Ý":"\xDD","Ý":"\xDD","Ŷ":"\u0176","Ы":"\u042B","𝔜":"\u{1D51C}","𝕐":"\u{1D550}","𝒴":"\u{1D4B4}","Ÿ":"\u0178","Ж":"\u0416","Ź":"\u0179","Ž":"\u017D","З":"\u0417","Ż":"\u017B","​":"\u200B","Ζ":"\u0396","ℨ":"\u2128","ℤ":"\u2124","𝒵":"\u{1D4B5}","á":"\xE1","á":"\xE1","ă":"\u0103","∾":"\u223E","∾̳":"\u223E\u0333","∿":"\u223F","â":"\xE2","â":"\xE2","´":"\xB4","´":"\xB4","а":"\u0430","æ":"\xE6","æ":"\xE6","⁡":"\u2061","𝔞":"\u{1D51E}","à":"\xE0","à":"\xE0","ℵ":"\u2135","ℵ":"\u2135","α":"\u03B1","ā":"\u0101","⨿":"\u2A3F","&":"&","&":"&","∧":"\u2227","⩕":"\u2A55","⩜":"\u2A5C","⩘":"\u2A58","⩚":"\u2A5A","∠":"\u2220","⦤":"\u29A4","∠":"\u2220","∡":"\u2221","⦨":"\u29A8","⦩":"\u29A9","⦪":"\u29AA","⦫":"\u29AB","⦬":"\u29AC","⦭":"\u29AD","⦮":"\u29AE","⦯":"\u29AF","∟":"\u221F","⊾":"\u22BE","⦝":"\u299D","∢":"\u2222","Å":"\xC5","⍼":"\u237C","ą":"\u0105","𝕒":"\u{1D552}","≈":"\u2248","⩰":"\u2A70","⩯":"\u2A6F","≊":"\u224A","≋":"\u224B","'":"'","≈":"\u2248","≊":"\u224A","å":"\xE5","å":"\xE5","𝒶":"\u{1D4B6}","*":"*","≈":"\u2248","≍":"\u224D","ã":"\xE3","ã":"\xE3","ä":"\xE4","ä":"\xE4","∳":"\u2233","⨑":"\u2A11","⫭":"\u2AED","≌":"\u224C","϶":"\u03F6","‵":"\u2035","∽":"\u223D","⋍":"\u22CD","⊽":"\u22BD","⌅":"\u2305","⌅":"\u2305","⎵":"\u23B5","⎶":"\u23B6","≌":"\u224C","б":"\u0431","„":"\u201E","∵":"\u2235","∵":"\u2235","⦰":"\u29B0","϶":"\u03F6","ℬ":"\u212C","β":"\u03B2","ℶ":"\u2136","≬":"\u226C","𝔟":"\u{1D51F}","⋂":"\u22C2","◯":"\u25EF","⋃":"\u22C3","⨀":"\u2A00","⨁":"\u2A01","⨂":"\u2A02","⨆":"\u2A06","★":"\u2605","▽":"\u25BD","△":"\u25B3","⨄":"\u2A04","⋁":"\u22C1","⋀":"\u22C0","⤍":"\u290D","⧫":"\u29EB","▪":"\u25AA","▴":"\u25B4","▾":"\u25BE","◂":"\u25C2","▸":"\u25B8","␣":"\u2423","▒":"\u2592","░":"\u2591","▓":"\u2593","█":"\u2588","=⃥":"=\u20E5","≡⃥":"\u2261\u20E5","⌐":"\u2310","𝕓":"\u{1D553}","⊥":"\u22A5","⊥":"\u22A5","⋈":"\u22C8","╗":"\u2557","╔":"\u2554","╖":"\u2556","╓":"\u2553","═":"\u2550","╦":"\u2566","╩":"\u2569","╤":"\u2564","╧":"\u2567","╝":"\u255D","╚":"\u255A","╜":"\u255C","╙":"\u2559","║":"\u2551","╬":"\u256C","╣":"\u2563","╠":"\u2560","╫":"\u256B","╢":"\u2562","╟":"\u255F","⧉":"\u29C9","╕":"\u2555","╒":"\u2552","┐":"\u2510","┌":"\u250C","─":"\u2500","╥":"\u2565","╨":"\u2568","┬":"\u252C","┴":"\u2534","⊟":"\u229F","⊞":"\u229E","⊠":"\u22A0","╛":"\u255B","╘":"\u2558","┘":"\u2518","└":"\u2514","│":"\u2502","╪":"\u256A","╡":"\u2561","╞":"\u255E","┼":"\u253C","┤":"\u2524","├":"\u251C","‵":"\u2035","˘":"\u02D8","¦":"\xA6","¦":"\xA6","𝒷":"\u{1D4B7}","⁏":"\u204F","∽":"\u223D","⋍":"\u22CD","\":"\\","⧅":"\u29C5","⟈":"\u27C8","•":"\u2022","•":"\u2022","≎":"\u224E","⪮":"\u2AAE","≏":"\u224F","≏":"\u224F","ć":"\u0107","∩":"\u2229","⩄":"\u2A44","⩉":"\u2A49","⩋":"\u2A4B","⩇":"\u2A47","⩀":"\u2A40","∩︀":"\u2229\uFE00","⁁":"\u2041","ˇ":"\u02C7","⩍":"\u2A4D","č":"\u010D","ç":"\xE7","ç":"\xE7","ĉ":"\u0109","⩌":"\u2A4C","⩐":"\u2A50","ċ":"\u010B","¸":"\xB8","¸":"\xB8","⦲":"\u29B2","¢":"\xA2","¢":"\xA2","·":"\xB7","𝔠":"\u{1D520}","ч":"\u0447","✓":"\u2713","✓":"\u2713","χ":"\u03C7","○":"\u25CB","⧃":"\u29C3","ˆ":"\u02C6","≗":"\u2257","↺":"\u21BA","↻":"\u21BB","®":"\xAE","Ⓢ":"\u24C8","⊛":"\u229B","⊚":"\u229A","⊝":"\u229D","≗":"\u2257","⨐":"\u2A10","⫯":"\u2AEF","⧂":"\u29C2","♣":"\u2663","♣":"\u2663",":":":","≔":"\u2254","≔":"\u2254",",":",","@":"@","∁":"\u2201","∘":"\u2218","∁":"\u2201","ℂ":"\u2102","≅":"\u2245","⩭":"\u2A6D","∮":"\u222E","𝕔":"\u{1D554}","∐":"\u2210","©":"\xA9","©":"\xA9","℗":"\u2117","↵":"\u21B5","✗":"\u2717","𝒸":"\u{1D4B8}","⫏":"\u2ACF","⫑":"\u2AD1","⫐":"\u2AD0","⫒":"\u2AD2","⋯":"\u22EF","⤸":"\u2938","⤵":"\u2935","⋞":"\u22DE","⋟":"\u22DF","↶":"\u21B6","⤽":"\u293D","∪":"\u222A","⩈":"\u2A48","⩆":"\u2A46","⩊":"\u2A4A","⊍":"\u228D","⩅":"\u2A45","∪︀":"\u222A\uFE00","↷":"\u21B7","⤼":"\u293C","⋞":"\u22DE","⋟":"\u22DF","⋎":"\u22CE","⋏":"\u22CF","¤":"\xA4","¤":"\xA4","↶":"\u21B6","↷":"\u21B7","⋎":"\u22CE","⋏":"\u22CF","∲":"\u2232","∱":"\u2231","⌭":"\u232D","⇓":"\u21D3","⥥":"\u2965","†":"\u2020","ℸ":"\u2138","↓":"\u2193","‐":"\u2010","⊣":"\u22A3","⤏":"\u290F","˝":"\u02DD","ď":"\u010F","д":"\u0434","ⅆ":"\u2146","‡":"\u2021","⇊":"\u21CA","⩷":"\u2A77","°":"\xB0","°":"\xB0","δ":"\u03B4","⦱":"\u29B1","⥿":"\u297F","𝔡":"\u{1D521}","⇃":"\u21C3","⇂":"\u21C2","⋄":"\u22C4","⋄":"\u22C4","♦":"\u2666","♦":"\u2666","¨":"\xA8","ϝ":"\u03DD","⋲":"\u22F2","÷":"\xF7","÷":"\xF7","÷":"\xF7","⋇":"\u22C7","⋇":"\u22C7","ђ":"\u0452","⌞":"\u231E","⌍":"\u230D","$":"$","𝕕":"\u{1D555}","˙":"\u02D9","≐":"\u2250","≑":"\u2251","∸":"\u2238","∔":"\u2214","⊡":"\u22A1","⌆":"\u2306","↓":"\u2193","⇊":"\u21CA","⇃":"\u21C3","⇂":"\u21C2","⤐":"\u2910","⌟":"\u231F","⌌":"\u230C","𝒹":"\u{1D4B9}","ѕ":"\u0455","⧶":"\u29F6","đ":"\u0111","⋱":"\u22F1","▿":"\u25BF","▾":"\u25BE","⇵":"\u21F5","⥯":"\u296F","⦦":"\u29A6","џ":"\u045F","⟿":"\u27FF","⩷":"\u2A77","≑":"\u2251","é":"\xE9","é":"\xE9","⩮":"\u2A6E","ě":"\u011B","≖":"\u2256","ê":"\xEA","ê":"\xEA","≕":"\u2255","э":"\u044D","ė":"\u0117","ⅇ":"\u2147","≒":"\u2252","𝔢":"\u{1D522}","⪚":"\u2A9A","è":"\xE8","è":"\xE8","⪖":"\u2A96","⪘":"\u2A98","⪙":"\u2A99","⏧":"\u23E7","ℓ":"\u2113","⪕":"\u2A95","⪗":"\u2A97","ē":"\u0113","∅":"\u2205","∅":"\u2205","∅":"\u2205"," ":"\u2004"," ":"\u2005"," ":"\u2003","ŋ":"\u014B"," ":"\u2002","ę":"\u0119","𝕖":"\u{1D556}","⋕":"\u22D5","⧣":"\u29E3","⩱":"\u2A71","ε":"\u03B5","ε":"\u03B5","ϵ":"\u03F5","≖":"\u2256","≕":"\u2255","≂":"\u2242","⪖":"\u2A96","⪕":"\u2A95","=":"=","≟":"\u225F","≡":"\u2261","⩸":"\u2A78","⧥":"\u29E5","≓":"\u2253","⥱":"\u2971","ℯ":"\u212F","≐":"\u2250","≂":"\u2242","η":"\u03B7","ð":"\xF0","ð":"\xF0","ë":"\xEB","ë":"\xEB","€":"\u20AC","!":"!","∃":"\u2203","ℰ":"\u2130","ⅇ":"\u2147","≒":"\u2252","ф":"\u0444","♀":"\u2640","ffi":"\uFB03","ff":"\uFB00","ffl":"\uFB04","𝔣":"\u{1D523}","fi":"\uFB01","fj":"fj","♭":"\u266D","fl":"\uFB02","▱":"\u25B1","ƒ":"\u0192","𝕗":"\u{1D557}","∀":"\u2200","⋔":"\u22D4","⫙":"\u2AD9","⨍":"\u2A0D","½":"\xBD","½":"\xBD","⅓":"\u2153","¼":"\xBC","¼":"\xBC","⅕":"\u2155","⅙":"\u2159","⅛":"\u215B","⅔":"\u2154","⅖":"\u2156","¾":"\xBE","¾":"\xBE","⅗":"\u2157","⅜":"\u215C","⅘":"\u2158","⅚":"\u215A","⅝":"\u215D","⅞":"\u215E","⁄":"\u2044","⌢":"\u2322","𝒻":"\u{1D4BB}","≧":"\u2267","⪌":"\u2A8C","ǵ":"\u01F5","γ":"\u03B3","ϝ":"\u03DD","⪆":"\u2A86","ğ":"\u011F","ĝ":"\u011D","г":"\u0433","ġ":"\u0121","≥":"\u2265","⋛":"\u22DB","≥":"\u2265","≧":"\u2267","⩾":"\u2A7E","⩾":"\u2A7E","⪩":"\u2AA9","⪀":"\u2A80","⪂":"\u2A82","⪄":"\u2A84","⋛︀":"\u22DB\uFE00","⪔":"\u2A94","𝔤":"\u{1D524}","≫":"\u226B","⋙":"\u22D9","ℷ":"\u2137","ѓ":"\u0453","≷":"\u2277","⪒":"\u2A92","⪥":"\u2AA5","⪤":"\u2AA4","≩":"\u2269","⪊":"\u2A8A","⪊":"\u2A8A","⪈":"\u2A88","⪈":"\u2A88","≩":"\u2269","⋧":"\u22E7","𝕘":"\u{1D558}","`":"`","ℊ":"\u210A","≳":"\u2273","⪎":"\u2A8E","⪐":"\u2A90",">":">",">":">","⪧":"\u2AA7","⩺":"\u2A7A","⋗":"\u22D7","⦕":"\u2995","⩼":"\u2A7C","⪆":"\u2A86","⥸":"\u2978","⋗":"\u22D7","⋛":"\u22DB","⪌":"\u2A8C","≷":"\u2277","≳":"\u2273","≩︀":"\u2269\uFE00","≩︀":"\u2269\uFE00","⇔":"\u21D4"," ":"\u200A","½":"\xBD","ℋ":"\u210B","ъ":"\u044A","↔":"\u2194","⥈":"\u2948","↭":"\u21AD","ℏ":"\u210F","ĥ":"\u0125","♥":"\u2665","♥":"\u2665","…":"\u2026","⊹":"\u22B9","𝔥":"\u{1D525}","⤥":"\u2925","⤦":"\u2926","⇿":"\u21FF","∻":"\u223B","↩":"\u21A9","↪":"\u21AA","𝕙":"\u{1D559}","―":"\u2015","𝒽":"\u{1D4BD}","ℏ":"\u210F","ħ":"\u0127","⁃":"\u2043","‐":"\u2010","í":"\xED","í":"\xED","⁣":"\u2063","î":"\xEE","î":"\xEE","и":"\u0438","е":"\u0435","¡":"\xA1","¡":"\xA1","⇔":"\u21D4","𝔦":"\u{1D526}","ì":"\xEC","ì":"\xEC","ⅈ":"\u2148","⨌":"\u2A0C","∭":"\u222D","⧜":"\u29DC","℩":"\u2129","ij":"\u0133","ī":"\u012B","ℑ":"\u2111","ℐ":"\u2110","ℑ":"\u2111","ı":"\u0131","⊷":"\u22B7","Ƶ":"\u01B5","∈":"\u2208","℅":"\u2105","∞":"\u221E","⧝":"\u29DD","ı":"\u0131","∫":"\u222B","⊺":"\u22BA","ℤ":"\u2124","⊺":"\u22BA","⨗":"\u2A17","⨼":"\u2A3C","ё":"\u0451","į":"\u012F","𝕚":"\u{1D55A}","ι":"\u03B9","⨼":"\u2A3C","¿":"\xBF","¿":"\xBF","𝒾":"\u{1D4BE}","∈":"\u2208","⋹":"\u22F9","⋵":"\u22F5","⋴":"\u22F4","⋳":"\u22F3","∈":"\u2208","⁢":"\u2062","ĩ":"\u0129","і":"\u0456","ï":"\xEF","ï":"\xEF","ĵ":"\u0135","й":"\u0439","𝔧":"\u{1D527}","ȷ":"\u0237","𝕛":"\u{1D55B}","𝒿":"\u{1D4BF}","ј":"\u0458","є":"\u0454","κ":"\u03BA","ϰ":"\u03F0","ķ":"\u0137","к":"\u043A","𝔨":"\u{1D528}","ĸ":"\u0138","х":"\u0445","ќ":"\u045C","𝕜":"\u{1D55C}","𝓀":"\u{1D4C0}","⇚":"\u21DA","⇐":"\u21D0","⤛":"\u291B","⤎":"\u290E","≦":"\u2266","⪋":"\u2A8B","⥢":"\u2962","ĺ":"\u013A","⦴":"\u29B4","ℒ":"\u2112","λ":"\u03BB","⟨":"\u27E8","⦑":"\u2991","⟨":"\u27E8","⪅":"\u2A85","«":"\xAB","«":"\xAB","←":"\u2190","⇤":"\u21E4","⤟":"\u291F","⤝":"\u291D","↩":"\u21A9","↫":"\u21AB","⤹":"\u2939","⥳":"\u2973","↢":"\u21A2","⪫":"\u2AAB","⤙":"\u2919","⪭":"\u2AAD","⪭︀":"\u2AAD\uFE00","⤌":"\u290C","❲":"\u2772","{":"{","[":"[","⦋":"\u298B","⦏":"\u298F","⦍":"\u298D","ľ":"\u013E","ļ":"\u013C","⌈":"\u2308","{":"{","л":"\u043B","⤶":"\u2936","“":"\u201C","„":"\u201E","⥧":"\u2967","⥋":"\u294B","↲":"\u21B2","≤":"\u2264","←":"\u2190","↢":"\u21A2","↽":"\u21BD","↼":"\u21BC","⇇":"\u21C7","↔":"\u2194","⇆":"\u21C6","⇋":"\u21CB","↭":"\u21AD","⋋":"\u22CB","⋚":"\u22DA","≤":"\u2264","≦":"\u2266","⩽":"\u2A7D","⩽":"\u2A7D","⪨":"\u2AA8","⩿":"\u2A7F","⪁":"\u2A81","⪃":"\u2A83","⋚︀":"\u22DA\uFE00","⪓":"\u2A93","⪅":"\u2A85","⋖":"\u22D6","⋚":"\u22DA","⪋":"\u2A8B","≶":"\u2276","≲":"\u2272","⥼":"\u297C","⌊":"\u230A","𝔩":"\u{1D529}","≶":"\u2276","⪑":"\u2A91","↽":"\u21BD","↼":"\u21BC","⥪":"\u296A","▄":"\u2584","љ":"\u0459","≪":"\u226A","⇇":"\u21C7","⌞":"\u231E","⥫":"\u296B","◺":"\u25FA","ŀ":"\u0140","⎰":"\u23B0","⎰":"\u23B0","≨":"\u2268","⪉":"\u2A89","⪉":"\u2A89","⪇":"\u2A87","⪇":"\u2A87","≨":"\u2268","⋦":"\u22E6","⟬":"\u27EC","⇽":"\u21FD","⟦":"\u27E6","⟵":"\u27F5","⟷":"\u27F7","⟼":"\u27FC","⟶":"\u27F6","↫":"\u21AB","↬":"\u21AC","⦅":"\u2985","𝕝":"\u{1D55D}","⨭":"\u2A2D","⨴":"\u2A34","∗":"\u2217","_":"_","◊":"\u25CA","◊":"\u25CA","⧫":"\u29EB","(":"(","⦓":"\u2993","⇆":"\u21C6","⌟":"\u231F","⇋":"\u21CB","⥭":"\u296D","‎":"\u200E","⊿":"\u22BF","‹":"\u2039","𝓁":"\u{1D4C1}","↰":"\u21B0","≲":"\u2272","⪍":"\u2A8D","⪏":"\u2A8F","[":"[","‘":"\u2018","‚":"\u201A","ł":"\u0142","<":"<","<":"<","⪦":"\u2AA6","⩹":"\u2A79","⋖":"\u22D6","⋋":"\u22CB","⋉":"\u22C9","⥶":"\u2976","⩻":"\u2A7B","⦖":"\u2996","◃":"\u25C3","⊴":"\u22B4","◂":"\u25C2","⥊":"\u294A","⥦":"\u2966","≨︀":"\u2268\uFE00","≨︀":"\u2268\uFE00","∺":"\u223A","¯":"\xAF","¯":"\xAF","♂":"\u2642","✠":"\u2720","✠":"\u2720","↦":"\u21A6","↦":"\u21A6","↧":"\u21A7","↤":"\u21A4","↥":"\u21A5","▮":"\u25AE","⨩":"\u2A29","м":"\u043C","—":"\u2014","∡":"\u2221","𝔪":"\u{1D52A}","℧":"\u2127","µ":"\xB5","µ":"\xB5","∣":"\u2223","*":"*","⫰":"\u2AF0","·":"\xB7","·":"\xB7","−":"\u2212","⊟":"\u229F","∸":"\u2238","⨪":"\u2A2A","⫛":"\u2ADB","…":"\u2026","∓":"\u2213","⊧":"\u22A7","𝕞":"\u{1D55E}","∓":"\u2213","𝓂":"\u{1D4C2}","∾":"\u223E","μ":"\u03BC","⊸":"\u22B8","⊸":"\u22B8","⋙̸":"\u22D9\u0338","≫⃒":"\u226B\u20D2","≫̸":"\u226B\u0338","⇍":"\u21CD","⇎":"\u21CE","⋘̸":"\u22D8\u0338","≪⃒":"\u226A\u20D2","≪̸":"\u226A\u0338","⇏":"\u21CF","⊯":"\u22AF","⊮":"\u22AE","∇":"\u2207","ń":"\u0144","∠⃒":"\u2220\u20D2","≉":"\u2249","⩰̸":"\u2A70\u0338","≋̸":"\u224B\u0338","ʼn":"\u0149","≉":"\u2249","♮":"\u266E","♮":"\u266E","ℕ":"\u2115"," ":"\xA0"," ":"\xA0","≎̸":"\u224E\u0338","≏̸":"\u224F\u0338","⩃":"\u2A43","ň":"\u0148","ņ":"\u0146","≇":"\u2247","⩭̸":"\u2A6D\u0338","⩂":"\u2A42","н":"\u043D","–":"\u2013","≠":"\u2260","⇗":"\u21D7","⤤":"\u2924","↗":"\u2197","↗":"\u2197","≐̸":"\u2250\u0338","≢":"\u2262","⤨":"\u2928","≂̸":"\u2242\u0338","∄":"\u2204","∄":"\u2204","𝔫":"\u{1D52B}","≧̸":"\u2267\u0338","≱":"\u2271","≱":"\u2271","≧̸":"\u2267\u0338","⩾̸":"\u2A7E\u0338","⩾̸":"\u2A7E\u0338","≵":"\u2275","≯":"\u226F","≯":"\u226F","⇎":"\u21CE","↮":"\u21AE","⫲":"\u2AF2","∋":"\u220B","⋼":"\u22FC","⋺":"\u22FA","∋":"\u220B","њ":"\u045A","⇍":"\u21CD","≦̸":"\u2266\u0338","↚":"\u219A","‥":"\u2025","≰":"\u2270","↚":"\u219A","↮":"\u21AE","≰":"\u2270","≦̸":"\u2266\u0338","⩽̸":"\u2A7D\u0338","⩽̸":"\u2A7D\u0338","≮":"\u226E","≴":"\u2274","≮":"\u226E","⋪":"\u22EA","⋬":"\u22EC","∤":"\u2224","𝕟":"\u{1D55F}","¬":"\xAC","¬":"\xAC","∉":"\u2209","⋹̸":"\u22F9\u0338","⋵̸":"\u22F5\u0338","∉":"\u2209","⋷":"\u22F7","⋶":"\u22F6","∌":"\u220C","∌":"\u220C","⋾":"\u22FE","⋽":"\u22FD","∦":"\u2226","∦":"\u2226","⫽⃥":"\u2AFD\u20E5","∂̸":"\u2202\u0338","⨔":"\u2A14","⊀":"\u2280","⋠":"\u22E0","⪯̸":"\u2AAF\u0338","⊀":"\u2280","⪯̸":"\u2AAF\u0338","⇏":"\u21CF","↛":"\u219B","⤳̸":"\u2933\u0338","↝̸":"\u219D\u0338","↛":"\u219B","⋫":"\u22EB","⋭":"\u22ED","⊁":"\u2281","⋡":"\u22E1","⪰̸":"\u2AB0\u0338","𝓃":"\u{1D4C3}","∤":"\u2224","∦":"\u2226","≁":"\u2241","≄":"\u2244","≄":"\u2244","∤":"\u2224","∦":"\u2226","⋢":"\u22E2","⋣":"\u22E3","⊄":"\u2284","⫅̸":"\u2AC5\u0338","⊈":"\u2288","⊂⃒":"\u2282\u20D2","⊈":"\u2288","⫅̸":"\u2AC5\u0338","⊁":"\u2281","⪰̸":"\u2AB0\u0338","⊅":"\u2285","⫆̸":"\u2AC6\u0338","⊉":"\u2289","⊃⃒":"\u2283\u20D2","⊉":"\u2289","⫆̸":"\u2AC6\u0338","≹":"\u2279","ñ":"\xF1","ñ":"\xF1","≸":"\u2278","⋪":"\u22EA","⋬":"\u22EC","⋫":"\u22EB","⋭":"\u22ED","ν":"\u03BD","#":"#","№":"\u2116"," ":"\u2007","⊭":"\u22AD","⤄":"\u2904","≍⃒":"\u224D\u20D2","⊬":"\u22AC","≥⃒":"\u2265\u20D2",">⃒":">\u20D2","⧞":"\u29DE","⤂":"\u2902","≤⃒":"\u2264\u20D2","<⃒":"<\u20D2","⊴⃒":"\u22B4\u20D2","⤃":"\u2903","⊵⃒":"\u22B5\u20D2","∼⃒":"\u223C\u20D2","⇖":"\u21D6","⤣":"\u2923","↖":"\u2196","↖":"\u2196","⤧":"\u2927","Ⓢ":"\u24C8","ó":"\xF3","ó":"\xF3","⊛":"\u229B","⊚":"\u229A","ô":"\xF4","ô":"\xF4","о":"\u043E","⊝":"\u229D","ő":"\u0151","⨸":"\u2A38","⊙":"\u2299","⦼":"\u29BC","œ":"\u0153","⦿":"\u29BF","𝔬":"\u{1D52C}","˛":"\u02DB","ò":"\xF2","ò":"\xF2","⧁":"\u29C1","⦵":"\u29B5","Ω":"\u03A9","∮":"\u222E","↺":"\u21BA","⦾":"\u29BE","⦻":"\u29BB","‾":"\u203E","⧀":"\u29C0","ō":"\u014D","ω":"\u03C9","ο":"\u03BF","⦶":"\u29B6","⊖":"\u2296","𝕠":"\u{1D560}","⦷":"\u29B7","⦹":"\u29B9","⊕":"\u2295","∨":"\u2228","↻":"\u21BB","⩝":"\u2A5D","ℴ":"\u2134","ℴ":"\u2134","ª":"\xAA","ª":"\xAA","º":"\xBA","º":"\xBA","⊶":"\u22B6","⩖":"\u2A56","⩗":"\u2A57","⩛":"\u2A5B","ℴ":"\u2134","ø":"\xF8","ø":"\xF8","⊘":"\u2298","õ":"\xF5","õ":"\xF5","⊗":"\u2297","⨶":"\u2A36","ö":"\xF6","ö":"\xF6","⌽":"\u233D","∥":"\u2225","¶":"\xB6","¶":"\xB6","∥":"\u2225","⫳":"\u2AF3","⫽":"\u2AFD","∂":"\u2202","п":"\u043F","%":"%",".":".","‰":"\u2030","⊥":"\u22A5","‱":"\u2031","𝔭":"\u{1D52D}","φ":"\u03C6","ϕ":"\u03D5","ℳ":"\u2133","☎":"\u260E","π":"\u03C0","⋔":"\u22D4","ϖ":"\u03D6","ℏ":"\u210F","ℎ":"\u210E","ℏ":"\u210F","+":"+","⨣":"\u2A23","⊞":"\u229E","⨢":"\u2A22","∔":"\u2214","⨥":"\u2A25","⩲":"\u2A72","±":"\xB1","±":"\xB1","⨦":"\u2A26","⨧":"\u2A27","±":"\xB1","⨕":"\u2A15","𝕡":"\u{1D561}","£":"\xA3","£":"\xA3","≺":"\u227A","⪳":"\u2AB3","⪷":"\u2AB7","≼":"\u227C","⪯":"\u2AAF","≺":"\u227A","⪷":"\u2AB7","≼":"\u227C","⪯":"\u2AAF","⪹":"\u2AB9","⪵":"\u2AB5","⋨":"\u22E8","≾":"\u227E","′":"\u2032","ℙ":"\u2119","⪵":"\u2AB5","⪹":"\u2AB9","⋨":"\u22E8","∏":"\u220F","⌮":"\u232E","⌒":"\u2312","⌓":"\u2313","∝":"\u221D","∝":"\u221D","≾":"\u227E","⊰":"\u22B0","𝓅":"\u{1D4C5}","ψ":"\u03C8"," ":"\u2008","𝔮":"\u{1D52E}","⨌":"\u2A0C","𝕢":"\u{1D562}","⁗":"\u2057","𝓆":"\u{1D4C6}","ℍ":"\u210D","⨖":"\u2A16","?":"?","≟":"\u225F",""":'"',""":'"',"⇛":"\u21DB","⇒":"\u21D2","⤜":"\u291C","⤏":"\u290F","⥤":"\u2964","∽̱":"\u223D\u0331","ŕ":"\u0155","√":"\u221A","⦳":"\u29B3","⟩":"\u27E9","⦒":"\u2992","⦥":"\u29A5","⟩":"\u27E9","»":"\xBB","»":"\xBB","→":"\u2192","⥵":"\u2975","⇥":"\u21E5","⤠":"\u2920","⤳":"\u2933","⤞":"\u291E","↪":"\u21AA","↬":"\u21AC","⥅":"\u2945","⥴":"\u2974","↣":"\u21A3","↝":"\u219D","⤚":"\u291A","∶":"\u2236","ℚ":"\u211A","⤍":"\u290D","❳":"\u2773","}":"}","]":"]","⦌":"\u298C","⦎":"\u298E","⦐":"\u2990","ř":"\u0159","ŗ":"\u0157","⌉":"\u2309","}":"}","р":"\u0440","⤷":"\u2937","⥩":"\u2969","”":"\u201D","”":"\u201D","↳":"\u21B3","ℜ":"\u211C","ℛ":"\u211B","ℜ":"\u211C","ℝ":"\u211D","▭":"\u25AD","®":"\xAE","®":"\xAE","⥽":"\u297D","⌋":"\u230B","𝔯":"\u{1D52F}","⇁":"\u21C1","⇀":"\u21C0","⥬":"\u296C","ρ":"\u03C1","ϱ":"\u03F1","→":"\u2192","↣":"\u21A3","⇁":"\u21C1","⇀":"\u21C0","⇄":"\u21C4","⇌":"\u21CC","⇉":"\u21C9","↝":"\u219D","⋌":"\u22CC","˚":"\u02DA","≓":"\u2253","⇄":"\u21C4","⇌":"\u21CC","‏":"\u200F","⎱":"\u23B1","⎱":"\u23B1","⫮":"\u2AEE","⟭":"\u27ED","⇾":"\u21FE","⟧":"\u27E7","⦆":"\u2986","𝕣":"\u{1D563}","⨮":"\u2A2E","⨵":"\u2A35",")":")","⦔":"\u2994","⨒":"\u2A12","⇉":"\u21C9","›":"\u203A","𝓇":"\u{1D4C7}","↱":"\u21B1","]":"]","’":"\u2019","’":"\u2019","⋌":"\u22CC","⋊":"\u22CA","▹":"\u25B9","⊵":"\u22B5","▸":"\u25B8","⧎":"\u29CE","⥨":"\u2968","℞":"\u211E","ś":"\u015B","‚":"\u201A","≻":"\u227B","⪴":"\u2AB4","⪸":"\u2AB8","š":"\u0161","≽":"\u227D","⪰":"\u2AB0","ş":"\u015F","ŝ":"\u015D","⪶":"\u2AB6","⪺":"\u2ABA","⋩":"\u22E9","⨓":"\u2A13","≿":"\u227F","с":"\u0441","⋅":"\u22C5","⊡":"\u22A1","⩦":"\u2A66","⇘":"\u21D8","⤥":"\u2925","↘":"\u2198","↘":"\u2198","§":"\xA7","§":"\xA7",";":";","⤩":"\u2929","∖":"\u2216","∖":"\u2216","✶":"\u2736","𝔰":"\u{1D530}","⌢":"\u2322","♯":"\u266F","щ":"\u0449","ш":"\u0448","∣":"\u2223","∥":"\u2225","­":"\xAD","­":"\xAD","σ":"\u03C3","ς":"\u03C2","ς":"\u03C2","∼":"\u223C","⩪":"\u2A6A","≃":"\u2243","≃":"\u2243","⪞":"\u2A9E","⪠":"\u2AA0","⪝":"\u2A9D","⪟":"\u2A9F","≆":"\u2246","⨤":"\u2A24","⥲":"\u2972","←":"\u2190","∖":"\u2216","⨳":"\u2A33","⧤":"\u29E4","∣":"\u2223","⌣":"\u2323","⪪":"\u2AAA","⪬":"\u2AAC","⪬︀":"\u2AAC\uFE00","ь":"\u044C","/":"/","⧄":"\u29C4","⌿":"\u233F","𝕤":"\u{1D564}","♠":"\u2660","♠":"\u2660","∥":"\u2225","⊓":"\u2293","⊓︀":"\u2293\uFE00","⊔":"\u2294","⊔︀":"\u2294\uFE00","⊏":"\u228F","⊑":"\u2291","⊏":"\u228F","⊑":"\u2291","⊐":"\u2290","⊒":"\u2292","⊐":"\u2290","⊒":"\u2292","□":"\u25A1","□":"\u25A1","▪":"\u25AA","▪":"\u25AA","→":"\u2192","𝓈":"\u{1D4C8}","∖":"\u2216","⌣":"\u2323","⋆":"\u22C6","☆":"\u2606","★":"\u2605","ϵ":"\u03F5","ϕ":"\u03D5","¯":"\xAF","⊂":"\u2282","⫅":"\u2AC5","⪽":"\u2ABD","⊆":"\u2286","⫃":"\u2AC3","⫁":"\u2AC1","⫋":"\u2ACB","⊊":"\u228A","⪿":"\u2ABF","⥹":"\u2979","⊂":"\u2282","⊆":"\u2286","⫅":"\u2AC5","⊊":"\u228A","⫋":"\u2ACB","⫇":"\u2AC7","⫕":"\u2AD5","⫓":"\u2AD3","≻":"\u227B","⪸":"\u2AB8","≽":"\u227D","⪰":"\u2AB0","⪺":"\u2ABA","⪶":"\u2AB6","⋩":"\u22E9","≿":"\u227F","∑":"\u2211","♪":"\u266A","¹":"\xB9","¹":"\xB9","²":"\xB2","²":"\xB2","³":"\xB3","³":"\xB3","⊃":"\u2283","⫆":"\u2AC6","⪾":"\u2ABE","⫘":"\u2AD8","⊇":"\u2287","⫄":"\u2AC4","⟉":"\u27C9","⫗":"\u2AD7","⥻":"\u297B","⫂":"\u2AC2","⫌":"\u2ACC","⊋":"\u228B","⫀":"\u2AC0","⊃":"\u2283","⊇":"\u2287","⫆":"\u2AC6","⊋":"\u228B","⫌":"\u2ACC","⫈":"\u2AC8","⫔":"\u2AD4","⫖":"\u2AD6","⇙":"\u21D9","⤦":"\u2926","↙":"\u2199","↙":"\u2199","⤪":"\u292A","ß":"\xDF","ß":"\xDF","⌖":"\u2316","τ":"\u03C4","⎴":"\u23B4","ť":"\u0165","ţ":"\u0163","т":"\u0442","⃛":"\u20DB","⌕":"\u2315","𝔱":"\u{1D531}","∴":"\u2234","∴":"\u2234","θ":"\u03B8","ϑ":"\u03D1","ϑ":"\u03D1","≈":"\u2248","∼":"\u223C"," ":"\u2009","≈":"\u2248","∼":"\u223C","þ":"\xFE","þ":"\xFE","˜":"\u02DC","×":"\xD7","×":"\xD7","⊠":"\u22A0","⨱":"\u2A31","⨰":"\u2A30","∭":"\u222D","⤨":"\u2928","⊤":"\u22A4","⌶":"\u2336","⫱":"\u2AF1","𝕥":"\u{1D565}","⫚":"\u2ADA","⤩":"\u2929","‴":"\u2034","™":"\u2122","▵":"\u25B5","▿":"\u25BF","◃":"\u25C3","⊴":"\u22B4","≜":"\u225C","▹":"\u25B9","⊵":"\u22B5","◬":"\u25EC","≜":"\u225C","⨺":"\u2A3A","⨹":"\u2A39","⧍":"\u29CD","⨻":"\u2A3B","⏢":"\u23E2","𝓉":"\u{1D4C9}","ц":"\u0446","ћ":"\u045B","ŧ":"\u0167","≬":"\u226C","↞":"\u219E","↠":"\u21A0","⇑":"\u21D1","⥣":"\u2963","ú":"\xFA","ú":"\xFA","↑":"\u2191","ў":"\u045E","ŭ":"\u016D","û":"\xFB","û":"\xFB","у":"\u0443","⇅":"\u21C5","ű":"\u0171","⥮":"\u296E","⥾":"\u297E","𝔲":"\u{1D532}","ù":"\xF9","ù":"\xF9","↿":"\u21BF","↾":"\u21BE","▀":"\u2580","⌜":"\u231C","⌜":"\u231C","⌏":"\u230F","◸":"\u25F8","ū":"\u016B","¨":"\xA8","¨":"\xA8","ų":"\u0173","𝕦":"\u{1D566}","↑":"\u2191","↕":"\u2195","↿":"\u21BF","↾":"\u21BE","⊎":"\u228E","υ":"\u03C5","ϒ":"\u03D2","υ":"\u03C5","⇈":"\u21C8","⌝":"\u231D","⌝":"\u231D","⌎":"\u230E","ů":"\u016F","◹":"\u25F9","𝓊":"\u{1D4CA}","⋰":"\u22F0","ũ":"\u0169","▵":"\u25B5","▴":"\u25B4","⇈":"\u21C8","ü":"\xFC","ü":"\xFC","⦧":"\u29A7","⇕":"\u21D5","⫨":"\u2AE8","⫩":"\u2AE9","⊨":"\u22A8","⦜":"\u299C","ϵ":"\u03F5","ϰ":"\u03F0","∅":"\u2205","ϕ":"\u03D5","ϖ":"\u03D6","∝":"\u221D","↕":"\u2195","ϱ":"\u03F1","ς":"\u03C2","⊊︀":"\u228A\uFE00","⫋︀":"\u2ACB\uFE00","⊋︀":"\u228B\uFE00","⫌︀":"\u2ACC\uFE00","ϑ":"\u03D1","⊲":"\u22B2","⊳":"\u22B3","в":"\u0432","⊢":"\u22A2","∨":"\u2228","⊻":"\u22BB","≚":"\u225A","⋮":"\u22EE","|":"|","|":"|","𝔳":"\u{1D533}","⊲":"\u22B2","⊂⃒":"\u2282\u20D2","⊃⃒":"\u2283\u20D2","𝕧":"\u{1D567}","∝":"\u221D","⊳":"\u22B3","𝓋":"\u{1D4CB}","⫋︀":"\u2ACB\uFE00","⊊︀":"\u228A\uFE00","⫌︀":"\u2ACC\uFE00","⊋︀":"\u228B\uFE00","⦚":"\u299A","ŵ":"\u0175","⩟":"\u2A5F","∧":"\u2227","≙":"\u2259","℘":"\u2118","𝔴":"\u{1D534}","𝕨":"\u{1D568}","℘":"\u2118","≀":"\u2240","≀":"\u2240","𝓌":"\u{1D4CC}","⋂":"\u22C2","◯":"\u25EF","⋃":"\u22C3","▽":"\u25BD","𝔵":"\u{1D535}","⟺":"\u27FA","⟷":"\u27F7","ξ":"\u03BE","⟸":"\u27F8","⟵":"\u27F5","⟼":"\u27FC","⋻":"\u22FB","⨀":"\u2A00","𝕩":"\u{1D569}","⨁":"\u2A01","⨂":"\u2A02","⟹":"\u27F9","⟶":"\u27F6","𝓍":"\u{1D4CD}","⨆":"\u2A06","⨄":"\u2A04","△":"\u25B3","⋁":"\u22C1","⋀":"\u22C0","ý":"\xFD","ý":"\xFD","я":"\u044F","ŷ":"\u0177","ы":"\u044B","¥":"\xA5","¥":"\xA5","𝔶":"\u{1D536}","ї":"\u0457","𝕪":"\u{1D56A}","𝓎":"\u{1D4CE}","ю":"\u044E","ÿ":"\xFF","ÿ":"\xFF","ź":"\u017A","ž":"\u017E","з":"\u0437","ż":"\u017C","ℨ":"\u2128","ζ":"\u03B6","𝔷":"\u{1D537}","ж":"\u0436","⇝":"\u21DD","𝕫":"\u{1D56B}","𝓏":"\u{1D4CF}","‍":"\u200D","‌":"\u200C"},Au=q2;function R2(e){return e.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(t,r)=>{if(typeof Au[t]=="string")return Au[t];if(r.charAt(0)!=="#"||t.charAt(t.length-1)!==";")return t;let i;r.charAt(1)==="x"?i=parseInt(r.substr(2),16):i=parseInt(r.substr(1),10);let n="";return i>=55296&&i<=57343||i>1114111?"\uFFFD":(i>65535&&(i-=65536,n+=String.fromCharCode(i>>>10&1023|55296),i=56320|i&1023),n+=String.fromCharCode(i),n)})}function Jt(e){return e.trim().replace(/[<>"'?&]/g,t=>{let r=t.charCodeAt(0).toString(16);return r.length<2&&(r="0"+r),"&#x"+r.toUpperCase()+";"})}function wd(e){return"<div>"+Jt(e).replace(/\n/g,"<br />")+"</div>"}function xd(e){return e=e.replace(/\r?\n/g,"").replace(/<\!\-\-.*?\-\->/gi," ").replace(/<br\b[^>]*>/gi,`
|
|
156
|
+
`}}}}).prompt();var ar=pe(et(),1);ht();process.env.RESEND_USER_AGENT=`resend-cli:${te}`;var nt=new TextEncoder,vo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xt=new Uint8Array(256);for(let t=0;t<vo.length;t++)Xt[vo.charCodeAt(t)]=t;function Er(t){let e=Math.ceil(t.length/4)*3,r=t.length,n=0;t.length%4===3?e--:t.length%4===2?e-=2:t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);let i=new ArrayBuffer(e),o=new Uint8Array(i);for(let s=0;s<r;s+=4){let a=Xt[t.charCodeAt(s)],l=Xt[t.charCodeAt(s+1)],d=Xt[t.charCodeAt(s+2)],c=Xt[t.charCodeAt(s+3)];o[n++]=a<<2|l>>4,o[n++]=(l&15)<<4|d>>2,o[n++]=(d&3)<<6|c&63}return i}function kt(t){t=t||"utf8";let e;try{e=new TextDecoder(t)}catch{e=new TextDecoder("windows-1252")}return e}async function it(t){if("arrayBuffer"in t)return await t.arrayBuffer();let e=new FileReader;return new Promise((r,n)=>{e.onload=function(i){r(i.target.result)},e.onerror=function(i){n(e.error)},e.readAsArrayBuffer(t)})}function Co(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70?String.fromCharCode(t):!1}function ed(t,e,r){let n=t.indexOf("*");n>=0&&(t=t.substr(0,n)),e=e.toUpperCase();let i;if(e==="Q"){r=r.replace(/=\s+([0-9a-fA-F])/g,"=$1").replace(/[_\s]/g," ");let o=nt.encode(r),s=[];for(let l=0,d=o.length;l<d;l++){let c=o[l];if(l<=d-2&&c===61){let u=Co(o[l+1]),m=Co(o[l+2]);if(u&&m){let y=parseInt(u+m,16);s.push(y),l+=2;continue}}s.push(c)}i=new ArrayBuffer(s.length);let a=new DataView(i);for(let l=0,d=s.length;l<d;l++)a.setUint8(l,s[l])}else e==="B"?i=Er(r.replace(/[^a-zA-Z0-9\+\/=]+/g,"")):i=nt.encode(r);return kt(t).decode(i)}function gt(t){let e=!0,r=!1;for(;!r;){let n=(t||"").toString().replace(/(=\?([^?]+)\?[Bb]\?([^?]*)\?=)\s*(?==\?([^?]+)\?[Bb]\?[^?]*\?=)/g,(i,o,s,a,l)=>e&&s===l&&a.length%4===0&&!/=$/.test(a)?o+"__\0JOIN\0__":i).replace(/(=\?([^?]+)\?[Qq]\?[^?]*\?=)\s*(?==\?([^?]+)\?[Qq]\?[^?]*\?=)/g,(i,o,s,a)=>e&&s===a?o+"__\0JOIN\0__":i).replace(/(\?=)?__\x00JOIN\x00__(=\?([^?]+)\?[QqBb]\?)?/g,"").replace(/(=\?[^?]+\?[QqBb]\?[^?]*\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g,"$1").replace(/=\?([\w_\-*]+)\?([QqBb])\?([^?]*)\?=/g,(i,o,s,a)=>ed(o,s,a));if(e&&n.indexOf("\uFFFD")>=0)e=!1;else return n}}function td(t,e){e=e||"utf-8";let r=[];for(let o=0;o<t.length;o++){let s=t.charAt(o);if(s==="%"&&/^[a-f0-9]{2}/i.test(t.substr(o+1,2))){let a=t.substr(o+1,2);o+=2,r.push(parseInt(a,16))}else if(s.charCodeAt(0)>126){s=nt.encode(s);for(let a=0;a<s.length;a++)r.push(s[a])}else r.push(s.charCodeAt(0))}let n=new ArrayBuffer(r.length),i=new DataView(n);for(let o=0,s=r.length;o<s;o++)i.setUint8(o,r[o]);return kt(e).decode(n)}function wo(t){let e=new Map;Object.keys(t.params).forEach(r=>{let n=r.match(/\*((\d+)\*?)?$/);if(!n)return;let i=r.substr(0,n.index).toLowerCase(),o=Number(n[2])||0,s;e.has(i)?s=e.get(i):(s={charset:!1,values:[]},e.set(i,s));let a=t.params[r];o===0&&n[0].charAt(n[0].length-1)==="*"&&(n=a.match(/^([^']*)'[^']*'(.*)$/))&&(s.charset=n[1]||"utf-8",a=n[2]),s.values.push({nr:o,value:a}),delete t.params[r]}),e.forEach((r,n)=>{t.params[n]=td(r.values.sort((i,o)=>i.nr-o.nr).map(i=>i.value).join(""),r.charset)})}var Zt=class{constructor(){this.chunks=[]}update(e){this.chunks.push(e),this.chunks.push(`
|
|
157
|
+
`)}finalize(){return it(new Blob(this.chunks,{type:"application/octet-stream"}))}};var er=class{constructor(e){e=e||{},this.decoder=e.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.chunks=[],this.remainder=""}update(e){let r=this.decoder.decode(e);if(r=r.replace(/[^a-zA-Z0-9+\/]+/g,""),this.remainder+=r,this.remainder.length>=this.maxChunkSize){let n=Math.floor(this.remainder.length/4)*4,i;n===this.remainder.length?(i=this.remainder,this.remainder=""):(i=this.remainder.substr(0,n),this.remainder=this.remainder.substr(n)),i.length&&this.chunks.push(Er(i))}}finalize(){return this.remainder&&!/^=+$/.test(this.remainder)&&this.chunks.push(Er(this.remainder)),it(new Blob(this.chunks,{type:"application/octet-stream"}))}};var _o=/^=[a-f0-9]{2}$/i,rd=/(?==[a-f0-9]{2})/i,nd=/=\r?\n/g,id=/=[a-fA-F0-9]?$/,tr=class{constructor(e){e=e||{},this.decoder=e.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.remainder="",this.chunks=[]}decodeQPBytes(e){let r=new ArrayBuffer(e.length),n=new DataView(r);for(let i=0,o=e.length;i<o;i++)n.setUint8(i,parseInt(e[i],16));return r}decodeChunks(e){e=e.replace(nd,"");let r=e.split(rd),n=[];for(let i of r){if(i.charAt(0)!=="="){n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[]),this.chunks.push(i);continue}if(i.length===3){_o.test(i)?n.push(i.substr(1)):(n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[]),this.chunks.push(i));continue}if(i.length>3){let o=i.substr(0,3);_o.test(o)?(n.push(i.substr(1,2)),this.chunks.push(this.decodeQPBytes(n)),n=[],i=i.substr(3),this.chunks.push(i)):(n.length&&(this.chunks.push(this.decodeQPBytes(n)),n=[]),this.chunks.push(i))}}n.length&&this.chunks.push(this.decodeQPBytes(n))}update(e){let r=this.decoder.decode(e)+`
|
|
158
|
+
`;if(r=this.remainder+r,r.length<this.maxChunkSize){this.remainder=r;return}this.remainder="";let n=r.match(id);if(n){if(n.index===0){this.remainder=r;return}this.remainder=r.substr(n.index),r=r.substr(0,n.index)}this.decodeChunks(r)}finalize(){return this.remainder.length&&(this.decodeChunks(this.remainder),this.remainder=""),it(new Blob(this.chunks,{type:"application/octet-stream"}))}};var od=kt(),$t=class{constructor(e){if(this.options=e||{},this.postalMime=this.options.postalMime,this.root=!!this.options.parentNode,this.childNodes=[],this.options.parentNode){if(this.parentNode=this.options.parentNode,this.depth=this.parentNode.depth+1,this.depth>this.options.maxNestingDepth)throw new Error(`Maximum MIME nesting depth of ${this.options.maxNestingDepth} levels exceeded`);this.options.parentNode.childNodes.push(this)}else this.depth=0;this.state="header",this.headerLines=[],this.headerSize=0;let n=(this.options.parentMultipartType||null)==="digest"?"message/rfc822":"text/plain";this.contentType={value:n,default:!0},this.contentTransferEncoding={value:"8bit"},this.contentDisposition={value:""},this.headers=[],this.contentDecoder=!1}setupContentDecoder(e){/base64/i.test(e)?this.contentDecoder=new er:/quoted-printable/i.test(e)?this.contentDecoder=new tr({decoder:kt(this.contentType.parsed.params.charset)}):this.contentDecoder=new Zt}async finalize(){if(this.state==="finished")return;this.state==="header"&&this.processHeaders();let e=this.postalMime.boundaries;for(let r=e.length-1;r>=0;r--)if(e[r].node===this){e.splice(r,1);break}await this.finalizeChildNodes(),this.content=this.contentDecoder?await this.contentDecoder.finalize():null,this.state="finished"}async finalizeChildNodes(){for(let e of this.childNodes)await e.finalize()}stripComments(e){let r="",n=0,i=!1,o=!1;for(let s=0;s<e.length;s++){let a=e.charAt(s);if(i){n===0&&(r+=a),i=!1;continue}if(a==="\\"){i=!0,n===0&&(r+=a);continue}if(a==='"'&&n===0){o=!o,r+=a;continue}if(!o){if(a==="("){n++;continue}if(a===")"&&n>0){n--;continue}}n===0&&(r+=a)}return r}parseStructuredHeader(e){e=this.stripComments(e);let r={value:!1,params:{}},n=!1,i="",o="value",s=!1,a=!1,l;for(let d=0,c=e.length;d<c;d++)switch(l=e.charAt(d),o){case"key":if(l==="="){n=i.trim().toLowerCase(),o="value",i="";break}i+=l;break;case"value":if(a)i+=l;else if(l==="\\"){a=!0;continue}else s&&l===s?s=!1:!s&&l==='"'?s=l:!s&&l===";"?(n===!1?r.value=i.trim():r.params[n]=i.trim(),o="key",i=""):i+=l;a=!1;break}return i=i.trim(),o==="value"?n===!1?r.value=i:r.params[n]=i:i&&(r.params[i.toLowerCase()]=""),r.value&&(r.value=r.value.toLowerCase()),wo(r),r}decodeFlowedText(e,r){return e.split(/\r?\n/).reduce((n,i)=>n.endsWith(" ")&&n!=="-- "&&!n.endsWith(`
|
|
159
|
+
-- `)?r?n.slice(0,-1)+i:n+i:n+`
|
|
160
|
+
`+i).replace(/^ /gm,"")}getTextContent(){if(!this.content)return"";let e=kt(this.contentType.parsed.params.charset).decode(this.content);return/^flowed$/i.test(this.contentType.parsed.params.format)&&(e=this.decodeFlowedText(e,/^yes$/i.test(this.contentType.parsed.params.delsp))),e}processHeaders(){for(let e=this.headerLines.length-1;e>=0;e--){let r=this.headerLines[e];e&&/^\s/.test(r)&&(this.headerLines[e-1]+=`
|
|
161
|
+
`+r,this.headerLines.splice(e,1))}this.rawHeaderLines=[];for(let e=this.headerLines.length-1;e>=0;e--){let r=this.headerLines[e],n=r.indexOf(":"),i=n<0?r.trim():r.substr(0,n).trim();this.rawHeaderLines.push({key:i.toLowerCase(),line:r});let o=r.replace(/\s+/g," ");n=o.indexOf(":");let s=n<0?o.trim():o.substr(0,n).trim(),a=n<0?"":o.substr(n+1).trim();switch(this.headers.push({key:s.toLowerCase(),originalKey:s,value:a}),s.toLowerCase()){case"content-type":this.contentType.default&&(this.contentType={value:a,parsed:{}});break;case"content-transfer-encoding":this.contentTransferEncoding={value:a,parsed:{}};break;case"content-disposition":this.contentDisposition={value:a,parsed:{}};break;case"content-id":this.contentId=a;break;case"content-description":this.contentDescription=a;break}}this.contentType.parsed=this.parseStructuredHeader(this.contentType.value),this.contentType.multipart=/^multipart\//i.test(this.contentType.parsed.value)?this.contentType.parsed.value.substr(this.contentType.parsed.value.indexOf("/")+1):!1,this.contentType.multipart&&this.contentType.parsed.params.boundary&&this.postalMime.boundaries.push({value:nt.encode(this.contentType.parsed.params.boundary),node:this}),this.contentDisposition.parsed=this.parseStructuredHeader(this.contentDisposition.value),this.contentTransferEncoding.encoding=this.contentTransferEncoding.value.toLowerCase().split(/[^\w-]/).shift(),this.setupContentDecoder(this.contentTransferEncoding.encoding)}feed(e){switch(this.state){case"header":if(!e.length)return this.state="body",this.processHeaders();if(this.headerSize+=e.length,this.headerSize>this.options.maxHeadersSize)throw new Error(`Maximum header size of ${this.options.maxHeadersSize} bytes exceeded`);this.headerLines.push(od.decode(e));break;case"body":this.contentDecoder.update(e)}}};var sd={"Æ":"\xC6","Æ":"\xC6","&":"&","&":"&","Á":"\xC1","Á":"\xC1","Ă":"\u0102","Â":"\xC2","Â":"\xC2","А":"\u0410","𝔄":"\u{1D504}","À":"\xC0","À":"\xC0","Α":"\u0391","Ā":"\u0100","⩓":"\u2A53","Ą":"\u0104","𝔸":"\u{1D538}","⁡":"\u2061","Å":"\xC5","Å":"\xC5","𝒜":"\u{1D49C}","≔":"\u2254","Ã":"\xC3","Ã":"\xC3","Ä":"\xC4","Ä":"\xC4","∖":"\u2216","⫧":"\u2AE7","⌆":"\u2306","Б":"\u0411","∵":"\u2235","ℬ":"\u212C","Β":"\u0392","𝔅":"\u{1D505}","𝔹":"\u{1D539}","˘":"\u02D8","ℬ":"\u212C","≎":"\u224E","Ч":"\u0427","©":"\xA9","©":"\xA9","Ć":"\u0106","⋒":"\u22D2","ⅅ":"\u2145","ℭ":"\u212D","Č":"\u010C","Ç":"\xC7","Ç":"\xC7","Ĉ":"\u0108","∰":"\u2230","Ċ":"\u010A","¸":"\xB8","·":"\xB7","ℭ":"\u212D","Χ":"\u03A7","⊙":"\u2299","⊖":"\u2296","⊕":"\u2295","⊗":"\u2297","∲":"\u2232","”":"\u201D","’":"\u2019","∷":"\u2237","⩴":"\u2A74","≡":"\u2261","∯":"\u222F","∮":"\u222E","ℂ":"\u2102","∐":"\u2210","∳":"\u2233","⨯":"\u2A2F","𝒞":"\u{1D49E}","⋓":"\u22D3","≍":"\u224D","ⅅ":"\u2145","⤑":"\u2911","Ђ":"\u0402","Ѕ":"\u0405","Џ":"\u040F","‡":"\u2021","↡":"\u21A1","⫤":"\u2AE4","Ď":"\u010E","Д":"\u0414","∇":"\u2207","Δ":"\u0394","𝔇":"\u{1D507}","´":"\xB4","˙":"\u02D9","˝":"\u02DD","`":"`","˜":"\u02DC","⋄":"\u22C4","ⅆ":"\u2146","𝔻":"\u{1D53B}","¨":"\xA8","⃜":"\u20DC","≐":"\u2250","∯":"\u222F","¨":"\xA8","⇓":"\u21D3","⇐":"\u21D0","⇔":"\u21D4","⫤":"\u2AE4","⟸":"\u27F8","⟺":"\u27FA","⟹":"\u27F9","⇒":"\u21D2","⊨":"\u22A8","⇑":"\u21D1","⇕":"\u21D5","∥":"\u2225","↓":"\u2193","⤓":"\u2913","⇵":"\u21F5","̑":"\u0311","⥐":"\u2950","⥞":"\u295E","↽":"\u21BD","⥖":"\u2956","⥟":"\u295F","⇁":"\u21C1","⥗":"\u2957","⊤":"\u22A4","↧":"\u21A7","⇓":"\u21D3","𝒟":"\u{1D49F}","Đ":"\u0110","Ŋ":"\u014A","Ð":"\xD0","Ð":"\xD0","É":"\xC9","É":"\xC9","Ě":"\u011A","Ê":"\xCA","Ê":"\xCA","Э":"\u042D","Ė":"\u0116","𝔈":"\u{1D508}","È":"\xC8","È":"\xC8","∈":"\u2208","Ē":"\u0112","◻":"\u25FB","▫":"\u25AB","Ę":"\u0118","𝔼":"\u{1D53C}","Ε":"\u0395","⩵":"\u2A75","≂":"\u2242","⇌":"\u21CC","ℰ":"\u2130","⩳":"\u2A73","Η":"\u0397","Ë":"\xCB","Ë":"\xCB","∃":"\u2203","ⅇ":"\u2147","Ф":"\u0424","𝔉":"\u{1D509}","◼":"\u25FC","▪":"\u25AA","𝔽":"\u{1D53D}","∀":"\u2200","ℱ":"\u2131","ℱ":"\u2131","Ѓ":"\u0403",">":">",">":">","Γ":"\u0393","Ϝ":"\u03DC","Ğ":"\u011E","Ģ":"\u0122","Ĝ":"\u011C","Г":"\u0413","Ġ":"\u0120","𝔊":"\u{1D50A}","⋙":"\u22D9","𝔾":"\u{1D53E}","≥":"\u2265","⋛":"\u22DB","≧":"\u2267","⪢":"\u2AA2","≷":"\u2277","⩾":"\u2A7E","≳":"\u2273","𝒢":"\u{1D4A2}","≫":"\u226B","Ъ":"\u042A","ˇ":"\u02C7","^":"^","Ĥ":"\u0124","ℌ":"\u210C","ℋ":"\u210B","ℍ":"\u210D","─":"\u2500","ℋ":"\u210B","Ħ":"\u0126","≎":"\u224E","≏":"\u224F","Е":"\u0415","IJ":"\u0132","Ё":"\u0401","Í":"\xCD","Í":"\xCD","Î":"\xCE","Î":"\xCE","И":"\u0418","İ":"\u0130","ℑ":"\u2111","Ì":"\xCC","Ì":"\xCC","ℑ":"\u2111","Ī":"\u012A","ⅈ":"\u2148","⇒":"\u21D2","∬":"\u222C","∫":"\u222B","⋂":"\u22C2","⁣":"\u2063","⁢":"\u2062","Į":"\u012E","𝕀":"\u{1D540}","Ι":"\u0399","ℐ":"\u2110","Ĩ":"\u0128","І":"\u0406","Ï":"\xCF","Ï":"\xCF","Ĵ":"\u0134","Й":"\u0419","𝔍":"\u{1D50D}","𝕁":"\u{1D541}","𝒥":"\u{1D4A5}","Ј":"\u0408","Є":"\u0404","Х":"\u0425","Ќ":"\u040C","Κ":"\u039A","Ķ":"\u0136","К":"\u041A","𝔎":"\u{1D50E}","𝕂":"\u{1D542}","𝒦":"\u{1D4A6}","Љ":"\u0409","<":"<","<":"<","Ĺ":"\u0139","Λ":"\u039B","⟪":"\u27EA","ℒ":"\u2112","↞":"\u219E","Ľ":"\u013D","Ļ":"\u013B","Л":"\u041B","⟨":"\u27E8","←":"\u2190","⇤":"\u21E4","⇆":"\u21C6","⌈":"\u2308","⟦":"\u27E6","⥡":"\u2961","⇃":"\u21C3","⥙":"\u2959","⌊":"\u230A","↔":"\u2194","⥎":"\u294E","⊣":"\u22A3","↤":"\u21A4","⥚":"\u295A","⊲":"\u22B2","⧏":"\u29CF","⊴":"\u22B4","⥑":"\u2951","⥠":"\u2960","↿":"\u21BF","⥘":"\u2958","↼":"\u21BC","⥒":"\u2952","⇐":"\u21D0","⇔":"\u21D4","⋚":"\u22DA","≦":"\u2266","≶":"\u2276","⪡":"\u2AA1","⩽":"\u2A7D","≲":"\u2272","𝔏":"\u{1D50F}","⋘":"\u22D8","⇚":"\u21DA","Ŀ":"\u013F","⟵":"\u27F5","⟷":"\u27F7","⟶":"\u27F6","⟸":"\u27F8","⟺":"\u27FA","⟹":"\u27F9","𝕃":"\u{1D543}","↙":"\u2199","↘":"\u2198","ℒ":"\u2112","↰":"\u21B0","Ł":"\u0141","≪":"\u226A","⤅":"\u2905","М":"\u041C"," ":"\u205F","ℳ":"\u2133","𝔐":"\u{1D510}","∓":"\u2213","𝕄":"\u{1D544}","ℳ":"\u2133","Μ":"\u039C","Њ":"\u040A","Ń":"\u0143","Ň":"\u0147","Ņ":"\u0145","Н":"\u041D","​":"\u200B","​":"\u200B","​":"\u200B","​":"\u200B","≫":"\u226B","≪":"\u226A","
":`
|
|
162
|
+
`,"𝔑":"\u{1D511}","⁠":"\u2060"," ":"\xA0","ℕ":"\u2115","⫬":"\u2AEC","≢":"\u2262","≭":"\u226D","∦":"\u2226","∉":"\u2209","≠":"\u2260","≂̸":"\u2242\u0338","∄":"\u2204","≯":"\u226F","≱":"\u2271","≧̸":"\u2267\u0338","≫̸":"\u226B\u0338","≹":"\u2279","⩾̸":"\u2A7E\u0338","≵":"\u2275","≎̸":"\u224E\u0338","≏̸":"\u224F\u0338","⋪":"\u22EA","⧏̸":"\u29CF\u0338","⋬":"\u22EC","≮":"\u226E","≰":"\u2270","≸":"\u2278","≪̸":"\u226A\u0338","⩽̸":"\u2A7D\u0338","≴":"\u2274","⪢̸":"\u2AA2\u0338","⪡̸":"\u2AA1\u0338","⊀":"\u2280","⪯̸":"\u2AAF\u0338","⋠":"\u22E0","∌":"\u220C","⋫":"\u22EB","⧐̸":"\u29D0\u0338","⋭":"\u22ED","⊏̸":"\u228F\u0338","⋢":"\u22E2","⊐̸":"\u2290\u0338","⋣":"\u22E3","⊂⃒":"\u2282\u20D2","⊈":"\u2288","⊁":"\u2281","⪰̸":"\u2AB0\u0338","⋡":"\u22E1","≿̸":"\u227F\u0338","⊃⃒":"\u2283\u20D2","⊉":"\u2289","≁":"\u2241","≄":"\u2244","≇":"\u2247","≉":"\u2249","∤":"\u2224","𝒩":"\u{1D4A9}","Ñ":"\xD1","Ñ":"\xD1","Ν":"\u039D","Œ":"\u0152","Ó":"\xD3","Ó":"\xD3","Ô":"\xD4","Ô":"\xD4","О":"\u041E","Ő":"\u0150","𝔒":"\u{1D512}","Ò":"\xD2","Ò":"\xD2","Ō":"\u014C","Ω":"\u03A9","Ο":"\u039F","𝕆":"\u{1D546}","“":"\u201C","‘":"\u2018","⩔":"\u2A54","𝒪":"\u{1D4AA}","Ø":"\xD8","Ø":"\xD8","Õ":"\xD5","Õ":"\xD5","⨷":"\u2A37","Ö":"\xD6","Ö":"\xD6","‾":"\u203E","⏞":"\u23DE","⎴":"\u23B4","⏜":"\u23DC","∂":"\u2202","П":"\u041F","𝔓":"\u{1D513}","Φ":"\u03A6","Π":"\u03A0","±":"\xB1","ℌ":"\u210C","ℙ":"\u2119","⪻":"\u2ABB","≺":"\u227A","⪯":"\u2AAF","≼":"\u227C","≾":"\u227E","″":"\u2033","∏":"\u220F","∷":"\u2237","∝":"\u221D","𝒫":"\u{1D4AB}","Ψ":"\u03A8",""":'"',""":'"',"𝔔":"\u{1D514}","ℚ":"\u211A","𝒬":"\u{1D4AC}","⤐":"\u2910","®":"\xAE","®":"\xAE","Ŕ":"\u0154","⟫":"\u27EB","↠":"\u21A0","⤖":"\u2916","Ř":"\u0158","Ŗ":"\u0156","Р":"\u0420","ℜ":"\u211C","∋":"\u220B","⇋":"\u21CB","⥯":"\u296F","ℜ":"\u211C","Ρ":"\u03A1","⟩":"\u27E9","→":"\u2192","⇥":"\u21E5","⇄":"\u21C4","⌉":"\u2309","⟧":"\u27E7","⥝":"\u295D","⇂":"\u21C2","⥕":"\u2955","⌋":"\u230B","⊢":"\u22A2","↦":"\u21A6","⥛":"\u295B","⊳":"\u22B3","⧐":"\u29D0","⊵":"\u22B5","⥏":"\u294F","⥜":"\u295C","↾":"\u21BE","⥔":"\u2954","⇀":"\u21C0","⥓":"\u2953","⇒":"\u21D2","ℝ":"\u211D","⥰":"\u2970","⇛":"\u21DB","ℛ":"\u211B","↱":"\u21B1","⧴":"\u29F4","Щ":"\u0429","Ш":"\u0428","Ь":"\u042C","Ś":"\u015A","⪼":"\u2ABC","Š":"\u0160","Ş":"\u015E","Ŝ":"\u015C","С":"\u0421","𝔖":"\u{1D516}","↓":"\u2193","←":"\u2190","→":"\u2192","↑":"\u2191","Σ":"\u03A3","∘":"\u2218","𝕊":"\u{1D54A}","√":"\u221A","□":"\u25A1","⊓":"\u2293","⊏":"\u228F","⊑":"\u2291","⊐":"\u2290","⊒":"\u2292","⊔":"\u2294","𝒮":"\u{1D4AE}","⋆":"\u22C6","⋐":"\u22D0","⋐":"\u22D0","⊆":"\u2286","≻":"\u227B","⪰":"\u2AB0","≽":"\u227D","≿":"\u227F","∋":"\u220B","∑":"\u2211","⋑":"\u22D1","⊃":"\u2283","⊇":"\u2287","⋑":"\u22D1","Þ":"\xDE","Þ":"\xDE","™":"\u2122","Ћ":"\u040B","Ц":"\u0426","	":" ","Τ":"\u03A4","Ť":"\u0164","Ţ":"\u0162","Т":"\u0422","𝔗":"\u{1D517}","∴":"\u2234","Θ":"\u0398","  ":"\u205F\u200A"," ":"\u2009","∼":"\u223C","≃":"\u2243","≅":"\u2245","≈":"\u2248","𝕋":"\u{1D54B}","⃛":"\u20DB","𝒯":"\u{1D4AF}","Ŧ":"\u0166","Ú":"\xDA","Ú":"\xDA","↟":"\u219F","⥉":"\u2949","Ў":"\u040E","Ŭ":"\u016C","Û":"\xDB","Û":"\xDB","У":"\u0423","Ű":"\u0170","𝔘":"\u{1D518}","Ù":"\xD9","Ù":"\xD9","Ū":"\u016A","_":"_","⏟":"\u23DF","⎵":"\u23B5","⏝":"\u23DD","⋃":"\u22C3","⊎":"\u228E","Ų":"\u0172","𝕌":"\u{1D54C}","↑":"\u2191","⤒":"\u2912","⇅":"\u21C5","↕":"\u2195","⥮":"\u296E","⊥":"\u22A5","↥":"\u21A5","⇑":"\u21D1","⇕":"\u21D5","↖":"\u2196","↗":"\u2197","ϒ":"\u03D2","Υ":"\u03A5","Ů":"\u016E","𝒰":"\u{1D4B0}","Ũ":"\u0168","Ü":"\xDC","Ü":"\xDC","⊫":"\u22AB","⫫":"\u2AEB","В":"\u0412","⊩":"\u22A9","⫦":"\u2AE6","⋁":"\u22C1","‖":"\u2016","‖":"\u2016","∣":"\u2223","|":"|","❘":"\u2758","≀":"\u2240"," ":"\u200A","𝔙":"\u{1D519}","𝕍":"\u{1D54D}","𝒱":"\u{1D4B1}","⊪":"\u22AA","Ŵ":"\u0174","⋀":"\u22C0","𝔚":"\u{1D51A}","𝕎":"\u{1D54E}","𝒲":"\u{1D4B2}","𝔛":"\u{1D51B}","Ξ":"\u039E","𝕏":"\u{1D54F}","𝒳":"\u{1D4B3}","Я":"\u042F","Ї":"\u0407","Ю":"\u042E","Ý":"\xDD","Ý":"\xDD","Ŷ":"\u0176","Ы":"\u042B","𝔜":"\u{1D51C}","𝕐":"\u{1D550}","𝒴":"\u{1D4B4}","Ÿ":"\u0178","Ж":"\u0416","Ź":"\u0179","Ž":"\u017D","З":"\u0417","Ż":"\u017B","​":"\u200B","Ζ":"\u0396","ℨ":"\u2128","ℤ":"\u2124","𝒵":"\u{1D4B5}","á":"\xE1","á":"\xE1","ă":"\u0103","∾":"\u223E","∾̳":"\u223E\u0333","∿":"\u223F","â":"\xE2","â":"\xE2","´":"\xB4","´":"\xB4","а":"\u0430","æ":"\xE6","æ":"\xE6","⁡":"\u2061","𝔞":"\u{1D51E}","à":"\xE0","à":"\xE0","ℵ":"\u2135","ℵ":"\u2135","α":"\u03B1","ā":"\u0101","⨿":"\u2A3F","&":"&","&":"&","∧":"\u2227","⩕":"\u2A55","⩜":"\u2A5C","⩘":"\u2A58","⩚":"\u2A5A","∠":"\u2220","⦤":"\u29A4","∠":"\u2220","∡":"\u2221","⦨":"\u29A8","⦩":"\u29A9","⦪":"\u29AA","⦫":"\u29AB","⦬":"\u29AC","⦭":"\u29AD","⦮":"\u29AE","⦯":"\u29AF","∟":"\u221F","⊾":"\u22BE","⦝":"\u299D","∢":"\u2222","Å":"\xC5","⍼":"\u237C","ą":"\u0105","𝕒":"\u{1D552}","≈":"\u2248","⩰":"\u2A70","⩯":"\u2A6F","≊":"\u224A","≋":"\u224B","'":"'","≈":"\u2248","≊":"\u224A","å":"\xE5","å":"\xE5","𝒶":"\u{1D4B6}","*":"*","≈":"\u2248","≍":"\u224D","ã":"\xE3","ã":"\xE3","ä":"\xE4","ä":"\xE4","∳":"\u2233","⨑":"\u2A11","⫭":"\u2AED","≌":"\u224C","϶":"\u03F6","‵":"\u2035","∽":"\u223D","⋍":"\u22CD","⊽":"\u22BD","⌅":"\u2305","⌅":"\u2305","⎵":"\u23B5","⎶":"\u23B6","≌":"\u224C","б":"\u0431","„":"\u201E","∵":"\u2235","∵":"\u2235","⦰":"\u29B0","϶":"\u03F6","ℬ":"\u212C","β":"\u03B2","ℶ":"\u2136","≬":"\u226C","𝔟":"\u{1D51F}","⋂":"\u22C2","◯":"\u25EF","⋃":"\u22C3","⨀":"\u2A00","⨁":"\u2A01","⨂":"\u2A02","⨆":"\u2A06","★":"\u2605","▽":"\u25BD","△":"\u25B3","⨄":"\u2A04","⋁":"\u22C1","⋀":"\u22C0","⤍":"\u290D","⧫":"\u29EB","▪":"\u25AA","▴":"\u25B4","▾":"\u25BE","◂":"\u25C2","▸":"\u25B8","␣":"\u2423","▒":"\u2592","░":"\u2591","▓":"\u2593","█":"\u2588","=⃥":"=\u20E5","≡⃥":"\u2261\u20E5","⌐":"\u2310","𝕓":"\u{1D553}","⊥":"\u22A5","⊥":"\u22A5","⋈":"\u22C8","╗":"\u2557","╔":"\u2554","╖":"\u2556","╓":"\u2553","═":"\u2550","╦":"\u2566","╩":"\u2569","╤":"\u2564","╧":"\u2567","╝":"\u255D","╚":"\u255A","╜":"\u255C","╙":"\u2559","║":"\u2551","╬":"\u256C","╣":"\u2563","╠":"\u2560","╫":"\u256B","╢":"\u2562","╟":"\u255F","⧉":"\u29C9","╕":"\u2555","╒":"\u2552","┐":"\u2510","┌":"\u250C","─":"\u2500","╥":"\u2565","╨":"\u2568","┬":"\u252C","┴":"\u2534","⊟":"\u229F","⊞":"\u229E","⊠":"\u22A0","╛":"\u255B","╘":"\u2558","┘":"\u2518","└":"\u2514","│":"\u2502","╪":"\u256A","╡":"\u2561","╞":"\u255E","┼":"\u253C","┤":"\u2524","├":"\u251C","‵":"\u2035","˘":"\u02D8","¦":"\xA6","¦":"\xA6","𝒷":"\u{1D4B7}","⁏":"\u204F","∽":"\u223D","⋍":"\u22CD","\":"\\","⧅":"\u29C5","⟈":"\u27C8","•":"\u2022","•":"\u2022","≎":"\u224E","⪮":"\u2AAE","≏":"\u224F","≏":"\u224F","ć":"\u0107","∩":"\u2229","⩄":"\u2A44","⩉":"\u2A49","⩋":"\u2A4B","⩇":"\u2A47","⩀":"\u2A40","∩︀":"\u2229\uFE00","⁁":"\u2041","ˇ":"\u02C7","⩍":"\u2A4D","č":"\u010D","ç":"\xE7","ç":"\xE7","ĉ":"\u0109","⩌":"\u2A4C","⩐":"\u2A50","ċ":"\u010B","¸":"\xB8","¸":"\xB8","⦲":"\u29B2","¢":"\xA2","¢":"\xA2","·":"\xB7","𝔠":"\u{1D520}","ч":"\u0447","✓":"\u2713","✓":"\u2713","χ":"\u03C7","○":"\u25CB","⧃":"\u29C3","ˆ":"\u02C6","≗":"\u2257","↺":"\u21BA","↻":"\u21BB","®":"\xAE","Ⓢ":"\u24C8","⊛":"\u229B","⊚":"\u229A","⊝":"\u229D","≗":"\u2257","⨐":"\u2A10","⫯":"\u2AEF","⧂":"\u29C2","♣":"\u2663","♣":"\u2663",":":":","≔":"\u2254","≔":"\u2254",",":",","@":"@","∁":"\u2201","∘":"\u2218","∁":"\u2201","ℂ":"\u2102","≅":"\u2245","⩭":"\u2A6D","∮":"\u222E","𝕔":"\u{1D554}","∐":"\u2210","©":"\xA9","©":"\xA9","℗":"\u2117","↵":"\u21B5","✗":"\u2717","𝒸":"\u{1D4B8}","⫏":"\u2ACF","⫑":"\u2AD1","⫐":"\u2AD0","⫒":"\u2AD2","⋯":"\u22EF","⤸":"\u2938","⤵":"\u2935","⋞":"\u22DE","⋟":"\u22DF","↶":"\u21B6","⤽":"\u293D","∪":"\u222A","⩈":"\u2A48","⩆":"\u2A46","⩊":"\u2A4A","⊍":"\u228D","⩅":"\u2A45","∪︀":"\u222A\uFE00","↷":"\u21B7","⤼":"\u293C","⋞":"\u22DE","⋟":"\u22DF","⋎":"\u22CE","⋏":"\u22CF","¤":"\xA4","¤":"\xA4","↶":"\u21B6","↷":"\u21B7","⋎":"\u22CE","⋏":"\u22CF","∲":"\u2232","∱":"\u2231","⌭":"\u232D","⇓":"\u21D3","⥥":"\u2965","†":"\u2020","ℸ":"\u2138","↓":"\u2193","‐":"\u2010","⊣":"\u22A3","⤏":"\u290F","˝":"\u02DD","ď":"\u010F","д":"\u0434","ⅆ":"\u2146","‡":"\u2021","⇊":"\u21CA","⩷":"\u2A77","°":"\xB0","°":"\xB0","δ":"\u03B4","⦱":"\u29B1","⥿":"\u297F","𝔡":"\u{1D521}","⇃":"\u21C3","⇂":"\u21C2","⋄":"\u22C4","⋄":"\u22C4","♦":"\u2666","♦":"\u2666","¨":"\xA8","ϝ":"\u03DD","⋲":"\u22F2","÷":"\xF7","÷":"\xF7","÷":"\xF7","⋇":"\u22C7","⋇":"\u22C7","ђ":"\u0452","⌞":"\u231E","⌍":"\u230D","$":"$","𝕕":"\u{1D555}","˙":"\u02D9","≐":"\u2250","≑":"\u2251","∸":"\u2238","∔":"\u2214","⊡":"\u22A1","⌆":"\u2306","↓":"\u2193","⇊":"\u21CA","⇃":"\u21C3","⇂":"\u21C2","⤐":"\u2910","⌟":"\u231F","⌌":"\u230C","𝒹":"\u{1D4B9}","ѕ":"\u0455","⧶":"\u29F6","đ":"\u0111","⋱":"\u22F1","▿":"\u25BF","▾":"\u25BE","⇵":"\u21F5","⥯":"\u296F","⦦":"\u29A6","џ":"\u045F","⟿":"\u27FF","⩷":"\u2A77","≑":"\u2251","é":"\xE9","é":"\xE9","⩮":"\u2A6E","ě":"\u011B","≖":"\u2256","ê":"\xEA","ê":"\xEA","≕":"\u2255","э":"\u044D","ė":"\u0117","ⅇ":"\u2147","≒":"\u2252","𝔢":"\u{1D522}","⪚":"\u2A9A","è":"\xE8","è":"\xE8","⪖":"\u2A96","⪘":"\u2A98","⪙":"\u2A99","⏧":"\u23E7","ℓ":"\u2113","⪕":"\u2A95","⪗":"\u2A97","ē":"\u0113","∅":"\u2205","∅":"\u2205","∅":"\u2205"," ":"\u2004"," ":"\u2005"," ":"\u2003","ŋ":"\u014B"," ":"\u2002","ę":"\u0119","𝕖":"\u{1D556}","⋕":"\u22D5","⧣":"\u29E3","⩱":"\u2A71","ε":"\u03B5","ε":"\u03B5","ϵ":"\u03F5","≖":"\u2256","≕":"\u2255","≂":"\u2242","⪖":"\u2A96","⪕":"\u2A95","=":"=","≟":"\u225F","≡":"\u2261","⩸":"\u2A78","⧥":"\u29E5","≓":"\u2253","⥱":"\u2971","ℯ":"\u212F","≐":"\u2250","≂":"\u2242","η":"\u03B7","ð":"\xF0","ð":"\xF0","ë":"\xEB","ë":"\xEB","€":"\u20AC","!":"!","∃":"\u2203","ℰ":"\u2130","ⅇ":"\u2147","≒":"\u2252","ф":"\u0444","♀":"\u2640","ffi":"\uFB03","ff":"\uFB00","ffl":"\uFB04","𝔣":"\u{1D523}","fi":"\uFB01","fj":"fj","♭":"\u266D","fl":"\uFB02","▱":"\u25B1","ƒ":"\u0192","𝕗":"\u{1D557}","∀":"\u2200","⋔":"\u22D4","⫙":"\u2AD9","⨍":"\u2A0D","½":"\xBD","½":"\xBD","⅓":"\u2153","¼":"\xBC","¼":"\xBC","⅕":"\u2155","⅙":"\u2159","⅛":"\u215B","⅔":"\u2154","⅖":"\u2156","¾":"\xBE","¾":"\xBE","⅗":"\u2157","⅜":"\u215C","⅘":"\u2158","⅚":"\u215A","⅝":"\u215D","⅞":"\u215E","⁄":"\u2044","⌢":"\u2322","𝒻":"\u{1D4BB}","≧":"\u2267","⪌":"\u2A8C","ǵ":"\u01F5","γ":"\u03B3","ϝ":"\u03DD","⪆":"\u2A86","ğ":"\u011F","ĝ":"\u011D","г":"\u0433","ġ":"\u0121","≥":"\u2265","⋛":"\u22DB","≥":"\u2265","≧":"\u2267","⩾":"\u2A7E","⩾":"\u2A7E","⪩":"\u2AA9","⪀":"\u2A80","⪂":"\u2A82","⪄":"\u2A84","⋛︀":"\u22DB\uFE00","⪔":"\u2A94","𝔤":"\u{1D524}","≫":"\u226B","⋙":"\u22D9","ℷ":"\u2137","ѓ":"\u0453","≷":"\u2277","⪒":"\u2A92","⪥":"\u2AA5","⪤":"\u2AA4","≩":"\u2269","⪊":"\u2A8A","⪊":"\u2A8A","⪈":"\u2A88","⪈":"\u2A88","≩":"\u2269","⋧":"\u22E7","𝕘":"\u{1D558}","`":"`","ℊ":"\u210A","≳":"\u2273","⪎":"\u2A8E","⪐":"\u2A90",">":">",">":">","⪧":"\u2AA7","⩺":"\u2A7A","⋗":"\u22D7","⦕":"\u2995","⩼":"\u2A7C","⪆":"\u2A86","⥸":"\u2978","⋗":"\u22D7","⋛":"\u22DB","⪌":"\u2A8C","≷":"\u2277","≳":"\u2273","≩︀":"\u2269\uFE00","≩︀":"\u2269\uFE00","⇔":"\u21D4"," ":"\u200A","½":"\xBD","ℋ":"\u210B","ъ":"\u044A","↔":"\u2194","⥈":"\u2948","↭":"\u21AD","ℏ":"\u210F","ĥ":"\u0125","♥":"\u2665","♥":"\u2665","…":"\u2026","⊹":"\u22B9","𝔥":"\u{1D525}","⤥":"\u2925","⤦":"\u2926","⇿":"\u21FF","∻":"\u223B","↩":"\u21A9","↪":"\u21AA","𝕙":"\u{1D559}","―":"\u2015","𝒽":"\u{1D4BD}","ℏ":"\u210F","ħ":"\u0127","⁃":"\u2043","‐":"\u2010","í":"\xED","í":"\xED","⁣":"\u2063","î":"\xEE","î":"\xEE","и":"\u0438","е":"\u0435","¡":"\xA1","¡":"\xA1","⇔":"\u21D4","𝔦":"\u{1D526}","ì":"\xEC","ì":"\xEC","ⅈ":"\u2148","⨌":"\u2A0C","∭":"\u222D","⧜":"\u29DC","℩":"\u2129","ij":"\u0133","ī":"\u012B","ℑ":"\u2111","ℐ":"\u2110","ℑ":"\u2111","ı":"\u0131","⊷":"\u22B7","Ƶ":"\u01B5","∈":"\u2208","℅":"\u2105","∞":"\u221E","⧝":"\u29DD","ı":"\u0131","∫":"\u222B","⊺":"\u22BA","ℤ":"\u2124","⊺":"\u22BA","⨗":"\u2A17","⨼":"\u2A3C","ё":"\u0451","į":"\u012F","𝕚":"\u{1D55A}","ι":"\u03B9","⨼":"\u2A3C","¿":"\xBF","¿":"\xBF","𝒾":"\u{1D4BE}","∈":"\u2208","⋹":"\u22F9","⋵":"\u22F5","⋴":"\u22F4","⋳":"\u22F3","∈":"\u2208","⁢":"\u2062","ĩ":"\u0129","і":"\u0456","ï":"\xEF","ï":"\xEF","ĵ":"\u0135","й":"\u0439","𝔧":"\u{1D527}","ȷ":"\u0237","𝕛":"\u{1D55B}","𝒿":"\u{1D4BF}","ј":"\u0458","є":"\u0454","κ":"\u03BA","ϰ":"\u03F0","ķ":"\u0137","к":"\u043A","𝔨":"\u{1D528}","ĸ":"\u0138","х":"\u0445","ќ":"\u045C","𝕜":"\u{1D55C}","𝓀":"\u{1D4C0}","⇚":"\u21DA","⇐":"\u21D0","⤛":"\u291B","⤎":"\u290E","≦":"\u2266","⪋":"\u2A8B","⥢":"\u2962","ĺ":"\u013A","⦴":"\u29B4","ℒ":"\u2112","λ":"\u03BB","⟨":"\u27E8","⦑":"\u2991","⟨":"\u27E8","⪅":"\u2A85","«":"\xAB","«":"\xAB","←":"\u2190","⇤":"\u21E4","⤟":"\u291F","⤝":"\u291D","↩":"\u21A9","↫":"\u21AB","⤹":"\u2939","⥳":"\u2973","↢":"\u21A2","⪫":"\u2AAB","⤙":"\u2919","⪭":"\u2AAD","⪭︀":"\u2AAD\uFE00","⤌":"\u290C","❲":"\u2772","{":"{","[":"[","⦋":"\u298B","⦏":"\u298F","⦍":"\u298D","ľ":"\u013E","ļ":"\u013C","⌈":"\u2308","{":"{","л":"\u043B","⤶":"\u2936","“":"\u201C","„":"\u201E","⥧":"\u2967","⥋":"\u294B","↲":"\u21B2","≤":"\u2264","←":"\u2190","↢":"\u21A2","↽":"\u21BD","↼":"\u21BC","⇇":"\u21C7","↔":"\u2194","⇆":"\u21C6","⇋":"\u21CB","↭":"\u21AD","⋋":"\u22CB","⋚":"\u22DA","≤":"\u2264","≦":"\u2266","⩽":"\u2A7D","⩽":"\u2A7D","⪨":"\u2AA8","⩿":"\u2A7F","⪁":"\u2A81","⪃":"\u2A83","⋚︀":"\u22DA\uFE00","⪓":"\u2A93","⪅":"\u2A85","⋖":"\u22D6","⋚":"\u22DA","⪋":"\u2A8B","≶":"\u2276","≲":"\u2272","⥼":"\u297C","⌊":"\u230A","𝔩":"\u{1D529}","≶":"\u2276","⪑":"\u2A91","↽":"\u21BD","↼":"\u21BC","⥪":"\u296A","▄":"\u2584","љ":"\u0459","≪":"\u226A","⇇":"\u21C7","⌞":"\u231E","⥫":"\u296B","◺":"\u25FA","ŀ":"\u0140","⎰":"\u23B0","⎰":"\u23B0","≨":"\u2268","⪉":"\u2A89","⪉":"\u2A89","⪇":"\u2A87","⪇":"\u2A87","≨":"\u2268","⋦":"\u22E6","⟬":"\u27EC","⇽":"\u21FD","⟦":"\u27E6","⟵":"\u27F5","⟷":"\u27F7","⟼":"\u27FC","⟶":"\u27F6","↫":"\u21AB","↬":"\u21AC","⦅":"\u2985","𝕝":"\u{1D55D}","⨭":"\u2A2D","⨴":"\u2A34","∗":"\u2217","_":"_","◊":"\u25CA","◊":"\u25CA","⧫":"\u29EB","(":"(","⦓":"\u2993","⇆":"\u21C6","⌟":"\u231F","⇋":"\u21CB","⥭":"\u296D","‎":"\u200E","⊿":"\u22BF","‹":"\u2039","𝓁":"\u{1D4C1}","↰":"\u21B0","≲":"\u2272","⪍":"\u2A8D","⪏":"\u2A8F","[":"[","‘":"\u2018","‚":"\u201A","ł":"\u0142","<":"<","<":"<","⪦":"\u2AA6","⩹":"\u2A79","⋖":"\u22D6","⋋":"\u22CB","⋉":"\u22C9","⥶":"\u2976","⩻":"\u2A7B","⦖":"\u2996","◃":"\u25C3","⊴":"\u22B4","◂":"\u25C2","⥊":"\u294A","⥦":"\u2966","≨︀":"\u2268\uFE00","≨︀":"\u2268\uFE00","∺":"\u223A","¯":"\xAF","¯":"\xAF","♂":"\u2642","✠":"\u2720","✠":"\u2720","↦":"\u21A6","↦":"\u21A6","↧":"\u21A7","↤":"\u21A4","↥":"\u21A5","▮":"\u25AE","⨩":"\u2A29","м":"\u043C","—":"\u2014","∡":"\u2221","𝔪":"\u{1D52A}","℧":"\u2127","µ":"\xB5","µ":"\xB5","∣":"\u2223","*":"*","⫰":"\u2AF0","·":"\xB7","·":"\xB7","−":"\u2212","⊟":"\u229F","∸":"\u2238","⨪":"\u2A2A","⫛":"\u2ADB","…":"\u2026","∓":"\u2213","⊧":"\u22A7","𝕞":"\u{1D55E}","∓":"\u2213","𝓂":"\u{1D4C2}","∾":"\u223E","μ":"\u03BC","⊸":"\u22B8","⊸":"\u22B8","⋙̸":"\u22D9\u0338","≫⃒":"\u226B\u20D2","≫̸":"\u226B\u0338","⇍":"\u21CD","⇎":"\u21CE","⋘̸":"\u22D8\u0338","≪⃒":"\u226A\u20D2","≪̸":"\u226A\u0338","⇏":"\u21CF","⊯":"\u22AF","⊮":"\u22AE","∇":"\u2207","ń":"\u0144","∠⃒":"\u2220\u20D2","≉":"\u2249","⩰̸":"\u2A70\u0338","≋̸":"\u224B\u0338","ʼn":"\u0149","≉":"\u2249","♮":"\u266E","♮":"\u266E","ℕ":"\u2115"," ":"\xA0"," ":"\xA0","≎̸":"\u224E\u0338","≏̸":"\u224F\u0338","⩃":"\u2A43","ň":"\u0148","ņ":"\u0146","≇":"\u2247","⩭̸":"\u2A6D\u0338","⩂":"\u2A42","н":"\u043D","–":"\u2013","≠":"\u2260","⇗":"\u21D7","⤤":"\u2924","↗":"\u2197","↗":"\u2197","≐̸":"\u2250\u0338","≢":"\u2262","⤨":"\u2928","≂̸":"\u2242\u0338","∄":"\u2204","∄":"\u2204","𝔫":"\u{1D52B}","≧̸":"\u2267\u0338","≱":"\u2271","≱":"\u2271","≧̸":"\u2267\u0338","⩾̸":"\u2A7E\u0338","⩾̸":"\u2A7E\u0338","≵":"\u2275","≯":"\u226F","≯":"\u226F","⇎":"\u21CE","↮":"\u21AE","⫲":"\u2AF2","∋":"\u220B","⋼":"\u22FC","⋺":"\u22FA","∋":"\u220B","њ":"\u045A","⇍":"\u21CD","≦̸":"\u2266\u0338","↚":"\u219A","‥":"\u2025","≰":"\u2270","↚":"\u219A","↮":"\u21AE","≰":"\u2270","≦̸":"\u2266\u0338","⩽̸":"\u2A7D\u0338","⩽̸":"\u2A7D\u0338","≮":"\u226E","≴":"\u2274","≮":"\u226E","⋪":"\u22EA","⋬":"\u22EC","∤":"\u2224","𝕟":"\u{1D55F}","¬":"\xAC","¬":"\xAC","∉":"\u2209","⋹̸":"\u22F9\u0338","⋵̸":"\u22F5\u0338","∉":"\u2209","⋷":"\u22F7","⋶":"\u22F6","∌":"\u220C","∌":"\u220C","⋾":"\u22FE","⋽":"\u22FD","∦":"\u2226","∦":"\u2226","⫽⃥":"\u2AFD\u20E5","∂̸":"\u2202\u0338","⨔":"\u2A14","⊀":"\u2280","⋠":"\u22E0","⪯̸":"\u2AAF\u0338","⊀":"\u2280","⪯̸":"\u2AAF\u0338","⇏":"\u21CF","↛":"\u219B","⤳̸":"\u2933\u0338","↝̸":"\u219D\u0338","↛":"\u219B","⋫":"\u22EB","⋭":"\u22ED","⊁":"\u2281","⋡":"\u22E1","⪰̸":"\u2AB0\u0338","𝓃":"\u{1D4C3}","∤":"\u2224","∦":"\u2226","≁":"\u2241","≄":"\u2244","≄":"\u2244","∤":"\u2224","∦":"\u2226","⋢":"\u22E2","⋣":"\u22E3","⊄":"\u2284","⫅̸":"\u2AC5\u0338","⊈":"\u2288","⊂⃒":"\u2282\u20D2","⊈":"\u2288","⫅̸":"\u2AC5\u0338","⊁":"\u2281","⪰̸":"\u2AB0\u0338","⊅":"\u2285","⫆̸":"\u2AC6\u0338","⊉":"\u2289","⊃⃒":"\u2283\u20D2","⊉":"\u2289","⫆̸":"\u2AC6\u0338","≹":"\u2279","ñ":"\xF1","ñ":"\xF1","≸":"\u2278","⋪":"\u22EA","⋬":"\u22EC","⋫":"\u22EB","⋭":"\u22ED","ν":"\u03BD","#":"#","№":"\u2116"," ":"\u2007","⊭":"\u22AD","⤄":"\u2904","≍⃒":"\u224D\u20D2","⊬":"\u22AC","≥⃒":"\u2265\u20D2",">⃒":">\u20D2","⧞":"\u29DE","⤂":"\u2902","≤⃒":"\u2264\u20D2","<⃒":"<\u20D2","⊴⃒":"\u22B4\u20D2","⤃":"\u2903","⊵⃒":"\u22B5\u20D2","∼⃒":"\u223C\u20D2","⇖":"\u21D6","⤣":"\u2923","↖":"\u2196","↖":"\u2196","⤧":"\u2927","Ⓢ":"\u24C8","ó":"\xF3","ó":"\xF3","⊛":"\u229B","⊚":"\u229A","ô":"\xF4","ô":"\xF4","о":"\u043E","⊝":"\u229D","ő":"\u0151","⨸":"\u2A38","⊙":"\u2299","⦼":"\u29BC","œ":"\u0153","⦿":"\u29BF","𝔬":"\u{1D52C}","˛":"\u02DB","ò":"\xF2","ò":"\xF2","⧁":"\u29C1","⦵":"\u29B5","Ω":"\u03A9","∮":"\u222E","↺":"\u21BA","⦾":"\u29BE","⦻":"\u29BB","‾":"\u203E","⧀":"\u29C0","ō":"\u014D","ω":"\u03C9","ο":"\u03BF","⦶":"\u29B6","⊖":"\u2296","𝕠":"\u{1D560}","⦷":"\u29B7","⦹":"\u29B9","⊕":"\u2295","∨":"\u2228","↻":"\u21BB","⩝":"\u2A5D","ℴ":"\u2134","ℴ":"\u2134","ª":"\xAA","ª":"\xAA","º":"\xBA","º":"\xBA","⊶":"\u22B6","⩖":"\u2A56","⩗":"\u2A57","⩛":"\u2A5B","ℴ":"\u2134","ø":"\xF8","ø":"\xF8","⊘":"\u2298","õ":"\xF5","õ":"\xF5","⊗":"\u2297","⨶":"\u2A36","ö":"\xF6","ö":"\xF6","⌽":"\u233D","∥":"\u2225","¶":"\xB6","¶":"\xB6","∥":"\u2225","⫳":"\u2AF3","⫽":"\u2AFD","∂":"\u2202","п":"\u043F","%":"%",".":".","‰":"\u2030","⊥":"\u22A5","‱":"\u2031","𝔭":"\u{1D52D}","φ":"\u03C6","ϕ":"\u03D5","ℳ":"\u2133","☎":"\u260E","π":"\u03C0","⋔":"\u22D4","ϖ":"\u03D6","ℏ":"\u210F","ℎ":"\u210E","ℏ":"\u210F","+":"+","⨣":"\u2A23","⊞":"\u229E","⨢":"\u2A22","∔":"\u2214","⨥":"\u2A25","⩲":"\u2A72","±":"\xB1","±":"\xB1","⨦":"\u2A26","⨧":"\u2A27","±":"\xB1","⨕":"\u2A15","𝕡":"\u{1D561}","£":"\xA3","£":"\xA3","≺":"\u227A","⪳":"\u2AB3","⪷":"\u2AB7","≼":"\u227C","⪯":"\u2AAF","≺":"\u227A","⪷":"\u2AB7","≼":"\u227C","⪯":"\u2AAF","⪹":"\u2AB9","⪵":"\u2AB5","⋨":"\u22E8","≾":"\u227E","′":"\u2032","ℙ":"\u2119","⪵":"\u2AB5","⪹":"\u2AB9","⋨":"\u22E8","∏":"\u220F","⌮":"\u232E","⌒":"\u2312","⌓":"\u2313","∝":"\u221D","∝":"\u221D","≾":"\u227E","⊰":"\u22B0","𝓅":"\u{1D4C5}","ψ":"\u03C8"," ":"\u2008","𝔮":"\u{1D52E}","⨌":"\u2A0C","𝕢":"\u{1D562}","⁗":"\u2057","𝓆":"\u{1D4C6}","ℍ":"\u210D","⨖":"\u2A16","?":"?","≟":"\u225F",""":'"',""":'"',"⇛":"\u21DB","⇒":"\u21D2","⤜":"\u291C","⤏":"\u290F","⥤":"\u2964","∽̱":"\u223D\u0331","ŕ":"\u0155","√":"\u221A","⦳":"\u29B3","⟩":"\u27E9","⦒":"\u2992","⦥":"\u29A5","⟩":"\u27E9","»":"\xBB","»":"\xBB","→":"\u2192","⥵":"\u2975","⇥":"\u21E5","⤠":"\u2920","⤳":"\u2933","⤞":"\u291E","↪":"\u21AA","↬":"\u21AC","⥅":"\u2945","⥴":"\u2974","↣":"\u21A3","↝":"\u219D","⤚":"\u291A","∶":"\u2236","ℚ":"\u211A","⤍":"\u290D","❳":"\u2773","}":"}","]":"]","⦌":"\u298C","⦎":"\u298E","⦐":"\u2990","ř":"\u0159","ŗ":"\u0157","⌉":"\u2309","}":"}","р":"\u0440","⤷":"\u2937","⥩":"\u2969","”":"\u201D","”":"\u201D","↳":"\u21B3","ℜ":"\u211C","ℛ":"\u211B","ℜ":"\u211C","ℝ":"\u211D","▭":"\u25AD","®":"\xAE","®":"\xAE","⥽":"\u297D","⌋":"\u230B","𝔯":"\u{1D52F}","⇁":"\u21C1","⇀":"\u21C0","⥬":"\u296C","ρ":"\u03C1","ϱ":"\u03F1","→":"\u2192","↣":"\u21A3","⇁":"\u21C1","⇀":"\u21C0","⇄":"\u21C4","⇌":"\u21CC","⇉":"\u21C9","↝":"\u219D","⋌":"\u22CC","˚":"\u02DA","≓":"\u2253","⇄":"\u21C4","⇌":"\u21CC","‏":"\u200F","⎱":"\u23B1","⎱":"\u23B1","⫮":"\u2AEE","⟭":"\u27ED","⇾":"\u21FE","⟧":"\u27E7","⦆":"\u2986","𝕣":"\u{1D563}","⨮":"\u2A2E","⨵":"\u2A35",")":")","⦔":"\u2994","⨒":"\u2A12","⇉":"\u21C9","›":"\u203A","𝓇":"\u{1D4C7}","↱":"\u21B1","]":"]","’":"\u2019","’":"\u2019","⋌":"\u22CC","⋊":"\u22CA","▹":"\u25B9","⊵":"\u22B5","▸":"\u25B8","⧎":"\u29CE","⥨":"\u2968","℞":"\u211E","ś":"\u015B","‚":"\u201A","≻":"\u227B","⪴":"\u2AB4","⪸":"\u2AB8","š":"\u0161","≽":"\u227D","⪰":"\u2AB0","ş":"\u015F","ŝ":"\u015D","⪶":"\u2AB6","⪺":"\u2ABA","⋩":"\u22E9","⨓":"\u2A13","≿":"\u227F","с":"\u0441","⋅":"\u22C5","⊡":"\u22A1","⩦":"\u2A66","⇘":"\u21D8","⤥":"\u2925","↘":"\u2198","↘":"\u2198","§":"\xA7","§":"\xA7",";":";","⤩":"\u2929","∖":"\u2216","∖":"\u2216","✶":"\u2736","𝔰":"\u{1D530}","⌢":"\u2322","♯":"\u266F","щ":"\u0449","ш":"\u0448","∣":"\u2223","∥":"\u2225","­":"\xAD","­":"\xAD","σ":"\u03C3","ς":"\u03C2","ς":"\u03C2","∼":"\u223C","⩪":"\u2A6A","≃":"\u2243","≃":"\u2243","⪞":"\u2A9E","⪠":"\u2AA0","⪝":"\u2A9D","⪟":"\u2A9F","≆":"\u2246","⨤":"\u2A24","⥲":"\u2972","←":"\u2190","∖":"\u2216","⨳":"\u2A33","⧤":"\u29E4","∣":"\u2223","⌣":"\u2323","⪪":"\u2AAA","⪬":"\u2AAC","⪬︀":"\u2AAC\uFE00","ь":"\u044C","/":"/","⧄":"\u29C4","⌿":"\u233F","𝕤":"\u{1D564}","♠":"\u2660","♠":"\u2660","∥":"\u2225","⊓":"\u2293","⊓︀":"\u2293\uFE00","⊔":"\u2294","⊔︀":"\u2294\uFE00","⊏":"\u228F","⊑":"\u2291","⊏":"\u228F","⊑":"\u2291","⊐":"\u2290","⊒":"\u2292","⊐":"\u2290","⊒":"\u2292","□":"\u25A1","□":"\u25A1","▪":"\u25AA","▪":"\u25AA","→":"\u2192","𝓈":"\u{1D4C8}","∖":"\u2216","⌣":"\u2323","⋆":"\u22C6","☆":"\u2606","★":"\u2605","ϵ":"\u03F5","ϕ":"\u03D5","¯":"\xAF","⊂":"\u2282","⫅":"\u2AC5","⪽":"\u2ABD","⊆":"\u2286","⫃":"\u2AC3","⫁":"\u2AC1","⫋":"\u2ACB","⊊":"\u228A","⪿":"\u2ABF","⥹":"\u2979","⊂":"\u2282","⊆":"\u2286","⫅":"\u2AC5","⊊":"\u228A","⫋":"\u2ACB","⫇":"\u2AC7","⫕":"\u2AD5","⫓":"\u2AD3","≻":"\u227B","⪸":"\u2AB8","≽":"\u227D","⪰":"\u2AB0","⪺":"\u2ABA","⪶":"\u2AB6","⋩":"\u22E9","≿":"\u227F","∑":"\u2211","♪":"\u266A","¹":"\xB9","¹":"\xB9","²":"\xB2","²":"\xB2","³":"\xB3","³":"\xB3","⊃":"\u2283","⫆":"\u2AC6","⪾":"\u2ABE","⫘":"\u2AD8","⊇":"\u2287","⫄":"\u2AC4","⟉":"\u27C9","⫗":"\u2AD7","⥻":"\u297B","⫂":"\u2AC2","⫌":"\u2ACC","⊋":"\u228B","⫀":"\u2AC0","⊃":"\u2283","⊇":"\u2287","⫆":"\u2AC6","⊋":"\u228B","⫌":"\u2ACC","⫈":"\u2AC8","⫔":"\u2AD4","⫖":"\u2AD6","⇙":"\u21D9","⤦":"\u2926","↙":"\u2199","↙":"\u2199","⤪":"\u292A","ß":"\xDF","ß":"\xDF","⌖":"\u2316","τ":"\u03C4","⎴":"\u23B4","ť":"\u0165","ţ":"\u0163","т":"\u0442","⃛":"\u20DB","⌕":"\u2315","𝔱":"\u{1D531}","∴":"\u2234","∴":"\u2234","θ":"\u03B8","ϑ":"\u03D1","ϑ":"\u03D1","≈":"\u2248","∼":"\u223C"," ":"\u2009","≈":"\u2248","∼":"\u223C","þ":"\xFE","þ":"\xFE","˜":"\u02DC","×":"\xD7","×":"\xD7","⊠":"\u22A0","⨱":"\u2A31","⨰":"\u2A30","∭":"\u222D","⤨":"\u2928","⊤":"\u22A4","⌶":"\u2336","⫱":"\u2AF1","𝕥":"\u{1D565}","⫚":"\u2ADA","⤩":"\u2929","‴":"\u2034","™":"\u2122","▵":"\u25B5","▿":"\u25BF","◃":"\u25C3","⊴":"\u22B4","≜":"\u225C","▹":"\u25B9","⊵":"\u22B5","◬":"\u25EC","≜":"\u225C","⨺":"\u2A3A","⨹":"\u2A39","⧍":"\u29CD","⨻":"\u2A3B","⏢":"\u23E2","𝓉":"\u{1D4C9}","ц":"\u0446","ћ":"\u045B","ŧ":"\u0167","≬":"\u226C","↞":"\u219E","↠":"\u21A0","⇑":"\u21D1","⥣":"\u2963","ú":"\xFA","ú":"\xFA","↑":"\u2191","ў":"\u045E","ŭ":"\u016D","û":"\xFB","û":"\xFB","у":"\u0443","⇅":"\u21C5","ű":"\u0171","⥮":"\u296E","⥾":"\u297E","𝔲":"\u{1D532}","ù":"\xF9","ù":"\xF9","↿":"\u21BF","↾":"\u21BE","▀":"\u2580","⌜":"\u231C","⌜":"\u231C","⌏":"\u230F","◸":"\u25F8","ū":"\u016B","¨":"\xA8","¨":"\xA8","ų":"\u0173","𝕦":"\u{1D566}","↑":"\u2191","↕":"\u2195","↿":"\u21BF","↾":"\u21BE","⊎":"\u228E","υ":"\u03C5","ϒ":"\u03D2","υ":"\u03C5","⇈":"\u21C8","⌝":"\u231D","⌝":"\u231D","⌎":"\u230E","ů":"\u016F","◹":"\u25F9","𝓊":"\u{1D4CA}","⋰":"\u22F0","ũ":"\u0169","▵":"\u25B5","▴":"\u25B4","⇈":"\u21C8","ü":"\xFC","ü":"\xFC","⦧":"\u29A7","⇕":"\u21D5","⫨":"\u2AE8","⫩":"\u2AE9","⊨":"\u22A8","⦜":"\u299C","ϵ":"\u03F5","ϰ":"\u03F0","∅":"\u2205","ϕ":"\u03D5","ϖ":"\u03D6","∝":"\u221D","↕":"\u2195","ϱ":"\u03F1","ς":"\u03C2","⊊︀":"\u228A\uFE00","⫋︀":"\u2ACB\uFE00","⊋︀":"\u228B\uFE00","⫌︀":"\u2ACC\uFE00","ϑ":"\u03D1","⊲":"\u22B2","⊳":"\u22B3","в":"\u0432","⊢":"\u22A2","∨":"\u2228","⊻":"\u22BB","≚":"\u225A","⋮":"\u22EE","|":"|","|":"|","𝔳":"\u{1D533}","⊲":"\u22B2","⊂⃒":"\u2282\u20D2","⊃⃒":"\u2283\u20D2","𝕧":"\u{1D567}","∝":"\u221D","⊳":"\u22B3","𝓋":"\u{1D4CB}","⫋︀":"\u2ACB\uFE00","⊊︀":"\u228A\uFE00","⫌︀":"\u2ACC\uFE00","⊋︀":"\u228B\uFE00","⦚":"\u299A","ŵ":"\u0175","⩟":"\u2A5F","∧":"\u2227","≙":"\u2259","℘":"\u2118","𝔴":"\u{1D534}","𝕨":"\u{1D568}","℘":"\u2118","≀":"\u2240","≀":"\u2240","𝓌":"\u{1D4CC}","⋂":"\u22C2","◯":"\u25EF","⋃":"\u22C3","▽":"\u25BD","𝔵":"\u{1D535}","⟺":"\u27FA","⟷":"\u27F7","ξ":"\u03BE","⟸":"\u27F8","⟵":"\u27F5","⟼":"\u27FC","⋻":"\u22FB","⨀":"\u2A00","𝕩":"\u{1D569}","⨁":"\u2A01","⨂":"\u2A02","⟹":"\u27F9","⟶":"\u27F6","𝓍":"\u{1D4CD}","⨆":"\u2A06","⨄":"\u2A04","△":"\u25B3","⋁":"\u22C1","⋀":"\u22C0","ý":"\xFD","ý":"\xFD","я":"\u044F","ŷ":"\u0177","ы":"\u044B","¥":"\xA5","¥":"\xA5","𝔶":"\u{1D536}","ї":"\u0457","𝕪":"\u{1D56A}","𝓎":"\u{1D4CE}","ю":"\u044E","ÿ":"\xFF","ÿ":"\xFF","ź":"\u017A","ž":"\u017E","з":"\u0437","ż":"\u017C","ℨ":"\u2128","ζ":"\u03B6","𝔷":"\u{1D537}","ж":"\u0436","⇝":"\u21DD","𝕫":"\u{1D56B}","𝓏":"\u{1D4CF}","‍":"\u200D","‌":"\u200C"},Bn=sd;function ad(t){return t.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(e,r)=>{if(typeof Bn[e]=="string")return Bn[e];if(r.charAt(0)!=="#"||e.charAt(e.length-1)!==";")return e;let n;r.charAt(1)==="x"?n=parseInt(r.substr(2),16):n=parseInt(r.substr(1),10);let i="";return n>=55296&&n<=57343||n>1114111?"\uFFFD":(n>65535&&(n-=65536,i+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),i+=String.fromCharCode(n),i)})}function bt(t){return t.trim().replace(/[<>"'?&]/g,e=>{let r=e.charCodeAt(0).toString(16);return r.length<2&&(r="0"+r),"&#x"+r.toUpperCase()+";"})}function xo(t){return"<div>"+bt(t).replace(/\n/g,"<br />")+"</div>"}function Ao(t){return t=t.replace(/\r?\n/g,"").replace(/<\!\-\-.*?\-\->/gi," ").replace(/<br\b[^>]*>/gi,`
|
|
164
163
|
`).replace(/<\/?(p|div|table|tr|td|th)\b[^>]*>/gi,`
|
|
165
164
|
|
|
166
165
|
`).replace(/<script\b[^>]*>.*?<\/script\b[^>]*>/gi," ").replace(/^.*<body\b[^>]*>/i,"").replace(/^.*<\/head\b[^>]*>/i,"").replace(/^.*<\!doctype\b[^>]*>/i,"").replace(/<\/body\b[^>]*>.*$/i,"").replace(/<\/html\b[^>]*>.*$/i,"").replace(/<a\b[^>]*href\s*=\s*["']?([^\s"']+)[^>]*>/gi," ($1) ").replace(/<\/?(span|em|i|strong|b|u|a)\b[^>]*>/gi,"").replace(/<li\b[^>]*>[\n\u0001\s]*/gi,"* ").replace(/<hr\b[^>]*>/g,`
|
|
@@ -170,59 +169,59 @@ ${a}
|
|
|
170
169
|
|
|
171
170
|
`).replace(/^\n+/,`
|
|
172
171
|
`).replace(/\n+$/,`
|
|
173
|
-
`),
|
|
174
|
-
`)}return o}function
|
|
175
|
-
${
|
|
176
|
-
${
|
|
172
|
+
`),t=ad(t),t}function ko(t){return[].concat(t.name||[]).concat(t.name?`<${t.address}>`:t.address).join(" ")}function Nn(t){let e=[],r=(n,i)=>{if(i&&e.push(", "),n.group){let o=`${n.name}:`,s=";";e.push(o),n.group.forEach(r),e.push(s)}else e.push(ko(n))};return t.forEach(r),e.join("")}function $o(t){return`<a href="mailto:${bt(t.address)}" class="postal-email-address">${bt(t.name||`<${t.address}>`)}</a>`}function Hn(t){let e=[],r=(n,i)=>{if(i&&e.push('<span class="postal-email-address-separator">, </span>'),n.group){let o=`<span class="postal-email-address-group">${bt(n.name)}:</span>`,s='<span class="postal-email-address-group">;</span>';e.push(o),n.group.forEach(r),e.push(s)}else e.push($o(n))};return t.forEach(r),e.join(" ")}function ld(t,e,r){t=(t||"").toString(),e=e||76;let n=0,i=t.length,o="",s,a;for(;n<i;){if(s=t.substr(n,e),s.length<e){o+=s;break}if(a=s.match(/^[^\n\r]*(\r?\n|\r)/)){s=a[0],o+=s,n+=s.length;continue}else(a=s.match(/(\s+)[^\s]*$/))&&a[0].length-(r?(a[1]||"").length:0)<s.length?s=s.substr(0,s.length-(a[0].length-(r?(a[1]||"").length:0))):(a=t.substr(n+s.length).match(/^[^\s]+(\s*)/))&&(s=s+a[0].substr(0,a[0].length-(r?0:(a[1]||"").length)));o+=s,n+=s.length,n<i&&(o+=`\r
|
|
173
|
+
`)}return o}function Ln(t){let e=[];if(t.from&&e.push({key:"From",val:ko(t.from)}),t.subject&&e.push({key:"Subject",val:t.subject}),t.date){let s={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},a=typeof Intl>"u"?t.date:new Intl.DateTimeFormat("default",s).format(new Date(t.date));e.push({key:"Date",val:a})}t.to&&t.to.length&&e.push({key:"To",val:Nn(t.to)}),t.cc&&t.cc.length&&e.push({key:"Cc",val:Nn(t.cc)}),t.bcc&&t.bcc.length&&e.push({key:"Bcc",val:Nn(t.bcc)});let r=e.map(s=>s.key.length).reduce((s,a)=>a>s?a:s,0);e=e.flatMap(s=>{let a=r-s.key.length,l=`${s.key}: ${" ".repeat(a)}`,d=`${" ".repeat(s.key.length+1)} ${" ".repeat(a)}`;return ld(s.val,80,!0).split(/\r?\n/).map(u=>u.trim()).map((u,m)=>`${m?d:l}${u}`)});let n=e.map(s=>s.length).reduce((s,a)=>a>s?a:s,0),i="-".repeat(n);return`
|
|
174
|
+
${i}
|
|
175
|
+
${e.join(`
|
|
177
176
|
`)}
|
|
178
|
-
${
|
|
179
|
-
`}function
|
|
180
|
-
<div class="postal-email-header-row">`)}${
|
|
181
|
-
`,",",";"].includes(r)&&(this.node.noBreak=!0),this.list.push(this.node),this.node=null,this.operatorExpecting="",this.escaped=!1;return}else if(!this.operatorExpecting&&
|
|
182
|
-
`&&(
|
|
177
|
+
${i}
|
|
178
|
+
`}function Gn(t){let e=[];if(t.from&&e.push(`<div class="postal-email-header-key">From</div><div class="postal-email-header-value">${$o(t.from)}</div>`),t.subject&&e.push(`<div class="postal-email-header-key">Subject</div><div class="postal-email-header-value postal-email-header-subject">${bt(t.subject)}</div>`),t.date){let n={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},i=typeof Intl>"u"?t.date:new Intl.DateTimeFormat("default",n).format(new Date(t.date));e.push(`<div class="postal-email-header-key">Date</div><div class="postal-email-header-value postal-email-header-date" data-date="${bt(t.date)}">${bt(i)}</div>`)}return t.to&&t.to.length&&e.push(`<div class="postal-email-header-key">To</div><div class="postal-email-header-value">${Hn(t.to)}</div>`),t.cc&&t.cc.length&&e.push(`<div class="postal-email-header-key">Cc</div><div class="postal-email-header-value">${Hn(t.cc)}</div>`),t.bcc&&t.bcc.length&&e.push(`<div class="postal-email-header-key">Bcc</div><div class="postal-email-header-value">${Hn(t.bcc)}</div>`),`<div class="postal-email-header">${e.length?'<div class="postal-email-header-row">':""}${e.join(`</div>
|
|
179
|
+
<div class="postal-email-header-row">`)}${e.length?"</div>":""}</div>`}function cd(t,e){let r=!1,n="text",i,o=[],s={address:[],comment:[],group:[],text:[],textWasQuoted:[]},a,l,d=!1;for(a=0,l=t.length;a<l;a++){let c=t[a],u=a?t[a-1]:null;if(c.type==="operator")switch(c.value){case"<":n="address",d=!1;break;case"(":n="comment",d=!1;break;case":":n="group",r=!0,d=!1;break;case'"':d=!d,n="text";break;default:n="text",d=!1;break}else c.value&&(n==="address"&&(c.value=c.value.replace(/^[^<]*<\s*/,"")),u&&u.noBreak&&s[n].length?(s[n][s[n].length-1]+=c.value,n==="text"&&d&&(s.textWasQuoted[s.textWasQuoted.length-1]=!0)):(s[n].push(c.value),n==="text"&&s.textWasQuoted.push(d)))}if(!s.text.length&&s.comment.length&&(s.text=s.comment,s.comment=[]),r){s.text=s.text.join(" ");let c=[];s.group.length&&qn(s.group.join(","),{_depth:e+1}).forEach(m=>{m.group?c=c.concat(m.group):c.push(m)}),o.push({name:gt(s.text||i&&i.name),group:c})}else{if(!s.address.length&&s.text.length){for(a=s.text.length-1;a>=0;a--)if(!s.textWasQuoted[a]&&s.text[a].match(/^[^@\s]+@[^@\s]+$/)){s.address=s.text.splice(a,1),s.textWasQuoted.splice(a,1);break}let c=function(u){return s.address.length?u:(s.address=[u.trim()]," ")};if(!s.address.length)for(a=s.text.length-1;a>=0&&!(!s.textWasQuoted[a]&&(s.text[a]=s.text[a].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,c).trim(),s.address.length));a--);}if(!s.text.length&&s.comment.length&&(s.text=s.comment,s.comment=[]),s.address.length>1&&(s.text=s.text.concat(s.address.splice(1))),s.text=s.text.join(" "),s.address=s.address.join(" "),!s.address&&/^=\?[^=]+?=$/.test(s.text.trim())){let c=gt(s.text);if(/<[^<>]+@[^<>]+>/.test(c)){let u=qn(c);if(u&&u.length)return u}return[{address:"",name:c}]}i={address:s.address||s.text||"",name:gt(s.text||s.address||"")},i.address===i.name&&((i.address||"").match(/@/)?i.name="":i.address=""),o.push(i)}return o}var Mn=class{constructor(e){this.str=(e||"").toString(),this.operatorCurrent="",this.operatorExpecting="",this.node=null,this.escaped=!1,this.list=[],this.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""}}tokenize(){let e=[];for(let r=0,n=this.str.length;r<n;r++){let i=this.str.charAt(r),o=r<n-1?this.str.charAt(r+1):null;this.checkChar(i,o)}return this.list.forEach(r=>{r.value=(r.value||"").toString().trim(),r.value&&e.push(r)}),e}checkChar(e,r){if(!this.escaped){if(e===this.operatorExpecting){this.node={type:"operator",value:e},r&&![" "," ","\r",`
|
|
180
|
+
`,",",";"].includes(r)&&(this.node.noBreak=!0),this.list.push(this.node),this.node=null,this.operatorExpecting="",this.escaped=!1;return}else if(!this.operatorExpecting&&e in this.operators){this.node={type:"operator",value:e},this.list.push(this.node),this.node=null,this.operatorExpecting=this.operators[e],this.escaped=!1;return}else if(this.operatorExpecting==='"'&&e==="\\"){this.escaped=!0;return}}this.node||(this.node={type:"text",value:""},this.list.push(this.node)),e===`
|
|
181
|
+
`&&(e=" "),(e.charCodeAt(0)>=33||[" "," "].includes(e))&&(this.node.value+=e),this.escaped=!1}},ud=50;function qn(t,e){e=e||{};let r=e._depth||0;if(r>ud)return[];let i=new Mn(t).tokenize(),o=[],s=[],a=[];if(i.forEach(l=>{l.type==="operator"&&(l.value===","||l.value===";")?(s.length&&o.push(s),s=[]):s.push(l)}),s.length&&o.push(s),o.forEach(l=>{l=cd(l,r),l.length&&(a=a.concat(l))}),e.flatten){let l=[],d=c=>{c.forEach(u=>{if(u.group)return d(u.group);l.push(u)})};return d(a),l}return a}var Dr=qn;function Eo(t){for(var e="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(t),i=n.byteLength,o=i%3,s=i-o,a,l,d,c,u,m=0;m<s;m=m+3)u=n[m]<<16|n[m+1]<<8|n[m+2],a=(u&16515072)>>18,l=(u&258048)>>12,d=(u&4032)>>6,c=u&63,e+=r[a]+r[l]+r[d]+r[c];return o==1?(u=n[s],a=(u&252)>>2,l=(u&3)<<4,e+=r[a]+r[l]+"=="):o==2&&(u=n[s]<<8|n[s+1],a=(u&64512)>>10,l=(u&1008)>>4,d=(u&15)<<2,e+=r[a]+r[l]+r[d]+"="),e}var dd=256,md=2*1024*1024;function Un(t){return t.replace(/-(.)/g,(e,r)=>r.toUpperCase())}var rr=class t{static parse(e,r){return new t(r).parse(e)}constructor(e){this.options=e||{},this.mimeOptions={maxNestingDepth:this.options.maxNestingDepth||dd,maxHeadersSize:this.options.maxHeadersSize||md},this.root=this.currentNode=new $t({postalMime:this,...this.mimeOptions}),this.boundaries=[],this.textContent={},this.attachments=[],this.attachmentEncoding=(this.options.attachmentEncoding||"").toString().replace(/[-_\s]/g,"").trim().toLowerCase()||"arraybuffer",this.started=!1}async finalize(){await this.root.finalize()}async processLine(e,r){let n=this.boundaries;if(n.length&&e.length>2&&e[0]===45&&e[1]===45)for(let i=n.length-1;i>=0;i--){let o=n[i];if(e.length<o.value.length+2)continue;let s=!0;for(let c=0;c<o.value.length;c++)if(e[c+2]!==o.value[c]){s=!1;break}if(!s)continue;let a=o.value.length+2,l=!1;e.length>=o.value.length+4&&e[o.value.length+2]===45&&e[o.value.length+3]===45&&(l=!0,a=o.value.length+4);let d=!0;for(let c=a;c<e.length;c++)if(e[c]!==32&&e[c]!==9){d=!1;break}if(d)return l?(await o.node.finalize(),this.currentNode=o.node.parentNode||this.root):(await o.node.finalizeChildNodes(),this.currentNode=new $t({postalMime:this,parentNode:o.node,parentMultipartType:o.node.contentType.multipart,...this.mimeOptions})),r?this.finalize():void 0}if(this.currentNode.feed(e),r)return this.finalize()}readLine(){let e=this.readPos,r=this.readPos;for(;this.readPos<this.av.length;){let n=this.av[this.readPos++];if(n!==13&&n!==10&&(r=this.readPos),n===10)return{bytes:new Uint8Array(this.buf,e,r-e),done:this.readPos>=this.av.length}}return{bytes:new Uint8Array(this.buf,e,r-e),done:this.readPos>=this.av.length}}async processNodeTree(){let e={},r=new Set,n=this.textMap=new Map,i=this.forceRfc822Attachments(),o=async(s,a,l)=>{if(a=a||!1,l=l||!1,s.contentType.multipart)s.contentType.multipart==="alternative"?a=s:s.contentType.multipart==="related"&&(l=s);else if(this.isInlineMessageRfc822(s)&&!i){let d=new t;s.subMessage=await d.parse(s.content),n.has(s)||n.set(s,{});let c=n.get(s);(s.subMessage.text||!s.subMessage.html)&&(c.plain=c.plain||[],c.plain.push({type:"subMessage",value:s.subMessage}),r.add("plain")),s.subMessage.html&&(c.html=c.html||[],c.html.push({type:"subMessage",value:s.subMessage}),r.add("html")),d.textMap&&d.textMap.forEach((u,m)=>{n.set(m,u)});for(let u of s.subMessage.attachments||[])this.attachments.push(u)}else if(this.isInlineTextNode(s)){let d=s.contentType.parsed.value.substr(s.contentType.parsed.value.indexOf("/")+1),c=a||s;n.has(c)||n.set(c,{});let u=n.get(c);u[d]=u[d]||[],u[d].push({type:"text",value:s.getTextContent()}),r.add(d)}else if(s.content){let d=s.contentDisposition?.parsed?.params?.filename||s.contentType.parsed.params.name||null,c={filename:d?gt(d):null,mimeType:s.contentType.parsed.value,disposition:s.contentDisposition?.parsed?.value||null};switch(l&&s.contentId&&(c.related=!0),s.contentDescription&&(c.description=s.contentDescription),s.contentId&&(c.contentId=s.contentId),s.contentType.parsed.value){case"text/calendar":case"application/ics":{s.contentType.parsed.params.method&&(c.method=s.contentType.parsed.params.method.toString().toUpperCase().trim());let u=s.getTextContent().replace(/\r?\n/g,`
|
|
183
182
|
`).replace(/\n*$/,`
|
|
184
|
-
`);
|
|
185
|
-
`)}),this.textContent=t}isInlineTextNode(t){if(t.contentDisposition?.parsed?.value==="attachment")return!1;switch(t.contentType.parsed?.value){case"text/html":case"text/plain":return!0;default:return!1}}isInlineMessageRfc822(t){return t.contentType.parsed?.value!=="message/rfc822"?!1:(t.contentDisposition?.parsed?.value||(this.options.rfc822Attachments?"attachment":"inline"))==="inline"}forceRfc822Attachments(){if(this.options.forceRfc822Attachments)return!0;let t=!1,r=i=>{i.contentType.multipart||i.contentType.parsed&&["message/delivery-status","message/feedback-report"].includes(i.contentType.parsed.value)&&(t=!0);for(let n of i.childNodes)r(n)};return r(this.root),t}async resolveStream(t){let r=0,i=[],n=t.getReader();for(;;){let{done:a,value:u}=await n.read();if(a)break;i.push(u),r+=u.length}let o=new Uint8Array(r),s=0;for(let a of i)o.set(a,s),s+=a.length;return o}async parse(t){if(this.started)throw new Error("Can not reuse parser, create a new PostalMime object");for(this.started=!0,t&&typeof t.getReader=="function"&&(t=await this.resolveStream(t)),t=t||new ArrayBuffer(0),typeof t=="string"&&(t=St.encode(t)),(t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]")&&(t=await wt(t)),t.buffer instanceof ArrayBuffer&&(t=new Uint8Array(t).buffer),this.buf=t,this.av=new Uint8Array(t),this.readPos=0;this.readPos<this.av.length;){let n=this.readLine();await this.processLine(n.bytes,n.done)}await this.processNodeTree();let r={headers:this.root.headers.map(n=>({key:n.key,originalKey:n.originalKey,value:n.value})).reverse()};for(let n of["from","sender"]){let o=this.root.headers.find(s=>s.key===n);if(o&&o.value){let s=Oi(o.value);s&&s.length&&(r[n]=s[0])}}for(let n of["delivered-to","return-path"]){let o=this.root.headers.find(s=>s.key===n);if(o&&o.value){let s=Oi(o.value);if(s&&s.length&&s[0].address){let a=Du(n);r[a]=s[0].address}}}for(let n of["to","cc","bcc","reply-to"]){let o=this.root.headers.filter(a=>a.key===n),s=[];if(o.filter(a=>a&&a.value).map(a=>Oi(a.value)).forEach(a=>s=s.concat(a||[])),s&&s.length){let a=Du(n);r[a]=s}}for(let n of["subject","message-id","in-reply-to","references"]){let o=this.root.headers.find(s=>s.key===n);if(o&&o.value){let s=Du(n);r[s]=zt(o.value)}}let i=this.root.headers.find(n=>n.key==="date");if(i){let n=new Date(i.value);n.toString()==="Invalid Date"?n=i.value:n=n.toISOString(),r.date=n}switch(this.textContent?.html&&(r.html=this.textContent.html),this.textContent?.plain&&(r.text=this.textContent.plain),r.attachments=this.attachments,r.headerLines=(this.root.rawHeaderLines||[]).slice().reverse(),this.attachmentEncoding){case"arraybuffer":break;case"base64":for(let o of r.attachments||[])o?.content&&(o.content=Ed(o.content),o.encoding="base64");break;case"utf8":let n=new TextDecoder("utf8");for(let o of r.attachments||[])o?.content&&(o.content=n.decode(o.content),o.encoding="utf8");break;default:throw new Error("Unknown attachment encoding")}return r}};var kb=we(vb(),1),FS="6.12.3";function ye(e){let t=new URLSearchParams;return e.limit!==void 0&&t.set("limit",e.limit.toString()),"after"in e&&e.after!==void 0&&t.set("after",e.after),"before"in e&&e.before!==void 0&&t.set("before",e.before),t.toString()}var HS=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/api-keys",e,t)}async list(e={}){let t=ye(e),r=t?`/api-keys?${t}`:"/api-keys";return await this.resend.get(r)}async remove(e){return await this.resend.delete(`/api-keys/${e}`)}},BS=class{constructor(e){this.resend=e}async get(e){return await this.resend.get(`/automations/${e.automationId}/runs/${e.runId}`)}async list(e){let t=ye(e),r=new URLSearchParams(t);if(e.status){let o=Array.isArray(e.status)?e.status.join(","):e.status;r.set("status",o)}let i=r.toString(),n=i?`/automations/${e.automationId}/runs?${i}`:`/automations/${e.automationId}/runs`;return await this.resend.get(n)}};function Ab(e){switch(e.type){case"trigger":return{key:e.key,type:e.type,config:{event_name:e.config.eventName}};case"delay":return{key:e.key,type:e.type,config:e.config};case"send_email":return{key:e.key,type:e.type,config:{template:e.config.template,subject:e.config.subject,from:e.config.from,reply_to:e.config.replyTo}};case"wait_for_event":return{key:e.key,type:e.type,config:{event_name:e.config.eventName,timeout:e.config.timeout,filter_rule:e.config.filterRule}};case"condition":return{key:e.key,type:e.type,config:e.config};case"contact_update":return{key:e.key,type:e.type,config:{first_name:e.config.firstName,last_name:e.config.lastName,unsubscribed:e.config.unsubscribed,properties:e.config.properties}};case"contact_delete":return{key:e.key,type:e.type,config:e.config};case"add_to_segment":return{key:e.key,type:e.type,config:{segment_id:e.config.segmentId}}}}function Eb(e){return{from:e.from,to:e.to,type:e.type}}function LS(e){return{name:e.name,status:e.status,steps:e.steps.map(Ab),connections:e.connections.map(Eb)}}function NS(e){return{event:e.event,contact_id:e.contactId,email:e.email,payload:e.payload}}var GS=class{constructor(e){this.resend=e,this.runs=new BS(this.resend)}async create(e){return await this.resend.post("/automations",LS(e))}async list(e={}){let t=[ye(e)];e.status&&t.push(`status=${encodeURIComponent(e.status)}`);let r=t.filter(Boolean).join("&"),i=r?`/automations?${r}`:"/automations";return await this.resend.get(i)}async get(e){return await this.resend.get(`/automations/${e}`)}async remove(e){return await this.resend.delete(`/automations/${e}`)}async update(e,t){let r={};return t.name!==void 0&&(r.name=t.name),t.status!==void 0&&(r.status=t.status),t.steps!==void 0&&(r.steps=t.steps.map(Ab)),t.connections!==void 0&&(r.connections=t.connections.map(Eb)),await this.resend.patch(`/automations/${e}`,r)}async stop(e){return await this.resend.post(`/automations/${e}/stop`)}};function US(e){return e?.map(t=>({content:t.content,filename:t.filename,path:t.path,content_type:t.contentType,content_id:t.contentId}))}function Pb(e){return{attachments:US(e.attachments),bcc:e.bcc,cc:e.cc,from:e.from,headers:e.headers,html:e.html,reply_to:e.replyTo,scheduled_at:e.scheduledAt,subject:e.subject,tags:e.tags,text:e.text,to:e.to,template:e.template?{id:e.template.id,variables:e.template.variables}:void 0,topic_id:e.topicId}}async function Oa(e){let t;try{({render:t}=await import("@react-email/render"))}catch{throw new Error("Failed to render React component. Make sure to install `@react-email/render` or `@react-email/components`.")}return t(e)}var WS=class{constructor(e){this.resend=e}async send(e,t){return this.create(e,t)}async create(e,t){let r=[];for(let i of e)i.react&&(i.html=await Oa(i.react),i.react=void 0),r.push(Pb(i));return await this.resend.post("/emails/batch",r,{...t,headers:{"x-batch-validation":t?.batchValidation??"strict",...t?.headers}})}},VS=class{constructor(e){this.resend=e}async create(e,t={}){return e.react&&(e.html=await Oa(e.react)),await this.resend.post("/broadcasts",{name:e.name,segment_id:e.segmentId,audience_id:e.audienceId,preview_text:e.previewText,from:e.from,html:e.html,reply_to:e.replyTo,subject:e.subject,text:e.text,topic_id:e.topicId,send:e.send,scheduled_at:e.scheduledAt},t)}async send(e,t){return await this.resend.post(`/broadcasts/${e}/send`,{scheduled_at:t?.scheduledAt})}async list(e={}){let t=ye(e),r=t?`/broadcasts?${t}`:"/broadcasts";return await this.resend.get(r)}async get(e){return await this.resend.get(`/broadcasts/${e}`)}async remove(e){return await this.resend.delete(`/broadcasts/${e}`)}async update(e,t){return t.react&&(t.html=await Oa(t.react)),await this.resend.patch(`/broadcasts/${e}`,{name:t.name,segment_id:t.segmentId,audience_id:t.audienceId,from:t.from,html:t.html,text:t.text,subject:t.subject,reply_to:t.replyTo,preview_text:t.previewText,topic_id:t.topicId})}};function yb(e){return{id:e.id,key:e.key,createdAt:e.created_at,type:e.type,fallbackValue:e.fallback_value}}function Cb(e){return"key"in e?{key:e.key,type:e.type,fallback_value:e.fallbackValue}:{fallback_value:e.fallbackValue}}var KS=class{constructor(e){this.resend=e}async create(e){let t=Cb(e);return await this.resend.post("/contact-properties",t)}async list(e={}){let t=ye(e),r=t?`/contact-properties?${t}`:"/contact-properties",i=await this.resend.get(r);return i.data?{data:{...i.data,data:i.data.data.map(n=>yb(n))},headers:i.headers,error:null}:i}async get(e){if(!e)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};let t=await this.resend.get(`/contact-properties/${e}`);return t.data?{data:{object:"contact_property",...yb(t.data)},headers:t.headers,error:null}:t}async update(e){if(!e.id)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};let t=Cb(e);return await this.resend.patch(`/contact-properties/${e.id}`,t)}async remove(e){return e?await this.resend.delete(`/contact-properties/${e}`):{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}}}},YS=class{constructor(e){this.resend=e}async list(e){if(!e.contactId&&!e.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let t=e.email?e.email:e.contactId,r=ye(e),i=r?`/contacts/${t}/segments?${r}`:`/contacts/${t}/segments`;return await this.resend.get(i)}async add(e){if(!e.contactId&&!e.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let t=e.email?e.email:e.contactId;return this.resend.post(`/contacts/${t}/segments/${e.segmentId}`)}async remove(e){if(!e.contactId&&!e.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let t=e.email?e.email:e.contactId;return this.resend.delete(`/contacts/${t}/segments/${e.segmentId}`)}},QS=class{constructor(e){this.resend=e}async update(e){if(!e.id&&!e.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let t=e.email?e.email:e.id;return this.resend.patch(`/contacts/${t}/topics`,e.topics)}async list(e){if(!e.id&&!e.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let t=e.email?e.email:e.id,r=ye(e),i=r?`/contacts/${t}/topics?${r}`:`/contacts/${t}/topics`;return this.resend.get(i)}},ZS=class{constructor(e){this.resend=e,this.topics=new QS(this.resend),this.segments=new YS(this.resend)}async create(e,t={}){return"audienceId"in e?"segments"in e||"topics"in e?{data:null,headers:null,error:{message:"`audienceId` is deprecated, and cannot be used together with `segments` or `topics`. Use `segments` instead to add one or more segments to the new contact.",statusCode:null,name:"invalid_parameter"}}:await this.resend.post(`/audiences/${e.audienceId}/contacts`,{unsubscribed:e.unsubscribed,email:e.email,first_name:e.firstName,last_name:e.lastName,properties:e.properties},t):await this.resend.post("/contacts",{unsubscribed:e.unsubscribed,email:e.email,first_name:e.firstName,last_name:e.lastName,properties:e.properties,segments:e.segments,topics:e.topics},t)}async list(e={}){let t=e.segmentId??e.audienceId;if(!t){let n=ye(e),o=n?`/contacts?${n}`:"/contacts";return await this.resend.get(o)}let r=ye(e),i=r?`/segments/${t}/contacts?${r}`:`/segments/${t}/contacts`;return await this.resend.get(i)}async get(e){return typeof e=="string"?this.resend.get(`/contacts/${e}`):!e.id&&!e.email?{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}}:e.audienceId?this.resend.get(`/audiences/${e.audienceId}/contacts/${e?.email?e?.email:e?.id}`):this.resend.get(`/contacts/${e?.email?e?.email:e?.id}`)}async update(e){return!e.id&&!e.email?{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}}:e.audienceId?await this.resend.patch(`/audiences/${e.audienceId}/contacts/${e?.email?e?.email:e?.id}`,{unsubscribed:e.unsubscribed,first_name:e.firstName,last_name:e.lastName,properties:e.properties}):await this.resend.patch(`/contacts/${e?.email?e?.email:e?.id}`,{unsubscribed:e.unsubscribed,first_name:e.firstName,last_name:e.lastName,properties:e.properties})}async remove(e){return typeof e=="string"?this.resend.delete(`/contacts/${e}`):!e.id&&!e.email?{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}}:e.audienceId?this.resend.delete(`/audiences/${e.audienceId}/contacts/${e?.email?e?.email:e?.id}`):this.resend.delete(`/contacts/${e?.email?e?.email:e?.id}`)}};function XS(e){return{name:e.name,region:e.region,custom_return_path:e.customReturnPath,capabilities:e.capabilities,open_tracking:e.openTracking,click_tracking:e.clickTracking,tls:e.tls,tracking_subdomain:e.trackingSubdomain}}var ew=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/domains",XS(e),t)}async list(e={}){let t=ye(e),r=t?`/domains?${t}`:"/domains";return await this.resend.get(r)}async get(e){return await this.resend.get(`/domains/${e}`)}async update(e){return await this.resend.patch(`/domains/${e.id}`,{click_tracking:e.clickTracking,open_tracking:e.openTracking,tls:e.tls,capabilities:e.capabilities,tracking_subdomain:e.trackingSubdomain})}async remove(e){return await this.resend.delete(`/domains/${e}`)}async verify(e){return await this.resend.post(`/domains/${e}/verify`)}},tw=class{constructor(e){this.resend=e}async get(e){let{emailId:t,id:r}=e;return await this.resend.get(`/emails/${t}/attachments/${r}`)}async list(e){let{emailId:t}=e,r=ye(e),i=r?`/emails/${t}/attachments?${r}`:`/emails/${t}/attachments`;return await this.resend.get(i)}},rw=class{constructor(e){this.resend=e}async get(e){let{emailId:t,id:r}=e;return await this.resend.get(`/emails/receiving/${t}/attachments/${r}`)}async list(e){let{emailId:t}=e,r=ye(e),i=r?`/emails/receiving/${t}/attachments?${r}`:`/emails/receiving/${t}/attachments`;return await this.resend.get(i)}},iw=class{constructor(e){this.resend=e,this.attachments=new rw(e)}async get(e){return await this.resend.get(`/emails/receiving/${e}`)}async list(e={}){let t=ye(e),r=t?`/emails/receiving?${t}`:"/emails/receiving";return await this.resend.get(r)}async forward(e){let{emailId:t,to:r,from:i}=e,n=e.passthrough!==!1,o=await this.get(t);if(o.error)return{data:null,error:o.error,headers:o.headers};let s=o.data,a=s.subject||"(no subject)";if(n)return this.forwardPassthrough(s,{to:r,from:i,subject:a});let u=a.startsWith("Fwd:")?a:`Fwd: ${a}`;return this.forwardWrapped(s,{to:r,from:i,subject:u,text:"text"in e?e.text:void 0,html:"html"in e?e.html:void 0})}async forwardPassthrough(e,t){let{to:r,from:i,subject:n}=t;if(!e.raw?.download_url)return{data:null,error:{name:"validation_error",message:"Raw email content is not available for this email",statusCode:400},headers:null};let o=await fetch(e.raw.download_url);if(!o.ok)return{data:null,error:{name:"application_error",message:"Failed to download raw email content",statusCode:o.status},headers:null};let s=await o.text(),a=await Wr.parse(s,{attachmentEncoding:"base64"}),u=a.attachments.map(d=>{let l=d.contentId?d.contentId.replace(/^<|>$/g,""):void 0;return{filename:d.filename,content:d.content.toString(),content_type:d.mimeType,content_id:l||void 0}});return await this.resend.post("/emails",{from:i,to:r,subject:n,text:a.text||void 0,html:a.html||void 0,attachments:u.length>0?u:void 0})}async forwardWrapped(e,t){let{to:r,from:i,subject:n,text:o,html:s}=t;if(!e.raw?.download_url)return{data:null,error:{name:"validation_error",message:"Raw email content is not available for this email",statusCode:400},headers:null};let a=await fetch(e.raw.download_url);if(!a.ok)return{data:null,error:{name:"application_error",message:"Failed to download raw email content",statusCode:a.status},headers:null};let u=await a.text();return await this.resend.post("/emails",{from:i,to:r,subject:n,text:o,html:s,attachments:[{filename:"forwarded_message.eml",content:Buffer.from(u).toString("base64"),content_type:"message/rfc822"}]})}},nw=class{constructor(e){this.resend=e,this.attachments=new tw(e),this.receiving=new iw(e)}async send(e,t={}){return this.create(e,t)}async create(e,t={}){return e.react&&(e.html=await Oa(e.react)),await this.resend.post("/emails",Pb(e),t)}async get(e){return await this.resend.get(`/emails/${e}`)}async list(e={}){let t=ye(e),r=t?`/emails?${t}`:"/emails";return await this.resend.get(r)}async update(e){return await this.resend.patch(`/emails/${e.id}`,{scheduled_at:e.scheduledAt})}async cancel(e){return await this.resend.post(`/emails/${e}/cancel`)}},ow=class{constructor(e){this.resend=e}async send(e){return await this.resend.post("/events/send",NS(e))}async create(e){return await this.resend.post("/events",e)}async get(e){return await this.resend.get(`/events/${encodeURIComponent(e)}`)}async list(e={}){let t=ye(e),r=t?`/events?${t}`:"/events";return await this.resend.get(r)}async update(e,t){return await this.resend.patch(`/events/${encodeURIComponent(e)}`,t)}async remove(e){return await this.resend.delete(`/events/${encodeURIComponent(e)}`)}},sw=class{constructor(e){this.resend=e}async list(e={}){let t=ye(e),r=t?`/logs?${t}`:"/logs";return await this.resend.get(r)}async get(e){return await this.resend.get(`/logs/${e}`)}},aw=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/segments",e,t)}async list(e={}){let t=ye(e),r=t?`/segments?${t}`:"/segments";return await this.resend.get(r)}async get(e){return await this.resend.get(`/segments/${e}`)}async remove(e){return await this.resend.delete(`/segments/${e}`)}};function uw(e={}){let t=new URLSearchParams;return e.before&&t.set("before",e.before),e.after&&t.set("after",e.after),e.limit&&t.set("limit",e.limit.toString()),t.size>0?`?${t.toString()}`:""}function lw(e){return e?.map(t=>({key:t.key,type:t.type,fallback_value:t.fallbackValue}))}function Ob(e){return{name:"name"in e?e.name:void 0,subject:e.subject,html:e.html,text:e.text,alias:e.alias,from:e.from,reply_to:e.replyTo,variables:lw(e.variables)}}var Sb=class{constructor(e,t){this.promise=e,this.publishFn=t}then(e,t){return this.promise.then(e,t)}async publish(){let{data:e,error:t}=await this.promise;return t?{data:null,headers:null,error:t}:this.publishFn(e.id)}},cw=class{constructor(e){this.resend=e}create(e){return new Sb(this.performCreate(e),this.publish.bind(this))}async performCreate(e){if(e.react){if(!this.renderAsync)try{let{renderAsync:t}=await import("@react-email/render");this.renderAsync=t}catch{throw new Error("Failed to render React component. Make sure to install `@react-email/render`")}e.html=await this.renderAsync(e.react)}return this.resend.post("/templates",Ob(e))}async remove(e){return await this.resend.delete(`/templates/${e}`)}async get(e){return await this.resend.get(`/templates/${e}`)}async list(e={}){return this.resend.get(`/templates${uw(e)}`)}duplicate(e){return new Sb(this.resend.post(`/templates/${e}/duplicate`),this.publish.bind(this))}async publish(e){return await this.resend.post(`/templates/${e}/publish`)}async update(e,t){return await this.resend.patch(`/templates/${e}`,Ob(t))}},dw=class{constructor(e){this.resend=e}async create(e){let{defaultSubscription:t,...r}=e;return await this.resend.post("/topics",{...r,default_subscription:t})}async list(){return await this.resend.get("/topics")}async get(e){return e?await this.resend.get(`/topics/${e}`):{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}}}async update(e){return e.id?await this.resend.patch(`/topics/${e.id}`,e):{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}}}async remove(e){return e?await this.resend.delete(`/topics/${e}`):{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}}}},mw=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/webhooks",e,t)}async get(e){return await this.resend.get(`/webhooks/${e}`)}async list(e={}){let t=ye(e),r=t?`/webhooks?${t}`:"/webhooks";return await this.resend.get(r)}async update(e,t){return await this.resend.patch(`/webhooks/${e}`,t)}async remove(e){return await this.resend.delete(`/webhooks/${e}`)}verify(e){return new kb.Webhook(e.webhookSecret).verify(e.payload,{"svix-id":e.headers.id,"svix-timestamp":e.headers.timestamp,"svix-signature":e.headers.signature})}},wb="https://api.resend.com",xb=`resend-node:${FS}`,pw=typeof process<"u"&&process.env&&process.env.RESEND_BASE_URL||wb,fw=typeof process<"u"&&process.env&&process.env.RESEND_USER_AGENT||xb,vr=class{constructor(e){if(this.key=e,this.segments=new aw(this),this.apiKeys=new HS(this),this.audiences=this.segments,this.automations=new GS(this),this.batch=new WS(this),this.broadcasts=new VS(this),this.contactProperties=new KS(this),this.contacts=new ZS(this),this.domains=new ew(this),this.emails=new nw(this),this.events=new ow(this),this.logs=new sw(this),this.templates=new cw(this),this.topics=new dw(this),this.webhooks=new mw(this),!e&&(typeof process<"u"&&process.env&&(this.key=process.env.RESEND_API_KEY),!this.key))throw new Error('Missing API key. Pass it to the constructor `new Resend("re_123")`');this.headers=new Headers({Authorization:`Bearer ${this.key}`,"User-Agent":fw,"Content-Type":"application/json"})}async fetchRequest(e,t={}){try{let r=await fetch(`${pw}${e}`,t);if(!r.ok)try{let i=await r.text();return{data:null,error:JSON.parse(i),headers:Object.fromEntries(r.headers.entries())}}catch(i){if(i instanceof SyntaxError)return{data:null,error:{name:"application_error",statusCode:r.status,message:"Internal server error. We are unable to process your request right now, please try again later."},headers:Object.fromEntries(r.headers.entries())};let n={message:r.statusText,statusCode:r.status,name:"application_error"};return i instanceof Error?{data:null,error:{...n,message:i.message},headers:Object.fromEntries(r.headers.entries())}:{data:null,error:n,headers:Object.fromEntries(r.headers.entries())}}return{data:await r.json(),error:null,headers:Object.fromEntries(r.headers.entries())}}catch{return{data:null,error:{name:"application_error",statusCode:null,message:"Unable to fetch data. The request could not be resolved."},headers:null}}}async post(e,t,r={}){let i=new Headers(this.headers);if(r.headers)for(let[o,s]of new Headers(r.headers).entries())i.set(o,s);r.idempotencyKey&&i.set("Idempotency-Key",r.idempotencyKey);let n={method:"POST",body:JSON.stringify(t),...r,headers:i};return this.fetchRequest(e,n)}async get(e,t={}){let r=new Headers(this.headers);if(t.headers)for(let[n,o]of new Headers(t.headers).entries())r.set(n,o);let i={method:"GET",...t,headers:r};return this.fetchRequest(e,i)}async put(e,t,r={}){let i=new Headers(this.headers);if(r.headers)for(let[o,s]of new Headers(r.headers).entries())i.set(o,s);let n={method:"PUT",body:JSON.stringify(t),...r,headers:i};return this.fetchRequest(e,n)}async patch(e,t,r={}){let i=new Headers(this.headers);if(r.headers)for(let[o,s]of new Headers(r.headers).entries())i.set(o,s);let n={method:"PATCH",body:JSON.stringify(t),...r,headers:i};return this.fetchRequest(e,n)}async delete(e,t){let r={method:"DELETE",body:JSON.stringify(t),headers:this.headers};return this.fetchRequest(e,r)}};Pe();var sc=we(yt(),1);function Y(e,t){return e instanceof Error?e.message:t}function Qb(e){return!!(e||!process.stdout.isTTY)}function z(e,t={}){Qb(t.json)?console.log(JSON.stringify(e,null,2)):console.log(typeof e=="string"?e:JSON.stringify(e,null,2)),t.exitCode!==void 0&&process.exit(t.exitCode)}var Sw=new Set(["content-type","retry-after"]);function ww(e){let t={};for(let[r,i]of Object.entries(e)){let n=r.toLowerCase();(Sw.has(n)||n.startsWith("x-"))&&(t[n]=i)}return t}function g(e,t={}){let r=t.exitCode??1,i=e.headers&&Object.keys(e.headers).length>0?ww(e.headers):void 0,n=i!==void 0&&Object.keys(i).length>0;if(Qb(t.json)){let o={message:e.message,code:e.code??"unknown"};typeof e.statusCode=="number"&&(o.statusCode=e.statusCode),n&&(o.headers=i),typeof e.body=="string"&&e.body.length>0&&(o.body=e.body),console.error(JSON.stringify({error:o},null,2))}else{console.error(`${sc.default.red("Error:")} ${e.message}`);let o=[];if(typeof e.statusCode=="number"&&o.push(`HTTP ${e.statusCode}`),n)for(let[s,a]of Object.entries(i))o.push(`${s}: ${a}`);o.length>0&&console.error(sc.default.dim(`[${o.join("; ")}]`))}process.exit(r)}var Zb={sending_access:0,full_access:1};function xw(e,t){return Zb[e]>=Zb[t]}async function ne(e,t){let r=e.profile;try{let i=await ir(e.apiKey,r);if(!i){if(r){let n=$e();if(!n.some(s=>s.name===r))throw new Error(`Profile "${r}" not found. Available profiles: ${n.map(s=>s.name).join(", ")||"(none)"}`)}throw new Error("No API key found. Set RESEND_API_KEY, use --api-key, or run: resend login")}if(i.permission){let n=t?.permission??"full_access";xw(i.permission,n)||g({message:`This command requires a full access API key. Your current key has sending access only.
|
|
186
|
-
${
|
|
187
|
-
`):process.stderr.write("\r\x1B[2K")},clear(){clearInterval(s),process.stderr.write("\r\x1B[2K")},warn(a){clearInterval(s),process.stderr.write(`\r\x1B[2K ${
|
|
188
|
-
`)},fail(a){clearInterval(s),process.stderr.write(`\r\x1B[2K ${
|
|
189
|
-
`)}}}
|
|
183
|
+
`);c.content=nt.encode(u);break}default:c.content=s.content}this.attachments.push(c)}for(let d of s.childNodes)await o(d,a,l)};await o(this.root,!1,!1),n.forEach(s=>{r.forEach(a=>{if(e[a]||(e[a]=[]),s[a])s[a].forEach(l=>{switch(l.type){case"text":e[a].push(l.value);break;case"subMessage":switch(a){case"html":e[a].push(Gn(l.value));break;case"plain":e[a].push(Ln(l.value));break}break}});else{let l;switch(a){case"html":l="plain";break;case"plain":l="html";break}(s[l]||[]).forEach(d=>{switch(d.type){case"text":switch(a){case"html":e[a].push(xo(d.value));break;case"plain":e[a].push(Ao(d.value));break}break;case"subMessage":switch(a){case"html":e[a].push(Gn(d.value));break;case"plain":e[a].push(Ln(d.value));break}break}})}})}),Object.keys(e).forEach(s=>{e[s]=e[s].join(`
|
|
184
|
+
`)}),this.textContent=e}isInlineTextNode(e){if(e.contentDisposition?.parsed?.value==="attachment")return!1;switch(e.contentType.parsed?.value){case"text/html":case"text/plain":return!0;default:return!1}}isInlineMessageRfc822(e){return e.contentType.parsed?.value!=="message/rfc822"?!1:(e.contentDisposition?.parsed?.value||(this.options.rfc822Attachments?"attachment":"inline"))==="inline"}forceRfc822Attachments(){if(this.options.forceRfc822Attachments)return!0;let e=!1,r=n=>{n.contentType.multipart||n.contentType.parsed&&["message/delivery-status","message/feedback-report"].includes(n.contentType.parsed.value)&&(e=!0);for(let i of n.childNodes)r(i)};return r(this.root),e}async resolveStream(e){let r=0,n=[],i=e.getReader();for(;;){let{done:a,value:l}=await i.read();if(a)break;n.push(l),r+=l.length}let o=new Uint8Array(r),s=0;for(let a of n)o.set(a,s),s+=a.length;return o}async parse(e){if(this.started)throw new Error("Can not reuse parser, create a new PostalMime object");for(this.started=!0,e&&typeof e.getReader=="function"&&(e=await this.resolveStream(e)),e=e||new ArrayBuffer(0),typeof e=="string"&&(e=nt.encode(e)),(e instanceof Blob||Object.prototype.toString.call(e)==="[object Blob]")&&(e=await it(e)),e.buffer instanceof ArrayBuffer&&(e=new Uint8Array(e).buffer),this.buf=e,this.av=new Uint8Array(e),this.readPos=0;this.readPos<this.av.length;){let i=this.readLine();await this.processLine(i.bytes,i.done)}await this.processNodeTree();let r={headers:this.root.headers.map(i=>({key:i.key,originalKey:i.originalKey,value:i.value})).reverse()};for(let i of["from","sender"]){let o=this.root.headers.find(s=>s.key===i);if(o&&o.value){let s=Dr(o.value);s&&s.length&&(r[i]=s[0])}}for(let i of["delivered-to","return-path"]){let o=this.root.headers.find(s=>s.key===i);if(o&&o.value){let s=Dr(o.value);if(s&&s.length&&s[0].address){let a=Un(i);r[a]=s[0].address}}}for(let i of["to","cc","bcc","reply-to"]){let o=this.root.headers.filter(a=>a.key===i),s=[];if(o.filter(a=>a&&a.value).map(a=>Dr(a.value)).forEach(a=>s=s.concat(a||[])),s&&s.length){let a=Un(i);r[a]=s}}for(let i of["subject","message-id","in-reply-to","references"]){let o=this.root.headers.find(s=>s.key===i);if(o&&o.value){let s=Un(i);r[s]=gt(o.value)}}let n=this.root.headers.find(i=>i.key==="date");if(n){let i=new Date(n.value);i.toString()==="Invalid Date"?i=n.value:i=i.toISOString(),r.date=i}switch(this.textContent?.html&&(r.html=this.textContent.html),this.textContent?.plain&&(r.text=this.textContent.plain),r.attachments=this.attachments,r.headerLines=(this.root.rawHeaderLines||[]).slice().reverse(),this.attachmentEncoding){case"arraybuffer":break;case"base64":for(let o of r.attachments||[])o?.content&&(o.content=Eo(o.content),o.encoding="base64");break;case"utf8":let i=new TextDecoder("utf8");for(let o of r.attachments||[])o?.content&&(o.content=i.decode(o.content),o.encoding="utf8");break;default:throw new Error("Unknown attachment encoding")}return r}};var Uo=pe(Bo(),1),wd="6.14.0";function oe(t){let e=new URLSearchParams;return t.limit!==void 0&&e.set("limit",t.limit.toString()),"after"in t&&t.after!==void 0&&e.set("after",t.after),"before"in t&&t.before!==void 0&&e.set("before",t.before),e.toString()}var _d=class{constructor(t){this.resend=t}async create(t,e={}){return await this.resend.post("/api-keys",t,e)}async list(t={}){let e=oe(t),r=e?`/api-keys?${e}`:"/api-keys";return await this.resend.get(r)}async remove(t){return await this.resend.delete(`/api-keys/${t}`)}},xd=class{constructor(t){this.resend=t}async get(t){return await this.resend.get(`/automations/${t.automationId}/runs/${t.runId}`)}async list(t){let e=oe(t),r=new URLSearchParams(e);if(t.status){let o=Array.isArray(t.status)?t.status.join(","):t.status;r.set("status",o)}let n=r.toString(),i=n?`/automations/${t.automationId}/runs?${n}`:`/automations/${t.automationId}/runs`;return await this.resend.get(i)}};function Wo(t){switch(t.type){case"trigger":return{key:t.key,type:t.type,config:{event_name:t.config.eventName}};case"delay":return{key:t.key,type:t.type,config:t.config};case"send_email":return{key:t.key,type:t.type,config:{template:t.config.template,subject:t.config.subject,from:t.config.from,reply_to:t.config.replyTo}};case"wait_for_event":return{key:t.key,type:t.type,config:{event_name:t.config.eventName,timeout:t.config.timeout,filter_rule:t.config.filterRule}};case"condition":return{key:t.key,type:t.type,config:t.config};case"contact_update":return{key:t.key,type:t.type,config:{first_name:t.config.firstName,last_name:t.config.lastName,unsubscribed:t.config.unsubscribed,properties:t.config.properties}};case"contact_delete":return{key:t.key,type:t.type,config:t.config};case"add_to_segment":return{key:t.key,type:t.type,config:{segment_id:t.config.segmentId}}}}function Vo(t){return{from:t.from,to:t.to,type:t.type}}function Ad(t){return{name:t.name,status:t.status,steps:t.steps.map(Wo),connections:t.connections.map(Vo)}}function kd(t){return{event:t.event,contact_id:t.contactId,email:t.email,payload:t.payload}}var $d=class{constructor(t){this.resend=t,this.runs=new xd(this.resend)}async create(t){return await this.resend.post("/automations",Ad(t))}async list(t={}){let e=[oe(t)];t.status&&e.push(`status=${encodeURIComponent(t.status)}`);let r=e.filter(Boolean).join("&"),n=r?`/automations?${r}`:"/automations";return await this.resend.get(n)}async get(t){return await this.resend.get(`/automations/${t}`)}async remove(t){return await this.resend.delete(`/automations/${t}`)}async update(t,e){let r={};return e.name!==void 0&&(r.name=e.name),e.status!==void 0&&(r.status=e.status),e.steps!==void 0&&(r.steps=e.steps.map(Wo)),e.connections!==void 0&&(r.connections=e.connections.map(Vo)),await this.resend.patch(`/automations/${t}`,r)}async stop(t){return await this.resend.post(`/automations/${t}/stop`)}};function Ed(t){return t?.map(e=>({content:e.content,filename:e.filename,path:e.path,content_type:e.contentType,content_id:e.contentId}))}function Ko(t){return{attachments:Ed(t.attachments),bcc:t.bcc,cc:t.cc,from:t.from,headers:t.headers,html:t.html,reply_to:t.replyTo,scheduled_at:t.scheduledAt,subject:t.subject,tags:t.tags,text:t.text,to:t.to,template:t.template?{id:t.template.id,variables:t.template.variables}:void 0,topic_id:t.topicId}}async function ir(t){let e;try{({render:e}=await import("@react-email/render"))}catch{throw new Error("Failed to render React component. Make sure to install `@react-email/render` or `@react-email/components`.")}return e(t)}var Dd=class{constructor(t){this.resend=t}async send(t,e){return this.create(t,e)}async create(t,e){let r=[];for(let n of t)n.react&&(n.html=await ir(n.react),n.react=void 0),r.push(Ko(n));return await this.resend.post("/emails/batch",r,{...e,headers:{"x-batch-validation":e?.batchValidation??"strict",...e?.headers}})}},Sd=class{constructor(t){this.resend=t}async create(t,e={}){let r=t.react?await ir(t.react):t.html;return await this.resend.post("/broadcasts",{name:t.name,segment_id:t.segmentId,audience_id:t.audienceId,preview_text:t.previewText,from:t.from,html:r,reply_to:t.replyTo,subject:t.subject,text:t.text,topic_id:t.topicId,send:t.send,scheduled_at:t.scheduledAt},e)}async send(t,e){return await this.resend.post(`/broadcasts/${t}/send`,{scheduled_at:e?.scheduledAt})}async list(t={}){let e=oe(t),r=e?`/broadcasts?${e}`:"/broadcasts";return await this.resend.get(r)}async get(t){return await this.resend.get(`/broadcasts/${t}`)}async remove(t){return await this.resend.delete(`/broadcasts/${t}`)}async update(t,e){let r=e.react?await ir(e.react):e.html;return await this.resend.patch(`/broadcasts/${t}`,{name:e.name,segment_id:e.segmentId,audience_id:e.audienceId,from:e.from,html:r,text:e.text,subject:e.subject,reply_to:e.replyTo,preview_text:e.previewText,topic_id:e.topicId})}};function No(t){return{id:t.id,key:t.key,createdAt:t.created_at,type:t.type,fallbackValue:t.fallback_value}}function Ho(t){return"key"in t?{key:t.key,type:t.type,fallback_value:t.fallbackValue}:{fallback_value:t.fallbackValue}}var Td=class{constructor(t){this.resend=t}async create(t){let e=Ho(t);return await this.resend.post("/contact-properties",e)}async list(t={}){let e=oe(t),r=e?`/contact-properties?${e}`:"/contact-properties",n=await this.resend.get(r);return n.data?{data:{...n.data,data:n.data.data.map(i=>No(i))},headers:n.headers,error:null}:n}async get(t){if(!t)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};let e=await this.resend.get(`/contact-properties/${t}`);return e.data?{data:{object:"contact_property",...No(e.data)},headers:e.headers,error:null}:e}async update(t){if(!t.id)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};let e=Ho(t);return await this.resend.patch(`/contact-properties/${t.id}`,e)}async remove(t){return t?await this.resend.delete(`/contact-properties/${t}`):{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}}}},Od=class{constructor(t){this.resend=t}async create(t,e={}){let r=this.buildCreateFormData(t);return this.resend.post("/contacts/imports",r,e)}async list(t={}){let e=new URLSearchParams(oe(t));t.status!==void 0&&e.set("status",t.status);let r=e.toString(),n=r?`/contacts/imports?${r}`:"/contacts/imports";return this.resend.get(n)}async get(t){return this.resend.get(`/contacts/imports/${t}`)}buildCreateFormData(t){let e=new FormData;return e.append("file",t.file),this.appendField(e,"column_map",this.buildColumnMap(t.columnMap??null)),this.appendField(e,"on_conflict",t.onConflict??null),this.appendField(e,"segments",t.segments??null),this.appendField(e,"topics",t.topics??null),e}buildColumnMap(t){return t===null?null:{email:t.email,first_name:t.firstName,last_name:t.lastName,unsubscribed:t.unsubscribed,properties:t.properties}}appendField(t,e,r){r!==null&&t.append(e,typeof r=="string"?r:JSON.stringify(r))}},Id=class{constructor(t){this.resend=t}async list(t){if(!t.contactId&&!t.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let e=t.email?t.email:t.contactId,r=oe(t),n=r?`/contacts/${e}/segments?${r}`:`/contacts/${e}/segments`;return await this.resend.get(n)}async add(t){if(!t.contactId&&!t.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let e=t.email?t.email:t.contactId;return this.resend.post(`/contacts/${e}/segments/${t.segmentId}`)}async remove(t){if(!t.contactId&&!t.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let e=t.email?t.email:t.contactId;return this.resend.delete(`/contacts/${e}/segments/${t.segmentId}`)}},Pd=class{constructor(t){this.resend=t}async update(t){if(!t.id&&!t.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let e=t.email?t.email:t.id;return this.resend.patch(`/contacts/${e}/topics`,t.topics)}async list(t){if(!t.id&&!t.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let e=t.email?t.email:t.id,r=oe(t),n=r?`/contacts/${e}/topics?${r}`:`/contacts/${e}/topics`;return this.resend.get(n)}},jd=class{constructor(t){this.resend=t,this.imports=new Od(this.resend),this.topics=new Pd(this.resend),this.segments=new Id(this.resend)}async create(t,e={}){return"audienceId"in t?"segments"in t||"topics"in t?{data:null,headers:null,error:{message:"`audienceId` is deprecated, and cannot be used together with `segments` or `topics`. Use `segments` instead to add one or more segments to the new contact.",statusCode:null,name:"invalid_parameter"}}:await this.resend.post(`/audiences/${t.audienceId}/contacts`,{unsubscribed:t.unsubscribed,email:t.email,first_name:t.firstName,last_name:t.lastName,properties:t.properties},e):await this.resend.post("/contacts",{unsubscribed:t.unsubscribed,email:t.email,first_name:t.firstName,last_name:t.lastName,properties:t.properties,segments:t.segments,topics:t.topics},e)}async list(t={}){let e=t.segmentId??t.audienceId;if(!e){let i=oe(t),o=i?`/contacts?${i}`:"/contacts";return await this.resend.get(o)}let r=oe(t),n=r?`/segments/${e}/contacts?${r}`:`/segments/${e}/contacts`;return await this.resend.get(n)}async get(t){return typeof t=="string"?this.resend.get(`/contacts/${t}`):!t.id&&!t.email?{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}}:t.audienceId?this.resend.get(`/audiences/${t.audienceId}/contacts/${t?.email?t?.email:t?.id}`):this.resend.get(`/contacts/${t?.email?t?.email:t?.id}`)}async update(t){return!t.id&&!t.email?{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}}:t.audienceId?await this.resend.patch(`/audiences/${t.audienceId}/contacts/${t?.email?t?.email:t?.id}`,{unsubscribed:t.unsubscribed,first_name:t.firstName,last_name:t.lastName,properties:t.properties}):await this.resend.patch(`/contacts/${t?.email?t?.email:t?.id}`,{unsubscribed:t.unsubscribed,first_name:t.firstName,last_name:t.lastName,properties:t.properties})}async remove(t){return typeof t=="string"?this.resend.delete(`/contacts/${t}`):!t.id&&!t.email?{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}}:t.audienceId?this.resend.delete(`/audiences/${t.audienceId}/contacts/${t?.email?t?.email:t?.id}`):this.resend.delete(`/contacts/${t?.email?t?.email:t?.id}`)}};function Rd(t){return{name:t.name,region:t.region,custom_return_path:t.customReturnPath,capabilities:t.capabilities,open_tracking:t.openTracking,click_tracking:t.clickTracking,tls:t.tls,tracking_subdomain:t.trackingSubdomain}}var Fd=class{constructor(t){this.resend=t}async create(t,e={}){return await this.resend.post("/domains/claim",{name:t.name,region:t.region,custom_return_path:t.customReturnPath,open_tracking:t.openTracking,click_tracking:t.clickTracking,tracking_subdomain:t.trackingSubdomain},e)}async get(t){return await this.resend.get(`/domains/${t}/claim`)}async verify(t){return await this.resend.post(`/domains/${t}/claim/verify`)}},Bd=class{constructor(t){this.resend=t,this.claims=new Fd(this.resend)}async create(t,e={}){return await this.resend.post("/domains",Rd(t),e)}async list(t={}){let e=oe(t),r=e?`/domains?${e}`:"/domains";return await this.resend.get(r)}async get(t){return await this.resend.get(`/domains/${t}`)}async update(t){return await this.resend.patch(`/domains/${t.id}`,{click_tracking:t.clickTracking,open_tracking:t.openTracking,tls:t.tls,capabilities:t.capabilities,tracking_subdomain:t.trackingSubdomain})}async remove(t){return await this.resend.delete(`/domains/${t}`)}async verify(t){return await this.resend.post(`/domains/${t}/verify`)}},Nd=class{constructor(t){this.resend=t}async get(t){let{emailId:e,id:r}=t;return await this.resend.get(`/emails/${e}/attachments/${r}`)}async list(t){let{emailId:e}=t,r=oe(t),n=r?`/emails/${e}/attachments?${r}`:`/emails/${e}/attachments`;return await this.resend.get(n)}},Hd=class{constructor(t){this.resend=t}async get(t){let{emailId:e,id:r}=t;return await this.resend.get(`/emails/receiving/${e}/attachments/${r}`)}async list(t){let{emailId:e}=t,r=oe(t),n=r?`/emails/receiving/${e}/attachments?${r}`:`/emails/receiving/${e}/attachments`;return await this.resend.get(n)}},Ld=class{constructor(t){this.resend=t,this.attachments=new Hd(t)}async get(t,e={}){let r=new URLSearchParams;e.html_format!==void 0&&r.set("html_format",e.html_format);let n=r.toString(),i=n?`/emails/receiving/${t}?${n}`:`/emails/receiving/${t}`;return await this.resend.get(i)}async list(t={}){let e=oe(t),r=e?`/emails/receiving?${e}`:"/emails/receiving";return await this.resend.get(r)}async forward(t){let{emailId:e,to:r,from:n}=t,i=t.passthrough!==!1,o=await this.get(e);if(o.error)return{data:null,error:o.error,headers:o.headers};let s=o.data,a=s.subject||"(no subject)";if(i)return this.forwardPassthrough(s,{to:r,from:n,subject:a});let l=a.startsWith("Fwd:")?a:`Fwd: ${a}`;return this.forwardWrapped(s,{to:r,from:n,subject:l,text:"text"in t?t.text:void 0,html:"html"in t?t.html:void 0})}async forwardPassthrough(t,e){let{to:r,from:n,subject:i}=e;if(!t.raw?.download_url)return{data:null,error:{name:"validation_error",message:"Raw email content is not available for this email",statusCode:400},headers:null};let o=await fetch(t.raw.download_url);if(!o.ok)return{data:null,error:{name:"application_error",message:"Failed to download raw email content",statusCode:o.status},headers:null};let s=await o.text(),a=await rr.parse(s,{attachmentEncoding:"base64"}),l=a.attachments.map(d=>{let c=d.contentId?d.contentId.replace(/^<|>$/g,""):void 0;return{filename:d.filename,content:d.content.toString(),content_type:d.mimeType,content_id:c||void 0}});return await this.resend.post("/emails",{from:n,to:r,subject:i,text:a.text||void 0,html:a.html||void 0,attachments:l.length>0?l:void 0})}async forwardWrapped(t,e){let{to:r,from:n,subject:i,text:o,html:s}=e;if(!t.raw?.download_url)return{data:null,error:{name:"validation_error",message:"Raw email content is not available for this email",statusCode:400},headers:null};let a=await fetch(t.raw.download_url);if(!a.ok)return{data:null,error:{name:"application_error",message:"Failed to download raw email content",statusCode:a.status},headers:null};let l=await a.text();return await this.resend.post("/emails",{from:n,to:r,subject:i,text:o,html:s,attachments:[{filename:"forwarded_message.eml",content:Buffer.from(l).toString("base64"),content_type:"message/rfc822"}]})}},Gd=class{constructor(t){this.resend=t,this.attachments=new Nd(t),this.receiving=new Ld(t)}async send(t,e={}){return this.create(t,e)}async create(t,e={}){let r={...t};return t.react&&(r.html=await ir(t.react)),await this.resend.post("/emails",Ko(r),e)}async get(t){return await this.resend.get(`/emails/${t}`)}async list(t={}){let e=oe(t),r=e?`/emails?${e}`:"/emails";return await this.resend.get(r)}async update(t){return await this.resend.patch(`/emails/${t.id}`,{scheduled_at:t.scheduledAt})}async cancel(t){return await this.resend.post(`/emails/${t}/cancel`)}},Md=class{constructor(t){this.resend=t}async send(t){return await this.resend.post("/events/send",kd(t))}async create(t){return await this.resend.post("/events",t)}async get(t){return await this.resend.get(`/events/${encodeURIComponent(t)}`)}async list(t={}){let e=oe(t),r=e?`/events?${e}`:"/events";return await this.resend.get(r)}async update(t,e){return await this.resend.patch(`/events/${encodeURIComponent(t)}`,e)}async remove(t){return await this.resend.delete(`/events/${encodeURIComponent(t)}`)}},qd=class{constructor(t){this.resend=t}async list(t={}){let e=oe(t),r=e?`/logs?${e}`:"/logs";return await this.resend.get(r)}async get(t){return await this.resend.get(`/logs/${t}`)}},Ud=class{constructor(t){this.resend=t}async create(t,e={}){return await this.resend.post("/segments",t,e)}async list(t={}){let e=oe(t),r=e?`/segments?${e}`:"/segments";return await this.resend.get(r)}async get(t){return await this.resend.get(`/segments/${t}`)}async remove(t){return await this.resend.delete(`/segments/${t}`)}};function Wd(t={}){let e=new URLSearchParams;return t.before&&e.set("before",t.before),t.after&&e.set("after",t.after),t.limit&&e.set("limit",t.limit.toString()),e.size>0?`?${e.toString()}`:""}function Vd(t){return t?.map(e=>({key:e.key,type:e.type,fallback_value:e.fallbackValue}))}function Lo(t){return{name:"name"in t?t.name:void 0,subject:t.subject,html:t.html,text:t.text,alias:t.alias,from:t.from,reply_to:t.replyTo,variables:Vd(t.variables)}}var Go=class{constructor(t,e){this.promise=t,this.publishFn=e}then(t,e){return this.promise.then(t,e)}async publish(){let{data:t,error:e}=await this.promise;return e?{data:null,headers:null,error:e}:this.publishFn(t.id)}},Kd=class{constructor(t){this.resend=t}create(t){return new Go(this.performCreate(t),this.publish.bind(this))}async performCreate(t){let e={...t};return t.react&&(e.html=await ir(t.react)),this.resend.post("/templates",Lo(e))}async remove(t){return await this.resend.delete(`/templates/${t}`)}async get(t){return await this.resend.get(`/templates/${t}`)}async list(t={}){return this.resend.get(`/templates${Wd(t)}`)}duplicate(t){return new Go(this.resend.post(`/templates/${t}/duplicate`),this.publish.bind(this))}async publish(t){return await this.resend.post(`/templates/${t}/publish`)}async update(t,e){return await this.resend.patch(`/templates/${t}`,Lo(e))}},zd=class{constructor(t){this.resend=t}async create(t){let{defaultSubscription:e,...r}=t;return await this.resend.post("/topics",{...r,default_subscription:e})}async list(){return await this.resend.get("/topics")}async get(t){return t?await this.resend.get(`/topics/${t}`):{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}}}async update(t){return t.id?await this.resend.patch(`/topics/${t.id}`,t):{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}}}async remove(t){return t?await this.resend.delete(`/topics/${t}`):{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}}}},Jd=class{constructor(t){this.resend=t}async create(t,e={}){return await this.resend.post("/webhooks",t,e)}async get(t){return await this.resend.get(`/webhooks/${t}`)}async list(t={}){let e=oe(t),r=e?`/webhooks?${e}`:"/webhooks";return await this.resend.get(r)}async update(t,e){return await this.resend.patch(`/webhooks/${t}`,e)}async remove(t){return await this.resend.delete(`/webhooks/${t}`)}verify(t){return new Uo.Webhook(t.webhookSecret).verify(t.payload,{"webhook-id":t.headers.id,"webhook-timestamp":t.headers.timestamp,"webhook-signature":t.headers.signature})}},Mo="https://api.resend.com",qo=`resend-node:${wd}`;function Yd(){return typeof process<"u"&&process.env&&process.env.RESEND_BASE_URL||Mo}function Qd(){return typeof process<"u"&&process.env&&process.env.RESEND_USER_AGENT||qo}var Dt=class{constructor(t,e){if(this.key=t,this.segments=new Ud(this),this.apiKeys=new _d(this),this.audiences=this.segments,this.automations=new $d(this),this.batch=new Dd(this),this.broadcasts=new Sd(this),this.contactProperties=new Td(this),this.contacts=new jd(this),this.domains=new Bd(this),this.emails=new Gd(this),this.events=new Md(this),this.logs=new qd(this),this.templates=new Kd(this),this.topics=new zd(this),this.webhooks=new Jd(this),!t&&(typeof process<"u"&&process.env&&(this.key=process.env.RESEND_API_KEY),!this.key))throw new Error('Missing API key. Pass it to the constructor `new Resend("re_123")`');this.baseUrl=e?.baseUrl??Yd(),this.userAgent=e?.userAgent??Qd(),this.headers=new Headers({Authorization:`Bearer ${this.key}`,"User-Agent":this.userAgent,"Content-Type":"application/json"})}async fetchRequest(t,e={}){try{let r=await fetch(`${this.baseUrl}${t}`,e);if(!r.ok)try{let n=await r.text();return{data:null,error:JSON.parse(n),headers:Object.fromEntries(r.headers.entries())}}catch(n){if(n instanceof SyntaxError)return{data:null,error:{name:"application_error",statusCode:r.status,message:"Internal server error. We are unable to process your request right now, please try again later."},headers:Object.fromEntries(r.headers.entries())};let i={message:r.statusText,statusCode:r.status,name:"application_error"};return n instanceof Error?{data:null,error:{...i,message:n.message},headers:Object.fromEntries(r.headers.entries())}:{data:null,error:i,headers:Object.fromEntries(r.headers.entries())}}return{data:await r.json(),error:null,headers:Object.fromEntries(r.headers.entries())}}catch{return{data:null,error:{name:"application_error",statusCode:null,message:"Unable to fetch data. The request could not be resolved."},headers:null}}}async post(t,e,r={}){let n=new Headers(this.headers),i=typeof FormData<"u"&&e instanceof FormData;if(i&&n.delete("Content-Type"),r.headers)for(let[s,a]of new Headers(r.headers).entries())n.set(s,a);r.idempotencyKey&&n.set("Idempotency-Key",r.idempotencyKey);let o={method:"POST",body:i?e:JSON.stringify(e),...r,headers:n};return this.fetchRequest(t,o)}async get(t,e={}){let r=new Headers(this.headers);if(e.headers)for(let[i,o]of new Headers(e.headers).entries())r.set(i,o);let n={method:"GET",...e,headers:r};return this.fetchRequest(t,n)}async put(t,e,r={}){let n=new Headers(this.headers);if(r.headers)for(let[o,s]of new Headers(r.headers).entries())n.set(o,s);let i={method:"PUT",body:JSON.stringify(e),...r,headers:n};return this.fetchRequest(t,i)}async patch(t,e,r={}){let n=new Headers(this.headers);if(r.headers)for(let[o,s]of new Headers(r.headers).entries())n.set(o,s);let i={method:"PATCH",body:JSON.stringify(e),...r,headers:n};return this.fetchRequest(t,i)}async delete(t,e,r={}){let n=new Headers(this.headers);if(r.headers)for(let[o,s]of new Headers(r.headers).entries())n.set(o,s);let i={method:"DELETE",body:e===void 0?void 0:JSON.stringify(e),...r,headers:n};return this.fetchRequest(t,i)}};ye();var ii=pe(et(),1);function V(t,e){return t instanceof Error?t.message:e}function hs(t){return!!(t||!process.stdout.isTTY)}function B(t,e={}){hs(e.json)?console.log(JSON.stringify(t,null,2)):console.log(typeof t=="string"?t:JSON.stringify(t,null,2)),e.exitCode!==void 0&&process.exit(e.exitCode)}var sm=new Set(["content-type","retry-after"]);function am(t){let e={};for(let[r,n]of Object.entries(t)){let i=r.toLowerCase();(sm.has(i)||i.startsWith("x-"))&&(e[i]=n)}return e}function h(t,e={}){let r=e.exitCode??1,n=t.headers&&Object.keys(t.headers).length>0?am(t.headers):void 0,i=n!==void 0&&Object.keys(n).length>0;if(hs(e.json)){let o={message:t.message,code:t.code??"unknown"};typeof t.statusCode=="number"&&(o.statusCode=t.statusCode),i&&(o.headers=n),typeof t.body=="string"&&t.body.length>0&&(o.body=t.body),console.error(JSON.stringify({error:o},null,2))}else{console.error(`${ii.default.red("Error:")} ${t.message}`);let o=[];if(typeof t.statusCode=="number"&&o.push(`HTTP ${t.statusCode}`),i)for(let[s,a]of Object.entries(n))o.push(`${s}: ${a}`);o.length>0&&console.error(ii.default.dim(`[${o.join("; ")}]`))}process.exit(r)}var gs={sending_access:0,full_access:1};function lm(t,e){return gs[t]>=gs[e]}async function X(t,e){let r=t.profile;try{let n=await _t(t.apiKey,r);if(!n){if(r){let i=we();if(!i.some(s=>s.name===r))throw new Error(`Profile "${r}" not found. Available profiles: ${i.map(s=>s.name).join(", ")||"(none)"}`)}throw new Error("No API key found. Set RESEND_API_KEY, use --api-key, or run: resend login")}if(n.permission){let i=e?.permission??"full_access";lm(n.permission,i)||h({message:`This command requires a full access API key. Your current key has sending access only.
|
|
185
|
+
${Tt}`,code:"insufficient_permissions"},{json:t.json})}return new Dt(n.key)}catch(n){h({message:V(n,"Failed to create client"),code:"auth_error"},{json:t.json})}}var bs=130;function cm(){process.stderr.isTTY&&process.stderr.write("\r\x1B[2K"),console.error("Cancelled."),process.exit(bs)}var Ot;function ys(){Ot=cm,process.on("SIGINT",Ot),process.on("uncaughtException",t=>{h({message:V(t,"An unexpected error occurred"),code:"unexpected_error"},{}),process.exit(1)})}function Gr(t){Ot&&process.removeListener("SIGINT",Ot),Ot=t,process.on("SIGINT",Ot)}function It(){return bs}ye();var Mr=pe(et(),1);z();var vs=[1,2,4],um=vs.length,dm=new Set(["internal_server_error","service_unavailable","gateway_timeout"]),mm=(t,e)=>!!(t==="rate_limit_exceeded"||e&&t!==void 0&&dm.has(t)),pm=t=>{let e=t?.["retry-after"];if(!e)return;let r=Number(e);if(Number.isFinite(r)&&r>=0)return r;let n=Date.parse(e);if(!Number.isNaN(n)){let i=(n-Date.now())/1e3;return i>0?i:0}},fm=t=>new Promise(e=>setTimeout(e,t)),sr=async(t,e,r=0)=>{let n=await t(),i=e?.retryTransient??!1;if(n.error&&r<um&&mm(n.error.name,i)){let o=pm(n.headers)??vs[r];return e?.onRetry?.(r,o,n.error.name??""),await fm(o*1e3),sr(t,e,r+1)}return n};var Cs=(t,e)=>new Promise((r,n)=>{let i=setTimeout(()=>{n(new Error(`Request timed out after ${e/1e3}s`))},e);i.unref(),t.then(o=>{clearTimeout(i),r(o)},o=>{clearTimeout(i),n(o)})});var gm=Qe?String.fromCodePoint(10004):"v",bm=Qe?String.fromCodePoint(9888):"!",ym=Qe?String.fromCodePoint(10007):"x",vm=["\u2839","\u2838","\u2834","\u2826","\u2807","\u280F","\u2819","\u2839"],Cm=80;async function Ee(t,e,r,n,i={}){let o=ae(t,n.quiet);try{let{data:s,error:a,headers:l}=await sr(()=>Cs(e(),3e4),{retryTransient:i.retryTransient,onRetry:(d,c,u)=>{o.update(u==="rate_limit_exceeded"?`Rate limited, retrying in ${c}s...`:`Server error, retrying in ${c}s...`)}});return a&&(o.stop(),h({message:a.message,code:r,statusCode:a.statusCode,headers:l},{json:n.json})),s===null&&(o.stop(),h({message:"Unexpected empty response",code:r,headers:l},{json:n.json})),o.stop(),s}catch(s){return o.stop(),h({message:V(s,"Unknown error"),code:r},{json:n.json})}}function ae(t,e){if(e||!w())return{update(a){},stop(a){},clear(){},warn(a){},fail(a){}};let r=Qe?vm:["-","\\","|","/"],n=Cm,i=0,o=t,s=setInterval(()=>{process.stderr.write(`\r\x1B[2K ${r[i++%r.length]} ${o}`)},n);return{update(a){o=a},stop(a){clearInterval(s),a?process.stderr.write(`\r\x1B[2K ${Mr.default.green(gm)} ${a}
|
|
186
|
+
`):process.stderr.write("\r\x1B[2K")},clear(){clearInterval(s),process.stderr.write("\r\x1B[2K")},warn(a){clearInterval(s),process.stderr.write(`\r\x1B[2K ${Mr.default.yellow(bm)} ${a}
|
|
187
|
+
`)},fail(a){clearInterval(s),process.stderr.write(`\r\x1B[2K ${Mr.default.red(ym)} ${a}
|
|
188
|
+
`)}}}z();function S(t){po(t),process.exit(It())}async function xs(t,e,r){(!w()||r.json)&&h({message:"Use --yes to confirm deletion in non-interactive mode.",code:"confirmation_required"},{json:r.json});let n=await rt({message:e});(k(n)||!n)&&S("Deletion cancelled.")}async function qr(t,e){let r=se(t);if(!r)return t;if(!w()||e.json)return h({message:`Profile "${t}" has an invalid name: ${r}`,code:"invalid_profile_name"},{json:e.json}),null;Q.warn(`Profile "${t}" has an invalid name: ${r}`);let n=await Y({message:"Enter a new name for this profile:",placeholder:t.replace(/[^a-zA-Z0-9._-]/g,"-"),validate:i=>se(i)});k(n)&&S("Rename cancelled.");try{await Lr(t,n)}catch(i){return h({message:V(i,"Failed to rename profile"),code:"rename_failed"},{json:e.json}),null}return Q.success(`Profile renamed to '${n}'.`),n}async function q(t,e,r,n){if(t!==void 0)return t;(!w()||n.json)&&h(r,{json:n.json});let i=await Y({message:e.message,placeholder:e.placeholder,defaultValue:e.defaultValue,validate:e.validate??(o=>!e.defaultValue&&(!o||o.length===0)?`${e.message} is required`:void 0)});return k(i)&&S("Cancelled."),i}async function Pt(t,e,r,n){if(t!==void 0)return t;(!w()||n.json)&&h(r,{json:n.json});let i=await ie({message:e.message,options:e.options});return k(i)&&S("Cancelled."),i}async function As(t,e,r){let n=e.filter(s=>s.required!==!1&&t[s.flag]==="");if(n.length>0){let s=n.map(a=>`--${a.flag}`).join(", ");h({message:`Empty value for required flags: ${s}`,code:"invalid_options"},{json:r.json})}let i=e.filter(s=>s.required!==!1&&!t[s.flag]);if(i.length===0)return t;if(!w()||r.json){let s=i.map(a=>`--${a.flag}`).join(", ");h({message:`Missing required flags: ${s}`,code:"missing_flags"},{json:r.json})}let o=await mo(Object.fromEntries(i.map(s=>[s.flag,()=>Y({message:s.message,placeholder:s.placeholder,defaultValue:s.defaultValue,validate:s.validate??(a=>!s.defaultValue&&(!a||a.length===0)?`${s.message} is required`:void 0)})])),{onCancel:()=>S("Operation cancelled.")});return{...t,...o}}var wm=20,ws="__fetch_more__",_s="__none__";async function le(t,e,r,n){if(t)return{id:t,label:t};let i=n?.optional??!1;if(!w()||r.json){if(i)return;h({message:"Missing required argument: id",code:"missing_id"},{json:r.json})}let o=await X(r),s=[];for(;;){let a=s.at(-1)?.id,l=ae(s.length===0?`Fetching ${e.resourcePlural}...`:`Fetching more ${e.resourcePlural}...`,r.quiet),d=await e.fetchItems(o,{limit:wm,...a&&{after:a}});if(d.error||!d.data){if(i){l.clear();return}l.fail(`Failed to fetch ${e.resourcePlural}`),h({message:d.error?.message??"Unexpected empty response",code:"list_error"},{json:r.json})}s.push(...d.data.data);let c=d.data.has_more??!1,u=e.filter?s.filter(e.filter):s;if(u.length===0&&!c&&i){l.clear();return}if(l.stop(s.length===u.length?`${e.resourcePlural} fetched`:`More ${e.resourcePlural} fetched`),u.length===0&&!c&&(Q.warn(`No ${e.resourcePlural} found.`),h({message:`No ${e.resourcePlural} found.`,code:"no_items"},{json:r.json})),u.length===0&&c&&!i)continue;let m=u.map(b=>({item:b,...e.display(b)})),y=m.map(({item:b,label:_,hint:A})=>({value:b.id,label:_,hint:A}));i&&y.unshift({value:_s,label:"None"}),c&&y.push({value:ws,label:"Fetch more..."});let g=await ie({message:`Select a ${e.resource}`,options:y});if(k(g)&&S("Cancelled."),g===_s)return;if(g!==ws){let b=m.find(({item:_})=>_.id===g);return{id:g,label:b?.label??g}}}}async function C(t,e,r,n){return(await le(t,e,r,n))?.id}var ks=require("node:util"),_m=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]|\r(?!\n)/g,_e=t=>(0,ks.stripVTControlCharacters)(String(t)).replace(_m,"");function jt(t){return typeof t=="string"?_e(t):Array.isArray(t)?t.map(jt):t!==null&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,jt(r)])):t}z();async function H(t,e){let r=t.permission?{permission:t.permission}:void 0,n=await X(e,r),i=await Ee(t.loading,()=>t.sdkCall(n),"fetch_error",e,{retryTransient:!0});!e.json&&w()?t.onInteractive(jt(i)):B(i,{json:e.json})}async function re(t,e,r,n){let i=r.permission?{permission:r.permission}:void 0,o=await X(n,i);e||await xs(t,r.confirmMessage,n),await Ee(r.loading,()=>r.sdkCall(o),"delete_error",n),!n.json&&w()?console.log(r.successMsg):B({object:r.object,id:t,deleted:!0},{json:n.json})}async function J(t,e){let r=t.permission?{permission:t.permission}:void 0,n=await X(e,r),i=await Ee(t.loading,()=>t.sdkCall(n),"create_error",e);!e.json&&w()?t.onInteractive(jt(i)):B(i,{json:e.json})}async function R(t,e){let r=t.permission?{permission:t.permission}:void 0,n=await X(e,r),i=await Ee(t.loading,()=>t.sdkCall(n),t.errorCode,e,{retryTransient:t.retryTransient});!e.json&&w()?console.log(t.successMsg):B(i,{json:e.json})}async function P(t,e){let r=t.permission?{permission:t.permission}:void 0,n=await X(e,r),i=await Ee(t.loading,()=>t.sdkCall(n),"list_error",e,{retryTransient:!0});!e.json&&w()?t.onInteractive(jt(i)):B(i,{json:e.json})}z();z();var ue=Qe?{h:String.fromCodePoint(9472),v:String.fromCodePoint(9474),tl:String.fromCodePoint(9484),tr:String.fromCodePoint(9488),bl:String.fromCodePoint(9492),br:String.fromCodePoint(9496),lm:String.fromCodePoint(9500),rm:String.fromCodePoint(9508),tm:String.fromCodePoint(9516),bm:String.fromCodePoint(9524),mm:String.fromCodePoint(9532)}:{h:"-",v:"|",tl:"+",tr:"+",bl:"+",br:"+",lm:"+",rm:"+",tm:"+",bm:"+",mm:"+"};function xm(){return process.stdout.columns}function Am(t,e,r){let n=Math.max(...t.map(o=>o.length)),i=Math.max(20,Math.min(r,60));return e.map((o,s)=>{let a=String(s+1),l=`${ue.h}${ue.h} ${a} ${ue.h.repeat(Math.max(0,i-a.length-4))}`,d=t.map((c,u)=>` ${c.padEnd(n)} ${o[u]}`);return[l,...d].join(`
|
|
190
189
|
`)}).join(`
|
|
191
190
|
|
|
192
|
-
`)}function
|
|
193
|
-
`)}
|
|
191
|
+
`)}function N(t,e,r="(no results)"){if(e.length===0)return r;let n=e.map(c=>c.map(_e)),i=t.map((c,u)=>Math.max(c.length,...n.map(m=>m[u].length))),o=xm();if(o!==void 0&&i.reduce((u,m)=>u+m,0)+3*i.length+1>o)return Am(t,n,o);let s=ue.tl+i.map(c=>ue.h.repeat(c+2)).join(ue.tm)+ue.tr,a=ue.lm+i.map(c=>ue.h.repeat(c+2)).join(ue.mm)+ue.rm,l=ue.bl+i.map(c=>ue.h.repeat(c+2)).join(ue.bm)+ue.br,d=c=>ue.v+" "+c.map((u,m)=>u.padEnd(i[m])).join(` ${ue.v} `)+" "+ue.v;return[s,d(t),a,...n.map(d),l].join(`
|
|
192
|
+
`)}z();var oi=Qe?String.fromCodePoint(9472):"-";function Ur(t,e){return t.length===0?"(no DNS records)":t.map(n=>{let i=n.name?n.name.includes(".")?n.name:`${n.name}.${e}`:e;return[`${oi}${oi} ${n.type} ${oi.repeat(40)}`,` Name ${i}`,` TTL ${n.ttl}`,` Value ${n.value}`].join(`
|
|
194
193
|
`)}).join(`
|
|
195
194
|
|
|
196
|
-
`)}function
|
|
195
|
+
`)}function $s(t){let e=t.map(r=>[r.name,r.status,r.region,r.id]);return N(["Name","Status","Region","ID"],e,"(no domains)")}function Es(t){switch(t){case"verified":return"\u2713 Verified";case"pending":return"\u23F3 Pending";case"not_started":return"\u25CB Not started";case"partially_verified":return"\u25D0 Partially verified";case"partially_failed":return"\u25D0 Partially failed";case"failed":case"temporary_failure":return"\u2717 Failed";default:return t}}var De={resource:"domain",resourcePlural:"domains",fetchItems:(t,{limit:e,after:r})=>t.domains.list({limit:e,...r&&{after:r}}),display:t=>({label:t.name,hint:t.id})};var Ds=new p("create").description("Create a new API key and display the token (shown once \u2014 store it immediately)").option("--name <name>","API key name (max 50 characters)").addOption(new ee("--permission <permission>","Permission level").choices(["full_access","sending_access"])).option("--domain-id <id>","Restrict a sending_access key to a single domain ID").addHelpText("after",f({context:`Non-interactive: --name is required (no prompts when stdin/stdout is not a TTY).
|
|
197
196
|
|
|
198
197
|
Permissions:
|
|
199
198
|
full_access Full API access (default)
|
|
200
199
|
sending_access Send-only access; optionally scope to a domain with --domain-id`,output:` {"id":"<id>","token":"<token>"}
|
|
201
|
-
The token is only returned at creation time and cannot be retrieved again.`,errorCodes:["auth_error","missing_name","invalid_flags","create_error"],examples:['resend api-keys create --name "Production"','resend api-keys create --name "CI Token" --permission sending_access','resend api-keys create --name "Domain Token" --permission sending_access --domain-id <domain-id>','resend api-keys create --name "Production" --json']})).action(async(e
|
|
202
|
-
${
|
|
200
|
+
The token is only returned at creation time and cannot be retrieved again.`,errorCodes:["auth_error","missing_name","invalid_flags","create_error"],examples:['resend api-keys create --name "Production"','resend api-keys create --name "CI Token" --permission sending_access','resend api-keys create --name "Domain Token" --permission sending_access --domain-id <domain-id>','resend api-keys create --name "Production" --json']})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=t.name,i=t.permission;if(!n){(!w()||r.json)&&h({message:"Missing --name flag.",code:"missing_name"},{json:r.json});let s=await Y({message:"Key name",placeholder:"e.g. My API Key",validate:l=>{if(!l)return"Name is required";if(l.length>50)return"Name must be 50 characters or less"}});k(s)&&S("Cancelled."),n=s;let a=await ie({message:"Permission level",options:[{value:"full_access",label:"Full access"},{value:"sending_access",label:"Sending access only"}]});k(a)&&S("Cancelled."),i=a}let o=t.domainId;o!==void 0&&i!=="sending_access"&&h({message:"--domain-id requires --permission sending_access",code:"invalid_flags"},{json:r.json}),!o&&i==="sending_access"&&(o=await C(void 0,De,r,{optional:!0})),await J({loading:"Creating API key...",sdkCall:s=>s.apiKeys.create({name:n,...i&&{permission:i},...o&&{domain_id:o}}),onInteractive:s=>{console.log(` ${ar.default.gray("Name:")} ${n}`),console.log(` ${ar.default.gray("ID:")} ${s.id}`),console.log(` ${ar.default.gray("Token:")} ${s.token}`),console.log(`
|
|
201
|
+
${ar.default.yellow("\u26A0")} Store this token now \u2014 it cannot be retrieved again.`)}},r)});var Ss={resource:"API key",resourcePlural:"API keys",fetchItems:(t,{limit:e,after:r})=>t.apiKeys.list({limit:e,...r&&{after:r}}),display:t=>({label:t.name,hint:t.id})};function Ts(t){let e=t.map(r=>[r.name,r.id,r.created_at,r.last_used_at??""]);return N(["Name","ID","Created","Last used"],e,"(no API keys)")}var Os=new p("delete").alias("rm").description("Delete an API key \u2014 any services using it will immediately lose access").argument("[id]","API key ID").option("--yes","Skip confirmation prompt").addHelpText("after",f({context:`Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.
|
|
203
202
|
|
|
204
203
|
Warning: Deleting a key is immediate and irreversible. Any service using this key
|
|
205
204
|
will stop authenticating instantly. The current key (used to call this command)
|
|
206
|
-
can delete itself \u2014 the API does not prevent self-deletion.`,output:' {"object":"api-key","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend api-keys delete dacf4072-aa82-4ff3-97de-514ae3000ee0 --yes","resend api-keys delete dacf4072-aa82-4ff3-97de-514ae3000ee0 --yes --json"]})).action(async(e,
|
|
207
|
-
ID: ${
|
|
208
|
-
Any services using this key will stop working.`,loading:"Deleting API key...",object:"api-key",successMsg:"API key deleted",sdkCall:o=>o.apiKeys.remove(
|
|
205
|
+
can delete itself \u2014 the API does not prevent self-deletion.`,output:' {"object":"api-key","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend api-keys delete dacf4072-aa82-4ff3-97de-514ae3000ee0 --yes","resend api-keys delete dacf4072-aa82-4ff3-97de-514ae3000ee0 --yes --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await le(t,Ss,n);await re(i.id,!!e.yes,{confirmMessage:`Delete API key "${i.label}"?
|
|
206
|
+
ID: ${i.id}
|
|
207
|
+
Any services using this key will stop working.`,loading:"Deleting API key...",object:"api-key",successMsg:"API key deleted",sdkCall:o=>o.apiKeys.remove(i.id)},n)});ye();function L(t,e){let r=parseInt(t,10);return(Number.isNaN(r)||r<1||r>100)&&h({message:"--limit must be an integer between 1 and 100",code:"invalid_limit"},{json:e.json}),r}function G(t,e,r,n){return e!==void 0&&r!==void 0&&h({message:"Cannot use --after and --before together. Pass only one cursor.",code:"invalid_pagination"},{json:n.json}),e!==void 0?{limit:t,after:e}:r!==void 0?{limit:t,before:r}:{limit:t}}function M(t,e,r){if(!t.has_more||t.data.length===0)return;let n=!!r.before,i=n?t.data[0].id:t.data[t.data.length-1].id,o=n?"--before":"--after",s=r.limit?` --limit ${r.limit}`:"",a=r.apiKey?` --api-key ${wt(r.apiKey)}`:"",l=r.profile?` --profile ${r.profile}`:"";console.log(`
|
|
209
208
|
Fetch the next page:
|
|
210
|
-
$ resend ${
|
|
211
|
-
Tokens are never included in list responses.`,errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend api-keys list","resend api-keys list --limit 25 --json","resend api-keys list --after <cursor> --json"]})).action(async(e
|
|
209
|
+
$ resend ${e} ${o} ${i}${s}${a}${l}`)}var Is=new p("list").alias("ls").description("List all API keys (IDs and names \u2014 tokens are never returned by this endpoint)").option("--limit <n>","Maximum number of API keys 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",f({output:` {"object":"list","has_more":false,"data":[{"id":"<id>","name":"<name>","created_at":"<date>","last_used_at":"<date>|null"}]}
|
|
210
|
+
Tokens are never included in list responses.`,errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend api-keys list","resend api-keys list --limit 25 --json","resend api-keys list --after <cursor> --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=L(t.limit,r),i=G(n,t.after,t.before,r);await P({loading:"Fetching API keys...",sdkCall:o=>o.apiKeys.list(i),onInteractive:o=>{console.log(Ts(o.data)),M(o,"api-keys list",{limit:n,before:t.before,apiKey:r.apiKey,profile:r.profile})}},r)});var Ps=new p("api-keys").description("Manage API keys for authentication").addHelpText("after",f({context:`Security notes:
|
|
212
211
|
- Tokens are only shown at creation time and cannot be retrieved again.
|
|
213
212
|
- Use sending_access keys with --domain-id for per-domain CI tokens.
|
|
214
|
-
- Deleting a key is immediate \u2014 any service using it loses access instantly.`,examples:["resend api-keys list",'resend api-keys create --name "Production"','resend api-keys create --name "CI Token" --permission sending_access --domain-id <domain-id>',"resend api-keys delete <id> --yes"]})).addCommand(
|
|
213
|
+
- Deleting a key is immediate \u2014 any service using it loses access instantly.`,examples:["resend api-keys list",'resend api-keys create --name "Production"','resend api-keys create --name "CI Token" --permission sending_access --domain-id <domain-id>',"resend api-keys delete <id> --yes"]})).addCommand(Ds).addCommand(Is,{isDefault:!0}).addCommand(Os);ye();z();function km(t){let e=we();if(t.json){B({profiles:e},{json:!0});return}if(e.length===0){console.log("No profiles configured. Run: resend login");return}w()&&console.log(`
|
|
215
214
|
Profiles
|
|
216
|
-
`);let r=!1;for(let
|
|
217
|
-
${
|
|
215
|
+
`);let r=!1;for(let n of e){let i=n.active?" (active)":"",o=se(n.name)!==void 0;o&&(r=!0),console.log(` ${n.active?"\u25B8":" "} ${n.name}${i}${o?" (invalid name)":""}`)}r&&w()&&console.log("\n Profiles with invalid names can be renamed via `resend auth rename`."),w()&&console.log("")}var js=new p("list").description("List all profiles").action((t,e)=>{km(e.optsWithGlobals())});var Rs=require("node:child_process"),lr=pe(et(),1),Ge="https://resend.com";function si(t){return new Promise(e=>{let r=process.platform==="win32"?"cmd.exe":process.platform==="darwin"?"open":"xdg-open",n=t.replaceAll('"',""),i=process.platform==="win32"?["/c","start",'""',`"${n}"`]:[t];(0,Rs.execFile)(r,i,{timeout:5e3,windowsVerbatimArguments:!0},o=>e(!o))})}async function Se(t,e){let r=await si(t);e?.json||e?.quiet||(r?console.log(lr.default.dim("Opened"),lr.default.blue(t)):console.warn(lr.default.yellow("Could not open browser. Visit this link:"),lr.default.blue(t)))}var de={emails:`${Ge}/emails`,logs:`${Ge}/logs`,log:t=>`${Ge}/logs/${t}`,templates:`${Ge}/templates`,template:t=>`${Ge}/templates/${t}`,broadcasts:`${Ge}/broadcasts`,broadcast:t=>`${Ge}/broadcasts/${t}`,documentation:`${Ge}/docs`,automations:`${Ge}/automations`,automation:t=>`${Ge}/automations/${t}/editor`,events:`${Ge}/automations/events`};ye();z();var ai="https://resend.com/api-keys?new=true",Wr=new p("login").description("Save a Resend API key").option("--key <key>","API key to store (required in non-interactive mode)").addHelpText("after",f({setup:!0,context:"Non-interactive: --key is required (no prompts will appear when stdin/stdout is not a TTY).",output:' {"success":true,"config_path":"<path>","profile":"<name>"}',errorCodes:["missing_key","invalid_key_format","validation_failed","invalid_profile_name","switch_failed","write_failed"],examples:["resend login --key re_123456789","resend login (interactive \u2014 prompts and opens browser)","RESEND_API_KEY=re_123 resend emails send ... (skip login; use env var directly)"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=typeof t.key=="string"?t.key.trim():t.key;if(!n){(!w()||r.json)&&h({message:"Missing --key flag. Provide your API key in non-interactive mode.",code:"missing_key"},{json:r.json}),fo("Resend Authentication"),Q.info(`Use a full access API key for complete CLI access.
|
|
216
|
+
${Tt}`);let c=await ie({message:"How would you like to get your API key?",options:[{value:"browser",label:"Open resend.com/api-keys in browser"},{value:"manual",label:"Enter API key manually"}]});k(c)&&S("Login cancelled."),c==="browser"&&(await si(ai)?Q.info(`Opened ${ai}`):Q.warn(`Could not open browser. Visit ${ai} manually.`));let u=await go({message:"Enter your Resend API key:",validate:m=>{if(!m)return"API key is required";if(!m.startsWith("re_"))return"API key must start with re_"}});k(u)&&S("Login cancelled."),n=u.trim()}(!n||!n.startsWith("re_"))&&h({message:"Invalid API key format. Key must start with re_",code:"invalid_key_format"},{json:r.json});let i=ae("Validating API key...",r.quiet),o="full_access";try{let c=new Dt(n),{error:u}=await c.domains.list();if(u){let m=u;if(m.name==="restricted_api_key")o="sending_access",i.warn("API key is valid (sending access only)");else{i.fail("API key validation failed"),h({message:m.message||"Failed to validate API key",code:"validation_failed"},{json:r.json});return}}else i.stop("API key is valid (full access)")}catch(c){i.fail("API key validation failed"),h({message:V(c,"Failed to validate API key"),code:"validation_failed"},{json:r.json})}let s=r.profile?.trim()||void 0;if(s){let c=se(s);if(c){h({message:c,code:"invalid_profile_name"},{json:r.json});return}}if(!s&&w()&&!r.json){let c=we();if(c.length>0){let u=[...c.map(y=>({value:y.name,label:`${y.name} (overwrite)`,hint:se(y.name)?"invalid name":void 0})),{value:"__new__",label:"+ Create new profile"}],m=await ie({message:"Save API key to which profile?",options:u});if(k(m)&&S("Login cancelled."),m==="__new__"){let y=await Y({message:"Enter a name for the new profile:",validate:b=>se((b??"").trim())});if(k(y)&&S("Login cancelled."),s=(y??"").trim()||"default",c.some(b=>b.name===s)){let b=await rt({message:`Profile '${s}' already exists. Overwrite?`});(k(b)||!b)&&S("Login cancelled.")}}else if(se(m)){let y=await qr(m,r);if(!y)return;s=y}else s=m}else s="default"}let{configPath:a,backend:l}=await ps(n,s,o),d=s||"default";if(s)try{Nr(d)}catch(c){h({message:V(c,"Failed to switch profile"),code:"switch_failed"},{json:r.json})}if(r.json)B({success:!0,config_path:a,profile:d,storage:l.name,permission:o},{json:!0});else{let c=l.isSecure?`in ${l.name}`:`at ${a}`,u=`API key stored for profile '${d}' ${c}`;if(w()?$r(u):console.log(u),!l.isSecure&&process.platform==="linux"){let m="Tip: Install libsecret-tools and a Secret Service provider (e.g. gnome-keyring) to store keys in secure storage instead of a plaintext file.";w()?Q.info(m):console.log(m)}}});var Fs=require("node:fs");ye();z();var Vr=new p("logout").description("Remove your saved Resend API key").addHelpText("after",f({setup:!0,context:`Removes the saved API key from secure storage and the credentials file.
|
|
218
217
|
|
|
219
218
|
When --profile is specified, only that profile's entry is removed.
|
|
220
219
|
When no profile is specified, all profiles are removed.
|
|
221
220
|
|
|
222
|
-
If no credentials file exists, exits cleanly with no error.`,output:' {"success":true,"config_path":"<path>"}',errorCodes:["remove_failed"],examples:["resend logout","resend logout --profile staging","resend logout --json"]})).action(async(e
|
|
221
|
+
If no credentials file exists, exits cleanly with no error.`,output:' {"success":true,"config_path":"<path>"}',errorCodes:["remove_failed"],examples:["resend logout","resend logout --profile staging","resend logout --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=yt(),i=ni();if(!i&&!(0,Fs.existsSync)(n)){!r.json&&w()?console.log("No saved credentials found. Nothing to remove."):B({success:!0,already_logged_out:!0},{json:r.json});return}let o=r.profile,s=!o,a=o??"all";if(!s&&i&&!i.profiles[a]&&h({message:`Profile "${a}" not found. Available profiles: ${Object.keys(i.profiles).join(", ")}`,code:"remove_failed"},{json:r.json}),!r.json&&w()){let l=s?"Remove all saved API keys?":`Remove saved API key for profile '${a}'?`,d=await rt({message:l});(k(d)||!d)&&S("Logout cancelled.")}try{s?await fs():await Hr(a)}catch(l){h({message:V(l,"Failed to remove credentials"),code:"remove_failed"},{json:r.json})}if(!r.json&&w()){let l=s?"Logged out. All API keys removed.":`Logged out. API key removed for profile '${a}'.`;$r(l)}else B({success:!0,config_path:n,profile:s?"all":a},{json:r.json})});ye();z();async function $m(t,e){let r=t;if(!r){if(!w()||e.json){h({message:"Missing profile name. Provide a profile name in non-interactive mode.",code:"missing_name"},{json:e.json});return}let n=we();if(n.length===0){h({message:"No profiles configured. Run `resend login` first.",code:"no_profiles"},{json:e.json});return}let i=await ie({message:"Remove which profile?",options:n.map(o=>({value:o.name,label:o.name,hint:o.active?"active":void 0}))});k(i)&&S("Remove cancelled."),r=i}if(!e.json&&w()){let n=await rt({message:`Remove profile '${r}' and its API key?`});(k(n)||!n)&&S("Remove cancelled.")}try{await Hr(r)}catch(n){h({message:V(n,"Failed to remove profile"),code:"remove_failed"},{json:e.json});return}e.json?B({success:!0,removed_profile:r},{json:!0}):console.log(`Profile '${r}' removed.`)}var Bs=new p("remove").description("Remove a profile").argument("[name]","Profile name to remove").action(async(t,e,r)=>{await $m(t,r.optsWithGlobals())});ye();z();async function Em(t,e,r){let n=t,i=e;if(!n){if(!w()||r.json){h({message:"Missing profile name. Provide old and new names in non-interactive mode.",code:"missing_name"},{json:r.json});return}let o=we();if(o.length===0){h({message:"No profiles configured. Run `resend login` first.",code:"no_profiles"},{json:r.json});return}let s=await ie({message:"Rename which profile?",options:o.map(a=>({value:a.name,label:a.name,hint:a.active?"active":se(a.name)?"invalid name":void 0}))});k(s)&&S("Rename cancelled."),n=s}if(!i){if(!w()||r.json){h({message:"Missing new name. Provide old and new names in non-interactive mode.",code:"missing_name"},{json:r.json});return}let o=await Y({message:`Enter new name for '${n}':`,placeholder:n.replace(/[^a-zA-Z0-9._-]/g,"-"),validate:s=>se(s)});k(o)&&S("Rename cancelled."),i=o}try{await Lr(n,i)}catch(o){h({message:V(o,"Failed to rename profile"),code:"rename_failed"},{json:r.json});return}r.json?B({success:!0,old_name:n,new_name:i},{json:!0}):console.log(`Profile '${n}' renamed to '${i}'.`)}var Ns=new p("rename").description("Rename a profile").argument("[old-name]","Current profile name").argument("[new-name]","New profile name").action(async(t,e,r,n)=>{await Em(t,e,n.optsWithGlobals())});ye();z();async function Dm(t,e){let r=t;if(!r){if(!w()||e.json){h({message:"Missing profile name. Provide a profile name in non-interactive mode.",code:"missing_name"},{json:e.json});return}let o=we();if(o.length===0){h({message:"No profiles configured. Run `resend login` first.",code:"no_profiles"},{json:e.json});return}let s=await ie({message:"Switch to which profile?",options:o.map(a=>({value:a.name,label:a.name,hint:a.active?"active":se(a.name)?"invalid name":void 0}))});k(s)&&S("Switch cancelled."),r=s}if(we().some(o=>o.name===r)){let o=await qr(r,e);if(!o)return;r=o}try{Nr(r)}catch(o){h({message:V(o,"Failed to switch profile"),code:"switch_failed"},{json:e.json});return}e.json?B({success:!0,active_profile:r},{json:!0}):console.log(`Switched to profile '${r}'.`)}var Hs=new p("switch").description("Switch the active profile").argument("[name]","Profile name to switch to").action(async(t,e,r)=>{await Dm(t,r.optsWithGlobals())});var Ls=new p("auth").description("Manage authentication and profiles").addHelpText("after",f({setup:!0,context:`Environment variables:
|
|
223
222
|
RESEND_API_KEY API key (overrides stored credentials)
|
|
224
223
|
RESEND_PROFILE Profile name (overrides config default)
|
|
225
|
-
RESEND_CREDENTIAL_STORE Storage method: "secure_storage" or "file"`,examples:["resend login","resend login --key re_123456789","resend logout","resend auth list","resend auth switch staging","resend auth rename staging production","resend auth remove staging"]})).addCommand(
|
|
224
|
+
RESEND_CREDENTIAL_STORE Storage method: "secure_storage" or "file"`,examples:["resend login","resend login --key re_123456789","resend logout","resend auth list","resend auth switch staging","resend auth rename staging production","resend auth remove staging"]})).addCommand(Wr).addCommand(Vr).addCommand(js,{isDefault:!0}).addCommand(Hs).addCommand(Ns).addCommand(Bs);var li=require("node:fs");function ce(t,e){if(t==="-"){process.stdin.isTTY&&h({message:"No input piped to stdin",code:"stdin_read_error"},{json:e.json});try{return(0,li.readFileSync)(0,"utf-8")}catch{h({message:"Failed to read from stdin",code:"stdin_read_error"},{json:e.json})}}try{return(0,li.readFileSync)(t,"utf-8")}catch{h({message:`Failed to read file: ${t}`,code:"file_read_error"},{json:e.json})}}function xt(t,e,r){if(t!==void 0)try{return JSON.parse(t)}catch(n){h({message:`Invalid JSON for ${e}: ${n instanceof Error?n.message:"parse error"}`,code:"invalid_json"},{json:r.json})}}var Gs=new p("create").description("Create a new automation").option("--name <name>","Automation name").addOption(new ee("--status <status>","Initial status").choices(["enabled","disabled"])).option("--steps <json>","Steps array as JSON string").option("--connections <json>","Connections array as JSON string").option("--file <path>",'Path to a JSON file containing the full automation payload (use "-" for stdin)').addHelpText("after",f({context:`Non-interactive: --name and --steps/--connections (or --file) are required.
|
|
226
225
|
|
|
227
226
|
Payload format:
|
|
228
227
|
--file accepts a JSON object with { name, status?, steps, connections }.
|
|
@@ -230,17 +229,17 @@ Payload format:
|
|
|
230
229
|
When using --file, --name/--status/--steps/--connections flags override file values.
|
|
231
230
|
|
|
232
231
|
Step types: trigger, delay, send_email, wait_for_event, condition
|
|
233
|
-
Connection types: default, condition_met, condition_not_met, timeout, event_received`,output:' {"object":"automation","id":"<id>"}',errorCodes:["auth_error","missing_name","missing_steps","missing_connections","invalid_json","file_read_error","create_error"],examples:["resend automations create --file automation.json","cat automation.json | resend automations create --file -","resend automations create --file automation.json --status disabled",`resend automations create --name "Welcome Flow" --steps '[...]' --connections '[...]'`]})).action(async(e
|
|
234
|
-
This cannot be undone.`,loading:"Deleting automation...",object:"automation",successMsg:"Automation deleted",sdkCall:o=>o.automations.remove(
|
|
232
|
+
Connection types: default, condition_met, condition_not_met, timeout, event_received`,output:' {"object":"automation","id":"<id>"}',errorCodes:["auth_error","missing_name","missing_steps","missing_connections","invalid_json","file_read_error","create_error"],examples:["resend automations create --file automation.json","cat automation.json | resend automations create --file -","resend automations create --file automation.json --status disabled",`resend automations create --name "Welcome Flow" --steps '[...]' --connections '[...]'`]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n={};if(t.file){let l=ce(t.file,r);try{n=JSON.parse(l)}catch(d){h({message:`Invalid JSON in --file: ${d instanceof Error?d.message:"parse error"}`,code:"invalid_json"},{json:r.json})}(typeof n!="object"||n===null||Array.isArray(n))&&h({message:"--file must contain a JSON object with automation properties (name, steps, connections).",code:"invalid_json"},{json:r.json})}let i=await q(t.name??n.name,{message:"Automation name",placeholder:"e.g. Welcome Flow"},{message:"Missing --name flag.",code:"missing_name"},r),o=xt(t.steps,"--steps",r)??n.steps;(!o||!Array.isArray(o)||o.length===0)&&h({message:"Missing or empty steps. Provide --steps as a JSON array or use --file.",code:"missing_steps"},{json:r.json});let s=xt(t.connections,"--connections",r)??n.connections;s||h({message:"Missing connections. Provide --connections as a JSON array or use --file (empty array is valid for single-step automations).",code:"missing_connections"},{json:r.json}),Array.isArray(s)||h({message:"--connections must be a JSON array.",code:"invalid_json"},{json:r.json});let a=t.status??n.status;await J({loading:"Creating automation...",sdkCall:l=>l.automations.create({name:i,steps:o,connections:s,...a&&{status:a}}),onInteractive:l=>{console.log(`Automation created: ${l.id}`)}},r)});function Ms(t){let e=t.map(r=>[r.name,ci(r.status),r.created_at,r.id]);return N(["Name","Status","Created","ID"],e,"(no automations)")}function ci(t){switch(t){case"enabled":return"\u2713 Enabled";case"disabled":return"\u25CB Disabled";default:return t}}var Ve={resource:"automation",resourcePlural:"automations",fetchItems:(t,{limit:e,after:r})=>t.automations.list({limit:e,...r&&{after:r}}),display:t=>({label:t.name,hint:t.id})};var qs=new p("delete").alias("rm").description("Delete an automation").argument("[id]","Automation ID").option("--yes","Skip confirmation prompt").addHelpText("after",f({context:"Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.",output:' {"object":"automation","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend automations delete <id> --yes","resend automations delete <id> --yes --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Ve,n);await re(i,!!e.yes,{confirmMessage:`Delete automation ${i}?
|
|
233
|
+
This cannot be undone.`,loading:"Deleting automation...",object:"automation",successMsg:"Automation deleted",sdkCall:o=>o.automations.remove(i)},n)});var Us=new p("get").description("Retrieve an automation with its steps and connections").argument("[id]","Automation ID").addHelpText("after",f({output:` Full automation object including steps and connections arrays.
|
|
235
234
|
|
|
236
|
-
Automation status values: enabled | disabled`,errorCodes:["auth_error","fetch_error"],examples:["resend automations get <id>","resend automations get <id> --json"]})).action(async(e,
|
|
237
|
-
Steps:`);let s=o.steps.map(a=>[a.key,a.type]);console.log(
|
|
238
|
-
Connections:`);let s=o.connections.map(a=>[a.from,a.to,a.type]);console.log(
|
|
235
|
+
Automation status values: enabled | disabled`,errorCodes:["auth_error","fetch_error"],examples:["resend automations get <id>","resend automations get <id> --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Ve,n);await H({loading:"Fetching automation...",sdkCall:o=>o.automations.get(i),onInteractive:o=>{if(console.log(`${o.name} \u2014 ${ci(o.status)}`),console.log(`ID: ${o.id}`),console.log(`Created: ${o.created_at}`),o.updated_at&&console.log(`Updated: ${o.updated_at}`),o.steps.length>0){console.log(`
|
|
236
|
+
Steps:`);let s=o.steps.map(a=>[a.key,a.type]);console.log(N(["Key","Type"],s,"(no steps)"))}if(o.connections.length>0){console.log(`
|
|
237
|
+
Connections:`);let s=o.connections.map(a=>[a.from,a.to,a.type]);console.log(N(["From","To","Type"],s,"(no connections)"))}}},n)});var Ws=new p("list").alias("ls").description("List all automations").option("--limit <n>","Maximum number of automations to return (1-100)","10").option("--after <cursor>","Return automations after this cursor (next page)").option("--before <cursor>","Return automations before this cursor (previous page)").addHelpText("after",f({output:' {"object":"list","data":[...],"has_more":true}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend automations list","resend automations list --limit 25 --json","resend automations list --after <cursor> --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=L(t.limit,r),i=G(n,t.after,t.before,r);await P({loading:"Fetching automations...",sdkCall:o=>o.automations.list(i),onInteractive:o=>{console.log(Ms(o.data)),M(o,"automations list",{limit:n,before:t.before,apiKey:r.apiKey,profile:r.profile})}},r)});var Vs=new p("open").description("Open an automation or the automations list in the Resend dashboard").argument("[id]","Automation ID \u2014 omit to open the automations list").addHelpText("after",f({context:`Opens the Resend dashboard in your default browser.
|
|
239
238
|
With an ID: opens that automation's editor.
|
|
240
|
-
Without an ID: opens the automations list.`,examples:["resend automations open","resend automations open 019d4ef1-8266-71d4-a1aa-60ce5d0eaea7"]})).action(async(e,
|
|
239
|
+
Without an ID: opens the automations list.`,examples:["resend automations open","resend automations open 019d4ef1-8266-71d4-a1aa-60ce5d0eaea7"]})).action(async(t,e,r)=>{let n=t?de.automation(t):de.automations,i=r.optsWithGlobals();await Se(n,i)});var Ks=new p("get").description("Retrieve details of a specific automation run").option("--automation-id <id>","Automation ID").option("--run-id <id>","Run ID").addHelpText("after",f({output:" Full automation run object with status, trigger, and timestamps.",errorCodes:["auth_error","missing_automation_id","missing_run_id","fetch_error"],examples:["resend automations runs get --automation-id <id> --run-id <id>","resend automations runs get --automation-id <id> --run-id <id> --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=await q(t.automationId,{message:"Automation ID"},{message:"Missing --automation-id flag.",code:"missing_automation_id"},r),i=await q(t.runId,{message:"Run ID"},{message:"Missing --run-id flag.",code:"missing_run_id"},r);await H({loading:"Fetching automation run...",sdkCall:o=>o.automations.runs.get({automationId:n,runId:i}),onInteractive:o=>{console.log(`Run: ${o.id}`),console.log(`Status: ${o.status}`),o.started_at&&console.log(`Started: ${o.started_at}`),o.completed_at&&console.log(`Completed: ${o.completed_at}`),console.log(`Created: ${o.created_at}`)}},r)});var zs=new p("list").alias("ls").description("List runs for an automation").argument("[automation-id]","Automation ID").option("--status <status>","Filter by status (running, completed, failed, cancelled). Comma-separated.").option("--limit <n>","Maximum number of runs to return (1-100)","10").option("--after <cursor>","Return runs after this cursor (next page)").option("--before <cursor>","Return runs before this cursor (previous page)").addHelpText("after",f({output:' {"object":"list","data":[...],"has_more":true}',errorCodes:["auth_error","missing_id","invalid_limit","list_error"],examples:["resend automations runs <automation-id>","resend automations runs list <automation-id>","resend automations runs list <automation-id> --status running","resend automations runs list <automation-id> --limit 25 --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Ve,n),o=L(e.limit,n),s=G(o,e.after,e.before,n);await P({loading:"Fetching automation runs...",sdkCall:a=>a.automations.runs.list({automationId:i,...s,...e.status?{status:e.status}:{}}),onInteractive:a=>{let l=a.data.map(d=>[d.id,d.status,d.started_at??"-",d.completed_at??"-"]);console.log(N(["ID","Status","Started","Completed"],l,"(no runs)")),M(a,`automations runs list ${i}`,{limit:o,before:e.before,apiKey:n.apiKey,profile:n.profile})}},n)});var Js=new p("runs").description("Manage automation runs").addHelpText("after",f({context:`Runs represent individual executions of an automation.
|
|
241
240
|
Each run is triggered by an event and progresses through the automation's steps.
|
|
242
241
|
|
|
243
|
-
Run status values: running | completed | failed | cancelled`,examples:["resend automations runs <automation-id>","resend automations runs list <automation-id> --limit 25","resend automations runs get --automation-id <id> --run-id <id>"]})).addCommand(
|
|
242
|
+
Run status values: running | completed | failed | cancelled`,examples:["resend automations runs <automation-id>","resend automations runs list <automation-id> --limit 25","resend automations runs get --automation-id <id> --run-id <id>"]})).addCommand(zs,{isDefault:!0}).addCommand(Ks);var Ys=new p("stop").description("Stop a running automation").argument("[id]","Automation ID").addHelpText("after",f({context:"Stops a running automation by setting its status to disabled and cancelling active runs.",output:' {"object":"automation","id":"<id>","status":"disabled"}',errorCodes:["auth_error","stop_error"],examples:["resend automations stop <id>","resend automations stop <id> --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Ve,n);await R({loading:"Stopping automation...",sdkCall:o=>o.automations.stop(i),errorCode:"stop_error",successMsg:"Automation stopped"},n)});var Qs=new p("update").description("Update an automation status (enable or disable)").argument("[id]","Automation ID").addOption(new ee("--status <status>","New status").choices(["enabled","disabled"])).addHelpText("after",f({output:' {"object":"automation","id":"<id>","status":"<status>"}',errorCodes:["auth_error","missing_status","update_error"],examples:["resend automations update <id> --status enabled","resend automations update <id> --status disabled --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Ve,n),o=await Pt(e.status,{message:"Status",options:[{value:"enabled",label:"Enabled"},{value:"disabled",label:"Disabled"}]},{message:"Missing --status flag.",code:"missing_status"},n);await R({loading:"Updating automation...",sdkCall:s=>s.automations.update(i,{status:o}),errorCode:"update_error",successMsg:`Automation updated: ${i} (${o})`},n)});var Xs=new p("automations").description("Manage automations").addHelpText("after",f({context:`Automations are event-driven workflows composed of steps and connections.
|
|
244
243
|
|
|
245
244
|
Steps define the actions (trigger, delay, send_email, wait_for_event, condition).
|
|
246
245
|
Connections define the flow between steps (default, condition_met, condition_not_met, timeout, event_received).
|
|
@@ -250,10 +249,10 @@ Lifecycle:
|
|
|
250
249
|
2. resend automations update <id> --status enabled
|
|
251
250
|
3. resend automations stop <id> (stop automation)
|
|
252
251
|
4. resend automations runs <id> (inspect runs)
|
|
253
|
-
5. 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 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(
|
|
252
|
+
5. 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 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(Gs).addCommand(Us).addCommand(Ws,{isDefault:!0}).addCommand(Qs).addCommand(qs).addCommand(Ys).addCommand(Vs).addCommand(Js);async function Kr(t){try{let{data:e,error:r}=await t.domains.list();return r||!e?[]:e.data.filter(n=>n.status==="verified"&&n.capabilities.sending==="enabled").map(n=>n.name)}catch{return[]}}var Sm=["noreply","hello"];async function zr(t){let e;if(t.length===1)e=t[0];else{let i=await ie({message:"Select a verified domain",options:t.map(o=>({value:o,label:o}))});k(i)&&S("Send cancelled."),e=i}let r=Sm.map(i=>({value:`${i}@${e}`,label:`${i}@${e}`}));r.push({value:null,label:"Custom address..."});let n=await ie({message:`From address (@${e})`,options:r});if(k(n)&&S("Send cancelled."),n===null){let i=await Y({message:"From address",placeholder:`e.g. you@${e}`,validate:o=>!o||!o.includes("@")?"Enter a valid email address":void 0});return k(i)&&S("Send cancelled."),i}return n}var Ft=require("node:fs"),la=require("node:path");var Jr=require("node:fs"),ia=require("node:os"),Rt=pe(require("node:path"),1);function Zs(){return"pkg"in process?require("esbuild-wasm"):require("esbuild")}var ta=require("node:fs"),ra=pe(require("node:path"),1);function ea(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var na=t=>({name:"rendering-utilities-exporter",setup:e=>{e.onLoad({filter:new RegExp(t.map(r=>ea(r)).join("|"))},async({path:r})=>({contents:`${await ta.promises.readFile(r,"utf8")};
|
|
254
253
|
export { render } from 'react-email-module-that-will-export-render'
|
|
255
254
|
export { createElement as reactEmailCreateReactElement } from 'react';
|
|
256
|
-
`,loader:
|
|
255
|
+
`,loader:ra.default.extname(r).slice(1)})),e.onResolve({filter:/^react-email-module-that-will-export-render$/},async r=>{let n={kind:"import-statement",importer:r.importer,resolveDir:r.resolveDir,namespace:r.namespace},i=await e.resolve("react-email",n);return i.errors.length===0||(i=await e.resolve("@react-email/components",n),i.errors.length===0)||(i=await e.resolve("@react-email/render",n),i.errors.length>0&&i.errors[0]&&(i.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.")),i})}});async function oa(t){let e=Rt.default.resolve(t),r=(0,Jr.mkdtempSync)(Rt.default.join((0,ia.tmpdir)(),"resend-react-email-"));try{let{build:o}=Zs();await o({bundle:!0,entryPoints:[e],format:"cjs",jsx:"automatic",logLevel:"silent",outExtension:{".js":".cjs"},outdir:r,platform:"node",plugins:[na([e])],write:!0})}catch(o){throw(0,Jr.rmSync)(r,{recursive:!0,force:!0}),o}let n=Rt.default.basename(e,Rt.default.extname(e));return{cjsPath:Rt.default.join(r,`${n}.cjs`),tmpDir:r}}var sa=require("node:module");async function aa(t){let e=(0,sa.createRequire)(t);delete e.cache[t];let r=e(t);return r.render(r.reactEmailCreateReactElement(r.default,{}),{})}var ui=t=>{t&&(0,Ft.rmSync)(t,{recursive:!0,force:!0})},Ne=async(t,e)=>{if(t.trim()==="")return h({message:"--react-email path cannot be empty",code:"react_email_build_error"},{json:e.json});let r=(0,la.resolve)(t);if(!(0,Ft.existsSync)(r))return h({message:`File not found: ${t}`,code:"react_email_build_error"},{json:e.json});if(!(0,Ft.statSync)(r).isFile())return h({message:`--react-email path must be a file, got a directory: ${t}`,code:"react_email_build_error"},{json:e.json});let n=ae("Bundling React Email template...",e.quiet),i;try{let o=await oa(t);i=o.tmpDir,n.stop("Bundled React Email template");let s=ae("Rendering React Email template...",e.quiet);try{let a=await aa(o.cjsPath);return s.stop("Rendered React Email template"),ui(i),a}catch(a){return s.fail("Failed to render React Email template"),ui(i),h({message:V(a,"Failed to render React Email template"),code:"react_email_render_error"},{json:e.json})}}catch(o){return n.fail("Failed to bundle React Email template"),ui(i),h({message:V(o,"Failed to bundle React Email template"),code:"react_email_build_error"},{json:e.json})}};z();var He={resource:"segment",resourcePlural:"segments",fetchItems:(t,{limit:e,after:r})=>t.segments.list({limit:e,...r&&{after:r}}),display:t=>({label:t.name,hint:t.id})};function Yr(t){let e=t.map(r=>[r.name,r.id,r.created_at]);return N(["Name","ID","Created"],e,"(no segments)")}var ct={resource:"topic",resourcePlural:"topics",fetchItems:t=>t.topics.list().then(e=>({...e,data:e.data?{data:e.data.data,has_more:!1}:null})),display:t=>({label:t.name,hint:t.id})};function ca(t){let e=t.map(r=>[r.name,r.description??"",r.id,r.created_at]);return N(["Name","Description","ID","Created"],e,"(no topics)")}var ua=new p("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",f({context:`Non-interactive: --from, --subject, and --segment-id are required.
|
|
257
256
|
Body: provide at least one of --html, --html-file, --text, --text-file, or --react-email.
|
|
258
257
|
|
|
259
258
|
Use --dry-run to print the request JSON without creating a broadcast.
|
|
@@ -265,26 +264,26 @@ Variable interpolation:
|
|
|
265
264
|
Scheduling:
|
|
266
265
|
Use --scheduled-at with --send to schedule delivery.
|
|
267
266
|
Accepts ISO 8601 (e.g. 2026-08-05T11:52:01Z) or natural language (e.g. "in 1 hour").
|
|
268
|
-
--scheduled-at without --send is ignored.`,output:' {"id":"<broadcast-id>"}',errorCodes:["auth_error","missing_from","missing_subject","missing_segment","missing_body","file_read_error","invalid_options","stdin_read_error","react_email_build_error","react_email_render_error","create_error"],examples:['resend broadcasts create --from onboarding@resend.com --subject "Weekly Update" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html "<p>Hello {{{FIRST_NAME|there}}}</p>"','resend broadcasts create --from onboarding@resend.com --subject "Launch" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html-file ./email.html --send','resend broadcasts create --from onboarding@resend.com --subject "Launch" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --text "Hello!" --send --scheduled-at "tomorrow at 9am ET"']})).action(async(e
|
|
267
|
+
--scheduled-at without --send is ignored.`,output:' {"id":"<broadcast-id>"}',errorCodes:["auth_error","missing_from","missing_subject","missing_segment","missing_body","file_read_error","invalid_options","stdin_read_error","react_email_build_error","react_email_render_error","create_error"],examples:['resend broadcasts create --from onboarding@resend.com --subject "Weekly Update" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html "<p>Hello {{{FIRST_NAME|there}}}</p>"','resend broadcasts create --from onboarding@resend.com --subject "Launch" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html-file ./email.html --send','resend broadcasts create --from onboarding@resend.com --subject "Launch" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --text "Hello!" --send --scheduled-at "tomorrow at 9am ET"']})).action(async(t,e)=>{let r=e.optsWithGlobals();t.htmlFile==="-"&&t.textFile==="-"&&h({message:"Cannot read both --html-file and --text-file from stdin. Pipe to one and pass the other as a file path.",code:"invalid_options"},{json:r.json}),t.reactEmail&&(t.html||t.htmlFile)&&h({message:"Cannot use --react-email with --html or --html-file",code:"invalid_options"},{json:r.json}),t.html!==void 0&&t.htmlFile!==void 0&&h({message:"--html and --html-file are mutually exclusive.",code:"invalid_options"},{json:r.json}),t.text!==void 0&&t.textFile!==void 0&&h({message:"--text and --text-file are mutually exclusive.",code:"invalid_options"},{json:r.json});let n=t.from,i=t.subject,o=t.segmentId;if(!n&&w()&&!r.json&&!t.dryRun){let c=await X(r),u=await Kr(c);u.length>0&&(n=await zr(u))}if(!n){(!w()||r.json)&&h({message:"Missing --from flag.",code:"missing_from"},{json:r.json});let c=await Y({message:"From address",placeholder:"e.g. onboarding@resend.com",validate:u=>u?void 0:"Required"});k(c)&&S("Cancelled."),n=c}if(!i){(!w()||r.json)&&h({message:"Missing --subject flag.",code:"missing_subject"},{json:r.json});let c=await Y({message:"Subject",placeholder:"e.g. Weekly Newsletter",validate:u=>u?void 0:"Required"});k(c)&&S("Cancelled."),i=c}if(!o)if((!w()||r.json)&&h({message:"Missing --segment-id flag.",code:"missing_segment"},{json:r.json}),t.dryRun){let c=await Y({message:"Segment ID",placeholder:"e.g. 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d",validate:u=>u?void 0:"Required"});k(c)&&S("Cancelled."),o=c}else o=await C(void 0,He,r);let s=t.reactEmail?await Ne(t.reactEmail,r):t.htmlFile?ce(t.htmlFile,r):t.html,a=t.textFile?ce(t.textFile,r):t.text;if(!s&&!a){(!w()||r.json)&&h({message:"Missing body. Provide --html, --html-file, --text, --text-file, or --react-email.",code:"missing_body"},{json:r.json});let c=await Y({message:"Body (plain text)",placeholder:"e.g. Hello {{{FIRST_NAME|there}}}!",validate:u=>u?void 0:"Required"});k(c)&&S("Cancelled."),a=c}let l=t.topicId;if(!l&&w()&&!r.json)if(t.dryRun){let c=await Y({message:"Topic ID (optional)",placeholder:"Press Enter to skip"});k(c)&&S("Cancelled."),l=c.trim()||void 0}else l=await C(void 0,ct,r,{optional:!0});let d={from:n,subject:i,segmentId:o,...s&&{html:s},...a&&{text:a},...t.name&&{name:t.name},...t.replyTo&&{replyTo:t.replyTo},...t.previewText&&{previewText:t.previewText},...l&&{topicId:l},...t.send&&{send:!0},...t.send&&t.scheduledAt&&{scheduledAt:t.scheduledAt}};if(t.dryRun){B({dryRun:!0,request:d},{json:r.json});return}await J({loading:"Creating broadcast...",sdkCall:c=>c.broadcasts.create(d),onInteractive:c=>{t.send?t.scheduledAt?console.log(`Broadcast scheduled: ${c.id}`):console.log(`Broadcast sent: ${c.id}`):(console.log(`Broadcast created: ${c.id}`),console.log("Status: draft"),console.log(`Send it with: resend broadcasts send ${c.id}`))}},r)});function di(t){switch(t){case"draft":return"\u25CB Draft";case"queued":return"\u23F3 Queued";case"sent":return"\u2713 Sent";default:return t}}var Bt={resource:"broadcast",resourcePlural:"broadcasts",fetchItems:(t,{limit:e,after:r})=>t.broadcasts.list({limit:e,...r&&{after:r}}),display:t=>({label:t.name??"(untitled)",hint:t.id})},da={resource:"broadcast",resourcePlural:"broadcasts",fetchItems:(t,{limit:e,after:r})=>t.broadcasts.list({limit:e,...r&&{after:r}}),display:t=>({label:t.name??"(untitled)",hint:`${di(t.status)} ${t.id}`}),filter:t=>t.status==="draft"};function ma(t){let e=t.map(r=>[r.name??"(untitled)",r.status,r.created_at,r.id]);return N(["Name","Status","Created","ID"],e,"(no broadcasts)")}var pa=new p("delete").alias("rm").description("Delete a broadcast \u2014 draft broadcasts are removed; scheduled broadcasts are cancelled before delivery").argument("[id]","Broadcast ID").option("--yes","Skip confirmation prompt").addHelpText("after",f({context:`Warning: Deleting a scheduled broadcast cancels its delivery immediately.
|
|
269
268
|
Only draft and scheduled broadcasts can be deleted; sent broadcasts cannot.
|
|
270
269
|
|
|
271
|
-
Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"broadcast","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend broadcasts delete d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --yes","resend broadcasts delete d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --yes --json"]})).action(async(e,
|
|
272
|
-
ID: ${
|
|
273
|
-
If scheduled, delivery will be cancelled.`,loading:"Deleting broadcast...",object:"broadcast",successMsg:"Broadcast deleted",sdkCall:o=>o.broadcasts.remove(
|
|
274
|
-
Use this command to retrieve the full broadcast payload.`,output:' {"id":"...","object":"broadcast","name":"...","segment_id":"...","from":"...","subject":"...","status":"draft|queued|sent","created_at":"...","scheduled_at":null,"sent_at":null}',errorCodes:["auth_error","fetch_error"],examples:["resend broadcasts get d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6","resend broadcasts get d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --json"]})).action(async(e,
|
|
275
|
-
To retrieve full details (html, from, subject), use: resend broadcasts get <id>`,output:' {"object":"list","has_more":false,"data":[{"id":"...","name":"...","status":"draft|queued|sent","created_at":"..."}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend broadcasts list","resend broadcasts list --limit 5","resend broadcasts list --after d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --limit 10","resend broadcasts list --json"]})).action(async(e
|
|
270
|
+
Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"broadcast","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend broadcasts delete d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --yes","resend broadcasts delete d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --yes --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await le(t,Bt,n);await re(i.id,!!e.yes,{confirmMessage:`Delete broadcast "${i.label}"?
|
|
271
|
+
ID: ${i.id}
|
|
272
|
+
If scheduled, delivery will be cancelled.`,loading:"Deleting broadcast...",object:"broadcast",successMsg:"Broadcast deleted",sdkCall:o=>o.broadcasts.remove(i.id)},n)});var fa=new p("get").description("Retrieve full details for a broadcast including HTML body, status, and delivery times").argument("[id]","Broadcast ID").addHelpText("after",f({context:`Note: The list command returns summary objects without html/text/from/subject.
|
|
273
|
+
Use this command to retrieve the full broadcast payload.`,output:' {"id":"...","object":"broadcast","name":"...","segment_id":"...","from":"...","subject":"...","status":"draft|queued|sent","created_at":"...","scheduled_at":null,"sent_at":null}',errorCodes:["auth_error","fetch_error"],examples:["resend broadcasts get d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6","resend broadcasts get d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Bt,n);await H({loading:"Fetching broadcast...",sdkCall:o=>o.broadcasts.get(i),onInteractive:o=>{console.log(`Broadcast: ${o.id}`),console.log(` Status: ${di(o.status)}`),console.log(` Name: ${o.name??"(untitled)"}`),console.log(` From: ${o.from??"\u2014"}`),console.log(` Subject: ${o.subject??"\u2014"}`),console.log(` Segment: ${o.segment_id??"\u2014"}`),o.preview_text&&console.log(` Preview: ${o.preview_text}`),o.topic_id&&console.log(` Topic: ${o.topic_id}`),console.log(` Created: ${o.created_at}`),o.scheduled_at&&console.log(` Scheduled: ${o.scheduled_at}`),o.sent_at&&console.log(` Sent: ${o.sent_at}`)}},n)});var ha=new p("list").alias("ls").description('List broadcasts \u2014 returns summary objects (use "get <id>" for full details including html/text)').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",f({context:`Note: List results include name, status, created_at, and id only.
|
|
274
|
+
To retrieve full details (html, from, subject), use: resend broadcasts get <id>`,output:' {"object":"list","has_more":false,"data":[{"id":"...","name":"...","status":"draft|queued|sent","created_at":"..."}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend broadcasts list","resend broadcasts list --limit 5","resend broadcasts list --after d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --limit 10","resend broadcasts list --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=L(t.limit,r),i=G(n,t.after,t.before,r);await P({loading:"Fetching broadcasts...",sdkCall:o=>o.broadcasts.list(i),onInteractive:o=>{console.log(ma(o.data)),M(o,"broadcasts list",{limit:n,before:t.before,apiKey:r.apiKey,profile:r.profile})}},r)});var ga=new p("open").description("Open a broadcast or the broadcasts list in the Resend dashboard").argument("[id]","Broadcast ID \u2014 omit to open the broadcasts list").addHelpText("after",f({context:`Opens the Resend dashboard in your default browser.
|
|
276
275
|
With an ID: opens that broadcast's page for viewing or editing.
|
|
277
|
-
Without an ID: opens the broadcasts list.`,examples:["resend broadcasts open","resend broadcasts open d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6"]})).action(async(e,
|
|
276
|
+
Without an ID: opens the broadcasts list.`,examples:["resend broadcasts open","resend broadcasts open d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6"]})).action(async(t,e,r)=>{let n=t?de.broadcast(t):de.broadcasts,i=r.optsWithGlobals();await Se(n,i)});var ba=new p("send").description("Send a draft broadcast (API-created drafts only \u2014 dashboard broadcasts cannot be sent via API)").argument("[id]","Broadcast ID").option("--scheduled-at <datetime>",'Schedule delivery \u2014 ISO 8601 or natural language e.g. "in 1 hour", "tomorrow at 9am ET"').addHelpText("after",f({context:`Note: Only broadcasts created via the API can be sent via this command.
|
|
278
277
|
Broadcasts created in the Resend dashboard cannot be sent programmatically.
|
|
279
278
|
|
|
280
279
|
Scheduling:
|
|
281
280
|
--scheduled-at accepts ISO 8601 (e.g. 2026-08-05T11:52:01Z) or
|
|
282
|
-
natural language (e.g. "in 1 hour", "tomorrow at 9am ET").`,output:' {"id":"<broadcast-id>"}',errorCodes:["auth_error","send_error"],examples:["resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6",'resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --scheduled-at "in 1 hour"','resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --scheduled-at "2026-08-05T11:52:01Z" --json']})).action(async(e,
|
|
281
|
+
natural language (e.g. "in 1 hour", "tomorrow at 9am ET").`,output:' {"id":"<broadcast-id>"}',errorCodes:["auth_error","send_error"],examples:["resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6",'resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --scheduled-at "in 1 hour"','resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --scheduled-at "2026-08-05T11:52:01Z" --json']})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,da,n);await R({loading:e.scheduledAt?"Scheduling broadcast...":"Sending broadcast...",sdkCall:o=>o.broadcasts.send(i,{...e.scheduledAt&&{scheduledAt:e.scheduledAt}}),errorCode:"send_error",successMsg:e.scheduledAt?"Broadcast scheduled":"Broadcast sent",permission:"sending_access"},n)});var ya=new p("update").description("Update a draft broadcast \u2014 only drafts can be updated; sent broadcasts are immutable").argument("[id]","Broadcast ID").option("--from <address>","Update sender address").option("--subject <subject>","Update subject").option("--html <html>","Update HTML body (supports {{{FIRST_NAME|fallback}}} variable interpolation)").option("--html-file <path>",'Path to an HTML file to replace the body (use "-" for stdin, supports {{{FIRST_NAME|fallback}}} variable interpolation)').option("--text <text>","Update plain-text body").option("--text-file <path>",'Path to a plain-text file to replace 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>","Update internal label").addHelpText("after",f({context:`Note: Only draft broadcasts can be updated.
|
|
283
282
|
If the broadcast is already sent or sending, the API will return an error.
|
|
284
283
|
|
|
285
284
|
Variable interpolation:
|
|
286
285
|
HTML bodies support triple-brace syntax for contact properties.
|
|
287
|
-
Example: {{{FIRST_NAME|Friend}}} \u2014 uses FIRST_NAME or falls back to "Friend".`,output:' {"id":"<broadcast-id>"}',errorCodes:["auth_error","no_changes","file_read_error","invalid_options","stdin_read_error","react_email_build_error","react_email_render_error","update_error"],examples:['resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --subject "Updated Subject"',"resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --html-file ./new-email.html",'resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --name "Q1 Newsletter" --from "onboarding@resend.com" --json','echo "<p>New content</p>" | resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --html-file -']})).action(async(e,
|
|
286
|
+
Example: {{{FIRST_NAME|Friend}}} \u2014 uses FIRST_NAME or falls back to "Friend".`,output:' {"id":"<broadcast-id>"}',errorCodes:["auth_error","no_changes","file_read_error","invalid_options","stdin_read_error","react_email_build_error","react_email_render_error","update_error"],examples:['resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --subject "Updated Subject"',"resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --html-file ./new-email.html",'resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --name "Q1 Newsletter" --from "onboarding@resend.com" --json','echo "<p>New content</p>" | resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --html-file -']})).action(async(t,e,r)=>{let n=r.optsWithGlobals();e.from==null&&e.subject==null&&e.html==null&&e.htmlFile==null&&e.text==null&&e.textFile==null&&e.reactEmail==null&&e.name==null&&h({message:"Provide at least one option to update: --from, --subject, --html, --html-file, --text, --text-file, --react-email, or --name.",code:"no_changes"},{json:n.json}),e.htmlFile==="-"&&e.textFile==="-"&&h({message:"Cannot read both --html-file and --text-file from stdin. Pipe to one and pass the other as a file path.",code:"invalid_options"},{json:n.json}),e.reactEmail!=null&&(e.html!=null||e.htmlFile!=null)&&h({message:"Cannot use --react-email with --html or --html-file",code:"invalid_options"},{json:n.json}),e.html!=null&&e.htmlFile!=null&&h({message:"--html and --html-file are mutually exclusive.",code:"invalid_options"},{json:n.json}),e.text!=null&&e.textFile!=null&&h({message:"--text and --text-file are mutually exclusive.",code:"invalid_options"},{json:n.json});let i=await C(t,Bt,n),o=e.reactEmail!=null?await Ne(e.reactEmail,n):e.htmlFile!=null?ce(e.htmlFile,n):e.html,s=e.textFile!=null?ce(e.textFile,n):e.text;await R({loading:"Updating broadcast...",sdkCall:a=>a.broadcasts.update(i,{...e.from!=null&&{from:e.from},...e.subject!=null&&{subject:e.subject},...o!=null&&{html:o},...s!=null&&{text:s},...e.name!=null&&{name:e.name}}),errorCode:"update_error",successMsg:`Broadcast updated: ${i}`},n)});var va=new p("broadcasts").description("Manage broadcasts").addHelpText("after",f({context:`Lifecycle:
|
|
288
287
|
Broadcasts follow a draft \u2192 send flow:
|
|
289
288
|
1. create \u2014 creates a draft (or sends immediately with --send)
|
|
290
289
|
2. send \u2014 sends an API-created draft (dashboard broadcasts cannot be sent via API)
|
|
@@ -295,25 +294,25 @@ Template variables:
|
|
|
295
294
|
Example: {{{FIRST_NAME|Friend}}} \u2014 uses FIRST_NAME or falls back to "Friend".
|
|
296
295
|
|
|
297
296
|
Scheduling:
|
|
298
|
-
--scheduled-at accepts ISO 8601 or natural language e.g. "in 1 hour", "tomorrow at 9am ET".`,examples:["resend broadcasts list",'resend broadcasts create --from onboarding@resend.com --subject "Launch" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html "<p>Hi {{{FIRST_NAME|there}}}</p>"',"resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6",'resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --scheduled-at "in 1 hour"',"resend broadcasts get d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6",'resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --subject "Updated Subject"',"resend broadcasts delete d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --yes","resend broadcasts open","resend broadcasts open d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6"]})).addCommand(
|
|
299
|
-
`)}function
|
|
300
|
-
`)}function
|
|
301
|
-
`)}function
|
|
302
|
-
`)}var
|
|
303
|
-
In machine mode (piped, CI, or --json), the tree is JSON you can feed to agents or scripts.`,examples:["resend commands","resend commands --json",'resend commands | jq ".subcommands[].name"']})).action((e
|
|
304
|
-
`),process.exit(1));let r=await
|
|
305
|
-
`),
|
|
297
|
+
--scheduled-at accepts ISO 8601 or natural language e.g. "in 1 hour", "tomorrow at 9am ET".`,examples:["resend broadcasts list",'resend broadcasts create --from onboarding@resend.com --subject "Launch" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html "<p>Hi {{{FIRST_NAME|there}}}</p>"',"resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6",'resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --scheduled-at "in 1 hour"',"resend broadcasts get d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6",'resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --subject "Updated Subject"',"resend broadcasts delete d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --yes","resend broadcasts open","resend broadcasts open d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6"]})).addCommand(ua).addCommand(ga).addCommand(ba).addCommand(fa).addCommand(ha,{isDefault:!0}).addCommand(ya).addCommand(pa);function cr(t){let e=[];for(let n of t.commands)n._hidden||e.push(cr(n));let r=[];for(let n of t.options)n.hidden||r.push({long:n.long,short:n.short,description:n.description,takesValue:n.required||n.optional,choices:n.argChoices});return{name:t.name(),aliases:t.aliases(),description:t.description(),subcommands:e,options:r}}function ur(t,e,r){let n=e?`${e} ${t.name}`:t.name,i=[],o=[];for(let a of t.subcommands){o.push({name:a.name,description:a.description});for(let l of a.aliases)o.push({name:l,description:a.description})}let s=[...t.options,...r];i.push({path:n,subcommands:o,options:s});for(let a of t.subcommands)i.push(...ur(a,n,r));return i}function mi(t){let e=new Set;function r(n){for(let i of n.options)i.takesValue&&(i.long&&e.add(i.long),i.short&&e.add(i.short));for(let i of n.subcommands)r(i)}return r(t),[...e]}function wa(t){let e=ur(t,"",[]),r=[],n=t.name;r.push(`# bash completion for ${n}`),r.push(`# Generated by: ${n} completion bash`),r.push(""),r.push(`_${n}_completions() {`),r.push(" local cur prev words cword"),r.push(" if type _init_completion &>/dev/null; then _init_completion || return; else"),r.push(' cur="${COMP_WORDS[COMP_CWORD]}"'),r.push(' prev="${COMP_WORDS[COMP_CWORD-1]}"'),r.push(' words=("${COMP_WORDS[@]}")'),r.push(" cword=$COMP_CWORD"),r.push(" fi"),r.push("");let o=mi(t).join("|");r.push(' local cmd_path=""'),r.push(" local i=1"),r.push(" while [ $i -lt $cword ]; do"),r.push(' case "${words[$i]}" in'),o&&r.push(` ${o}) i=$((i + 1)) ;;`),r.push(" -*) ;;"),r.push(' *) cmd_path="${cmd_path:+$cmd_path }${words[$i]}" ;;'),r.push(" esac"),r.push(" i=$((i + 1))"),r.push(" done"),r.push(""),r.push(' case "$cmd_path" in');for(let s of e){let a=s.path===t.name?"":s.path.replace(`${t.name} `,""),l=s.options.filter(b=>b.choices&&b.long),d=s.options.map(b=>b.long).filter(Boolean).join(" "),c=s.subcommands.map(b=>b.name).join(" "),u=l.length>0,m=d.length>0,y=c.length>0;if(!u&&!m&&!y)continue;r.push(` "${a}")`);let g=s.options.filter(b=>b.takesValue&&!b.choices);if(u||g.length>0){r.push(' case "$prev" in');for(let b of l)r.push(` ${b.long}) COMPREPLY=($(compgen -W "${b.choices?.join(" ")}" -- "$cur")); return ;;`);if(g.length>0){let b=g.flatMap(_=>[_.long,_.short].filter(Boolean)).join("|");r.push(` ${b}) return ;;`)}r.push(" esac")}m&&(r.push(' if [[ "$cur" == -* ]]; then'),r.push(` COMPREPLY=($(compgen -W "${d}" -- "$cur")); return`),r.push(" fi")),y&&r.push(` COMPREPLY=($(compgen -W "${c}" -- "$cur"))`),r.push(" ;;")}return r.push(" esac"),r.push("}"),r.push(""),r.push(`complete -o default -F _${n}_completions ${n}`),r.join(`
|
|
298
|
+
`)}function _a(t){let e=ur(t,"",[]),r=[],n=t.name;r.push(`#compdef ${n}`),r.push(`# zsh completion for ${n}`),r.push(`# Generated by: ${n} completion zsh`),r.push(""),r.push(`_${n}() {`),r.push(" local cur prev cmd_path"),r.push(' cur="${words[$CURRENT]}"'),r.push(' prev="${words[$CURRENT-1]}"'),r.push("");let o=mi(t).join("|");r.push(' cmd_path=""'),r.push(" for ((i=2; i < CURRENT; i++)); do"),r.push(' case "${words[$i]}" in'),o&&r.push(` ${o}) ((i++)) ;;`),r.push(" -*) ;;"),r.push(' *) cmd_path="${cmd_path:+$cmd_path }${words[$i]}" ;;'),r.push(" esac"),r.push(" done"),r.push(""),r.push(' case "$cmd_path" in');for(let s of e){let a=s.path===t.name?"":s.path.replace(`${t.name} `,""),l=s.options.filter(m=>m.choices&&m.long),d=s.options.filter(m=>m.long),c=s.subcommands.length>0;r.push(` "${a}")`);let u=s.options.filter(m=>m.takesValue&&!m.choices);if(l.length>0||u.length>0){r.push(' case "$prev" in');for(let m of l)r.push(` ${m.long}) compadd -- ${m.choices?.join(" ")}; return ;;`);if(u.length>0){let m=u.flatMap(y=>[y.long,y.short].filter(Boolean)).join("|");r.push(` ${m}) _files; return ;;`)}r.push(" esac")}if(d.length>0){r.push(' if [[ "$cur" == -* ]]; then');let m=d.map(y=>`"${y.long}:${Ca(y.description)}"`).join(" ");r.push(` local -a opts=(${m}); _describe 'option' opts; return`),r.push(" fi")}if(c){let m=s.subcommands.map(y=>`"${y.name}:${Ca(y.description)}"`).join(" ");r.push(` local -a cmds=(${m}); _describe 'command' cmds`)}else r.push(" _files");r.push(" ;;")}return r.push(" esac"),r.push("}"),r.push(""),r.push(`compdef _${n} ${n}`),r.join(`
|
|
299
|
+
`)}function xa(t){let e=t.name,r=ur(t,"",[]),n=[];n.push(`# fish completion for ${e}`),n.push(`# Generated by: ${e} completion fish`),n.push("");let i=r[0];for(let o of i.subcommands)n.push(`complete -c ${e} -n "__fish_use_subcommand" -a "${o.name}" -d "${Qr(o.description)}"`);for(let o of t.options)if(o.long){let s=o.long.replace("--",""),a=`complete -c ${e} -l "${s}"`;o.short&&(a+=` -s "${o.short.replace("-","")}"`),o.takesValue&&(a+=" -r"),o.choices&&(a+=` -a "${o.choices.join(" ")}"`),a+=` -d "${Qr(o.description)}"`,n.push(a)}for(let o of r.slice(1)){let s=o.path.split(" ").slice(1),l=`__fish_seen_subcommand_from ${s[s.length-1]}`;for(let d of o.subcommands)n.push(`complete -c ${e} -n "${l}" -a "${d.name}" -d "${Qr(d.description)}"`);for(let d of o.options)if(d.long){let c=d.long.replace("--",""),u=`complete -c ${e} -n "${l}" -l "${c}"`;d.short&&(u+=` -s "${d.short.replace("-","")}"`),d.takesValue&&(u+=" -r"),d.choices&&(u+=` -a "${d.choices.join(" ")}"`),u+=` -d "${Qr(d.description)}"`,n.push(u)}}return n.join(`
|
|
300
|
+
`)}function Ca(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/:/g,"\\:")}function Qr(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Aa(t){let e=t.name,r=ur(t,"",[]),n=[];n.push(`# PowerShell completion for ${e}`),n.push(`# Generated by: ${e} completion powershell`),n.push(""),n.push(`Register-ArgumentCompleter -Native -CommandName ${e} -ScriptBlock {`),n.push(" param($wordToComplete, $commandAst, $cursorPosition)"),n.push(""),n.push(' $words = $commandAst.ToString().Substring(0, $cursorPosition) -split "\\s+"');let o=mi(t).map(s=>`"${s}"`).join(", ");n.push(" $cmdPath = @()"),n.push(` $valueFlags = @(${o})`),n.push(" for ($i = 1; $i -lt $words.Count - 1; $i++) {"),n.push(" if ($valueFlags -contains $words[$i]) { $i++; continue }"),n.push(' if ($words[$i] -notlike "-*") { $cmdPath += $words[$i] }'),n.push(" }"),n.push(' $joined = $cmdPath -join " "'),n.push(" $cur = $words[-1]"),n.push(' if ($words.Count -eq 1) { $cur = "" }'),n.push(""),n.push(' $prev = if ($words.Count -ge 2) { $words[-2] } else { "" }'),n.push(""),n.push(" switch ($joined) {");for(let s of r){let a=s.path===t.name?"":s.path.replace(`${t.name} `,""),l=s.options.filter(b=>b.choices&&b.long),d=s.options.map(b=>b.long).filter(Boolean).map(b=>`"${b}"`).join(", "),c=s.subcommands.map(b=>`"${b.name}"`).join(", "),u=l.length>0,m=d.length>0,y=c.length>0;if(!u&&!m&&!y)continue;n.push(` "${a}" {`);let g=s.options.filter(b=>b.takesValue&&!b.choices);if(u||g.length>0){n.push(" switch ($prev) {");for(let b of l){let _=b.choices?.map(A=>`"${A}"`).join(", ");n.push(` "${b.long}" { @(${_}) | Where-Object { $_ -like "$cur*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_) }; return }`)}if(g.length>0){let b=g.flatMap(_=>[_.long,_.short].filter(Boolean)).map(_=>`"${_}"`).join(", ");n.push(` { $_ -in @(${b}) } { return }`)}n.push(" }")}m&&(n.push(' if ($cur -like "-*") {'),n.push(` @(${d}) | Where-Object { $_ -like "$cur*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_) }; return`),n.push(" }")),y&&n.push(` @(${c}) | Where-Object { $_ -like "$cur*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_) }`),n.push(" }")}return n.push(" }"),n.push("}"),n.join(`
|
|
301
|
+
`)}var ka=new p("commands").description("Print the full command tree as JSON (for agents and tooling)").addHelpText("after",f({context:`Outputs every subcommand, option, and description from the CLI definition.
|
|
302
|
+
In machine mode (piped, CI, or --json), the tree is JSON you can feed to agents or scripts.`,examples:["resend commands","resend commands --json",'resend commands | jq ".subcommands[].name"']})).action((t,e)=>{let r=e.parent;if(!r)throw new Error("commands must be registered on the root program");let n=e.optsWithGlobals(),i=cr(r);B(i,{json:n.json})});var me=require("node:fs"),ut=require("node:os"),je=require("node:path");z();var Da=["bash","zsh","fish","powershell"],Xr="# resend shell completion";function Tm(){let t=process.env.SHELL;if(t){let e=(0,je.basename)(t);if(e==="bash")return"bash";if(e==="zsh")return"zsh";if(e==="fish")return"fish"}if(process.env.PSModulePath)return"powershell"}async function Om(t){if(t)return t;let e=Tm();if(e)return e;w()||(process.stderr.write(`error: could not detect shell. Pass the shell name explicitly.
|
|
303
|
+
`),process.exit(1));let r=await ie({message:"Which shell do you use?",options:Da.map(n=>({value:n,label:n}))});return k(r)&&S("Cancelled."),r}function $a(t){switch(t){case"bash":return process.platform==="darwin"?(0,je.join)((0,ut.homedir)(),".bash_profile"):(0,je.join)((0,ut.homedir)(),".bashrc");case"zsh":return(0,je.join)((0,ut.homedir)(),".zshrc");case"powershell":return process.platform==="win32"?(0,je.join)((0,ut.homedir)(),"Documents","PowerShell","Microsoft.PowerShell_profile.ps1"):(0,je.join)((0,ut.homedir)(),".config","powershell","Microsoft.PowerShell_profile.ps1")}}function Im(t,e){switch(t){case"bash":return wa(e);case"zsh":return _a(e);case"fish":return xa(e);case"powershell":return Aa(e)}}function Ea(t,e,r){(0,me.existsSync)(t)||(0,me.mkdirSync)(t,{recursive:!0});let n=(0,je.join)(t,e);return(0,me.writeFileSync)(n,`${r}
|
|
304
|
+
`),n}function Pm(t,e){switch(t){case"zsh":{let r=(0,je.join)((0,ut.homedir)(),".zsh","completions"),n=Ea(r,"_resend",e);Q.success(`Completions written to ${n}`);let i=$a(t),o=!0;if((0,me.existsSync)(i)&&(0,me.readFileSync)(i,"utf8").includes(r)&&(o=!1),o){let s=`${Xr}
|
|
306
305
|
fpath=(${r} $fpath)
|
|
307
|
-
`,a=(0,
|
|
308
|
-
${
|
|
306
|
+
`,a=(0,me.existsSync)(i)?(0,me.readFileSync)(i,"utf8"):"",l=a.match(/^.*compinit.*$/m);if(l){let d=a.indexOf(l[0]),c=a.slice(0,d),u=a.slice(d);(0,me.writeFileSync)(i,`${c}${s}
|
|
307
|
+
${u}`)}else{let d=`
|
|
309
308
|
${s}autoload -Uz compinit && compinit
|
|
310
|
-
`;(0,
|
|
311
|
-
${
|
|
309
|
+
`;(0,me.writeFileSync)(i,d,{flag:"a"})}Q.info(`Added completion path to ${i}`)}Q.info("Restart your shell to activate completions.");return}case"fish":{let r=(0,je.join)((0,ut.homedir)(),".config","fish","completions"),n=Ea(r,"resend.fish",e);Q.success(`Completions written to ${n}`),Q.info("Completions will be available in new fish sessions.");return}case"bash":case"powershell":{let r=$a(t),n=t==="powershell"?`
|
|
310
|
+
${Xr}
|
|
312
311
|
resend completion powershell | Invoke-Expression
|
|
313
312
|
`:`
|
|
314
|
-
${
|
|
315
|
-
eval "$(resend completion ${
|
|
316
|
-
`;if((0,
|
|
313
|
+
${Xr}
|
|
314
|
+
eval "$(resend completion ${t})"
|
|
315
|
+
`;if((0,me.existsSync)(r)&&(0,me.readFileSync)(r,"utf8").includes(Xr)){Q.info(`Completions already installed in ${r}`);return}let i=(0,je.dirname)(r);(0,me.existsSync)(i)||(0,me.mkdirSync)(i,{recursive:!0}),(0,me.writeFileSync)(r,n,{flag:"a"}),Q.success(`Completions added to ${r}`),Q.info("Restart your shell to activate completions.");return}}}var Sa=new p("completion").description("Generate shell completion script").addArgument(new Ni("[shell]","Shell type").choices(Da)).option("--install","Install completions into your shell profile").addHelpText("after",f({context:`Outputs a completion script for the given shell. The shell is auto-detected
|
|
317
316
|
from $SHELL when not specified.
|
|
318
317
|
|
|
319
318
|
Quick setup:
|
|
@@ -333,7 +332,7 @@ Manual setup:
|
|
|
333
332
|
PowerShell (add to $PROFILE):
|
|
334
333
|
resend completion powershell >> $PROFILE
|
|
335
334
|
|
|
336
|
-
Homebrew users: completions may be configured automatically by your formula.`,examples:["resend completion --install","resend completion bash","resend completion zsh",'eval "$(resend completion bash)"']})).action(async(e,
|
|
335
|
+
Homebrew users: completions may be configured automatically by your formula.`,examples:["resend completion --install","resend completion bash","resend completion zsh",'eval "$(resend completion bash)"']})).action(async(t,e,r)=>{let n=await Om(t),i=r.parent;if(!i)throw new Error("completion command must be registered under a parent");let o=cr(i),s=Im(n,o);if(e.install){Pm(n,s);return}if(!t&&w()){r.help();return}console.log(s)});var Ta=new p("create").description("Create a new contact property definition").addOption(new ee("--key <key>","Property key name, used in broadcast template interpolation (e.g. company_name, department)")).addOption(new ee("--type <type>","Property data type: 'string' for text values, 'number' for numeric values").choices(["string","number"])).option("--fallback-value <value>","Default value used in broadcast templates when a contact has no value set for this property").addHelpText("after",f({context:`Property keys are used as identifiers in broadcast HTML template interpolation:
|
|
337
336
|
{{{PROPERTY_NAME|fallback}}} \u2014 triple-brace syntax substitutes the contact's value
|
|
338
337
|
{{{company_name|Unknown}}} \u2014 falls back to "Unknown" if the property is not set
|
|
339
338
|
|
|
@@ -341,20 +340,20 @@ Reserved keys (cannot be used): FIRST_NAME, LAST_NAME, EMAIL, UNSUBSCRIBE_URL
|
|
|
341
340
|
|
|
342
341
|
Non-interactive: --key and --type are required. --fallback-value is optional.
|
|
343
342
|
Warning: do not create properties with reserved key names \u2014 they will conflict with
|
|
344
|
-
built-in contact fields and may cause unexpected behavior in broadcasts.`,output:' {"object":"contact_property","id":"<id>"}',errorCodes:["auth_error","missing_key","missing_type","invalid_fallback_value","create_error"],examples:["resend contact-properties create --key company_name --type string",'resend contact-properties create --key company_name --type string --fallback-value "Unknown"',"resend contact-properties create --key employee_count --type number --fallback-value 0","resend contact-properties create --key department --type string --json"]})).action(async(e
|
|
343
|
+
built-in contact fields and may cause unexpected behavior in broadcasts.`,output:' {"object":"contact_property","id":"<id>"}',errorCodes:["auth_error","missing_key","missing_type","invalid_fallback_value","create_error"],examples:["resend contact-properties create --key company_name --type string",'resend contact-properties create --key company_name --type string --fallback-value "Unknown"',"resend contact-properties create --key employee_count --type number --fallback-value 0","resend contact-properties create --key department --type string --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=await q(t.key,{message:"Property key",placeholder:"e.g. company_name"},{message:"Missing --key flag.",code:"missing_key"},r),i=await Pt(t.type,{message:"Property data type",options:[{value:"string",label:"string \u2014 text values"},{value:"number",label:"number \u2014 numeric values"}]},{message:"Missing --type flag.",code:"missing_type"},r),o;if(t.fallbackValue!==void 0)if(i==="number"){let a=parseFloat(t.fallbackValue);Number.isNaN(a)&&h({message:"--fallback-value must be a valid number for number-type properties.",code:"invalid_fallback_value"},{json:r.json}),o=a}else o=t.fallbackValue;let s={key:n,type:i,...o!==void 0&&{fallbackValue:o}};await J({loading:"Creating contact property...",sdkCall:a=>a.contactProperties.create(s),onInteractive:a=>{console.log(`Contact property created: ${a.id}`)}},r)});var Nt={resource:"contact property",resourcePlural:"contact properties",fetchItems:(t,{limit:e,after:r})=>t.contactProperties.list({limit:e,...r&&{after:r}}),display:t=>({label:`${t.key} (${t.type})`,hint:t.id})};function Oa(t){let e=t.map(r=>[r.key,r.type,r.fallbackValue!=null?String(r.fallbackValue):"",r.id,r.createdAt]);return N(["Key","Type","Fallback Value","ID","Created"],e,"(no contact properties)")}var Ia=new p("delete").alias("rm").description("Delete a contact property definition").argument("[id]","Contact property UUID").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",f({context:`WARNING: Deleting a property definition removes that property value from ALL contacts
|
|
345
344
|
permanently. This cannot be undone, and any broadcasts that reference this property key
|
|
346
345
|
via {{{PROPERTY_NAME}}} will render an empty string or their inline fallback instead.
|
|
347
346
|
|
|
348
|
-
Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"contact_property","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend contact-properties delete b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --yes","resend contact-properties delete b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --yes --json"]})).action(async(e,
|
|
349
|
-
ID: ${
|
|
350
|
-
This will remove this property from ALL contacts permanently.`,loading:"Deleting contact property...",object:"contact_property",successMsg:"Contact property deleted",sdkCall:o=>o.contactProperties.remove(
|
|
347
|
+
Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"contact_property","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend contact-properties delete b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --yes","resend contact-properties delete b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --yes --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await le(t,Nt,n);await re(i.id,!!e.yes,{confirmMessage:`Delete contact property "${i.label}"?
|
|
348
|
+
ID: ${i.id}
|
|
349
|
+
This will remove this property from ALL contacts permanently.`,loading:"Deleting contact property...",object:"contact_property",successMsg:"Contact property deleted",sdkCall:o=>o.contactProperties.remove(i.id)},n)});var Pa=new p("get").description("Retrieve a contact property definition by ID").argument("[id]","Contact property UUID").addHelpText("after",f({output:` {
|
|
351
350
|
"object": "contact_property",
|
|
352
351
|
"id": "<uuid>",
|
|
353
352
|
"key": "company_name",
|
|
354
353
|
"type": "string",
|
|
355
354
|
"fallbackValue": null,
|
|
356
355
|
"createdAt": "2026-01-01T00:00:00.000Z"
|
|
357
|
-
}`,errorCodes:["auth_error","fetch_error"],examples:["resend contact-properties get b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d","resend contact-properties get b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --json"]})).action(async(e,
|
|
356
|
+
}`,errorCodes:["auth_error","fetch_error"],examples:["resend contact-properties get b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d","resend contact-properties get b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Nt,n);await H({loading:"Fetching contact property...",sdkCall:o=>o.contactProperties.get(i),onInteractive:o=>{console.log(`${o.key} (${o.type})`),console.log(`ID: ${o.id}`),console.log(`Created: ${o.createdAt}`),console.log(`Fallback value: ${o.fallbackValue??"(none)"}`)}},n)});var ja=new p("list").alias("ls").description("List all contact property definitions").option("--limit <n>","Maximum number of contact properties to return (1-100)","10").option("--after <cursor>","Return contact properties after this cursor (next page)").option("--before <cursor>","Return contact properties before this cursor (previous page)").addHelpText("after",f({context:`Pagination: use --after or --before with a contact property ID as the cursor.
|
|
358
357
|
Only one of --after or --before may be used at a time.
|
|
359
358
|
The response includes has_more: true when additional pages exist.`,output:` {
|
|
360
359
|
"object": "list",
|
|
@@ -362,14 +361,14 @@ This will remove this property from ALL contacts permanently.`,loading:"Deleting
|
|
|
362
361
|
"data": [
|
|
363
362
|
{ "id": "<uuid>", "key": "company_name", "type": "string", "fallbackValue": null, "createdAt": "..." }
|
|
364
363
|
]
|
|
365
|
-
}`,errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend contact-properties list","resend contact-properties list --limit 25 --json","resend contact-properties list --after b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --json"]})).action(async(e
|
|
364
|
+
}`,errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend contact-properties list","resend contact-properties list --limit 25 --json","resend contact-properties list --after b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=L(t.limit,r),i=G(n,t.after,t.before,r);await P({loading:"Fetching contact properties...",sdkCall:o=>o.contactProperties.list(i),onInteractive:o=>{console.log(Oa(o.data)),M(o,"contact-properties list",{limit:n,before:t.before,apiKey:r.apiKey,profile:r.profile})}},r)});var Ra=new p("update").description("Update a contact property definition").argument("[id]","Contact property UUID").option("--fallback-value <value>","New fallback value used in broadcast templates when a contact has no value set for this property").option("--clear-fallback-value","Remove the fallback value (sets it to null)").addHelpText("after",f({context:`Note: the property key and type cannot be changed after creation. Only the fallback value
|
|
366
365
|
is updatable. Renaming a property would break existing broadcasts that reference the old key.
|
|
367
366
|
|
|
368
367
|
--fallback-value and --clear-fallback-value are mutually exclusive.
|
|
369
368
|
|
|
370
369
|
The fallback value is used in broadcast template interpolation when a contact has no value:
|
|
371
370
|
{{{company_name|Unknown}}} \u2014 inline fallback (takes precedence over the property's fallback)
|
|
372
|
-
{{{company_name}}} \u2014 uses the property's stored fallback value if set`,output:' {"object":"contact_property","id":"<id>"}',errorCodes:["auth_error","no_changes","conflicting_flags","fetch_error","invalid_fallback_value","update_error"],examples:['resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --fallback-value "Acme Corp"',"resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --fallback-value 42","resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --clear-fallback-value",'resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --fallback-value "Unknown" --json']})).action(async(e,
|
|
371
|
+
{{{company_name}}} \u2014 uses the property's stored fallback value if set`,output:' {"object":"contact_property","id":"<id>"}',errorCodes:["auth_error","no_changes","conflicting_flags","fetch_error","invalid_fallback_value","update_error"],examples:['resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --fallback-value "Acme Corp"',"resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --fallback-value 42","resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --clear-fallback-value",'resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --fallback-value "Unknown" --json']})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Nt,n);e.fallbackValue===void 0&&!e.clearFallbackValue&&h({message:"Provide at least one option to update: --fallback-value or --clear-fallback-value.",code:"no_changes"},{json:n.json}),e.fallbackValue!==void 0&&e.clearFallbackValue&&h({message:"--fallback-value and --clear-fallback-value are mutually exclusive.",code:"conflicting_flags"},{json:n.json});let o=e.clearFallbackValue?null:e.fallbackValue;if(typeof o=="string"){let s=await X(n);if((await Ee("Fetching contact property...",()=>s.contactProperties.get(i),"fetch_error",n,{retryTransient:!0})).type==="number"){let l=parseFloat(o);Number.isNaN(l)&&h({message:"--fallback-value must be a valid number for number-type properties.",code:"invalid_fallback_value"},{json:n.json}),o=l}}await R({loading:"Updating contact property...",sdkCall:s=>s.contactProperties.update({id:i,...o!==void 0&&{fallbackValue:o}}),errorCode:"update_error",successMsg:`Contact property updated: ${i}`},n)});var Fa=new p("contact-properties").description("Manage contact property definitions").addHelpText("after",f({context:`Contact properties define the schema for custom data stored on contacts.
|
|
373
372
|
Think of them as column definitions \u2014 you create a property definition (e.g. company_name)
|
|
374
373
|
and then set values for that property on individual contacts via "resend contacts update --properties".
|
|
375
374
|
|
|
@@ -384,9 +383,9 @@ Supported types:
|
|
|
384
383
|
number \u2014 numeric values (useful for counts, scores, thresholds)
|
|
385
384
|
|
|
386
385
|
Note: property keys and types are immutable after creation. Only the fallback value can
|
|
387
|
-
be updated. Deleting a property removes it from all contacts.`,examples:["resend contact-properties list","resend contact-properties create --key company_name --type string",'resend contact-properties create --key plan --type string --fallback-value "free"',"resend contact-properties create --key score --type number --fallback-value 0","resend contact-properties get b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d",'resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --fallback-value "Unknown"',"resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --clear-fallback-value","resend contact-properties delete b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --yes"]})).addCommand(
|
|
386
|
+
be updated. Deleting a property removes it from all contacts.`,examples:["resend contact-properties list","resend contact-properties create --key company_name --type string",'resend contact-properties create --key plan --type string --fallback-value "free"',"resend contact-properties create --key score --type number --fallback-value 0","resend contact-properties get b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d",'resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --fallback-value "Unknown"',"resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --clear-fallback-value","resend contact-properties delete b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --yes"]})).addCommand(Ta).addCommand(Pa).addCommand(ja,{isDefault:!0}).addCommand(Ra).addCommand(Ia);function Zr(t){let e=t.map(r=>[r.email,r.first_name??"",r.last_name??"",r.unsubscribed?"yes":"no",r.id]);return N(["Email","First Name","Last Name","Unsubscribed","ID"],e,"(no contacts)")}function Ba(t){let e=t.map(r=>[r.name,r.subscription,r.id,r.description??""]);return N(["Name","Subscription","ID","Description"],e,"(no topic subscriptions)")}var fe={resource:"contact",resourcePlural:"contacts",fetchItems:(t,{limit:e,after:r})=>t.contacts.list({limit:e,...r&&{after:r}}),display:t=>({label:t.email,hint:t.id})};function Ht(t){return t.includes("@")?{email:t}:{id:t}}function Lt(t){return t.includes("@")?{email:t}:{contactId:t}}function Na(t,e){let r;try{r=JSON.parse(t)}catch{h({message:"Invalid --topics JSON. Expected an array of {id, subscription} objects.",code:"invalid_topics"},{json:e.json})}return Array.isArray(r)||h({message:"Invalid --topics JSON. Expected an array of {id, subscription} objects.",code:"invalid_topics"},{json:e.json}),r}function en(t,e){if(t)try{return JSON.parse(t)}catch{h({message:"Invalid --properties JSON.",code:"invalid_properties"},{json:e.json})}}var Ha=new p("add-segment").description("Add a contact to a segment").argument("[contactId]","Contact UUID or email address").option("--segment-id <id>","Segment ID to add the contact to (required)").addHelpText("after",f({context:`The <contactId> argument accepts either a UUID or an email address.
|
|
388
387
|
|
|
389
|
-
Non-interactive: --segment-id is required.`,output:' {"id":"<segment-membership-id>"}',errorCodes:["auth_error","missing_segment_id","add_segment_error"],examples:["resend contacts add-segment e169aa45-1ecf-4183-9955-b1499d5701d3 --segment-id 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend contacts add-segment steve.wozniak@gmail.com --segment-id 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,
|
|
388
|
+
Non-interactive: --segment-id is required.`,output:' {"id":"<segment-membership-id>"}',errorCodes:["auth_error","missing_segment_id","add_segment_error"],examples:["resend contacts add-segment e169aa45-1ecf-4183-9955-b1499d5701d3 --segment-id 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend contacts add-segment steve.wozniak@gmail.com --segment-id 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,fe,n),o=await C(e.segmentId,He,n),s={...Lt(i),segmentId:o};await R({loading:"Adding contact to segment...",sdkCall:a=>a.contacts.segments.add(s),errorCode:"add_segment_error",successMsg:`Contact added to segment: ${o}`},n)});z();var La=new p("create").description("Create a new contact").option("--email <email>","Contact email address (required)").option("--first-name <name>","First name").option("--last-name <name>","Last name").option("--unsubscribed","Globally unsubscribe the contact from all broadcasts").option("--properties <json>",`Custom properties as a JSON string (e.g. '{"company":"Acme"}')`).option("--segment-id <id...>","Segment ID to add the contact to on creation (repeatable: --segment-id abc --segment-id def)").addHelpText("after",f({context:`Non-interactive: --email is required. All other flags are optional.
|
|
390
389
|
|
|
391
390
|
Properties: pass a JSON object string to --properties (e.g. '{"plan":"pro","company":"Acme"}').
|
|
392
391
|
Properties are stored as custom contact attributes. To clear a property, set it to null.
|
|
@@ -394,11 +393,11 @@ Properties: pass a JSON object string to --properties (e.g. '{"plan":"pro","comp
|
|
|
394
393
|
|
|
395
394
|
Segments: use --segment-id once per segment to add the contact to one or more segments on creation.
|
|
396
395
|
|
|
397
|
-
Unsubscribed: setting --unsubscribed is a team-wide opt-out from all broadcasts, regardless of segments/topics.`,output:' {"object":"contact","id":"<id>"}',errorCodes:["auth_error","missing_email","invalid_properties","create_error"],examples:["resend contacts create --email steve.wozniak@gmail.com","resend contacts create --email steve.wozniak@gmail.com --first-name Steve --last-name Wozniak",`resend contacts create --email steve.wozniak@gmail.com --properties '{"company":"Acme","plan":"pro"}'`]})).action(async(e
|
|
396
|
+
Unsubscribed: setting --unsubscribed is a team-wide opt-out from all broadcasts, regardless of segments/topics.`,output:' {"object":"contact","id":"<id>"}',errorCodes:["auth_error","missing_email","invalid_properties","create_error"],examples:["resend contacts create --email steve.wozniak@gmail.com","resend contacts create --email steve.wozniak@gmail.com --first-name Steve --last-name Wozniak",`resend contacts create --email steve.wozniak@gmail.com --properties '{"company":"Acme","plan":"pro"}'`]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=await q(t.email,{message:"Email address",placeholder:"steve.wozniak@gmail.com"},{message:"Missing --email flag.",code:"missing_email"},r),i=t.firstName,o=t.lastName;if(w()&&!r.json&&!t.firstName){let l=await Y({message:"First name (optional)"});k(l)&&S("Cancelled."),l&&(i=l)}if(w()&&!r.json&&!t.lastName){let l=await Y({message:"Last name (optional)"});k(l)&&S("Cancelled."),l&&(o=l)}let s=en(t.properties,r),a=t.segmentId??[];await J({loading:"Creating contact...",sdkCall:l=>l.contacts.create({email:n,...i&&{firstName:i},...o&&{lastName:o},...t.unsubscribed&&{unsubscribed:!0},...s&&{properties:s},...a.length>0&&{segments:a.map(d=>({id:d}))}}),onInteractive:l=>{console.log(`Contact created: ${l.id}`)}},r)});var Ga=new p("delete").alias("rm").description("Delete a contact").argument("[id]","Contact UUID or email address \u2014 both are accepted by the API").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",f({context:`The <id> argument accepts either a UUID or an email address.
|
|
398
397
|
|
|
399
|
-
Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"contact","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend contacts delete 520784e2-887d-4c25-b53c-4ad46ad38100 --yes","resend contacts delete acme@example.com --yes --json"]})).action(async(e,
|
|
400
|
-
ID: ${
|
|
401
|
-
This cannot be undone.`,loading:"Deleting contact...",object:"contact",successMsg:"Contact deleted",sdkCall:o=>o.contacts.remove(
|
|
398
|
+
Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"contact","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend contacts delete 520784e2-887d-4c25-b53c-4ad46ad38100 --yes","resend contacts delete acme@example.com --yes --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await le(t,fe,n);await re(i.id,!!e.yes,{confirmMessage:`Delete contact "${i.label}"?
|
|
399
|
+
ID: ${i.id}
|
|
400
|
+
This cannot be undone.`,loading:"Deleting contact...",object:"contact",successMsg:"Contact deleted",sdkCall:o=>o.contacts.remove(i.id)},n)});var Ma=new p("get").description("Retrieve a contact by ID or email address").argument("[id]","Contact UUID or email address \u2014 both are accepted by the API").addHelpText("after",f({output:` {
|
|
402
401
|
"object": "contact",
|
|
403
402
|
"id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
|
|
404
403
|
"email": "steve.wozniak@gmail.com",
|
|
@@ -407,17 +406,17 @@ This cannot be undone.`,loading:"Deleting contact...",object:"contact",successMs
|
|
|
407
406
|
"created_at": "2026-01-01T00:00:00.000Z",
|
|
408
407
|
"unsubscribed": false,
|
|
409
408
|
"properties": {}
|
|
410
|
-
}`,errorCodes:["auth_error","fetch_error"],examples:["resend contacts get e169aa45-1ecf-4183-9955-b1499d5701d3","resend contacts get steve.wozniak@gmail.com","resend contacts get e169aa45-1ecf-4183-9955-b1499d5701d3 --json"]})).action(async(e,
|
|
409
|
+
}`,errorCodes:["auth_error","fetch_error"],examples:["resend contacts get e169aa45-1ecf-4183-9955-b1499d5701d3","resend contacts get steve.wozniak@gmail.com","resend contacts get e169aa45-1ecf-4183-9955-b1499d5701d3 --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,fe,n);await H({loading:"Fetching contact...",sdkCall:o=>o.contacts.get(i),onInteractive:o=>{let s=[o.first_name,o.last_name].filter(Boolean).join(" ");console.log(`${o.email}${s?` (${s})`:""}`),console.log(`ID: ${o.id}`),console.log(`Created: ${o.created_at}`),console.log(`Unsubscribed: ${o.unsubscribed?"yes":"no"}`);let a=Object.entries(o.properties??{});if(a.length>0){console.log("Properties:");for(let[l,d]of a)console.log(` ${l}: ${d.value}`)}}},n)});var qa=new p("list").alias("ls").description("List all contacts").option("--limit <n>","Maximum number of contacts to return (1-100)","10").option("--after <cursor>","Return contacts after this cursor (next page)").option("--before <cursor>","Return contacts before this cursor (previous page)").addHelpText("after",f({context:`Contacts are global \u2014 they are not scoped to audiences or segments since the 2025 migration.
|
|
411
410
|
|
|
412
411
|
Pagination: use --after or --before with a contact ID as the cursor.
|
|
413
412
|
Only one of --after or --before may be used at a time.
|
|
414
|
-
The response includes has_more: true when additional pages exist.`,output:' {"object":"list","data":[{"id":"...","email":"...","first_name":"...","last_name":"...","unsubscribed":false}],"has_more":false}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend contacts list","resend contacts list --limit 25 --json","resend contacts list --after 479e3145-dd38-4932-8c0c-e58b548c9e76 --json"]})).action(async(e
|
|
415
|
-
The <segmentId> argument must be a segment UUID (not an email).`,output:' {"id":"<segment-id>","deleted":true}',errorCodes:["auth_error","remove_segment_error"],examples:["resend contacts remove-segment e169aa45-1ecf-4183-9955-b1499d5701d3 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend contacts remove-segment steve.wozniak@gmail.com 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,
|
|
413
|
+
The response includes has_more: true when additional pages exist.`,output:' {"object":"list","data":[{"id":"...","email":"...","first_name":"...","last_name":"...","unsubscribed":false}],"has_more":false}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend contacts list","resend contacts list --limit 25 --json","resend contacts list --after 479e3145-dd38-4932-8c0c-e58b548c9e76 --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=L(t.limit,r),i=G(n,t.after,t.before,r);await P({loading:"Fetching contacts...",sdkCall:o=>o.contacts.list(i),onInteractive:o=>{console.log(Zr(o.data)),M(o,"contacts list",{limit:n,before:t.before,apiKey:r.apiKey,profile:r.profile})}},r)});var Ua=new p("remove-segment").description("Remove a contact from a segment").argument("[contactId]","Contact UUID or email address").argument("[segmentId]","Segment ID to remove the contact from").addHelpText("after",f({context:`The <contactId> argument accepts either a UUID or an email address.
|
|
414
|
+
The <segmentId> argument must be a segment UUID (not an email).`,output:' {"id":"<segment-id>","deleted":true}',errorCodes:["auth_error","remove_segment_error"],examples:["resend contacts remove-segment e169aa45-1ecf-4183-9955-b1499d5701d3 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend contacts remove-segment steve.wozniak@gmail.com 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(t,e,r,n)=>{let i=n.optsWithGlobals(),o=await C(t,fe,i),s=await C(e,He,i),a={...Lt(o),segmentId:s};await R({loading:"Removing contact from segment...",sdkCall:l=>l.contacts.segments.remove(a),errorCode:"remove_segment_error",successMsg:`Contact removed from segment: ${s}`},i)});var Wa=new p("segments").description("List the segments a contact belongs to").argument("[id]","Contact UUID or email address").addHelpText("after",f({context:"The <id> argument accepts either a UUID or an email address.",output:' {"object":"list","data":[{"id":"<segment-uuid>","name":"Newsletter Subscribers","created_at":"..."}],"has_more":false}',errorCodes:["auth_error","list_error"],examples:["resend contacts segments e169aa45-1ecf-4183-9955-b1499d5701d3","resend contacts segments steve.wozniak@gmail.com","resend contacts segments e169aa45-1ecf-4183-9955-b1499d5701d3 --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,fe,n);await P({loading:"Fetching segments...",sdkCall:o=>o.contacts.segments.list(Lt(i)),onInteractive:o=>console.log(Yr(o.data))},n)});var Va=new p("topics").description("List a contact's topic subscriptions").argument("[id]","Contact UUID or email address").addHelpText("after",f({context:`The <id> argument accepts either a UUID or an email address.
|
|
416
415
|
|
|
417
416
|
Topics control which broadcast email types a contact receives.
|
|
418
417
|
subscription values: "opt_in" (receiving) | "opt_out" (not receiving)
|
|
419
418
|
|
|
420
|
-
Use "resend contacts update-topics <id>" to change subscription statuses.`,output:' {"object":"list","data":[{"id":"...","name":"Product Updates","description":"...","subscription":"opt_in"}],"has_more":false}',errorCodes:["auth_error","list_error"],examples:["resend contacts topics e169aa45-1ecf-4183-9955-b1499d5701d3","resend contacts topics steve.wozniak@gmail.com","resend contacts topics e169aa45-1ecf-4183-9955-b1499d5701d3 --json"]})).action(async(e,
|
|
419
|
+
Use "resend contacts update-topics <id>" to change subscription statuses.`,output:' {"object":"list","data":[{"id":"...","name":"Product Updates","description":"...","subscription":"opt_in"}],"has_more":false}',errorCodes:["auth_error","list_error"],examples:["resend contacts topics e169aa45-1ecf-4183-9955-b1499d5701d3","resend contacts topics steve.wozniak@gmail.com","resend contacts topics e169aa45-1ecf-4183-9955-b1499d5701d3 --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,fe,n);await P({loading:"Fetching topic subscriptions...",sdkCall:o=>o.contacts.topics.list(Ht(i)),onInteractive:o=>console.log(Ba(o.data))},n)});var Ka=new p("update").description("Update a contact's subscription status or custom properties").argument("[id]","Contact UUID or email address \u2014 both are accepted by the API").option("--unsubscribed","Globally unsubscribe the contact from all broadcasts").option("--no-unsubscribed","Re-subscribe the contact (clears the global unsubscribe flag)").option("--properties <json>",`JSON object of properties to merge (e.g. '{"company":"Acme"}'); set a key to null to clear it`).addHelpText("after",f({context:`The <id> argument accepts either a UUID or an email address.
|
|
421
420
|
|
|
422
421
|
Subscription toggle:
|
|
423
422
|
--unsubscribed Sets unsubscribed: true \u2014 contact will not receive any broadcasts.
|
|
@@ -425,7 +424,7 @@ Subscription toggle:
|
|
|
425
424
|
Omitting both flags leaves the subscription status unchanged.
|
|
426
425
|
|
|
427
426
|
Properties: --properties merges the given JSON object with existing properties.
|
|
428
|
-
Set a key to null to clear it: '{"company":null}'.`,output:' {"object":"contact","id":"<id>"}',errorCodes:["auth_error","invalid_properties","update_error"],examples:["resend contacts update e169aa45-1ecf-4183-9955-b1499d5701d3 --unsubscribed","resend contacts update acme@example.com --no-unsubscribed",`resend contacts update e169aa45-1ecf-4183-9955-b1499d5701d3 --properties '{"plan":"pro"}'`,"resend contacts update acme@example.com --unsubscribed --json"]})).action(async(e,
|
|
427
|
+
Set a key to null to clear it: '{"company":null}'.`,output:' {"object":"contact","id":"<id>"}',errorCodes:["auth_error","invalid_properties","update_error"],examples:["resend contacts update e169aa45-1ecf-4183-9955-b1499d5701d3 --unsubscribed","resend contacts update acme@example.com --no-unsubscribed",`resend contacts update e169aa45-1ecf-4183-9955-b1499d5701d3 --properties '{"plan":"pro"}'`,"resend contacts update acme@example.com --unsubscribed --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,fe,n),o=en(e.properties,n),s={...Ht(i),...e.unsubscribed!==void 0&&{unsubscribed:e.unsubscribed},...o&&{properties:o}};await R({loading:"Updating contact...",sdkCall:a=>a.contacts.update(s),errorCode:"update_error",successMsg:`Contact updated: ${i}`},n)});z();var za=new p("update-topics").description("Update a contact's topic subscription statuses").argument("[id]","Contact UUID or email address").option("--topics <json>",`JSON array of topic subscriptions (required) \u2014 e.g. '[{"id":"topic-uuid","subscription":"opt_in"}]'`).addHelpText("after",f({context:`The <id> argument accepts either a UUID or an email address.
|
|
429
428
|
|
|
430
429
|
Non-interactive: --topics is required.
|
|
431
430
|
|
|
@@ -434,7 +433,7 @@ Topics JSON format:
|
|
|
434
433
|
subscription values: "opt_in" | "opt_out"
|
|
435
434
|
|
|
436
435
|
This operation replaces all topic subscriptions for the specified topics.
|
|
437
|
-
Topics not included in the array are left unchanged.`,output:' {"id":"<contact-id>"}',errorCodes:["auth_error","missing_topics","invalid_topics","update_topics_error"],examples:[`resend contacts update-topics e169aa45-1ecf-4183-9955-b1499d5701d3 --topics '[{"id":"b6d24b8e-af0b-4c3c-be0c-359bbd97381e","subscription":"opt_in"}]'`,`resend contacts update-topics steve.wozniak@gmail.com --topics '[{"id":"b6d24b8e-af0b-4c3c-be0c-359bbd97381e","subscription":"opt_out"},{"id":"07d84122-7224-4881-9c31-1c048e204602","subscription":"opt_in"}]' --json`]})).action(async(e,
|
|
436
|
+
Topics not included in the array are left unchanged.`,output:' {"id":"<contact-id>"}',errorCodes:["auth_error","missing_topics","invalid_topics","update_topics_error"],examples:[`resend contacts update-topics e169aa45-1ecf-4183-9955-b1499d5701d3 --topics '[{"id":"b6d24b8e-af0b-4c3c-be0c-359bbd97381e","subscription":"opt_in"}]'`,`resend contacts update-topics steve.wozniak@gmail.com --topics '[{"id":"b6d24b8e-af0b-4c3c-be0c-359bbd97381e","subscription":"opt_out"},{"id":"07d84122-7224-4881-9c31-1c048e204602","subscription":"opt_in"}]' --json`]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,fe,n),o=await X(n),s=e.topics;if(!s){(!w()||n.json)&&h({message:"Missing --topics flag.",code:"missing_topics"},{json:n.json});let d=await Y({message:`Topics JSON (e.g. '[{"id":"topic-uuid","subscription":"opt_in"}]')`,placeholder:'[{"id":"topic-uuid","subscription":"opt_in"}]',validate:c=>c?void 0:"Required"});k(d)&&S("Cancelled."),s=d}let a=Na(s,n),l=await Ee("Updating topic subscriptions...",()=>o.contacts.topics.update({...Ht(i),topics:a}),"update_topics_error",n);!n.json&&w()?console.log(`Topic subscriptions updated for contact: ${i}`):B(l,{json:n.json})});var Ja=new p("contacts").description("Manage contacts").addHelpText("after",f({context:`Contacts are global entities (not audience-scoped since the 2025 migration).
|
|
438
437
|
Each contact is identified by a UUID or email address \u2014 both are accepted in all subcommands.
|
|
439
438
|
|
|
440
439
|
Properties:
|
|
@@ -448,7 +447,7 @@ Subscription:
|
|
|
448
447
|
|
|
449
448
|
Segments:
|
|
450
449
|
Contacts can belong to multiple segments. Segments determine which contacts receive a broadcast.
|
|
451
|
-
Manage membership with "resend contacts add-segment" and "resend contacts remove-segment".`,examples:["resend contacts list","resend contacts create --email steve.wozniak@gmail.com --first-name Steve","resend contacts get e169aa45-1ecf-4183-9955-b1499d5701d3","resend contacts get steve.wozniak@gmail.com","resend contacts update acme@example.com --unsubscribed","resend contacts delete e169aa45-1ecf-4183-9955-b1499d5701d3 --yes","resend contacts segments steve.wozniak@gmail.com","resend contacts add-segment steve.wozniak@gmail.com --segment-id 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend contacts remove-segment steve.wozniak@gmail.com 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend contacts topics steve.wozniak@gmail.com",`resend contacts update-topics steve.wozniak@gmail.com --topics '[{"id":"b6d24b8e-af0b-4c3c-be0c-359bbd97381e","subscription":"opt_in"}]'`]})).addCommand(
|
|
450
|
+
Manage membership with "resend contacts add-segment" and "resend contacts remove-segment".`,examples:["resend contacts list","resend contacts create --email steve.wozniak@gmail.com --first-name Steve","resend contacts get e169aa45-1ecf-4183-9955-b1499d5701d3","resend contacts get steve.wozniak@gmail.com","resend contacts update acme@example.com --unsubscribed","resend contacts delete e169aa45-1ecf-4183-9955-b1499d5701d3 --yes","resend contacts segments steve.wozniak@gmail.com","resend contacts add-segment steve.wozniak@gmail.com --segment-id 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend contacts remove-segment steve.wozniak@gmail.com 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend contacts topics steve.wozniak@gmail.com",`resend contacts update-topics steve.wozniak@gmail.com --topics '[{"id":"b6d24b8e-af0b-4c3c-be0c-359bbd97381e","subscription":"opt_in"}]'`]})).addCommand(La).addCommand(Ma).addCommand(qa,{isDefault:!0}).addCommand(Ka).addCommand(Ga).addCommand(Wa).addCommand(Ha).addCommand(Ua).addCommand(Va).addCommand(za);var Ya=new p("docs").description("Open the Resend documentation in your browser").addHelpText("after",f({context:"Opens https://resend.com/docs in your default browser.",examples:["resend docs"]})).action(async(t,e)=>{let r=e.optsWithGlobals();await Se(de.documentation,r)});ye();ti();z();dr();ht();var hi="TimeoutError",rl=(t,e)=>{let r,n=new Promise((i,o)=>{r=setTimeout(()=>{let s=new Error(`Operation timed out after ${e}ms`);s.name=hi,o(s)},e)});return Promise.race([t,n]).finally(()=>{clearTimeout(r)})};var Nm=5e3;async function Hm(){try{let t=await fetch(pi,{headers:{Accept:"application/vnd.github.v3+json"},signal:AbortSignal.timeout(5e3)});if(!t.ok)return{name:"CLI Version",status:"warn",message:`v${te} (could not check for updates)`};let e=await t.json();if(e.prerelease||e.draft)return{name:"CLI Version",status:"warn",message:`v${te} (could not check for updates)`};let r=e.tag_name?.replace(/^v/,"")??"unknown";return r===te?{name:"CLI Version",status:"pass",message:`v${te} (latest)`}:{name:"CLI Version",status:"warn",message:`v${te} (latest: v${r})`,detail:"Update available"}}catch{return{name:"CLI Version",status:"warn",message:`v${te} (could not check for updates)`}}}async function Lm(t){let e=await _t(t);if(!e)return{name:"API Key",status:"fail",message:"No API key found",detail:"Run: resend login"};let r=e.profile?`, profile: ${e.profile}`:"";return{name:"API Key",status:"pass",message:`${wt(e.key)} (source: ${e.source}${r})`}}async function Gm(t){let e=await _t(t);if(!e)return{name:"API Validation",status:"fail",message:"Skipped \u2014 no API key"};try{let r=new Dt(e.key),{data:n,error:i}=await rl(r.domains.list(),Nm);if(i){let l=i;return l.name==="restricted_api_key"?{name:"API Validation",status:"warn",message:"Sending-only API key",detail:Tt}:l.name==="application_error"?{name:"API Validation",status:"warn",message:"Network error. Check your connection and try again"}:{name:"API Validation",status:"fail",message:`API key invalid: ${i.message}`}}let o=n?.data??[],s=o.filter(l=>l.status==="verified"),a=o.filter(l=>l.status!=="verified");return o.length===0?{name:"Domains",status:"warn",message:"No domains configured",detail:"Add a domain at https://resend.com/domains"}:s.length===0?{name:"Domains",status:"warn",message:`${a.length} domain(s) pending verification`,detail:o.map(l=>`${l.name} (${l.status})`).join(", ")}:{name:"Domains",status:"pass",message:`${s.length} verified, ${a.length} pending`,detail:o.map(l=>`${l.name} (${l.status})`).join(", ")}}catch(r){return r instanceof Error&&r.name===hi?{name:"API Validation",status:"warn",message:"Request timed out"}:{name:"API Validation",status:"fail",message:V(r,"Failed to validate API key")}}}var nl=new p("doctor").description("Check CLI version, API key, and domain status").addHelpText("after",f({setup:!0,context:`Checks performed:
|
|
452
451
|
CLI Version Is the installed version up to date?
|
|
453
452
|
API Key Is a key present (--api-key, RESEND_API_KEY, or credentials file)?
|
|
454
453
|
Credential Storage Which backend is storing credentials (secure storage vs plaintext file)?
|
|
@@ -461,28 +460,39 @@ Segments:
|
|
|
461
460
|
]
|
|
462
461
|
}
|
|
463
462
|
status values: "pass" | "warn" | "fail"
|
|
464
|
-
Exit code 1 if any check has status "fail"`,examples:["resend doctor","resend doctor --json"]})).action(async(e
|
|
463
|
+
Exit code 1 if any check has status "fail"`,examples:["resend doctor","resend doctor --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=[],i=w()&&!r.json;i&&console.log(`
|
|
465
464
|
Resend Doctor
|
|
466
|
-
`);let o=
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
465
|
+
`);let o=i?ae("Checking CLI version..."):null,s=await Hm();n.push(s),s.status==="warn"?o?.warn(s.message):o?.stop(s.message),o=i?ae("Checking API key..."):null;let a=await Lm(r.apiKey);n.push(a),a.status==="fail"?o?.fail(a.message):o?.stop(a.message),o=i?ae("Checking credential storage..."):null;let l=await at(),d=$e(),c=l.isSecure,u={name:"Credential Storage",status:c?"pass":"warn",message:c?l.name:"plaintext file",...!c&&process.env.RESEND_CREDENTIAL_STORE!=="file"&&(d?.storage==="secure_storage"||process.env.RESEND_CREDENTIAL_STORE==="secure_storage")?{detail:"Secure backend unavailable despite secure storage preference \u2014 falling back to plaintext"}:{}};n.push(u),u.status==="warn"?o?.warn(u.message):o?.stop(u.message),o=i?ae("Validating API key & domains..."):null;let m=await Gm(r.apiKey);n.push(m),m.status==="fail"?o?.fail(m.message):m.status==="warn"?o?.warn(m.message):o?.stop(m.message);let y=n.some(g=>g.status==="fail");!r.json&&w()?console.log(""):B({ok:!y,checks:n},{json:r.json}),y&&process.exit(1)});var il=new p("create").description("Start a claim for a domain another Resend account has verified").option("--name <domain>","Domain name to claim (e.g. example.com)").addOption(new ee("--region <region>","Sending region").choices(["us-east-1","eu-west-1","sa-east-1","ap-northeast-1"])).option("--tracking-subdomain <subdomain>","Subdomain for click and open tracking (e.g. track)").option("--custom-return-path <subdomain>","Subdomain for the Return-Path address (e.g. bounce)").option("--open-tracking","Enable open tracking").option("--no-open-tracking","Disable open tracking").option("--click-tracking","Enable click tracking").option("--no-click-tracking","Disable click tracking").addHelpText("after",f({context:"Non-interactive: --name is required (no prompts when stdin/stdout is not a TTY)",output:" domain_claim object with the placeholder domain_id and the TXT record to add to DNS.",errorCodes:["auth_error","missing_name","create_error"],examples:["resend domains claim create --name example.com","resend domains claim create --name example.com --region eu-west-1","resend domains claim create --name example.com --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=await q(t.name,{message:"Domain name to claim",placeholder:"example.com"},{message:"Missing --name flag.",code:"missing_name"},r);await J({loading:"Starting domain claim...",sdkCall:i=>i.domains.claims.create({name:n,...t.region&&{region:t.region},...t.customReturnPath!==void 0&&{customReturnPath:t.customReturnPath},...t.openTracking!==void 0&&{openTracking:t.openTracking},...t.clickTracking!==void 0&&{clickTracking:t.clickTracking},...t.trackingSubdomain!==void 0&&{trackingSubdomain:t.trackingSubdomain}}),onInteractive:i=>{console.log(`Claim started for ${i.name} (claim id: ${i.id}, domain id: ${i.domain_id})`),console.log(`Status: ${i.status}`),console.log(`
|
|
466
|
+
Add this TXT record at your DNS provider:`),console.log(` ${i.record.name} TXT ${i.record.value}`),console.log(`
|
|
467
|
+
Then run \`resend domains claim verify ${i.domain_id}\`.`)}},r)});var ol=new p("get").description("Retrieve the latest claim for a domain").argument("[id]","Domain ID (the placeholder domain created by the claim)").addHelpText("after",f({output:` domain_claim object: status, domain_id, the TXT record, blocked_reason, expires_at.
|
|
468
|
+
|
|
469
|
+
Claim status values: pending | verified | completed | blocked | expired | superseded | canceled | failed`,errorCodes:["auth_error","fetch_error","not_found"],examples:["resend domains claim get 4dd369bc-aa82-4ff3-97de-514ae3000ee0","resend domains claim get 4dd369bc-aa82-4ff3-97de-514ae3000ee0 --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,De,n);await H({loading:"Fetching domain claim...",sdkCall:o=>o.domains.claims.get(i),onInteractive:o=>{console.log(`${o.name} \u2014 ${o.status}`),console.log(`Claim ID: ${o.id}`),console.log(`Domain ID: ${o.domain_id}`),o.blocked_reason&&console.log(`Blocked: ${o.blocked_reason}`),console.log(`Expires: ${o.expires_at}`),console.log(`
|
|
470
|
+
TXT record:`),console.log(` ${o.record.name} TXT ${o.record.value}`)}},n)});var sl=new p("verify").description("Trigger DNS verification and transfer for a domain claim").argument("[id]","Domain ID (the placeholder domain created by the claim)").addHelpText("after",f({output:" domain_claim object (status stays pending while verification runs async).",errorCodes:["auth_error","verify_error","not_found"],examples:["resend domains claim verify 4dd369bc-aa82-4ff3-97de-514ae3000ee0"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,De,n);await R({loading:"Verifying domain claim...",sdkCall:o=>o.domains.claims.verify(i),errorCode:"verify_error",successMsg:`Domain claim verification started. Check status with resend domains claim get ${i}.`},n)});var al=new p("claim").description("Claim a domain already verified by another Resend account").addHelpText("after",f({context:`Claim lifecycle:
|
|
471
|
+
1. resend domains claim create --name example.com (returns the TXT record)
|
|
472
|
+
2. Configure the TXT record at your DNS provider
|
|
473
|
+
3. resend domains claim verify <domain-id> (trigger verification + transfer)
|
|
474
|
+
4. resend domains claim get <domain-id> (poll until "completed")
|
|
475
|
+
5. The transferred domain has NEW DKIM records \u2014 update DNS, then run:
|
|
476
|
+
resend domains verify <domain-id>`,examples:["resend domains claim create --name example.com","resend domains claim get 4dd369bc-aa82-4ff3-97de-514ae3000ee0","resend domains claim verify 4dd369bc-aa82-4ff3-97de-514ae3000ee0"]})).addCommand(il).addCommand(ol).addCommand(sl);var ll=new p("create").description("Create a new domain and receive DNS records to configure").option("--name <domain>","Domain name (e.g. example.com)").addOption(new ee("--region <region>","Sending region").choices(["us-east-1","eu-west-1","sa-east-1","ap-northeast-1"])).addOption(new ee("--tls <mode>","TLS mode (default: opportunistic)").choices(["opportunistic","enforced"])).option("--tracking-subdomain <subdomain>","Subdomain for click and open tracking (e.g. track)").option("--sending","Enable sending capability (default: enabled)").option("--receiving","Enable receiving capability (default: disabled)").addHelpText("after",f({context:"Non-interactive: --name is required (no prompts when stdin/stdout is not a TTY)",output:" Full domain object with DNS records array to configure in your DNS provider.",errorCodes:["auth_error","missing_name","create_error"],examples:["resend domains create --name example.com","resend domains create --name example.com --region eu-west-1 --tls enforced","resend domains create --name example.com --tracking-subdomain track","resend domains create --name example.com --receiving --json","resend domains create --name example.com --sending --receiving --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=await q(t.name,{message:"Domain name",placeholder:"example.com"},{message:"Missing --name flag.",code:"missing_name"},r);await J({loading:"Creating domain...",sdkCall:i=>i.domains.create({name:n,...t.region&&{region:t.region},...t.tls&&{tls:t.tls},...t.trackingSubdomain&&{trackingSubdomain:t.trackingSubdomain},...(t.sending||t.receiving)&&{capabilities:{...t.sending&&{sending:"enabled"},...t.receiving&&{receiving:"enabled"}}}}),onInteractive:i=>{console.log(`Domain created: ${i.name} (id: ${i.id})`),console.log(`
|
|
477
|
+
DNS Records to configure:`),console.log(Ur(i.records,i.name)),console.log(`
|
|
478
|
+
Run \`resend domains verify ${i.id}\` after configuring DNS.`)}},r)});var cl=new p("delete").alias("rm").description("Delete a domain").argument("[id]","Domain ID").option("--yes","Skip confirmation prompt").addHelpText("after",f({context:"Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.",output:' {"object":"domain","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend domains delete 4dd369bc-aa82-4ff3-97de-514ae3000ee0 --yes","resend domains delete 4dd369bc-aa82-4ff3-97de-514ae3000ee0 --yes --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await le(t,De,n);await re(i.id,!!e.yes,{confirmMessage:`Delete domain "${i.label}"?
|
|
479
|
+
ID: ${i.id}
|
|
480
|
+
This cannot be undone.`,loading:"Deleting domain...",object:"domain",successMsg:"Domain deleted",sdkCall:o=>o.domains.remove(i.id)},n)});var ul=new p("get").description("Retrieve a domain with its DNS records and current verification status").argument("[id]","Domain ID").addHelpText("after",f({output:` Full domain object including records array and current status.
|
|
481
|
+
|
|
482
|
+
Domain status values: not_started | pending | verified | failed | partially_verified | partially_failed`,errorCodes:["auth_error","fetch_error"],examples:["resend domains get 4dd369bc-aa82-4ff3-97de-514ae3000ee0","resend domains get 4dd369bc-aa82-4ff3-97de-514ae3000ee0 --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,De,n);await H({loading:"Fetching domain...",sdkCall:o=>o.domains.get(i),onInteractive:o=>{console.log(`${o.name} \u2014 ${Es(o.status)}`),console.log(`ID: ${o.id}`),console.log(`Region: ${o.region}`),console.log(`Created: ${o.created_at}`),o.open_tracking!==void 0&&console.log(`Open tracking: ${o.open_tracking?"enabled":"disabled"}`),o.click_tracking!==void 0&&console.log(`Click tracking: ${o.click_tracking?"enabled":"disabled"}`),o.tracking_subdomain&&console.log(`Tracking subdomain: ${o.tracking_subdomain}`),o.records.length>0&&(console.log(`
|
|
483
|
+
DNS Records:`),console.log(Ur(o.records,o.name)))}},n)});var dl=new p("list").alias("ls").description("List all domains").option("--limit <n>","Maximum number of domains to return (1-100)","10").option("--after <cursor>","Return domains after this cursor (next page)").option("--before <cursor>","Return domains before this cursor (previous page)").addHelpText("after",f({output:` {"object":"list","data":[...],"has_more":true}
|
|
484
|
+
The list response does not include DNS records \u2014 use "resend domains get <id>" for that.`,errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend domains list","resend domains list --limit 25 --json","resend domains list --after <cursor> --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=L(t.limit,r),i=G(n,t.after,t.before,r);await P({loading:"Fetching domains...",sdkCall:o=>o.domains.list(i),onInteractive:o=>{console.log($s(o.data)),M(o,"domains list",{limit:n,before:t.before,apiKey:r.apiKey,profile:r.profile})}},r)});var ml=new p("update").description("Update domain settings: TLS mode, tracking, and tracking subdomain").argument("[id]","Domain ID").addOption(new ee("--tls <mode>","TLS mode").choices(["opportunistic","enforced"])).option("--open-tracking","Enable open tracking").option("--no-open-tracking","Disable open tracking").option("--click-tracking","Enable click tracking").option("--no-click-tracking","Disable click tracking").option("--tracking-subdomain <subdomain>","Subdomain for click and open tracking (e.g. track)").addHelpText("after",f({output:' {"object":"domain","id":"<id>"}',errorCodes:["auth_error","no_changes","update_error"],examples:["resend domains update <id> --tls enforced","resend domains update <id> --open-tracking --click-tracking","resend domains update <id> --tracking-subdomain track","resend domains update <id> --no-open-tracking --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,De,n),{tls:o,openTracking:s,clickTracking:a,trackingSubdomain:l}=e;!o&&s===void 0&&a===void 0&&!l&&h({message:"Provide at least one option to update: --tls, --open-tracking, --click-tracking, or --tracking-subdomain.",code:"no_changes"},{json:n.json});let d={id:i};o&&(d.tls=o),s!==void 0&&(d.openTracking=s),a!==void 0&&(d.clickTracking=a),l&&(d.trackingSubdomain=l),await R({loading:"Updating domain...",sdkCall:c=>c.domains.update(d),errorCode:"update_error",successMsg:`Domain updated: ${i}`},n)});var pl=new p("verify").description("Trigger async DNS verification for a domain").argument("[id]","Domain ID").addHelpText("after",f({context:`Verification is async \u2014 the domain enters "pending" status while DNS records are checked.
|
|
485
|
+
Poll the status with: resend domains get <id>`,output:' {"object":"domain","id":"<id>"}',errorCodes:["auth_error","verify_error"],examples:["resend domains verify 4dd369bc-aa82-4ff3-97de-514ae3000ee0","resend domains verify 4dd369bc-aa82-4ff3-97de-514ae3000ee0 --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,De,n);await R({loading:"Verifying domain...",sdkCall:o=>o.domains.verify(i),errorCode:"verify_error",successMsg:`Domain verification started. Check status with resend domains get ${i}.`},n)});var fl=new p("domains").description("Manage verified sending and receiving domains").addHelpText("after",f({context:`Domain lifecycle:
|
|
476
486
|
1. resend domains create --name example.com (get DNS records)
|
|
477
487
|
2. Configure DNS records at your DNS provider
|
|
478
488
|
3. resend domains verify <id> (trigger verification)
|
|
479
|
-
4. resend domains get <id> (poll until "verified")`,examples:["resend domains list","resend domains create --name example.com --region us-east-1","resend domains verify 4dd369bc-aa82-4ff3-97de-514ae3000ee0","resend domains get 4dd369bc-aa82-4ff3-97de-514ae3000ee0","resend domains update <id> --tls enforced --open-tracking","resend domains delete <id> --yes"]})).addCommand(
|
|
480
|
-
resend emails attachment <emailId> <attachmentId> --json | jq -r .download_url | xargs curl -O`,output:' {"object":"attachment","id":"<uuid>","filename":"invoice.pdf","size":51200,"content_type":"application/pdf","content_disposition":"attachment","content_id":null,"download_url":"<signed-url>","expires_at":"<iso-date>"}',errorCodes:["auth_error","fetch_error"],examples:["resend emails attachment <email-id> <attachment-id>","resend emails attachment <email-id> <attachment-id> --json"]})).action(async(e,
|
|
489
|
+
4. resend domains get <id> (poll until "verified")`,examples:["resend domains list","resend domains create --name example.com --region us-east-1","resend domains verify 4dd369bc-aa82-4ff3-97de-514ae3000ee0","resend domains get 4dd369bc-aa82-4ff3-97de-514ae3000ee0","resend domains update <id> --tls enforced --open-tracking","resend domains delete <id> --yes","resend domains claim create --name example.com"]})).addCommand(ll).addCommand(pl).addCommand(ul).addCommand(dl,{isDefault:!0}).addCommand(ml).addCommand(cl).addCommand(al);var Ke={resource:"email",resourcePlural:"emails",fetchItems:(t,{limit:e,after:r})=>t.emails.list({limit:e,...r&&{after:r}}),display:t=>({label:t.subject||"(no subject)",hint:t.id})};function hl(t){return{resource:"attachment",resourcePlural:"attachments",fetchItems:(e,{limit:r,after:n})=>e.emails.attachments.list({emailId:t,limit:r,...n&&{after:n}}),display:e=>({label:e.filename??"(unnamed)",hint:e.id})}}function nn(t){let e=t.map(r=>[r.filename??"(unnamed)",r.content_type,String(r.size),r.id]);return N(["Filename","Content-Type","Size (bytes)","ID"],e,"(no attachments)")}var gl=new p("attachment").description("Retrieve a single attachment from a sent (outbound) email").argument("[emailId]","Email UUID").argument("[attachmentId]","Attachment UUID").addHelpText("after",f({context:`The download_url is a signed URL that expires in ~1 hour. Download the file directly:
|
|
490
|
+
resend emails attachment <emailId> <attachmentId> --json | jq -r .download_url | xargs curl -O`,output:' {"object":"attachment","id":"<uuid>","filename":"invoice.pdf","size":51200,"content_type":"application/pdf","content_disposition":"attachment","content_id":null,"download_url":"<signed-url>","expires_at":"<iso-date>"}',errorCodes:["auth_error","fetch_error"],examples:["resend emails attachment <email-id> <attachment-id>","resend emails attachment <email-id> <attachment-id> --json"]})).action(async(t,e,r,n)=>{let i=n.optsWithGlobals(),o=await C(t,Ke,i),s=await C(e,hl(o),i);await H({loading:"Fetching attachment...",sdkCall:a=>a.emails.attachments.get({emailId:o,id:s}),onInteractive:a=>{console.log(`${a.filename??"(unnamed)"}`),console.log(`ID: ${a.id}`),console.log(`Content-Type: ${a.content_type}`),console.log(`Size: ${a.size} bytes`),console.log(`Disposition: ${a.content_disposition}`),console.log(`Download URL: ${a.download_url}`),console.log(`Expires: ${a.expires_at}`)}},i)});var bl=new p("attachments").description("List attachments on a sent (outbound) email").argument("[emailId]","Email UUID").option("--limit <n>","Maximum number of attachments to return (1-100)","10").option("--after <cursor>","Return attachments after this cursor (next page)").option("--before <cursor>","Return attachments before this cursor (previous page)").addHelpText("after",f({context:`Each attachment has a download_url (signed, expires ~1 hour).
|
|
481
491
|
Use the attachment sub-command to retrieve a single attachment with its download URL:
|
|
482
492
|
resend emails attachment <emailId> <attachmentId>
|
|
483
493
|
|
|
484
494
|
content_disposition: "inline" means the attachment is embedded in the HTML body (e.g. an image).
|
|
485
|
-
content_disposition: "attachment" means it is a standalone file download.`,output:' {"object":"list","has_more":false,"data":[{"id":"<uuid>","filename":"invoice.pdf","size":51200,"content_type":"application/pdf","content_disposition":"attachment","content_id":null,"download_url":"<url>","expires_at":"<iso-date>"}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend emails attachments <email-id>","resend emails attachments <email-id> --json","resend emails attachments <email-id> --limit 25 --json"]})).action(async(e,
|
|
495
|
+
content_disposition: "attachment" means it is a standalone file download.`,output:' {"object":"list","has_more":false,"data":[{"id":"<uuid>","filename":"invoice.pdf","size":51200,"content_type":"application/pdf","content_disposition":"attachment","content_id":null,"download_url":"<url>","expires_at":"<iso-date>"}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend emails attachments <email-id>","resend emails attachments <email-id> --json","resend emails attachments <email-id> --limit 25 --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Ke,n),o=L(e.limit,n),s=G(o,e.after,e.before,n);await P({loading:"Fetching attachments...",sdkCall:a=>a.emails.attachments.list({emailId:i,...s}),onInteractive:a=>{console.log(nn(a.data)),M(a,`emails attachments ${i}`,{limit:o,before:e.before,apiKey:n.apiKey,profile:n.profile})}},n)});z();var yl=new p("batch").description("Send up to 100 emails in a single API request from a JSON file").option("--file <path>",'Path to a JSON file containing an array of email objects (use "-" for stdin; required in non-interactive mode)').option("--react-email <path>","Path to a React Email template (.tsx) \u2014 rendered HTML is set on every email in the batch").option("--idempotency-key <key>","Deduplicate this batch request using this key").addOption(new ee("--batch-validation <mode>","Validation mode: strict (default, fail all on error) or permissive (partial success)").choices(["strict","permissive"])).addHelpText("after",f({context:`Non-interactive: --file
|
|
486
496
|
Limit: 100 emails per request (API hard limit \u2014 warned if exceeded)
|
|
487
497
|
Unsupported per-email fields: attachments, scheduled_at
|
|
488
498
|
|
|
@@ -490,53 +500,53 @@ File format (--file path):
|
|
|
490
500
|
[
|
|
491
501
|
{"from":"onboarding@resend.com","to":["delivered@resend.com"],"subject":"Hello","text":"Hi"},
|
|
492
502
|
{"from":"onboarding@resend.com","to":["delivered@resend.com"],"subject":"Hello","html":"<b>Hi</b>"}
|
|
493
|
-
]`,output:' [{"id":"<email-id>"},{"id":"<email-id>"}]',errorCodes:["auth_error","missing_file","file_read_error","stdin_read_error","invalid_json","invalid_format","react_email_build_error","react_email_render_error","batch_error"],examples:["resend emails batch --file ./emails.json","resend emails batch --file ./emails.json --batch-validation permissive",`echo '[{"from":"onboarding@resend.com","to":["delivered@resend.com"],"subject":"Hi","text":"Hello"}]' | resend emails batch --file -`]})).action(async(e
|
|
494
|
-
${
|
|
495
|
-
resend emails receiving attachment <emailId> <attachmentId> --json | jq -r .download_url | xargs curl -O`,output:' {"object":"attachment","id":"<uuid>","filename":"invoice.pdf","size":51200,"content_type":"application/pdf","content_disposition":"attachment","content_id":null,"download_url":"<signed-url>","expires_at":"<iso-date>"}',errorCodes:["auth_error","fetch_error"],examples:["resend emails receiving attachment <email-id> <attachment-id>","resend emails receiving attachment <email-id> <attachment-id> --json"]})).action(async(e,
|
|
503
|
+
]`,output:' [{"id":"<email-id>"},{"id":"<email-id>"}]',errorCodes:["auth_error","missing_file","file_read_error","stdin_read_error","invalid_json","invalid_format","react_email_build_error","react_email_render_error","batch_error"],examples:["resend emails batch --file ./emails.json","resend emails batch --file ./emails.json --batch-validation permissive",`echo '[{"from":"onboarding@resend.com","to":["delivered@resend.com"],"subject":"Hi","text":"Hello"}]' | resend emails batch --file -`]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=await X(r,{permission:"sending_access"}),i=await q(t.file,{message:"Path to JSON file",placeholder:"./emails.json"},{message:"Missing --file flag. Provide a JSON file with an array of email objects.",code:"missing_file"},r),o=ce(i,r),s;try{s=JSON.parse(o)}catch{h({message:"File content is not valid JSON.",code:"invalid_json"},{json:r.json})}Array.isArray(s)||h({message:"File content must be a JSON array of email objects.",code:"invalid_format"},{json:r.json});let a=s;if(a.length>100&&console.warn(`Warning: ${a.length} emails exceeds the 100-email limit. The API may reject this request.`),t.reactEmail){let u=await Ne(t.reactEmail,r);for(let m of a)m.html=u}for(let u=0;u<a.length;u++){let m=a[u];(m===null||typeof m!="object"||Array.isArray(m))&&h({message:`Email at index ${u} must be a JSON object.`,code:"invalid_format"},{json:r.json}),"attachments"in m&&h({message:`Email at index ${u} contains "attachments", which is not supported in batch sends.`,code:"batch_error"},{json:r.json}),"scheduled_at"in m&&h({message:`Email at index ${u} contains "scheduled_at", which is not supported in batch sends.`,code:"batch_error"},{json:r.json})}let l=await Ee("Sending batch...",()=>{let u={...t.idempotencyKey&&{idempotencyKey:t.idempotencyKey},...t.batchValidation&&{batchValidation:t.batchValidation}};return n.batch.send(a,Object.keys(u).length>0?u:void 0)},"batch_error",r),d=l.data,c=l.errors;if(!r.json&&w()){console.log(`Sent ${d.length} email${d.length===1?"":"s"}`);for(let u of d)console.log(` ${u.id}`);if(c&&c.length>0){console.warn(`
|
|
504
|
+
${c.length} email${c.length===1?"":"s"} failed:`);for(let u of c)console.warn(` [${u.index}] ${u.message}`)}}else B(c&&c.length>0?{data:d,errors:c}:d,{json:r.json})});var vl=new p("cancel").description("Cancel a scheduled email").argument("[id]","Email ID").addHelpText("after",f({output:' {"object":"email","id":"<email-id>"}',errorCodes:["auth_error","cancel_error"],examples:["resend emails cancel <email-id>","resend emails cancel <email-id> --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Ke,n);await R({loading:"Cancelling email...",sdkCall:o=>o.emails.cancel(i),errorCode:"cancel_error",successMsg:`Email cancelled: ${i}`},n)});var Cl=new p("get").description("Retrieve a sent email by ID").argument("[id]","Email ID").addHelpText("after",f({output:' {"object":"email","id":"<uuid>","from":"onboarding@resend.com","to":["delivered@resend.com"],"subject":"Hello","html":"<p>Hi</p>","text":"Hi","last_event":"delivered","created_at":"<iso-date>","scheduled_at":null,"bcc":null,"cc":null,"reply_to":null}',errorCodes:["auth_error","fetch_error"],examples:["resend emails get <email-id>","resend emails get <email-id> --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Ke,n);await H({loading:"Fetching email...",sdkCall:o=>o.emails.get(i),onInteractive:o=>{console.log(`From: ${o.from}`),console.log(`To: ${o.to.join(", ")}`),console.log(`Subject: ${o.subject}`),console.log(`Status: ${o.last_event}`),console.log(`Date: ${o.created_at}`),o.scheduled_at&&console.log(`Scheduled: ${o.scheduled_at}`)}},n)});function Mm(t){let e=t.map(r=>{let n=r.to.join(", "),i=n.length>40?`${n.slice(0,37)}...`:n,o=r.subject.length>50?`${r.subject.slice(0,47)}...`:r.subject;return[r.from,i,o,r.last_event??"\u2014",r.created_at,r.id]});return N(["From","To","Subject","Status","Created","ID"],e,"(no sent emails)")}var wl=new p("list").alias("ls").description('List sent emails \u2014 returns summary (use "get <id>" for full details)').option("--limit <n>","Maximum number of emails 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",f({context:"Lists emails sent by your team. For emails received by your domain, use: resend emails receiving list",output:' {"object":"list","has_more":false,"data":[{"id":"...","to":["..."],"from":"...","subject":"...","created_at":"...","last_event":"delivered|opened|...","scheduled_at":null}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend emails list","resend emails list --limit 5","resend emails list --after <email-id> --limit 10","resend emails list --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=L(t.limit,r),i=G(n,t.after,t.before,r);await P({loading:"Fetching sent emails...",sdkCall:o=>o.emails.list(i),onInteractive:o=>{console.log(Mm(o.data)),M(o,"emails list",{limit:n,before:t.before,apiKey:r.apiKey,profile:r.profile})}},r)});var dt={resource:"received email",resourcePlural:"received emails",fetchItems:(t,{limit:e,after:r})=>t.emails.receiving.list({limit:e,...r&&{after:r}}),display:t=>({label:t.subject||"(no subject)",hint:t.id})};function _l(t){return{resource:"attachment",resourcePlural:"attachments",fetchItems:(e,{limit:r,after:n})=>e.emails.receiving.attachments.list({emailId:t,limit:r,...n&&{after:n}}),display:e=>({label:e.filename??"(unnamed)",hint:e.id})}}function xl(t){let e=t.map(r=>{let n=r.to.join(", "),i=n.length>40?`${n.slice(0,37)}...`:n,o=r.subject.length>50?`${r.subject.slice(0,47)}...`:r.subject;return[r.from,i,o,r.created_at,r.id]});return N(["From","To","Subject","Created At","ID"],e,"(no received emails)")}var Al=new p("attachment").description("Retrieve a single attachment from a received (inbound) email").argument("[emailId]","Received email UUID").argument("[attachmentId]","Attachment UUID").addHelpText("after",f({context:`The download_url is a signed URL that expires in ~1 hour. Download the file directly:
|
|
505
|
+
resend emails receiving attachment <emailId> <attachmentId> --json | jq -r .download_url | xargs curl -O`,output:' {"object":"attachment","id":"<uuid>","filename":"invoice.pdf","size":51200,"content_type":"application/pdf","content_disposition":"attachment","content_id":null,"download_url":"<signed-url>","expires_at":"<iso-date>"}',errorCodes:["auth_error","fetch_error"],examples:["resend emails receiving attachment <email-id> <attachment-id>","resend emails receiving attachment <email-id> <attachment-id> --json"]})).action(async(t,e,r,n)=>{let i=n.optsWithGlobals(),o=await C(t,dt,i),s=await C(e,_l(o),i);await H({loading:"Fetching attachment...",sdkCall:a=>a.emails.receiving.attachments.get({emailId:o,id:s}),onInteractive:a=>{console.log(`${a.filename??"(unnamed)"}`),console.log(`ID: ${a.id}`),console.log(`Content-Type: ${a.content_type}`),console.log(`Size: ${a.size} bytes`),console.log(`Disposition: ${a.content_disposition}`),console.log(`Download URL: ${a.download_url}`),console.log(`Expires: ${a.expires_at}`)}},i)});var kl=new p("attachments").description("List attachments on a received (inbound) email").argument("[emailId]","Received email UUID").option("--limit <n>","Maximum number of attachments to return (1-100)","10").option("--after <cursor>","Return attachments after this cursor (next page)").option("--before <cursor>","Return attachments before this cursor (previous page)").addHelpText("after",f({context:`Each attachment has a download_url (signed, expires ~1 hour).
|
|
496
506
|
Use the attachment sub-command to retrieve a single attachment with its download URL:
|
|
497
507
|
resend emails receiving attachment <emailId> <attachmentId>
|
|
498
508
|
|
|
499
509
|
content_disposition: "inline" means the attachment is embedded in the HTML body (e.g. an image).
|
|
500
|
-
content_disposition: "attachment" means it is a standalone file download.`,output:' {"object":"list","has_more":false,"data":[{"id":"<uuid>","filename":"invoice.pdf","size":51200,"content_type":"application/pdf","content_disposition":"attachment","content_id":null,"download_url":"<url>","expires_at":"<iso-date>"}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend emails receiving attachments <email-id>","resend emails receiving attachments <email-id> --json","resend emails receiving attachments <email-id> --limit 25 --json"]})).action(async(e,
|
|
501
|
-
Forwards the original email content (passthrough mode).`,output:' {"id":"<email-id>"}',errorCodes:["auth_error","create_error"],examples:["resend emails receiving forward <email-id> --to delivered@resend.com --from onboarding@resend.com","resend emails receiving forward <email-id> --to delivered@resend.com --from onboarding@resend.com --json"]})).action(async(e,
|
|
510
|
+
content_disposition: "attachment" means it is a standalone file download.`,output:' {"object":"list","has_more":false,"data":[{"id":"<uuid>","filename":"invoice.pdf","size":51200,"content_type":"application/pdf","content_disposition":"attachment","content_id":null,"download_url":"<url>","expires_at":"<iso-date>"}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend emails receiving attachments <email-id>","resend emails receiving attachments <email-id> --json","resend emails receiving attachments <email-id> --limit 25 --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,dt,n),o=L(e.limit,n),s=G(o,e.after,e.before,n);await P({loading:"Fetching attachments...",sdkCall:a=>a.emails.receiving.attachments.list({emailId:i,...s}),onInteractive:a=>{console.log(nn(a.data)),M(a,`emails receiving attachments ${i}`,{limit:o,before:e.before,apiKey:n.apiKey,profile:n.profile})}},n)});var $l=new p("forward").description("Forward a received email").argument("[id]","Received email ID").requiredOption("--to <addresses...>","Recipient address(es)").requiredOption("--from <address>","Sender address").addHelpText("after",f({context:`Required: --to, --from
|
|
511
|
+
Forwards the original email content (passthrough mode).`,output:' {"id":"<email-id>"}',errorCodes:["auth_error","create_error"],examples:["resend emails receiving forward <email-id> --to delivered@resend.com --from onboarding@resend.com","resend emails receiving forward <email-id> --to delivered@resend.com --from onboarding@resend.com --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,dt,n);await J({loading:"Forwarding email...",sdkCall:o=>o.emails.receiving.forward({emailId:i,to:e.to,from:e.from}),onInteractive:o=>{console.log(`Email forwarded: ${o.id}`)}},n)});var El=new p("get").description("Retrieve a single received (inbound) email with full details including HTML, text, and headers").argument("[id]","Received email UUID").addHelpText("after",f({context:`The raw.download_url field is a signed URL (expires ~1 hour) containing the full RFC 2822
|
|
502
512
|
MIME message. Pipe it to curl to save the original email:
|
|
503
513
|
resend emails receiving get <id> --json | jq -r .raw.download_url | xargs curl > email.eml
|
|
504
514
|
|
|
505
515
|
Attachments are listed in the attachments array. Use the attachments sub-command to get
|
|
506
516
|
download URLs:
|
|
507
|
-
resend emails receiving attachments <id>`,output:' {"object":"email","id":"<uuid>","to":["inbox@example.com"],"from":"sender@external.com","subject":"Hello","html":"<p>Hello!</p>","text":"Hello!","headers":{"x-mailer":"..."},"message_id":"<str>","bcc":[],"cc":[],"reply_to":[],"raw":{"download_url":"<url>","expires_at":"<iso-date>"},"attachments":[]}',errorCodes:["auth_error","fetch_error"],examples:["resend emails receiving get <email-id>","resend emails receiving get <email-id> --json"]})).action(async(e,
|
|
508
|
-
(HTML body only \u2014 use --json to view or pipe to a browser)`)}},
|
|
517
|
+
resend emails receiving attachments <id>`,output:' {"object":"email","id":"<uuid>","to":["inbox@example.com"],"from":"sender@external.com","subject":"Hello","html":"<p>Hello!</p>","text":"Hello!","headers":{"x-mailer":"..."},"message_id":"<str>","bcc":[],"cc":[],"reply_to":[],"raw":{"download_url":"<url>","expires_at":"<iso-date>"},"attachments":[]}',errorCodes:["auth_error","fetch_error"],examples:["resend emails receiving get <email-id>","resend emails receiving get <email-id> --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,dt,n);await H({loading:"Fetching received email...",sdkCall:o=>o.emails.receiving.get(i),onInteractive:o=>{if(console.log(`From: ${o.from}`),console.log(`To: ${o.to.join(", ")}`),console.log(`Subject: ${o.subject}`),console.log(`Date: ${o.created_at}`),o.attachments.length>0&&console.log(`Files: ${o.attachments.length} attachment(s)`),o.text){let s=o.text.length>200?`${o.text.slice(0,197)}...`:o.text;console.log(`${s}`)}else o.html&&console.log(`
|
|
518
|
+
(HTML body only \u2014 use --json to view or pipe to a browser)`)}},n)});var Dl=new p("list").alias("ls").description("List received (inbound) emails for domains with receiving enabled").option("--limit <n>","Maximum number of emails to return (1-100)","10").option("--after <cursor>","Return emails after this cursor (next page)").option("--before <cursor>","Return emails before this cursor (previous page)").addHelpText("after",f({context:`Receiving must be enabled on the domain first:
|
|
509
519
|
resend domains update <id> --receiving enabled
|
|
510
520
|
|
|
511
521
|
Pagination: use --after or --before with a received email ID as the cursor.
|
|
512
522
|
Only one of --after or --before may be used at a time.
|
|
513
|
-
The response includes has_more: true when additional pages exist.`,output:' {"object":"list","has_more":false,"data":[{"id":"<uuid>","to":["inbox@example.com"],"from":"sender@external.com","subject":"Hello","created_at":"<iso-date>","message_id":"<str>","bcc":null,"cc":null,"reply_to":null,"attachments":[]}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend emails receiving list","resend emails receiving list --limit 25 --json","resend emails receiving list --after <email-id> --json"]})).action(async(e
|
|
514
|
-
`)}},
|
|
523
|
+
The response includes has_more: true when additional pages exist.`,output:' {"object":"list","has_more":false,"data":[{"id":"<uuid>","to":["inbox@example.com"],"from":"sender@external.com","subject":"Hello","created_at":"<iso-date>","message_id":"<str>","bcc":null,"cc":null,"reply_to":null,"attachments":[]}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend emails receiving list","resend emails receiving list --limit 25 --json","resend emails receiving list --after <email-id> --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=L(t.limit,r),i=G(n,t.after,t.before,r);await P({loading:"Fetching received emails...",sdkCall:o=>o.emails.receiving.list(i),onInteractive:o=>{console.log(xl(o.data)),M(o,"emails receiving list",{limit:n,before:t.before,apiKey:r.apiKey,profile:r.profile})}},r)});var Xe=pe(et(),1);z();var Sl=(t=1e4)=>{if(!Number.isInteger(t)||t<1)throw new RangeError(`maxSize must be a positive integer, got ${t}`);let e=new Map,r=()=>{let n=e.keys().next();n.done||e.delete(n.value)};return{has:n=>e.has(n)?(e.delete(n),e.set(n,!0),!0):!1,add:n=>{if(e.has(n)){e.delete(n),e.set(n,!0);return}e.size>=t&&r(),e.set(n,!0)},size:()=>e.size}};var gi=100,Tl=5,bi=()=>new Date().toLocaleTimeString("en-GB",{hour12:!1}),qm=(t,e)=>{if(e)console.log(JSON.stringify(t));else{let r=t.to.map(_e).join(", "),n=Xe.default.dim(`[${bi()}]`),i=_e(t.subject),o=i.length>50?`${i.slice(0,47)}...`:i,s=_e(t.from),a=_e(t.id);process.stderr.write(`${n} ${s} -> ${r} ${Xe.default.bold(`"${o}"`)} ${Xe.default.dim(a)}
|
|
524
|
+
`)}},Um=(t,e)=>{let r=t.findIndex(n=>e.has(n.id));return r===-1?{newEmails:t,foundSeen:!1}:{newEmails:t.slice(0,r),foundSeen:!0}},Ol=new p("listen").description("Poll for new inbound emails and display them as they arrive").option("--interval <seconds>","Polling interval in seconds (minimum 2)","5").addHelpText("after",f({context:`Long-running command that polls the receiving API at a fixed
|
|
515
525
|
interval and prints each new email as it arrives.
|
|
516
526
|
|
|
517
527
|
Interactive output shows one line per email. When piped (or with --json),
|
|
518
528
|
output is NDJSON (one JSON object per line).
|
|
519
529
|
|
|
520
|
-
Ctrl+C exits cleanly.`,examples:["resend emails receiving listen","resend emails receiving listen --interval 10","resend emails receiving listen --json | head -3"]})).action(async(e
|
|
521
|
-
`),process.stderr.write(` ${
|
|
530
|
+
Ctrl+C exits cleanly.`,examples:["resend emails receiving listen","resend emails receiving listen --interval 10","resend emails receiving listen --json | head -3"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=Number.parseInt(t.interval??"5",10);(Number.isNaN(n)||n<2)&&h({message:"Polling interval must be at least 2 seconds.",code:"invalid_interval"},{json:r.json});let i=await X(r),o=r.json||!w(),s=ae("Connecting...",r.quiet||o),a=Sl(),l=0;try{let{data:b,error:_}=await i.emails.receiving.list({limit:1});(_||!b)&&(s.fail("Failed to connect"),h({message:_?.message??"Unexpected empty response",code:"list_error"},{json:r.json}));for(let A of b.data)a.add(A.id);s.stop("Ready")}catch(b){s.fail("Failed to connect"),h({message:V(b,"Unknown error"),code:"list_error"},{json:r.json})}o||(process.stderr.write(`
|
|
531
|
+
`),process.stderr.write(` ${Xe.default.bold("Polling:")} every ${n}s
|
|
522
532
|
`),process.stderr.write(`
|
|
523
533
|
Listening for new inbound emails. Press Ctrl+C to stop.
|
|
524
534
|
|
|
525
|
-
`));let d=
|
|
526
|
-
`),
|
|
527
|
-
`)},
|
|
535
|
+
`));let d=b=>{l++,o||process.stderr.write(`${Xe.default.dim(`[${bi()}]`)} ${Xe.default.yellow("Warning:")} ${b}
|
|
536
|
+
`),l>=5&&h({message:"Exiting after 5 consecutive API failures.",code:"poll_error"},{json:r.json})},c=async(b,_,A)=>{if(A<=0)return{emails:_,hasMore:!0};let x=b?{limit:gi,after:b}:{limit:gi},{data:$,error:F}=await sr(()=>i.emails.receiving.list(x));if(F||!$)return{emails:_,error:F?.message??"Empty response",hasMore:!1};let{newEmails:D,foundSeen:O}=Um($.data,a),T=[..._,...D];if(O||!$.has_more)return{emails:T,hasMore:!1};let E=$.data[$.data.length-1]?.id;return E?c(E,T,A-1):{emails:T,hasMore:!0}},u,m=()=>{let b=`Hit page cap of ${Tl*gi} emails this poll; remaining will be picked up next tick.`;o?console.log(JSON.stringify({warning:"page_cap_reached",message:b})):process.stderr.write(`${Xe.default.dim(`[${bi()}]`)} ${Xe.default.yellow("Warning:")} ${b}
|
|
537
|
+
`)},y=async()=>{try{let b=await c(void 0,[],Tl);b.error&&d(b.error),b.hasMore&&m();let _=b.emails.toReversed();for(let A of _)a.add(A.id);if(b.emails.length>0){l=0;for(let A of _)qm(A,o)}else b.error||(l=0)}catch(b){d(V(b,"Unknown error"))}finally{u=setTimeout(y,n*1e3)}};u=setTimeout(y,n*1e3);let g=()=>{clearTimeout(u),o||process.stderr.write(`
|
|
528
538
|
Stopped listening.
|
|
529
|
-
`),process.exit(
|
|
530
|
-
resend domains update <id> --receiving enabled`,examples:["resend emails receiving list","resend emails receiving listen","resend emails receiving get <email-id>","resend emails receiving attachments <email-id>","resend emails receiving attachment <email-id> <attachment-id>","resend emails receiving forward <email-id> --to delivered@resend.com --from onboarding@resend.com"]})).addCommand(
|
|
531
|
-
Use --dry-run to print the request JSON without sending (attachments show filename and byteLength only).`,output:' {"id":"<email-id>"}',errorCodes:["auth_error","missing_body","file_read_error","invalid_options","stdin_read_error","invalid_header","invalid_tag","invalid_var","template_body_conflict","template_attachment_conflict","react_email_build_error","react_email_render_error","send_error"],examples:['resend emails send --from onboarding@resend.com --to delivered@resend.com --subject "Hello" --text "Hi"','resend emails send --from onboarding@resend.com --to delivered@resend.com --subject "Hello" --html "<b>Hi</b>"','resend emails send --from onboarding@resend.com --to delivered@resend.com --subject "Hello" --text "Hi" --attachment ./report.pdf',"resend emails send --template tmpl_123 --to delivered@resend.com"]})).action(async(e
|
|
532
|
-
`),
|
|
533
|
-
`),d=
|
|
539
|
+
`),process.exit(It())};Gr(g),process.on("SIGTERM",g),await new Promise(()=>{})});var Il=new p("receiving").description("Manage received (inbound) emails \u2014 requires domain receiving to be enabled").addHelpText("after",f({context:`Receiving must be enabled on the domain first:
|
|
540
|
+
resend domains update <id> --receiving enabled`,examples:["resend emails receiving list","resend emails receiving listen","resend emails receiving get <email-id>","resend emails receiving attachments <email-id>","resend emails receiving attachment <email-id> <attachment-id>","resend emails receiving forward <email-id> --to delivered@resend.com --from onboarding@resend.com"]})).addCommand(Dl,{isDefault:!0}).addCommand(El).addCommand(Ol).addCommand(kl).addCommand(Al).addCommand($l);var Pl=require("node:fs"),jl=require("node:path");z();function Wm(t){let{attachments:e,...r}=t;return e?.length?{...r,attachments:e.map(n=>({filename:n.filename,byteLength:Buffer.isBuffer(n.content)?n.content.byteLength:Buffer.byteLength(String(n.content),"utf8")}))}:r}var Rl=new p("send").description("Send an email").option("--from <address>","Sender address (required unless using --template)").option("--to <addresses...>","Recipient address(es) (required)").option("--subject <subject>","Email subject (required unless using --template)").option("--html <html>","HTML body").option("--html-file <path>",'Path to an HTML file for the body (use "-" for stdin)').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 send").option("--cc <addresses...>","CC recipients").option("--bcc <addresses...>","BCC recipients").option("--reply-to <address>","Reply-to address").option("--scheduled-at <datetime>",'Schedule email for later \u2014 ISO 8601 or natural language e.g. "in 1 hour", "tomorrow at 9am ET"').option("--attachment <paths...>","File path(s) to attach").option("--headers <key=value...>","Custom headers as key=value pairs (e.g. X-Entity-Ref-ID=123)").option("--tags <name=value...>","Email tags as name=value pairs (e.g. category=marketing)").option("--idempotency-key <key>","Deduplicate this send request using this key").option("--dry-run","Validate input and print the request JSON without calling the API (interactive: verified-domain list is not fetched)").option("--template <id>","Template ID to use").option("--var <key=value...>","Template variables as key=value pairs (repeatable, e.g. --var name=John --var count=42)").addHelpText("after",f({context:`Required: --to and either --template, --react-email, or (--from, --subject, and one of --text | --text-file | --html | --html-file).
|
|
541
|
+
Use --dry-run to print the request JSON without sending (attachments show filename and byteLength only).`,output:' {"id":"<email-id>"}',errorCodes:["auth_error","missing_body","file_read_error","invalid_options","stdin_read_error","invalid_header","invalid_tag","invalid_var","template_body_conflict","template_attachment_conflict","react_email_build_error","react_email_render_error","send_error"],examples:['resend emails send --from onboarding@resend.com --to delivered@resend.com --subject "Hello" --text "Hi"','resend emails send --from onboarding@resend.com --to delivered@resend.com --subject "Hello" --html "<b>Hi</b>"','resend emails send --from onboarding@resend.com --to delivered@resend.com --subject "Hello" --text "Hi" --attachment ./report.pdf',"resend emails send --template tmpl_123 --to delivered@resend.com"]})).action(async(t,e)=>{let r=e.optsWithGlobals();t.htmlFile==="-"&&t.textFile==="-"&&h({message:"Cannot read both --html-file and --text-file from stdin. Pipe to one and pass the other as a file path.",code:"invalid_options"},{json:r.json}),t.from===""&&h({message:"--from cannot be empty",code:"invalid_options"},{json:r.json});let n=!!t.template;t.var&&!n&&h({message:"--var can only be used with --template",code:"invalid_var"},{json:r.json}),t.reactEmail&&(t.html||t.htmlFile||n)&&h({message:"Cannot use --react-email with --html, --html-file, or --template",code:"invalid_options"},{json:r.json}),n&&(t.html||t.htmlFile||t.text||t.textFile)&&h({message:"Cannot use --template with --html, --html-file, --text, or --text-file",code:"template_body_conflict"},{json:r.json}),n&&t.attachment&&h({message:"Cannot use --attachment with --template",code:"template_attachment_conflict"},{json:r.json});let i=t.var?Object.fromEntries(t.var.map(x=>{let $=x.indexOf("=");$<1&&h({message:`Invalid var format: "${x}". Expected key=value.`,code:"invalid_var"},{json:r.json});let F=x.slice(0,$),D=x.slice($+1);return[F,D]})):void 0,o=t.from;if(!t.dryRun&&!o&&!n&&w()&&!r.json){let x=await X(r,{permission:"sending_access"}),$=await Kr(x);$.length>0&&(o=await zr($))}let s=[{flag:"from",message:"From address",placeholder:"onboarding@resend.dev",defaultValue:"onboarding@resend.dev",required:!n},{flag:"to",message:"To address",placeholder:"delivered@resend.dev",defaultValue:"delivered@resend.dev"},{flag:"subject",message:"Subject",placeholder:"Hello!",defaultValue:"Hello!",required:!n}],a=await As({from:o,to:t.to?.[0],subject:t.subject},s,r),l=t.html,d=t.text;t.htmlFile&&(t.html&&process.stderr.write(`Warning: both --html and --html-file provided; using --html-file
|
|
542
|
+
`),l=ce(t.htmlFile,r)),t.textFile&&(t.text&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
|
|
543
|
+
`),d=ce(t.textFile,r)),t.reactEmail&&(l=await Ne(t.reactEmail,r));let c=d;!n&&!t.reactEmail&&!l&&!d&&(c=await q(void 0,{message:"Email body (plain text)",placeholder:"Hello, World!",defaultValue:"Hello, World!"},{message:"Missing email body. Provide --html, --html-file, --text, --text-file, or --react-email",code:"missing_body"},r));let u=t.to??[a.to],m=t.attachment?.map(x=>{try{let $=(0,Pl.readFileSync)(x);return{filename:(0,jl.basename)(x),content:$}}catch{return h({message:`Failed to read file: ${x}`,code:"file_read_error"},{json:r.json})}}),y=t.headers?Object.fromEntries(t.headers.map(x=>{let $=x.indexOf("=");return $<1&&h({message:`Invalid header format: "${x}". Expected key=value.`,code:"invalid_header"},{json:r.json}),[x.slice(0,$),x.slice($+1)]})):void 0,g=t.tags?.map(x=>{let $=x.indexOf("=");return $<1&&h({message:`Invalid tag format: "${x}". Expected name=value.`,code:"invalid_tag"},{json:r.json}),{name:x.slice(0,$),value:x.slice($+1)}}),b;if(n?b={template:{id:t.template,...i&&{variables:i}},to:u,...a.from&&{from:a.from},...a.subject&&{subject:a.subject},...t.cc&&{cc:t.cc},...t.bcc&&{bcc:t.bcc},...t.replyTo&&{replyTo:t.replyTo},...t.scheduledAt&&{scheduledAt:t.scheduledAt},...y&&{headers:y},...g&&{tags:g}}:b={from:a.from,to:u,subject:a.subject,...l&&{html:l},...c&&{text:c},...t.cc&&{cc:t.cc},...t.bcc&&{bcc:t.bcc},...t.replyTo&&{replyTo:t.replyTo},...t.scheduledAt&&{scheduledAt:t.scheduledAt},...m&&{attachments:m},...y&&{headers:y},...g&&{tags:g}},t.dryRun){B({dryRun:!0,request:Wm(b)},{json:r.json});return}let _=await X(r,{permission:"sending_access"}),A=await Ee(t.scheduledAt?"Scheduling email...":"Sending email...",()=>_.emails.send(b,t.idempotencyKey?{idempotencyKey:t.idempotencyKey}:void 0),"send_error",r);!r.json&&w()?t.scheduledAt?console.log(`Email scheduled: ${A.id}`):console.log(`Email sent: ${A.id}`):B(A,{json:r.json})});var Fl=new p("update").description("Update a scheduled email").argument("[id]","Email ID").requiredOption("--scheduled-at <datetime>","New scheduled date in ISO 8601 format (e.g. 2024-08-05T11:52:01.858Z)").addHelpText("after",f({context:"Required: --scheduled-at",output:' {"object":"email","id":"<email-id>"}',errorCodes:["auth_error","update_error"],examples:["resend emails update <email-id> --scheduled-at 2024-08-05T11:52:01.858Z","resend emails update <email-id> --scheduled-at 2024-08-05T11:52:01.858Z --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Ke,n);await R({loading:"Updating email...",sdkCall:o=>o.emails.update({id:i,scheduledAt:e.scheduledAt}),errorCode:"update_error",successMsg:`Email updated: ${i}`},n)});var Bl=new p("emails").description("Send and manage emails").addHelpText("after",f({examples:['resend emails send --from onboarding@resend.com --to delivered@resend.com --subject "Hello" --text "Hi"',"resend emails get <email-id>","resend emails batch --file ./emails.json","resend emails cancel <email-id>","resend emails attachments <email-id>","resend emails attachment <email-id> <attachment-id>","resend emails receiving list","resend emails receiving forward <email-id> --to delivered@resend.com --from onboarding@resend.com"]})).addCommand(wl,{isDefault:!0}).addCommand(Rl).addCommand(Cl).addCommand(yl).addCommand(vl).addCommand(Fl).addCommand(bl).addCommand(gl).addCommand(Il);var Vm=new Set(["string","number","boolean","date"]);function yi(t){if(!t)return"(none)";let e=Object.entries(t);return e.length===0?"(empty)":e.map(([r,n])=>`${r}:${n}`).join(", ")}function Nl(t){let e=t.map(r=>[r.name,yi(r.schema),r.created_at,r.id]);return N(["Name","Schema","Created","ID"],e,"(no events)")}function on(t,e){if(t==="null")return null;let r=xt(t,"--schema",e);(typeof r!="object"||r===null||Array.isArray(r))&&h({message:"--schema must be a JSON object mapping field names to types (string | number | boolean | date).",code:"invalid_schema"},{json:e.json});for(let[n,i]of Object.entries(r))(typeof i!="string"||!Vm.has(i))&&h({message:`Invalid schema type for "${n}": "${i}". Must be one of: string, number, boolean, date.`,code:"invalid_schema"},{json:e.json});return r}var Mt={resource:"event",resourcePlural:"events",fetchItems:(t,{limit:e,after:r})=>t.events.list({limit:e,...r&&{after:r}}),display:t=>({label:t.name,hint:t.id})};var Hl=new p("create").description("Create a new event definition").option("--name <name>","Event name (e.g. user.signed_up)").option("--schema <json>","Schema as JSON mapping field names to types (string | number | boolean | date)").addHelpText("after",f({context:`Non-interactive: --name is required. --schema is optional.
|
|
534
544
|
|
|
535
545
|
Schema format:
|
|
536
546
|
A JSON object mapping field names to type strings.
|
|
537
547
|
Valid types: string, number, boolean, date.
|
|
538
|
-
Example: '{"plan":"string","age":"number","active":"boolean"}'`,output:' {"object":"event","id":"<id>"}',errorCodes:["auth_error","missing_name","invalid_schema","create_error"],examples:['resend events create --name "user.signed_up"',`resend events create --name "order.completed" --schema '{"amount":"number","currency":"string"}'`,'resend events create --name "user.signed_up" --json']})).action(async(e
|
|
539
|
-
This cannot be undone.`,loading:"Deleting event...",object:"event",successMsg:"Event deleted",sdkCall:o=>o.events.remove(
|
|
548
|
+
Example: '{"plan":"string","age":"number","active":"boolean"}'`,output:' {"object":"event","id":"<id>"}',errorCodes:["auth_error","missing_name","invalid_schema","create_error"],examples:['resend events create --name "user.signed_up"',`resend events create --name "order.completed" --schema '{"amount":"number","currency":"string"}'`,'resend events create --name "user.signed_up" --json']})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=await q(t.name,{message:"Event name",placeholder:"e.g. user.signed_up"},{message:"Missing --name flag.",code:"missing_name"},r),i=t.schema?on(t.schema,r):void 0;await J({loading:"Creating event...",sdkCall:o=>o.events.create({name:n,...i!==void 0&&{schema:i}}),onInteractive:o=>{console.log(`Event created: ${o.id}`)}},r)});var Ll=new p("delete").alias("rm").description("Delete an event definition").argument("[id]","Event ID").option("--yes","Skip confirmation prompt").addHelpText("after",f({context:"Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.",output:' {"object":"event","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend events delete <id> --yes","resend events delete <id> --yes --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Mt,n);await re(i,!!e.yes,{confirmMessage:`Delete event ${i}?
|
|
549
|
+
This cannot be undone.`,loading:"Deleting event...",object:"event",successMsg:"Event deleted",sdkCall:o=>o.events.remove(i)},n)});var Gl=new p("get").description("Retrieve an event definition").argument("[id]","Event ID").addHelpText("after",f({output:" Full event object including schema.",errorCodes:["auth_error","fetch_error"],examples:["resend events get <id>","resend events get <id> --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Mt,n);await H({loading:"Fetching event...",sdkCall:o=>o.events.get(i),onInteractive:o=>{console.log(o.name),console.log(`ID: ${o.id}`),console.log(`Schema: ${yi(o.schema)}`),console.log(`Created: ${o.created_at}`),o.updated_at&&console.log(`Updated: ${o.updated_at}`)}},n)});var Ml=new p("list").alias("ls").description("List all events").option("--limit <n>","Maximum number of events to return (1-100)","10").option("--after <cursor>","Return events after this cursor (next page)").option("--before <cursor>","Return events before this cursor (previous page)").addHelpText("after",f({output:' {"object":"list","data":[...],"has_more":true}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend events list","resend events list --limit 25 --json","resend events list --after <cursor> --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=L(t.limit,r),i=G(n,t.after,t.before,r);await P({loading:"Fetching events...",sdkCall:o=>o.events.list(i),onInteractive:o=>{console.log(Nl(o.data)),M(o,"events list",{limit:n,before:t.before,apiKey:r.apiKey,profile:r.profile})}},r)});var ql=new p("open").description("Open the events page in the Resend dashboard").addHelpText("after",f({context:"Opens the events management page in the Resend dashboard in your default browser.",examples:["resend events open"]})).action(async(t,e)=>{let r=e.optsWithGlobals();await Se(de.events,r)});var Ul=new p("send").description("Send an event to trigger automations for a contact").option("--event <name>","Event name (e.g. user.signed_up)").option("--contact-id <id>","Contact ID (mutually exclusive with --email)").option("--email <email>","Contact email (mutually exclusive with --contact-id)").option("--payload <json>","Event payload as JSON string").addHelpText("after",f({context:`Sends an event for a specific contact, triggering any automations listening for it.
|
|
540
550
|
|
|
541
551
|
Contact targeting:
|
|
542
552
|
Provide exactly one of --contact-id or --email to identify the contact.
|
|
@@ -544,12 +554,12 @@ Contact targeting:
|
|
|
544
554
|
|
|
545
555
|
Payload:
|
|
546
556
|
Optional JSON object with event-specific data.
|
|
547
|
-
Must match the event's schema if one is defined.`,output:' {"object":"event","event":"<name>"}',errorCodes:["auth_error","missing_event","missing_contact","conflicting_contact","invalid_json","send_error"],examples:['resend events send --event "user.signed_up" --contact-id <id>','resend events send --event "user.signed_up" --email user@example.com',`resend events send --event "order.completed" --contact-id <id> --payload '{"amount":99,"currency":"usd"}'`]})).action(async(e
|
|
557
|
+
Must match the event's schema if one is defined.`,output:' {"object":"event","event":"<name>"}',errorCodes:["auth_error","missing_event","missing_contact","conflicting_contact","invalid_json","send_error"],examples:['resend events send --event "user.signed_up" --contact-id <id>','resend events send --event "user.signed_up" --email user@example.com',`resend events send --event "order.completed" --contact-id <id> --payload '{"amount":99,"currency":"usd"}'`]})).action(async(t,e)=>{let r=e.optsWithGlobals();t.contactId!==void 0&&t.email!==void 0&&h({message:"Cannot use both --contact-id and --email. Provide only one.",code:"conflicting_contact"},{json:r.json});let n=await q(t.event,{message:"Event name",placeholder:"e.g. user.signed_up"},{message:"Missing --event flag.",code:"missing_event"},r),i=t.contactId,o=t.email;!i&&!o&&(await Pt(void 0,{message:"Identify contact by",options:[{value:"contact-id",label:"Contact ID"},{value:"email",label:"Email address"}]},{message:"Missing --contact-id or --email flag.",code:"missing_contact"},r)==="contact-id"?i=await q(void 0,{message:"Contact ID"},{message:"Missing contact ID.",code:"missing_contact"},r):o=await q(void 0,{message:"Email address",placeholder:"user@example.com"},{message:"Missing email.",code:"missing_contact"},r));let s=xt(t.payload,"--payload",r),a=i?{event:n,contactId:i,...s&&{payload:s}}:{event:n,email:o,...s&&{payload:s}};await R({loading:"Sending event...",sdkCall:l=>l.events.send(a),errorCode:"send_error",successMsg:`Event sent: ${n}`},r)});z();var Wl=new p("update").description("Update an event schema").argument("[id]","Event ID").option("--schema <json>",'New schema as JSON (or "null" to clear the schema)').addHelpText("after",f({context:`Non-interactive: --schema is required. Pass "null" to remove the schema.
|
|
548
558
|
|
|
549
559
|
Schema format:
|
|
550
560
|
A JSON object mapping field names to type strings.
|
|
551
561
|
Valid types: string, number, boolean, date.
|
|
552
|
-
Example: '{"plan":"string","age":"number"}'`,output:' {"object":"event","id":"<id>"}',errorCodes:["auth_error","missing_schema","invalid_schema","update_error"],examples:[`resend events update <id> --schema '{"plan":"string","age":"number"}'`,"resend events update <id> --schema null",`resend events update <id> --schema '{"plan":"string"}' --json`]})).action(async(e,
|
|
562
|
+
Example: '{"plan":"string","age":"number"}'`,output:' {"object":"event","id":"<id>"}',errorCodes:["auth_error","missing_schema","invalid_schema","update_error"],examples:[`resend events update <id> --schema '{"plan":"string","age":"number"}'`,"resend events update <id> --schema null",`resend events update <id> --schema '{"plan":"string"}' --json`]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Mt,n),o=e.schema;o===void 0&&((!w()||n.json)&&h({message:"Missing --schema flag.",code:"missing_schema"},{json:n.json}),o=await q(void 0,{message:'Schema JSON (or "null" to clear)',placeholder:'{"field":"string"}'},{message:"Missing --schema flag.",code:"missing_schema"},n));let s=on(o,n);await R({loading:"Updating event...",sdkCall:a=>a.events.update(i,{schema:s}),errorCode:"update_error",successMsg:`Event updated: ${i}`},n)});var Vl=new p("events").description("Manage events").addHelpText("after",f({context:`Events define the signals that trigger automations.
|
|
553
563
|
Each event has a name and an optional typed schema (string | number | boolean | date fields).
|
|
554
564
|
|
|
555
565
|
Lifecycle:
|
|
@@ -558,33 +568,33 @@ Lifecycle:
|
|
|
558
568
|
3. resend events list
|
|
559
569
|
4. resend events get <id>
|
|
560
570
|
5. resend events update <id> --schema '{"plan":"string","trial":"boolean"}'
|
|
561
|
-
6. resend events delete <id> --yes`,examples:["resend events list",'resend events create --name "user.signed_up"',`resend events create --name "order.completed" --schema '{"amount":"number","currency":"string"}'`,"resend events get <id>",`resend events update <id> --schema '{"plan":"string"}'`,"resend events update <id> --schema null","resend events delete <id> --yes",'resend events send --event "user.signed_up" --contact-id <id>',`resend events send --event "user.signed_up" --email user@example.com --payload '{"plan":"pro"}'`]})).addCommand(
|
|
571
|
+
6. resend events delete <id> --yes`,examples:["resend events list",'resend events create --name "user.signed_up"',`resend events create --name "order.completed" --schema '{"amount":"number","currency":"string"}'`,"resend events get <id>",`resend events update <id> --schema '{"plan":"string"}'`,"resend events update <id> --schema null","resend events delete <id> --yes",'resend events send --event "user.signed_up" --contact-id <id>',`resend events send --event "user.signed_up" --email user@example.com --payload '{"plan":"pro"}'`]})).addCommand(Hl).addCommand(Gl).addCommand(Ml,{isDefault:!0}).addCommand(Wl).addCommand(Ll).addCommand(ql).addCommand(Ul);function Kl(t){let e=t.map(r=>[r.method,r.endpoint,String(r.response_status),r.created_at,r.id]);return N(["Method","Endpoint","Status","Created","ID"],e,"(no logs)")}var zl={resource:"log",resourcePlural:"logs",fetchItems:(t,{limit:e,after:r})=>t.logs.list({limit:e,...r&&{after:r}}),display:t=>({label:`${t.method} ${t.endpoint}`,hint:t.id})};var Jl=new p("get").description("Retrieve a single API request log with full request/response bodies").argument("[id]","Log ID").addHelpText("after",f({output:" Full log object including request_body and response_body.",errorCodes:["auth_error","fetch_error"],examples:["resend logs get 3d4a472d-bc6d-4dd2-aa9d-d3d11b549e55","resend logs get 3d4a472d-bc6d-4dd2-aa9d-d3d11b549e55 --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,zl,n);await H({loading:"Fetching log...",sdkCall:o=>o.logs.get(i),onInteractive:o=>{console.log(`${o.method} ${o.endpoint} \u2014 ${o.response_status}`),console.log(`ID: ${o.id}`),console.log(`Created: ${o.created_at}`),console.log(`User-Agent: ${o.user_agent??"(none)"}`),o.request_body&&console.log(`
|
|
562
572
|
Request Body:
|
|
563
573
|
${JSON.stringify(o.request_body,null,2)}`),o.response_body&&console.log(`
|
|
564
574
|
Response Body:
|
|
565
|
-
${JSON.stringify(o.response_body,null,2)}`)}},
|
|
566
|
-
The list response does not include request/response bodies \u2014 use "resend logs get <id>" for that.`,errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend logs list","resend logs list --limit 25 --json","resend logs list --after <cursor> --json"]})).action(async(e
|
|
575
|
+
${JSON.stringify(o.response_body,null,2)}`)}},n)});var Yl=new p("list").alias("ls").description("List API request logs").option("--limit <n>","Maximum number of logs to return (1-100)","10").option("--after <cursor>","Return logs after this cursor (next page)").option("--before <cursor>","Return logs before this cursor (previous page)").addHelpText("after",f({output:` {"object":"list","data":[...],"has_more":true}
|
|
576
|
+
The list response does not include request/response bodies \u2014 use "resend logs get <id>" for that.`,errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend logs list","resend logs list --limit 25 --json","resend logs list --after <cursor> --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=L(t.limit,r),i=G(n,t.after,t.before,r);await P({loading:"Fetching logs...",sdkCall:o=>o.logs.list(i),onInteractive:o=>{console.log(Kl(o.data)),M(o,"logs list",{limit:n,before:t.before,apiKey:r.apiKey,profile:r.profile})}},r)});var Ql=new p("open").description("Open a log or the logs list in the Resend dashboard").argument("[id]","Log ID \u2014 omit to open the logs list").addHelpText("after",f({context:`Opens the Resend dashboard in your default browser.
|
|
567
577
|
With an ID: opens that log's detail page.
|
|
568
|
-
Without an ID: opens the logs list.`,examples:["resend logs open","resend logs open 3d4a472d-bc6d-4dd2-aa9d-d3d11b549e55"]})).action(async(e,
|
|
578
|
+
Without an ID: opens the logs list.`,examples:["resend logs open","resend logs open 3d4a472d-bc6d-4dd2-aa9d-d3d11b549e55"]})).action(async(t,e,r)=>{let n=t?de.log(t):de.logs,i=r.optsWithGlobals();await Se(n,i)});var Xl=new p("logs").description("View API request logs").addHelpText("after",f({examples:["resend logs list","resend logs list --limit 25 --json","resend logs get 3d4a472d-bc6d-4dd2-aa9d-d3d11b549e55","resend logs open","resend logs open 3d4a472d-bc6d-4dd2-aa9d-d3d11b549e55"]})).addCommand(Jl).addCommand(Yl,{isDefault:!0}).addCommand(Ql);var Zl=new p("open").description("Open the Resend dashboard in your browser").addHelpText("after",f({context:"Opens https://resend.com/emails in your default browser.",examples:["resend open"]})).action(async(t,e)=>{let r=e.optsWithGlobals();await Se(de.emails,r)});var ec=new p("contacts").description("List contacts belonging to a segment").argument("[segmentId]","ID of the segment").option("--limit <n>","Maximum number of contacts to return (1-100)","10").option("--after <cursor>","Return contacts after this cursor (next page)").option("--before <cursor>","Return contacts before this cursor (previous page)").addHelpText("after",f({context:`Lists all contacts that belong to the given segment.
|
|
569
579
|
|
|
570
580
|
If no segment ID is provided interactively, a picker will prompt you to choose one.
|
|
571
581
|
|
|
572
582
|
Pagination: use --after or --before with a contact ID as the cursor.
|
|
573
583
|
Only one of --after or --before may be used at a time.
|
|
574
|
-
The response includes has_more: true when additional pages exist.`,output:' {"object":"list","data":[{"id":"...","email":"...","first_name":"...","last_name":"...","unsubscribed":false}],"has_more":false}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend segments contacts 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend segments contacts 78261eea-8f8b-4381-83c6-79fa7120f1cf --limit 25 --json","resend segments contacts 78261eea-8f8b-4381-83c6-79fa7120f1cf --after 479e3145-dd38-4932-8c0c-e58b548c9e76"]})).action(async(e,
|
|
584
|
+
The response includes has_more: true when additional pages exist.`,output:' {"object":"list","data":[{"id":"...","email":"...","first_name":"...","last_name":"...","unsubscribed":false}],"has_more":false}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend segments contacts 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend segments contacts 78261eea-8f8b-4381-83c6-79fa7120f1cf --limit 25 --json","resend segments contacts 78261eea-8f8b-4381-83c6-79fa7120f1cf --after 479e3145-dd38-4932-8c0c-e58b548c9e76"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,He,n),o=L(e.limit,n),s=G(o,e.after,e.before,n);await P({loading:"Fetching segment contacts...",sdkCall:a=>a.contacts.list({segmentId:i,...s}),onInteractive:a=>{console.log(Zr(a.data)),M(a,`segments contacts ${i}`,{limit:o,before:e.before,apiKey:n.apiKey,profile:n.profile})}},n)});var tc=new p("create").description("Create a new segment").option("--name <name>","Segment name (required)").addHelpText("after",f({context:`Segments are named groups of contacts. Broadcasts target segments via segment_id.
|
|
575
585
|
Contacts can belong to multiple segments. Audiences are deprecated \u2014 use segments instead.
|
|
576
586
|
|
|
577
|
-
Non-interactive: --name is required.`,output:' {"object":"segment","id":"<uuid>","name":"<name>"}',errorCodes:["auth_error","missing_name","create_error"],examples:['resend segments create --name "Newsletter Subscribers"','resend segments create --name "Beta Users" --json']})).action(async(e
|
|
587
|
+
Non-interactive: --name is required.`,output:' {"object":"segment","id":"<uuid>","name":"<name>"}',errorCodes:["auth_error","missing_name","create_error"],examples:['resend segments create --name "Newsletter Subscribers"','resend segments create --name "Beta Users" --json']})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=await q(t.name,{message:"Segment name",placeholder:"e.g. Newsletter Subscribers"},{message:"Missing --name flag.",code:"missing_name"},r);await J({loading:"Creating segment...",sdkCall:i=>i.segments.create({name:n}),onInteractive:i=>{console.log(`Segment created: ${i.id}`),console.log(`Name: ${i.name}`)}},r)});var rc=new p("delete").alias("rm").description("Delete a segment").argument("[id]","Segment UUID").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",f({context:`Warning: Deleting a segment removes it as a target for future broadcasts,
|
|
578
588
|
but does NOT delete the contacts within it.
|
|
579
589
|
|
|
580
|
-
Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"segment","id":"<uuid>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend segments delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes","resend segments delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes --json"]})).action(async(e,
|
|
581
|
-
ID: ${
|
|
582
|
-
Contacts will not be deleted, but broadcasts targeting this segment will no longer work.`,loading:"Deleting segment...",object:"segment",successMsg:"Segment deleted",sdkCall:o=>o.segments.remove(
|
|
590
|
+
Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"segment","id":"<uuid>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend segments delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes","resend segments delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await le(t,He,n);await re(i.id,!!e.yes,{confirmMessage:`Delete segment "${i.label}"?
|
|
591
|
+
ID: ${i.id}
|
|
592
|
+
Contacts will not be deleted, but broadcasts targeting this segment will no longer work.`,loading:"Deleting segment...",object:"segment",successMsg:"Segment deleted",sdkCall:o=>o.segments.remove(i.id)},n)});var nc=new p("get").description("Retrieve a segment by ID").argument("[id]","Segment UUID").addHelpText("after",f({output:' {"object":"segment","id":"<uuid>","name":"<name>","created_at":"<iso-date>"}',errorCodes:["auth_error","fetch_error"],examples:["resend segments get 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend segments get 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,He,n);await H({loading:"Fetching segment...",sdkCall:o=>o.segments.get(i),onInteractive:o=>{console.log(`${o.name}`),console.log(`ID: ${o.id}`),console.log(`Created: ${o.created_at}`)}},n)});var ic=new p("list").alias("ls").description("List all segments").option("--limit <n>","Maximum number of segments to return (1-100)","10").option("--after <cursor>","Return segments after this cursor (next page)").option("--before <cursor>","Return segments before this cursor (previous page)").addHelpText("after",f({context:`Pagination: use --after or --before with a segment ID as the cursor.
|
|
583
593
|
Only one of --after or --before may be used at a time.
|
|
584
594
|
The response includes has_more: true when additional pages exist.
|
|
585
595
|
|
|
586
596
|
Use "resend segments list" to discover segment IDs for use with broadcasts
|
|
587
|
-
or "resend contacts add-segment".`,output:' {"object":"list","data":[{"id":"<uuid>","name":"<name>","created_at":"<iso-date>"}],"has_more":false}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend segments list","resend segments list --limit 25 --json","resend segments list --after 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e
|
|
597
|
+
or "resend contacts add-segment".`,output:' {"object":"list","data":[{"id":"<uuid>","name":"<name>","created_at":"<iso-date>"}],"has_more":false}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend segments list","resend segments list --limit 25 --json","resend segments list --after 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=L(t.limit,r),i=G(n,t.after,t.before,r);await P({loading:"Fetching segments...",sdkCall:o=>o.segments.list(i),onInteractive:o=>{console.log(Yr(o.data)),M(o,"segments list",{limit:n,before:t.before,apiKey:r.apiKey,profile:r.profile})}},r)});var oc=new p("segments").description("Manage segments").addHelpText("after",f({context:`Segments are the modern replacement for Audiences (deprecated).
|
|
588
598
|
A segment is a named group of contacts. Broadcasts target segments via segment_id.
|
|
589
599
|
Contacts can belong to multiple segments.
|
|
590
600
|
|
|
@@ -593,7 +603,7 @@ Segment membership is managed through the contacts namespace:
|
|
|
593
603
|
resend contacts remove-segment <contactId> <segmentId>
|
|
594
604
|
resend contacts segments <contactId>
|
|
595
605
|
|
|
596
|
-
There is no "update" endpoint \u2014 to rename a segment, delete it and recreate.`,examples:["resend segments list",'resend segments create --name "Newsletter Subscribers"',"resend segments get 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend segments contacts 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend segments delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes"]})).addCommand(
|
|
606
|
+
There is no "update" endpoint \u2014 to rename a segment, delete it and recreate.`,examples:["resend segments list",'resend segments create --name "Newsletter Subscribers"',"resend segments get 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend segments contacts 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend segments delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes"]})).addCommand(ec).addCommand(tc).addCommand(nc).addCommand(ic,{isDefault:!0}).addCommand(rc);z();function sn(t){return t.map(e=>{let[r,n,...i]=e.split(":");if(!r)throw new Error(`Invalid --var "${e}": key is required.`);if(n!=="string"&&n!=="number")throw new Error(`Invalid --var "${e}": type must be "string" or "number".`);let o=i.length?i.join(":"):void 0;if(o!=null&&o==="")throw new Error(`Invalid --var "${e}": fallback value cannot be empty.`);let s=o;if(n==="number"){if(s!=null&&Number.isNaN(Number(s)))throw new Error(`Invalid --var "${e}": fallback "${s}" is not a valid number.`);return{key:r,type:"number",...s!=null?{fallbackValue:Number(s)}:{}}}return{key:r,type:"string",...s!=null?{fallbackValue:s}:{}}})}var ze={resource:"template",resourcePlural:"templates",fetchItems:(t,{limit:e,after:r})=>t.templates.list({limit:e,...r&&{after:r}}),display:t=>({label:t.name,hint:t.id})};function sc(t){let e=t.map(r=>[r.name,r.status,r.alias??"",r.id,r.created_at]);return N(["Name","Status","Alias","ID","Created"],e,"(no templates)")}var ac=new p("create").description("Create a new template").option("--name <name>","Template name \u2014 required").option("--html <html>","HTML body").option("--html-file <path>",'Path to an HTML file for the body (use "-" for stdin)').option("--subject <subject>","Email subject").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("--from <address>","Sender address").option("--reply-to <address>","Reply-to address").option("--alias <alias>","Template alias for lookup by name").option("--var <var...>","Template variable: KEY:type or KEY:type:fallback (repeatable)").addHelpText("after",f({context:`Creates a new draft template. Use "resend templates publish" to make it available for sending.
|
|
597
607
|
|
|
598
608
|
--name is required. Body: provide --html, --html-file, or --react-email. Optionally add --text or --text-file for plain-text.
|
|
599
609
|
|
|
@@ -603,24 +613,24 @@ There is no "update" endpoint \u2014 to rename a segment, delete it and recreate
|
|
|
603
613
|
--html "<p>Hi {{{NAME}}}, your total is {{{PRICE}}}</p>"
|
|
604
614
|
--var NAME:string --var PRICE:number:0
|
|
605
615
|
|
|
606
|
-
Non-interactive: --name and a body (--html, --html-file, or --react-email) are required. --text-file provides a plain-text fallback.`,output:' {"object":"template","id":"<template-id>"}',errorCodes:["auth_error","missing_name","missing_body","file_read_error","invalid_options","stdin_read_error","react_email_build_error","react_email_render_error","create_error"],examples:['resend templates create --name "Welcome" --html "<h1>Hello</h1>" --subject "Welcome!"','resend templates create --name "Newsletter" --html-file ./template.html --from acme@example.com','resend templates create --name "Onboarding" --html "<p>Hi</p>" --alias onboarding --json','resend templates create --name "Order" --html "<p>{{{PRODUCT}}}: {{{PRICE}}}</p>" --var PRODUCT:string:item --var PRICE:number:25']})).action(async(e
|
|
607
|
-
`),
|
|
608
|
-
`),o=
|
|
616
|
+
Non-interactive: --name and a body (--html, --html-file, or --react-email) are required. --text-file provides a plain-text fallback.`,output:' {"object":"template","id":"<template-id>"}',errorCodes:["auth_error","missing_name","missing_body","file_read_error","invalid_options","stdin_read_error","react_email_build_error","react_email_render_error","create_error"],examples:['resend templates create --name "Welcome" --html "<h1>Hello</h1>" --subject "Welcome!"','resend templates create --name "Newsletter" --html-file ./template.html --from acme@example.com','resend templates create --name "Onboarding" --html "<p>Hi</p>" --alias onboarding --json','resend templates create --name "Order" --html "<p>{{{PRODUCT}}}: {{{PRICE}}}</p>" --var PRODUCT:string:item --var PRICE:number:25']})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=t.name;if(!n){(!w()||r.json)&&h({message:"Missing --name flag.",code:"missing_name"},{json:r.json});let s=await Y({message:"Template name",placeholder:"e.g. Welcome Email",validate:a=>a?void 0:"Required"});k(s)&&S("Cancelled."),n=s}t.htmlFile==="-"&&t.textFile==="-"&&h({message:"Cannot read both --html-file and --text-file from stdin. Pipe to one and pass the other as a file path.",code:"invalid_options"},{json:r.json}),t.reactEmail&&(t.html||t.htmlFile)&&h({message:"Cannot use --react-email with --html or --html-file",code:"invalid_options"},{json:r.json});let i=t.html,o=t.text;if(t.htmlFile&&(t.html&&process.stderr.write(`Warning: both --html and --html-file provided; using --html-file
|
|
617
|
+
`),i=ce(t.htmlFile,r)),t.textFile&&(t.text&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
|
|
618
|
+
`),o=ce(t.textFile,r)),t.reactEmail&&(i=await Ne(t.reactEmail,r)),!i){(!w()||r.json)&&h({message:"Missing body. Provide --html, --html-file, or --react-email.",code:"missing_body"},{json:r.json});let s=await Y({message:"HTML body",placeholder:"<h1>Hello {{name}}</h1>",validate:a=>a?void 0:"Required"});k(s)&&S("Cancelled."),i=s}await J({loading:"Creating template...",sdkCall:s=>Promise.resolve(s.templates.create({name:n,html:i,...t.subject&&{subject:t.subject},...o&&{text:o},...t.from&&{from:t.from},...t.replyTo&&{replyTo:t.replyTo},...t.alias&&{alias:t.alias},...t.var&&{variables:sn(t.var)}})),onInteractive:s=>{console.log(`Template created: ${s.id}`)}},r)});var lc=new p("delete").alias("rm").description("Delete a template").argument("[id]","Template ID or alias").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",f({context:`Warning: Deleting a template is permanent and cannot be undone.
|
|
609
619
|
|
|
610
|
-
Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"template","id":"<uuid>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend templates delete 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes","resend templates rm my-template-alias --yes","resend templates delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes --json"]})).action(async(e,
|
|
611
|
-
ID: ${
|
|
612
|
-
This action is permanent and cannot be undone.`,loading:"Deleting template...",object:"template",successMsg:"Template deleted",sdkCall:o=>o.templates.remove(
|
|
620
|
+
Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"template","id":"<uuid>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend templates delete 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes","resend templates rm my-template-alias --yes","resend templates delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await le(t,ze,n);await re(i.id,!!e.yes,{confirmMessage:`Delete template "${i.label}"?
|
|
621
|
+
ID: ${i.id}
|
|
622
|
+
This action is permanent and cannot be undone.`,loading:"Deleting template...",object:"template",successMsg:"Template deleted",sdkCall:o=>o.templates.remove(i.id)},n)});var cc=new p("duplicate").description("Duplicate a template").argument("[id]","Template ID or alias to duplicate").addHelpText("after",f({context:`Creates a copy of an existing template and returns the new template ID.
|
|
613
623
|
The duplicate is created as a draft with " (Copy)" appended to the original name.
|
|
614
|
-
All fields (HTML, subject, variables, etc.) are copied to the new template.`,output:' {"object":"template","id":"<new-template-id>"}',errorCodes:["auth_error","create_error"],examples:["resend templates duplicate 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates duplicate my-template-alias --json"]})).action(async(e,
|
|
624
|
+
All fields (HTML, subject, variables, etc.) are copied to the new template.`,output:' {"object":"template","id":"<new-template-id>"}',errorCodes:["auth_error","create_error"],examples:["resend templates duplicate 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates duplicate my-template-alias --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,ze,n);await J({loading:"Duplicating template...",sdkCall:o=>Promise.resolve(o.templates.duplicate(i)),onInteractive:o=>{console.log(`Template duplicated: ${o.id}`)}},n)});var uc=new p("get").description("Retrieve a template by ID or alias").argument("[id]","Template ID or alias").addHelpText("after",f({context:"Returns the full template including HTML body, variables, and publication status.",output:' {"object":"template","id":"...","name":"...","subject":"...","status":"draft|published","html":"...","alias":"...","from":"...","reply_to":["..."],"variables":[...],"created_at":"...","updated_at":"..."}',errorCodes:["auth_error","fetch_error"],examples:["resend templates get 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates get my-template-alias","resend templates get 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,ze,n);await H({loading:"Fetching template...",sdkCall:o=>o.templates.get(i),onInteractive:o=>{if(console.log(`${o.name}`),console.log(`ID: ${o.id}`),console.log(`Status: ${o.status}`),o.alias&&console.log(`Alias: ${o.alias}`),o.subject&&console.log(`Subject: ${o.subject}`),o.from&&console.log(`From: ${o.from}`),o.reply_to?.length&&console.log(`Reply-To: ${o.reply_to.join(", ")}`),o.html){let s=o.html.length>200?`${o.html.slice(0,197)}...`:o.html;console.log(`HTML: ${s}`)}o.variables?.length&&console.log(`Variables: ${o.variables.map(s=>s.key).join(", ")}`),o.published_at&&console.log(`Published: ${o.published_at}`),console.log(`Created: ${o.created_at}`),console.log(`Updated: ${o.updated_at}`)}},n)});var dc=new p("list").alias("ls").description("List all templates").option("--limit <n>","Maximum number of templates 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",f({output:' {"object":"list","has_more":false,"data":[{"id":"...","name":"...","status":"draft|published","alias":"...","created_at":"..."}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend templates list","resend templates list --limit 5","resend templates list --after <template-id> --limit 10","resend templates list --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=L(t.limit,r),i=G(n,t.after,t.before,r);await P({loading:"Fetching templates...",sdkCall:o=>o.templates.list(i),onInteractive:o=>{console.log(sc(o.data)),M(o,"templates list",{limit:n,before:t.before,apiKey:r.apiKey,profile:r.profile})}},r)});var mc=new p("open").description("Open a template or the templates list in the Resend dashboard").argument("[id]","Template ID \u2014 omit to open the templates list").addHelpText("after",f({context:`Opens the Resend dashboard in your default browser.
|
|
615
625
|
With an ID: opens that template's page for editing or viewing.
|
|
616
|
-
Without an ID: opens the templates list.`,examples:["resend templates open","resend templates open 78261eea-8f8b-4381-83c6-79fa7120f1cf"]})).action(async(e,
|
|
626
|
+
Without an ID: opens the templates list.`,examples:["resend templates open","resend templates open 78261eea-8f8b-4381-83c6-79fa7120f1cf"]})).action(async(t,e,r)=>{let n=t?de.template(t):de.templates,i=r.optsWithGlobals();await Se(n,i)});var pc=new p("publish").description("Publish a draft template").argument("[id]","Template ID or alias").addHelpText("after",f({context:`Promotes a draft template to published status, making it available for use in emails.
|
|
617
627
|
After updating a published template, re-publish to make the changes live.
|
|
618
|
-
Publishing an already-published template re-publishes it with the latest draft changes.`,output:' {"object":"template","id":"<template-id>"}',errorCodes:["auth_error","publish_error"],examples:["resend templates publish 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates publish 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,
|
|
628
|
+
Publishing an already-published template re-publishes it with the latest draft changes.`,output:' {"object":"template","id":"<template-id>"}',errorCodes:["auth_error","publish_error"],examples:["resend templates publish 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates publish 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,ze,n);await R({loading:"Publishing template...",sdkCall:o=>o.templates.publish(i),errorCode:"publish_error",successMsg:`Template published: ${i}`,retryTransient:!0},n)});var fc=new p("update").description("Update an existing template").argument("[id]","Template ID or alias").option("--name <name>","Update template name").option("--html <html>","Update HTML body").option("--html-file <path>",'Path to an HTML file to replace the body (use "-" for stdin)').option("--subject <subject>","Update subject").option("--text <text>","Update plain-text body").option("--text-file <path>",'Path to a plain-text file to replace 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("--from <address>","Update sender address").option("--reply-to <address>","Update reply-to address").option("--alias <alias>","Update template alias").option("--var <var...>","Template variable: KEY:type or KEY:type:fallback (repeatable)").addHelpText("after",f({context:`At least one option is required. Only the provided fields are changed; others are left as-is.
|
|
619
629
|
|
|
620
630
|
--var declares a template variable using the format KEY:type or KEY:type:fallback.
|
|
621
631
|
Valid types: string, number.
|
|
622
|
-
Variables must match {{{KEY}}} placeholders in the HTML body.`,output:' {"object":"template","id":"<template-id>"}',errorCodes:["auth_error","no_changes","file_read_error","invalid_options","stdin_read_error","react_email_build_error","react_email_render_error","update_error"],examples:['resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --name "Updated Name"',"resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --html-file ./new-template.html",'resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --subject "New Subject" --from "acme@example.com" --json',"resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --var PRODUCT:string:item --var PRICE:number:25"]})).action(async(e,
|
|
623
|
-
`),s=
|
|
632
|
+
Variables must match {{{KEY}}} placeholders in the HTML body.`,output:' {"object":"template","id":"<template-id>"}',errorCodes:["auth_error","no_changes","file_read_error","invalid_options","stdin_read_error","react_email_build_error","react_email_render_error","update_error"],examples:['resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --name "Updated Name"',"resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --html-file ./new-template.html",'resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --subject "New Subject" --from "acme@example.com" --json',"resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --var PRODUCT:string:item --var PRICE:number:25"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals();e.name==null&&e.html==null&&e.htmlFile==null&&e.reactEmail==null&&e.subject==null&&e.text==null&&e.textFile==null&&e.from==null&&e.replyTo==null&&e.alias==null&&e.var==null&&h({message:"Provide at least one option to update: --name, --html, --html-file, --react-email, --subject, --text, --text-file, --from, --reply-to, --alias, or --var.",code:"no_changes"},{json:n.json}),e.reactEmail!=null&&(e.html!=null||e.htmlFile!=null)&&h({message:"Cannot use --react-email with --html or --html-file",code:"invalid_options"},{json:n.json}),e.html!=null&&e.htmlFile!=null&&h({message:"--html and --html-file are mutually exclusive.",code:"invalid_options"},{json:n.json}),e.htmlFile==="-"&&e.textFile==="-"&&h({message:"Cannot read both --html-file and --text-file from stdin. Pipe to one and pass the other as a file path.",code:"invalid_options"},{json:n.json});let i=await C(t,ze,n),o=e.html,s=e.text;e.htmlFile!=null&&(o=ce(e.htmlFile,n)),e.textFile!=null&&(e.text!=null&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
|
|
633
|
+
`),s=ce(e.textFile,n)),e.reactEmail!=null&&(o=await Ne(e.reactEmail,n)),await R({loading:"Updating template...",sdkCall:a=>a.templates.update(i,{...e.name!=null&&{name:e.name},...o!=null&&{html:o},...e.subject!=null&&{subject:e.subject},...s!=null&&{text:s},...e.from!=null&&{from:e.from},...e.replyTo!=null&&{replyTo:e.replyTo},...e.alias!=null&&{alias:e.alias},...e.var!=null&&{variables:sn(e.var)}}),errorCode:"update_error",successMsg:`Template updated: ${i}`,retryTransient:!0},n)});var hc=new p("templates").description("Manage templates").addHelpText("after",f({context:`Lifecycle:
|
|
624
634
|
Templates follow a draft \u2192 published workflow:
|
|
625
635
|
1. create \u2014 creates a draft template
|
|
626
636
|
2. update \u2014 edits name, subject, HTML, variables, etc.
|
|
@@ -634,7 +644,7 @@ Template variables:
|
|
|
634
644
|
Each variable must be declared with --var when creating or updating:
|
|
635
645
|
--var KEY:type e.g. --var NAME:string
|
|
636
646
|
--var KEY:type:fallback e.g. --var PRICE:number:25
|
|
637
|
-
Valid types: string, number.`,examples:["resend templates list",'resend templates create --name "Welcome" --html "<h1>Hello {{{NAME}}}</h1>" --subject "Welcome!" --var NAME:string',"resend templates get 78261eea-8f8b-4381-83c6-79fa7120f1cf",'resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --subject "Updated Subject"',"resend templates publish 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates duplicate 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes","resend templates open","resend templates open 78261eea-8f8b-4381-83c6-79fa7120f1cf"]})).addCommand(
|
|
647
|
+
Valid types: string, number.`,examples:["resend templates list",'resend templates create --name "Welcome" --html "<h1>Hello {{{NAME}}}</h1>" --subject "Welcome!" --var NAME:string',"resend templates get 78261eea-8f8b-4381-83c6-79fa7120f1cf",'resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --subject "Updated Subject"',"resend templates publish 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates duplicate 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes","resend templates open","resend templates open 78261eea-8f8b-4381-83c6-79fa7120f1cf"]})).addCommand(ac).addCommand(uc).addCommand(mc).addCommand(dc,{isDefault:!0}).addCommand(fc).addCommand(lc).addCommand(pc).addCommand(cc);var gc=new p("create").description("Create a new topic for subscription management").option("--name <name>","Topic name (required)").option("--description <description>","Description shown to contacts when managing subscriptions").addOption(new ee("--default-subscription <mode>","Default subscription state for contacts").choices(["opt_in","opt_out"]).default("opt_in")).addHelpText("after",f({context:`Topics enable fine-grained subscription management. Contacts can opt in or out of
|
|
638
648
|
individual topics. Broadcasts can target only contacts opted into a specific topic.
|
|
639
649
|
|
|
640
650
|
Example topics: "Product Updates", "Security Alerts", "Weekly Digest".
|
|
@@ -643,16 +653,16 @@ Example topics: "Product Updates", "Security Alerts", "Weekly Digest".
|
|
|
643
653
|
opt_in Contacts receive broadcasts unless they explicitly opt out (default)
|
|
644
654
|
opt_out Contacts do NOT receive broadcasts unless they explicitly opt in
|
|
645
655
|
|
|
646
|
-
Non-interactive: --name is required.`,output:' {"id":"<uuid>"}',errorCodes:["auth_error","missing_name","create_error"],examples:['resend topics create --name "Product Updates"','resend topics create --name "Weekly Digest" --default-subscription opt_out','resend topics create --name "Security Alerts" --description "Critical security notices" --json']})).action(async(e
|
|
656
|
+
Non-interactive: --name is required.`,output:' {"id":"<uuid>"}',errorCodes:["auth_error","missing_name","create_error"],examples:['resend topics create --name "Product Updates"','resend topics create --name "Weekly Digest" --default-subscription opt_out','resend topics create --name "Security Alerts" --description "Critical security notices" --json']})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=await q(t.name,{message:"Topic name",placeholder:"e.g. Product Updates"},{message:"Missing --name flag.",code:"missing_name"},r);await J({loading:"Creating topic...",sdkCall:i=>i.topics.create({name:n,defaultSubscription:t.defaultSubscription,...t.description&&{description:t.description}}),onInteractive:i=>{console.log(`Topic created: ${i.id}`)}},r)});var bc=new p("delete").alias("rm").description("Delete a topic").argument("[id]","Topic UUID").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",f({context:`Warning: Deleting a topic removes all contact subscriptions to that topic and may affect
|
|
647
657
|
broadcasts that reference this topic_id. Contacts themselves are not deleted.
|
|
648
658
|
|
|
649
|
-
Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"topic","id":"<uuid>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend topics delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes","resend topics delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes --json"]})).action(async(e,
|
|
650
|
-
ID: ${
|
|
651
|
-
All contact subscriptions and broadcast associations will be removed.`,loading:"Deleting topic...",object:"topic",successMsg:"Topic deleted",sdkCall:o=>o.topics.remove(
|
|
652
|
-
contacts is handled via "resend contacts topics <contactId>".`,output:' {"data":[{"id":"<uuid>","name":"<name>","description":"<desc>","default_subscription":"opt_in|opt_out","created_at":"<iso-date>"}]}',errorCodes:["auth_error","list_error"],examples:["resend topics list","resend topics list --json"]})).action(async(e
|
|
659
|
+
Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"topic","id":"<uuid>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend topics delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes","resend topics delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await le(t,ct,n);await re(i.id,!!e.yes,{confirmMessage:`Delete topic "${i.label}"?
|
|
660
|
+
ID: ${i.id}
|
|
661
|
+
All contact subscriptions and broadcast associations will be removed.`,loading:"Deleting topic...",object:"topic",successMsg:"Topic deleted",sdkCall:o=>o.topics.remove(i.id)},n)});var yc=new p("get").description("Retrieve a topic by ID").argument("[id]","Topic UUID").addHelpText("after",f({output:' {"id":"<uuid>","name":"<name>","description":"<desc>","default_subscription":"opt_in|opt_out","created_at":"<iso-date>"}',errorCodes:["auth_error","fetch_error"],examples:["resend topics get 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend topics get 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,ct,n);await H({loading:"Fetching topic...",sdkCall:o=>o.topics.get(i),onInteractive:o=>{console.log(`${o.name}`),console.log(`ID: ${o.id}`),o.description&&console.log(`Description: ${o.description}`),console.log(`Default subscription: ${o.default_subscription}`),console.log(`Created: ${o.created_at}`)}},n)});var vc=new p("list").alias("ls").description("List all topics").addHelpText("after",f({context:`Returns all topics in your account. Topic subscription management for individual
|
|
662
|
+
contacts is handled via "resend contacts topics <contactId>".`,output:' {"data":[{"id":"<uuid>","name":"<name>","description":"<desc>","default_subscription":"opt_in|opt_out","created_at":"<iso-date>"}]}',errorCodes:["auth_error","list_error"],examples:["resend topics list","resend topics list --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals();await P({loading:"Fetching topics...",sdkCall:n=>n.topics.list(),onInteractive:n=>console.log(ca(n.data))},r)});var Cc=new p("update").description("Update a topic's name or description").argument("[id]","Topic UUID").option("--name <name>","New topic name").option("--description <description>","New description shown to contacts").addHelpText("after",f({context:`At least one of --name or --description must be provided to update the topic.
|
|
653
663
|
|
|
654
664
|
Note: --default-subscription cannot be changed after creation.
|
|
655
|
-
To change the default subscription, delete the topic and recreate it.`,output:' {"id":"<uuid>"}',errorCodes:["auth_error","no_changes","update_error"],examples:['resend topics update 78261eea-8f8b-4381-83c6-79fa7120f1cf --name "Security Alerts"','resend topics update 78261eea-8f8b-4381-83c6-79fa7120f1cf --description "Critical notices" --json']})).action(async(e,
|
|
665
|
+
To change the default subscription, delete the topic and recreate it.`,output:' {"id":"<uuid>"}',errorCodes:["auth_error","no_changes","update_error"],examples:['resend topics update 78261eea-8f8b-4381-83c6-79fa7120f1cf --name "Security Alerts"','resend topics update 78261eea-8f8b-4381-83c6-79fa7120f1cf --description "Critical notices" --json']})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,ct,n);!e.name&&!e.description&&h({message:"Provide at least one option to update: --name or --description.",code:"no_changes"},{json:n.json}),await R({loading:"Updating topic...",sdkCall:o=>o.topics.update({id:i,...e.name&&{name:e.name},...e.description&&{description:e.description}}),errorCode:"update_error",successMsg:`Topic updated: ${i}`},n)});var wc=new p("topics").description("Manage topics for contact subscription preferences").addHelpText("after",f({context:`Topics enable fine-grained subscription management beyond the global unsubscribe flag.
|
|
656
666
|
A contact can opt in or out of individual topics independently.
|
|
657
667
|
|
|
658
668
|
Broadcasts can target a topic_id so only contacts who have opted into that topic
|
|
@@ -665,11 +675,11 @@ Subscription states:
|
|
|
665
675
|
|
|
666
676
|
Contact topic subscriptions are managed via the contacts namespace:
|
|
667
677
|
resend contacts topics <contactId>
|
|
668
|
-
resend contacts update-topics <contactId> --topic-id <id> --subscription opt_in`,examples:["resend topics list",'resend topics create --name "Product Updates"','resend topics create --name "Weekly Digest" --default-subscription opt_out',"resend topics get 78261eea-8f8b-4381-83c6-79fa7120f1cf",'resend topics update 78261eea-8f8b-4381-83c6-79fa7120f1cf --name "Security Alerts"',"resend topics delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes"]})).addCommand(
|
|
678
|
+
resend contacts update-topics <contactId> --topic-id <id> --subscription opt_in`,examples:["resend topics list",'resend topics create --name "Product Updates"','resend topics create --name "Weekly Digest" --default-subscription opt_out',"resend topics get 78261eea-8f8b-4381-83c6-79fa7120f1cf",'resend topics update 78261eea-8f8b-4381-83c6-79fa7120f1cf --name "Security Alerts"',"resend topics delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes"]})).addCommand(gc).addCommand(yc).addCommand(vc,{isDefault:!0}).addCommand(Cc).addCommand(bc);z();dr();ht();var _c=new p("update").description("Check for available CLI updates").addHelpText("after",f({context:`Checks the latest release on GitHub (bypasses the cache).
|
|
669
679
|
Shows the current version, latest version, and how to upgrade.`,output:` {"current":"1.4.0","latest":"1.5.0","update_available":true,"upgrade_command":"npm install -g resend-cli"}
|
|
670
|
-
{"current":"1.5.0","latest":"1.5.0","update_available":false}`,examples:["resend update","resend update --json"]})).action(async(e
|
|
671
|
-
${
|
|
672
|
-
`)}else
|
|
680
|
+
{"current":"1.5.0","latest":"1.5.0","update_available":false}`,examples:["resend update","resend update --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),i=w()&&!r.json?ae("Checking for updates..."):null,o=await fi();if(!o){i?.fail("Could not check for updates"),h({message:"Could not reach GitHub releases",code:"fetch_failed"},{json:r.json});return}let s=tn(te,o),a=rn();if(r.json||!w()){B({current:te,latest:o,update_available:s,...s?{upgrade_command:a}:{}},{json:r.json});return}if(s){let l=a.startsWith("http");i?.warn(`Update available: v${te} \u2192 v${o}`),console.log(`
|
|
681
|
+
${l?"Visit":"Run"}: \x1B[36m${a}\x1B[0m
|
|
682
|
+
`)}else i?.stop(`Already up to date (v${te})`)});z();var Ze=["email.sent","email.delivered","email.delivery_delayed","email.bounced","email.complained","email.opened","email.clicked","email.failed","email.scheduled","email.suppressed","email.received","contact.created","contact.updated","contact.deleted","domain.created","domain.updated","domain.deleted"];function qt(t){return t.flatMap(e=>e.split(",")).map(e=>e.trim()).filter(Boolean)}var Ut={resource:"webhook",resourcePlural:"webhooks",fetchItems:(t,{limit:e,after:r})=>t.webhooks.list({limit:e,...r&&{after:r}}),display:t=>({label:t.endpoint,hint:t.id})};function xc(t){let e=t.map(r=>{let n=(r.events??[]).join(", "),i=n.length>60?`${n.slice(0,57)}...`:n;return[r.endpoint,i,r.status,r.id]});return N(["Endpoint","Events","Status","ID"],e,"(no webhooks)")}var Ac=new p("create").description("Register a new webhook endpoint to receive real-time event notifications").option("--endpoint <endpoint>","HTTPS URL to receive webhook events (required)").option("--events <events...>",'Event types to subscribe to (comma or space-separated). Use "all" for all 17 events.').addHelpText("after",f({context:`Webhooks deliver real-time event notifications to your HTTPS endpoint.
|
|
673
683
|
Events fire per-recipient: a batch email to 3 recipients generates 3 email.sent events.
|
|
674
684
|
|
|
675
685
|
--endpoint must use HTTPS.
|
|
@@ -690,20 +700,20 @@ The signing_secret in the response is shown ONCE \u2014 save it immediately to v
|
|
|
690
700
|
webhook payloads using Svix signature headers (svix-id, svix-timestamp, svix-signature).
|
|
691
701
|
Use resend.webhooks.verify() in your application to validate incoming payloads.
|
|
692
702
|
|
|
693
|
-
Non-interactive: --endpoint and --events are required.`,output:' {"object":"webhook","id":"<uuid>","signing_secret":"<whsec_...>"}',errorCodes:["auth_error","missing_endpoint","missing_events","create_error"],examples:["resend webhooks create --endpoint https://app.example.com/hooks/resend --events all","resend webhooks create --endpoint https://app.example.com/hooks/resend --events email.sent email.bounced","resend webhooks create --endpoint https://app.example.com/hooks/resend --events all --json"]})).action(async(e
|
|
703
|
+
Non-interactive: --endpoint and --events are required.`,output:' {"object":"webhook","id":"<uuid>","signing_secret":"<whsec_...>"}',errorCodes:["auth_error","missing_endpoint","missing_events","create_error"],examples:["resend webhooks create --endpoint https://app.example.com/hooks/resend --events all","resend webhooks create --endpoint https://app.example.com/hooks/resend --events email.sent email.bounced","resend webhooks create --endpoint https://app.example.com/hooks/resend --events all --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=await q(t.endpoint,{message:"Webhook endpoint URL",placeholder:"https://your-app.com/webhooks/resend",validate:s=>{if(!s)return"Endpoint URL is required";if(!s.startsWith("https://"))return"Endpoint must use HTTPS"}},{message:"Missing --endpoint flag.",code:"missing_endpoint"},r),i,o=t.events?.length?qt(t.events):void 0;if(o?.includes("all"))i=Ze;else if(o?.length)i=o;else{(!w()||r.json)&&h({message:"Missing --events flag.",code:"missing_events"},{json:r.json});let s=await ho({message:"Select event types to subscribe to",options:Ze.map(a=>({value:a,label:a}))});k(s)&&S("Cancelled."),i=s}await J({loading:"Creating webhook...",sdkCall:s=>s.webhooks.create({endpoint:n,events:i}),onInteractive:s=>{console.log("Webhook created"),console.log(`ID: ${s.id}`),console.log(`Signing Secret: ${s.signing_secret}`),console.log("Save the signing secret \u2014 it is only shown once.")}},r)});var kc=new p("delete").alias("rm").description("Delete a webhook endpoint and stop all event deliveries to it").argument("[id]","Webhook UUID").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",f({context:`Warning: Deleting a webhook immediately stops event delivery to the endpoint.
|
|
694
704
|
In-flight events may still be attempted once before the deletion takes effect.
|
|
695
705
|
To temporarily pause delivery without losing configuration, use:
|
|
696
706
|
resend webhooks update <id> --status disabled
|
|
697
707
|
|
|
698
|
-
Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"webhook","id":"<uuid>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend webhooks delete wh_abc123 --yes","resend webhooks delete wh_abc123 --yes --json"]})).action(async(e,
|
|
699
|
-
ID: ${
|
|
700
|
-
Events will no longer be delivered to this endpoint.`,loading:"Deleting webhook...",object:"webhook",successMsg:"Webhook deleted",sdkCall:o=>o.webhooks.remove(
|
|
701
|
-
To rotate secrets, delete the webhook and recreate it.`,output:' {"object":"webhook","id":"<uuid>","endpoint":"<url>","events":["<event>"],"status":"enabled|disabled","created_at":"<iso-date>","signing_secret":"<whsec_...>"}',errorCodes:["auth_error","fetch_error"],examples:["resend webhooks get wh_abc123","resend webhooks get wh_abc123 --json"]})).action(async(e,
|
|
708
|
+
Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"webhook","id":"<uuid>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend webhooks delete wh_abc123 --yes","resend webhooks delete wh_abc123 --yes --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await le(t,Ut,n);await re(i.id,!!e.yes,{confirmMessage:`Delete webhook "${i.label}"?
|
|
709
|
+
ID: ${i.id}
|
|
710
|
+
Events will no longer be delivered to this endpoint.`,loading:"Deleting webhook...",object:"webhook",successMsg:"Webhook deleted",sdkCall:o=>o.webhooks.remove(i.id)},n)});var $c=new p("get").description("Retrieve a webhook endpoint configuration by ID").argument("[id]","Webhook UUID").addHelpText("after",f({context:`Note: The signing_secret is not returned by the get endpoint.
|
|
711
|
+
To rotate secrets, delete the webhook and recreate it.`,output:' {"object":"webhook","id":"<uuid>","endpoint":"<url>","events":["<event>"],"status":"enabled|disabled","created_at":"<iso-date>","signing_secret":"<whsec_...>"}',errorCodes:["auth_error","fetch_error"],examples:["resend webhooks get wh_abc123","resend webhooks get wh_abc123 --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Ut,n);await H({loading:"Fetching webhook...",sdkCall:o=>o.webhooks.get(i),onInteractive:o=>{console.log(`${o.endpoint}`),console.log(`ID: ${o.id}`),console.log(`Status: ${o.status}`),console.log(`Events: ${(o.events??[]).join(", ")||"(none)"}`),console.log(`Created: ${o.created_at}`)}},n)});var Ec=new p("list").alias("ls").description("List all registered webhook endpoints").option("--limit <n>","Maximum number of webhooks to return (1-100)","10").option("--after <cursor>","Return webhooks after this cursor (next page)").option("--before <cursor>","Return webhooks before this cursor (previous page)").addHelpText("after",f({context:`Pagination: use --after or --before with a webhook ID as the cursor.
|
|
702
712
|
Only one of --after or --before may be used at a time.
|
|
703
|
-
The response includes has_more: true when additional pages exist.`,output:' {"object":"list","data":[{"id":"<uuid>","endpoint":"<url>","events":["<event>"],"status":"enabled","created_at":"<iso-date>"}],"has_more":false}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend webhooks list","resend webhooks list --limit 25 --json","resend webhooks list --after wh_abc123 --json"]})).action(async(e
|
|
704
|
-
Cleaning up...`);try{await
|
|
705
|
-
`)}catch{process.stderr.write(` Failed to delete webhook ${
|
|
706
|
-
`)}r.close()}var
|
|
713
|
+
The response includes has_more: true when additional pages exist.`,output:' {"object":"list","data":[{"id":"<uuid>","endpoint":"<url>","events":["<event>"],"status":"enabled","created_at":"<iso-date>"}],"has_more":false}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend webhooks list","resend webhooks list --limit 25 --json","resend webhooks list --after wh_abc123 --json"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=L(t.limit,r),i=G(n,t.after,t.before,r);await P({loading:"Fetching webhooks...",sdkCall:o=>o.webhooks.list(i),onInteractive:o=>{console.log(xc(o.data)),M(o,"webhooks list",{limit:n,before:t.before,apiKey:r.apiKey,profile:r.profile})}},r)});var Sc=require("node:http");var he=pe(et(),1);z();function Dc(t){return t?"error"in t?t.timeout?{status:504,body:"Forward target timed out"}:{status:502,body:"Forward target unreachable"}:t.status>=200&&t.status<300?{status:200,body:"OK"}:{status:t.status,body:"Forward target failed"}:{status:200,body:"OK"}}var Tc=["svix-id","svix-timestamp","svix-signature"],Km=3e4;function zm(){return new Date().toLocaleTimeString("en-GB",{hour12:!1})}function Jm(t){let e=_e(t.type??"unknown"),r=t.data??{},n=_e(r.id??""),i="";if(e.startsWith("email.")){let o=_e(r.from??""),s=_e(Array.isArray(r.to)?r.to[0]:"");(o||s)&&(i=`${o} -> ${s}`)}else e.startsWith("domain.")?i=_e(r.name??""):e.startsWith("contact.")&&(i=_e(r.email??""));return{type:e,resourceId:n,detail:i}}function Ym(t){let e=`${t} ${Qm(t)}`;return t>=200&&t<300?he.default.green(e):t>=400&&t<500?he.default.yellow(e):he.default.red(e)}function Qm(t){return{200:"OK",201:"Created",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"}[t]??""}async function Xm(t,e,r){let n={"content-type":"application/json"};for(let s of Tc){let a=r[s];a&&(n[s]=a)}let i=t.startsWith("http")?t:`http://${t}`;return{status:(await fetch(i,{method:"POST",headers:n,body:e,signal:AbortSignal.timeout(Km)})).status}}function Zm(t){return new Promise((e,r)=>{let n=[];t.on("data",i=>n.push(i)),t.on("end",()=>e(Buffer.concat(n).toString())),t.on("error",r)})}async function ep(t,e,r){process.stderr.write(`
|
|
714
|
+
Cleaning up...`);try{await t.webhooks.remove(e),process.stderr.write(` Webhook ${e} deleted.
|
|
715
|
+
`)}catch{process.stderr.write(` Failed to delete webhook ${e}.
|
|
716
|
+
`)}r.close()}var Oc=new p("listen").description("Listen for webhook events locally during development").option("--url <url>","Public URL for receiving webhooks (your tunnel URL)").option("--forward-to <url>","Forward payloads to this local URL").option("--events <events...>","Event types to listen for (default: all)").option("--port <port>","Local server port","4318").addHelpText("after",f({context:`Start a local server that receives Resend webhook events in real time.
|
|
707
717
|
|
|
708
718
|
You must provide a public URL (e.g. from ngrok or localtunnel) that
|
|
709
719
|
points to the local server port. The CLI will:
|
|
@@ -714,26 +724,26 @@ points to the local server port. The CLI will:
|
|
|
714
724
|
5. Delete the temporary webhook on exit (Ctrl+C)
|
|
715
725
|
|
|
716
726
|
Important: your tunnel must forward traffic to the same port as --port (default 4318).
|
|
717
|
-
For example, if using ngrok: ngrok http 4318`,examples:["resend webhooks listen --url https://example.ngrok-free.app","resend webhooks listen --url https://example.ngrok-free.app --forward-to localhost:3000/webhook","resend webhooks listen --url https://example.ngrok-free.app --events email.sent email.bounced","resend webhooks listen --url https://example.ngrok-free.app --port 8080"]})).action(async(e
|
|
718
|
-
`),
|
|
719
|
-
`):process.stderr.write(`${
|
|
720
|
-
`)}}let
|
|
721
|
-
`),process.stderr.write(` ${
|
|
722
|
-
`),process.stderr.write(` ${
|
|
723
|
-
`),process.stderr.write(` ${
|
|
724
|
-
`),process.stderr.write(` ${
|
|
725
|
-
`),
|
|
727
|
+
For example, if using ngrok: ngrok http 4318`,examples:["resend webhooks listen --url https://example.ngrok-free.app","resend webhooks listen --url https://example.ngrok-free.app --forward-to localhost:3000/webhook","resend webhooks listen --url https://example.ngrok-free.app --events email.sent email.bounced","resend webhooks listen --url https://example.ngrok-free.app --port 8080"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=await q(t.url,{message:"Public tunnel URL",placeholder:"https://example.ngrok-free.app",validate:g=>{if(!g)return"URL is required";if(!g.startsWith("https://")&&!g.startsWith("http://"))return"URL must start with http:// or https://"}},{message:"Missing --url flag.",code:"missing_url"},r),i=Number.parseInt(t.port??"4318",10);(Number.isNaN(i)||i<1||i>65535)&&h({message:"Invalid port number.",code:"invalid_port"},{json:r.json});let o=t.events?.length?qt(t.events):void 0,s;o?.includes("all")?s=Ze:o?.length?s=o:s=Ze;let a=await X(r),l=r.json||!w(),d=(0,Sc.createServer)(async(g,b)=>{try{if(g.method!=="POST"){b.writeHead(405).end("Method not allowed");return}let _=await Zm(g),A;try{A=JSON.parse(_)}catch{b.writeHead(400).end("Invalid JSON");return}let x={};for(let E of Tc){let I=g.headers[E];x[E]=Array.isArray(I)?I[0]:I}let{type:$,resourceId:F,detail:D}=Jm(A),O;if(t.forwardTo)try{let{status:E}=await Xm(t.forwardTo,_,x);O={status:E}}catch(E){let I=E instanceof DOMException&&E.name==="TimeoutError";O={error:E instanceof Error?E.message:"Unknown error",timeout:I}}if(l){let E={timestamp:new Date().toISOString(),type:$,resource_id:F,payload:A};t.forwardTo&&O&&(E.forwarded="error"in O?{url:t.forwardTo,error:O.error}:{url:t.forwardTo,status:O.status}),console.log(JSON.stringify(E))}else{let E=he.default.dim(`[${zm()}]`),I=$.padEnd(20),ge=F.padEnd(14);if(process.stderr.write(`${E} ${he.default.bold(I)} ${he.default.cyan(ge)} ${D}
|
|
728
|
+
`),t.forwardTo&&O){let Z=t.forwardTo.startsWith("http")?t.forwardTo:`http://${t.forwardTo}`;"error"in O?process.stderr.write(`${he.default.dim(" -> POST")} ${Z} ${he.default.red(`[Error: ${O.error}]`)}
|
|
729
|
+
`):process.stderr.write(`${he.default.dim(" -> POST")} ${Z} ${he.default.dim(`[${Ym(O.status)}]`)}
|
|
730
|
+
`)}}let T=Dc(O);b.writeHead(T.status).end(T.body)}catch{b.headersSent||b.writeHead(500).end("Internal error")}});try{await new Promise((g,b)=>{d.on("error",b),d.listen(i,g)})}catch(g){h({message:g instanceof Error?`Failed to start local server on port ${i}: ${g.message}`:`Failed to start local server on port ${i}`,code:"server_listen_error"},{json:r.json})}let c=ae("Setting up webhook listener...",r.quiet),u;try{let{data:g,error:b}=await a.webhooks.create({endpoint:n,events:s});(b||!g)&&(c.fail("Failed to create webhook"),d.close(),h({message:b?.message??"Unexpected empty response",code:"create_error"},{json:r.json})),u=g.id}catch(g){c.fail("Failed to create webhook"),d.close(),h({message:g instanceof Error?g.message:"Unknown error",code:"create_error"},{json:r.json})}if(c.stop("Webhook listener ready"),!l){let g=s.length===Ze.length?"all events":s.length<=3?s.join(", "):`${s.slice(0,3).join(", ")} (+${s.length-3} more)`;if(process.stderr.write(`
|
|
731
|
+
`),process.stderr.write(` ${he.default.bold("Webhook:")} ${u}
|
|
732
|
+
`),process.stderr.write(` ${he.default.bold("Endpoint:")} ${n}
|
|
733
|
+
`),process.stderr.write(` ${he.default.bold("Events:")} ${g}
|
|
734
|
+
`),process.stderr.write(` ${he.default.bold("Server:")} http://localhost:${i}
|
|
735
|
+
`),t.forwardTo){let b=t.forwardTo.startsWith("http")?t.forwardTo:`http://${t.forwardTo}`;process.stderr.write(` ${he.default.bold("Forward:")} ${b}
|
|
726
736
|
`)}process.stderr.write(`
|
|
727
737
|
Ready! Listening for webhook events. Press Ctrl+C to stop.
|
|
728
738
|
|
|
729
|
-
`)}let m=!1,
|
|
739
|
+
`)}let m=!1,y=async()=>{m||(m=!0,await ep(a,u,d),process.exit(It()))};Gr(y),process.on("SIGTERM",y),await new Promise(()=>{})});var Ic=new p("update").description("Update a webhook's endpoint URL, event subscriptions, or enabled status").argument("[id]","Webhook UUID").option("--endpoint <endpoint>","New HTTPS URL for this webhook").option("--events <events...>",'Replace the full event subscription list (comma or space-separated). Use "all" for all 17 events.').addOption(new ee("--status <status>","Enable or disable event delivery for this webhook").choices(["enabled","disabled"])).addHelpText("after",f({context:`At least one of --endpoint, --events, or --status must be provided.
|
|
730
740
|
|
|
731
741
|
--events replaces the entire event list (it is not additive).
|
|
732
742
|
Use "all" as a shorthand for all 17 event types.
|
|
733
743
|
|
|
734
744
|
--status controls whether events are delivered to this endpoint:
|
|
735
745
|
enabled Events are delivered (default on creation)
|
|
736
|
-
disabled Events are suppressed without deleting the webhook`,output:' {"object":"webhook","id":"<uuid>"}',errorCodes:["auth_error","no_changes","update_error"],examples:["resend webhooks update wh_abc123 --endpoint https://new-app.example.com/hooks/resend","resend webhooks update wh_abc123 --events email.sent email.bounced","resend webhooks update wh_abc123 --events all","resend webhooks update wh_abc123 --status disabled","resend webhooks update wh_abc123 --endpoint https://new-app.example.com/hooks/resend --events all --json"]})).action(async(e,
|
|
746
|
+
disabled Events are suppressed without deleting the webhook`,output:' {"object":"webhook","id":"<uuid>"}',errorCodes:["auth_error","no_changes","update_error"],examples:["resend webhooks update wh_abc123 --endpoint https://new-app.example.com/hooks/resend","resend webhooks update wh_abc123 --events email.sent email.bounced","resend webhooks update wh_abc123 --events all","resend webhooks update wh_abc123 --status disabled","resend webhooks update wh_abc123 --endpoint https://new-app.example.com/hooks/resend --events all --json"]})).action(async(t,e,r)=>{let n=r.optsWithGlobals(),i=await C(t,Ut,n),o=e.events?.length?qt(e.events):void 0,s=o!==void 0;!e.endpoint&&!s&&!e.status&&h({message:"Provide at least one option to update: --endpoint, --events, or --status.",code:"no_changes"},{json:n.json}),s&&!o.length&&h({message:"Missing --events values.",code:"no_changes"},{json:n.json});let a=o?.includes("all")?Ze:o?.length?o:void 0;await R({loading:"Updating webhook...",sdkCall:l=>l.webhooks.update(i,{...e.endpoint&&{endpoint:e.endpoint},...a?.length&&{events:a},...e.status&&{status:e.status}}),errorCode:"update_error",successMsg:`Webhook updated: ${i}`},n)});var Pc=new p("webhooks").description("Manage webhook endpoints for real-time event notifications").addHelpText("after",f({context:`Webhooks let you receive real-time event notifications from Resend at an HTTPS endpoint.
|
|
737
747
|
Payloads are signed with Svix headers for verification.
|
|
738
748
|
|
|
739
749
|
Event categories (17 total):
|
|
@@ -745,19 +755,25 @@ Event categories (17 total):
|
|
|
745
755
|
|
|
746
756
|
Signature verification (Svix):
|
|
747
757
|
Each delivery includes headers: svix-id, svix-timestamp, svix-signature
|
|
748
|
-
Verify payloads in your application using: resend.webhooks.verify({ payload, headers, webhookSecret })`,examples:["resend webhooks list","resend webhooks create --endpoint https://app.example.com/hooks/resend --events all","resend webhooks get wh_abc123","resend webhooks update wh_abc123 --status disabled","resend webhooks delete wh_abc123 --yes"]})).addCommand(
|
|
749
|
-
Shows which profile is active and where the API key comes from.`,output:' {"authenticated":true,"profile":"production","api_key":"re_...abcd","source":"config","config_path":"/Users/you/.config/resend/credentials.json"}\n {"error":{"message":"Not authenticated.\\nRun `resend login` to get started.","code":"not_authenticated"}}',examples:["resend whoami","resend whoami --json","resend whoami --profile production"]})).action(async(e
|
|
750
|
-
Available profiles: ${
|
|
751
|
-
`)
|
|
758
|
+
Verify payloads in your application using: resend.webhooks.verify({ payload, headers, webhookSecret })`,examples:["resend webhooks list","resend webhooks create --endpoint https://app.example.com/hooks/resend --events all","resend webhooks get wh_abc123","resend webhooks update wh_abc123 --status disabled","resend webhooks delete wh_abc123 --yes"]})).addCommand(Ac).addCommand($c).addCommand(Oc).addCommand(Ec,{isDefault:!0}).addCommand(Ic).addCommand(kc);var jc=require("node:path");ye();z();var Rc=new p("whoami").description("Show current authentication status").addHelpText("after",f({setup:!0,context:`Local only \u2014 no network calls.
|
|
759
|
+
Shows which profile is active and where the API key comes from.`,output:' {"authenticated":true,"profile":"production","api_key":"re_...abcd","source":"config","config_path":"/Users/you/.config/resend/credentials.json"}\n {"error":{"message":"Not authenticated.\\nRun `resend login` to get started.","code":"not_authenticated"}}',examples:["resend whoami","resend whoami --json","resend whoami --profile production"]})).action(async(t,e)=>{let r=e.optsWithGlobals(),n=r.profile,i=await _t(r.apiKey,n);if(!i){let d=n||Br(n),c=we(),u=c.some(b=>b.name===d),m=n||process.env.RESEND_PROFILE,y=m&&!u?`Profile "${d}" not found.
|
|
760
|
+
Available profiles: ${c.map(b=>b.name).join(", ")||"(none)"}`:"Not authenticated.\nRun `resend login` to get started.",g=m&&!u?"profile_not_found":"not_authenticated";r.json||!w()?h({message:y,code:g},{json:r.json}):h({message:y,code:g},{json:!1});return}let o=i.profile??Br(n),s=(0,jc.join)(Be(),"credentials.json");if(r.json||!w()){B({authenticated:!0,profile:o,api_key:wt(i.key),source:i.source,...i.permission&&{permission:i.permission},config_path:s},{json:r.json});return}let a=i.source==="secure_storage"?"secure storage":i.source==="config"?"config file":i.source==="env"?"environment variable":"flag",l=i.permission==="sending_access"?"sending access":i.permission==="full_access"?"full access":void 0;console.log(""),console.log(` Profile: ${o}`),console.log(` API Key: ${wt(i.key)}`),console.log(` Source: ${a}`),l&&console.log(` Access: ${l}`),console.log(` Config: ${s}`),console.log("")});function Fc(t,e={}){let r=e.getArgv??(()=>process.argv.slice(2)),n=[],i=[t];for(;i.length>0;){let o=i.pop();if(!o)break;n.push(o);for(let s of o.commands)i.push(s)}for(let o of n){let a=o.configureOutput().outputError??((l,d)=>d(l));o.configureOutput({outputError:(l,d)=>{a(tp(l,t,r()),d)}})}}function tp(t,e,r){if(!np(t))return t;let n=rp(e,r);return n?ip(t,n):t}function rp(t,e){let r=t,n=[];for(let i=0;i<e.length;i+=1){let o=e[i];if(!o||o==="--")return;let s=i;if(o.startsWith("-")&&o!=="-"){let d=o.startsWith("--")?o.split("=",1)[0]:o.length>2?o.slice(0,2):o,c;for(let u of op(r)){for(let m of u.createHelp().visibleOptions(u))if(m.long===d||m.short===d){c=m;break}if(c)break}if(!c)s=void 0;else if(!c.required&&!c.optional)s=i+1;else if(c.variadic)s=e.length;else if(o.startsWith("--")&&o.includes("="))s=i+1;else if(!o.startsWith("--")&&o.length>2)s=i+1;else{let u=e[i+1];c.optional&&(u===void 0||u.startsWith("-"))?s=i+1:s=Math.min(i+2,e.length)}}if(s===void 0)return;if(s!==i){i=s-1;continue}if(o.startsWith("-"))return;let a=sp(r).find(d=>Nc(d).has(o));if(a){r=a,n.push(a.name());continue}let l=ap(o,Bc(r)).map(d=>[t.name(),...n,d.name()].join(" "));return l.length===0?void 0:{unknownCommand:o,suggestions:l}}}function np(t){return/^error: unknown command /.test(t)||/^error: too many arguments/.test(t)}function ip(t,e){let r=t.endsWith(`
|
|
761
|
+
`)?`
|
|
762
|
+
`:"",{suggestions:n}=e,i=n.length===1?"Did you mean this?":"Did you mean one of these?",o=n.map(s=>` ${s}`).join(`
|
|
763
|
+
`);return`error: unknown command '${e.unknownCommand}'
|
|
764
|
+
|
|
765
|
+
${i}
|
|
766
|
+
${o}${r}`}function op(t){let e=[];for(let r=t;r;r=r.parent)e.push(r);return e}function Bc(t){return t.createHelp().visibleCommands(t).filter(e=>!e._hidden)}function sp(t){let e=[...t.commands];for(let r of Bc(t))e.includes(r)||e.push(r);return e}function Nc(t){return new Set([t.name(),...t.aliases()])}function ap(t,e){let r=e.map(i=>{let o=Number.POSITIVE_INFINITY;for(let s of Nc(i)){if(s.length<=1)continue;let a=lp(t,s,3),l=Math.max(t.length,s.length),d=(l-a)/l;a<=3&&d>.4&&a<o&&(o=a)}return{command:i,distance:o}}).filter(i=>Number.isFinite(i.distance));if(r.length===0)return[];let n=Math.min(...r.map(i=>i.distance));return r.filter(i=>i.distance===n).sort((i,o)=>i.command.name().localeCompare(o.command.name())).map(i=>i.command)}function lp(t,e,r=Number.POSITIVE_INFINITY){if(Math.abs(t.length-e.length)>r)return Math.max(t.length,e.length);let n=[];for(let i=0;i<=t.length;i+=1)n[i]=[i];for(let i=0;i<=e.length;i+=1)n[0][i]=i;for(let i=1;i<=e.length;i+=1)for(let o=1;o<=t.length;o+=1){let s=t[o-1]===e[i-1]?0:1;n[o][i]=Math.min(n[o-1][i]+1,n[o][i-1]+1,n[o-1][i-1]+s),o>1&&i>1&&t[o-1]===e[i-2]&&t[o-2]===e[i-1]&&(n[o][i]=Math.min(n[o][i],n[o-2][i-2]+1))}return n[t.length][e.length]}var cp=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 "," \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557"," \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551"," \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551"," \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D"," \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D "];function Hc(){process.stdout.write(`
|
|
767
|
+
`);for(let t of cp)process.stdout.write(`${t}
|
|
752
768
|
`);process.stdout.write(`
|
|
753
|
-
`)}
|
|
754
|
-
${
|
|
769
|
+
`)}wi();dr();ht();ys();var _i="",Kc=[],zc=[],mt=new p().name("resend").description("Resend CLI \u2014 email for developers").configureHelp({showGlobalOptions:!0,styleTitle:t=>Wt.default.gray(t)}).configureOutput({writeErr:t=>{process.stderr.write(t.replace(/^error:/,()=>Wt.default.red("error:")))}}).helpCommand(!0).version(`${yo} v${te}`,"-v, --version","Output the current version").option("--api-key <key>","Resend API key (overrides env/config)").option("-p, --profile <name>","Profile to use (overrides RESEND_PROFILE)").option("--json","Force JSON output").option("-q, --quiet","Suppress spinners and status output (implies --json)").option("--insecure-storage","Save API key as plaintext instead of secure storage").hook("preAction",(t,e)=>{let r=[];for(let i=e;i?.parent;i=i.parent)r.unshift(i.name());_i=r.join(" ");let n=i=>i.options.filter(o=>i.getOptionValueSource(o.attributeName())==="cli").map(o=>o.long?.replace(/^--/,"")??o.short?.replace(/^-/,"")??"").filter(Boolean);Kc=n(e),zc=n(t),e.optsWithGlobals().quiet&&t.setOptionValue("json",!0),e.optsWithGlobals().insecureStorage&&(process.env.RESEND_CREDENTIAL_STORE="file")}).addHelpText("after",`
|
|
770
|
+
${Wt.default.gray("Examples:")}
|
|
755
771
|
|
|
756
772
|
- Login to Resend
|
|
757
773
|
|
|
758
|
-
${
|
|
774
|
+
${Wt.default.blue("$ resend login")}
|
|
759
775
|
|
|
760
776
|
- Send an email
|
|
761
777
|
|
|
762
|
-
${
|
|
763
|
-
`).action(()=>{process.stdout.isTTY&&
|
|
778
|
+
${Wt.default.blue("$ resend emails send")}
|
|
779
|
+
`).action(()=>{process.stdout.isTTY&&Hc();let t=mt.opts();t.apiKey&&h({message:"--api-key is a per-command override and was not saved. To store your API key, run `resend login`.",code:"missing_command"},{json:t.json}),mt.help()}).addCommand(Wr).addCommand(Bl).addCommand(va).addCommand(Xs).addCommand(Vl).addCommand(hc).addCommand(Ja).addCommand(Fa).addCommand(oc).addCommand(wc).addCommand(fl).addCommand(Xl).addCommand(Ps).addCommand(Pc).addCommand(Ls).addCommand(Vr).addCommand(Rc).addCommand(nl).addCommand(Zl).addCommand(Ya).addCommand(_c).addCommand(ka).addCommand(Sa),Jc=new p("telemetry").description("Telemetry management").helpCommand(!1);Jc.command("flush").argument("<file>").action(async t=>{let{flushFromFile:e}=await Promise.resolve().then(()=>(wi(),Vc));await e(t)});mt.addCommand(Jc,{hidden:!0});Fc(mt);mt.parseAsync().then(()=>{let t=mt.args[0];if(t==="update"||t==="telemetry")return;_i&&Ci(_i,{...mt.opts(),flags:Kc,globalFlags:zc});let e=mt.opts();tl({json:!!(e.json||e.quiet)}).catch(()=>{})}).catch(t=>{h({message:V(t,"An unexpected error occurred"),code:"unexpected_error"})});
|