@ecodrix/erix-api 3.3.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/dist/cli.js +8 -8
- package/dist/ts/cjs/index.cjs +1 -1
- package/dist/ts/esm/index.d.ts +6607 -1797
- package/dist/ts/esm/index.js +1 -1
- package/package.json +1 -1
package/dist/ts/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var rt=Object.create;var B=Object.defineProperty,st=Object.defineProperties,it=Object.getOwnPropertyDescriptor,ot=Object.getOwnPropertyDescriptors,at=Object.getOwnPropertyNames,Ge=Object.getOwnPropertySymbols,ct=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable;var lt=(n,e)=>(e=Symbol[n])?e:Symbol.for("Symbol."+n);var ve=(n,e,t)=>e in n?B(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,g=(n,e)=>{for(var t in e||(e={}))Qe.call(e,t)&&ve(n,t,e[t]);if(Ge)for(var t of Ge(e))pt.call(e,t)&&ve(n,t,e[t]);return n},R=(n,e)=>st(n,ot(e));var ut=(n,e)=>{for(var t in e)B(n,t,{get:e[t],enumerable:!0})},Ye=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of at(e))!Qe.call(n,s)&&s!==t&&B(n,s,{get:()=>e[s],enumerable:!(r=it(e,s))||r.enumerable});return n};var L=(n,e,t)=>(t=n!=null?rt(ct(n)):{},Ye(e||!n||!n.__esModule?B(t,"default",{value:n,enumerable:!0}):t,n)),gt=n=>Ye(B({},"__esModule",{value:!0}),n);var i=(n,e,t)=>ve(n,typeof e!="symbol"?e+"":e,t);var Ce=function(n,e){this[0]=n,this[1]=e},Je=(n,e,t)=>{var r=(u,l,f,d)=>{try{var b=t[u](l),k=(l=b.value)instanceof Ce,P=b.done;Promise.resolve(k?l[0]:l).then(y=>k?r(u==="return"?u:"next",l[1]?{done:y.done,value:y.value}:y,f,d):f({value:y,done:P})).catch(y=>r("throw",y,f,d))}catch(y){d(y)}},s=(u,l,f,d)=>p[u]=b=>(l=new Promise((k,P,y)=>(y=()=>r(u,b,k,P),a?a.then(y):y())),d=()=>a===f&&(a=0),a=f=l.then(d,d),l),a,p={};return t=t.apply(n,e),p[lt("asyncIterator")]=()=>p,s("next"),s("throw"),s("return"),p};var xt={};ut(xt,{APIError:()=>m,APIResource:()=>o,AiAgent:()=>$,AuthenticationError:()=>T,ConnectInfra:()=>W,ECODrIx:()=>A,ECODrIxAPI:()=>A,ERROR_RETRY_CONFIG:()=>Ne,EcodrixError:()=>G,EmailConnect:()=>N,ErixChat:()=>_,ErixProduct:()=>U,HTTP_STATUS_ERROR_MAP:()=>mt,InfraDomain:()=>D,KNOWLEDGE_FILE_TYPES:()=>et,Knowledge:()=>E,LEAD_STATUS_VALUES:()=>Ee,Onboarding:()=>I,PermissionError:()=>v,Persona:()=>S,PlatformDomain:()=>M,PlatformTenants:()=>j,PlatformUsers:()=>H,ProductDomain:()=>O,RateLimitError:()=>x,StorageInfra:()=>K,WebhookSignatureError:()=>w,Webhooks:()=>F,WhatsAppConnect:()=>V,default:()=>bt,getErrorDetails:()=>ht,getRetryConfig:()=>Tt,handleAPIError:()=>yt,isAPIError:()=>ft,toAPIError:()=>q});module.exports=gt(xt);var nt=L(require("axios"),1),Ue=L(require("axios-retry"),1);var Ie="https://api.ecodrix.com";function Xe(n="v1",e=Ie){return`${e.replace(/\/+$/,"")}/${n}/api`}var G=class extends Error{constructor(e){super(e),this.name="EcodrixError"}},m=class extends G{constructor(t,r,s){super(t);i(this,"status");i(this,"code");i(this,"issues");i(this,"field");this.name="APIError",this.status=r,this.code=s}},T=class extends m{constructor(e="Invalid API Key or Client Code",t="AUTH_FAILED",r=401){super(e,r,t),this.name="AuthenticationError"}},v=class extends T{constructor(e="You don't have permission to do this.",t="FORBIDDEN"){super(e,t,403),this.name="PermissionError"}},x=class extends m{constructor(e="Too many requests. Please slow down."){super(e,429,"RATE_LIMIT_EXCEEDED"),this.name="RateLimitError"}};function q(n){var a;if(!(n!=null&&n.response))return new m((n==null?void 0:n.message)||"Network Error");let{status:e,data:t}=n.response,r=(t==null?void 0:t.message)||(t==null?void 0:t.error)||"API Request Failed",s=(a=t==null?void 0:t.code)!=null?a:typeof(t==null?void 0:t.error)=="string"&&/^[A-Z][A-Z0-9_]*$/.test(t.error)?t.error:void 0;switch(e){case 401:return new T(r,s);case 403:return new v(r,s);case 429:return new x(r);default:{let p=new m(r,e,s);return Array.isArray(t==null?void 0:t.issues)&&(p.issues=t.issues),typeof(t==null?void 0:t.field)=="string"&&(p.field=t.field),p}}}var o=class{constructor(e){i(this,"client",e)}async post(e,t,r){try{let s=this.buildConfig(r);return(await this.client.post(e,t,s)).data}catch(s){this.handleError(s)}}async get(e,t){try{let r=this.buildConfig(t);return(await this.client.get(e,r)).data}catch(r){this.handleError(r)}}async patch(e,t,r){try{let s=this.buildConfig(r);return(await this.client.patch(e,t,s)).data}catch(s){this.handleError(s)}}async put(e,t,r){try{let s=this.buildConfig(r);return(await this.client.put(e,t,s)).data}catch(s){this.handleError(s)}}async deleteRequest(e,t){try{let r=this.buildConfig(t);return(await this.client.delete(e,r)).data}catch(r){this.handleError(r)}}buildConfig(e){if(!e)return;let t=g({},e);return e.idempotencyKey&&(t.headers=R(g({},t.headers),{"Idempotency-Key":e.idempotencyKey})),t}handleError(e){throw q(e)}};var Se=class extends o{async list(e){return this.get(`/product/erix/crm/leads/${e}/notes`)}async create(e,t){return this.post(`/product/erix/crm/leads/${e}/notes`,t)}async update(e,t){return this.patch(`/product/erix/crm/notes/${e}`,{content:t})}async pin(e,t=!0){return this.patch(`/product/erix/crm/notes/${e}/pin`,{isPinned:t})}async delete(e){return this.deleteRequest(`/product/erix/crm/notes/${e}`)}},Q=class extends o{constructor(t){super(t);i(this,"notes");this.notes=new Se(t)}async timeline(t,r){return this.get(`/product/erix/crm/leads/${t}/timeline`,{params:r})}async list(t,r){return this.get(`/product/erix/crm/leads/${t}/activities`,{params:g({},r)})}async log(t){return this.post(`/product/erix/crm/leads/${t.leadId}/activities`,t)}async logCall(t,r){return this.post(`/product/erix/crm/leads/${t}/calls`,r)}};var Y=class extends o{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})}async revenue(){return this.get("/product/erix/crm/analytics/revenue")}async health(){return this.get("/product/erix/crm/analytics/health")}async payments(){return this.get("/product/erix/crm/analytics/payments")}async reviews(){return this.get("/product/erix/crm/analytics/reviews")}async retention(){return this.get("/product/erix/crm/analytics/retention")}};var J=class extends o{async getChecklist(e){return this.get(`/product/erix/crm/documents/checklist/${e}`)}async createChecklist(e,t){return this.post(`/product/erix/crm/documents/checklist/${e}`,{templateNiche:t})}async markReceived(e,t,r){return this.patch(`/product/erix/crm/documents/checklist/${e}/${t}`,r?{fileUrl:r}:{})}async sendReminder(e){return this.post(`/product/erix/crm/documents/checklist/${e}/remind`)}async listIncomplete(){return this.get("/product/erix/crm/documents/checklist/incomplete")}async listTemplates(){return this.get("/product/erix/crm/documents/templates")}};var X=class extends o{async csv(e){return this.get("/product/erix/commerce/invoices/export/csv",{params:e})}async tally(e){return this.get("/product/erix/commerce/invoices/export/tally",{params:e})}async zoho(e){return this.get("/product/erix/commerce/invoices/export/zoho",{params:e})}};var Ee=["open","won","lost","archived"],Z=class extends o{async create(e){return this.post("/product/erix/crm/leads",e)}async describe(){let e=await this.fields(),t=Array.isArray(e.data)?e.data:[],r=[{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:Ee.map(a=>({label:`${a.charAt(0).toUpperCase()}${a.slice(1)}`,value:a}))},{key:"value",label:"Lead Value",type:"currency",required:!1},{key:"source",label:"Source",type:"string",required:!1}],s=t.map(a=>({key:`metadata.extra.${a.name}`,label:a.label||a.name,type:a.type||"string",required:!!a.required,options:a.options,group:"Custom Fields"}));return{name:"Lead",fields:[...r,...s],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,t=50){let r=[];for(let s=0;s<e.length;s+=t){let p=e.slice(s,s+t).map(l=>this.create(l)),u=await Promise.allSettled(p);for(let l of u)if(l.status==="fulfilled")r.push(l.value);else throw l.reason}return r}async import(e){return this.post("/product/erix/crm/leads/import",{leads:e})}async bulkUpsert(e){return this.import(e)}async list(e){let t=g({},e);return Array.isArray(t.tags)&&(t.tags=t.tags.join(",")),this.get("/product/erix/crm/leads",{params:t})}listAutoPaging(e){return Je(this,null,function*(){let t=(e==null?void 0:e.page)||1,r=!0;for(;r;){let s=yield new Ce(this.list(R(g({},e),{page:t}))),a=Array.isArray(s.data)?s.data:s||[];if(a.length===0){r=!1;break}for(let p of a)yield p;s.pagination&&t<s.pagination.pages||!s.pagination&&a.length>0?t++:r=!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,t,r={}){return this.get(`/product/erix/crm/pipelines/${e}/stages/${t}/leads`,{params:r})}async retrieveByRef(e,t){return this.get(`/product/erix/crm/leads/ref/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)}async update(e,t){return this.patch(`/product/erix/crm/leads/${e}`,t)}async setFollowUp(e,t,r){return this.patch(`/product/erix/crm/leads/${e}`,{nextFollowUpAt:t,nextFollowUpNote:t&&r!=null?r:null})}async move(e,t){return this.patch(`/product/erix/crm/leads/${e}/move`,{stageId:t})}async convert(e,t,r){return this.post(`/product/erix/crm/leads/${e}/convert`,{outcome:t,reason:r})}async tags(e,t){return this.patch(`/product/erix/crm/leads/${e}/tags`,t)}async recalculateScore(e){return this.post(`/product/erix/crm/leads/${e}/score`,{})}async updateMetadata(e,t){return this.patch(`/product/erix/crm/leads/${e}/metadata`,t)}async fields(){return this.get("/product/erix/crm/fields")}async notes(e){return this.get(`/product/erix/crm/leads/${e}/notes`)}async activities(e,t){return this.get(`/product/erix/crm/leads/${e}/timeline`,{params:t})}async createNote(e,t){return this.post(`/product/erix/crm/leads/${e}/notes`,t)}async updateNote(e,t,r){return this.patch(`/product/erix/crm/notes/${t}`,r)}async deleteNote(e,t){return this.deleteRequest(`/product/erix/crm/notes/${t}`)}async delete(e){return this.deleteRequest(`/product/erix/crm/leads/${e}`)}async export(e){return this.get(`/product/erix/crm/leads/${encodeURIComponent(e)}/export`)}async erase(e){return this.post(`/product/erix/crm/leads/${encodeURIComponent(e)}/erase`,{confirm:"ERASE"})}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 flowRuns(e){return this.get(`/product/erix/crm/leads/${e}/flow-runs`)}async merge(e,t){return this.post("/product/erix/crm/leads/merge",{primaryId:e,secondaryId:t})}};var ee=class extends o{async capture(e){return this.post("/product/erix/crm/payments/capture",e)}};var te=class extends o{async list(){return this.get("/product/erix/crm/pipelines")}async getStageManifest(e){var s,a;let t=await this.retrieve(e),r=Array.isArray((s=t.data)==null?void 0:s.stages)?t.data.stages:[];return{name:`Pipeline: ${((a=t.data)==null?void 0:a.name)||e}`,fields:r.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,t){return this.patch(`/product/erix/crm/pipelines/${e}`,t)}async setDefault(e){return this.patch(`/product/erix/crm/pipelines/${e}/default`,{})}async duplicate(e,t){return this.post(`/product/erix/crm/pipelines/${e}/duplicate`,{name:t})}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,t){return this.post(`/product/erix/crm/pipelines/${e}/stages`,t)}async reorderStages(e,t){return this.patch(`/product/erix/crm/pipelines/${e}/stages/reorder`,{order:t})}async updateStage(e,t){return this.patch(`/product/erix/crm/stages/${e}`,t)}async deleteStage(e,t){return this.deleteRequest(`/product/erix/crm/stages/${e}`,{data:t?{moveLeadsToStageId:t}:void 0})}};var ne=class extends o{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 re=class extends o{async list(e){return this.get("/platform/inbox/conversations",{params:e})}async create(e){var t;return this.post("/platform/inbox/conversations",{address:e.phone,channel:(t=e.channel)!=null?t:"whatsapp",userName:e.name})}async linkLead(e,t){return this.patch(`/platform/inbox/conversations/${e}/lead`,{leadId:t})}async retrieve(e){return this.get(`/platform/inbox/conversations/${e}`)}async messages(e,t){return this.get(`/platform/inbox/conversations/${e}/messages`,{params:t})}async markRead(e){return this.post(`/platform/inbox/conversations/${e}/read`,{})}async delete(e){return this.deleteRequest(`/platform/inbox/conversations/${e}`)}async bulkDelete(e){return this.post("/platform/inbox/conversations/bulk-delete",{ids:e})}};var C=class extends o{async send(e){if(e.conversationId)return this.post(`/platform/inbox/conversations/${e.conversationId}/messages`,{text:e.text,media:e.media});if(!e.to)throw new Error("send: conversationId or to is required");if(e.media)throw new Error("send: media goes to an inbox thread (conversationId)");return this.post("/infra/connect/send/whatsapp",{phone:e.to,text:e.text})}async sendTemplate(e){return this.post("/infra/connect/send/whatsapp",{phone:e.to,templateName:e.templateName,language:e.language,variables:e.variables})}async star(e,t){return this.post(`/platform/inbox/messages/${e}/star`,{starred:t})}async markRead(e){return this.post(`/platform/inbox/conversations/${e}/read`,{})}async upload(e,t={}){var f,d,b;let r=(d=(f=t.fileName)!=null?f:e.name)!=null?d:"file",s=e.type||"application/octet-stream",a=await this.post("/infra/storage/files/upload-url",{folder:(b=t.folder)!=null?b:"inbox",filename:r,contentType:s}),{uploadUrl:p,key:u}=a.data,l=await fetch(p,{method:"PUT",headers:{"Content-Type":s},body:e});if(!l.ok)throw new Error(`upload failed (${l.status})`);return await this.post("/infra/storage/files/confirm-upload",{key:u,sizeBytes:e.size}),{key:u,mimeType:s,fileName:r}}};var se=class extends o{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 o{async trigger(e){return this.post("/product/erix/events/trigger",e)}async listCustomEvents(){return this.get("/product/flow/config/triggers")}async createCustomEvent(e){return this.post("/product/flow/config/triggers",e)}async deleteCustomEvent(e){return this.deleteRequest(`/product/flow/config/triggers/${e}`)}};var oe=class extends o{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,t){return this.patch(`/product/erix/commerce/invoices/${e}`,t)}async void(e){return this.post(`/product/erix/commerce/invoices/${e}/void`,{})}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)}async paymentLink(e){return this.post(`/product/erix/commerce/invoices/${encodeURIComponent(e)}/payment-link`,{})}async recordPayment(e,t){return this.post(`/product/erix/commerce/invoices/${encodeURIComponent(e)}/payments`,t)}async sendWhatsApp(e){return this.post(`/product/erix/commerce/invoices/${encodeURIComponent(e)}/send-whatsapp`,{})}async sendEmail(e){return this.post(`/product/erix/commerce/invoices/${encodeURIComponent(e)}/send-email`,{})}};var ae=class extends o{async workflowPacks(){return this.get("/product/erix/crm/niche/workflow-packs")}async workflowPackDetail(e){return this.get(`/product/erix/crm/niche/workflow-packs/${e}`)}async installWorkflowPack(e){return this.post(`/product/erix/crm/niche/workflow-packs/${e}/install`)}async templateSuggestions(){return this.get("/product/erix/crm/niche/template-suggestions")}};var ce=class extends o{async list(e){return this.get(`/product/erix/commerce/projects/${e}/documents`)}async upload(e,t){return this.post(`/product/erix/commerce/projects/${e}/documents`,t)}async toggleSignature(e,t,r){return this.patch(`/product/erix/commerce/projects/${e}/documents/${t}/signature`,{required:r})}async addSigner(e,t,r){return this.post(`/product/erix/commerce/projects/${e}/documents/${t}/signers`,r)}async decline(e,t){return this.post(`/product/erix/commerce/projects/${e}/documents/${t}/decline`,{})}async stampSign(e,t,r){return this.post(`/product/erix/commerce/projects/${e}/documents/${t}/stamp-sign`,r)}};var pe=class extends o{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,t){return this.post(`/infra/connect/connections/${e}/connect`,t)}async configure(e,t){return this.put(`/infra/connect/connections/${e}/configure`,t)}async configureWebchat(e){return this.configure("webchat",{method:"domain",config:e})}async webchatSettings(){return this.get("/infra/connect/connections/webchat/settings")}async removeWebchatDomain(e){return this.deleteRequest(`/infra/connect/connections/webchat/domains/${encodeURIComponent(e)}`)}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,t){return this.put(`/infra/connect/connections/${e}/access`,t)}async googleConnectUrl(){return this.post("/infra/connect/google/connect-url",{})}async createPaymentLink(e){return this.post("/infra/connect/connections/payments/payment-link",e)}};var le=class extends o{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,t){return this.put(`/infra/connect/email/templates/${e}`,t)}async deleteTemplate(e,t=!1){return this.deleteRequest(`/infra/connect/email/templates/${e}`,{params:{force:t}})}async previewTemplate(e,t){return this.post(`/infra/connect/email/templates/${e}/preview`,t)}};var ue=class extends o{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,t){return this.patch(`/infra/connect/meet/${e}`,t)}async reschedule(e,t){return this.patch(`/infra/connect/meet/${e}`,t)}async delete(e){return this.update(e,{status:"cancelled"})}};var ge=class extends o{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 de=class extends o{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,t){return this.put(`/infra/connect/whatsapp/templates/${e}`,t)}async deleteTemplate(e,t){return this.deleteRequest(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}${t?"?force=true":""}`)}async mappingConfig(){return this.get("/infra/connect/whatsapp/templates/mapping/config")}async mappingSources(){return this.get("/infra/connect/whatsapp/templates/mapping/sources")}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,t){return this.put(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/mapping`,t)}async validate(e,t){let r=`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/validate`;return t?this.post(r,t):this.get(r)}async preview(e,t,r,s){return this.post(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/preview`,{context:t,mappings:r,onEmptyVariable:s})}async getVariableManifest(e){var a,p;let t=await this.retrieve(e),r=Array.isArray((a=t.data)==null?void 0:a.components)?t.data.components:[],s=[];for(let u of r)if(u.text){let l=u.text.match(/{{(\d+)}}/g);if(l)for(let f of l){let d=f.replace(/{{|}}/g,"");s.push({key:`var_${d}`,label:`${u.type} Var {{${d}}}`,type:"string",required:!0,group:u.type,description:`Variable placeholder in template ${u.type}`})}}return{name:`Template variables: ${((p=t.data)==null?void 0:p.name)||e}`,fields:s,uiHints:{icon:"Variables",primaryColor:"#059669"}}}};var Ze=L(require("axios"),1);var me=class extends o{async getUsage(){return this.get("/infra/storage/files/usage")}async createFolder(e){return this.post("/infra/storage/files/folders",{name:e})}async list(e,t){return this.get(`/infra/storage/files/files/${e}`,{params:t})}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,t){let r=await this.post("/infra/storage/files/upload-url",t),{uploadUrl:s,key:a}=r.data;await Ze.default.put(s,e,{headers:{"Content-Type":t.contentType}});let p=e.size||e.byteLength||0;return this.post("/infra/storage/files/confirm-upload",{key:a,sizeBytes:p})}};var ye=class extends o{async create(e){return this.post("/infra/storage/files/folders",{name:e})}},fe=class extends o{async list(e,t){return this.get(`/infra/storage/files/files/${e}`,{params:t})}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/files",{params:{key:e}})}};var he=class extends o{async system(){return(await this.get("/health")).data}};var Te=class extends o{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")}};var I=class extends o{async global(e){return this.post("/platform/tenants/onboarding/global",e)}async complete(e){return this.post("/platform/tenants/onboarding/complete",e)}};var S=class extends o{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,t){var s;let r=await super.get(`/platform/tenants/persona/${e}/timeline`,{params:t});return(s=r==null?void 0:r.data)!=null?s:{entries:[],hasMore:!1}}async followups(e){var r,s;let t=await super.get(`/platform/tenants/persona/${e}/followups`);return(s=(r=t==null?void 0:t.data)==null?void 0:r.entries)!=null?s:[]}};var $e=class extends o{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"}},be=class{constructor(e){i(this,"copilot");this.copilot=new $e(e)}};var et=["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/plain","text/markdown","text/csv","text/html","image/png","image/jpeg","image/webp"],E=class extends o{async list(){return this.get("/platform/knowledge/sources")}async addText(e){return this.post("/platform/knowledge/sources",g({kind:"text"},e))}async addUrl(e){return this.post("/platform/knowledge/sources",g({kind:"url"},e))}async addWebsite(e){return this.post("/platform/knowledge/sources",{type:"website",url:e.url})}async addFile(e,t={}){var s,a;let r=await new C(this.client).upload(e,{folder:"knowledge"});return this.post("/platform/knowledge/sources",{kind:"file",key:r.key,mimeType:r.mimeType,title:(a=(s=t.title)!=null?s:r.fileName)!=null?a:"Document"})}async remove(e){return this.deleteRequest(`/platform/knowledge/sources/${e}`)}async reindex(e){return this.post(`/platform/knowledge/sources/${e}/reindex`,{})}async search(e,t){return this.post("/platform/knowledge/search",g({query:e},t?{limit:t}:{}))}};var $=class extends o{async settings(){return this.get("/product/erix/ai/settings")}async updateSettings(e){return this.patch("/product/erix/ai/settings",e)}async outcomes(e={}){return this.get("/product/erix/ai/outcomes",{params:e})}async reviews(e){return this.get(`/product/erix/ai/reviews${e?`?status=${e}`:""}`)}async review(e,t,r){return this.post(`/product/erix/ai/reviews/${encodeURIComponent(e)}`,g({verdict:t},r?{note:r}:{}))}async suggestion(e){return this.get(`/product/erix/ai/suggestion/${e}`)}async approveAction(e){return this.post(`/product/erix/ai/suggestion/${e}/approve-action`,{})}async markSent(e,t,r){return this.post(`/product/erix/ai/suggestion/${e}/send`,{text:t,confidence:r})}async dismiss(e){return this.post(`/product/erix/ai/suggestion/${e}/dismiss`,{})}async approvals(){return this.get("/product/flow/approvals")}async agents(){return this.get("/product/flow/agents")}async updateAgent(e,t){return this.patch(`/product/flow/agents/${encodeURIComponent(e)}`,t)}async decideRun(e,t,r){return this.post(`/product/flow/runs/${encodeURIComponent(e)}/approve`,g({decision:t},r&&{nodeId:r}))}};var xe=class extends o{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,t){return this.post(`/platform/auth/invitations/${e}/accept`,t)}};var Oe=class extends o{async get(){return super.get("/platform/billing/entitlements/entitlements")}async usage(){return super.get("/platform/billing/entitlements/usage")}},De=class extends o{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)}},Me=class extends o{async listPublic(){return this.get("/platform/billing/plans/public")}},Fe=class extends o{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)}},Be=class extends o{async transactions(){return this.get("/platform/billing/user/transactions")}async transactionInvoice(e){return this.get(`/platform/billing/user/transactions/${encodeURIComponent(e)}/invoice`)}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")}},Le=class extends o{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)}},we=class{constructor(e){i(this,"entitlements");i(this,"subscriptions");i(this,"plans");i(this,"checkout");i(this,"user");i(this,"credits");this.entitlements=new Oe(e),this.subscriptions=new De(e),this.plans=new Me(e),this.checkout=new Fe(e),this.user=new Be(e),this.credits=new Le(e)}};var ke=class extends o{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,t){return this.post(`/platform/support/tickets/${e}/reply`,t)}async close(e){return this.patch(`/platform/support/tickets/${e}/close`,{})}};var Re=class extends o{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",{})}},Ae=class extends o{async list(){return this.get("/platform/users/members")}async invite(e){return this.post("/platform/users/members/invite",e)}async updateRole(e,t){return this.patch(`/platform/users/members/${e}`,{role:t})}async remove(e){return this.deleteRequest(`/platform/users/members/${e}`)}},Pe=class extends o{async list(){return this.get("/platform/auth/sessions")}async revoke(e){return this.deleteRequest(`/platform/auth/sessions/${e}`)}};var _=class{constructor(e){i(this,"messages");i(this,"conversations");this.messages=new C(e),this.conversations=new re(e)}},U=class{constructor(e){i(this,"leads");i(this,"pipelines");i(this,"activities");i(this,"analytics");i(this,"scoring");i(this,"payments");i(this,"chat");i(this,"events");i(this,"invoices");i(this,"checkout");i(this,"projects");i(this,"niche");i(this,"documents");i(this,"invoiceExport");i(this,"ai");this.leads=new Z(e),this.pipelines=new te(e),this.activities=new Q(e),this.analytics=new Y(e),this.scoring=new ne(e),this.payments=new ee(e),this.chat=new _(e),this.events=new ie(e),this.invoices=new oe(e),this.checkout=new se(e),this.projects=new ce(e),this.niche=new ae(e),this.documents=new J(e),this.invoiceExport=new X(e),this.ai=new $(e)}},O=class{constructor(e){i(this,"erix");this.erix=new U(e)}},N=class{constructor(e){i(this,"config");i(this,"templates");this.config=new ge(e),this.templates=new le(e)}},V=class{constructor(e){i(this,"templates");this.templates=new de(e)}},W=class{constructor(e){i(this,"email");i(this,"whatsapp");i(this,"meet");i(this,"connections");this.email=new N(e),this.whatsapp=new V(e),this.meet=new ue(e),this.connections=new pe(e)}},K=class{constructor(e){i(this,"files");i(this,"folders");i(this,"media");this.files=new fe(e),this.folders=new ye(e),this.media=new me(e)}},D=class{constructor(e){i(this,"connect");i(this,"storage");this.connect=new W(e),this.storage=new K(e)}},j=class{constructor(e){i(this,"onboarding");i(this,"persona");this.onboarding=new I(e),this.persona=new S(e)}},H=class{constructor(e){i(this,"me");i(this,"members");i(this,"sessions");i(this,"notifications");this.me=new Re(e),this.members=new Ae(e),this.sessions=new Pe(e),this.notifications=new Te(e)}},M=class{constructor(e){i(this,"auth");i(this,"users");i(this,"tenants");i(this,"billing");i(this,"support");i(this,"ai");i(this,"knowledge");i(this,"health");this.auth=new xe(e),this.users=new H(e),this.tenants=new j(e),this.billing=new we(e),this.support=new ke(e),this.ai=new be(e),this.knowledge=new E(e),this.health=new he(e)}};var w=class extends m{constructor(e){super(e,400,"invalid_signature"),this.name="WebhookSignatureError"}},F=class{async constructEvent(e,t,r){if(!t)throw new w("No webhook signature provided");let s=Array.isArray(t)?t[0]:t;s.startsWith("sha256=")&&(s=s.slice(7));try{let a=await import("crypto"),u=a.createHmac("sha256",r).update(e).digest("hex");if(!a.timingSafeEqual(Buffer.from(u),Buffer.from(s)))throw new w("Invalid webhook signature provided");return JSON.parse(e.toString("utf8"))}catch(a){throw a instanceof w?a:new w(`Webhook payload parsing failed: ${a.message}`)}}};var qe=typeof process!="undefined"&&"3.3.0"||"3.1.1";var tt,_e=(tt=Ue.default.default)!=null?tt:Ue.default,A=class{constructor(e){i(this,"client");i(this,"socket",null);i(this,"startSocket",null);i(this,"socketPromise",null);i(this,"socketQueue",[]);i(this,"clientCode");i(this,"apiVersion");i(this,"platform");i(this,"product");i(this,"infra");i(this,"webhooks");i(this,"lastSeq");i(this,"closed",!1);var d,b,k,P,y,Ve,We,Ke;let t=e.proxy;if(!e.apiKey&&!t)throw new T("API Key is required");this.clientCode=(d=e.clientCode)==null?void 0:d.toUpperCase(),this.apiVersion=(b=e.version)!=null?b:"v1";let r=(k=e.baseUrl)!=null?k:Ie,s=Xe(this.apiVersion,(P=t==null?void 0:t.url)!=null?P:r),a=e.socketUrl||r,p=typeof window!="undefined"&&typeof window.document!="undefined",u=p?"browser":typeof process!="undefined"?`node ${process.version}`:"unknown",l=p?((y=globalThis.navigator)==null?void 0:y.userAgent)||"browser":typeof process!="undefined"?process.platform:"unknown",f=R(g({},t?{}:{"x-api-key":e.apiKey,"x-client-code":((Ve=e.clientCode)==null?void 0:Ve.toUpperCase())||""}),{"Content-Type":"application/json","x-ecodrix-client-agent":JSON.stringify({sdk_version:qe,runtime:u,os:l})});if(this.client=nt.default.create({baseURL:s,headers:f,timeout:(We=e.timeout)!=null?We:3e4}),_e(this.client,{retries:3,retryDelay:_e.exponentialDelay,retryCondition:h=>{var z;return _e.isNetworkOrIdempotentRequestError(h)||((z=h.response)==null?void 0:z.status)===429},onRetry:(h,z,je)=>{var He,ze;typeof process!="undefined"&&((He=process.env)==null?void 0:He.NODE_ENV)==="development"&&console.warn(`[ECODrIx SDK] Retrying request (${h}/3): ${(ze=je.method)==null?void 0:ze.toUpperCase()} ${je.url}. Reason: ${z.message}`)}}),this.platform=new M(this.client),this.product=new O(this.client),this.infra=new D(this.client),this.webhooks=new F,t){if(t.ticket){let h=t.ticket;this.startSocket=()=>this.initSocket(a,async()=>({ticket:await h()}))}}else{let h={apiKey:e.apiKey,clientCode:((Ke=e.clientCode)==null?void 0:Ke.toUpperCase())||""};this.startSocket=()=>this.initSocket(a,async()=>h,{"x-api-key":h.apiKey,"x-client-code":h.clientCode})}if(p){let h={version:qe,clientCode:e.clientCode,initializedAt:new Date().toISOString()};window.__ECODRIX_SDK__=h}}initSocket(e,t,r){return this.socketPromise?this.socketPromise:(this.socketPromise=import("socket.io-client").then(({io:s})=>{this.socket=s(e,{auth:a=>{t().then(p=>a(R(g({},p),{lastSeq:this.lastSeq})),()=>a({lastSeq:this.lastSeq}))},extraHeaders:r}),this.setupSocket();for(let{type:a,args:p}of this.socketQueue)a==="joinRoom"?this.socket.emit("join-room",p[0]):a==="leaveRoom"?this.socket.emit("leave-room",p[0]):a==="on"?this.socket.on(p[0],p[1]):a==="off"?this.socket.off(p[0],p[1]):a==="disconnect"&&this.socket.disconnect();this.socketQueue=[]}),this.socketPromise)}joinRoom(e){var t;this.closed||(t=this.startSocket)==null||t.call(this),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(){this.socket&&(this.socket.on("connect_error",()=>{var e;(e=this.socket)!=null&&e.active||setTimeout(()=>{var t;this.closed||(t=this.socket)==null||t.connect()},5e3)}),this.socket.onAny((...e)=>{var r,s;let t=(r=e.at(-1))==null?void 0:r.seq;typeof t=="number"&&t>((s=this.lastSeq)!=null?s:0)&&(this.lastSeq=t)}))}on(e,t){var r;return this.closed||(r=this.startSocket)==null||r.call(this),this.socket?this.socket.on(e,t):this.socketQueue.push({type:"on",args:[e,t]}),this}disconnect(){this.closed=!0,this.socket?this.socket.disconnect():this.socketPromise&&this.socketQueue.push({type:"disconnect",args:[]})}off(e,t){return this.socket?this.socket.off(e,t):this.socketQueue.push({type:"off",args:[e,t]}),this}async request(e,t,r,s){var a,p,u;try{return(await this.client.request({method:e,url:t,data:r,params:s})).data}catch(l){throw l.response?new m(((a=l.response.data)==null?void 0:a.message)||((p=l.response.data)==null?void 0:p.error)||"Raw Execution Failed",l.response.status,(u=l.response.data)==null?void 0:u.code):new m(l.message||"Network Error")}}};var mt={401:T,403:v,429:x};function yt(n){throw q(n)}function ft(n,e){return n instanceof e}function ht(n){return n instanceof T?{message:n.message,status:n.status,code:n.code,type:"AuthenticationError"}:n instanceof x?{message:n.message,status:n.status,code:n.code,type:"RateLimitError"}:n instanceof m?{message:n.message,status:n.status,code:n.code,type:"APIError"}:{message:n.message||"Unknown error",type:"UnknownError"}}var Ne={[T.name]:{shouldRetry:!1,reason:"Authentication errors require fixing credentials, not retrying"},[x.name]:{shouldRetry:!0,maxRetries:3,baseDelay:1e3,backoffMultiplier:2,reason:"Rate limit errors can be retried with exponential backoff"},[m.name]:{shouldRetry:!0,maxRetries:2,baseDelay:500,backoffMultiplier:1.5,reason:"Generic API errors may be transient and worth retrying"}};function Tt(n){let e=n.constructor.name;return Ne[e]||Ne[m.name]}var bt=A;0&&(module.exports={APIError,APIResource,AiAgent,AuthenticationError,ConnectInfra,ECODrIx,ECODrIxAPI,ERROR_RETRY_CONFIG,EcodrixError,EmailConnect,ErixChat,ErixProduct,HTTP_STATUS_ERROR_MAP,InfraDomain,KNOWLEDGE_FILE_TYPES,Knowledge,LEAD_STATUS_VALUES,Onboarding,PermissionError,Persona,PlatformDomain,PlatformTenants,PlatformUsers,ProductDomain,RateLimitError,StorageInfra,WebhookSignatureError,Webhooks,WhatsAppConnect,getErrorDetails,getRetryConfig,handleAPIError,isAPIError,toAPIError});
|
|
1
|
+
"use strict";var cn=Object.create;var Re=Object.defineProperty,ln=Object.defineProperties,un=Object.getOwnPropertyDescriptor,pn=Object.getOwnPropertyDescriptors,gn=Object.getOwnPropertyNames,qe=Object.getOwnPropertySymbols,dn=Object.getPrototypeOf,wt=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable;var mn=(n,e)=>(e=Symbol[n])?e:Symbol.for("Symbol."+n);var Ct=(n,e,t)=>e in n?Re(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,g=(n,e)=>{for(var t in e||(e={}))wt.call(e,t)&&Ct(n,t,e[t]);if(qe)for(var t of qe(e))zt.call(e,t)&&Ct(n,t,e[t]);return n},E=(n,e)=>ln(n,pn(e));var R=(n,e)=>{var t={};for(var r in n)wt.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&qe)for(var r of qe(n))e.indexOf(r)<0&&zt.call(n,r)&&(t[r]=n[r]);return t};var yn=(n,e)=>{for(var t in e)Re(n,t,{get:e[t],enumerable:!0})},Qt=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of gn(e))!wt.call(n,o)&&o!==t&&Re(n,o,{get:()=>e[o],enumerable:!(r=un(e,o))||r.enumerable});return n};var Ae=(n,e,t)=>(t=n!=null?cn(dn(n)):{},Qt(e||!n||!n.__esModule?Re(t,"default",{value:n,enumerable:!0}):t,n)),fn=n=>Qt(Re({},"__esModule",{value:!0}),n);var i=(n,e,t)=>Ct(n,typeof e!="symbol"?e+"":e,t);var Tt=function(n,e){this[0]=n,this[1]=e},Yt=(n,e,t)=>{var r=(d,p,k,f)=>{try{var v=t[d](p),L=(p=v.value)instanceof Tt,D=v.done;Promise.resolve(L?p[0]:p).then(b=>L?r(d==="return"?d:"next",p[1]?{done:b.done,value:b.value}:b,k,f):k({value:b,done:D})).catch(b=>r("throw",b,k,f))}catch(b){f(b)}},o=(d,p,k,f)=>u[d]=v=>(p=new Promise((L,D,b)=>(b=()=>r(d,v,L,D),a?a.then(b):b())),f=()=>a===k&&(a=0),a=k=p.then(f,f),p),a,u={};return t=t.apply(n,e),u[mn("asyncIterator")]=()=>u,o("next"),o("throw"),o("return"),u};var Rn={};yn(Rn,{APIError:()=>y,APIResource:()=>s,AiAgent:()=>he,AuthenticationError:()=>T,Campaigns:()=>I,Catalog:()=>ke,Collector:()=>fe,ConnectInfra:()=>Me,ECODrIx:()=>O,ECODrIxAPI:()=>O,ERROR_RETRY_CONFIG:()=>Bt,EcodrixError:()=>Ke,EmailConnect:()=>Ve,ErixChat:()=>Le,ErixProduct:()=>Ee,FlowAudiences:()=>q,FlowAutomations:()=>F,FlowConversations:()=>U,FlowDrafts:()=>N,FlowFirstRunResource:()=>B,FlowHome:()=>_,FlowProduct:()=>$e,HTTP_STATUS_ERROR_MAP:()=>kn,InfraDomain:()=>Te,KNOWLEDGE_FILE_TYPES:()=>sn,Knowledge:()=>Ce,LAIE_EVENTS:()=>Zt,LEAD_STATUS_VALUES:()=>It,LaieAudits:()=>re,LaieCampaigns:()=>H,LaieCompliance:()=>X,LaieFreshness:()=>ne,LaieImport:()=>Y,LaieLeads:()=>Q,LaieLearning:()=>ee,LaieLists:()=>J,LaieLookalikes:()=>te,LaieMarket:()=>Z,LaiePacks:()=>j,LaieProduct:()=>De,LaieRuns:()=>z,LaieSignals:()=>G,LaieTools:()=>W,Onboarding:()=>be,PermissionError:()=>V,Persona:()=>xe,PlatformDomain:()=>ve,PlatformTenants:()=>_e,PlatformUsers:()=>Ne,ProductDomain:()=>we,RateLimitError:()=>A,SeoAudits:()=>oe,SeoBacklinks:()=>de,SeoBriefs:()=>ye,SeoInsights:()=>ae,SeoLocal:()=>ue,SeoPerformance:()=>me,SeoProduct:()=>Oe,SeoProjects:()=>ie,SeoRanks:()=>le,SeoReports:()=>pe,SeoResearch:()=>ge,SeoSearchConsole:()=>ce,StorageInfra:()=>Ue,VOICE_EVENTS:()=>tn,VOICE_REFUSAL_REASONS:()=>Pt,Voice:()=>se,VoiceCampaigns:()=>Pe,WebhookSignatureError:()=>P,Webhooks:()=>Se,WhatsAppConnect:()=>Fe,default:()=>Sn,getErrorDetails:()=>Tn,getRetryConfig:()=>vn,handleAPIError:()=>Cn,isAPIError:()=>wn,laieStageQueued:()=>Xt,toAPIError:()=>$,voiceErrorCode:()=>nn,voiceRefusalReason:()=>rn});module.exports=fn(Rn);var an=Ae(require("axios"),1),Nt=Ae(require("axios-retry"),1);var vt="https://api.ecodrix.com";function Jt(n="v1",e=vt){return`${e.replace(/\/+$/,"")}/${n}/api`}var Ke=class extends Error{constructor(e){super(e),this.name="EcodrixError"}},y=class extends Ke{constructor(t,r,o){super(t);i(this,"status");i(this,"code");i(this,"issues");i(this,"field");this.name="APIError",this.status=r,this.code=o}},T=class extends y{constructor(e="Invalid API Key or Client Code",t="AUTH_FAILED",r=401){super(e,r,t),this.name="AuthenticationError"}},V=class extends T{constructor(e="You don't have permission to do this.",t="FORBIDDEN"){super(e,t,403),this.name="PermissionError"}},A=class extends y{constructor(e="Too many requests. Please slow down."){super(e,429,"RATE_LIMIT_EXCEEDED"),this.name="RateLimitError"}};function $(n){var a;if(!(n!=null&&n.response))return new y((n==null?void 0:n.message)||"Network Error");let{status:e,data:t}=n.response,r=(t==null?void 0:t.message)||(t==null?void 0:t.error)||"API Request Failed",o=(a=t==null?void 0:t.code)!=null?a:typeof(t==null?void 0:t.error)=="string"&&/^[A-Z][A-Z0-9_]*$/.test(t.error)?t.error:void 0;switch(e){case 401:return new T(r,o);case 403:return new V(r,o);case 429:return new A(r);default:{let u=new y(r,e,o);return Array.isArray(t==null?void 0:t.issues)&&(u.issues=t.issues),typeof(t==null?void 0:t.field)=="string"&&(u.field=t.field),u}}}var s=class{constructor(e){i(this,"client",e)}async post(e,t,r){try{let o=this.buildConfig(r);return(await this.client.post(e,t,o)).data}catch(o){this.handleError(o)}}async get(e,t){try{let r=this.buildConfig(t);return(await this.client.get(e,r)).data}catch(r){this.handleError(r)}}async patch(e,t,r){try{let o=this.buildConfig(r);return(await this.client.patch(e,t,o)).data}catch(o){this.handleError(o)}}async put(e,t,r){try{let o=this.buildConfig(r);return(await this.client.put(e,t,o)).data}catch(o){this.handleError(o)}}async deleteRequest(e,t){try{let r=this.buildConfig(t);return(await this.client.delete(e,r)).data}catch(r){this.handleError(r)}}buildConfig(e){if(!e)return;let t=g({},e);return e.idempotencyKey&&(t.headers=E(g({},t.headers),{"Idempotency-Key":e.idempotencyKey})),t}handleError(e){throw $(e)}};var F=class extends s{path(e,t=""){return`/product/flow/workflows/${encodeURIComponent(e)}${t}`}async versions(e){return this.get(this.path(e,"/versions"))}async version(e,t){return this.get(this.path(e,`/versions/${encodeURIComponent(t)}`))}async restoreVersion(e,t){return this.post(this.path(e,`/versions/${encodeURIComponent(t)}/restore`))}async testData(e){return this.get(this.path(e,"/test-data"))}async pinTestData(e,t){return this.put(this.path(e,"/test-data"),{runId:t})}async unpinTestData(e){return this.deleteRequest(this.path(e,"/test-data"))}async testRun(e,t={}){return this.post(this.path(e,"/test-run"),t)}async testRunProgress(e,t){return this.get(this.path(e,"/test-run"),{params:{runIds:t.join(",")}})}async copilot(e,t){return this.post(this.path(e,"/copilot"),t)}async live(e){return this.get(this.path(e,"/live"))}async week(e){return this.get(this.path(e,"/week"))}async deleteImpact(e){return this.get(this.path(e,"/delete-impact"))}async remove(e,t={}){return this.deleteRequest(this.path(e,t.stop?"?stop=true":""))}async duplicate(e){return this.post(this.path(e,"/duplicate"))}async retryFailed(e,t={}){return this.post(this.path(e,"/retry-failed"),t)}};var I=class extends s{async list(e={}){return this.get("/product/flow/campaigns",{params:e})}async create(e){return this.post("/product/flow/campaigns",e)}async launch(e,t={}){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/launch`,t)}async retrieve(e){return this.get(`/product/flow/campaigns/${encodeURIComponent(e)}`)}async update(e,t){return this.patch(`/product/flow/campaigns/${encodeURIComponent(e)}`,t)}async test(e){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/test`,{})}async start(e,t={}){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/start`,t)}async pause(e){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/pause`,{})}async resume(e){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/resume`,{})}async stop(e){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/stop`,{})}async remove(e){return this.deleteRequest(`/product/flow/campaigns/${encodeURIComponent(e)}`)}async duplicate(e){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/duplicate`,{})}async followUp(e,t={}){return this.post(`/product/flow/campaigns/${encodeURIComponent(e)}/follow-up`,t)}async checks(e){return this.get(`/product/flow/campaigns/${encodeURIComponent(e)}/checks`)}async results(e){return this.get(`/product/flow/campaigns/${encodeURIComponent(e)}/results`)}async people(e,t={}){return this.get(`/product/flow/campaigns/${encodeURIComponent(e)}/people`,{params:t})}};var M="/product/flow/conversations",h=(n,e="")=>`${M}/${encodeURIComponent(n)}${e}`,U=class extends s{async list(e={}){return this.get(M,{params:e})}async create(e){return this.post(M,e)}async retrieve(e){return this.get(h(e))}async update(e,t){return this.patch(h(e),t)}async duplicate(e){return this.post(h(e,"/duplicate"),{})}async archive(e){return this.deleteRequest(h(e))}async publish(e,t={}){return this.post(h(e,"/publish"),t)}async versions(e){return this.get(h(e,"/versions"))}async version(e,t){return this.get(h(e,`/versions/${t}`))}async rollback(e,t){return this.post(h(e,"/rollback"),{version:t})}async try(e,t){return this.post(h(e,"/try"),t)}async tests(e){return this.get(h(e,"/tests"))}async addTest(e,t){return this.post(h(e,"/tests"),t)}async deleteTest(e,t){return this.deleteRequest(h(e,`/tests/${encodeURIComponent(t)}`))}async runTests(e,t={}){return this.post(h(e,"/tests/run"),t)}async deployments(e){return this.get(h(e,"/deployments"))}async allDeployments(){return this.get(`${M}/deployments`)}async deploy(e,t){return this.post(h(e,"/deployments"),t)}async updateDeployment(e,t){return this.patch(`${M}/deployments/${encodeURIComponent(e)}`,t)}async removeDeployment(e){return this.deleteRequest(`${M}/deployments/${encodeURIComponent(e)}`)}async checks(e){return this.get(h(e,"/checks"))}};var _=class extends s{async get(){return super.get("/product/flow/home")}async nav(){return super.get("/product/flow/home/nav")}},N=class extends s{async create(e){return this.post("/product/flow/drafts",e)}},B=class extends s{async status(){return this.get("/product/flow/first-run")}async installPack(e){return this.post(`/product/flow/first-run/packs/${e}`)}},q=class extends s{async list(){return this.get("/product/flow/audiences")}async byId(e){return this.get(`/product/flow/audiences/${encodeURIComponent(e)}`)}async create(e){return this.post("/product/flow/audiences",e)}async update(e,t){return this.patch(`/product/flow/audiences/${encodeURIComponent(e)}`,t)}async remove(e){return this.deleteRequest(`/product/flow/audiences/${encodeURIComponent(e)}`)}async preview(e){return this.get(`/product/flow/audiences/${encodeURIComponent(e)}/preview`)}async previewRules(e){return this.post("/product/flow/audiences/preview",e)}};var x="/product/erix/commerce/checkout",S="/product/erix/public/checkout",C=encodeURIComponent,St=class extends s{async getProduct(e,t){return this.get(`${S}/products/${C(t)}`,{params:{c:e}})}async viewSession(e,t){return this.get(`${S}/sessions/view`,{params:{c:e,t}})}async updateItems(e){let o=e,{sessionId:t}=o,r=R(o,["sessionId"]);return this.post(`${S}/sessions/${C(t)}/items`,r)}async startSession(e){return this.post(`${S}/sessions`,e)}async applyCoupon(e){let o=e,{sessionId:t}=o,r=R(o,["sessionId"]);return this.post(`${S}/sessions/${C(t)}/coupon`,r)}async verify(e){let o=e,{sessionId:t}=o,r=R(o,["sessionId"]);return this.post(`${S}/sessions/${C(t)}/verify`,r)}async placeOrder(e){let o=e,{sessionId:t}=o,r=R(o,["sessionId"]);return this.post(`${S}/sessions/${C(t)}/order`,r)}async verifyRazorpay(e){let a=e,{sessionId:t,orderId:r}=a,o=R(a,["sessionId","orderId"]);return this.post(`${S}/sessions/${C(t)}/order/${C(r)}/razorpay`,o)}async orderStatus(e,t){return this.get(`${S}/orders/status`,{params:{c:e,t}})}async confirmCod(e,t){return this.post(`${S}/cod/confirm`,{clientCode:e,token:t})}},Rt=class extends s{async create(e){return this.post(`${x}/sessions`,e)}},je=class extends s{constructor(t){super(t);i(this,"buyer");i(this,"sessions");this.buyer=new St(t),this.sessions=new Rt(t)}async listProducts(){return this.get(`${x}/products`)}async createProduct(t){return this.post(`${x}/products`,t)}async updateProduct(t,r){return this.patch(`${x}/products/${C(t)}`,r)}async deleteProduct(t){return this.deleteRequest(`${x}/products/${C(t)}`)}async listCoupons(){return this.get(`${x}/coupons`)}async createCoupon(t){return this.post(`${x}/coupons`,t)}async updateCoupon(t,r){return this.patch(`${x}/coupons/${C(t)}`,r)}async deleteCoupon(t){return this.deleteRequest(`${x}/coupons/${C(t)}`)}async listOrders(t){return this.get(`${x}/orders`,{params:t})}async getOrder(t){return this.get(`${x}/orders/${C(t)}`)}async updateOrderStatus(t,r){return this.patch(`${x}/orders/${C(t)}/status`,r)}async getSettings(){return this.get(`${x}/settings`)}async updateSettings(t){return this.put(`${x}/settings`,t)}async createProductLink(t){return this.post(`${x}/links`,t)}};var At=class extends s{async list(e){return this.get(`/product/erix/crm/leads/${e}/notes`)}async create(e,t){return this.post(`/product/erix/crm/leads/${e}/notes`,t)}async update(e,t){return this.patch(`/product/erix/crm/notes/${e}`,{content:t})}async pin(e,t=!0){return this.patch(`/product/erix/crm/notes/${e}/pin`,{isPinned:t})}async delete(e){return this.deleteRequest(`/product/erix/crm/notes/${e}`)}},Ge=class extends s{constructor(t){super(t);i(this,"notes");this.notes=new At(t)}async timeline(t,r){return this.get(`/product/erix/crm/leads/${t}/timeline`,{params:r})}async list(t,r){return this.get(`/product/erix/crm/leads/${t}/activities`,{params:g({},r)})}async log(t){return this.post(`/product/erix/crm/leads/${t.leadId}/activities`,t)}async logCall(t,r){return this.post(`/product/erix/crm/leads/${t}/calls`,r)}};var We=class extends s{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})}async revenue(){return this.get("/product/erix/crm/analytics/revenue")}async health(){return this.get("/product/erix/crm/analytics/health")}async payments(){return this.get("/product/erix/crm/analytics/payments")}async reviews(){return this.get("/product/erix/crm/analytics/reviews")}async retention(){return this.get("/product/erix/crm/analytics/retention")}};var He=class extends s{async getChecklist(e){return this.get(`/product/erix/crm/documents/checklist/${e}`)}async createChecklist(e,t){return this.post(`/product/erix/crm/documents/checklist/${e}`,{templateNiche:t})}async markReceived(e,t,r){return this.patch(`/product/erix/crm/documents/checklist/${e}/${t}`,r?{fileUrl:r}:{})}async sendReminder(e){return this.post(`/product/erix/crm/documents/checklist/${e}/remind`)}async listIncomplete(){return this.get("/product/erix/crm/documents/checklist/incomplete")}async listTemplates(){return this.get("/product/erix/crm/documents/templates")}};var ze=class extends s{async csv(e){return this.get("/product/erix/commerce/invoices/export/csv",{params:e})}async tally(e){return this.get("/product/erix/commerce/invoices/export/tally",{params:e})}async zoho(e){return this.get("/product/erix/commerce/invoices/export/zoho",{params:e})}};var It=["open","won","lost","archived"],Qe=class extends s{async create(e){return this.post("/product/erix/crm/leads",e)}async describe(){let e=await this.fields(),t=Array.isArray(e.data)?e.data:[],r=[{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:It.map(a=>({label:`${a.charAt(0).toUpperCase()}${a.slice(1)}`,value:a}))},{key:"value",label:"Lead Value",type:"currency",required:!1},{key:"source",label:"Source",type:"string",required:!1}],o=t.map(a=>({key:`metadata.extra.${a.name}`,label:a.label||a.name,type:a.type||"string",required:!!a.required,options:a.options,group:"Custom Fields"}));return{name:"Lead",fields:[...r,...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,t=50){let r=[];for(let o=0;o<e.length;o+=t){let u=e.slice(o,o+t).map(p=>this.create(p)),d=await Promise.allSettled(u);for(let p of d)if(p.status==="fulfilled")r.push(p.value);else throw p.reason}return r}async import(e,t={}){return this.post("/product/erix/crm/leads/import",g({leads:e},t))}async bulkUpsert(e){return this.import(e)}async list(e){let t=g({},e);return Array.isArray(t.tags)&&(t.tags=t.tags.join(",")),this.get("/product/erix/crm/leads",{params:t})}listAutoPaging(e){return Yt(this,null,function*(){let t=(e==null?void 0:e.page)||1,r=!0;for(;r;){let o=yield new Tt(this.list(E(g({},e),{page:t}))),a=Array.isArray(o.data)?o.data:o||[];if(a.length===0){r=!1;break}for(let u of a)yield u;o.pagination&&t<o.pagination.pages||!o.pagination&&a.length>0?t++:r=!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,t,r={}){return this.get(`/product/erix/crm/pipelines/${e}/stages/${t}/leads`,{params:r})}async retrieveByRef(e,t){return this.get(`/product/erix/crm/leads/ref/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)}async update(e,t){return this.patch(`/product/erix/crm/leads/${e}`,t)}async setFollowUp(e,t,r){return this.patch(`/product/erix/crm/leads/${e}`,{nextFollowUpAt:t,nextFollowUpNote:t&&r!=null?r:null})}async move(e,t){return this.patch(`/product/erix/crm/leads/${e}/move`,{stageId:t})}async convert(e,t,r){return this.post(`/product/erix/crm/leads/${e}/convert`,{outcome:t,reason:r})}async tags(e,t){return this.patch(`/product/erix/crm/leads/${e}/tags`,t)}async recalculateScore(e){return this.post(`/product/erix/crm/leads/${e}/score`,{})}async updateMetadata(e,t){return this.patch(`/product/erix/crm/leads/${e}/metadata`,t)}async fields(){return this.get("/product/erix/crm/fields")}async notes(e){return this.get(`/product/erix/crm/leads/${e}/notes`)}async activities(e,t){return this.get(`/product/erix/crm/leads/${e}/timeline`,{params:t})}async createNote(e,t){return this.post(`/product/erix/crm/leads/${e}/notes`,t)}async updateNote(e,t,r){return this.patch(`/product/erix/crm/notes/${t}`,r)}async deleteNote(e,t){return this.deleteRequest(`/product/erix/crm/notes/${t}`)}async delete(e){return this.deleteRequest(`/product/erix/crm/leads/${e}`)}async export(e){return this.get(`/product/erix/crm/leads/${encodeURIComponent(e)}/export`)}async erase(e){return this.post(`/product/erix/crm/leads/${encodeURIComponent(e)}/erase`,{confirm:"ERASE"})}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 flowRuns(e){return this.get(`/product/erix/crm/leads/${e}/flow-runs`)}async merge(e,t){return this.post("/product/erix/crm/leads/merge",{primaryId:e,secondaryId:t})}async duplicates(e){return this.get(`/product/erix/crm/leads/${encodeURIComponent(e)}/duplicates`)}};var Ye=class extends s{async capture(e){return this.post("/product/erix/crm/payments/capture",e)}};var Je=class extends s{async list(){return this.get("/product/erix/crm/pipelines")}async getStageManifest(e){var o,a;let t=await this.retrieve(e),r=Array.isArray((o=t.data)==null?void 0:o.stages)?t.data.stages:[];return{name:`Pipeline: ${((a=t.data)==null?void 0:a.name)||e}`,fields:r.map(u=>({key:u._id,label:u.name,type:"string",required:!0,options:[{label:u.name,value:u._id}],group:"Stages",uiHints:{color:u.color||"#cbd5e1",probability:u.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,t){return this.patch(`/product/erix/crm/pipelines/${e}`,t)}async setDefault(e){return this.patch(`/product/erix/crm/pipelines/${e}/default`,{})}async duplicate(e,t){return this.post(`/product/erix/crm/pipelines/${e}/duplicate`,{name:t})}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,t){return this.post(`/product/erix/crm/pipelines/${e}/stages`,t)}async reorderStages(e,t){return this.patch(`/product/erix/crm/pipelines/${e}/stages/reorder`,{order:t})}async updateStage(e,t){return this.patch(`/product/erix/crm/stages/${e}`,t)}async deleteStage(e,t){return this.deleteRequest(`/product/erix/crm/stages/${e}`,{data:t?{moveLeadsToStageId:t}:void 0})}};var Xe=class extends s{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 Ze=class extends s{async trigger(e){return this.post("/product/erix/events/trigger",e)}async listCustomEvents(){return this.get("/product/flow/config/triggers")}async createCustomEvent(e){return this.post("/product/flow/config/triggers",e)}async deleteCustomEvent(e){return this.deleteRequest(`/product/flow/config/triggers/${e}`)}};var et=class extends s{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,t){return this.patch(`/product/erix/commerce/invoices/${e}`,t)}async void(e){return this.post(`/product/erix/commerce/invoices/${e}/void`,{})}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)}async paymentLink(e){return this.post(`/product/erix/commerce/invoices/${encodeURIComponent(e)}/payment-link`,{})}async recordPayment(e,t){return this.post(`/product/erix/commerce/invoices/${encodeURIComponent(e)}/payments`,t)}async sendWhatsApp(e){return this.post(`/product/erix/commerce/invoices/${encodeURIComponent(e)}/send-whatsapp`,{})}async sendEmail(e){return this.post(`/product/erix/commerce/invoices/${encodeURIComponent(e)}/send-email`,{})}};var tt=class extends s{async workflowPacks(){return this.get("/product/erix/crm/niche/workflow-packs")}async workflowPackDetail(e){return this.get(`/product/erix/crm/niche/workflow-packs/${e}`)}async installWorkflowPack(e){return this.post(`/product/erix/crm/niche/workflow-packs/${e}/install`)}async templateSuggestions(){return this.get("/product/erix/crm/niche/template-suggestions")}};var nt=class extends s{async list(e){return this.get(`/product/erix/commerce/projects/${e}/documents`)}async upload(e,t){return this.post(`/product/erix/commerce/projects/${e}/documents`,t)}async toggleSignature(e,t,r){return this.patch(`/product/erix/commerce/projects/${e}/documents/${t}/signature`,{required:r})}async addSigner(e,t,r){return this.post(`/product/erix/commerce/projects/${e}/documents/${t}/signers`,r)}async decline(e,t){return this.post(`/product/erix/commerce/projects/${e}/documents/${t}/decline`,{})}async stampSign(e,t,r){return this.post(`/product/erix/commerce/projects/${e}/documents/${t}/stamp-sign`,r)}};var rt=class extends s{async list(e){return this.get("/platform/inbox/conversations",{params:e})}async create(e){var t;return this.post("/platform/inbox/conversations",{address:e.phone,channel:(t=e.channel)!=null?t:"whatsapp",userName:e.name})}async linkLead(e,t){return this.patch(`/platform/inbox/conversations/${e}/lead`,{leadId:t})}async retrieve(e){return this.get(`/platform/inbox/conversations/${e}`)}async messages(e,t){return this.get(`/platform/inbox/conversations/${e}/messages`,{params:t})}async markRead(e){return this.post(`/platform/inbox/conversations/${e}/read`,{})}async delete(e){return this.deleteRequest(`/platform/inbox/conversations/${e}`)}async bulkDelete(e){return this.post("/platform/inbox/conversations/bulk-delete",{ids:e})}};var K=class extends s{async send(e){if(e.conversationId)return this.post(`/platform/inbox/conversations/${e.conversationId}/messages`,{text:e.text,media:e.media});if(!e.to)throw new Error("send: conversationId or to is required");if(e.media)throw new Error("send: media goes to an inbox thread (conversationId)");return this.post("/infra/connect/send/whatsapp",{phone:e.to,text:e.text})}async sendTemplate(e){return this.post("/infra/connect/send/whatsapp",{phone:e.to,templateName:e.templateName,language:e.language,variables:e.variables})}async star(e,t){return this.post(`/platform/inbox/messages/${e}/star`,{starred:t})}async markRead(e){return this.post(`/platform/inbox/conversations/${e}/read`,{})}async upload(e,t={}){var k,f,v;let r=(f=(k=t.fileName)!=null?k:e.name)!=null?f:"file",o=e.type||"application/octet-stream",a=await this.post("/infra/storage/files/upload-url",{folder:(v=t.folder)!=null?v:"inbox",filename:r,contentType:o}),{uploadUrl:u,key:d}=a.data,p=await fetch(u,{method:"PUT",headers:{"Content-Type":o},body:e});if(!p.ok)throw new Error(`upload failed (${p.status})`);return await this.post("/infra/storage/files/confirm-upload",{key:d,sizeBytes:e.size}),{key:d,mimeType:o,fileName:r}}};var st=class extends s{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,t){return this.post(`/infra/connect/connections/${e}/connect`,t)}async configure(e,t){return this.put(`/infra/connect/connections/${e}/configure`,t)}async configureWebchat(e){return this.configure("webchat",{method:"domain",config:e})}async webchatSettings(){return this.get("/infra/connect/connections/webchat/settings")}async removeWebchatDomain(e){return this.deleteRequest(`/infra/connect/connections/webchat/domains/${encodeURIComponent(e)}`)}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 checkNow(e){return this.post(`/infra/connect/connections/${e}/health/check`,{})}async googleConnectUrl(){return this.post("/infra/connect/google/connect-url",{})}async createPaymentLink(e){return this.post("/infra/connect/connections/payments/payment-link",e)}};var it=class extends s{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,t){return this.put(`/infra/connect/email/templates/${e}`,t)}async deleteTemplate(e,t=!1){return this.deleteRequest(`/infra/connect/email/templates/${e}`,{params:{force:t}})}async previewTemplate(e,t){return this.post(`/infra/connect/email/templates/${e}/preview`,t)}};var ot=class extends s{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,t){return this.patch(`/infra/connect/meet/${e}`,t)}async reschedule(e,t){return this.patch(`/infra/connect/meet/${e}`,t)}async delete(e){return this.update(e,{status:"cancelled"})}};var at=class extends s{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 ct=class extends s{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,t){return this.put(`/infra/connect/whatsapp/templates/${e}`,t)}async fix(e){return this.post(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/fix`,{})}async resubmit(e,t){return this.post(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/resubmit`,t)}async deleteTemplate(e,t){return this.deleteRequest(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}${t?"?force=true":""}`)}async mappingConfig(){return this.get("/infra/connect/whatsapp/templates/mapping/config")}async mappingSources(){return this.get("/infra/connect/whatsapp/templates/mapping/sources")}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,t){return this.put(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/mapping`,t)}async validate(e,t){let r=`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/validate`;return t?this.post(r,t):this.get(r)}async preview(e,t,r,o){return this.post(`/infra/connect/whatsapp/templates/${encodeURIComponent(e)}/preview`,{context:t,mappings:r,onEmptyVariable:o})}async getVariableManifest(e){var a,u;let t=await this.retrieve(e),r=Array.isArray((a=t.data)==null?void 0:a.components)?t.data.components:[],o=[];for(let d of r)if(d.text){let p=d.text.match(/{{(\d+)}}/g);if(p)for(let k of p){let f=k.replace(/{{|}}/g,"");o.push({key:`var_${f}`,label:`${d.type} Var {{${f}}}`,type:"string",required:!0,group:d.type,description:`Variable placeholder in template ${d.type}`})}}return{name:`Template variables: ${((u=t.data)==null?void 0:u.name)||e}`,fields:o,uiHints:{icon:"Variables",primaryColor:"#059669"}}}};var Xt=n=>"queued"in n&&n.queued===!0,Zt={runProgress:"laie:run:progress",importComplete:"laie:import:complete"},m=encodeURIComponent,l="/product/laie",j=class extends s{async list(){return this.get(`${l}/packs`)}async byId(e){return this.get(`${l}/packs/${m(e)}`)}},G=class extends s{async catalog(e={}){return this.get(`${l}/signals/catalog`,{params:e})}async list(e={}){return this.get(`${l}/signals`,{params:e})}},W=class extends s{async find(e){return this.post(`${l}/tools/find`,e)}async collect(e){return this.post(`${l}/tools/collect`,e)}async enrich(e){return this.post(`${l}/tools/enrich`,e)}async verify(e){return this.post(`${l}/tools/verify`,e)}async qualify(e){return this.post(`${l}/tools/qualify`,e)}async store(e){return this.post(`${l}/tools/store`,e)}async use(e){return this.post(`${l}/tools/use`,e)}async verifyEmail(e){return this.post(`${l}/tools/verify-email`,{emails:e})}async websiteLookup(e){return this.post(`${l}/tools/website-lookup`,{url:e})}},H=class extends s{async list(){return this.get(`${l}/campaigns`)}async create(e){return this.post(`${l}/campaigns`,e)}async byId(e){return this.get(`${l}/flows/${m(e)}`)}async settings(e){return this.get(`${l}/campaigns/${m(e)}/settings`)}async updateSettings(e,t){return this.patch(`${l}/campaigns/${m(e)}/settings`,t)}async signals(e){return this.get(`${l}/campaigns/${m(e)}/signals`)}async setSignals(e,t){return this.put(`${l}/campaigns/${m(e)}/signals`,t)}},z=class extends s{async start(e){return this.post(`${l}/campaigns/${m(e)}/runs`)}async list(e,t={}){return this.get(`${l}/campaigns/${m(e)}/runs`,{params:t})}async byId(e,t){return this.get(`${l}/campaigns/${m(e)}/runs/${m(t)}`)}async changes(e,t,r={}){return this.get(`${l}/campaigns/${m(e)}/runs/${m(t)}/changes`,{params:r})}async cancel(e,t){return this.post(`${l}/campaigns/${m(e)}/runs/${m(t)}/cancel`)}async quality(e){return this.get(`${l}/jobs/${m(e)}/quality`)}},Q=class extends s{async list(e={}){let o=e,{importedToCrm:t}=o,r=R(o,["importedToCrm"]);return this.get(`${l}/leads`,{params:g(g({},r),t!==void 0&&{importedToCrm:String(t)})})}async byId(e){return this.get(`${l}/leads/${m(e)}`)}async update(e,t){return this.patch(`${l}/leads/${m(e)}`,t)}async notes(e){return this.get(`${l}/leads/${m(e)}/notes`)}async addNote(e,t){return this.post(`${l}/leads/${m(e)}/notes`,t)}async generateKit(e){return this.post(`${l}/leads/${m(e)}/generate-kit`)}async pipelineSummary(){return this.get(`${l}/leads/pipeline-summary`)}async bulkContacted(e,t){return this.post(`${l}/leads/bulk/contacted`,{leadIds:e,channel:t})}async bulkTag(e,t){return this.post(`${l}/leads/bulk/tag`,{leadIds:e,tags:t})}async bulkDelete(e){return this.post(`${l}/leads/bulk/delete`,{leadIds:e})}async bulkExport(e,t="json"){return t==="csv"?this.post(`${l}/leads/bulk/export`,{leadIds:e,format:t},{responseType:"text"}):this.post(`${l}/leads/bulk/export`,{leadIds:e,format:t})}},Y=class extends s{async pipelines(){return this.get(`${l}/import/pipelines`)}async crm(e){return this.post(`${l}/import/crm`,e)}},J=class extends s{async enrich(e){return this.post(`${l}/lists/enrich`,e)}},X=class extends s{async dsr(e){return this.post(`${l}/compliance/dsr`,e)}async report(e={}){return this.get(`${l}/compliance/report`,{params:e})}},Z=class extends s{async map(e={}){return this.get(`${l}/market-map`,{params:e})}async forCampaign(e){return this.get(`${l}/campaigns/${m(e)}/market-map`)}async refresh(e={}){return this.post(`${l}/market-map/refresh`,e)}},ee=class extends s{async weights(e={}){return this.get(`${l}/learning/weights`,{params:e})}async outcomes(e={}){return this.get(`${l}/learning/outcomes`,{params:e})}},te=class extends s{async preview(e){return this.post(`${l}/lookalikes/preview`,e)}async create(e){return this.post(`${l}/lookalikes`,e)}async list(e={}){return this.get(`${l}/lookalikes`,{params:e})}async byId(e){return this.get(`${l}/lookalikes/${m(e)}`)}async rank(e,t={}){return this.get(`${l}/lookalikes/${m(e)}/rank`,{params:t})}},ne=class extends s{async status(){return this.get(`${l}/freshness`)}},re=class extends s{async start(e){return this.post(`${l}/audit`,e)}async byId(e){return this.get(`${l}/audit/${m(e)}`)}};var en=Ae(require("axios"),1);var lt=class extends s{async getUsage(){return this.get("/infra/storage/files/usage")}async createFolder(e){return this.post("/infra/storage/files/folders",{name:e})}async list(e,t){return this.get(`/infra/storage/files/files/${e}`,{params:t})}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,t){let r=await this.post("/infra/storage/files/upload-url",t),{uploadUrl:o,key:a}=r.data;await en.default.put(o,e,{headers:{"Content-Type":t.contentType}});let u=e.size||e.byteLength||0;return this.post("/infra/storage/files/confirm-upload",{key:a,sizeBytes:u})}};var tn={callChanged:"voice_call_changed"},hn=["NOT_FOUND","VOICE_CALL_REFUSED","VOICE_NOT_SET_UP","VOICE_CAMPAIGN_NOT_APPROVED","VOICE_NOT_ENABLED","VOICE_AGENT_UNAVAILABLE","VOICE_RUNTIME_UNAVAILABLE","VOICE_PREVIEW_FAILED","VOICE_NOT_CONFIGURED","LEAD_NOT_FOUND","INSUFFICIENT_CREDITS"];function nn(n){let e=n instanceof y?n.code:void 0;return e&&hn.includes(e)?e:void 0}var Pt={gate:"Voice calling isn't switched on for this workspace.",bad_number:"That phone number isn't a number we can call.",do_not_call:"They asked not to be called again.",dnd:"Their number is on the Do Not Disturb register.",hours:"No calling hours are open for this step.",recently_called:"They were called recently.",promotional:"Promotional calls aren't offered. Calls are for service, reminders, callbacks and demo follow-ups.",no_consent:"No record that they agreed to a phone call, or asked for one. They are not called.",campaign_stopped:"This campaign was stopped.",test_limit:"You can ring your own phone 3 times a day. Try again tomorrow."};function rn(n){var e;return(e=Pt[n])!=null?e:n}var Ie=encodeURIComponent,Pe=class extends s{get flow(){return new I(this.client)}list(e={}){return this.flow.list(e)}retrieve(e){return this.flow.retrieve(e)}create(e){return this.flow.create(e)}launch(e,t={}){return this.flow.launch(e,t)}start(e,t={}){return this.flow.start(e,t)}pause(e){return this.flow.pause(e)}resume(e){return this.flow.resume(e)}stop(e){return this.flow.stop(e)}costPreview(e){return this.get(`/product/flow/campaigns/${Ie(e)}/voice-preview`)}counters(e){return this.get(`/infra/connect/voice/campaigns/${Ie(e)}/counters`)}approval(e){return this.get(`/infra/connect/voice/campaigns/${Ie(e)}/approval`)}requestApproval(e){return this.post(`/infra/connect/voice/campaigns/${Ie(e)}/approval/request`,{})}},se=class extends s{constructor(t){super(t);i(this,"campaigns");this.campaigns=new Pe(t)}status(){return this.get("/infra/connect/voice/status")}agent(){return this.get("/infra/connect/voice/agent")}skills(){return this.get("/infra/connect/voice/skills")}saveAgent(t){return this.put("/infra/connect/voice/agent",t)}async preview(t={}){var r;try{return(await this.client.post("/infra/connect/voice/preview",t,{responseType:"arraybuffer"})).data}catch(o){let a=(r=o==null?void 0:o.response)==null?void 0:r.data;if(a instanceof ArrayBuffer||ArrayBuffer.isView(a))try{o.response.data=JSON.parse(new TextDecoder().decode(a))}catch(u){o.response.data=void 0}throw $(o)}}lines(){return this.get("/infra/connect/voice/lines")}activity(){return this.get("/infra/connect/voice/activity")}calls(t={}){return this.get("/infra/connect/voice/calls",{params:t})}call(t){return this.get(`/infra/connect/voice/calls/${Ie(t)}`)}callWithAI(t){return this.post("/infra/connect/voice/calls",t)}checkCallWithAI(t){return this.post("/infra/connect/voice/calls/check",t)}callMyPhone(t={}){return this.post("/infra/connect/voice/calls/my-phone",t)}testCall(t={}){return this.post("/infra/connect/voice/test-call",t)}};var ie=class extends s{async list(){return this.get("/product/seo/projects")}async create(e){return this.post("/product/seo/projects",e)}async byId(e){return this.get(`/product/seo/projects/${e}`)}async update(e,t){return this.patch(`/product/seo/projects/${e}`,t)}async remove(e){return this.deleteRequest(`/product/seo/projects/${e}`)}async crawl(e){return this.post(`/product/seo/projects/${e}/crawl`)}async crawlCompetitor(e,t){return this.post(`/product/seo/projects/${e}/competitors/crawl`,{domain:t})}},oe=class extends s{async start(e){return this.post("/product/seo/audits",e)}async list(e={}){return this.get("/product/seo/audits",{params:e})}async compare(e){return this.post("/product/seo/audits/compare",e)}async byId(e){return this.get(`/product/seo/audits/${e}`)}async resume(e){return this.post(`/product/seo/audits/${e}/resume`)}async pages(e,t={}){return this.get(`/product/seo/audits/${e}/pages`,{params:t})}async issues(e){return this.get(`/product/seo/audits/${e}/issues`)}async links(e){return this.get(`/product/seo/audits/${e}/links`)}async export(e,t="json"){return this.get(`/product/seo/audits/${e}/export`,{params:{format:t},responseType:"text"})}},ae=class extends s{async keywords(e,t={}){return this.get(`/product/seo/audits/${e}/keywords`,{params:t})}async contentGap(e){return this.post("/product/seo/audits/content-gap",e)}async search(e){return this.post("/product/seo/audits/search",e)}async backlinks(e){return this.get("/product/seo/audits/backlinks",{params:e})}async domain(e){return this.get(`/product/seo/audits/domains/${encodeURIComponent(e)}`)}},ce=class extends s{async check(e){return this.post(`/product/seo/search-console/${e}/check`)}async importNow(e){return this.post(`/product/seo/search-console/${e}/import`)}async status(e){return this.get(`/product/seo/search-console/${e}/status`)}async queries(e,t={}){return this.get(`/product/seo/search-console/${e}/queries`,{params:t})}async pages(e,t={}){return this.get(`/product/seo/search-console/${e}/pages`,{params:t})}async trend(e,t={}){return this.get(`/product/seo/search-console/${e}/trend`,{params:t})}},le=class extends s{async keywords(e){return this.get(`/product/seo/ranks/${e}/keywords`)}async add(e,t,r={}){return this.post(`/product/seo/ranks/${e}/keywords`,g({queries:t},r))}async visibility(e,t={}){return this.get(`/product/seo/ranks/${e}/visibility`,{params:t})}async competitors(e){return this.get(`/product/seo/ranks/${e}/competitors`)}async gap(e,t={}){return this.get(`/product/seo/ranks/${e}/gap`,{params:t})}async remove(e,t){return this.deleteRequest(`/product/seo/ranks/${e}/keywords/${t}`)}async checkNow(e,t){return this.post(`/product/seo/ranks/${e}/keywords/${t}/check`)}async history(e,t,r={}){return this.get(`/product/seo/ranks/${e}/keywords/${t}/history`,{params:r})}async changes(e){return this.get(`/product/seo/ranks/${e}/changes`)}},ue=class extends s{async checkNow(e){return this.post(`/product/seo/local/${e}/check`)}async latest(e){return this.get(`/product/seo/local/${e}`)}async history(e,t={}){return this.get(`/product/seo/local/${e}/history`,{params:t})}async startGrid(e,t={}){return this.post(`/product/seo/local/${e}/grid`,t)}async grid(e){return this.get(`/product/seo/local/${e}/grid`)}async grids(e,t={}){return this.get(`/product/seo/local/${e}/grids`,{params:t})}},pe=class extends s{async byProject(e){return this.get(`/product/seo/reports/${e}`)}async export(e,t="csv"){return this.get(`/product/seo/reports/${e}/export`,{params:{format:t},responseType:"text"})}async pdf(e,t={}){return this.get(`/product/seo/reports/${e}/pdf`,{params:t,responseType:"arraybuffer"})}async generate(e,t={}){return this.post(`/product/seo/reports/${e}/generate`,t)}async history(e,t={}){return this.get(`/product/seo/reports/${e}/history`,{params:t})}async changes(e){return this.get(`/product/seo/reports/${e}/changes`)}},ge=class extends s{async seed(e,t,r="en"){return this.post(`/product/seo/research/${e}/seed`,{seed:t,lang:r})}async fromSearchConsole(e){return this.post(`/product/seo/research/${e}/from-search-console`)}async ideas(e,t={}){return this.get(`/product/seo/research/${e}/ideas`,{params:t})}async analyze(e,t){return this.post(`/product/seo/research/${e}/ideas/${t}/analyze`)}};var de=class extends s{async releases(){return this.get("/product/seo/backlinks/releases")}async strength(e){return this.get("/product/seo/backlinks/strength",{params:{domains:e.join(",")}})}async overview(e){return this.get(`/product/seo/backlinks/${e}`)}async referring(e,t){return this.get(`/product/seo/backlinks/${e}/referring`,{params:t})}async changes(e,t){return this.get(`/product/seo/backlinks/${e}/changes`,{params:t})}},me=class extends s{async checkNow(e){return this.post(`/product/seo/performance/${e}/check`)}async latest(e){return this.get(`/product/seo/performance/${e}`)}async history(e,t={}){return this.get(`/product/seo/performance/${e}/history`,{params:t})}},ye=class extends s{async create(e){return this.post("/product/seo/briefs",e)}async byId(e){return this.get(`/product/seo/briefs/${e}`)}async list(e,t={}){return this.get("/product/seo/briefs",{params:g({projectId:e},t)})}};var bn=35e3,fe=class extends s{async claim(e,t){var o;let r=await this.post("/infra/serp/collector/claim",{collectorId:e,kinds:t},{timeout:bn});return(o=r&&typeof r=="object"?r.data:null)!=null?o:null}async result(e){return this.post("/infra/serp/collector/result",e)}async heartbeat(e,t){return this.post("/infra/serp/collector/heartbeat",g({collectorId:e},t))}};var ut=class extends s{async create(e){return this.post("/infra/storage/files/folders",{name:e})}},pt=class extends s{async list(e,t){return this.get(`/infra/storage/files/files/${e}`,{params:t})}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/files",{params:{key:e}})}};var he=class extends s{async settings(){return this.get("/product/erix/ai/settings")}async updateSettings(e){return this.patch("/product/erix/ai/settings",e)}async outcomes(e={}){return this.get("/product/erix/ai/outcomes",{params:e})}async reviews(e){return this.get(`/product/erix/ai/reviews${e?`?status=${e}`:""}`)}async review(e,t,r){return this.post(`/product/erix/ai/reviews/${encodeURIComponent(e)}`,g({verdict:t},r?{note:r}:{}))}async suggestion(e){return this.get(`/product/erix/ai/suggestion/${e}`)}async approveAction(e){return this.post(`/product/erix/ai/suggestion/${e}/approve-action`,{})}async markSent(e,t,r){return this.post(`/product/erix/ai/suggestion/${e}/send`,{text:t,confidence:r})}async dismiss(e){return this.post(`/product/erix/ai/suggestion/${e}/dismiss`,{})}async approvals(){return this.get("/product/flow/approvals")}async agents(){return this.get("/product/flow/agents")}async agent(e){return this.get(`/product/flow/agents/${encodeURIComponent(e)}`)}async tryAgent(e,t){return this.post(`/product/flow/agents/${encodeURIComponent(e)}/try`,t)}async agentTemplates(){return this.get("/product/flow/agents/templates")}async createAgent(e){return this.post("/product/flow/agents",e)}async updateAgent(e,t){return this.patch(`/product/flow/agents/${encodeURIComponent(e)}`,t)}async deleteAgent(e){return this.deleteRequest(`/product/flow/agents/${encodeURIComponent(e)}`)}async agentAutomation(e,t){return this.post(`/product/flow/agents/${encodeURIComponent(e)}/automation`,{trigger:t})}async decideRun(e,t,r){return this.post(`/product/flow/runs/${encodeURIComponent(e)}/approve`,g({decision:t},r&&{nodeId:r}))}};var gt=class extends s{async system(){return(await this.get("/health")).data}};var dt=class extends s{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")}};var be=class extends s{async global(e){return this.post("/platform/tenants/onboarding/global",e)}async complete(e){return this.post("/platform/tenants/onboarding/complete",e)}};var xe=class extends s{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,t){var o;let r=await super.get(`/platform/tenants/persona/${e}/timeline`,{params:t});return(o=r==null?void 0:r.data)!=null?o:{entries:[],hasMore:!1}}async followups(e){var r,o;let t=await super.get(`/platform/tenants/persona/${e}/followups`);return(o=(r=t==null?void 0:t.data)==null?void 0:r.entries)!=null?o:[]}};var Lt=class extends s{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"}},mt=class{constructor(e){i(this,"copilot");this.copilot=new Lt(e)}};var yt=class extends s{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,t){return this.post(`/platform/auth/invitations/${e}/accept`,t)}};var Et=class extends s{async get(){return super.get("/platform/billing/entitlements/entitlements")}async usage(){return super.get("/platform/billing/entitlements/usage")}},$t=class extends s{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)}},Ot=class extends s{async listPublic(){return this.get("/platform/billing/plans/public")}},Dt=class extends s{async plans(){return this.get("/platform/billing/checkout/plans")}async proration(e,t){return this.get("/platform/billing/checkout/proration",{params:{planId:e,billingCycle:t}})}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)}},Vt=class extends s{async transactions(){return this.get("/platform/billing/user/transactions")}async transactionInvoice(e){return this.get(`/platform/billing/user/transactions/${encodeURIComponent(e)}/invoice`)}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")}},Ft=class extends s{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)}},ft=class{constructor(e){i(this,"entitlements");i(this,"subscriptions");i(this,"plans");i(this,"checkout");i(this,"user");i(this,"credits");this.entitlements=new Et(e),this.subscriptions=new $t(e),this.plans=new Ot(e),this.checkout=new Dt(e),this.user=new Vt(e),this.credits=new Ft(e)}};var ke=class extends s{async list(){return this.get("/platform/public/catalog",{ignoreClientCode:!0})}};var sn=["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/plain","text/markdown","text/csv","text/html","image/png","image/jpeg","image/webp"],Ce=class extends s{async list(){return this.get("/platform/knowledge/sources")}async addText(e){return this.post("/platform/knowledge/sources",g({kind:"text"},e))}async addUrl(e){return this.post("/platform/knowledge/sources",g({kind:"url"},e))}async addWebsite(e){return this.post("/platform/knowledge/sources",{type:"website",url:e.url})}async addFile(e,t={}){var o,a;let r=await new K(this.client).upload(e,{folder:"knowledge"});return this.post("/platform/knowledge/sources",{kind:"file",key:r.key,mimeType:r.mimeType,title:(a=(o=t.title)!=null?o:r.fileName)!=null?a:"Document"})}async remove(e){return this.deleteRequest(`/platform/knowledge/sources/${e}`)}async reindex(e){return this.post(`/platform/knowledge/sources/${e}/reindex`,{})}async search(e,t){return this.post("/platform/knowledge/search",g({query:e},t?{limit:t}:{}))}};var ht=class extends s{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,t){return this.post(`/platform/support/tickets/${e}/reply`,t)}async close(e){return this.patch(`/platform/support/tickets/${e}/close`,{})}async channelSetup(e){return this.get(`/platform/support/channel-requests/${encodeURIComponent(e)}/setup`)}};var bt=class extends s{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",{})}},xt=class extends s{async list(){return this.get("/platform/users/members")}async access(){return this.get("/platform/users/members/access")}async invite(e){return this.post("/platform/users/members/invite",e)}async updateAccess(e,t){return this.patch(`/platform/users/members/${encodeURIComponent(e)}`,t)}async updateRole(e,t){return this.updateAccess(e,{role:t})}async remove(e){return this.deleteRequest(`/platform/users/members/${encodeURIComponent(e)}`)}async invitations(){return this.get("/platform/users/members/invitations")}async resendInvitation(e){return this.post(`/platform/users/members/invitations/${encodeURIComponent(e)}/resend`,{})}async revokeInvitation(e){return this.deleteRequest(`/platform/users/members/invitations/${encodeURIComponent(e)}`)}},kt=class extends s{async list(){return this.get("/platform/auth/sessions")}async revoke(e){return this.deleteRequest(`/platform/auth/sessions/${e}`)}};var Le=class{constructor(e){i(this,"messages");i(this,"conversations");this.messages=new K(e),this.conversations=new rt(e)}},Ee=class{constructor(e){i(this,"leads");i(this,"pipelines");i(this,"activities");i(this,"analytics");i(this,"scoring");i(this,"payments");i(this,"chat");i(this,"events");i(this,"invoices");i(this,"checkout");i(this,"projects");i(this,"niche");i(this,"documents");i(this,"invoiceExport");i(this,"ai");this.leads=new Qe(e),this.pipelines=new Je(e),this.activities=new Ge(e),this.analytics=new We(e),this.scoring=new Xe(e),this.payments=new Ye(e),this.chat=new Le(e),this.events=new Ze(e),this.invoices=new et(e),this.checkout=new je(e),this.projects=new nt(e),this.niche=new tt(e),this.documents=new He(e),this.invoiceExport=new ze(e),this.ai=new he(e)}},$e=class{constructor(e){i(this,"automations");i(this,"campaigns");i(this,"conversations");i(this,"home");i(this,"drafts");i(this,"firstRun");i(this,"audiences");this.automations=new F(e),this.campaigns=new I(e),this.conversations=new U(e),this.home=new _(e),this.drafts=new N(e),this.firstRun=new B(e),this.audiences=new q(e)}},Oe=class{constructor(e){i(this,"projects");i(this,"audits");i(this,"insights");i(this,"searchConsole");i(this,"ranks");i(this,"local");i(this,"reports");i(this,"backlinks");i(this,"performance");i(this,"briefs");i(this,"research");this.projects=new ie(e),this.audits=new oe(e),this.insights=new ae(e),this.searchConsole=new ce(e),this.ranks=new le(e),this.local=new ue(e),this.reports=new pe(e),this.backlinks=new de(e),this.performance=new me(e),this.briefs=new ye(e),this.research=new ge(e)}},De=class{constructor(e){i(this,"packs");i(this,"signals");i(this,"tools");i(this,"campaigns");i(this,"runs");i(this,"leads");i(this,"import");i(this,"lists");i(this,"compliance");i(this,"market");i(this,"learning");i(this,"lookalikes");i(this,"freshness");i(this,"audit");this.packs=new j(e),this.signals=new G(e),this.tools=new W(e),this.campaigns=new H(e),this.runs=new z(e),this.leads=new Q(e),this.import=new Y(e),this.lists=new J(e),this.compliance=new X(e),this.market=new Z(e),this.learning=new ee(e),this.lookalikes=new te(e),this.freshness=new ne(e),this.audit=new re(e)}},we=class{constructor(e){i(this,"erix");i(this,"flow");i(this,"seo");i(this,"laie");this.erix=new Ee(e),this.flow=new $e(e),this.seo=new Oe(e),this.laie=new De(e)}},Ve=class{constructor(e){i(this,"config");i(this,"templates");this.config=new at(e),this.templates=new it(e)}},Fe=class{constructor(e){i(this,"templates");this.templates=new ct(e)}},Me=class{constructor(e){i(this,"email");i(this,"whatsapp");i(this,"meet");i(this,"connections");i(this,"voice");this.email=new Ve(e),this.whatsapp=new Fe(e),this.meet=new ot(e),this.connections=new st(e),this.voice=new se(e)}},Ue=class{constructor(e){i(this,"files");i(this,"folders");i(this,"media");this.files=new pt(e),this.folders=new ut(e),this.media=new lt(e)}},Mt=class{constructor(e){i(this,"collector");this.collector=new fe(e)}},Te=class{constructor(e){i(this,"connect");i(this,"storage");i(this,"serp");this.connect=new Me(e),this.storage=new Ue(e),this.serp=new Mt(e)}},_e=class{constructor(e){i(this,"onboarding");i(this,"persona");this.onboarding=new be(e),this.persona=new xe(e)}},Ne=class{constructor(e){i(this,"me");i(this,"members");i(this,"sessions");i(this,"notifications");this.me=new bt(e),this.members=new xt(e),this.sessions=new kt(e),this.notifications=new dt(e)}},ve=class{constructor(e){i(this,"auth");i(this,"users");i(this,"tenants");i(this,"billing");i(this,"support");i(this,"ai");i(this,"knowledge");i(this,"health");i(this,"catalog");this.auth=new yt(e),this.users=new Ne(e),this.tenants=new _e(e),this.billing=new ft(e),this.support=new ht(e),this.ai=new mt(e),this.knowledge=new Ce(e),this.health=new gt(e),this.catalog=new ke(e)}};var P=class extends y{constructor(e){super(e,400,"invalid_signature"),this.name="WebhookSignatureError"}},Se=class{async constructEvent(e,t,r){if(!t)throw new P("No webhook signature provided");let o=Array.isArray(t)?t[0]:t;o.startsWith("sha256=")&&(o=o.slice(7));try{let a=await import("crypto"),d=a.createHmac("sha256",r).update(e).digest("hex");if(!a.timingSafeEqual(Buffer.from(d),Buffer.from(o)))throw new P("Invalid webhook signature provided");return JSON.parse(e.toString("utf8"))}catch(a){throw a instanceof P?a:new P(`Webhook payload parsing failed: ${a.message}`)}}};var Ut=typeof process!="undefined"&&"4.0.0"||"3.1.1";var on,_t=(on=Nt.default.default)!=null?on:Nt.default,O=class{constructor(e){i(this,"client");i(this,"socket",null);i(this,"startSocket",null);i(this,"socketPromise",null);i(this,"socketQueue",[]);i(this,"clientCode");i(this,"apiVersion");i(this,"platform");i(this,"product");i(this,"infra");i(this,"webhooks");i(this,"lastSeq");i(this,"closed",!1);var f,v,L,D,b,qt,Kt,jt;let t=e.proxy;if(!e.apiKey&&!t)throw new T("API Key is required");this.clientCode=(f=e.clientCode)==null?void 0:f.toUpperCase(),this.apiVersion=(v=e.version)!=null?v:"v1";let r=(L=e.baseUrl)!=null?L:vt,o=Jt(this.apiVersion,(D=t==null?void 0:t.url)!=null?D:r),a=e.socketUrl||r,u=typeof window!="undefined"&&typeof window.document!="undefined",d=u?"browser":typeof process!="undefined"?`node ${process.version}`:"unknown",p=u?((b=globalThis.navigator)==null?void 0:b.userAgent)||"browser":typeof process!="undefined"?process.platform:"unknown",k=E(g({},t?{}:{"x-api-key":e.apiKey,"x-client-code":((qt=e.clientCode)==null?void 0:qt.toUpperCase())||""}),{"Content-Type":"application/json","x-ecodrix-client-agent":JSON.stringify({sdk_version:Ut,runtime:d,os:p})});if(this.client=an.default.create({baseURL:o,headers:k,timeout:(Kt=e.timeout)!=null?Kt:3e4}),_t(this.client,{retries:3,retryDelay:_t.exponentialDelay,retryCondition:w=>{var Be;return _t.isNetworkOrIdempotentRequestError(w)||((Be=w.response)==null?void 0:Be.status)===429},onRetry:(w,Be,Gt)=>{var Wt,Ht;typeof process!="undefined"&&((Wt=process.env)==null?void 0:Wt.NODE_ENV)==="development"&&console.warn(`[ECODrIx SDK] Retrying request (${w}/3): ${(Ht=Gt.method)==null?void 0:Ht.toUpperCase()} ${Gt.url}. Reason: ${Be.message}`)}}),this.platform=new ve(this.client),this.product=new we(this.client),this.infra=new Te(this.client),this.webhooks=new Se,t){if(t.ticket){let w=t.ticket;this.startSocket=()=>this.initSocket(a,async()=>({ticket:await w()}))}}else{let w={apiKey:e.apiKey,clientCode:((jt=e.clientCode)==null?void 0:jt.toUpperCase())||""};this.startSocket=()=>this.initSocket(a,async()=>w,{"x-api-key":w.apiKey,"x-client-code":w.clientCode})}if(u){let w={version:Ut,clientCode:e.clientCode,initializedAt:new Date().toISOString()};window.__ECODRIX_SDK__=w}}initSocket(e,t,r){return this.socketPromise?this.socketPromise:(this.socketPromise=import("socket.io-client").then(({io:o})=>{this.socket=o(e,{auth:a=>{t().then(u=>a(E(g({},u),{lastSeq:this.lastSeq})),()=>a({lastSeq:this.lastSeq}))},extraHeaders:r}),this.setupSocket();for(let{type:a,args:u}of this.socketQueue)a==="joinRoom"?this.socket.emit("join-room",u[0]):a==="leaveRoom"?this.socket.emit("leave-room",u[0]):a==="on"?this.socket.on(u[0],u[1]):a==="off"?this.socket.off(u[0],u[1]):a==="disconnect"&&this.socket.disconnect();this.socketQueue=[]}),this.socketPromise)}joinRoom(e){var t;this.closed||(t=this.startSocket)==null||t.call(this),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(){this.socket&&(this.socket.on("connect_error",()=>{var e;(e=this.socket)!=null&&e.active||setTimeout(()=>{var t;this.closed||(t=this.socket)==null||t.connect()},5e3)}),this.socket.onAny((...e)=>{var r,o;let t=(r=e.at(-1))==null?void 0:r.seq;typeof t=="number"&&t>((o=this.lastSeq)!=null?o:0)&&(this.lastSeq=t)}))}on(e,t){var r;return this.closed||(r=this.startSocket)==null||r.call(this),this.socket?this.socket.on(e,t):this.socketQueue.push({type:"on",args:[e,t]}),this}disconnect(){this.closed=!0,this.socket?this.socket.disconnect():this.socketPromise&&this.socketQueue.push({type:"disconnect",args:[]})}off(e,t){return this.socket?this.socket.off(e,t):this.socketQueue.push({type:"off",args:[e,t]}),this}async request(e,t,r,o){var a,u,d;try{return(await this.client.request({method:e,url:t,data:r,params:o})).data}catch(p){throw p.response?new y(((a=p.response.data)==null?void 0:a.message)||((u=p.response.data)==null?void 0:u.error)||"Raw Execution Failed",p.response.status,(d=p.response.data)==null?void 0:d.code):new y(p.message||"Network Error")}}};var kn={401:T,403:V,429:A};function Cn(n){throw $(n)}function wn(n,e){return n instanceof e}function Tn(n){return n instanceof T?{message:n.message,status:n.status,code:n.code,type:"AuthenticationError"}:n instanceof A?{message:n.message,status:n.status,code:n.code,type:"RateLimitError"}:n instanceof y?{message:n.message,status:n.status,code:n.code,type:"APIError"}:{message:n.message||"Unknown error",type:"UnknownError"}}var Bt={[T.name]:{shouldRetry:!1,reason:"Authentication errors require fixing credentials, not retrying"},[A.name]:{shouldRetry:!0,maxRetries:3,baseDelay:1e3,backoffMultiplier:2,reason:"Rate limit errors can be retried with exponential backoff"},[y.name]:{shouldRetry:!0,maxRetries:2,baseDelay:500,backoffMultiplier:1.5,reason:"Generic API errors may be transient and worth retrying"}};function vn(n){let e=n.constructor.name;return Bt[e]||Bt[y.name]}var Sn=O;0&&(module.exports={APIError,APIResource,AiAgent,AuthenticationError,Campaigns,Catalog,Collector,ConnectInfra,ECODrIx,ECODrIxAPI,ERROR_RETRY_CONFIG,EcodrixError,EmailConnect,ErixChat,ErixProduct,FlowAudiences,FlowAutomations,FlowConversations,FlowDrafts,FlowFirstRunResource,FlowHome,FlowProduct,HTTP_STATUS_ERROR_MAP,InfraDomain,KNOWLEDGE_FILE_TYPES,Knowledge,LAIE_EVENTS,LEAD_STATUS_VALUES,LaieAudits,LaieCampaigns,LaieCompliance,LaieFreshness,LaieImport,LaieLeads,LaieLearning,LaieLists,LaieLookalikes,LaieMarket,LaiePacks,LaieProduct,LaieRuns,LaieSignals,LaieTools,Onboarding,PermissionError,Persona,PlatformDomain,PlatformTenants,PlatformUsers,ProductDomain,RateLimitError,SeoAudits,SeoBacklinks,SeoBriefs,SeoInsights,SeoLocal,SeoPerformance,SeoProduct,SeoProjects,SeoRanks,SeoReports,SeoResearch,SeoSearchConsole,StorageInfra,VOICE_EVENTS,VOICE_REFUSAL_REASONS,Voice,VoiceCampaigns,WebhookSignatureError,Webhooks,WhatsAppConnect,getErrorDetails,getRetryConfig,handleAPIError,isAPIError,laieStageQueued,toAPIError,voiceErrorCode,voiceRefusalReason});
|