resend-cli 2.2.1-rc-0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +4 -4
- package/package.json +2 -2
package/dist/cli.cjs
CHANGED
|
@@ -24,7 +24,7 @@ Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[t]?this._life
|
|
|
24
24
|
`),this.outputHelp({error:!0}));let i=r||{},n=i.exitCode||1,o=i.code||"commander.error";this._exit(n,o,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in K.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,K.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new P2(this.options),r=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&r(i.attributeName())&&t.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let i=s=>{let a=s.attributeName(),u=this.getOptionValue(a),c=this.options.find(d=>d.negate&&a===d.attributeName()),l=this.options.find(d=>!d.negate&&a===d.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||s},n=s=>{let a=i(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${n(t)} cannot be used with ${n(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);n=n.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=Qc(t,n)}let i=`error: unknown option '${t}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,i=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${i} but got ${t.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(o=>{n.push(o.name()),o.alias()&&n.push(o.alias())}),r=Qc(t,n)}let i=`error: unknown command '${t}'${r}`;this.error(i,{code:"commander.unknownCommand"})}version(t,r,i){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",i=i||"output the version number";let n=this.createOption(r,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${t}
|
|
25
25
|
`),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===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]),t===r._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(t);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(i=>k2(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=gt.basename(t,gt.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),i=this._getOutputContext(t);r.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let n=r.formatHelp(this,r);return i.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(t){t=t||{};let r=!!t.error,i,n,o;return r?(i=a=>this._outputConfiguration.writeErr(a),n=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),n=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(n||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:n,helpWidth:o}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let i=this._getOutputContext(t),n={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let o=this.helpInformation({error:i.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",n))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(K.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let i=["beforeAll","before","after","afterAll"];if(!i.includes(t))throw new Error(`Unexpected value for position to addHelpText.
|
|
26
26
|
Expecting one of '${i.join("', '")}'`);let n=`${t}Help`;return this.on(n,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s}
|
|
27
|
-
`)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Zc(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 wu(){if(K.env.NO_COLOR||K.env.FORCE_COLOR==="0"||K.env.FORCE_COLOR==="false")return!1;if(K.env.FORCE_COLOR||K.env.CLICOLOR_FORCE!==void 0)return!0}ku.Command=xu;ku.useColor=wu});var id=f(Ve=>{var{Argument:ed}=hi(),{Command:Au}=Xc(),{CommanderError:T2,InvalidArgumentError:td}=Jr(),{Help:I2}=bu(),{Option:rd}=Cu();Ve.program=new Au;Ve.createCommand=e=>new Au(e);Ve.createOption=(e,t)=>new rd(e,t);Ve.createArgument=(e,t)=>new ed(e,t);Ve.Command=Au;Ve.Option=rd;Ve.Argument=ed;Ve.Help=I2;Ve.CommanderError=T2;Ve.InvalidArgumentError=td;Ve.InvalidOptionArgumentError=td});var od=f((Ne,nd)=>{var nt=id();Ne=nd.exports={};Ne.program=new nt.Command;Ne.Argument=nt.Argument;Ne.Command=nt.Command;Ne.CommanderError=nt.CommanderError;Ne.Help=nt.Help;Ne.InvalidArgumentError=nt.InvalidArgumentError;Ne.InvalidOptionArgumentError=nt.InvalidArgumentError;Ne.Option=nt.Option;Ne.createCommand=e=>new nt.Command(e);Ne.createOption=(e,t)=>new nt.Option(e,t);Ne.createArgument=(e,t)=>new nt.Argument(e,t)});var Ct=f(($w,Eu)=>{var vi=process||{},ud=vi.argv||[],bi=vi.env||{},D2=!(bi.NO_COLOR||ud.includes("--no-color"))&&(!!bi.FORCE_COLOR||ud.includes("--color")||vi.platform==="win32"||(vi.stdout||{}).isTTY&&bi.TERM!=="dumb"||!!bi.CI),j2=(e,t,r=e)=>i=>{let n=""+i,o=n.indexOf(t,e.length);return~o?e+$2(n,t,r,o)+t:e+n+t},$2=(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)},ld=(e=D2)=>{let t=e?j2:()=>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")}};Eu.exports=ld();Eu.exports.createColors=ld});var qu=f((Nw,Od)=>{"use strict";var $u={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"},W2={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},V2={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?$u.up():"");return e&&(t+=$u.left),t}};Od.exports={cursor:$u,scroll:W2,erase:V2,beep:"\x07"}});var Bu,Rd=W(()=>{Bu={name:"resend-cli",version:"2.2.1
|
|
27
|
+
`)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Zc(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 wu(){if(K.env.NO_COLOR||K.env.FORCE_COLOR==="0"||K.env.FORCE_COLOR==="false")return!1;if(K.env.FORCE_COLOR||K.env.CLICOLOR_FORCE!==void 0)return!0}ku.Command=xu;ku.useColor=wu});var id=f(Ve=>{var{Argument:ed}=hi(),{Command:Au}=Xc(),{CommanderError:T2,InvalidArgumentError:td}=Jr(),{Help:I2}=bu(),{Option:rd}=Cu();Ve.program=new Au;Ve.createCommand=e=>new Au(e);Ve.createOption=(e,t)=>new rd(e,t);Ve.createArgument=(e,t)=>new ed(e,t);Ve.Command=Au;Ve.Option=rd;Ve.Argument=ed;Ve.Help=I2;Ve.CommanderError=T2;Ve.InvalidArgumentError=td;Ve.InvalidOptionArgumentError=td});var od=f((Ne,nd)=>{var nt=id();Ne=nd.exports={};Ne.program=new nt.Command;Ne.Argument=nt.Argument;Ne.Command=nt.Command;Ne.CommanderError=nt.CommanderError;Ne.Help=nt.Help;Ne.InvalidArgumentError=nt.InvalidArgumentError;Ne.InvalidOptionArgumentError=nt.InvalidArgumentError;Ne.Option=nt.Option;Ne.createCommand=e=>new nt.Command(e);Ne.createOption=(e,t)=>new nt.Option(e,t);Ne.createArgument=(e,t)=>new nt.Argument(e,t)});var Ct=f(($w,Eu)=>{var vi=process||{},ud=vi.argv||[],bi=vi.env||{},D2=!(bi.NO_COLOR||ud.includes("--no-color"))&&(!!bi.FORCE_COLOR||ud.includes("--color")||vi.platform==="win32"||(vi.stdout||{}).isTTY&&bi.TERM!=="dumb"||!!bi.CI),j2=(e,t,r=e)=>i=>{let n=""+i,o=n.indexOf(t,e.length);return~o?e+$2(n,t,r,o)+t:e+n+t},$2=(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)},ld=(e=D2)=>{let t=e?j2:()=>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")}};Eu.exports=ld();Eu.exports.createColors=ld});var qu=f((Nw,Od)=>{"use strict";var $u={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"},W2={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},V2={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?$u.up():"");return e&&(t+=$u.left),t}};Od.exports={cursor:$u,scroll:W2,erase:V2,beep:"\x07"}});var Bu,Rd=W(()=>{Bu={name:"resend-cli",version:"2.2.1",description:"The official CLI for Resend",license:"MIT",repository:{type:"git",url:"https://github.com/resend/resend-cli"},homepage:"https://github.com/resend/resend-cli#readme",keywords:["cli","resend","email","api","tanstack-intent"],engines:{node:">=20"},packageManager:"pnpm@10.33.0",files:["dist/cli.cjs","skills/"],type:"module",bin:{resend:"./dist/cli.cjs"},scripts:{dev:"tsx src/cli.ts","dev:watch":"tsx --watch src/cli.ts",build:"node scripts/build.mjs","build:bin":"pnpm build && pkg dist/cli.cjs --config package.json --compress Brotli --target node24 --output dist/resend",lint:"biome check .","lint:fix":"biome check --write .",typecheck:"tsc --noEmit",test:"vitest run","test:e2e":"vitest run --config vitest.config.e2e.ts",prepack:"pnpm install && pnpm build && node scripts/verify-bundle.mjs"},dependencies:{"@clack/prompts":"1.2.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.2"},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"]},pnpm:{onlyBuiltDependencies:["esbuild","@biomejs/biome"]},devDependencies:{"@biomejs/biome":"2.4.11","@types/node":"24.12.2","@yao-pkg/pkg":"6.15.0",tsx:"4.21.0",typescript:"5.9.3",vitest:"4.1.4"}}});var se,Fd,zt=W(()=>{"use strict";Rd();se=Bu.version,Fd=Bu.name});var qi=f($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.ApplicationInSerializer=void 0;$i.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 Yu=f(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.ApplicationOutSerializer=void 0;Ri.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 Wd=f(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.ApplicationPatchSerializer=void 0;Fi.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 Kd=f(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.ListResponseApplicationOutSerializer=void 0;var Vd=Yu();zi.ListResponseApplicationOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Vd.ApplicationOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Vd.ApplicationOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Zu=f(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.ApiException=void 0;var Qu=class extends Error{constructor(t,r,i){super(`HTTP-Code: ${t}
|
|
28
28
|
Headers: ${JSON.stringify(i)}`),this.code=t,this.body=r,this.headers={},i.forEach((n,o)=>{this.headers[o]=n})}};Mi.ApiException=Qu});var Yd,Qd=W(()=>{Yd="ffffffff-ffff-ffff-ffff-ffffffffffff"});var Zd,Xd=W(()=>{Zd="00000000-0000-0000-0000-000000000000"});var em,tm=W(()=>{em=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});function wC(e){return typeof e=="string"&&em.test(e)}var kt,Yr=W(()=>{tm();kt=wC});function kC(e){if(!kt(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}var At,Qr=W(()=>{Yr();At=kC});function Te(e,t=0){return(we[e[t+0]]+we[e[t+1]]+we[e[t+2]]+we[e[t+3]]+"-"+we[e[t+4]]+we[e[t+5]]+"-"+we[e[t+6]]+we[e[t+7]]+"-"+we[e[t+8]]+we[e[t+9]]+"-"+we[e[t+10]]+we[e[t+11]]+we[e[t+12]]+we[e[t+13]]+we[e[t+14]]+we[e[t+15]]).toLowerCase()}function AC(e,t=0){let r=Te(e,t);if(!kt(r))throw TypeError("Stringified UUID is invalid");return r}var we,rm,bt=W(()=>{Yr();we=[];for(let e=0;e<256;++e)we.push((e+256).toString(16).slice(1));rm=AC});function Bt(){return Ji>Bi.length-16&&(im.default.randomFillSync(Bi),Ji=0),Bi.slice(Ji,Ji+=16)}var im,Bi,Ji,Hi=W(()=>{im=le(require("node:crypto")),Bi=new Uint8Array(256),Ji=Bi.length});function EC(e,t,r){let i=t&&r||0,n=t||new Array(16);e=e||{};let o=e.node,s=e.clockseq;if(e._v6||(o||(o=Xu),s==null&&(s=Ni)),o==null||s==null){let m=e.random||(e.rng||Bt)();o==null&&(o=[m[0],m[1],m[2],m[3],m[4],m[5]],!Xu&&!e._v6&&(o[0]|=1,Xu=o)),s==null&&(s=(m[6]<<8|m[7])&16383,Ni===void 0&&!e._v6&&(Ni=s))}let a=e.msecs!==void 0?e.msecs:Date.now(),u=e.nsecs!==void 0?e.nsecs:tl+1,c=a-el+(u-tl)/1e4;if(c<0&&e.clockseq===void 0&&(s=s+1&16383),(c<0||a>el)&&e.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");el=a,tl=u,Ni=s,a+=122192928e5;let l=((a&268435455)*1e4+u)%4294967296;n[i++]=l>>>24&255,n[i++]=l>>>16&255,n[i++]=l>>>8&255,n[i++]=l&255;let d=a/4294967296*1e4&268435455;n[i++]=d>>>8&255,n[i++]=d&255,n[i++]=d>>>24&15|16,n[i++]=d>>>16&255,n[i++]=s>>>8|128,n[i++]=s&255;for(let m=0;m<6;++m)n[i+m]=o[m];return t||Te(n)}var Xu,Ni,el,tl,Li,rl=W(()=>{Hi();bt();el=0,tl=0;Li=EC});function Zr(e){let t=typeof e=="string"?At(e):e,r=PC(t);return typeof e=="string"?Te(r):r}function PC(e,t=!1){return Uint8Array.of((e[6]&15)<<4|e[7]>>4&15,(e[7]&15)<<4|(e[4]&240)>>4,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,(e[1]&15)<<4|(e[2]&240)>>4,96|e[2]&15,e[3],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}var il=W(()=>{Qr();bt()});function TC(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}function Xr(e,t,r){function i(n,o,s,a){var u;if(typeof n=="string"&&(n=TC(n)),typeof o=="string"&&(o=At(o)),((u=o)===null||u===void 0?void 0:u.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+n.length);if(c.set(o),c.set(n,o.length),c=r(c),c[6]=c[6]&15|t,c[8]=c[8]&63|128,s){a=a||0;for(let l=0;l<16;++l)s[a+l]=c[l];return s}return Te(c)}try{i.name=e}catch{}return i.DNS=IC,i.URL=DC,i}var IC,DC,nl=W(()=>{bt();Qr();IC="6ba7b810-9dad-11d1-80b4-00c04fd430c8",DC="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function jC(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),nm.default.createHash("md5").update(e).digest()}var nm,om,sm=W(()=>{nm=le(require("node:crypto"));om=jC});var $C,am,um=W(()=>{nl();sm();$C=Xr("v3",48,om),am=$C});var lm,ol,cm=W(()=>{lm=le(require("node:crypto")),ol={randomUUID:lm.default.randomUUID}});function qC(e,t,r){if(ol.randomUUID&&!t&&!e)return ol.randomUUID();e=e||{};let i=e.random||(e.rng||Bt)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let n=0;n<16;++n)t[r+n]=i[n];return t}return Te(i)}var dm,mm=W(()=>{cm();Hi();bt();dm=qC});function RC(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),pm.default.createHash("sha1").update(e).digest()}var pm,fm,hm=W(()=>{pm=le(require("node:crypto"));fm=RC});var FC,gm,bm=W(()=>{nl();hm();FC=Xr("v5",80,fm),gm=FC});function sl(e={},t,r=0){let i=Li({...e,_v6:!0},new Uint8Array(16));if(i=Zr(i),t){for(let n=0;n<16;n++)t[r+n]=i[n];return t}return Te(i)}var vm=W(()=>{bt();rl();il()});function al(e){let t=typeof e=="string"?At(e):e,r=zC(t);return typeof e=="string"?Te(r):r}function zC(e){return Uint8Array.of((e[3]&15)<<4|e[4]>>4&15,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|e[6]&15,e[7],(e[1]&15)<<4|(e[2]&240)>>4,(e[2]&15)<<4|(e[3]&240)>>4,16|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}var _m=W(()=>{Qr();bt()});function MC(e,t,r){e=e||{};let i=t&&r||0,n=t||new Uint8Array(16),o=e.random||(e.rng||Bt)(),s=e.msecs!==void 0?e.msecs:Date.now(),a=e.seq!==void 0?e.seq:null,u=Cm,c=ym;return s>ot&&e.msecs===void 0&&(ot=s,a!==null&&(u=null,c=null)),a!==null&&(a>2147483647&&(a=2147483647),u=a>>>19&4095,c=a&524287),(u===null||c===null)&&(u=o[6]&127,u=u<<8|o[7],c=o[8]&63,c=c<<8|o[9],c=c<<5|o[10]>>>3),s+1e4>ot&&a===null?++c>524287&&(c=0,++u>4095&&(u=0,ot++)):ot=s,Cm=u,ym=c,n[i++]=ot/1099511627776&255,n[i++]=ot/4294967296&255,n[i++]=ot/16777216&255,n[i++]=ot/65536&255,n[i++]=ot/256&255,n[i++]=ot&255,n[i++]=u>>>4&15|112,n[i++]=u&255,n[i++]=c>>>13&63|128,n[i++]=c>>>5&255,n[i++]=c<<3&255|o[10]&7,n[i++]=o[11],n[i++]=o[12],n[i++]=o[13],n[i++]=o[14],n[i++]=o[15],t||Te(n)}var ym,Cm,ot,Om,Sm=W(()=>{Hi();bt();ym=null,Cm=null,ot=0;Om=MC});function JC(e){if(!kt(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}var xm,wm=W(()=>{Yr();xm=JC});var km={};ar(km,{MAX:()=>Yd,NIL:()=>Zd,parse:()=>At,stringify:()=>rm,v1:()=>Li,v1ToV6:()=>Zr,v3:()=>am,v4:()=>dm,v5:()=>gm,v6:()=>sl,v6ToV1:()=>al,v7:()=>Om,validate:()=>kt,version:()=>xm});var Am=W(()=>{Qd();Xd();Qr();bt();rl();il();um();mm();bm();vm();_m();Sm();Yr();wm()});var ne=f(Ye=>{"use strict";var ei=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{c(i.next(l))}catch(d){s(d)}}function u(l){try{c(i.throw(l))}catch(d){s(d)}}function c(l){l.done?o(l.value):n(l.value).then(a,u)}c((i=i.apply(e,t||[])).next())})};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.SvixRequest=Ye.HttpMethod=Ye.LIB_VERSION=void 0;var ul=Zu(),BC=(Am(),g2(km));Ye.LIB_VERSION="1.90.0";var HC=`svix-libs/${Ye.LIB_VERSION}/javascript`,NC;(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"})(NC=Ye.HttpMethod||(Ye.HttpMethod={}));var ll=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 ei(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 ei(this,void 0,void 0,function*(){yield this.sendInner(t)})}sendInner(t){var r,i;return ei(this,void 0,void 0,function*(){let n=new URL(t.baseUrl+this.path);for(let[u,c]of Object.entries(this.queryParams))n.searchParams.set(u,c);this.headerParams["idempotency-key"]===void 0&&this.method.toUpperCase()==="POST"&&(this.headerParams["idempotency-key"]=`auto_${(0,BC.v4)()}`);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 Em(n,{method:this.method.toString(),body:this.body,headers:Object.assign({accept:"application/json, */*;q=0.8",authorization:`Bearer ${t.token}`,"user-agent":HC,"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 LC(a)})}};Ye.SvixRequest=ll;function LC(e){return ei(this,void 0,void 0,function*(){if(e.status<300)return e;let t=yield e.text();throw e.status===422?new ul.ApiException(e.status,JSON.parse(t),e.headers):e.status>=400&&e.status<=499?new ul.ApiException(e.status,JSON.parse(t),e.headers):new ul.ApiException(e.status,t,e.headers)})}function Em(e,t,r,i=50,n=2,o=fetch,s=1){return ei(this,void 0,void 0,function*(){let a=u=>new Promise(c=>setTimeout(c,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 Em(e,t,r,i,--n,o,++s)})}});var Pm=f(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.Application=void 0;var cl=qi(),ti=Yu(),GC=Wd(),UC=Kd(),Fe=ne(),dl=class{constructor(t){this.requestCtx=t}list(t){let r=new Fe.SvixRequest(Fe.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,UC.ListResponseApplicationOutSerializer._fromJsonObject)}create(t,r){let i=new Fe.SvixRequest(Fe.HttpMethod.POST,"/api/v1/app");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(cl.ApplicationInSerializer._toJsonObject(t)),i.send(this.requestCtx,ti.ApplicationOutSerializer._fromJsonObject)}getOrCreate(t,r){let i=new Fe.SvixRequest(Fe.HttpMethod.POST,"/api/v1/app");return i.setQueryParam("get_if_exists",!0),i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(cl.ApplicationInSerializer._toJsonObject(t)),i.send(this.requestCtx,ti.ApplicationOutSerializer._fromJsonObject)}get(t){let r=new Fe.SvixRequest(Fe.HttpMethod.GET,"/api/v1/app/{app_id}");return r.setPathParam("app_id",t),r.send(this.requestCtx,ti.ApplicationOutSerializer._fromJsonObject)}update(t,r){let i=new Fe.SvixRequest(Fe.HttpMethod.PUT,"/api/v1/app/{app_id}");return i.setPathParam("app_id",t),i.setBody(cl.ApplicationInSerializer._toJsonObject(r)),i.send(this.requestCtx,ti.ApplicationOutSerializer._fromJsonObject)}delete(t){let r=new Fe.SvixRequest(Fe.HttpMethod.DELETE,"/api/v1/app/{app_id}");return r.setPathParam("app_id",t),r.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new Fe.SvixRequest(Fe.HttpMethod.PATCH,"/api/v1/app/{app_id}");return i.setPathParam("app_id",t),i.setBody(GC.ApplicationPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,ti.ApplicationOutSerializer._fromJsonObject)}};Gi.Application=dl});var Tm=f(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.ApiTokenOutSerializer=void 0;Ui.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 ml=f(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.AppPortalCapabilitySerializer=Ht.AppPortalCapability=void 0;var WC;(function(e){e.ViewBase="ViewBase",e.ViewEndpointSecret="ViewEndpointSecret",e.ManageEndpointSecret="ManageEndpointSecret",e.ManageTransformations="ManageTransformations",e.CreateAttempts="CreateAttempts",e.ManageEndpoint="ManageEndpoint"})(WC=Ht.AppPortalCapability||(Ht.AppPortalCapability={}));Ht.AppPortalCapabilitySerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var jm=f(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.AppPortalAccessInSerializer=void 0;var Im=ml(),Dm=qi();Wi.AppPortalAccessInSerializer={_fromJsonObject(e){var t;return{application:e.application!=null?Dm.ApplicationInSerializer._fromJsonObject(e.application):void 0,capabilities:(t=e.capabilities)===null||t===void 0?void 0:t.map(r=>Im.AppPortalCapabilitySerializer._fromJsonObject(r)),expiry:e.expiry,featureFlags:e.featureFlags,readOnly:e.readOnly,sessionId:e.sessionId}},_toJsonObject(e){var t;return{application:e.application!=null?Dm.ApplicationInSerializer._toJsonObject(e.application):void 0,capabilities:(t=e.capabilities)===null||t===void 0?void 0:t.map(r=>Im.AppPortalCapabilitySerializer._toJsonObject(r)),expiry:e.expiry,featureFlags:e.featureFlags,readOnly:e.readOnly,sessionId:e.sessionId}}}});var $m=f(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.AppPortalAccessOutSerializer=void 0;Vi.AppPortalAccessOutSerializer={_fromJsonObject(e){return{token:e.token,url:e.url}},_toJsonObject(e){return{token:e.token,url:e.url}}}});var qm=f(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.ApplicationTokenExpireInSerializer=void 0;Ki.ApplicationTokenExpireInSerializer={_fromJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}},_toJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}}}});var Rm=f(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.RotatePollerTokenInSerializer=void 0;Yi.RotatePollerTokenInSerializer={_fromJsonObject(e){return{expiry:e.expiry,oldTokenExpiry:e.oldTokenExpiry}},_toJsonObject(e){return{expiry:e.expiry,oldTokenExpiry:e.oldTokenExpiry}}}});var Fm=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 zm=f(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.StreamTokenExpireInSerializer=void 0;Zi.StreamTokenExpireInSerializer={_fromJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}},_toJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}}}});var pl=f(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.DashboardAccessOutSerializer=void 0;Xi.DashboardAccessOutSerializer={_fromJsonObject(e){return{token:e.token,url:e.url}},_toJsonObject(e){return{token:e.token,url:e.url}}}});var Bm=f(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.Authentication=void 0;var Mm=Tm(),VC=jm(),Jm=$m(),KC=qm(),YC=Rm(),QC=Fm(),ZC=zm(),XC=pl(),ve=ne(),fl=class{constructor(t){this.requestCtx=t}appPortalAccess(t,r,i){let n=new ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/auth/app-portal-access/{app_id}");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(VC.AppPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,Jm.AppPortalAccessOutSerializer._fromJsonObject)}expireAll(t,r,i){let n=new ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/auth/app/{app_id}/expire-all");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(KC.ApplicationTokenExpireInSerializer._toJsonObject(r)),n.sendNoResponseBody(this.requestCtx)}dashboardAccess(t,r){let i=new ve.SvixRequest(ve.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,XC.DashboardAccessOutSerializer._fromJsonObject)}logout(t){let r=new ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/auth/logout");return r.setHeaderParam("idempotency-key",t?.idempotencyKey),r.sendNoResponseBody(this.requestCtx)}streamLogout(t){let r=new ve.SvixRequest(ve.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 ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/auth/stream-portal-access/{stream_id}");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(QC.StreamPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,Jm.AppPortalAccessOutSerializer._fromJsonObject)}streamExpireAll(t,r,i){let n=new ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/expire-all");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(ZC.StreamTokenExpireInSerializer._toJsonObject(r)),n.sendNoResponseBody(this.requestCtx)}getStreamPollerToken(t,r){let i=new ve.SvixRequest(ve.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,Mm.ApiTokenOutSerializer._fromJsonObject)}rotateStreamPollerToken(t,r,i,n){let o=new ve.SvixRequest(ve.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(YC.RotatePollerTokenInSerializer._toJsonObject(i)),o.send(this.requestCtx,Mm.ApiTokenOutSerializer._fromJsonObject)}};en.Authentication=fl});var Et=f(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.BackgroundTaskStatusSerializer=Nt.BackgroundTaskStatus=void 0;var eO;(function(e){e.Running="running",e.Finished="finished",e.Failed="failed"})(eO=Nt.BackgroundTaskStatus||(Nt.BackgroundTaskStatus={}));Nt.BackgroundTaskStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Pt=f(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.BackgroundTaskTypeSerializer=Lt.BackgroundTaskType=void 0;var tO;(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"})(tO=Lt.BackgroundTaskType||(Lt.BackgroundTaskType={}));Lt.BackgroundTaskTypeSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var hl=f(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.BackgroundTaskOutSerializer=void 0;var Hm=Et(),Nm=Pt();tn.BackgroundTaskOutSerializer={_fromJsonObject(e){return{data:e.data,id:e.id,status:Hm.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:Nm.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{data:e.data,id:e.id,status:Hm.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:Nm.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var Gm=f(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.ListResponseBackgroundTaskOutSerializer=void 0;var Lm=hl();rn.ListResponseBackgroundTaskOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Lm.BackgroundTaskOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Lm.BackgroundTaskOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Um=f(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.BackgroundTask=void 0;var rO=hl(),iO=Gm(),nn=ne(),gl=class{constructor(t){this.requestCtx=t}list(t){let r=new nn.SvixRequest(nn.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,iO.ListResponseBackgroundTaskOutSerializer._fromJsonObject)}listByEndpoint(t){return this.list(t)}get(t){let r=new nn.SvixRequest(nn.HttpMethod.GET,"/api/v1/background-task/{task_id}");return r.setPathParam("task_id",t),r.send(this.requestCtx,rO.BackgroundTaskOutSerializer._fromJsonObject)}};on.BackgroundTask=gl});var dr=f(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.ConnectorKindSerializer=Gt.ConnectorKind=void 0;var nO;(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"})(nO=Gt.ConnectorKind||(Gt.ConnectorKind={}));Gt.ConnectorKindSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var sn=f(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.ConnectorProductSerializer=Ut.ConnectorProduct=void 0;var oO;(function(e){e.Dispatch="Dispatch",e.Stream="Stream"})(oO=Ut.ConnectorProduct||(Ut.ConnectorProduct={}));Ut.ConnectorProductSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var bl=f(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.ConnectorInSerializer=void 0;var Wm=dr(),Vm=sn();an.ConnectorInSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?Wm.ConnectorKindSerializer._fromJsonObject(e.kind):void 0,logo:e.logo,name:e.name,productType:e.productType!=null?Vm.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?Wm.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,productType:e.productType!=null?Vm.ConnectorProductSerializer._toJsonObject(e.productType):void 0,transformation:e.transformation,uid:e.uid}}}});var ln=f(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.ConnectorOutSerializer=void 0;var Km=dr(),Ym=sn();un.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:Km.ConnectorKindSerializer._fromJsonObject(e.kind),logo:e.logo,name:e.name,orgId:e.orgId,productType:Ym.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:Km.ConnectorKindSerializer._toJsonObject(e.kind),logo:e.logo,name:e.name,orgId:e.orgId,productType:Ym.ConnectorProductSerializer._toJsonObject(e.productType),transformation:e.transformation,transformationUpdatedAt:e.transformationUpdatedAt,uid:e.uid,updatedAt:e.updatedAt}}}});var Zm=f(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.ConnectorPatchSerializer=void 0;var Qm=dr();cn.ConnectorPatchSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?Qm.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?Qm.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}}}});var ep=f(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.ConnectorUpdateSerializer=void 0;var Xm=dr();dn.ConnectorUpdateSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?Xm.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?Xm.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}}}});var rp=f(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.ListResponseConnectorOutSerializer=void 0;var tp=ln();mn.ListResponseConnectorOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>tp.ConnectorOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>tp.ConnectorOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var ip=f(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.Connector=void 0;var sO=bl(),pn=ln(),aO=Zm(),uO=ep(),lO=rp(),Qe=ne(),vl=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,lO.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(sO.ConnectorInSerializer._toJsonObject(t)),i.send(this.requestCtx,pn.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,pn.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(uO.ConnectorUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,pn.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(aO.ConnectorPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,pn.ConnectorOutSerializer._fromJsonObject)}};fn.Connector=vl});var mr=f(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.MessageStatusSerializer=Wt.MessageStatus=void 0;var cO;(function(e){e[e.Success=0]="Success",e[e.Pending=1]="Pending",e[e.Fail=2]="Fail",e[e.Sending=3]="Sending"})(cO=Wt.MessageStatus||(Wt.MessageStatus={}));Wt.MessageStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var _l=f(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.StatusCodeClassSerializer=Vt.StatusCodeClass=void 0;var dO;(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"})(dO=Vt.StatusCodeClass||(Vt.StatusCodeClass={}));Vt.StatusCodeClassSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var sp=f(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.BulkReplayInSerializer=void 0;var np=mr(),op=_l();hn.BulkReplayInSerializer={_fromJsonObject(e){return{channel:e.channel,eventTypes:e.eventTypes,since:new Date(e.since),status:e.status!=null?np.MessageStatusSerializer._fromJsonObject(e.status):void 0,statusCodeClass:e.statusCodeClass!=null?op.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?np.MessageStatusSerializer._toJsonObject(e.status):void 0,statusCodeClass:e.statusCodeClass!=null?op.StatusCodeClassSerializer._toJsonObject(e.statusCodeClass):void 0,tag:e.tag,until:e.until}}}});var ap=f(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.EndpointHeadersInSerializer=void 0;gn.EndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var yl=f(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.EndpointHeadersOutSerializer=void 0;bn.EndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var up=f(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.EndpointHeadersPatchInSerializer=void 0;vn.EndpointHeadersPatchInSerializer={_fromJsonObject(e){return{deleteHeaders:e.deleteHeaders,headers:e.headers}},_toJsonObject(e){return{deleteHeaders:e.deleteHeaders,headers:e.headers}}}});var lp=f(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.EndpointInSerializer=void 0;_n.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 Cl=f(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.EndpointOutSerializer=void 0;yn.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 cp=f(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.EndpointPatchSerializer=void 0;Cn.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 dp=f(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.EndpointSecretOutSerializer=void 0;On.EndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Ol=f(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.EndpointSecretRotateInSerializer=void 0;Sn.EndpointSecretRotateInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var mp=f(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.EndpointStatsSerializer=void 0;xn.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 pp=f(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.EndpointTransformationInSerializer=void 0;wn.EndpointTransformationInSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var fp=f(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.EndpointTransformationOutSerializer=void 0;kn.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 hp=f(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.EndpointTransformationPatchSerializer=void 0;An.EndpointTransformationPatchSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var gp=f(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.EndpointUpdateSerializer=void 0;En.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 bp=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 _p=f(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.ListResponseEndpointOutSerializer=void 0;var vp=Cl();Tn.ListResponseEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>vp.EndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>vp.EndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var ri=f(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.MessageOutSerializer=void 0;In.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 yp=f(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.RecoverInSerializer=void 0;Dn.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 Sp=f(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.RecoverOutSerializer=void 0;var Cp=Et(),Op=Pt();jn.RecoverOutSerializer={_fromJsonObject(e){return{id:e.id,status:Cp.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:Op.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:Cp.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:Op.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var xp=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 Ap=f(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.ReplayOutSerializer=void 0;var wp=Et(),kp=Pt();qn.ReplayOutSerializer={_fromJsonObject(e){return{id:e.id,status:wp.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:kp.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:wp.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:kp.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var Pp=f(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.Endpoint=void 0;var mO=sp(),pO=ap(),fO=yl(),hO=up(),gO=lp(),Rn=Cl(),bO=cp(),vO=dp(),_O=Ol(),yO=mp(),CO=pp(),OO=fp(),SO=hp(),xO=gp(),wO=bp(),kO=_p(),AO=ri(),EO=yp(),PO=Sp(),TO=xp(),Ep=Ap(),R=ne(),Sl=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,kO.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(gO.EndpointInSerializer._toJsonObject(r)),n.send(this.requestCtx,Rn.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,Rn.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(xO.EndpointUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,Rn.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(bO.EndpointPatchSerializer._toJsonObject(i)),n.send(this.requestCtx,Rn.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(mO.BulkReplayInSerializer._toJsonObject(i)),o.send(this.requestCtx,Ep.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,fO.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(pO.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(hO.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(EO.RecoverInSerializer._toJsonObject(i)),o.send(this.requestCtx,PO.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(TO.ReplayInSerializer._toJsonObject(i)),o.send(this.requestCtx,Ep.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,vO.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(_O.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(wO.EventExampleInSerializer._toJsonObject(i)),o.send(this.requestCtx,AO.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,yO.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,OO.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(SO.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(CO.EndpointTransformationInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}};Fn.Endpoint=Sl});var xl=f(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.EventTypeInSerializer=void 0;zn.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 Dp=f(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.EnvironmentInSerializer=void 0;var Tp=bl(),Ip=xl();Mn.EnvironmentInSerializer={_fromJsonObject(e){var t,r;return{connectors:(t=e.connectors)===null||t===void 0?void 0:t.map(i=>Tp.ConnectorInSerializer._fromJsonObject(i)),eventTypes:(r=e.eventTypes)===null||r===void 0?void 0:r.map(i=>Ip.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=>Tp.ConnectorInSerializer._toJsonObject(i)),eventTypes:(r=e.eventTypes)===null||r===void 0?void 0:r.map(i=>Ip.EventTypeInSerializer._toJsonObject(i)),settings:e.settings}}}});var Bn=f(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.EventTypeOutSerializer=void 0;Jn.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 qp=f(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.EnvironmentOutSerializer=void 0;var jp=ln(),$p=Bn();Hn.EnvironmentOutSerializer={_fromJsonObject(e){return{connectors:e.connectors.map(t=>jp.ConnectorOutSerializer._fromJsonObject(t)),createdAt:new Date(e.createdAt),eventTypes:e.eventTypes.map(t=>$p.EventTypeOutSerializer._fromJsonObject(t)),settings:e.settings,version:e.version}},_toJsonObject(e){return{connectors:e.connectors.map(t=>jp.ConnectorOutSerializer._toJsonObject(t)),createdAt:e.createdAt,eventTypes:e.eventTypes.map(t=>$p.EventTypeOutSerializer._toJsonObject(t)),settings:e.settings,version:e.version}}}});var Rp=f(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.Environment=void 0;var IO=Dp(),DO=qp(),Nn=ne(),wl=class{constructor(t){this.requestCtx=t}export(t){let r=new Nn.SvixRequest(Nn.HttpMethod.POST,"/api/v1/environment/export");return r.setHeaderParam("idempotency-key",t?.idempotencyKey),r.send(this.requestCtx,DO.EnvironmentOutSerializer._fromJsonObject)}import(t,r){let i=new Nn.SvixRequest(Nn.HttpMethod.POST,"/api/v1/environment/import");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(IO.EnvironmentInSerializer._toJsonObject(t)),i.sendNoResponseBody(this.requestCtx)}};Ln.Environment=wl});var Fp=f(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.EventTypeImportOpenApiInSerializer=void 0;Gn.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 zp=f(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.EventTypeFromOpenApiSerializer=void 0;Un.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 Jp=f(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.EventTypeImportOpenApiOutDataSerializer=void 0;var Mp=zp();Wn.EventTypeImportOpenApiOutDataSerializer={_fromJsonObject(e){var t;return{modified:e.modified,toModify:(t=e.to_modify)===null||t===void 0?void 0:t.map(r=>Mp.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=>Mp.EventTypeFromOpenApiSerializer._toJsonObject(r))}}}});var Hp=f(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.EventTypeImportOpenApiOutSerializer=void 0;var Bp=Jp();Vn.EventTypeImportOpenApiOutSerializer={_fromJsonObject(e){return{data:Bp.EventTypeImportOpenApiOutDataSerializer._fromJsonObject(e.data)}},_toJsonObject(e){return{data:Bp.EventTypeImportOpenApiOutDataSerializer._toJsonObject(e.data)}}}});var Np=f(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.EventTypePatchSerializer=void 0;Kn.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 Lp=f(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.EventTypeUpdateSerializer=void 0;Yn.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 Up=f(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.ListResponseEventTypeOutSerializer=void 0;var Gp=Bn();Qn.ListResponseEventTypeOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Gp.EventTypeOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Gp.EventTypeOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Wp=f(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.EventType=void 0;var jO=Fp(),$O=Hp(),qO=xl(),Zn=Bn(),RO=Np(),FO=Lp(),zO=Up(),ze=ne(),kl=class{constructor(t){this.requestCtx=t}list(t){let r=new ze.SvixRequest(ze.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,zO.ListResponseEventTypeOutSerializer._fromJsonObject)}create(t,r){let i=new ze.SvixRequest(ze.HttpMethod.POST,"/api/v1/event-type");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(qO.EventTypeInSerializer._toJsonObject(t)),i.send(this.requestCtx,Zn.EventTypeOutSerializer._fromJsonObject)}importOpenapi(t,r){let i=new ze.SvixRequest(ze.HttpMethod.POST,"/api/v1/event-type/import/openapi");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(jO.EventTypeImportOpenApiInSerializer._toJsonObject(t)),i.send(this.requestCtx,$O.EventTypeImportOpenApiOutSerializer._fromJsonObject)}get(t){let r=new ze.SvixRequest(ze.HttpMethod.GET,"/api/v1/event-type/{event_type_name}");return r.setPathParam("event_type_name",t),r.send(this.requestCtx,Zn.EventTypeOutSerializer._fromJsonObject)}update(t,r){let i=new ze.SvixRequest(ze.HttpMethod.PUT,"/api/v1/event-type/{event_type_name}");return i.setPathParam("event_type_name",t),i.setBody(FO.EventTypeUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,Zn.EventTypeOutSerializer._fromJsonObject)}delete(t,r){let i=new ze.SvixRequest(ze.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 ze.SvixRequest(ze.HttpMethod.PATCH,"/api/v1/event-type/{event_type_name}");return i.setPathParam("event_type_name",t),i.setBody(RO.EventTypePatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Zn.EventTypeOutSerializer._fromJsonObject)}};Xn.EventType=kl});var Kp=f(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.Health=void 0;var Vp=ne(),Al=class{constructor(t){this.requestCtx=t}get(){return new Vp.SvixRequest(Vp.HttpMethod.GET,"/api/v1/health").sendNoResponseBody(this.requestCtx)}};eo.Health=Al});var Yp=f(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.IngestSourceConsumerPortalAccessInSerializer=void 0;to.IngestSourceConsumerPortalAccessInSerializer={_fromJsonObject(e){return{expiry:e.expiry,readOnly:e.readOnly}},_toJsonObject(e){return{expiry:e.expiry,readOnly:e.readOnly}}}});var Qp=f(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.IngestEndpointHeadersInSerializer=void 0;ro.IngestEndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var Zp=f(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.IngestEndpointHeadersOutSerializer=void 0;io.IngestEndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var Xp=f(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.IngestEndpointInSerializer=void 0;no.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 El=f(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.IngestEndpointOutSerializer=void 0;oo.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 ef=f(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.IngestEndpointSecretInSerializer=void 0;so.IngestEndpointSecretInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var tf=f(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.IngestEndpointSecretOutSerializer=void 0;ao.IngestEndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var rf=f(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.IngestEndpointTransformationOutSerializer=void 0;uo.IngestEndpointTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var nf=f(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.IngestEndpointTransformationPatchSerializer=void 0;lo.IngestEndpointTransformationPatchSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var of=f(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.IngestEndpointUpdateSerializer=void 0;co.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 af=f(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.ListResponseIngestEndpointOutSerializer=void 0;var sf=El();mo.ListResponseIngestEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>sf.IngestEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>sf.IngestEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var uf=f(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.IngestEndpoint=void 0;var MO=Qp(),JO=Zp(),BO=Xp(),Pl=El(),HO=ef(),NO=tf(),LO=rf(),GO=nf(),UO=of(),WO=af(),ae=ne(),Tl=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,WO.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(BO.IngestEndpointInSerializer._toJsonObject(r)),n.send(this.requestCtx,Pl.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,Pl.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(UO.IngestEndpointUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,Pl.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,JO.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(MO.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,NO.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(HO.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,LO.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(GO.IngestEndpointTransformationPatchSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}};po.IngestEndpoint=Tl});var lf=f(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.AdobeSignConfigSerializer=void 0;fo.AdobeSignConfigSerializer={_fromJsonObject(e){return{clientId:e.clientId}},_toJsonObject(e){return{clientId:e.clientId}}}});var cf=f(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.AirwallexConfigSerializer=void 0;ho.AirwallexConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var df=f(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.CheckbookConfigSerializer=void 0;go.CheckbookConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Il=f(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.CronConfigSerializer=void 0;bo.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 mf=f(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.DocusignConfigSerializer=void 0;vo.DocusignConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var pf=f(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.EasypostConfigSerializer=void 0;_o.EasypostConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var ff=f(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.GithubConfigSerializer=void 0;yo.GithubConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var hf=f(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.HubspotConfigSerializer=void 0;Co.HubspotConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var gf=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 bf=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 vf=f(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.PandaDocConfigSerializer=void 0;xo.PandaDocConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var _f=f(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.PortIoConfigSerializer=void 0;wo.PortIoConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var yf=f(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.RutterConfigSerializer=void 0;ko.RutterConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Cf=f(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.SegmentConfigSerializer=void 0;Ao.SegmentConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Of=f(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.ShopifyConfigSerializer=void 0;Eo.ShopifyConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Sf=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 xf=f(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.StripeConfigSerializer=void 0;To.StripeConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var wf=f(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.SvixConfigSerializer=void 0;Io.SvixConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var kf=f(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.TelnyxConfigSerializer=void 0;Do.TelnyxConfigSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var Af=f(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.VapiConfigSerializer=void 0;jo.VapiConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Ef=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 Pf=f(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.ZoomConfigSerializer=void 0;qo.ZoomConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Qf=f(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.IngestSourceInSerializer=void 0;var Tf=lf(),If=cf(),Df=df(),jf=Il(),$f=mf(),qf=pf(),Rf=ff(),Ff=hf(),zf=gf(),Mf=bf(),Jf=vf(),Bf=_f(),Hf=yf(),Nf=Cf(),Lf=Of(),Gf=Sf(),Uf=xf(),J=wf(),Wf=kf(),Vf=Af(),Kf=Ef(),Yf=Pf();Ro.IngestSourceInSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"generic-webhook":return{};case"cron":return jf.CronConfigSerializer._fromJsonObject(e.config);case"adobe-sign":return Tf.AdobeSignConfigSerializer._fromJsonObject(e.config);case"beehiiv":return J.SvixConfigSerializer._fromJsonObject(e.config);case"brex":return J.SvixConfigSerializer._fromJsonObject(e.config);case"checkbook":return Df.CheckbookConfigSerializer._fromJsonObject(e.config);case"clerk":return J.SvixConfigSerializer._fromJsonObject(e.config);case"docusign":return $f.DocusignConfigSerializer._fromJsonObject(e.config);case"easypost":return qf.EasypostConfigSerializer._fromJsonObject(e.config);case"github":return Rf.GithubConfigSerializer._fromJsonObject(e.config);case"guesty":return J.SvixConfigSerializer._fromJsonObject(e.config);case"hubspot":return Ff.HubspotConfigSerializer._fromJsonObject(e.config);case"incident-io":return J.SvixConfigSerializer._fromJsonObject(e.config);case"lithic":return J.SvixConfigSerializer._fromJsonObject(e.config);case"meta":return zf.MetaConfigSerializer._fromJsonObject(e.config);case"nash":return J.SvixConfigSerializer._fromJsonObject(e.config);case"orum-io":return Mf.OrumIoConfigSerializer._fromJsonObject(e.config);case"panda-doc":return Jf.PandaDocConfigSerializer._fromJsonObject(e.config);case"port-io":return Bf.PortIoConfigSerializer._fromJsonObject(e.config);case"pleo":return J.SvixConfigSerializer._fromJsonObject(e.config);case"psi-fi":return J.SvixConfigSerializer._fromJsonObject(e.config);case"replicate":return J.SvixConfigSerializer._fromJsonObject(e.config);case"resend":return J.SvixConfigSerializer._fromJsonObject(e.config);case"rutter":return Hf.RutterConfigSerializer._fromJsonObject(e.config);case"safebase":return J.SvixConfigSerializer._fromJsonObject(e.config);case"sardine":return J.SvixConfigSerializer._fromJsonObject(e.config);case"segment":return Nf.SegmentConfigSerializer._fromJsonObject(e.config);case"shopify":return Lf.ShopifyConfigSerializer._fromJsonObject(e.config);case"slack":return Gf.SlackConfigSerializer._fromJsonObject(e.config);case"stripe":return Uf.StripeConfigSerializer._fromJsonObject(e.config);case"stych":return J.SvixConfigSerializer._fromJsonObject(e.config);case"svix":return J.SvixConfigSerializer._fromJsonObject(e.config);case"zoom":return Yf.ZoomConfigSerializer._fromJsonObject(e.config);case"telnyx":return Wf.TelnyxConfigSerializer._fromJsonObject(e.config);case"vapi":return Vf.VapiConfigSerializer._fromJsonObject(e.config);case"open-ai":return J.SvixConfigSerializer._fromJsonObject(e.config);case"render":return J.SvixConfigSerializer._fromJsonObject(e.config);case"veriff":return Kf.VeriffConfigSerializer._fromJsonObject(e.config);case"airwallex":return If.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=jf.CronConfigSerializer._toJsonObject(e.config);break;case"adobe-sign":t=Tf.AdobeSignConfigSerializer._toJsonObject(e.config);break;case"beehiiv":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"brex":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"checkbook":t=Df.CheckbookConfigSerializer._toJsonObject(e.config);break;case"clerk":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"docusign":t=$f.DocusignConfigSerializer._toJsonObject(e.config);break;case"easypost":t=qf.EasypostConfigSerializer._toJsonObject(e.config);break;case"github":t=Rf.GithubConfigSerializer._toJsonObject(e.config);break;case"guesty":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"hubspot":t=Ff.HubspotConfigSerializer._toJsonObject(e.config);break;case"incident-io":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"lithic":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"meta":t=zf.MetaConfigSerializer._toJsonObject(e.config);break;case"nash":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"orum-io":t=Mf.OrumIoConfigSerializer._toJsonObject(e.config);break;case"panda-doc":t=Jf.PandaDocConfigSerializer._toJsonObject(e.config);break;case"port-io":t=Bf.PortIoConfigSerializer._toJsonObject(e.config);break;case"pleo":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"psi-fi":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"replicate":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"resend":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"rutter":t=Hf.RutterConfigSerializer._toJsonObject(e.config);break;case"safebase":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"sardine":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"segment":t=Nf.SegmentConfigSerializer._toJsonObject(e.config);break;case"shopify":t=Lf.ShopifyConfigSerializer._toJsonObject(e.config);break;case"slack":t=Gf.SlackConfigSerializer._toJsonObject(e.config);break;case"stripe":t=Uf.StripeConfigSerializer._toJsonObject(e.config);break;case"stych":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"svix":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"zoom":t=Yf.ZoomConfigSerializer._toJsonObject(e.config);break;case"telnyx":t=Wf.TelnyxConfigSerializer._toJsonObject(e.config);break;case"vapi":t=Vf.VapiConfigSerializer._toJsonObject(e.config);break;case"open-ai":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"render":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"veriff":t=Kf.VeriffConfigSerializer._toJsonObject(e.config);break;case"airwallex":t=If.AirwallexConfigSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,metadata:e.metadata,name:e.name,uid:e.uid}}}});var Zf=f(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.AdobeSignConfigOutSerializer=void 0;Fo.AdobeSignConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Xf=f(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.AirwallexConfigOutSerializer=void 0;zo.AirwallexConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var eh=f(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.CheckbookConfigOutSerializer=void 0;Mo.CheckbookConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var th=f(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.DocusignConfigOutSerializer=void 0;Jo.DocusignConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var rh=f(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.EasypostConfigOutSerializer=void 0;Bo.EasypostConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var ih=f(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.GithubConfigOutSerializer=void 0;Ho.GithubConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var nh=f(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.HubspotConfigOutSerializer=void 0;No.HubspotConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var oh=f(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.MetaConfigOutSerializer=void 0;Lo.MetaConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var sh=f(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.OrumIoConfigOutSerializer=void 0;Go.OrumIoConfigOutSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var ah=f(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.PandaDocConfigOutSerializer=void 0;Uo.PandaDocConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var uh=f(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.PortIoConfigOutSerializer=void 0;Wo.PortIoConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var lh=f(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.RutterConfigOutSerializer=void 0;Vo.RutterConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var ch=f(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.SegmentConfigOutSerializer=void 0;Ko.SegmentConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var dh=f(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.ShopifyConfigOutSerializer=void 0;Yo.ShopifyConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var mh=f(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.SlackConfigOutSerializer=void 0;Qo.SlackConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var ph=f(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.StripeConfigOutSerializer=void 0;Zo.StripeConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var fh=f(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.SvixConfigOutSerializer=void 0;Xo.SvixConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var hh=f(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.TelnyxConfigOutSerializer=void 0;es.TelnyxConfigOutSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var gh=f(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.VapiConfigOutSerializer=void 0;ts.VapiConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var bh=f(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.VeriffConfigOutSerializer=void 0;rs.VeriffConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var vh=f(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.ZoomConfigOutSerializer=void 0;is.ZoomConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Dl=f(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.IngestSourceOutSerializer=void 0;var _h=Zf(),yh=Xf(),Ch=eh(),Oh=Il(),Sh=th(),xh=rh(),wh=ih(),kh=nh(),Ah=oh(),Eh=sh(),Ph=ah(),Th=uh(),Ih=lh(),Dh=ch(),jh=dh(),$h=mh(),qh=ph(),B=fh(),Rh=hh(),Fh=gh(),zh=bh(),Mh=vh();ns.IngestSourceOutSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"generic-webhook":return{};case"cron":return Oh.CronConfigSerializer._fromJsonObject(e.config);case"adobe-sign":return _h.AdobeSignConfigOutSerializer._fromJsonObject(e.config);case"beehiiv":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"brex":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"checkbook":return Ch.CheckbookConfigOutSerializer._fromJsonObject(e.config);case"clerk":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"docusign":return Sh.DocusignConfigOutSerializer._fromJsonObject(e.config);case"easypost":return xh.EasypostConfigOutSerializer._fromJsonObject(e.config);case"github":return wh.GithubConfigOutSerializer._fromJsonObject(e.config);case"guesty":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"hubspot":return kh.HubspotConfigOutSerializer._fromJsonObject(e.config);case"incident-io":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"lithic":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"meta":return Ah.MetaConfigOutSerializer._fromJsonObject(e.config);case"nash":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"orum-io":return Eh.OrumIoConfigOutSerializer._fromJsonObject(e.config);case"panda-doc":return Ph.PandaDocConfigOutSerializer._fromJsonObject(e.config);case"port-io":return Th.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 Ih.RutterConfigOutSerializer._fromJsonObject(e.config);case"safebase":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"sardine":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"segment":return Dh.SegmentConfigOutSerializer._fromJsonObject(e.config);case"shopify":return jh.ShopifyConfigOutSerializer._fromJsonObject(e.config);case"slack":return $h.SlackConfigOutSerializer._fromJsonObject(e.config);case"stripe":return qh.StripeConfigOutSerializer._fromJsonObject(e.config);case"stych":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"svix":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"zoom":return Mh.ZoomConfigOutSerializer._fromJsonObject(e.config);case"telnyx":return Rh.TelnyxConfigOutSerializer._fromJsonObject(e.config);case"vapi":return Fh.VapiConfigOutSerializer._fromJsonObject(e.config);case"open-ai":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"render":return B.SvixConfigOutSerializer._fromJsonObject(e.config);case"veriff":return zh.VeriffConfigOutSerializer._fromJsonObject(e.config);case"airwallex":return yh.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=Oh.CronConfigSerializer._toJsonObject(e.config);break;case"adobe-sign":t=_h.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=Ch.CheckbookConfigOutSerializer._toJsonObject(e.config);break;case"clerk":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"docusign":t=Sh.DocusignConfigOutSerializer._toJsonObject(e.config);break;case"easypost":t=xh.EasypostConfigOutSerializer._toJsonObject(e.config);break;case"github":t=wh.GithubConfigOutSerializer._toJsonObject(e.config);break;case"guesty":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"hubspot":t=kh.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=Ah.MetaConfigOutSerializer._toJsonObject(e.config);break;case"nash":t=B.SvixConfigOutSerializer._toJsonObject(e.config);break;case"orum-io":t=Eh.OrumIoConfigOutSerializer._toJsonObject(e.config);break;case"panda-doc":t=Ph.PandaDocConfigOutSerializer._toJsonObject(e.config);break;case"port-io":t=Th.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=Ih.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=Dh.SegmentConfigOutSerializer._toJsonObject(e.config);break;case"shopify":t=jh.ShopifyConfigOutSerializer._toJsonObject(e.config);break;case"slack":t=$h.SlackConfigOutSerializer._toJsonObject(e.config);break;case"stripe":t=qh.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=Mh.ZoomConfigOutSerializer._toJsonObject(e.config);break;case"telnyx":t=Rh.TelnyxConfigOutSerializer._toJsonObject(e.config);break;case"vapi":t=Fh.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=zh.VeriffConfigOutSerializer._toJsonObject(e.config);break;case"airwallex":t=yh.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 Bh=f(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.ListResponseIngestSourceOutSerializer=void 0;var Jh=Dl();os.ListResponseIngestSourceOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Jh.IngestSourceOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Jh.IngestSourceOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Hh=f(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.RotateTokenOutSerializer=void 0;ss.RotateTokenOutSerializer={_fromJsonObject(e){return{ingestUrl:e.ingestUrl}},_toJsonObject(e){return{ingestUrl:e.ingestUrl}}}});var Lh=f(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.IngestSource=void 0;var Nh=Qf(),jl=Dl(),VO=Bh(),KO=Hh(),Ze=ne(),$l=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,VO.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(Nh.IngestSourceInSerializer._toJsonObject(t)),i.send(this.requestCtx,jl.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,jl.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(Nh.IngestSourceInSerializer._toJsonObject(r)),i.send(this.requestCtx,jl.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,KO.RotateTokenOutSerializer._fromJsonObject)}};as.IngestSource=$l});var Uh=f(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.Ingest=void 0;var YO=pl(),QO=Yp(),ZO=uf(),XO=Lh(),Gh=ne(),ql=class{constructor(t){this.requestCtx=t}get endpoint(){return new ZO.IngestEndpoint(this.requestCtx)}get source(){return new XO.IngestSource(this.requestCtx)}dashboard(t,r,i){let n=new Gh.SvixRequest(Gh.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/dashboard");return n.setPathParam("source_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(QO.IngestSourceConsumerPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,YO.DashboardAccessOutSerializer._fromJsonObject)}};us.Ingest=ql});var Wh=f(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.IntegrationInSerializer=void 0;ls.IntegrationInSerializer={_fromJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}}}});var Vh=f(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.IntegrationKeyOutSerializer=void 0;cs.IntegrationKeyOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Rl=f(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.IntegrationOutSerializer=void 0;ds.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 Kh=f(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.IntegrationUpdateSerializer=void 0;ms.IntegrationUpdateSerializer={_fromJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}}}});var Qh=f(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.ListResponseIntegrationOutSerializer=void 0;var Yh=Rl();ps.ListResponseIntegrationOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Yh.IntegrationOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Yh.IntegrationOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Xh=f(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.Integration=void 0;var eS=Wh(),Zh=Vh(),Fl=Rl(),tS=Kh(),rS=Qh(),Me=ne(),zl=class{constructor(t){this.requestCtx=t}list(t,r){let i=new Me.SvixRequest(Me.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,rS.ListResponseIntegrationOutSerializer._fromJsonObject)}create(t,r,i){let n=new Me.SvixRequest(Me.HttpMethod.POST,"/api/v1/app/{app_id}/integration");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(eS.IntegrationInSerializer._toJsonObject(r)),n.send(this.requestCtx,Fl.IntegrationOutSerializer._fromJsonObject)}get(t,r){let i=new Me.SvixRequest(Me.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,Fl.IntegrationOutSerializer._fromJsonObject)}update(t,r,i){let n=new Me.SvixRequest(Me.HttpMethod.PUT,"/api/v1/app/{app_id}/integration/{integ_id}");return n.setPathParam("app_id",t),n.setPathParam("integ_id",r),n.setBody(tS.IntegrationUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,Fl.IntegrationOutSerializer._fromJsonObject)}delete(t,r){let i=new Me.SvixRequest(Me.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 Me.SvixRequest(Me.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,Zh.IntegrationKeyOutSerializer._fromJsonObject)}rotateKey(t,r,i){let n=new Me.SvixRequest(Me.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,Zh.IntegrationKeyOutSerializer._fromJsonObject)}};fs.Integration=zl});var rg=f(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.ExpungeAllContentsOutSerializer=void 0;var eg=Et(),tg=Pt();hs.ExpungeAllContentsOutSerializer={_fromJsonObject(e){return{id:e.id,status:eg.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:tg.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:eg.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:tg.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var ng=f(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.ListResponseMessageOutSerializer=void 0;var ig=ri();gs.ListResponseMessageOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>ig.MessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>ig.MessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var og=f(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.MessagePrecheckInSerializer=void 0;bs.MessagePrecheckInSerializer={_fromJsonObject(e){return{channels:e.channels,eventType:e.eventType}},_toJsonObject(e){return{channels:e.channels,eventType:e.eventType}}}});var sg=f(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.MessagePrecheckOutSerializer=void 0;vs.MessagePrecheckOutSerializer={_fromJsonObject(e){return{active:e.active}},_toJsonObject(e){return{active:e.active}}}});var ag=f(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.PollingEndpointConsumerSeekInSerializer=void 0;_s.PollingEndpointConsumerSeekInSerializer={_fromJsonObject(e){return{after:new Date(e.after)}},_toJsonObject(e){return{after:e.after}}}});var ug=f(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.PollingEndpointConsumerSeekOutSerializer=void 0;ys.PollingEndpointConsumerSeekOutSerializer={_fromJsonObject(e){return{iterator:e.iterator}},_toJsonObject(e){return{iterator:e.iterator}}}});var lg=f(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.PollingEndpointMessageOutSerializer=void 0;Cs.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 dg=f(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.PollingEndpointOutSerializer=void 0;var cg=lg();Os.PollingEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>cg.PollingEndpointMessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator}},_toJsonObject(e){return{data:e.data.map(t=>cg.PollingEndpointMessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator}}}});var pg=f(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.MessagePoller=void 0;var iS=ag(),nS=ug(),mg=dg(),pr=ne(),Ml=class{constructor(t){this.requestCtx=t}poll(t,r,i){let n=new pr.SvixRequest(pr.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,mg.PollingEndpointOutSerializer._fromJsonObject)}consumerPoll(t,r,i,n){let o=new pr.SvixRequest(pr.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,mg.PollingEndpointOutSerializer._fromJsonObject)}consumerSeek(t,r,i,n,o){let s=new pr.SvixRequest(pr.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(iS.PollingEndpointConsumerSeekInSerializer._toJsonObject(n)),s.send(this.requestCtx,nS.PollingEndpointConsumerSeekOutSerializer._fromJsonObject)}};Ss.MessagePoller=Ml});var hg=f(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.MessageInSerializer=void 0;var fg=qi();xs.MessageInSerializer={_fromJsonObject(e){return{application:e.application!=null?fg.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?fg.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(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.messageInRaw=fr.Message=void 0;var oS=rg(),sS=ng(),gg=ri(),aS=og(),uS=sg(),lS=pg(),Xe=ne(),cS=hg(),Jl=class{constructor(t){this.requestCtx=t}get poller(){return new lS.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,sS.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(cS.MessageInSerializer._toJsonObject(r)),n.send(this.requestCtx,gg.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,oS.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(aS.MessagePrecheckInSerializer._toJsonObject(r)),n.send(this.requestCtx,uS.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,gg.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)}};fr.Message=Jl;function dS(e,t,r){return{eventType:e,payload:{},transformationsParams:{rawPayload:t,headers:r?{"content-type":r}:void 0}}}fr.messageInRaw=dS});var Hl=f(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.EmptyResponseSerializer=void 0;ws.EmptyResponseSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var ii=f(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.MessageStatusTextSerializer=Kt.MessageStatusText=void 0;var mS;(function(e){e.Success="success",e.Pending="pending",e.Fail="fail",e.Sending="sending"})(mS=Kt.MessageStatusText||(Kt.MessageStatusText={}));Kt.MessageStatusTextSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var _g=f(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.EndpointMessageOutSerializer=void 0;var bg=mr(),vg=ii();ks.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:bg.MessageStatusSerializer._fromJsonObject(e.status),statusText:vg.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:bg.MessageStatusSerializer._toJsonObject(e.status),statusText:vg.MessageStatusTextSerializer._toJsonObject(e.statusText),tags:e.tags,timestamp:e.timestamp}}}});var Cg=f(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.ListResponseEndpointMessageOutSerializer=void 0;var yg=_g();As.ListResponseEndpointMessageOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>yg.EndpointMessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>yg.EndpointMessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Nl=f(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.MessageAttemptTriggerTypeSerializer=Yt.MessageAttemptTriggerType=void 0;var pS;(function(e){e[e.Scheduled=0]="Scheduled",e[e.Manual=1]="Manual"})(pS=Yt.MessageAttemptTriggerType||(Yt.MessageAttemptTriggerType={}));Yt.MessageAttemptTriggerTypeSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Ll=f(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.MessageAttemptOutSerializer=void 0;var Og=Nl(),Sg=ri(),xg=mr(),wg=ii();Es.MessageAttemptOutSerializer={_fromJsonObject(e){return{endpointId:e.endpointId,id:e.id,msg:e.msg!=null?Sg.MessageOutSerializer._fromJsonObject(e.msg):void 0,msgId:e.msgId,response:e.response,responseDurationMs:e.responseDurationMs,responseStatusCode:e.responseStatusCode,status:xg.MessageStatusSerializer._fromJsonObject(e.status),statusText:wg.MessageStatusTextSerializer._fromJsonObject(e.statusText),timestamp:new Date(e.timestamp),triggerType:Og.MessageAttemptTriggerTypeSerializer._fromJsonObject(e.triggerType),url:e.url}},_toJsonObject(e){return{endpointId:e.endpointId,id:e.id,msg:e.msg!=null?Sg.MessageOutSerializer._toJsonObject(e.msg):void 0,msgId:e.msgId,response:e.response,responseDurationMs:e.responseDurationMs,responseStatusCode:e.responseStatusCode,status:xg.MessageStatusSerializer._toJsonObject(e.status),statusText:wg.MessageStatusTextSerializer._toJsonObject(e.statusText),timestamp:e.timestamp,triggerType:Og.MessageAttemptTriggerTypeSerializer._toJsonObject(e.triggerType),url:e.url}}}});var Ag=f(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.ListResponseMessageAttemptOutSerializer=void 0;var kg=Ll();Ps.ListResponseMessageAttemptOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>kg.MessageAttemptOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>kg.MessageAttemptOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Tg=f(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.MessageEndpointOutSerializer=void 0;var Eg=mr(),Pg=ii();Ts.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:Eg.MessageStatusSerializer._fromJsonObject(e.status),statusText:Pg.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:Eg.MessageStatusSerializer._toJsonObject(e.status),statusText:Pg.MessageStatusTextSerializer._toJsonObject(e.statusText),throttleRate:e.throttleRate,uid:e.uid,updatedAt:e.updatedAt,url:e.url,version:e.version}}}});var Dg=f(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.ListResponseMessageEndpointOutSerializer=void 0;var Ig=Tg();Is.ListResponseMessageEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Ig.MessageEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Ig.MessageEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var $g=f(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.MessageAttempt=void 0;var fS=Hl(),hS=Cg(),jg=Ag(),gS=Dg(),bS=Ll(),Je=ne(),Gl=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,jg.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,jg.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,hS.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,bS.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,gS.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,fS.EmptyResponseSerializer._fromJsonObject)}};Ds.MessageAttempt=Gl});var Ul=f(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.OperationalWebhookEndpointOutSerializer=void 0;js.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 Rg=f($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.ListResponseOperationalWebhookEndpointOutSerializer=void 0;var qg=Ul();$s.ListResponseOperationalWebhookEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>qg.OperationalWebhookEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>qg.OperationalWebhookEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Fg=f(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.OperationalWebhookEndpointHeadersInSerializer=void 0;qs.OperationalWebhookEndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var zg=f(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.OperationalWebhookEndpointHeadersOutSerializer=void 0;Rs.OperationalWebhookEndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var Mg=f(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.OperationalWebhookEndpointInSerializer=void 0;Fs.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 Jg=f(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.OperationalWebhookEndpointSecretInSerializer=void 0;zs.OperationalWebhookEndpointSecretInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Bg=f(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.OperationalWebhookEndpointSecretOutSerializer=void 0;Ms.OperationalWebhookEndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Hg=f(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.OperationalWebhookEndpointUpdateSerializer=void 0;Js.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 Kl=f(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.OperationalWebhookEndpoint=void 0;var vS=Rg(),_S=Fg(),yS=zg(),CS=Mg(),Wl=Ul(),OS=Jg(),SS=Bg(),xS=Hg(),_e=ne(),Vl=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,vS.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(CS.OperationalWebhookEndpointInSerializer._toJsonObject(t)),i.send(this.requestCtx,Wl.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,Wl.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(xS.OperationalWebhookEndpointUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,Wl.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,yS.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(_S.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,SS.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(OS.OperationalWebhookEndpointSecretInSerializer._toJsonObject(r)),n.sendNoResponseBody(this.requestCtx)}};Bs.OperationalWebhookEndpoint=Vl});var Ng=f(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.OperationalWebhook=void 0;var wS=Kl(),Yl=class{constructor(t){this.requestCtx=t}get endpoint(){return new wS.OperationalWebhookEndpoint(this.requestCtx)}};Hs.OperationalWebhook=Yl});var Ug=f(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.AggregateEventTypesOutSerializer=void 0;var Lg=Et(),Gg=Pt();Ns.AggregateEventTypesOutSerializer={_fromJsonObject(e){return{id:e.id,status:Lg.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:Gg.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:Lg.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:Gg.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var Wg=f(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.AppUsageStatsInSerializer=void 0;Ls.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 Yg=f(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.AppUsageStatsOutSerializer=void 0;var Vg=Et(),Kg=Pt();Gs.AppUsageStatsOutSerializer={_fromJsonObject(e){return{id:e.id,status:Vg.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:Kg.BackgroundTaskTypeSerializer._fromJsonObject(e.task),unresolvedAppIds:e.unresolvedAppIds,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:Vg.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:Kg.BackgroundTaskTypeSerializer._toJsonObject(e.task),unresolvedAppIds:e.unresolvedAppIds,updatedAt:e.updatedAt}}}});var Qg=f(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.Statistics=void 0;var kS=Ug(),AS=Wg(),ES=Yg(),Us=ne(),Ql=class{constructor(t){this.requestCtx=t}aggregateAppStats(t,r){let i=new Us.SvixRequest(Us.HttpMethod.POST,"/api/v1/stats/usage/app");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(AS.AppUsageStatsInSerializer._toJsonObject(t)),i.send(this.requestCtx,ES.AppUsageStatsOutSerializer._fromJsonObject)}aggregateEventTypes(){return new Us.SvixRequest(Us.HttpMethod.PUT,"/api/v1/stats/usage/event-types").send(this.requestCtx,kS.AggregateEventTypesOutSerializer._fromJsonObject)}};Ws.Statistics=Ql});var Zg=f(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.HttpSinkHeadersPatchInSerializer=void 0;Vs.HttpSinkHeadersPatchInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var Xg=f(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.SinkTransformationOutSerializer=void 0;Ks.SinkTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var Zl=f(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.StreamEventTypeOutSerializer=void 0;Ys.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 tb=f(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.ListResponseStreamEventTypeOutSerializer=void 0;var eb=Zl();Qs.ListResponseStreamEventTypeOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>eb.StreamEventTypeOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>eb.StreamEventTypeOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var rb=f(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.StreamEventTypeInSerializer=void 0;Zs.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 ib=f(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.StreamEventTypePatchSerializer=void 0;Xs.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 ob=f(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.StreamingEventType=void 0;var PS=tb(),nb=rb(),ea=Zl(),TS=ib(),et=ne(),Xl=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,PS.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(nb.StreamEventTypeInSerializer._toJsonObject(t)),i.send(this.requestCtx,ea.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,ea.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(nb.StreamEventTypeInSerializer._toJsonObject(r)),i.send(this.requestCtx,ea.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(TS.StreamEventTypePatchSerializer._toJsonObject(r)),i.send(this.requestCtx,ea.StreamEventTypeOutSerializer._fromJsonObject)}};ta.StreamingEventType=Xl});var sb=f(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.EventInSerializer=void 0;ra.EventInSerializer={_fromJsonObject(e){return{eventType:e.eventType,payload:e.payload}},_toJsonObject(e){return{eventType:e.eventType,payload:e.payload}}}});var ec=f(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.StreamInSerializer=void 0;ia.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 lb=f(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.CreateStreamEventsInSerializer=void 0;var ab=sb(),ub=ec();na.CreateStreamEventsInSerializer={_fromJsonObject(e){return{events:e.events.map(t=>ab.EventInSerializer._fromJsonObject(t)),stream:e.stream!=null?ub.StreamInSerializer._fromJsonObject(e.stream):void 0}},_toJsonObject(e){return{events:e.events.map(t=>ab.EventInSerializer._toJsonObject(t)),stream:e.stream!=null?ub.StreamInSerializer._toJsonObject(e.stream):void 0}}}});var cb=f(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.CreateStreamEventsOutSerializer=void 0;oa.CreateStreamEventsOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var db=f(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.EventOutSerializer=void 0;sa.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 pb=f(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.EventStreamOutSerializer=void 0;var mb=db();aa.EventStreamOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>mb.EventOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator}},_toJsonObject(e){return{data:e.data.map(t=>mb.EventOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator}}}});var fb=f(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.StreamingEvents=void 0;var IS=lb(),DS=cb(),jS=pb(),ua=ne(),tc=class{constructor(t){this.requestCtx=t}create(t,r,i){let n=new ua.SvixRequest(ua.HttpMethod.POST,"/api/v1/stream/{stream_id}/events");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(IS.CreateStreamEventsInSerializer._toJsonObject(r)),n.send(this.requestCtx,DS.CreateStreamEventsOutSerializer._fromJsonObject)}get(t,r,i){let n=new ua.SvixRequest(ua.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,jS.EventStreamOutSerializer._fromJsonObject)}};la.StreamingEvents=tc});var rc=f(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.AzureBlobStorageConfigSerializer=void 0;ca.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 ic=f(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.GoogleCloudStorageConfigSerializer=void 0;da.GoogleCloudStorageConfigSerializer={_fromJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}},_toJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}}}});var nc=f(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.S3ConfigSerializer=void 0;ma.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 oc=f(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.SinkHttpConfigSerializer=void 0;pa.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 sc=f(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.SinkOtelV1ConfigSerializer=void 0;fa.SinkOtelV1ConfigSerializer={_fromJsonObject(e){return{headers:e.headers,url:e.url}},_toJsonObject(e){return{headers:e.headers,url:e.url}}}});var ac=f(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.SinkStatusSerializer=Qt.SinkStatus=void 0;var $S;(function(e){e.Enabled="enabled",e.Paused="paused",e.Disabled="disabled",e.Retrying="retrying"})($S=Qt.SinkStatus||(Qt.SinkStatus={}));Qt.SinkStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var uc=f(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.StreamSinkOutSerializer=void 0;var hb=rc(),gb=ic(),bb=nc(),vb=oc(),_b=sc(),yb=ac();ha.StreamSinkOutSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return hb.AzureBlobStorageConfigSerializer._fromJsonObject(e.config);case"otelTracing":return _b.SinkOtelV1ConfigSerializer._fromJsonObject(e.config);case"http":return vb.SinkHttpConfigSerializer._fromJsonObject(e.config);case"amazonS3":return bb.S3ConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return gb.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:yb.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=hb.AzureBlobStorageConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=_b.SinkOtelV1ConfigSerializer._toJsonObject(e.config);break;case"http":t=vb.SinkHttpConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=bb.S3ConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=gb.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:yb.SinkStatusSerializer._toJsonObject(e.status),uid:e.uid,updatedAt:e.updatedAt}}}});var Ob=f(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.ListResponseStreamSinkOutSerializer=void 0;var Cb=uc();ga.ListResponseStreamSinkOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Cb.StreamSinkOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Cb.StreamSinkOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Sb=f(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.SinkSecretOutSerializer=void 0;ba.SinkSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var xb=f(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.SinkTransformInSerializer=void 0;va.SinkTransformInSerializer={_fromJsonObject(e){return{code:e.code}},_toJsonObject(e){return{code:e.code}}}});var _a=f(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.SinkStatusInSerializer=Zt.SinkStatusIn=void 0;var qS;(function(e){e.Enabled="enabled",e.Disabled="disabled"})(qS=Zt.SinkStatusIn||(Zt.SinkStatusIn={}));Zt.SinkStatusInSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Ib=f(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.StreamSinkInSerializer=void 0;var wb=rc(),kb=ic(),Ab=nc(),Eb=oc(),Pb=sc(),Tb=_a();ya.StreamSinkInSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return wb.AzureBlobStorageConfigSerializer._fromJsonObject(e.config);case"otelTracing":return Pb.SinkOtelV1ConfigSerializer._fromJsonObject(e.config);case"http":return Eb.SinkHttpConfigSerializer._fromJsonObject(e.config);case"amazonS3":return Ab.S3ConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return kb.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?Tb.SinkStatusInSerializer._fromJsonObject(e.status):void 0,uid:e.uid}},_toJsonObject(e){let t;switch(e.type){case"poller":t={};break;case"azureBlobStorage":t=wb.AzureBlobStorageConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=Pb.SinkOtelV1ConfigSerializer._toJsonObject(e.config);break;case"http":t=Eb.SinkHttpConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=Ab.S3ConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=kb.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?Tb.SinkStatusInSerializer._toJsonObject(e.status):void 0,uid:e.uid}}}});var Db=f(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.AmazonS3PatchConfigSerializer=void 0;Ca.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 jb=f(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.AzureBlobStoragePatchConfigSerializer=void 0;Oa.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 $b=f(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.GoogleCloudStoragePatchConfigSerializer=void 0;Sa.GoogleCloudStoragePatchConfigSerializer={_fromJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}},_toJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}}}});var qb=f(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.HttpPatchConfigSerializer=void 0;xa.HttpPatchConfigSerializer={_fromJsonObject(e){return{url:e.url}},_toJsonObject(e){return{url:e.url}}}});var Rb=f(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.OtelTracingPatchConfigSerializer=void 0;wa.OtelTracingPatchConfigSerializer={_fromJsonObject(e){return{url:e.url}},_toJsonObject(e){return{url:e.url}}}});var Nb=f(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.StreamSinkPatchSerializer=void 0;var Fb=Db(),zb=jb(),Mb=$b(),Jb=qb(),Bb=Rb(),Hb=_a();ka.StreamSinkPatchSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return zb.AzureBlobStoragePatchConfigSerializer._fromJsonObject(e.config);case"otelTracing":return Bb.OtelTracingPatchConfigSerializer._fromJsonObject(e.config);case"http":return Jb.HttpPatchConfigSerializer._fromJsonObject(e.config);case"amazonS3":return Fb.AmazonS3PatchConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return Mb.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?Hb.SinkStatusInSerializer._fromJsonObject(e.status):void 0,uid:e.uid}},_toJsonObject(e){let t;switch(e.type){case"poller":t={};break;case"azureBlobStorage":t=zb.AzureBlobStoragePatchConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=Bb.OtelTracingPatchConfigSerializer._toJsonObject(e.config);break;case"http":t=Jb.HttpPatchConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=Fb.AmazonS3PatchConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=Mb.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?Hb.SinkStatusInSerializer._toJsonObject(e.status):void 0,uid:e.uid}}}});var Ub=f(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.StreamingSink=void 0;var Lb=Hl(),RS=Ol(),FS=Ob(),zS=Sb(),MS=xb(),Gb=Ib(),Aa=uc(),JS=Nb(),ye=ne(),lc=class{constructor(t){this.requestCtx=t}list(t,r){let i=new ye.SvixRequest(ye.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,FS.ListResponseStreamSinkOutSerializer._fromJsonObject)}create(t,r,i){let n=new ye.SvixRequest(ye.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(Gb.StreamSinkInSerializer._toJsonObject(r)),n.send(this.requestCtx,Aa.StreamSinkOutSerializer._fromJsonObject)}get(t,r){let i=new ye.SvixRequest(ye.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,Aa.StreamSinkOutSerializer._fromJsonObject)}update(t,r,i){let n=new ye.SvixRequest(ye.HttpMethod.PUT,"/api/v1/stream/{stream_id}/sink/{sink_id}");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(Gb.StreamSinkInSerializer._toJsonObject(i)),n.send(this.requestCtx,Aa.StreamSinkOutSerializer._fromJsonObject)}delete(t,r){let i=new ye.SvixRequest(ye.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 ye.SvixRequest(ye.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(JS.StreamSinkPatchSerializer._toJsonObject(i)),n.send(this.requestCtx,Aa.StreamSinkOutSerializer._fromJsonObject)}getSecret(t,r){let i=new ye.SvixRequest(ye.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,zS.SinkSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i,n){let o=new ye.SvixRequest(ye.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(RS.EndpointSecretRotateInSerializer._toJsonObject(i)),o.send(this.requestCtx,Lb.EmptyResponseSerializer._fromJsonObject)}transformationPartialUpdate(t,r,i){let n=new ye.SvixRequest(ye.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(MS.SinkTransformInSerializer._toJsonObject(i)),n.send(this.requestCtx,Lb.EmptyResponseSerializer._fromJsonObject)}};Ea.StreamingSink=lc});var cc=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 Vb=f(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.ListResponseStreamOutSerializer=void 0;var Wb=cc();Ta.ListResponseStreamOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Wb.StreamOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Wb.StreamOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Kb=f(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.StreamPatchSerializer=void 0;Ia.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 Qb=f(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.StreamingStream=void 0;var BS=Vb(),Yb=ec(),Da=cc(),HS=Kb(),tt=ne(),dc=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,BS.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(Yb.StreamInSerializer._toJsonObject(t)),i.send(this.requestCtx,Da.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,Da.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(Yb.StreamInSerializer._toJsonObject(r)),i.send(this.requestCtx,Da.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(HS.StreamPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Da.StreamOutSerializer._fromJsonObject)}};ja.StreamingStream=dc});var Xb=f($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.Streaming=void 0;var Zb=yl(),NS=Zg(),LS=Xg(),GS=ob(),US=fb(),WS=Ub(),VS=Qb(),hr=ne(),mc=class{constructor(t){this.requestCtx=t}get event_type(){return new GS.StreamingEventType(this.requestCtx)}get events(){return new US.StreamingEvents(this.requestCtx)}get sink(){return new WS.StreamingSink(this.requestCtx)}get stream(){return new VS.StreamingStream(this.requestCtx)}sinkHeadersGet(t,r){let i=new hr.SvixRequest(hr.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,Zb.EndpointHeadersOutSerializer._fromJsonObject)}sinkHeadersPatch(t,r,i){let n=new hr.SvixRequest(hr.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(NS.HttpSinkHeadersPatchInSerializer._toJsonObject(i)),n.send(this.requestCtx,Zb.EndpointHeadersOutSerializer._fromJsonObject)}sinkTransformationGet(t,r){let i=new hr.SvixRequest(hr.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,LS.SinkTransformationOutSerializer._fromJsonObject)}};$a.Streaming=mc});var e0=f(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.HTTPValidationError=Tt.ValidationError=Tt.HttpErrorOut=void 0;var gr=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};Tt.HttpErrorOut=gr;gr.discriminator=void 0;gr.mapping=void 0;gr.attributeTypeMap=[{name:"code",baseName:"code",type:"string",format:""},{name:"detail",baseName:"detail",type:"string",format:""}];var br=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};Tt.ValidationError=br;br.discriminator=void 0;br.mapping=void 0;br.attributeTypeMap=[{name:"loc",baseName:"loc",type:"Array<string>",format:""},{name:"msg",baseName:"msg",type:"string",format:""},{name:"type",baseName:"type",type:"string",format:""}];var vr=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};Tt.HTTPValidationError=vr;vr.discriminator=void 0;vr.mapping=void 0;vr.attributeTypeMap=[{name:"detail",baseName:"detail",type:"Array<ValidationError>",format:""}]});var r0=f(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.timingSafeEqual=void 0;function t0(e,t=""){if(!e)throw new Error(t)}function KS(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)),t0(e instanceof DataView),t0(t instanceof DataView);let r=e.byteLength,i=0,n=-1;for(;++n<r;)i|=e.getUint8(n)^t.getUint8(n);return i===0}qa.timingSafeEqual=KS});var o0=f(Ge=>{"use strict";var YS=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 de=256,pc=(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,c=0,l=0,d=0;s<i-4;s+=4)u=this._decodeChar(t.charCodeAt(s+0)),c=this._decodeChar(t.charCodeAt(s+1)),l=this._decodeChar(t.charCodeAt(s+2)),d=this._decodeChar(t.charCodeAt(s+3)),n[o++]=u<<2|c>>>4,n[o++]=c<<4|l>>>2,n[o++]=l<<6|d,a|=u&de,a|=c&de,a|=l&de,a|=d&de;if(s<i-1&&(u=this._decodeChar(t.charCodeAt(s)),c=this._decodeChar(t.charCodeAt(s+1)),n[o++]=u<<2|c>>>4,a|=u&de,a|=c&de),s<i-2&&(l=this._decodeChar(t.charCodeAt(s+2)),n[o++]=c<<4|l>>>2,a|=l&de),s<i-3&&(d=this._decodeChar(t.charCodeAt(s+3)),n[o++]=l<<6|d,a|=d&de),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=de;return r+=(42-t&t-44)>>>8&-de+t-43+62,r+=(46-t&t-48)>>>8&-de+t-47+63,r+=(47-t&t-58)>>>8&-de+t-48+52,r+=(64-t&t-91)>>>8&-de+t-65+0,r+=(96-t&t-123)>>>8&-de+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=pc;var ni=new pc;function QS(e){return ni.encode(e)}Ge.encode=QS;function ZS(e){return ni.decode(e)}Ge.decode=ZS;var i0=(function(e){YS(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=de;return i+=(44-r&r-46)>>>8&-de+r-45+62,i+=(94-r&r-96)>>>8&-de+r-95+63,i+=(47-r&r-58)>>>8&-de+r-48+52,i+=(64-r&r-91)>>>8&-de+r-65+0,i+=(96-r&r-123)>>>8&-de+r-97+26,i},t})(pc);Ge.URLSafeCoder=i0;var n0=new i0;function XS(e){return n0.encode(e)}Ge.encodeURLSafe=XS;function e1(e){return n0.decode(e)}Ge.decodeURLSafe=e1;Ge.encodedLength=function(e){return ni.encodedLength(e)};Ge.maxDecodedLength=function(e){return ni.maxDecodedLength(e)};Ge.decodedLength=function(e){return ni.decodedLength(e)}});var a0=f((s0,Ra)=>{(function(e,t){var r={};t(r);var i=r.default;for(var n in r)i[n]=r[n];typeof Ra=="object"&&typeof Ra.exports=="object"?Ra.exports=i:typeof define=="function"&&define.amd?define(function(){return i}):e.sha256=i})(s0,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(d,m,v,b,_){for(var x,w,S,A,D,P,j,E,k,G,We,qe,mi;_>=64;){for(x=m[0],w=m[1],S=m[2],A=m[3],D=m[4],P=m[5],j=m[6],E=m[7],G=0;G<16;G++)We=b+G*4,d[G]=(v[We]&255)<<24|(v[We+1]&255)<<16|(v[We+2]&255)<<8|v[We+3]&255;for(G=16;G<64;G++)k=d[G-2],qe=(k>>>17|k<<15)^(k>>>19|k<<13)^k>>>10,k=d[G-15],mi=(k>>>7|k<<25)^(k>>>18|k<<14)^k>>>3,d[G]=(qe+d[G-7]|0)+(mi+d[G-16]|0);for(G=0;G<64;G++)qe=(((D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7))+(D&P^~D&j)|0)+(E+(t[G]+d[G]|0)|0)|0,mi=((x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10))+(x&w^x&S^w&S)|0,E=j,j=P,P=D,D=A+qe|0,A=S,S=w,w=x,x=qe+mi|0;m[0]+=x,m[1]+=w,m[2]+=S,m[3]+=A,m[4]+=D,m[5]+=P,m[6]+=j,m[7]+=E,b+=64,_-=64}return b}var i=(function(){function d(){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 d.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},d.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()},d.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},d.prototype.finish=function(m){if(!this.finished){var v=this.bytesHashed,b=this.bufferLength,_=v/536870912|0,x=v<<3,w=v%64<56?64:128;this.buffer[b]=128;for(var S=b+1;S<w-8;S++)this.buffer[S]=0;this.buffer[w-8]=_>>>24&255,this.buffer[w-7]=_>>>16&255,this.buffer[w-6]=_>>>8&255,this.buffer[w-5]=_>>>0&255,this.buffer[w-4]=x>>>24&255,this.buffer[w-3]=x>>>16&255,this.buffer[w-2]=x>>>8&255,this.buffer[w-1]=x>>>0&255,r(this.temp,this.state,this.buffer,0,w),this.finished=!0}for(var S=0;S<8;S++)m[S*4+0]=this.state[S]>>>24&255,m[S*4+1]=this.state[S]>>>16&255,m[S*4+2]=this.state[S]>>>8&255,m[S*4+3]=this.state[S]>>>0&255;return this},d.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},d.prototype._saveState=function(m){for(var v=0;v<this.state.length;v++)m[v]=this.state[v]},d.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},d})();e.Hash=i;var n=(function(){function d(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 d.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},d.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()},d.prototype.update=function(m){return this.inner.update(m),this},d.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},d.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},d})();e.HMAC=n;function o(d){var m=new i().update(d),v=m.digest();return m.clean(),v}e.hash=o,e.default=o;function s(d,m){var v=new n(d).update(m),b=v.digest();return v.clean(),b}e.hmac=s;function a(d,m,v,b){var _=b[0];if(_===0)throw new Error("hkdf: cannot expand more");m.reset(),_>1&&m.update(d),v&&m.update(v),m.update(b),m.finish(d),b[0]++}var u=new Uint8Array(e.digestLength);function c(d,m,v,b){m===void 0&&(m=u),b===void 0&&(b=32);for(var _=new Uint8Array([1]),x=s(m,d),w=new n(x),S=new Uint8Array(w.digestLength),A=S.length,D=new Uint8Array(b),P=0;P<b;P++)A===S.length&&(a(S,w,v,_),A=0),D[P]=S[A++];return w.clean(),S.fill(0),_.fill(0),D}e.hkdf=c;function l(d,m,v,b){for(var _=new n(d),x=_.digestLength,w=new Uint8Array(4),S=new Uint8Array(x),A=new Uint8Array(x),D=new Uint8Array(b),P=0;P*x<b;P++){var j=P+1;w[0]=j>>>24&255,w[1]=j>>>16&255,w[2]=j>>>8&255,w[3]=j>>>0&255,_.reset(),_.update(m),_.update(w),_.finish(A);for(var E=0;E<x;E++)S[E]=A[E];for(var E=2;E<=v;E++){_.reset(),_.update(A).finish(A);for(var k=0;k<x;k++)S[k]^=A[k]}for(var E=0;E<x&&P*x+E<b;E++)D[P*x+E]=S[E]}for(var P=0;P<x;P++)S[P]=A[P]=0;for(var P=0;P<4;P++)w[P]=0;return _.clean(),D}e.pbkdf2=l})});var hc=f(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.Webhook=_r.WebhookVerificationError=void 0;var t1=r0(),u0=o0(),r1=a0(),l0=300,fc=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},It=class e extends fc{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};_r.WebhookVerificationError=It;var Fa=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=u0.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 It("Missing required headers");let a=this.verifyTimestamp(s),c=this.sign(n,a,t).split(",")[1],l=o.split(" "),d=new globalThis.TextEncoder;for(let m of l){let[v,b]=m.split(",");if(v==="v1"&&(0,t1.timingSafeEqual)(d.encode(b),d.encode(c)))return JSON.parse(t.toString())}throw new It("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,${u0.encode(r1.hmac(this.key,s))}`}verifyTimestamp(t){let r=Math.floor(Date.now()/1e3),i=parseInt(t,10);if(isNaN(i))throw new It("Invalid Signature Headers");if(r-i>l0)throw new It("Message timestamp too old");if(i>r+l0)throw new It("Message timestamp too new");return new Date(i*1e3)}};_r.Webhook=Fa;Fa.prefix="whsec_"});var c0=f(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.Webhook=yr.WebhookVerificationError=void 0;var i1=hc(),n1=hc();Object.defineProperty(yr,"WebhookVerificationError",{enumerable:!0,get:function(){return n1.WebhookVerificationError}});var gc=class{constructor(t,r){this.inner=new i1.Webhook(t,r)}verify(t,r){var i,n,o,s,a,u;let c={};for(let l of Object.keys(r))c[l.toLowerCase()]=r[l];return c["webhook-id"]=(n=(i=c["svix-id"])!==null&&i!==void 0?i:c["webhook-id"])!==null&&n!==void 0?n:"",c["webhook-signature"]=(s=(o=c["svix-signature"])!==null&&o!==void 0?o:c["webhook-signature"])!==null&&s!==void 0?s:"",c["webhook-timestamp"]=(u=(a=c["svix-timestamp"])!==null&&a!==void 0?a:c["webhook-timestamp"])!==null&&u!==void 0?u:"",this.inner.verify(t,c)}sign(t,r,i){return this.inner.sign(t,r,i)}};yr.Webhook=gc});var d0=f(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.EndpointDisabledTriggerSerializer=Xt.EndpointDisabledTrigger=void 0;var o1;(function(e){e.Manual="manual",e.Automatic="automatic"})(o1=Xt.EndpointDisabledTrigger||(Xt.EndpointDisabledTrigger={}));Xt.EndpointDisabledTriggerSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var m0=f(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.OrderingSerializer=er.Ordering=void 0;var s1;(function(e){e.Ascending="ascending",e.Descending="descending"})(s1=er.Ordering||(er.Ordering={}));er.OrderingSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var p0=f(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.StatusCodeClass=X.SinkStatusIn=X.SinkStatus=X.Ordering=X.MessageStatusText=X.MessageStatus=X.MessageAttemptTriggerType=X.EndpointDisabledTrigger=X.ConnectorProduct=X.ConnectorKind=X.BackgroundTaskType=X.BackgroundTaskStatus=X.AppPortalCapability=void 0;var a1=ml();Object.defineProperty(X,"AppPortalCapability",{enumerable:!0,get:function(){return a1.AppPortalCapability}});var u1=Et();Object.defineProperty(X,"BackgroundTaskStatus",{enumerable:!0,get:function(){return u1.BackgroundTaskStatus}});var l1=Pt();Object.defineProperty(X,"BackgroundTaskType",{enumerable:!0,get:function(){return l1.BackgroundTaskType}});var c1=dr();Object.defineProperty(X,"ConnectorKind",{enumerable:!0,get:function(){return c1.ConnectorKind}});var d1=sn();Object.defineProperty(X,"ConnectorProduct",{enumerable:!0,get:function(){return d1.ConnectorProduct}});var m1=d0();Object.defineProperty(X,"EndpointDisabledTrigger",{enumerable:!0,get:function(){return m1.EndpointDisabledTrigger}});var p1=Nl();Object.defineProperty(X,"MessageAttemptTriggerType",{enumerable:!0,get:function(){return p1.MessageAttemptTriggerType}});var f1=mr();Object.defineProperty(X,"MessageStatus",{enumerable:!0,get:function(){return f1.MessageStatus}});var h1=ii();Object.defineProperty(X,"MessageStatusText",{enumerable:!0,get:function(){return h1.MessageStatusText}});var g1=m0();Object.defineProperty(X,"Ordering",{enumerable:!0,get:function(){return g1.Ordering}});var b1=ac();Object.defineProperty(X,"SinkStatus",{enumerable:!0,get:function(){return b1.SinkStatus}});var v1=_a();Object.defineProperty(X,"SinkStatusIn",{enumerable:!0,get:function(){return v1.SinkStatusIn}});var _1=_l();Object.defineProperty(X,"StatusCodeClass",{enumerable:!0,get:function(){return _1.StatusCodeClass}})});var h0=f(me=>{"use strict";var y1=me&&me.__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]})),f0=me&&me.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&y1(t,e,r)};Object.defineProperty(me,"__esModule",{value:!0});me.Svix=me.messageInRaw=me.ValidationError=me.HttpErrorOut=me.HTTPValidationError=me.ApiException=void 0;var C1=Pm(),O1=Bm(),S1=Um(),x1=ip(),w1=Pp(),k1=Rp(),A1=Wp(),E1=Kp(),P1=Uh(),T1=Xh(),I1=Bl(),D1=$g(),j1=Ng(),$1=Qg(),q1=Xb(),R1=Kl(),F1=Zu();Object.defineProperty(me,"ApiException",{enumerable:!0,get:function(){return F1.ApiException}});var vc=e0();Object.defineProperty(me,"HTTPValidationError",{enumerable:!0,get:function(){return vc.HTTPValidationError}});Object.defineProperty(me,"HttpErrorOut",{enumerable:!0,get:function(){return vc.HttpErrorOut}});Object.defineProperty(me,"ValidationError",{enumerable:!0,get:function(){return vc.ValidationError}});f0(c0(),me);f0(p0(),me);var z1=Bl();Object.defineProperty(me,"messageInRaw",{enumerable:!0,get:function(){return z1.messageInRaw}});var M1=[{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"}],bc=class{constructor(t,r={}){var i,n,o;let s=(i=M1.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 C1.Application(this.requestCtx)}get authentication(){return new O1.Authentication(this.requestCtx)}get backgroundTask(){return new S1.BackgroundTask(this.requestCtx)}get connector(){return new x1.Connector(this.requestCtx)}get endpoint(){return new w1.Endpoint(this.requestCtx)}get environment(){return new k1.Environment(this.requestCtx)}get eventType(){return new A1.EventType(this.requestCtx)}get health(){return new E1.Health(this.requestCtx)}get ingest(){return new P1.Ingest(this.requestCtx)}get integration(){return new T1.Integration(this.requestCtx)}get message(){return new I1.Message(this.requestCtx)}get messageAttempt(){return new D1.MessageAttempt(this.requestCtx)}get operationalWebhook(){return new j1.OperationalWebhook(this.requestCtx)}get statistics(){return new $1.Statistics(this.requestCtx)}get streaming(){return new q1.Streaming(this.requestCtx)}get operationalWebhookEndpoint(){return new R1.OperationalWebhookEndpoint(this.requestCtx)}};me.Svix=bc});var yc={};ar(yc,{FileBackend:()=>_c});var _c,Cc=W(()=>{"use strict";Ie();_c=class{name="plaintext file";isSecure=!1;async get(t,r){let i=ke();return i?i.profiles[r]?.api_key??null:null}async set(t,r,i){Oc(i,r)}async delete(t,r){try{return Sc(r),!0}catch{return!1}}async isAvailable(){return!0}}});var A0={};ar(A0,{MacOSBackend:()=>wc});function xc(e,t){return new Promise(r=>{(0,k0.execFile)(e,t,{timeout:5e3},(i,n,o)=>{let s=i&&"code"in i?i.code:0;r({stdout:n??"",stderr:o??"",code:s})})})}var k0,wc,E0=W(()=>{"use strict";k0=require("node:child_process");wc=class{name="macOS Keychain";isSecure=!0;async get(t,r){let{stdout:i,stderr:n,code:o}=await xc("/usr/bin/security",["find-generic-password","-s",t,"-a",r,"-w"]);if(o===44)return null;if(o!==0)throw new Error(`Failed to read from macOS Keychain (exit code ${o}): ${n.trim()}`);return i.trim()||null}async set(t,r,i){let{code:n,stderr:o}=await xc("/usr/bin/security",["add-generic-password","-s",t,"-a",r,"-w",i,"-U"]);if(n!==0)throw new Error(`Failed to store credential in macOS Keychain: ${o.trim()}`)}async delete(t,r){let{code:i}=await xc("/usr/bin/security",["delete-generic-password","-s",t,"-a",r]);return i===0}async isAvailable(){return process.platform==="darwin"}}});var P0={};ar(P0,{LinuxBackend:()=>kc});function Ma(e,t,r){return new Promise(i=>{(0,Ja.execFile)(e,t,{timeout:r?.timeout??5e3},(n,o,s)=>{let a=n&&"code"in n?n.code:0;i({stdout:o??"",stderr:s??"",code:a})})})}function hx(e,t,r){return new Promise(i=>{let n=(0,Ja.spawn)(e,t,{stdio:["pipe","ignore","pipe"],timeout:5e3}),o="";n.stderr?.on("data",s=>{o+=s.toString()}),n.on("close",s=>{i({code:s,stderr:o})}),n.on("error",()=>{i({code:1,stderr:"Failed to spawn process"})}),n.stdin?.on("error",()=>{}),n.stdin?.write(r),n.stdin?.end()})}var Ja,kc,T0=W(()=>{"use strict";Ja=require("node:child_process");kc=class{name="Secret Service (libsecret)";isSecure=!0;async get(t,r){let{stdout:i,code:n}=await Ma("secret-tool",["lookup","service",t,"account",r]);return n!==0||!i.trim()?null:i.trim()}async set(t,r,i){let{code:n,stderr:o}=await hx("secret-tool",["store",`--label=Resend CLI (${r})`,"service",t,"account",r],i);if(n!==0)throw new Error(`Failed to store credential in Secret Service: ${o.trim()}`)}async delete(t,r){let{code:i}=await Ma("secret-tool",["clear","service",t,"account",r]);return i===0}async isAvailable(){if(process.platform!=="linux"||(await Ma("which",["secret-tool"])).code!==0)return!1;let r=await Ma("secret-tool",["lookup","service","__resend_cli_probe__"],{timeout:3e3});return r.code===0||r.code===1}}});var I0={};ar(I0,{WindowsBackend:()=>Ac});function Ba(e){return new Promise(t=>{(0,Ha.execFile)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e],{timeout:1e4},(r,i,n)=>{let o=r&&"code"in r?r.code:0;t({stdout:i??"",stderr:n??"",code:o})})})}function gx(e,t){return new Promise(r=>{let i=(0,Ha.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e],{stdio:["pipe","pipe","pipe"],timeout:1e4}),n="",o="";i.stdout?.on("data",s=>{n+=s.toString()}),i.stderr?.on("data",s=>{o+=s.toString()}),i.on("close",s=>{r({stdout:n,stderr:o,code:s})}),i.on("error",()=>{r({stdout:"",stderr:"Failed to spawn process",code:1})}),i.stdin?.on("error",()=>{}),i.stdin?.write(t),i.stdin?.end()})}function Dt(e){return e.replace(/'/g,"''")}var Ha,oi,Ac,D0=W(()=>{"use strict";Ha=require("node:child_process");oi=`
|
|
29
29
|
try { $null = [Windows.Security.Credentials.PasswordVault] } catch {
|
|
30
30
|
[void][Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime]
|
|
@@ -180,7 +180,7 @@ ${n}
|
|
|
180
180
|
`&&(t=" "),(t.charCodeAt(0)>=33||[" "," "].includes(t))&&(this.node.value+=t),this.escaped=!1}},OC=50;function Vu(e,t){t=t||{};let r=t._depth||0;if(r>OC)return[];let n=new Wu(e).tokenize(),o=[],s=[],a=[];if(n.forEach(u=>{u.type==="operator"&&(u.value===","||u.value===";")?(s.length&&o.push(s),s=[]):s.push(u)}),s.length&&o.push(s),o.forEach(u=>{u=CC(u,r),u.length&&(a=a.concat(u))}),t.flatten){let u=[],c=l=>{l.forEach(d=>{if(d.group)return c(d.group);u.push(d)})};return c(a),u}return a}var ji=Vu;function Ud(e){for(var t="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(e),n=i.byteLength,o=n%3,s=n-o,a,u,c,l,d,m=0;m<s;m=m+3)d=i[m]<<16|i[m+1]<<8|i[m+2],a=(d&16515072)>>18,u=(d&258048)>>12,c=(d&4032)>>6,l=d&63,t+=r[a]+r[u]+r[c]+r[l];return o==1?(d=i[s],a=(d&252)>>2,u=(d&3)<<4,t+=r[a]+r[u]+"=="):o==2&&(d=i[s]<<8|i[s+1],a=(d&64512)>>10,u=(d&1008)>>4,c=(d&15)<<2,t+=r[a]+r[u]+r[c]+"="),t}var SC=256,xC=2*1024*1024;function Ku(e){return e.replace(/-(.)/g,(t,r)=>r.toUpperCase())}var Kr=class e{static parse(t,r){return new e(r).parse(t)}constructor(t){this.options=t||{},this.mimeOptions={maxNestingDepth:this.options.maxNestingDepth||SC,maxHeadersSize:this.options.maxHeadersSize||xC},this.root=this.currentNode=new cr({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(t,r){let i=this.boundaries;if(i.length&&t.length>2&&t[0]===45&&t[1]===45)for(let n=i.length-1;n>=0;n--){let o=i[n];if(t.length<o.value.length+2)continue;let s=!0;for(let l=0;l<o.value.length;l++)if(t[l+2]!==o.value[l]){s=!1;break}if(!s)continue;let a=o.value.length+2,u=!1;t.length>=o.value.length+4&&t[o.value.length+2]===45&&t[o.value.length+3]===45&&(u=!0,a=o.value.length+4);let c=!0;for(let l=a;l<t.length;l++)if(t[l]!==32&&t[l]!==9){c=!1;break}if(c)return u?(await o.node.finalize(),this.currentNode=o.node.parentNode||this.root):(await o.node.finalizeChildNodes(),this.currentNode=new cr({postalMime:this,parentNode:o.node,parentMultipartType:o.node.contentType.multipart,...this.mimeOptions})),r?this.finalize():void 0}if(this.currentNode.feed(t),r)return this.finalize()}readLine(){let t=this.readPos,r=this.readPos;for(;this.readPos<this.av.length;){let i=this.av[this.readPos++];if(i!==13&&i!==10&&(r=this.readPos),i===10)return{bytes:new Uint8Array(this.buf,t,r-t),done:this.readPos>=this.av.length}}return{bytes:new Uint8Array(this.buf,t,r-t),done:this.readPos>=this.av.length}}async processNodeTree(){let t={},r=new Set,i=this.textMap=new Map,n=this.forceRfc822Attachments(),o=async(s,a,u)=>{if(a=a||!1,u=u||!1,s.contentType.multipart)s.contentType.multipart==="alternative"?a=s:s.contentType.multipart==="related"&&(u=s);else if(this.isInlineMessageRfc822(s)&&!n){let c=new e;s.subMessage=await c.parse(s.content),i.has(s)||i.set(s,{});let l=i.get(s);(s.subMessage.text||!s.subMessage.html)&&(l.plain=l.plain||[],l.plain.push({type:"subMessage",value:s.subMessage}),r.add("plain")),s.subMessage.html&&(l.html=l.html||[],l.html.push({type:"subMessage",value:s.subMessage}),r.add("html")),c.textMap&&c.textMap.forEach((d,m)=>{i.set(m,d)});for(let d of s.subMessage.attachments||[])this.attachments.push(d)}else if(this.isInlineTextNode(s)){let c=s.contentType.parsed.value.substr(s.contentType.parsed.value.indexOf("/")+1),l=a||s;i.has(l)||i.set(l,{});let d=i.get(l);d[c]=d[c]||[],d[c].push({type:"text",value:s.getTextContent()}),r.add(c)}else if(s.content){let c=s.contentDisposition?.parsed?.params?.filename||s.contentType.parsed.params.name||null,l={filename:c?Mt(c):null,mimeType:s.contentType.parsed.value,disposition:s.contentDisposition?.parsed?.value||null};switch(u&&s.contentId&&(l.related=!0),s.contentDescription&&(l.description=s.contentDescription),s.contentId&&(l.contentId=s.contentId),s.contentType.parsed.value){case"text/calendar":case"application/ics":{s.contentType.parsed.params.method&&(l.method=s.contentType.parsed.params.method.toString().toUpperCase().trim());let d=s.getTextContent().replace(/\r?\n/g,`
|
|
181
181
|
`).replace(/\n*$/,`
|
|
182
182
|
`);l.content=xt.encode(d);break}default:l.content=s.content}this.attachments.push(l)}for(let c of s.childNodes)await o(c,a,u)};await o(this.root,!1,!1),i.forEach(s=>{r.forEach(a=>{if(t[a]||(t[a]=[]),s[a])s[a].forEach(u=>{switch(u.type){case"text":t[a].push(u.value);break;case"subMessage":switch(a){case"html":t[a].push(Uu(u.value));break;case"plain":t[a].push(Gu(u.value));break}break}});else{let u;switch(a){case"html":u="plain";break;case"plain":u="html";break}(s[u]||[]).forEach(c=>{switch(c.type){case"text":switch(a){case"html":t[a].push(Hd(c.value));break;case"plain":t[a].push(Nd(c.value));break}break;case"subMessage":switch(a){case"html":t[a].push(Uu(c.value));break;case"plain":t[a].push(Gu(c.value));break}break}})}})}),Object.keys(t).forEach(s=>{t[s]=t[s].join(`
|
|
183
|
-
`)}),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=xt.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=ji(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=ji(o.value);if(s&&s.length&&s[0].address){let a=Ku(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=>ji(a.value)).forEach(a=>s=s.concat(a||[])),s&&s.length){let a=Ku(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=Ku(n);r[s]=Mt(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=Ud(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 O0=le(h0(),1),J1="6.12.0";function Ce(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 B1=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/api-keys",e,t)}async list(e={}){let t=Ce(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}`)}},H1=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=Ce(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 S0(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 x0(e){return{from:e.from,to:e.to,type:e.type}}function N1(e){return{name:e.name,status:e.status,steps:e.steps.map(S0),connections:e.connections.map(x0)}}function L1(e){return{event:e.event,contact_id:e.contactId,email:e.email,payload:e.payload}}var G1=class{constructor(e){this.resend=e,this.runs=new H1(this.resend)}async create(e){return await this.resend.post("/automations",N1(e))}async list(e={}){let t=[Ce(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(S0)),t.connections!==void 0&&(r.connections=t.connections.map(x0)),await this.resend.patch(`/automations/${e}`,r)}async stop(e){return await this.resend.post(`/automations/${e}/stop`)}};function U1(e){return e?.map(t=>({content:t.content,filename:t.filename,path:t.path,content_type:t.contentType,content_id:t.contentId}))}function w0(e){return{attachments:U1(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 za(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 W1=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 za(i.react),i.react=void 0),r.push(w0(i));return await this.resend.post("/emails/batch",r,{...t,headers:{"x-batch-validation":t?.batchValidation??"strict",...t?.headers}})}},V1=class{constructor(e){this.resend=e}async create(e,t={}){return e.react&&(e.html=await za(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=Ce(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 za(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 g0(e){return{id:e.id,key:e.key,createdAt:e.created_at,type:e.type,fallbackValue:e.fallback_value}}function b0(e){return"key"in e?{key:e.key,type:e.type,fallback_value:e.fallbackValue}:{fallback_value:e.fallbackValue}}var K1=class{constructor(e){this.resend=e}async create(e){let t=b0(e);return await this.resend.post("/contact-properties",t)}async list(e={}){let t=Ce(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=>g0(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",...g0(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=b0(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"}}}},Y1=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=Ce(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}`)}},Q1=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=Ce(e),i=r?`/contacts/${t}/topics?${r}`:`/contacts/${t}/topics`;return this.resend.get(i)}},Z1=class{constructor(e){this.resend=e,this.topics=new Q1(this.resend),this.segments=new Y1(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=Ce(e),o=n?`/contacts?${n}`:"/contacts";return await this.resend.get(o)}let r=Ce(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 X1(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 ex=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/domains",X1(e),t)}async list(e={}){let t=Ce(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`)}},tx=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=Ce(e),i=r?`/emails/${t}/attachments?${r}`:`/emails/${t}/attachments`;return await this.resend.get(i)}},rx=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=Ce(e),i=r?`/emails/receiving/${t}/attachments?${r}`:`/emails/receiving/${t}/attachments`;return await this.resend.get(i)}},ix=class{constructor(e){this.resend=e,this.attachments=new rx(e)}async get(e){return await this.resend.get(`/emails/receiving/${e}`)}async list(e={}){let t=Ce(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 Kr.parse(s,{attachmentEncoding:"base64"}),u=a.attachments.map(c=>{let l=c.contentId?c.contentId.replace(/^<|>$/g,""):void 0;return{filename:c.filename,content:c.content.toString(),content_type:c.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"}]})}},nx=class{constructor(e){this.resend=e,this.attachments=new tx(e),this.receiving=new ix(e)}async send(e,t={}){return this.create(e,t)}async create(e,t={}){return e.react&&(e.html=await za(e.react)),await this.resend.post("/emails",w0(e),t)}async get(e){return await this.resend.get(`/emails/${e}`)}async list(e={}){let t=Ce(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`)}},ox=class{constructor(e){this.resend=e}async send(e){return await this.resend.post("/events/send",L1(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=Ce(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)}`)}},sx=class{constructor(e){this.resend=e}async list(e={}){let t=Ce(e),r=t?`/logs?${t}`:"/logs";return await this.resend.get(r)}async get(e){return await this.resend.get(`/logs/${e}`)}},ax=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/segments",e,t)}async list(e={}){let t=Ce(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 ux(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 lx(e){return e?.map(t=>({key:t.key,type:t.type,fallback_value:t.fallbackValue}))}function v0(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:lx(e.variables)}}var _0=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)}},cx=class{constructor(e){this.resend=e}create(e){return new _0(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",v0(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${ux(e)}`)}duplicate(e){return new _0(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}`,v0(t))}},dx=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"}}}},mx=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=Ce(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 O0.Webhook(e.webhookSecret).verify(e.payload,{"svix-id":e.headers.id,"svix-timestamp":e.headers.timestamp,"svix-signature":e.headers.signature})}},y0="https://api.resend.com",C0=`resend-node:${J1}`,px=typeof process<"u"&&process.env&&process.env.RESEND_BASE_URL||y0,fx=typeof process<"u"&&process.env&&process.env.RESEND_USER_AGENT||C0,Cr=class{constructor(e){if(this.key=e,this.segments=new ax(this),this.apiKeys=new B1(this),this.audiences=this.segments,this.automations=new G1(this),this.batch=new W1(this),this.broadcasts=new V1(this),this.contactProperties=new K1(this),this.contacts=new Z1(this),this.domains=new ex(this),this.emails=new nx(this),this.events=new ox(this),this.logs=new sx(this),this.templates=new cx(this),this.topics=new dx(this),this.webhooks=new mx(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":fx,"Content-Type":"application/json"})}async fetchRequest(e,t={}){try{let r=await fetch(`${px}${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)}};Ie();var F0=le(Ct(),1);function Q(e,t){return e instanceof Error?e.message:t}function z0(e){return!!(e||!process.stdout.isTTY)}function F(e,t={}){z0(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)}function g(e,t={}){let r=t.exitCode??1;z0(t.json)?console.error(JSON.stringify({error:{message:e.message,code:e.code??"unknown"}},null,2)):console.error(`${F0.default.red("Error:")} ${e.message}`),process.exit(r)}var M0={sending_access:0,full_access:1};function vx(e,t){return M0[e]>=M0[t]}async function oe(e,t){let r=e.profile;try{let i=await ir(e.apiKey,r);if(!i){if(r){let n=je();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";vx(i.permission,n)||g({message:`This command requires a full access API key. Your current key has sending access only.
|
|
183
|
+
`)}),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=xt.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=ji(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=ji(o.value);if(s&&s.length&&s[0].address){let a=Ku(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=>ji(a.value)).forEach(a=>s=s.concat(a||[])),s&&s.length){let a=Ku(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=Ku(n);r[s]=Mt(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=Ud(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 O0=le(h0(),1),J1="6.12.2";function Ce(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 B1=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/api-keys",e,t)}async list(e={}){let t=Ce(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}`)}},H1=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=Ce(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 S0(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 x0(e){return{from:e.from,to:e.to,type:e.type}}function N1(e){return{name:e.name,status:e.status,steps:e.steps.map(S0),connections:e.connections.map(x0)}}function L1(e){return{event:e.event,contact_id:e.contactId,email:e.email,payload:e.payload}}var G1=class{constructor(e){this.resend=e,this.runs=new H1(this.resend)}async create(e){return await this.resend.post("/automations",N1(e))}async list(e={}){let t=[Ce(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(S0)),t.connections!==void 0&&(r.connections=t.connections.map(x0)),await this.resend.patch(`/automations/${e}`,r)}async stop(e){return await this.resend.post(`/automations/${e}/stop`)}};function U1(e){return e?.map(t=>({content:t.content,filename:t.filename,path:t.path,content_type:t.contentType,content_id:t.contentId}))}function w0(e){return{attachments:U1(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 za(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 W1=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 za(i.react),i.react=void 0),r.push(w0(i));return await this.resend.post("/emails/batch",r,{...t,headers:{"x-batch-validation":t?.batchValidation??"strict",...t?.headers}})}},V1=class{constructor(e){this.resend=e}async create(e,t={}){return e.react&&(e.html=await za(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=Ce(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 za(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 g0(e){return{id:e.id,key:e.key,createdAt:e.created_at,type:e.type,fallbackValue:e.fallback_value}}function b0(e){return"key"in e?{key:e.key,type:e.type,fallback_value:e.fallbackValue}:{fallback_value:e.fallbackValue}}var K1=class{constructor(e){this.resend=e}async create(e){let t=b0(e);return await this.resend.post("/contact-properties",t)}async list(e={}){let t=Ce(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=>g0(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",...g0(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=b0(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"}}}},Y1=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=Ce(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}`)}},Q1=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=Ce(e),i=r?`/contacts/${t}/topics?${r}`:`/contacts/${t}/topics`;return this.resend.get(i)}},Z1=class{constructor(e){this.resend=e,this.topics=new Q1(this.resend),this.segments=new Y1(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=Ce(e),o=n?`/contacts?${n}`:"/contacts";return await this.resend.get(o)}let r=Ce(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 X1(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 ex=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/domains",X1(e),t)}async list(e={}){let t=Ce(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`)}},tx=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=Ce(e),i=r?`/emails/${t}/attachments?${r}`:`/emails/${t}/attachments`;return await this.resend.get(i)}},rx=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=Ce(e),i=r?`/emails/receiving/${t}/attachments?${r}`:`/emails/receiving/${t}/attachments`;return await this.resend.get(i)}},ix=class{constructor(e){this.resend=e,this.attachments=new rx(e)}async get(e){return await this.resend.get(`/emails/receiving/${e}`)}async list(e={}){let t=Ce(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 Kr.parse(s,{attachmentEncoding:"base64"}),u=a.attachments.map(c=>{let l=c.contentId?c.contentId.replace(/^<|>$/g,""):void 0;return{filename:c.filename,content:c.content.toString(),content_type:c.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"}]})}},nx=class{constructor(e){this.resend=e,this.attachments=new tx(e),this.receiving=new ix(e)}async send(e,t={}){return this.create(e,t)}async create(e,t={}){return e.react&&(e.html=await za(e.react)),await this.resend.post("/emails",w0(e),t)}async get(e){return await this.resend.get(`/emails/${e}`)}async list(e={}){let t=Ce(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`)}},ox=class{constructor(e){this.resend=e}async send(e){return await this.resend.post("/events/send",L1(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=Ce(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)}`)}},sx=class{constructor(e){this.resend=e}async list(e={}){let t=Ce(e),r=t?`/logs?${t}`:"/logs";return await this.resend.get(r)}async get(e){return await this.resend.get(`/logs/${e}`)}},ax=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/segments",e,t)}async list(e={}){let t=Ce(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 ux(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 lx(e){return e?.map(t=>({key:t.key,type:t.type,fallback_value:t.fallbackValue}))}function v0(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:lx(e.variables)}}var _0=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)}},cx=class{constructor(e){this.resend=e}create(e){return new _0(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",v0(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${ux(e)}`)}duplicate(e){return new _0(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}`,v0(t))}},dx=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"}}}},mx=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=Ce(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 O0.Webhook(e.webhookSecret).verify(e.payload,{"svix-id":e.headers.id,"svix-timestamp":e.headers.timestamp,"svix-signature":e.headers.signature})}},y0="https://api.resend.com",C0=`resend-node:${J1}`,px=typeof process<"u"&&process.env&&process.env.RESEND_BASE_URL||y0,fx=typeof process<"u"&&process.env&&process.env.RESEND_USER_AGENT||C0,Cr=class{constructor(e){if(this.key=e,this.segments=new ax(this),this.apiKeys=new B1(this),this.audiences=this.segments,this.automations=new G1(this),this.batch=new W1(this),this.broadcasts=new V1(this),this.contactProperties=new K1(this),this.contacts=new Z1(this),this.domains=new ex(this),this.emails=new nx(this),this.events=new ox(this),this.logs=new sx(this),this.templates=new cx(this),this.topics=new dx(this),this.webhooks=new mx(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":fx,"Content-Type":"application/json"})}async fetchRequest(e,t={}){try{let r=await fetch(`${px}${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)}};Ie();var F0=le(Ct(),1);function Q(e,t){return e instanceof Error?e.message:t}function z0(e){return!!(e||!process.stdout.isTTY)}function F(e,t={}){z0(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)}function g(e,t={}){let r=t.exitCode??1;z0(t.json)?console.error(JSON.stringify({error:{message:e.message,code:e.code??"unknown"}},null,2)):console.error(`${F0.default.red("Error:")} ${e.message}`),process.exit(r)}var M0={sending_access:0,full_access:1};function vx(e,t){return M0[e]>=M0[t]}async function oe(e,t){let r=e.profile;try{let i=await ir(e.apiKey,r);if(!i){if(r){let n=je();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";vx(i.permission,n)||g({message:`This command requires a full access API key. Your current key has sending access only.
|
|
184
184
|
${Or}`,code:"insufficient_permissions"},{json:e.json})}return new Cr(i.key)}catch(i){g({message:Q(i,"Failed to create client"),code:"auth_error"},{json:e.json})}}var J0=130;function _x(){process.stderr.isTTY&&process.stderr.write("\r\x1B[2K"),console.error("Cancelled."),process.exit(J0)}var wr;function B0(){wr=_x,process.on("SIGINT",wr),process.on("uncaughtException",e=>{g({message:Q(e,"An unexpected error occurred"),code:"unexpected_error"},{}),process.exit(1)})}function Ua(e){wr&&process.removeListener("SIGINT",wr),wr=e,process.on("SIGINT",wr)}function kr(){return J0}Ie();var Wa=le(Ct(),1);ee();var yx=_t?String.fromCodePoint(10004):"v",Cx=_t?String.fromCodePoint(9888):"!",Ox=_t?String.fromCodePoint(10007):"x",Sx=["\u2839","\u2838","\u2834","\u2826","\u2807","\u280F","\u2819","\u2839"],xx=80,H0=[1,2,4],wx=H0.length;function kx(e){let t=e?.["retry-after"];if(!t)return;let r=Number(t);if(Number.isFinite(r)&&r>=0)return r}function Ax(e){return new Promise(t=>setTimeout(t,e))}async function Be(e,t,r,i){let n=he(e,i.quiet);try{for(let o=0;;o++){let{data:s,error:a,headers:u}=await t();if(a){if(o<wx&&a.name==="rate_limit_exceeded"){let c=kx(u)??H0[o];n.update(`Rate limited, retrying in ${c}s...`),await Ax(c*1e3),n.update(e);continue}n.stop(),g({message:a.message,code:r},{json:i.json})}return s===null&&(n.stop(),g({message:"Unexpected empty response",code:r},{json:i.json})),n.stop(),s}}catch(o){return n.stop(),g({message:Q(o,"Unknown error"),code:r},{json:i.json})}}function he(e,t){if(t||!O())return{update(a){},stop(a){},clear(){},warn(a){},fail(a){}};let r=_t?Sx:["-","\\","|","/"],i=xx,n=0,o=e,s=setInterval(()=>{process.stderr.write(`\r\x1B[2K ${r[n++%r.length]} ${o}`)},i);return{update(a){o=a},stop(a){clearInterval(s),a?process.stderr.write(`\r\x1B[2K ${Wa.default.green(yx)} ${a}
|
|
185
185
|
`):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 ${Wa.default.yellow(Cx)} ${a}
|
|
186
186
|
`)},fail(a){clearInterval(s),process.stderr.write(`\r\x1B[2K ${Wa.default.red(Ox)} ${a}
|
|
@@ -191,7 +191,7 @@ ${Or}`,code:"insufficient_permissions"},{json:e.json})}return new Cr(i.key)}catc
|
|
|
191
191
|
`)}ee();var Pc=_t?String.fromCodePoint(9472):"-";function Ka(e,t){return e.length===0?"(no DNS records)":e.map(i=>{let n=i.name?i.name.includes(".")?i.name:`${i.name}.${t}`:t;return[`${Pc}${Pc} ${i.type} ${Pc.repeat(40)}`,` Name ${n}`,` TTL ${i.ttl}`,` Value ${i.value}`].join(`
|
|
192
192
|
`)}).join(`
|
|
193
193
|
|
|
194
|
-
`)}function V0(e){let t=e.map(r=>[r.name,r.status,r.region,r.id]);return M(["Name","Status","Region","ID"],t,"(no domains)")}function K0(e){switch(e){case"verified":return"\u2713 Verified";case"pending":return"\u23F3 Pending";case"not_started":return"\u25CB Not started";case"failed":case"temporary_failure":return"\u2717 Failed";default:return e}}var mt={resource:"domain",resourcePlural:"domains",fetchItems:(e,{limit:t,after:r})=>e.domains.list({limit:t,...r&&{after:r}}),display:e=>({label:e.name,hint:e.id})};var Y0=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 ce("--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",h({context:`Non-interactive: --name is required (no prompts when stdin/stdout is not a TTY).
|
|
194
|
+
`)}function V0(e){let t=e.map(r=>[r.name,r.status,r.region,r.id]);return M(["Name","Status","Region","ID"],t,"(no domains)")}function K0(e){switch(e){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 e}}var mt={resource:"domain",resourcePlural:"domains",fetchItems:(e,{limit:t,after:r})=>e.domains.list({limit:t,...r&&{after:r}}),display:e=>({label:e.name,hint:e.id})};var Y0=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 ce("--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",h({context:`Non-interactive: --name is required (no prompts when stdin/stdout is not a TTY).
|
|
195
195
|
|
|
196
196
|
Permissions:
|
|
197
197
|
full_access Full API access (default)
|
|
@@ -467,7 +467,7 @@ Run \`resend domains verify ${n.id}\` after configuring DNS.`)}},r)});var A_=new
|
|
|
467
467
|
ID: ${n.id}
|
|
468
468
|
This cannot be undone.`,loading:"Deleting domain...",object:"domain",successMsg:"Domain deleted",sdkCall:o=>o.domains.remove(n.id)},i)});var E_=new p("get").description("Retrieve a domain with its DNS records and current verification status").argument("[id]","Domain ID").addHelpText("after",h({output:` Full domain object including records array and current status.
|
|
469
469
|
|
|
470
|
-
Domain status values: not_started | pending | verified | failed |
|
|
470
|
+
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(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,mt,i);await V({loading:"Fetching domain...",sdkCall:o=>o.domains.get(n),onInteractive:o=>{console.log(`${o.name} \u2014 ${K0(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(`
|
|
471
471
|
DNS Records:`),console.log(Ka(o.records,o.name)))}},i)});var P_=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",h({output:` {"object":"list","data":[...],"has_more":true}
|
|
472
472
|
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(e,t)=>{let r=t.optsWithGlobals(),i=H(e.limit,r),n=N(i,e.after,e.before,r);await $({loading:"Fetching domains...",sdkCall:o=>o.domains.list(n),onInteractive:o=>{console.log(V0(o.data)),L(o,"domains list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var T_=new p("update").description("Update domain settings: TLS mode, tracking, and tracking subdomain").argument("[id]","Domain ID").addOption(new ce("--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",h({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(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,mt,i),{tls:o,openTracking:s,clickTracking:a,trackingSubdomain:u}=t;!o&&s===void 0&&a===void 0&&!u&&g({message:"Provide at least one option to update: --tls, --open-tracking, --click-tracking, or --tracking-subdomain.",code:"no_changes"},{json:i.json});let c={id:n};o&&(c.tls=o),s!==void 0&&(c.openTracking=s),a!==void 0&&(c.clickTracking=a),u&&(c.trackingSubdomain=u),await z({loading:"Updating domain...",sdkCall:l=>l.domains.update(c),errorCode:"update_error",successMsg:`Domain updated: ${n}`},i)});var I_=new p("verify").description("Trigger async DNS verification for a domain").argument("[id]","Domain ID").addHelpText("after",h({context:`Verification is async \u2014 the domain enters "pending" status while DNS records are checked.
|
|
473
473
|
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(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,mt,i);await z({loading:"Verifying domain...",sdkCall:o=>o.domains.verify(n),errorCode:"verify_error",successMsg:`Domain verification started. Check status with resend domains get ${n}.`},i)});var D_=new p("domains").description("Manage verified sending and receiving domains").addHelpText("after",h({context:`Domain lifecycle:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resend-cli",
|
|
3
|
-
"version": "2.2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "The official CLI for Resend",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"esbuild": "0.28.0",
|
|
47
47
|
"esbuild-wasm": "0.28.0",
|
|
48
48
|
"picocolors": "1.1.1",
|
|
49
|
-
"resend": "6.12.
|
|
49
|
+
"resend": "6.12.2"
|
|
50
50
|
},
|
|
51
51
|
"pkg": {
|
|
52
52
|
"scripts": [
|