PageSourceSearch

https://app.hightouch.com/assets/index-DYw9-j8-.js

js hightouch.com collected 2026-09-24 07:24:20 UTC 10,334 bytes, 2 lines download raw bytes

1import{af as e,aw as de,b4 as le,r as m,a9 as $,as as ue}from"./vendor-B2oIjyY4.js";import{R as y,an as F,B as O,Cy as he,bV as ge,I as T,gW as V,k as ve,b as L,p as P,BE as pe,IK as me,FR as ye,G as _e,dq as be,w as q,IL as H,ca as N,cN as fe,c8 as xe,C as S,f6 as Q,T as U,fg as G,bM as we,l as K,f8 as J,n as X,f9 as Y,bR as Z,i as je,S as Se,aj as W,y as ee,s3 as Ee,IM as Ce,sa as Ie,e1 as De,f5 as Me}from"./main-CJK8sxkW.js";import{e as ne,a as ke}from"./types-WJ9Oe6Nf.js";import{a as Te,I as We}from"./icon-stack-Bc-6S09d.js";import{u as te}from"./use-optimistic-value-ACNSQkFa.js";import{k as se}from"./keyBy-gKMqFstq.js";import{E}from"./types-ypUuiJby.js";import"./bounded-range-fetch-CggGfMWc.js";import"./vendor-charts-BqgCVUWx.js";const ae=({syncId:n,isWarehouseSync:i,sources:o,destination:a,sourceDefinitionsById:g,destinationDefinition:v})=>{var l,c;const r=o.length>1,u=o[0],d=u?g[u.id]:void 0;return e.jsxs(y,{flex:1,alignItems:"center",gap:4,overflow:"hidden",sx:{a:{color:"text.primary"},"a:hover":{color:"link.default"}},children:[e.jsx(F,{message:i?"Storage sync":"Forwarding sync",children:e.jsx(y,{align:"center",justify:"center",bg:"base.background",w:8,h:8,borderRadius:"sm",flexShrink:0,children:e.jsx(O,{as:i?he:ge,boxSize:5,color:"text.secondary"})})}),r?e.jsx(Te,{items:o.map(h=>{const _=g[h.id];return{id:h.id,renderIcon:()=>e.jsx(We,{children:e.jsx(T,{name:_.name,src:_.icon})})}})}):e.jsx(T,{name:d==null?void 0:d.name,src:d==null?void 0:d.icon}),e.jsx(V,{href:r?`/events/syncs/${n}/sources`:`/events/sources/${(l=o[0])==null?void 0:l.id}`,fontWeight:"semibold",fontSize:"lg",color:"inherit",children:r?`${o.length} ${de("source",o.length)}`:(c=o[0])==null?void 0:c.name}),e.jsx(O,{as:ve,color:"text.secondary",boxSize:6}),e.jsx(T,{name:v.name,src:v.icon}),e.jsx(V,{href:`/events/destinations/${a.id}`,fontWeight:"semibold",fontSize:"lg",color:"inherit",children:a.name??v.name})]})},Pe=({sync:n})=>{var z,A;const{toast:i}=ee(),o=L(),a=le(),{workspace:g}=P(),v=g==null?void 0:g.alerting_v2_enabled,[r,u]=m.useState(!1),[d,l]=m.useState(!1),[c,h]=m.useState(n.enabled!==!1);m.useEffect(()=>{h(n.enabled!==!1)},[n.enabled]);const{optimisticValue:_,setOptimisticValue:x,clearOptimisticValue:C}=te({name:n.name},n),{name:b}=_,w=pe(),j=me(),I=ye({onSuccess:()=>{}}),D=$(se(n.event_warehouse_sync_sources.map(t=>({id:t.event_source.id,definition:ne[t.event_source.type]})),"id"),t=>t.definition),M=ke[n.event_warehouse_destination.type],f=(z=n.event_warehouse_sync_sources)==null?void 0:z.some(t=>t.event_source.type===E.CEP),s=m.useMemo(()=>n.event_warehouse_sync_sources.map(t=>({id:t.event_source.id,name:t.event_source.name})),[n.event_warehouse_sync_sources]),p=(A=n.runs)==null?void 0:A[0],ie=p&&p.started_at&&!p.finished_at,re=async()=>{try{I.mutateAsync({id:n.id}),i({id:"run-success",title:"Sync run has been initiated.",variant:"success"})}catch(t){W(t),i({id:"run-error",title:"There was a problem running your sync.",variant:"error"})}},oe=async t=>
1{try{await w.mutateAsync({id:n.id,input:t}),i({id:"update-event-sync",title:"Event sync was updated",variant:"success"})}catch{C(),i({id:"update-event-sync-error",title:"There was a problem updating your event sync.",variant:"error"})}},R=async t=>{h(t);try{await w.mutateAsync({id:n.id,input:{enabled:t}}),i({id:"toggle-event-sync",title:`Sync was ${t?"enabled":"disabled"}`,...t?{variant:"success"}:{variant:"warning",message:"Events received while this sync is disabled, along with any already-queued events that haven't been delivered yet, will be dropped and cannot be recovered when the sync is re-enabled."}}),a.invalidateQueries(["EventSync"])}catch(k){h(!t),W(k),i({id:"toggle-event-sync",title:`Sync could not be ${t?"enabled":"disabled"}`,message:k.message,variant:"error"})}},ce=t=>{t?R(!0):l(!0)},B=e.jsx(_e,{size:"lg",permission:{v2:{resource:"event_warehouse_sync",grant:"can_run",id:n.id}},isDisabled:!c,icon:be,onClick:()=>{re()},children:"Run"});return e.jsxs(q,{title:"Sync",crumbs:[{label:"Syncs",link:"/events/syncs"},...b?[{label:b}]:[]],tabDepth:5,tabs:[{title:"Runs",path:"runs",variant:"table"},{title:"Archived failures",path:"archive",variant:"table"},{title:"Schedule",path:"schedule",variant:"form"},{title:"Sources",path:"sources",variant:"table"},{title:"Alerting",path:"alerting",isHidden:!v,variant:"form",hasBottomPadding:!0}],header:e.jsx(S,{flex:1,minWidth:0,gap:2,children:e.jsxs(y,{flex:1,justify:"space-between",minWidth:0,pt:1,children:[e.jsxs(S,{gap:4,align:"left",children:[b&&e.jsx(Q,{permission:{v2:{resource:"event_warehouse_sync",grant:"can_update",id:n.id}},isDisabled:f,size:"lg",value:b,onChange:t=>{x({..._,name:t}),oe({name:t,schedule:n.schedule})}}),e.jsx(ae,{syncId:n.id,isWarehouseSync:!0,sourceDefinitionsById:D,destinationDefinition:M,sources:s,destination:n.event_warehouse_destination})]}),e.jsxs(y,{align:"center",gap:3,children:[!f&&e.jsxs(y,{align:"center",gap:2,children:[e.jsx(U,{textTransform:"uppercase",size:"sm",fontWeight:"semibold",color:"text.tertiary",children:c?"Enabled":"Disabled"}),e.jsx(G,{"aria-label":"Enable sync.",permission:{v2:{resource:"event_warehouse_sync",grant:"can_update",id:n.id}},isChecked:c,onChange:ce})]}),e.jsxs(we,{size:"lg",children:[!f&&e.jsxs(K,{children:[e.jsx(J,{variant:"secondary",size:"lg"}),e.jsx(X,{children:e.jsx(Y,{permission:{v2:{resource:"event_warehouse_sync",grant:"can_delete",id:n.id}},icon:Z,variant:"danger",onClick:()=>{u(!0)},children:"Delete"})})]}),ie?e.jsxs(je,{isDisabled:!0,children:[e.jsx(Se,{size:"sm",mr:2}),"Running"]}):c?B:e.jsx(F,{message:"This sync is disabled. Re-enable it to run.",children:B})]})]})]})}),children:[e.jsx(H,{context:{sync:n,type:"warehouse"}}),e.jsx(N,{isOpen:r,resourceLabel:"sync",onClose:()=>{u(!1)},onDelete:async()=>{await j.mutateAsync({id:n.id}),o("/events/syncs")}}),e.jsx(fe,{isOpen:d,title:"Disable sync?",confirmButtonText:"Disable sync",variant:"warning",onClose:()=>l(!1),onConfirm:async()=>{l(!1),await R(!1)},children:e.jsx(xe,{children:"Events received while this sync is disabled will be dropped, along with any already-queued events that haven't been delivered yet. They cannot be recovered when the sync is re-enabled."})})]})},Re=({sync:n})=>{var f;const{toast:i}=ee(),{workspace:o}=P(),a=L(),[g,v]=m.useState(!1),[r,u]=m.useState(n.enabled!==!1),{optimisticValue:d,setOptimisticValue:l,clearOptimisticValue:c}=te({name:n.name},n),{name:h}=d,_=o==null?void 0:o.alerting_v2_enabled;m.useEffect(()=>{u(n.enabled!==!1)},[n.enabled]);const x=Ee(),C=Ce(),b=$(se(n.event_forwarding_sync_sources.map(s=>({id:s.event_source.id,definition:ne[s.event_source.type]})),"id"),s=>s.definition),w=n.destination.definition,j=(f=n.event_forwarding_sync_sources)==null?void 0:f.some(s=>{var p;return((p=s.event_source)==null?void 0:p.type)===E.CEP}),I=m.useMemo(()=>n.event_forwarding_sync_sources.map(s=>({id:s.event_source.id,name:s.event_source.name})),[n.event_forwarding_sync_sources]),D=async s=>
1{try{await x.mutateAsync({id:n.id,input:s}),i({id:"update-event-sync",title:"Event sync was updated",variant:"success"})}catch{c(),i({id:"update-event-sync",title:"There was a problem updating your event sync.",variant:"error"})}},M=async s=>{u(s);try{await x.mutateAsync({id:n.id,input:{enabled:s}}),i({id:"toggle-event-sync",title:`Sync was ${s?"enabled":"disabled"}`,...s?{variant:"success"}:{variant:"warning",message:"Events received while this sync is disabled will not be forwarded to this destination and cannot be replayed later."}})}catch(p){u(!s),W(p),i({id:"toggle-event-sync",title:`Sync could not be ${s?"enabled":"disabled"}`,message:p.message,variant:"error"})}};return e.jsxs(q,{title:"Sync",crumbs:[{label:"Syncs",link:"/events/syncs"},...h?[{label:h}]:[]],tabDepth:5,tabs:[{path:"overview",title:"Overview",variant:"card",hasBottomPadding:!0},{path:"configuration",title:"Configuration",variant:"fullPage"},{path:"sources",title:"Sources",variant:"table"},{path:"errors",title:"Errors",variant:"table"},{title:"Alerting",path:"alerting",isHidden:!_,variant:"form",hasBottomPadding:!0}],header:e.jsx(S,{flex:1,minWidth:0,gap:2,children:e.jsxs(y,{flex:1,justify:"space-between",minWidth:0,pt:1,children:[e.jsxs(S,{gap:4,align:"left",children:[h&&e.jsx(Q,{permission:{v2:{resource:"event_forwarding_sync",grant:"can_update",id:n.id}},isDisabled:j,size:"lg",value:h,onChange:s=>{l({...d,name:s}),D({name:s})}}),e.jsx(ae,{syncId:n.id,isWarehouseSync:!1,sourceDefinitionsById:b,destinationDefinition:w,sources:I,destination:n.destination})]}),!j&&e.jsxs(y,{align:"center",gap:4,children:[e.jsxs(y,{align:"center",gap:2,children:[e.jsx(U,{textTransform:"uppercase",size:"sm",fontWeight:"semibold",color:"text.tertiary",children:r?"Enabled":"Disabled"}),e.jsx(G,{"aria-label":"Enable sync.",permission:{v2:{resource:"event_forwarding_sync",grant:"can_update",id:n.id}},isChecked:r,onChange:M})]}),e.jsxs(K,{children:[e.jsx(J,{variant:"secondary"}),e.jsx(X,{children:e.jsx(Y,{permission:{v2:{resource:"event_forwarding_sync",grant:"can_delete",id:n.id}},icon:Z,variant:"danger",onClick:()=>{v(!0)},children:"Delete"})})]})]})]})}),children:[e.jsx(H,{context:{sync:n,type:"forwarding"}}),e.jsx(N,{resourceLabel:"sync",isOpen:g,onClose:()=>{v(!1)},onDelete:async()=>{await C.mutateAsync({id:n.id}),a("/events/syncs")}})]})},He=()=>{const{workspace:n,user:i}=P(),{id:o}=ue(),{data:a,isLoading:g}=Ie({id:String(o),workspaceId:n==null?void 0:n.id},{enabled:!!o});if(g)return e.jsx(De,{});const v=(i==null?void 0:i.can_impersonate)===!0,r=(a==null?void 0:a.event_warehouse_syncs_by_pk)??(a==null?void 0:a.event_forwarding_syncs_by_pk),u=(r==null?void 0:r.__typename)==="event_forwarding_syncs"?r.event_forwarding_sync_sources.some(l=>{var c;return((c=l.event_source)==null?void 0:c.type)===E.ONSITE}):(r==null?void 0:r.__typename)==="event_warehouse_syncs"?r.event_warehouse_sync_sources.some(l=>{var c;return((c=l.event_source)==null?void 0:c.type)===E.ONSITE}):!1,d=e.jsx(Me,{subtitle:"An error occurred while fetching this resource. Please try again, or contact support if the issue persists.",title:"Event sync not found"});return u&&!v?d:a!=null&&a.event_warehouse_syncs_by_pk?e.jsx(Pe,{sync:a.event_warehouse_syncs_by_pk}):a!=null&&a.event_forwarding_syncs_by_pk?e.jsx(Re,{sync:a.event_forwarding_syncs_by_pk}):d};export{He as EventSync};
2//# sourceMappingURL=index-DYw9-j8-.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.