PageSourceSearch

https://dashboard.mux.com/assets/index.route-MIWzNzfW.js

js mux.com collected 2026-09-24 08:01:20 UTC 17,693 bytes, 2 lines download raw bytes

1import{s as pe,v as he,w as ge,cW as U,j as e,a as T,R as ae,r as Y,cX as z,aN as je,cY as fe,F as P}from"./react-DwuEVfNv.js";import{fP as ve,$ as J,_ as ie,ge as be,cp as Q,cq as we,fQ as ye,b5 as w,b6 as y,b7 as D,b8 as L,du as W,ab as $,c as N,k as C,d0 as A,d6 as Se,a8 as ce,b4 as _e,dw as Ee,dx as Ce,dy as Te,dz as Ie,dA as Z,dd as ke,dc as q,aa as H,aw as le,bP as de,bT as ue,bU as b,ci as j,es as De,en as G,q as g,c0 as Ne,c3 as Le,c1 as Ae,cK as Re,bQ as Ve,bR as _,bX as Fe,bS as ee,gD as R,cO as B,am as Pe,bi as $e,bj as Oe,bk as qe,bA as Ge,bl as Me,bm as ze,b_ as We,ba as He,bc as Be,bd as Ke,be as Ue,bZ as Ye,s as Je,bh as Qe}from"./index-DQzPtNsy.js";import"./d3-q0zOtUjj.js";var S=function(t){return t.Viewstream="viewstream",t.Livehealthstream="livehealthstream",t}({}),K=function(t){return t.Protobuf="protobuf",t.JSON="json",t}({});const Xe=t=>{const s=J(),n=ie();return pe({queryKey:[n,s,"streaming-exports","info"],queryFn:()=>we(`${Q}/streaming-exports/info`,{environment:s,organization:n,preserveSnake:!0}),...t})},Ze=t=>{const{features:s}=t;if(!s)return[];const n={streamingExportsViewstream:"viewstream",streamingExportsLivehealthstream:"livehealthstream"};return Object.entries(s).filter(([o,r])=>o in n&&r===!0).map(([o])=>n[o])},et=()=>["protobuf","json"],te=(t={})=>{const s=he(),n=ie(),o=J();return ge({...t,mutationFn:async({id:r,action:a})=>{const{data:u}=await be(a==="restart"?"POST":"PUT",`${Q}/streaming-exports/${r}/${a}`,{},{environment:o,organization:n,preserveSnake:!0});return u},onSuccess:async(r,a,u)=>{await t.onSuccess?.(r,a,u),await s.refetchQueries({queryKey:[n,o,"streaming-exports","list"]})}})},tt=ye(`${Q}/streaming-exports`,{preserveSnake:!0}),{useList:rt,useCreateMutation:st,useUpdateMutation:nt,useDeleteMutation:ot}=ve("streaming-exports",tt),at={viewstream:"Video Views",livehealthstream:"Live Stream Input Health"},it={protobuf:"Protobuf",json:"JSON"},xe=t=>at[t],ct=t=>it[t],F=t=>{const s=xe(t);return t==="livehealthstream"?`${s} data`:s};var m=function(t){return t.CLOSED="CLOSED",t.NEW="NEW",t.EDITING="EDITING",t}({});const lt=T(C)(["padding:20px;background:",";"],N.background.highlight),dt={[S.Viewstream]:"https://docs.mux.com/guides/data/export-amazon-kinesis-data-streams",[S.Livehealthstream]:"https://docs.mux.com/guides/video/debug-live-stream-issues#integrate-live-stream-input-health-data"},ut=({info:t,exportType:s})=>{const{aws_account_id:n,aws_external_id:o}=t?.details,r=dt[s];return e.jsxs(lt,{gap:4,children:[e.jsxs(w,{children:[e.jsx(y,{children:"Mux AWS Account ID"}),e.jsx(D,{readOnly:!0,value:n,children:e.jsx(W,{value:n})})]}),e.jsxs(w,{children:[e.jsx(y,{children:"External ID"}),e.jsx(D,{readOnly:!0,value:o,children:e.jsx(W,{value:o})})]}),e.jsx($,{href:r,children:"See our guide"})]})},xt=t=>{const{info:s,exportType:n}=t,{register:o,formState:{errors:r}}=U(),a=/^arn:aws:(?<service>\w+):(?<region>(\w+(?:-\w+)+){0,1}):\d{12}:(?<resource_type>\w+)\/(?<resource>[A-Za-z0-9_.-]+)$/;return e.jsxs(e.Fragment,{children:[e.jsx(ut,{info:s,exportType:n}),e.jsxs(w,{error:r.aws_kinesis_arn,children:[e.jsx(y,{children:"Kinesis data stream ARN"}),e.jsx(D,{required:!0,...o("aws_kinesis_arn",{required:{value:!0,message:"Field is required"},pattern:{value:a,message:"ARN must match arn:aws:kinesis:{region}:{account-id}:stream/{data-stream-name}."}}),placeholder:"arn:aws:kinesis:us-west-1:123456781234:stream/mux-data-views"}),e.jsx(L,{children:r.aws_kinesis_arn?.message})]}),e.jsxs(w,{error:r.aws_role_arn,children:[e.jsx(y,{children:"IAM role ARN"}),e.jsx(D,{required:!0,...o("aws_role_arn",{required:{value:!0,message:"Field is required"},pattern:{value:a,message:"ARN must match arn:aws:iam::{account-id}:role/{role-name}."}}),placeholder:"arn:aws:iam::123456781234:role/mux-data-kinesis-external-access-role"}),e.jsx(L,{children:r.aws_role_arn?.message})]})]})},mt=T(C)(["padding:20px;background:",";"],N.gray05),pt={[S.Viewstream]:"https://docs.mux.com/guides/data/export-google-cloud-pubsub",[S.Livehealthstream]:"https://docs.mux.com/guides/video/debug-live-stream-issues#integrate-live-stream-input-health-data"},ht=({info:t,exportType:s})=>{const{google_service_account:n}=t?.details,o=pt[s];return e.jsxs(mt,{gap:4,children:[e.jsxs(w,{children:[e.jsx(y,{children:"Mux Google Cloud Service Account"}),e.jsx(D,{readOnly:!0,value:n,children:e.jsx(W,{value:n})})]}),e.jsx($,{href:o,children:"See our guide"})]})},gt=t=>{const{register:s,formState:{errors:n}}=U(),{info:o,exportType:r}=t,a=/projects\/.*\/topics\/.*/;return e.jsxs(e.Fragment,{children:[e.jsx(ht,{info:o,exportType:r}),e.jsxs(w,{error:n.google_topic,children:[e.jsx(y,{children:"Pub/Sub topic name"}),e.jsx(D,{...s("google_topic",{required:{value:!0,message:"Field is required"},pattern:{value:a,message:"Topic name must match projects/{project-id}/topics/{topic-id}."}}),required:!0,placeholder:"projects/project-123456/topics/mux-data-views"}),e.jsx(L,{children:n.google_topic?.message})]})]})},re=T.div(["display:flex;margin-left:0;line-height:",";flex-direction:column;"],Se[2]),se=T.span(["color:",";"],N.text.default),jt={[S.Viewstream]:{label:"Video Views",description:"Views tracked by Mux Data"},[S.Livehealthstream]:{label:"Live Stream Input Health",description:"Health updates and RTMP metadata events"}},ft={[K.Protobuf]:{label:"Protobuf",description:""},[K.JSON]:{label:"JSON",description:""}}
1,vt=({supportedExportTypes:t,supportedExportFormats:s,panelState:n})=>{const{control:o,setValue:r,formState:{errors:a}}=U();ae.useEffect(()=>{if(n.mode===m.NEW&&t.length===1){const c=t[0],x=s[0];r("type",c),r("format",x)}},[t,s,r,n.mode]);const[u,p]=Y.useState(!0);return e.jsxs(e.Fragment,{children:[e.jsxs(w,{error:a.type,children:[e.jsx(y,{children:"Export Data"}),e.jsx(z,{name:"type",control:o,rules:{required:{value:!0,message:"Field is required"}},render:({field:{value:c,onChange:x}})=>e.jsx(A,{value:c,onValueChange:i=>{x(i),p(i===S.Viewstream.toString())},disabled:n.mode===m.EDITING||t.length===1,children:t.map(i=>{const d=jt[i];return e.jsx(A.Item,{value:i,label:e.jsxs(re,{children:[d.label,e.jsx(se,{children:d.description})]})},i)})})}),e.jsx(L,{children:a.type?.message})]}),e.jsxs(w,{error:a.format,children:[e.jsx(y,{children:"Export Format"}),e.jsx(z,{name:"format",control:o,rules:{required:{value:!0,message:"Field is required"}},render:({field:{value:c,onChange:x}})=>e.jsx(A,{value:c,onValueChange:x,disabled:n.mode===m.EDITING||s.length===1,children:s.filter(i=>u||i!==K.JSON).map(i=>{const d=ft[i];return e.jsx(A.Item,{value:i,label:e.jsxs(re,{children:[d.label,e.jsx(se,{children:d.description})]})},i)})})}),e.jsx(L,{children:a.format?.message})]})]})},bt=({service:t,info:s,exportType:n})=>{const o=s.data.services.find(r=>r.id===t);switch(t){case"aws_kinesis":return e.jsx(xt,{info:o,exportType:n});case"google_pubsub":return e.jsx(gt,{info:o,exportType:n});default:return e.jsx(e.Fragment,{})}},wt=([t,s,n])=>!(t||s&&n),yt=({panelState:t,streamingExportsInfoData:s,supportedExportTypes:n,supportedExportFormats:o,hidePanel:r})=>{const a=ce(),u=J(),{mutateAsync:p,isLoading:c}=st({onSuccess:()=>{a({id:"streaming_export_created",type:"Success",title:"New streaming export enabled",description:""}),r()},meta:{errorToastContent:{id:"create_streaming_export_failed",title:"New streaming export failed"}}}),{mutateAsync:x,isLoading:i}=nt({onSuccess:()=>r(),meta:{errorToastContent:{id:"update_streaming_export_failed",title:"Update streaming export failed"}}}),d=je({mode:"onSubmit",reValidateMode:"onChange",defaultValues:{...t.streamExport?.details,type:t.streamExport?.type,format:t.streamExport?.format,environment_id:t.streamExport?.environment_id??u,connector_plugin:t.streamExport?.connector_plugin}}),{handleSubmit:h,watch:f,control:I,clearErrors:v}=d,l=f("connector_plugin"),X=f(["google_topic","aws_kinesis_arn","aws_role_arn"]),E=f("type");ae.useEffect(()=>{v("environment_id")},[E,v]);const O=async k=>{t.mode===m.EDITING?await x({id:t.streamExport?.id,changes:k}):await p(k)};return e.jsx(fe,{...d,children:e.jsxs(_e,{onSubmit:h(O),children:[e.jsx(vt,{supportedExportTypes:n,supportedExportFormats:o,panelState:t}),e.jsxs(w,{children:[e.jsx(y,{children:"Service"}),e.jsx(z,{name:"connector_plugin",control:I,rules:{required:!0},render:({field:{value:k,onChange:me}})=>e.jsxs(Ee,{value:k,onValueChange:me,disabled:t.mode===m.EDITING,children:[e.jsx(Ce,{children:e.jsx(Te,{placeholder:"Select a service"})}),e.jsxs(Ie,{children:[e.jsx(Z,{value:"aws_kinesis",children:"Amazon Kinesis Data Streams"}),e.jsx(Z,{value:"google_pubsub",children:"Google Cloud Pub/Sub"})]})]})})]}),l&&E&&e.jsx(bt,{exportType:E,service:l,info:s}),e.jsxs(ke,{gutterY:20,gutterX:10,children:[e.jsx(q,{}),e.jsx(q,{auto:!0,children:e.jsx(H,{onClick:r,children:"Cancel"})}),e.jsx(q,{auto:!0,children:e.jsxs(H,{loading:c||i,disabled:wt(X),variant:"access",type:"submit",children:[t.mode!==m.EDITING?"Enable":"Update"," export"]})})]})]})})},ne=T(g)(["color:",";"],N.text.default),St=T(g)(["color:",";"],N.red60),oe=t=>t.replace("exportstream.","").replace("VideoView",""),_t=(t,s)=>s==="google_pubsub"?e.jsx(G,{children:t.google_topic}):s==="aws_kinesis"?e.jsx(G,{children:t.aws_kinesis_arn}):e.jsx(G,{children:"unknown"}),Et=t=>t==="google_pubsub"?"Google Cloud Pub/Sub":t==="aws_kinesis"?"Amazon Kinesis Data Streams":t,Ct=t=>t?t==="running"?e.jsx(g,{children:"Active"}):t==="restarting"?e.jsx(ne,{children:"Retrying..."}):t==="failed"?e.jsxs(Ne,{children:[e.jsx(Le,{side:"bottom",children:"We weren't able to export views. This is usually due to insufficient permissions. Check your configuration and retry."}),e.jsx(Ae,{asChild:!0,children:e.jsxs("div",{style:{display:"flex",width:70,justifyContent:"space-between"},children:[e.jsx(Re,{color:N.red60}),e.jsx(St,{children:"Failed"})]})})]}):e.jsx(g,{style:{textTransform:"capitalize"},children:t}):e.jsx(ne,{children:"Not Available"}),Tt=(t,s)=>t?.toLowerCase()===s?t:`${t} (${s})`,It=({data:t,onEdit:s,onRetry:n,onPause:o,onDelete:r,onResume:a,onUpgrade:u})=>{const{environment_id:p,type:c,format:x,schema:i,latest_version:d,state:h,details:f,connector_plugin:I}=t,v=P(le),l=_t(f,I),E=P(de)?.find(k=>k.id===p),O=i?oe(i):"V1";return e.jsxs(ue,{children:[e.jsx(b,{top:!0,ratio:3,children:E?Tt(E.name,E.type):""}),e.jsx(b,{top:!0,ratio:3,children:xe(c)}),e.jsx(b,{top:!0,ratio:3,children:Et(I)}),e.jsx(b,{top:!0,ratio:7,children:l}),e.jsx(b,{top:!0,ratio:3,children:Ct(h)}),e.jsx(b,{top:!0,ratio:3,children:ct(x)}),e.jsx(b,{top:!0,ratio:3,children:O}),e.jsx(b,{right:!0,ratio:1,children:v?.isAdmin&&e.jsxs(j,{containWidth:!1,xOffset:-45,fixOverflow:!0,children:[e.jsx(j.Toggle,{children:e.jsx(j.Button,{variant:"muted",children:e.jsx(De,{})})}),e.jsxs(j.Menu,{children:[e.jsx(j.Item,{onClick:()=>s(t),children:"Edit"}),h==="failed"&&e.jsx(j.Item,{onClick:()=>n(t),children:"Retry"}),h==="running"&&e.jsx(j.Item,{onClick:()=>o(t),children:"Pause"}),h==="paused"&&e.jsx(j.Item,{onClick:()=>a(t),children:"Resume"}),t?.schema!==t?.latest_version&&e.jsxs(j.Item,{onClick:()=>u(t),children:["Upgrade to ",oe(d??"")]}),e.jsx(j.Item,{onClick:()=>r(t),children:"Delete"})]})]})})]})},kt=()=>e.jsxs(Ve,{children:[e.jsx(_,{columnName:"environment",left:!0,ratio:3}),e.jsx(_,{columnName:"data",left:!0,ratio:3}),e.jsx(_,{columnName:"service",left:!0,ratio:3}),e.jsx(_,{columnName:"destination",left:!0,ratio:7}),e.jsx(_,{columnName:"status",left:!0,ratio:3}),e.jsx(_,{columnName:"format",left:!0,ratio:3}),e.jsx(_,{columnName:"current version",left:!0,ratio:3}),e.jsx(_,{left:!0,ratio:1})]}),V=t=>t==="aws_kinesis"?"Amazon Kinesis Data Streams":t==="google_pubsub"?"Google Cloud Pub/Sub":t,M=t=>({viewstream:24,livehealthstream:4})[t],Dt=({streamingExportsData:t,openEditPanel:s})=>{const{data:n,total_row_count:o}=t,[r,a]=Y.useState({action:"closed",export:null}),u=P(de),p=v=>u.find(l=>l.id===v)?.name,c=()=>a({action:"closed",export:null}),x=ce(),{mutate:i,isLoading:d}=ot({onSuccess:()=>c(),meta:{errorToastContent:{id:"delete_streaming_export_failed",title:"Delete streaming export failed"}}}),{mutate:h,isLoading:f}=te({onSuccess:()=>c(),meta:{errorToastContent:{id:"pause_streaming_export_failed",title:"Pause streaming export failed"}}}),{mutate:I}=te({onSuccess:()=>{x({id:"retry_streaming_export_failed",type:"Warning",title:"Retry Started",description:"We're retrying your export. This usually takes a few seconds to start."})}});return e.jsxs(e.Fragment,{children:[e.jsxs(Fe,{bordered:!0,children:[e.jsx(kt,{}),o===0?e.jsx(ee,{children:e.jsx(ue,{children:e.jsx(b,{style:{justifyContent:"center"},children:e.jsx(g,{children:"You haven’t set up any streaming exports yet"})})})}):e.jsx(ee,{children:n.map(v=>e.jsx(It,{data:v,onEdit:s,onRetry:l=>I({action:"restart",id:l.id}),onPause:l=>a({action:"pause",export:l}),onDelete:l=>a({action:"delete",export:l}),onResume:l=>a({action:"resume",export:l}),onUpgrade:l=>a({action:"upgrade",export:l})},v.id))})]}),r.action==="pause"&&r.export&&e.jsx(R,{title:"Pause Export",variant:"warn",onCancel:c,loading:f,onSubmit:()=>h({action:"pause",id:r.export?.id}),children:e.jsxs(C,{gap:3,children:[e.jsxs(g,{children:["Are you sure you want to pause the export from your"," ",e.jsx("strong",{children:p(r.export.environment_id)})," environment to"," ",e.jsx("strong",{children:V(r.export.connector_plugin)}),"? We will stop sending ",F(r.export.type)," immediately. You can resume the export later."]}
1),M(r.export.type)&&e.jsx(B,{type:"warn",children:e.jsxs(g,{children:["If the export is resumed after more than ",M(r.export.type)," ","hours, we will only send records that were tracked during the last"," ",M(r.export.type)," hours. Any records older than that will still be available in Mux but will not be sent to your destination service."]})})]})}),r.action==="resume"&&r.export&&e.jsx(R,{title:"Resume Export",variant:"access",onCancel:c,loading:f,onSubmit:()=>h({action:"resume",id:r.export?.id}),children:e.jsxs(g,{children:["Are you sure you want to resume the export from your"," ",e.jsx("strong",{children:p(r.export.environment_id)})," environment to"," ",e.jsx("strong",{children:V(r.export.connector_plugin)}),"? We will start sending"," ",F(r.export.type)," immediately, including records that were tracked while the export was paused."]})}),r.action==="upgrade"&&e.jsx(R,{title:"Upgrade Export Version",variant:"warn",onCancel:c,loading:f,onSubmit:()=>h({action:"upgrade",id:r.export?.id}),children:e.jsxs(C,{gap:3,children:[e.jsxs(g,{children:["Are you sure you want to upgrade your"," ",e.jsx("strong",{children:V(r.export?.connector_plugin)})," service in"," ",e.jsx("strong",{children:p(r.export?.environment_id)})," to the latest version? To learn more about the schema versioning, check out our"," ",e.jsx(Pe,{href:"https://docs.mux.com/guides/data/export-raw-video-view-data#streaming-export-versioning",children:"guide"}),"."]}),e.jsx(B,{type:"warn",children:e.jsx(g,{children:"This action cannot be undone."})})]})}),r.action==="delete"&&r.export&&e.jsx(R,{title:"Delete Export",variant:"warn",loading:d,onCancel:c,onSubmit:()=>i(r.export?.id),children:e.jsxs(g,{children:["Are you sure you want to delete the export from your"," ",e.jsx("strong",{children:p(r.export.environment_id)})," environment to"," ",e.jsx("strong",{children:V(r.export.connector_plugin)}),"? We will stop sending"," ",F(r.export.type)," immediately. This action can’t be undone."]})})]})},Nt={[S.Viewstream]:{label:"Export Raw Video View Data",link:"https://docs.mux.com/guides/data/export-raw-video-view-data#stream-views-as-they-complete"},[S.Livehealthstream]:{label:"Integrate Live Stream Input Health data",link:"https://docs.mux.com/guides/video/debug-live-stream-issues#integrate-live-stream-input-health-data"}},Lt=T.ul(["display:flex;flex-direction:column;padding:0;gap:",";list-style:none;"],Je[1]),At=t=>{const s=t.map(n=>Nt[n]);return s.length===1?e.jsx($,{href:s[0].link,children:"Learn more in our guide"}):e.jsx(e.Fragment,{children:e.jsx(Lt,{children:s.map(n=>e.jsx("li",{children:e.jsx($,{href:n.link,children:n.label})},n.label))})})},Rt=t=>{const s=t.map(F).join(" and ");return e.jsxs(g,{children:["Mux supports streaming exports of ",s," to Amazon Kinesis Data Streams and Google Cloud Pub/Sub."," ",At(t)]})},Vt=()=>{const t=P(le),{isAdmin:s=!1}=t,n=Ze(t),o=et(),[r,a]=Y.useState({mode:m.CLOSED,streamExport:null}),u=()=>{a({mode:m.CLOSED,streamExport:null})},p=()=>{a({mode:m.NEW,streamExport:null})},c=h=>{a({mode:m.EDITING,streamExport:h})},{data:x}=Xe({}),{isLoading:i,data:d}=rt({},{staleTime:1e4,refetchInterval:1e4,refetchOnWindowFocus:!0});return e.jsxs($e,{children:[e.jsxs(Oe,{children:[e.jsx(qe,{children:"Streaming Exports"}),e.jsx(Ge,{children:Rt(n)}),e.jsx(Me,{children:e.jsx(H,{variant:"access",disabled:!s,onClick:p,children:"New streaming export"})})]}),e.jsxs(ze,{gutterY:4,children:[!s&&e.jsx(B,{type:"info",children:"Admin permissions are required to edit these settings."}),e.jsx(C,{gutterY:4,children:i?e.jsx(We,{gutterY:6}):e.jsx(e.Fragment,{children:d&&e.jsx(Dt,{openEditPanel:c,streamingExportsData:d})})}),r.mode!==m.CLOSED&&e.jsx(He,{open:!0,onOpenChange:()=>u(),children:e.jsxs(Be,{style:{overflowY:"auto"},children:[e.jsx(Ke,{children:e.jsxs(C,{gap:3,children:[e.jsxs(Ue,{children:[r.mode===m.NEW?"New":"Edit"," Streaming Export"]}),r.mode===m.NEW&&e.jsx(Ye,{children:"Create a streaming export to send data to an Amazon Kinesis data stream or Google Cloud Pub/Sub topic."})]})}),e.jsx(C,{gutterY:2,children:e.jsx(yt,{panelState:r,supportedExportTypes:n,supportedExportFormats:o,streamingExportsInfoData:x,hidePanel:u})})]})})]})]})};function Ot(){return Qe("Streaming Exports | Settings"),e.jsx(Vt,{})}export{Ot as default};
2//# sourceMappingURL=index.route-MIWzNzfW.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.