forked from duneanalytics/DuneQueryRepo
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
8571-b7477aa91103b54d.js.download
2 lines (2 loc) · 15.1 KB
/
8571-b7477aa91103b54d.js.download
1
2
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8571],{83412:function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){if(arguments.length<1)throw TypeError("1 arguments required, but only ".concat(arguments.length," present"));var n=(0,t.default)(e);if(!(0,u.default)(n))throw RangeError("Invalid time value");var r=o[n.getUTCDay()],s=(0,a.default)(n.getUTCDate(),2),d=i[n.getUTCMonth()],c=n.getUTCFullYear(),l=(0,a.default)(n.getUTCHours(),2),h=(0,a.default)(n.getUTCMinutes(),2),f=(0,a.default)(n.getUTCSeconds(),2);return"".concat(r,", ").concat(s," ").concat(d," ").concat(c," ").concat(l,":").concat(h,":").concat(f," GMT")};var t=s(r(71171)),u=s(r(39989)),a=s(r(87394));function s(e){return e&&e.__esModule?e:{default:e}}var o=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];e.exports=n.default},14514:function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){(0,a.default)(1,arguments);var n=(0,u.default)(e);return(0,t.default)(1e3*n)};var t=s(r(71171)),u=s(r(82084)),a=s(r(68734));function s(e){return e&&e.__esModule?e:{default:e}}e.exports=n.default},49955:function(e,n,r){"use strict";r.d(n,{y:function(){return m}});var t=r(85893),u=r(97600),a=r.n(u),s=r(1801),o=r(5505),i=r(56446),d=r(47730),c=r(84512),l=r(55754),h=r(44917),f=r(61018);let y=e=>{let{run:n,title:r}=e;return(0,t.jsxs)("p",{children:[r,": ",(0,l.Z)(n,"yyyy-MM-dd HH:mm"),"\xa0-\xa0",(0,l.Z)(new Date(n).getTime()+18e5,"HH:mm")]})},m=e=>{let{size:n,schedule:r,hasQueryAlerts:u}=e,l=(0,i.mB)(r.cronString);if(void 0===l||void 0===r.cronString)return null;let m=(0,c.rD)(r.cronString,r.updatedAt),p=(0,c.Gs)(r.cronString);return(0,t.jsx)("div",{className:a().scheduleBadge,children:(0,t.jsx)(d.u,{label:(0,t.jsxs)("div",{children:[!!m&&(0,t.jsx)(y,{run:m,title:"Last execution"}),!!p&&(0,t.jsx)(y,{run:p,title:"Next execution"})]}),position:"below-align-right",children:(0,t.jsx)("div",{children:(0,t.jsx)(s.C,{size:n,color:!0===u?"warning":"brand-blue",variant:"filled",children:(0,t.jsxs)("span",{className:a().badgeLabel,children:[(0,t.jsx)("span",{children:(0,h.S)(l)}),!0===u?(0,t.jsx)(f.IconBellRing,{}):(0,t.jsx)(o.IconClockHistory,{})]})})})})})}},56446:function(e,n,r){"use strict";r.d(n,{ec:function(){return l},Kj:function(){return f},u$:function(){return i},wX:function(){return d},UV:function(){return s},Sq:function(){return y.S},Y3:function(){return m},mB:function(){return c}});var t=r(31269),u=r(84512),a=r(40551);let s=["Minute","Hour","Day","Week"],o=["15 minutes","20 minutes","30 minutes","1 hour","2 hours","3 hours","4 hours","6 hours","8 hours","12 hours","Day","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];function i(e){switch(e){case"Minute":return["15 minutes","20 minutes","30 minutes"];case"Hour":return["1 hour","2 hours","3 hours","4 hours","6 hours","8 hours","12 hours"];case"Day":return["Day"];case"Week":return["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];default:(0,a.U)(e)}}function d(e){return/^\d+ \d+/.test(e)}function c(e){if(/^\d+ \d+ \* \* \*$/.test(e))return"Day";if(/^\d+ \d+ \* \* \d+$/.test(e)){let n=Number(e.split(" ").slice(-1)[0]),r=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][n];return r}return o.find(function(e){let n=(0,u.BU)(e);return r=>{let u=h(e,r);return(0,t.qP)(u).every(e=>{let[r,t]=e;return n[r]===t})}}(e))}function l(e,n){return(0,u.n1)(e)(h(e,n))}function h(e,n){let r=d(e)?{}:f();switch(n){case"15 minutes":return{minute:"*/15",hour:"*",weekday:"*"};case"20 minutes":return{minute:"*/20",hour:"*",weekday:"*"};case"30 minutes":return{minute:"*/30",hour:"*",weekday:"*"};case"1 hour":return{minute:"0",hour:"*",weekday:"*"};case"2 hours":return{minute:"0",hour:"*/2",weekday:"*"};case"3 hours":return{minute:"0",hour:"*/3",weekday:"*"};case"4 hours":return{minute:"0",hour:"*/4",weekday:"*"};case"6 hours":return{minute:"0",hour:"*/6",weekday:"*"};case"8 hours":return{minute:"0",hour:"*/8",weekday:"*"};case"12 hours":return{minute:"0",hour:"*/12",weekday:"*"};case"Day":return{weekday:"*",...r};case"Sunday":return{weekday:"0",...r};case"Monday":return{weekday:"1",...r};case"Tuesday":return{weekday:"2",...r};case"Wednesday":return{weekday:"3",...r};case"Thursday":return{weekday:"4",...r};case"Friday":return{weekday:"5",...r};case"Saturday":return{weekday:"6",...r}}}function f(){return{minute:30>new Date().getMinutes()?"0":"30",hour:"".concat(new Date().getHours())}}var y=r(44917);function m(e){switch(e){case"15 minutes":return"15 minutes";case"20 minutes":return"20 minutes";case"30 minutes":return"30 minutes";case"1 hour":return"hour";case"2 hours":return"2 hours";case"3 hours":return"3 hours";case"4 hours":return"4 hours";case"6 hours":return"6 hours";case"8 hours":return"8 hours";case"12 hours":return"12 hours";case"Day":return"day";case"Monday":return"Monday";case"Tuesday":return"Tuesday";case"Wednesday":return"Wednesday";case"Thursday":return"Thursday";case"Friday":return"Friday";case"Saturday":return"Saturday";case"Sunday":return"Sunday";default:(0,a.U)(e)}}},44917:function(e,n,r){"use strict";r.d(n,{S:function(){return u}});var t=r(40551);function u(e){switch(e){case"15 minutes":return"15m";case"20 minutes":return"20m";case"30 minutes":return"30m";case"1 hour":return"1h";case"2 hours":return"2h";case"3 hours":return"3h";case"4 hours":return"4h";case"6 hours":return"6h";case"8 hours":return"8h";case"12 hours":return"12h";case"Day":return"Daily";case"Monday":return"Mondays";case"Tuesday":return"Tuesdays";case"Wednesday":return"Wednesdays";case"Thursday":return"Thursdays";case"Friday":return"Fridays";case"Saturday":return"Saturdays";case"Sunday":return"Sundays";default:(0,t.U)(e)}}},28571:function(e,n,r){"use strict";r.d(n,{d:function(){return $}});var t=r(85893),u=r(41042),a=r(31821),s=r(37242),o=r(77251),i=r(32546),d=r(87257),c=r(18035),l=r(69339),h=r(24426),f=r(36568),y=r(41499),m=r(25675),p=r.n(m),v=r(42661),g=r(69896),x=r.n(g),_=r(85361),C=r(7395),w=r(41664),j=r.n(w),k=r(49955),M=r(71429),S=r(82209);function T(e){let n="/endpoints/".concat(e.owner.handle,"/").concat(e.slug);return(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:x().avatarColumn,children:(0,t.jsx)(j(),{href:n,children:(0,t.jsx)(S.IconPlug,{})})}),(0,t.jsx)("td",{children:(0,t.jsxs)("div",{className:x().multiline,children:[(0,t.jsx)("div",{className:x().nameAndTags,children:(0,t.jsx)(j(),{className:x().contentName,href:n,children:e.name})}),(0,t.jsxs)("div",{className:x().ownerAndDetails,children:[(0,t.jsxs)(j(),{href:"/".concat(e.owner.handle),children:["@",e.owner.handle]}),(0,t.jsxs)("span",{children:["• updated ",(0,t.jsx)(M.bM,{children:e.updatedAt})]})]})]})}),(0,t.jsx)("td",{children:void 0!==e.querySchedule&&(0,t.jsx)(k.y,{size:"L",schedule:e.querySchedule})})]})}var b=r(82729),L=r(57831),I=r(84937),A=r(39137);function N(){let e=(0,b._)(["\n query ListCustomEndpoints(\n $filters: CustomEndpointFiltersInput!\n $pagination: PaginationInput\n ) {\n customEndpoints(filters: $filters, pagination: $pagination) {\n edges {\n node {\n id\n queryId\n name\n slug\n userId\n teamId\n createdAt\n updatedAt\n query {\n schedules {\n cronExpression\n id\n metadata {\n updatedAt\n }\n nextExecutionTime\n ownedByCustomerId\n performance\n }\n }\n }\n cursor\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n }\n"]);return N=function(){return e},e}let D={user:I.$fW.User,team:I.$fW.Team};(0,A.Z)(N());var U=r(62457),E=r(61575);function F(){var e,n;let r=(0,_.UE)(),u=function(){let e=(0,_.UE)(),n=(0,L.Ke)(),r=(0,I.Jq$)({context:{session:n},fetchPolicy:"cache-and-network",variables:{filters:{contextOwner:{type:D[e.type],id:e.id}}}});return r}(),a=null===(n=u.data)||void 0===n?void 0:null===(e=n.customEndpoints.edges)||void 0===e?void 0:e.map(e=>{let{node:n}=e;return n});if(void 0===a||0===a.length)return(0,t.jsx)(C.u,{title:"You don't have any custom endpoints yet.",illustration:(0,t.jsx)(p(),{alt:"",src:v.Z,width:190,height:200})});let s={type:r.type,id:r.id,handle:r.handle,profileImageUrl:r.profile_image_url};return(0,t.jsx)("table",{className:x().table,children:(0,t.jsx)("tbody",{children:a.map(e=>{var n,r;return(0,t.jsx)(T,{queryId:e.queryId,querySchedule:(0,E.$K)(null===(n=e.query)||void 0===n?void 0:n.schedules)?(0,U.F6)(null===(r=e.query)||void 0===r?void 0:r.schedules[0]):void 0,name:e.name,slug:e.slug,owner:s,createdAt:e.createdAt,updatedAt:e.updatedAt},e.id)})})})}function $(){let e=(0,h.N)("custom-endpoints"),n=(0,l.L)();if((0,u.e)(n.value,{getUrl:e=>(0,c.Y)(e)+"/endpoints"}),!e)return(0,t.jsx)(f.default,{});switch(n.status){case"LOADING":return(0,t.jsx)(s.h,{});case"INVALID":return(0,t.jsx)(d.C,{urlContext:n.invalidValue})}let r=(0,t.jsx)(y.E,{activePage:"Custom endpoints"});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.yG,{title:"Custom endpoints"}),(0,t.jsxs)(i.T3,{children:[(0,t.jsx)(i.h4,{renderLibraryMobileMenu:()=>r}),(0,t.jsxs)(i.or,{children:[(0,t.jsx)(o.im,{children:r}),(0,t.jsx)(i.JH,{children:(0,t.jsx)(i.Kb,{children:(0,t.jsx)(F,{})})})]})]})]})}},62457:function(e,n,r){"use strict";r.d(n,{F6:function(){return d},Yb:function(){return i},sD:function(){return o}});var t=r(61575),u=r(83267),a=r(84512),s=r(35560);function o(e){var n,r,u,a,s,o,i,c,l;let h=void 0!==e.user&&null!==e.user?{type:"user",handle:e.user.handle,id:e.user.id,profile_image_url:null!==(a=e.user.profileImageUrl)&&void 0!==a?a:void 0}:{type:"team",handle:null!==(s=null===(n=e.team)||void 0===n?void 0:n.handle)&&void 0!==s?s:"",id:null!==(o=null===(r=e.team)||void 0===r?void 0:r.id)&&void 0!==o?o:-1,profile_image_url:null!==(i=null===(u=e.team)||void 0===u?void 0:u.profileImageUrl)&&void 0!==i?i:void 0};return{id:e.id,name:e.name,created_at:e.createdAt,updated_at:e.updatedAt,owner:h,is_private:e.isPrivate,tags:null!==(c=e.tags)&&void 0!==c?c:[],favoriteCount:e.starCount,matview_id:null!==(l=e.matviewId)&&void 0!==l?l:void 0,hasStarred:e.hasStarred,schedule:(0,t.$K)(e.schedules)?d(e.schedules[0]):void 0}}function i(e){var n,r,u,a,s,o,i,c;let l=void 0!==e.user&&null!==e.user?{type:"user",handle:e.user.handle,id:e.user.id,profile_image_url:null!==(a=e.user.profileImageUrl)&&void 0!==a?a:void 0}:{type:"team",handle:null!==(s=null===(n=e.team)||void 0===n?void 0:n.handle)&&void 0!==s?s:"",id:null!==(o=null===(r=e.team)||void 0===r?void 0:r.id)&&void 0!==o?o:-1,profile_image_url:null!==(i=null===(u=e.team)||void 0===u?void 0:u.profileImageUrl)&&void 0!==i?i:void 0};return{id:e.id,name:e.name,slug:e.slug,isTrending:!1,created_at:e.createdAt,updated_at:e.updatedAt,owner:l,is_private:e.isPrivate,tags:null!==(c=e.tags)&&void 0!==c?c:[],favoriteCount:e.starCount,hasStarred:e.hasStarred,schedule:(0,t.$K)(e.schedules)?d(e.schedules[0]):void 0}}function d(e){return void 0!==e&&(0,t.$K)(e.cronExpression)&&(0,a.fN)(e.cronExpression)&&(0,t.$K)(e.performance)&&(0,s.U)(e.performance)&&(0,t.$K)(e.ownedByCustomerId)?{id:e.id,cronString:e.cronExpression,performanceTier:e.performance,owner:u.Qc(e.ownedByCustomerId),updatedAt:e.metadata.updatedAt}:void 0}},71429:function(e,n,r){"use strict";r.d(n,{II:function(){return _},bM:function(){return v},rI:function(){return g},wr:function(){return x}});var t=r(85893),u=r(67294),a=r(35180),s=r.n(a),o=r(13120),i=r.n(o),d=r(83412),c=r.n(d),l=r(39612),h=r(14514),f=r.n(h),y=r(51196),m=r.n(y),p=r(52502);let v=e=>{let n=g({now:_(),time:e.children,counter:e.counter});return n?(0,t.jsx)("time",{dateTime:n.abs,title:n.abs,className:e.className,children:n.rel}):null};function g(e){let{now:n,time:r,counter:t}=e;if(!r)return;let u=C(r),a=c()(u);if(t)return{iso:u,abs:a,rel:(0,l.NE)(s()(n,u))};let o=i()(u,n,{addSuffix:!0}),d=o.includes("second")?"Just now":o;return{rel:d,abs:a,iso:u}}function x(e){let{now:n,date:r}=e,t=i()(r,n);return t.includes("second")?"Now":t.replace(" minutes","min").replace(" minute","min").replace(" hours","h").replace(" hour","h").replace(" days","d").replace(" day","d").replace(" months","mo").replace(" month","mo").replace(" years","y").replace(" year","y")}let _=()=>{let e=(0,p.N)();return u.useEffect(()=>{let n=setInterval(e,1e3);return()=>clearInterval(n)},[e]),Date.now()},C=e=>"string"==typeof e?m()(e):"number"==typeof e?f()(e):f()(e.getTime()/1e3)},61018:function(e,n,r){"use strict";r.r(n),r.d(n,{IconBellRing:function(){return u}});var t=r(85893);let u=()=>(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M3 12H13",stroke:"currentColor",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M4 8C4 5.79086 5.79086 4 8 4V4C10.2091 4 12 5.79086 12 8V12H4V8Z",stroke:"currentColor"}),(0,t.jsx)("path",{d:"M6.98122 14.435C7.26281 14.7166 7.6024 14.8574 8 14.8574C8.3976 14.8574 8.73719 14.7166 9.01878 14.435C9.30037 14.1535 9.44116 13.8139 9.44116 13.4163H6.55884C6.55884 13.8139 6.69963 14.1535 6.98122 14.435Z",fill:"currentColor"}),(0,t.jsx)("path",{d:"M7 3C7 2.44772 7.44772 2 8 2C8.55228 2 9 2.44772 9 3V4H7V3Z",fill:"currentColor"}),(0,t.jsx)("path",{d:"M2.16426 5.15975C2.77213 3.89512 3.75161 2.80199 4.9955 1.99999",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M13.9955 5.15981C13.3877 3.89518 12.4082 2.80205 11.1643 2.00005",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]})},5505:function(e,n,r){"use strict";r.r(n),r.d(n,{IconClockHistory:function(){return u}});var t=r(85893);function u(){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M3.52779 4C4.62643 2.7725 6.223 2 8 2C11.3137 2 14 4.68629 14 8C14 9.52167 13.4335 10.911 12.5 11.9687",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:"2 2"}),(0,t.jsx)("path",{d:"M3.52779 4C2.57771 5.06151 2 6.46329 2 8C2 11.3137 4.68629 14 8 14C9.79204 14 11.4006 13.2144 12.5 11.9687",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M8 5V8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M10.6 9.5L8 8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]})}},40551:function(e,n,r){"use strict";function t(e){throw Error("Unreachable code reached")}r.d(n,{U:function(){return t}})},69896:function(e){e.exports={table:"ContentList_table__ezPEU",avatarColumn:"ContentList_avatarColumn__U1KUi",multiline:"ContentList_multiline__pwNrv",contentName:"ContentList_contentName__OAzIv",ownerAndDetails:"ContentList_ownerAndDetails__0cucp",nameAndTags:"ContentList_nameAndTags__gtiaT",badges:"ContentList_badges__D2NOb",favorites:"ContentList_favorites__A_J3c",rightContainer:"ContentList_rightContainer__5pPzJ",actions:"ContentList_actions__AnpKh",threeDotMenu:"ContentList_threeDotMenu__Vqf_d",tags:"ContentList_tags__cgYZj"}},97600:function(e){e.exports={scheduleBadge:"ScheduleBadge_scheduleBadge__FfPCV",badgeLabel:"ScheduleBadge_badgeLabel__tZv3n"}}}]);
//# sourceMappingURL=8571-b7477aa91103b54d.js.map