@ecodrix/erix-api 2.1.1 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var _n=Object.create;var E=Object.defineProperty,Vn=Object.defineProperties,jn=Object.getOwnPropertyDescriptor,Wn=Object.getOwnPropertyDescriptors,Hn=Object.getOwnPropertyNames,En=Object.getOwnPropertySymbols,Kn=Object.getPrototypeOf,Ln=Object.prototype.hasOwnProperty,zn=Object.prototype.propertyIsEnumerable;var Qn=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t);var un=(t,e,n)=>e in t?E(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,T=(t,e)=>{for(var n in e||(e={}))Ln.call(e,n)&&un(t,n,e[n]);if(En)for(var n of En(e))zn.call(e,n)&&un(t,n,e[n]);return t},k=(t,e)=>Vn(t,Wn(e));var Gn=(t,e)=>{for(var n in e)E(t,n,{get:e[n],enumerable:!0})},Dn=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Hn(e))!Ln.call(t,o)&&o!==n&&E(t,o,{get:()=>e[o],enumerable:!(a=jn(e,o))||a.enumerable});return t};var L=(t,e,n)=>(n=t!=null?_n(Kn(t)):{},Dn(e||!t||!t.__esModule?E(n,"default",{value:t,enumerable:!0}):n,t)),Yn=t=>Dn(E({},"__esModule",{value:!0}),t);var s=(t,e,n)=>un(t,typeof e!="symbol"?e+"":e,n);var mn=function(t,e){this[0]=t,this[1]=e},qn=(t,e,n)=>{var a=(l,d,f,y)=>{try{var b=n[l](d),x=(d=b.value)instanceof mn,R=b.done;Promise.resolve(x?d[0]:d).then(u=>x?a(l==="return"?l:"next",d[1]?{done:u.done,value:u.value}:u,f,y):f({value:u,done:R})).catch(u=>a("throw",u,f,y))}catch(u){y(u)}},o=(l,d,f,y)=>p[l]=b=>(d=new Promise((x,R,u)=>(u=()=>a(l,b,x,R),c?c.then(u):u())),y=()=>c===f&&(c=0),c=f=d.then(y,y),d),c,p={};return n=n.apply(t,e),p[Qn("asyncIterator")]=()=>p,o("next"),o("throw"),o("return"),p};var rt={};Gn(rt,{APIError:()=>g,AdminOnboarding:()=>v,AuthenticationError:()=>m,ConnectInfra:()=>U,ECODrIx:()=>w,ECODrIxAPI:()=>w,ERROR_RETRY_CONFIG:()=>In,EcodrixError:()=>W,EmailConnect:()=>N,ErixChat:()=>D,ErixProduct:()=>q,HTTP_STATUS_ERROR_MAP:()=>Mn,InfraDomain:()=>$,LEAD_STATUS_VALUES:()=>Fn,Onboarding:()=>A,Persona:()=>C,PlatformAdmin:()=>V,PlatformDomain:()=>O,PlatformTenants:()=>M,PlatformUsers:()=>_,ProductDomain:()=>I,RateLimitError:()=>h,StorageInfra:()=>B,WhatsAppConnect:()=>F,default:()=>tt,getErrorDetails:()=>et,getRetryConfig:()=>nt,handleAPIError:()=>Xn,isAPIError:()=>Zn});module.exports=Yn(rt);var Bn=L(require("axios"),1),gn=L(require("axios-retry"),1);var yn="https://api.ecodrix.com";function Nn(t="v1",e=yn){return`${e.replace(/\/+$/,"")}/${t}/api`}var W=class extends Error{constructor(e){super(e),this.name="EcodrixError"}},g=class extends W{constructor(n,a,o){super(n);s(this,"status");s(this,"code");this.name="APIError",this.status=a,this.code=o}},m=class extends g{constructor(e="Invalid API Key or Client Code"){super(e,401,"AUTH_FAILED"),this.name="AuthenticationError"}},h=class extends g{constructor(e="Too many requests. Please slow down."){super(e,429,"RATE_LIMIT_EXCEEDED"),this.name="RateLimitError"}};var r=class{constructor(e){s(this,"client",e)}async post(e,n,a){try{let o=this.buildConfig(a);return(await this.client.post(e,n,o)).data}catch(o){this.handleError(o)}}async get(e,n){try{let a=this.buildConfig(n);return(await this.client.get(e,a)).data}catch(a){this.handleError(a)}}async patch(e,n,a){try{let o=this.buildConfig(a);return(await this.client.patch(e,n,o)).data}catch(o){this.handleError(o)}}async put(e,n,a){try{let o=this.buildConfig(a);return(await this.client.put(e,n,o)).data}catch(o){this.handleError(o)}}async deleteRequest(e,n){try{let a=this.buildConfig(n);return(await this.client.delete(e,a)).data}catch(a){this.handleError(a)}}buildConfig(e){if(!e)return;let n=T({},e);return e.idempotencyKey&&(n.headers=k(T({},n.headers),{"Idempotency-Key":e.idempotencyKey})),n}handleError(e){var n,a,o;if(e.response){let c=e.response.status,p=((n=e.response.data)==null?void 0:n.message)||((a=e.response.data)==null?void 0:a.error)||"API Request Failed",l=(o=e.response.data)==null?void 0:o.code;switch(c){case 401:throw new m(p);case 403:throw new m(p);case 429:throw new h(p);default:throw new g(p,c,l)}}throw new g(e.message||"Network Error")}};var fn=class extends r{async list(e){return this.get(`/product/erix/crm/leads/${e}/notes`)}async create(e,n){return this.post(`/product/erix/crm/leads/${e}/notes`,n)}async update(e,n){return this.patch(`/product/erix/crm/notes/${e}`,{content:n})}async pin(e,n=!0){return this.patch(`/product/erix/crm/notes/${e}/pin`,{isPinned:n})}async delete(e){return this.deleteRequest(`/product/erix/crm/notes/${e}`)}},H=class extends r{constructor(n){super(n);s(this,"notes");this.notes=new fn(n)}async timeline(n,a){return this.get(`/product/erix/crm/leads/${n}/timeline`,{params:a})}async list(n,a){return this.get(`/product/erix/crm/leads/${n}/activities`,{params:T({},a)})}async log(n){return this.post(`/product/erix/crm/leads/${n.leadId}/activities`,n)}async logCall(n,a){return this.post(`/product/erix/crm/leads/${n}/calls`,a)}};var K=class extends r{async overview(e){return this.get("/product/erix/crm/analytics/overview",{params:e})}async funnel(e){return this.get("/product/erix/crm/analytics/funnel",{params:{pipelineId:e}})}async forecast(e){return this.get("/product/erix/crm/analytics/forecast",{params:{pipelineId:e}})}async sources(e){return this.get("/product/erix/crm/analytics/sources",{params:e})}async team(e){return this.get("/product/erix/crm/analytics/team",{params:e})}async heatmap(e){return this.get("/product/erix/crm/analytics/heatmap",{params:e})}async scores(){return this.get("/product/erix/crm/analytics/scores")}async stageTime(e){return this.get("/product/erix/crm/analytics/stage-time",{params:{pipelineId:e}})}async tiered(e){return this.get("/product/erix/crm/analytics/tiered",{params:e})}async summary(e){return this.get("/product/erix/crm/analytics/summary",{params:e})}async whatsapp(e){return this.get("/product/erix/crm/analytics/whatsapp",{params:e})}};var z=class extends r{async stats(){return this.get("/product/erix/crm/automation/stats")}async logs(e){return this.get("/product/erix/crm/automation/logs",{params:e})}async retryFailedEvent(e){return this.post(`/product/erix/crm/automation/logs/${e}/retry`,{})}};var Q=class extends r{async list(){return this.get("/product/erix/crm/automations")}async create(e){return this.post("/product/erix/crm/automations",e)}async update(e,n){return this.patch(`/product/erix/crm/automations/${e}`,n)}async toggle(e){return this.patch(`/product/erix/crm/automations/${e}/toggle`)}async delete(e){return this.deleteRequest(`/product/erix/crm/automations/${e}`)}async bulkDelete(e){return this.post("/product/erix/crm/automations/bulk-delete",{ids:e})}async test(e,n){return this.post(`/product/erix/crm/automations/${e}/test`,{leadId:n})}async getAvailableEvents(){return this.post("/product/erix/crm/events",{})}async enrollments(e,n){return this.get(`/product/erix/crm/${e}/enrollments`,{params:n})}async getEnrollment(e){return this.get(`/product/erix/crm/enrollments/${e}`)}async pauseEnrollment(e,n){return this.post(`/product/erix/crm/${e}/enrollments/${n}/pause`,{})}async resumeEnrollment(e,n){return this.post(`/product/erix/crm/${e}/enrollments/${n}/resume`,{})}async runs(e){return this.get(`/product/erix/crm/${e}/runs`)}async getRun(e){return this.get(`/product/erix/crm/runs/${e}`)}async resumeRun(e){return this.post(`/product/erix/crm/runs/${e}/resume`,{})}async abortRun(e){return this.post(`/product/erix/crm/runs/${e}/abort`,{})}async webhookEvent(e,n,a){return this.post("/product/erix/crm/webhook-event",{ruleId:e,eventName:n,payload:a})}async trigger(e){return this.post("/product/erix/events/trigger",e)}};var Fn=["open","won","lost","archived"],G=class extends r{async create(e){return this.post("/product/erix/crm/leads",e)}async describe(){let e=await this.fields(),n=Array.isArray(e.data)?e.data:[],a=[{key:"firstName",label:"First Name",type:"string",required:!0,group:"Basic Info"},{key:"lastName",label:"Last Name",type:"string",required:!1,group:"Basic Info"},{key:"phone",label:"Phone Number",type:"phone",required:!0,group:"Contact"},{key:"email",label:"Email Address",type:"email",required:!1,group:"Contact"},{key:"status",label:"Status",type:"select",required:!0,options:[{label:"New",value:"new"},{label:"Contacted",value:"contacted"},{label:"Qualified",value:"qualified"},{label:"Won",value:"won"},{label:"Lost",value:"lost"}]},{key:"value",label:"Lead Value",type:"currency",required:!1},{key:"source",label:"Source",type:"string",required:!1}],o=n.map(c=>({key:`metadata.extra.${c.name}`,label:c.label||c.name,type:c.type||"string",required:!!c.required,options:c.options,group:"Custom Fields"}));return{name:"Lead",fields:[...a,...o],uiHints:{icon:"User",primaryColor:"#3b82f6",defaultSort:{field:"createdAt",direction:"desc"},summaryFields:["firstName","lastName","phone","status"]}}}async upsert(e){return this.post("/product/erix/crm/leads/upsert",e)}async createMany(e,n=50){let a=[];for(let o=0;o<e.length;o+=n){let p=e.slice(o,o+n).map(d=>this.create(d)),l=await Promise.allSettled(p);for(let d of l)if(d.status==="fulfilled")a.push(d.value);else throw d.reason}return a}async import(e){return this.post("/product/erix/crm/leads/import",{leads:e})}async bulkUpsert(e){return this.import(e)}async list(e){let n=T({},e);return Array.isArray(n.tags)&&(n.tags=n.tags.join(",")),this.get("/product/erix/crm/leads",{params:n})}listAutoPaging(e){return qn(this,null,function*(){let n=(e==null?void 0:e.page)||1,a=!0;for(;a;){let o=yield new mn(this.list(k(T({},e),{page:n}))),c=Array.isArray(o.data)?o.data:o||[];if(c.length===0){a=!1;break}for(let p of c)yield p;o.pagination&&n<o.pagination.pages||!o.pagination&&c.length>0?n++:a=!1}})}async retrieve(e){return this.get(`/product/erix/crm/leads/${e}`)}async retrieveByPhone(e){return this.get(`/product/erix/crm/leads/phone/${encodeURIComponent(e)}`)}async byStage(e,n,a={}){return this.get(`/product/erix/crm/pipelines/${e}/stages/${n}/leads`,{params:a})}async retrieveByRef(e,n){return this.get(`/product/erix/crm/leads/ref/${encodeURIComponent(e)}/${encodeURIComponent(n)}`)}async update(e,n){return this.patch(`/product/erix/crm/leads/${e}`,n)}async move(e,n){return this.patch(`/product/erix/crm/leads/${e}/move`,{stageId:n})}async convert(e,n,a){return this.post(`/product/erix/crm/leads/${e}/convert`,{outcome:n,reason:a})}async tags(e,n){return this.patch(`/product/erix/crm/leads/${e}/tags`,n)}async recalculateScore(e){return this.post(`/product/erix/crm/leads/${e}/score`,{})}async updateMetadata(e,n){return this.patch(`/product/erix/crm/leads/${e}/metadata`,n)}async fields(){return this.get("/product/erix/crm/fields")}async notes(e){return this.get(`/product/erix/crm/leads/${e}/notes`)}async activities(e,n){return this.get(`/product/erix/crm/leads/${e}/timeline`,{params:n})}async createNote(e,n){return this.post(`/product/erix/crm/leads/${e}/notes`,n)}async updateNote(e,n,a){return this.patch(`/product/erix/crm/notes/${n}`,a)}async deleteNote(e,n){return this.deleteRequest(`/product/erix/crm/notes/${n}`)}async delete(e){return this.deleteRequest(`/product/erix/crm/leads/${e}`)}async bulkArchive(e){return this.patch("/product/erix/crm/leads/bulk-archive",{ids:e})}async bulkDelete(e){return this.deleteRequest("/product/erix/crm/leads",{data:{ids:e}})}async archive(e){return this.deleteRequest(`/product/erix/crm/leads/${e}`)}async profile(e){return this.get(`/product/erix/crm/leads/${e}/profile`)}async invoices(e){return this.get(`/product/erix/crm/leads/${e}/invoices`)}async projects(e){return this.get(`/product/erix/crm/leads/${e}/projects`)}async conversations(e){return this.get(`/product/erix/crm/leads/${e}/conversations`)}async meetings(e){return this.get(`/product/erix/crm/leads/${e}/meetings`)}async sequences(e){return this.get(`/product/erix/crm/leads/${e}/sequences`)}};var Y=class extends r{async capture(e){return this.post("/product/erix/crm/payments/capture",e)}};var J=class extends r{async list(){return this.get("/product/erix/crm/pipelines")}async getStageManifest(e){var o,c;let n=await this.retrieve(e),a=Array.isArray((o=n.data)==null?void 0:o.stages)?n.data.stages:[];return{name:`Pipeline: ${((c=n.data)==null?void 0:c.name)||e}`,fields:a.map(p=>({key:p._id,label:p.name,type:"string",required:!0,options:[{label:p.name,value:p._id}],group:"Stages",uiHints:{color:p.color||"#cbd5e1",probability:p.probability}})),uiHints:{icon:"Columns",primaryColor:"#6366f1"}}}async create(e){return this.post("/product/erix/crm/pipelines",e)}async retrieve(e){return this.get(`/product/erix/crm/pipelines/${e}`)}async update(e,n){return this.patch(`/product/erix/crm/pipelines/${e}`,n)}async setDefault(e){return this.patch(`/product/erix/crm/pipelines/${e}/default`,{})}async duplicate(e,n){return this.post(`/product/erix/crm/pipelines/${e}/duplicate`,{newName:n})}async archive(e){return this.patch(`/product/erix/crm/pipelines/${e}/archive`,{})}async delete(e){return this.deleteRequest(`/product/erix/crm/pipelines/${e}`)}async checkInUse(e){return this.get(`/product/erix/crm/pipelines/${e}/in-use`)}async board(e){return this.get(`/product/erix/crm/pipelines/${e}/board`)}async forecast(e){return this.get(`/product/erix/crm/pipelines/${e}/forecast`)}async addStage(e,n){return this.post(`/product/erix/crm/pipelines/${e}/stages`,n)}async reorderStages(e,n){return this.patch(`/product/erix/crm/pipelines/${e}/stages/reorder`,{order:n})}async updateStage(e,n){return this.patch(`/product/erix/crm/stages/${e}`,n)}async deleteStage(e,n){return this.deleteRequest(`/product/erix/crm/stages/${e}`,{data:n?{moveLeadsToStageId:n}:void 0})}};var X=class extends r{async getConfig(){return this.get("/product/erix/crm/scoring")}async updateConfig(e){return this.patch("/product/erix/crm/scoring",e)}async recalculate(e){return this.post(`/product/erix/crm/scoring/${e}/recalculate`,{})}};var Z=class extends r{async enroll(e){return this.post("/product/erix/crm/sequences/enroll",e)}async unenroll(e){return this.deleteRequest(`/product/erix/crm/sequences/unenroll/${e}`)}async listForLead(e){return this.get(`/product/erix/crm/sequences/lead/${e}`)}};var ee=class extends r{async list(e){return this.get("/product/erix/chat/broadcasts",{params:e})}async retrieve(e){return this.get(`/product/erix/chat/broadcasts/${e}`)}async create(e){return this.post("/product/erix/chat/broadcast",e)}async update(e,n){return this.patch(`/product/erix/chat/broadcasts/${e}`,n)}async delete(e){return this.deleteRequest(`/product/erix/chat/broadcasts/${e}`)}};var ne=class extends r{async list(e){return this.get("/product/erix/chat/conversations",{params:e})}async create(e){return this.post("/product/erix/chat/conversations",e)}async retrieve(e){return this.get(`/product/erix/chat/conversations/${e}`)}async messages(e,n){return this.get(`/product/erix/chat/conversations/${e}/messages`,{params:n})}async linkLead(e,n,a){return this.post(`/product/erix/chat/conversations/${e}/link-lead`,{leadId:n,leadData:a})}async markRead(e){return this.post(`/product/erix/chat/conversations/${e}/read`,{})}async delete(e){return this.deleteRequest(`/product/erix/chat/conversations/${e}`)}async bulkDelete(e){return this.post("/product/erix/chat/conversations/bulk-delete",{ids:e})}};var te=class extends r{async send(e){return this.post("/product/erix/chat/send",e)}async sendTemplate(e){return this.post("/product/erix/chat/send",k(T({},e),{templateLanguage:e.language||e.templateLanguage||"en_US"}))}async star(e,n){return this.post(`/product/erix/chat/messages/${e}/star`,{isStarred:n})}async react(e,n){return this.post(`/product/erix/chat/messages/${e}/react`,{reaction:n})}async markRead(e){return this.post(`/product/erix/chat/conversations/${e}/read`)}async upload(e){let n=new FormData;return n.append("file",e),this.post("/product/erix/chat/upload",n,{headers:{"Content-Type":"multipart/form-data"}})}};var re=class extends r{async list(e){return this.get("/product/erix/crm/campaigns",{params:e})}async create(e){return this.post("/product/erix/crm/campaigns",e)}async stats(e){return this.get(`/product/erix/crm/campaigns/${e}/analytics`)}};var se=class extends r{async getProduct(e){return this.get(`/product/erix/commerce/checkout/products/${e}`)}async createSession(e){return this.post("/product/erix/commerce/checkout/session",e)}async applyCoupon(e){return this.post("/product/erix/commerce/checkout/coupon",e)}async verify(e){return this.post("/product/erix/commerce/checkout/verify",e)}async createOrder(e){return this.post("/product/erix/commerce/checkout/order",e)}};var ae=class extends r{async trigger(e){return this.post("/product/erix/events/trigger",e)}async listCustomEvents(){return this.get("/product/erix/crm/custom-events")}async createCustomEvent(e){return this.post("/product/erix/crm/custom-events",e)}async deleteCustomEvent(e){return this.deleteRequest(`/product/erix/crm/custom-events/${e}`)}};var ie=class extends r{async list(e){return this.get("/product/erix/commerce/invoices",{params:e})}async getInvoice(e){return this.get(`/product/erix/commerce/invoices/${e}`)}async create(e){return this.post("/product/erix/commerce/invoices",e)}async update(e,n){return this.patch(`/product/erix/commerce/invoices/${e}`,n)}async delete(e){return this.deleteRequest(`/product/erix/commerce/invoices/${e}`)}async sendViaWhatsApp(e){return this.post(`/product/erix/commerce/invoices/${e}/send-whatsapp`,{})}async getSettings(){return this.get("/product/erix/commerce/settings")}async updateSettings(e){return this.put("/product/erix/commerce/settings",e)}};var oe=class extends r{async listEventLogs(e){return this.get("/product/erix/event-log/events/logs",{params:e})}async getEventLog(e){return this.get(`/product/erix/event-log/events/logs/${e}`)}async listCallbackLogs(e){return this.get("/product/erix/event-log/callbacks/logs",{params:e})}async getStats(){return this.get("/product/erix/event-log/events/stats")}};var ce=class extends r{async conversations(){return this.get("/product/erix/portal-inbox/conversations")}async messages(e){return this.get(`/product/erix/portal-inbox/conversations/${e}/messages`)}async reply(e,n){return this.post(`/product/erix/portal-inbox/conversations/${e}/messages`,n)}};var pe=class extends r{async list(e){return this.get(`/product/erix/commerce/projects/${e}/documents`)}async upload(e,n){return this.post(`/product/erix/commerce/projects/${e}/documents`,n)}async toggleSignature(e,n,a){return this.patch(`/product/erix/commerce/projects/${e}/documents/${n}/signature`,{required:a})}async addSigner(e,n,a){return this.post(`/product/erix/commerce/projects/${e}/documents/${n}/signers`,a)}async sign(e,n,a){return this.post(`/product/erix/commerce/projects/${e}/documents/${n}/sign`,a!=null?a:{})}async decline(e,n){return this.post(`/product/erix/commerce/projects/${e}/documents/${n}/decline`,{})}async stampSign(e,n,a){return this.post(`/product/erix/commerce/projects/${e}/documents/${n}/stamp-sign`,a)}};var de=class extends r{async providers(){return this.get("/infra/connect/providers")}async list(){return this.get("/infra/connect/connections")}async get_(e){return this.get(`/infra/connect/connections/${e}`)}async connect(e,n){return this.post(`/infra/connect/connections/${e}/connect`,n)}async configure(e,n){return this.put(`/infra/connect/connections/${e}/configure`,n)}async disconnect(e){return this.post(`/infra/connect/connections/${e}/disconnect`,{})}async reveal(e){return this.post(`/infra/connect/connections/${e}/reveal`,{})}async test(e){return this.post(`/infra/connect/connections/${e}/test`,{})}async setAccess(e,n){return this.put(`/infra/connect/connections/${e}/access`,n)}async createPaymentLink(e){return this.post("/infra/connect/connections/payments/payment-link",e)}};var le=class extends r{async sendTest(e){return this.post("/infra/connect/email/test",{to:e})}async listTemplates(e){return this.get("/infra/connect/email/templates",{params:e})}async getTemplate(e){return this.get(`/infra/connect/email/templates/${e}`)}async createTemplate(e){return this.post("/infra/connect/email/templates",e)}async updateTemplate(e,n){return this.put(`/infra/connect/email/templates/${e}`,n)}async deleteTemplate(e,n=!1){return this.deleteRequest(`/infra/connect/email/templates/${e}`,{params:{force:n}})}async previewTemplate(e,n){return this.post(`/infra/connect/email/templates/${e}/preview`,n)}};var ge=class extends r{async create(e){return this.post("/infra/connect/meet",e)}async list(e){return this.get("/infra/connect/meet",{params:e})}async retrieve(e){return this.get(`/infra/connect/meet/${e}`)}async update(e,n){return this.patch(`/infra/connect/meet/${e}`,n)}async reschedule(e,n){return this.patch(`/infra/connect/meet/${e}`,n)}async delete(e){return this.update(e,{status:"cancelled"})}};var ue=class extends r{async getConfig(){return this.get("/infra/connect/email/config")}async initDomainVerification(e){return this.post("/infra/connect/email/config/ses/domain",{domain:e})}async saveEmailConfig(e){return this.post("/infra/connect/email/config/ses/config",e)}async checkSesVerification(){return this.get("/infra/connect/email/config/ses/verify")}async removeSesIdentity(){return this.deleteRequest("/infra/connect/email/config/ses/domain")}async sendTest(e){return this.post("/infra/connect/email/config/test",{toEmail:e})}async saveAdvancedConfig(e){return this.post("/infra/connect/email/config/advanced",e)}async getHealth(){return this.get("/infra/connect/email/config/health")}async fixDmarc(){return this.post("/infra/connect/email/config/ses/fix-dmarc",{})}async listProviders(){return this.get("/infra/connect/email/config/providers")}};var me=class extends r{async list(e){return this.get("/infra/connect/whatsapp/templates",{params:e})}async sync(){return this.post("/infra/connect/whatsapp/templates/sync",{})}async retrieve(e){return this.get(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}`)}async create(e){return this.post("/infra/connect/whatsapp/templates",e)}async update(e,n){return this.put(`/infra/connect/whatsapp/templates/${e}`,n)}async deleteTemplate(e,n){return this.deleteRequest(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}${n?"?force=true":""}`)}async mappingConfig(){return this.get("/infra/connect/whatsapp/templates/mapping/config")}async collections(){return this.get("/infra/connect/whatsapp/templates/collections")}async collectionFields(e){return this.get(`/infra/connect/whatsapp/templates/collections/${encodeURIComponent(e)}/fields`)}async updateMapping(e,n){return this.put(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/mapping`,n)}async validate(e){return this.get(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/validate`)}async preview(e,n){return this.post(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/preview`,{context:n})}async getVariableManifest(e){var c,p;let n=await this.retrieve(e),a=Array.isArray((c=n.data)==null?void 0:c.components)?n.data.components:[],o=[];for(let l of a)if(l.text){let d=l.text.match(/{{(\d+)}}/g);if(d)for(let f of d){let y=f.replace(/{{|}}/g,"");o.push({key:`var_${y}`,label:`${l.type} Var {{${y}}}`,type:"string",required:!0,group:l.type,description:`Variable placeholder in template ${l.type}`})}}return{name:`Template variables: ${((p=n.data)==null?void 0:p.name)||e}`,fields:o,uiHints:{icon:"Variables",primaryColor:"#059669"}}}async checkUsage(e){return this.get(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/usage`)}};var Un=L(require("axios"),1);var ye=class extends r{async getUsage(){return this.get("/infra/storage/files/usage")}async createFolder(e){return this.post("/infra/storage/files/folders",{name:e})}async list(e,n){return this.get(`/infra/storage/files/files/${e}`,{params:n})}async delete(e){return this.deleteRequest("/infra/storage/files/files",{params:{key:e}})}async getDownloadUrl(e){return this.post("/infra/storage/files/download-url",{key:e})}async aiDescribe(e){return this.post("/infra/storage/files/ai/describe",{key:e})}async upload(e,n){let a=await this.post("/infra/storage/files/upload-url",n),{uploadUrl:o,key:c}=a.data;await Un.default.put(o,e,{headers:{"Content-Type":n.contentType}});let p=e.size||e.byteLength||0;return this.post("/infra/storage/files/confirm-upload",{key:c,sizeBytes:p})}};var fe=class extends r{async create(e){return this.post("/infra/storage/files/folders",{name:e})}async delete(e){return this.deleteRequest(`/infra/storage/files/folders/${encodeURIComponent(e)}`)}},he=class extends r{async list(e,n){return this.get(`/infra/storage/files/files/${e}`,{params:n})}async getUploadUrl(e){return this.post("/infra/storage/files/upload-url",e)}async confirmUpload(e){return this.post("/infra/storage/files/confirm-upload",e)}async getDownloadUrl(e){return this.post("/infra/storage/files/download-url",{key:e})}async delete(e){return this.deleteRequest("/infra/storage/files",{params:{key:e}})}};var v=class extends r{async listNichePacks(e={}){return this.get("/platform/admin/onboarding/niche-packs",{params:P(e)})}async getNichePack(e,n){let a=n?{version:n}:void 0;return this.get(`/platform/admin/onboarding/niche-packs/${encodeURIComponent(e)}`,{params:a})}async createNichePack(e){return this.post("/platform/admin/onboarding/niche-packs",e)}async updateNichePack(e,n,a){let o=a?{version:a}:void 0;return this.patch(`/platform/admin/onboarding/niche-packs/${encodeURIComponent(e)}`,n,{params:o})}async publishNichePack(e,n){let a=n?{version:n}:void 0;return this.post(`/platform/admin/onboarding/niche-packs/${encodeURIComponent(e)}/publish`,void 0,{params:a})}async unpublishNichePack(e,n){let a=n?{version:n}:void 0;return this.post(`/platform/admin/onboarding/niche-packs/${encodeURIComponent(e)}/unpublish`,void 0,{params:a})}async forkNichePack(e,n={}){return this.post(`/platform/admin/onboarding/niche-packs/${encodeURIComponent(e)}/fork`,n)}async smokeTestNichePack(e,n={},a){let o=a?{version:a}:void 0;return this.post(`/platform/admin/onboarding/niche-packs/${encodeURIComponent(e)}/smoke-test`,n,{params:o})}async listOnboardingConfigs(e={}){return this.get("/platform/admin/onboarding/configs",{params:P(e)})}async createOnboardingConfig(e){return this.post("/platform/admin/onboarding/configs",e)}async updateOnboardingConfig(e,n,a){return this.patch(`/platform/admin/onboarding/configs/${encodeURIComponent(e)}/${encodeURIComponent(n)}`,a)}async publishOnboardingConfig(e,n){return this.post(`/platform/admin/onboarding/configs/${encodeURIComponent(e)}/${encodeURIComponent(n)}/publish`)}async listOnboardingExperiments(e={}){return this.get("/platform/admin/onboarding/experiments",{params:P(e)})}async getOnboardingExperiment(e){return this.get(`/platform/admin/onboarding/experiments/${encodeURIComponent(e)}`)}async createOnboardingExperiment(e){return this.post("/platform/admin/onboarding/experiments",e)}async updateOnboardingExperiment(e,n){return this.patch(`/platform/admin/onboarding/experiments/${encodeURIComponent(e)}`,n)}async deleteOnboardingExperiment(e){return this.deleteRequest(`/platform/admin/onboarding/experiments/${encodeURIComponent(e)}`)}async getOnboardingFunnel(e={}){return this.get("/platform/admin/onboarding/analytics/funnel",{params:P(e)})}async getOnboardingTimeOnStep(e={}){return this.get("/platform/admin/onboarding/analytics/time-on-step",{params:P(e)})}async getOnboardingAbandonment(e={}){return this.get("/platform/admin/onboarding/analytics/abandonment",{params:P(e)})}};function P(t){let e={};for(let[n,a]of Object.entries(t))a!==void 0&&(e[n]=a);return e}var Te=class extends r{async list(){return this.get("/platform/admin/cors/cors")}async create(e){return this.post("/platform/admin/cors/cors",e)}async update(e,n){return this.patch(`/platform/admin/cors/cors/${e}`,n)}async delete(e){return this.deleteRequest(`/platform/admin/cors/cors/${e}`)}};var be=class extends r{async system(){return(await this.get("/health")).data}};var xe=class extends r{async listLogs(e){return this.get("/product/erix/event-log/events/logs",{params:e})}async retrieveLog(e){return this.get(`/product/erix/event-log/events/logs/${e}`)}async getStats(e){return this.get("/product/erix/event-log/events/stats",{params:e})}async listCallbacks(e){return this.get("/product/erix/event-log/callbacks/logs",{params:e})}async listAlerts(e){return this.get("/platform/users/notifications",{params:e})}async dismissAlert(e){return this.patch(`/platform/users/notifications/${e}/dismiss`)}async clearAllAlerts(){return this.deleteRequest("/platform/users/notifications/dismiss-all")}async retryAction(e){return this.post(`/platform/users/notifications/${e}/retry`,{})}};var A=class extends r{async global(e){return this.post("/platform/tenants/onboarding/onboarding/global",e)}async start(e){return this.post(`/platform/tenants/onboarding/onboarding/${e.productId}/start`,e)}async answer(e){return this.post("/api/onboarding/answer",e)}async state(e){return this.get(`/platform/tenants/onboarding/onboarding/${e}/state`,{params:{productId:e}})}async complete(e){return this.post("/platform/tenants/onboarding/onboarding/complete",e)}async edit(e){return this.post("/api/onboarding/edit",e)}async previewWorkspace(e){return this.get("/api/onboarding/preview-workspace",{params:{sessionId:e}})}};var C=class extends r{async get(e){return super.get(`/platform/tenants/persona/persona/${e}`)}async reinforce(e){return this.post(`/platform/tenants/persona/persona/${e.productId}/reinforce`,e)}async confidence(e){return super.get(`/platform/tenants/persona/persona/${e}/confidence`,{params:{productId:e}})}async timeline(e,n){var o;let a=await super.get(`/platform/tenants/persona/persona/${e}/timeline`,{params:n});return(o=a==null?void 0:a.data)!=null?o:{entries:[],hasMore:!1}}async followups(e){var a,o;let n=await super.get(`/platform/tenants/persona/persona/${e}/followups`);return(o=(a=n==null?void 0:n.data)==null?void 0:a.entries)!=null?o:[]}};var hn=class extends r{async list(){return this.get("/platform/admin/clients")}async getCountAndGenerateCode(){return this.get("/platform/admin/clients/count")}async retrieve(e){return this.get(`/platform/admin/clients/${e}`)}async getApiKey(e){return this.get(`/platform/admin/clients/${e}/api-key`)}async rotateApiKey(e){return this.post(`/platform/admin/clients/${e}/api-key`,{})}async create(e){return this.post("/platform/admin/clients",e)}async getConfig(e){return this.get(`/platform/admin/clients/${e}/config`)}async updateConfig(e,n){return this.patch(`/platform/admin/clients/${e}/config`,n)}async getConnections(e){return this.get(`/platform/admin/clients/${e}/connections`)}async getConnectProviders(e){return this.get(`/platform/admin/clients/${e}/connections/providers`)}async connectProvider(e,n,a){return this.post(`/platform/admin/clients/${e}/connections/${n}/connect`,a)}async configureProvider(e,n,a){return this.put(`/platform/admin/clients/${e}/connections/${n}/configure`,a)}async disconnectProvider(e,n){return this.post(`/platform/admin/clients/${e}/connections/${n}/disconnect`,{})}async revealConnection(e,n){return this.post(`/platform/admin/clients/${e}/connections/${n}/reveal`,{})}async setConnectionAccess(e,n,a){return this.put(`/platform/admin/clients/${e}/connections/${n}/access`,a)}async getDataSource(e){return this.get(`/api/clients/${e}/datasource`)}async manageDataSource(e,n){return this.post(`/api/clients/${e}/datasource`,n)}async updateIdentity(e,n){return this.patch(`/platform/admin/clients/${e}/identity`,n)}async googleReauth(e,n={}){return this.post(`/platform/admin/clients/${e}/google/reauth`,n)}async delete(e){return this.deleteRequest(`/platform/admin/clients/${e}`)}},Tn=class extends r{async list(){return this.get("/platform/admin/blogs/services/blogs")}},bn=class extends r{async add(e){return this.post("/platform/admin/leads/add-lead",e)}},we=class extends r{constructor(n){super(n);s(this,"clients");s(this,"blogs");s(this,"globalLeads");this.clients=new hn(n),this.blogs=new Tn(n),this.globalLeads=new bn(n)}};var xn=class extends r{async chatSync(e){return this.post("/platform/ai/copilot/chat/sync",e)}async confirm(e){return this.post("/platform/ai/copilot/confirm",e)}async listSessions(){return this.get("/platform/ai/copilot/sessions")}async getSession(e){return this.get(`/platform/ai/copilot/sessions/${e}`)}async deleteSession(e){return this.deleteRequest(`/platform/ai/copilot/sessions/${e}`)}chatStreamUrl(){return"/platform/ai/copilot/chat"}},Re=class{constructor(e){s(this,"copilot");this.copilot=new xn(e)}};var ke=class extends r{async register(e){return this.post("/platform/auth/register",e)}async login(e){return this.post("/platform/auth/login",e)}async logout(e){return this.post("/platform/auth/logout",e)}async logoutAll(e){return this.post("/platform/auth/logout-all",e)}async validateSession(e){return this.post("/platform/auth/session/validate",e)}async listSessions(){return this.get("/platform/auth/sessions")}async revokeSession(e){return this.deleteRequest(`/platform/auth/sessions/${e}`)}async requestPasswordOtp(e){return this.post("/platform/auth/password/request-otp",e)}async setPassword(e){return this.post("/platform/auth/password/set",e)}async changePassword(e){return this.post("/platform/auth/password/change",e)}async forgotPassword(e){return this.post("/platform/auth/forgot",e)}async resetPassword(e){return this.post("/platform/auth/reset",e)}async linkOAuth(e){return this.post("/platform/auth/oauth-link",e)}async getInvitation(e){return this.get(`/platform/auth/invitations/${e}`)}async acceptInvitation(e,n){return this.post(`/platform/auth/invitations/${e}/accept`,n)}};var wn=class extends r{async get(){return super.get("/platform/billing/entitlements/entitlements")}async usage(){return super.get("/platform/billing/entitlements/usage")}},Rn=class extends r{async upgrade(e){return this.post("/platform/billing/subscriptions/subscriptions/upgrade",e)}async downgrade(e){return this.post("/platform/billing/subscriptions/subscriptions/downgrade",e)}async cancel(e){return this.post("/platform/billing/subscriptions/subscriptions/cancel",e)}async purchaseAddon(e){return this.post("/platform/billing/subscriptions/addons/purchase",e)}async cancelAddon(e){return this.post("/platform/billing/subscriptions/addons/cancel",e)}},kn=class extends r{async listPublic(){return this.get("/platform/billing/plans/public")}},Pn=class extends r{async plans(){return this.get("/platform/billing/checkout/plans")}async subscribe(e){return this.post("/platform/billing/checkout/subscribe",e)}async verify(e){return this.post("/platform/billing/checkout/verify",e)}async cancel(e){return this.post("/platform/billing/checkout/cancel",e)}async status(){return this.get("/platform/billing/checkout/status")}async syncPlan(e){return this.post("/platform/billing/checkout/sync-plan",e)}},vn=class extends r{async transactions(){return this.get("/platform/billing/user/transactions")}async subscription(){return this.get("/platform/billing/user/subscription")}async raiseDispute(e){return this.post("/platform/billing/user/dispute",e)}async disputes(){return this.get("/platform/billing/user/disputes")}},An=class extends r{async balance(){return this.get("/platform/billing/credits/balance")}async transactions(){return this.get("/platform/billing/credits/transactions")}async packs(){return this.get("/platform/billing/credits/packs")}async topupOrder(e){return this.post("/platform/billing/credits/topup/order",e)}async verifyTopup(e){return this.post("/platform/billing/credits/topup/verify",e)}async setAutoTopup(e){return this.patch("/platform/billing/credits/auto-topup",e)}async setSpendCap(e){return this.patch("/platform/billing/credits/spend-cap",e)}},Pe=class{constructor(e){s(this,"entitlements");s(this,"subscriptions");s(this,"plans");s(this,"checkout");s(this,"user");s(this,"credits");this.entitlements=new wn(e),this.subscriptions=new Rn(e),this.plans=new kn(e),this.checkout=new Pn(e),this.user=new vn(e),this.credits=new An(e)}};var ve=class extends r{async categories(){return this.get("/platform/support/categories")}async listTickets(e){return this.get("/platform/support/tickets",{params:e})}async createTicket(e){return this.post("/platform/support/tickets",e)}async getTicket(e){return this.get(`/platform/support/tickets/${e}`)}async reply(e,n){return this.post(`/platform/support/tickets/${e}/reply`,n)}async close(e){return this.patch(`/platform/support/tickets/${e}/close`,{})}};var Ae=class extends r{async get(){return super.get("/platform/users/me")}async update(e){return this.patch("/platform/users/me",e)}async updateOrganization(e){return this.patch("/platform/users/me/organization",e)}async toggleModules(e){return this.post("/platform/users/me/modules",e)}async workspaces(){return super.get("/platform/users/me/workspaces")}async setActiveOrg(e){return this.post("/platform/users/me/active-org",e)}async dismissWorkspaceSetup(){return this.post("/platform/users/me/workspace/dismiss-setup",{})}},Ce=class extends r{async list(){return this.get("/platform/users/members/members")}async invite(e){return this.post("/platform/users/members/members/invite",e)}async remove(e){return this.deleteRequest(`/platform/users/members/members/${e}`)}},Ie=class extends r{async list(){return this.get("/platform/users/sessions")}async revoke(e){return this.deleteRequest(`/platform/users/sessions/${e}`)}async revokeAll(){return this.deleteRequest("/platform/users/sessions")}};var $e=class extends r{async list(e){return this.get("/platform/admin/logs",{params:e})}async export(e){return this.get("/platform/admin/logs/export",{params:e})}};var Oe=class extends r{async getSettings(){return this.get("/platform/admin/agency-invoices/admin/invoice-settings")}async updateSettings(e){return this.patch("/platform/admin/agency-invoices/admin/invoice-settings",e)}async list(e){return this.get("/platform/admin/agency-invoices/admin/invoices",{params:e})}async create(e){return this.post("/platform/admin/agency-invoices/admin/invoices",e)}async retrieve(e){return this.get(`/platform/admin/agency-invoices/admin/invoices/${e}`)}async update(e,n){return this.patch(`/platform/admin/agency-invoices/admin/invoices/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/agency-invoices/admin/invoices/${e}`)}};var Se=class extends r{async stats(e){return this.get("/platform/admin/agents/stats",{params:e})}async list(e){return this.get("/platform/admin/agents",{params:e})}async retrieve(e){return this.get(`/platform/admin/agents/${e}`)}async update(e,n){return this.patch(`/platform/admin/agents/${e}`,n)}async runs(e){return this.get(`/platform/admin/agents/${e}/runs`)}};var Ee=class extends r{async overview(e){return this.get("/platform/admin/analytics/overview",{params:e})}async endpoints(e){return this.get("/platform/admin/analytics/endpoints",{params:e})}async errors(e){return this.get("/platform/admin/analytics/errors",{params:e})}async tenants(e){return this.get("/platform/admin/analytics/tenants",{params:e})}};var Le=class extends r{async list(e){return this.get("/platform/admin/comms",{params:e})}async create(e){return this.post("/platform/admin/comms",e)}async update(e,n){return this.patch(`/platform/admin/comms/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/comms/${e}`)}async publish(e,n){return this.post(`/platform/admin/comms/${e}/publish`,n)}async broadcast(e){return this.post("/platform/admin/comms/broadcast",e)}async setMaintenance(e){return this.post("/platform/admin/comms/maintenance",e)}async getMaintenance(e){return this.get("/platform/admin/comms/maintenance",{params:e})}async changelog(e){return this.post("/platform/admin/comms/changelog",e)}};var De=class extends r{async stats(e){return this.get("/platform/admin/audit/stats",{params:e})}async list(e){return this.get("/platform/admin/audit",{params:e})}async export(e){return this.get("/platform/admin/audit/export",{params:e})}};var qe=class extends r{async events(e){return this.get("/platform/admin/billing/events",{params:e})}async orgEvents(e){return this.get(`/platform/admin/billing/events/${e}`)}async failed(e){return this.get("/platform/admin/billing/failed",{params:e})}async recordEvent(e){return this.post("/platform/admin/billing/record-event",e)}async extendTrial(e){return this.post("/platform/admin/billing/extend-trial",e)}async grandfather(e){return this.post("/platform/admin/billing/grandfather",e)}async reconcile(e){return this.get("/platform/admin/billing/reconcile",{params:e})}};var Ne=class extends r{async list(e){return this.get("/platform/admin/blogs/services/blogs",{params:e})}async retrieve(e){return this.get(`/platform/admin/blogs/services/blogs/${e}`)}async create(e){return this.post("/platform/admin/blogs/services/blogs",e)}async update(e,n){return this.put(`/platform/admin/blogs/services/blogs/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/blogs/services/blogs/${e}`)}};var Fe=class extends r{async requests(e){return this.get("/platform/admin/compliance/requests",{params:e})}async createRequest(e){return this.post("/platform/admin/compliance/requests",e)}async updateRequest(e,n){return this.patch(`/platform/admin/compliance/requests/${e}`,n)}async exportOrg(e,n){return this.post(`/platform/admin/compliance/export/${e}`,n)}};var Ue=class extends r{async rateCard(e){return this.get("/platform/admin/credits/rate-card",{params:e})}async packs(e){return this.get("/platform/admin/credits/packs",{params:e})}async createPack(e){return this.post("/platform/admin/credits/packs",e)}async updatePack(e,n){return this.patch(`/platform/admin/credits/packs/${e}`,n)}async deletePack(e){return this.deleteRequest(`/platform/admin/credits/packs/${e}`)}async wallet(e){return this.get(`/platform/admin/credits/wallet/${e}`)}async adjustWallet(e,n){return this.post(`/platform/admin/credits/wallet/${e}/adjust`,n)}};var Be=class extends r{async stats(e){return this.get("/platform/admin/dashboard/admin/dashboard/stats",{params:e})}};var Me=class extends r{async overview(e){return this.get("/platform/admin/email/overview",{params:e})}async campaigns(e){return this.get("/platform/admin/email/campaigns",{params:e})}async events(e){return this.get("/platform/admin/email/events",{params:e})}async sesHealth(e){return this.get("/platform/admin/email/ses-health",{params:e})}};var _e=class extends r{async createTenant(e){return this.post("/platform/admin/erix/tenants",e)}async tenants(e){return this.get("/platform/admin/erix/tenants",{params:e})}async tenant(e){return this.get(`/platform/admin/erix/tenants/${e}`)}async updatePlan(e,n){return this.patch(`/platform/admin/erix/tenants/${e}/plan`,n)}async suspend(e,n){return this.post(`/platform/admin/erix/tenants/${e}/suspend`,n)}async reactivate(e,n){return this.post(`/platform/admin/erix/tenants/${e}/reactivate`,n)}async rotateKey(e,n){return this.post(`/platform/admin/erix/tenants/${e}/rotate-key`,n)}async usage(e){return this.get(`/platform/admin/erix/tenants/${e}/usage`)}};var Ve=class extends r{async list(e){return this.get("/platform/admin/flags",{params:e})}async create(e){return this.post("/platform/admin/flags",e)}async update(e,n){return this.patch(`/platform/admin/flags/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/flags/${e}`)}async listOverrides(e){return this.get(`/platform/admin/flags/${e}/overrides`)}async addOverride(e,n){return this.post(`/platform/admin/flags/${e}/overrides`,n)}async removeOverride(e,n){return this.deleteRequest(`/platform/admin/flags/${e}/overrides/${n}`)}async forOrg(e){return this.get(`/platform/admin/flags/org/${e}`)}};var je=class extends r{async overview(e){return this.get("/platform/admin/flow/overview",{params:e})}async runs(e){return this.get("/platform/admin/flow/runs",{params:e})}async failures(e){return this.get("/platform/admin/flow/failures",{params:e})}async run(e){return this.get(`/platform/admin/flow/runs/${e}`)}async retryRun(e,n){return this.post(`/platform/admin/flow/runs/${e}/retry`,n)}};var We=class extends r{async list(e){return this.get(`/platform/admin/integrations/${e}/integrations`)}async connect(e,n,a){return this.post(`/platform/admin/integrations/${e}/integrations/${n}`,a)}async disconnect(e,n){return this.deleteRequest(`/platform/admin/integrations/${e}/integrations/${n}`)}async test(e,n,a){return this.post(`/platform/admin/integrations/${e}/integrations/${n}/test`,a)}async invite(e,n){return this.post(`/platform/admin/integrations/${e}/invite`,n)}};var He=class extends r{async overview(e){return this.get("/platform/admin/laie/overview",{params:e})}async queue(e){return this.get("/platform/admin/laie/queue",{params:e})}async proxies(e){return this.get("/platform/admin/laie/proxies",{params:e})}async vaultStats(e){return this.get("/platform/admin/laie/vault-stats",{params:e})}async credits(e){return this.get("/platform/admin/laie/credits",{params:e})}async actors(e){return this.get("/platform/admin/laie/actors",{params:e})}async actorRegistry(e){return this.get("/platform/admin/laie/actors/registry",{params:e})}async runActor(e,n){return this.post(`/platform/admin/laie/actors/${e}/run`,n)}async getEnrichmentConfig(){return this.get("/platform/admin/laie/enrichment/config")}async setEnrichmentConfig(e){return this.put("/platform/admin/laie/enrichment/config",e)}async audits(e){return this.get("/platform/admin/laie/audits",{params:e})}async audit(e){return this.get(`/platform/admin/laie/audits/${e}`)}};var Ke=class extends r{async queueStats(e){return this.get("/platform/admin/laie-runtime/queue/stats",{params:e})}async proxyHealth(e){return this.get("/platform/admin/laie-runtime/proxy/health",{params:e})}async browserPoolStats(e){return this.get("/platform/admin/laie-runtime/browser-pool/stats",{params:e})}async replayDlq(e){return this.post("/platform/admin/laie-runtime/dlq/replay",e)}async runStats(e){return this.get("/platform/admin/laie-runtime/runs/stats",{params:e})}};var ze=class extends r{async overview(e){return this.get("/platform/admin/laie-vault/admin/laie/vault",{params:e})}};var Qe=class extends r{async addLead(e){return this.post("/platform/admin/leads/add-lead",e)}async list(e){return this.get("/platform/admin/leads/leads",{params:e})}async retrieve(e){return this.get(`/platform/admin/leads/leads/${e}`)}async update(e,n){return this.patch(`/platform/admin/leads/leads/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/leads/leads/${e}`)}async updateStatus(e,n){return this.patch(`/platform/admin/leads/leads/${e}/status`,n)}async qualification(e,n){return this.post(`/platform/admin/leads/leads/${e}/qualification`,n)}async firstContact(e,n){return this.post(`/platform/admin/leads/leads/${e}/first-contact`,n)}async followup(e,n){return this.post(`/platform/admin/leads/leads/${e}/followup`,n)}async notes(e){return this.get(`/platform/admin/leads/leads/${e}/notes`)}async addNote(e,n){return this.post(`/platform/admin/leads/leads/${e}/notes`,n)}async updateNote(e,n,a){return this.patch(`/platform/admin/leads/leads/${e}/notes/${n}`,a)}async deleteNote(e,n){return this.deleteRequest(`/platform/admin/leads/leads/${e}/notes/${n}`)}};var Ge=class extends r{async json(){return this.get("/platform/admin/openapi/openapi.json")}async spec(){return this.get("/platform/admin/openapi/openapi")}async health(){return this.get("/platform/admin/openapi/openapi/health")}};var Ye=class extends r{async stats(e){return this.get("/platform/admin/partners/stats",{params:e})}async list(e){return this.get("/platform/admin/partners",{params:e})}async create(e){return this.post("/platform/admin/partners",e)}async retrieve(e){return this.get(`/platform/admin/partners/${e}`)}async update(e,n){return this.patch(`/platform/admin/partners/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/partners/${e}`)}async referrals(e){return this.get(`/platform/admin/partners/${e}/referrals`)}async updateReferral(e,n,a){return this.patch(`/platform/admin/partners/${e}/referrals/${n}`,a)}};var Je=class extends r{async refund(e){return this.post("/platform/admin/payments/refund",e)}async validate(e){return this.get(`/platform/admin/payments/validate/${e}`)}async fetch(e){return this.get(`/platform/admin/payments/fetch/${e}`)}async subscription(e){return this.get(`/platform/admin/payments/subscription/${e}`)}async failed(e){return this.get("/platform/admin/payments/failed",{params:e})}async retry(e,n){return this.post(`/platform/admin/payments/retry/${e}`,n)}async timeline(e){return this.get(`/platform/admin/payments/timeline/${e}`)}async risk(e){return this.get(`/platform/admin/payments/risk/${e}`)}};var Xe=class extends r{async stats(e){return this.get("/platform/admin/persona-history/stats",{params:e})}async list(e){return this.get("/platform/admin/persona-history",{params:e})}async retrieve(e){return this.get(`/platform/admin/persona-history/${e}`)}async version(e,n){return this.get(`/platform/admin/persona-history/${e}/${n}`)}};var Ze=class extends r{async templates(e){return this.get("/platform/admin/pipelines/templates",{params:e})}async createTemplate(e){return this.post("/platform/admin/pipelines/templates",e)}async updateTemplate(e,n){return this.patch(`/platform/admin/pipelines/templates/${e}`,n)}async deleteTemplate(e){return this.deleteRequest(`/platform/admin/pipelines/templates/${e}`)}async provision(e){return this.post("/platform/admin/pipelines/provision",e)}async overview(e){return this.get("/platform/admin/pipelines/overview",{params:e})}};var en=class extends r{async list(e){return this.get("/platform/admin/plans",{params:e})}async create(e){return this.post("/platform/admin/plans",e)}async update(e,n){return this.patch(`/platform/admin/plans/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/plans/${e}`)}async tenants(e){return this.get(`/platform/admin/plans/${e}/tenants`)}};var nn=class extends r{async summary(e){return this.get("/platform/admin/revenue/summary",{params:e})}async snapshots(e){return this.get("/platform/admin/revenue/snapshots",{params:e})}async generateSnapshot(e){return this.post("/platform/admin/revenue/snapshot/generate",e)}};var tn=class extends r{async verifyCredentials(e){return this.post("/platform/admin/auth/admin/staff/verify-credentials",e)}async findOrCreate(e){return this.post("/platform/admin/auth/admin/staff/find-or-create",e)}async list(e){return this.get("/platform/admin/auth/admin/staff",{params:e})}async create(e){return this.post("/platform/admin/auth/admin/staff",e)}async update(e,n){return this.patch(`/platform/admin/auth/admin/staff/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/auth/admin/staff/${e}`)}};var rn=class extends r{async stats(e){return this.get("/platform/admin/storage/stats",{params:e})}async events(e){return this.get("/platform/admin/storage/events",{params:e})}async usage(e){return this.get("/platform/admin/storage/usage",{params:e})}};var sn=class extends r{async overview(e){return this.get("/platform/admin/health",{params:e})}};var an=class extends r{async list(e){return this.get("/platform/admin/templates",{params:e})}async create(e){return this.post("/platform/admin/templates",e)}async retrieve(e){return this.get(`/platform/admin/templates/${e}`)}async update(e,n){return this.patch(`/platform/admin/templates/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/templates/${e}`)}async clone(e,n){return this.post(`/platform/admin/templates/${e}/clone`,n)}async versions(e){return this.get(`/platform/admin/templates/${e}/versions`)}async assignPlans(e,n){return this.post(`/platform/admin/templates/${e}/plans`,n)}};var on=class extends r{async deep(e){return this.get(`/platform/admin/tenants/${e}/deep`)}async usage(e){return this.get(`/platform/admin/tenants/${e}/usage`)}async team(e){return this.get(`/platform/admin/tenants/${e}/team`)}async billing(e){return this.get(`/platform/admin/tenants/${e}/billing`)}async whatsapp(e){return this.get(`/platform/admin/tenants/${e}/whatsapp`)}async flows(e){return this.get(`/platform/admin/tenants/${e}/flows`)}async crmStats(e){return this.get(`/platform/admin/tenants/${e}/crm-stats`)}async impersonate(e,n){return this.post(`/platform/admin/tenants/${e}/impersonate`,n)}async suspend(e,n){return this.post(`/platform/admin/tenants/${e}/suspend`,n)}async reactivate(e,n){return this.post(`/platform/admin/tenants/${e}/reactivate`,n)}async updatePlan(e,n){return this.patch(`/platform/admin/tenants/${e}/plan`,n)}async updateLimits(e,n){return this.patch(`/platform/admin/tenants/${e}/limits`,n)}async bulkAssignPlan(e){return this.post("/platform/admin/tenants/bulk-assign-plan",e)}async unassigned(){return this.get("/platform/admin/tenants/unassigned")}};var cn=class extends r{async stats(e){return this.get("/platform/admin/tickets/stats",{params:e})}async list(e){return this.get("/platform/admin/tickets",{params:e})}async create(e){return this.post("/platform/admin/tickets",e)}async retrieve(e){return this.get(`/platform/admin/tickets/${e}`)}async update(e,n){return this.patch(`/platform/admin/tickets/${e}`,n)}async addMessage(e,n){return this.post(`/platform/admin/tickets/${e}/messages`,n)}async resolve(e,n){return this.post(`/platform/admin/tickets/${e}/resolve`,n)}async close(e,n){return this.post(`/platform/admin/tickets/${e}/close`,n)}};var pn=class extends r{async stats(e){return this.get("/platform/admin/waitlist/stats",{params:e})}async list(e){return this.get("/platform/admin/waitlist",{params:e})}async retrieve(e){return this.get(`/platform/admin/waitlist/${e}`)}async update(e,n){return this.patch(`/platform/admin/waitlist/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/waitlist/${e}`)}async bulk(e){return this.post("/platform/admin/waitlist/bulk",e)}};var dn=class extends r{async overview(e){return this.get("/platform/admin/whatsapp/overview",{params:e})}async wabas(e){return this.get("/platform/admin/whatsapp/wabas",{params:e})}async templates(e){return this.get("/platform/admin/whatsapp/templates",{params:e})}async delivery(e){return this.get("/platform/admin/whatsapp/delivery",{params:e})}async webhooks(e){return this.get("/platform/admin/whatsapp/webhooks",{params:e})}};var D=class{constructor(e){s(this,"messages");s(this,"conversations");s(this,"broadcasts");this.messages=new te(e),this.conversations=new ne(e),this.broadcasts=new ee(e)}},q=class{constructor(e){s(this,"leads");s(this,"pipelines");s(this,"automations");s(this,"activities");s(this,"analytics");s(this,"scoring");s(this,"payments");s(this,"sequences");s(this,"automationDashboard");s(this,"chat");s(this,"events");s(this,"eventLog");s(this,"invoices");s(this,"checkout");s(this,"projects");s(this,"campaigns");s(this,"portalInbox");this.leads=new G(e),this.pipelines=new J(e),this.automations=new Q(e),this.activities=new H(e),this.analytics=new K(e),this.scoring=new X(e),this.payments=new Y(e),this.sequences=new Z(e),this.automationDashboard=new z(e),this.chat=new D(e),this.events=new ae(e),this.eventLog=new oe(e),this.invoices=new ie(e),this.checkout=new se(e),this.projects=new pe(e),this.campaigns=new re(e),this.portalInbox=new ce(e)}},I=class{constructor(e){s(this,"erix");this.erix=new q(e)}},N=class{constructor(e){s(this,"config");s(this,"templates");this.config=new ue(e),this.templates=new le(e)}},F=class{constructor(e){s(this,"templates");this.templates=new me(e)}},U=class{constructor(e){s(this,"email");s(this,"whatsapp");s(this,"meet");s(this,"connections");this.email=new N(e),this.whatsapp=new F(e),this.meet=new ge(e),this.connections=new de(e)}},B=class{constructor(e){s(this,"files");s(this,"folders");s(this,"media");this.files=new he(e),this.folders=new fe(e),this.media=new ye(e)}},$=class{constructor(e){s(this,"connect");s(this,"storage");this.connect=new U(e),this.storage=new B(e)}},M=class{constructor(e){s(this,"onboarding");s(this,"persona");this.onboarding=new A(e),this.persona=new C(e)}},_=class{constructor(e){s(this,"me");s(this,"members");s(this,"sessions");s(this,"notifications");this.me=new Ae(e),this.members=new Ce(e),this.sessions=new Ie(e),this.notifications=new xe(e)}},V=class{constructor(e){s(this,"revenue");s(this,"billing");s(this,"payments");s(this,"credits");s(this,"plans");s(this,"agencyInvoices");s(this,"flags");s(this,"activityLogs");s(this,"auditLogs");s(this,"analytics");s(this,"health");s(this,"storage");s(this,"announcements");s(this,"compliance");s(this,"tickets");s(this,"templates");s(this,"agents");s(this,"personaHistory");s(this,"openapi");s(this,"staff");s(this,"tenants");s(this,"whatsapp");s(this,"laie");s(this,"laieRuntime");s(this,"laieVault");s(this,"flow");s(this,"email");s(this,"pipelines");s(this,"integrations");s(this,"erix");s(this,"dashboard");s(this,"partners");s(this,"waitlist");s(this,"blogs");s(this,"leads");s(this,"onboarding");s(this,"cors");s(this,"clients");this.revenue=new nn(e),this.billing=new qe(e),this.payments=new Je(e),this.credits=new Ue(e),this.plans=new en(e),this.agencyInvoices=new Oe(e),this.flags=new Ve(e),this.activityLogs=new $e(e),this.auditLogs=new De(e),this.analytics=new Ee(e),this.health=new sn(e),this.storage=new rn(e),this.announcements=new Le(e),this.compliance=new Fe(e),this.tickets=new cn(e),this.templates=new an(e),this.agents=new Se(e),this.personaHistory=new Xe(e),this.openapi=new Ge(e),this.staff=new tn(e),this.tenants=new on(e),this.whatsapp=new dn(e),this.laie=new He(e),this.laieRuntime=new Ke(e),this.laieVault=new ze(e),this.flow=new je(e),this.email=new Me(e),this.pipelines=new Ze(e),this.integrations=new We(e),this.erix=new _e(e),this.dashboard=new Be(e),this.partners=new Ye(e),this.waitlist=new pn(e),this.blogs=new Ne(e),this.leads=new Qe(e),this.onboarding=new v(e),this.cors=new Te(e),this.clients=new we(e)}},O=class{constructor(e){s(this,"auth");s(this,"users");s(this,"tenants");s(this,"billing");s(this,"support");s(this,"ai");s(this,"admin");s(this,"health");this.auth=new ke(e),this.users=new _(e),this.tenants=new M(e),this.billing=new Pe(e),this.support=new ve(e),this.ai=new Re(e),this.admin=new V(e),this.health=new be(e)}};var S=class extends g{constructor(e){super(e,400,"invalid_signature"),this.name="WebhookSignatureError"}},ln=class{async constructEvent(e,n,a){if(!n)throw new S("No webhook signature provided");let o=Array.isArray(n)?n[0]:n;o.startsWith("sha256=")&&(o=o.slice(7));try{let c=await import("crypto"),l=c.createHmac("sha256",a).update(e).digest("hex");if(!c.timingSafeEqual(Buffer.from(l),Buffer.from(o)))throw new S("Invalid webhook signature provided");return JSON.parse(e.toString("utf8"))}catch(c){throw c instanceof S?c:new S(`Webhook payload parsing failed: ${c.message}`)}}};var Cn=typeof process!="undefined"&&"2.1.1"||"2.0.0";var w=class{constructor(e){s(this,"client");s(this,"socket",null);s(this,"socketPromise",null);s(this,"socketQueue",[]);s(this,"clientCode");s(this,"apiVersion");s(this,"platform");s(this,"product");s(this,"infra");s(this,"webhooks");var f,y,b,x,R;if(!e.apiKey)throw new m("API Key is required");this.clientCode=(f=e.clientCode)==null?void 0:f.toUpperCase(),this.apiVersion=(y=e.version)!=null?y:"v1";let n=(b=e.baseUrl)!=null?b:yn,a=Nn(this.apiVersion,n),o=e.socketUrl||n,c=typeof window!="undefined"&&typeof window.document!="undefined",p=c?"browser":typeof process!="undefined"?`node ${process.version}`:"unknown",l=c?((x=globalThis.navigator)==null?void 0:x.userAgent)||"browser":typeof process!="undefined"?process.platform:"unknown",d={"x-api-key":e.apiKey,"x-client-code":((R=e.clientCode)==null?void 0:R.toUpperCase())||"","Content-Type":"application/json","x-ecodrix-client-agent":JSON.stringify({sdk_version:Cn,runtime:p,os:l})};if(e.coreApiKey&&(d["x-core-api-key"]=e.coreApiKey),this.client=Bn.default.create({baseURL:a,headers:d}),(0,gn.default)(this.client,{retries:3,retryDelay:gn.default.exponentialDelay,retryCondition:u=>{var j;return gn.default.isNetworkOrIdempotentRequestError(u)||((j=u.response)==null?void 0:j.status)===429},onRetry:(u,j,$n)=>{var On,Sn;typeof process!="undefined"&&((On=process.env)==null?void 0:On.NODE_ENV)==="development"&&console.warn(`[ECODrIx SDK] Retrying request (${u}/3): ${(Sn=$n.method)==null?void 0:Sn.toUpperCase()} ${$n.url}. Reason: ${j.message}`)}}),this.platform=new O(this.client),this.product=new I(this.client),this.infra=new $(this.client),this.webhooks=new ln,this.initSocket(o,e.apiKey,e.clientCode),c){let u={version:Cn,clientCode:e.clientCode,initializedAt:new Date().toISOString()};window.__ECODRIX_SDK__=u,window.ecodrix||(window.ecodrix=this)}}initSocket(e,n,a){return this.socketPromise?this.socketPromise:(this.socketPromise=import("socket.io-client").then(({io:o})=>{this.socket=o(e,{extraHeaders:{"x-api-key":n,"x-client-code":(a==null?void 0:a.toUpperCase())||""}}),this.setupSocket(a);for(let{type:c,args:p}of this.socketQueue)c==="joinRoom"?this.socket.emit("join-room",p[0]):c==="leaveRoom"?this.socket.emit("leave-room",p[0]):c==="on"?this.socket.on(p[0],p[1]):c==="off"?this.socket.off(p[0],p[1]):c==="disconnect"&&this.socket.disconnect();this.socketQueue=[]}),this.socketPromise)}joinRoom(e){this.socket?this.socket.emit("join-room",e):this.socketQueue.push({type:"joinRoom",args:[e]})}leaveRoom(e){this.socket?this.socket.emit("leave-room",e):this.socketQueue.push({type:"leaveRoom",args:[e]})}setupSocket(e){this.socket&&this.socket.on("connect",()=>{e&&this.socket.emit("join-room",e.toUpperCase())})}on(e,n){return this.socket?this.socket.on(e,n):this.socketQueue.push({type:"on",args:[e,n]}),this}disconnect(){this.socket?this.socket.disconnect():this.socketQueue.push({type:"disconnect",args:[]})}off(e,n){return this.socket?this.socket.off(e,n):this.socketQueue.push({type:"off",args:[e,n]}),this}async request(e,n,a,o){var c,p,l;try{return(await this.client.request({method:e,url:n,data:a,params:o})).data}catch(d){throw d.response?new g(((c=d.response.data)==null?void 0:c.message)||((p=d.response.data)==null?void 0:p.error)||"Raw Execution Failed",d.response.status,(l=d.response.data)==null?void 0:l.code):new g(d.message||"Network Error")}}};var Mn={401:m,403:m,429:h};function Xn(t){var e,n,a;if(t.response){let o=t.response.status,c=((e=t.response.data)==null?void 0:e.message)||((n=t.response.data)==null?void 0:n.error)||"API Request Failed",p=(a=t.response.data)==null?void 0:a.code,l=Mn[o]||g;throw l===m?new m(c):l===h?new h(c):new g(c,o,p)}throw new g(t.message||"Network Error")}function Zn(t,e){return t instanceof e}function et(t){return t instanceof m?{message:t.message,status:t.status,code:t.code,type:"AuthenticationError"}:t instanceof h?{message:t.message,status:t.status,code:t.code,type:"RateLimitError"}:t instanceof g?{message:t.message,status:t.status,code:t.code,type:"APIError"}:{message:t.message||"Unknown error",type:"UnknownError"}}var In={[m.name]:{shouldRetry:!1,reason:"Authentication errors require fixing credentials, not retrying"},[h.name]:{shouldRetry:!0,maxRetries:3,baseDelay:1e3,backoffMultiplier:2,reason:"Rate limit errors can be retried with exponential backoff"},[g.name]:{shouldRetry:!0,maxRetries:2,baseDelay:500,backoffMultiplier:1.5,reason:"Generic API errors may be transient and worth retrying"}};function nt(t){let e=t.constructor.name;return In[e]||In[g.name]}var tt=w;0&&(module.exports={APIError,AdminOnboarding,AuthenticationError,ConnectInfra,ECODrIx,ECODrIxAPI,ERROR_RETRY_CONFIG,EcodrixError,EmailConnect,ErixChat,ErixProduct,HTTP_STATUS_ERROR_MAP,InfraDomain,LEAD_STATUS_VALUES,Onboarding,Persona,PlatformAdmin,PlatformDomain,PlatformTenants,PlatformUsers,ProductDomain,RateLimitError,StorageInfra,WhatsAppConnect,getErrorDetails,getRetryConfig,handleAPIError,isAPIError});
1
+ "use strict";var Vn=Object.create;var L=Object.defineProperty,jn=Object.defineProperties,Wn=Object.getOwnPropertyDescriptor,Hn=Object.getOwnPropertyDescriptors,Kn=Object.getOwnPropertyNames,Ln=Object.getOwnPropertySymbols,zn=Object.getPrototypeOf,Dn=Object.prototype.hasOwnProperty,Qn=Object.prototype.propertyIsEnumerable;var Gn=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t);var mn=(t,e,n)=>e in t?L(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,T=(t,e)=>{for(var n in e||(e={}))Dn.call(e,n)&&mn(t,n,e[n]);if(Ln)for(var n of Ln(e))Qn.call(e,n)&&mn(t,n,e[n]);return t},P=(t,e)=>jn(t,Hn(e));var Yn=(t,e)=>{for(var n in e)L(t,n,{get:e[n],enumerable:!0})},qn=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Kn(e))!Dn.call(t,o)&&o!==n&&L(t,o,{get:()=>e[o],enumerable:!(a=Wn(e,o))||a.enumerable});return t};var D=(t,e,n)=>(n=t!=null?Vn(zn(t)):{},qn(e||!t||!t.__esModule?L(n,"default",{value:t,enumerable:!0}):n,t)),Jn=t=>qn(L({},"__esModule",{value:!0}),t);var s=(t,e,n)=>mn(t,typeof e!="symbol"?e+"":e,n);var yn=function(t,e){this[0]=t,this[1]=e},Nn=(t,e,n)=>{var a=(l,d,f,y)=>{try{var b=n[l](d),x=(d=b.value)instanceof yn,R=b.done;Promise.resolve(x?d[0]:d).then(g=>x?a(l==="return"?l:"next",d[1]?{done:g.done,value:g.value}:g,f,y):f({value:g,done:R})).catch(g=>a("throw",g,f,y))}catch(g){y(g)}},o=(l,d,f,y)=>p[l]=b=>(d=new Promise((x,R,g)=>(g=()=>a(l,b,x,R),c?c.then(g):g())),y=()=>c===f&&(c=0),c=f=d.then(y,y),d),c,p={};return n=n.apply(t,e),p[Gn("asyncIterator")]=()=>p,o("next"),o("throw"),o("return"),p};var st={};Yn(st,{APIError:()=>u,AdminOnboarding:()=>A,AuthenticationError:()=>m,ConnectInfra:()=>B,ECODrIx:()=>w,ECODrIxAPI:()=>w,ERROR_RETRY_CONFIG:()=>$n,EcodrixError:()=>H,EmailConnect:()=>F,ErixChat:()=>q,ErixProduct:()=>N,HTTP_STATUS_ERROR_MAP:()=>_n,InfraDomain:()=>O,LEAD_STATUS_VALUES:()=>Un,Onboarding:()=>C,Persona:()=>I,PlatformAdmin:()=>j,PlatformDomain:()=>S,PlatformTenants:()=>_,PlatformUsers:()=>V,ProductDomain:()=>$,RateLimitError:()=>h,StorageInfra:()=>M,WhatsAppConnect:()=>U,default:()=>rt,getErrorDetails:()=>nt,getRetryConfig:()=>tt,handleAPIError:()=>Zn,isAPIError:()=>et});module.exports=Jn(st);var Mn=D(require("axios"),1),gn=D(require("axios-retry"),1);var fn="https://api.ecodrix.com";function Fn(t="v1",e=fn){return`${e.replace(/\/+$/,"")}/${t}/api`}var H=class extends Error{constructor(e){super(e),this.name="EcodrixError"}},u=class extends H{constructor(n,a,o){super(n);s(this,"status");s(this,"code");this.name="APIError",this.status=a,this.code=o}},m=class extends u{constructor(e="Invalid API Key or Client Code"){super(e,401,"AUTH_FAILED"),this.name="AuthenticationError"}},h=class extends u{constructor(e="Too many requests. Please slow down."){super(e,429,"RATE_LIMIT_EXCEEDED"),this.name="RateLimitError"}};var r=class{constructor(e){s(this,"client",e)}async post(e,n,a){try{let o=this.buildConfig(a);return(await this.client.post(e,n,o)).data}catch(o){this.handleError(o)}}async get(e,n){try{let a=this.buildConfig(n);return(await this.client.get(e,a)).data}catch(a){this.handleError(a)}}async patch(e,n,a){try{let o=this.buildConfig(a);return(await this.client.patch(e,n,o)).data}catch(o){this.handleError(o)}}async put(e,n,a){try{let o=this.buildConfig(a);return(await this.client.put(e,n,o)).data}catch(o){this.handleError(o)}}async deleteRequest(e,n){try{let a=this.buildConfig(n);return(await this.client.delete(e,a)).data}catch(a){this.handleError(a)}}buildConfig(e){if(!e)return;let n=T({},e);return e.idempotencyKey&&(n.headers=P(T({},n.headers),{"Idempotency-Key":e.idempotencyKey})),n}handleError(e){var n,a,o;if(e.response){let c=e.response.status,p=((n=e.response.data)==null?void 0:n.message)||((a=e.response.data)==null?void 0:a.error)||"API Request Failed",l=(o=e.response.data)==null?void 0:o.code;switch(c){case 401:throw new m(p);case 403:throw new m(p);case 429:throw new h(p);default:throw new u(p,c,l)}}throw new u(e.message||"Network Error")}};var hn=class extends r{async list(e){return this.get(`/product/erix/crm/leads/${e}/notes`)}async create(e,n){return this.post(`/product/erix/crm/leads/${e}/notes`,n)}async update(e,n){return this.patch(`/product/erix/crm/notes/${e}`,{content:n})}async pin(e,n=!0){return this.patch(`/product/erix/crm/notes/${e}/pin`,{isPinned:n})}async delete(e){return this.deleteRequest(`/product/erix/crm/notes/${e}`)}},K=class extends r{constructor(n){super(n);s(this,"notes");this.notes=new hn(n)}async timeline(n,a){return this.get(`/product/erix/crm/leads/${n}/timeline`,{params:a})}async list(n,a){return this.get(`/product/erix/crm/leads/${n}/activities`,{params:T({},a)})}async log(n){return this.post(`/product/erix/crm/leads/${n.leadId}/activities`,n)}async logCall(n,a){return this.post(`/product/erix/crm/leads/${n}/calls`,a)}};var z=class extends r{async overview(e){return this.get("/product/erix/crm/analytics/overview",{params:e})}async funnel(e){return this.get("/product/erix/crm/analytics/funnel",{params:{pipelineId:e}})}async forecast(e){return this.get("/product/erix/crm/analytics/forecast",{params:{pipelineId:e}})}async sources(e){return this.get("/product/erix/crm/analytics/sources",{params:e})}async team(e){return this.get("/product/erix/crm/analytics/team",{params:e})}async heatmap(e){return this.get("/product/erix/crm/analytics/heatmap",{params:e})}async scores(){return this.get("/product/erix/crm/analytics/scores")}async stageTime(e){return this.get("/product/erix/crm/analytics/stage-time",{params:{pipelineId:e}})}async tiered(e){return this.get("/product/erix/crm/analytics/tiered",{params:e})}async summary(e){return this.get("/product/erix/crm/analytics/summary",{params:e})}async whatsapp(e){return this.get("/product/erix/crm/analytics/whatsapp",{params:e})}};var Q=class extends r{async stats(){return this.get("/product/erix/crm/automation/stats")}async logs(e){return this.get("/product/erix/crm/automation/logs",{params:e})}async retryFailedEvent(e){return this.post(`/product/erix/crm/automation/logs/${e}/retry`,{})}};var G=class extends r{async list(){return this.get("/product/erix/crm/automations")}async create(e){return this.post("/product/erix/crm/automations",e)}async update(e,n){return this.patch(`/product/erix/crm/automations/${e}`,n)}async toggle(e){return this.patch(`/product/erix/crm/automations/${e}/toggle`)}async delete(e){return this.deleteRequest(`/product/erix/crm/automations/${e}`)}async bulkDelete(e){return this.post("/product/erix/crm/automations/bulk-delete",{ids:e})}async test(e,n){return this.post(`/product/erix/crm/automations/${e}/test`,{leadId:n})}async getAvailableEvents(){return this.post("/product/erix/crm/events",{})}async enrollments(e,n){return this.get(`/product/erix/crm/${e}/enrollments`,{params:n})}async getEnrollment(e){return this.get(`/product/erix/crm/enrollments/${e}`)}async pauseEnrollment(e,n){return this.post(`/product/erix/crm/${e}/enrollments/${n}/pause`,{})}async resumeEnrollment(e,n){return this.post(`/product/erix/crm/${e}/enrollments/${n}/resume`,{})}async runs(e){return this.get(`/product/erix/crm/${e}/runs`)}async getRun(e){return this.get(`/product/erix/crm/runs/${e}`)}async resumeRun(e){return this.post(`/product/erix/crm/runs/${e}/resume`,{})}async abortRun(e){return this.post(`/product/erix/crm/runs/${e}/abort`,{})}async webhookEvent(e,n,a){return this.post("/product/erix/crm/webhook-event",{ruleId:e,eventName:n,payload:a})}async trigger(e){return this.post("/product/erix/events/trigger",e)}};var Un=["open","won","lost","archived"],Y=class extends r{async create(e){return this.post("/product/erix/crm/leads",e)}async describe(){let e=await this.fields(),n=Array.isArray(e.data)?e.data:[],a=[{key:"firstName",label:"First Name",type:"string",required:!0,group:"Basic Info"},{key:"lastName",label:"Last Name",type:"string",required:!1,group:"Basic Info"},{key:"phone",label:"Phone Number",type:"phone",required:!0,group:"Contact"},{key:"email",label:"Email Address",type:"email",required:!1,group:"Contact"},{key:"status",label:"Status",type:"select",required:!0,options:[{label:"New",value:"new"},{label:"Contacted",value:"contacted"},{label:"Qualified",value:"qualified"},{label:"Won",value:"won"},{label:"Lost",value:"lost"}]},{key:"value",label:"Lead Value",type:"currency",required:!1},{key:"source",label:"Source",type:"string",required:!1}],o=n.map(c=>({key:`metadata.extra.${c.name}`,label:c.label||c.name,type:c.type||"string",required:!!c.required,options:c.options,group:"Custom Fields"}));return{name:"Lead",fields:[...a,...o],uiHints:{icon:"User",primaryColor:"#3b82f6",defaultSort:{field:"createdAt",direction:"desc"},summaryFields:["firstName","lastName","phone","status"]}}}async upsert(e){return this.post("/product/erix/crm/leads/upsert",e)}async createMany(e,n=50){let a=[];for(let o=0;o<e.length;o+=n){let p=e.slice(o,o+n).map(d=>this.create(d)),l=await Promise.allSettled(p);for(let d of l)if(d.status==="fulfilled")a.push(d.value);else throw d.reason}return a}async import(e){return this.post("/product/erix/crm/leads/import",{leads:e})}async bulkUpsert(e){return this.import(e)}async list(e){let n=T({},e);return Array.isArray(n.tags)&&(n.tags=n.tags.join(",")),this.get("/product/erix/crm/leads",{params:n})}listAutoPaging(e){return Nn(this,null,function*(){let n=(e==null?void 0:e.page)||1,a=!0;for(;a;){let o=yield new yn(this.list(P(T({},e),{page:n}))),c=Array.isArray(o.data)?o.data:o||[];if(c.length===0){a=!1;break}for(let p of c)yield p;o.pagination&&n<o.pagination.pages||!o.pagination&&c.length>0?n++:a=!1}})}async retrieve(e){return this.get(`/product/erix/crm/leads/${e}`)}async retrieveByPhone(e){return this.get(`/product/erix/crm/leads/phone/${encodeURIComponent(e)}`)}async byStage(e,n,a={}){return this.get(`/product/erix/crm/pipelines/${e}/stages/${n}/leads`,{params:a})}async retrieveByRef(e,n){return this.get(`/product/erix/crm/leads/ref/${encodeURIComponent(e)}/${encodeURIComponent(n)}`)}async update(e,n){return this.patch(`/product/erix/crm/leads/${e}`,n)}async move(e,n){return this.patch(`/product/erix/crm/leads/${e}/move`,{stageId:n})}async convert(e,n,a){return this.post(`/product/erix/crm/leads/${e}/convert`,{outcome:n,reason:a})}async tags(e,n){return this.patch(`/product/erix/crm/leads/${e}/tags`,n)}async recalculateScore(e){return this.post(`/product/erix/crm/leads/${e}/score`,{})}async updateMetadata(e,n){return this.patch(`/product/erix/crm/leads/${e}/metadata`,n)}async fields(){return this.get("/product/erix/crm/fields")}async notes(e){return this.get(`/product/erix/crm/leads/${e}/notes`)}async activities(e,n){return this.get(`/product/erix/crm/leads/${e}/timeline`,{params:n})}async createNote(e,n){return this.post(`/product/erix/crm/leads/${e}/notes`,n)}async updateNote(e,n,a){return this.patch(`/product/erix/crm/notes/${n}`,a)}async deleteNote(e,n){return this.deleteRequest(`/product/erix/crm/notes/${n}`)}async delete(e){return this.deleteRequest(`/product/erix/crm/leads/${e}`)}async bulkArchive(e){return this.patch("/product/erix/crm/leads/bulk-archive",{ids:e})}async bulkDelete(e){return this.deleteRequest("/product/erix/crm/leads",{data:{ids:e}})}async archive(e){return this.deleteRequest(`/product/erix/crm/leads/${e}`)}async profile(e){return this.get(`/product/erix/crm/leads/${e}/profile`)}async invoices(e){return this.get(`/product/erix/crm/leads/${e}/invoices`)}async projects(e){return this.get(`/product/erix/crm/leads/${e}/projects`)}async conversations(e){return this.get(`/product/erix/crm/leads/${e}/conversations`)}async meetings(e){return this.get(`/product/erix/crm/leads/${e}/meetings`)}async sequences(e){return this.get(`/product/erix/crm/leads/${e}/sequences`)}};var J=class extends r{async capture(e){return this.post("/product/erix/crm/payments/capture",e)}};var X=class extends r{async list(){return this.get("/product/erix/crm/pipelines")}async getStageManifest(e){var o,c;let n=await this.retrieve(e),a=Array.isArray((o=n.data)==null?void 0:o.stages)?n.data.stages:[];return{name:`Pipeline: ${((c=n.data)==null?void 0:c.name)||e}`,fields:a.map(p=>({key:p._id,label:p.name,type:"string",required:!0,options:[{label:p.name,value:p._id}],group:"Stages",uiHints:{color:p.color||"#cbd5e1",probability:p.probability}})),uiHints:{icon:"Columns",primaryColor:"#6366f1"}}}async create(e){return this.post("/product/erix/crm/pipelines",e)}async retrieve(e){return this.get(`/product/erix/crm/pipelines/${e}`)}async update(e,n){return this.patch(`/product/erix/crm/pipelines/${e}`,n)}async setDefault(e){return this.patch(`/product/erix/crm/pipelines/${e}/default`,{})}async duplicate(e,n){return this.post(`/product/erix/crm/pipelines/${e}/duplicate`,{newName:n})}async archive(e){return this.patch(`/product/erix/crm/pipelines/${e}/archive`,{})}async delete(e){return this.deleteRequest(`/product/erix/crm/pipelines/${e}`)}async checkInUse(e){return this.get(`/product/erix/crm/pipelines/${e}/in-use`)}async board(e){return this.get(`/product/erix/crm/pipelines/${e}/board`)}async forecast(e){return this.get(`/product/erix/crm/pipelines/${e}/forecast`)}async addStage(e,n){return this.post(`/product/erix/crm/pipelines/${e}/stages`,n)}async reorderStages(e,n){return this.patch(`/product/erix/crm/pipelines/${e}/stages/reorder`,{order:n})}async updateStage(e,n){return this.patch(`/product/erix/crm/stages/${e}`,n)}async deleteStage(e,n){return this.deleteRequest(`/product/erix/crm/stages/${e}`,{data:n?{moveLeadsToStageId:n}:void 0})}};var Z=class extends r{async getConfig(){return this.get("/product/erix/crm/scoring")}async updateConfig(e){return this.patch("/product/erix/crm/scoring",e)}async recalculate(e){return this.post(`/product/erix/crm/scoring/${e}/recalculate`,{})}async preview(e){return this.get(`/product/erix/crm/scoring/preview/${e}`)}};var ee=class extends r{async enroll(e){return this.post("/product/erix/crm/sequences/enroll",e)}async unenroll(e){return this.deleteRequest(`/product/erix/crm/sequences/unenroll/${e}`)}async listForLead(e){return this.get(`/product/erix/crm/sequences/lead/${e}`)}};var ne=class extends r{async list(e){return this.get("/product/erix/chat/broadcasts",{params:e})}async retrieve(e){return this.get(`/product/erix/chat/broadcasts/${e}`)}async create(e){return this.post("/product/erix/chat/broadcast",e)}async update(e,n){return this.patch(`/product/erix/chat/broadcasts/${e}`,n)}async delete(e){return this.deleteRequest(`/product/erix/chat/broadcasts/${e}`)}};var te=class extends r{async list(e){return this.get("/product/erix/chat/conversations",{params:e})}async create(e){return this.post("/product/erix/chat/conversations",e)}async retrieve(e){return this.get(`/product/erix/chat/conversations/${e}`)}async messages(e,n){return this.get(`/product/erix/chat/conversations/${e}/messages`,{params:n})}async linkLead(e,n,a){return this.post(`/product/erix/chat/conversations/${e}/link-lead`,{leadId:n,leadData:a})}async markRead(e){return this.post(`/product/erix/chat/conversations/${e}/read`,{})}async delete(e){return this.deleteRequest(`/product/erix/chat/conversations/${e}`)}async bulkDelete(e){return this.post("/product/erix/chat/conversations/bulk-delete",{ids:e})}};var re=class extends r{async send(e){return this.post("/product/erix/chat/send",e)}async sendTemplate(e){return this.post("/product/erix/chat/send",P(T({},e),{templateLanguage:e.language||e.templateLanguage||"en_US"}))}async star(e,n){return this.post(`/product/erix/chat/messages/${e}/star`,{isStarred:n})}async react(e,n){return this.post(`/product/erix/chat/messages/${e}/react`,{reaction:n})}async markRead(e){return this.post(`/product/erix/chat/conversations/${e}/read`)}async upload(e){let n=new FormData;return n.append("file",e),this.post("/product/erix/chat/upload",n,{headers:{"Content-Type":"multipart/form-data"}})}};var se=class extends r{async list(e){return this.get("/product/erix/crm/campaigns",{params:e})}async create(e){return this.post("/product/erix/crm/campaigns",e)}async stats(e){return this.get(`/product/erix/crm/campaigns/${e}/analytics`)}};var ae=class extends r{async getProduct(e){return this.get(`/product/erix/commerce/checkout/products/${e}`)}async createSession(e){return this.post("/product/erix/commerce/checkout/session",e)}async applyCoupon(e){return this.post("/product/erix/commerce/checkout/coupon",e)}async verify(e){return this.post("/product/erix/commerce/checkout/verify",e)}async createOrder(e){return this.post("/product/erix/commerce/checkout/order",e)}};var ie=class extends r{async trigger(e){return this.post("/product/erix/events/trigger",e)}async listCustomEvents(){return this.get("/product/erix/crm/custom-events")}async createCustomEvent(e){return this.post("/product/erix/crm/custom-events",e)}async deleteCustomEvent(e){return this.deleteRequest(`/product/erix/crm/custom-events/${e}`)}};var oe=class extends r{async list(e){return this.get("/product/erix/commerce/invoices",{params:e})}async getInvoice(e){return this.get(`/product/erix/commerce/invoices/${e}`)}async create(e){return this.post("/product/erix/commerce/invoices",e)}async update(e,n){return this.patch(`/product/erix/commerce/invoices/${e}`,n)}async delete(e){return this.deleteRequest(`/product/erix/commerce/invoices/${e}`)}async sendViaWhatsApp(e){return this.post(`/product/erix/commerce/invoices/${e}/send-whatsapp`,{})}async getSettings(){return this.get("/product/erix/commerce/settings")}async updateSettings(e){return this.put("/product/erix/commerce/settings",e)}};var ce=class extends r{async listEventLogs(e){return this.get("/product/erix/event-log/events/logs",{params:e})}async getEventLog(e){return this.get(`/product/erix/event-log/events/logs/${e}`)}async listCallbackLogs(e){return this.get("/product/erix/event-log/callbacks/logs",{params:e})}async getStats(){return this.get("/product/erix/event-log/events/stats")}};var pe=class extends r{async conversations(){return this.get("/product/erix/portal-inbox/conversations")}async messages(e){return this.get(`/product/erix/portal-inbox/conversations/${e}/messages`)}async reply(e,n){return this.post(`/product/erix/portal-inbox/conversations/${e}/messages`,n)}};var de=class extends r{async list(e){return this.get(`/product/erix/commerce/projects/${e}/documents`)}async upload(e,n){return this.post(`/product/erix/commerce/projects/${e}/documents`,n)}async toggleSignature(e,n,a){return this.patch(`/product/erix/commerce/projects/${e}/documents/${n}/signature`,{required:a})}async addSigner(e,n,a){return this.post(`/product/erix/commerce/projects/${e}/documents/${n}/signers`,a)}async sign(e,n,a){return this.post(`/product/erix/commerce/projects/${e}/documents/${n}/sign`,a!=null?a:{})}async decline(e,n){return this.post(`/product/erix/commerce/projects/${e}/documents/${n}/decline`,{})}async stampSign(e,n,a){return this.post(`/product/erix/commerce/projects/${e}/documents/${n}/stamp-sign`,a)}};var le=class extends r{async providers(){return this.get("/infra/connect/providers")}async list(){return this.get("/infra/connect/connections")}async get_(e){return this.get(`/infra/connect/connections/${e}`)}async connect(e,n){return this.post(`/infra/connect/connections/${e}/connect`,n)}async configure(e,n){return this.put(`/infra/connect/connections/${e}/configure`,n)}async disconnect(e){return this.post(`/infra/connect/connections/${e}/disconnect`,{})}async reveal(e){return this.post(`/infra/connect/connections/${e}/reveal`,{})}async test(e){return this.post(`/infra/connect/connections/${e}/test`,{})}async setAccess(e,n){return this.put(`/infra/connect/connections/${e}/access`,n)}async createPaymentLink(e){return this.post("/infra/connect/connections/payments/payment-link",e)}};var ue=class extends r{async sendTest(e){return this.post("/infra/connect/email/test",{to:e})}async listTemplates(e){return this.get("/infra/connect/email/templates",{params:e})}async getTemplate(e){return this.get(`/infra/connect/email/templates/${e}`)}async createTemplate(e){return this.post("/infra/connect/email/templates",e)}async updateTemplate(e,n){return this.put(`/infra/connect/email/templates/${e}`,n)}async deleteTemplate(e,n=!1){return this.deleteRequest(`/infra/connect/email/templates/${e}`,{params:{force:n}})}async previewTemplate(e,n){return this.post(`/infra/connect/email/templates/${e}/preview`,n)}};var ge=class extends r{async create(e){return this.post("/infra/connect/meet",e)}async list(e){return this.get("/infra/connect/meet",{params:e})}async retrieve(e){return this.get(`/infra/connect/meet/${e}`)}async update(e,n){return this.patch(`/infra/connect/meet/${e}`,n)}async reschedule(e,n){return this.patch(`/infra/connect/meet/${e}`,n)}async delete(e){return this.update(e,{status:"cancelled"})}};var me=class extends r{async getConfig(){return this.get("/infra/connect/email/config")}async initDomainVerification(e){return this.post("/infra/connect/email/config/ses/domain",{domain:e})}async saveEmailConfig(e){return this.post("/infra/connect/email/config/ses/config",e)}async checkSesVerification(){return this.get("/infra/connect/email/config/ses/verify")}async removeSesIdentity(){return this.deleteRequest("/infra/connect/email/config/ses/domain")}async sendTest(e){return this.post("/infra/connect/email/config/test",{toEmail:e})}async saveAdvancedConfig(e){return this.post("/infra/connect/email/config/advanced",e)}async getHealth(){return this.get("/infra/connect/email/config/health")}async fixDmarc(){return this.post("/infra/connect/email/config/ses/fix-dmarc",{})}async listProviders(){return this.get("/infra/connect/email/config/providers")}};var ye=class extends r{async list(e){return this.get("/infra/connect/whatsapp/templates",{params:e})}async sync(){return this.post("/infra/connect/whatsapp/templates/sync",{})}async retrieve(e){return this.get(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}`)}async create(e){return this.post("/infra/connect/whatsapp/templates",e)}async update(e,n){return this.put(`/infra/connect/whatsapp/templates/${e}`,n)}async deleteTemplate(e,n){return this.deleteRequest(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}${n?"?force=true":""}`)}async mappingConfig(){return this.get("/infra/connect/whatsapp/templates/mapping/config")}async collections(){return this.get("/infra/connect/whatsapp/templates/collections")}async collectionFields(e){return this.get(`/infra/connect/whatsapp/templates/collections/${encodeURIComponent(e)}/fields`)}async updateMapping(e,n){return this.put(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/mapping`,n)}async validate(e){return this.get(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/validate`)}async preview(e,n){return this.post(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/preview`,{context:n})}async getVariableManifest(e){var c,p;let n=await this.retrieve(e),a=Array.isArray((c=n.data)==null?void 0:c.components)?n.data.components:[],o=[];for(let l of a)if(l.text){let d=l.text.match(/{{(\d+)}}/g);if(d)for(let f of d){let y=f.replace(/{{|}}/g,"");o.push({key:`var_${y}`,label:`${l.type} Var {{${y}}}`,type:"string",required:!0,group:l.type,description:`Variable placeholder in template ${l.type}`})}}return{name:`Template variables: ${((p=n.data)==null?void 0:p.name)||e}`,fields:o,uiHints:{icon:"Variables",primaryColor:"#059669"}}}async checkUsage(e){return this.get(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/usage`)}};var Bn=D(require("axios"),1);var fe=class extends r{async getUsage(){return this.get("/infra/storage/files/usage")}async createFolder(e){return this.post("/infra/storage/files/folders",{name:e})}async list(e,n){return this.get(`/infra/storage/files/files/${e}`,{params:n})}async delete(e){return this.deleteRequest("/infra/storage/files/files",{params:{key:e}})}async getDownloadUrl(e){return this.post("/infra/storage/files/download-url",{key:e})}async aiDescribe(e){return this.post("/infra/storage/files/ai/describe",{key:e})}async upload(e,n){let a=await this.post("/infra/storage/files/upload-url",n),{uploadUrl:o,key:c}=a.data;await Bn.default.put(o,e,{headers:{"Content-Type":n.contentType}});let p=e.size||e.byteLength||0;return this.post("/infra/storage/files/confirm-upload",{key:c,sizeBytes:p})}};var he=class extends r{async create(e){return this.post("/infra/storage/files/folders",{name:e})}async delete(e){return this.deleteRequest(`/infra/storage/files/folders/${encodeURIComponent(e)}`)}},Te=class extends r{async list(e,n){return this.get(`/infra/storage/files/files/${e}`,{params:n})}async getUploadUrl(e){return this.post("/infra/storage/files/upload-url",e)}async confirmUpload(e){return this.post("/infra/storage/files/confirm-upload",e)}async getDownloadUrl(e){return this.post("/infra/storage/files/download-url",{key:e})}async delete(e){return this.deleteRequest("/infra/storage/files",{params:{key:e}})}};var A=class extends r{async listNichePacks(e={}){return this.get("/platform/admin/onboarding/niche-packs",{params:v(e)})}async getNichePack(e,n){let a=n?{version:n}:void 0;return this.get(`/platform/admin/onboarding/niche-packs/${encodeURIComponent(e)}`,{params:a})}async createNichePack(e){return this.post("/platform/admin/onboarding/niche-packs",e)}async updateNichePack(e,n,a){let o=a?{version:a}:void 0;return this.patch(`/platform/admin/onboarding/niche-packs/${encodeURIComponent(e)}`,n,{params:o})}async publishNichePack(e,n){let a=n?{version:n}:void 0;return this.post(`/platform/admin/onboarding/niche-packs/${encodeURIComponent(e)}/publish`,void 0,{params:a})}async unpublishNichePack(e,n){let a=n?{version:n}:void 0;return this.post(`/platform/admin/onboarding/niche-packs/${encodeURIComponent(e)}/unpublish`,void 0,{params:a})}async forkNichePack(e,n={}){return this.post(`/platform/admin/onboarding/niche-packs/${encodeURIComponent(e)}/fork`,n)}async smokeTestNichePack(e,n={},a){let o=a?{version:a}:void 0;return this.post(`/platform/admin/onboarding/niche-packs/${encodeURIComponent(e)}/smoke-test`,n,{params:o})}async listOnboardingConfigs(e={}){return this.get("/platform/admin/onboarding/configs",{params:v(e)})}async createOnboardingConfig(e){return this.post("/platform/admin/onboarding/configs",e)}async updateOnboardingConfig(e,n,a){return this.patch(`/platform/admin/onboarding/configs/${encodeURIComponent(e)}/${encodeURIComponent(n)}`,a)}async publishOnboardingConfig(e,n){return this.post(`/platform/admin/onboarding/configs/${encodeURIComponent(e)}/${encodeURIComponent(n)}/publish`)}async listOnboardingExperiments(e={}){return this.get("/platform/admin/onboarding/experiments",{params:v(e)})}async getOnboardingExperiment(e){return this.get(`/platform/admin/onboarding/experiments/${encodeURIComponent(e)}`)}async createOnboardingExperiment(e){return this.post("/platform/admin/onboarding/experiments",e)}async updateOnboardingExperiment(e,n){return this.patch(`/platform/admin/onboarding/experiments/${encodeURIComponent(e)}`,n)}async deleteOnboardingExperiment(e){return this.deleteRequest(`/platform/admin/onboarding/experiments/${encodeURIComponent(e)}`)}async getOnboardingFunnel(e={}){return this.get("/platform/admin/onboarding/analytics/funnel",{params:v(e)})}async getOnboardingTimeOnStep(e={}){return this.get("/platform/admin/onboarding/analytics/time-on-step",{params:v(e)})}async getOnboardingAbandonment(e={}){return this.get("/platform/admin/onboarding/analytics/abandonment",{params:v(e)})}};function v(t){let e={};for(let[n,a]of Object.entries(t))a!==void 0&&(e[n]=a);return e}var be=class extends r{async list(){return this.get("/platform/admin/cors")}async create(e){return this.post("/platform/admin/cors",e)}async update(e,n){return this.patch(`/platform/admin/cors/${e}`,n)}async delete(e){return this.deleteRequest(`/platform/admin/cors/${e}`)}};var xe=class extends r{async system(){return(await this.get("/health")).data}};var we=class extends r{async listLogs(e){return this.get("/product/erix/event-log/events/logs",{params:e})}async retrieveLog(e){return this.get(`/product/erix/event-log/events/logs/${e}`)}async getStats(e){return this.get("/product/erix/event-log/events/stats",{params:e})}async listCallbacks(e){return this.get("/product/erix/event-log/callbacks/logs",{params:e})}async listAlerts(e){return this.get("/platform/users/notifications",{params:e})}async dismissAlert(e){return this.patch(`/platform/users/notifications/${e}/dismiss`)}async clearAllAlerts(){return this.deleteRequest("/platform/users/notifications/dismiss-all")}async retryAction(e){return this.post(`/platform/users/notifications/${e}/retry`,{})}};var C=class extends r{async global(e){return this.post("/platform/tenants/onboarding/global",e)}async start(e){return this.post(`/platform/tenants/onboarding/${e.productId}/start`,e)}async answer(e){return this.post("/api/onboarding/answer",e)}async state(e){return this.get(`/platform/tenants/onboarding/${e}/state`,{params:{productId:e}})}async complete(e){return this.post("/platform/tenants/onboarding/complete",e)}async edit(e){return this.post("/api/onboarding/edit",e)}async previewWorkspace(e){return this.get("/api/onboarding/preview-workspace",{params:{sessionId:e}})}};var I=class extends r{async get(e){return super.get(`/platform/tenants/persona/${e}`)}async reinforce(e){return this.post(`/platform/tenants/persona/${e.productId}/reinforce`,e)}async confidence(e){return super.get(`/platform/tenants/persona/${e}/confidence`,{params:{productId:e}})}async timeline(e,n){var o;let a=await super.get(`/platform/tenants/persona/${e}/timeline`,{params:n});return(o=a==null?void 0:a.data)!=null?o:{entries:[],hasMore:!1}}async followups(e){var a,o;let n=await super.get(`/platform/tenants/persona/${e}/followups`);return(o=(a=n==null?void 0:n.data)==null?void 0:a.entries)!=null?o:[]}};var Tn=class extends r{async list(){return this.get("/platform/admin/clients")}async getCountAndGenerateCode(){return this.get("/platform/admin/clients/count")}async retrieve(e){return this.get(`/platform/admin/clients/${e}`)}async getApiKey(e){return this.get(`/platform/admin/clients/${e}/api-key`)}async rotateApiKey(e){return this.post(`/platform/admin/clients/${e}/api-key`,{})}async create(e){return this.post("/platform/admin/clients",e)}async getConfig(e){return this.get(`/platform/admin/clients/${e}/config`)}async updateConfig(e,n){return this.patch(`/platform/admin/clients/${e}/config`,n)}async getConnections(e){return this.get(`/platform/admin/clients/${e}/connections`)}async getConnectProviders(e){return this.get(`/platform/admin/clients/${e}/connections/providers`)}async connectProvider(e,n,a){return this.post(`/platform/admin/clients/${e}/connections/${n}/connect`,a)}async configureProvider(e,n,a){return this.put(`/platform/admin/clients/${e}/connections/${n}/configure`,a)}async disconnectProvider(e,n){return this.post(`/platform/admin/clients/${e}/connections/${n}/disconnect`,{})}async revealConnection(e,n){return this.post(`/platform/admin/clients/${e}/connections/${n}/reveal`,{})}async setConnectionAccess(e,n,a){return this.put(`/platform/admin/clients/${e}/connections/${n}/access`,a)}async getDataSource(e){return this.get(`/api/clients/${e}/datasource`)}async manageDataSource(e,n){return this.post(`/api/clients/${e}/datasource`,n)}async updateIdentity(e,n){return this.patch(`/platform/admin/clients/${e}/identity`,n)}async googleReauth(e,n={}){return this.post(`/platform/admin/clients/${e}/google/reauth`,n)}async delete(e){return this.deleteRequest(`/platform/admin/clients/${e}`)}},bn=class extends r{async list(){return this.get("/platform/admin/blogs")}},xn=class extends r{async add(e){return this.post("/platform/admin/leads/add-lead",e)}},Re=class extends r{constructor(n){super(n);s(this,"clients");s(this,"blogs");s(this,"globalLeads");this.clients=new Tn(n),this.blogs=new bn(n),this.globalLeads=new xn(n)}};var wn=class extends r{async chatSync(e){return this.post("/platform/ai/copilot/chat/sync",e)}async confirm(e){return this.post("/platform/ai/copilot/confirm",e)}async listSessions(){return this.get("/platform/ai/copilot/sessions")}async getSession(e){return this.get(`/platform/ai/copilot/sessions/${e}`)}async deleteSession(e){return this.deleteRequest(`/platform/ai/copilot/sessions/${e}`)}chatStreamUrl(){return"/platform/ai/copilot/chat"}},ke=class{constructor(e){s(this,"copilot");this.copilot=new wn(e)}};var Pe=class extends r{async register(e){return this.post("/platform/auth/register",e)}async login(e){return this.post("/platform/auth/login",e)}async logout(e){return this.post("/platform/auth/logout",e)}async logoutAll(e){return this.post("/platform/auth/logout-all",e)}async validateSession(e){return this.post("/platform/auth/session/validate",e)}async listSessions(){return this.get("/platform/auth/sessions")}async revokeSession(e){return this.deleteRequest(`/platform/auth/sessions/${e}`)}async requestPasswordOtp(e){return this.post("/platform/auth/password/request-otp",e)}async setPassword(e){return this.post("/platform/auth/password/set",e)}async changePassword(e){return this.post("/platform/auth/password/change",e)}async forgotPassword(e){return this.post("/platform/auth/forgot",e)}async resetPassword(e){return this.post("/platform/auth/reset",e)}async linkOAuth(e){return this.post("/platform/auth/oauth-link",e)}async getInvitation(e){return this.get(`/platform/auth/invitations/${e}`)}async acceptInvitation(e,n){return this.post(`/platform/auth/invitations/${e}/accept`,n)}};var Rn=class extends r{async get(){return super.get("/platform/billing/entitlements/entitlements")}async usage(){return super.get("/platform/billing/entitlements/usage")}},kn=class extends r{async upgrade(e){return this.post("/platform/billing/subscriptions/subscriptions/upgrade",e)}async downgrade(e){return this.post("/platform/billing/subscriptions/subscriptions/downgrade",e)}async cancel(e){return this.post("/platform/billing/subscriptions/subscriptions/cancel",e)}async purchaseAddon(e){return this.post("/platform/billing/subscriptions/addons/purchase",e)}async cancelAddon(e){return this.post("/platform/billing/subscriptions/addons/cancel",e)}},Pn=class extends r{async listPublic(){return this.get("/platform/billing/plans/public")}},vn=class extends r{async plans(){return this.get("/platform/billing/checkout/plans")}async subscribe(e){return this.post("/platform/billing/checkout/subscribe",e)}async verify(e){return this.post("/platform/billing/checkout/verify",e)}async cancel(e){return this.post("/platform/billing/checkout/cancel",e)}async status(){return this.get("/platform/billing/checkout/status")}async syncPlan(e){return this.post("/platform/billing/checkout/sync-plan",e)}},An=class extends r{async transactions(){return this.get("/platform/billing/user/transactions")}async subscription(){return this.get("/platform/billing/user/subscription")}async raiseDispute(e){return this.post("/platform/billing/user/dispute",e)}async disputes(){return this.get("/platform/billing/user/disputes")}},Cn=class extends r{async balance(){return this.get("/platform/billing/credits/balance")}async transactions(){return this.get("/platform/billing/credits/transactions")}async packs(){return this.get("/platform/billing/credits/packs")}async topupOrder(e){return this.post("/platform/billing/credits/topup/order",e)}async verifyTopup(e){return this.post("/platform/billing/credits/topup/verify",e)}async setAutoTopup(e){return this.patch("/platform/billing/credits/auto-topup",e)}async setSpendCap(e){return this.patch("/platform/billing/credits/spend-cap",e)}},ve=class{constructor(e){s(this,"entitlements");s(this,"subscriptions");s(this,"plans");s(this,"checkout");s(this,"user");s(this,"credits");this.entitlements=new Rn(e),this.subscriptions=new kn(e),this.plans=new Pn(e),this.checkout=new vn(e),this.user=new An(e),this.credits=new Cn(e)}};var Ae=class extends r{async categories(){return this.get("/platform/support/categories")}async listTickets(e){return this.get("/platform/support/tickets",{params:e})}async createTicket(e){return this.post("/platform/support/tickets",e)}async getTicket(e){return this.get(`/platform/support/tickets/${e}`)}async reply(e,n){return this.post(`/platform/support/tickets/${e}/reply`,n)}async close(e){return this.patch(`/platform/support/tickets/${e}/close`,{})}};var Ce=class extends r{async get(){return super.get("/platform/users/me")}async update(e){return this.patch("/platform/users/me",e)}async updateOrganization(e){return this.patch("/platform/users/me/organization",e)}async toggleModules(e){return this.post("/platform/users/me/modules",e)}async workspaces(){return super.get("/platform/users/me/workspaces")}async setActiveOrg(e){return this.post("/platform/users/me/active-org",e)}async dismissWorkspaceSetup(){return this.post("/platform/users/me/workspace/dismiss-setup",{})}},Ie=class extends r{async list(){return this.get("/platform/users/members")}async invite(e){return this.post("/platform/users/members/invite",e)}async remove(e){return this.deleteRequest(`/platform/users/members/${e}`)}},$e=class extends r{async list(){return this.get("/platform/users/sessions")}async revoke(e){return this.deleteRequest(`/platform/users/sessions/${e}`)}async revokeAll(){return this.deleteRequest("/platform/users/sessions")}};var Oe=class extends r{async list(e){return this.get("/platform/admin/logs",{params:e})}async export(e){return this.get("/platform/admin/logs/export",{params:e})}};var Se=class extends r{async getSettings(){return this.get("/platform/admin/invoices/settings")}async updateSettings(e){return this.patch("/platform/admin/invoices/settings",e)}async list(e){return this.get("/platform/admin/invoices",{params:e})}async create(e){return this.post("/platform/admin/invoices",e)}async retrieve(e){return this.get(`/platform/admin/invoices/${e}`)}async update(e,n){return this.patch(`/platform/admin/invoices/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/invoices/${e}`)}};var Ee=class extends r{async stats(e){return this.get("/platform/admin/agents/stats",{params:e})}async list(e){return this.get("/platform/admin/agents",{params:e})}async retrieve(e){return this.get(`/platform/admin/agents/${e}`)}async update(e,n){return this.patch(`/platform/admin/agents/${e}`,n)}async runs(e){return this.get(`/platform/admin/agents/${e}/runs`)}};var Le=class extends r{async overview(e){return this.get("/platform/admin/analytics/overview",{params:e})}async endpoints(e){return this.get("/platform/admin/analytics/endpoints",{params:e})}async errors(e){return this.get("/platform/admin/analytics/errors",{params:e})}async tenants(e){return this.get("/platform/admin/analytics/tenants",{params:e})}};var De=class extends r{async list(e){return this.get("/platform/admin/comms",{params:e})}async create(e){return this.post("/platform/admin/comms",e)}async update(e,n){return this.patch(`/platform/admin/comms/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/comms/${e}`)}async publish(e,n){return this.post(`/platform/admin/comms/${e}/publish`,n)}async broadcast(e){return this.post("/platform/admin/comms/broadcast",e)}async setMaintenance(e){return this.post("/platform/admin/comms/maintenance",e)}async getMaintenance(e){return this.get("/platform/admin/comms/maintenance",{params:e})}async changelog(e){return this.post("/platform/admin/comms/changelog",e)}};var qe=class extends r{async stats(e){return this.get("/platform/admin/audit/stats",{params:e})}async list(e){return this.get("/platform/admin/audit",{params:e})}async export(e){return this.get("/platform/admin/audit/export",{params:e})}};var Ne=class extends r{async events(e){return this.get("/platform/admin/billing/events",{params:e})}async orgEvents(e){return this.get(`/platform/admin/billing/events/${e}`)}async failed(e){return this.get("/platform/admin/billing/failed",{params:e})}async recordEvent(e){return this.post("/platform/admin/billing/record-event",e)}async extendTrial(e){return this.post("/platform/admin/billing/extend-trial",e)}async grandfather(e){return this.post("/platform/admin/billing/grandfather",e)}async reconcile(e){return this.get("/platform/admin/billing/reconcile",{params:e})}};var Fe=class extends r{async list(e){return this.get("/platform/admin/blogs",{params:e})}async retrieve(e){return this.get(`/platform/admin/blogs/${e}`)}async create(e){return this.post("/platform/admin/blogs",e)}async update(e,n){return this.put(`/platform/admin/blogs/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/blogs/${e}`)}};var Ue=class extends r{async requests(e){return this.get("/platform/admin/compliance/requests",{params:e})}async createRequest(e){return this.post("/platform/admin/compliance/requests",e)}async updateRequest(e,n){return this.patch(`/platform/admin/compliance/requests/${e}`,n)}async exportOrg(e,n){return this.post(`/platform/admin/compliance/export/${e}`,n)}};var Be=class extends r{async rateCard(e){return this.get("/platform/admin/credits/rate-card",{params:e})}async packs(e){return this.get("/platform/admin/credits/packs",{params:e})}async createPack(e){return this.post("/platform/admin/credits/packs",e)}async updatePack(e,n){return this.patch(`/platform/admin/credits/packs/${e}`,n)}async deletePack(e){return this.deleteRequest(`/platform/admin/credits/packs/${e}`)}async wallet(e){return this.get(`/platform/admin/credits/wallet/${e}`)}async adjustWallet(e,n){return this.post(`/platform/admin/credits/wallet/${e}/adjust`,n)}};var Me=class extends r{async stats(e){return this.get("/platform/admin/dashboard/stats",{params:e})}};var _e=class extends r{async overview(e){return this.get("/platform/admin/email/overview",{params:e})}async campaigns(e){return this.get("/platform/admin/email/campaigns",{params:e})}async events(e){return this.get("/platform/admin/email/events",{params:e})}async sesHealth(e){return this.get("/platform/admin/email/ses-health",{params:e})}};var Ve=class extends r{async createTenant(e){return this.post("/platform/admin/erix/tenants",e)}async tenants(e){return this.get("/platform/admin/erix/tenants",{params:e})}async tenant(e){return this.get(`/platform/admin/erix/tenants/${e}`)}async updatePlan(e,n){return this.patch(`/platform/admin/erix/tenants/${e}/plan`,n)}async suspend(e,n){return this.post(`/platform/admin/erix/tenants/${e}/suspend`,n)}async reactivate(e,n){return this.post(`/platform/admin/erix/tenants/${e}/reactivate`,n)}async rotateKey(e,n){return this.post(`/platform/admin/erix/tenants/${e}/rotate-key`,n)}async usage(e){return this.get(`/platform/admin/erix/tenants/${e}/usage`)}};var je=class extends r{async list(e){return this.get("/platform/admin/flags",{params:e})}async create(e){return this.post("/platform/admin/flags",e)}async update(e,n){return this.patch(`/platform/admin/flags/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/flags/${e}`)}async listOverrides(e){return this.get(`/platform/admin/flags/${e}/overrides`)}async addOverride(e,n){return this.post(`/platform/admin/flags/${e}/overrides`,n)}async removeOverride(e,n){return this.deleteRequest(`/platform/admin/flags/${e}/overrides/${n}`)}async forOrg(e){return this.get(`/platform/admin/flags/org/${e}`)}};var We=class extends r{async overview(e){return this.get("/platform/admin/flow/overview",{params:e})}async runs(e){return this.get("/platform/admin/flow/runs",{params:e})}async failures(e){return this.get("/platform/admin/flow/failures",{params:e})}async run(e){return this.get(`/platform/admin/flow/runs/${e}`)}async retryRun(e,n){return this.post(`/platform/admin/flow/runs/${e}/retry`,n)}};var He=class extends r{async list(e){return this.get(`/platform/admin/integrations/${e}/integrations`)}async connect(e,n,a){return this.post(`/platform/admin/integrations/${e}/integrations/${n}`,a)}async disconnect(e,n){return this.deleteRequest(`/platform/admin/integrations/${e}/integrations/${n}`)}async test(e,n,a){return this.post(`/platform/admin/integrations/${e}/integrations/${n}/test`,a)}async invite(e,n){return this.post(`/platform/admin/integrations/${e}/invite`,n)}};var Ke=class extends r{async overview(e){return this.get("/platform/admin/laie/overview",{params:e})}async queue(e){return this.get("/platform/admin/laie/queue",{params:e})}async proxies(e){return this.get("/platform/admin/laie/proxies",{params:e})}async vaultStats(e){return this.get("/platform/admin/laie/vault-stats",{params:e})}async credits(e){return this.get("/platform/admin/laie/credits",{params:e})}async actors(e){return this.get("/platform/admin/laie/actors",{params:e})}async actorRegistry(e){return this.get("/platform/admin/laie/actors/registry",{params:e})}async runActor(e,n){return this.post(`/platform/admin/laie/actors/${e}/run`,n)}async getEnrichmentConfig(){return this.get("/platform/admin/laie/enrichment/config")}async setEnrichmentConfig(e){return this.put("/platform/admin/laie/enrichment/config",e)}async audits(e){return this.get("/platform/admin/laie/audits",{params:e})}async audit(e){return this.get(`/platform/admin/laie/audits/${e}`)}};var ze=class extends r{async queueStats(e){return this.get("/platform/admin/laie-runtime/queue/stats",{params:e})}async proxyHealth(e){return this.get("/platform/admin/laie-runtime/proxy/health",{params:e})}async browserPoolStats(e){return this.get("/platform/admin/laie-runtime/browser-pool/stats",{params:e})}async replayDlq(e){return this.post("/platform/admin/laie-runtime/dlq/replay",e)}async runStats(e){return this.get("/platform/admin/laie-runtime/runs/stats",{params:e})}};var Qe=class extends r{async overview(e){return this.get("/platform/admin/laie-vault",{params:e})}};var Ge=class extends r{async addLead(e){return this.post("/platform/admin/leads/add-lead",e)}async list(e){return this.get("/platform/admin/leads",{params:e})}async retrieve(e){return this.get(`/platform/admin/leads/${e}`)}async update(e,n){return this.patch(`/platform/admin/leads/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/leads/${e}`)}async updateStatus(e,n){return this.patch(`/platform/admin/leads/${e}/status`,n)}async qualification(e,n){return this.post(`/platform/admin/leads/${e}/qualification`,n)}async firstContact(e,n){return this.post(`/platform/admin/leads/${e}/first-contact`,n)}async followup(e,n){return this.post(`/platform/admin/leads/${e}/followup`,n)}async notes(e){return this.get(`/platform/admin/leads/${e}/notes`)}async addNote(e,n){return this.post(`/platform/admin/leads/${e}/notes`,n)}async updateNote(e,n,a){return this.patch(`/platform/admin/leads/${e}/notes/${n}`,a)}async deleteNote(e,n){return this.deleteRequest(`/platform/admin/leads/${e}/notes/${n}`)}};var Ye=class extends r{async json(){return this.get("/platform/admin/openapi/spec.json")}async docs(){return this.get("/platform/admin/openapi")}async health(){return this.get("/platform/admin/openapi/health")}};var Je=class extends r{async stats(e){return this.get("/platform/admin/partners/stats",{params:e})}async list(e){return this.get("/platform/admin/partners",{params:e})}async create(e){return this.post("/platform/admin/partners",e)}async retrieve(e){return this.get(`/platform/admin/partners/${e}`)}async update(e,n){return this.patch(`/platform/admin/partners/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/partners/${e}`)}async referrals(e){return this.get(`/platform/admin/partners/${e}/referrals`)}async updateReferral(e,n,a){return this.patch(`/platform/admin/partners/${e}/referrals/${n}`,a)}};var Xe=class extends r{async refund(e){return this.post("/platform/admin/payments/refund",e)}async validate(e){return this.get(`/platform/admin/payments/validate/${e}`)}async fetch(e){return this.get(`/platform/admin/payments/fetch/${e}`)}async subscription(e){return this.get(`/platform/admin/payments/subscription/${e}`)}async failed(e){return this.get("/platform/admin/payments/failed",{params:e})}async retry(e,n){return this.post(`/platform/admin/payments/retry/${e}`,n)}async timeline(e){return this.get(`/platform/admin/payments/timeline/${e}`)}async risk(e){return this.get(`/platform/admin/payments/risk/${e}`)}};var Ze=class extends r{async stats(e){return this.get("/platform/admin/persona-history/stats",{params:e})}async list(e){return this.get("/platform/admin/persona-history",{params:e})}async retrieve(e){return this.get(`/platform/admin/persona-history/${e}`)}async version(e,n){return this.get(`/platform/admin/persona-history/${e}/${n}`)}};var en=class extends r{async templates(e){return this.get("/platform/admin/pipelines/templates",{params:e})}async createTemplate(e){return this.post("/platform/admin/pipelines/templates",e)}async updateTemplate(e,n){return this.patch(`/platform/admin/pipelines/templates/${e}`,n)}async deleteTemplate(e){return this.deleteRequest(`/platform/admin/pipelines/templates/${e}`)}async provision(e){return this.post("/platform/admin/pipelines/provision",e)}async overview(e){return this.get("/platform/admin/pipelines/overview",{params:e})}};var nn=class extends r{async list(e){return this.get("/platform/admin/plans",{params:e})}async create(e){return this.post("/platform/admin/plans",e)}async update(e,n){return this.patch(`/platform/admin/plans/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/plans/${e}`)}async tenants(e){return this.get(`/platform/admin/plans/${e}/tenants`)}};var tn=class extends r{async summary(e){return this.get("/platform/admin/revenue/summary",{params:e})}async snapshots(e){return this.get("/platform/admin/revenue/snapshots",{params:e})}async generateSnapshot(e){return this.post("/platform/admin/revenue/snapshot/generate",e)}};var rn=class extends r{async verifyCredentials(e){return this.post("/platform/admin/auth/staff/verify-credentials",e)}async findOrCreate(e){return this.post("/platform/admin/auth/staff/find-or-create",e)}async list(e){return this.get("/platform/admin/auth/staff",{params:e})}async create(e){return this.post("/platform/admin/auth/staff",e)}async update(e,n){return this.patch(`/platform/admin/auth/staff/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/auth/staff/${e}`)}};var sn=class extends r{async stats(e){return this.get("/platform/admin/storage/stats",{params:e})}async events(e){return this.get("/platform/admin/storage/events",{params:e})}async usage(e){return this.get("/platform/admin/storage/usage",{params:e})}};var an=class extends r{async overview(e){return this.get("/platform/admin/health",{params:e})}};var on=class extends r{async list(e){return this.get("/platform/admin/templates",{params:e})}async create(e){return this.post("/platform/admin/templates",e)}async retrieve(e){return this.get(`/platform/admin/templates/${e}`)}async update(e,n){return this.patch(`/platform/admin/templates/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/templates/${e}`)}async clone(e,n){return this.post(`/platform/admin/templates/${e}/clone`,n)}async versions(e){return this.get(`/platform/admin/templates/${e}/versions`)}async assignPlans(e,n){return this.post(`/platform/admin/templates/${e}/plans`,n)}};var cn=class extends r{async deep(e){return this.get(`/platform/admin/tenants/${e}/deep`)}async usage(e){return this.get(`/platform/admin/tenants/${e}/usage`)}async team(e){return this.get(`/platform/admin/tenants/${e}/team`)}async billing(e){return this.get(`/platform/admin/tenants/${e}/billing`)}async whatsapp(e){return this.get(`/platform/admin/tenants/${e}/whatsapp`)}async flows(e){return this.get(`/platform/admin/tenants/${e}/flows`)}async crmStats(e){return this.get(`/platform/admin/tenants/${e}/crm-stats`)}async impersonate(e,n){return this.post(`/platform/admin/tenants/${e}/impersonate`,n)}async suspend(e,n){return this.post(`/platform/admin/tenants/${e}/suspend`,n)}async reactivate(e,n){return this.post(`/platform/admin/tenants/${e}/reactivate`,n)}async updatePlan(e,n){return this.patch(`/platform/admin/tenants/${e}/plan`,n)}async updateLimits(e,n){return this.patch(`/platform/admin/tenants/${e}/limits`,n)}async bulkAssignPlan(e){return this.post("/platform/admin/tenants/bulk-assign-plan",e)}async unassigned(){return this.get("/platform/admin/tenants/unassigned")}};var pn=class extends r{async stats(e){return this.get("/platform/admin/tickets/stats",{params:e})}async list(e){return this.get("/platform/admin/tickets",{params:e})}async create(e){return this.post("/platform/admin/tickets",e)}async retrieve(e){return this.get(`/platform/admin/tickets/${e}`)}async update(e,n){return this.patch(`/platform/admin/tickets/${e}`,n)}async addMessage(e,n){return this.post(`/platform/admin/tickets/${e}/messages`,n)}async resolve(e,n){return this.post(`/platform/admin/tickets/${e}/resolve`,n)}async close(e,n){return this.post(`/platform/admin/tickets/${e}/close`,n)}};var dn=class extends r{async stats(e){return this.get("/platform/admin/waitlist/stats",{params:e})}async list(e){return this.get("/platform/admin/waitlist",{params:e})}async retrieve(e){return this.get(`/platform/admin/waitlist/${e}`)}async update(e,n){return this.patch(`/platform/admin/waitlist/${e}`,n)}async remove(e){return this.deleteRequest(`/platform/admin/waitlist/${e}`)}async bulk(e){return this.post("/platform/admin/waitlist/bulk",e)}};var ln=class extends r{async overview(e){return this.get("/platform/admin/whatsapp/overview",{params:e})}async wabas(e){return this.get("/platform/admin/whatsapp/wabas",{params:e})}async templates(e){return this.get("/platform/admin/whatsapp/templates",{params:e})}async delivery(e){return this.get("/platform/admin/whatsapp/delivery",{params:e})}async webhooks(e){return this.get("/platform/admin/whatsapp/webhooks",{params:e})}};var q=class{constructor(e){s(this,"messages");s(this,"conversations");s(this,"broadcasts");this.messages=new re(e),this.conversations=new te(e),this.broadcasts=new ne(e)}},N=class{constructor(e){s(this,"leads");s(this,"pipelines");s(this,"automations");s(this,"activities");s(this,"analytics");s(this,"scoring");s(this,"payments");s(this,"sequences");s(this,"automationDashboard");s(this,"chat");s(this,"events");s(this,"eventLog");s(this,"invoices");s(this,"checkout");s(this,"projects");s(this,"campaigns");s(this,"portalInbox");this.leads=new Y(e),this.pipelines=new X(e),this.automations=new G(e),this.activities=new K(e),this.analytics=new z(e),this.scoring=new Z(e),this.payments=new J(e),this.sequences=new ee(e),this.automationDashboard=new Q(e),this.chat=new q(e),this.events=new ie(e),this.eventLog=new ce(e),this.invoices=new oe(e),this.checkout=new ae(e),this.projects=new de(e),this.campaigns=new se(e),this.portalInbox=new pe(e)}},$=class{constructor(e){s(this,"erix");this.erix=new N(e)}},F=class{constructor(e){s(this,"config");s(this,"templates");this.config=new me(e),this.templates=new ue(e)}},U=class{constructor(e){s(this,"templates");this.templates=new ye(e)}},B=class{constructor(e){s(this,"email");s(this,"whatsapp");s(this,"meet");s(this,"connections");this.email=new F(e),this.whatsapp=new U(e),this.meet=new ge(e),this.connections=new le(e)}},M=class{constructor(e){s(this,"files");s(this,"folders");s(this,"media");this.files=new Te(e),this.folders=new he(e),this.media=new fe(e)}},O=class{constructor(e){s(this,"connect");s(this,"storage");this.connect=new B(e),this.storage=new M(e)}},_=class{constructor(e){s(this,"onboarding");s(this,"persona");this.onboarding=new C(e),this.persona=new I(e)}},V=class{constructor(e){s(this,"me");s(this,"members");s(this,"sessions");s(this,"notifications");this.me=new Ce(e),this.members=new Ie(e),this.sessions=new $e(e),this.notifications=new we(e)}},j=class{constructor(e){s(this,"revenue");s(this,"billing");s(this,"payments");s(this,"credits");s(this,"plans");s(this,"agencyInvoices");s(this,"flags");s(this,"activityLogs");s(this,"auditLogs");s(this,"analytics");s(this,"health");s(this,"storage");s(this,"announcements");s(this,"compliance");s(this,"tickets");s(this,"templates");s(this,"agents");s(this,"personaHistory");s(this,"openapi");s(this,"staff");s(this,"tenants");s(this,"whatsapp");s(this,"laie");s(this,"laieRuntime");s(this,"laieVault");s(this,"flow");s(this,"email");s(this,"pipelines");s(this,"integrations");s(this,"erix");s(this,"dashboard");s(this,"partners");s(this,"waitlist");s(this,"blogs");s(this,"leads");s(this,"onboarding");s(this,"cors");s(this,"clients");this.revenue=new tn(e),this.billing=new Ne(e),this.payments=new Xe(e),this.credits=new Be(e),this.plans=new nn(e),this.agencyInvoices=new Se(e),this.flags=new je(e),this.activityLogs=new Oe(e),this.auditLogs=new qe(e),this.analytics=new Le(e),this.health=new an(e),this.storage=new sn(e),this.announcements=new De(e),this.compliance=new Ue(e),this.tickets=new pn(e),this.templates=new on(e),this.agents=new Ee(e),this.personaHistory=new Ze(e),this.openapi=new Ye(e),this.staff=new rn(e),this.tenants=new cn(e),this.whatsapp=new ln(e),this.laie=new Ke(e),this.laieRuntime=new ze(e),this.laieVault=new Qe(e),this.flow=new We(e),this.email=new _e(e),this.pipelines=new en(e),this.integrations=new He(e),this.erix=new Ve(e),this.dashboard=new Me(e),this.partners=new Je(e),this.waitlist=new dn(e),this.blogs=new Fe(e),this.leads=new Ge(e),this.onboarding=new A(e),this.cors=new be(e),this.clients=new Re(e)}},S=class{constructor(e){s(this,"auth");s(this,"users");s(this,"tenants");s(this,"billing");s(this,"support");s(this,"ai");s(this,"admin");s(this,"health");this.auth=new Pe(e),this.users=new V(e),this.tenants=new _(e),this.billing=new ve(e),this.support=new Ae(e),this.ai=new ke(e),this.admin=new j(e),this.health=new xe(e)}};var E=class extends u{constructor(e){super(e,400,"invalid_signature"),this.name="WebhookSignatureError"}},un=class{async constructEvent(e,n,a){if(!n)throw new E("No webhook signature provided");let o=Array.isArray(n)?n[0]:n;o.startsWith("sha256=")&&(o=o.slice(7));try{let c=await import("crypto"),l=c.createHmac("sha256",a).update(e).digest("hex");if(!c.timingSafeEqual(Buffer.from(l),Buffer.from(o)))throw new E("Invalid webhook signature provided");return JSON.parse(e.toString("utf8"))}catch(c){throw c instanceof E?c:new E(`Webhook payload parsing failed: ${c.message}`)}}};var In=typeof process!="undefined"&&"2.1.3"||"2.0.0";var w=class{constructor(e){s(this,"client");s(this,"socket",null);s(this,"socketPromise",null);s(this,"socketQueue",[]);s(this,"clientCode");s(this,"apiVersion");s(this,"platform");s(this,"product");s(this,"infra");s(this,"webhooks");var f,y,b,x,R,g;if(!e.apiKey)throw new m("API Key is required");this.clientCode=(f=e.clientCode)==null?void 0:f.toUpperCase(),this.apiVersion=(y=e.version)!=null?y:"v1";let n=(b=e.baseUrl)!=null?b:fn,a=Fn(this.apiVersion,n),o=e.socketUrl||n,c=typeof window!="undefined"&&typeof window.document!="undefined",p=c?"browser":typeof process!="undefined"?`node ${process.version}`:"unknown",l=c?((x=globalThis.navigator)==null?void 0:x.userAgent)||"browser":typeof process!="undefined"?process.platform:"unknown",d={"x-api-key":e.apiKey,"x-client-code":((R=e.clientCode)==null?void 0:R.toUpperCase())||"","Content-Type":"application/json","x-ecodrix-client-agent":JSON.stringify({sdk_version:In,runtime:p,os:l})};if(e.coreApiKey&&(d["x-core-api-key"]=e.coreApiKey),this.client=Mn.default.create({baseURL:a,headers:d,timeout:(g=e.timeout)!=null?g:3e4}),(0,gn.default)(this.client,{retries:3,retryDelay:gn.default.exponentialDelay,retryCondition:k=>{var W;return gn.default.isNetworkOrIdempotentRequestError(k)||((W=k.response)==null?void 0:W.status)===429},onRetry:(k,W,On)=>{var Sn,En;typeof process!="undefined"&&((Sn=process.env)==null?void 0:Sn.NODE_ENV)==="development"&&console.warn(`[ECODrIx SDK] Retrying request (${k}/3): ${(En=On.method)==null?void 0:En.toUpperCase()} ${On.url}. Reason: ${W.message}`)}}),this.platform=new S(this.client),this.product=new $(this.client),this.infra=new O(this.client),this.webhooks=new un,this.initSocket(o,e.apiKey,e.clientCode),c){let k={version:In,clientCode:e.clientCode,initializedAt:new Date().toISOString()};window.__ECODRIX_SDK__=k,window.ecodrix||(window.ecodrix=this)}}initSocket(e,n,a){return this.socketPromise?this.socketPromise:(this.socketPromise=import("socket.io-client").then(({io:o})=>{this.socket=o(e,{extraHeaders:{"x-api-key":n,"x-client-code":(a==null?void 0:a.toUpperCase())||""}}),this.setupSocket(a);for(let{type:c,args:p}of this.socketQueue)c==="joinRoom"?this.socket.emit("join-room",p[0]):c==="leaveRoom"?this.socket.emit("leave-room",p[0]):c==="on"?this.socket.on(p[0],p[1]):c==="off"?this.socket.off(p[0],p[1]):c==="disconnect"&&this.socket.disconnect();this.socketQueue=[]}),this.socketPromise)}joinRoom(e){this.socket?this.socket.emit("join-room",e):this.socketQueue.push({type:"joinRoom",args:[e]})}leaveRoom(e){this.socket?this.socket.emit("leave-room",e):this.socketQueue.push({type:"leaveRoom",args:[e]})}setupSocket(e){this.socket&&this.socket.on("connect",()=>{e&&this.socket.emit("join-room",e.toUpperCase())})}on(e,n){return this.socket?this.socket.on(e,n):this.socketQueue.push({type:"on",args:[e,n]}),this}disconnect(){this.socket?this.socket.disconnect():this.socketQueue.push({type:"disconnect",args:[]})}off(e,n){return this.socket?this.socket.off(e,n):this.socketQueue.push({type:"off",args:[e,n]}),this}async request(e,n,a,o){var c,p,l;try{return(await this.client.request({method:e,url:n,data:a,params:o})).data}catch(d){throw d.response?new u(((c=d.response.data)==null?void 0:c.message)||((p=d.response.data)==null?void 0:p.error)||"Raw Execution Failed",d.response.status,(l=d.response.data)==null?void 0:l.code):new u(d.message||"Network Error")}}};var _n={401:m,403:m,429:h};function Zn(t){var e,n,a;if(t.response){let o=t.response.status,c=((e=t.response.data)==null?void 0:e.message)||((n=t.response.data)==null?void 0:n.error)||"API Request Failed",p=(a=t.response.data)==null?void 0:a.code,l=_n[o]||u;throw l===m?new m(c):l===h?new h(c):new u(c,o,p)}throw new u(t.message||"Network Error")}function et(t,e){return t instanceof e}function nt(t){return t instanceof m?{message:t.message,status:t.status,code:t.code,type:"AuthenticationError"}:t instanceof h?{message:t.message,status:t.status,code:t.code,type:"RateLimitError"}:t instanceof u?{message:t.message,status:t.status,code:t.code,type:"APIError"}:{message:t.message||"Unknown error",type:"UnknownError"}}var $n={[m.name]:{shouldRetry:!1,reason:"Authentication errors require fixing credentials, not retrying"},[h.name]:{shouldRetry:!0,maxRetries:3,baseDelay:1e3,backoffMultiplier:2,reason:"Rate limit errors can be retried with exponential backoff"},[u.name]:{shouldRetry:!0,maxRetries:2,baseDelay:500,backoffMultiplier:1.5,reason:"Generic API errors may be transient and worth retrying"}};function tt(t){let e=t.constructor.name;return $n[e]||$n[u.name]}var rt=w;0&&(module.exports={APIError,AdminOnboarding,AuthenticationError,ConnectInfra,ECODrIx,ECODrIxAPI,ERROR_RETRY_CONFIG,EcodrixError,EmailConnect,ErixChat,ErixProduct,HTTP_STATUS_ERROR_MAP,InfraDomain,LEAD_STATUS_VALUES,Onboarding,Persona,PlatformAdmin,PlatformDomain,PlatformTenants,PlatformUsers,ProductDomain,RateLimitError,StorageInfra,WhatsAppConnect,getErrorDetails,getRetryConfig,handleAPIError,isAPIError});
@@ -1073,6 +1073,12 @@ declare class Pipelines extends APIResource {
1073
1073
  deleteStage(stageId: string, moveLeadsToStageId?: string): Promise<unknown>;
1074
1074
  }
