PageSourceSearch

https://app.hightouch.com/assets/data-extraction-Bb2Z5VIG.js

js hightouch.com collected 2026-09-24 07:25:29 UTC 7,838 bytes, 2 lines download raw bytes

1import{as as Q,r as g,af as e,b7 as k,b8 as z}from"./vendor-B2oIjyY4.js";import{f2 as $,d9 as H,_ as q,eu as G,fd as V,fe as Y,ff as X,R as f,C as o,A as K,T as c,h as y,fg as Z,c8 as P,fh as J,e3 as ee,fi as ne,c9 as se,D as te,fj as ae,eY as ie,i as B,fk as re,fl as oe,fm as ce,bM as le,G as de,y as ue,am as _,de as R,j as he,B as S,dm as xe,fn as me,bL as ge,fo as d,cr as A}from"./main-CJK8sxkW.js";import"./bounded-range-fetch-CggGfMWc.js";import"./vendor-charts-BqgCVUWx.js";const fe={type:ge.INTERVAL,schedule:{interval:{unit:me.DAY,quantity:1}}},pe=["snowflake","bigquery","postgres","fabric"],ve=()=>{var T,E;const{destination_id:n}=Q(),{data:s}=$({id:String(n)},{enabled:!!n,select:r=>r.destinations_by_pk,suspense:!0}),{toast:i}=ue(),[t,p]=g.useState(!!(s!=null&&s.analytics_ingestion_schedule)),[h,x]=g.useState((T=s==null?void 0:s.analytics_ingestion_connection_id)==null?void 0:T.toString()),{page:j,limit:a,offset:u,setPage:U}=H({limit:10}),[w,C]=g.useState(null),{isPermitted:W}=q({v2:{resource:"destination",grant:"can_update",id:n}}),{mutateAsync:v,isLoading:F,isSuccess:D}=G();g.useEffect(()=>{D&&i({id:"update-destination",title:"Data extraction settings were updated",variant:"success"})},[D]);const{data:I}=V({destinationId:n},{enabled:!!n,refetchInterval:1e4,select:r=>r.latestIngestionJob}),{data:b}=Y({destinationId:n},{enabled:!!n,refetchInterval:1e4,select:r=>r.analytics_ingestion_stats}),{data:l}=X({filters:{plan_in_warehouse:{_eq:!0}}},{select:r=>r.connections}),L=g.useMemo(()=>{var r;return((r=l==null?void 0:l.filter(m=>pe.includes(m.type)))==null?void 0:r.map(m=>({value:`${m.id}`,label:m.name,icon:m.definition.icon})))??[]},[l]),O=l&&!l.length,M=async()=>{if(n){if(!h){i({id:"update-destination",title:"Select a data system to enable data extraction",variant:"error"});return}t?await v({id:n==null?void 0:n.toString(),destination:{analytics_ingestion_schedule:fe,analytics_ingestion_connection_id:h}}):(await v({id:n==null?void 0:n.toString(),destination:{analytics_ingestion_schedule:null,analytics_ingestion_connection_id:null}}),x(void 0))}},N=t!==!!(s!=null&&s.analytics_ingestion_schedule)||h!==((E=s==null?void 0:s.analytics_ingestion_connection_id)==null?void 0:E.toString());return e.jsxs(e.Fragment,{children:[e.jsxs(f,{flex:1,justifyContent:"space-between",maxWidth:"960px",children:[e.jsxs(o,{gap:8,maxWidth:"570px",children:[e.jsxs(o,{gap:2,children:[O&&e.jsx(f,{mb:4,maxWidth:"570px",children:e.jsx(K,{variant:"inline",type:"warning",title:"No lightning sync engine sources configured",message:e.jsx(c,{children:"You must configure at least one source on the lightning sync engine to enable data ingestion."})})}),e.jsxs(f,{alignItems:"center",gap:4,children:[e.jsx(y,{children:"Enable data extraction"}),e.jsx(Z,{"aria-label":"Enable data extraction",permission:{v2:{resource:"destination",grant:"can_update",id:n}},isChecked:t,onChange:p,isDisabled:!(l!=null&&l.length)})]}),e.jsxs(P,{color:"text.secondary",size:"md",children:["Extract audience and other data from"," ",(s==null?void 0:s.name)??"this destination"," into a centralized data system on a regular schedule."]})]}),t&&e.jsxs(e.Fragment,{children:[e.jsxs(o,{gap:2,children:[e.jsxs(y,{children:["Which data system should we send ",s==null?void 0:s.name," data to?"]}),e.jsxs(P,{color:"text.secondary",size:"md",children:["Hightouch will extract the data from"," ",(s==null?void 0:s.name)??"this destination"," and write to the"," ",e.jsx(J,{children:"hightouch_audit"})," schema in your data system."]}),e.jsx(ee,{optionAccessories:r=>({leftAccessory:{type:"image",url:r.icon}}),value:h,options:L,onChange:x,width:"xs",isDisabled:!W})]}),e.jsxs(o,{gap:2,children:[e.jsxs(y,{children:["Which report should we extract from"," ",(s==null?void 0:s.name)??"this destination","?"]}),e.jsx(ne,{children:e.jsx(se,{label:"Audience size report",description:`Data about the size of each of your audiences in ${(s==null?void 0:s.name)??"this destination"}`,value:"audience_report",isChecked:!0,onChange:()=>{}})})]})]})]}),t&&e.jsx(o,{children:e.jsx(je,{latestIngestionJob:I})})]}),t&&b&&!!b.length&&e.jsx(f,{my:16,children:e.jsxs(o,{gap:4,children:[e.jsx(y,{children:"Extraction runs"}),e.jsx(_e,{ingestionStats:b,page:j,limit:a,offset:u,setPage:U,setIngestionRunError:C})]})}),e.jsx(te,{isOpen:!!w,variant:"info",width:"lg",title:"Data extraction run error",actions:e.jsx(B,{icon:re,
1size:"md",variant:"secondary",onClick:()=>oe(`I'm experiencing an issue with the data extraction from my destination and could use some assistance. The error message I'm receiving is: '${w}'. Here's a link to my model: <a href="${window.location.href}">${window.location.href}</a>.`),children:"Chat with support"}),onClose:()=>C(null),children:e.jsxs(o,{gap:4,children:[e.jsx(ae,{lineClampCount:"5",children:e.jsx(ie,{children:w??"Unknown error"})}),e.jsxs(o,{children:[e.jsx(c,{fontWeight:"medium",size:"lg",children:"Need more help?"}),e.jsx(c,{mt:2,children:"If you feel stuck, please reach out! We want to make sure you have all the help you need. Our team is available via chat to help you troubleshoot this error."})]})]})}),e.jsx(ce,{children:e.jsx(le,{children:e.jsx(de,{permission:{v2:{resource:"destination",grant:"can_update",id:n}},size:"lg",variant:"primary",isDisabled:!N,isLoading:F,onClick:M,children:"Save changes"})})})]})},je=({latestIngestionJob:n})=>{let s="Pending",i="subtle";const t=n==null?void 0:n.status;return!n||t===d.Queued?(s="Pending",i="subtle"):t===d.Cancelling?(s="Canceling",i="subtle"):t===d.Cancelled?(s="Canceled",i="subtle"):t===d.Failed?(s="Failed",i="error"):t===d.Finished?(i="success",s="Success"):t===d.Processing&&(s="Processing",i="info"),e.jsxs(f,{bg:"white",gap:4,align:"flex-start",flexDir:"column",children:[e.jsxs(o,{gap:1,children:[e.jsx(c,{fontWeight:"semibold",color:"text.secondary",size:"sm",children:"STATUS"}),e.jsx(_,{variant:i,children:s})]}),e.jsxs(o,{gap:1,children:[e.jsx(c,{fontWeight:"semibold",color:"text.secondary",size:"sm",children:"EXTRACTION SCHEDULE"}),e.jsx(c,{size:"sm",children:"Every day"})]}),(n==null?void 0:n.created_at)&&e.jsxs(o,{gap:1,children:[e.jsx(c,{fontWeight:"semibold",color:"text.secondary",size:"sm",children:ye(t)?"LAST RUN AT":"STARTED AT"}),e.jsx(c,{size:"sm",children:R(n.created_at)}),n.finished_at&&e.jsx(c,{size:"sm",children:k(z({start:new Date(n.created_at).getTime(),end:new Date(n.finished_at).getTime()}),{zero:!1})})]})]})};function ye(n){return n===d.Finished||n===d.Failed||n===d.Cancelled}const _e=({ingestionStats:n,page:s,limit:i,offset:t,setPage:p,setIngestionRunError:h})=>{const x=n.slice(t,t+i),j=[{name:"Status",cell:({status:a})=>{switch(a){case"success":return e.jsx(_,{variant:"success",children:"Successful"});case"failed":return e.jsx(_,{variant:"error",children:"Failed"});default:return e.jsx(_,{variant:"warning",children:"Unknown"})}}},{name:"Started at",cell:({last_ran_at:a})=>{const u=R(new Date(a).toISOString())??"--";return e.jsx(A,{message:u,children:u})}},{name:"Duration",cell:({duration_ms:a})=>{const u=k(z({start:0,end:a}));return e.jsx(A,{children:u})}},{name:"Ad accounts",cell:({processed_ad_accounts_count:a})=>e.jsx(S,{textAlign:"right",width:"100%",children:e.jsx(c,{children:a??"--"})})},{name:"Total audiences",cell:({extracted_audiences_count:a})=>e.jsx(S,{textAlign:"right",width:"100%",children:e.jsx(c,{children:a??"--"})})}];return x.some(a=>a.status==="failed")&&j.push({name:"Error",cell:({error:a,status:u})=>u!=="failed"?null:e.jsx(B,{size:"sm",ml:"auto",variant:"danger",onClick:()=>{h(a??"Something went wrong during data extraction.")},children:"View error"})}),e.jsxs(e.Fragment,{children:[e.jsx(he,{columns:j,data:x}),e.jsx(S,{children:e.jsx(xe,{page:s,setPage:p,rowsPerPage:i,count:n==null?void 0:n.length})})]})};export{ve as Element};
2//# sourceMappingURL=data-extraction-Bb2Z5VIG.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.