PageSourceSearch

https://app.hightouch.com/assets/event-catalog-CY6hFA4n.js

js hightouch.com collected 2026-09-24 07:24:08 UTC 5,705 bytes, 2 lines download raw bytes

1import{r as d,cb as H,aq as Q,ao as w,af as t,cc as P}from"./vendor-B2oIjyY4.js";import{ru as Y,rl as I,p as q,d9 as W,rn as D,rw as J,rx as K,rk as X,aY as Z,eC as ee,C as te,ry as ae,rz as ne,rA as se,ea as oe,ae as re,j as ie,i as le,L as _,e as ce,T as y,am as de,b4 as ue,x as me,at as ve,rB as A,b as pe}from"./main-CJK8sxkW.js";import{E as he}from"./utils-DnDWukUz.js";import{c as ye}from"./utils-Cex3K4B7.js";import{L as ge}from"./last-updated-Cvo02YKE.js";import{s as xe,a as fe}from"./composite-ids-zuybeVKj.js";import{E as Ce}from"./event-volume-display-CExGF3ts.js";import{u as be}from"./use-active-alerts-for-source-il0f9OS6.js";import{C as Te}from"./content-header-Bu9-RFzG.js";import{A as Ee}from"./add-to-domain-modal-Bcu4Lke9.js";import{u as je,n as _e}from"./urls-CchGUaiy.js";import"./bounded-range-fetch-CggGfMWc.js";import"./vendor-charts-BqgCVUWx.js";import"./sparkline-BjzozI0J.js";import"./use-domains-DiBI2RIt.js";import"./use-collected-event-observations-B3GfDdxR.js";import"./use-event-library-CgrcTVYz.js";var O=(n=>(n.Name="eventName",n.Alerts="hasMonitors",n.UpdatedAt="updated_at",n))(O||{});const He=()=>{const{source:n}=Y(),[o,g]=d.useState(""),[l,x]=d.useState(I.OneDay),u=D[l],{workspace:i}=q(),B=i==null?void 0:i.alerting_v2_enabled,{sortKey:f,sortDirection:C,columnSortState:b}=W({defaultSortKey:"updated_at",sortOptions:Object.values(O)}),T=H(new Date,{roundingMethod:"ceil"}),L=Q(T,u.days*24),{data:m,isLoading:R}=J({input:{id:n.id,resourceType:"SOURCE",endTime:T.valueOf(),startTime:L.valueOf(),metrics:["RECEIVED"],aggType:"SUM"}},{refetchInterval:P(60),select:e=>w.sortBy(e.getAvailableEventMetrics.results.map(a=>({timestamp:new Date(a.maxTimestamp),volume:a.value,eventType:ve(A,A.Track)(a.dimensions.eventType),eventName:a.dimensions.eventName||void 0})),a=>a.volume).reverse()||[]}),{data:r,isLoading:k}=K({event_source_id:n.id},{select:e=>{var a,s,h;return((h=(s=(a=e.event_sources_by_pk)==null?void 0:a.event_sources_plans)==null?void 0:s[0])==null?void 0:h.event_plan)||void 0}}),{data:v}=X({sourceIdLike:xe(n.id)},{select:e=>e.resource_monitor_conditions}),{isLoading:U,alerts:G}=be({sourceId:n.id}),E=!U&&w.groupBy(G,e=>e.eventTypeResourceId),[j,N]=d.useState(null),p=d.useMemo(()=>m?(o===""?m:m.filter(e=>{var a;return e.eventType.toLowerCase().includes(o.toLowerCase())||((a=e.eventName)==null?void 0:a.toLowerCase().includes(o.toLowerCase()))})).map(e=>{var M;const a=r==null?void 0:r.event_schemas.find(c=>c.event_type===e.eventType&&c.event_name===(e.eventName||null)),s=fe({eventSourceId:n.id,eventName:e.eventName,eventType:e.eventType}),h=!!(v!=null&&v.find(c=>c.resource_id===s&&c.enabled)),z=E&&((M=E[s])==null?void 0:M.length)||0,S=a&&r?r.name:t.jsxs(t.Fragment,{children:["Configure ",t.jsx(Z,{})]}),F=a?{type:"link",label:S,link:`/events/domains/${r==null?void 0:r.id}/${ye({eventType:e.eventType,eventName:e.eventName,eventVersion:a.event_version})}`}:{type:"button",label:S,onClick:()=>{N(e)}};return{...e,volume:e.volume.toLocaleString(),eventResourceId:s,hasMonitors:h,activeAlertCount:z,...a||{created_at:null,updated_at:null,created_by_user:null,updated_by_user:null},contractMetadata:k?{type:"contract-loading"}:F}}):[],[o,m,r,k,v,E]),V=d.useMemo(()=>!f||!C||!p?p:ee(p,f,C),[p,f,C]),$=o?t.jsxs(y,{whiteSpace:"pre-wrap",color:"text.secondary",children:["No events found for search ",t.jsxs(y,{fontWeight:"medium",children:['"',o,'"']})]}):t.jsxs(y,{color:"text.secondary",children:["Note that new event types can take a few minutes to be added to the catalog after their first occurrence. Check out our"," ",t.jsx(_,{href:"https://hightouch.com/docs/events/overview",children:"Events documentation"})," ","to learn more."]});return t.jsxs(t.Fragment,{children:[t.jsxs(te,{width:"100%",children:[t.jsx(Te,{variant:"table",search:t.jsx(re,{width:"lg",placeholder:"Search by type or name…",value:o,onChange:e=>{g(e.target.value)}}),actions:t.jsx(ae,{value:l,onChange:e=>{oe(I)(e)&&x(e)},children:ne.map(e=>t.jsx(se,{label:D[e].label,value:e},e))})}),t.jsx(ie,{loading:R,columns:[{name:"Name",...b("eventName"),max:"auto",cell:({eventType:e,eventName:a})=>t.jsx(he,{eventType:e,title:a})},{name:`Volume (${u.label})`,min:"auto",cell:({eventName:e,eventType:a})=>t.jsx(Ce,{sourceId:n.id,endTime:T,startTime:L,eventName:e,eventType:a,granularity:l})},{name:"Contract",min:"auto",breakpoint:"md",cell:({contractMetadata:e})=>{const a=e.type==="contract-loading";let s;switch(e.type){case"link":s=t.jsx(_,{href:e.link,children:e.label});break;case"button":s=t.jsx(le,{variant:"link",onClick:()=>e.onClick(),children:e.label});break}return t.jsx(ce,{isLoading:a,children:t.jsx(y,{children:a?"----":s})})}},...B?[{name:"Alerts",...b("hasMonitors"),min:"auto",cell:({eventResourceId:e,hasMonitors:a,activeAlertCount:s})=>t.jsx(_,{href:`configure/${encodeURIComponent(e)}`,children:s?t.jsxs(t.Fragment,{children:[t.jsx(de,{variant:"error",mr:1,size:"sm",children:s})," ","Critical"]}):a?"Monitoring…":"Configure"})}]:[],{...b("updated_at"),...ge}].filter(ue),data:V,placeholder:{body:$,title:"No events found"}}),t.jsx(me,{})]}),j&&t.jsx(Le,{eventType:j.eventType,eventName:j.eventName,onClose:()=>N(null)})]})},Le=({eventType:n,eventName:o,onClose:g})=>
1{const l=pe(),{contractedDomains:x,isLoading:u}=je({eventName:o||null,eventType:n});return t.jsx(Ee,{isOpen:!0,onClose:g,title:"Add to domain",description:"Choose the domain that should declare this event. You'll define its schema on the next page.",excludedDomainIds:x.map(i=>i.id),emptyText:"Every domain already declares this event.",isLoading:u,onContinue:i=>l(_e({domainId:i,eventType:n,eventName:o}))})};export{He as EventCatalog};
2//# sourceMappingURL=event-catalog-CY6hFA4n.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.