@sequenzy/cli 0.0.90 → 0.0.91
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/index.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -346,7 +346,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
|
|
|
346
346
|
<%s {...props} />
|
|
347
347
|
React keys must be passed directly to JSX without using spread:
|
|
348
348
|
let props = %s;
|
|
349
|
-
<%s key={someKey} {...props} />`,w0,bA,eA,bA),EA[bA+w0]=!0)}if(bA=null,o!==void 0&&(E(o),bA=""+o),D(y0)&&(E(y0.key),bA=""+y0.key),"key"in y0){o={};for(var px in y0)px!=="key"&&(o[px]=y0[px])}else o=y0;return bA&&I(o,typeof j0==="function"?j0.displayName||j0.name||"Unknown":j0),K(j0,bA,o,B(),zA,a0)}function M(j0){W(j0)?j0._store&&(j0._store.validated=1):typeof j0==="object"&&j0!==null&&j0.$$typeof===UA&&(j0._payload.status==="fulfilled"?W(j0._payload.value)&&j0._payload.value._store&&(j0._payload.value._store.validated=1):j0._store&&(j0._store.validated=1))}function W(j0){return typeof j0==="object"&&j0!==null&&j0.$$typeof===R}var R=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),Q0=Symbol.for("react.profiler"),M0=Symbol.for("react.consumer"),C0=Symbol.for("react.context"),H0=Symbol.for("react.forward_ref"),K0=Symbol.for("react.suspense"),l0=Symbol.for("react.suspense_list"),V0=Symbol.for("react.memo"),UA=Symbol.for("react.lazy"),O0=Symbol.for("react.activity"),XA=Symbol.for("react.client.reference"),nx=pF.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,tA=Object.prototype.hasOwnProperty,HA=Array.isArray,u0=console.createTask?console.createTask:function(){return null};pF={react_stack_bottom_frame:function(j0){return j0()}};var $0,e0={},N0=pF.react_stack_bottom_frame.bind(pF,Q)(),qA=u0(g(Q)),EA={};Mo0.Fragment=u,Mo0.jsxDEV=function(j0,y0,o,w0){var zA=1e4>nx.recentlyCreatedOwnerStacks++;return X(j0,y0,o,w0,zA?Error("react-stack-top-frame"):N0,zA?u0(g(j0)):qA)}})()});var Xm=kx(Ym(),1),{program:TxA,createCommand:hxA,createArgument:bxA,createOption:kxA,CommanderError:ixA,InvalidArgumentError:mxA,InvalidOptionArgumentError:cxA,Command:Zm,Argument:pxA,Option:rxA,Help:_xA}=Xm.default;var Um={name:"@sequenzy/cli",version:"0.0.90",description:"Sequenzy CLI for email marketing from the terminal",type:"module",bin:{sequenzy:"./dist/index.js"},main:"./src/index.tsx",types:"./src/index.tsx",exports:{".":"./src/index.tsx"},scripts:{dev:"bun --watch src/index.tsx",build:"bun build src/index.tsx --outdir dist --target node --minify --define 'process.env.DEV=false'",start:"node dist/index.js","type-check":"tsc --noEmit",test:"bun test","test:watch":"bun test --watch",prepublishOnly:"bun run build"},dependencies:{commander:"^12.1.0",ink:"^5.0.1","ink-spinner":"^5.0.0","ink-text-input":"^6.0.0","ink-select-input":"^6.0.0","ink-table":"^3.1.0",open:"^10.1.0",react:"^18.3.1",conf:"^13.0.0"},devDependencies:{"@emailer/shared":"workspace:*","@types/bun":"latest","@types/node":"^22.0.0","@types/react":"^18.3.0","bun-types":"latest",typescript:"^7.0.2"},files:["dist"],keywords:["sequenzy","email","cli","marketing"],license:"MIT",repository:{type:"git",url:"https://github.com/sequenzy/sequenzy"}};import{isDeepStrictEqual as GX0}from"node:util";import td from"node:process";import tC from"node:fs";import ed from"node:path";import aK from"node:crypto";import WX0 from"node:assert";var cC=(A)=>{let x=typeof A;return A!==null&&(x==="object"||x==="function")};var Sz=new Set(["__proto__","prototype","constructor"]),UC0=new Set("0123456789");function PY(A){let x=[],E="",g="start",B=!1;for(let Q of A)switch(Q){case"\\":{if(g==="index")throw Error("Invalid character in an index");if(g==="indexEnd")throw Error("Invalid character after an index");if(B)E+=Q;g="property",B=!B;break}case".":{if(g==="index")throw Error("Invalid character in an index");if(g==="indexEnd"){g="property";break}if(B){B=!1,E+=Q;break}if(Sz.has(E))return[];x.push(E),E="",g="property";break}case"[":{if(g==="index")throw Error("Invalid character in an index");if(g==="indexEnd"){g="index";break}if(B){B=!1,E+=Q;break}if(g==="property"){if(Sz.has(E))return[];x.push(E),E=""}g="index";break}case"]":{if(g==="index"){x.push(Number.parseInt(E,10)),E="",g="indexEnd";break}if(g==="indexEnd")throw Error("Invalid character after an index")}default:{if(g==="index"&&!UC0.has(Q))throw Error("Invalid character in an index");if(g==="indexEnd")throw Error("Invalid character after an index");if(g==="start")g="property";if(B)B=!1,E+="\\";E+=Q}}if(B)E+="\\";switch(g){case"property":{if(Sz.has(E))return[];x.push(E);break}case"index":throw Error("Index was not closed");case"start":{x.push("");break}}return x}function Lz(A,x){if(typeof x!=="number"&&Array.isArray(A)){let E=Number.parseInt(x,10);return Number.isInteger(E)&&A[E]===A[x]}return!1}function Gm(A,x){if(Lz(A,x))throw Error("Cannot use string index")}function Wm(A,x,E){if(!cC(A)||typeof x!=="string")return E===void 0?A:E;let g=PY(x);if(g.length===0)return E;for(let B=0;B<g.length;B++){let Q=g[B];if(Lz(A,Q))A=B===g.length-1?void 0:null;else A=A[Q];if(A===void 0||A===null){if(B!==g.length-1)return E;break}}return A===void 0?E:A}function Oz(A,x,E){if(!cC(A)||typeof x!=="string")return A;let g=A,B=PY(x);for(let Q=0;Q<B.length;Q++){let D=B[Q];if(Gm(A,D),Q===B.length-1)A[D]=E;else if(!cC(A[D]))A[D]=typeof B[Q+1]==="number"?[]:{};A=A[D]}return g}function Rm(A,x){if(!cC(A)||typeof x!=="string")return!1;let E=PY(x);for(let g=0;g<E.length;g++){let B=E[g];if(Gm(A,B),g===E.length-1)return delete A[B],!0;if(A=A[B],!cC(A))return!1}}function Mm(A,x){if(!cC(A)||typeof x!=="string")return!1;let E=PY(x);if(E.length===0)return!1;for(let g of E){if(!cC(A)||!(g in A)||Lz(A,g))return!1;A=A[g]}return!0}import lB from"node:path";import zm from"node:os";import jz from"node:process";var hQ=zm.homedir(),Pz=zm.tmpdir(),{env:v3}=jz,GC0=(A)=>{let x=lB.join(hQ,"Library");return{data:lB.join(x,"Application Support",A),config:lB.join(x,"Preferences",A),cache:lB.join(x,"Caches",A),log:lB.join(x,"Logs",A),temp:lB.join(Pz,A)}},WC0=(A)=>{let x=v3.APPDATA||lB.join(hQ,"AppData","Roaming"),E=v3.LOCALAPPDATA||lB.join(hQ,"AppData","Local");return{data:lB.join(E,A,"Data"),config:lB.join(x,A,"Config"),cache:lB.join(E,A,"Cache"),log:lB.join(E,A,"Log"),temp:lB.join(Pz,A)}},RC0=(A)=>{let x=lB.basename(hQ);return{data:lB.join(v3.XDG_DATA_HOME||lB.join(hQ,".local","share"),A),config:lB.join(v3.XDG_CONFIG_HOME||lB.join(hQ,".config"),A),cache:lB.join(v3.XDG_CACHE_HOME||lB.join(hQ,".cache"),A),log:lB.join(v3.XDG_STATE_HOME||lB.join(hQ,".local","state"),A),temp:lB.join(Pz,x,A)}};function Nz(A,{suffix:x="nodejs"}={}){if(typeof A!=="string")throw TypeError(`Expected a string, got ${typeof A}`);if(x)A+=`-${x}`;if(jz.platform==="darwin")return GC0(A);if(jz.platform==="win32")return WC0(A);return RC0(A)}import NC0 from"node:path";import q8 from"node:fs";import{promisify as c6}from"node:util";var MC0=(A,x)=>{let{onError:E}=x;return function(...B){return A.apply(void 0,B).catch(E)}},T2=MC0;var zC0=(A,x)=>{let{onError:E}=x;return function(...B){try{return A.apply(void 0,B)}catch(Q){return E(Q)}}},T7=zC0;var Sm=250;var SC0=(A,x)=>{let{isRetriable:E}=x;return function(B){let{timeout:Q}=B,D=B.interval??Sm,I=Date.now()+Q;return function J(...K){return A.apply(void 0,K).catch((X)=>{if(!E(X))throw X;if(Date.now()>=I)throw X;let M=Math.round(D*Math.random());if(M>0)return new Promise((R)=>setTimeout(R,M)).then(()=>J.apply(void 0,K));else return J.apply(void 0,K)})}}},h2=SC0;var LC0=(A,x)=>{let{isRetriable:E}=x;return function(B){let{timeout:Q}=B,D=Date.now()+Q;return function(...J){while(!0)try{return A.apply(void 0,J)}catch(K){if(!E(K))throw K;if(Date.now()>=D)throw K;continue}}}},b2=LC0;import Om from"node:process";var $K={isChangeErrorOk:(A)=>{if(!$K.isNodeError(A))return!1;let{code:x}=A;if(x==="ENOSYS")return!0;if(!Lm&&(x==="EINVAL"||x==="EPERM"))return!0;return!1},isNodeError:(A)=>{return A instanceof Error},isRetriableError:(A)=>{if(!$K.isNodeError(A))return!1;let{code:x}=A;if(x==="EMFILE"||x==="ENFILE"||x==="EAGAIN"||x==="EBUSY"||x==="EACCESS"||x==="EACCES"||x==="EACCS"||x==="EPERM")return!0;return!1},onChangeError:(A)=>{if(!$K.isNodeError(A))throw A;if($K.isChangeErrorOk(A))return;throw A}},Vz=$K;var HK={onError:Vz.onChangeError},T5={onError:()=>{return}},Lm=Om.getuid?!Om.getuid():!1,G6={isRetriable:Vz.isRetriableError};var OC0={attempt:{chmod:T2(c6(q8.chmod),HK),chown:T2(c6(q8.chown),HK),close:T2(c6(q8.close),T5),fsync:T2(c6(q8.fsync),T5),mkdir:T2(c6(q8.mkdir),T5),realpath:T2(c6(q8.realpath),T5),stat:T2(c6(q8.stat),T5),unlink:T2(c6(q8.unlink),T5),chmodSync:T7(q8.chmodSync,HK),chownSync:T7(q8.chownSync,HK),closeSync:T7(q8.closeSync,T5),existsSync:T7(q8.existsSync,T5),fsyncSync:T7(q8.fsync,T5),mkdirSync:T7(q8.mkdirSync,T5),realpathSync:T7(q8.realpathSync,T5),statSync:T7(q8.statSync,T5),unlinkSync:T7(q8.unlinkSync,T5)},retry:{close:h2(c6(q8.close),G6),fsync:h2(c6(q8.fsync),G6),open:h2(c6(q8.open),G6),readFile:h2(c6(q8.readFile),G6),rename:h2(c6(q8.rename),G6),stat:h2(c6(q8.stat),G6),write:h2(c6(q8.write),G6),writeFile:h2(c6(q8.writeFile),G6),closeSync:b2(q8.closeSync,G6),fsyncSync:b2(q8.fsyncSync,G6),openSync:b2(q8.openSync,G6),readFileSync:b2(q8.readFileSync,G6),renameSync:b2(q8.renameSync,G6),statSync:b2(q8.statSync,G6),writeSync:b2(q8.writeSync,G6),writeFileSync:b2(q8.writeFileSync,G6)}},g6=OC0;import pC from"node:process";var jm="utf8",vz=438,Pm=511;var Nm={},Vm=pC.geteuid?pC.geteuid():-1,vm=pC.getegid?pC.getegid():-1;var um=1000,Tm=!!pC.getuid,GEA=pC.getuid?!pC.getuid():!1,uz=128;var hm=(A)=>{return A instanceof Error&&"code"in A};var Tz=(A)=>{return typeof A==="string"},NY=(A)=>{return A===void 0};import PC0 from"node:path";import u3 from"node:process";import bm from"node:process";var km=bm.platform==="linux",VY=bm.platform==="win32";var hz=["SIGHUP","SIGINT","SIGTERM"];if(!VY)hz.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(km)hz.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var im=hz;class mm{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(A)=>{if(this.exited)return;this.exited=!0;for(let x of this.callbacks)x();if(A)if(VY&&(A!=="SIGINT"&&A!=="SIGTERM"&&A!=="SIGKILL"))u3.kill(u3.pid,"SIGTERM");else u3.kill(u3.pid,A)},this.hook=()=>{u3.once("exit",()=>this.exit());for(let A of im)try{u3.once(A,()=>this.exit(A))}catch{}},this.register=(A)=>{return this.callbacks.add(A),()=>{this.callbacks.delete(A)}},this.hook()}}var cm=new mm;var jC0=cm.register,pm=jC0;var y4={store:{},create:(A)=>{let x=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),E=Date.now().toString().slice(-10),g="tmp-",B=`.tmp-${E}${x}`;return`${A}${B}`},get:(A,x,E=!0)=>{let g=y4.truncate(x(A));if(g in y4.store)return y4.get(A,x,E);return y4.store[g]=E,[g,()=>delete y4.store[g]]},purge:(A)=>{if(!y4.store[A])return;delete y4.store[A],g6.attempt.unlink(A)},purgeSync:(A)=>{if(!y4.store[A])return;delete y4.store[A],g6.attempt.unlinkSync(A)},purgeSyncAll:()=>{for(let A in y4.store)y4.purgeSync(A)},truncate:(A)=>{let x=PC0.basename(A);if(x.length<=uz)return A;let E=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(x);if(!E)return A;let g=x.length-uz;return`${A.slice(0,-x.length)}${E[1]}${E[2].slice(0,-g)}${E[3]}`}};pm(y4.purgeSyncAll);var yK=y4;function bz(A,x,E=Nm){if(Tz(E))return bz(A,x,{encoding:E});let B={timeout:E.timeout??um},Q=null,D=null,I=null;try{let J=g6.attempt.realpathSync(A),K=!!J;A=J||A,[D,Q]=yK.get(A,E.tmpCreate||yK.create,E.tmpPurge!==!1);let X=Tm&&NY(E.chown),M=NY(E.mode);if(K&&(X||M)){let W=g6.attempt.statSync(A);if(W){if(E={...E},X)E.chown={uid:W.uid,gid:W.gid};if(M)E.mode=W.mode}}if(!K){let W=NC0.dirname(A);g6.attempt.mkdirSync(W,{mode:Pm,recursive:!0})}if(I=g6.retry.openSync(B)(D,"w",E.mode||vz),E.tmpCreated)E.tmpCreated(D);if(Tz(x))g6.retry.writeSync(B)(I,x,0,E.encoding||jm);else if(!NY(x))g6.retry.writeSync(B)(I,x,0,x.length,0);if(E.fsync!==!1)if(E.fsyncWait!==!1)g6.retry.fsyncSync(B)(I);else g6.attempt.fsync(I);if(g6.retry.closeSync(B)(I),I=null,E.chown&&(E.chown.uid!==Vm||E.chown.gid!==vm))g6.attempt.chownSync(D,E.chown.uid,E.chown.gid);if(E.mode&&E.mode!==vz)g6.attempt.chmodSync(D,E.mode);try{g6.retry.renameSync(B)(D,A)}catch(W){if(!hm(W))throw W;if(W.code!=="ENAMETOOLONG")throw W;g6.retry.renameSync(B)(D,yK.truncate(A))}Q(),D=null}finally{if(I)g6.attempt.closeSync(I);if(D)yK.purge(D)}}var xa=kx(un(),1),Ea=kx(gl(),1);var Hy0=(A,x,E,g)=>{if(E==="length"||E==="prototype")return;if(E==="arguments"||E==="caller")return;let B=Object.getOwnPropertyDescriptor(A,E),Q=Object.getOwnPropertyDescriptor(x,E);if(!yy0(B,Q)&&g)return;Object.defineProperty(A,E,Q)},yy0=function(A,x){return A===void 0||A.configurable||A.writable===x.writable&&A.enumerable===x.enumerable&&A.configurable===x.configurable&&(A.writable||A.value===x.value)},qy0=(A,x)=>{let E=Object.getPrototypeOf(x);if(E===Object.getPrototypeOf(A))return;Object.setPrototypeOf(A,E)},Yy0=(A,x)=>`/* Wrapped ${A}*/
|
|
349
|
+
<%s key={someKey} {...props} />`,w0,bA,eA,bA),EA[bA+w0]=!0)}if(bA=null,o!==void 0&&(E(o),bA=""+o),D(y0)&&(E(y0.key),bA=""+y0.key),"key"in y0){o={};for(var px in y0)px!=="key"&&(o[px]=y0[px])}else o=y0;return bA&&I(o,typeof j0==="function"?j0.displayName||j0.name||"Unknown":j0),K(j0,bA,o,B(),zA,a0)}function M(j0){W(j0)?j0._store&&(j0._store.validated=1):typeof j0==="object"&&j0!==null&&j0.$$typeof===UA&&(j0._payload.status==="fulfilled"?W(j0._payload.value)&&j0._payload.value._store&&(j0._payload.value._store.validated=1):j0._store&&(j0._store.validated=1))}function W(j0){return typeof j0==="object"&&j0!==null&&j0.$$typeof===R}var R=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),Q0=Symbol.for("react.profiler"),M0=Symbol.for("react.consumer"),C0=Symbol.for("react.context"),H0=Symbol.for("react.forward_ref"),K0=Symbol.for("react.suspense"),l0=Symbol.for("react.suspense_list"),V0=Symbol.for("react.memo"),UA=Symbol.for("react.lazy"),O0=Symbol.for("react.activity"),XA=Symbol.for("react.client.reference"),nx=pF.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,tA=Object.prototype.hasOwnProperty,HA=Array.isArray,u0=console.createTask?console.createTask:function(){return null};pF={react_stack_bottom_frame:function(j0){return j0()}};var $0,e0={},N0=pF.react_stack_bottom_frame.bind(pF,Q)(),qA=u0(g(Q)),EA={};Mo0.Fragment=u,Mo0.jsxDEV=function(j0,y0,o,w0){var zA=1e4>nx.recentlyCreatedOwnerStacks++;return X(j0,y0,o,w0,zA?Error("react-stack-top-frame"):N0,zA?u0(g(j0)):qA)}})()});var Xm=kx(Ym(),1),{program:TxA,createCommand:hxA,createArgument:bxA,createOption:kxA,CommanderError:ixA,InvalidArgumentError:mxA,InvalidOptionArgumentError:cxA,Command:Zm,Argument:pxA,Option:rxA,Help:_xA}=Xm.default;var Um={name:"@sequenzy/cli",version:"0.0.91",description:"Sequenzy CLI for email marketing from the terminal",type:"module",bin:{sequenzy:"./dist/index.js"},main:"./src/index.tsx",types:"./src/index.tsx",exports:{".":"./src/index.tsx"},scripts:{dev:"bun --watch src/index.tsx",build:"bun build src/index.tsx --outdir dist --target node --minify --define 'process.env.DEV=false'",start:"node dist/index.js","type-check":"tsc --noEmit",test:"bun test","test:watch":"bun test --watch",prepublishOnly:"bun run build"},dependencies:{commander:"^12.1.0",ink:"^5.0.1","ink-spinner":"^5.0.0","ink-text-input":"^6.0.0","ink-select-input":"^6.0.0","ink-table":"^3.1.0",open:"^10.1.0",react:"^18.3.1",conf:"^13.0.0"},devDependencies:{"@emailer/shared":"workspace:*","@types/bun":"latest","@types/node":"^22.0.0","@types/react":"^18.3.0","bun-types":"latest",typescript:"^7.0.2"},files:["dist"],keywords:["sequenzy","email","cli","marketing"],license:"MIT",repository:{type:"git",url:"https://github.com/sequenzy/sequenzy"}};import{isDeepStrictEqual as GX0}from"node:util";import td from"node:process";import tC from"node:fs";import ed from"node:path";import aK from"node:crypto";import WX0 from"node:assert";var cC=(A)=>{let x=typeof A;return A!==null&&(x==="object"||x==="function")};var Sz=new Set(["__proto__","prototype","constructor"]),UC0=new Set("0123456789");function PY(A){let x=[],E="",g="start",B=!1;for(let Q of A)switch(Q){case"\\":{if(g==="index")throw Error("Invalid character in an index");if(g==="indexEnd")throw Error("Invalid character after an index");if(B)E+=Q;g="property",B=!B;break}case".":{if(g==="index")throw Error("Invalid character in an index");if(g==="indexEnd"){g="property";break}if(B){B=!1,E+=Q;break}if(Sz.has(E))return[];x.push(E),E="",g="property";break}case"[":{if(g==="index")throw Error("Invalid character in an index");if(g==="indexEnd"){g="index";break}if(B){B=!1,E+=Q;break}if(g==="property"){if(Sz.has(E))return[];x.push(E),E=""}g="index";break}case"]":{if(g==="index"){x.push(Number.parseInt(E,10)),E="",g="indexEnd";break}if(g==="indexEnd")throw Error("Invalid character after an index")}default:{if(g==="index"&&!UC0.has(Q))throw Error("Invalid character in an index");if(g==="indexEnd")throw Error("Invalid character after an index");if(g==="start")g="property";if(B)B=!1,E+="\\";E+=Q}}if(B)E+="\\";switch(g){case"property":{if(Sz.has(E))return[];x.push(E);break}case"index":throw Error("Index was not closed");case"start":{x.push("");break}}return x}function Lz(A,x){if(typeof x!=="number"&&Array.isArray(A)){let E=Number.parseInt(x,10);return Number.isInteger(E)&&A[E]===A[x]}return!1}function Gm(A,x){if(Lz(A,x))throw Error("Cannot use string index")}function Wm(A,x,E){if(!cC(A)||typeof x!=="string")return E===void 0?A:E;let g=PY(x);if(g.length===0)return E;for(let B=0;B<g.length;B++){let Q=g[B];if(Lz(A,Q))A=B===g.length-1?void 0:null;else A=A[Q];if(A===void 0||A===null){if(B!==g.length-1)return E;break}}return A===void 0?E:A}function Oz(A,x,E){if(!cC(A)||typeof x!=="string")return A;let g=A,B=PY(x);for(let Q=0;Q<B.length;Q++){let D=B[Q];if(Gm(A,D),Q===B.length-1)A[D]=E;else if(!cC(A[D]))A[D]=typeof B[Q+1]==="number"?[]:{};A=A[D]}return g}function Rm(A,x){if(!cC(A)||typeof x!=="string")return!1;let E=PY(x);for(let g=0;g<E.length;g++){let B=E[g];if(Gm(A,B),g===E.length-1)return delete A[B],!0;if(A=A[B],!cC(A))return!1}}function Mm(A,x){if(!cC(A)||typeof x!=="string")return!1;let E=PY(x);if(E.length===0)return!1;for(let g of E){if(!cC(A)||!(g in A)||Lz(A,g))return!1;A=A[g]}return!0}import lB from"node:path";import zm from"node:os";import jz from"node:process";var hQ=zm.homedir(),Pz=zm.tmpdir(),{env:v3}=jz,GC0=(A)=>{let x=lB.join(hQ,"Library");return{data:lB.join(x,"Application Support",A),config:lB.join(x,"Preferences",A),cache:lB.join(x,"Caches",A),log:lB.join(x,"Logs",A),temp:lB.join(Pz,A)}},WC0=(A)=>{let x=v3.APPDATA||lB.join(hQ,"AppData","Roaming"),E=v3.LOCALAPPDATA||lB.join(hQ,"AppData","Local");return{data:lB.join(E,A,"Data"),config:lB.join(x,A,"Config"),cache:lB.join(E,A,"Cache"),log:lB.join(E,A,"Log"),temp:lB.join(Pz,A)}},RC0=(A)=>{let x=lB.basename(hQ);return{data:lB.join(v3.XDG_DATA_HOME||lB.join(hQ,".local","share"),A),config:lB.join(v3.XDG_CONFIG_HOME||lB.join(hQ,".config"),A),cache:lB.join(v3.XDG_CACHE_HOME||lB.join(hQ,".cache"),A),log:lB.join(v3.XDG_STATE_HOME||lB.join(hQ,".local","state"),A),temp:lB.join(Pz,x,A)}};function Nz(A,{suffix:x="nodejs"}={}){if(typeof A!=="string")throw TypeError(`Expected a string, got ${typeof A}`);if(x)A+=`-${x}`;if(jz.platform==="darwin")return GC0(A);if(jz.platform==="win32")return WC0(A);return RC0(A)}import NC0 from"node:path";import q8 from"node:fs";import{promisify as c6}from"node:util";var MC0=(A,x)=>{let{onError:E}=x;return function(...B){return A.apply(void 0,B).catch(E)}},T2=MC0;var zC0=(A,x)=>{let{onError:E}=x;return function(...B){try{return A.apply(void 0,B)}catch(Q){return E(Q)}}},T7=zC0;var Sm=250;var SC0=(A,x)=>{let{isRetriable:E}=x;return function(B){let{timeout:Q}=B,D=B.interval??Sm,I=Date.now()+Q;return function J(...K){return A.apply(void 0,K).catch((X)=>{if(!E(X))throw X;if(Date.now()>=I)throw X;let M=Math.round(D*Math.random());if(M>0)return new Promise((R)=>setTimeout(R,M)).then(()=>J.apply(void 0,K));else return J.apply(void 0,K)})}}},h2=SC0;var LC0=(A,x)=>{let{isRetriable:E}=x;return function(B){let{timeout:Q}=B,D=Date.now()+Q;return function(...J){while(!0)try{return A.apply(void 0,J)}catch(K){if(!E(K))throw K;if(Date.now()>=D)throw K;continue}}}},b2=LC0;import Om from"node:process";var $K={isChangeErrorOk:(A)=>{if(!$K.isNodeError(A))return!1;let{code:x}=A;if(x==="ENOSYS")return!0;if(!Lm&&(x==="EINVAL"||x==="EPERM"))return!0;return!1},isNodeError:(A)=>{return A instanceof Error},isRetriableError:(A)=>{if(!$K.isNodeError(A))return!1;let{code:x}=A;if(x==="EMFILE"||x==="ENFILE"||x==="EAGAIN"||x==="EBUSY"||x==="EACCESS"||x==="EACCES"||x==="EACCS"||x==="EPERM")return!0;return!1},onChangeError:(A)=>{if(!$K.isNodeError(A))throw A;if($K.isChangeErrorOk(A))return;throw A}},Vz=$K;var HK={onError:Vz.onChangeError},T5={onError:()=>{return}},Lm=Om.getuid?!Om.getuid():!1,G6={isRetriable:Vz.isRetriableError};var OC0={attempt:{chmod:T2(c6(q8.chmod),HK),chown:T2(c6(q8.chown),HK),close:T2(c6(q8.close),T5),fsync:T2(c6(q8.fsync),T5),mkdir:T2(c6(q8.mkdir),T5),realpath:T2(c6(q8.realpath),T5),stat:T2(c6(q8.stat),T5),unlink:T2(c6(q8.unlink),T5),chmodSync:T7(q8.chmodSync,HK),chownSync:T7(q8.chownSync,HK),closeSync:T7(q8.closeSync,T5),existsSync:T7(q8.existsSync,T5),fsyncSync:T7(q8.fsync,T5),mkdirSync:T7(q8.mkdirSync,T5),realpathSync:T7(q8.realpathSync,T5),statSync:T7(q8.statSync,T5),unlinkSync:T7(q8.unlinkSync,T5)},retry:{close:h2(c6(q8.close),G6),fsync:h2(c6(q8.fsync),G6),open:h2(c6(q8.open),G6),readFile:h2(c6(q8.readFile),G6),rename:h2(c6(q8.rename),G6),stat:h2(c6(q8.stat),G6),write:h2(c6(q8.write),G6),writeFile:h2(c6(q8.writeFile),G6),closeSync:b2(q8.closeSync,G6),fsyncSync:b2(q8.fsyncSync,G6),openSync:b2(q8.openSync,G6),readFileSync:b2(q8.readFileSync,G6),renameSync:b2(q8.renameSync,G6),statSync:b2(q8.statSync,G6),writeSync:b2(q8.writeSync,G6),writeFileSync:b2(q8.writeFileSync,G6)}},g6=OC0;import pC from"node:process";var jm="utf8",vz=438,Pm=511;var Nm={},Vm=pC.geteuid?pC.geteuid():-1,vm=pC.getegid?pC.getegid():-1;var um=1000,Tm=!!pC.getuid,GEA=pC.getuid?!pC.getuid():!1,uz=128;var hm=(A)=>{return A instanceof Error&&"code"in A};var Tz=(A)=>{return typeof A==="string"},NY=(A)=>{return A===void 0};import PC0 from"node:path";import u3 from"node:process";import bm from"node:process";var km=bm.platform==="linux",VY=bm.platform==="win32";var hz=["SIGHUP","SIGINT","SIGTERM"];if(!VY)hz.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(km)hz.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var im=hz;class mm{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(A)=>{if(this.exited)return;this.exited=!0;for(let x of this.callbacks)x();if(A)if(VY&&(A!=="SIGINT"&&A!=="SIGTERM"&&A!=="SIGKILL"))u3.kill(u3.pid,"SIGTERM");else u3.kill(u3.pid,A)},this.hook=()=>{u3.once("exit",()=>this.exit());for(let A of im)try{u3.once(A,()=>this.exit(A))}catch{}},this.register=(A)=>{return this.callbacks.add(A),()=>{this.callbacks.delete(A)}},this.hook()}}var cm=new mm;var jC0=cm.register,pm=jC0;var y4={store:{},create:(A)=>{let x=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),E=Date.now().toString().slice(-10),g="tmp-",B=`.tmp-${E}${x}`;return`${A}${B}`},get:(A,x,E=!0)=>{let g=y4.truncate(x(A));if(g in y4.store)return y4.get(A,x,E);return y4.store[g]=E,[g,()=>delete y4.store[g]]},purge:(A)=>{if(!y4.store[A])return;delete y4.store[A],g6.attempt.unlink(A)},purgeSync:(A)=>{if(!y4.store[A])return;delete y4.store[A],g6.attempt.unlinkSync(A)},purgeSyncAll:()=>{for(let A in y4.store)y4.purgeSync(A)},truncate:(A)=>{let x=PC0.basename(A);if(x.length<=uz)return A;let E=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(x);if(!E)return A;let g=x.length-uz;return`${A.slice(0,-x.length)}${E[1]}${E[2].slice(0,-g)}${E[3]}`}};pm(y4.purgeSyncAll);var yK=y4;function bz(A,x,E=Nm){if(Tz(E))return bz(A,x,{encoding:E});let B={timeout:E.timeout??um},Q=null,D=null,I=null;try{let J=g6.attempt.realpathSync(A),K=!!J;A=J||A,[D,Q]=yK.get(A,E.tmpCreate||yK.create,E.tmpPurge!==!1);let X=Tm&&NY(E.chown),M=NY(E.mode);if(K&&(X||M)){let W=g6.attempt.statSync(A);if(W){if(E={...E},X)E.chown={uid:W.uid,gid:W.gid};if(M)E.mode=W.mode}}if(!K){let W=NC0.dirname(A);g6.attempt.mkdirSync(W,{mode:Pm,recursive:!0})}if(I=g6.retry.openSync(B)(D,"w",E.mode||vz),E.tmpCreated)E.tmpCreated(D);if(Tz(x))g6.retry.writeSync(B)(I,x,0,E.encoding||jm);else if(!NY(x))g6.retry.writeSync(B)(I,x,0,x.length,0);if(E.fsync!==!1)if(E.fsyncWait!==!1)g6.retry.fsyncSync(B)(I);else g6.attempt.fsync(I);if(g6.retry.closeSync(B)(I),I=null,E.chown&&(E.chown.uid!==Vm||E.chown.gid!==vm))g6.attempt.chownSync(D,E.chown.uid,E.chown.gid);if(E.mode&&E.mode!==vz)g6.attempt.chmodSync(D,E.mode);try{g6.retry.renameSync(B)(D,A)}catch(W){if(!hm(W))throw W;if(W.code!=="ENAMETOOLONG")throw W;g6.retry.renameSync(B)(D,yK.truncate(A))}Q(),D=null}finally{if(I)g6.attempt.closeSync(I);if(D)yK.purge(D)}}var xa=kx(un(),1),Ea=kx(gl(),1);var Hy0=(A,x,E,g)=>{if(E==="length"||E==="prototype")return;if(E==="arguments"||E==="caller")return;let B=Object.getOwnPropertyDescriptor(A,E),Q=Object.getOwnPropertyDescriptor(x,E);if(!yy0(B,Q)&&g)return;Object.defineProperty(A,E,Q)},yy0=function(A,x){return A===void 0||A.configurable||A.writable===x.writable&&A.enumerable===x.enumerable&&A.configurable===x.configurable&&(A.writable||A.value===x.value)},qy0=(A,x)=>{let E=Object.getPrototypeOf(x);if(E===Object.getPrototypeOf(A))return;Object.setPrototypeOf(A,E)},Yy0=(A,x)=>`/* Wrapped ${A}*/
|
|
350
350
|
${x}`,Xy0=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Zy0=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Uy0=(A,x,E)=>{let g=E===""?"":`with ${E.trim()}() `,B=Yy0.bind(null,g,x.toString());Object.defineProperty(B,"name",Zy0);let{writable:Q,enumerable:D,configurable:I}=Xy0;Object.defineProperty(A,"toString",{value:B,writable:Q,enumerable:D,configurable:I})};function eS(A,x,{ignoreNonConfigurable:E=!1}={}){let{name:g}=A;for(let B of Reflect.ownKeys(x))Hy0(A,x,B,E);return qy0(A,x),Uy0(A,x,g),A}var Gy0=(A,x={})=>{if(typeof A!=="function")throw TypeError(`Expected the first argument to be a function, got \`${typeof A}\``);let{wait:E=0,maxWait:g=Number.POSITIVE_INFINITY,before:B=!1,after:Q=!0}=x;if(E<0||g<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!B&&!Q)throw Error("Both `before` and `after` are false, function wouldn't be called.");let D,I,J,K=function(...X){let M=this,W=()=>{if(D=void 0,I)clearTimeout(I),I=void 0;if(Q)J=A.apply(M,X)},R=()=>{if(I=void 0,D)clearTimeout(D),D=void 0;if(Q)J=A.apply(M,X)},O=B&&!D;if(clearTimeout(D),D=setTimeout(W,E),g>0&&g!==Number.POSITIVE_INFINITY&&!I)I=setTimeout(R,g);if(O)J=A.apply(M,X);return J};return eS(K,A),K.cancel=()=>{if(D)clearTimeout(D),D=void 0;if(I)clearTimeout(I),I=void 0},K},AL=Gy0;var eC=kx(dd(),1);var HX0=Object.prototype.toString;function sd(A,x,E){if(!A)return!1;if(A.constructor===x)return!0;return HX0.call(A)===E}function od(A){return sd(A,Uint8Array,"[object Uint8Array]")}function yX0(A){return sd(A,ArrayBuffer,"[object ArrayBuffer]")}function qX0(A){return od(A)||yX0(A)}function YX0(A){if(!od(A))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof A}\``)}function XX0(A){if(!qX0(A))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof A}\``)}function yL(A,x){if(A.length===0)return new Uint8Array(0);x??=A.reduce((B,Q)=>B+Q.length,0);let E=new Uint8Array(x),g=0;for(let B of A)YX0(B),E.set(B,g),g+=B.length;return E}var ad={utf8:new globalThis.TextDecoder("utf8")};function qL(A,x="utf8"){return XX0(A),ad[x]??=new globalThis.TextDecoder(x),ad[x].decode(A)}function ZX0(A){if(typeof A!=="string")throw TypeError(`Expected \`string\`, got \`${typeof A}\``)}var UX0=new globalThis.TextEncoder;function PX(A){return ZX0(A),UX0.encode(A)}var I6A=Array.from({length:256},(A,x)=>x.toString(16).padStart(2,"0"));var RX0=Ea.default.default,Aa="aes-256-cbc",o3=()=>Object.create(null),MX0=(A)=>A!==void 0&&A!==null,zX0=(A,x)=>{let E=new Set(["undefined","symbol","function"]),g=typeof x;if(E.has(g))throw TypeError(`Setting a value of type \`${g}\` for key \`${A}\` is not allowed as it's not supported by JSON`)},NX="__internal__",YL=`${NX}.migrations.version`;class VX{path;events;#B;#x;#A;#E={};constructor(A={}){let x={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...A};if(!x.cwd){if(!x.projectName)throw Error("Please specify the `projectName` option.");x.cwd=Nz(x.projectName,{suffix:x.projectSuffix}).config}if(this.#A=x,x.schema??x.ajvOptions??x.rootSchema){if(x.schema&&typeof x.schema!=="object")throw TypeError("The `schema` option must be an object.");let Q=new xa.Ajv2020({allErrors:!0,useDefaults:!0,...x.ajvOptions});RX0(Q);let D={...x.rootSchema,type:"object",properties:x.schema};this.#B=Q.compile(D);for(let[I,J]of Object.entries(x.schema??{}))if(J?.default)this.#E[I]=J.default}if(x.defaults)this.#E={...this.#E,...x.defaults};if(x.serialize)this._serialize=x.serialize;if(x.deserialize)this._deserialize=x.deserialize;this.events=new EventTarget,this.#x=x.encryptionKey;let E=x.fileExtension?`.${x.fileExtension}`:"";this.path=ed.resolve(x.cwd,`${x.configName??"config"}${E}`);let g=this.store,B=Object.assign(o3(),x.defaults,g);if(x.migrations){if(!x.projectVersion)throw Error("Please specify the `projectVersion` option.");this._migrate(x.migrations,x.projectVersion,x.beforeEachMigration)}this._validate(B);try{WX0.deepEqual(g,B)}catch{this.store=B}if(x.watch)this._watch()}get(A,x){if(this.#A.accessPropertiesByDotNotation)return this._get(A,x);let{store:E}=this;return A in E?E[A]:x}set(A,x){if(typeof A!=="string"&&typeof A!=="object")throw TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof A}`);if(typeof A!=="object"&&x===void 0)throw TypeError("Use `delete()` to clear values");if(this._containsReservedKey(A))throw TypeError(`Please don't use the ${NX} key, as it's used to manage this module internal operations.`);let{store:E}=this,g=(B,Q)=>{if(zX0(B,Q),this.#A.accessPropertiesByDotNotation)Oz(E,B,Q);else E[B]=Q};if(typeof A==="object"){let B=A;for(let[Q,D]of Object.entries(B))g(Q,D)}else g(A,x);this.store=E}has(A){if(this.#A.accessPropertiesByDotNotation)return Mm(this.store,A);return A in this.store}reset(...A){for(let x of A)if(MX0(this.#E[x]))this.set(x,this.#E[x])}delete(A){let{store:x}=this;if(this.#A.accessPropertiesByDotNotation)Rm(x,A);else delete x[A];this.store=x}clear(){this.store=o3();for(let A of Object.keys(this.#E))this.reset(A)}onDidChange(A,x){if(typeof A!=="string")throw TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof A}`);if(typeof x!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof x}`);return this._handleChange(()=>this.get(A),x)}onDidAnyChange(A){if(typeof A!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof A}`);return this._handleChange(()=>this.store,A)}get size(){return Object.keys(this.store).length}get store(){try{let A=tC.readFileSync(this.path,this.#x?null:"utf8"),x=this._encryptData(A),E=this._deserialize(x);return this._validate(E),Object.assign(o3(),E)}catch(A){if(A?.code==="ENOENT")return this._ensureDirectory(),o3();if(this.#A.clearInvalidConfig&&A.name==="SyntaxError")return o3();throw A}}set store(A){this._ensureDirectory(),this._validate(A),this._write(A),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[A,x]of Object.entries(this.store))yield[A,x]}_encryptData(A){if(!this.#x)return typeof A==="string"?A:qL(A);try{let x=A.slice(0,16),E=aK.pbkdf2Sync(this.#x,x.toString(),1e4,32,"sha512"),g=aK.createDecipheriv(Aa,E,x),B=A.slice(17),Q=typeof B==="string"?PX(B):B;return qL(yL([g.update(Q),g.final()]))}catch{}return A.toString()}_handleChange(A,x){let E=A(),g=()=>{let B=E,Q=A();if(GX0(Q,B))return;E=Q,x.call(this,Q,B)};return this.events.addEventListener("change",g),()=>{this.events.removeEventListener("change",g)}}_deserialize=(A)=>JSON.parse(A);_serialize=(A)=>JSON.stringify(A,void 0,"\t");_validate(A){if(!this.#B)return;if(this.#B(A)||!this.#B.errors)return;let E=this.#B.errors.map(({instancePath:g,message:B=""})=>`\`${g.slice(1)}\` ${B}`);throw Error("Config schema violation: "+E.join("; "))}_ensureDirectory(){tC.mkdirSync(ed.dirname(this.path),{recursive:!0})}_write(A){let x=this._serialize(A);if(this.#x){let E=aK.randomBytes(16),g=aK.pbkdf2Sync(this.#x,E.toString(),1e4,32,"sha512"),B=aK.createCipheriv(Aa,g,E);x=yL([E,PX(":"),B.update(PX(x)),B.final()])}if(td.env.SNAP)tC.writeFileSync(this.path,x,{mode:this.#A.configFileMode});else try{bz(this.path,x,{mode:this.#A.configFileMode})}catch(E){if(E?.code==="EXDEV"){tC.writeFileSync(this.path,x,{mode:this.#A.configFileMode});return}throw E}}_watch(){if(this._ensureDirectory(),!tC.existsSync(this.path))this._write(o3());if(td.platform==="win32")tC.watch(this.path,{persistent:!1},AL(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else tC.watchFile(this.path,{persistent:!1},AL(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(A,x,E){let g=this._get(YL,"0.0.0"),B=Object.keys(A).filter((D)=>this._shouldPerformMigration(D,g,x)),Q={...this.store};for(let D of B)try{if(E)E(this,{fromVersion:g,toVersion:D,finalVersion:x,versions:B});let I=A[D];I?.(this),this._set(YL,D),g=D,Q={...this.store}}catch(I){throw this.store=Q,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${I}`)}if(this._isVersionInRangeFormat(g)||!eC.default.eq(g,x))this._set(YL,x)}_containsReservedKey(A){if(typeof A==="object"){if(Object.keys(A)[0]===NX)return!0}if(typeof A!=="string")return!1;if(this.#A.accessPropertiesByDotNotation){if(A.startsWith(`${NX}.`))return!0;return!1}return!1}_isVersionInRangeFormat(A){return eC.default.clean(A)===null}_shouldPerformMigration(A,x,E){if(this._isVersionInRangeFormat(A)){if(x!=="0.0.0"&&eC.default.satisfies(x,A))return!1;return eC.default.satisfies(E,A)}if(eC.default.lte(A,x))return!1;if(eC.default.gt(A,E))return!1;return!0}_get(A,x){return Wm(this.store,A,x)}_set(A,x){let{store:E}=this;Oz(E,A,x),this.store=E}}var XL="com.sequenzy.cli",ZL="api-key",UL=typeof globalThis.Bun<"u",nQ=new VX({projectName:"sequenzy",schema:{userId:{type:"string"},userEmail:{type:"string"},_apiKey:{type:"string"}}});async function GL(){let A=process.env.SEQUENZY_API_KEY;if(A)return A;if(UL)try{let x=await globalThis.Bun.secrets.get({service:XL,name:ZL});if(x)return x}catch{}return nQ.get("_apiKey")}async function Ba(A){if(UL)try{await globalThis.Bun.secrets.set({service:XL,name:ZL,value:A,allowUnrestrictedAccess:!1});return}catch{}nQ.set("_apiKey",A)}async function ga(){if(UL)try{await globalThis.Bun.secrets.delete({service:XL,name:ZL})}catch{}nQ.delete("_apiKey")}async function Cx(){return!!await GL()}function vX(){return{userId:nQ.get("userId"),userEmail:nQ.get("userEmail")}}function Qa(A){if(A.userId!==void 0)nQ.set("userId",A.userId);if(A.userEmail!==void 0)nQ.set("userEmail",A.userEmail)}function Da(){nQ.clear()}var SX0=process.env.SEQUENZY_API_URL??"https://api.sequenzy.com";class l extends Error{statusCode;rawDetails;code;constructor(A,x,E,g){super(A);this.statusCode=x;this.rawDetails=E;this.code=g;this.name="ApiError"}}function LX0(A){if(!A.trim())return{message:"Request failed"};try{let x=JSON.parse(A);if(typeof x==="string")return{message:x};if(typeof x.error==="string")return{message:x.error,code:x.code};if(x.error&&typeof x.error==="object")return{message:x.error.message??x.message??A,code:x.error.code??x.code};return{message:x.message??A,code:x.code}}catch{return{message:A}}}async function Y0(A,x,E,g){let B=await GL();if(!B)throw new l("Not logged in. Run `sequenzy login` first.",401);let Q={"Content-Type":"application/json",Authorization:`Bearer ${B}`};if(g)Q["x-company-id"]=g;let D;try{D=await fetch(`${SX0}${x}`,{method:A,headers:Q,body:E?JSON.stringify(E):void 0})}catch(I){throw new l(I instanceof Error?I.message:"Failed to reach Sequenzy API",0,void 0,"NETWORK_ERROR")}if(!D.ok){let I=await D.text(),J=LX0(I);throw new l(J.message,D.status,I,J.code)}return D.json()}var Fa="https://docs.sequenzy.com",Cg=`${Fa}/concepts/cli`,Ca=`${Fa}/authentication`,OX0="https://sequenzy.com/dashboard";function jX0(A){if(A instanceof l)return{message:A.message,statusCode:A.statusCode,code:A.code,rawDetails:A.rawDetails};if(A instanceof Error)return{message:A.message};return{message:String(A)}}function PX0(A){let x=A.match(/api key is missing required scopes?:\s*(.+)$/i);if(!x?.[1])return[];return x[1].match(/[a-z_]+:[a-z_]+/gi)??[]}function NX0(A){let x=jX0(A),E=x.message.trim()||"Unknown error",g=E.toLowerCase(),B=x.rawDetails?.trim()||E;if(x.code==="CLI_AUTH_REQUIRED"||g.includes("not logged in"))return{title:"Authentication required",description:"This command needs a Sequenzy API key, but the CLI could not find one in your local login state or environment.",howToFix:"Run `sequenzy login` and approve the session, or set `SEQUENZY_API_KEY` for non-interactive environments.",docsUrl:Cg,details:B};if(g.includes("already logged in"))return{title:"CLI already authenticated",description:"The CLI already has a saved Sequenzy login for this machine.",howToFix:"Run `sequenzy logout` first if you want to switch accounts, then run `sequenzy login` again.",docsUrl:Cg,details:B};if(x.statusCode===401||x.code==="UNAUTHORIZED")return{title:"Authentication failed",description:"The request reached Sequenzy, but the current API key was rejected.",howToFix:"Run `sequenzy login` again, or replace the key with a valid personal API key that still has access to your account.",docsUrl:Ca,details:B};let Q=PX0(E);if(Q.length>0){let D=Q.map((J)=>`\`${J}\``).join(", "),I=Q.every((J)=>J.endsWith(":read"))?"the Read-only or Safer agent access preset":"Safer agent access when it covers the task, or Custom permissions";return{title:"API key permission required",description:`The current API key is valid, but this operation requires the missing ${Q.length===1?"scope":"scopes"}: ${D}.`,howToFix:`Run \`sequenzy account\` to inspect the active key and open its API Keys settings URL. If that command also requires \`account:read\`, open ${OX0} directly and go to Settings → API Keys. Create a replacement key with ${I} including ${D}, then replace \`SEQUENZY_API_KEY\` or log in again. Existing key permissions cannot be edited in place.`,docsUrl:Cg,details:B}}if(x.statusCode===403||g.includes("access denied"))return{title:"Access denied",description:"The current API key is valid, but it does not have permission to perform this action or access the requested company.",howToFix:"Use an API key with access to the target company, or switch to a company you can access before retrying.",docsUrl:Ca,details:B};if(x.statusCode===404||g.includes("not found"))return{title:"Requested resource not found",description:"Sequenzy could not find the company, template, campaign, sequence, or subscriber you asked for.",howToFix:"Double-check the ID or email value and list the resource first before retrying the command.",docsUrl:Cg,details:B};if(x.statusCode===429||g.includes("rate limit"))return{title:"Rate limited",description:"Sequenzy temporarily slowed this request because too many requests were sent in a short period.",howToFix:"Wait a moment and retry. If an agent is looping, reduce the retry frequency before calling the CLI again.",docsUrl:Cg,details:B};if(g.includes("--subject")||g.includes("--template")||g.includes("is required"))return{title:"Invalid command input",description:"The CLI command arguments are incomplete or incompatible for this action.",howToFix:"Review the flags you passed, add the missing values, and run the command again.",docsUrl:Cg,details:B};if(x.code==="NETWORK_ERROR"||g.includes("fetch failed")||g.includes("failed to initiate login"))return{title:"Network or configuration error",description:"The CLI could not reach the Sequenzy API or app URL from this environment.",howToFix:"Check your network connection and verify `SEQUENZY_API_URL` or `SEQUENZY_APP_URL` if you override them locally.",docsUrl:Cg,details:B};if(x.statusCode&&x.statusCode>=500)return{title:"Sequenzy server error",description:"The request reached Sequenzy, but the server could not complete it successfully.",howToFix:"Retry once. If the error persists, keep the details below and check the docs before escalating.",docsUrl:Cg,details:B};return{title:"Command failed",description:"The CLI could not complete the requested operation.",howToFix:"Review the details below, adjust the command or credentials, and retry.",docsUrl:Cg,details:B}}function Kx(){return new l("Not logged in. Run `sequenzy login` first.",401,void 0,"CLI_AUTH_REQUIRED")}function sK(A){let x=NX0(A);return[`Sequenzy CLI error: ${x.title}`,`Description: ${x.description}`,`How to fix: ${x.howToFix}`,`Docs: ${x.docsUrl}`,`Details: ${x.details}`].join(`
|
|
351
351
|
`)}function YA(A){console.error(sK(A))}import{readFileSync as VX0}from"node:fs";import{createInterface as vX0}from"node:readline/promises";function L0(A){console.log(JSON.stringify(A,null,2))}function dA(A){if(!A)return"None";let x=A instanceof Date?A:new Date(A);if(Number.isNaN(x.getTime()))return String(A);return x.toISOString()}function q4(A,x,E){if(A&&x)throw new l(`Provide either --${E} or --${E}-file, not both`,400);if(!x)return A;try{return VX0(x,"utf8")}catch(g){throw new l(`Failed to read ${E} file '${x}': ${g instanceof Error?g.message:"Unknown error"}`,400)}}function gE(A,x,E){let g=q4(A,x,E);if(!g)return;try{return JSON.parse(g)}catch(B){throw new l(`Invalid ${E} JSON: ${B instanceof Error?B.message:"Unknown error"}`,400)}}function lQ(A){let x=q4(A.html,A.htmlFile,"html"),E=gE(A.blocksJson,A.blocksFile,"blocks");if(x!==void 0&&E!==void 0)throw new l("Provide either --html/--html-file or --blocks-json/--blocks-file, not both",400);if(E!==void 0&&!Array.isArray(E))throw new l("blocks JSON must be an array",400);if(A.required&&x===void 0&&E===void 0)throw new l(A.requiredMessage??"Provide either --html/--html-file or --blocks-json/--blocks-file",400);return{...x!==void 0&&{html:x},...E!==void 0&&{blocks:E}}}function M8(A,x){if(A===void 0)return;let E=A.trim();if(!/^[+-]?\d+$/.test(E))throw new l(`${x} must be an integer`,400);let g=Number(E);if(!Number.isInteger(g))throw new l(`${x} must be an integer`,400);return g}async function l9(A,x){if(x.yes===!0)return!0;if(!process.stdin.isTTY)throw new l(`${A} Confirmation is required: re-run with --yes when stdin is not interactive`,400);let E=vX0({input:process.stdin,output:process.stdout});try{let g=(await E.question(`${A} [y/N] `)).trim().toLowerCase();return g==="y"||g==="yes"}finally{E.close()}}function dQ(A,x){if(!A||A.trim()==="")throw new l(`${x} is required`,400);return A}var uX0=new Set(["open_rate","click_rate"]);function TX0(A,x){if(typeof A!=="object"||A===null)throw new l(`${x} must be an object with a subject field`,400);let E=A;if(typeof E.subject!=="string"||E.subject.trim()==="")throw new l(`${x}.subject must be a non-empty string`,400);if(E.previewText!==void 0&&typeof E.previewText!=="string")throw new l(`${x}.previewText must be a string`,400);if(E.blocks!==void 0&&!Array.isArray(E.blocks))throw new l(`${x}.blocks must be an array`,400);return{subject:E.subject,...E.previewText!==void 0&&{previewText:E.previewText},...Array.isArray(E.blocks)&&{blocks:E.blocks}}}function hX0(A){if(Boolean(A.campaignId)===Boolean(A.automationNodeId))throw new l("Provide exactly one campaign ID or --automation-node",400);let x=M8(A.testPercentage,"--test-percentage");if(x!==void 0&&(x<5||x>50))throw new l("--test-percentage must be an integer between 5 and 50",400);if(A.testType!==void 0&&A.testType!=="subject"&&A.testType!=="content")throw new l("--test-type must be subject or content",400);let E=M8(A.winnerThreshold,"--winner-threshold");if(E!==void 0&&(E<10||E>1000))throw new l("--winner-threshold must be an integer between 10 and 1000",400);let g=M8(A.durationMinutes,"--duration-minutes");if(g!==void 0&&(g<15||g>1440))throw new l("--duration-minutes must be an integer between 15 and 1440",400);if(A.winnerCriteria!==void 0&&!uX0.has(A.winnerCriteria))throw new l("--winner-criteria must be open_rate or click_rate",400);let B=gE(A.variantsJson,A.variantsFile,"variants"),Q;if(B!==void 0){if(!Array.isArray(B))throw new l("variants JSON must be an array",400);Q=B.map((D,I)=>TX0(D,`variants[${I}]`))}if(A.automationNodeId&&(Q?.length??0)===0)throw new l("Sequence A/B tests need at least one variant in addition to control variant A; provide --variants-json or --variants-file",400);return{...A.campaignId!==void 0&&{campaignId:A.campaignId},...A.automationNodeId!==void 0&&{automationNodeId:A.automationNodeId},...A.confirmLiveChange===!0&&{confirmLiveChange:!0},...A.name!==void 0&&{name:A.name},...x!==void 0&&{testPercentage:x},...g!==void 0&&{testDurationMinutes:g},...A.winnerCriteria!==void 0&&{winnerCriteria:A.winnerCriteria},...A.testType!==void 0&&{testType:A.testType},...E!==void 0&&{winnerThreshold:E},...Q!==void 0&&{variants:Q}}}function bX0(A){if(!A.subject||A.subject.trim()==="")throw new l("--subject is required",400);let x=gE(A.blocksJson,A.blocksFile,"blocks");if(x!==void 0&&!Array.isArray(x))throw new l("blocks JSON must be an array",400);return{subject:A.subject,...A.previewText!==void 0&&{previewText:A.previewText},...x!==void 0&&{blocks:x},...A.confirmLiveChange===!0&&{confirmLiveChange:!0}}}function kX0(A){let x=A.isWinner?" winner":"";return` - Variant ${A.label} [${A.id}]${x}`}function oK(A){if(console.log(`${A.name??"A/B Test"} [${A.id}]`),console.log(`Status: ${A.status}`),console.log(`Winner criteria: ${A.winnerCriteria}`),console.log(`Updated: ${dA(A.updatedAt)}`),A.campaignId)console.log(`Campaign: ${A.campaignId}`);if(A.automationNodeId)console.log(`Automation node: ${A.automationNodeId}`);console.log(`Variants: ${A.variants.length}`);for(let x of A.variants)console.log(kX0(x)),console.log(` Email: ${x.emailId}`),console.log(` Subject: ${x.subject||"(no subject)"}`),console.log(` Preview: ${x.previewText??"None"}`),console.log(` Blocks: ${x.blocks.length}`)}function uX(A){return`${A.toFixed(1)}%`}function iX0(A){let x=A.period??(A.start&&A.end?`${A.start} - ${A.end}`:"all time");console.log(`A/B test stats (${x})`),console.log(`Sent: ${A.stats.sent.toLocaleString()}`),console.log(`Delivered: ${A.stats.delivered.toLocaleString()}`),console.log(`Opened: ${A.stats.opened.toLocaleString()} (${uX(A.stats.openRate)})`),console.log(`Clicked: ${A.stats.clicked.toLocaleString()} (${uX(A.stats.clickRate)})`),console.log(),console.log("Variants:");for(let E of A.variants){let g=E.isWinner?" winner":"";console.log(`- Variant ${E.label} [${E.id}]${g}`),console.log(` Subject: ${E.subject||"(no subject)"}`),console.log(` Sent ${E.stats.sent.toLocaleString()}, opened ${E.stats.opened.toLocaleString()} (${uX(E.stats.openRate)}), clicked ${E.stats.clicked.toLocaleString()} (${uX(E.stats.clickRate)})`)}}async function p2(A,x){if(!await Cx())YA(Kx()),process.exit(1);try{if(A==="list"){let B=new URLSearchParams;if(x.sequence)B.set("sequenceId",x.sequence);let Q=await Y0("GET",`/api/v1/ab-tests${B.size>0?`?${B.toString()}`:""}`,void 0,x.company);if(x.json){L0(Q);return}console.log(`A/B tests (${Q.abTests.length})`);for(let D of Q.abTests)console.log(`- ${D.name??"A/B Test"} [${D.id}]`),console.log(` Status: ${D.status}`),console.log(` Variants: ${D.variants.length}`);return}if(A==="create"){let B=await Y0("POST","/api/v1/ab-tests",hX0(x),x.company);if(x.json){L0(B);return}console.log("Created A/B test"),oK(B.abTest);return}if(!x.id)throw new l("A/B test ID is required",400);if(A==="add-variant"){let B=await Y0("POST",`/api/v1/ab-tests/${x.id}/variants`,bX0(x),x.company);if(x.json){L0(B);return}console.log(`Added variant to A/B test ${x.id}`),oK(B.abTest);return}if(A==="delete-variant"){if(!x.variantId)throw new l("Variant ID is required",400);if(!await l9(`Delete variant ${x.variantId} from A/B test ${x.id}?`,x)){console.log("Aborted.");return}let B=x.confirmLiveChange===!0?"?confirmLiveChange=true":"",Q=await Y0("DELETE",`/api/v1/ab-tests/${x.id}/variants/${x.variantId}${B}`,void 0,x.company);if(x.json){L0(Q);return}console.log(`Removed variant ${x.variantId}`),oK(Q.abTest);return}if(A==="delete"){if(!await l9(`Delete A/B test ${x.id}?`,x)){console.log("Aborted.");return}let B=await Y0("DELETE",`/api/v1/ab-tests/${x.id}`,void 0,x.company);if(x.json){L0(B);return}console.log(`Deleted A/B test: ${x.id}`);return}if(A==="get"){let B=await Y0("GET",`/api/v1/ab-tests/${x.id}`,void 0,x.company);if(x.json){L0(B);return}oK(B.abTest);return}if(A==="stats"){let B=new URLSearchParams;if(x.period)B.set("period",x.period);if(x.start)B.set("start",x.start);if(x.end)B.set("end",x.end);if(x.includeBots)B.set("includeMachineEngagement","true");let Q=await Y0("GET",`/api/v1/ab-tests/${x.id}/stats${B.size>0?`?${B.toString()}`:""}`,void 0,x.company);if(x.json){L0(Q);return}iX0(Q);return}if(A==="restart"){if(x.testType!==void 0&&x.testType!=="subject"&&x.testType!=="content")throw new l("--test-type must be subject or content",400);let B=x.testType,Q;if(x.variantCount!==void 0)Q=Number.parseInt(x.variantCount,10);let D;if(x.winnerThreshold!==void 0)D=Number.parseInt(x.winnerThreshold,10);if(Q!==void 0&&(!Number.isInteger(Q)||Q<2||Q>4))throw new l("--variant-count must be an integer from 2 to 4",400);if(D!==void 0&&(!Number.isInteger(D)||D<10||D>1000))throw new l("--winner-threshold must be an integer from 10 to 1000",400);let I=await Y0("POST",`/api/v1/ab-tests/${x.id}/restart`,{sourceVariantId:x.sourceVariant,testType:B,winnerThreshold:D,variantCount:Q},x.company);if(x.json){L0(I);return}console.log(`Started new A/B test: ${I.abTest.id}`),console.log(`Previous test: ${I.previousAbTestId}`),console.log(`Control variant: ${I.sourceVariantId}`),oK(I.abTest);return}if(!x.variantId)throw new l("Variant ID is required",400);let E=lQ({html:x.html,htmlFile:x.htmlFile,blocksJson:x.blocksJson,blocksFile:x.blocksFile});if(x.subject===void 0&&x.previewText===void 0&&E.html===void 0&&E.blocks===void 0)throw new l("Provide at least one of: --subject, --preview-text, --html, --html-file, --blocks-json, --blocks-file",400);let g=await Y0("PATCH",`/api/v1/ab-tests/${x.id}/variants/${x.variantId}`,{subject:x.subject,previewText:x.previewText,html:E.html,blocks:E.blocks,...x.confirmLiveChange===!0&&{confirmLiveChange:!0}},x.company);if(x.json){L0(g);return}console.log(`Updated variant ${g.variant.label}`),console.log(`ID: ${g.variant.id}`),console.log(`Email: ${g.variant.emailId}`),console.log(`Subject: ${g.variant.subject}`)}catch(E){YA(E instanceof l?E:E),process.exit(1)}}var mX0=[{scope:"account:read",label:"Read account",description:"View account and workspace metadata.",group:"account"},{scope:"companies:manage",label:"Manage workspaces",description:"Create and update workspaces available to the key owner.",group:"account"},{scope:"subscribers:read",label:"Read subscribers",description:"View subscriber profiles, notes, list memberships, and activity.",group:"contacts"},{scope:"subscribers:write",label:"Write subscribers",description:"Create, update, tag, and unsubscribe subscribers.",group:"contacts"},{scope:"subscribers:delete",label:"Delete subscribers",description:"Permanently delete subscriber records.",group:"contacts",destructive:!0},{scope:"events:write",label:"Write events",description:"Record subscriber events and event properties.",group:"contacts"},{scope:"automations:trigger",label:"Trigger automations",description:"Allow subscriber, event, commerce, and tag changes to start or continue live automations and opt-in emails.",group:"contacts",liveDelivery:!0},{scope:"tags:read",label:"Read tags",description:"View tag definitions.",group:"contacts"},{scope:"tags:write",label:"Write tags",description:"Create and update tag definitions.",group:"contacts"},{scope:"tags:delete",label:"Delete tags",description:"Delete tag definitions and remove them from subscribers.",group:"contacts",destructive:!0},{scope:"lists:read",label:"Read lists",description:"View subscriber lists.",group:"contacts"},{scope:"lists:write",label:"Write lists",description:"Create, update, and manage subscriber lists.",group:"contacts"},{scope:"lists:delete",label:"Delete lists",description:"Delete subscriber lists.",group:"contacts",destructive:!0},{scope:"segments:read",label:"Read segments",description:"View saved segments and counts.",group:"contacts"},{scope:"segments:write",label:"Write segments",description:"Create and update saved segments.",group:"contacts"},{scope:"segments:delete",label:"Delete segments",description:"Delete saved segments.",group:"contacts",destructive:!0},{scope:"templates:read",label:"Read templates",description:"View reusable email templates.",group:"content"},{scope:"templates:write",label:"Write templates",description:"Create and update reusable email templates.",group:"content"},{scope:"templates:delete",label:"Delete templates",description:"Delete reusable email templates.",group:"content",destructive:!0},{scope:"emails:read",label:"Read emails",description:"View email content and render previews.",group:"content"},{scope:"emails:write",label:"Write emails",description:"Create and update email content.",group:"content"},{scope:"emails:delete",label:"Delete emails",description:"Delete email content records.",group:"content",destructive:!0},{scope:"landing_pages:read",label:"Read landing pages",description:"View landing pages and landing page domains.",group:"content"},{scope:"landing_pages:write",label:"Write landing pages",description:"Create, update, and verify landing pages and domains.",group:"content"},{scope:"landing_pages:delete",label:"Delete landing pages",description:"Delete landing pages and landing page domains.",group:"content",destructive:!0},{scope:"websites:read",label:"Read websites",description:"View discovered website and brand data.",group:"content"},{scope:"websites:write",label:"Write websites",description:"Create and process website records.",group:"content"},{scope:"websites:delete",label:"Delete websites",description:"Delete website records.",group:"content",destructive:!0},{scope:"campaigns:read",label:"Read campaigns",description:"View campaigns and campaign details.",group:"campaigns"},{scope:"campaigns:write",label:"Write campaigns",description:"Create, edit, and duplicate draft campaigns.",group:"campaigns"},{scope:"campaigns:delete",label:"Delete campaigns",description:"Delete campaigns.",group:"campaigns",destructive:!0},{scope:"campaigns:send",label:"Send campaigns",description:"Schedule, resume, pause, cancel, or test live campaign delivery.",group:"campaigns",liveDelivery:!0},{scope:"ab_tests:read",label:"Read A/B tests",description:"View campaign A/B tests and metrics.",group:"campaigns"},{scope:"ab_tests:write",label:"Write A/B tests",description:"Create, update, and run campaign A/B tests.",group:"campaigns"},{scope:"ab_tests:delete",label:"Delete A/B tests",description:"Delete campaign A/B tests and variants.",group:"campaigns",destructive:!0},{scope:"sequences:read",label:"Read sequences",description:"View sequences, steps, and sequence stats.",group:"sequences"},{scope:"sequences:write",label:"Write sequences",description:"Create and edit sequence drafts and steps.",group:"sequences"},{scope:"sequences:delete",label:"Delete sequences",description:"Delete sequences.",group:"sequences",destructive:!0},{scope:"sequences:activate",label:"Activate sequences",description:"Enable, disable, pause, and resume live sequence enrollment.",group:"sequences",liveDelivery:!0},{scope:"sequences:enroll",label:"Enroll subscribers",description:"Manually enroll or cancel subscribers in sequences.",group:"sequences",liveDelivery:!0},{scope:"transactional:read",label:"Read transactional emails",description:"View transactional email templates.",group:"transactional"},{scope:"transactional:write",label:"Write transactional emails",description:"Create and update transactional email templates.",group:"transactional"},{scope:"transactional:delete",label:"Delete transactional emails",description:"Delete transactional email templates.",group:"transactional",destructive:!0},{scope:"transactional:send",label:"Send via transactional API",description:"Send live transactional emails, or single-recipient marketing emails with compliance handling, through the transactional API.",group:"transactional",liveDelivery:!0},{scope:"commerce:read",label:"Read commerce data",description:"View products and commerce records.",group:"commerce"},{scope:"commerce:write",label:"Write commerce data",description:"Push products, customers, orders, checkouts, and stock requests.",group:"commerce"},{scope:"commerce:delete",label:"Delete commerce data",description:"Delete products and commerce records.",group:"commerce",destructive:!0},{scope:"analytics:read",label:"Read analytics",description:"View campaign, sequence, subscriber, and email event analytics.",group:"analytics"},{scope:"audience_syncs:read",label:"Read audience syncs",description:"View external audience sync configuration.",group:"integrations"},{scope:"audience_syncs:write",label:"Write audience syncs",description:"Create, update, and run external audience syncs.",group:"integrations"},{scope:"audience_syncs:delete",label:"Delete audience syncs",description:"Delete external audience syncs.",group:"integrations",destructive:!0},{scope:"integrations:manage",label:"Manage integrations",description:"Manage integration, migration, and connected service setup.",group:"integrations"},{scope:"webhooks:read",label:"Read webhooks",description:"View outbound webhooks and deliveries.",group:"integrations"},{scope:"webhooks:write",label:"Write webhooks",description:"Create, update, and test outbound webhooks.",group:"integrations"},{scope:"webhooks:delete",label:"Delete webhooks",description:"Delete outbound webhooks.",group:"integrations",destructive:!0},{scope:"widgets:read",label:"Read widgets",description:"View widget configuration.",group:"integrations"},{scope:"widgets:write",label:"Write widgets",description:"Create and update widget configuration.",group:"integrations"},{scope:"widgets:delete",label:"Delete widgets",description:"Delete widget configuration.",group:"integrations",destructive:!0},{scope:"conversations:read",label:"Read conversations",description:"View inbound reply conversations.",group:"integrations"},{scope:"conversations:write",label:"Write conversations",description:"Update conversation state and send conversation replies.",group:"integrations",liveDelivery:!0},{scope:"team:read",label:"Read team",description:"View team members and invitations.",group:"admin"},{scope:"team:manage",label:"Manage team",description:"Invite, remove, and update team members.",group:"admin",liveDelivery:!0},{scope:"api_keys:manage",label:"Manage API keys",description:"List, create, and revoke company API keys through the public API.",group:"admin"}],WL=mX0.map((A)=>A.scope),k6A=new Set(WL),Ia={full_access:{label:"Full access",description:"Can read, write, manage, and send across the workspace.",scopes:WL},read_only:{label:"Read-only",description:"Can inspect workspace data, but cannot make changes.",scopes:["account:read","subscribers:read","tags:read","lists:read","segments:read","templates:read","emails:read","landing_pages:read","websites:read","campaigns:read","ab_tests:read","sequences:read","transactional:read","commerce:read","analytics:read","audience_syncs:read","webhooks:read","widgets:read","conversations:read","team:read"]},agent_safe:{label:"Safer agent access",description:"Default for AI agents. Can inspect data and draft content without live delivery, destructive deletes, team changes, or API key creation.",scopes:["account:read","subscribers:read","tags:read","lists:read","segments:read","templates:read","templates:write","emails:read","emails:write","landing_pages:read","landing_pages:write","websites:read","campaigns:read","campaigns:write","ab_tests:read","sequences:read","sequences:write","transactional:read","transactional:write","commerce:read","analytics:read","audience_syncs:read","webhooks:read","widgets:read","widgets:write","conversations:read","team:read"]},ai_drafting:{label:"AI drafting",description:"Can inspect data, build subscriber lists, and draft content, campaigns, sequences, and templates without live delivery.",scopes:["account:read","subscribers:read","subscribers:write","tags:read","tags:write","lists:read","lists:write","segments:read","segments:write","templates:read","templates:write","emails:read","emails:write","landing_pages:read","landing_pages:write","websites:read","websites:write","campaigns:read","campaigns:write","ab_tests:read","ab_tests:write","sequences:read","sequences:write","transactional:read","transactional:write","commerce:read","analytics:read","audience_syncs:read","webhooks:read","widgets:read","widgets:write","conversations:read"]},data_ingest_safe:{label:"Data ingest, no automations",description:"Can sync subscribers and events, but cannot start or continue automations.",scopes:["account:read","subscribers:read","subscribers:write","events:write","tags:read","lists:read","segments:read","commerce:read","commerce:write"]},data_ingest_automations:{label:"Data ingest with automations",description:"Can sync subscribers, events, and commerce data that may trigger automations.",scopes:["account:read","subscribers:read","subscribers:write","events:write","automations:trigger","tags:read","tags:write","lists:read","segments:read","commerce:read","commerce:write"]},transactional_sender:{label:"Transactional sender",description:"Can manage transactional templates and send through the transactional API, including its compliant single-recipient marketing mode.",scopes:["account:read","subscribers:read","transactional:read","transactional:write","transactional:send","emails:read","emails:write","analytics:read"]},marketing_sender:{label:"Marketing sender",description:"Can manage and send campaigns and live sequences.",scopes:["account:read","subscribers:read","subscribers:write","events:write","automations:trigger","tags:read","tags:write","lists:read","lists:write","segments:read","segments:write","templates:read","templates:write","emails:read","emails:write","campaigns:read","campaigns:write","campaigns:send","ab_tests:read","ab_tests:write","sequences:read","sequences:write","sequences:activate","sequences:enroll","analytics:read"]}};function cX0(A,x){if(A==null)return x==="full_access";let E=Ia[x].scopes;if(A.length!==E.length)return!1;let g=new Set(A);return E.every((B)=>g.has(B))}function pX0(A){if(A==null)return"full_access";for(let x of Object.keys(Ia)){if(x==="full_access")continue;if(cX0(A,x))return x}return"custom"}function tK(A){let x=WL.length;if(A==null)return{preset:"full_access",fullAccess:!0,selectedScopeCount:x,currentScopeCount:x,description:"All current and future permissions are enabled."};let E=A.length,g=E===x?`All ${E} current permissions are enabled as a fixed custom selection.`:`${E} of ${x} current permissions are enabled.`;return{preset:pX0(A),fullAccess:!1,selectedScopeCount:E,currentScopeCount:x,description:g}}var g8;(function(A){A[A.AM=0]="AM",A[A.PM=1]="PM"})(g8||(g8={}));var e8;(function(A){A[A.SUNDAY=0]="SUNDAY",A[A.MONDAY=1]="MONDAY",A[A.TUESDAY=2]="TUESDAY",A[A.WEDNESDAY=3]="WEDNESDAY",A[A.THURSDAY=4]="THURSDAY",A[A.FRIDAY=5]="FRIDAY",A[A.SATURDAY=6]="SATURDAY"})(e8||(e8={}));var Y4;(function(A){A[A.JANUARY=1]="JANUARY",A[A.FEBRUARY=2]="FEBRUARY",A[A.MARCH=3]="MARCH",A[A.APRIL=4]="APRIL",A[A.MAY=5]="MAY",A[A.JUNE=6]="JUNE",A[A.JULY=7]="JULY",A[A.AUGUST=8]="AUGUST",A[A.SEPTEMBER=9]="SEPTEMBER",A[A.OCTOBER=10]="OCTOBER",A[A.NOVEMBER=11]="NOVEMBER",A[A.DECEMBER=12]="DECEMBER"})(Y4||(Y4={}));function r7(A,x){A.assign("day",x.getDate()),A.assign("month",x.getMonth()+1),A.assign("year",x.getFullYear())}function TX(A,x){A.assign("hour",x.getHours()),A.assign("minute",x.getMinutes()),A.assign("second",x.getSeconds()),A.assign("millisecond",x.getMilliseconds()),A.assign("meridiem",x.getHours()<12?g8.AM:g8.PM)}function Fg(A,x){A.imply("day",x.getDate()),A.imply("month",x.getMonth()+1),A.imply("year",x.getFullYear())}function eK(A,x){A.imply("hour",x.getHours()),A.imply("minute",x.getMinutes()),A.imply("second",x.getSeconds()),A.imply("millisecond",x.getMilliseconds()),A.imply("meridiem",x.getHours()<12?g8.AM:g8.PM)}var _X0={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:{timezoneOffsetDuringDst:120,timezoneOffsetNonDst:60,dstStart:(A)=>wa(A,Y4.MARCH,e8.SUNDAY,2),dstEnd:(A)=>wa(A,Y4.OCTOBER,e8.SUNDAY,3)},CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CT:{timezoneOffsetDuringDst:-300,timezoneOffsetNonDst:-360,dstStart:(A)=>aQ(A,Y4.MARCH,e8.SUNDAY,2,2),dstEnd:(A)=>aQ(A,Y4.NOVEMBER,e8.SUNDAY,1,2)},CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:{timezoneOffsetDuringDst:-240,timezoneOffsetNonDst:-300,dstStart:(A)=>aQ(A,Y4.MARCH,e8.SUNDAY,2,2),dstEnd:(A)=>aQ(A,Y4.NOVEMBER,e8.SUNDAY,1,2)},FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MT:{timezoneOffsetDuringDst:-360,timezoneOffsetNonDst:-420,dstStart:(A)=>aQ(A,Y4.MARCH,e8.SUNDAY,2,2),dstEnd:(A)=>aQ(A,Y4.NOVEMBER,e8.SUNDAY,1,2)},MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:{timezoneOffsetDuringDst:-420,timezoneOffsetNonDst:-480,dstStart:(A)=>aQ(A,Y4.MARCH,e8.SUNDAY,2,2),dstEnd:(A)=>aQ(A,Y4.NOVEMBER,e8.SUNDAY,1,2)},PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function aQ(A,x,E,g,B=0){let Q=0,D=0;while(D<g)if(Q++,new Date(A,x-1,Q).getDay()===E)D++;return new Date(A,x-1,Q,B)}function wa(A,x,E,g=0){let B=E===0?7:E,Q=new Date(A,x-1+1,1,12),D=Q.getDay()===0?7:Q.getDay(),I;if(D===B)I=7;else if(D<B)I=7+D-B;else I=D-B;return Q.setDate(Q.getDate()-I),new Date(A,x-1,Q.getDate(),g)}function hX(A,x,E={}){if(A==null)return null;if(typeof A==="number")return A;let g=E[A]??_X0[A];if(g==null)return null;if(typeof g=="number")return g;if(x==null)return null;if(x>g.dstStart(x.getFullYear())&&!(x>g.dstEnd(x.getFullYear())))return g.timezoneOffsetDuringDst;return g.timezoneOffsetNonDst}var Ja={day:0,second:0,millisecond:0};function Q6(A,x){let E=new Date(A);if(x.y)x.year=x.y,delete x.y;if(x.mo)x.month=x.mo,delete x.mo;if(x.M)x.month=x.M,delete x.M;if(x.w)x.week=x.w,delete x.w;if(x.d)x.day=x.d,delete x.d;if(x.h)x.hour=x.h,delete x.h;if(x.m)x.minute=x.m,delete x.m;if(x.s)x.second=x.s,delete x.s;if(x.ms)x.millisecond=x.ms,delete x.ms;if("year"in x){let g=Math.floor(x.year);E.setFullYear(E.getFullYear()+g);let B=x.year-g;if(B>0)x.month=x?.month??0,x.month+=B*12}if("quarter"in x){let g=Math.floor(x.quarter);E.setMonth(E.getMonth()+g*3)}if("month"in x){let g=Math.floor(x.month);E.setMonth(E.getMonth()+g);let B=x.month-g;if(B>0)x.week=x?.week??0,x.week+=B*4}if("week"in x){let g=Math.floor(x.week);E.setDate(E.getDate()+g*7);let B=x.week-g;if(B>0)x.day=x?.day??0,x.day+=Math.round(B*7)}if("day"in x){let g=Math.floor(x.day);E.setDate(E.getDate()+g);let B=x.day-g;if(B>0)x.hour=x?.hour??0,x.hour+=Math.round(B*24)}if("hour"in x){let g=Math.floor(x.hour);E.setHours(E.getHours()+g);let B=x.hour-g;if(B>0)x.minute=x?.minute??0,x.minute+=Math.round(B*60)}if("minute"in x){let g=Math.floor(x.minute);E.setMinutes(E.getMinutes()+g);let B=x.minute-g;if(B>0)x.second=x?.second??0,x.second+=Math.round(B*60)}if("second"in x){let g=Math.floor(x.second);E.setSeconds(E.getSeconds()+g);let B=x.second-g;if(B>0)x.millisecond=x?.millisecond??0,x.millisecond+=Math.round(B*1000)}if("millisecond"in x){let g=Math.floor(x.millisecond);E.setMilliseconds(E.getMilliseconds()+g)}return E}function sQ(A){let x={};for(let E in A)x[E]=-A[E];return x}class r2{instant;timezoneOffset;constructor(A,x){this.instant=A??new Date,this.timezoneOffset=x??null}static fromDate(A){return new r2(A)}static fromInput(A,x){if(A instanceof Date)return r2.fromDate(A);let E=A?.instant??new Date,g=hX(A?.timezone,E,x);return new r2(E,g)}getDateWithAdjustedTimezone(){let A=new Date(this.instant);if(this.timezoneOffset!==null)A.setMinutes(A.getMinutes()-this.getSystemTimezoneAdjustmentMinute(this.instant));return A}getSystemTimezoneAdjustmentMinute(A,x){if(!A||A.getTime()<0)A=new Date;let E=-A.getTimezoneOffset(),g=x??this.timezoneOffset??E;return E-g}getTimezoneOffset(){return this.timezoneOffset??-this.instant.getTimezoneOffset()}}class I8{knownValues;impliedValues;reference;_tags=new Set;constructor(A,x){if(this.reference=A,this.knownValues={},this.impliedValues={},x)for(let g in x)this.knownValues[g]=x[g];let E=A.getDateWithAdjustedTimezone();this.imply("day",E.getDate()),this.imply("month",E.getMonth()+1),this.imply("year",E.getFullYear()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}static createRelativeFromReference(A,x=Ja){let E=Q6(A.getDateWithAdjustedTimezone(),x),g=new I8(A);if(g.addTag("result/relativeDate"),"hour"in x||"minute"in x||"second"in x||"millisecond"in x)g.addTag("result/relativeDateAndTime"),TX(g,E),r7(g,E),g.assign("timezoneOffset",A.getTimezoneOffset());else if(eK(g,E),g.imply("timezoneOffset",A.getTimezoneOffset()),"day"in x)g.assign("day",E.getDate()),g.assign("month",E.getMonth()+1),g.assign("year",E.getFullYear()),g.assign("weekday",E.getDay());else if("week"in x)g.assign("day",E.getDate()),g.assign("month",E.getMonth()+1),g.assign("year",E.getFullYear()),g.imply("weekday",E.getDay());else if(g.imply("day",E.getDate()),"month"in x)g.assign("month",E.getMonth()+1),g.assign("year",E.getFullYear());else if(g.imply("month",E.getMonth()+1),"year"in x)g.assign("year",E.getFullYear());else g.imply("year",E.getFullYear());return g}get(A){if(A in this.knownValues)return this.knownValues[A];if(A in this.impliedValues)return this.impliedValues[A];return null}isCertain(A){return A in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(A,x){if(A in this.knownValues)return this;return this.impliedValues[A]=x,this}assign(A,x){return this.knownValues[A]=x,delete this.impliedValues[A],this}addDurationAsImplied(A){let x=this.dateWithoutTimezoneAdjustment(),E=Q6(x,A);if("day"in A||"week"in A||"month"in A||"year"in A)this.delete(["day","weekday","month","year"]),this.imply("day",E.getDate()),this.imply("weekday",E.getDay()),this.imply("month",E.getMonth()+1),this.imply("year",E.getFullYear());if("second"in A||"minute"in A||"hour"in A)this.delete(["second","minute","hour"]),this.imply("second",E.getSeconds()),this.imply("minute",E.getMinutes()),this.imply("hour",E.getHours());return this}delete(A){if(typeof A==="string")A=[A];for(let x of A)delete this.knownValues[x],delete this.impliedValues[x]}clone(){let A=new I8(this.reference);A.knownValues={},A.impliedValues={};for(let x in this.knownValues)A.knownValues[x]=this.knownValues[x];for(let x in this.impliedValues)A.impliedValues[x]=this.impliedValues[x];return A}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")&&!this.isCertain("year")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isDateWithUnknownYear(){return this.isCertain("month")&&!this.isCertain("year")}isValidDate(){let A=this.dateWithoutTimezoneAdjustment();if(A.getFullYear()!==this.get("year"))return!1;if(A.getMonth()!==this.get("month")-1)return!1;if(A.getDate()!==this.get("day"))return!1;if(this.get("hour")!=null&&A.getHours()!=this.get("hour"))return!1;if(this.get("minute")!=null&&A.getMinutes()!=this.get("minute"))return!1;return!0}toString(){return`[ParsingComponents {
|
|
352
352
|
tags: ${JSON.stringify(Array.from(this._tags).sort())},
|
|
@@ -626,4 +626,4 @@ ${wg0}Quick Start${o6}
|
|
|
626
626
|
${H1}$${o6} sequenzy websites guide --framework nextjs --use-case transactional`,D=`
|
|
627
627
|
${wg0}Notes${o6}
|
|
628
628
|
${H1}Generated content should be reviewed before sending.${o6}
|
|
629
|
-
${H1}Use 'sequenzy --help' and '<command> --help' for detailed examples and caveats.${o6}`;console.log(E),console.log(g),console.log(),console.log(B),console.log(Q),console.log(D),console.log()}var A8=new Zm;A8.name("sequenzy").description("Sequenzy CLI - Email marketing from the terminal").version(Jg0).showHelpAfterError().showSuggestionAfterError().action(le0);X0(A8,{notes:["Use --json on data commands when another tool or agent should parse structured output.","Dashboard-aware JSON responses include appUrls when a company ID can be resolved.","Company-scoped commands accept --company for personal API keys that can access multiple companies.","Content commands prefer file flags such as --html-file, --blocks-file, --steps-file, and --emails-file to avoid shell escaping issues.","Sequence creation supports --goal for AI generation or explicit step JSON."],examples:['sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy campaigns update camp_123 --subject "Updated subject" --html-file ./campaign.html',"sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json","sequenzy urls --company comp_123 --sequence seq_123 --settings-tab integrations","sequenzy websites guide --framework nextjs --use-case transactional",'sequenzy api-keys create --name "CI deploy key" --company comp_123']});var de0=A8.command("login").description("Log in to your Sequenzy account").action(z60);X0(de0,{notes:["Starts device authentication and prints a verification URL plus approval code."],examples:["sequenzy login"]});var ae0=A8.command("logout").description("Log out of your Sequenzy account").action(S60);X0(ae0,{examples:["sequenzy logout"]});var se0=A8.command("whoami").description("Show the locally stored Sequenzy identity").action(Cg0);X0(se0,{notes:["This checks local CLI credential state only. Use 'sequenzy account' to make a live request and verify the active key, permissions, and company access."],examples:["sequenzy whoami"]});var oe0=A8.command("stats").description("Show account, campaign, or sequence metrics, including Poll/NPS").option("-p, --period <period>","Time period (7d, 30d, 90d)","7d").option("--campaign <id>","Get stats for a specific campaign").option("--sequence <id>","Get stats for a specific sequence").option("--include-bots","Include machine-classified bot/scanner opens and clicks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including poll and NPS results").action(f20);X0(oe0,{notes:["Use exactly one of: account-level period, --campaign, or --sequence.","Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement.","Sequence stats include per-step failures when the API reports them.","Campaign stats include a Poll & NPS Results section when the email collected answers; use --json for the full polls array."],examples:["sequenzy stats","sequenzy stats --period 30d","sequenzy stats --campaign camp_123","sequenzy stats --campaign camp_123 --json","sequenzy stats --campaign camp_123 --include-bots","sequenzy stats --sequence seq_123"]});var te0=A8.command("events").description("List raw campaign or sequence email events").option("--campaign <id>","List events for a campaign").option("--sequence <id>","List events for a sequence").option("--type <type>","Single event type to include, such as delivery, open, or click").option("--event-types <types>","Comma-separated event types to include (default: delivery)").option("-p, --period <period>","Time period (1h, 24h, 7d, 30d, 90d)").option("--start <iso>","Start of custom time range (ISO 8601)").option("--end <iso>","End of custom time range (ISO 8601)").option("--page <number>","Page number").option("--limit <number>","Events per page, capped by the API").option("--include-bots","Include machine-classified bot/scanner opens and clicks").option("-c, --company <id>","Company ID").option("--json","Print JSON").action(K60);X0(te0,{notes:["Use exactly one of --campaign or --sequence.","Defaults to delivery events. Use --event-types delivery,open,click when you need engagement events too.","Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement."],examples:["sequenzy events --campaign camp_123","sequenzy events --sequence seq_123 --limit 100 --json","sequenzy events --campaign camp_123 --event-types delivery,click --period 30d"]});var ee0=A8.command("urls").description("Generate Sequenzy dashboard URLs for known resource IDs").option("-c, --company <id>","Company ID").option("--campaign <id>","Campaign ID for campaign editor URL").option("--landing-page <id>","Landing page ID for landing page editor URL").option("--sequence <id>","Sequence ID for sequence editor URL").option("--template <id>","Template/email ID for email editor URL").option("--email <id>","Email ID for email editor URL").option("--transactional <id>","Transactional email ID").option("--email-send <id>","Email send ID").option("--domain <id>","Sending domain ID").option("--status <status>","Status for campaign/sequence list URLs").option("--settings-tab <tab>","Settings tab slug, e.g. integrations").option("--json","Print JSON").action(A60);X0(ee0,{notes:["Uses SEQUENZY_APP_URL when set, otherwise https://sequenzy.com.","If --company is omitted, the CLI tries the current company from `sequenzy account`.","Useful after creating a campaign or sequence when the user wants a review/edit link."],examples:["sequenzy urls --company comp_123","sequenzy urls --company comp_123 --sequence seq_123","sequenzy urls --company comp_123 --campaign camp_123","sequenzy urls --company comp_123 --landing-page lp_123","sequenzy urls --company comp_123 --email-send send_123","sequenzy urls --company comp_123 --settings-tab integrations","sequenzy urls --company comp_123 --json"]});var Q2=A8.command("subscribers").description("Manage subscribers").action(()=>Q2.help());X0(Q2,{notes:["Subscriber list fetches every page by default so agents do not silently miss later results.","`subscribers get` includes tags, list memberships, sequence enrollments, email stats, and recent activity.","--attr expects repeated key=value pairs. Example: --attr firstName=Ana --attr plan=pro"],examples:["sequenzy subscribers list --tag vip",'sequenzy subscribers list --list "Master List" --json',"sequenzy subscribers list --tag vip --limit 25 --json","sequenzy subscribers add user@example.com --tag trial --attr firstName=Ana","sequenzy subscribers import copper-contacts.csv --list list_123 --opt-in-mode confirmed","sequenzy subscribers import-status import_123 --json","sequenzy subscribers get user@example.com --json",'sequenzy subscribers notes add user@example.com --body "Customer prefers quarterly reports"',"sequenzy subscribers remove user@example.com --hard"]});var A0A=Q2.command("list").description("List subscribers").option("-s, --segment <id>","Filter by segment").option("-t, --tag <tag>","Filter by tag").option("--list <id-or-name>","Filter by subscriber list ID or exact name").option("-l, --limit <number>","Maximum results to return").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>H7("list",A));X0(A0A,{examples:["sequenzy subscribers list",'sequenzy subscribers list --list "Master List"',"sequenzy subscribers list --segment seg_123","sequenzy subscribers list --tag onboarding --limit 100"]});var x0A=Q2.command("add [email]").description("Add or upsert a subscriber").option("--external-id <id>","Customer-owned subscriber ID").option("--first-name <name>","Subscriber first name").option("--last-name <name>","Subscriber last name").option("-t, --tag <tags...>","Tags to apply").option("-l, --list <ids...>","List IDs to add the subscriber to").option("--no-lists","Add the subscriber to no lists").option("--skip-sequences","Do not enroll the subscriber in matching sequences").option("-a, --attr <attrs...>","Attributes (key=value)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("add",{email:A,...x,noLists:x.lists===!1}));X0(x0A,{examples:["sequenzy subscribers add user@example.com","sequenzy subscribers add user@example.com --first-name Ana --tag trial --attr plan=pro","sequenzy subscribers add user@example.com --list list_123","sequenzy subscribers add user@example.com --skip-sequences"]});var E0A=Q2.command("import [file]").description("Queue a full-record subscriber import from CSV or JSON").option("--records-json <json>","Inline JSON array (alternative to a CSV/JSON file)").option("--duplicate-strategy <strategy>","Existing contact behavior: skip, merge, or overwrite","skip").option("--file-name <name>","Source label shown in import history").option("-l, --list <ids...>","List IDs for every imported subscriber").option("--enroll-sequences","Enroll matching subscribers (requires automations:trigger)").option("--default-phone-country <country>","Two-letter country for national phone numbers").option("--sms-consent","Assert express written SMS consent for every imported phone").option("--opt-in-mode <mode>","Email consent mode: default, confirmed, or double_opt_in","default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("import",{file:A,...x}));X0(E0A,{notes:["CSV columns for email, names, external ID, phone, status, and tags are detected automatically; other columns become custom attributes.","Use --opt-in-mode confirmed only when these contacts already gave verified email consent.","Imports run asynchronously. Poll the returned ID with subscribers import-status."],examples:["sequenzy subscribers import copper-contacts.csv --list list_123 --opt-in-mode confirmed",`sequenzy subscribers import --records-json '[{"email":"one@example.com","firstName":"Ana"}]' --opt-in-mode confirmed`]});var B0A=Q2.command("import-status <importId>").description("Get subscriber import progress and result counts").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("import:get",{importId:A,...x}));X0(B0A,{notes:["A completed import can still contain failed rows; inspect failed counts and --json reason maps."],examples:["sequenzy subscribers import-status import_123","sequenzy subscribers import-status import_123 --json"]});var g0A=Q2.command("get [email]").description("Get subscriber details").option("--external-id <id>","Customer-owned subscriber ID").option("--include-bots","Include machine-classified bot/scanner opens and clicks in stats/activity").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("get",{email:A,...x}));X0(g0A,{notes:["Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement."],examples:["sequenzy subscribers get user@example.com","sequenzy subscribers get user@example.com --include-bots"]});var Ry=Q2.command("notes").description("Manage subscriber notes").action(()=>Ry.help());X0(Ry,{examples:["sequenzy subscribers notes list user@example.com",'sequenzy subscribers notes add user@example.com --body "Prefers monthly digest"',"sequenzy subscribers notes delete note_123"]});var Q0A=Ry.command("list [email]").description("List subscriber notes").option("--external-id <id>","Customer-owned subscriber ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("notes:list",{email:A,...x}));X0(Q0A,{examples:["sequenzy subscribers notes list user@example.com","sequenzy subscribers notes list --external-id user_123 --json"]});var D0A=Ry.command("add [email]").description("Add a subscriber note").option("--external-id <id>","Customer-owned subscriber ID").requiredOption("-b, --body <body>","Note body").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("notes:add",{email:A,...x}));X0(D0A,{examples:['sequenzy subscribers notes add user@example.com --body "Asked about enterprise plan"','sequenzy subscribers notes add --external-id user_123 --body "Imported from sales call"']});var C0A=Ry.command("delete <noteId>").description("Delete a subscriber note").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("notes:delete",{noteId:A,...x}));X0(C0A,{examples:["sequenzy subscribers notes delete note_123"]});var F0A=Q2.command("update [email]").description("Update subscriber status, name, tags, or custom attributes").option("--external-id <id>","Customer-owned subscriber ID").option("--status <status>","Subscriber status").option("--first-name <name>","Subscriber first name").option("--last-name <name>","Subscriber last name").option("-t, --tag <tags...>","Replacement tags").option("-a, --attr <attrs...>","Attributes (key=value)").option("--merge","Merge custom attributes instead of replacing them").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("update",{email:A,...x}));X0(F0A,{examples:["sequenzy subscribers update user@example.com --status unsubscribed","sequenzy subscribers update user@example.com --first-name Ana --last-name Silva","sequenzy subscribers update user@example.com --tag churned --attr cancelReason=too_expensive","sequenzy subscribers update user@example.com --attr plan=pro --merge"]});var I0A=Q2.command("event [email]").description("Trigger an event for a subscriber").option("--external-id <id>","Customer-owned subscriber ID").requiredOption("-n, --name <event>","Event name").option("-p, --property <properties...>","Event properties (key=value)").option("-a, --attr <attrs...>","Subscriber attributes (key=value)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("event",{email:A,...x}));X0(I0A,{examples:["sequenzy subscribers event user@example.com --name saas.purchase","sequenzy subscribers event user@example.com --name saas.purchase --property plan=pro --property amount=99"]});var w0A=Q2.command("remove [email]").description("Unsubscribe or permanently delete a subscriber").option("--external-id <id>","Customer-owned subscriber ID").option("--hard","Permanently delete (not just unsubscribe)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("remove",{email:A,...x}));X0(w0A,{examples:["sequenzy subscribers remove user@example.com","sequenzy subscribers remove user@example.com --hard"]});var My=A8.command("transactional").description("Inspect transactional email templates").action(()=>My.help());X0(My,{notes:["Use the top-level `sequenzy send` command to send email."],examples:["sequenzy transactional list","sequenzy transactional get welcome","sequenzy send user@example.com --template welcome --var firstName=Ana"]});var J0A=My.command("list").description("List transactional templates").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>$R("list",A));X0(J0A,{examples:["sequenzy transactional list --company comp_123"]});var f0A=My.command("get <slug>").description("Get transactional template details by slug").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>$R("get",{slug:A,...x}));X0(f0A,{examples:["sequenzy transactional get welcome"]});var K0A=My.command("create <name>").description("Create a transactional template").option("--slug <slug>","API slug").option("-s, --subject <subject>","Subject (optional with --prompt)").option("--preview-text <text>","Preview text override").option("--prompt <prompt>","Generate branded transactional blocks").option("--style <style>","Prompt generation style").option("--tone <tone>","Prompt generation tone").option("--html <html>","Preserved HTML content").option("--html-file <file>","Read preserved HTML from file").option("--blocks-json <json>","Finished Sequenzy blocks JSON").option("--blocks-file <file>","Read finished Sequenzy blocks from file").option("--enabled","Enable immediately (prompt creates default disabled)").option("--no-enabled","Create the transactional template disabled").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>$R("create",{name:A,...x}));X0(K0A,{notes:["Provide exactly one of prompt, HTML, or blocks.",HR],examples:['sequenzy transactional create password-reset --prompt "Write a password reset email"']});var Vk=A8.command("widgets").description("Widget helper commands").action(()=>Vk.help());X0(Vk,{examples:["sequenzy widgets preferences-token user@example.com"]});var $0A=Vk.command("preferences-token <email>").description("Generate a subscription preferences iframe token").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>Fg0("preferences-token",{email:A,...x}));X0($0A,{examples:["sequenzy widgets preferences-token user@example.com"]});var vk=A8.command("email-sends").alias("emailsends").description("Inspect sent email snapshots and delivery events").action(()=>vk.help());X0(vk,{notes:["Email send rows are short-lived; if the row was cleaned up, this falls back to retained ClickHouse events.","Use --html to print the stored HTML body when it is still available."],examples:["sequenzy email-sends get send_123","sequenzy email-sends get send_123 --html","sequenzy email-sends get send_123 --json"]});var H0A=vk.command("get <emailSendId>").description("Get an email send by ID").option("-c, --company <id>","Company ID override for personal API keys").option("--html","Print the full stored HTML body in text output").option("--html-only","Print only the stored HTML body").option("--json","Print raw JSON").action((A,x)=>w60("get",{id:A,...x}));X0(H0A,{examples:["sequenzy email-sends get send_123","sequenzy email-sends get send_123 --html","sequenzy email-sends get send_123 --company comp_123 --json"]});var yR=A8.command("suppressions").description("Inspect and clean stale recipient bounce suppression").action(()=>yR.help());X0(yR,{notes:["Suppression lookup is exact-address only because the SES account-level list is shared across companies.","Removal clears stale bounce entries only; complaint and unsubscribe protections are preserved."],examples:["sequenzy suppressions get me@example.com","sequenzy suppressions remove me@example.com --yes"]});var y0A=yR.command("get <email>").description("Check local and Amazon SES suppression for one recipient").option("--region <region>","Check one AWS SES region").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>Pk("get",{email:A,...x}));X0(y0A,{examples:["sequenzy suppressions get me@example.com","sequenzy suppressions get me@example.com --region us-east-1 --json"]});var q0A=yR.command("remove <email>").description("Remove stale bounce suppression for one recipient").option("--region <region>","Clear one AWS SES region").option("-c, --company <id>","Company ID override for personal API keys").option("-y, --yes","Skip confirmation").option("--json","Print raw JSON").action((A,x)=>Pk("remove",{email:A,...x}));X0(q0A,{examples:["sequenzy suppressions remove me@example.com","sequenzy suppressions remove me@example.com --region us-east-1 --yes"]});var Y0A=A8.command("send <email>").description("Send through the transactional email API").option("-t, --template <slug>","Transactional template slug to use").option("-s, --subject <subject>","Email subject").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--email-type <type>","Delivery policy: transactional (default) or marketing").option("--vars-json <json>","Variables as a JSON object, including nested arrays for repeat blocks").option("-v, --var <vars...>","Variables (key=value)").action(B20);X0(Y0A,{notes:["Use either --template or --html/--html-file.","--template takes a transactional API slug and cannot be combined with --subject.","--subject is required when sending raw HTML.","--email-type marketing adds the standard unsubscribe footer and RFC 8058 one-click-unsubscribe headers; it supports one recipient only.","--vars-json accepts nested objects and arrays; --var overrides individual scalar keys."],examples:["sequenzy send user@example.com --template welcome --var firstName=Ana",`sequenzy send user@example.com --template welcome --vars-json '{"event":{"items":[{"title":"Plan","description":"Pro"}]}}'`,'sequenzy send user@example.com --subject "Welcome" --html-file ./welcome.html',"sequenzy send user@example.com --template trial-reminder --email-type marketing --var firstName=Ana"]});var a5=A8.command("campaigns").description("Manage campaigns").action(()=>a5.help());X0(a5,{notes:["Campaign creation supports HTML, Sequenzy blocks, or prompt-generated content.","Campaign updates support HTML, Sequenzy blocks, subject, name, labels, and reply-to changes.","Campaign scheduling requires a future ISO timestamp and a verified sending domain.","Use cancel to stop a scheduled or sending campaign, and pause/resume to control an active send.",HR],examples:["sequenzy campaigns list --status draft --company comp_123",'sequenzy campaigns create "April Launch" --subject "We shipped" --html-file ./campaign.html','sequenzy campaigns create "API Launch" --subject "We shipped" --label edm api --html-file ./campaign.html','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z"',"sequenzy campaigns test camp_123 --to you@example.com","sequenzy campaigns cancel camp_123","sequenzy campaigns duplicate camp_123 --mode ab_test"]});var X0A=a5.command("list").description("List campaigns").option("-s, --status <status>","Filter by status").option("--label <labels...>","Filter by label name").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>z4("list",A));X0(X0A,{examples:["sequenzy campaigns list","sequenzy campaigns list --status draft --company comp_123","sequenzy campaigns list --label edm"]});var Z0A=a5.command("get <id>").description("Get campaign details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("get",{id:A,...x}));X0(Z0A,{examples:["sequenzy campaigns get camp_123 --company comp_123"]});var U0A=a5.command("create <name>").description("Create a campaign").option("-s, --subject <subject>","Email subject").option("--preview-text <text>","Inbox preview text").option("--preheader-text <text>","Alias for --preview-text").option("--tracking-code <code>","Optional campaign tracking code").option("--status <status>","Initial status: draft or sent").option("--sent-at <iso-date>","Sent timestamp when creating with --status sent").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--prompt <prompt>","Generate campaign blocks from a prompt").option("--style <style>","Prompt generation style: minimal, branded, promotional").option("--tone <tone>","Prompt generation tone: professional, casual, friendly").option("--label <labels...>","Label names to assign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("create",{name:A,...x}));X0(U0A,{notes:["--subject is required unless --prompt is provided. With --prompt, the generated subject is used unless --subject is also provided.","Use --preview-text or --preheader-text to set the inbox preview text. With --prompt, the generated preview is used unless one of these flags is provided.","Use --blocks-json or --blocks-file when you need editor-compatible blocks, including conditional content and per-block styles.","Use --status sent only to archive an already-sent campaign; it does not send email or create per-recipient delivery history.","Do not combine prompt, HTML flags, and blocks flags in the same request."],examples:['sequenzy campaigns create "April Launch" --prompt "Announce our new analytics dashboard"','sequenzy campaigns create "April Launch" --subject "We shipped" --preheader-text "Your quick product update" --html-file ./campaign.html','sequenzy campaigns create "Imported launch" --subject "We shipped" --status sent --sent-at "2026-05-01T14:00:00Z" --html-file ./campaign.html','sequenzy campaigns create "API Launch" --subject "We shipped" --label edm api --html-file ./campaign.html','sequenzy campaigns create "Segmented Launch" --subject "We shipped" --blocks-file ./campaign-blocks.json']});var G0A=a5.command("update <id>").description("Update a draft campaign").option("-n, --name <name>","Campaign name").option("-s, --subject <subject>","Email subject").option("--preview-text <text>","Inbox preview text").option("--preheader-text <text>","Alias for --preview-text").option("--tracking-code <code>","Optional campaign tracking code").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--campaign-data-json <json>","Inline campaignData JSON object").option("--campaign-data-file <file>","Path to a JSON file with campaignData").option("--computed-lists-json <json>","Inline computedLists JSON array").option("--computed-lists-file <file>","Path to a JSON file with computedLists").option("--reply-to <email>","Set reply-to using an existing reply profile email").option("--reply-profile <id>","Set reply-to using a reply profile ID").option("--label <labels...>","Replace label names").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("update",{id:A,...x}));X0(G0A,{notes:["Provide at least one update flag, including subject, preview text, content, labels, reply-to, campaign data, or computed lists.","Use --blocks-json or --blocks-file when you need editor-compatible blocks, including conditional content and per-block styles.","Use --campaign-data-file and --computed-lists-file to upload personalization data for repeat blocks.","Do not combine HTML flags with blocks flags in the same request.","Use either --reply-to or --reply-profile, not both."],examples:['sequenzy campaigns update camp_123 --subject "Updated subject"','sequenzy campaigns update camp_123 --preheader-text "Updated preview"',"sequenzy campaigns update camp_123 --html-file ./campaign-v2.html","sequenzy campaigns update camp_123 --blocks-file ./campaign-v2-blocks.json","sequenzy campaigns update camp_123 --campaign-data-file ./campaign-data.json --computed-lists-file ./computed-lists.json","sequenzy campaigns update camp_123 --reply-to support@example.com","sequenzy campaigns update camp_123 --label edm api"]});var W0A=a5.command("schedule <id>").description("Schedule a draft or scheduled campaign").requiredOption("--at <datetime>","Future ISO date/time to send, for example 2026-06-01T14:00:00Z").option("--target-lists-json <json>","Inline campaign targetLists JSON object").option("--target-lists-file <file>","Path to a JSON file with campaign targetLists").option("--send-time-optimization","Enable send-time optimization for the scheduled send").option("--spread-over-hours <hours>","Spread delivery over 1-72 hours. Disables send-time optimization when set.").option("--repeat <interval>","Repeat the campaign weekly or monthly starting at --at. Audience membership is re-evaluated at every run.").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("schedule",{id:A,...x}));X0(W0A,{notes:["The campaign must be draft or already scheduled.","Omit target lists to reuse saved campaign targeting, or default to all active subscribers.",'Target list examples include {"type":"all"}, {"type":"lists","listIds":["list_123"]}, and {"type":"segment","segmentId":"seg_123"}.',"With --repeat, the campaign becomes a recurring template: each run is duplicated and sent automatically. Re-schedule without --repeat (or cancel the campaign) to stop the series."],examples:['sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z"',`sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --target-lists-json '{"type":"all"}'`,'sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --target-lists-file ./target-lists.json','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --spread-over-hours 6','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --repeat monthly']});var R0A=a5.command("test <id>").description("Send a test email for a campaign").requiredOption("--to <email>","Recipient email for the test").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("test",{id:A,...x}));X0(R0A,{examples:["sequenzy campaigns test camp_123 --to you@example.com"]});var M0A=a5.command("cancel <id>").description("Cancel a scheduled, paused, or sending campaign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("cancel",{id:A,...x}));X0(M0A,{notes:["Cancelling stops scheduled, paused, waiting-approval, and actively sending campaigns immediately.","No confirmation prompt is shown so a bad send can be stopped fast."],examples:["sequenzy campaigns cancel camp_123"]});var z0A=a5.command("pause <id>").description("Pause a campaign that is currently sending").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("pause",{id:A,...x}));X0(z0A,{notes:["Only campaigns in sending status can be paused."],examples:["sequenzy campaigns pause camp_123"]});var S0A=a5.command("resume <id>").description("Resume a paused campaign").option("--spread-over-hours <hours>","Spread the remaining delivery over 1-72 hours").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("resume",{id:A,...x}));X0(S0A,{notes:["Only paused campaigns can be resumed."],examples:["sequenzy campaigns resume camp_123","sequenzy campaigns resume camp_123 --spread-over-hours 6"]});var L0A=a5.command("delete <id>").description("Delete a campaign").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("delete",{id:A,...x}));X0(L0A,{notes:["Sending, scheduled, and paused campaigns must be cancelled before they can be deleted."],examples:["sequenzy campaigns delete camp_123 --yes"]});var O0A=a5.command("duplicate <id>").description("Duplicate a campaign as a new draft").option("--mode <mode>","Duplicate mode: campaign, ab_test, or variant","campaign").option("--variant-id <id>","A/B test variant to copy when --mode is variant").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("duplicate",{id:A,...x}));X0(O0A,{notes:["Mode campaign copies the campaign email, ab_test also copies the A/B test with all variants, and variant copies one variant's content as a plain campaign."],examples:["sequenzy campaigns duplicate camp_123","sequenzy campaigns duplicate camp_123 --mode ab_test","sequenzy campaigns duplicate camp_123 --mode variant --variant-id var_b"]});var j0A=a5.command("resend-to-non-openers <id>").description("Create a draft resend to subscribers who didn't open a sent campaign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("resend-to-non-openers",{id:A,...x}));X0(j0A,{notes:["Only available 6 hours after a sent campaign finishes sending.",`Creates a draft targeting the same audience plus a "didn't open this campaign" rule. Review the draft, then schedule or send it.`,"The response includes an estimate of how many subscribers haven't opened the original."],examples:["sequenzy campaigns resend-to-non-openers camp_123"]});var D2=A8.command("landing-pages").description("Manage landing pages").action(()=>D2.help());X0(D2,{notes:["Landing pages are created as drafts. Publish only after reviewing the page.","Use --content-json or --content-file for full editor-compatible landing page content.","Custom domains require a CNAME record pointing to pages.sequenzydns.com."],examples:["sequenzy landing-pages list --company comp_123",'sequenzy landing-pages create "Product Waitlist" --template waitlist',"sequenzy landing-pages publish lp_123","sequenzy landing-pages connect-domain pages.example.com"]});var P0A=D2.command("list").description("List landing pages").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>I1("list",A));X0(P0A,{examples:["sequenzy landing-pages list --company comp_123"]});var N0A=D2.command("get <id>").description("Get landing page details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>I1("get",{id:A,...x}));X0(N0A,{examples:["sequenzy landing-pages get lp_123 --company comp_123"]});var V0A=D2.command("create [name]").description("Create a draft landing page").option("--slug <slug>","Landing page URL slug").option("--template <template>","Template key, e.g. waitlist").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>I1("create",{name:A,...x}));X0(V0A,{notes:["When --content-json/--content-file is omitted, a valid default page is generated from --template."],examples:['sequenzy landing-pages create "Product Waitlist" --template waitlist','sequenzy landing-pages create "Launch Page" --slug launch --content-file ./landing-page.json']});var v0A=D2.command("update <id>").description("Edit a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>I1("update",{id:A,...x}));X0(v0A,{examples:['sequenzy landing-pages update lp_123 --name "Updated page"',"sequenzy landing-pages update lp_123 --content-file ./landing-page.json"]});var u0A=D2.command("publish <id>").description("Publish a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>I1("publish",{id:A,...x}));X0(u0A,{examples:["sequenzy landing-pages publish lp_123"]});var T0A=D2.command("unpublish <id>").description("Unpublish a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>I1("unpublish",{id:A,...x}));X0(T0A,{examples:["sequenzy landing-pages unpublish lp_123"]});var h0A=D2.command("delete <id>").description("Delete a landing page").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>I1("delete",{id:A,...x}));X0(h0A,{examples:["sequenzy landing-pages delete lp_123"]});var b0A=D2.command("connect-domain <domain>").description("Connect a custom landing page domain").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>I1("connect-domain",{domain:A,...x}));X0(b0A,{examples:["sequenzy landing-pages connect-domain pages.example.com --company comp_123"]});var k0A=D2.command("update-domain-settings").description("Update or verify landing page domain settings").option("--domain <domain>","Replace the connected landing page domain").option("--verify","Refresh domain verification state").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>I1("update-domain-settings",A));X0(k0A,{examples:["sequenzy landing-pages update-domain-settings --domain pages.example.com","sequenzy landing-pages update-domain-settings --verify"]});var J6=A8.command("sequences").description("Manage email sequences").action(()=>J6.help());X0(J6,{notes:["The CLI supports both AI goal-based sequence creation and explicit-step creation.","Trigger-specific options depend on --trigger. For example: contact_added needs --list-id, tag_added needs --tag-name, inactivity needs --event-name and --inactive-days.","Use --goal for AI generation, or --steps-file / --emails-file with JSON arrays that match the API step objects.","Use --enrollment-mode matching_field for product- or variant-specific event sequences.",'Explicit --steps-file input can include dynamic Stripe or Shopify discount actions with {"type":"create_discount","discount":{"provider":"stripe","discountType":"percent","percentOff":20,"duration":"once","appliesToAllPlans":true}}; the code is created when each subscriber reaches the step, and later emails can use {{discount.code}}.',"Discount action sequences require the selected provider integration, such as Stripe or Shopify, before enabling.",HR],examples:["sequenzy sequences list --company comp_123",'sequenzy sequences create onboarding --trigger event_received --event-name signup.completed --goal "Guide new users to activation"',"sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json","sequenzy sequences update seq_123 --steps-file ./sequence-updates.json","sequenzy sequences enable seq_123"]});var i0A=J6.command("list").description("List sequences").option("--status <status>","Filter by draft, active, paused, or archived").option("--search <text>","Search sequence names and descriptions").option("--label <labels...>","Filter by dashboard label names").option("--limit <count>","Page size from 1 to 100").option("--offset <count>","Zero-based result offset").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>E9("list",A));X0(i0A,{examples:["sequenzy sequences list --company comp_123"]});var m0A=J6.command("get <id>").description("Get sequence details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("get",{id:A,...x}));X0(m0A,{examples:["sequenzy sequences get seq_123 --company comp_123"]});function fg0(A){return A.option("--description <text>","Goal description").option("--trigger-type <type>","Goal signal: event or attribute_change").option("--trigger-event-name <event>","Event goal signal name").option("--attribute-path <path>","Subscriber attribute goal path").option("--attribute-condition <condition>","changed, changed_to, or changed_from_to").option("--attribute-value <value>","Target subscriber attribute value").option("--attribute-previous-value <value>","Previous subscriber attribute value").option("--event-property-name <name>","Optional event property whose value is tracked").option("--event-property-label <label>","Display label for the tracked event property").option("--attribution-window-hours <hours>","Goal attribution window in hours")}var qR=J6.command("goals").description("Manage persisted sequence conversion goals");qR.command("list <sequenceId>").description("List sequence goals").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((A,x)=>E9("goals",{id:A,...x}));fg0(qR.command("create <sequenceId> <name>").description("Create a sequence conversion goal")).option("--active","Create the goal with conversion tracking on (default)").option("--inactive","Create the goal with conversion tracking off").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((A,x,E)=>E9("goal-create",{id:A,name:x,isActive:E.active,notActive:E.inactive,...E}));fg0(qR.command("update <sequenceId> <goalId>").description("Update a sequence conversion goal").option("--name <name>","Goal name")).option("--active","Enable the goal").option("--inactive","Disable the goal").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((A,x,E)=>E9("goal-update",{id:A,goalId:x,isActive:E.active,notActive:E.inactive,...E}));qR.command("delete <sequenceId> <goalId>").description("Delete a sequence conversion goal").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((A,x,E)=>E9("goal-delete",{id:A,goalId:x,...E}));var uk=J6.command("webhook").description("Manage a sequence inbound webhook endpoint");uk.command("get <sequenceId>").description("Read a sequence inbound webhook URL and setup status").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((A,x)=>E9("webhook-get",{id:A,...x}));uk.command("configure <sequenceId>").description("Create or update a sequence inbound webhook endpoint").option("--field-mapping-json <json>","Inline mapping with email, optional names, and property paths").option("--field-mapping-file <file>","JSON file containing the webhook field mapping").option("--sample-payload-json <json>","Inline representative webhook payload").option("--sample-payload-file <file>","JSON file containing a representative webhook payload").option("--clear-field-mapping","Clear the saved mapping and return the endpoint to pending setup").option("--clear-sample-payload","Clear the saved sample payload").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((A,x)=>E9("webhook-configure",{id:A,...x}));uk.command("rotate <sequenceId>").description("Rotate a sequence inbound webhook secret and URL").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((A,x)=>E9("webhook-rotate",{id:A,...x}));var c0A=J6.command("create <name>").description("Create a blank, AI-generated, or explicit-step sequence").option("-t, --trigger <trigger>","Sequence trigger type (defaults to contact_added)").option("--description <text>","Sequence description").option("--label <labels...>","Dashboard label names to assign").option("--user-cancellable","Allow subscribers to cancel enrollment").option("--not-user-cancellable","Prevent subscribers from cancelling enrollment").option("--from-email <email>","Sequence-level From address").option("--from-name <name>","Display name for --from-email").option("--sender-profile-id <id>","Existing sender profile ID").option("--reply-to <email>","Sequence-level Reply-To address").option("--reply-to-name <name>","Display name for --reply-to").option("--reply-profile-id <id>","Existing reply profile ID").option("--bcc-emails <emails>","Comma-separated sequence-level BCC addresses (max 10)").option("-g, --goal <goal>","AI generation goal for the sequence").option("--email-count <count>","Number of AI-generated emails when using --goal (1-10)").option("--duration-days <days>","Total duration in days for AI-generated sequence delays when using --goal").option("--email-style <style>","Style for AI-generated emails when using --goal: visual (designed) or plain (text-first)").option("--enrollment-mode <mode>","Enrollment mode: unlimited, one_time, or matching_field").option("--enrollment-field-path <path>","Event property dot path used by matching_field enrollment").option("--sending-window-start <time>","Earliest local send time for sequence emails (HH:mm, e.g. 08:00)").option("--sending-window-end <time>","Latest local send cutoff for sequence emails (HH:mm, e.g. 20:00)").option("--sending-window-timezone <timezone>","IANA timezone for the sequence sending window, e.g. Europe/Kiev").option("--sending-window-days <days>","Comma-separated days for sequence sends, e.g. weekdays or mon,tue,wed,thu,fri").option("--list-id <id>","List ID for contact_added triggers").option("--tag-name <name>","Tag name for tag_added triggers").option("--segment-id <id>","Segment ID for segment_entered triggers").option("--stop-on-segment-exit","Cancel active enrollments when a contact leaves the trigger segment").option("--event-name <name>","Event name for event_received, inbound_webhook, inactivity, and frequency triggers").option("--integration-slug <slug>","Inbound webhook integration slug").option("--integration-event-key <key>","Inbound webhook integration event key").option("--custom-integration-json <json>","Inline custom inbound webhook integration descriptor").option("--custom-integration-file <file>","JSON file with a custom inbound webhook integration descriptor").option("--property-filters-json <json>","Inline JSON array of event property filters for event_received triggers").option("--property-filters-file <file>","Path to a JSON file with event property filters").option("--inactive-days <days>","Days of inactivity for inactivity triggers").option("--inactivity-baseline <baseline>","Inactivity baseline: sequence_created_at or subscriber_created_at").option("--min-count <count>","Minimum event count for frequency triggers").option("--time-window-days <days>","Time window for frequency triggers").option("--steps-json <json>","Inline JSON array of sequence steps").option("--steps-file <file>","Path to a JSON file with sequence steps").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("create",{name:A,...x}));X0(c0A,{notes:["Provide --goal for AI generation, --steps-json/--steps-file for explicit content, or omit both for a blank dashboard-compatible draft.","Each explicit email step needs subject plus either html or blocks. Discount action steps use type=create_discount to dynamically create a code before an email that references {{discount.code}}.",'SMS steps use type="sms" with a plain-text "text" field (optional label, ineligibleAction skip|exit, imageUrls). Generate copy with `sequenzy generate sms` and check `sequenzy sms settings` first.','Update Subscriber steps use type="update_subscriber", nodeType="action_update_attributes", and config values such as {{event.plan}}, {{event.amount}}, or {{event.active}}.',"For migrated provider flows, put the exact provider HTML in each step's html field; Sequenzy stores it as raw HTML. Use delay or delayMs for waits.","Prefer --steps-file for anything non-trivial. The CLI passes the JSON through to the API.","Shopify replenishment and back-in-stock event sequences default to matching_field.","Use --enrollment-field-path for custom event keys such as order.id or product.providerVariantId.","Use --property-filters-json/--property-filters-file with event_received triggers to only start the sequence when the event properties match, e.g. scope a purchase sequence to one product.","Use --sending-window-start/--sending-window-end/--sending-window-timezone to hold every email step until the allowed local send window. Add --sending-window-days weekdays for working days only.","Discount action sequences require the selected provider integration, such as Stripe or Shopify, before enabling."],examples:['sequenzy sequences create onboarding --trigger event_received --event-name signup.completed --goal "Guide new users to activation" --email-count 4 --duration-days 10','sequenzy sequences create trial --trigger tag_added --tag-name trial --goal "Convert trial users" --sending-window-start 08:00 --sending-window-end 20:00 --sending-window-timezone Europe/Kiev --sending-window-days weekdays',"sequenzy sequences create restock --trigger event_received --event-name ecommerce.back_in_stock --enrollment-mode matching_field --steps-file ./steps.json",`sequenzy sequences create deliver-ebook --trigger event_received --event-name ecommerce.order_placed --property-filters-json '[{"path":"lineItems[].providerProductId","operator":"equals","value":"prod_123"}]' --steps-file ./steps.json`,"sequenzy sequences create post-purchase --trigger event_received --event-name ecommerce.order_placed --enrollment-mode matching_field --enrollment-field-path order.id --steps-file ./steps.json","sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json",`sequenzy sequences create purchase-profile --trigger event_received --event-name saas.purchase --steps-json '[{"type":"update_subscriber","nodeType":"action_update_attributes","config":{"customAttributeUpdates":[{"name":"plan","value":"{{event.plan}}","valueType":"text"}]}},{"subject":"Thanks","html":"<p>Purchase received.</p>"}]'`,"sequenzy sequences create rescue --trigger inactivity --event-name login --inactive-days 14 --steps-file ./steps.json"]});var p0A=J6.command("update <id>").description("Update sequence metadata, email step content, stop conditions, or paths").option("-n, --name <name>","Sequence name").option("--description <text>","Sequence description").option("--label <labels...>","Replace dashboard label names").option("--clear-labels","Remove all dashboard labels from the sequence").option("--user-cancellable","Allow subscribers to cancel enrollment").option("--not-user-cancellable","Prevent subscribers from cancelling enrollment").option("--trigger <trigger>","Replace the sequence trigger type").option("--list-id <id>","List ID for contact_added").option("--tag-name <name>","Tag name for tag_added").option("--segment-id <id>","Segment ID for segment_entered").option("--stop-on-segment-exit","Stop active enrollments when a contact leaves the trigger segment").option("--no-stop-on-segment-exit","Keep active enrollments running when a contact leaves the trigger segment").option("--event-name <event>","Event name for event, webhook, inactivity, or frequency triggers").option("--integration-slug <slug>","Catalog integration slug for inbound_webhook").option("--integration-event-key <key>","Catalog event key for inbound_webhook").option("--custom-integration-json <json>","Inline custom inbound webhook integration descriptor").option("--custom-integration-file <file>","JSON file containing a custom inbound webhook integration descriptor").option("--property-filters-json <json>","Inline event trigger property filters").option("--property-filters-file <file>","JSON file containing event trigger property filters").option("--inactive-days <days>","Days required for inactivity").option("--inactivity-baseline <baseline>","Inactivity baseline: sequence_created_at or subscriber_created_at").option("--min-count <count>","Minimum frequency event count").option("--time-window-days <days>","Frequency lookback window").option("--from-email <email>","Sequence-level From address").option("--from-name <name>","Display name for --from-email").option("--sender-profile-id <id>","Existing sender profile ID").option("--reply-to <email>","Sequence-level Reply-To address").option("--reply-to-name <name>","Display name for --reply-to").option("--reply-profile-id <id>","Existing reply profile ID").option("--enrollment-mode <mode>","Enrollment mode: unlimited, one_time, or matching_field").option("--enrollment-field-path <path>","Event property dot path used by matching_field enrollment").option("--pause-new-enrollments","Stop new sequence enrollments while current recipients continue").option("--resume-new-enrollments","Resume new sequence enrollments while current recipients continue").option("--sending-window-start <time>","Earliest local send time for sequence emails (HH:mm, e.g. 08:00)").option("--sending-window-end <time>","Latest local send cutoff for sequence emails (HH:mm, e.g. 20:00)").option("--sending-window-timezone <timezone>","IANA timezone for the sequence sending window, e.g. Europe/Kiev").option("--sending-window-days <days>","Comma-separated days for sequence sends, e.g. weekdays or mon,tue,wed,thu,fri").option("--clear-sending-window","Disable the sequence sending window").option("--bcc-emails <emails>","Comma-separated BCC addresses copied on every email this sequence sends, e.g. a support inbox (max 10)").option("--clear-bcc-emails","Remove the sequence BCC addresses").option("--confirm-structural-change","Confirm an insertSteps or branch structural edit to an active sequence").option("--confirm-live-change","Confirm node config edits to an active sequence").option("--steps-json <json>","Inline JSON array of step updates").option("--steps-file <file>","Path to a JSON file with step updates").option("--emails-json <json>","Inline JSON array of email updates; native-block emails, including supported custom HTML blocks, may set emailPreset to branded or minimal").option("--emails-file <file>","Path to a JSON file with email updates; native-block emails, including supported custom HTML blocks, may set emailPreset to branded or minimal").option("--sms-steps-json <json>","Inline JSON array of SMS step content updates (targeted by nodeId)").option("--sms-steps-file <file>","Path to a JSON file with SMS step content updates").option("--subscriber-update-steps-json <json>","Inline JSON array of Update Subscriber configs targeted by nodeId").option("--subscriber-update-steps-file <file>","Path to a JSON file with Update Subscriber configs targeted by nodeId").option("--branch-json <json>","Inline JSON object for inserting an if/else branch with path steps and/or existing target node IDs").option("--branch-file <file>","Path to a JSON file for inserting an if/else branch with path steps and/or existing target node IDs").option("--insert-steps-json <json>","Inline JSON object for inserting new linear steps").option("--insert-steps-file <file>","Path to a JSON file for inserting new linear steps").option("--node-updates-json <json>","Inline typed nodeUpdates array from sequences get").option("--node-updates-file <file>","JSON file containing typed nodeUpdates").option("--graph-edit-json <json>","Inline graphEdit object using the current graphRevision").option("--graph-edit-file <file>","JSON file containing a graphEdit operation").option("--stop-condition-json <json>","Inline JSON object for updating the sequence stop condition").option("--stop-condition-file <file>","Path to a JSON file for updating the sequence stop condition").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("update",{id:A,...x}));X0(p0A,{notes:["Use either the steps form or the emails form, not both.","Each update entry can target a step by nodeId, emailId, or by array order.","Use --insert-steps-json/--insert-steps-file to add new linear steps, including outbound webhooks; use --steps-* or --emails-* to edit existing email steps.",'Inserted steps can be SMS steps: {"type":"sms","text":"...","delay":{"days":1}}. Generate copy with `sequenzy generate sms`.','Edit existing SMS steps with --sms-steps-json/--sms-steps-file: [{"nodeId":"node_sms","text":"New message"}]. Entries may also update label and ineligibleAction.','Edit existing Update Subscriber steps with --subscriber-update-steps-json/--subscriber-update-steps-file: [{"nodeId":"node_update","config":{"customAttributeUpdates":[{"name":"plan","value":"{{event.plan}}","valueType":"text"}]}}].',"For migrated provider flow steps, use html/htmlContent to preserve exact HTML as raw HTML and use delay or delayMs for waits.","When inserting steps or branches into an active sequence, pass --confirm-structural-change after confirming the live-flow impact.",'Use --stop-condition-json/--stop-condition-file with values like {"type":"has_tag","value":"customer"}; use {"type":"none","value":null} to clear it.',"Branch condition types include has_tag, does_not_have_tag, in_list, in_segment, event_received, link_clicked, and field_* comparisons. Use activityScope (this_sequence, previous_email, ever) for event and click checks.","Branch paths may set targetNodeId and elseTargetNodeId to wire directly to existing nodes from sequences get, including the completion node. If path steps are also provided, they run before that target.","Use --clear-sending-window to remove a configured send window.","Use --bcc-emails with a comma-separated list to blind-copy team inboxes on every sequence email; use --clear-bcc-emails to remove them."],examples:['sequenzy sequences update seq_123 --name "User Onboarding"',"sequenzy sequences update seq_123 --pause-new-enrollments","sequenzy sequences update seq_123 --resume-new-enrollments","sequenzy sequences update seq_123 --enrollment-mode matching_field","sequenzy sequences update seq_123 --enrollment-field-path order.id","sequenzy sequences update seq_123 --sending-window-start 08:00 --sending-window-end 20:00 --sending-window-timezone Europe/Kiev --sending-window-days weekdays","sequenzy sequences update seq_123 --clear-sending-window",'sequenzy sequences update seq_123 --bcc-emails "cs-team@yourcompany.com, founder@yourcompany.com"',"sequenzy sequences update seq_123 --clear-bcc-emails","sequenzy sequences update seq_123 --steps-file ./sequence-updates.json",`sequenzy sequences update seq_123 --stop-condition-json '{"type":"has_tag","value":"customer"}'`,`sequenzy sequences update seq_123 --insert-steps-json '{"afterNodeId":"node_email","steps":[{"delay":{"days":1},"subject":"Migration check-in","html":"<p>Need help migrating?</p>"}]}' --confirm-structural-change`,`sequenzy sequences update seq_123 --insert-steps-json '{"afterNodeId":"node_email","steps":[{"nodeType":"logic_wait_for_event","config":{"label":"Wait for reply","eventName":"email.replied","timeoutDays":5,"timeoutAction":"continue"}}]}'`,`sequenzy sequences update seq_123 --branch-json '{"afterNodeId":"node_email","branches":[{"conditionType":"link_clicked","linkUrl":"project-invites","activityScope":"previous_email","steps":[{"subject":"Invite accepted","html":"<p>Thanks for accepting.</p>"}]}],"elseSteps":[{"subject":"Reminder","html":"<p>Please accept your invite.</p>"}]}'`,`sequenzy sequences update seq_123 --branch-json '{"afterNodeId":"node_email_1","branches":[{"id":"replied","conditionType":"event_received","eventName":"email.replied","activityScope":"this_sequence","targetNodeId":"node_complete"}],"elseTargetNodeId":"node_email_2"}'`,"sequenzy sequences update seq_123 --branch-file ./branch.json",`sequenzy sequences update seq_123 --sms-steps-json '[{"nodeId":"node_sms","text":"Hey {{FIRST_NAME}}, your order shipped!"}]'`,`sequenzy sequences update seq_123 --subscriber-update-steps-json '[{"nodeId":"node_update","config":{"customAttributeUpdates":[{"name":"mrr","value":"{{event.amount}}","valueType":"number"}]}}]'`]});var r0A=J6.command("enable <id>").description("Enable a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("enable",{id:A,...x}));X0(r0A,{examples:["sequenzy sequences enable seq_123"]});var _0A=J6.command("disable <id>").description("Disable a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("disable",{id:A,...x}));X0(_0A,{examples:["sequenzy sequences disable seq_123"]});var n0A=J6.command("duplicate <id>").description("Create an independent draft copy of a sequence").option("-n, --name <name>","Name for the copied sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("duplicate",{id:A,...x}));X0(n0A,{notes:["Email templates, graph topology, and sequence A/B tests are copied independently."],examples:["sequenzy sequences duplicate seq_123",'sequenzy sequences duplicate seq_123 --name "Welcome Series v2"']});var l0A=J6.command("archive <id>").description("Archive a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("archive",{id:A,...x}));X0(l0A,{examples:["sequenzy sequences archive seq_123"]});var d0A=J6.command("unarchive <id>").description("Restore an archived sequence as a draft").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("unarchive",{id:A,...x}));X0(d0A,{examples:["sequenzy sequences unarchive seq_123"]});var a0A=J6.command("pause-enrollments <id>").description("Stop new enrollments while current sequence recipients continue").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("pause-enrollments",{id:A,...x}));X0(a0A,{notes:["The sequence must already be active. Existing active and waiting recipients keep moving through the sequence.","Use sequences disable when you want to freeze current recipients too."],examples:["sequenzy sequences pause-enrollments seq_123"]});var s0A=J6.command("resume-enrollments <id>").description("Resume new enrollments for an active sequence without changing current recipients").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("resume-enrollments",{id:A,...x}));X0(s0A,{notes:["The sequence must already be active. Use sequences enable to resume a fully disabled sequence."],examples:["sequenzy sequences resume-enrollments seq_123"]});var o0A=J6.command("enroll <id>").description("Manually enroll subscribers in a sequence").option("-e, --email <emails...>","Email addresses to enroll").option("--subscriber-ids <ids...>","Subscriber IDs to enroll").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--target-node-id <nodeId>","Sequence node to enroll at; defaults to the first step after the trigger").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("enroll",{id:A,...x}));X0(o0A,{notes:["Provide at least one target using --subscriber-ids or exactly one email source: --email, --emails-json, or --emails-file.","Subscribers must be active; unknown emails are reported as not found and inactive, unavailable, or already enrolled subscribers are skipped.","Enrollment requires the sequence to be accepting entrants (enabled and not paused for enrollment)."],examples:["sequenzy sequences enroll seq_123 --email one@example.com two@example.com","sequenzy sequences enroll seq_123 --subscriber-ids sub_123 sub_456 --target-node-id node_email_2","sequenzy sequences enroll seq_123 --emails-file ./vips.csv","sequenzy sequences enroll seq_123 --email one@example.com --target-node-id node_email_2"]});var t0A=J6.command("cancel-enrollments <id>").description("Cancel active or waiting subscriber enrollments in a sequence").option("--subscriber-id <id>","Cancel enrollments for one subscriber ID").option("--field-path <path>","Entry event property dot path to match, such as order.id").option("--field-values <values>","Comma-separated entry field values to match").option("--reason <reason>","Reason stored on cancelled enrollments").option("--apply","Actually cancel matches; otherwise only dry-run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("cancel-enrollments",{id:A,...x}));X0(t0A,{notes:["sequenceId is always required. Provide exactly one target: --subscriber-id or --field-values.","Without --apply, this command only reports matching enrollments.","When --field-path is omitted, the API uses the sequence enrollmentFieldPath if configured."],examples:["sequenzy sequences cancel-enrollments seq_123 --subscriber-id sub_123 --apply","sequenzy sequences cancel-enrollments seq_123 --field-path order.id --field-values ord_123,ord_456"]});var e0A=J6.command("delete <id>").description("Delete a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("delete",{id:A,...x}));X0(e0A,{examples:["sequenzy sequences delete seq_123"]});var C2=A8.command("ab-tests").description("Inspect and edit A/B test variants").action(()=>C2.help());X0(C2,{notes:["Use get to discover variant IDs, then update-variant to edit a specific A/B variant.","Only draft A/B tests can be edited.","create, add-variant, and delete-variant work on campaign and sequence A/B tests; delete works on campaign A/B tests only."],examples:["sequenzy ab-tests list --sequence seq_123","sequenzy ab-tests get ab_123","sequenzy ab-tests stats ab_123 --period 7d","sequenzy ab-tests create camp_123 --test-percentage 20 --winner-criteria open_rate",'sequenzy ab-tests add-variant ab_123 --subject "Alternative subject"',"sequenzy ab-tests restart ab_123 --source-variant var_b",'sequenzy ab-tests update-variant ab_123 var_b --subject "New subject"',"sequenzy ab-tests update-variant ab_123 var_b --blocks-file ./variant-b.json"]});var AAA=C2.command("list").description("List A/B tests").option("--sequence <id>","Filter by sequence ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>p2("list",A));X0(AAA,{examples:["sequenzy ab-tests list --sequence seq_123"]});var xAA=C2.command("get <id>").description("Get A/B test details and variants").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>p2("get",{id:A,...x}));X0(xAA,{examples:["sequenzy ab-tests get ab_123"]});var EAA=C2.command("stats <id>").description("Get A/B test variant stats").option("-p, --period <period>","Time period (1h, 24h, 7d, 30d, 90d)").option("--start <iso>","Custom range start as ISO 8601").option("--end <iso>","Custom range end as ISO 8601").option("--include-bots","Include machine-classified bot/scanner opens and clicks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>p2("stats",{id:A,...x}));X0(EAA,{notes:["Use --period or both --start and --end. Custom ranges max at 90 days.","Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement."],examples:["sequenzy ab-tests stats ab_123","sequenzy ab-tests stats ab_123 --period 30d","sequenzy ab-tests stats ab_123 --include-bots"]});var BAA=C2.command("restart <id>").description("Run another sequence A/B test from an existing variant").option("--source-variant <id>","Variant to use as the new control. Defaults to the selected winner.").option("--test-type <type>","Test type for generated variants: subject or content").option("--winner-threshold <count>","Subscribers before selecting a winner (10-1000)").option("--variant-count <count>","Total variants including control (2-4)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>p2("restart",{id:A,...x}));X0(BAA,{notes:["Only sequence A/B tests with a selected winner can be restarted.","Run `sequenzy ab-tests get <id>` first to find variant IDs."],examples:["sequenzy ab-tests restart ab_123","sequenzy ab-tests restart ab_123 --source-variant var_b --test-type content --variant-count 3"]});var gAA=C2.command("update-variant <id> <variantId>").description("Update a draft A/B test variant").option("-s, --subject <subject>","Variant subject").option("--preview-text <text>","Variant preview text").option("--html <html>","Replacement HTML body").option("--html-file <file>","Read replacement HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--confirm-live-change","Confirm updating a variant used by an active sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x,E)=>p2("update-variant",{id:A,variantId:x,...E}));X0(gAA,{notes:["Provide either HTML or blocks, not both.","Use --confirm-live-change when the variant belongs to an active sequence.","Run `sequenzy ab-tests get <id>` first to find variant IDs."],examples:['sequenzy ab-tests update-variant ab_123 var_b --subject "New subject"',"sequenzy ab-tests update-variant ab_123 var_b --html-file ./variant-b.html"]});var QAA=C2.command("create [campaignId]").description("Create a campaign or sequence-node A/B test").option("--automation-node <nodeId>","Convert this sequence email node into an A/B test node").option("--confirm-live-change","Confirm conversion of an email node in an active sequence").option("-n, --name <name>","A/B test name").option("--test-percentage <percent>","Share of the audience used for testing (5-50, default 20)").option("--duration-minutes <minutes>","Test duration before a winner is selected (15-1440, default 240)").option("--winner-criteria <criteria>","Winner criteria: open_rate or click_rate (default open_rate)").option("--test-type <type>","Sequence test type: subject or content (default content)").option("--winner-threshold <count>","Sequence test sample size (10-1000, default 100)").option("--variants-json <json>","Inline JSON array of extra variants ({subject, previewText?, blocks?})").option("--variants-file <file>","Path to a JSON file with extra variants ({subject, previewText?, blocks?})").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>p2("create",{campaignId:A,automationNodeId:x.automationNode,...x}));X0(QAA,{notes:["Provide either a campaign ID or --automation-node, but not both.","Campaigns must be in draft or rejected status. Sequence node IDs must reference an email node.","Variant A is created automatically from the campaign email; provided variants are added after it."],examples:["sequenzy ab-tests create camp_123",`sequenzy ab-tests create --automation-node node_123 --test-type content --winner-threshold 100 --variants-json '[{"subject":"Variant B"}]'`,"sequenzy ab-tests create camp_123 --test-percentage 30 --duration-minutes 120 --winner-criteria click_rate",`sequenzy ab-tests create camp_123 --variants-json '[{"subject":"Alternative subject"}]'`]});var DAA=C2.command("add-variant <id>").description("Add a variant to a draft campaign or sequence A/B test").requiredOption("-s, --subject <subject>","Variant subject").option("--preview-text <text>","Variant preview text").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--confirm-live-change","Confirm adding a variant to an A/B test in an active sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>p2("add-variant",{id:A,...x}));X0(DAA,{notes:["Variants can only be added while the A/B test is in draft status.","A/B tests in an active sequence require --confirm-live-change."],examples:['sequenzy ab-tests add-variant ab_123 --subject "Alternative subject"','sequenzy ab-tests add-variant ab_123 --subject "Alternative subject" --blocks-file ./variant.json']});var CAA=C2.command("delete-variant <id> <variantId>").description("Remove a variant from a draft campaign or sequence A/B test").option("-y, --yes","Skip the confirmation prompt").option("--confirm-live-change","Confirm deleting a variant from an A/B test in an active sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x,E)=>p2("delete-variant",{id:A,variantId:x,...E}));X0(CAA,{notes:["Variant A is the control variant and cannot be deleted.","Variants can only be removed while the A/B test is in draft status.","A/B tests in an active sequence require --confirm-live-change."],examples:["sequenzy ab-tests delete-variant ab_123 var_b --yes"]});var FAA=C2.command("delete <id>").description("Delete a campaign A/B test").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>p2("delete",{id:A,...x}));X0(FAA,{notes:["Running A/B tests cannot be deleted; the linked campaign must be draft or rejected."],examples:["sequenzy ab-tests delete ab_123 --yes"]});var vD=A8.command("templates").description("Manage email templates").action(()=>vD.help());X0(vD,{notes:["Template content can be provided as raw HTML or as Sequenzy blocks JSON.","Templates can be assigned labels and listed by label for integration dashboards.","Use blocks when you need conditional content, per-block styles, or an exact editor-compatible structure.",HR],examples:["sequenzy templates list --company comp_123","sequenzy templates list --label edm --company comp_123",'sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --label edm template --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --blocks-file ./welcome-blocks.json','sequenzy templates update tmpl_123 --subject "Updated" --html-file ./welcome-v2.html','sequenzy templates localizations set tmpl_123 es --subject "Hola" --html-file ./welcome-es.html',"sequenzy templates localizations sync tmpl_123 --locale es fr"]});var IAA=vD.command("list").description("List all templates").option("--label <labels...>","Filter by label name").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>ND("list",A));X0(IAA,{examples:["sequenzy templates list --company comp_123","sequenzy templates list --label edm --company comp_123"]});var wAA=vD.command("get <id>").description("Get template details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>ND("get",{id:A,...x}));X0(wAA,{examples:["sequenzy templates get tmpl_123 --company comp_123"]});var JAA=vD.command("create <name>").description("Create a template").option("-s, --subject <subject>","Email subject (optional with --prompt)").option("--preview-text <text>","Email preview text override").option("--prompt <prompt>","Generate branded native blocks from a prompt").option("--style <style>","Prompt generation style").option("--tone <tone>","Prompt generation tone").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--label <labels...>","Label names to assign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>ND("create",{name:A,...x}));X0(JAA,{notes:["Provide exactly one of prompt, HTML, or blocks JSON content.","Use blocks when you need conditional content, per-block styles, or exact editor parity."],examples:['sequenzy templates create welcome --prompt "Welcome new customers"','sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --label edm template --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --blocks-file ./welcome-blocks.json']});var fAA=vD.command("update <id>").description("Update a template").option("-n, --name <name>","Template name").option("-s, --subject <subject>","Email subject").option("--preview-text <text>","Inbox preview text").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--label <labels...>","Replace label names").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>ND("update",{id:A,...x}));X0(fAA,{notes:["Provide at least one of --name, --subject, --preview-text, --label, --html, --html-file, --blocks-json, or --blocks-file.","Do not combine HTML flags with blocks flags in the same request."],examples:['sequenzy templates update tmpl_123 --subject "Updated"','sequenzy templates update tmpl_123 --preview-text "A warmer inbox preview"',"sequenzy templates update tmpl_123 --label edm template","sequenzy templates update tmpl_123 --html-file ./welcome-v2.html","sequenzy templates update tmpl_123 --blocks-file ./welcome-v2-blocks.json"]});var YR=vD.command("localizations").description("Manage localized template variants").action(()=>YR.help());X0(YR,{notes:["Set stores caller-supplied localized content immediately.","Sync queues AI translation for selected locales, or every enabled non-primary locale when --locale is omitted."],examples:['sequenzy templates localizations set tmpl_123 es --subject "Hola" --html-file ./welcome-es.html',"sequenzy templates localizations sync tmpl_123 --locale es fr","sequenzy templates localizations sync tmpl_123"]});var KAA=YR.command("set <id> <locale>").description("Create or replace a localized template variant").requiredOption("-s, --subject <subject>","Localized email subject").option("--preview-text <text>","Localized email preview text").option("--html <html>","Localized email HTML content").option("--html-file <file>","Read localized HTML from file").option("--blocks-json <json>","Inline JSON array of localized Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with localized Sequenzy email blocks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x,E)=>ND("set-localization",{id:A,locale:x,...E}));X0(KAA,{notes:["The locale must be enabled in the company's localization settings and cannot be the primary locale.","Provide exactly one HTML or blocks content source."],examples:['sequenzy templates localizations set tmpl_123 es --subject "Hola" --html-file ./welcome-es.html','sequenzy templates localizations set tmpl_123 fr-CA --subject "Bienvenue" --blocks-file ./welcome-fr-ca.json']});var $AA=YR.command("sync <id>").description("Queue AI translation for template locales").option("--locale <locales...>","Enabled locales to sync; omit to sync every non-primary locale").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>ND("sync-localizations",{id:A,locales:x.locale,company:x.company,json:x.json}));X0($AA,{examples:["sequenzy templates localizations sync tmpl_123 --locale es fr","sequenzy templates localizations sync tmpl_123"]});var HAA=vD.command("delete <id>").description("Delete a template").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>ND("delete",{id:A,...x}));X0(HAA,{notes:["Deletion fails when the template is still referenced by a campaign or sequence."],examples:["sequenzy templates delete tmpl_123"]});var XJ=A8.command("companies").description("Inspect or create companies").action(()=>XJ.help());X0(XJ,{notes:["Company creation starts background website processing automatically."],examples:["sequenzy companies list","sequenzy companies get comp_123","sequenzy companies update comp_123 --primary-color '#0ea5e9'","sequenzy companies create example.com --name Example"]});var yAA=XJ.command("list").description("List accessible companies").option("--json","Print raw JSON").action((A)=>cH("list",A));X0(yAA,{examples:["sequenzy companies list"]});var qAA=XJ.command("get <id>").description("Get company details").option("--json","Print raw JSON").action((A,x)=>cH("get",{id:A,...x}));X0(qAA,{examples:["sequenzy companies get comp_123"]});var YAA=XJ.command("update <id>").description("Update company info, brand context, and reply tracking").option("-n, --name <name>","Company display name").option("--description <text>","Short product or company summary").option("--description-file <path>","Read description from a file").option("--logo-url <url>","Public logo URL").option("--founder-name <name>","Founder or sender name").option("--primary-color <hex>","Primary brand color, e.g. #f97316").option("--brand-colors-json <json>","Brand colors object as JSON").option("--brand-colors-file <path>","Read brand colors JSON from a file").option("--value-props-json <json>","Value propositions array as JSON").option("--value-props-file <path>","Read value propositions JSON from a file").option("--testimonials-json <json>","Testimonials array as JSON").option("--testimonials-file <path>","Read testimonials JSON from a file").option("--tone-voice <text>","Tone of voice guidance").option("--company-context <text>","Product knowledge for AI writing").option("--company-context-file <path>","Read product knowledge from a file").option("--email-length-preference <value>","Email length: concise, balanced, or detailed").option("--social-links-json <json>","Social links object as JSON").option("--social-links-file <path>","Read social links JSON from a file").option("--privacy-policy-url <url>","Privacy policy URL").option("--terms-url <url>","Terms of service URL").option("--address <address>","Physical mailing address").option("--language <code>","Primary language code").option("--pricing-json <json>","Pricing object as JSON").option("--pricing-file <path>","Read pricing JSON from a file").option("--font-family <family>","Default email font family").option("--email-theme-json <json>","Default email theme as JSON (partial: presetId, colors, typography, layout; pass null to reset)").option("--email-theme-file <path>","Read the default email theme JSON from a file").option("--email-direction <direction>","Default email direction: ltr or rtl").option("--enable-reply-tracking","Enable inbound reply tracking").option("--disable-reply-tracking","Disable inbound reply tracking").option("--reply-tracking-domain-mode <mode>","Reply domain mode: sequenzy or custom").option("--enable-reply-forwarding","Enable captured reply forwarding").option("--disable-reply-forwarding","Disable captured reply forwarding").option("--json","Print raw JSON").action((A,x)=>cH("update",{id:A,...x}));X0(YAA,{examples:["sequenzy companies update comp_123 --primary-color '#0ea5e9'",`sequenzy companies update comp_123 --email-theme-json '{"colors":{"mutedText":"#4b5563"},"typography":{"baseFontSize":16}}'`,"sequenzy companies update comp_123 --company-context-file ./product.md --tone-voice 'clear, direct, warm'","sequenzy companies update comp_123 --enable-reply-tracking --reply-tracking-domain-mode sequenzy",`sequenzy companies update comp_123 --value-props-json '[{"title":"Fast setup","description":"Launch lifecycle emails in minutes."}]'`]});var XAA=XJ.command("create <domain>").description("Create a company and queue website processing").option("-n, --name <name>","Company name").option("--json","Print raw JSON").action((A,x)=>cH("create",{domain:A,...x}));X0(XAA,{examples:["sequenzy companies create example.com","sequenzy companies create https://example.com --name Example"]});var zy=A8.command("tags").description("Manage tag definitions").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>YJ("list",A));X0(zy,{notes:["Running `sequenzy tags` without a subcommand lists tag definitions.","Tag names are normalized to lowercase with dashes; system tags cannot be changed or deleted."],examples:["sequenzy tags --company comp_123","sequenzy tags list","sequenzy tags create vip --color purple","sequenzy tags update tag_123 --color red","sequenzy tags delete tag_123 --yes"]});var ZAA=zy.command("list").description("List tag definitions").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>YJ("list",A));X0(ZAA,{examples:["sequenzy tags list --company comp_123"]});var UAA=zy.command("create <name>").description("Create a tag definition").option("--color <color>","Tag color, e.g. gray, red, green, blue, purple").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>YJ("create",{name:A,...x}));X0(UAA,{notes:["Names are normalized to lowercase with dashes, so `VIP Customer` becomes `vip-customer`."],examples:["sequenzy tags create vip","sequenzy tags create vip --color purple"]});var GAA=zy.command("update <tagId>").description("Update a tag definition color").requiredOption("--color <color>","New tag color").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>YJ("update",{tagId:A,...x}));X0(GAA,{notes:["System tags cannot be updated."],examples:["sequenzy tags update tag_123 --color red"]});var WAA=zy.command("delete <tagId>").description("Delete a tag definition").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>YJ("delete",{tagId:A,...x}));X0(WAA,{notes:["Deleting a tag removes it from every subscriber.","Tags used by sequences cannot be deleted until those sequences stop referencing them."],examples:["sequenzy tags delete tag_123 --yes"]});var bg=A8.command("lists").description("Manage subscriber lists").action(()=>bg.help());X0(bg,{examples:["sequenzy lists list --company comp_123",'sequenzy lists create Newsletter --description "Public newsletter list"','sequenzy lists update list_123 --name "Weekly Newsletter" --private',"sequenzy lists add-subscribers list_123 --emails-file ./batch-001.csv","sequenzy lists remove-subscribers list_123 --email one@example.com","sequenzy lists import list_123 --emails-file ./batch-001.csv","sequenzy lists delete list_123 --yes"]});var RAA=bg.command("list").description("List subscriber lists").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>UD("list",A));X0(RAA,{examples:["sequenzy lists list --company comp_123"]});var MAA=bg.command("create <name>").description("Create a subscriber list").option("-d, --description <text>","List description").option("--private","Mark the list as private").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UD("create",{name:A,...x}));X0(MAA,{examples:['sequenzy lists create Newsletter --description "Public newsletter list"',"sequenzy lists create VIP --private --company comp_123"]});var zAA=bg.command("add-subscribers <listId>").description("Add subscribers to a list from emails, JSON, or a file").option("-e, --email <emails...>","Email addresses to add").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--duplicate-strategy <strategy>","Duplicate strategy: skip, merge, or overwrite","skip").option("--enroll-sequences","Enroll newly created subscribers in matching sequences").option("--opt-in-mode <mode>","Consent mode: default, confirmed, or double_opt_in","default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UD("add-subscribers",{listId:A,...x}));X0(zAA,{notes:["Provide exactly one source: --email, --emails-json, or --emails-file.","Files may be newline-separated, CSV with an email column, a JSON email array, or a JSON object with emails/subscribers.","CSV headers named email, e-mail, email address, or mail are detected; otherwise the first column is used.","New subscribers are not enrolled in matching sequences unless --enroll-sequences is set."],examples:["sequenzy lists add-subscribers list_123 --email one@example.com two@example.com",`sequenzy lists add-subscribers list_123 --emails-json '["one@example.com","two@example.com"]'`,"sequenzy lists add-subscribers list_123 --emails-file ./batch-001.csv"]});var SAA=bg.command("import <listId>").description("Alias for add-subscribers; import subscribers into a list").option("-e, --email <emails...>","Email addresses to add").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--duplicate-strategy <strategy>","Duplicate strategy: skip, merge, or overwrite","skip").option("--enroll-sequences","Enroll newly created subscribers in matching sequences").option("--opt-in-mode <mode>","Consent mode: default, confirmed, or double_opt_in","default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UD("add-subscribers",{listId:A,...x}));X0(SAA,{notes:["`lists import` is an alias for `lists add-subscribers`.","Provide exactly one source: --email, --emails-json, or --emails-file.","Files may be newline-separated, CSV with an email column, a JSON email array, or a JSON object with emails/subscribers.","CSV headers named email, e-mail, email address, or mail are detected; otherwise the first column is used."],examples:["sequenzy lists import list_123 --emails-file ./batch-001.csv",`sequenzy lists import list_123 --emails-json '["one@example.com","two@example.com"]'`]});var LAA=bg.command("update <listId>").description("Update a subscriber list").option("-n, --name <name>","List name").option("-d, --description <text>","List description").option("--private","Mark the list as private").option("--no-private","Mark the list as public").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UD("update",{listId:A,...x}));X0(LAA,{notes:["Provide at least one of --name, --description, --private, or --no-private."],examples:['sequenzy lists update list_123 --name "Weekly Newsletter"',"sequenzy lists update list_123 --private","sequenzy lists update list_123 --no-private"]});var OAA=bg.command("remove-subscribers <listId>").description("Remove subscribers from a list by email").option("-e, --email <emails...>","Email addresses to remove").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UD("remove-subscribers",{listId:A,...x}));X0(OAA,{notes:["Provide exactly one source: --email, --emails-json, or --emails-file.","Subscribers are only removed from the list; they stay in your audience.","Emails that do not match a subscriber are reported as not found."],examples:["sequenzy lists remove-subscribers list_123 --email one@example.com two@example.com","sequenzy lists remove-subscribers list_123 --emails-file ./churned.csv"]});var jAA=bg.command("delete <listId>").description("Delete a subscriber list").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UD("delete",{listId:A,...x}));X0(jAA,{notes:["Deleting a list removes all of its memberships; subscribers themselves are kept."],examples:["sequenzy lists delete list_123 --yes"]});var aF=A8.command("segments").description("Manage segments").action(()=>aF.help());X0(aF,{notes:["Use --filter-json for arbitrary segment filters. The CLI will fill in missing filter IDs.","Use --match any to create a segment that matches any filter instead of all filters.",'Engagement filters (emailSent, emailOpened, emailClicked, emailBounced, emailComplained) accept either a time range as the value ("7d", "30d", "90d", "180d", "all") OR a specific campaign ("campaign:<campaign_id>"). Combine multiple engagement filters with --match all to build things like "bounced campaign A but not campaign B".'],examples:["sequenzy segments list --company comp_123",'sequenzy segments create --name "Bought Pro" --stripe-product prod_pro',`sequenzy segments create --name "VIP or Churn Risk" --match any --filter-json '[{"field":"tag","operator":"contains","value":"vip"},{"field":"emailOpened","operator":"is_not","value":"30d"}]'`,`sequenzy segments create --name "Bounced A not B" --filter-json '[{"field":"emailBounced","operator":"is","value":"campaign:cmp_abc"},{"field":"emailBounced","operator":"is_not","value":"campaign:cmp_xyz"}]'`]});var PAA=aF.command("list").description("List all segments").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>nw("list",A));X0(PAA,{examples:["sequenzy segments list --company comp_123"]});var NAA=aF.command("create").description("Create a segment").requiredOption("-n, --name <name>","Segment name").option("-c, --company <id>","Company ID override for personal API keys").option("--match <mode>","How filters combine: all or any","all").option("--stripe-product <id>","Stripe product ID to segment on").option("--commerce-product <id>","Commerce product to segment on, as provider:productId (e.g. shopify:42); a bare ID matches any provider").option("--purchase-operator <operator>","Purchase operator (bought, didnt-buy, at-least, less-than)","bought").option("--payments <number>","Payment threshold for at-least/less-than").option("--orders <number>","Order threshold for at-least/less-than with --commerce-product").option("--filter-json <json>","Raw JSON array of segment filters (IDs are optional)").option("--json","Print raw JSON").action((A)=>nw("create",A));X0(NAA,{examples:['sequenzy segments create --name "Bought Pro" --stripe-product prod_pro','sequenzy segments create --name "3+ Pro Payments" --stripe-product prod_pro --purchase-operator at-least --payments 3','sequenzy segments create --name "Starter Kit Buyers" --commerce-product api:prod-starter-kit','sequenzy segments create --name "Repeat Kit Buyers" --commerce-product api:prod-starter-kit --purchase-operator at-least --orders 2',`sequenzy segments create --name "VIP or Churn Risk" --match any --filter-json '[{"field":"tag","operator":"contains","value":"vip"},{"field":"emailOpened","operator":"is_not","value":"30d"}]'`,`sequenzy segments create --name "Bounced A not B" --filter-json '[{"field":"emailBounced","operator":"is","value":"campaign:cmp_abc"},{"field":"emailBounced","operator":"is_not","value":"campaign:cmp_xyz"}]'`]});var VAA=aF.command("count <id>").description("Get subscriber count for a segment").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>nw("count",{id:A,...x}));X0(VAA,{examples:["sequenzy segments count seg_123 --company comp_123"]});var vAA=aF.command("update <id>").description("Update a segment name, filters, or join operator").option("-n, --name <name>","Segment name").option("--filters-json <json>","Raw JSON array of segment filters, or an object with a root group").option("--filters-file <file>","Path to a JSON file with segment filters or a root group").option("--join-operator <operator>","How filters combine: and or or").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>nw("update",{id:A,...x}));X0(vAA,{notes:["Provide at least one of --name, --filters-json, --filters-file, or --join-operator.","Filters replace the existing filter set; missing filter IDs are filled in by the CLI."],examples:['sequenzy segments update seg_123 --name "Churn Risk"',`sequenzy segments update seg_123 --filters-json '[{"field":"tag","operator":"contains","value":"vip"}]'`,"sequenzy segments update seg_123 --join-operator or"]});var uAA=aF.command("delete <id>").description("Delete a segment").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>nw("delete",{id:A,...x}));X0(uAA,{examples:["sequenzy segments delete seg_123 --yes"]});var uD=A8.command("audience-syncs").description("Sync segments to Meta custom audiences").action(()=>uD.help());X0(uD,{notes:["Requires the Meta Ads integration to be connected in the dashboard (Settings -> Integrations).",'Use --template to start from a ready-made segment ("zero-ltv", "no-purchase-1y", "recent-buyers", "high-spenders-ecom", "non-buyers", "engaged"); the segment is created automatically on first use.',"Audiences are add-only: subscribers who leave the segment stay in the Meta audience."],examples:["sequenzy audience-syncs list",'sequenzy audience-syncs create --template recent-buyers --ad-account act_123 --name "Sequenzy - Recent buyers"']});var TAA=uD.command("list").description("List audience syncs with schedule and status").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>SF("list",A));X0(TAA,{examples:["sequenzy audience-syncs list --company comp_123"]});var hAA=uD.command("ad-accounts").description("List the connected Meta ad accounts").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>SF("ad-accounts",A));X0(hAA,{examples:["sequenzy audience-syncs ad-accounts"]});var bAA=uD.command("create").description("Create an audience sync (segment -> Meta custom audience)").option("--segment <id>","Existing segment ID to sync").option("--template <id>",'Predefined segment template (for example "recent-buyers", "zero-ltv", "no-purchase-1y")').requiredOption("--ad-account <id>","Meta ad account ID (see `sequenzy audience-syncs ad-accounts`)").requiredOption("-n, --name <name>","Audience name in Meta Ads Manager").option("--frequency <frequency>","Sync frequency: hourly, daily, or weekly","daily").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>SF("create",A));X0(bAA,{examples:['sequenzy audience-syncs create --template recent-buyers --ad-account act_123 --name "Sequenzy - Recent buyers"','sequenzy audience-syncs create --segment seg_123 --ad-account act_123 --name "Sequenzy - VIPs" --frequency hourly']});var kAA=uD.command("update <id>").description("Change an audience sync's frequency or pause/resume it").option("--frequency <frequency>","Sync frequency: hourly, daily, or weekly").option("--active <bool>","true to resume, false to pause").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>SF("update",{id:A,...x}));X0(kAA,{examples:["sequenzy audience-syncs update sync_123 --frequency weekly","sequenzy audience-syncs update sync_123 --active false"]});var iAA=uD.command("delete <id>").description("Remove an audience sync (the Meta audience itself is kept)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>SF("delete",{id:A,...x}));X0(iAA,{examples:["sequenzy audience-syncs delete sync_123"]});var mAA=uD.command("sync <id>").description("Trigger an immediate sync run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>SF("sync",{id:A,...x}));X0(mAA,{examples:["sequenzy audience-syncs sync sync_123"]});var TD=A8.command("products").description("Manage products and digital delivery files").action(()=>TD.help());X0(TD,{notes:["Products sync from Stripe, Shopify, and WooCommerce integrations.","Attach a deliverable file to a Stripe product, then reference it in purchase sequence emails with {{event.download.url}} and {{event.download.name}}."],examples:["sequenzy products list --provider stripe","sequenzy products sync",'sequenzy products upsert my-ebook --title "The Ebook" --price-cents 1900 --file ./ebook.pdf',"sequenzy products attach-file prod_abc --file ./guide.pdf","sequenzy products attach-file prod_abc --url https://example.com/guide.pdf --name guide.pdf","sequenzy products detach-file prod_abc","sequenzy products delete my-ebook"]});var cAA=TD.command("list").description("List synced products including attached delivery files").option("-c, --company <id>","Company ID override for personal API keys").option("--provider <provider>","Filter by provider (stripe, shopify, woocommerce, manual)").option("--search <query>","Filter products by title").option("--json","Print raw JSON").action((A)=>OF("list",A));X0(cAA,{examples:["sequenzy products list --provider stripe"]});var pAA=TD.command("sync").description("Queue a Stripe product catalog sync").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>OF("sync",A));X0(pAA,{examples:["sequenzy products sync --company comp_123"]});var rAA=TD.command("upsert [productId]").description("Create or update products in the catalog (Commerce API, keyed by your productId)").option("--title <title>","Product title (required for single upserts)").option("--description <text>","Product description").option("--price-cents <cents>","Price in the smallest currency unit").option("--currency <code>","ISO currency code, e.g. USD").option("--image-url <url>","Product image URL").option("--product-url <url>","Product page URL").option("--in-stock","Mark the product as in stock").option("--out-of-stock","Mark the product as out of stock").option("--file <path>","Deliverable file to upload and attach in one step").option("--url <link>","External deliverable http(s) link to attach in one step").option("--name <fileName>","Display name for the attached deliverable").option("--products-json <json>","Inline JSON array of products to upsert").option("--products-file <file>","Path to a JSON file with products to upsert").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>OF("upsert",x,A));X0(rAA,{notes:["Products are keyed by your own productId and stored under the api provider.","Combine --file or --url with a single-product upsert to attach the deliverable file in the same command.","Use --products-json/--products-file for bulk upserts of up to 100 products."],examples:['sequenzy products upsert my-ebook --title "The Ebook" --price-cents 1900 --currency USD --file ./ebook.pdf','sequenzy products upsert my-course --title "The Course" --url https://files.example.com/course.zip',"sequenzy products upsert --products-file ./products.json"]});var _AA=TD.command("delete <productId>").description("Delete a product previously pushed via the Commerce API").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>OF("delete",x,A));X0(_AA,{examples:["sequenzy products delete my-ebook"]});var nAA=TD.command("attach-file <id>").description("Attach the deliverable file buyers receive after purchase").option("--file <path>","Local file to upload (PDF, ePub, ZIP, media)").option("--url <link>","External http(s) link instead of an upload").option("--name <fileName>","Display name for the file (e.g. guide.pdf)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>OF("attach-file",x,A));X0(nAA,{examples:["sequenzy products attach-file prod_abc --file ./guide.pdf","sequenzy products attach-file prod_abc --url https://example.com/template.zip --name template.zip"]});var lAA=TD.command("detach-file <id>").description("Remove the attached delivery file from a product").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>OF("detach-file",x,A));X0(lAA,{examples:["sequenzy products detach-file prod_abc"]});var Sy=A8.command("team").description("Manage team members and invitations").action(()=>Sy.help());X0(Sy,{notes:["Inviting and cancelling invitations requires owner or admin access.","Billing access can only be granted by the company owner."],examples:["sequenzy team list","sequenzy team invite teammate@example.com --role admin","sequenzy team cancel-invitation inv_123"]});var dAA=Sy.command("list").description("List team members and pending invitations").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>fR("list",A));X0(dAA,{examples:["sequenzy team list --company comp_123"]});var aAA=Sy.command("invite <email>").description("Invite a team member or add an existing user").requiredOption("--role <role>","Member role: admin, viewer, or restricted").option("--billing-access","Allow the member to manage billing (owner only)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>fR("invite",{email:A,...x}));X0(aAA,{notes:["Existing Sequenzy users are added to the team immediately; everyone else receives an email invitation.","Invitations expire automatically and can be re-sent by inviting the same email again after cancelling."],examples:["sequenzy team invite teammate@example.com --role admin","sequenzy team invite editor@example.com --role restricted","sequenzy team invite finance@example.com --role viewer --billing-access"]});var sAA=Sy.command("cancel-invitation <invitationId>").description("Cancel a pending team invitation").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>fR("cancel-invitation",{invitationId:A,...x}));X0(sAA,{notes:["Run `sequenzy team list` first to find invitation IDs."],examples:["sequenzy team cancel-invitation inv_123 --yes"]});var hD=A8.command("inbox").description("Manage subscriber reply conversations").action(()=>hD.help());X0(hD,{notes:["The inbox collects subscriber replies to campaigns, sequences, and transactional email.","Use --note on replies to add an internal note instead of emailing the subscriber."],examples:["sequenzy inbox list --status open --unread","sequenzy inbox get conv_123","sequenzy inbox reply conv_123 --text 'Thanks for reaching out!'","sequenzy inbox close conv_123"]});var oAA=hD.command("list").description("List conversations").option("-s, --status <status>","Filter by status: open, closed, or all").option("--search <query>","Search by subscriber email, name, or subject").option("--unread","Only conversations with unread messages").option("-p, --page <number>","Page number (default 1)").option("-l, --limit <number>","Results per page (1-100, default 20)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>LF("list",A));X0(oAA,{examples:["sequenzy inbox list","sequenzy inbox list --status open --unread",'sequenzy inbox list --search "refund" --limit 50']});var tAA=hD.command("get <conversationId>").description("Get a conversation with its full message history").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>LF("get",{conversationId:A,...x}));X0(tAA,{examples:["sequenzy inbox get conv_123","sequenzy inbox get conv_123 --json"]});var eAA=hD.command("reply <conversationId>").description("Reply to a conversation or add an internal note").option("-t, --text <text>","Plain text message body").option("--html-file <file>","Read an HTML message body from file").option("-s, --subject <subject>","Override the reply subject").option("--note","Add an internal note instead of emailing the subscriber").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>LF("reply",{conversationId:A,...x}));X0(eAA,{notes:["Provide a body with --text and/or --html-file.","Outbound replies are emailed to the subscriber and reopen closed conversations; notes are internal only."],examples:["sequenzy inbox reply conv_123 --text 'Thanks for reaching out!'","sequenzy inbox reply conv_123 --html-file ./reply.html","sequenzy inbox reply conv_123 --text 'Customer asked for a refund' --note"]});var AxA=hD.command("close <conversationId>").description("Close a conversation").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>LF("close",{conversationId:A,...x}));X0(AxA,{examples:["sequenzy inbox close conv_123"]});var xxA=hD.command("reopen <conversationId>").description("Reopen a closed conversation").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>LF("reopen",{conversationId:A,...x}));X0(xxA,{examples:["sequenzy inbox reopen conv_123"]});var ExA=hD.command("mark-read <conversationId>").description("Mark all messages in a conversation as read").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>LF("mark-read",{conversationId:A,...x}));X0(ExA,{examples:["sequenzy inbox mark-read conv_123"]});var kg=A8.command("webhooks").description("Manage outbound webhook endpoints").action(()=>kg.help());X0(kg,{notes:["Webhook payloads are signed; the signing secret is only shown once at creation time.","Valid events cover email.*, subscriber.*, and sequence.* types; omit --event to use the default set."],examples:["sequenzy webhooks list","sequenzy webhooks create --name CI --url https://example.com/hook --event email.bounced","sequenzy webhooks deliveries wh_123 --limit 50","sequenzy webhooks replay wh_123 del_456"]});var BxA=kg.command("list").description("List outbound webhook endpoints").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>VD("list",A));X0(BxA,{examples:["sequenzy webhooks list --company comp_123"]});var gxA=kg.command("create").description("Create an outbound webhook endpoint").requiredOption("-n, --name <name>","Webhook name").requiredOption("-u, --url <url>","HTTPS endpoint URL").option("-e, --event <events...>","Event types to deliver, e.g. email.bounced subscriber.list_subscribed subscriber.list_unsubscribed").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>VD("create",A));X0(gxA,{notes:["The signing secret is printed once on creation and cannot be retrieved later - store it immediately.","Omit --event to subscribe to the default event set."],examples:["sequenzy webhooks create --name CI --url https://example.com/hook --event email.bounced","sequenzy webhooks create --name 'All events' --url https://example.com/hook"]});var QxA=kg.command("update <id>").description("Update an outbound webhook endpoint").option("-n, --name <name>","Webhook name").option("-u, --url <url>","HTTPS endpoint URL").option("-e, --event <events...>","Replacement event types").option("--enable","Enable the webhook").option("--disable","Disable the webhook").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>VD("update",{id:A,...x}));X0(QxA,{notes:["Provide at least one of --name, --url, --event, --enable, or --disable.","Changing the URL or re-enabling resets the failure circuit breaker."],examples:["sequenzy webhooks update wh_123 --url https://example.com/new-hook","sequenzy webhooks update wh_123 --event email.bounced email.complained","sequenzy webhooks update wh_123 --disable"]});var DxA=kg.command("delete <id>").description("Delete an outbound webhook endpoint").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>VD("delete",{id:A,...x}));X0(DxA,{examples:["sequenzy webhooks delete wh_123 --yes"]});var CxA=kg.command("test <id>").description("Send a test event to a webhook endpoint").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>VD("test",{id:A,...x}));X0(CxA,{notes:["The webhook must be enabled to receive a test event."],examples:["sequenzy webhooks test wh_123"]});var FxA=kg.command("deliveries <id>").description("List recent deliveries for a webhook endpoint").option("-l, --limit <number>","Maximum deliveries to return (1-100)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>VD("deliveries",{id:A,...x}));X0(FxA,{examples:["sequenzy webhooks deliveries wh_123","sequenzy webhooks deliveries wh_123 --limit 50"]});var IxA=kg.command("replay <id> <deliveryId>").description("Replay a webhook delivery").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x,E)=>VD("replay",{id:A,deliveryId:x,...E}));X0(IxA,{notes:["Run `sequenzy webhooks deliveries <id>` first to find delivery IDs."],examples:["sequenzy webhooks replay wh_123 del_456"]});var wxA=A8.command("account").description("Verify the active API key, permissions, and account context").option("--json","Print JSON").action(x60);X0(wxA,{notes:["Makes a live API request with the active credential. Compare its key name and prefix with Settings after replacing a key."],examples:["sequenzy account","sequenzy account --json"]});var JxA=A8.command("feedback <message>").description("Send product feedback about Sequenzy to the Sequenzy team").option("--category <category>","Category: missing_capability, bug, docs, ux, praise, other (default: other)").option("--context <context>","What you were trying to accomplish when you hit the gap").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H60(A,x));X0(JxA,{notes:["Agents: send feedback whenever the user wanted something the CLI, API, or MCP tools do not support. The Sequenzy team reads every submission."],examples:['sequenzy feedback "No command to bulk-delete campaigns by label" --category missing_capability','sequenzy feedback "Segment count and list output disagree for seg_123" --category bug --context "Auditing a re-engagement segment"']});var ZJ=A8.command("api-keys").description("Manage company API keys").action(()=>ZJ.help());X0(ZJ,{notes:["The plain API key is only returned on creation. Save it immediately.","Listing and revocation return metadata only; secrets and stored hashes are never returned."],examples:["sequenzy api-keys list --company comp_123","sequenzy api-keys create",'sequenzy api-keys create --name "CI deploy key" --company comp_123',"sequenzy api-keys revoke key_123 --company comp_123 --yes"]});var fxA=ZJ.command("create").description("Create a company API key").option("-n, --name <name>","Human-readable API key name").option("-c, --company <id>","Company ID override for personal API keys").option("--preset <preset>","Permission preset: full_access, read_only, agent_safe, ai_drafting, data_ingest_safe, data_ingest_automations, transactional_sender, marketing_sender (default: full_access)").option("--scopes <scopes>","Comma-separated explicit permission scopes (overrides --preset)").option("--json","Print raw JSON").action((A)=>mH("create",A));X0(fxA,{notes:["Keys default to full access. Pass --preset or --scopes to restrict what the key can do."],examples:["sequenzy api-keys create",'sequenzy api-keys create --name "CI deploy key" --company comp_123','sequenzy api-keys create --preset transactional_sender --name "Order emails"','sequenzy api-keys create --scopes "subscribers:read,subscribers:write,events:write"']});var KxA=ZJ.command("list").description("List company API keys without secret values").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>mH("list",A));X0(KxA,{notes:["Use the returned ID, name, prefix, and current-key marker to identify a key before revoking it."],examples:["sequenzy api-keys list","sequenzy api-keys list --company comp_123 --json"]});var $xA=ZJ.command("revoke").description("Permanently revoke a company API key").argument("<api-key-id>","Exact API key ID returned by api-keys list").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>mH("revoke",{apiKeyId:A,...x}));X0($xA,{notes:["Revocation cannot be undone. Run 'sequenzy api-keys list' first and verify the exact ID and prefix."],examples:["sequenzy api-keys revoke key_123 --company comp_123 --yes"]});var HxA=ZJ.command("delete").description("Alias for api-keys revoke").argument("<api-key-id>","Exact API key ID returned by api-keys list").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>mH("delete",{apiKeyId:A,...x}));X0(HxA,{notes:["This is a compatibility alias for 'sequenzy api-keys revoke'."],examples:["sequenzy api-keys delete key_123 --company comp_123 --yes"]});var UJ=A8.command("websites").description("Manage sending domains and integration guides").action(()=>UJ.help());X0(UJ,{notes:["Use 'guide' for code examples and 'check' to inspect current DNS verification details."],examples:["sequenzy websites list --company comp_123","sequenzy websites add example.com --company comp_123","sequenzy websites guide --framework nextjs --use-case transactional"]});var yxA=UJ.command("list").description("List sending domains for a company").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>Wy("list",A));X0(yxA,{examples:["sequenzy websites list --company comp_123"]});var qxA=UJ.command("add <domain>").description("Add a sending domain").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>Wy("add",{domain:A,...x}));X0(qxA,{examples:["sequenzy websites add example.com --company comp_123"]});var YxA=UJ.command("check <domain>").description("Inspect sending domain verification details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>Wy("check",{domain:A,...x}));X0(YxA,{examples:["sequenzy websites check example.com --company comp_123"]});var XxA=UJ.command("guide").description("Print framework-specific integration code").option("--framework <name>","Framework name, e.g. nextjs, express, python").option("--use-case <name>","Use case, e.g. transactional, subscribe_form, event_tracking").option("--json","Print raw JSON").action((A)=>Wy("guide",A));X0(XxA,{examples:["sequenzy websites guide","sequenzy websites guide --framework nextjs --use-case transactional","sequenzy websites guide --framework python --use-case event_tracking"]});var Tk=A8.command("shopify").description("Manage the connected Shopify store's automation settings").action(()=>Tk.help());X0(Tk,{notes:["Requires a connected Shopify integration on the company.","Browse abandonment emails shoppers who viewed a product but didn't buy; price drop alerts email recent viewers when a product's price falls."],examples:["sequenzy shopify settings get","sequenzy shopify settings update --price-drop off","sequenzy shopify settings update --browse-delay-hours 4 --browse-cooldown-hours 48"]});var hk=Tk.command("settings").description("Browse-abandonment and price-drop automation settings").action(()=>hk.help()),ZxA=hk.command("get").description("Show the effective automation settings").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>kb("get",A));X0(ZxA,{notes:["Shows the effective values - platform defaults apply until the store overrides them."],examples:["sequenzy shopify settings get --json"]});var UxA=hk.command("update").description("Update browse-abandonment and/or price-drop settings").option("--browse-abandonment <on|off>","Enable or disable browse abandonment").option("--browse-delay-hours <hours>","Hours to wait after a product view before the abandonment check (default 2)").option("--browse-cooldown-hours <hours>","Minimum hours between browse-abandoned events per subscriber (default 24)").option("--reset-browse-abandonment","Reset browse abandonment to the platform defaults").option("--price-drop <on|off>","Enable or disable price drop alerts").option("--price-drop-min-percent <percent>","Minimum price decrease percent to alert on (default 5)").option("--price-drop-lookback-days <days>","How many days back viewers qualify as the audience (default 30)").option("--price-drop-cooldown-days <days>","Minimum days between price-drop events per subscriber and product (default 7)").option("--reset-price-drop","Reset price drop alerts to the platform defaults").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>kb("update",A));X0(UxA,{notes:["Partial update: omitted flags keep their current values.","If no sequence handles ecommerce.price_drop, Sequenzy sends a default price-drop email to active subscribers."],examples:["sequenzy shopify settings update --browse-abandonment off","sequenzy shopify settings update --price-drop-min-percent 10 --price-drop-lookback-days 14","sequenzy shopify settings update --reset-price-drop"]});var XR=A8.command("sms").description("Inspect the SMS add-on status for a company").action(()=>XR.help());X0(XR,{notes:["SMS sequence steps only send when the add-on is enabled, the plan is eligible, and an active number exists.",'Add SMS steps to sequences with type: "sms" in sequences create --steps-* or update --insert-steps-*.','Generate SMS copy with `sequenzy generate sms "<prompt>"`.'],examples:["sequenzy sms settings","sequenzy sms settings --json"]});var GxA=XR.command("settings").description("Show SMS add-on status, credits, and phone numbers").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>ib("settings",A));X0(GxA,{notes:["readyToSend in the JSON output tells you whether SMS sequence steps will actually send."],examples:["sequenzy sms settings --json"]});var WxA=XR.command("send-test <phone>").description("Send a test SMS to a phone number").option("-t, --text <text>","Plain-text message body").option("--image-url <url...>","Publicly reachable MMS image URL (repeat for up to 2)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>ib("send-test",{phone:A,...x}));X0(WxA,{notes:["Sends a real text and charges credits. Limited to 5 test sends per hour; bypasses quiet hours; excluded from step stats.","Requires the SMS add-on with a verified number - check `sequenzy sms settings` first."],examples:['sequenzy sms send-test +15550100123 --text "Test from Sequenzy"']});var ZR=A8.command("sync-rules").description("Manage automatic tag changes applied when events fire").action(()=>ZR.help());X0(ZR,{notes:["Sync rules map events to tag changes, e.g. an order-placed event adding a customer tag.","Rules can carry conditions: required/excluded subscriber tags, and a product match for commerce events (tag buyers by product tag, collection, type, or vendor)."],examples:["sequenzy sync-rules get","sequenzy sync-rules update --rules-file ./sync-rules.json","sequenzy sync-rules update --reset"]});var RxA=ZR.command("get").description("Show the effective sync rules").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>Nk("get",A));X0(RxA,{notes:["Shows the platform defaults until the company saves custom rules; the JSON output includes isDefault."],examples:["sequenzy sync-rules get --json"]});var MxA=ZR.command("update").description("Replace the sync rules or reset them to the defaults").option("--rules-json <json>","Inline JSON array with the full rule set").option("--rules-file <file>","Path to a JSON file with the full rule set").option("--reset","Reset the company to the platform default rules").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>Nk("update",A));X0(MxA,{notes:["This replaces the FULL rule set - fetch with 'sync-rules get --json', edit, then update.",'Each rule: {"triggerEvent":"...","actions":{"addTags":[...],"removeTags":[...]},"conditions":{...}}.'],examples:["sequenzy sync-rules update --rules-file ./sync-rules.json",`sequenzy sync-rules update --rules-json '[{"triggerEvent":"ecommerce.order_placed","actions":{"addTags":["vinyl-collector"],"removeTags":[]},"conditions":{"purchasedProduct":{"tags":["Vinyl"]}}}]'`,"sequenzy sync-rules update --reset"]});var GJ=A8.command("generate").description("Generate email and SMS content with AI").action(()=>GJ.help());X0(GJ,{notes:["Generated email and SMS content is returned as draft content. Review it before sending.","`generate sequence` is deprecated and persists a disabled draft. Use `sequences create <name> --trigger <trigger> --goal <goal>` instead.","Use --json when another tool or agent should parse the generated output."],examples:['sequenzy generate email "Welcome a new user to our analytics product"','sequenzy generate subjects "April product launch" --count 8','sequenzy generate sms "Cart reminder with a free-shipping hook" --count 3']});GJ.command("email <prompt>").description("Generate email blocks from a prompt").option("-s, --style <style>","Style: minimal, branded, promotional").option("-t, --tone <tone>","Tone: professional, casual, friendly").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>pH("email",{prompt:A,...x}));GJ.command("sequence <goal>").description("[DEPRECATED] Persist a disabled AI sequence draft; use `sequences create`").option("--name <name>","Optional sequence name; defaults to the goal").option("--list-id <id>","Optional list ID for the contact_added trigger").option("-c, --count <number>","Number of emails (1-10)","5").option("-d, --days <number>","Duration in days","14").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>pH("sequence",{goal:A,...x}));GJ.command("subjects <topic>").description("Generate A/B subject line variants").option("-c, --count <number>","Number of variants","5").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>pH("subjects",{topic:A,...x}));var zxA=GJ.command("sms <prompt>").description("Generate SMS message variants from a prompt").option("-c, --count <number>","Number of variants (1-10)","3").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>pH("sms",{prompt:A,...x}));X0(zxA,{notes:["Messages are plain text with encoding and segment counts; use them as the text of an SMS sequence step.","Opt-out footers and the brand prefix are added automatically at send time - never include them in the message.","Check `sequenzy sms settings` to confirm the SMS add-on is ready before enabling SMS sequences."],examples:['sequenzy generate sms "Flash sale ends tonight" --count 5 --json']});await A8.parseAsync();process.exit(process.exitCode??0);
|
|
629
|
+
${H1}Use 'sequenzy --help' and '<command> --help' for detailed examples and caveats.${o6}`;console.log(E),console.log(g),console.log(),console.log(B),console.log(Q),console.log(D),console.log()}var A8=new Zm;A8.name("sequenzy").description("Sequenzy CLI - Email marketing from the terminal").version(Jg0).showHelpAfterError().showSuggestionAfterError().action(le0);X0(A8,{notes:["Use --json on data commands when another tool or agent should parse structured output.","Dashboard-aware JSON responses include appUrls when a company ID can be resolved.","Company-scoped commands accept --company for personal API keys that can access multiple companies.","Content commands prefer file flags such as --html-file, --blocks-file, --steps-file, and --emails-file to avoid shell escaping issues.","Sequence creation supports --goal for AI generation or explicit step JSON."],examples:['sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy campaigns update camp_123 --subject "Updated subject" --html-file ./campaign.html',"sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json","sequenzy urls --company comp_123 --sequence seq_123 --settings-tab integrations","sequenzy websites guide --framework nextjs --use-case transactional",'sequenzy api-keys create --name "CI deploy key" --company comp_123']});var de0=A8.command("login").description("Log in to your Sequenzy account").action(z60);X0(de0,{notes:["Starts device authentication and prints a verification URL plus approval code."],examples:["sequenzy login"]});var ae0=A8.command("logout").description("Log out of your Sequenzy account").action(S60);X0(ae0,{examples:["sequenzy logout"]});var se0=A8.command("whoami").description("Show the locally stored Sequenzy identity").action(Cg0);X0(se0,{notes:["This checks local CLI credential state only. Use 'sequenzy account' to make a live request and verify the active key, permissions, and company access."],examples:["sequenzy whoami"]});var oe0=A8.command("stats").description("Show account, campaign, or sequence metrics, including Poll/NPS").option("-p, --period <period>","Time period (7d, 30d, 90d)","7d").option("--campaign <id>","Get stats for a specific campaign").option("--sequence <id>","Get stats for a specific sequence").option("--include-bots","Include machine-classified bot/scanner opens and clicks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON, including poll and NPS results").action(f20);X0(oe0,{notes:["Use exactly one of: account-level period, --campaign, or --sequence.","Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement.","Sequence stats include per-step failures when the API reports them.","Campaign stats include a Poll & NPS Results section when the email collected answers; use --json for the full polls array."],examples:["sequenzy stats","sequenzy stats --period 30d","sequenzy stats --campaign camp_123","sequenzy stats --campaign camp_123 --json","sequenzy stats --campaign camp_123 --include-bots","sequenzy stats --sequence seq_123"]});var te0=A8.command("events").description("List raw campaign or sequence email events").option("--campaign <id>","List events for a campaign").option("--sequence <id>","List events for a sequence").option("--type <type>","Single event type to include, such as delivery, open, or click").option("--event-types <types>","Comma-separated event types to include (default: delivery)").option("-p, --period <period>","Time period (1h, 24h, 7d, 30d, 90d)").option("--start <iso>","Start of custom time range (ISO 8601)").option("--end <iso>","End of custom time range (ISO 8601)").option("--page <number>","Page number").option("--limit <number>","Events per page, capped by the API").option("--include-bots","Include machine-classified bot/scanner opens and clicks").option("-c, --company <id>","Company ID").option("--json","Print JSON").action(K60);X0(te0,{notes:["Use exactly one of --campaign or --sequence.","Defaults to delivery events. Use --event-types delivery,open,click when you need engagement events too.","Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement."],examples:["sequenzy events --campaign camp_123","sequenzy events --sequence seq_123 --limit 100 --json","sequenzy events --campaign camp_123 --event-types delivery,click --period 30d"]});var ee0=A8.command("urls").description("Generate Sequenzy dashboard URLs for known resource IDs").option("-c, --company <id>","Company ID").option("--campaign <id>","Campaign ID for campaign editor URL").option("--landing-page <id>","Landing page ID for landing page editor URL").option("--sequence <id>","Sequence ID for sequence editor URL").option("--template <id>","Template/email ID for email editor URL").option("--email <id>","Email ID for email editor URL").option("--transactional <id>","Transactional email ID").option("--email-send <id>","Email send ID").option("--domain <id>","Sending domain ID").option("--status <status>","Status for campaign/sequence list URLs").option("--settings-tab <tab>","Settings tab slug, e.g. integrations").option("--json","Print JSON").action(A60);X0(ee0,{notes:["Uses SEQUENZY_APP_URL when set, otherwise https://sequenzy.com.","If --company is omitted, the CLI tries the current company from `sequenzy account`.","Useful after creating a campaign or sequence when the user wants a review/edit link."],examples:["sequenzy urls --company comp_123","sequenzy urls --company comp_123 --sequence seq_123","sequenzy urls --company comp_123 --campaign camp_123","sequenzy urls --company comp_123 --landing-page lp_123","sequenzy urls --company comp_123 --email-send send_123","sequenzy urls --company comp_123 --settings-tab integrations","sequenzy urls --company comp_123 --json"]});var Q2=A8.command("subscribers").description("Manage subscribers").action(()=>Q2.help());X0(Q2,{notes:["Subscriber list fetches every page by default so agents do not silently miss later results.","`subscribers get` includes tags, list memberships, sequence enrollments, email stats, and recent activity.","--attr expects repeated key=value pairs. Example: --attr firstName=Ana --attr plan=pro"],examples:["sequenzy subscribers list --tag vip",'sequenzy subscribers list --list "Master List" --json',"sequenzy subscribers list --tag vip --limit 25 --json","sequenzy subscribers add user@example.com --tag trial --attr firstName=Ana","sequenzy subscribers import copper-contacts.csv --list list_123 --opt-in-mode confirmed","sequenzy subscribers import-status import_123 --json","sequenzy subscribers get user@example.com --json",'sequenzy subscribers notes add user@example.com --body "Customer prefers quarterly reports"',"sequenzy subscribers remove user@example.com --hard"]});var A0A=Q2.command("list").description("List subscribers").option("-s, --segment <id>","Filter by segment").option("-t, --tag <tag>","Filter by tag").option("--list <id-or-name>","Filter by subscriber list ID or exact name").option("-l, --limit <number>","Maximum results to return").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>H7("list",A));X0(A0A,{examples:["sequenzy subscribers list",'sequenzy subscribers list --list "Master List"',"sequenzy subscribers list --segment seg_123","sequenzy subscribers list --tag onboarding --limit 100"]});var x0A=Q2.command("add [email]").description("Add or upsert a subscriber").option("--external-id <id>","Customer-owned subscriber ID").option("--first-name <name>","Subscriber first name").option("--last-name <name>","Subscriber last name").option("-t, --tag <tags...>","Tags to apply").option("-l, --list <ids...>","List IDs to add the subscriber to").option("--no-lists","Add the subscriber to no lists").option("--skip-sequences","Do not enroll the subscriber in matching sequences").option("-a, --attr <attrs...>","Attributes (key=value)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("add",{email:A,...x,noLists:x.lists===!1}));X0(x0A,{examples:["sequenzy subscribers add user@example.com","sequenzy subscribers add user@example.com --first-name Ana --tag trial --attr plan=pro","sequenzy subscribers add user@example.com --list list_123","sequenzy subscribers add user@example.com --skip-sequences"]});var E0A=Q2.command("import [file]").description("Queue a full-record subscriber import from CSV or JSON").option("--records-json <json>","Inline JSON array (alternative to a CSV/JSON file)").option("--duplicate-strategy <strategy>","Existing contact behavior: skip, merge, or overwrite","skip").option("--file-name <name>","Source label shown in import history").option("-l, --list <ids...>","List IDs for every imported subscriber").option("--enroll-sequences","Enroll matching subscribers (requires automations:trigger)").option("--default-phone-country <country>","Two-letter country for national phone numbers").option("--sms-consent","Assert express written SMS consent for every imported phone").option("--opt-in-mode <mode>","Email consent mode: default, confirmed, or double_opt_in","default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("import",{file:A,...x}));X0(E0A,{notes:["CSV columns for email, names, external ID, phone, status, and tags are detected automatically; other columns become custom attributes.","Use --opt-in-mode confirmed only when these contacts already gave verified email consent.","Imports run asynchronously. Poll the returned ID with subscribers import-status."],examples:["sequenzy subscribers import copper-contacts.csv --list list_123 --opt-in-mode confirmed",`sequenzy subscribers import --records-json '[{"email":"one@example.com","firstName":"Ana"}]' --opt-in-mode confirmed`]});var B0A=Q2.command("import-status <importId>").description("Get subscriber import progress and result counts").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("import:get",{importId:A,...x}));X0(B0A,{notes:["A completed import can still contain failed rows; inspect failed counts and --json reason maps."],examples:["sequenzy subscribers import-status import_123","sequenzy subscribers import-status import_123 --json"]});var g0A=Q2.command("get [email]").description("Get subscriber details").option("--external-id <id>","Customer-owned subscriber ID").option("--include-bots","Include machine-classified bot/scanner opens and clicks in stats/activity").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("get",{email:A,...x}));X0(g0A,{notes:["Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement."],examples:["sequenzy subscribers get user@example.com","sequenzy subscribers get user@example.com --include-bots"]});var Ry=Q2.command("notes").description("Manage subscriber notes").action(()=>Ry.help());X0(Ry,{examples:["sequenzy subscribers notes list user@example.com",'sequenzy subscribers notes add user@example.com --body "Prefers monthly digest"',"sequenzy subscribers notes delete note_123"]});var Q0A=Ry.command("list [email]").description("List subscriber notes").option("--external-id <id>","Customer-owned subscriber ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("notes:list",{email:A,...x}));X0(Q0A,{examples:["sequenzy subscribers notes list user@example.com","sequenzy subscribers notes list --external-id user_123 --json"]});var D0A=Ry.command("add [email]").description("Add a subscriber note").option("--external-id <id>","Customer-owned subscriber ID").requiredOption("-b, --body <body>","Note body").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("notes:add",{email:A,...x}));X0(D0A,{examples:['sequenzy subscribers notes add user@example.com --body "Asked about enterprise plan"','sequenzy subscribers notes add --external-id user_123 --body "Imported from sales call"']});var C0A=Ry.command("delete <noteId>").description("Delete a subscriber note").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("notes:delete",{noteId:A,...x}));X0(C0A,{examples:["sequenzy subscribers notes delete note_123"]});var F0A=Q2.command("update [email]").description("Update subscriber status, name, tags, or custom attributes").option("--external-id <id>","Customer-owned subscriber ID").option("--status <status>","Subscriber status").option("--first-name <name>","Subscriber first name").option("--last-name <name>","Subscriber last name").option("-t, --tag <tags...>","Replacement tags").option("-a, --attr <attrs...>","Attributes (key=value)").option("--merge","Merge custom attributes instead of replacing them").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("update",{email:A,...x}));X0(F0A,{examples:["sequenzy subscribers update user@example.com --status unsubscribed","sequenzy subscribers update user@example.com --first-name Ana --last-name Silva","sequenzy subscribers update user@example.com --tag churned --attr cancelReason=too_expensive","sequenzy subscribers update user@example.com --attr plan=pro --merge"]});var I0A=Q2.command("event [email]").description("Trigger an event for a subscriber").option("--external-id <id>","Customer-owned subscriber ID").requiredOption("-n, --name <event>","Event name").option("-p, --property <properties...>","Event properties (key=value)").option("-a, --attr <attrs...>","Subscriber attributes (key=value)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("event",{email:A,...x}));X0(I0A,{examples:["sequenzy subscribers event user@example.com --name saas.purchase","sequenzy subscribers event user@example.com --name saas.purchase --property plan=pro --property amount=99"]});var w0A=Q2.command("remove [email]").description("Unsubscribe or permanently delete a subscriber").option("--external-id <id>","Customer-owned subscriber ID").option("--hard","Permanently delete (not just unsubscribe)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H7("remove",{email:A,...x}));X0(w0A,{examples:["sequenzy subscribers remove user@example.com","sequenzy subscribers remove user@example.com --hard"]});var My=A8.command("transactional").description("Inspect transactional email templates").action(()=>My.help());X0(My,{notes:["Use the top-level `sequenzy send` command to send email."],examples:["sequenzy transactional list","sequenzy transactional get welcome","sequenzy send user@example.com --template welcome --var firstName=Ana"]});var J0A=My.command("list").description("List transactional templates").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>$R("list",A));X0(J0A,{examples:["sequenzy transactional list --company comp_123"]});var f0A=My.command("get <slug>").description("Get transactional template details by slug").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>$R("get",{slug:A,...x}));X0(f0A,{examples:["sequenzy transactional get welcome"]});var K0A=My.command("create <name>").description("Create a transactional template").option("--slug <slug>","API slug").option("-s, --subject <subject>","Subject (optional with --prompt)").option("--preview-text <text>","Preview text override").option("--prompt <prompt>","Generate branded transactional blocks").option("--style <style>","Prompt generation style").option("--tone <tone>","Prompt generation tone").option("--html <html>","Preserved HTML content").option("--html-file <file>","Read preserved HTML from file").option("--blocks-json <json>","Finished Sequenzy blocks JSON").option("--blocks-file <file>","Read finished Sequenzy blocks from file").option("--enabled","Enable immediately (prompt creates default disabled)").option("--no-enabled","Create the transactional template disabled").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>$R("create",{name:A,...x}));X0(K0A,{notes:["Provide exactly one of prompt, HTML, or blocks.",HR],examples:['sequenzy transactional create password-reset --prompt "Write a password reset email"']});var Vk=A8.command("widgets").description("Widget helper commands").action(()=>Vk.help());X0(Vk,{examples:["sequenzy widgets preferences-token user@example.com"]});var $0A=Vk.command("preferences-token <email>").description("Generate a subscription preferences iframe token").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>Fg0("preferences-token",{email:A,...x}));X0($0A,{examples:["sequenzy widgets preferences-token user@example.com"]});var vk=A8.command("email-sends").alias("emailsends").description("Inspect sent email snapshots and delivery events").action(()=>vk.help());X0(vk,{notes:["Email send rows are short-lived; if the row was cleaned up, this falls back to retained ClickHouse events.","Use --html to print the stored HTML body when it is still available."],examples:["sequenzy email-sends get send_123","sequenzy email-sends get send_123 --html","sequenzy email-sends get send_123 --json"]});var H0A=vk.command("get <emailSendId>").description("Get an email send by ID").option("-c, --company <id>","Company ID override for personal API keys").option("--html","Print the full stored HTML body in text output").option("--html-only","Print only the stored HTML body").option("--json","Print raw JSON").action((A,x)=>w60("get",{id:A,...x}));X0(H0A,{examples:["sequenzy email-sends get send_123","sequenzy email-sends get send_123 --html","sequenzy email-sends get send_123 --company comp_123 --json"]});var yR=A8.command("suppressions").description("Inspect and clean stale recipient bounce suppression").action(()=>yR.help());X0(yR,{notes:["Suppression lookup is exact-address only because the SES account-level list is shared across companies.","Removal clears stale bounce entries only; complaint and unsubscribe protections are preserved."],examples:["sequenzy suppressions get me@example.com","sequenzy suppressions remove me@example.com --yes"]});var y0A=yR.command("get <email>").description("Check local and Amazon SES suppression for one recipient").option("--region <region>","Check one AWS SES region").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>Pk("get",{email:A,...x}));X0(y0A,{examples:["sequenzy suppressions get me@example.com","sequenzy suppressions get me@example.com --region us-east-1 --json"]});var q0A=yR.command("remove <email>").description("Remove stale bounce suppression for one recipient").option("--region <region>","Clear one AWS SES region").option("-c, --company <id>","Company ID override for personal API keys").option("-y, --yes","Skip confirmation").option("--json","Print raw JSON").action((A,x)=>Pk("remove",{email:A,...x}));X0(q0A,{examples:["sequenzy suppressions remove me@example.com","sequenzy suppressions remove me@example.com --region us-east-1 --yes"]});var Y0A=A8.command("send <email>").description("Send through the transactional email API").option("-t, --template <slug>","Transactional template slug to use").option("-s, --subject <subject>","Email subject").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--email-type <type>","Delivery policy: transactional (default) or marketing").option("--vars-json <json>","Variables as a JSON object, including nested arrays for repeat blocks").option("-v, --var <vars...>","Variables (key=value)").action(B20);X0(Y0A,{notes:["Use either --template or --html/--html-file.","--template takes a transactional API slug and cannot be combined with --subject.","--subject is required when sending raw HTML.","--email-type marketing adds the standard unsubscribe footer and RFC 8058 one-click-unsubscribe headers; it supports one recipient only.","--vars-json accepts nested objects and arrays; --var overrides individual scalar keys.","If the recipient matches a subscriber, saved first and last names fill omitted name variables; --var values override them."],examples:["sequenzy send user@example.com --template welcome --var firstName=Ana",`sequenzy send user@example.com --template welcome --vars-json '{"event":{"items":[{"title":"Plan","description":"Pro"}]}}'`,'sequenzy send user@example.com --subject "Welcome" --html-file ./welcome.html',"sequenzy send user@example.com --template trial-reminder --email-type marketing --var firstName=Ana"]});var a5=A8.command("campaigns").description("Manage campaigns").action(()=>a5.help());X0(a5,{notes:["Campaign creation supports HTML, Sequenzy blocks, or prompt-generated content.","Campaign updates support HTML, Sequenzy blocks, subject, name, labels, and reply-to changes.","Campaign scheduling requires a future ISO timestamp and a verified sending domain.","Use cancel to stop a scheduled or sending campaign, and pause/resume to control an active send.",HR],examples:["sequenzy campaigns list --status draft --company comp_123",'sequenzy campaigns create "April Launch" --subject "We shipped" --html-file ./campaign.html','sequenzy campaigns create "API Launch" --subject "We shipped" --label edm api --html-file ./campaign.html','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z"',"sequenzy campaigns test camp_123 --to you@example.com","sequenzy campaigns cancel camp_123","sequenzy campaigns duplicate camp_123 --mode ab_test"]});var X0A=a5.command("list").description("List campaigns").option("-s, --status <status>","Filter by status").option("--label <labels...>","Filter by label name").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>z4("list",A));X0(X0A,{examples:["sequenzy campaigns list","sequenzy campaigns list --status draft --company comp_123","sequenzy campaigns list --label edm"]});var Z0A=a5.command("get <id>").description("Get campaign details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("get",{id:A,...x}));X0(Z0A,{examples:["sequenzy campaigns get camp_123 --company comp_123"]});var U0A=a5.command("create <name>").description("Create a campaign").option("-s, --subject <subject>","Email subject").option("--preview-text <text>","Inbox preview text").option("--preheader-text <text>","Alias for --preview-text").option("--tracking-code <code>","Optional campaign tracking code").option("--status <status>","Initial status: draft or sent").option("--sent-at <iso-date>","Sent timestamp when creating with --status sent").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--prompt <prompt>","Generate campaign blocks from a prompt").option("--style <style>","Prompt generation style: minimal, branded, promotional").option("--tone <tone>","Prompt generation tone: professional, casual, friendly").option("--label <labels...>","Label names to assign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("create",{name:A,...x}));X0(U0A,{notes:["--subject is required unless --prompt is provided. With --prompt, the generated subject is used unless --subject is also provided.","Use --preview-text or --preheader-text to set the inbox preview text. With --prompt, the generated preview is used unless one of these flags is provided.","Use --blocks-json or --blocks-file when you need editor-compatible blocks, including conditional content and per-block styles.","Use --status sent only to archive an already-sent campaign; it does not send email or create per-recipient delivery history.","Do not combine prompt, HTML flags, and blocks flags in the same request."],examples:['sequenzy campaigns create "April Launch" --prompt "Announce our new analytics dashboard"','sequenzy campaigns create "April Launch" --subject "We shipped" --preheader-text "Your quick product update" --html-file ./campaign.html','sequenzy campaigns create "Imported launch" --subject "We shipped" --status sent --sent-at "2026-05-01T14:00:00Z" --html-file ./campaign.html','sequenzy campaigns create "API Launch" --subject "We shipped" --label edm api --html-file ./campaign.html','sequenzy campaigns create "Segmented Launch" --subject "We shipped" --blocks-file ./campaign-blocks.json']});var G0A=a5.command("update <id>").description("Update a draft campaign").option("-n, --name <name>","Campaign name").option("-s, --subject <subject>","Email subject").option("--preview-text <text>","Inbox preview text").option("--preheader-text <text>","Alias for --preview-text").option("--tracking-code <code>","Optional campaign tracking code").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--campaign-data-json <json>","Inline campaignData JSON object").option("--campaign-data-file <file>","Path to a JSON file with campaignData").option("--computed-lists-json <json>","Inline computedLists JSON array").option("--computed-lists-file <file>","Path to a JSON file with computedLists").option("--reply-to <email>","Set reply-to using an existing reply profile email").option("--reply-profile <id>","Set reply-to using a reply profile ID").option("--label <labels...>","Replace label names").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("update",{id:A,...x}));X0(G0A,{notes:["Provide at least one update flag, including subject, preview text, content, labels, reply-to, campaign data, or computed lists.","Use --blocks-json or --blocks-file when you need editor-compatible blocks, including conditional content and per-block styles.","Use --campaign-data-file and --computed-lists-file to upload personalization data for repeat blocks.","Do not combine HTML flags with blocks flags in the same request.","Use either --reply-to or --reply-profile, not both."],examples:['sequenzy campaigns update camp_123 --subject "Updated subject"','sequenzy campaigns update camp_123 --preheader-text "Updated preview"',"sequenzy campaigns update camp_123 --html-file ./campaign-v2.html","sequenzy campaigns update camp_123 --blocks-file ./campaign-v2-blocks.json","sequenzy campaigns update camp_123 --campaign-data-file ./campaign-data.json --computed-lists-file ./computed-lists.json","sequenzy campaigns update camp_123 --reply-to support@example.com","sequenzy campaigns update camp_123 --label edm api"]});var W0A=a5.command("schedule <id>").description("Schedule a draft or scheduled campaign").requiredOption("--at <datetime>","Future ISO date/time to send, for example 2026-06-01T14:00:00Z").option("--target-lists-json <json>","Inline campaign targetLists JSON object").option("--target-lists-file <file>","Path to a JSON file with campaign targetLists").option("--send-time-optimization","Enable send-time optimization for the scheduled send").option("--spread-over-hours <hours>","Spread delivery over 1-72 hours. Disables send-time optimization when set.").option("--repeat <interval>","Repeat the campaign weekly or monthly starting at --at. Audience membership is re-evaluated at every run.").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("schedule",{id:A,...x}));X0(W0A,{notes:["The campaign must be draft or already scheduled.","Omit target lists to reuse saved campaign targeting, or default to all active subscribers.",'Target list examples include {"type":"all"}, {"type":"lists","listIds":["list_123"]}, and {"type":"segment","segmentId":"seg_123"}.',"With --repeat, the campaign becomes a recurring template: each run is duplicated and sent automatically. Re-schedule without --repeat (or cancel the campaign) to stop the series."],examples:['sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z"',`sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --target-lists-json '{"type":"all"}'`,'sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --target-lists-file ./target-lists.json','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --spread-over-hours 6','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --repeat monthly']});var R0A=a5.command("test <id>").description("Send a test email for a campaign").requiredOption("--to <email>","Recipient email for the test").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("test",{id:A,...x}));X0(R0A,{examples:["sequenzy campaigns test camp_123 --to you@example.com"]});var M0A=a5.command("cancel <id>").description("Cancel a scheduled, paused, or sending campaign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("cancel",{id:A,...x}));X0(M0A,{notes:["Cancelling stops scheduled, paused, waiting-approval, and actively sending campaigns immediately.","No confirmation prompt is shown so a bad send can be stopped fast."],examples:["sequenzy campaigns cancel camp_123"]});var z0A=a5.command("pause <id>").description("Pause a campaign that is currently sending").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("pause",{id:A,...x}));X0(z0A,{notes:["Only campaigns in sending status can be paused."],examples:["sequenzy campaigns pause camp_123"]});var S0A=a5.command("resume <id>").description("Resume a paused campaign").option("--spread-over-hours <hours>","Spread the remaining delivery over 1-72 hours").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("resume",{id:A,...x}));X0(S0A,{notes:["Only paused campaigns can be resumed."],examples:["sequenzy campaigns resume camp_123","sequenzy campaigns resume camp_123 --spread-over-hours 6"]});var L0A=a5.command("delete <id>").description("Delete a campaign").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("delete",{id:A,...x}));X0(L0A,{notes:["Sending, scheduled, and paused campaigns must be cancelled before they can be deleted."],examples:["sequenzy campaigns delete camp_123 --yes"]});var O0A=a5.command("duplicate <id>").description("Duplicate a campaign as a new draft").option("--mode <mode>","Duplicate mode: campaign, ab_test, or variant","campaign").option("--variant-id <id>","A/B test variant to copy when --mode is variant").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("duplicate",{id:A,...x}));X0(O0A,{notes:["Mode campaign copies the campaign email, ab_test also copies the A/B test with all variants, and variant copies one variant's content as a plain campaign."],examples:["sequenzy campaigns duplicate camp_123","sequenzy campaigns duplicate camp_123 --mode ab_test","sequenzy campaigns duplicate camp_123 --mode variant --variant-id var_b"]});var j0A=a5.command("resend-to-non-openers <id>").description("Create a draft resend to subscribers who didn't open a sent campaign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>z4("resend-to-non-openers",{id:A,...x}));X0(j0A,{notes:["Only available 6 hours after a sent campaign finishes sending.",`Creates a draft targeting the same audience plus a "didn't open this campaign" rule. Review the draft, then schedule or send it.`,"The response includes an estimate of how many subscribers haven't opened the original."],examples:["sequenzy campaigns resend-to-non-openers camp_123"]});var D2=A8.command("landing-pages").description("Manage landing pages").action(()=>D2.help());X0(D2,{notes:["Landing pages are created as drafts. Publish only after reviewing the page.","Use --content-json or --content-file for full editor-compatible landing page content.","Custom domains require a CNAME record pointing to pages.sequenzydns.com."],examples:["sequenzy landing-pages list --company comp_123",'sequenzy landing-pages create "Product Waitlist" --template waitlist',"sequenzy landing-pages publish lp_123","sequenzy landing-pages connect-domain pages.example.com"]});var P0A=D2.command("list").description("List landing pages").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>I1("list",A));X0(P0A,{examples:["sequenzy landing-pages list --company comp_123"]});var N0A=D2.command("get <id>").description("Get landing page details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>I1("get",{id:A,...x}));X0(N0A,{examples:["sequenzy landing-pages get lp_123 --company comp_123"]});var V0A=D2.command("create [name]").description("Create a draft landing page").option("--slug <slug>","Landing page URL slug").option("--template <template>","Template key, e.g. waitlist").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>I1("create",{name:A,...x}));X0(V0A,{notes:["When --content-json/--content-file is omitted, a valid default page is generated from --template."],examples:['sequenzy landing-pages create "Product Waitlist" --template waitlist','sequenzy landing-pages create "Launch Page" --slug launch --content-file ./landing-page.json']});var v0A=D2.command("update <id>").description("Edit a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>I1("update",{id:A,...x}));X0(v0A,{examples:['sequenzy landing-pages update lp_123 --name "Updated page"',"sequenzy landing-pages update lp_123 --content-file ./landing-page.json"]});var u0A=D2.command("publish <id>").description("Publish a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>I1("publish",{id:A,...x}));X0(u0A,{examples:["sequenzy landing-pages publish lp_123"]});var T0A=D2.command("unpublish <id>").description("Unpublish a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>I1("unpublish",{id:A,...x}));X0(T0A,{examples:["sequenzy landing-pages unpublish lp_123"]});var h0A=D2.command("delete <id>").description("Delete a landing page").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>I1("delete",{id:A,...x}));X0(h0A,{examples:["sequenzy landing-pages delete lp_123"]});var b0A=D2.command("connect-domain <domain>").description("Connect a custom landing page domain").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>I1("connect-domain",{domain:A,...x}));X0(b0A,{examples:["sequenzy landing-pages connect-domain pages.example.com --company comp_123"]});var k0A=D2.command("update-domain-settings").description("Update or verify landing page domain settings").option("--domain <domain>","Replace the connected landing page domain").option("--verify","Refresh domain verification state").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>I1("update-domain-settings",A));X0(k0A,{examples:["sequenzy landing-pages update-domain-settings --domain pages.example.com","sequenzy landing-pages update-domain-settings --verify"]});var J6=A8.command("sequences").description("Manage email sequences").action(()=>J6.help());X0(J6,{notes:["The CLI supports both AI goal-based sequence creation and explicit-step creation.","Trigger-specific options depend on --trigger. For example: contact_added needs --list-id, tag_added needs --tag-name, inactivity needs --event-name and --inactive-days.","Use --goal for AI generation, or --steps-file / --emails-file with JSON arrays that match the API step objects.","Use --enrollment-mode matching_field for product- or variant-specific event sequences.",'Explicit --steps-file input can include dynamic Stripe or Shopify discount actions with {"type":"create_discount","discount":{"provider":"stripe","discountType":"percent","percentOff":20,"duration":"once","appliesToAllPlans":true}}; the code is created when each subscriber reaches the step, and later emails can use {{discount.code}}.',"Discount action sequences require the selected provider integration, such as Stripe or Shopify, before enabling.",HR],examples:["sequenzy sequences list --company comp_123",'sequenzy sequences create onboarding --trigger event_received --event-name signup.completed --goal "Guide new users to activation"',"sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json","sequenzy sequences update seq_123 --steps-file ./sequence-updates.json","sequenzy sequences enable seq_123"]});var i0A=J6.command("list").description("List sequences").option("--status <status>","Filter by draft, active, paused, or archived").option("--search <text>","Search sequence names and descriptions").option("--label <labels...>","Filter by dashboard label names").option("--limit <count>","Page size from 1 to 100").option("--offset <count>","Zero-based result offset").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>E9("list",A));X0(i0A,{examples:["sequenzy sequences list --company comp_123"]});var m0A=J6.command("get <id>").description("Get sequence details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("get",{id:A,...x}));X0(m0A,{examples:["sequenzy sequences get seq_123 --company comp_123"]});function fg0(A){return A.option("--description <text>","Goal description").option("--trigger-type <type>","Goal signal: event or attribute_change").option("--trigger-event-name <event>","Event goal signal name").option("--attribute-path <path>","Subscriber attribute goal path").option("--attribute-condition <condition>","changed, changed_to, or changed_from_to").option("--attribute-value <value>","Target subscriber attribute value").option("--attribute-previous-value <value>","Previous subscriber attribute value").option("--event-property-name <name>","Optional event property whose value is tracked").option("--event-property-label <label>","Display label for the tracked event property").option("--attribution-window-hours <hours>","Goal attribution window in hours")}var qR=J6.command("goals").description("Manage persisted sequence conversion goals");qR.command("list <sequenceId>").description("List sequence goals").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((A,x)=>E9("goals",{id:A,...x}));fg0(qR.command("create <sequenceId> <name>").description("Create a sequence conversion goal")).option("--active","Create the goal with conversion tracking on (default)").option("--inactive","Create the goal with conversion tracking off").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((A,x,E)=>E9("goal-create",{id:A,name:x,isActive:E.active,notActive:E.inactive,...E}));fg0(qR.command("update <sequenceId> <goalId>").description("Update a sequence conversion goal").option("--name <name>","Goal name")).option("--active","Enable the goal").option("--inactive","Disable the goal").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((A,x,E)=>E9("goal-update",{id:A,goalId:x,isActive:E.active,notActive:E.inactive,...E}));qR.command("delete <sequenceId> <goalId>").description("Delete a sequence conversion goal").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((A,x,E)=>E9("goal-delete",{id:A,goalId:x,...E}));var uk=J6.command("webhook").description("Manage a sequence inbound webhook endpoint");uk.command("get <sequenceId>").description("Read a sequence inbound webhook URL and setup status").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((A,x)=>E9("webhook-get",{id:A,...x}));uk.command("configure <sequenceId>").description("Create or update a sequence inbound webhook endpoint").option("--field-mapping-json <json>","Inline mapping with email, optional names, and property paths").option("--field-mapping-file <file>","JSON file containing the webhook field mapping").option("--sample-payload-json <json>","Inline representative webhook payload").option("--sample-payload-file <file>","JSON file containing a representative webhook payload").option("--clear-field-mapping","Clear the saved mapping and return the endpoint to pending setup").option("--clear-sample-payload","Clear the saved sample payload").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((A,x)=>E9("webhook-configure",{id:A,...x}));uk.command("rotate <sequenceId>").description("Rotate a sequence inbound webhook secret and URL").option("-c, --company <id>","Company ID override").option("--json","Print raw JSON").action((A,x)=>E9("webhook-rotate",{id:A,...x}));var c0A=J6.command("create <name>").description("Create a blank, AI-generated, or explicit-step sequence").option("-t, --trigger <trigger>","Sequence trigger type (defaults to contact_added)").option("--description <text>","Sequence description").option("--label <labels...>","Dashboard label names to assign").option("--user-cancellable","Allow subscribers to cancel enrollment").option("--not-user-cancellable","Prevent subscribers from cancelling enrollment").option("--from-email <email>","Sequence-level From address").option("--from-name <name>","Display name for --from-email").option("--sender-profile-id <id>","Existing sender profile ID").option("--reply-to <email>","Sequence-level Reply-To address").option("--reply-to-name <name>","Display name for --reply-to").option("--reply-profile-id <id>","Existing reply profile ID").option("--bcc-emails <emails>","Comma-separated sequence-level BCC addresses (max 10)").option("-g, --goal <goal>","AI generation goal for the sequence").option("--email-count <count>","Number of AI-generated emails when using --goal (1-10)").option("--duration-days <days>","Total duration in days for AI-generated sequence delays when using --goal").option("--email-style <style>","Style for AI-generated emails when using --goal: visual (designed) or plain (text-first)").option("--enrollment-mode <mode>","Enrollment mode: unlimited, one_time, or matching_field").option("--enrollment-field-path <path>","Event property dot path used by matching_field enrollment").option("--sending-window-start <time>","Earliest local send time for sequence emails (HH:mm, e.g. 08:00)").option("--sending-window-end <time>","Latest local send cutoff for sequence emails (HH:mm, e.g. 20:00)").option("--sending-window-timezone <timezone>","IANA timezone for the sequence sending window, e.g. Europe/Kiev").option("--sending-window-days <days>","Comma-separated days for sequence sends, e.g. weekdays or mon,tue,wed,thu,fri").option("--list-id <id>","List ID for contact_added triggers").option("--tag-name <name>","Tag name for tag_added triggers").option("--segment-id <id>","Segment ID for segment_entered triggers").option("--stop-on-segment-exit","Cancel active enrollments when a contact leaves the trigger segment").option("--event-name <name>","Event name for event_received, inbound_webhook, inactivity, and frequency triggers").option("--integration-slug <slug>","Inbound webhook integration slug").option("--integration-event-key <key>","Inbound webhook integration event key").option("--custom-integration-json <json>","Inline custom inbound webhook integration descriptor").option("--custom-integration-file <file>","JSON file with a custom inbound webhook integration descriptor").option("--property-filters-json <json>","Inline JSON array of event property filters for event_received triggers").option("--property-filters-file <file>","Path to a JSON file with event property filters").option("--inactive-days <days>","Days of inactivity for inactivity triggers").option("--inactivity-baseline <baseline>","Inactivity baseline: sequence_created_at or subscriber_created_at").option("--min-count <count>","Minimum event count for frequency triggers").option("--time-window-days <days>","Time window for frequency triggers").option("--steps-json <json>","Inline JSON array of sequence steps").option("--steps-file <file>","Path to a JSON file with sequence steps").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("create",{name:A,...x}));X0(c0A,{notes:["Provide --goal for AI generation, --steps-json/--steps-file for explicit content, or omit both for a blank dashboard-compatible draft.","Each explicit email step needs subject plus either html or blocks. Discount action steps use type=create_discount to dynamically create a code before an email that references {{discount.code}}.",'SMS steps use type="sms" with a plain-text "text" field (optional label, ineligibleAction skip|exit, imageUrls). Generate copy with `sequenzy generate sms` and check `sequenzy sms settings` first.','Update Subscriber steps use type="update_subscriber", nodeType="action_update_attributes", and config values such as {{event.plan}}, {{event.amount}}, or {{event.active}}.',"For migrated provider flows, put the exact provider HTML in each step's html field; Sequenzy stores it as raw HTML. Use delay or delayMs for waits.","Prefer --steps-file for anything non-trivial. The CLI passes the JSON through to the API.","Shopify replenishment and back-in-stock event sequences default to matching_field.","Use --enrollment-field-path for custom event keys such as order.id or product.providerVariantId.","Use --property-filters-json/--property-filters-file with event_received triggers to only start the sequence when the event properties match, e.g. scope a purchase sequence to one product.","Use --sending-window-start/--sending-window-end/--sending-window-timezone to hold every email step until the allowed local send window. Add --sending-window-days weekdays for working days only.","Discount action sequences require the selected provider integration, such as Stripe or Shopify, before enabling."],examples:['sequenzy sequences create onboarding --trigger event_received --event-name signup.completed --goal "Guide new users to activation" --email-count 4 --duration-days 10','sequenzy sequences create trial --trigger tag_added --tag-name trial --goal "Convert trial users" --sending-window-start 08:00 --sending-window-end 20:00 --sending-window-timezone Europe/Kiev --sending-window-days weekdays',"sequenzy sequences create restock --trigger event_received --event-name ecommerce.back_in_stock --enrollment-mode matching_field --steps-file ./steps.json",`sequenzy sequences create deliver-ebook --trigger event_received --event-name ecommerce.order_placed --property-filters-json '[{"path":"lineItems[].providerProductId","operator":"equals","value":"prod_123"}]' --steps-file ./steps.json`,"sequenzy sequences create post-purchase --trigger event_received --event-name ecommerce.order_placed --enrollment-mode matching_field --enrollment-field-path order.id --steps-file ./steps.json","sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json",`sequenzy sequences create purchase-profile --trigger event_received --event-name saas.purchase --steps-json '[{"type":"update_subscriber","nodeType":"action_update_attributes","config":{"customAttributeUpdates":[{"name":"plan","value":"{{event.plan}}","valueType":"text"}]}},{"subject":"Thanks","html":"<p>Purchase received.</p>"}]'`,"sequenzy sequences create rescue --trigger inactivity --event-name login --inactive-days 14 --steps-file ./steps.json"]});var p0A=J6.command("update <id>").description("Update sequence metadata, email step content, stop conditions, or paths").option("-n, --name <name>","Sequence name").option("--description <text>","Sequence description").option("--label <labels...>","Replace dashboard label names").option("--clear-labels","Remove all dashboard labels from the sequence").option("--user-cancellable","Allow subscribers to cancel enrollment").option("--not-user-cancellable","Prevent subscribers from cancelling enrollment").option("--trigger <trigger>","Replace the sequence trigger type").option("--list-id <id>","List ID for contact_added").option("--tag-name <name>","Tag name for tag_added").option("--segment-id <id>","Segment ID for segment_entered").option("--stop-on-segment-exit","Stop active enrollments when a contact leaves the trigger segment").option("--no-stop-on-segment-exit","Keep active enrollments running when a contact leaves the trigger segment").option("--event-name <event>","Event name for event, webhook, inactivity, or frequency triggers").option("--integration-slug <slug>","Catalog integration slug for inbound_webhook").option("--integration-event-key <key>","Catalog event key for inbound_webhook").option("--custom-integration-json <json>","Inline custom inbound webhook integration descriptor").option("--custom-integration-file <file>","JSON file containing a custom inbound webhook integration descriptor").option("--property-filters-json <json>","Inline event trigger property filters").option("--property-filters-file <file>","JSON file containing event trigger property filters").option("--inactive-days <days>","Days required for inactivity").option("--inactivity-baseline <baseline>","Inactivity baseline: sequence_created_at or subscriber_created_at").option("--min-count <count>","Minimum frequency event count").option("--time-window-days <days>","Frequency lookback window").option("--from-email <email>","Sequence-level From address").option("--from-name <name>","Display name for --from-email").option("--sender-profile-id <id>","Existing sender profile ID").option("--reply-to <email>","Sequence-level Reply-To address").option("--reply-to-name <name>","Display name for --reply-to").option("--reply-profile-id <id>","Existing reply profile ID").option("--enrollment-mode <mode>","Enrollment mode: unlimited, one_time, or matching_field").option("--enrollment-field-path <path>","Event property dot path used by matching_field enrollment").option("--pause-new-enrollments","Stop new sequence enrollments while current recipients continue").option("--resume-new-enrollments","Resume new sequence enrollments while current recipients continue").option("--sending-window-start <time>","Earliest local send time for sequence emails (HH:mm, e.g. 08:00)").option("--sending-window-end <time>","Latest local send cutoff for sequence emails (HH:mm, e.g. 20:00)").option("--sending-window-timezone <timezone>","IANA timezone for the sequence sending window, e.g. Europe/Kiev").option("--sending-window-days <days>","Comma-separated days for sequence sends, e.g. weekdays or mon,tue,wed,thu,fri").option("--clear-sending-window","Disable the sequence sending window").option("--bcc-emails <emails>","Comma-separated BCC addresses copied on every email this sequence sends, e.g. a support inbox (max 10)").option("--clear-bcc-emails","Remove the sequence BCC addresses").option("--confirm-structural-change","Confirm an insertSteps or branch structural edit to an active sequence").option("--confirm-live-change","Confirm node config edits to an active sequence").option("--steps-json <json>","Inline JSON array of step updates").option("--steps-file <file>","Path to a JSON file with step updates").option("--emails-json <json>","Inline JSON array of email updates; native-block emails, including supported custom HTML blocks, may set emailPreset to branded or minimal").option("--emails-file <file>","Path to a JSON file with email updates; native-block emails, including supported custom HTML blocks, may set emailPreset to branded or minimal").option("--sms-steps-json <json>","Inline JSON array of SMS step content updates (targeted by nodeId)").option("--sms-steps-file <file>","Path to a JSON file with SMS step content updates").option("--subscriber-update-steps-json <json>","Inline JSON array of Update Subscriber configs targeted by nodeId").option("--subscriber-update-steps-file <file>","Path to a JSON file with Update Subscriber configs targeted by nodeId").option("--branch-json <json>","Inline JSON object for inserting an if/else branch with path steps and/or existing target node IDs").option("--branch-file <file>","Path to a JSON file for inserting an if/else branch with path steps and/or existing target node IDs").option("--insert-steps-json <json>","Inline JSON object for inserting new linear steps").option("--insert-steps-file <file>","Path to a JSON file for inserting new linear steps").option("--node-updates-json <json>","Inline typed nodeUpdates array from sequences get").option("--node-updates-file <file>","JSON file containing typed nodeUpdates").option("--graph-edit-json <json>","Inline graphEdit object using the current graphRevision").option("--graph-edit-file <file>","JSON file containing a graphEdit operation").option("--stop-condition-json <json>","Inline JSON object for updating the sequence stop condition").option("--stop-condition-file <file>","Path to a JSON file for updating the sequence stop condition").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("update",{id:A,...x}));X0(p0A,{notes:["Use either the steps form or the emails form, not both.","Each update entry can target a step by nodeId, emailId, or by array order.","Use --insert-steps-json/--insert-steps-file to add new linear steps, including outbound webhooks; use --steps-* or --emails-* to edit existing email steps.",'Inserted steps can be SMS steps: {"type":"sms","text":"...","delay":{"days":1}}. Generate copy with `sequenzy generate sms`.','Edit existing SMS steps with --sms-steps-json/--sms-steps-file: [{"nodeId":"node_sms","text":"New message"}]. Entries may also update label and ineligibleAction.','Edit existing Update Subscriber steps with --subscriber-update-steps-json/--subscriber-update-steps-file: [{"nodeId":"node_update","config":{"customAttributeUpdates":[{"name":"plan","value":"{{event.plan}}","valueType":"text"}]}}].',"For migrated provider flow steps, use html/htmlContent to preserve exact HTML as raw HTML and use delay or delayMs for waits.","When inserting steps or branches into an active sequence, pass --confirm-structural-change after confirming the live-flow impact.",'Use --stop-condition-json/--stop-condition-file with values like {"type":"has_tag","value":"customer"}; use {"type":"none","value":null} to clear it.',"Branch condition types include has_tag, does_not_have_tag, in_list, in_segment, event_received, link_clicked, and field_* comparisons. Use activityScope (this_sequence, previous_email, ever) for event and click checks.","Branch paths may set targetNodeId and elseTargetNodeId to wire directly to existing nodes from sequences get, including the completion node. If path steps are also provided, they run before that target.","Use --clear-sending-window to remove a configured send window.","Use --bcc-emails with a comma-separated list to blind-copy team inboxes on every sequence email; use --clear-bcc-emails to remove them."],examples:['sequenzy sequences update seq_123 --name "User Onboarding"',"sequenzy sequences update seq_123 --pause-new-enrollments","sequenzy sequences update seq_123 --resume-new-enrollments","sequenzy sequences update seq_123 --enrollment-mode matching_field","sequenzy sequences update seq_123 --enrollment-field-path order.id","sequenzy sequences update seq_123 --sending-window-start 08:00 --sending-window-end 20:00 --sending-window-timezone Europe/Kiev --sending-window-days weekdays","sequenzy sequences update seq_123 --clear-sending-window",'sequenzy sequences update seq_123 --bcc-emails "cs-team@yourcompany.com, founder@yourcompany.com"',"sequenzy sequences update seq_123 --clear-bcc-emails","sequenzy sequences update seq_123 --steps-file ./sequence-updates.json",`sequenzy sequences update seq_123 --stop-condition-json '{"type":"has_tag","value":"customer"}'`,`sequenzy sequences update seq_123 --insert-steps-json '{"afterNodeId":"node_email","steps":[{"delay":{"days":1},"subject":"Migration check-in","html":"<p>Need help migrating?</p>"}]}' --confirm-structural-change`,`sequenzy sequences update seq_123 --insert-steps-json '{"afterNodeId":"node_email","steps":[{"nodeType":"logic_wait_for_event","config":{"label":"Wait for reply","eventName":"email.replied","timeoutDays":5,"timeoutAction":"continue"}}]}'`,`sequenzy sequences update seq_123 --branch-json '{"afterNodeId":"node_email","branches":[{"conditionType":"link_clicked","linkUrl":"project-invites","activityScope":"previous_email","steps":[{"subject":"Invite accepted","html":"<p>Thanks for accepting.</p>"}]}],"elseSteps":[{"subject":"Reminder","html":"<p>Please accept your invite.</p>"}]}'`,`sequenzy sequences update seq_123 --branch-json '{"afterNodeId":"node_email_1","branches":[{"id":"replied","conditionType":"event_received","eventName":"email.replied","activityScope":"this_sequence","targetNodeId":"node_complete"}],"elseTargetNodeId":"node_email_2"}'`,"sequenzy sequences update seq_123 --branch-file ./branch.json",`sequenzy sequences update seq_123 --sms-steps-json '[{"nodeId":"node_sms","text":"Hey {{FIRST_NAME}}, your order shipped!"}]'`,`sequenzy sequences update seq_123 --subscriber-update-steps-json '[{"nodeId":"node_update","config":{"customAttributeUpdates":[{"name":"mrr","value":"{{event.amount}}","valueType":"number"}]}}]'`]});var r0A=J6.command("enable <id>").description("Enable a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("enable",{id:A,...x}));X0(r0A,{examples:["sequenzy sequences enable seq_123"]});var _0A=J6.command("disable <id>").description("Disable a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("disable",{id:A,...x}));X0(_0A,{examples:["sequenzy sequences disable seq_123"]});var n0A=J6.command("duplicate <id>").description("Create an independent draft copy of a sequence").option("-n, --name <name>","Name for the copied sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("duplicate",{id:A,...x}));X0(n0A,{notes:["Email templates, graph topology, and sequence A/B tests are copied independently."],examples:["sequenzy sequences duplicate seq_123",'sequenzy sequences duplicate seq_123 --name "Welcome Series v2"']});var l0A=J6.command("archive <id>").description("Archive a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("archive",{id:A,...x}));X0(l0A,{examples:["sequenzy sequences archive seq_123"]});var d0A=J6.command("unarchive <id>").description("Restore an archived sequence as a draft").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("unarchive",{id:A,...x}));X0(d0A,{examples:["sequenzy sequences unarchive seq_123"]});var a0A=J6.command("pause-enrollments <id>").description("Stop new enrollments while current sequence recipients continue").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("pause-enrollments",{id:A,...x}));X0(a0A,{notes:["The sequence must already be active. Existing active and waiting recipients keep moving through the sequence.","Use sequences disable when you want to freeze current recipients too."],examples:["sequenzy sequences pause-enrollments seq_123"]});var s0A=J6.command("resume-enrollments <id>").description("Resume new enrollments for an active sequence without changing current recipients").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("resume-enrollments",{id:A,...x}));X0(s0A,{notes:["The sequence must already be active. Use sequences enable to resume a fully disabled sequence."],examples:["sequenzy sequences resume-enrollments seq_123"]});var o0A=J6.command("enroll <id>").description("Manually enroll subscribers in a sequence").option("-e, --email <emails...>","Email addresses to enroll").option("--subscriber-ids <ids...>","Subscriber IDs to enroll").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--target-node-id <nodeId>","Sequence node to enroll at; defaults to the first step after the trigger").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("enroll",{id:A,...x}));X0(o0A,{notes:["Provide at least one target using --subscriber-ids or exactly one email source: --email, --emails-json, or --emails-file.","Subscribers must be active; unknown emails are reported as not found and inactive, unavailable, or already enrolled subscribers are skipped.","Enrollment requires the sequence to be accepting entrants (enabled and not paused for enrollment)."],examples:["sequenzy sequences enroll seq_123 --email one@example.com two@example.com","sequenzy sequences enroll seq_123 --subscriber-ids sub_123 sub_456 --target-node-id node_email_2","sequenzy sequences enroll seq_123 --emails-file ./vips.csv","sequenzy sequences enroll seq_123 --email one@example.com --target-node-id node_email_2"]});var t0A=J6.command("cancel-enrollments <id>").description("Cancel active or waiting subscriber enrollments in a sequence").option("--subscriber-id <id>","Cancel enrollments for one subscriber ID").option("--field-path <path>","Entry event property dot path to match, such as order.id").option("--field-values <values>","Comma-separated entry field values to match").option("--reason <reason>","Reason stored on cancelled enrollments").option("--apply","Actually cancel matches; otherwise only dry-run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("cancel-enrollments",{id:A,...x}));X0(t0A,{notes:["sequenceId is always required. Provide exactly one target: --subscriber-id or --field-values.","Without --apply, this command only reports matching enrollments.","When --field-path is omitted, the API uses the sequence enrollmentFieldPath if configured."],examples:["sequenzy sequences cancel-enrollments seq_123 --subscriber-id sub_123 --apply","sequenzy sequences cancel-enrollments seq_123 --field-path order.id --field-values ord_123,ord_456"]});var e0A=J6.command("delete <id>").description("Delete a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>E9("delete",{id:A,...x}));X0(e0A,{examples:["sequenzy sequences delete seq_123"]});var C2=A8.command("ab-tests").description("Inspect and edit A/B test variants").action(()=>C2.help());X0(C2,{notes:["Use get to discover variant IDs, then update-variant to edit a specific A/B variant.","Only draft A/B tests can be edited.","create, add-variant, and delete-variant work on campaign and sequence A/B tests; delete works on campaign A/B tests only."],examples:["sequenzy ab-tests list --sequence seq_123","sequenzy ab-tests get ab_123","sequenzy ab-tests stats ab_123 --period 7d","sequenzy ab-tests create camp_123 --test-percentage 20 --winner-criteria open_rate",'sequenzy ab-tests add-variant ab_123 --subject "Alternative subject"',"sequenzy ab-tests restart ab_123 --source-variant var_b",'sequenzy ab-tests update-variant ab_123 var_b --subject "New subject"',"sequenzy ab-tests update-variant ab_123 var_b --blocks-file ./variant-b.json"]});var AAA=C2.command("list").description("List A/B tests").option("--sequence <id>","Filter by sequence ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>p2("list",A));X0(AAA,{examples:["sequenzy ab-tests list --sequence seq_123"]});var xAA=C2.command("get <id>").description("Get A/B test details and variants").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>p2("get",{id:A,...x}));X0(xAA,{examples:["sequenzy ab-tests get ab_123"]});var EAA=C2.command("stats <id>").description("Get A/B test variant stats").option("-p, --period <period>","Time period (1h, 24h, 7d, 30d, 90d)").option("--start <iso>","Custom range start as ISO 8601").option("--end <iso>","Custom range end as ISO 8601").option("--include-bots","Include machine-classified bot/scanner opens and clicks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>p2("stats",{id:A,...x}));X0(EAA,{notes:["Use --period or both --start and --end. Custom ranges max at 90 days.","Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement."],examples:["sequenzy ab-tests stats ab_123","sequenzy ab-tests stats ab_123 --period 30d","sequenzy ab-tests stats ab_123 --include-bots"]});var BAA=C2.command("restart <id>").description("Run another sequence A/B test from an existing variant").option("--source-variant <id>","Variant to use as the new control. Defaults to the selected winner.").option("--test-type <type>","Test type for generated variants: subject or content").option("--winner-threshold <count>","Subscribers before selecting a winner (10-1000)").option("--variant-count <count>","Total variants including control (2-4)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>p2("restart",{id:A,...x}));X0(BAA,{notes:["Only sequence A/B tests with a selected winner can be restarted.","Run `sequenzy ab-tests get <id>` first to find variant IDs."],examples:["sequenzy ab-tests restart ab_123","sequenzy ab-tests restart ab_123 --source-variant var_b --test-type content --variant-count 3"]});var gAA=C2.command("update-variant <id> <variantId>").description("Update a draft A/B test variant").option("-s, --subject <subject>","Variant subject").option("--preview-text <text>","Variant preview text").option("--html <html>","Replacement HTML body").option("--html-file <file>","Read replacement HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--confirm-live-change","Confirm updating a variant used by an active sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x,E)=>p2("update-variant",{id:A,variantId:x,...E}));X0(gAA,{notes:["Provide either HTML or blocks, not both.","Use --confirm-live-change when the variant belongs to an active sequence.","Run `sequenzy ab-tests get <id>` first to find variant IDs."],examples:['sequenzy ab-tests update-variant ab_123 var_b --subject "New subject"',"sequenzy ab-tests update-variant ab_123 var_b --html-file ./variant-b.html"]});var QAA=C2.command("create [campaignId]").description("Create a campaign or sequence-node A/B test").option("--automation-node <nodeId>","Convert this sequence email node into an A/B test node").option("--confirm-live-change","Confirm conversion of an email node in an active sequence").option("-n, --name <name>","A/B test name").option("--test-percentage <percent>","Share of the audience used for testing (5-50, default 20)").option("--duration-minutes <minutes>","Test duration before a winner is selected (15-1440, default 240)").option("--winner-criteria <criteria>","Winner criteria: open_rate or click_rate (default open_rate)").option("--test-type <type>","Sequence test type: subject or content (default content)").option("--winner-threshold <count>","Sequence test sample size (10-1000, default 100)").option("--variants-json <json>","Inline JSON array of extra variants ({subject, previewText?, blocks?})").option("--variants-file <file>","Path to a JSON file with extra variants ({subject, previewText?, blocks?})").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>p2("create",{campaignId:A,automationNodeId:x.automationNode,...x}));X0(QAA,{notes:["Provide either a campaign ID or --automation-node, but not both.","Campaigns must be in draft or rejected status. Sequence node IDs must reference an email node.","Variant A is created automatically from the campaign email; provided variants are added after it."],examples:["sequenzy ab-tests create camp_123",`sequenzy ab-tests create --automation-node node_123 --test-type content --winner-threshold 100 --variants-json '[{"subject":"Variant B"}]'`,"sequenzy ab-tests create camp_123 --test-percentage 30 --duration-minutes 120 --winner-criteria click_rate",`sequenzy ab-tests create camp_123 --variants-json '[{"subject":"Alternative subject"}]'`]});var DAA=C2.command("add-variant <id>").description("Add a variant to a draft campaign or sequence A/B test").requiredOption("-s, --subject <subject>","Variant subject").option("--preview-text <text>","Variant preview text").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--confirm-live-change","Confirm adding a variant to an A/B test in an active sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>p2("add-variant",{id:A,...x}));X0(DAA,{notes:["Variants can only be added while the A/B test is in draft status.","A/B tests in an active sequence require --confirm-live-change."],examples:['sequenzy ab-tests add-variant ab_123 --subject "Alternative subject"','sequenzy ab-tests add-variant ab_123 --subject "Alternative subject" --blocks-file ./variant.json']});var CAA=C2.command("delete-variant <id> <variantId>").description("Remove a variant from a draft campaign or sequence A/B test").option("-y, --yes","Skip the confirmation prompt").option("--confirm-live-change","Confirm deleting a variant from an A/B test in an active sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x,E)=>p2("delete-variant",{id:A,variantId:x,...E}));X0(CAA,{notes:["Variant A is the control variant and cannot be deleted.","Variants can only be removed while the A/B test is in draft status.","A/B tests in an active sequence require --confirm-live-change."],examples:["sequenzy ab-tests delete-variant ab_123 var_b --yes"]});var FAA=C2.command("delete <id>").description("Delete a campaign A/B test").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>p2("delete",{id:A,...x}));X0(FAA,{notes:["Running A/B tests cannot be deleted; the linked campaign must be draft or rejected."],examples:["sequenzy ab-tests delete ab_123 --yes"]});var vD=A8.command("templates").description("Manage email templates").action(()=>vD.help());X0(vD,{notes:["Template content can be provided as raw HTML or as Sequenzy blocks JSON.","Templates can be assigned labels and listed by label for integration dashboards.","Use blocks when you need conditional content, per-block styles, or an exact editor-compatible structure.",HR],examples:["sequenzy templates list --company comp_123","sequenzy templates list --label edm --company comp_123",'sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --label edm template --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --blocks-file ./welcome-blocks.json','sequenzy templates update tmpl_123 --subject "Updated" --html-file ./welcome-v2.html','sequenzy templates localizations set tmpl_123 es --subject "Hola" --html-file ./welcome-es.html',"sequenzy templates localizations sync tmpl_123 --locale es fr"]});var IAA=vD.command("list").description("List all templates").option("--label <labels...>","Filter by label name").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>ND("list",A));X0(IAA,{examples:["sequenzy templates list --company comp_123","sequenzy templates list --label edm --company comp_123"]});var wAA=vD.command("get <id>").description("Get template details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>ND("get",{id:A,...x}));X0(wAA,{examples:["sequenzy templates get tmpl_123 --company comp_123"]});var JAA=vD.command("create <name>").description("Create a template").option("-s, --subject <subject>","Email subject (optional with --prompt)").option("--preview-text <text>","Email preview text override").option("--prompt <prompt>","Generate branded native blocks from a prompt").option("--style <style>","Prompt generation style").option("--tone <tone>","Prompt generation tone").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--label <labels...>","Label names to assign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>ND("create",{name:A,...x}));X0(JAA,{notes:["Provide exactly one of prompt, HTML, or blocks JSON content.","Use blocks when you need conditional content, per-block styles, or exact editor parity."],examples:['sequenzy templates create welcome --prompt "Welcome new customers"','sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --label edm template --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --blocks-file ./welcome-blocks.json']});var fAA=vD.command("update <id>").description("Update a template").option("-n, --name <name>","Template name").option("-s, --subject <subject>","Email subject").option("--preview-text <text>","Inbox preview text").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--label <labels...>","Replace label names").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>ND("update",{id:A,...x}));X0(fAA,{notes:["Provide at least one of --name, --subject, --preview-text, --label, --html, --html-file, --blocks-json, or --blocks-file.","Do not combine HTML flags with blocks flags in the same request."],examples:['sequenzy templates update tmpl_123 --subject "Updated"','sequenzy templates update tmpl_123 --preview-text "A warmer inbox preview"',"sequenzy templates update tmpl_123 --label edm template","sequenzy templates update tmpl_123 --html-file ./welcome-v2.html","sequenzy templates update tmpl_123 --blocks-file ./welcome-v2-blocks.json"]});var YR=vD.command("localizations").description("Manage localized template variants").action(()=>YR.help());X0(YR,{notes:["Set stores caller-supplied localized content immediately.","Sync queues AI translation for selected locales, or every enabled non-primary locale when --locale is omitted."],examples:['sequenzy templates localizations set tmpl_123 es --subject "Hola" --html-file ./welcome-es.html',"sequenzy templates localizations sync tmpl_123 --locale es fr","sequenzy templates localizations sync tmpl_123"]});var KAA=YR.command("set <id> <locale>").description("Create or replace a localized template variant").requiredOption("-s, --subject <subject>","Localized email subject").option("--preview-text <text>","Localized email preview text").option("--html <html>","Localized email HTML content").option("--html-file <file>","Read localized HTML from file").option("--blocks-json <json>","Inline JSON array of localized Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with localized Sequenzy email blocks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x,E)=>ND("set-localization",{id:A,locale:x,...E}));X0(KAA,{notes:["The locale must be enabled in the company's localization settings and cannot be the primary locale.","Provide exactly one HTML or blocks content source."],examples:['sequenzy templates localizations set tmpl_123 es --subject "Hola" --html-file ./welcome-es.html','sequenzy templates localizations set tmpl_123 fr-CA --subject "Bienvenue" --blocks-file ./welcome-fr-ca.json']});var $AA=YR.command("sync <id>").description("Queue AI translation for template locales").option("--locale <locales...>","Enabled locales to sync; omit to sync every non-primary locale").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>ND("sync-localizations",{id:A,locales:x.locale,company:x.company,json:x.json}));X0($AA,{examples:["sequenzy templates localizations sync tmpl_123 --locale es fr","sequenzy templates localizations sync tmpl_123"]});var HAA=vD.command("delete <id>").description("Delete a template").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>ND("delete",{id:A,...x}));X0(HAA,{notes:["Deletion fails when the template is still referenced by a campaign or sequence."],examples:["sequenzy templates delete tmpl_123"]});var XJ=A8.command("companies").description("Inspect or create companies").action(()=>XJ.help());X0(XJ,{notes:["Company creation starts background website processing automatically."],examples:["sequenzy companies list","sequenzy companies get comp_123","sequenzy companies update comp_123 --primary-color '#0ea5e9'","sequenzy companies create example.com --name Example"]});var yAA=XJ.command("list").description("List accessible companies").option("--json","Print raw JSON").action((A)=>cH("list",A));X0(yAA,{examples:["sequenzy companies list"]});var qAA=XJ.command("get <id>").description("Get company details").option("--json","Print raw JSON").action((A,x)=>cH("get",{id:A,...x}));X0(qAA,{examples:["sequenzy companies get comp_123"]});var YAA=XJ.command("update <id>").description("Update company info, brand context, and reply tracking").option("-n, --name <name>","Company display name").option("--description <text>","Short product or company summary").option("--description-file <path>","Read description from a file").option("--logo-url <url>","Public logo URL").option("--founder-name <name>","Founder or sender name").option("--primary-color <hex>","Primary brand color, e.g. #f97316").option("--brand-colors-json <json>","Brand colors object as JSON").option("--brand-colors-file <path>","Read brand colors JSON from a file").option("--value-props-json <json>","Value propositions array as JSON").option("--value-props-file <path>","Read value propositions JSON from a file").option("--testimonials-json <json>","Testimonials array as JSON").option("--testimonials-file <path>","Read testimonials JSON from a file").option("--tone-voice <text>","Tone of voice guidance").option("--company-context <text>","Product knowledge for AI writing").option("--company-context-file <path>","Read product knowledge from a file").option("--email-length-preference <value>","Email length: concise, balanced, or detailed").option("--social-links-json <json>","Social links object as JSON").option("--social-links-file <path>","Read social links JSON from a file").option("--privacy-policy-url <url>","Privacy policy URL").option("--terms-url <url>","Terms of service URL").option("--address <address>","Physical mailing address").option("--language <code>","Primary language code").option("--pricing-json <json>","Pricing object as JSON").option("--pricing-file <path>","Read pricing JSON from a file").option("--font-family <family>","Default email font family").option("--email-theme-json <json>","Default email theme as JSON (partial: presetId, colors, typography, layout; pass null to reset)").option("--email-theme-file <path>","Read the default email theme JSON from a file").option("--email-direction <direction>","Default email direction: ltr or rtl").option("--enable-reply-tracking","Enable inbound reply tracking").option("--disable-reply-tracking","Disable inbound reply tracking").option("--reply-tracking-domain-mode <mode>","Reply domain mode: sequenzy or custom").option("--enable-reply-forwarding","Enable captured reply forwarding").option("--disable-reply-forwarding","Disable captured reply forwarding").option("--json","Print raw JSON").action((A,x)=>cH("update",{id:A,...x}));X0(YAA,{examples:["sequenzy companies update comp_123 --primary-color '#0ea5e9'",`sequenzy companies update comp_123 --email-theme-json '{"colors":{"mutedText":"#4b5563"},"typography":{"baseFontSize":16}}'`,"sequenzy companies update comp_123 --company-context-file ./product.md --tone-voice 'clear, direct, warm'","sequenzy companies update comp_123 --enable-reply-tracking --reply-tracking-domain-mode sequenzy",`sequenzy companies update comp_123 --value-props-json '[{"title":"Fast setup","description":"Launch lifecycle emails in minutes."}]'`]});var XAA=XJ.command("create <domain>").description("Create a company and queue website processing").option("-n, --name <name>","Company name").option("--json","Print raw JSON").action((A,x)=>cH("create",{domain:A,...x}));X0(XAA,{examples:["sequenzy companies create example.com","sequenzy companies create https://example.com --name Example"]});var zy=A8.command("tags").description("Manage tag definitions").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>YJ("list",A));X0(zy,{notes:["Running `sequenzy tags` without a subcommand lists tag definitions.","Tag names are normalized to lowercase with dashes; system tags cannot be changed or deleted."],examples:["sequenzy tags --company comp_123","sequenzy tags list","sequenzy tags create vip --color purple","sequenzy tags update tag_123 --color red","sequenzy tags delete tag_123 --yes"]});var ZAA=zy.command("list").description("List tag definitions").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>YJ("list",A));X0(ZAA,{examples:["sequenzy tags list --company comp_123"]});var UAA=zy.command("create <name>").description("Create a tag definition").option("--color <color>","Tag color, e.g. gray, red, green, blue, purple").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>YJ("create",{name:A,...x}));X0(UAA,{notes:["Names are normalized to lowercase with dashes, so `VIP Customer` becomes `vip-customer`."],examples:["sequenzy tags create vip","sequenzy tags create vip --color purple"]});var GAA=zy.command("update <tagId>").description("Update a tag definition color").requiredOption("--color <color>","New tag color").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>YJ("update",{tagId:A,...x}));X0(GAA,{notes:["System tags cannot be updated."],examples:["sequenzy tags update tag_123 --color red"]});var WAA=zy.command("delete <tagId>").description("Delete a tag definition").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>YJ("delete",{tagId:A,...x}));X0(WAA,{notes:["Deleting a tag removes it from every subscriber.","Tags used by sequences cannot be deleted until those sequences stop referencing them."],examples:["sequenzy tags delete tag_123 --yes"]});var bg=A8.command("lists").description("Manage subscriber lists").action(()=>bg.help());X0(bg,{examples:["sequenzy lists list --company comp_123",'sequenzy lists create Newsletter --description "Public newsletter list"','sequenzy lists update list_123 --name "Weekly Newsletter" --private',"sequenzy lists add-subscribers list_123 --emails-file ./batch-001.csv","sequenzy lists remove-subscribers list_123 --email one@example.com","sequenzy lists import list_123 --emails-file ./batch-001.csv","sequenzy lists delete list_123 --yes"]});var RAA=bg.command("list").description("List subscriber lists").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>UD("list",A));X0(RAA,{examples:["sequenzy lists list --company comp_123"]});var MAA=bg.command("create <name>").description("Create a subscriber list").option("-d, --description <text>","List description").option("--private","Mark the list as private").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UD("create",{name:A,...x}));X0(MAA,{examples:['sequenzy lists create Newsletter --description "Public newsletter list"',"sequenzy lists create VIP --private --company comp_123"]});var zAA=bg.command("add-subscribers <listId>").description("Add subscribers to a list from emails, JSON, or a file").option("-e, --email <emails...>","Email addresses to add").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--duplicate-strategy <strategy>","Duplicate strategy: skip, merge, or overwrite","skip").option("--enroll-sequences","Enroll newly created subscribers in matching sequences").option("--opt-in-mode <mode>","Consent mode: default, confirmed, or double_opt_in","default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UD("add-subscribers",{listId:A,...x}));X0(zAA,{notes:["Provide exactly one source: --email, --emails-json, or --emails-file.","Files may be newline-separated, CSV with an email column, a JSON email array, or a JSON object with emails/subscribers.","CSV headers named email, e-mail, email address, or mail are detected; otherwise the first column is used.","New subscribers are not enrolled in matching sequences unless --enroll-sequences is set."],examples:["sequenzy lists add-subscribers list_123 --email one@example.com two@example.com",`sequenzy lists add-subscribers list_123 --emails-json '["one@example.com","two@example.com"]'`,"sequenzy lists add-subscribers list_123 --emails-file ./batch-001.csv"]});var SAA=bg.command("import <listId>").description("Alias for add-subscribers; import subscribers into a list").option("-e, --email <emails...>","Email addresses to add").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--duplicate-strategy <strategy>","Duplicate strategy: skip, merge, or overwrite","skip").option("--enroll-sequences","Enroll newly created subscribers in matching sequences").option("--opt-in-mode <mode>","Consent mode: default, confirmed, or double_opt_in","default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UD("add-subscribers",{listId:A,...x}));X0(SAA,{notes:["`lists import` is an alias for `lists add-subscribers`.","Provide exactly one source: --email, --emails-json, or --emails-file.","Files may be newline-separated, CSV with an email column, a JSON email array, or a JSON object with emails/subscribers.","CSV headers named email, e-mail, email address, or mail are detected; otherwise the first column is used."],examples:["sequenzy lists import list_123 --emails-file ./batch-001.csv",`sequenzy lists import list_123 --emails-json '["one@example.com","two@example.com"]'`]});var LAA=bg.command("update <listId>").description("Update a subscriber list").option("-n, --name <name>","List name").option("-d, --description <text>","List description").option("--private","Mark the list as private").option("--no-private","Mark the list as public").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UD("update",{listId:A,...x}));X0(LAA,{notes:["Provide at least one of --name, --description, --private, or --no-private."],examples:['sequenzy lists update list_123 --name "Weekly Newsletter"',"sequenzy lists update list_123 --private","sequenzy lists update list_123 --no-private"]});var OAA=bg.command("remove-subscribers <listId>").description("Remove subscribers from a list by email").option("-e, --email <emails...>","Email addresses to remove").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UD("remove-subscribers",{listId:A,...x}));X0(OAA,{notes:["Provide exactly one source: --email, --emails-json, or --emails-file.","Subscribers are only removed from the list; they stay in your audience.","Emails that do not match a subscriber are reported as not found."],examples:["sequenzy lists remove-subscribers list_123 --email one@example.com two@example.com","sequenzy lists remove-subscribers list_123 --emails-file ./churned.csv"]});var jAA=bg.command("delete <listId>").description("Delete a subscriber list").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UD("delete",{listId:A,...x}));X0(jAA,{notes:["Deleting a list removes all of its memberships; subscribers themselves are kept."],examples:["sequenzy lists delete list_123 --yes"]});var aF=A8.command("segments").description("Manage segments").action(()=>aF.help());X0(aF,{notes:["Use --filter-json for arbitrary segment filters. The CLI will fill in missing filter IDs.","Use --match any to create a segment that matches any filter instead of all filters.",'Engagement filters (emailSent, emailOpened, emailClicked, emailBounced, emailComplained) accept either a time range as the value ("7d", "30d", "90d", "180d", "all") OR a specific campaign ("campaign:<campaign_id>"). Combine multiple engagement filters with --match all to build things like "bounced campaign A but not campaign B".'],examples:["sequenzy segments list --company comp_123",'sequenzy segments create --name "Bought Pro" --stripe-product prod_pro',`sequenzy segments create --name "VIP or Churn Risk" --match any --filter-json '[{"field":"tag","operator":"contains","value":"vip"},{"field":"emailOpened","operator":"is_not","value":"30d"}]'`,`sequenzy segments create --name "Bounced A not B" --filter-json '[{"field":"emailBounced","operator":"is","value":"campaign:cmp_abc"},{"field":"emailBounced","operator":"is_not","value":"campaign:cmp_xyz"}]'`]});var PAA=aF.command("list").description("List all segments").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>nw("list",A));X0(PAA,{examples:["sequenzy segments list --company comp_123"]});var NAA=aF.command("create").description("Create a segment").requiredOption("-n, --name <name>","Segment name").option("-c, --company <id>","Company ID override for personal API keys").option("--match <mode>","How filters combine: all or any","all").option("--stripe-product <id>","Stripe product ID to segment on").option("--commerce-product <id>","Commerce product to segment on, as provider:productId (e.g. shopify:42); a bare ID matches any provider").option("--purchase-operator <operator>","Purchase operator (bought, didnt-buy, at-least, less-than)","bought").option("--payments <number>","Payment threshold for at-least/less-than").option("--orders <number>","Order threshold for at-least/less-than with --commerce-product").option("--filter-json <json>","Raw JSON array of segment filters (IDs are optional)").option("--json","Print raw JSON").action((A)=>nw("create",A));X0(NAA,{examples:['sequenzy segments create --name "Bought Pro" --stripe-product prod_pro','sequenzy segments create --name "3+ Pro Payments" --stripe-product prod_pro --purchase-operator at-least --payments 3','sequenzy segments create --name "Starter Kit Buyers" --commerce-product api:prod-starter-kit','sequenzy segments create --name "Repeat Kit Buyers" --commerce-product api:prod-starter-kit --purchase-operator at-least --orders 2',`sequenzy segments create --name "VIP or Churn Risk" --match any --filter-json '[{"field":"tag","operator":"contains","value":"vip"},{"field":"emailOpened","operator":"is_not","value":"30d"}]'`,`sequenzy segments create --name "Bounced A not B" --filter-json '[{"field":"emailBounced","operator":"is","value":"campaign:cmp_abc"},{"field":"emailBounced","operator":"is_not","value":"campaign:cmp_xyz"}]'`]});var VAA=aF.command("count <id>").description("Get subscriber count for a segment").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>nw("count",{id:A,...x}));X0(VAA,{examples:["sequenzy segments count seg_123 --company comp_123"]});var vAA=aF.command("update <id>").description("Update a segment name, filters, or join operator").option("-n, --name <name>","Segment name").option("--filters-json <json>","Raw JSON array of segment filters, or an object with a root group").option("--filters-file <file>","Path to a JSON file with segment filters or a root group").option("--join-operator <operator>","How filters combine: and or or").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>nw("update",{id:A,...x}));X0(vAA,{notes:["Provide at least one of --name, --filters-json, --filters-file, or --join-operator.","Filters replace the existing filter set; missing filter IDs are filled in by the CLI."],examples:['sequenzy segments update seg_123 --name "Churn Risk"',`sequenzy segments update seg_123 --filters-json '[{"field":"tag","operator":"contains","value":"vip"}]'`,"sequenzy segments update seg_123 --join-operator or"]});var uAA=aF.command("delete <id>").description("Delete a segment").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>nw("delete",{id:A,...x}));X0(uAA,{examples:["sequenzy segments delete seg_123 --yes"]});var uD=A8.command("audience-syncs").description("Sync segments to Meta custom audiences").action(()=>uD.help());X0(uD,{notes:["Requires the Meta Ads integration to be connected in the dashboard (Settings -> Integrations).",'Use --template to start from a ready-made segment ("zero-ltv", "no-purchase-1y", "recent-buyers", "high-spenders-ecom", "non-buyers", "engaged"); the segment is created automatically on first use.',"Audiences are add-only: subscribers who leave the segment stay in the Meta audience."],examples:["sequenzy audience-syncs list",'sequenzy audience-syncs create --template recent-buyers --ad-account act_123 --name "Sequenzy - Recent buyers"']});var TAA=uD.command("list").description("List audience syncs with schedule and status").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>SF("list",A));X0(TAA,{examples:["sequenzy audience-syncs list --company comp_123"]});var hAA=uD.command("ad-accounts").description("List the connected Meta ad accounts").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>SF("ad-accounts",A));X0(hAA,{examples:["sequenzy audience-syncs ad-accounts"]});var bAA=uD.command("create").description("Create an audience sync (segment -> Meta custom audience)").option("--segment <id>","Existing segment ID to sync").option("--template <id>",'Predefined segment template (for example "recent-buyers", "zero-ltv", "no-purchase-1y")').requiredOption("--ad-account <id>","Meta ad account ID (see `sequenzy audience-syncs ad-accounts`)").requiredOption("-n, --name <name>","Audience name in Meta Ads Manager").option("--frequency <frequency>","Sync frequency: hourly, daily, or weekly","daily").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>SF("create",A));X0(bAA,{examples:['sequenzy audience-syncs create --template recent-buyers --ad-account act_123 --name "Sequenzy - Recent buyers"','sequenzy audience-syncs create --segment seg_123 --ad-account act_123 --name "Sequenzy - VIPs" --frequency hourly']});var kAA=uD.command("update <id>").description("Change an audience sync's frequency or pause/resume it").option("--frequency <frequency>","Sync frequency: hourly, daily, or weekly").option("--active <bool>","true to resume, false to pause").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>SF("update",{id:A,...x}));X0(kAA,{examples:["sequenzy audience-syncs update sync_123 --frequency weekly","sequenzy audience-syncs update sync_123 --active false"]});var iAA=uD.command("delete <id>").description("Remove an audience sync (the Meta audience itself is kept)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>SF("delete",{id:A,...x}));X0(iAA,{examples:["sequenzy audience-syncs delete sync_123"]});var mAA=uD.command("sync <id>").description("Trigger an immediate sync run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>SF("sync",{id:A,...x}));X0(mAA,{examples:["sequenzy audience-syncs sync sync_123"]});var TD=A8.command("products").description("Manage products and digital delivery files").action(()=>TD.help());X0(TD,{notes:["Products sync from Stripe, Shopify, and WooCommerce integrations.","Attach a deliverable file to a Stripe product, then reference it in purchase sequence emails with {{event.download.url}} and {{event.download.name}}."],examples:["sequenzy products list --provider stripe","sequenzy products sync",'sequenzy products upsert my-ebook --title "The Ebook" --price-cents 1900 --file ./ebook.pdf',"sequenzy products attach-file prod_abc --file ./guide.pdf","sequenzy products attach-file prod_abc --url https://example.com/guide.pdf --name guide.pdf","sequenzy products detach-file prod_abc","sequenzy products delete my-ebook"]});var cAA=TD.command("list").description("List synced products including attached delivery files").option("-c, --company <id>","Company ID override for personal API keys").option("--provider <provider>","Filter by provider (stripe, shopify, woocommerce, manual)").option("--search <query>","Filter products by title").option("--json","Print raw JSON").action((A)=>OF("list",A));X0(cAA,{examples:["sequenzy products list --provider stripe"]});var pAA=TD.command("sync").description("Queue a Stripe product catalog sync").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>OF("sync",A));X0(pAA,{examples:["sequenzy products sync --company comp_123"]});var rAA=TD.command("upsert [productId]").description("Create or update products in the catalog (Commerce API, keyed by your productId)").option("--title <title>","Product title (required for single upserts)").option("--description <text>","Product description").option("--price-cents <cents>","Price in the smallest currency unit").option("--currency <code>","ISO currency code, e.g. USD").option("--image-url <url>","Product image URL").option("--product-url <url>","Product page URL").option("--in-stock","Mark the product as in stock").option("--out-of-stock","Mark the product as out of stock").option("--file <path>","Deliverable file to upload and attach in one step").option("--url <link>","External deliverable http(s) link to attach in one step").option("--name <fileName>","Display name for the attached deliverable").option("--products-json <json>","Inline JSON array of products to upsert").option("--products-file <file>","Path to a JSON file with products to upsert").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>OF("upsert",x,A));X0(rAA,{notes:["Products are keyed by your own productId and stored under the api provider.","Combine --file or --url with a single-product upsert to attach the deliverable file in the same command.","Use --products-json/--products-file for bulk upserts of up to 100 products."],examples:['sequenzy products upsert my-ebook --title "The Ebook" --price-cents 1900 --currency USD --file ./ebook.pdf','sequenzy products upsert my-course --title "The Course" --url https://files.example.com/course.zip',"sequenzy products upsert --products-file ./products.json"]});var _AA=TD.command("delete <productId>").description("Delete a product previously pushed via the Commerce API").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>OF("delete",x,A));X0(_AA,{examples:["sequenzy products delete my-ebook"]});var nAA=TD.command("attach-file <id>").description("Attach the deliverable file buyers receive after purchase").option("--file <path>","Local file to upload (PDF, ePub, ZIP, media)").option("--url <link>","External http(s) link instead of an upload").option("--name <fileName>","Display name for the file (e.g. guide.pdf)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>OF("attach-file",x,A));X0(nAA,{examples:["sequenzy products attach-file prod_abc --file ./guide.pdf","sequenzy products attach-file prod_abc --url https://example.com/template.zip --name template.zip"]});var lAA=TD.command("detach-file <id>").description("Remove the attached delivery file from a product").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>OF("detach-file",x,A));X0(lAA,{examples:["sequenzy products detach-file prod_abc"]});var Sy=A8.command("team").description("Manage team members and invitations").action(()=>Sy.help());X0(Sy,{notes:["Inviting and cancelling invitations requires owner or admin access.","Billing access can only be granted by the company owner."],examples:["sequenzy team list","sequenzy team invite teammate@example.com --role admin","sequenzy team cancel-invitation inv_123"]});var dAA=Sy.command("list").description("List team members and pending invitations").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>fR("list",A));X0(dAA,{examples:["sequenzy team list --company comp_123"]});var aAA=Sy.command("invite <email>").description("Invite a team member or add an existing user").requiredOption("--role <role>","Member role: admin, viewer, or restricted").option("--billing-access","Allow the member to manage billing (owner only)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>fR("invite",{email:A,...x}));X0(aAA,{notes:["Existing Sequenzy users are added to the team immediately; everyone else receives an email invitation.","Invitations expire automatically and can be re-sent by inviting the same email again after cancelling."],examples:["sequenzy team invite teammate@example.com --role admin","sequenzy team invite editor@example.com --role restricted","sequenzy team invite finance@example.com --role viewer --billing-access"]});var sAA=Sy.command("cancel-invitation <invitationId>").description("Cancel a pending team invitation").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>fR("cancel-invitation",{invitationId:A,...x}));X0(sAA,{notes:["Run `sequenzy team list` first to find invitation IDs."],examples:["sequenzy team cancel-invitation inv_123 --yes"]});var hD=A8.command("inbox").description("Manage subscriber reply conversations").action(()=>hD.help());X0(hD,{notes:["The inbox collects subscriber replies to campaigns, sequences, and transactional email.","Use --note on replies to add an internal note instead of emailing the subscriber."],examples:["sequenzy inbox list --status open --unread","sequenzy inbox get conv_123","sequenzy inbox reply conv_123 --text 'Thanks for reaching out!'","sequenzy inbox close conv_123"]});var oAA=hD.command("list").description("List conversations").option("-s, --status <status>","Filter by status: open, closed, or all").option("--search <query>","Search by subscriber email, name, or subject").option("--unread","Only conversations with unread messages").option("-p, --page <number>","Page number (default 1)").option("-l, --limit <number>","Results per page (1-100, default 20)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>LF("list",A));X0(oAA,{examples:["sequenzy inbox list","sequenzy inbox list --status open --unread",'sequenzy inbox list --search "refund" --limit 50']});var tAA=hD.command("get <conversationId>").description("Get a conversation with its full message history").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>LF("get",{conversationId:A,...x}));X0(tAA,{examples:["sequenzy inbox get conv_123","sequenzy inbox get conv_123 --json"]});var eAA=hD.command("reply <conversationId>").description("Reply to a conversation or add an internal note").option("-t, --text <text>","Plain text message body").option("--html-file <file>","Read an HTML message body from file").option("-s, --subject <subject>","Override the reply subject").option("--note","Add an internal note instead of emailing the subscriber").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>LF("reply",{conversationId:A,...x}));X0(eAA,{notes:["Provide a body with --text and/or --html-file.","Outbound replies are emailed to the subscriber and reopen closed conversations; notes are internal only."],examples:["sequenzy inbox reply conv_123 --text 'Thanks for reaching out!'","sequenzy inbox reply conv_123 --html-file ./reply.html","sequenzy inbox reply conv_123 --text 'Customer asked for a refund' --note"]});var AxA=hD.command("close <conversationId>").description("Close a conversation").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>LF("close",{conversationId:A,...x}));X0(AxA,{examples:["sequenzy inbox close conv_123"]});var xxA=hD.command("reopen <conversationId>").description("Reopen a closed conversation").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>LF("reopen",{conversationId:A,...x}));X0(xxA,{examples:["sequenzy inbox reopen conv_123"]});var ExA=hD.command("mark-read <conversationId>").description("Mark all messages in a conversation as read").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>LF("mark-read",{conversationId:A,...x}));X0(ExA,{examples:["sequenzy inbox mark-read conv_123"]});var kg=A8.command("webhooks").description("Manage outbound webhook endpoints").action(()=>kg.help());X0(kg,{notes:["Webhook payloads are signed; the signing secret is only shown once at creation time.","Valid events cover email.*, subscriber.*, and sequence.* types; omit --event to use the default set."],examples:["sequenzy webhooks list","sequenzy webhooks create --name CI --url https://example.com/hook --event email.bounced","sequenzy webhooks deliveries wh_123 --limit 50","sequenzy webhooks replay wh_123 del_456"]});var BxA=kg.command("list").description("List outbound webhook endpoints").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>VD("list",A));X0(BxA,{examples:["sequenzy webhooks list --company comp_123"]});var gxA=kg.command("create").description("Create an outbound webhook endpoint").requiredOption("-n, --name <name>","Webhook name").requiredOption("-u, --url <url>","HTTPS endpoint URL").option("-e, --event <events...>","Event types to deliver, e.g. email.bounced subscriber.list_subscribed subscriber.list_unsubscribed").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>VD("create",A));X0(gxA,{notes:["The signing secret is printed once on creation and cannot be retrieved later - store it immediately.","Omit --event to subscribe to the default event set."],examples:["sequenzy webhooks create --name CI --url https://example.com/hook --event email.bounced","sequenzy webhooks create --name 'All events' --url https://example.com/hook"]});var QxA=kg.command("update <id>").description("Update an outbound webhook endpoint").option("-n, --name <name>","Webhook name").option("-u, --url <url>","HTTPS endpoint URL").option("-e, --event <events...>","Replacement event types").option("--enable","Enable the webhook").option("--disable","Disable the webhook").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>VD("update",{id:A,...x}));X0(QxA,{notes:["Provide at least one of --name, --url, --event, --enable, or --disable.","Changing the URL or re-enabling resets the failure circuit breaker."],examples:["sequenzy webhooks update wh_123 --url https://example.com/new-hook","sequenzy webhooks update wh_123 --event email.bounced email.complained","sequenzy webhooks update wh_123 --disable"]});var DxA=kg.command("delete <id>").description("Delete an outbound webhook endpoint").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>VD("delete",{id:A,...x}));X0(DxA,{examples:["sequenzy webhooks delete wh_123 --yes"]});var CxA=kg.command("test <id>").description("Send a test event to a webhook endpoint").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>VD("test",{id:A,...x}));X0(CxA,{notes:["The webhook must be enabled to receive a test event."],examples:["sequenzy webhooks test wh_123"]});var FxA=kg.command("deliveries <id>").description("List recent deliveries for a webhook endpoint").option("-l, --limit <number>","Maximum deliveries to return (1-100)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>VD("deliveries",{id:A,...x}));X0(FxA,{examples:["sequenzy webhooks deliveries wh_123","sequenzy webhooks deliveries wh_123 --limit 50"]});var IxA=kg.command("replay <id> <deliveryId>").description("Replay a webhook delivery").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x,E)=>VD("replay",{id:A,deliveryId:x,...E}));X0(IxA,{notes:["Run `sequenzy webhooks deliveries <id>` first to find delivery IDs."],examples:["sequenzy webhooks replay wh_123 del_456"]});var wxA=A8.command("account").description("Verify the active API key, permissions, and account context").option("--json","Print JSON").action(x60);X0(wxA,{notes:["Makes a live API request with the active credential. Compare its key name and prefix with Settings after replacing a key."],examples:["sequenzy account","sequenzy account --json"]});var JxA=A8.command("feedback <message>").description("Send product feedback about Sequenzy to the Sequenzy team").option("--category <category>","Category: missing_capability, bug, docs, ux, praise, other (default: other)").option("--context <context>","What you were trying to accomplish when you hit the gap").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>H60(A,x));X0(JxA,{notes:["Agents: send feedback whenever the user wanted something the CLI, API, or MCP tools do not support. The Sequenzy team reads every submission."],examples:['sequenzy feedback "No command to bulk-delete campaigns by label" --category missing_capability','sequenzy feedback "Segment count and list output disagree for seg_123" --category bug --context "Auditing a re-engagement segment"']});var ZJ=A8.command("api-keys").description("Manage company API keys").action(()=>ZJ.help());X0(ZJ,{notes:["The plain API key is only returned on creation. Save it immediately.","Listing and revocation return metadata only; secrets and stored hashes are never returned."],examples:["sequenzy api-keys list --company comp_123","sequenzy api-keys create",'sequenzy api-keys create --name "CI deploy key" --company comp_123',"sequenzy api-keys revoke key_123 --company comp_123 --yes"]});var fxA=ZJ.command("create").description("Create a company API key").option("-n, --name <name>","Human-readable API key name").option("-c, --company <id>","Company ID override for personal API keys").option("--preset <preset>","Permission preset: full_access, read_only, agent_safe, ai_drafting, data_ingest_safe, data_ingest_automations, transactional_sender, marketing_sender (default: full_access)").option("--scopes <scopes>","Comma-separated explicit permission scopes (overrides --preset)").option("--json","Print raw JSON").action((A)=>mH("create",A));X0(fxA,{notes:["Keys default to full access. Pass --preset or --scopes to restrict what the key can do."],examples:["sequenzy api-keys create",'sequenzy api-keys create --name "CI deploy key" --company comp_123','sequenzy api-keys create --preset transactional_sender --name "Order emails"','sequenzy api-keys create --scopes "subscribers:read,subscribers:write,events:write"']});var KxA=ZJ.command("list").description("List company API keys without secret values").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>mH("list",A));X0(KxA,{notes:["Use the returned ID, name, prefix, and current-key marker to identify a key before revoking it."],examples:["sequenzy api-keys list","sequenzy api-keys list --company comp_123 --json"]});var $xA=ZJ.command("revoke").description("Permanently revoke a company API key").argument("<api-key-id>","Exact API key ID returned by api-keys list").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>mH("revoke",{apiKeyId:A,...x}));X0($xA,{notes:["Revocation cannot be undone. Run 'sequenzy api-keys list' first and verify the exact ID and prefix."],examples:["sequenzy api-keys revoke key_123 --company comp_123 --yes"]});var HxA=ZJ.command("delete").description("Alias for api-keys revoke").argument("<api-key-id>","Exact API key ID returned by api-keys list").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>mH("delete",{apiKeyId:A,...x}));X0(HxA,{notes:["This is a compatibility alias for 'sequenzy api-keys revoke'."],examples:["sequenzy api-keys delete key_123 --company comp_123 --yes"]});var UJ=A8.command("websites").description("Manage sending domains and integration guides").action(()=>UJ.help());X0(UJ,{notes:["Use 'guide' for code examples and 'check' to inspect current DNS verification details."],examples:["sequenzy websites list --company comp_123","sequenzy websites add example.com --company comp_123","sequenzy websites guide --framework nextjs --use-case transactional"]});var yxA=UJ.command("list").description("List sending domains for a company").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>Wy("list",A));X0(yxA,{examples:["sequenzy websites list --company comp_123"]});var qxA=UJ.command("add <domain>").description("Add a sending domain").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>Wy("add",{domain:A,...x}));X0(qxA,{examples:["sequenzy websites add example.com --company comp_123"]});var YxA=UJ.command("check <domain>").description("Inspect sending domain verification details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>Wy("check",{domain:A,...x}));X0(YxA,{examples:["sequenzy websites check example.com --company comp_123"]});var XxA=UJ.command("guide").description("Print framework-specific integration code").option("--framework <name>","Framework name, e.g. nextjs, express, python").option("--use-case <name>","Use case, e.g. transactional, subscribe_form, event_tracking").option("--json","Print raw JSON").action((A)=>Wy("guide",A));X0(XxA,{examples:["sequenzy websites guide","sequenzy websites guide --framework nextjs --use-case transactional","sequenzy websites guide --framework python --use-case event_tracking"]});var Tk=A8.command("shopify").description("Manage the connected Shopify store's automation settings").action(()=>Tk.help());X0(Tk,{notes:["Requires a connected Shopify integration on the company.","Browse abandonment emails shoppers who viewed a product but didn't buy; price drop alerts email recent viewers when a product's price falls."],examples:["sequenzy shopify settings get","sequenzy shopify settings update --price-drop off","sequenzy shopify settings update --browse-delay-hours 4 --browse-cooldown-hours 48"]});var hk=Tk.command("settings").description("Browse-abandonment and price-drop automation settings").action(()=>hk.help()),ZxA=hk.command("get").description("Show the effective automation settings").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>kb("get",A));X0(ZxA,{notes:["Shows the effective values - platform defaults apply until the store overrides them."],examples:["sequenzy shopify settings get --json"]});var UxA=hk.command("update").description("Update browse-abandonment and/or price-drop settings").option("--browse-abandonment <on|off>","Enable or disable browse abandonment").option("--browse-delay-hours <hours>","Hours to wait after a product view before the abandonment check (default 2)").option("--browse-cooldown-hours <hours>","Minimum hours between browse-abandoned events per subscriber (default 24)").option("--reset-browse-abandonment","Reset browse abandonment to the platform defaults").option("--price-drop <on|off>","Enable or disable price drop alerts").option("--price-drop-min-percent <percent>","Minimum price decrease percent to alert on (default 5)").option("--price-drop-lookback-days <days>","How many days back viewers qualify as the audience (default 30)").option("--price-drop-cooldown-days <days>","Minimum days between price-drop events per subscriber and product (default 7)").option("--reset-price-drop","Reset price drop alerts to the platform defaults").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>kb("update",A));X0(UxA,{notes:["Partial update: omitted flags keep their current values.","If no sequence handles ecommerce.price_drop, Sequenzy sends a default price-drop email to active subscribers."],examples:["sequenzy shopify settings update --browse-abandonment off","sequenzy shopify settings update --price-drop-min-percent 10 --price-drop-lookback-days 14","sequenzy shopify settings update --reset-price-drop"]});var XR=A8.command("sms").description("Inspect the SMS add-on status for a company").action(()=>XR.help());X0(XR,{notes:["SMS sequence steps only send when the add-on is enabled, the plan is eligible, and an active number exists.",'Add SMS steps to sequences with type: "sms" in sequences create --steps-* or update --insert-steps-*.','Generate SMS copy with `sequenzy generate sms "<prompt>"`.'],examples:["sequenzy sms settings","sequenzy sms settings --json"]});var GxA=XR.command("settings").description("Show SMS add-on status, credits, and phone numbers").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>ib("settings",A));X0(GxA,{notes:["readyToSend in the JSON output tells you whether SMS sequence steps will actually send."],examples:["sequenzy sms settings --json"]});var WxA=XR.command("send-test <phone>").description("Send a test SMS to a phone number").option("-t, --text <text>","Plain-text message body").option("--image-url <url...>","Publicly reachable MMS image URL (repeat for up to 2)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>ib("send-test",{phone:A,...x}));X0(WxA,{notes:["Sends a real text and charges credits. Limited to 5 test sends per hour; bypasses quiet hours; excluded from step stats.","Requires the SMS add-on with a verified number - check `sequenzy sms settings` first."],examples:['sequenzy sms send-test +15550100123 --text "Test from Sequenzy"']});var ZR=A8.command("sync-rules").description("Manage automatic tag changes applied when events fire").action(()=>ZR.help());X0(ZR,{notes:["Sync rules map events to tag changes, e.g. an order-placed event adding a customer tag.","Rules can carry conditions: required/excluded subscriber tags, and a product match for commerce events (tag buyers by product tag, collection, type, or vendor)."],examples:["sequenzy sync-rules get","sequenzy sync-rules update --rules-file ./sync-rules.json","sequenzy sync-rules update --reset"]});var RxA=ZR.command("get").description("Show the effective sync rules").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>Nk("get",A));X0(RxA,{notes:["Shows the platform defaults until the company saves custom rules; the JSON output includes isDefault."],examples:["sequenzy sync-rules get --json"]});var MxA=ZR.command("update").description("Replace the sync rules or reset them to the defaults").option("--rules-json <json>","Inline JSON array with the full rule set").option("--rules-file <file>","Path to a JSON file with the full rule set").option("--reset","Reset the company to the platform default rules").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>Nk("update",A));X0(MxA,{notes:["This replaces the FULL rule set - fetch with 'sync-rules get --json', edit, then update.",'Each rule: {"triggerEvent":"...","actions":{"addTags":[...],"removeTags":[...]},"conditions":{...}}.'],examples:["sequenzy sync-rules update --rules-file ./sync-rules.json",`sequenzy sync-rules update --rules-json '[{"triggerEvent":"ecommerce.order_placed","actions":{"addTags":["vinyl-collector"],"removeTags":[]},"conditions":{"purchasedProduct":{"tags":["Vinyl"]}}}]'`,"sequenzy sync-rules update --reset"]});var GJ=A8.command("generate").description("Generate email and SMS content with AI").action(()=>GJ.help());X0(GJ,{notes:["Generated email and SMS content is returned as draft content. Review it before sending.","`generate sequence` is deprecated and persists a disabled draft. Use `sequences create <name> --trigger <trigger> --goal <goal>` instead.","Use --json when another tool or agent should parse the generated output."],examples:['sequenzy generate email "Welcome a new user to our analytics product"','sequenzy generate subjects "April product launch" --count 8','sequenzy generate sms "Cart reminder with a free-shipping hook" --count 3']});GJ.command("email <prompt>").description("Generate email blocks from a prompt").option("-s, --style <style>","Style: minimal, branded, promotional").option("-t, --tone <tone>","Tone: professional, casual, friendly").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>pH("email",{prompt:A,...x}));GJ.command("sequence <goal>").description("[DEPRECATED] Persist a disabled AI sequence draft; use `sequences create`").option("--name <name>","Optional sequence name; defaults to the goal").option("--list-id <id>","Optional list ID for the contact_added trigger").option("-c, --count <number>","Number of emails (1-10)","5").option("-d, --days <number>","Duration in days","14").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>pH("sequence",{goal:A,...x}));GJ.command("subjects <topic>").description("Generate A/B subject line variants").option("-c, --count <number>","Number of variants","5").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>pH("subjects",{topic:A,...x}));var zxA=GJ.command("sms <prompt>").description("Generate SMS message variants from a prompt").option("-c, --count <number>","Number of variants (1-10)","3").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>pH("sms",{prompt:A,...x}));X0(zxA,{notes:["Messages are plain text with encoding and segment counts; use them as the text of an SMS sequence step.","Opt-out footers and the brand prefix are added automatically at send time - never include them in the message.","Check `sequenzy sms settings` to confirm the SMS add-on is ready before enabling SMS sequences."],examples:['sequenzy generate sms "Flash sale ends tonight" --count 5 --json']});await A8.parseAsync();process.exit(process.exitCode??0);
|