1075
1075
 
1076
+ /** Optional time-decay: leads lose points once idle past `afterDays`. */
1077
+ interface ScoreDecay {
1078
+ enabled: boolean;
1079
+ afterDays: number;
1080
+ pointsPerDay: number;
1081
+ }
1076
1082
  interface ScoringConfig {
1077
1083
  /** Scoring rules — each rule adds/subtracts points based on field conditions. */
1078
1084
  rules: any[];
@@ -1091,6 +1097,8 @@ interface ScoringConfig {
1091
1097
  * @example ["lead_created", "appointment_booked"]
1092
1098
  */
1093
1099
  recalculateOnTriggers?: string[];
1100
+ /** Optional time-decay for idle leads. */
1101
+ decay?: ScoreDecay;
1094
1102
  }
1095
1103
  declare class Scoring extends APIResource {
1096
1104
  /**
@@ -1118,6 +1126,13 @@ declare class Scoring extends APIResource {
1118
1126
  * ```
1119
1127
  */
1120
1128
  recalculate<T = any>(leadId: string): Promise<T>;
1129
+ /**
1130
+ * Preview a lead's score + per-rule breakdown WITHOUT persisting it.
1131
+ * Powers the scoring config "why this lead scores X" panel.
1132
+ *
1133
+ * @param leadId - The unique ID of the lead to evaluate.
1134
+ */
1135
+ preview<T = any>(leadId: string): Promise<T>;
1121
1136
  }
1122
1137
 
1123
1138
  declare class Sequences extends APIResource {
@@ -3629,7 +3644,7 @@ interface LearningMemory {
3629
3644
  }
3630
3645
  /**
3631
3646
  * Full AI persona — one row per `(userId, orgId, productId)` in
3632
- * `ecodrix_ai_personas`. Returned by `GET /platform/tenants/persona/persona/:productId`.
3647
+ * `ecodrix_ai_personas`. Returned by `GET /platform/tenants/persona/:productId`.
3633
3648
  */
3634
3649
  interface AIPersona {
3635
3650
  id: string;
@@ -3776,7 +3791,7 @@ type ReinforcementEvent = (ReinforcementEventBase & {
3776
3791
  answer: unknown;
3777
3792
  });
3778
3793
  /**
3779
- * Response of `POST /platform/tenants/persona/persona/:productId/reinforce`.
3794
+ * Response of `POST /platform/tenants/persona/:productId/reinforce`.
3780
3795
  */
3781
3796
  interface ReinforceResponse {
3782
3797
  ok: true;
@@ -3784,7 +3799,7 @@ interface ReinforceResponse {
3784
3799
  version: number;
3785
3800
  }
3786
3801
  /**
3787
- * Response of `GET /platform/tenants/persona/persona/:productId/confidence`.
3802
+ * Response of `GET /platform/tenants/persona/:productId/confidence`.
3788
3803
  */
3789
3804
  interface ConfidenceResponse {
3790
3805
  /** 0–100 score per REQ-008. */
@@ -3798,7 +3813,7 @@ interface ConfidenceResponse {
3798
3813
  }
3799
3814
  /**
3800
3815
  * One row of a persona's version history. Mirrors the wire shape of
3801
- * `GET /platform/tenants/persona/persona/:productId/timeline` produced by
3816
+ * `GET /platform/tenants/persona/:productId/timeline` produced by
3802
3817
  * `personaHistory.listTimeline` on the server.
3803
3818
  *
3804
3819
  * The DB stores 50 of these per persona (`personaHistory.appendAndPrune`
@@ -3824,7 +3839,7 @@ interface PersonaTimelineEntry {
3824
3839
  createdAt: string;
3825
3840
  }
3826
3841
  /**
3827
- * Response shape of `GET /platform/tenants/persona/persona/:productId/timeline`.
3842
+ * Response shape of `GET /platform/tenants/persona/:productId/timeline`.
3828
3843
  *
3829
3844
  * `hasMore` is a soft "did we hit the page size?" hint — the server
3830
3845
  * doesn't run a second COUNT(*) to compute an exact total. The saas
@@ -3846,13 +3861,13 @@ interface PersonaTimelineOptions {
3846
3861
  * confidence-gap-detection loop (REQ-016 Loop 1). The saas
3847
3862
  * `<FollowupQuestionCard>` renders the newest pending entry inline
3848
3863
  * on the relevant product page; the user's answer routes through
3849
- * `POST /platform/tenants/persona/persona/:productId/followups/:id/answer` (which flips
3864
+ * `POST /platform/tenants/persona/:productId/followups/:id/answer` (which flips
3850
3865
  * `answeredAt` on the row) and additionally fires a
3851
3866
  * `kind: "followup_answer"` reinforcement event so the persona's
3852
3867
  * `corrections[]` audit slot is updated.
3853
3868
  *
3854
3869
  * Mirrors the wire shape returned by
3855
- * `GET /platform/tenants/persona/persona/:productId/followups`. The DB row carries
3870
+ * `GET /platform/tenants/persona/:productId/followups`. The DB row carries
3856
3871
  * `answeredAt` and `answer` columns; we deliberately omit them here
3857
3872
  * because the reader only ever returns pending rows (both columns
3858
3873
  * are NULL until the user answers).
@@ -3890,7 +3905,7 @@ interface PersonaFollowupQuestion {
3890
3905
  } | null;
3891
3906
  }
3892
3907
  /**
3893
- * Body shape of `POST /platform/tenants/persona/persona/:productId/followups/:id/answer`.
3908
+ * Body shape of `POST /platform/tenants/persona/:productId/followups/:id/answer`.
3894
3909
  *
3895
3910
  * Two acceptable forms:
3896
3911
  * - Plain string answer — the legacy path used by Loop 1
@@ -3913,7 +3928,7 @@ type AnswerFollowupBody = {
3913
3928
  };
3914
3929
  };
3915
3930
  /**
3916
- * Response shape of `GET /platform/tenants/persona/persona/:productId/followups`.
3931
+ * Response shape of `GET /platform/tenants/persona/:productId/followups`.
3917
3932
  *
3918
3933
  * The list is ordered newest-first by `askedAt` and capped at 5
3919
3934
  * server-side. The saas card only ever renders the first entry.
@@ -4642,7 +4657,7 @@ declare class Notifications extends APIResource {
4642
4657
  }
4643
4658
 
4644
4659
  /**
4645
- * Body of `POST /platform/tenants/onboarding/onboarding/global` — the four-question signup form.
4660
+ * Body of `POST /platform/tenants/onboarding/global` — the four-question signup form.
4646
4661
  *
4647
4662
  * Fields land directly on `ecodrix_organizations.*` columns (workspace
4648
4663
  * name, timezone) and `service_config -> 'global'` (primary product,
@@ -4662,7 +4677,7 @@ interface GlobalOnboardingPayload {
4662
4677
  primaryProduct: "crm" | "laie" | "flow" | "not_sure";
4663
4678
  }
4664
4679
  /**
4665
- * Body of `POST /platform/tenants/onboarding/onboarding/${productId}/start` — opens a per-product onboarding
4680
+ * Body of `POST /platform/tenants/onboarding/${productId}/start` — opens a per-product onboarding
4666
4681
  * session. Triggered by the explicit "Enable {Product}" click on
4667
4682
  * `/products/<productId>` (REQ-002).
4668
4683
  */
@@ -4670,7 +4685,7 @@ interface StartOnboardingPayload {
4670
4685
  productId: "crm" | "laie" | "flow";
4671
4686
  }
4672
4687
  /**
4673
- * Body of `POST /platform/tenants/onboarding/onboarding/${productId}/answer` — records one step's answer and
4688
+ * Body of `POST /platform/tenants/onboarding/${productId}/answer` — records one step's answer and
4674
4689
  * advances the engine. The saas calls this on every step submit (and as
4675
4690
  * a debounced PATCH for resumability).
4676
4691
  */
@@ -4681,14 +4696,14 @@ interface AnswerOnboardingPayload {
4681
4696
  answer: unknown;
4682
4697
  }
4683
4698
  /**
4684
- * Body of `POST /platform/tenants/onboarding/onboarding/complete` — terminates the session,
4699
+ * Body of `POST /platform/tenants/onboarding/complete` — terminates the session,
4685
4700
  * upserts the persona, and materializes the workspace defaults.
4686
4701
  */
4687
4702
  interface CompleteOnboardingPayload {
4688
4703
  sessionId: string;
4689
4704
  }
4690
4705
  /**
4691
- * Body of `POST /platform/tenants/onboarding/onboarding/${productId}/edit` — post-completion edit of a single
4706
+ * Body of `POST /platform/tenants/onboarding/${productId}/edit` — post-completion edit of a single
4692
4707
  * answer from `/settings/onboarding`. Triggers a `persona_recomputed`
4693
4708
  * event (REQ-010).
4694
4709
  */
@@ -4697,14 +4712,14 @@ interface EditOnboardingPayload {
4697
4712
  answer: unknown;
4698
4713
  }
4699
4714
  /**
4700
- * Result of `POST /platform/tenants/onboarding/onboarding/${productId}/start`.
4715
+ * Result of `POST /platform/tenants/onboarding/${productId}/start`.
4701
4716
  */
4702
4717
  interface StartOnboardingResponse {
4703
4718
  sessionId: string;
4704
4719
  firstStep: OnboardingStep;
4705
4720
  }
4706
4721
  /**
4707
- * Result of `POST /platform/tenants/onboarding/onboarding/${productId}/answer`.
4722
+ * Result of `POST /platform/tenants/onboarding/${productId}/answer`.
4708
4723
  */
4709
4724
  interface AnswerOnboardingResponse {
4710
4725
  /** `null` when the engine has reached the final step. */
@@ -4712,7 +4727,7 @@ interface AnswerOnboardingResponse {
4712
4727
  draftPersona: Record<string, unknown>;
4713
4728
  }
4714
4729
  /**
4715
- * Result of `GET /platform/tenants/onboarding/onboarding/${productId}/state`. Returns the active session
4730
+ * Result of `GET /platform/tenants/onboarding/${productId}/state`. Returns the active session
4716
4731
  * (status `"active"`) for `(userId, productId)`, plus the step the
4717
4732
  * renderer should currently show.
4718
4733
  */
@@ -4721,7 +4736,7 @@ interface OnboardingStateResponse {
4721
4736
  currentStep: OnboardingStep | null;
4722
4737
  }
4723
4738
  /**
4724
- * Result of `POST /platform/tenants/onboarding/onboarding/complete`.
4739
+ * Result of `POST /platform/tenants/onboarding/complete`.
4725
4740
  */
4726
4741
  interface CompleteOnboardingResponse {
4727
4742
  /** Opaque persona document — full type lives in `resources/persona.ts`. */
@@ -4729,7 +4744,7 @@ interface CompleteOnboardingResponse {
4729
4744
  workspaceProfile: WorkspaceProfile;
4730
4745
  }
4731
4746
  /**
4732
- * Result of `POST /platform/tenants/onboarding/onboarding/${productId}/edit`.
4747
+ * Result of `POST /platform/tenants/onboarding/${productId}/edit`.
4733
4748
  */
4734
4749
  interface EditOnboardingResponse {
4735
4750
  persona: Record<string, unknown>;
@@ -5981,9 +5996,9 @@ declare class AdminOpenApi extends APIResource {
5981
5996
  */
5982
5997
  json<T = any>(): Promise<T>;
5983
5998
  /**
5984
- * Retrieve the OpenAPI spec.
5999
+ * Retrieve the Swagger UI HTML page.
5985
6000
  */
5986
- spec<T = any>(): Promise<T>;
6001
+ docs<T = any>(): Promise<T>;
5987
6002
  /**
5988
6003
  * Retrieve the OpenAPI health status.
5989
6004
  */
@@ -6741,6 +6756,12 @@ interface ECODrIxAPIOptions {
6741
6756
  * never set this and never pass a URL.
6742
6757
  */
6743
6758
  baseUrl?: string;
6759
+ /**
6760
+ * Per-request timeout in milliseconds. A request that gets no response
6761
+ * within this window is aborted and rejected (rather than hanging the
6762
+ * caller forever). Defaults to 30000 (30s). Set 0 to disable.
6763
+ */
6764
+ timeout?: number;
6744
6765
  }
6745
6766
  /**
6746
6767
  * The primary entry point for the ECODrIx SDK.