@corsair-dev/hubspot 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/endpoints/index.d.ts +371 -1960
- package/dist/endpoints/index.d.ts.map +1 -1
- package/dist/endpoints/types.d.ts +418 -6848
- package/dist/endpoints/types.d.ts.map +1 -1
- package/dist/index.d.ts +551 -6981
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/schema/database.d.ts +14 -116
- package/dist/schema/database.d.ts.map +1 -1
- package/dist/schema/index.d.ts +15 -121
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/webhooks/index.d.ts +28 -28
- package/dist/webhooks/types.d.ts +26 -600
- package/dist/webhooks/types.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,aAAa,EACb,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,uBAAuB,EAGvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACX,qBAAqB,EACrB,sBAAsB,EACtB,MAAM,aAAa,CAAC;AAcrB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EACX,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB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B,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,GACtB,MAAM,kBAAkB,CAAC;AAM1B,YAAY,EACX,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EAClB,wBAAwB,EACxB,6BAA6B,EAC7B,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,6BAA6B,EAC7B,6BAA6B,EAC7B,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,GACpB,MAAM,mBAAmB,CAAC;AAM3B,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,aAAa,EACb,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,uBAAuB,EAGvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACX,qBAAqB,EACrB,sBAAsB,EACtB,MAAM,aAAa,CAAC;AAcrB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EACX,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAA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ACtB,kBAAkB,EAClB,sBAAsB,GACtB,MAAM,kBAAkB,CAAC;AAM1B,YAAY,EACX,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EAClB,wBAAwB,EACxB,6BAA6B,EAC7B,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,6BAA6B,EAC7B,6BAA6B,EAC7B,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,GACpB,MAAM,mBAAmB,CAAC;AAM3B,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as u}from"zod";import{logEventFromContext as E}from"corsair/core";import{request as pt}from"corsair/http";var v=class extends Error{constructor(s,r){super(s);this.code=r;this.name="HubSpotAPIError"}},it="https://api.hubapi.com";async function d(t,a,s={}){let{method:r="GET",body:n,query:o}=s,p={BASE:it,VERSION:"1.0.0",WITH_CREDENTIALS:!1,CREDENTIALS:"omit",TOKEN:a,HEADERS:{"Content-Type":"application/json"}},B={method:r,url:t,body:r==="POST"||r==="PUT"||r==="PATCH"?n:void 0,mediaType:"application/json",query:r==="GET"?o:void 0};try{return await pt(p,B)}catch(g){throw g&&typeof g=="object"&&"status"in g&&typeof g.status=="number"?new v(g instanceof Error?g.message:"HubSpot API error",g.status):new v(g instanceof Error?g.message:"Unknown error")}}var ae=async(t,a)=>{let{companyId:s,...r}=a,n=`/crm/v3/objects/companies/${s}`,o=await d(n,t.key,{query:{...r,properties:r.properties?.join(","),propertiesWithHistory:r.propertiesWithHistory?.join(","),associations:r.associations?.join(",")}});if(o&&t.db.companies)try{await t.db.companies.upsertByEntityId(o.id,o)}catch(p){console.warn("Failed to save company to database:",p)}return await E(t,"hubspot.companies.get",{...a},"completed"),o},ne=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/companies",t.key,{query:{...s,properties:s.properties?.join(","),propertiesWithHistory:s.propertiesWithHistory?.join(","),associations:s.associations?.join(",")}});if(n.results&&t.db.companies)try{for(let o of n.results)await t.db.companies.upsertByEntityId(o.id,o)}catch(o){console.warn("Failed to save companies to database:",o)}return await E(t,"hubspot.companies.getMany",{...a},"completed"),n},se=async(t,a)=>{let{...s}=a,n=await d("/crm/v3/objects/companies",t.key,{method:"POST",body:s});if(n&&t.db.companies)try{await t.db.companies.upsertByEntityId(n.id,n)}catch(o){console.warn("Failed to save company to database:",o)}return await E(t,"hubspot.companies.create",{...a},"completed"),n},re=async(t,a)=>{let{companyId:s,...r}=a,n=`/crm/v3/objects/companies/${s}`,o=await d(n,t.key,{method:"PATCH",body:r});if(o&&t.db.companies)try{await t.db.companies.upsertByEntityId(o.id,o)}catch(p){console.warn("Failed to save company to database:",p)}return await E(t,"hubspot.companies.update",{...a},"completed"),o},pe=async(t,a)=>{let{companyId:s}=a,r=`/crm/v3/objects/companies/${s}`;if(await d(r,t.key,{method:"DELETE"}),t.db.companies)try{await t.db.companies.deleteByEntityId(s)}catch(n){console.warn("Failed to delete company from database:",n)}await E(t,"hubspot.companies.delete",{...a},"completed")},ie=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/companies",t.key,{query:s});if(n.results&&t.db.companies)try{for(let o of n.results)await t.db.companies.upsertByEntityId(o.id,o)}catch(o){console.warn("Failed to save companies to database:",o)}return await E(t,"hubspot.companies.getRecentlyCreated",{...a},"completed"),n},ce=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/companies",t.key,{query:s});if(n.results&&t.db.companies)try{for(let o of n.results)await t.db.companies.upsertByEntityId(o.id,o)}catch(o){console.warn("Failed to save companies to database:",o)}return await E(t,"hubspot.companies.getRecentlyUpdated",{...a},"completed"),n},de=async(t,a)=>{let{domain:s,...r}=a,o=await d("/crm/v3/objects/companies/search",t.key,{query:{...r,domain:s,properties:r.properties?.join(",")}});return await E(t,"hubspot.companies.searchByDomain",{...a},"completed"),o};import{logEventFromContext as le}from"corsair/core";var ye=async(t,a)=>{let{listId:s,...r}=a,n=`/contacts/v1/lists/${s}/add`,o=await d(n,t.key,{method:"POST",body:r});return await le(t,"hubspot.contactLists.addContact",{...a},"completed"),o},ue=async(t,a)=>{let{listId:s,...r}=a,n=`/contacts/v1/lists/${s}/remove`,o=await d(n,t.key,{method:"POST",body:r});return await le(t,"hubspot.contactLists.removeContact",{...a},"completed"),o};import{logEventFromContext as H}from"corsair/core";var me=async(t,a)=>{let{contactId:s,...r}=a,n=`/crm/v3/objects/contacts/${s}`,o=await d(n,t.key,{query:{...r,properties:r.properties?.join(","),propertiesWithHistory:r.propertiesWithHistory?.join(","),associations:r.associations?.join(",")}});if(o&&t.db.contacts)try{await t.db.contacts.upsertByEntityId(o.id,o)}catch(p){console.warn("Failed to save contact to database:",p)}return await H(t,"hubspot.contacts.get",{...a},"completed"),o},be=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/contacts",t.key,{query:{...s,properties:s.properties?.join(","),propertiesWithHistory:s.propertiesWithHistory?.join(","),associations:s.associations?.join(",")}});if(n.results&&t.db.contacts)try{for(let o of n.results)await t.db.contacts.upsertByEntityId(o.id,o)}catch(o){console.warn("Failed to save contacts to database:",o)}return await H(t,"hubspot.contacts.getMany",{...a},"completed"),n},ge=async(t,a)=>{let{...s}=a,n=await d("/crm/v3/objects/contacts",t.key,{method:"POST",body:s});if(n&&t.db.contacts)try{await t.db.contacts.upsertByEntityId(n.id,n)}catch(o){console.warn("Failed to save contact to database:",o)}return await H(t,"hubspot.contacts.createOrUpdate",{...a},"completed"),n},he=async(t,a)=>{let{contactId:s}=a,r=`/crm/v3/objects/contacts/${s}`;if(await d(r,t.key,{method:"DELETE"}),t.db.contacts)try{await t.db.contacts.deleteByEntityId(s)}catch(n){console.warn("Failed to delete contact from database:",n)}await H(t,"hubspot.contacts.delete",{...a},"completed")},Se=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/contacts",t.key,{query:s});return await H(t,"hubspot.contacts.getRecentlyCreated",{...a},"completed"),n},Ce=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/contacts",t.key,{query:s});return await H(t,"hubspot.contacts.getRecentlyUpdated",{...a},"completed"),n},Ee=async(t,a)=>{let{...s}=a,n=await d("/crm/v3/objects/contacts/search",t.key,{method:"POST",body:s});return await H(t,"hubspot.contacts.search",{...a},"completed"),n};import{logEventFromContext as k}from"corsair/core";var ke=async(t,a)=>{let{dealId:s,...r}=a,n=`/crm/v3/objects/deals/${s}`,o=await d(n,t.key,{query:{...r,properties:r.properties?.join(","),propertiesWithHistory:r.propertiesWithHistory?.join(","),associations:r.associations?.join(",")}});if(o&&t.db.deals)try{await t.db.deals.upsertByEntityId(o.id,o)}catch(p){console.warn("Failed to save deal to database:",p)}return await k(t,"hubspot.deals.get",{...a},"completed"),o},fe=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/deals",t.key,{query:{...s,properties:s.properties?.join(","),propertiesWithHistory:s.propertiesWithHistory?.join(","),associations:s.associations?.join(",")}});if(n.results&&t.db.deals)try{for(let o of n.results)await t.db.deals.upsertByEntityId(o.id,o)}catch(o){console.warn("Failed to save deals to database:",o)}return await k(t,"hubspot.deals.getMany",{...a},"completed"),n},ve=async(t,a)=>{let{...s}=a,n=await d("/crm/v3/objects/deals",t.key,{method:"POST",body:s});if(n&&t.db.deals)try{await t.db.deals.upsertByEntityId(n.id,n)}catch(o){console.warn("Failed to save deal to database:",o)}return await k(t,"hubspot.deals.create",{...a},"completed"),n},He=async(t,a)=>{let{dealId:s,...r}=a,n=`/crm/v3/objects/deals/${s}`,o=await d(n,t.key,{method:"PATCH",body:r});if(o&&t.db.deals)try{await t.db.deals.upsertByEntityId(o.id,o)}catch(p){console.warn("Failed to update deal in database:",p)}return await k(t,"hubspot.deals.update",{...a},"completed"),o},Re=async(t,a)=>{let{dealId:s}=a,r=`/crm/v3/objects/deals/${s}`;if(await d(r,t.key,{method:"DELETE"}),t.db.deals)try{await t.db.deals.deleteByEntityId(s)}catch(n){console.warn("Failed to delete deal from database:",n)}await k(t,"hubspot.deals.delete",{...a},"completed")},we=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/deals",t.key,{query:s});return await k(t,"hubspot.deals.getRecentlyCreated",{...a},"completed"),n},Ie=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/deals",t.key,{query:s});return await k(t,"hubspot.deals.getRecentlyUpdated",{...a},"completed"),n},De=async(t,a)=>{let{...s}=a,n=await d("/crm/v3/objects/deals/search",t.key,{method:"POST",body:s});return await k(t,"hubspot.deals.search",{...a},"completed"),n};import{logEventFromContext as G}from"corsair/core";var Te=async(t,a)=>{let{engagementId:s}=a,r=`/crm/v3/objects/engagements/${s}`,n=await d(r,t.key);if(n&&t.db.engagements)try{await t.db.engagements.upsertByEntityId(n.id,{...n})}catch(o){console.warn("Failed to save engagement to database:",o)}return await G(t,"hubspot.engagements.get",{...a},"completed"),n},je=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/engagements",t.key,{query:s});if(n.results&&t.db.engagements)try{for(let o of n.results)await t.db.engagements.upsertByEntityId(o.id,{...o})}catch(o){console.warn("Failed to save engagements to database:",o)}return await G(t,"hubspot.engagements.getMany",{...a},"completed"),n},Ge=async(t,a)=>{let{...s}=a,n=await d("/crm/v3/objects/engagements",t.key,{method:"POST",body:s});if(n&&t.db.engagements)try{await t.db.engagements.upsertByEntityId(n.id,{...n})}catch(o){console.warn("Failed to save engagement to database:",o)}return await G(t,"hubspot.engagements.create",{...a},"completed"),n},Ue=async(t,a)=>{let{engagementId:s}=a,r=`/crm/v3/objects/engagements/${s}`;if(await d(r,t.key,{method:"DELETE"}),t.db.engagements)try{await t.db.engagements.deleteByEntityId(s)}catch(n){console.warn("Failed to delete engagement from database:",n)}await G(t,"hubspot.engagements.delete",{...a},"completed")};import{logEventFromContext as w}from"corsair/core";var Ae=async(t,a)=>{let{ticketId:s,...r}=a,n=`/crm/v3/objects/tickets/${s}`,o=await d(n,t.key,{query:{...r,properties:r.properties?.join(","),propertiesWithHistory:r.propertiesWithHistory?.join(","),associations:r.associations?.join(",")}});if(o&&t.db.tickets)try{await t.db.tickets.upsertByEntityId(o.id,o)}catch(p){console.warn("Failed to save ticket to database:",p)}return await w(t,"hubspot.tickets.get",{...a},"completed"),o},Me=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/tickets",t.key,{query:{...s,properties:s.properties?.join(","),propertiesWithHistory:s.propertiesWithHistory?.join(","),associations:s.associations?.join(",")}});if(n.results&&t.db.tickets)try{for(let o of n.results)await t.db.tickets.upsertByEntityId(o.id,o)}catch(o){console.warn("Failed to save tickets to database:",o)}return await w(t,"hubspot.tickets.getMany",{...a},"completed"),n},We=async(t,a)=>{let{...s}=a,n=await d("/crm/v3/objects/tickets",t.key,{method:"POST",body:s});if(n&&t.db.tickets)try{await t.db.tickets.upsertByEntityId(n.id,n)}catch(o){console.warn("Failed to save ticket to database:",o)}return await w(t,"hubspot.tickets.create",{...a},"completed"),n},xe=async(t,a)=>{let{ticketId:s,...r}=a,n=`/crm/v3/objects/tickets/${s}`,o=await d(n,t.key,{method:"PATCH",body:r});if(o&&t.db.tickets)try{await t.db.tickets.upsertByEntityId(o.id,o)}catch(p){console.warn("Failed to update ticket in database:",p)}return await w(t,"hubspot.tickets.update",{...a},"completed"),o},Oe=async(t,a)=>{let{ticketId:s}=a,r=`/crm/v3/objects/tickets/${s}`;if(await d(r,t.key,{method:"DELETE"}),t.db.tickets)try{await t.db.tickets.deleteByEntityId(s)}catch(n){console.warn("Failed to delete ticket from database:",n)}await w(t,"hubspot.tickets.delete",{...a},"completed")};import{z as e}from"zod";var bt=e.object({contactId:e.string(),properties:e.array(e.string()).optional(),propertiesWithHistory:e.array(e.string()).optional(),associations:e.array(e.string()).optional(),archived:e.boolean().optional(),idProperty:e.string().optional()}),gt=e.object({limit:e.number().optional(),after:e.string().optional(),properties:e.array(e.string()).optional(),propertiesWithHistory:e.array(e.string()).optional(),associations:e.array(e.string()).optional(),archived:e.boolean().optional()}),ht=e.object({properties:e.record(e.string(),e.string()).optional(),associations:e.array(e.object({to:e.object({id:e.string()}),types:e.array(e.object({associationCategory:e.string(),associationTypeId:e.number()}))})).optional()}),St=e.object({contactId:e.string()}),Ct=e.object({count:e.number().optional(),after:e.string().optional(),since:e.string().optional()}),Et=e.object({count:e.number().optional(),after:e.string().optional(),since:e.string().optional()}),kt=e.enum(["BETWEEN","CONTAINS_TOKEN","EQ","GT","GTE","HAS_PROPERTY","IN","LT","LTE","NEQ","NOT_CONTAINS_TOKEN","NOT_HAS_PROPERTY","NOT_IN"]),ft=e.object({operator:kt,propertyName:e.string(),highValue:e.string().optional(),value:e.string().optional(),values:e.array(e.string()).optional()}),Le=e.object({filters:e.array(ft)}),vt=e.object({id:e.string(),type:e.string().optional()}),Ht=e.object({results:e.array(vt)}),D=e.record(e.string(),e.union([Ht,e.array(e.string())])),Rt=e.object({query:e.string().optional(),limit:e.number().optional(),after:e.string().optional(),sorts:e.array(e.string()).optional(),properties:e.array(e.string()).optional(),filterGroups:e.array(Le).optional()}),wt=e.object({companyId:e.string(),properties:e.array(e.string()).optional(),propertiesWithHistory:e.array(e.string()).optional(),associations:e.array(e.string()).optional(),archived:e.boolean().optional(),idProperty:e.string().optional()}),It=e.object({limit:e.number().optional(),after:e.string().optional(),properties:e.array(e.string()).optional(),propertiesWithHistory:e.array(e.string()).optional(),associations:e.array(e.string()).optional(),archived:e.boolean().optional()}),Dt=e.object({properties:e.record(e.string(),e.string()).optional(),associations:e.array(e.object({to:e.object({id:e.string()}),types:e.array(e.object({associationCategory:e.string(),associationTypeId:e.number()}))})).optional()}),Tt=e.object({companyId:e.string(),properties:e.record(e.string(),e.string()).optional()}),jt=e.object({companyId:e.string()}),Gt=e.object({count:e.number().optional(),after:e.string().optional(),since:e.string().optional()}),Ut=e.object({count:e.number().optional(),after:e.string().optional(),since:e.string().optional()}),At=e.object({domain:e.string(),properties:e.array(e.string()).optional()}),Mt=e.object({dealId:e.string(),properties:e.array(e.string()).optional(),propertiesWithHistory:e.array(e.string()).optional(),associations:e.array(e.string()).optional(),archived:e.boolean().optional(),idProperty:e.string().optional()}),Wt=e.object({limit:e.number().optional(),after:e.string().optional(),properties:e.array(e.string()).optional(),propertiesWithHistory:e.array(e.string()).optional(),associations:e.array(e.string()).optional(),archived:e.boolean().optional()}),xt=e.object({properties:e.record(e.string(),e.string()).optional(),associations:e.array(e.object({to:e.object({id:e.string()}),types:e.array(e.object({associationCategory:e.string(),associationTypeId:e.number()}))})).optional()}),Ot=e.object({dealId:e.string(),properties:e.record(e.string(),e.string()).optional()}),Pt=e.object({dealId:e.string()}),Lt=e.object({count:e.number().optional(),after:e.string().optional(),since:e.string().optional()}),Bt=e.object({count:e.number().optional(),after:e.string().optional(),since:e.string().optional()}),Ft=e.object({query:e.string().optional(),limit:e.number().optional(),after:e.string().optional(),sorts:e.array(e.string()).optional(),properties:e.array(e.string()).optional(),filterGroups:e.array(Le).optional()}),zt=e.object({ticketId:e.string(),properties:e.array(e.string()).optional(),propertiesWithHistory:e.array(e.string()).optional(),associations:e.array(e.string()).optional(),archived:e.boolean().optional(),idProperty:e.string().optional()}),Nt=e.object({limit:e.number().optional(),after:e.string().optional(),properties:e.array(e.string()).optional(),propertiesWithHistory:e.array(e.string()).optional(),associations:e.array(e.string()).optional(),archived:e.boolean().optional()}),Vt=e.object({properties:e.record(e.string(),e.string()).optional(),associations:e.array(e.object({to:e.object({id:e.string()}),types:e.array(e.object({associationCategory:e.string(),associationTypeId:e.number()}))})).optional()}),_t=e.object({ticketId:e.string(),properties:e.record(e.string(),e.string()).optional()}),qt=e.object({ticketId:e.string()}),$t=e.object({engagementId:e.string()}),Kt=e.object({limit:e.number().optional(),after:e.string().optional()}),Qt=e.object({engagement:e.object({active:e.boolean().optional(),type:e.string(),timestamp:e.number().optional()}),associations:e.object({contactIds:e.array(e.number()).optional(),companyIds:e.array(e.number()).optional(),dealIds:e.array(e.number()).optional(),ownerIds:e.array(e.number()).optional()}).optional(),metadata:e.record(e.any()).optional()}),Yt=e.object({engagementId:e.string()}),Jt=e.object({listId:e.string(),emails:e.array(e.string()).optional(),vids:e.array(e.number()).optional()}),Xt=e.object({listId:e.string(),emails:e.array(e.string()).optional(),vids:e.array(e.number()).optional()}),l={contactsGet:bt,contactsGetMany:gt,contactsCreateOrUpdate:ht,contactsDelete:St,contactsGetRecentlyCreated:Ct,contactsGetRecentlyUpdated:Et,contactsSearch:Rt,companiesGet:wt,companiesGetMany:It,companiesCreate:Dt,companiesUpdate:Tt,companiesDelete:jt,companiesGetRecentlyCreated:Gt,companiesGetRecentlyUpdated:Ut,companiesSearchByDomain:At,dealsGet:Mt,dealsGetMany:Wt,dealsCreate:xt,dealsUpdate:Ot,dealsDelete:Pt,dealsGetRecentlyCreated:Lt,dealsGetRecentlyUpdated:Bt,dealsSearch:Ft,ticketsGet:zt,ticketsGetMany:Nt,ticketsCreate:Vt,ticketsUpdate:_t,ticketsDelete:qt,engagementsGet:$t,engagementsGetMany:Kt,engagementsCreate:Qt,engagementsDelete:Yt,contactListsAddContact:Jt,contactListsRemoveContact:Xt},z=e.object({id:e.string(),properties:e.record(e.string(),e.string()).optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archived:e.boolean().optional(),associations:D.optional()}).passthrough(),I=e.object({id:e.string(),properties:e.record(e.string(),e.string()).optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archived:e.boolean().optional(),associations:D.optional()}).passthrough(),M=e.object({id:e.string(),properties:e.record(e.string(),e.string()).optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archived:e.boolean().optional(),associations:D.optional()}).passthrough(),W=e.object({id:e.string(),properties:e.record(e.string(),e.string()).optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archived:e.boolean().optional(),associations:D.optional()}).passthrough(),N=e.object({id:e.string(),engagement:e.object({id:e.number().optional(),portalId:e.number().optional(),active:e.boolean().optional(),createdAt:e.number().optional(),lastUpdated:e.number().optional(),createdBy:e.number().optional(),modifiedBy:e.number().optional(),ownerId:e.number().optional(),type:e.string().optional(),timestamp:e.number().optional()}).optional(),associations:D.optional(),metadata:e.record(e.any()).optional()}).passthrough(),T=e.object({next:e.object({after:e.string()}).optional(),prev:e.object({before:e.string()}).optional()}),U=e.object({results:e.array(z).optional(),paging:T.optional()}).passthrough(),F=e.object({results:e.array(I).optional(),paging:T.optional()}).passthrough(),A=e.object({results:e.array(M).optional(),paging:T.optional()}).passthrough(),Zt=e.object({results:e.array(W).optional(),paging:T.optional()}).passthrough(),eo=e.object({results:e.array(N).optional(),paging:T.optional()}).passthrough(),to=e.object({results:e.array(I).optional()}).passthrough(),Pe=e.object({updated:e.array(e.number()).optional(),discarded:e.array(e.number()).optional(),invalidVids:e.array(e.number()).optional(),invalidEmails:e.array(e.string()).optional()}),y={contactsGet:z,contactsGetMany:U,contactsCreateOrUpdate:z,contactsDelete:e.void(),contactsGetRecentlyCreated:U,contactsGetRecentlyUpdated:U,contactsSearch:U,companiesGet:I,companiesGetMany:F,companiesCreate:I,companiesUpdate:I,companiesDelete:e.void(),companiesGetRecentlyCreated:F,companiesGetRecentlyUpdated:F,companiesSearchByDomain:to,dealsGet:M,dealsGetMany:A,dealsCreate:M,dealsUpdate:M,dealsDelete:e.void(),dealsGetRecentlyCreated:A,dealsGetRecentlyUpdated:A,dealsSearch:A,ticketsGet:W,ticketsGetMany:Zt,ticketsCreate:W,ticketsUpdate:W,ticketsDelete:e.void(),engagementsGet:N,engagementsGetMany:eo,engagementsCreate:N,engagementsDelete:e.void(),contactListsAddContact:Pe,contactListsRemoveContact:Pe};var f={get:me,getMany:be,createOrUpdate:ge,delete:he,getRecentlyCreated:Se,getRecentlyUpdated:Ce,search:Ee},S={get:ae,getMany:ne,create:se,update:re,delete:pe,getRecentlyCreated:ie,getRecentlyUpdated:ce,searchByDomain:de},C={get:ke,getMany:fe,create:ve,update:He,delete:Re,getRecentlyCreated:we,getRecentlyUpdated:Ie,search:De},R={get:Ae,getMany:Me,create:We,update:xe,delete:Oe},j={get:Te,getMany:je,create:Ge,delete:Ue},V={addContact:ye,removeContact:ue};import{ApiError as Be}from"corsair/http";var Fe={PERMISSION_ERROR:{match:(t,a)=>{if((t instanceof Be&&t.status===403||t instanceof v&&t.code===403)&&a.operation.toLowerCase().includes("tickets"))return!0;let s=t.message.toLowerCase();return s.includes("forbidden")||s.includes("permission denied")||s.includes("access denied")},handler:async(t,a)=>({maxRetries:0})},VALIDATION_ERROR:{match:(t,a)=>!!((t instanceof Be&&t.status===400||t instanceof v&&t.code===400)&&a.operation.toLowerCase().includes("engagements.create")),handler:async(t,a)=>({maxRetries:0})},DEFAULT:{match:(t,a)=>!0,handler:async(t,a)=>(console.error(`[corsair:${a.pluginId}:${a.operation}]`,{error:t.message,input:a.input}),{maxRetries:0})}};import{z as $e}from"zod";import{z as i}from"zod";var ze=i.object({id:i.string(),properties:i.record(i.any()).optional(),createdAt:i.coerce.date().nullable().optional(),updatedAt:i.coerce.date().nullable().optional(),archived:i.boolean().optional()}),Ne=i.object({id:i.string(),properties:i.record(i.any()).optional(),createdAt:i.coerce.date().nullable().optional(),updatedAt:i.coerce.date().nullable().optional(),archived:i.boolean().optional()}),Ve=i.object({id:i.string(),properties:i.record(i.any()).optional(),createdAt:i.coerce.date().nullable().optional(),updatedAt:i.coerce.date().nullable().optional(),archived:i.boolean().optional()}),_e=i.object({id:i.string(),properties:i.record(i.any()).optional(),createdAt:i.coerce.date().nullable().optional(),updatedAt:i.coerce.date().nullable().optional(),archived:i.boolean().optional()}),qe=i.object({id:i.string(),engagement:i.object({id:i.number().optional(),portalId:i.number().optional(),active:i.boolean().optional(),createdAt:i.number().optional(),lastUpdated:i.number().optional(),createdBy:i.number().optional(),modifiedBy:i.number().optional(),ownerId:i.number().optional(),type:i.string().optional(),timestamp:i.number().optional()}).optional(),associations:i.record(i.string(),i.any()).optional(),metadata:i.record(i.string(),i.any()).optional()});var xo=$e.object({token:$e.string()}),Ke={version:"1.0.0",entities:{contacts:ze,companies:Ne,deals:Ve,tickets:_e,engagements:qe}};import{verifyHmacSignature as oo}from"corsair/http";import{z as c}from"zod";var h=c.object({subscriptionId:c.number(),portalId:c.number(),occurredAt:c.number(),subscriptionType:c.string(),attemptNumber:c.number(),objectId:c.number().optional(),propertyName:c.string().optional(),propertyValue:c.string().optional(),changeSource:c.string().optional(),eventId:c.string().optional()}),_=h.extend({subscriptionType:c.literal("contact.creation"),objectId:c.number()}),q=h.extend({subscriptionType:c.literal("contact.propertyChange"),objectId:c.number(),propertyName:c.string(),propertyValue:c.string()}),$=h.extend({subscriptionType:c.literal("contact.deletion"),objectId:c.number()}),K=h.extend({subscriptionType:c.literal("company.creation"),objectId:c.number()}),Q=h.extend({subscriptionType:c.literal("company.propertyChange"),objectId:c.number(),propertyName:c.string(),propertyValue:c.string()}),Y=h.extend({subscriptionType:c.literal("company.deletion"),objectId:c.number()}),J=h.extend({subscriptionType:c.literal("deal.creation"),objectId:c.number()}),X=h.extend({subscriptionType:c.literal("deal.propertyChange"),objectId:c.number(),propertyName:c.string(),propertyValue:c.string()}),Z=h.extend({subscriptionType:c.literal("deal.deletion"),objectId:c.number()}),ee=h.extend({subscriptionType:c.literal("ticket.creation"),objectId:c.number()}),te=h.extend({subscriptionType:c.literal("ticket.propertyChange"),objectId:c.number(),propertyName:c.string(),propertyValue:c.string()}),oe=h.extend({subscriptionType:c.literal("ticket.deletion"),objectId:c.number()}),Bo=c.union([_,q,$,K,Q,Y,J,X,Z,ee,te,oe]);function ao(t){return typeof t=="string"?JSON.parse(t):t}function m(t,a){if(!a)return{valid:!1};let s=t.rawBody;if(!s)return{valid:!1,error:"Missing raw body for signature verification"};let r=t.headers,n=Array.isArray(r["x-hubspot-signature-v3"])?r["x-hubspot-signature-v3"][0]:r["x-hubspot-signature-v3"];return n?oo(s,a,n)?{valid:!0}:{valid:!1,error:"Invalid signature"}:{valid:!1,error:"Missing x-hubspot-signature-v3 header"}}function b(t){return a=>{let s=ao(a.body);return(Array.isArray(s)?s:[s]).some(n=>typeof n=="object"&&n!==null&&"subscriptionType"in n&&typeof n.subscriptionType=="string"&&n.subscriptionType===t)}}var Qe={match:b("company.creation"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="company.creation"&&(console.log("\u{1F3E2} HubSpot Company Created:",{objectId:o.objectId,portalId:o.portalId}),t.db.companies&&o.objectId))try{await t.db.companies.upsertByEntityId(o.objectId.toString(),{id:o.objectId.toString(),properties:{},createdAt:new Date(o.occurredAt),updatedAt:new Date(o.occurredAt)})}catch(p){console.warn("Failed to save company to database:",p)}return{success:!0,data:{success:!0}}}},Ye={match:b("company.propertyChange"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="company.propertyChange"&&(console.log("\u{1F4DD} HubSpot Company Updated:",{objectId:o.objectId,propertyName:o.propertyName,propertyValue:o.propertyValue}),t.db.companies&&o.objectId))try{let p=await t.db.companies.findByEntityId(o.objectId.toString());await t.db.companies.upsertByEntityId(o.objectId.toString(),{id:o.objectId.toString(),properties:{...p?.data?.properties||{},[o.propertyName||""]:o.propertyValue},createdAt:p?.data?.createdAt||new Date(o.occurredAt),updatedAt:new Date(o.occurredAt)})}catch(p){console.warn("Failed to update company in database:",p)}return{success:!0,data:{success:!0}}}},Je={match:b("company.deletion"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="company.deletion"&&(console.log("\u{1F5D1}\uFE0F HubSpot Company Deleted:",{objectId:o.objectId,portalId:o.portalId}),t.db.companies&&o.objectId))try{await t.db.companies.deleteByEntityId(o.objectId.toString())}catch(p){console.warn("Failed to delete company from database:",p)}return{success:!0,data:{success:!0}}}};var Xe={match:b("contact.creation"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="contact.creation"&&(console.log("\u{1F464} HubSpot Contact Created:",{objectId:o.objectId,portalId:o.portalId}),t.db.contacts&&o.objectId))try{await t.db.contacts.upsertByEntityId(o.objectId.toString(),{id:o.objectId.toString(),properties:{},createdAt:new Date(o.occurredAt),updatedAt:new Date(o.occurredAt)})}catch(p){console.warn("Failed to save contact to database:",p)}return{success:!0,data:{success:!0}}}},Ze={match:b("contact.propertyChange"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="contact.propertyChange"&&(console.log("\u{1F4DD} HubSpot Contact Updated:",{objectId:o.objectId,propertyName:o.propertyName,propertyValue:o.propertyValue}),t.db.contacts&&o.objectId))try{let p=await t.db.contacts.findByEntityId(o.objectId.toString());await t.db.contacts.upsertByEntityId(o.objectId.toString(),{id:o.objectId.toString(),properties:{...p?.data?.properties||{},[o.propertyName||""]:o.propertyValue},createdAt:p?.data?.createdAt||new Date(o.occurredAt),updatedAt:new Date(o.occurredAt)})}catch(p){console.warn("Failed to update contact in database:",p)}return{success:!0,data:{success:!0}}}},et={match:b("contact.deletion"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="contact.deletion"&&(console.log("\u{1F5D1}\uFE0F HubSpot Contact Deleted:",{objectId:o.objectId,portalId:o.portalId}),t.db.contacts&&o.objectId))try{await t.db.contacts.deleteByEntityId(o.objectId.toString())}catch(p){console.warn("Failed to delete contact from database:",p)}return{success:!0,data:{success:!0}}}};var tt={match:b("deal.creation"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="deal.creation"&&(console.log("\u{1F4BC} HubSpot Deal Created:",{objectId:o.objectId,portalId:o.portalId}),t.db.deals&&o.objectId))try{await t.db.deals.upsertByEntityId(o.objectId.toString(),{id:o.objectId.toString(),properties:{},createdAt:new Date(o.occurredAt),updatedAt:new Date(o.occurredAt)})}catch(p){console.warn("Failed to save deal to database:",p)}return{success:!0,data:{success:!0}}}},ot={match:b("deal.propertyChange"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="deal.propertyChange"&&(console.log("\u{1F4DD} HubSpot Deal Updated:",{objectId:o.objectId,propertyName:o.propertyName,propertyValue:o.propertyValue}),t.db.deals&&o.objectId))try{let p=await t.db.deals.findByEntityId(o.objectId.toString());await t.db.deals.upsertByEntityId(o.objectId.toString(),{id:o.objectId.toString(),properties:{...p?.data?.properties||{},[o.propertyName||""]:o.propertyValue},createdAt:p?.data?.createdAt||new Date(o.occurredAt),updatedAt:new Date(o.occurredAt)})}catch(p){console.warn("Failed to update deal in database:",p)}return{success:!0,data:{success:!0}}}},at={match:b("deal.deletion"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="deal.deletion"&&(console.log("\u{1F5D1}\uFE0F HubSpot Deal Deleted:",{objectId:o.objectId,portalId:o.portalId}),t.db.deals&&o.objectId))try{await t.db.deals.deleteByEntityId(o.objectId.toString())}catch(p){console.warn("Failed to delete deal from database:",p)}return{success:!0,data:{success:!0}}}};var nt={match:b("ticket.creation"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="ticket.creation"&&(console.log("\u{1F3AB} HubSpot Ticket Created:",{objectId:o.objectId,portalId:o.portalId}),t.db.tickets&&o.objectId))try{await t.db.tickets.upsertByEntityId(o.objectId.toString(),{id:o.objectId.toString(),properties:{},createdAt:new Date(o.occurredAt),updatedAt:new Date(o.occurredAt)})}catch(p){console.warn("Failed to save ticket to database:",p)}return{success:!0,data:{success:!0}}}},st={match:b("ticket.propertyChange"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="ticket.propertyChange"&&(console.log("\u{1F4DD} HubSpot Ticket Updated:",{objectId:o.objectId,propertyName:o.propertyName,propertyValue:o.propertyValue}),t.db.tickets&&o.objectId))try{let p=await t.db.tickets.findByEntityId(o.objectId.toString());await t.db.tickets.upsertByEntityId(o.objectId.toString(),{id:o.objectId.toString(),properties:{...p?.data?.properties||{},[o.propertyName||""]:o.propertyValue},createdAt:p?.data?.createdAt||new Date(o.occurredAt),updatedAt:new Date(o.occurredAt)})}catch(p){console.warn("Failed to update ticket in database:",p)}return{success:!0,data:{success:!0}}}},rt={match:b("ticket.deletion"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="ticket.deletion"&&(console.log("\u{1F5D1}\uFE0F HubSpot Ticket Deleted:",{objectId:o.objectId,portalId:o.portalId}),t.db.tickets&&o.objectId))try{await t.db.tickets.deleteByEntityId(o.objectId.toString())}catch(p){console.warn("Failed to delete ticket from database:",p)}return{success:!0,data:{success:!0}}}};var x={created:Xe,updated:Ze,deleted:et},O={created:Qe,updated:Ye,deleted:Je},P={created:tt,updated:ot,deleted:at},L={created:nt,updated:st,deleted:rt};var no={contacts:{get:f.get,getMany:f.getMany,createOrUpdate:f.createOrUpdate,delete:f.delete,getRecentlyCreated:f.getRecentlyCreated,getRecentlyUpdated:f.getRecentlyUpdated,search:f.search},companies:{get:S.get,getMany:S.getMany,create:S.create,update:S.update,delete:S.delete,getRecentlyCreated:S.getRecentlyCreated,getRecentlyUpdated:S.getRecentlyUpdated,searchByDomain:S.searchByDomain},deals:{get:C.get,getMany:C.getMany,create:C.create,update:C.update,delete:C.delete,getRecentlyCreated:C.getRecentlyCreated,getRecentlyUpdated:C.getRecentlyUpdated,search:C.search},tickets:{get:R.get,getMany:R.getMany,create:R.create,update:R.update,delete:R.delete},engagements:{get:j.get,getMany:j.getMany,create:j.create,delete:j.delete},contactLists:{addContact:V.addContact,removeContact:V.removeContact}},so={"contacts.get":{input:l.contactsGet,output:y.contactsGet},"contacts.getMany":{input:l.contactsGetMany,output:y.contactsGetMany},"contacts.createOrUpdate":{input:l.contactsCreateOrUpdate,output:y.contactsCreateOrUpdate},"contacts.delete":{input:l.contactsDelete,output:y.contactsDelete},"contacts.getRecentlyCreated":{input:l.contactsGetRecentlyCreated,output:y.contactsGetRecentlyCreated},"contacts.getRecentlyUpdated":{input:l.contactsGetRecentlyUpdated,output:y.contactsGetRecentlyUpdated},"contacts.search":{input:l.contactsSearch,output:y.contactsSearch},"companies.get":{input:l.companiesGet,output:y.companiesGet},"companies.getMany":{input:l.companiesGetMany,output:y.companiesGetMany},"companies.create":{input:l.companiesCreate,output:y.companiesCreate},"companies.update":{input:l.companiesUpdate,output:y.companiesUpdate},"companies.delete":{input:l.companiesDelete,output:y.companiesDelete},"companies.getRecentlyCreated":{input:l.companiesGetRecentlyCreated,output:y.companiesGetRecentlyCreated},"companies.getRecentlyUpdated":{input:l.companiesGetRecentlyUpdated,output:y.companiesGetRecentlyUpdated},"companies.searchByDomain":{input:l.companiesSearchByDomain,output:y.companiesSearchByDomain},"deals.get":{input:l.dealsGet,output:y.dealsGet},"deals.getMany":{input:l.dealsGetMany,output:y.dealsGetMany},"deals.create":{input:l.dealsCreate,output:y.dealsCreate},"deals.update":{input:l.dealsUpdate,output:y.dealsUpdate},"deals.delete":{input:l.dealsDelete,output:y.dealsDelete},"deals.getRecentlyCreated":{input:l.dealsGetRecentlyCreated,output:y.dealsGetRecentlyCreated},"deals.getRecentlyUpdated":{input:l.dealsGetRecentlyUpdated,output:y.dealsGetRecentlyUpdated},"deals.search":{input:l.dealsSearch,output:y.dealsSearch},"tickets.get":{input:l.ticketsGet,output:y.ticketsGet},"tickets.getMany":{input:l.ticketsGetMany,output:y.ticketsGetMany},"tickets.create":{input:l.ticketsCreate,output:y.ticketsCreate},"tickets.update":{input:l.ticketsUpdate,output:y.ticketsUpdate},"tickets.delete":{input:l.ticketsDelete,output:y.ticketsDelete},"engagements.get":{input:l.engagementsGet,output:y.engagementsGet},"engagements.getMany":{input:l.engagementsGetMany,output:y.engagementsGetMany},"engagements.create":{input:l.engagementsCreate,output:y.engagementsCreate},"engagements.delete":{input:l.engagementsDelete,output:y.engagementsDelete},"contactLists.addContact":{input:l.contactListsAddContact,output:y.contactListsAddContact},"contactLists.removeContact":{input:l.contactListsRemoveContact,output:y.contactListsRemoveContact}},ro={contactCreated:x.created,contactUpdated:x.updated,contactDeleted:x.deleted,companyCreated:O.created,companyUpdated:O.updated,companyDeleted:O.deleted,dealCreated:P.created,dealUpdated:P.updated,dealDeleted:P.deleted,ticketCreated:L.created,ticketUpdated:L.updated,ticketDeleted:L.deleted},po={contactCreated:{description:"A new contact was created",payload:_,response:u.object({success:u.boolean()})},contactUpdated:{description:"A contact property was updated",payload:q,response:u.object({success:u.boolean()})},contactDeleted:{description:"A contact was deleted",payload:$,response:u.object({success:u.boolean()})},companyCreated:{description:"A new company was created",payload:K,response:u.object({success:u.boolean()})},companyUpdated:{description:"A company property was updated",payload:Q,response:u.object({success:u.boolean()})},companyDeleted:{description:"A company was deleted",payload:Y,response:u.object({success:u.boolean()})},dealCreated:{description:"A new deal was created",payload:J,response:u.object({success:u.boolean()})},dealUpdated:{description:"A deal property was updated",payload:X,response:u.object({success:u.boolean()})},dealDeleted:{description:"A deal was deleted",payload:Z,response:u.object({success:u.boolean()})},ticketCreated:{description:"A new support ticket was created",payload:ee,response:u.object({success:u.boolean()})},ticketUpdated:{description:"A support ticket property was updated",payload:te,response:u.object({success:u.boolean()})},ticketDeleted:{description:"A support ticket was deleted",payload:oe,response:u.object({success:u.boolean()})}},io="api_key",co={"contacts.get":{riskLevel:"read",description:"Get a specific contact"},"contacts.getMany":{riskLevel:"read",description:"Get multiple contacts"},"contacts.createOrUpdate":{riskLevel:"write",description:"Create a new contact or update an existing one"},"contacts.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete a contact [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"contacts.getRecentlyCreated":{riskLevel:"read",description:"List recently created contacts"},"contacts.getRecentlyUpdated":{riskLevel:"read",description:"List recently updated contacts"},"contacts.search":{riskLevel:"read",description:"Search contacts"},"companies.get":{riskLevel:"read",description:"Get a specific company"},"companies.getMany":{riskLevel:"read",description:"Get multiple companies"},"companies.create":{riskLevel:"write",description:"Create a new company"},"companies.update":{riskLevel:"write",description:"Update an existing company"},"companies.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete a company [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"companies.getRecentlyCreated":{riskLevel:"read",description:"List recently created companies"},"companies.getRecentlyUpdated":{riskLevel:"read",description:"List recently updated companies"},"companies.searchByDomain":{riskLevel:"read",description:"Search companies by domain name"},"deals.get":{riskLevel:"read",description:"Get a specific deal"},"deals.getMany":{riskLevel:"read",description:"Get multiple deals"},"deals.create":{riskLevel:"write",description:"Create a new deal"},"deals.update":{riskLevel:"write",description:"Update an existing deal"},"deals.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete a deal [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"deals.getRecentlyCreated":{riskLevel:"read",description:"List recently created deals"},"deals.getRecentlyUpdated":{riskLevel:"read",description:"List recently updated deals"},"deals.search":{riskLevel:"read",description:"Search deals"},"tickets.get":{riskLevel:"read",description:"Get a specific ticket"},"tickets.getMany":{riskLevel:"read",description:"Get multiple tickets"},"tickets.create":{riskLevel:"write",description:"Create a new support ticket"},"tickets.update":{riskLevel:"write",description:"Update an existing ticket"},"tickets.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete a ticket [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"engagements.get":{riskLevel:"read",description:"Get a specific engagement"},"engagements.getMany":{riskLevel:"read",description:"Get multiple engagements"},"engagements.create":{riskLevel:"write",description:"Create a new engagement"},"engagements.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete an engagement [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"contactLists.addContact":{riskLevel:"write",description:"Add a contact to a static contact list"},"contactLists.removeContact":{riskLevel:"write",description:"Remove a contact from a static contact list"}};function ca(t={}){let a={...t,authType:t.authType??io};return{id:"hubspot",schema:Ke,options:a,hooks:a.hooks,webhookHooks:a.webhookHooks,endpoints:no,webhooks:ro,endpointMeta:co,endpointSchemas:so,webhookSchemas:po,pluginWebhookMatcher:s=>{let n="x-hubspot-signature-v3"in s.headers,o=s.body,B=(Array.isArray(o)?o:[o]).some(g=>typeof g.subscriptionType=="string"&&g.subscriptionType!==void 0);return n||B},errorHandlers:a.errorHandlers||Fe,keyBuilder:async(s,r)=>{let n=s.authType;if(r==="webhook"&&a.webhookSecret)return a.webhookSecret;if(r==="webhook"){let o=await s.keys.get_webhook_signature();if(!o)throw new Error("[auth-missing:hubspot:webhook_signature]: HubSpot webhook signature is missing");return o}if(r==="endpoint"){if(s.authType==="api_key"){let o=await s.keys.get_api_key();if(!o)throw new Error("[auth-missing:hubspot:api_key]: HubSpot API Key is missing");return o}else if(s.authType==="oauth_2"){let o=await s.keys.get_access_token();if(!o)throw new Error("[auth-missing:hubspot:oauth_2]: HubSpot access token is missing");return o}}throw new Error(`[auth-missing:hubspot:${n}]: HubSpot key is missing`)}}}export{b as createHubSpotEventMatch,ca as hubspot,so as hubspotEndpointSchemas,m as verifyHubSpotWebhookSignature};
|
|
1
|
+
import{z as u}from"zod";import{logEventFromContext as E}from"corsair/core";import{request as pt}from"corsair/http";var v=class extends Error{constructor(s,r){super(s);this.code=r;this.name="HubSpotAPIError"}},it="https://api.hubapi.com";async function d(t,a,s={}){let{method:r="GET",body:n,query:o}=s,p={BASE:it,VERSION:"1.0.0",WITH_CREDENTIALS:!1,CREDENTIALS:"omit",TOKEN:a,HEADERS:{"Content-Type":"application/json"}},B={method:r,url:t,body:r==="POST"||r==="PUT"||r==="PATCH"?n:void 0,mediaType:"application/json",query:r==="GET"?o:void 0};try{return await pt(p,B)}catch(g){throw g&&typeof g=="object"&&"status"in g&&typeof g.status=="number"?new v(g instanceof Error?g.message:"HubSpot API error",g.status):new v(g instanceof Error?g.message:"Unknown error")}}var ae=async(t,a)=>{let{companyId:s,...r}=a,n=`/crm/v3/objects/companies/${s}`,o=await d(n,t.key,{query:{...r,properties:r.properties?.join(","),propertiesWithHistory:r.propertiesWithHistory?.join(","),associations:r.associations?.join(",")}});if(o&&t.db.companies)try{await t.db.companies.upsertByEntityId(o.id,o)}catch(p){console.warn("Failed to save company to database:",p)}return await E(t,"hubspot.companies.get",{...a},"completed"),o},ne=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/companies",t.key,{query:{...s,properties:s.properties?.join(","),propertiesWithHistory:s.propertiesWithHistory?.join(","),associations:s.associations?.join(",")}});if(n.results&&t.db.companies)try{for(let o of n.results)await t.db.companies.upsertByEntityId(o.id,o)}catch(o){console.warn("Failed to save companies to database:",o)}return await E(t,"hubspot.companies.getMany",{...a},"completed"),n},se=async(t,a)=>{let{...s}=a,n=await d("/crm/v3/objects/companies",t.key,{method:"POST",body:s});if(n&&t.db.companies)try{await t.db.companies.upsertByEntityId(n.id,n)}catch(o){console.warn("Failed to save company to database:",o)}return await E(t,"hubspot.companies.create",{...a},"completed"),n},re=async(t,a)=>{let{companyId:s,...r}=a,n=`/crm/v3/objects/companies/${s}`,o=await d(n,t.key,{method:"PATCH",body:r});if(o&&t.db.companies)try{await t.db.companies.upsertByEntityId(o.id,o)}catch(p){console.warn("Failed to save company to database:",p)}return await E(t,"hubspot.companies.update",{...a},"completed"),o},pe=async(t,a)=>{let{companyId:s}=a,r=`/crm/v3/objects/companies/${s}`;if(await d(r,t.key,{method:"DELETE"}),t.db.companies)try{await t.db.companies.deleteByEntityId(s)}catch(n){console.warn("Failed to delete company from database:",n)}await E(t,"hubspot.companies.delete",{...a},"completed")},ie=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/companies",t.key,{query:s});if(n.results&&t.db.companies)try{for(let o of n.results)await t.db.companies.upsertByEntityId(o.id,o)}catch(o){console.warn("Failed to save companies to database:",o)}return await E(t,"hubspot.companies.getRecentlyCreated",{...a},"completed"),n},ce=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/companies",t.key,{query:s});if(n.results&&t.db.companies)try{for(let o of n.results)await t.db.companies.upsertByEntityId(o.id,o)}catch(o){console.warn("Failed to save companies to database:",o)}return await E(t,"hubspot.companies.getRecentlyUpdated",{...a},"completed"),n},de=async(t,a)=>{let{domain:s,...r}=a,o=await d("/crm/v3/objects/companies/search",t.key,{query:{...r,domain:s,properties:r.properties?.join(",")}});return await E(t,"hubspot.companies.searchByDomain",{...a},"completed"),o};import{logEventFromContext as le}from"corsair/core";var ye=async(t,a)=>{let{listId:s,...r}=a,n=`/contacts/v1/lists/${s}/add`,o=await d(n,t.key,{method:"POST",body:r});return await le(t,"hubspot.contactLists.addContact",{...a},"completed"),o},ue=async(t,a)=>{let{listId:s,...r}=a,n=`/contacts/v1/lists/${s}/remove`,o=await d(n,t.key,{method:"POST",body:r});return await le(t,"hubspot.contactLists.removeContact",{...a},"completed"),o};import{logEventFromContext as H}from"corsair/core";var me=async(t,a)=>{let{contactId:s,...r}=a,n=`/crm/v3/objects/contacts/${s}`,o=await d(n,t.key,{query:{...r,properties:r.properties?.join(","),propertiesWithHistory:r.propertiesWithHistory?.join(","),associations:r.associations?.join(",")}});if(o&&t.db.contacts)try{await t.db.contacts.upsertByEntityId(o.id,o)}catch(p){console.warn("Failed to save contact to database:",p)}return await H(t,"hubspot.contacts.get",{...a},"completed"),o},be=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/contacts",t.key,{query:{...s,properties:s.properties?.join(","),propertiesWithHistory:s.propertiesWithHistory?.join(","),associations:s.associations?.join(",")}});if(n.results&&t.db.contacts)try{for(let o of n.results)await t.db.contacts.upsertByEntityId(o.id,o)}catch(o){console.warn("Failed to save contacts to database:",o)}return await H(t,"hubspot.contacts.getMany",{...a},"completed"),n},ge=async(t,a)=>{let{...s}=a,n=await d("/crm/v3/objects/contacts",t.key,{method:"POST",body:s});if(n&&t.db.contacts)try{await t.db.contacts.upsertByEntityId(n.id,n)}catch(o){console.warn("Failed to save contact to database:",o)}return await H(t,"hubspot.contacts.createOrUpdate",{...a},"completed"),n},he=async(t,a)=>{let{contactId:s}=a,r=`/crm/v3/objects/contacts/${s}`;if(await d(r,t.key,{method:"DELETE"}),t.db.contacts)try{await t.db.contacts.deleteByEntityId(s)}catch(n){console.warn("Failed to delete contact from database:",n)}await H(t,"hubspot.contacts.delete",{...a},"completed")},Se=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/contacts",t.key,{query:s});return await H(t,"hubspot.contacts.getRecentlyCreated",{...a},"completed"),n},Ce=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/contacts",t.key,{query:s});return await H(t,"hubspot.contacts.getRecentlyUpdated",{...a},"completed"),n},Ee=async(t,a)=>{let{...s}=a,n=await d("/crm/v3/objects/contacts/search",t.key,{method:"POST",body:s});return await H(t,"hubspot.contacts.search",{...a},"completed"),n};import{logEventFromContext as k}from"corsair/core";var ke=async(t,a)=>{let{dealId:s,...r}=a,n=`/crm/v3/objects/deals/${s}`,o=await d(n,t.key,{query:{...r,properties:r.properties?.join(","),propertiesWithHistory:r.propertiesWithHistory?.join(","),associations:r.associations?.join(",")}});if(o&&t.db.deals)try{await t.db.deals.upsertByEntityId(o.id,o)}catch(p){console.warn("Failed to save deal to database:",p)}return await k(t,"hubspot.deals.get",{...a},"completed"),o},fe=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/deals",t.key,{query:{...s,properties:s.properties?.join(","),propertiesWithHistory:s.propertiesWithHistory?.join(","),associations:s.associations?.join(",")}});if(n.results&&t.db.deals)try{for(let o of n.results)await t.db.deals.upsertByEntityId(o.id,o)}catch(o){console.warn("Failed to save deals to database:",o)}return await k(t,"hubspot.deals.getMany",{...a},"completed"),n},ve=async(t,a)=>{let{...s}=a,n=await d("/crm/v3/objects/deals",t.key,{method:"POST",body:s});if(n&&t.db.deals)try{await t.db.deals.upsertByEntityId(n.id,n)}catch(o){console.warn("Failed to save deal to database:",o)}return await k(t,"hubspot.deals.create",{...a},"completed"),n},He=async(t,a)=>{let{dealId:s,...r}=a,n=`/crm/v3/objects/deals/${s}`,o=await d(n,t.key,{method:"PATCH",body:r});if(o&&t.db.deals)try{await t.db.deals.upsertByEntityId(o.id,o)}catch(p){console.warn("Failed to update deal in database:",p)}return await k(t,"hubspot.deals.update",{...a},"completed"),o},Re=async(t,a)=>{let{dealId:s}=a,r=`/crm/v3/objects/deals/${s}`;if(await d(r,t.key,{method:"DELETE"}),t.db.deals)try{await t.db.deals.deleteByEntityId(s)}catch(n){console.warn("Failed to delete deal from database:",n)}await k(t,"hubspot.deals.delete",{...a},"completed")},we=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/deals",t.key,{query:s});return await k(t,"hubspot.deals.getRecentlyCreated",{...a},"completed"),n},Ie=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/deals",t.key,{query:s});return await k(t,"hubspot.deals.getRecentlyUpdated",{...a},"completed"),n},De=async(t,a)=>{let{...s}=a,n=await d("/crm/v3/objects/deals/search",t.key,{method:"POST",body:s});return await k(t,"hubspot.deals.search",{...a},"completed"),n};import{logEventFromContext as G}from"corsair/core";var Te=async(t,a)=>{let{engagementId:s}=a,r=`/crm/v3/objects/engagements/${s}`,n=await d(r,t.key);if(n&&t.db.engagements)try{await t.db.engagements.upsertByEntityId(n.id,{...n})}catch(o){console.warn("Failed to save engagement to database:",o)}return await G(t,"hubspot.engagements.get",{...a},"completed"),n},je=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/engagements",t.key,{query:s});if(n.results&&t.db.engagements)try{for(let o of n.results)await t.db.engagements.upsertByEntityId(o.id,{...o})}catch(o){console.warn("Failed to save engagements to database:",o)}return await G(t,"hubspot.engagements.getMany",{...a},"completed"),n},Ge=async(t,a)=>{let{...s}=a,n=await d("/crm/v3/objects/engagements",t.key,{method:"POST",body:s});if(n&&t.db.engagements)try{await t.db.engagements.upsertByEntityId(n.id,{...n})}catch(o){console.warn("Failed to save engagement to database:",o)}return await G(t,"hubspot.engagements.create",{...a},"completed"),n},Ue=async(t,a)=>{let{engagementId:s}=a,r=`/crm/v3/objects/engagements/${s}`;if(await d(r,t.key,{method:"DELETE"}),t.db.engagements)try{await t.db.engagements.deleteByEntityId(s)}catch(n){console.warn("Failed to delete engagement from database:",n)}await G(t,"hubspot.engagements.delete",{...a},"completed")};import{logEventFromContext as w}from"corsair/core";var Ae=async(t,a)=>{let{ticketId:s,...r}=a,n=`/crm/v3/objects/tickets/${s}`,o=await d(n,t.key,{query:{...r,properties:r.properties?.join(","),propertiesWithHistory:r.propertiesWithHistory?.join(","),associations:r.associations?.join(",")}});if(o&&t.db.tickets)try{await t.db.tickets.upsertByEntityId(o.id,o)}catch(p){console.warn("Failed to save ticket to database:",p)}return await w(t,"hubspot.tickets.get",{...a},"completed"),o},Me=async(t,a)=>{let{...s}=a||{},n=await d("/crm/v3/objects/tickets",t.key,{query:{...s,properties:s.properties?.join(","),propertiesWithHistory:s.propertiesWithHistory?.join(","),associations:s.associations?.join(",")}});if(n.results&&t.db.tickets)try{for(let o of n.results)await t.db.tickets.upsertByEntityId(o.id,o)}catch(o){console.warn("Failed to save tickets to database:",o)}return await w(t,"hubspot.tickets.getMany",{...a},"completed"),n},We=async(t,a)=>{let{...s}=a,n=await d("/crm/v3/objects/tickets",t.key,{method:"POST",body:s});if(n&&t.db.tickets)try{await t.db.tickets.upsertByEntityId(n.id,n)}catch(o){console.warn("Failed to save ticket to database:",o)}return await w(t,"hubspot.tickets.create",{...a},"completed"),n},xe=async(t,a)=>{let{ticketId:s,...r}=a,n=`/crm/v3/objects/tickets/${s}`,o=await d(n,t.key,{method:"PATCH",body:r});if(o&&t.db.tickets)try{await t.db.tickets.upsertByEntityId(o.id,o)}catch(p){console.warn("Failed to update ticket in database:",p)}return await w(t,"hubspot.tickets.update",{...a},"completed"),o},Oe=async(t,a)=>{let{ticketId:s}=a,r=`/crm/v3/objects/tickets/${s}`;if(await d(r,t.key,{method:"DELETE"}),t.db.tickets)try{await t.db.tickets.deleteByEntityId(s)}catch(n){console.warn("Failed to delete ticket from database:",n)}await w(t,"hubspot.tickets.delete",{...a},"completed")};import{z as e}from"zod";var bt=e.object({contactId:e.string(),properties:e.array(e.string()).optional(),propertiesWithHistory:e.array(e.string()).optional(),associations:e.array(e.string()).optional(),archived:e.boolean().optional(),idProperty:e.string().optional()}),gt=e.object({limit:e.number().optional(),after:e.string().optional(),properties:e.array(e.string()).optional(),propertiesWithHistory:e.array(e.string()).optional(),associations:e.array(e.string()).optional(),archived:e.boolean().optional()}),ht=e.object({properties:e.record(e.string(),e.string()).optional(),associations:e.array(e.object({to:e.object({id:e.string()}),types:e.array(e.object({associationCategory:e.string(),associationTypeId:e.number()}))})).optional()}),St=e.object({contactId:e.string()}),Ct=e.object({count:e.number().optional(),after:e.string().optional(),since:e.string().optional()}),Et=e.object({count:e.number().optional(),after:e.string().optional(),since:e.string().optional()}),kt=e.enum(["BETWEEN","CONTAINS_TOKEN","EQ","GT","GTE","HAS_PROPERTY","IN","LT","LTE","NEQ","NOT_CONTAINS_TOKEN","NOT_HAS_PROPERTY","NOT_IN"]),ft=e.object({operator:kt,propertyName:e.string(),highValue:e.string().optional(),value:e.string().optional(),values:e.array(e.string()).optional()}),Le=e.object({filters:e.array(ft)}),vt=e.object({id:e.string(),type:e.string().optional()}),Ht=e.object({results:e.array(vt)}),D=e.record(e.string(),e.union([Ht,e.array(e.string())])),Rt=e.object({query:e.string().optional(),limit:e.number().optional(),after:e.string().optional(),sorts:e.array(e.string()).optional(),properties:e.array(e.string()).optional(),filterGroups:e.array(Le).optional()}),wt=e.object({companyId:e.string(),properties:e.array(e.string()).optional(),propertiesWithHistory:e.array(e.string()).optional(),associations:e.array(e.string()).optional(),archived:e.boolean().optional(),idProperty:e.string().optional()}),It=e.object({limit:e.number().optional(),after:e.string().optional(),properties:e.array(e.string()).optional(),propertiesWithHistory:e.array(e.string()).optional(),associations:e.array(e.string()).optional(),archived:e.boolean().optional()}),Dt=e.object({properties:e.record(e.string(),e.string()).optional(),associations:e.array(e.object({to:e.object({id:e.string()}),types:e.array(e.object({associationCategory:e.string(),associationTypeId:e.number()}))})).optional()}),Tt=e.object({companyId:e.string(),properties:e.record(e.string(),e.string()).optional()}),jt=e.object({companyId:e.string()}),Gt=e.object({count:e.number().optional(),after:e.string().optional(),since:e.string().optional()}),Ut=e.object({count:e.number().optional(),after:e.string().optional(),since:e.string().optional()}),At=e.object({domain:e.string(),properties:e.array(e.string()).optional()}),Mt=e.object({dealId:e.string(),properties:e.array(e.string()).optional(),propertiesWithHistory:e.array(e.string()).optional(),associations:e.array(e.string()).optional(),archived:e.boolean().optional(),idProperty:e.string().optional()}),Wt=e.object({limit:e.number().optional(),after:e.string().optional(),properties:e.array(e.string()).optional(),propertiesWithHistory:e.array(e.string()).optional(),associations:e.array(e.string()).optional(),archived:e.boolean().optional()}),xt=e.object({properties:e.record(e.string(),e.string()).optional(),associations:e.array(e.object({to:e.object({id:e.string()}),types:e.array(e.object({associationCategory:e.string(),associationTypeId:e.number()}))})).optional()}),Ot=e.object({dealId:e.string(),properties:e.record(e.string(),e.string()).optional()}),Pt=e.object({dealId:e.string()}),Lt=e.object({count:e.number().optional(),after:e.string().optional(),since:e.string().optional()}),Bt=e.object({count:e.number().optional(),after:e.string().optional(),since:e.string().optional()}),Ft=e.object({query:e.string().optional(),limit:e.number().optional(),after:e.string().optional(),sorts:e.array(e.string()).optional(),properties:e.array(e.string()).optional(),filterGroups:e.array(Le).optional()}),zt=e.object({ticketId:e.string(),properties:e.array(e.string()).optional(),propertiesWithHistory:e.array(e.string()).optional(),associations:e.array(e.string()).optional(),archived:e.boolean().optional(),idProperty:e.string().optional()}),Nt=e.object({limit:e.number().optional(),after:e.string().optional(),properties:e.array(e.string()).optional(),propertiesWithHistory:e.array(e.string()).optional(),associations:e.array(e.string()).optional(),archived:e.boolean().optional()}),Vt=e.object({properties:e.record(e.string(),e.string()).optional(),associations:e.array(e.object({to:e.object({id:e.string()}),types:e.array(e.object({associationCategory:e.string(),associationTypeId:e.number()}))})).optional()}),_t=e.object({ticketId:e.string(),properties:e.record(e.string(),e.string()).optional()}),qt=e.object({ticketId:e.string()}),$t=e.object({engagementId:e.string()}),Kt=e.object({limit:e.number().optional(),after:e.string().optional()}),Qt=e.object({engagement:e.object({active:e.boolean().optional(),type:e.string(),timestamp:e.number().optional()}),associations:e.object({contactIds:e.array(e.number()).optional(),companyIds:e.array(e.number()).optional(),dealIds:e.array(e.number()).optional(),ownerIds:e.array(e.number()).optional()}).optional(),metadata:e.record(e.string(),e.any()).optional()}),Yt=e.object({engagementId:e.string()}),Jt=e.object({listId:e.string(),emails:e.array(e.string()).optional(),vids:e.array(e.number()).optional()}),Xt=e.object({listId:e.string(),emails:e.array(e.string()).optional(),vids:e.array(e.number()).optional()}),l={contactsGet:bt,contactsGetMany:gt,contactsCreateOrUpdate:ht,contactsDelete:St,contactsGetRecentlyCreated:Ct,contactsGetRecentlyUpdated:Et,contactsSearch:Rt,companiesGet:wt,companiesGetMany:It,companiesCreate:Dt,companiesUpdate:Tt,companiesDelete:jt,companiesGetRecentlyCreated:Gt,companiesGetRecentlyUpdated:Ut,companiesSearchByDomain:At,dealsGet:Mt,dealsGetMany:Wt,dealsCreate:xt,dealsUpdate:Ot,dealsDelete:Pt,dealsGetRecentlyCreated:Lt,dealsGetRecentlyUpdated:Bt,dealsSearch:Ft,ticketsGet:zt,ticketsGetMany:Nt,ticketsCreate:Vt,ticketsUpdate:_t,ticketsDelete:qt,engagementsGet:$t,engagementsGetMany:Kt,engagementsCreate:Qt,engagementsDelete:Yt,contactListsAddContact:Jt,contactListsRemoveContact:Xt},z=e.object({id:e.string(),properties:e.record(e.string(),e.string()).optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archived:e.boolean().optional(),associations:D.optional()}).loose(),I=e.object({id:e.string(),properties:e.record(e.string(),e.string()).optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archived:e.boolean().optional(),associations:D.optional()}).loose(),M=e.object({id:e.string(),properties:e.record(e.string(),e.string()).optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archived:e.boolean().optional(),associations:D.optional()}).loose(),W=e.object({id:e.string(),properties:e.record(e.string(),e.string()).optional(),createdAt:e.coerce.date().nullable().optional(),updatedAt:e.coerce.date().nullable().optional(),archived:e.boolean().optional(),associations:D.optional()}).loose(),N=e.object({id:e.string(),engagement:e.object({id:e.number().optional(),portalId:e.number().optional(),active:e.boolean().optional(),createdAt:e.number().optional(),lastUpdated:e.number().optional(),createdBy:e.number().optional(),modifiedBy:e.number().optional(),ownerId:e.number().optional(),type:e.string().optional(),timestamp:e.number().optional()}).optional(),associations:D.optional(),metadata:e.record(e.string(),e.any()).optional()}).loose(),T=e.object({next:e.object({after:e.string()}).optional(),prev:e.object({before:e.string()}).optional()}),U=e.object({results:e.array(z).optional(),paging:T.optional()}).loose(),F=e.object({results:e.array(I).optional(),paging:T.optional()}).loose(),A=e.object({results:e.array(M).optional(),paging:T.optional()}).loose(),Zt=e.object({results:e.array(W).optional(),paging:T.optional()}).loose(),eo=e.object({results:e.array(N).optional(),paging:T.optional()}).loose(),to=e.object({results:e.array(I).optional()}).loose(),Pe=e.object({updated:e.array(e.number()).optional(),discarded:e.array(e.number()).optional(),invalidVids:e.array(e.number()).optional(),invalidEmails:e.array(e.string()).optional()}),y={contactsGet:z,contactsGetMany:U,contactsCreateOrUpdate:z,contactsDelete:e.void(),contactsGetRecentlyCreated:U,contactsGetRecentlyUpdated:U,contactsSearch:U,companiesGet:I,companiesGetMany:F,companiesCreate:I,companiesUpdate:I,companiesDelete:e.void(),companiesGetRecentlyCreated:F,companiesGetRecentlyUpdated:F,companiesSearchByDomain:to,dealsGet:M,dealsGetMany:A,dealsCreate:M,dealsUpdate:M,dealsDelete:e.void(),dealsGetRecentlyCreated:A,dealsGetRecentlyUpdated:A,dealsSearch:A,ticketsGet:W,ticketsGetMany:Zt,ticketsCreate:W,ticketsUpdate:W,ticketsDelete:e.void(),engagementsGet:N,engagementsGetMany:eo,engagementsCreate:N,engagementsDelete:e.void(),contactListsAddContact:Pe,contactListsRemoveContact:Pe};var f={get:me,getMany:be,createOrUpdate:ge,delete:he,getRecentlyCreated:Se,getRecentlyUpdated:Ce,search:Ee},S={get:ae,getMany:ne,create:se,update:re,delete:pe,getRecentlyCreated:ie,getRecentlyUpdated:ce,searchByDomain:de},C={get:ke,getMany:fe,create:ve,update:He,delete:Re,getRecentlyCreated:we,getRecentlyUpdated:Ie,search:De},R={get:Ae,getMany:Me,create:We,update:xe,delete:Oe},j={get:Te,getMany:je,create:Ge,delete:Ue},V={addContact:ye,removeContact:ue};import{ApiError as Be}from"corsair/http";var Fe={PERMISSION_ERROR:{match:(t,a)=>{if((t instanceof Be&&t.status===403||t instanceof v&&t.code===403)&&a.operation.toLowerCase().includes("tickets"))return!0;let s=t.message.toLowerCase();return s.includes("forbidden")||s.includes("permission denied")||s.includes("access denied")},handler:async(t,a)=>({maxRetries:0})},VALIDATION_ERROR:{match:(t,a)=>!!((t instanceof Be&&t.status===400||t instanceof v&&t.code===400)&&a.operation.toLowerCase().includes("engagements.create")),handler:async(t,a)=>({maxRetries:0})},DEFAULT:{match:(t,a)=>!0,handler:async(t,a)=>(console.error(`[corsair:${a.pluginId}:${a.operation}]`,{error:t.message,input:a.input}),{maxRetries:0})}};import{z as $e}from"zod";import{z as i}from"zod";var ze=i.object({id:i.string(),properties:i.record(i.string(),i.any()).optional(),createdAt:i.coerce.date().nullable().optional(),updatedAt:i.coerce.date().nullable().optional(),archived:i.boolean().optional()}),Ne=i.object({id:i.string(),properties:i.record(i.string(),i.any()).optional(),createdAt:i.coerce.date().nullable().optional(),updatedAt:i.coerce.date().nullable().optional(),archived:i.boolean().optional()}),Ve=i.object({id:i.string(),properties:i.record(i.string(),i.any()).optional(),createdAt:i.coerce.date().nullable().optional(),updatedAt:i.coerce.date().nullable().optional(),archived:i.boolean().optional()}),_e=i.object({id:i.string(),properties:i.record(i.string(),i.any()).optional(),createdAt:i.coerce.date().nullable().optional(),updatedAt:i.coerce.date().nullable().optional(),archived:i.boolean().optional()}),qe=i.object({id:i.string(),engagement:i.object({id:i.number().optional(),portalId:i.number().optional(),active:i.boolean().optional(),createdAt:i.number().optional(),lastUpdated:i.number().optional(),createdBy:i.number().optional(),modifiedBy:i.number().optional(),ownerId:i.number().optional(),type:i.string().optional(),timestamp:i.number().optional()}).optional(),associations:i.record(i.string(),i.any()).optional(),metadata:i.record(i.string(),i.any()).optional()});var xo=$e.object({token:$e.string()}),Ke={version:"1.0.0",entities:{contacts:ze,companies:Ne,deals:Ve,tickets:_e,engagements:qe}};import{verifyHmacSignature as oo}from"corsair/http";import{z as c}from"zod";var h=c.object({subscriptionId:c.number(),portalId:c.number(),occurredAt:c.number(),subscriptionType:c.string(),attemptNumber:c.number(),objectId:c.number().optional(),propertyName:c.string().optional(),propertyValue:c.string().optional(),changeSource:c.string().optional(),eventId:c.string().optional()}),_=h.extend({subscriptionType:c.literal("contact.creation"),objectId:c.number()}),q=h.extend({subscriptionType:c.literal("contact.propertyChange"),objectId:c.number(),propertyName:c.string(),propertyValue:c.string()}),$=h.extend({subscriptionType:c.literal("contact.deletion"),objectId:c.number()}),K=h.extend({subscriptionType:c.literal("company.creation"),objectId:c.number()}),Q=h.extend({subscriptionType:c.literal("company.propertyChange"),objectId:c.number(),propertyName:c.string(),propertyValue:c.string()}),Y=h.extend({subscriptionType:c.literal("company.deletion"),objectId:c.number()}),J=h.extend({subscriptionType:c.literal("deal.creation"),objectId:c.number()}),X=h.extend({subscriptionType:c.literal("deal.propertyChange"),objectId:c.number(),propertyName:c.string(),propertyValue:c.string()}),Z=h.extend({subscriptionType:c.literal("deal.deletion"),objectId:c.number()}),ee=h.extend({subscriptionType:c.literal("ticket.creation"),objectId:c.number()}),te=h.extend({subscriptionType:c.literal("ticket.propertyChange"),objectId:c.number(),propertyName:c.string(),propertyValue:c.string()}),oe=h.extend({subscriptionType:c.literal("ticket.deletion"),objectId:c.number()}),Bo=c.union([_,q,$,K,Q,Y,J,X,Z,ee,te,oe]);function ao(t){return typeof t=="string"?JSON.parse(t):t}function m(t,a){if(!a)return{valid:!1};let s=t.rawBody;if(!s)return{valid:!1,error:"Missing raw body for signature verification"};let r=t.headers,n=Array.isArray(r["x-hubspot-signature-v3"])?r["x-hubspot-signature-v3"][0]:r["x-hubspot-signature-v3"];return n?oo(s,a,n)?{valid:!0}:{valid:!1,error:"Invalid signature"}:{valid:!1,error:"Missing x-hubspot-signature-v3 header"}}function b(t){return a=>{let s=ao(a.body);return(Array.isArray(s)?s:[s]).some(n=>typeof n=="object"&&n!==null&&"subscriptionType"in n&&typeof n.subscriptionType=="string"&&n.subscriptionType===t)}}var Qe={match:b("company.creation"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="company.creation"&&(console.log("\u{1F3E2} HubSpot Company Created:",{objectId:o.objectId,portalId:o.portalId}),t.db.companies&&o.objectId))try{await t.db.companies.upsertByEntityId(o.objectId.toString(),{id:o.objectId.toString(),properties:{},createdAt:new Date(o.occurredAt),updatedAt:new Date(o.occurredAt)})}catch(p){console.warn("Failed to save company to database:",p)}return{success:!0,data:{success:!0}}}},Ye={match:b("company.propertyChange"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="company.propertyChange"&&(console.log("\u{1F4DD} HubSpot Company Updated:",{objectId:o.objectId,propertyName:o.propertyName,propertyValue:o.propertyValue}),t.db.companies&&o.objectId))try{let p=await t.db.companies.findByEntityId(o.objectId.toString());await t.db.companies.upsertByEntityId(o.objectId.toString(),{id:o.objectId.toString(),properties:{...p?.data?.properties||{},[o.propertyName||""]:o.propertyValue},createdAt:p?.data?.createdAt||new Date(o.occurredAt),updatedAt:new Date(o.occurredAt)})}catch(p){console.warn("Failed to update company in database:",p)}return{success:!0,data:{success:!0}}}},Je={match:b("company.deletion"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="company.deletion"&&(console.log("\u{1F5D1}\uFE0F HubSpot Company Deleted:",{objectId:o.objectId,portalId:o.portalId}),t.db.companies&&o.objectId))try{await t.db.companies.deleteByEntityId(o.objectId.toString())}catch(p){console.warn("Failed to delete company from database:",p)}return{success:!0,data:{success:!0}}}};var Xe={match:b("contact.creation"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="contact.creation"&&(console.log("\u{1F464} HubSpot Contact Created:",{objectId:o.objectId,portalId:o.portalId}),t.db.contacts&&o.objectId))try{await t.db.contacts.upsertByEntityId(o.objectId.toString(),{id:o.objectId.toString(),properties:{},createdAt:new Date(o.occurredAt),updatedAt:new Date(o.occurredAt)})}catch(p){console.warn("Failed to save contact to database:",p)}return{success:!0,data:{success:!0}}}},Ze={match:b("contact.propertyChange"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="contact.propertyChange"&&(console.log("\u{1F4DD} HubSpot Contact Updated:",{objectId:o.objectId,propertyName:o.propertyName,propertyValue:o.propertyValue}),t.db.contacts&&o.objectId))try{let p=await t.db.contacts.findByEntityId(o.objectId.toString());await t.db.contacts.upsertByEntityId(o.objectId.toString(),{id:o.objectId.toString(),properties:{...p?.data?.properties||{},[o.propertyName||""]:o.propertyValue},createdAt:p?.data?.createdAt||new Date(o.occurredAt),updatedAt:new Date(o.occurredAt)})}catch(p){console.warn("Failed to update contact in database:",p)}return{success:!0,data:{success:!0}}}},et={match:b("contact.deletion"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="contact.deletion"&&(console.log("\u{1F5D1}\uFE0F HubSpot Contact Deleted:",{objectId:o.objectId,portalId:o.portalId}),t.db.contacts&&o.objectId))try{await t.db.contacts.deleteByEntityId(o.objectId.toString())}catch(p){console.warn("Failed to delete contact from database:",p)}return{success:!0,data:{success:!0}}}};var tt={match:b("deal.creation"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="deal.creation"&&(console.log("\u{1F4BC} HubSpot Deal Created:",{objectId:o.objectId,portalId:o.portalId}),t.db.deals&&o.objectId))try{await t.db.deals.upsertByEntityId(o.objectId.toString(),{id:o.objectId.toString(),properties:{},createdAt:new Date(o.occurredAt),updatedAt:new Date(o.occurredAt)})}catch(p){console.warn("Failed to save deal to database:",p)}return{success:!0,data:{success:!0}}}},ot={match:b("deal.propertyChange"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="deal.propertyChange"&&(console.log("\u{1F4DD} HubSpot Deal Updated:",{objectId:o.objectId,propertyName:o.propertyName,propertyValue:o.propertyValue}),t.db.deals&&o.objectId))try{let p=await t.db.deals.findByEntityId(o.objectId.toString());await t.db.deals.upsertByEntityId(o.objectId.toString(),{id:o.objectId.toString(),properties:{...p?.data?.properties||{},[o.propertyName||""]:o.propertyValue},createdAt:p?.data?.createdAt||new Date(o.occurredAt),updatedAt:new Date(o.occurredAt)})}catch(p){console.warn("Failed to update deal in database:",p)}return{success:!0,data:{success:!0}}}},at={match:b("deal.deletion"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="deal.deletion"&&(console.log("\u{1F5D1}\uFE0F HubSpot Deal Deleted:",{objectId:o.objectId,portalId:o.portalId}),t.db.deals&&o.objectId))try{await t.db.deals.deleteByEntityId(o.objectId.toString())}catch(p){console.warn("Failed to delete deal from database:",p)}return{success:!0,data:{success:!0}}}};var nt={match:b("ticket.creation"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="ticket.creation"&&(console.log("\u{1F3AB} HubSpot Ticket Created:",{objectId:o.objectId,portalId:o.portalId}),t.db.tickets&&o.objectId))try{await t.db.tickets.upsertByEntityId(o.objectId.toString(),{id:o.objectId.toString(),properties:{},createdAt:new Date(o.occurredAt),updatedAt:new Date(o.occurredAt)})}catch(p){console.warn("Failed to save ticket to database:",p)}return{success:!0,data:{success:!0}}}},st={match:b("ticket.propertyChange"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="ticket.propertyChange"&&(console.log("\u{1F4DD} HubSpot Ticket Updated:",{objectId:o.objectId,propertyName:o.propertyName,propertyValue:o.propertyValue}),t.db.tickets&&o.objectId))try{let p=await t.db.tickets.findByEntityId(o.objectId.toString());await t.db.tickets.upsertByEntityId(o.objectId.toString(),{id:o.objectId.toString(),properties:{...p?.data?.properties||{},[o.propertyName||""]:o.propertyValue},createdAt:p?.data?.createdAt||new Date(o.occurredAt),updatedAt:new Date(o.occurredAt)})}catch(p){console.warn("Failed to update ticket in database:",p)}return{success:!0,data:{success:!0}}}},rt={match:b("ticket.deletion"),handler:async(t,a)=>{let s=t.key,r=m(a,s);if(!r.valid)return{success:!1,statusCode:401,error:r.error||"Signature verification failed"};let n=Array.isArray(a.payload)?a.payload:[a.payload];for(let o of n)if(o.subscriptionType==="ticket.deletion"&&(console.log("\u{1F5D1}\uFE0F HubSpot Ticket Deleted:",{objectId:o.objectId,portalId:o.portalId}),t.db.tickets&&o.objectId))try{await t.db.tickets.deleteByEntityId(o.objectId.toString())}catch(p){console.warn("Failed to delete ticket from database:",p)}return{success:!0,data:{success:!0}}}};var x={created:Xe,updated:Ze,deleted:et},O={created:Qe,updated:Ye,deleted:Je},P={created:tt,updated:ot,deleted:at},L={created:nt,updated:st,deleted:rt};var no={contacts:{get:f.get,getMany:f.getMany,createOrUpdate:f.createOrUpdate,delete:f.delete,getRecentlyCreated:f.getRecentlyCreated,getRecentlyUpdated:f.getRecentlyUpdated,search:f.search},companies:{get:S.get,getMany:S.getMany,create:S.create,update:S.update,delete:S.delete,getRecentlyCreated:S.getRecentlyCreated,getRecentlyUpdated:S.getRecentlyUpdated,searchByDomain:S.searchByDomain},deals:{get:C.get,getMany:C.getMany,create:C.create,update:C.update,delete:C.delete,getRecentlyCreated:C.getRecentlyCreated,getRecentlyUpdated:C.getRecentlyUpdated,search:C.search},tickets:{get:R.get,getMany:R.getMany,create:R.create,update:R.update,delete:R.delete},engagements:{get:j.get,getMany:j.getMany,create:j.create,delete:j.delete},contactLists:{addContact:V.addContact,removeContact:V.removeContact}},so={"contacts.get":{input:l.contactsGet,output:y.contactsGet},"contacts.getMany":{input:l.contactsGetMany,output:y.contactsGetMany},"contacts.createOrUpdate":{input:l.contactsCreateOrUpdate,output:y.contactsCreateOrUpdate},"contacts.delete":{input:l.contactsDelete,output:y.contactsDelete},"contacts.getRecentlyCreated":{input:l.contactsGetRecentlyCreated,output:y.contactsGetRecentlyCreated},"contacts.getRecentlyUpdated":{input:l.contactsGetRecentlyUpdated,output:y.contactsGetRecentlyUpdated},"contacts.search":{input:l.contactsSearch,output:y.contactsSearch},"companies.get":{input:l.companiesGet,output:y.companiesGet},"companies.getMany":{input:l.companiesGetMany,output:y.companiesGetMany},"companies.create":{input:l.companiesCreate,output:y.companiesCreate},"companies.update":{input:l.companiesUpdate,output:y.companiesUpdate},"companies.delete":{input:l.companiesDelete,output:y.companiesDelete},"companies.getRecentlyCreated":{input:l.companiesGetRecentlyCreated,output:y.companiesGetRecentlyCreated},"companies.getRecentlyUpdated":{input:l.companiesGetRecentlyUpdated,output:y.companiesGetRecentlyUpdated},"companies.searchByDomain":{input:l.companiesSearchByDomain,output:y.companiesSearchByDomain},"deals.get":{input:l.dealsGet,output:y.dealsGet},"deals.getMany":{input:l.dealsGetMany,output:y.dealsGetMany},"deals.create":{input:l.dealsCreate,output:y.dealsCreate},"deals.update":{input:l.dealsUpdate,output:y.dealsUpdate},"deals.delete":{input:l.dealsDelete,output:y.dealsDelete},"deals.getRecentlyCreated":{input:l.dealsGetRecentlyCreated,output:y.dealsGetRecentlyCreated},"deals.getRecentlyUpdated":{input:l.dealsGetRecentlyUpdated,output:y.dealsGetRecentlyUpdated},"deals.search":{input:l.dealsSearch,output:y.dealsSearch},"tickets.get":{input:l.ticketsGet,output:y.ticketsGet},"tickets.getMany":{input:l.ticketsGetMany,output:y.ticketsGetMany},"tickets.create":{input:l.ticketsCreate,output:y.ticketsCreate},"tickets.update":{input:l.ticketsUpdate,output:y.ticketsUpdate},"tickets.delete":{input:l.ticketsDelete,output:y.ticketsDelete},"engagements.get":{input:l.engagementsGet,output:y.engagementsGet},"engagements.getMany":{input:l.engagementsGetMany,output:y.engagementsGetMany},"engagements.create":{input:l.engagementsCreate,output:y.engagementsCreate},"engagements.delete":{input:l.engagementsDelete,output:y.engagementsDelete},"contactLists.addContact":{input:l.contactListsAddContact,output:y.contactListsAddContact},"contactLists.removeContact":{input:l.contactListsRemoveContact,output:y.contactListsRemoveContact}},ro={contactCreated:x.created,contactUpdated:x.updated,contactDeleted:x.deleted,companyCreated:O.created,companyUpdated:O.updated,companyDeleted:O.deleted,dealCreated:P.created,dealUpdated:P.updated,dealDeleted:P.deleted,ticketCreated:L.created,ticketUpdated:L.updated,ticketDeleted:L.deleted},po={contactCreated:{description:"A new contact was created",payload:_,response:u.object({success:u.boolean()})},contactUpdated:{description:"A contact property was updated",payload:q,response:u.object({success:u.boolean()})},contactDeleted:{description:"A contact was deleted",payload:$,response:u.object({success:u.boolean()})},companyCreated:{description:"A new company was created",payload:K,response:u.object({success:u.boolean()})},companyUpdated:{description:"A company property was updated",payload:Q,response:u.object({success:u.boolean()})},companyDeleted:{description:"A company was deleted",payload:Y,response:u.object({success:u.boolean()})},dealCreated:{description:"A new deal was created",payload:J,response:u.object({success:u.boolean()})},dealUpdated:{description:"A deal property was updated",payload:X,response:u.object({success:u.boolean()})},dealDeleted:{description:"A deal was deleted",payload:Z,response:u.object({success:u.boolean()})},ticketCreated:{description:"A new support ticket was created",payload:ee,response:u.object({success:u.boolean()})},ticketUpdated:{description:"A support ticket property was updated",payload:te,response:u.object({success:u.boolean()})},ticketDeleted:{description:"A support ticket was deleted",payload:oe,response:u.object({success:u.boolean()})}},io="api_key",co={"contacts.get":{riskLevel:"read",description:"Get a specific contact"},"contacts.getMany":{riskLevel:"read",description:"Get multiple contacts"},"contacts.createOrUpdate":{riskLevel:"write",description:"Create a new contact or update an existing one"},"contacts.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete a contact [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"contacts.getRecentlyCreated":{riskLevel:"read",description:"List recently created contacts"},"contacts.getRecentlyUpdated":{riskLevel:"read",description:"List recently updated contacts"},"contacts.search":{riskLevel:"read",description:"Search contacts"},"companies.get":{riskLevel:"read",description:"Get a specific company"},"companies.getMany":{riskLevel:"read",description:"Get multiple companies"},"companies.create":{riskLevel:"write",description:"Create a new company"},"companies.update":{riskLevel:"write",description:"Update an existing company"},"companies.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete a company [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"companies.getRecentlyCreated":{riskLevel:"read",description:"List recently created companies"},"companies.getRecentlyUpdated":{riskLevel:"read",description:"List recently updated companies"},"companies.searchByDomain":{riskLevel:"read",description:"Search companies by domain name"},"deals.get":{riskLevel:"read",description:"Get a specific deal"},"deals.getMany":{riskLevel:"read",description:"Get multiple deals"},"deals.create":{riskLevel:"write",description:"Create a new deal"},"deals.update":{riskLevel:"write",description:"Update an existing deal"},"deals.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete a deal [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"deals.getRecentlyCreated":{riskLevel:"read",description:"List recently created deals"},"deals.getRecentlyUpdated":{riskLevel:"read",description:"List recently updated deals"},"deals.search":{riskLevel:"read",description:"Search deals"},"tickets.get":{riskLevel:"read",description:"Get a specific ticket"},"tickets.getMany":{riskLevel:"read",description:"Get multiple tickets"},"tickets.create":{riskLevel:"write",description:"Create a new support ticket"},"tickets.update":{riskLevel:"write",description:"Update an existing ticket"},"tickets.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete a ticket [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"engagements.get":{riskLevel:"read",description:"Get a specific engagement"},"engagements.getMany":{riskLevel:"read",description:"Get multiple engagements"},"engagements.create":{riskLevel:"write",description:"Create a new engagement"},"engagements.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete an engagement [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"contactLists.addContact":{riskLevel:"write",description:"Add a contact to a static contact list"},"contactLists.removeContact":{riskLevel:"write",description:"Remove a contact from a static contact list"}};function ca(t={}){let a={...t,authType:t.authType??io};return{id:"hubspot",oauthConfig:{providerName:"HubSpot",authUrl:"https://app.hubspot.com/oauth/authorize",tokenUrl:"https://api.hubapi.com/oauth/v1/token",scopes:["crm.objects.contacts.read","crm.objects.contacts.write","crm.objects.companies.read","crm.objects.companies.write","crm.objects.deals.read","crm.objects.deals.write"]},schema:Ke,options:a,hooks:a.hooks,webhookHooks:a.webhookHooks,endpoints:no,webhooks:ro,endpointMeta:co,endpointSchemas:so,webhookSchemas:po,pluginWebhookMatcher:s=>{let n="x-hubspot-signature-v3"in s.headers,o=s.body,B=(Array.isArray(o)?o:[o]).some(g=>typeof g.subscriptionType=="string"&&g.subscriptionType!==void 0);return n||B},errorHandlers:a.errorHandlers||Fe,keyBuilder:async(s,r)=>{let n=s.authType;if(r==="webhook"&&a.webhookSecret)return a.webhookSecret;if(r==="webhook"){let o=await s.keys.get_webhook_signature();if(!o)throw new Error("[auth-missing:hubspot:webhook_signature]: HubSpot webhook signature is missing");return o}if(r==="endpoint"){if(s.authType==="api_key"){let o=await s.keys.get_api_key();if(!o)throw new Error("[auth-missing:hubspot:api_key]: HubSpot API Key is missing");return o}else if(s.authType==="oauth_2"){let o=await s.keys.get_access_token();if(!o)throw new Error("[auth-missing:hubspot:oauth_2]: HubSpot access token is missing");return o}}throw new Error(`[auth-missing:hubspot:${n}]: HubSpot key is missing`)}}}export{b as createHubSpotEventMatch,ca as hubspot,so as hubspotEndpointSchemas,m as verifyHubSpotWebhookSignature};
|
|
@@ -2,79 +2,31 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const HubSpotContact: z.ZodObject<{
|
|
3
3
|
id: z.ZodString;
|
|
4
4
|
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
5
|
-
createdAt: z.ZodOptional<z.ZodNullable<z.
|
|
6
|
-
updatedAt: z.ZodOptional<z.ZodNullable<z.
|
|
5
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
6
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
7
7
|
archived: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
-
},
|
|
9
|
-
id: string;
|
|
10
|
-
properties?: Record<string, any> | undefined;
|
|
11
|
-
archived?: boolean | undefined;
|
|
12
|
-
createdAt?: Date | null | undefined;
|
|
13
|
-
updatedAt?: Date | null | undefined;
|
|
14
|
-
}, {
|
|
15
|
-
id: string;
|
|
16
|
-
properties?: Record<string, any> | undefined;
|
|
17
|
-
archived?: boolean | undefined;
|
|
18
|
-
createdAt?: Date | null | undefined;
|
|
19
|
-
updatedAt?: Date | null | undefined;
|
|
20
|
-
}>;
|
|
8
|
+
}, z.core.$strip>;
|
|
21
9
|
export declare const HubSpotCompany: z.ZodObject<{
|
|
22
10
|
id: z.ZodString;
|
|
23
11
|
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
24
|
-
createdAt: z.ZodOptional<z.ZodNullable<z.
|
|
25
|
-
updatedAt: z.ZodOptional<z.ZodNullable<z.
|
|
12
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
13
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
26
14
|
archived: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
-
},
|
|
28
|
-
id: string;
|
|
29
|
-
properties?: Record<string, any> | undefined;
|
|
30
|
-
archived?: boolean | undefined;
|
|
31
|
-
createdAt?: Date | null | undefined;
|
|
32
|
-
updatedAt?: Date | null | undefined;
|
|
33
|
-
}, {
|
|
34
|
-
id: string;
|
|
35
|
-
properties?: Record<string, any> | undefined;
|
|
36
|
-
archived?: boolean | undefined;
|
|
37
|
-
createdAt?: Date | null | undefined;
|
|
38
|
-
updatedAt?: Date | null | undefined;
|
|
39
|
-
}>;
|
|
15
|
+
}, z.core.$strip>;
|
|
40
16
|
export declare const HubSpotDeal: z.ZodObject<{
|
|
41
17
|
id: z.ZodString;
|
|
42
18
|
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
43
|
-
createdAt: z.ZodOptional<z.ZodNullable<z.
|
|
44
|
-
updatedAt: z.ZodOptional<z.ZodNullable<z.
|
|
19
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
20
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
45
21
|
archived: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
-
},
|
|
47
|
-
id: string;
|
|
48
|
-
properties?: Record<string, any> | undefined;
|
|
49
|
-
archived?: boolean | undefined;
|
|
50
|
-
createdAt?: Date | null | undefined;
|
|
51
|
-
updatedAt?: Date | null | undefined;
|
|
52
|
-
}, {
|
|
53
|
-
id: string;
|
|
54
|
-
properties?: Record<string, any> | undefined;
|
|
55
|
-
archived?: boolean | undefined;
|
|
56
|
-
createdAt?: Date | null | undefined;
|
|
57
|
-
updatedAt?: Date | null | undefined;
|
|
58
|
-
}>;
|
|
22
|
+
}, z.core.$strip>;
|
|
59
23
|
export declare const HubSpotTicket: z.ZodObject<{
|
|
60
24
|
id: z.ZodString;
|
|
61
25
|
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
62
|
-
createdAt: z.ZodOptional<z.ZodNullable<z.
|
|
63
|
-
updatedAt: z.ZodOptional<z.ZodNullable<z.
|
|
26
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
27
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
64
28
|
archived: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
-
},
|
|
66
|
-
id: string;
|
|
67
|
-
properties?: Record<string, any> | undefined;
|
|
68
|
-
archived?: boolean | undefined;
|
|
69
|
-
createdAt?: Date | null | undefined;
|
|
70
|
-
updatedAt?: Date | null | undefined;
|
|
71
|
-
}, {
|
|
72
|
-
id: string;
|
|
73
|
-
properties?: Record<string, any> | undefined;
|
|
74
|
-
archived?: boolean | undefined;
|
|
75
|
-
createdAt?: Date | null | undefined;
|
|
76
|
-
updatedAt?: Date | null | undefined;
|
|
77
|
-
}>;
|
|
29
|
+
}, z.core.$strip>;
|
|
78
30
|
export declare const HubSpotEngagement: z.ZodObject<{
|
|
79
31
|
id: z.ZodString;
|
|
80
32
|
engagement: z.ZodOptional<z.ZodObject<{
|
|
@@ -88,64 +40,10 @@ export declare const HubSpotEngagement: z.ZodObject<{
|
|
|
88
40
|
ownerId: z.ZodOptional<z.ZodNumber>;
|
|
89
41
|
type: z.ZodOptional<z.ZodString>;
|
|
90
42
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
91
|
-
},
|
|
92
|
-
type?: string | undefined;
|
|
93
|
-
id?: number | undefined;
|
|
94
|
-
active?: boolean | undefined;
|
|
95
|
-
timestamp?: number | undefined;
|
|
96
|
-
createdAt?: number | undefined;
|
|
97
|
-
portalId?: number | undefined;
|
|
98
|
-
lastUpdated?: number | undefined;
|
|
99
|
-
createdBy?: number | undefined;
|
|
100
|
-
modifiedBy?: number | undefined;
|
|
101
|
-
ownerId?: number | undefined;
|
|
102
|
-
}, {
|
|
103
|
-
type?: string | undefined;
|
|
104
|
-
id?: number | undefined;
|
|
105
|
-
active?: boolean | undefined;
|
|
106
|
-
timestamp?: number | undefined;
|
|
107
|
-
createdAt?: number | undefined;
|
|
108
|
-
portalId?: number | undefined;
|
|
109
|
-
lastUpdated?: number | undefined;
|
|
110
|
-
createdBy?: number | undefined;
|
|
111
|
-
modifiedBy?: number | undefined;
|
|
112
|
-
ownerId?: number | undefined;
|
|
113
|
-
}>>;
|
|
43
|
+
}, z.core.$strip>>;
|
|
114
44
|
associations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
115
45
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
116
|
-
},
|
|
117
|
-
id: string;
|
|
118
|
-
associations?: Record<string, any> | undefined;
|
|
119
|
-
engagement?: {
|
|
120
|
-
type?: string | undefined;
|
|
121
|
-
id?: number | undefined;
|
|
122
|
-
active?: boolean | undefined;
|
|
123
|
-
timestamp?: number | undefined;
|
|
124
|
-
createdAt?: number | undefined;
|
|
125
|
-
portalId?: number | undefined;
|
|
126
|
-
lastUpdated?: number | undefined;
|
|
127
|
-
createdBy?: number | undefined;
|
|
128
|
-
modifiedBy?: number | undefined;
|
|
129
|
-
ownerId?: number | undefined;
|
|
130
|
-
} | undefined;
|
|
131
|
-
metadata?: Record<string, any> | undefined;
|
|
132
|
-
}, {
|
|
133
|
-
id: string;
|
|
134
|
-
associations?: Record<string, any> | undefined;
|
|
135
|
-
engagement?: {
|
|
136
|
-
type?: string | undefined;
|
|
137
|
-
id?: number | undefined;
|
|
138
|
-
active?: boolean | undefined;
|
|
139
|
-
timestamp?: number | undefined;
|
|
140
|
-
createdAt?: number | undefined;
|
|
141
|
-
portalId?: number | undefined;
|
|
142
|
-
lastUpdated?: number | undefined;
|
|
143
|
-
createdBy?: number | undefined;
|
|
144
|
-
modifiedBy?: number | undefined;
|
|
145
|
-
ownerId?: number | undefined;
|
|
146
|
-
} | undefined;
|
|
147
|
-
metadata?: Record<string, any> | undefined;
|
|
148
|
-
}>;
|
|
46
|
+
}, z.core.$strip>;
|
|
149
47
|
export type HubSpotContact = z.infer<typeof HubSpotContact>;
|
|
150
48
|
export type HubSpotCompany = z.infer<typeof HubSpotCompany>;
|
|
151
49
|
export type HubSpotDeal = z.infer<typeof HubSpotDeal>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../schema/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../schema/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc;;;;;;iBAMzB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;iBAMzB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;iBAMtB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;iBAMxB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;iBAkB5B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACtD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const HubSpotCredentials: z.ZodObject<{
|
|
3
3
|
token: z.ZodString;
|
|
4
|
-
},
|
|
5
|
-
token: string;
|
|
6
|
-
}, {
|
|
7
|
-
token: string;
|
|
8
|
-
}>;
|
|
4
|
+
}, z.core.$strip>;
|
|
9
5
|
export type HubSpotCredentials = z.infer<typeof HubSpotCredentials>;
|
|
10
6
|
export declare const HubSpotSchema: {
|
|
11
7
|
readonly version: "1.0.0";
|
|
@@ -13,79 +9,31 @@ export declare const HubSpotSchema: {
|
|
|
13
9
|
readonly contacts: z.ZodObject<{
|
|
14
10
|
id: z.ZodString;
|
|
15
11
|
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
16
|
-
createdAt: z.ZodOptional<z.ZodNullable<z.
|
|
17
|
-
updatedAt: z.ZodOptional<z.ZodNullable<z.
|
|
12
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
13
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
18
14
|
archived: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
-
},
|
|
20
|
-
id: string;
|
|
21
|
-
properties?: Record<string, any> | undefined;
|
|
22
|
-
archived?: boolean | undefined;
|
|
23
|
-
createdAt?: Date | null | undefined;
|
|
24
|
-
updatedAt?: Date | null | undefined;
|
|
25
|
-
}, {
|
|
26
|
-
id: string;
|
|
27
|
-
properties?: Record<string, any> | undefined;
|
|
28
|
-
archived?: boolean | undefined;
|
|
29
|
-
createdAt?: Date | null | undefined;
|
|
30
|
-
updatedAt?: Date | null | undefined;
|
|
31
|
-
}>;
|
|
15
|
+
}, z.core.$strip>;
|
|
32
16
|
readonly companies: z.ZodObject<{
|
|
33
17
|
id: z.ZodString;
|
|
34
18
|
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
35
|
-
createdAt: z.ZodOptional<z.ZodNullable<z.
|
|
36
|
-
updatedAt: z.ZodOptional<z.ZodNullable<z.
|
|
19
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
20
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
37
21
|
archived: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
-
},
|
|
39
|
-
id: string;
|
|
40
|
-
properties?: Record<string, any> | undefined;
|
|
41
|
-
archived?: boolean | undefined;
|
|
42
|
-
createdAt?: Date | null | undefined;
|
|
43
|
-
updatedAt?: Date | null | undefined;
|
|
44
|
-
}, {
|
|
45
|
-
id: string;
|
|
46
|
-
properties?: Record<string, any> | undefined;
|
|
47
|
-
archived?: boolean | undefined;
|
|
48
|
-
createdAt?: Date | null | undefined;
|
|
49
|
-
updatedAt?: Date | null | undefined;
|
|
50
|
-
}>;
|
|
22
|
+
}, z.core.$strip>;
|
|
51
23
|
readonly deals: z.ZodObject<{
|
|
52
24
|
id: z.ZodString;
|
|
53
25
|
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
54
|
-
createdAt: z.ZodOptional<z.ZodNullable<z.
|
|
55
|
-
updatedAt: z.ZodOptional<z.ZodNullable<z.
|
|
26
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
27
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
56
28
|
archived: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
-
},
|
|
58
|
-
id: string;
|
|
59
|
-
properties?: Record<string, any> | undefined;
|
|
60
|
-
archived?: boolean | undefined;
|
|
61
|
-
createdAt?: Date | null | undefined;
|
|
62
|
-
updatedAt?: Date | null | undefined;
|
|
63
|
-
}, {
|
|
64
|
-
id: string;
|
|
65
|
-
properties?: Record<string, any> | undefined;
|
|
66
|
-
archived?: boolean | undefined;
|
|
67
|
-
createdAt?: Date | null | undefined;
|
|
68
|
-
updatedAt?: Date | null | undefined;
|
|
69
|
-
}>;
|
|
29
|
+
}, z.core.$strip>;
|
|
70
30
|
readonly tickets: z.ZodObject<{
|
|
71
31
|
id: z.ZodString;
|
|
72
32
|
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
73
|
-
createdAt: z.ZodOptional<z.ZodNullable<z.
|
|
74
|
-
updatedAt: z.ZodOptional<z.ZodNullable<z.
|
|
33
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
34
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
75
35
|
archived: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
-
},
|
|
77
|
-
id: string;
|
|
78
|
-
properties?: Record<string, any> | undefined;
|
|
79
|
-
archived?: boolean | undefined;
|
|
80
|
-
createdAt?: Date | null | undefined;
|
|
81
|
-
updatedAt?: Date | null | undefined;
|
|
82
|
-
}, {
|
|
83
|
-
id: string;
|
|
84
|
-
properties?: Record<string, any> | undefined;
|
|
85
|
-
archived?: boolean | undefined;
|
|
86
|
-
createdAt?: Date | null | undefined;
|
|
87
|
-
updatedAt?: Date | null | undefined;
|
|
88
|
-
}>;
|
|
36
|
+
}, z.core.$strip>;
|
|
89
37
|
readonly engagements: z.ZodObject<{
|
|
90
38
|
id: z.ZodString;
|
|
91
39
|
engagement: z.ZodOptional<z.ZodObject<{
|
|
@@ -99,64 +47,10 @@ export declare const HubSpotSchema: {
|
|
|
99
47
|
ownerId: z.ZodOptional<z.ZodNumber>;
|
|
100
48
|
type: z.ZodOptional<z.ZodString>;
|
|
101
49
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
102
|
-
},
|
|
103
|
-
type?: string | undefined;
|
|
104
|
-
id?: number | undefined;
|
|
105
|
-
active?: boolean | undefined;
|
|
106
|
-
timestamp?: number | undefined;
|
|
107
|
-
createdAt?: number | undefined;
|
|
108
|
-
portalId?: number | undefined;
|
|
109
|
-
lastUpdated?: number | undefined;
|
|
110
|
-
createdBy?: number | undefined;
|
|
111
|
-
modifiedBy?: number | undefined;
|
|
112
|
-
ownerId?: number | undefined;
|
|
113
|
-
}, {
|
|
114
|
-
type?: string | undefined;
|
|
115
|
-
id?: number | undefined;
|
|
116
|
-
active?: boolean | undefined;
|
|
117
|
-
timestamp?: number | undefined;
|
|
118
|
-
createdAt?: number | undefined;
|
|
119
|
-
portalId?: number | undefined;
|
|
120
|
-
lastUpdated?: number | undefined;
|
|
121
|
-
createdBy?: number | undefined;
|
|
122
|
-
modifiedBy?: number | undefined;
|
|
123
|
-
ownerId?: number | undefined;
|
|
124
|
-
}>>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
125
51
|
associations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
126
52
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
127
|
-
},
|
|
128
|
-
id: string;
|
|
129
|
-
associations?: Record<string, any> | undefined;
|
|
130
|
-
engagement?: {
|
|
131
|
-
type?: string | undefined;
|
|
132
|
-
id?: number | undefined;
|
|
133
|
-
active?: boolean | undefined;
|
|
134
|
-
timestamp?: number | undefined;
|
|
135
|
-
createdAt?: number | undefined;
|
|
136
|
-
portalId?: number | undefined;
|
|
137
|
-
lastUpdated?: number | undefined;
|
|
138
|
-
createdBy?: number | undefined;
|
|
139
|
-
modifiedBy?: number | undefined;
|
|
140
|
-
ownerId?: number | undefined;
|
|
141
|
-
} | undefined;
|
|
142
|
-
metadata?: Record<string, any> | undefined;
|
|
143
|
-
}, {
|
|
144
|
-
id: string;
|
|
145
|
-
associations?: Record<string, any> | undefined;
|
|
146
|
-
engagement?: {
|
|
147
|
-
type?: string | undefined;
|
|
148
|
-
id?: number | undefined;
|
|
149
|
-
active?: boolean | undefined;
|
|
150
|
-
timestamp?: number | undefined;
|
|
151
|
-
createdAt?: number | undefined;
|
|
152
|
-
portalId?: number | undefined;
|
|
153
|
-
lastUpdated?: number | undefined;
|
|
154
|
-
createdBy?: number | undefined;
|
|
155
|
-
modifiedBy?: number | undefined;
|
|
156
|
-
ownerId?: number | undefined;
|
|
157
|
-
} | undefined;
|
|
158
|
-
metadata?: Record<string, any> | undefined;
|
|
159
|
-
}>;
|
|
53
|
+
}, z.core.$strip>;
|
|
160
54
|
};
|
|
161
55
|
};
|
|
162
56
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,kBAAkB;;iBAE7B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAShB,CAAC"}
|