1 line
13 KiB
JavaScript
Vendored
1 line
13 KiB
JavaScript
Vendored
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[462],{48689:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(1413),o=n(67294),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},a=n(42135),i=function(e,t){return o.createElement(a.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:c}))};i.displayName="DeleteOutlined";var s=o.forwardRef(i)},6226:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(4942),o=n(87462),c=n(71002),a=n(67294),i=n(94184),s=n.n(i),l=n(99134),u=n(59844),f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};var p=["xs","sm","md","lg","xl","xxl"],d=a.forwardRef((function(e,t){var n,i=a.useContext(u.E_),d=i.getPrefixCls,h=i.direction,v=a.useContext(l.Z),m=v.gutter,b=v.wrap,y=v.supportFlexGap,x=e.prefixCls,Z=e.span,g=e.order,w=e.offset,j=e.push,O=e.pull,k=e.className,C=e.children,E=e.flex,P=e.style,N=f(e,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),S=d("col",x),_={};p.forEach((function(t){var n,a={},i=e[t];"number"===typeof i?a.span=i:"object"===(0,c.Z)(i)&&(a=i||{}),delete N[t],_=(0,o.Z)((0,o.Z)({},_),(n={},(0,r.Z)(n,"".concat(S,"-").concat(t,"-").concat(a.span),void 0!==a.span),(0,r.Z)(n,"".concat(S,"-").concat(t,"-order-").concat(a.order),a.order||0===a.order),(0,r.Z)(n,"".concat(S,"-").concat(t,"-offset-").concat(a.offset),a.offset||0===a.offset),(0,r.Z)(n,"".concat(S,"-").concat(t,"-push-").concat(a.push),a.push||0===a.push),(0,r.Z)(n,"".concat(S,"-").concat(t,"-pull-").concat(a.pull),a.pull||0===a.pull),(0,r.Z)(n,"".concat(S,"-rtl"),"rtl"===h),n))}));var T=s()(S,(n={},(0,r.Z)(n,"".concat(S,"-").concat(Z),void 0!==Z),(0,r.Z)(n,"".concat(S,"-order-").concat(g),g),(0,r.Z)(n,"".concat(S,"-offset-").concat(w),w),(0,r.Z)(n,"".concat(S,"-push-").concat(j),j),(0,r.Z)(n,"".concat(S,"-pull-").concat(O),O),n),k,_),A={};if(m&&m[0]>0){var R=m[0]/2;A.paddingLeft=R,A.paddingRight=R}if(m&&m[1]>0&&!y){var I=m[1]/2;A.paddingTop=I,A.paddingBottom=I}return E&&(A.flex=function(e){return"number"===typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}(E),!1!==b||A.minWidth||(A.minWidth=0)),a.createElement("div",(0,o.Z)({},N,{style:(0,o.Z)((0,o.Z)({},A),P),className:T,ref:t}),C)}));d.displayName="Col";var h=d},99134:function(e,t,n){"use strict";var r=(0,n(67294).createContext)({});t.Z=r},25968:function(e,t,n){"use strict";n.d(t,{Z:function(){return b}});var r=n(87462),o=n(4942),c=n(71002),a=n(97685),i=n(67294),s=n(94184),l=n.n(s),u=n(59844),f=n(99134),p=n(93355),d=n(24308),h=n(98082),v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},m=((0,p.b)("top","middle","bottom","stretch"),(0,p.b)("start","end","center","space-around","space-between"),i.forwardRef((function(e,t){var n,s=e.prefixCls,p=e.justify,m=e.align,b=e.className,y=e.style,x=e.children,Z=e.gutter,g=void 0===Z?0:Z,w=e.wrap,j=v(e,["prefixCls","justify","align","className","style","children","gutter","wrap"]),O=i.useContext(u.E_),k=O.getPrefixCls,C=O.direction,E=i.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),P=(0,a.Z)(E,2),N=P[0],S=P[1],_=(0,h.Z)(),T=i.useRef(g);i.useEffect((function(){var e=d.ZP.subscribe((function(e){var t=T.current||0;(!Array.isArray(t)&&"object"===(0,c.Z)(t)||Array.isArray(t)&&("object"===(0,c.Z)(t[0])||"object"===(0,c.Z)(t[1])))&&S(e)}));return function(){return d.ZP.unsubscribe(e)}}),[]);var A=k("row",s),R=function(){var e=[0,0];return(Array.isArray(g)?g:[g,0]).forEach((function(t,n){if("object"===(0,c.Z)(t))for(var r=0;r<d.c4.length;r++){var o=d.c4[r];if(N[o]&&void 0!==t[o]){e[n]=t[o];break}}else e[n]=t||0})),e}(),I=l()(A,(n={},(0,o.Z)(n,"".concat(A,"-no-wrap"),!1===w),(0,o.Z)(n,"".concat(A,"-").concat(p),p),(0,o.Z)(n,"".concat(A,"-").concat(m),m),(0,o.Z)(n,"".concat(A,"-rtl"),"rtl"===C),n),b),W={},M=R[0]>0?R[0]/-2:void 0,G=R[1]>0?R[1]/-2:void 0;if(M&&(W.marginLeft=M,W.marginRight=M),_){var H=(0,a.Z)(R,2);W.rowGap=H[1]}else G&&(W.marginTop=G,W.marginBottom=G);var B=i.useMemo((function(){return{gutter:R,wrap:w,supportFlexGap:_}}),[R,w,_]);return i.createElement(f.Z.Provider,{value:B},i.createElement("div",(0,r.Z)({},j,{className:I,style:(0,r.Z)((0,r.Z)({},W),y),ref:t}),x))})));m.displayName="Row";var b=m},20550:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});var r=n(4942),o=n(87462),c=n(97685),a=n(67294),i=n(94184),s=n.n(i),l=n(98423),u=n(97937),f=n(59844),p=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},d=function(e){var t,n=e.prefixCls,c=e.className,i=e.checked,l=e.onChange,u=e.onClick,d=p(e,["prefixCls","className","checked","onChange","onClick"]),h=(0,a.useContext(f.E_).getPrefixCls)("tag",n),v=s()(h,(t={},(0,r.Z)(t,"".concat(h,"-checkable"),!0),(0,r.Z)(t,"".concat(h,"-checkable-checked"),i),t),c);return a.createElement("span",(0,o.Z)({},d,{className:v,onClick:function(e){null===l||void 0===l||l(!i),null===u||void 0===u||u(e)}}))},h=n(98787),v=n(68349),m=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},b=new RegExp("^(".concat(h.Y.join("|"),")(-inverse)?$")),y=new RegExp("^(".concat(h.E.join("|"),")$")),x=function(e,t){var n,i=e.prefixCls,p=e.className,d=e.style,h=e.children,x=e.icon,Z=e.color,g=e.onClose,w=e.closeIcon,j=e.closable,O=void 0!==j&&j,k=m(e,["prefixCls","className","style","children","icon","color","onClose","closeIcon","closable"]),C=a.useContext(f.E_),E=C.getPrefixCls,P=C.direction,N=a.useState(!0),S=(0,c.Z)(N,2),_=S[0],T=S[1];a.useEffect((function(){"visible"in k&&T(k.visible)}),[k.visible]);var A=function(){return!!Z&&(b.test(Z)||y.test(Z))},R=(0,o.Z)({backgroundColor:Z&&!A()?Z:void 0},d),I=A(),W=E("tag",i),M=s()(W,(n={},(0,r.Z)(n,"".concat(W,"-").concat(Z),I),(0,r.Z)(n,"".concat(W,"-has-color"),Z&&!I),(0,r.Z)(n,"".concat(W,"-hidden"),!_),(0,r.Z)(n,"".concat(W,"-rtl"),"rtl"===P),n),p),G=function(e){e.stopPropagation(),null===g||void 0===g||g(e),e.defaultPrevented||"visible"in k||T(!1)},H="onClick"in k||h&&"a"===h.type,B=(0,l.Z)(k,["visible"]),D=x||null,U=D?a.createElement(a.Fragment,null,D,a.createElement("span",null,h)):h,z=a.createElement("span",(0,o.Z)({},B,{ref:t,className:M,style:R}),U,O?w?a.createElement("span",{className:"".concat(W,"-close-icon"),onClick:G},w):a.createElement(u.Z,{className:"".concat(W,"-close-icon"),onClick:G}):null);return H?a.createElement(v.Z,null,z):z},Z=a.forwardRef(x);Z.displayName="Tag",Z.CheckableTag=d;var g=Z},75269:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/webhooks",function(){return n(90546)}])},90546:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return E}});var r=n(34051),o=n.n(r),c=n(85893),a=n(48689),i=n(84485),s=n(56266),l=n(20550),u=n(6226),f=n(32808),p=n(80414),d=n(69677),h=n(25968),v=n(71577),m=n(26713),b=n(88829),y=n(67294),x=n(58827),Z=n(19411);function g(e,t,n,r,o,c,a){try{var i=e[c](a),s=i.value}catch(l){return void n(l)}i.done?t(s):Promise.resolve(s).then(r,o)}function w(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var c=e.apply(t,n);function a(e){g(c,r,o,a,i,"next",e)}function i(e){g(c,r,o,a,i,"throw",e)}a(void 0)}))}}var j=i.Z.Title,O=i.Z.Paragraph,k={CHAT:{name:"Chat messages",description:"When a user sends a chat message",color:"purple"},USER_JOINED:{name:"User joined",description:"When a user joins the chat",color:"green"},NAME_CHANGE:{name:"User name changed",description:"When a user changes their name",color:"blue"},"VISIBILITY-UPDATE":{name:"Message visibility changed",description:"When a message visibility changes, likely due to moderation",color:"red"},STREAM_STARTED:{name:"Stream started",description:"When a stream starts",color:"orange"},STREAM_STOPPED:{name:"Stream stopped",description:"When a stream stops",color:"cyan"}};function C(e){var t=e.onOk,n=e.onCancel,r=e.visible,o=(0,y.useState)([]),a=o[0],i=o[1],s=(0,y.useState)(""),l=s[0],m=s[1],b=Object.keys(k).map((function(e){return{value:e,label:k[e].description}})),x={disabled:0===(null===a||void 0===a?void 0:a.length)||!(0,Z.Z)(l)},g=b.map((function(e){return(0,c.jsx)(u.Z,{span:8,children:(0,c.jsx)(f.Z,{value:e.value,children:e.label})},e.value)}));return(0,c.jsxs)(p.Z,{title:"Create New Webhook",visible:r,onOk:function(){t(l,a),m(""),i(null)},onCancel:n,okButtonProps:x,children:[(0,c.jsx)("div",{children:(0,c.jsx)(d.Z,{value:l,placeholder:"https://myserver.com/webhook",onChange:function(e){return m(e.currentTarget.value.trim())},type:"url",pattern:Z.a})}),(0,c.jsx)("p",{children:"Select the events that will be sent to this webhook."}),(0,c.jsx)(f.Z.Group,{style:{width:"100%"},value:a,onChange:function(e){i(e)},children:(0,c.jsx)(h.Z,{children:g})}),(0,c.jsx)("p",{children:(0,c.jsx)(v.Z,{type:"primary",onClick:function(){i(Object.keys(k))},children:"Select all"})})]})}function E(){var e=function(e){console.error("error",e)},t=(0,y.useState)([]),n=t[0],r=t[1],i=(0,y.useState)(!1),u=i[0],f=i[1];function p(){return d.apply(this,arguments)}function d(){return(d=w(o().mark((function t(){var n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,(0,x.rQ)(x.XA);case 3:n=t.sent,r(n),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),e(t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})))).apply(this,arguments)}function h(){return(h=w(o().mark((function t(n){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,(0,x.rQ)(x.M_,{method:"POST",data:{id:n}});case 3:p(),t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),e(t.t0);case 9:case"end":return t.stop()}}),t,null,[[0,6]])})))).apply(this,arguments)}function Z(){return(Z=w(o().mark((function t(c,a){var i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,(0,x.rQ)(x.iG,{method:"POST",data:{url:c,events:a}});case 3:i=t.sent,r(n.concat(i)),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),e(t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})))).apply(this,arguments)}(0,y.useEffect)((function(){p()}),[]);var g=[{title:"",key:"delete",render:function(e,t){return(0,c.jsx)(m.Z,{size:"middle",children:(0,c.jsx)(v.Z,{onClick:function(){return function(e){return h.apply(this,arguments)}(t.id)},icon:(0,c.jsx)(a.Z,{})})})}},{title:"URL",dataIndex:"url",key:"url"},{title:"Events",dataIndex:"events",key:"events",render:function(e){return(0,c.jsx)(c.Fragment,{children:e.map((function(e){return function(e){if(!e||!k[e])return null;var t=k[e];return(0,c.jsx)(s.Z,{title:t.description,children:(0,c.jsx)(l.Z,{color:t.color,children:t.name})},e)}(e)}))})}}];return(0,c.jsxs)("div",{children:[(0,c.jsx)(j,{children:"Webhooks"}),(0,c.jsx)(O,{children:"A webhook is a callback made to an external API in response to an event that takes place within Owncast. This can be used to build chat bots or sending automatic notifications that you've started streaming."}),(0,c.jsxs)(O,{children:["Read more about how to use webhooks, with examples, at"," ",(0,c.jsx)("a",{href:"https://owncast.online/docs/integrations/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"our documentation"}),"."]}),(0,c.jsx)(b.Z,{rowKey:function(e){return e.id},columns:g,dataSource:n,pagination:!1}),(0,c.jsx)("br",{}),(0,c.jsx)(v.Z,{type:"primary",onClick:function(){f(!0)},children:"Create Webhook"}),(0,c.jsx)(C,{visible:u,onOk:function(e,t){f(!1),function(e,t){Z.apply(this,arguments)}(e,t)},onCancel:function(){f(!1)}})]})}}},function(e){e.O(0,[829,774,888,179],(function(){return t=75269,e(e.s=t);var t}));var t=e.O();_N_E=t}]); |