mirror of
https://github.com/rajnandan1/kener.git
synced 2026-06-23 04:10:22 +00:00
added incident management apis
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
function u(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}export{u as e};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{u as b,s as w,_ as m,J as q,T as x}from"./scheduler.1b18627c.js";const a=[];function z(s,u){return{subscribe:A(s,u).subscribe}}function A(s,u=b){let t;const r=new Set;function o(n){if(w(s,n)&&(s=n,t)){const i=!a.length;for(const e of r)e[1](),a.push(e,s);if(i){for(let e=0;e<a.length;e+=2)a[e][0](a[e+1]);a.length=0}}}function f(n){o(n(s))}function l(n,i=b){const e=[n,i];return r.add(e),r.size===1&&(t=u(o,f)||b),n(s),()=>{r.delete(e),r.size===0&&t&&(t(),t=null)}}return{set:o,update:f,subscribe:l}}function E(s,u,t){const r=!Array.isArray(s),o=r?[s]:s;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const f=u.length<2;return z(t,(l,n)=>{let i=!1;const e=[];let d=0,p=b;const y=()=>{if(d)return;p();const c=u(r?e[0]:e,l,n);f?l(c):p=x(c)?c:b},_=o.map((c,g)=>m(c,h=>{e[g]=h,d&=~(1<<g),i&&y()},()=>{d|=1<<g}));return i=!0,y(),function(){q(_),p(),i=!1}})}function J(s){return{subscribe:s.subscribe.bind(s)}}export{J as a,E as d,z as r,A as w};
|
||||
import{u as b,s as w,_ as m,J as q,T as x}from"./scheduler.0e55af49.js";const a=[];function z(s,u){return{subscribe:A(s,u).subscribe}}function A(s,u=b){let t;const r=new Set;function o(n){if(w(s,n)&&(s=n,t)){const i=!a.length;for(const e of r)e[1](),a.push(e,s);if(i){for(let e=0;e<a.length;e+=2)a[e][0](a[e+1]);a.length=0}}}function f(n){o(n(s))}function l(n,i=b){const e=[n,i];return r.add(e),r.size===1&&(t=u(o,f)||b),n(s),()=>{r.delete(e),r.size===0&&t&&(t(),t=null)}}return{set:o,update:f,subscribe:l}}function E(s,u,t){const r=!Array.isArray(s),o=r?[s]:s;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const f=u.length<2;return z(t,(l,n)=>{let i=!1;const e=[];let d=0,p=b;const y=()=>{if(d)return;p();const c=u(r?e[0]:e,l,n);f?l(c):p=x(c)?c:b},_=o.map((c,g)=>m(c,h=>{e[g]=h,d&=~(1<<g),i&&y()},()=>{d|=1<<g}));return i=!0,y(),function(){q(_),p(),i=!1}})}function J(s){return{subscribe:s.subscribe.bind(s)}}export{J as a,E as d,z as r,A as w};
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
var K=Object.defineProperty;var Q=(t,e,n)=>e in t?K(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var I=(t,e,n)=>(Q(t,typeof e!="symbol"?e+"":e,n),n);import{u as x,$ as W,d as V,a0 as X,J as E,T as j,U as O,a1 as Y,a2 as N,a3 as L,h as Z,a4 as tt,a5 as et,a6 as nt,a7 as it,a8 as T,a9 as st,aa as rt,ab as at,ac as ot,ad as ft}from"./scheduler.1b18627c.js";const q=typeof window<"u";let U=q?()=>window.performance.now():()=>Date.now(),B=q?t=>requestAnimationFrame(t):x;const k=new Set;function G(t){k.forEach(e=>{e.c(t)||(k.delete(e),e.f())}),k.size!==0&&B(G)}function D(t){let e;return k.size===0&&B(G),{promise:new Promise(n=>{k.add(e={c:t,f:n})}),abort(){k.delete(e)}}}const P=new Map;let R=0;function ut(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}function lt(t,e){const n={stylesheet:X(e),rules:{}};return P.set(t,n),n}function z(t,e,n,r,u,a,l,i=0){const c=16.666/r;let s=`{
|
||||
var K=Object.defineProperty;var Q=(t,e,n)=>e in t?K(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var I=(t,e,n)=>(Q(t,typeof e!="symbol"?e+"":e,n),n);import{u as x,$ as W,d as V,a0 as X,J as E,T as j,O,a1 as Y,a2 as N,a3 as T,h as Z,a4 as tt,a5 as et,a6 as nt,a7 as it,a8 as U,a9 as st,aa as rt,ab as at,ac as ot,ad as ft}from"./scheduler.0e55af49.js";const q=typeof window<"u";let B=q?()=>window.performance.now():()=>Date.now(),D=q?t=>requestAnimationFrame(t):x;const k=new Set;function G(t){k.forEach(e=>{e.c(t)||(k.delete(e),e.f())}),k.size!==0&&D(G)}function F(t){let e;return k.size===0&&D(G),{promise:new Promise(n=>{k.add(e={c:t,f:n})}),abort(){k.delete(e)}}}const P=new Map;let R=0;function ut(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}function lt(t,e){const n={stylesheet:X(e),rules:{}};return P.set(t,n),n}function z(t,e,n,r,u,a,l,i=0){const c=16.666/r;let s=`{
|
||||
`;for(let $=0;$<=1;$+=c){const g=e+(n-e)*a($);s+=$*100+`%{${l(g,1-g)}}
|
||||
`}const _=s+`100% {${l(n,1-n)}}
|
||||
}`,f=`__svelte_${ut(_)}_${i}`,m=W(t),{stylesheet:h,rules:o}=P.get(m)||lt(m,t);o[f]||(o[f]=!0,h.insertRule(`@keyframes ${f} ${_}`,h.cssRules.length));const d=t.style.animation||"";return t.style.animation=`${d?`${d}, `:""}${f} ${r}ms linear ${u}ms 1 both`,R+=1,f}function A(t,e){const n=(t.style.animation||"").split(", "),r=n.filter(e?a=>a.indexOf(e)<0:a=>a.indexOf("__svelte")===-1),u=n.length-r.length;u&&(t.style.animation=r.join(", "),R-=u,R||ct())}function ct(){B(()=>{R||(P.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&V(e)}),P.clear())})}let S;function F(){return S||(S=Promise.resolve(),S.then(()=>{S=null})),S}function w(t,e,n){t.dispatchEvent(Y(`${e?"intro":"outro"}${n}`))}const M=new Set;let p;function yt(){p={r:0,c:[],p}}function vt(){p.r||E(p.c),p=p.p}function _t(t,e){t&&t.i&&(M.delete(t),t.i(e))}function wt(t,e,n,r){if(t&&t.o){if(M.has(t))return;M.add(t),p.c.push(()=>{M.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}const J={duration:0};function xt(t,e,n){const r={direction:"in"};let u=e(t,n,r),a=!1,l,i,c=0;function s(){l&&A(t,l)}function _(){const{delay:m=0,duration:h=300,easing:o=N,tick:d=x,css:$}=u||J;$&&(l=z(t,0,1,h,m,o,$,c++)),d(0,1);const g=U()+m,y=g+h;i&&i.abort(),a=!0,O(()=>w(t,!0,"start")),i=D(v=>{if(a){if(v>=y)return d(1,0),w(t,!0,"end"),s(),a=!1;if(v>=g){const b=o((v-g)/h);d(b,1-b)}}return a})}let f=!1;return{start(){f||(f=!0,A(t),j(u)?(u=u(r),F().then(_)):_())},invalidate(){f=!1},end(){a&&(s(),a=!1)}}}function bt(t,e,n){const r={direction:"out"};let u=e(t,n,r),a=!0,l;const i=p;i.r+=1;let c;function s(){const{delay:_=0,duration:f=300,easing:m=N,tick:h=x,css:o}=u||J;o&&(l=z(t,1,0,f,_,m,o));const d=U()+_,$=d+f;O(()=>w(t,!1,"start")),"inert"in t&&(c=t.inert,t.inert=!0),D(g=>{if(a){if(g>=$)return h(0,1),w(t,!1,"end"),--i.r||E(i.c),!1;if(g>=d){const y=m((g-d)/f);h(1-y,y)}}return a})}return j(u)?F().then(()=>{u=u(r),s()}):s(),{end(_){_&&"inert"in t&&(t.inert=c),_&&u.tick&&u.tick(1,0),a&&(l&&A(t,l),a=!1)}}}function kt(t,e,n,r){let a=e(t,n,{direction:"both"}),l=r?0:1,i=null,c=null,s=null,_;function f(){s&&A(t,s)}function m(o,d){const $=o.b-l;return d*=Math.abs($),{a:l,b:o.b,d:$,duration:d,start:o.start,end:o.start+d,group:o.group}}function h(o){const{delay:d=0,duration:$=300,easing:g=N,tick:y=x,css:v}=a||J,b={start:U()+d,b:o};o||(b.group=p,p.r+=1),"inert"in t&&(o?_!==void 0&&(t.inert=_):(_=t.inert,t.inert=!0)),i||c?c=b:(v&&(f(),s=z(t,l,o,$,d,g,v)),o&&y(0,1),i=m(b,$),O(()=>w(t,o,"start")),D(C=>{if(c&&C>c.start&&(i=m(c,$),c=null,w(t,i.b,"start"),v&&(f(),s=z(t,l,i.b,i.duration,0,g,a.css))),i){if(C>=i.end)y(l=i.b,1-l),w(t,i.b,"end"),c||(i.b?f():--i.group.r||E(i.group.c)),i=null;else if(C>=i.start){const H=C-i.start;l=i.a+i.d*g(H/i.duration),y(l,1-l)}}return!!(i||c)}))}return{run(o){j(a)?F().then(()=>{a=a({direction:o?"in":"out"}),h(o)}):h(o)},end(){f(),i=c=null}}}function Et(t){t&&t.c()}function St(t,e){t&&t.l(e)}function dt(t,e,n){const{fragment:r,after_update:u}=t.$$;r&&r.m(e,n),O(()=>{const a=t.$$.on_mount.map(st).filter(j);t.$$.on_destroy?t.$$.on_destroy.push(...a):E(a),t.$$.on_mount=[]}),u.forEach(O)}function $t(t,e){const n=t.$$;n.fragment!==null&&(nt(n.after_update),E(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ht(t,e){t.$$.dirty[0]===-1&&(rt.push(t),at(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Ot(t,e,n,r,u,a,l=null,i=[-1]){const c=it;T(t);const s=t.$$={fragment:null,ctx:[],props:a,update:x,not_equal:u,bound:L(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:L(),dirty:i,skip_bound:!1,root:e.target||c.$$.root};l&&l(s.root);let _=!1;if(s.ctx=n?n(t,e.props||{},(f,m,...h)=>{const o=h.length?h[0]:m;return s.ctx&&u(s.ctx[f],s.ctx[f]=o)&&(!s.skip_bound&&s.bound[f]&&s.bound[f](o),_&&ht(t,f)),m}):[],s.update(),_=!0,E(s.before_update),s.fragment=r?r(s.ctx):!1,e.target){if(e.hydrate){ot();const f=Z(e.target);s.fragment&&s.fragment.l(f),f.forEach(V)}else s.fragment&&s.fragment.c();e.intro&&_t(t.$$.fragment),dt(t,e.target,e.anchor),ft(),tt()}T(c)}class jt{constructor(){I(this,"$$");I(this,"$$set")}$destroy(){$t(this,1),this.$destroy=x}$on(e,n){if(!j(n))return x;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const u=r.indexOf(n);u!==-1&&r.splice(u,1)}}$set(e){this.$$set&&!et(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const mt="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(mt);export{jt as S,_t as a,Et as b,vt as c,St as d,$t as e,bt as f,yt as g,xt as h,Ot as i,kt as j,dt as m,wt as t};
|
||||
}`,f=`__svelte_${ut(_)}_${i}`,m=W(t),{stylesheet:h,rules:o}=P.get(m)||lt(m,t);o[f]||(o[f]=!0,h.insertRule(`@keyframes ${f} ${_}`,h.cssRules.length));const d=t.style.animation||"";return t.style.animation=`${d?`${d}, `:""}${f} ${r}ms linear ${u}ms 1 both`,R+=1,f}function A(t,e){const n=(t.style.animation||"").split(", "),r=n.filter(e?a=>a.indexOf(e)<0:a=>a.indexOf("__svelte")===-1),u=n.length-r.length;u&&(t.style.animation=r.join(", "),R-=u,R||ct())}function ct(){D(()=>{R||(P.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&V(e)}),P.clear())})}let S;function J(){return S||(S=Promise.resolve(),S.then(()=>{S=null})),S}function w(t,e,n){t.dispatchEvent(Y(`${e?"intro":"outro"}${n}`))}const M=new Set;let p;function yt(){p={r:0,c:[],p}}function vt(){p.r||E(p.c),p=p.p}function _t(t,e){t&&t.i&&(M.delete(t),t.i(e))}function wt(t,e,n,r){if(t&&t.o){if(M.has(t))return;M.add(t),p.c.push(()=>{M.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}const L={duration:0};function xt(t,e,n){const r={direction:"in"};let u=e(t,n,r),a=!1,l,i,c=0;function s(){l&&A(t,l)}function _(){const{delay:m=0,duration:h=300,easing:o=N,tick:d=x,css:$}=u||L;$&&(l=z(t,0,1,h,m,o,$,c++)),d(0,1);const g=B()+m,y=g+h;i&&i.abort(),a=!0,O(()=>w(t,!0,"start")),i=F(v=>{if(a){if(v>=y)return d(1,0),w(t,!0,"end"),s(),a=!1;if(v>=g){const b=o((v-g)/h);d(b,1-b)}}return a})}let f=!1;return{start(){f||(f=!0,A(t),j(u)?(u=u(r),J().then(_)):_())},invalidate(){f=!1},end(){a&&(s(),a=!1)}}}function bt(t,e,n){const r={direction:"out"};let u=e(t,n,r),a=!0,l;const i=p;i.r+=1;let c;function s(){const{delay:_=0,duration:f=300,easing:m=N,tick:h=x,css:o}=u||L;o&&(l=z(t,1,0,f,_,m,o));const d=B()+_,$=d+f;O(()=>w(t,!1,"start")),"inert"in t&&(c=t.inert,t.inert=!0),F(g=>{if(a){if(g>=$)return h(0,1),w(t,!1,"end"),--i.r||E(i.c),!1;if(g>=d){const y=m((g-d)/f);h(1-y,y)}}return a})}return j(u)?J().then(()=>{u=u(r),s()}):s(),{end(_){_&&"inert"in t&&(t.inert=c),_&&u.tick&&u.tick(1,0),a&&(l&&A(t,l),a=!1)}}}function kt(t,e,n,r){let a=e(t,n,{direction:"both"}),l=r?0:1,i=null,c=null,s=null,_;function f(){s&&A(t,s)}function m(o,d){const $=o.b-l;return d*=Math.abs($),{a:l,b:o.b,d:$,duration:d,start:o.start,end:o.start+d,group:o.group}}function h(o){const{delay:d=0,duration:$=300,easing:g=N,tick:y=x,css:v}=a||L,b={start:B()+d,b:o};o||(b.group=p,p.r+=1),"inert"in t&&(o?_!==void 0&&(t.inert=_):(_=t.inert,t.inert=!0)),i||c?c=b:(v&&(f(),s=z(t,l,o,$,d,g,v)),o&&y(0,1),i=m(b,$),O(()=>w(t,o,"start")),F(C=>{if(c&&C>c.start&&(i=m(c,$),c=null,w(t,i.b,"start"),v&&(f(),s=z(t,l,i.b,i.duration,0,g,a.css))),i){if(C>=i.end)y(l=i.b,1-l),w(t,i.b,"end"),c||(i.b?f():--i.group.r||E(i.group.c)),i=null;else if(C>=i.start){const H=C-i.start;l=i.a+i.d*g(H/i.duration),y(l,1-l)}}return!!(i||c)}))}return{run(o){j(a)?J().then(()=>{a=a({direction:o?"in":"out"}),h(o)}):h(o)},end(){f(),i=c=null}}}function Et(t){t&&t.c()}function St(t,e){t&&t.l(e)}function dt(t,e,n){const{fragment:r,after_update:u}=t.$$;r&&r.m(e,n),O(()=>{const a=t.$$.on_mount.map(st).filter(j);t.$$.on_destroy?t.$$.on_destroy.push(...a):E(a),t.$$.on_mount=[]}),u.forEach(O)}function $t(t,e){const n=t.$$;n.fragment!==null&&(nt(n.after_update),E(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ht(t,e){t.$$.dirty[0]===-1&&(rt.push(t),at(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Ot(t,e,n,r,u,a,l=null,i=[-1]){const c=it;U(t);const s=t.$$={fragment:null,ctx:[],props:a,update:x,not_equal:u,bound:T(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:T(),dirty:i,skip_bound:!1,root:e.target||c.$$.root};l&&l(s.root);let _=!1;if(s.ctx=n?n(t,e.props||{},(f,m,...h)=>{const o=h.length?h[0]:m;return s.ctx&&u(s.ctx[f],s.ctx[f]=o)&&(!s.skip_bound&&s.bound[f]&&s.bound[f](o),_&&ht(t,f)),m}):[],s.update(),_=!0,E(s.before_update),s.fragment=r?r(s.ctx):!1,e.target){if(e.hydrate){ot();const f=Z(e.target);s.fragment&&s.fragment.l(f),f.forEach(V)}else s.fragment&&s.fragment.c();e.intro&&_t(t.$$.fragment),dt(t,e.target,e.anchor),ft(),tt()}U(c)}class jt{constructor(){I(this,"$$");I(this,"$$set")}$destroy(){$t(this,1),this.$destroy=x}$on(e,n){if(!j(n))return x;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const u=r.indexOf(n);u!==-1&&r.splice(u,1)}}$set(e){this.$$set&&!et(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const mt="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(mt);export{jt as S,_t as a,Et as b,vt as c,St as d,$t as e,bt as f,yt as g,xt as h,Ot as i,kt as j,dt as m,wt as t};
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{w as u}from"./index.3e0e01a3.js";var _;const k=((_=globalThis.__sveltekit_1yr8f85)==null?void 0:_.base)??"";var g;const m=((g=globalThis.__sveltekit_1yr8f85)==null?void 0:g.assets)??k,w="1703527635216",R="sveltekit:snapshot",T="sveltekit:scroll",I="sveltekit:index",f={tap:1,hover:2,viewport:3,eager:4,off:-1},h=location.origin;function S(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function x(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function b(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function O(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=b(e)}}function U(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||E(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=(n==null?void 0:n.origin)===h&&e.hasAttribute("download");return{url:n,external:r,target:o,download:l}}function L(e){let t=null,n=null,o=null,r=null,l=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=c(s,"preload-code")),r===null&&(r=c(s,"preload-data")),t===null&&(t=c(s,"keepfocus")),n===null&&(n=c(s,"noscroll")),l===null&&(l=c(s,"reload")),a===null&&(a=c(s,"replacestate")),s=b(s);function i(v){switch(v){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:d[o??"off"],preload_data:d[r??"off"],keep_focus:i(t),noscroll:i(n),reload:i(l),replace_state:i(a)}}function p(e){const t=u(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function l(a){let s;return t.subscribe(i=>{(s===void 0||n&&i!==s)&&a(s=i)})}return{notify:o,set:r,subscribe:l}}function y(){const{set:e,subscribe:t}=u(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${m}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==w;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function E(e,t){return e.origin!==h||!e.pathname.startsWith(t)}function N(e){e.client}const P={url:p({}),page:p({}),navigating:u(null),updated:y()};export{I,f as P,T as S,R as a,U as b,L as c,P as d,k as e,O as f,S as g,N as h,E as i,h as o,x as s};
|
||||
import{w as u}from"./index.3cd3e9b4.js";var _;const k=((_=globalThis.__sveltekit_1az4y2g)==null?void 0:_.base)??"";var g;const m=((g=globalThis.__sveltekit_1az4y2g)==null?void 0:g.assets)??k,w="1704133327594",R="sveltekit:snapshot",T="sveltekit:scroll",I="sveltekit:index",f={tap:1,hover:2,viewport:3,eager:4,off:-1},h=location.origin;function S(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function x(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function b(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function O(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=b(e)}}function U(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||E(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=(n==null?void 0:n.origin)===h&&e.hasAttribute("download");return{url:n,external:r,target:o,download:l}}function L(e){let t=null,n=null,o=null,r=null,l=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=c(s,"preload-code")),r===null&&(r=c(s,"preload-data")),t===null&&(t=c(s,"keepfocus")),n===null&&(n=c(s,"noscroll")),l===null&&(l=c(s,"reload")),a===null&&(a=c(s,"replacestate")),s=b(s);function i(v){switch(v){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:d[o??"off"],preload_data:d[r??"off"],keep_focus:i(t),noscroll:i(n),reload:i(l),replace_state:i(a)}}function p(e){const t=u(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function l(a){let s;return t.subscribe(i=>{(s===void 0||n&&i!==s)&&a(s=i)})}return{notify:o,set:r,subscribe:l}}function y(){const{set:e,subscribe:t}=u(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${m}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==w;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function E(e,t){return e.origin!==h||!e.pathname.startsWith(t)}function N(e){e.client}const P={url:p({}),page:p({}),navigating:u(null),updated:y()};export{I,f as P,T as S,R as a,U as b,L as c,P as d,k as e,O as f,S as g,N as h,E as i,h as o,x as s};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{s as S,f as _,l as d,a as x,g as f,h as g,m as h,d as u,c as q,i as m,r as v,n as $,u as E,D as y}from"../chunks/scheduler.1b18627c.js";import{S as C,i as D}from"../chunks/index.a0ccbbe4.js";import{d as H}from"../chunks/singletons.8407d17b.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},j={subscribe(s){return P().page.subscribe(s)}};function k(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=_("h1"),o=d(r),n=x(),i=_("p"),l=d(c)},l(e){t=f(e,"H1",{});var a=g(t);o=h(a,r),a.forEach(u),n=q(e),i=f(e,"P",{});var p=g(i);l=h(p,c),p.forEach(u)},m(e,a){m(e,t,a),v(t,o),m(e,n,a),m(e,i,a),v(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&$(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&$(l,c)},i:E,o:E,d(e){e&&(u(t),u(n),u(i))}}}function w(s,t,r){let o;return y(s,j,n=>r(0,o=n)),[o]}let F=class extends C{constructor(t){super(),D(this,t,w,k,S,{})}};export{F as component};
|
||||
import{s as S,f as _,l as d,a as x,g as f,h as g,m as h,d as u,c as q,i as m,r as v,n as $,u as E,D as y}from"../chunks/scheduler.0e55af49.js";import{S as C,i as D}from"../chunks/index.7fa4eb0f.js";import{d as H}from"../chunks/singletons.19f82a08.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},j={subscribe(s){return P().page.subscribe(s)}};function k(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=_("h1"),o=d(r),n=x(),i=_("p"),l=d(c)},l(e){t=f(e,"H1",{});var a=g(t);o=h(a,r),a.forEach(u),n=q(e),i=f(e,"P",{});var p=g(i);l=h(p,c),p.forEach(u)},m(e,a){m(e,t,a),v(t,o),m(e,n,a),m(e,i,a),v(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&$(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&$(l,c)},i:E,o:E,d(e){e&&(u(t),u(n),u(i))}}}function w(s,t,r){let o;return y(s,j,n=>r(0,o=n)),[o]}let F=class extends C{constructor(t){super(),D(this,t,w,k,S,{})}};export{F as component};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"version":"1703527635216"}
|
||||
{"version":"1704133327594"}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.5 KiB |
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"0-34da3b44.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/_layout.server.js","../../../.svelte-kit/adapter-node/nodes/0.js"],"sourcesContent":["import fs from \"fs-extra\";\nimport { p as public_env } from \"../../chunks/shared-server.js\";\nasync function load({ params, route, url, cookies }) {\n let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/site.json\", \"utf8\"));\n let localTz = \"GMT\";\n const localTzCookie = cookies.get(\"localTz\");\n if (!!localTzCookie) {\n localTz = localTzCookie;\n }\n return {\n site,\n localTz\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/_layout.server.js';\n\nexport const index = 0;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_layout.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/+layout.server.js\";\nexport const imports = [\"_app/immutable/nodes/0.45c98190.js\",\"_app/immutable/chunks/scheduler.1b18627c.js\",\"_app/immutable/chunks/index.a0ccbbe4.js\",\"_app/immutable/chunks/each.e59479a4.js\",\"_app/immutable/chunks/index.2f5200cf.js\",\"_app/immutable/chunks/index.3e0e01a3.js\"];\nexport const stylesheets = [\"_app/immutable/assets/0.cc9e9bab.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":";;;AAEA,eAAe,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;AACrD,EAAE,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,EAAE,IAAI,OAAO,GAAG,KAAK,CAAC;AACtB,EAAE,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAC/C,EAAE,IAAI,CAAC,CAAC,aAAa,EAAE;AACvB,IAAI,OAAO,GAAG,aAAa,CAAC;AAC5B,GAAG;AACH,EAAE,OAAO;AACT,IAAI,IAAI;AACR,IAAI,OAAO;AACX,GAAG,CAAC;AACJ;;;;;;;ACXY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,8BAAoC,CAAC,EAAE,QAAQ;AAE1G,MAAC,SAAS,GAAG,+BAA+B;AAC5C,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,wCAAwC,CAAC,yCAAyC,CAAC,yCAAyC,EAAE;AACvQ,MAAC,WAAW,GAAG,CAAC,sCAAsC,EAAE;AACxD,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -21,11 +21,11 @@ var _layout_server = /*#__PURE__*/Object.freeze({
|
||||
|
||||
const index = 0;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./_layout.svelte-48a64526.js')).default;
|
||||
const component = async () => component_cache ??= (await import('./_layout.svelte-69122555.js')).default;
|
||||
const server_id = "src/routes/+layout.server.js";
|
||||
const imports = ["_app/immutable/nodes/0.45c98190.js","_app/immutable/chunks/scheduler.1b18627c.js","_app/immutable/chunks/index.a0ccbbe4.js","_app/immutable/chunks/each.e59479a4.js","_app/immutable/chunks/index.2f5200cf.js","_app/immutable/chunks/index.3e0e01a3.js"];
|
||||
const stylesheets = ["_app/immutable/assets/0.cc9e9bab.css"];
|
||||
const imports = ["_app/immutable/nodes/0.98d1626a.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/index.7fa4eb0f.js","_app/immutable/chunks/ctx.b7ea881a.js","_app/immutable/chunks/index.3cd3e9b4.js","_app/immutable/chunks/index.8cfb104d.js"];
|
||||
const stylesheets = ["_app/immutable/assets/0.399360ef.css"];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _layout_server as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=0-34da3b44.js.map
|
||||
//# sourceMappingURL=0-cb0211dd.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"0-cb0211dd.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/_layout.server.js","../../../.svelte-kit/adapter-node/nodes/0.js"],"sourcesContent":["import fs from \"fs-extra\";\nimport { p as public_env } from \"../../chunks/shared-server.js\";\nasync function load({ params, route, url, cookies }) {\n let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/site.json\", \"utf8\"));\n let localTz = \"GMT\";\n const localTzCookie = cookies.get(\"localTz\");\n if (!!localTzCookie) {\n localTz = localTzCookie;\n }\n return {\n site,\n localTz\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/_layout.server.js';\n\nexport const index = 0;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_layout.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/+layout.server.js\";\nexport const imports = [\"_app/immutable/nodes/0.98d1626a.js\",\"_app/immutable/chunks/scheduler.0e55af49.js\",\"_app/immutable/chunks/index.7fa4eb0f.js\",\"_app/immutable/chunks/ctx.b7ea881a.js\",\"_app/immutable/chunks/index.3cd3e9b4.js\",\"_app/immutable/chunks/index.8cfb104d.js\"];\nexport const stylesheets = [\"_app/immutable/assets/0.399360ef.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":";;;AAEA,eAAe,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;AACrD,EAAE,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,EAAE,IAAI,OAAO,GAAG,KAAK,CAAC;AACtB,EAAE,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAC/C,EAAE,IAAI,CAAC,CAAC,aAAa,EAAE;AACvB,IAAI,OAAO,GAAG,aAAa,CAAC;AAC5B,GAAG;AACH,EAAE,OAAO;AACT,IAAI,IAAI;AACR,IAAI,OAAO;AACX,GAAG,CAAC;AACJ;;;;;;;ACXY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,8BAAoC,CAAC,EAAE,QAAQ;AAE1G,MAAC,SAAS,GAAG,+BAA+B;AAC5C,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,uCAAuC,CAAC,yCAAyC,CAAC,yCAAyC,EAAE;AACtQ,MAAC,WAAW,GAAG,CAAC,sCAAsC,EAAE;AACxD,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -0,0 +1,9 @@
|
||||
const index = 1;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./error.svelte-9dc5c501.js')).default;
|
||||
const imports = ["_app/immutable/nodes/1.4a4109b4.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/index.7fa4eb0f.js","_app/immutable/chunks/singletons.19f82a08.js","_app/immutable/chunks/index.3cd3e9b4.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, stylesheets };
|
||||
//# sourceMappingURL=1-3a88ccd5.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"1-459271f2.js","sources":["../../../.svelte-kit/adapter-node/nodes/1.js"],"sourcesContent":["\n\nexport const index = 1;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/fallbacks/error.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/1.80c470c3.js\",\"_app/immutable/chunks/scheduler.1b18627c.js\",\"_app/immutable/chunks/index.a0ccbbe4.js\",\"_app/immutable/chunks/singletons.8407d17b.js\",\"_app/immutable/chunks/index.3e0e01a3.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAsC,CAAC,EAAE,QAAQ;AAC5G,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,8CAA8C,CAAC,yCAAyC,EAAE;AACnO,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
|
||||
{"version":3,"file":"1-3a88ccd5.js","sources":["../../../.svelte-kit/adapter-node/nodes/1.js"],"sourcesContent":["\n\nexport const index = 1;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/fallbacks/error.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/1.4a4109b4.js\",\"_app/immutable/chunks/scheduler.0e55af49.js\",\"_app/immutable/chunks/index.7fa4eb0f.js\",\"_app/immutable/chunks/singletons.19f82a08.js\",\"_app/immutable/chunks/index.3cd3e9b4.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAsC,CAAC,EAAE,QAAQ;AAC5G,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,8CAA8C,CAAC,yCAAyC,EAAE;AACnO,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -1,9 +0,0 @@
|
||||
const index = 1;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./error.svelte-9dc5c501.js')).default;
|
||||
const imports = ["_app/immutable/nodes/1.80c470c3.js","_app/immutable/chunks/scheduler.1b18627c.js","_app/immutable/chunks/index.a0ccbbe4.js","_app/immutable/chunks/singletons.8407d17b.js","_app/immutable/chunks/index.3e0e01a3.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, stylesheets };
|
||||
//# sourceMappingURL=1-459271f2.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,10 +1,10 @@
|
||||
import { G as GetIncidents, M as Mapper } from './github-e1662b86.js';
|
||||
import { G as GetIncidents, M as Mapper } from './github-54c09baa.js';
|
||||
import fs from 'fs-extra';
|
||||
import { G as GetMinuteStartNowTimestampUTC, B as BeginingOfDay } from './tool-153dc604.js';
|
||||
import { S as StatusObj, P as ParseUptime, a as ParsePercentage } from './helpers-eac5677c.js';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import 'axios';
|
||||
import '@markdoc/markdoc';
|
||||
import 'marked';
|
||||
|
||||
const secondsInDay = 24 * 60 * 60;
|
||||
function getDayData(day0, startTime, endTime) {
|
||||
@@ -126,11 +126,11 @@ var _page_server = /*#__PURE__*/Object.freeze({
|
||||
|
||||
const index = 2;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./_page.svelte-312ab1e2.js')).default;
|
||||
const component = async () => component_cache ??= (await import('./_page.svelte-51a9cf2a.js')).default;
|
||||
const server_id = "src/routes/+page.server.js";
|
||||
const imports = ["_app/immutable/nodes/2.6dabdebd.js","_app/immutable/chunks/scheduler.1b18627c.js","_app/immutable/chunks/index.a0ccbbe4.js","_app/immutable/chunks/each.e59479a4.js","_app/immutable/chunks/card-content.02ecb8a3.js","_app/immutable/chunks/incident.4ef4dd12.js","_app/immutable/chunks/index.2f5200cf.js","_app/immutable/chunks/index.3e0e01a3.js"];
|
||||
const imports = ["_app/immutable/nodes/2.c3097cef.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/index.7fa4eb0f.js","_app/immutable/chunks/ctx.b7ea881a.js","_app/immutable/chunks/index.3cd3e9b4.js","_app/immutable/chunks/chevron-down.2b71fd98.js","_app/immutable/chunks/incident.99422fec.js","_app/immutable/chunks/index.8cfb104d.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _page_server as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=2-3c01972e.js.map
|
||||
//# sourceMappingURL=2-6ac0edba.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"3-8cfd0bbd.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/docs/_page.server.js","../../../.svelte-kit/adapter-node/nodes/3.js"],"sourcesContent":["import axios from \"axios\";\nasync function load({ params, route, url, parent }) {\n const { data } = await axios.get(\"https://raw.githubusercontent.com/rajnandan1/kener/main/docs.md\");\n return {\n md: data\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/docs/_page.server.js';\n\nexport const index = 3;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/docs/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/docs/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/3.789898fb.js\",\"_app/immutable/chunks/scheduler.1b18627c.js\",\"_app/immutable/chunks/index.a0ccbbe4.js\",\"_app/immutable/chunks/each.e59479a4.js\",\"_app/immutable/chunks/card-content.02ecb8a3.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":";;AACA,eAAe,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE;AACpD,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;AACtG,EAAE,OAAO;AACT,IAAI,EAAE,EAAE,IAAI;AACZ,GAAG,CAAC;AACJ;;;;;;;ACJY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAuC,CAAC,EAAE,QAAQ;AAE7G,MAAC,SAAS,GAAG,kCAAkC;AAC/C,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,wCAAwC,CAAC,gDAAgD,EAAE;AACpO,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import fs from 'fs-extra';
|
||||
|
||||
async function load({ params, route, url, parent }) {
|
||||
const { data } = await axios.get("https://raw.githubusercontent.com/rajnandan1/kener/main/docs.md");
|
||||
const data = fs.readFileSync("/Users/raj/kener/docs.md", "utf8");
|
||||
return {
|
||||
md: data
|
||||
};
|
||||
@@ -14,11 +14,11 @@ var _page_server = /*#__PURE__*/Object.freeze({
|
||||
|
||||
const index = 3;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./_page.svelte-db7dbbf9.js')).default;
|
||||
const component = async () => component_cache ??= (await import('./_page.svelte-a36a0a0c.js')).default;
|
||||
const server_id = "src/routes/docs/+page.server.js";
|
||||
const imports = ["_app/immutable/nodes/3.789898fb.js","_app/immutable/chunks/scheduler.1b18627c.js","_app/immutable/chunks/index.a0ccbbe4.js","_app/immutable/chunks/each.e59479a4.js","_app/immutable/chunks/card-content.02ecb8a3.js"];
|
||||
const imports = ["_app/immutable/nodes/3.21622bf4.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/index.7fa4eb0f.js","_app/immutable/chunks/ctx.b7ea881a.js","_app/immutable/chunks/index.3cd3e9b4.js","_app/immutable/chunks/chevron-down.2b71fd98.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _page_server as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=3-8cfd0bbd.js.map
|
||||
//# sourceMappingURL=3-96344d28.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"3-96344d28.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/docs/_page.server.js","../../../.svelte-kit/adapter-node/nodes/3.js"],"sourcesContent":["import fs from \"fs-extra\";\nasync function load({ params, route, url, parent }) {\n const data = fs.readFileSync(\"/Users/raj/kener/docs.md\", \"utf8\");\n return {\n md: data\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/docs/_page.server.js';\n\nexport const index = 3;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/docs/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/docs/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/3.21622bf4.js\",\"_app/immutable/chunks/scheduler.0e55af49.js\",\"_app/immutable/chunks/index.7fa4eb0f.js\",\"_app/immutable/chunks/ctx.b7ea881a.js\",\"_app/immutable/chunks/index.3cd3e9b4.js\",\"_app/immutable/chunks/chevron-down.2b71fd98.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":";;AACA,eAAe,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE;AACpD,EAAE,MAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAC;AACnE,EAAE,OAAO;AACT,IAAI,EAAE,EAAE,IAAI;AACZ,GAAG,CAAC;AACJ;;;;;;;ACJY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAuC,CAAC,EAAE,QAAQ;AAE7G,MAAC,SAAS,GAAG,kCAAkC;AAC/C,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,uCAAuC,CAAC,yCAAyC,CAAC,gDAAgD,EAAE;AAC7Q,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"4-2402dca6.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/incident/_id_/_page.server.js","../../../.svelte-kit/adapter-node/nodes/4.js"],"sourcesContent":["import { p as public_env } from \"../../../../chunks/shared-server.js\";\nimport { G as GetIncidents, M as Mapper } from \"../../../../chunks/github.js\";\nimport fs from \"fs-extra\";\nasync function load({ params, route, url, parent }) {\n let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\n const siteData = await parent();\n const github = siteData.site.github;\n const { description, name, tag, image } = monitors.find((monitor) => monitor.folderName === params.id);\n const allIncidents = await GetIncidents(tag, github, \"all\");\n const gitHubActiveIssues = allIncidents.filter((issue) => {\n return issue.state === \"open\";\n });\n const gitHubPastIssues = allIncidents.filter((issue) => {\n return issue.state === \"closed\";\n });\n return {\n issues: params.id,\n githubConfig: github,\n monitor: { description, name, image },\n activeIncidents: await Promise.all(gitHubActiveIssues.map(Mapper, { github })),\n pastIncidents: await Promise.all(gitHubPastIssues.map(Mapper, { github }))\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/incident/_id_/_page.server.js';\n\nexport const index = 4;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/incident/_id_/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/incident/[id]/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/4.9c29bf21.js\",\"_app/immutable/chunks/scheduler.1b18627c.js\",\"_app/immutable/chunks/index.a0ccbbe4.js\",\"_app/immutable/chunks/each.e59479a4.js\",\"_app/immutable/chunks/incident.4ef4dd12.js\",\"_app/immutable/chunks/card-content.02ecb8a3.js\",\"_app/immutable/chunks/index.2f5200cf.js\",\"_app/immutable/chunks/index.3e0e01a3.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":";;;;;;;AAGA,eAAe,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE;AACpD,EAAE,IAAI,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC;AACxG,EAAE,MAAM,QAAQ,GAAG,MAAM,MAAM,EAAE,CAAC;AAClC,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;AACtC,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,UAAU,KAAK,MAAM,CAAC,EAAE,CAAC,CAAC;AACzG,EAAE,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC9D,EAAE,MAAM,kBAAkB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK;AAC5D,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,MAAM,CAAC;AAClC,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,gBAAgB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK;AAC1D,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,CAAC;AACpC,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,MAAM,EAAE,MAAM,CAAC,EAAE;AACrB,IAAI,YAAY,EAAE,MAAM;AACxB,IAAI,OAAO,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE;AACzC,IAAI,eAAe,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAClF,IAAI,aAAa,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAC9E,GAAG,CAAC;AACJ;;;;;;;ACpBY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAgD,CAAC,EAAE,QAAQ;AAEtH,MAAC,SAAS,GAAG,2CAA2C;AACxD,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,wCAAwC,CAAC,4CAA4C,CAAC,gDAAgD,CAAC,yCAAyC,CAAC,yCAAyC,EAAE;AACrW,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -1,9 +1,9 @@
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import { G as GetIncidents, M as Mapper } from './github-e1662b86.js';
|
||||
import { G as GetIncidents, M as Mapper } from './github-54c09baa.js';
|
||||
import fs from 'fs-extra';
|
||||
import 'axios';
|
||||
import './tool-153dc604.js';
|
||||
import '@markdoc/markdoc';
|
||||
import 'marked';
|
||||
|
||||
async function load({ params, route, url, parent }) {
|
||||
let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
|
||||
@@ -33,11 +33,11 @@ var _page_server = /*#__PURE__*/Object.freeze({
|
||||
|
||||
const index = 4;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./_page.svelte-1b349938.js')).default;
|
||||
const component = async () => component_cache ??= (await import('./_page.svelte-ab6ea79c.js')).default;
|
||||
const server_id = "src/routes/incident/[id]/+page.server.js";
|
||||
const imports = ["_app/immutable/nodes/4.9c29bf21.js","_app/immutable/chunks/scheduler.1b18627c.js","_app/immutable/chunks/index.a0ccbbe4.js","_app/immutable/chunks/each.e59479a4.js","_app/immutable/chunks/incident.4ef4dd12.js","_app/immutable/chunks/card-content.02ecb8a3.js","_app/immutable/chunks/index.2f5200cf.js","_app/immutable/chunks/index.3e0e01a3.js"];
|
||||
const imports = ["_app/immutable/nodes/4.b5788dfa.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/index.7fa4eb0f.js","_app/immutable/chunks/ctx.b7ea881a.js","_app/immutable/chunks/index.3cd3e9b4.js","_app/immutable/chunks/incident.99422fec.js","_app/immutable/chunks/chevron-down.2b71fd98.js","_app/immutable/chunks/index.8cfb104d.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _page_server as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=4-2402dca6.js.map
|
||||
//# sourceMappingURL=4-a823779f.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"4-a823779f.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/incident/_id_/_page.server.js","../../../.svelte-kit/adapter-node/nodes/4.js"],"sourcesContent":["import { p as public_env } from \"../../../../chunks/shared-server.js\";\nimport { e as GetIncidents, M as Mapper } from \"../../../../chunks/github.js\";\nimport fs from \"fs-extra\";\nasync function load({ params, route, url, parent }) {\n let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\n const siteData = await parent();\n const github = siteData.site.github;\n const { description, name, tag, image } = monitors.find((monitor) => monitor.folderName === params.id);\n const allIncidents = await GetIncidents(tag, github, \"all\");\n const gitHubActiveIssues = allIncidents.filter((issue) => {\n return issue.state === \"open\";\n });\n const gitHubPastIssues = allIncidents.filter((issue) => {\n return issue.state === \"closed\";\n });\n return {\n issues: params.id,\n githubConfig: github,\n monitor: { description, name, image },\n activeIncidents: await Promise.all(gitHubActiveIssues.map(Mapper, { github })),\n pastIncidents: await Promise.all(gitHubPastIssues.map(Mapper, { github }))\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/incident/_id_/_page.server.js';\n\nexport const index = 4;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/incident/_id_/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/incident/[id]/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/4.b5788dfa.js\",\"_app/immutable/chunks/scheduler.0e55af49.js\",\"_app/immutable/chunks/index.7fa4eb0f.js\",\"_app/immutable/chunks/ctx.b7ea881a.js\",\"_app/immutable/chunks/index.3cd3e9b4.js\",\"_app/immutable/chunks/incident.99422fec.js\",\"_app/immutable/chunks/chevron-down.2b71fd98.js\",\"_app/immutable/chunks/index.8cfb104d.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":";;;;;;;AAGA,eAAe,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE;AACpD,EAAE,IAAI,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC;AACxG,EAAE,MAAM,QAAQ,GAAG,MAAM,MAAM,EAAE,CAAC;AAClC,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;AACtC,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,UAAU,KAAK,MAAM,CAAC,EAAE,CAAC,CAAC;AACzG,EAAE,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC9D,EAAE,MAAM,kBAAkB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK;AAC5D,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,MAAM,CAAC;AAClC,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,gBAAgB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK;AAC1D,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,CAAC;AACpC,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,MAAM,EAAE,MAAM,CAAC,EAAE;AACrB,IAAI,YAAY,EAAE,MAAM;AACxB,IAAI,OAAO,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE;AACzC,IAAI,eAAe,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAClF,IAAI,aAAa,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAC9E,GAAG,CAAC;AACJ;;;;;;;ACpBY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAgD,CAAC,EAAE,QAAQ;AAEtH,MAAC,SAAS,GAAG,2CAA2C;AACxD,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,uCAAuC,CAAC,yCAAyC,CAAC,4CAA4C,CAAC,gDAAgD,CAAC,yCAAyC,EAAE;AACpW,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"_layout.svelte-48a64526.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/_layout.svelte.js"],"sourcesContent":["import { c as create_ssr_component, a as add_attribute, e as escape, b as each, v as validate_component } from \"../../chunks/ssr.js\";\nimport \"../../chunks/index3.js\";\nconst app = \"\";\nconst kener = \"\";\nconst Nav = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n let { data } = $$props;\n if ($$props.data === void 0 && $$bindings.data && data !== void 0)\n $$bindings.data(data);\n return `<div class=\"one\"></div> <header class=\"relative z-50 w-full\"><div class=\"container flex h-14 items-center\"><div class=\"mr-4 flex blurry-bg\"><a${add_attribute(\"href\", data.site.home ? data.site.home : \"/\", 0)} class=\"mr-6 flex items-center space-x-2\">${data.site.logo ? `<img${add_attribute(\"src\", data.site.logo, 0)} class=\"h-5 w-5\" alt=\"\" srcset=\"\">` : ``} ${data.site.title ? `<span class=\"hidden font-bold sm:inline-block text-[15px] lg:text-base\">${escape(data.site.title)}</span>` : ``}</a> ${data.site.nav ? `<nav class=\"flex items-center space-x-6 text-sm font-medium\">${each(data.site.nav, (navItem) => {\n return `<a${add_attribute(\"href\", navItem.url, 0)}>${escape(navItem.name)} </a>`;\n })}</nav>` : ``}</div></div></header>`;\n});\nconst Layout = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n let { data } = $$props;\n if ($$props.data === void 0 && $$bindings.data && data !== void 0)\n $$bindings.data(data);\n return `${validate_component(Nav, \"Nav\").$$render($$result, { data }, {}, {})} ${$$result.head += `<!-- HEAD_svelte-xs6o1m_START -->${$$result.title = `<title>${escape(data.site.title)}</title>`, \"\"}${each(Object.entries(data.site.metaTags), ([key, value]) => {\n return `<meta${add_attribute(\"name\", key, 0)}${add_attribute(\"content\", value, 0)}>`;\n })}<!-- HEAD_svelte-xs6o1m_END -->`, \"\"} ${slots.default ? slots.default({}) : ``}`;\n});\nexport {\n Layout as default\n};\n"],"names":[],"mappings":";;;;;;AAIA,MAAM,GAAG,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC3E,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AACzB,EAAE,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC;AACnE,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,EAAE,OAAO,CAAC,8IAA8I,EAAE,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,0CAA0C,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,kCAAkC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,wEAAwE,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,6DAA6D,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,KAAK;AAC7mB,IAAI,OAAO,CAAC,EAAE,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;AACrF,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC;AACzC,CAAC,CAAC,CAAC;AACE,MAAC,MAAM,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC9E,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AACzB,EAAE,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC;AACnE,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,EAAE,OAAO,CAAC,EAAE,kBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,IAAI,CAAC,iCAAiC,EAAE,QAAQ,CAAC,KAAK,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;AACtQ,IAAI,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzF,GAAG,CAAC,CAAC,+BAA+B,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACtF,CAAC;;;;"}
|
||||
+4
-3
@@ -1,5 +1,6 @@
|
||||
import { c as create_ssr_component, v as validate_component, e as escape, a as each, b as add_attribute } from './ssr-c85d451a.js';
|
||||
import './index3-0d676326.js';
|
||||
import './index3-58d8c192.js';
|
||||
import './ctx-168edc6f.js';
|
||||
import './index2-d9c461ad.js';
|
||||
import 'clsx';
|
||||
import 'tailwind-variants';
|
||||
@@ -8,7 +9,7 @@ const Nav = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let { data } = $$props;
|
||||
if ($$props.data === void 0 && $$bindings.data && data !== void 0)
|
||||
$$bindings.data(data);
|
||||
return `<div class="one"></div> <header class="relative z-50 w-full"><div class="container flex h-14 items-center"><div class="mr-4 flex blurry-bg"><a${add_attribute("href", data.site.home ? data.site.home : "/", 0)} class="mr-6 flex items-center space-x-2">${data.site.logo ? `<img${add_attribute("src", data.site.logo, 0)} class="h-5 w-5" alt="" srcset="">` : ``} ${data.site.title ? `<span class="hidden font-bold sm:inline-block text-[15px] lg:text-base">${escape(data.site.title)}</span>` : ``}</a> ${data.site.nav ? `<nav class="flex items-center space-x-6 text-sm font-medium">${each(data.site.nav, (navItem) => {
|
||||
return `<div class="one"></div> <header class="relative z-50 w-full"><div class="container flex h-14 items-center"><div class="mr-4 flex blurry-bg"><a${add_attribute("href", data.site.home ? data.site.home : "/", 0)} class="mr-6 flex items-center space-x-2">${data.site.logo ? `<img${add_attribute("src", data.site.logo, 0)} class="h-9 w-9"${add_attribute("alt", data.site.title, 0)} srcset="">` : ``} ${data.site.title ? `<span class="hidden font-bold sm:inline-block text-[15px] lg:text-base">${escape(data.site.title)}</span>` : ``}</a> ${data.site.nav ? `<nav class="flex items-center space-x-6 text-sm font-medium">${each(data.site.nav, (navItem) => {
|
||||
return `<a${add_attribute("href", navItem.url, 0)}>${escape(navItem.name)} </a>`;
|
||||
})}</nav>` : ``}</div></div></header>`;
|
||||
});
|
||||
@@ -22,4 +23,4 @@ const Layout = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
});
|
||||
|
||||
export { Layout as default };
|
||||
//# sourceMappingURL=_layout.svelte-48a64526.js.map
|
||||
//# sourceMappingURL=_layout.svelte-69122555.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_layout.svelte-69122555.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/_layout.svelte.js"],"sourcesContent":["import { c as create_ssr_component, a as add_attribute, e as escape, b as each, v as validate_component } from \"../../chunks/ssr.js\";\nimport \"../../chunks/index3.js\";\nconst app = \"\";\nconst kener = \"\";\nconst Nav = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n let { data } = $$props;\n if ($$props.data === void 0 && $$bindings.data && data !== void 0)\n $$bindings.data(data);\n return `<div class=\"one\"></div> <header class=\"relative z-50 w-full\"><div class=\"container flex h-14 items-center\"><div class=\"mr-4 flex blurry-bg\"><a${add_attribute(\"href\", data.site.home ? data.site.home : \"/\", 0)} class=\"mr-6 flex items-center space-x-2\">${data.site.logo ? `<img${add_attribute(\"src\", data.site.logo, 0)} class=\"h-9 w-9\"${add_attribute(\"alt\", data.site.title, 0)} srcset=\"\">` : ``} ${data.site.title ? `<span class=\"hidden font-bold sm:inline-block text-[15px] lg:text-base\">${escape(data.site.title)}</span>` : ``}</a> ${data.site.nav ? `<nav class=\"flex items-center space-x-6 text-sm font-medium\">${each(data.site.nav, (navItem) => {\n return `<a${add_attribute(\"href\", navItem.url, 0)}>${escape(navItem.name)} </a>`;\n })}</nav>` : ``}</div></div></header>`;\n});\nconst Layout = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n let { data } = $$props;\n if ($$props.data === void 0 && $$bindings.data && data !== void 0)\n $$bindings.data(data);\n return `${validate_component(Nav, \"Nav\").$$render($$result, { data }, {}, {})} ${$$result.head += `<!-- HEAD_svelte-xs6o1m_START -->${$$result.title = `<title>${escape(data.site.title)}</title>`, \"\"}${each(Object.entries(data.site.metaTags), ([key, value]) => {\n return `<meta${add_attribute(\"name\", key, 0)}${add_attribute(\"content\", value, 0)}>`;\n })}<!-- HEAD_svelte-xs6o1m_END -->`, \"\"} ${slots.default ? slots.default({}) : ``}`;\n});\nexport {\n Layout as default\n};\n"],"names":[],"mappings":";;;;;;;AAIA,MAAM,GAAG,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC3E,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AACzB,EAAE,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC;AACnE,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,EAAE,OAAO,CAAC,8IAA8I,EAAE,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,0CAA0C,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,gBAAgB,EAAE,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,wEAAwE,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,6DAA6D,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,KAAK;AACjpB,IAAI,OAAO,CAAC,EAAE,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;AACrF,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC;AACzC,CAAC,CAAC,CAAC;AACE,MAAC,MAAM,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC9E,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AACzB,EAAE,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC;AACnE,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,EAAE,OAAO,CAAC,EAAE,kBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,IAAI,CAAC,iCAAiC,EAAE,QAAQ,CAAC,KAAK,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;AACtQ,IAAI,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzF,GAAG,CAAC,CAAC,+BAA+B,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACtF,CAAC;;;;"}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8
-7
@@ -1,8 +1,9 @@
|
||||
import { c as create_ssr_component, b as add_attribute, e as escape, v as validate_component, a as each } from './ssr-c85d451a.js';
|
||||
import { C as Card, a as Card_content } from './card-content-512872f2.js';
|
||||
import { C as Card, a as Card_content, I as Icon$1 } from './chevron-down-226abe3e.js';
|
||||
import 'clsx';
|
||||
import { B as Badge, I as Incident, R as Root, T as Trigger, H as Hover_card_content, a as Icon$1 } from './incident-fe6a229f.js';
|
||||
import { b as buttonVariants } from './index3-0d676326.js';
|
||||
import { B as Badge, I as Incident, R as Root, T as Trigger, H as Hover_card_content } from './incident-3b62e478.js';
|
||||
import './ctx-168edc6f.js';
|
||||
import { b as buttonVariants } from './index3-58d8c192.js';
|
||||
import 'tailwind-merge';
|
||||
import './index2-d9c461ad.js';
|
||||
import './helpers-eac5677c.js';
|
||||
@@ -48,7 +49,7 @@ const Monitor = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
}
|
||||
})}`;
|
||||
}
|
||||
})}` : ``}</div></div> <div class="mt-2"><div class="grid grid-cols-2 gap-0"><div class="col-span-2 -mt-2"><a href="${"/incident/" + escape(monitor.folderName, true) + "#past_incident"}" class="${"pt-0 pl-0 pb-0 text-indigo-500 text-left " + escape(buttonVariants({ variant: "link" }), true)}">Recent Incidents ${validate_component(ArrowRight, "ArrowRight").$$render($$result, { size: 16 }, {}, {})}</a></div></div></div></div> <div class="col-span-12 md:col-span-8 pt-2"><div class="grid grid-cols-12"><div class="col-span-12 md:col-span-8 h-[32px]"><a href="javascript:void(0);">${validate_component(Badge, "Badge").$$render(
|
||||
})}` : ``}</div></div> <div class="mt-2"><div class="grid grid-cols-2 gap-0"><div class="col-span-2 -mt-2"><a href="${"/incident/" + escape(monitor.folderName, true) + "#past_incident"}" class="${"pt-0 pl-0 pb-0 text-indigo-500 text-left " + escape(buttonVariants({ variant: "link" }), true)}">Recent Incidents ${validate_component(ArrowRight, "ArrowRight").$$render($$result, { size: 16 }, {}, {})}</a></div></div></div></div> <div class="col-span-12 md:col-span-8 pt-2"><div class="grid grid-cols-12"><div class="col-span-12 md:col-span-8 h-[32px]"><button class="inline-block">${validate_component(Badge, "Badge").$$render(
|
||||
$$result,
|
||||
{
|
||||
variant: ""
|
||||
@@ -59,11 +60,11 @@ const Monitor = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
return `90 Day ► ${escape(uptime90Day)}%`;
|
||||
}
|
||||
}
|
||||
)}</a> <a href="javascript:void(0);">${validate_component(Badge, "Badge").$$render($$result, { variant: "outline" }, {}, {
|
||||
)}</button> <button>${validate_component(Badge, "Badge").$$render($$result, { variant: "outline" }, {}, {
|
||||
default: () => {
|
||||
return `Today ► ${escape(uptime0Day)}%`;
|
||||
}
|
||||
})}</a></div> <div class="col-span-12 md:col-span-4 text-right h-[32px]">${_90Day[todayDD] ? `<div class="${"text-api-up text-sm font-semibold mt-[4px] text-" + escape(_90Day[todayDD].cssClass, true)}">${escape(_90Day[todayDD].message)}</div>` : ``}</div></div> <div class="grid grid-cols-12">${`<div class="chart-status relative mt-1 col-span-12"><div class="flex flex-wrap">${each(Object.entries(_90Day), ([ts, bar]) => {
|
||||
})}</button></div> <div class="col-span-12 md:col-span-4 text-right h-[32px]">${_90Day[todayDD] ? `<div class="${"text-api-up text-sm font-semibold mt-[4px] text-" + escape(_90Day[todayDD].cssClass, true)}">${escape(_90Day[todayDD].message)}</div>` : ``}</div></div> <div class="grid grid-cols-12">${`<div class="chart-status relative mt-1 col-span-12"><div class="flex flex-wrap">${each(Object.entries(_90Day), ([ts, bar]) => {
|
||||
return `<div class="h-[30px] w-[6px] rounded-sm oneline"><div class="${"h-[30px] bg-" + escape(bar.cssClass, true) + " w-[4px] rounded-sm mr-[2px]"}"></div></div> <div class="absolute show-hover text-sm bg-background"><div class="${"text-" + escape(bar.cssClass, true) + " font-semibold"}">${bar.message != "No Data" ? `● ${escape(new Date(bar.timestamp * 1e3).toLocaleDateString())} ${escape(bar.message)}` : `● ${escape(new Date(bar.timestamp * 1e3).toLocaleDateString())} ${escape(bar.message)}`}</div> </div>`;
|
||||
})}</div></div>`}</div></div></div>`;
|
||||
}
|
||||
@@ -114,4 +115,4 @@ const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
});
|
||||
|
||||
export { Page as default };
|
||||
//# sourceMappingURL=_page.svelte-312ab1e2.js.map
|
||||
//# sourceMappingURL=_page.svelte-51a9cf2a.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,324 @@
|
||||
import { c as create_ssr_component, v as validate_component, a as each, e as escape, f as compute_rest_props, d as subscribe, h as spread, i as escape_object } from './ssr-c85d451a.js';
|
||||
import { marked } from 'marked';
|
||||
import { C as Card, a as Card_content, c as cn, b as ChevronDown, d as createDispatcher, e as cubicOut } from './chevron-down-226abe3e.js';
|
||||
import 'clsx';
|
||||
import { s as setCtx$2, a as setItem, g as getCtx$1, b as getTrigger, c as getContent, d as getAttrs$2 } from './ctx-168edc6f.js';
|
||||
import 'tailwind-merge';
|
||||
import './index2-d9c461ad.js';
|
||||
|
||||
const Accordion = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["multiple", "value", "onValueChange", "disabled", "asChild"]);
|
||||
let $root, $$unsubscribe_root;
|
||||
let { multiple = false } = $$props;
|
||||
let { value = void 0 } = $$props;
|
||||
let { onValueChange = void 0 } = $$props;
|
||||
let { disabled = false } = $$props;
|
||||
let { asChild = false } = $$props;
|
||||
const { elements: { root }, states: { value: localValue }, updateOption } = setCtx$2({
|
||||
multiple,
|
||||
disabled,
|
||||
defaultValue: value,
|
||||
onValueChange: ({ next }) => {
|
||||
if (value !== next) {
|
||||
onValueChange?.(next);
|
||||
value = next;
|
||||
}
|
||||
return next;
|
||||
}
|
||||
});
|
||||
$$unsubscribe_root = subscribe(root, (value2) => $root = value2);
|
||||
const attrs = getAttrs$2("root");
|
||||
if ($$props.multiple === void 0 && $$bindings.multiple && multiple !== void 0)
|
||||
$$bindings.multiple(multiple);
|
||||
if ($$props.value === void 0 && $$bindings.value && value !== void 0)
|
||||
$$bindings.value(value);
|
||||
if ($$props.onValueChange === void 0 && $$bindings.onValueChange && onValueChange !== void 0)
|
||||
$$bindings.onValueChange(onValueChange);
|
||||
if ($$props.disabled === void 0 && $$bindings.disabled && disabled !== void 0)
|
||||
$$bindings.disabled(disabled);
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
{
|
||||
localValue.set(value);
|
||||
}
|
||||
{
|
||||
updateOption("multiple", multiple);
|
||||
}
|
||||
{
|
||||
updateOption("disabled", disabled);
|
||||
}
|
||||
builder = $root;
|
||||
$$unsubscribe_root();
|
||||
return `${asChild ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>`}`;
|
||||
});
|
||||
const AccordionItem = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["value", "disabled", "asChild"]);
|
||||
let $item, $$unsubscribe_item;
|
||||
let { value } = $$props;
|
||||
let { disabled = void 0 } = $$props;
|
||||
let { asChild = false } = $$props;
|
||||
const { item, props } = setItem({ value, disabled });
|
||||
$$unsubscribe_item = subscribe(item, (value2) => $item = value2);
|
||||
const attrs = getAttrs$2("item");
|
||||
if ($$props.value === void 0 && $$bindings.value && value !== void 0)
|
||||
$$bindings.value(value);
|
||||
if ($$props.disabled === void 0 && $$bindings.disabled && disabled !== void 0)
|
||||
$$bindings.disabled(disabled);
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
builder = $item(props);
|
||||
$$unsubscribe_item();
|
||||
return `${asChild ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>`}`;
|
||||
});
|
||||
const AccordionHeader = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["level", "asChild"]);
|
||||
let $header, $$unsubscribe_header;
|
||||
let { level = 3 } = $$props;
|
||||
let { asChild = false } = $$props;
|
||||
const { elements: { heading: header } } = getCtx$1();
|
||||
$$unsubscribe_header = subscribe(header, (value) => $header = value);
|
||||
const attrs = getAttrs$2("header");
|
||||
if ($$props.level === void 0 && $$bindings.level && level !== void 0)
|
||||
$$bindings.level(level);
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
builder = $header(level);
|
||||
$$unsubscribe_header();
|
||||
return `${asChild ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>`}`;
|
||||
});
|
||||
const AccordionTrigger = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["asChild"]);
|
||||
let $trigger, $$unsubscribe_trigger;
|
||||
let { asChild = false } = $$props;
|
||||
const { trigger, props } = getTrigger();
|
||||
$$unsubscribe_trigger = subscribe(trigger, (value) => $trigger = value);
|
||||
createDispatcher();
|
||||
const attrs = getAttrs$2("trigger");
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
builder = $trigger(props);
|
||||
$$unsubscribe_trigger();
|
||||
return `${asChild ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `<button${spread(
|
||||
[
|
||||
escape_object(builder),
|
||||
{ type: "button" },
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({ builder, attrs }) : ``}</button>`}`;
|
||||
});
|
||||
const AccordionContent = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, [
|
||||
"transition",
|
||||
"transitionConfig",
|
||||
"inTransition",
|
||||
"inTransitionConfig",
|
||||
"outTransition",
|
||||
"outTransitionConfig",
|
||||
"asChild"
|
||||
]);
|
||||
let $content, $$unsubscribe_content;
|
||||
let $isSelected, $$unsubscribe_isSelected;
|
||||
let { transition = void 0 } = $$props;
|
||||
let { transitionConfig = void 0 } = $$props;
|
||||
let { inTransition = void 0 } = $$props;
|
||||
let { inTransitionConfig = void 0 } = $$props;
|
||||
let { outTransition = void 0 } = $$props;
|
||||
let { outTransitionConfig = void 0 } = $$props;
|
||||
let { asChild = false } = $$props;
|
||||
const { content, isSelected, props } = getContent();
|
||||
$$unsubscribe_content = subscribe(content, (value) => $content = value);
|
||||
$$unsubscribe_isSelected = subscribe(isSelected, (value) => $isSelected = value);
|
||||
const attrs = getAttrs$2("content");
|
||||
if ($$props.transition === void 0 && $$bindings.transition && transition !== void 0)
|
||||
$$bindings.transition(transition);
|
||||
if ($$props.transitionConfig === void 0 && $$bindings.transitionConfig && transitionConfig !== void 0)
|
||||
$$bindings.transitionConfig(transitionConfig);
|
||||
if ($$props.inTransition === void 0 && $$bindings.inTransition && inTransition !== void 0)
|
||||
$$bindings.inTransition(inTransition);
|
||||
if ($$props.inTransitionConfig === void 0 && $$bindings.inTransitionConfig && inTransitionConfig !== void 0)
|
||||
$$bindings.inTransitionConfig(inTransitionConfig);
|
||||
if ($$props.outTransition === void 0 && $$bindings.outTransition && outTransition !== void 0)
|
||||
$$bindings.outTransition(outTransition);
|
||||
if ($$props.outTransitionConfig === void 0 && $$bindings.outTransitionConfig && outTransitionConfig !== void 0)
|
||||
$$bindings.outTransitionConfig(outTransitionConfig);
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
builder = $content(props);
|
||||
$$unsubscribe_content();
|
||||
$$unsubscribe_isSelected();
|
||||
return `${asChild && $isSelected(props) ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `${transition && $isSelected(props) ? `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : `${inTransition && outTransition && $isSelected(props) ? `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : `${inTransition && $isSelected(props) ? `<div${spread(
|
||||
[
|
||||
escape_object(builder),
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : `${outTransition && $isSelected(props) ? `<div${spread(
|
||||
[
|
||||
escape_object(builder),
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : `${$isSelected(props) ? `<div${spread(
|
||||
[
|
||||
escape_object(builder),
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : ``}`}`}`}`}`}`;
|
||||
});
|
||||
function slide(node, { delay = 0, duration = 400, easing = cubicOut, axis = "y" } = {}) {
|
||||
const style = getComputedStyle(node);
|
||||
const opacity = +style.opacity;
|
||||
const primary_property = axis === "y" ? "height" : "width";
|
||||
const primary_property_value = parseFloat(style[primary_property]);
|
||||
const secondary_properties = axis === "y" ? ["top", "bottom"] : ["left", "right"];
|
||||
const capitalized_secondary_properties = secondary_properties.map(
|
||||
(e) => `${e[0].toUpperCase()}${e.slice(1)}`
|
||||
);
|
||||
const padding_start_value = parseFloat(style[`padding${capitalized_secondary_properties[0]}`]);
|
||||
const padding_end_value = parseFloat(style[`padding${capitalized_secondary_properties[1]}`]);
|
||||
const margin_start_value = parseFloat(style[`margin${capitalized_secondary_properties[0]}`]);
|
||||
const margin_end_value = parseFloat(style[`margin${capitalized_secondary_properties[1]}`]);
|
||||
const border_width_start_value = parseFloat(
|
||||
style[`border${capitalized_secondary_properties[0]}Width`]
|
||||
);
|
||||
const border_width_end_value = parseFloat(
|
||||
style[`border${capitalized_secondary_properties[1]}Width`]
|
||||
);
|
||||
return {
|
||||
delay,
|
||||
duration,
|
||||
easing,
|
||||
css: (t) => `overflow: hidden;opacity: ${Math.min(t * 20, 1) * opacity};${primary_property}: ${t * primary_property_value}px;padding-${secondary_properties[0]}: ${t * padding_start_value}px;padding-${secondary_properties[1]}: ${t * padding_end_value}px;margin-${secondary_properties[0]}: ${t * margin_start_value}px;margin-${secondary_properties[1]}: ${t * margin_end_value}px;border-${secondary_properties[0]}-width: ${t * border_width_start_value}px;border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;`
|
||||
};
|
||||
}
|
||||
const Accordion_content = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class", "transition", "transitionConfig"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
let { transition = slide } = $$props;
|
||||
let { transitionConfig = { duration: 200 } } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
if ($$props.transition === void 0 && $$bindings.transition && transition !== void 0)
|
||||
$$bindings.transition(transition);
|
||||
if ($$props.transitionConfig === void 0 && $$bindings.transitionConfig && transitionConfig !== void 0)
|
||||
$$bindings.transitionConfig(transitionConfig);
|
||||
return `${validate_component(AccordionContent, "AccordionPrimitive.Content").$$render(
|
||||
$$result,
|
||||
Object.assign(
|
||||
{},
|
||||
{
|
||||
class: cn("overflow-hidden text-sm transition-all", className)
|
||||
},
|
||||
{ transition },
|
||||
{ transitionConfig },
|
||||
$$restProps
|
||||
),
|
||||
{},
|
||||
{
|
||||
default: () => {
|
||||
return `<div class="pb-4 pt-0">${slots.default ? slots.default({}) : ``}</div>`;
|
||||
}
|
||||
}
|
||||
)}`;
|
||||
});
|
||||
const Accordion_item = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class", "value"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
let { value } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
if ($$props.value === void 0 && $$bindings.value && value !== void 0)
|
||||
$$bindings.value(value);
|
||||
return `${validate_component(AccordionItem, "AccordionPrimitive.Item").$$render($$result, Object.assign({}, { value }, { class: cn("border-b", className) }, $$restProps), {}, {
|
||||
default: () => {
|
||||
return `${slots.default ? slots.default({}) : ``}`;
|
||||
}
|
||||
})}`;
|
||||
});
|
||||
const Accordion_trigger = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class", "level"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
let { level = 3 } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
if ($$props.level === void 0 && $$bindings.level && level !== void 0)
|
||||
$$bindings.level(level);
|
||||
return `${validate_component(AccordionHeader, "AccordionPrimitive.Header").$$render($$result, { level, class: "flex" }, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(AccordionTrigger, "AccordionPrimitive.Trigger").$$render(
|
||||
$$result,
|
||||
Object.assign(
|
||||
{},
|
||||
{
|
||||
class: cn("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180", className)
|
||||
},
|
||||
$$restProps
|
||||
),
|
||||
{},
|
||||
{
|
||||
default: () => {
|
||||
return `${slots.default ? slots.default({}) : ``} ${validate_component(ChevronDown, "ChevronDown").$$render(
|
||||
$$result,
|
||||
{
|
||||
class: "h-4 w-4 transition-transform duration-200"
|
||||
},
|
||||
{},
|
||||
{}
|
||||
)}`;
|
||||
}
|
||||
}
|
||||
)}`;
|
||||
}
|
||||
})}`;
|
||||
});
|
||||
const Root = Accordion;
|
||||
const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let { data } = $$props;
|
||||
let html = marked.parse(data.md);
|
||||
let sideBar = [];
|
||||
if ($$props.data === void 0 && $$bindings.data && data !== void 0)
|
||||
$$bindings.data(data);
|
||||
return `<section class="mx-auto container rounded-3xl scroll-smooth mt-8">${validate_component(Card, "Card.Root").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Card_content, "Card.Content").$$render($$result, { class: "px-1" }, {}, {
|
||||
default: () => {
|
||||
return `<div class="grid grid-cols-5 gap-4"><div class="col-span-5 md:col-span-1 pt-2 hidden md:block pr-1 border-r-2 border-secondary sticky top-0 overflow-y-auto max-h-screen">${each(sideBar, (item) => {
|
||||
return `${validate_component(Root, "Accordion.Root").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Accordion_item, "Accordion.Item").$$render($$result, { value: item.id }, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Accordion_trigger, "Accordion.Trigger").$$render($$result, { class: "text-sm font-semibold pl-2 pr-3" }, {}, {
|
||||
default: () => {
|
||||
return `<a href="${"#" + escape(item.id, true)}" class="sidebar-a">${escape(item.text)}</a> `;
|
||||
}
|
||||
})} ${validate_component(Accordion_content, "Accordion.Content").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return ` <ul class="text-sm font-medium pl-6">${each(item.children, (child) => {
|
||||
return `<li class="w-full py-2"><a href="${"#" + escape(child.id, true)}" class="sidebar-a">${escape(child.text)}</a> </li>`;
|
||||
})}</ul> `;
|
||||
}
|
||||
})} `;
|
||||
}
|
||||
})} `;
|
||||
}
|
||||
})}`;
|
||||
})}</div> <div class="col-span-5 md:col-span-4"><div class="pt-6 p-0 md:p-10 "><article id="markdown" class="prose prose-stone max-w-none dark:prose-invert dark:prose-pre:bg-neutral-900 prose-code:py-[0.2rem] prose-code:font-normal prose-code:font-mono prose-code:text-sm prose-code:rounded"><!-- HTML_TAG_START -->${html}<!-- HTML_TAG_END --></article></div></div></div>`;
|
||||
}
|
||||
})}`;
|
||||
}
|
||||
})}</section>`;
|
||||
});
|
||||
|
||||
export { Page as default };
|
||||
//# sourceMappingURL=_page.svelte-a36a0a0c.js.map
|
||||
File diff suppressed because one or more lines are too long
+5
-4
@@ -1,11 +1,12 @@
|
||||
import { c as create_ssr_component, e as escape, v as validate_component, a as each, f as compute_rest_props, d as subscribe, h as spread, i as escape_object } from './ssr-c85d451a.js';
|
||||
import 'clsx';
|
||||
import { B as Badge, I as Incident } from './incident-fe6a229f.js';
|
||||
import { s as setCtx, g as getAttrs } from './index3-0d676326.js';
|
||||
import { c as cn } from './card-content-512872f2.js';
|
||||
import { B as Badge, I as Incident } from './incident-3b62e478.js';
|
||||
import { e as setCtx, f as getAttrs } from './ctx-168edc6f.js';
|
||||
import { c as cn } from './chevron-down-226abe3e.js';
|
||||
import 'moment';
|
||||
import './index2-d9c461ad.js';
|
||||
import './helpers-eac5677c.js';
|
||||
import './index3-58d8c192.js';
|
||||
import 'tailwind-variants';
|
||||
import 'tailwind-merge';
|
||||
|
||||
@@ -105,4 +106,4 @@ const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
});
|
||||
|
||||
export { Page as default };
|
||||
//# sourceMappingURL=_page.svelte-1b349938.js.map
|
||||
//# sourceMappingURL=_page.svelte-ab6ea79c.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,29 +0,0 @@
|
||||
import { c as create_ssr_component, v as validate_component, a as each, e as escape, b as add_attribute } from './ssr-c85d451a.js';
|
||||
import Markdoc from '@markdoc/markdoc';
|
||||
import { C as Card, a as Card_content } from './card-content-512872f2.js';
|
||||
import 'clsx';
|
||||
import 'tailwind-merge';
|
||||
|
||||
const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let { data } = $$props;
|
||||
const ast = Markdoc.parse(data.md);
|
||||
const content = Markdoc.transform(ast);
|
||||
let html = Markdoc.renderers.html(content);
|
||||
let sideBar = [];
|
||||
if ($$props.data === void 0 && $$bindings.data && data !== void 0)
|
||||
$$bindings.data(data);
|
||||
return `<section class="mx-auto container rounded-3xl mt-8">${validate_component(Card, "Card.Root").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Card_content, "Card.Content").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `<div class="grid grid-cols-5 gap-4"><div class="col-span-5 md:col-span-1 pt-2 hidden md:block border-r-2 border-secondary"><ul class="w-full text-sm font-medium sticky top-0 overflow-y-auto max-h-screen">${each(sideBar, (item) => {
|
||||
return `<li class="w-full py-2"><a href="${"#" + escape(item.id, true)}"${add_attribute("class", item.type == "h2" ? "pl-5" : "", 0)}>${escape(item.text)}</a> </li>`;
|
||||
})}</ul></div> <div class="col-span-5 md:col-span-4"><div class="pt-6 p-0 md:p-10"><article id="markdown" class="prose prose-stone max-w-none dark:prose-invert dark:prose-pre:bg-neutral-900 prose-code:px-[0.3rem] dark:prose-code:bg-yellow-100 dark:prose-code:text-primary-foreground prose-code:py-[0.2rem] prose-code:font-normal prose-code:font-mono prose-code:text-sm prose-code:rounded"><!-- HTML_TAG_START -->${html}<!-- HTML_TAG_END --></article></div></div></div>`;
|
||||
}
|
||||
})}`;
|
||||
}
|
||||
})}</section>`;
|
||||
});
|
||||
|
||||
export { Page as default };
|
||||
//# sourceMappingURL=_page.svelte-db7dbbf9.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"_page.svelte-db7dbbf9.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/docs/_page.svelte.js"],"sourcesContent":["import { c as create_ssr_component, v as validate_component, b as each, e as escape, a as add_attribute } from \"../../../chunks/ssr.js\";\nimport Markdoc from \"@markdoc/markdoc\";\nimport { C as Card, a as Card_content } from \"../../../chunks/card-content.js\";\nimport \"clsx\";\nconst Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n let { data } = $$props;\n const ast = Markdoc.parse(data.md);\n const content = Markdoc.transform(ast);\n let html = Markdoc.renderers.html(content);\n let sideBar = [];\n if ($$props.data === void 0 && $$bindings.data && data !== void 0)\n $$bindings.data(data);\n return `<section class=\"mx-auto container rounded-3xl mt-8\">${validate_component(Card, \"Card.Root\").$$render($$result, {}, {}, {\n default: () => {\n return `${validate_component(Card_content, \"Card.Content\").$$render($$result, {}, {}, {\n default: () => {\n return `<div class=\"grid grid-cols-5 gap-4\"><div class=\"col-span-5 md:col-span-1 pt-2 hidden md:block border-r-2 border-secondary\"><ul class=\"w-full text-sm font-medium sticky top-0 overflow-y-auto max-h-screen\">${each(sideBar, (item) => {\n return `<li class=\"w-full py-2\"><a href=\"${\"#\" + escape(item.id, true)}\"${add_attribute(\"class\", item.type == \"h2\" ? \"pl-5\" : \"\", 0)}>${escape(item.text)}</a> </li>`;\n })}</ul></div> <div class=\"col-span-5 md:col-span-4\"><div class=\"pt-6 p-0 md:p-10\"><article id=\"markdown\" class=\"prose prose-stone max-w-none dark:prose-invert dark:prose-pre:bg-neutral-900 prose-code:px-[0.3rem] dark:prose-code:bg-yellow-100 dark:prose-code:text-primary-foreground prose-code:py-[0.2rem] prose-code:font-normal prose-code:font-mono prose-code:text-sm prose-code:rounded\"><!-- HTML_TAG_START -->${html}<!-- HTML_TAG_END --></article></div></div></div>`;\n }\n })}`;\n }\n })}</section>`;\n});\nexport {\n Page as default\n};\n"],"names":[],"mappings":";;;;;;AAIK,MAAC,IAAI,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC5E,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AACzB,EAAE,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACrC,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AACzC,EAAE,IAAI,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC7C,EAAE,IAAI,OAAO,GAAG,EAAE,CAAC;AACnB,EAAE,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC;AACnE,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,EAAE,OAAO,CAAC,oDAAoD,EAAE,kBAAkB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE;AACjI,IAAI,OAAO,EAAE,MAAM;AACnB,MAAM,OAAO,CAAC,EAAE,kBAAkB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE;AAC5F,QAAQ,OAAO,EAAE,MAAM;AACvB,UAAU,OAAO,CAAC,4MAA4M,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,KAAK;AACxP,YAAY,OAAO,CAAC,iCAAiC,EAAE,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,GAAG,MAAM,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC;AAClL,WAAW,CAAC,CAAC,yZAAyZ,EAAE,IAAI,CAAC,iDAAiD,CAAC,CAAC;AAChe,SAAS;AACT,OAAO,CAAC,CAAC,CAAC,CAAC;AACX,KAAK;AACL,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC;AACjB,CAAC;;;;"}
|
||||
@@ -0,0 +1,74 @@
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { a as auth, P as ParseIncidentPayload, G as GHIssueToKenerIncident } from './webhook-bd364d16.js';
|
||||
import { U as UpdateIssue, a as GetIncidentByNumber } from './github-54c09baa.js';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import './tool-153dc604.js';
|
||||
import 'randomstring';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
|
||||
async function PATCH({ request, params }) {
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
const incidentNumber = params.incidentNumber;
|
||||
const payload = await request.json();
|
||||
if (!incidentNumber || isNaN(incidentNumber)) {
|
||||
return json(
|
||||
{ error: "Invalid incidentNumber" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let { title, body, githubLabels, error } = ParseIncidentPayload(payload);
|
||||
if (error) {
|
||||
return json(
|
||||
{ error },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let resp = await UpdateIssue(github, incidentNumber, title, body, githubLabels);
|
||||
if (resp === null) {
|
||||
return json(
|
||||
{ error: "github error" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
return json(GHIssueToKenerIncident(resp), {
|
||||
status: 200
|
||||
});
|
||||
}
|
||||
async function GET({ request, params }) {
|
||||
const incidentNumber = params.incidentNumber;
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let issue = await GetIncidentByNumber(github, incidentNumber);
|
||||
if (issue === null) {
|
||||
return json(
|
||||
{ error: "incident not found" },
|
||||
{
|
||||
status: 404
|
||||
}
|
||||
);
|
||||
}
|
||||
return json(GHIssueToKenerIncident(issue), {
|
||||
status: 200
|
||||
});
|
||||
}
|
||||
|
||||
export { GET, PATCH };
|
||||
//# sourceMappingURL=_server-21dfbd18.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_server-21dfbd18.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/incident/_incidentNumber_/_server.js"],"sourcesContent":["import { j as json } from \"../../../../../chunks/index.js\";\nimport { a as auth, P as ParseIncidentPayload, G as GHIssueToKenerIncident } from \"../../../../../chunks/webhook.js\";\nimport { U as UpdateIssue, G as GetIncidentByNumber } from \"../../../../../chunks/github.js\";\nimport { p as public_env } from \"../../../../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nasync function PATCH({ request, params }) {\n const authError = auth(request);\n if (authError !== null) {\n return json(\n { error: authError.message },\n {\n status: 401\n }\n );\n }\n const incidentNumber = params.incidentNumber;\n const payload = await request.json();\n if (!incidentNumber || isNaN(incidentNumber)) {\n return json(\n { error: \"Invalid incidentNumber\" },\n {\n status: 400\n }\n );\n }\n let { title, body, githubLabels, error } = ParseIncidentPayload(payload);\n if (error) {\n return json(\n { error },\n {\n status: 400\n }\n );\n }\n let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/site.json\", \"utf8\"));\n let github = site.github;\n let resp = await UpdateIssue(github, incidentNumber, title, body, githubLabels);\n if (resp === null) {\n return json(\n { error: \"github error\" },\n {\n status: 400\n }\n );\n }\n return json(GHIssueToKenerIncident(resp), {\n status: 200\n });\n}\nasync function GET({ request, params }) {\n const incidentNumber = params.incidentNumber;\n let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/site.json\", \"utf8\"));\n let github = site.github;\n let issue = await GetIncidentByNumber(github, incidentNumber);\n if (issue === null) {\n return json(\n { error: \"incident not found\" },\n {\n status: 404\n }\n );\n }\n return json(GHIssueToKenerIncident(issue), {\n status: 200\n });\n}\nexport {\n GET,\n PATCH\n};\n"],"names":[],"mappings":";;;;;;;;;;AAKA,eAAe,KAAK,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;AAC1C,EAAE,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;AAClC,EAAE,IAAI,SAAS,KAAK,IAAI,EAAE;AAC1B,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE;AAClC,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAC/C,EAAE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;AACvC,EAAE,IAAI,CAAC,cAAc,IAAI,KAAK,CAAC,cAAc,CAAC,EAAE;AAChD,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,wBAAwB,EAAE;AACzC,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC3E,EAAE,IAAI,KAAK,EAAE;AACb,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE;AACf,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,EAAE,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,EAAE,IAAI,IAAI,GAAG,MAAM,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;AAClF,EAAE,IAAI,IAAI,KAAK,IAAI,EAAE;AACrB,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE;AAC/B,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE;AAC5C,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL,CAAC;AACD,eAAe,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;AACxC,EAAE,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAC/C,EAAE,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,EAAE,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,EAAE,IAAI,KAAK,GAAG,MAAM,mBAAmB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAChE,EAAE,IAAI,KAAK,KAAK,IAAI,EAAE;AACtB,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,oBAAoB,EAAE;AACrC,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,EAAE;AAC7C,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL;;;;"}
|
||||
@@ -0,0 +1,48 @@
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { a as auth, P as ParseIncidentPayload, G as GHIssueToKenerIncident } from './webhook-bd364d16.js';
|
||||
import { C as CreateIssue } from './github-54c09baa.js';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import './tool-153dc604.js';
|
||||
import 'randomstring';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
|
||||
async function POST({ request }) {
|
||||
const payload = await request.json();
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
let { title, body, githubLabels, error } = ParseIncidentPayload(payload);
|
||||
if (error) {
|
||||
return json(
|
||||
{ error },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let resp = await CreateIssue(github, title, body, githubLabels);
|
||||
if (resp === null) {
|
||||
return json(
|
||||
{ error: "github error" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
return json(GHIssueToKenerIncident(resp), {
|
||||
status: 200
|
||||
});
|
||||
}
|
||||
|
||||
export { POST };
|
||||
//# sourceMappingURL=_server-589e42d1.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_server-589e42d1.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/incident/_server.js"],"sourcesContent":["import { j as json } from \"../../../../chunks/index.js\";\nimport { a as auth, P as ParseIncidentPayload, G as GHIssueToKenerIncident } from \"../../../../chunks/webhook.js\";\nimport { C as CreateIssue } from \"../../../../chunks/github.js\";\nimport { p as public_env } from \"../../../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nasync function POST({ request }) {\n const payload = await request.json();\n const authError = auth(request);\n if (authError !== null) {\n return json(\n { error: authError.message },\n {\n status: 401\n }\n );\n }\n let { title, body, githubLabels, error } = ParseIncidentPayload(payload);\n if (error) {\n return json(\n { error },\n {\n status: 400\n }\n );\n }\n let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/site.json\", \"utf8\"));\n let github = site.github;\n let resp = await CreateIssue(github, title, body, githubLabels);\n if (resp === null) {\n return json(\n { error: \"github error\" },\n {\n status: 400\n }\n );\n }\n return json(GHIssueToKenerIncident(resp), {\n status: 200\n });\n}\nexport {\n POST\n};\n"],"names":[],"mappings":";;;;;;;;;;AAKA,eAAe,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE;AACjC,EAAE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;AACvC,EAAE,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;AAClC,EAAE,IAAI,SAAS,KAAK,IAAI,EAAE;AAC1B,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE;AAClC,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC3E,EAAE,IAAI,KAAK,EAAE;AACb,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE;AACf,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,EAAE,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,EAAE,IAAI,IAAI,GAAG,MAAM,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;AAClE,EAAE,IAAI,IAAI,KAAK,IAAI,EAAE;AACrB,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE;AAC/B,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE;AAC5C,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL;;;;"}
|
||||
@@ -1,87 +0,0 @@
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import fs from 'fs-extra';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import 'moment';
|
||||
import { a as GetNowTimestampUTC, b as GetMinuteStartTimestampUTC, G as GetMinuteStartNowTimestampUTC } from './tool-153dc604.js';
|
||||
import Randomstring from 'randomstring';
|
||||
|
||||
const API_TOKEN = process.env.API_TOKEN;
|
||||
const API_IP = process.env.API_IP;
|
||||
const checkIfValidTag = function(tag) {
|
||||
let tags = [];
|
||||
let monitors = [];
|
||||
try {
|
||||
monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
|
||||
tags = monitors.map((monitor) => monitor.tag);
|
||||
if (tags.indexOf(tag) == -1) {
|
||||
throw new Error("not a valid tag");
|
||||
}
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const store = function(data, authHeader, ip) {
|
||||
const tag = data.tag;
|
||||
const authToken = authHeader.replace("Bearer ", "");
|
||||
if (authToken !== API_TOKEN) {
|
||||
return { error: "invalid token", status: 401 };
|
||||
}
|
||||
if (API_IP !== void 0 && ip != "" && ip !== API_IP) {
|
||||
return { error: "invalid ip", status: 401 };
|
||||
}
|
||||
const resp = {};
|
||||
if (data.status === void 0 || ["UP", "DOWN", "DEGRADED"].indexOf(data.status) === -1) {
|
||||
return { error: "status missing", status: 400 };
|
||||
}
|
||||
if (data.latency === void 0 || isNaN(data.latency)) {
|
||||
return { error: "latency missing or not a number", status: 400 };
|
||||
}
|
||||
if (data.timestampInSeconds !== void 0 && isNaN(data.timestampInSeconds)) {
|
||||
return { error: "timestampInSeconds not a number", status: 400 };
|
||||
}
|
||||
if (data.timestampInSeconds === void 0) {
|
||||
data.timestampInSeconds = GetNowTimestampUTC();
|
||||
}
|
||||
data.timestampInSeconds = GetMinuteStartTimestampUTC(data.timestampInSeconds);
|
||||
resp.status = data.status;
|
||||
resp.latency = data.latency;
|
||||
resp.type = "webhook";
|
||||
let timestamp = GetMinuteStartNowTimestampUTC();
|
||||
try {
|
||||
if (data.timestampInSeconds > timestamp) {
|
||||
throw new Error("timestampInSeconds is in future");
|
||||
}
|
||||
if (timestamp - data.timestampInSeconds > 90 * 24 * 60 * 60) {
|
||||
throw new Error("timestampInSeconds is older than 90days");
|
||||
}
|
||||
} catch (err) {
|
||||
return { error: err.message, status: 400 };
|
||||
}
|
||||
if (!checkIfValidTag(tag)) {
|
||||
return { error: "invalid tag", status: 400 };
|
||||
}
|
||||
let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
|
||||
const monitor = monitors.find((monitor2) => monitor2.tag === tag);
|
||||
let day0 = {};
|
||||
day0[data.timestampInSeconds] = resp;
|
||||
fs.writeFileSync(public_env.PUBLIC_KENER_FOLDER + `/${monitor.folderName}.webhook.${Randomstring.generate()}.json`, JSON.stringify(day0, null, 2));
|
||||
return { status: 200, message: "success at " + data.timestampInSeconds };
|
||||
};
|
||||
async function POST({ request }) {
|
||||
const payload = await request.json();
|
||||
const authorization = request.headers.get("authorization");
|
||||
let ip = "";
|
||||
try {
|
||||
ip = request.headers.get("x-forwarded-for") || request.socket.remoteAddress || request.headers.get("x-real-ip");
|
||||
} catch (err) {
|
||||
console.log("IP Not Found " + err.message);
|
||||
}
|
||||
let resp = store(payload, authorization, ip);
|
||||
return json(resp, {
|
||||
status: resp.status
|
||||
});
|
||||
}
|
||||
|
||||
export { POST };
|
||||
//# sourceMappingURL=_server-b3ec6621.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,99 @@
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { a as auth } from './webhook-bd364d16.js';
|
||||
import { b as GetCommentsForIssue, A as AddComment } from './github-54c09baa.js';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import './tool-153dc604.js';
|
||||
import 'randomstring';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
|
||||
async function GET({ request, params }) {
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
const incidentNumber = params.incidentNumber;
|
||||
if (!incidentNumber || isNaN(incidentNumber)) {
|
||||
return json(
|
||||
{ error: "Invalid incidentNumber" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let resp = await GetCommentsForIssue(incidentNumber, github);
|
||||
return json(
|
||||
resp.map((comment) => {
|
||||
return {
|
||||
commentID: comment.id,
|
||||
body: comment.body,
|
||||
createdAt: Math.floor(new Date(comment.created_at).getTime() / 1e3)
|
||||
};
|
||||
}),
|
||||
{
|
||||
status: 200
|
||||
}
|
||||
);
|
||||
}
|
||||
async function POST({ request, params }) {
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
const incidentNumber = params.incidentNumber;
|
||||
if (!incidentNumber || isNaN(incidentNumber)) {
|
||||
return json(
|
||||
{ error: "Invalid incidentNumber" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
const payload = await request.json();
|
||||
let body = payload.body;
|
||||
if (!body || typeof body !== "string") {
|
||||
return json(
|
||||
{ error: "Invalid body" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let resp = await AddComment(github, incidentNumber, body);
|
||||
if (resp === null) {
|
||||
return json(
|
||||
{ error: "github error" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
return json(
|
||||
{
|
||||
commentID: resp.id,
|
||||
body: resp.body,
|
||||
createdAt: Math.floor(new Date(resp.created_at).getTime() / 1e3)
|
||||
},
|
||||
{
|
||||
status: 200
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export { GET, POST };
|
||||
//# sourceMappingURL=_server-d9ce737b.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,89 @@
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { a as auth, G as GHIssueToKenerIncident } from './webhook-bd364d16.js';
|
||||
import { a as GetIncidentByNumber, c as UpdateIssueLabels } from './github-54c09baa.js';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import './tool-153dc604.js';
|
||||
import 'randomstring';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
|
||||
async function POST({ request, params }) {
|
||||
const payload = await request.json();
|
||||
const incidentNumber = params.incidentNumber;
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
let isIdentified = payload.isIdentified;
|
||||
let isResolved = payload.isResolved;
|
||||
let endDatetime = payload.endDatetime;
|
||||
if (!incidentNumber || isNaN(incidentNumber)) {
|
||||
return json(
|
||||
{ error: "Invalid incidentNumber" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
if (endDatetime && typeof endDatetime !== "number") {
|
||||
return json(
|
||||
{ error: "Invalid endDatetime" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let issue = await GetIncidentByNumber(github, incidentNumber);
|
||||
if (issue === null) {
|
||||
return json(
|
||||
{ error: "github error" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let labels = issue.labels.map((label) => {
|
||||
return label.name;
|
||||
});
|
||||
if (isIdentified !== void 0) {
|
||||
labels = labels.filter((label) => label !== "identified");
|
||||
if (isIdentified === true) {
|
||||
labels.push("identified");
|
||||
}
|
||||
}
|
||||
if (isResolved !== void 0) {
|
||||
labels = labels.filter((label) => label !== "resolved");
|
||||
if (isResolved === true) {
|
||||
labels.push("resolved");
|
||||
}
|
||||
}
|
||||
let body = issue.body;
|
||||
if (endDatetime) {
|
||||
body = body.replace(/\[end_datetime:(\d+)\]/g, "");
|
||||
body = body.trim();
|
||||
body = body + ` [end_datetime:${endDatetime}]`;
|
||||
}
|
||||
let resp = await UpdateIssueLabels(github, incidentNumber, labels, body);
|
||||
if (resp === null) {
|
||||
return json(
|
||||
{ error: "github error" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
return json(GHIssueToKenerIncident(resp), {
|
||||
status: 200
|
||||
});
|
||||
}
|
||||
|
||||
export { POST };
|
||||
//# sourceMappingURL=_server-e0c327de.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,29 @@
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { a as auth, s as store } from './webhook-bd364d16.js';
|
||||
import 'fs-extra';
|
||||
import './shared-server-58a5f352.js';
|
||||
import './tool-153dc604.js';
|
||||
import './github-54c09baa.js';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
import 'randomstring';
|
||||
|
||||
async function POST({ request }) {
|
||||
const payload = await request.json();
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
let resp = store(payload);
|
||||
return json(resp, {
|
||||
status: resp.status
|
||||
});
|
||||
}
|
||||
|
||||
export { POST };
|
||||
//# sourceMappingURL=_server-e6873bc7.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_server-e6873bc7.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/status/_server.js"],"sourcesContent":["import { j as json } from \"../../../../chunks/index.js\";\nimport { a as auth, s as store } from \"../../../../chunks/webhook.js\";\nasync function POST({ request }) {\n const payload = await request.json();\n const authError = auth(request);\n if (authError !== null) {\n return json(\n { error: authError.message },\n {\n status: 401\n }\n );\n }\n let resp = store(payload);\n return json(resp, {\n status: resp.status\n });\n}\nexport {\n POST\n};\n"],"names":[],"mappings":";;;;;;;;;;AAEA,eAAe,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE;AACjC,EAAE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;AACvC,EAAE,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;AAClC,EAAE,IAAI,SAAS,KAAK,IAAI,EAAE;AAC1B,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE;AAClC,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;AAC5B,EAAE,OAAO,IAAI,CAAC,IAAI,EAAE;AACpB,IAAI,MAAM,EAAE,IAAI,CAAC,MAAM;AACvB,GAAG,CAAC,CAAC;AACL;;;;"}
|
||||
@@ -1,76 +0,0 @@
|
||||
import { c as create_ssr_component, f as compute_rest_props, h as spread, j as escape_attribute_value, i as escape_object } from './ssr-c85d451a.js';
|
||||
import { clsx } from 'clsx';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
function cubicOut(t) {
|
||||
const f = t - 1;
|
||||
return f * f * f + 1;
|
||||
}
|
||||
function cn(...inputs) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
const flyAndScale = (node, params = { y: -8, x: 0, start: 0.95, duration: 150 }) => {
|
||||
const style = getComputedStyle(node);
|
||||
const transform = style.transform === "none" ? "" : style.transform;
|
||||
const scaleConversion = (valueA, scaleA, scaleB) => {
|
||||
const [minA, maxA] = scaleA;
|
||||
const [minB, maxB] = scaleB;
|
||||
const percentage = (valueA - minA) / (maxA - minA);
|
||||
const valueB = percentage * (maxB - minB) + minB;
|
||||
return valueB;
|
||||
};
|
||||
const styleToString = (style2) => {
|
||||
return Object.keys(style2).reduce((str, key) => {
|
||||
if (style2[key] === void 0)
|
||||
return str;
|
||||
return str + `${key}:${style2[key]};`;
|
||||
}, "");
|
||||
};
|
||||
return {
|
||||
duration: params.duration ?? 200,
|
||||
delay: 0,
|
||||
css: (t) => {
|
||||
const y = scaleConversion(t, [0, 1], [params.y ?? 5, 0]);
|
||||
const x = scaleConversion(t, [0, 1], [params.x ?? 0, 0]);
|
||||
const scale = scaleConversion(t, [0, 1], [params.start ?? 0.95, 1]);
|
||||
return styleToString({
|
||||
transform: `${transform} translate3d(${x}px, ${y}px, 0) scale(${scale})`,
|
||||
opacity: t
|
||||
});
|
||||
},
|
||||
easing: cubicOut
|
||||
};
|
||||
};
|
||||
const Card = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
return `<div${spread(
|
||||
[
|
||||
{
|
||||
class: escape_attribute_value(cn("rounded-lg border bg-card text-card-foreground shadow-sm", className))
|
||||
},
|
||||
escape_object($$restProps)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({}) : ``}</div>`;
|
||||
});
|
||||
const Card_content = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
return `<div${spread(
|
||||
[
|
||||
{
|
||||
class: escape_attribute_value(cn("p-6 pt-0", className))
|
||||
},
|
||||
escape_object($$restProps)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({}) : ``}</div>`;
|
||||
});
|
||||
|
||||
export { Card as C, Card_content as a, cn as c, flyAndScale as f };
|
||||
//# sourceMappingURL=card-content-512872f2.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,154 @@
|
||||
import { c as create_ssr_component, f as compute_rest_props, h as spread, j as escape_attribute_value, i as escape_object, k as createEventDispatcher, v as validate_component, a as each } from './ssr-c85d451a.js';
|
||||
import { clsx } from 'clsx';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
const void_element_names = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;
|
||||
function is_void(name) {
|
||||
return void_element_names.test(name) || name.toLowerCase() === "!doctype";
|
||||
}
|
||||
function createDispatcher() {
|
||||
const dispatch = createEventDispatcher();
|
||||
return (e) => {
|
||||
const { originalEvent } = e.detail;
|
||||
const { cancelable } = e;
|
||||
const type = originalEvent.type;
|
||||
const shouldContinue = dispatch(type, { originalEvent, currentTarget: originalEvent.currentTarget }, { cancelable });
|
||||
if (!shouldContinue) {
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
}
|
||||
function cubicOut(t) {
|
||||
const f = t - 1;
|
||||
return f * f * f + 1;
|
||||
}
|
||||
function cn(...inputs) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
const flyAndScale = (node, params = { y: -8, x: 0, start: 0.95, duration: 150 }) => {
|
||||
const style = getComputedStyle(node);
|
||||
const transform = style.transform === "none" ? "" : style.transform;
|
||||
const scaleConversion = (valueA, scaleA, scaleB) => {
|
||||
const [minA, maxA] = scaleA;
|
||||
const [minB, maxB] = scaleB;
|
||||
const percentage = (valueA - minA) / (maxA - minA);
|
||||
const valueB = percentage * (maxB - minB) + minB;
|
||||
return valueB;
|
||||
};
|
||||
const styleToString = (style2) => {
|
||||
return Object.keys(style2).reduce((str, key) => {
|
||||
if (style2[key] === void 0)
|
||||
return str;
|
||||
return str + `${key}:${style2[key]};`;
|
||||
}, "");
|
||||
};
|
||||
return {
|
||||
duration: params.duration ?? 200,
|
||||
delay: 0,
|
||||
css: (t) => {
|
||||
const y = scaleConversion(t, [0, 1], [params.y ?? 5, 0]);
|
||||
const x = scaleConversion(t, [0, 1], [params.x ?? 0, 0]);
|
||||
const scale = scaleConversion(t, [0, 1], [params.start ?? 0.95, 1]);
|
||||
return styleToString({
|
||||
transform: `${transform} translate3d(${x}px, ${y}px, 0) scale(${scale})`,
|
||||
opacity: t
|
||||
});
|
||||
},
|
||||
easing: cubicOut
|
||||
};
|
||||
};
|
||||
const Card = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
return `<div${spread(
|
||||
[
|
||||
{
|
||||
class: escape_attribute_value(cn("rounded-lg border bg-card text-card-foreground shadow-sm", className))
|
||||
},
|
||||
escape_object($$restProps)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({}) : ``}</div>`;
|
||||
});
|
||||
const Card_content = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
return `<div${spread(
|
||||
[
|
||||
{
|
||||
class: escape_attribute_value(cn("p-6 pt-0", className))
|
||||
},
|
||||
escape_object($$restProps)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({}) : ``}</div>`;
|
||||
});
|
||||
const defaultAttributes = {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
width: 24,
|
||||
height: 24,
|
||||
viewBox: "0 0 24 24",
|
||||
fill: "none",
|
||||
stroke: "currentColor",
|
||||
"stroke-width": 2,
|
||||
"stroke-linecap": "round",
|
||||
"stroke-linejoin": "round"
|
||||
};
|
||||
const Icon = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["name", "color", "size", "strokeWidth", "absoluteStrokeWidth", "iconNode"]);
|
||||
let { name } = $$props;
|
||||
let { color = "currentColor" } = $$props;
|
||||
let { size = 24 } = $$props;
|
||||
let { strokeWidth = 2 } = $$props;
|
||||
let { absoluteStrokeWidth = false } = $$props;
|
||||
let { iconNode } = $$props;
|
||||
if ($$props.name === void 0 && $$bindings.name && name !== void 0)
|
||||
$$bindings.name(name);
|
||||
if ($$props.color === void 0 && $$bindings.color && color !== void 0)
|
||||
$$bindings.color(color);
|
||||
if ($$props.size === void 0 && $$bindings.size && size !== void 0)
|
||||
$$bindings.size(size);
|
||||
if ($$props.strokeWidth === void 0 && $$bindings.strokeWidth && strokeWidth !== void 0)
|
||||
$$bindings.strokeWidth(strokeWidth);
|
||||
if ($$props.absoluteStrokeWidth === void 0 && $$bindings.absoluteStrokeWidth && absoluteStrokeWidth !== void 0)
|
||||
$$bindings.absoluteStrokeWidth(absoluteStrokeWidth);
|
||||
if ($$props.iconNode === void 0 && $$bindings.iconNode && iconNode !== void 0)
|
||||
$$bindings.iconNode(iconNode);
|
||||
return `<svg${spread(
|
||||
[
|
||||
escape_object(defaultAttributes),
|
||||
escape_object($$restProps),
|
||||
{ width: escape_attribute_value(size) },
|
||||
{ height: escape_attribute_value(size) },
|
||||
{ stroke: escape_attribute_value(color) },
|
||||
{
|
||||
"stroke-width": escape_attribute_value(absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth)
|
||||
},
|
||||
{
|
||||
class: escape_attribute_value(`lucide-icon lucide lucide-${name} ${$$props.class ?? ""}`)
|
||||
}
|
||||
],
|
||||
{}
|
||||
)}>${each(iconNode, ([tag, attrs]) => {
|
||||
return `${((tag$1) => {
|
||||
return tag$1 ? `<${tag}${spread([escape_object(attrs)], {})}>${is_void(tag$1) ? "" : ``}${is_void(tag$1) ? "" : `</${tag$1}>`}` : "";
|
||||
})(tag)}`;
|
||||
})}${slots.default ? slots.default({}) : ``}</svg>`;
|
||||
});
|
||||
const Icon$1 = Icon;
|
||||
const Chevron_down = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
const iconNode = [["path", { "d": "m6 9 6 6 6-6" }]];
|
||||
return `${validate_component(Icon$1, "Icon").$$render($$result, Object.assign({}, { name: "chevron-down" }, $$props, { iconNode }), {}, {
|
||||
default: () => {
|
||||
return `${slots.default ? slots.default({}) : ``}`;
|
||||
}
|
||||
})}`;
|
||||
});
|
||||
const ChevronDown = Chevron_down;
|
||||
|
||||
export { Card as C, Icon$1 as I, Card_content as a, ChevronDown as b, cn as c, createDispatcher as d, cubicOut as e, flyAndScale as f, is_void as i };
|
||||
//# sourceMappingURL=chevron-down-226abe3e.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,7 +1,5 @@
|
||||
import { r as readable, d as derived, w as writable, a as readonly } from './index2-d9c461ad.js';
|
||||
import { g as getContext, s as setContext, o as onDestroy, l as get_store_value, n as set_current_component, r as run_all, p as current_component } from './ssr-c85d451a.js';
|
||||
import 'clsx';
|
||||
import { tv } from 'tailwind-variants';
|
||||
import { s as setContext, g as getContext, o as onDestroy, l as get_store_value, n as set_current_component, r as run_all, p as current_component } from './ssr-c85d451a.js';
|
||||
|
||||
let urlAlphabet =
|
||||
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
||||
@@ -3083,6 +3081,9 @@ function styleToString$1(style) {
|
||||
return str + `${key}:${style[key]};`;
|
||||
}, "");
|
||||
}
|
||||
function disabledAttr(disabled) {
|
||||
return disabled ? true : void 0;
|
||||
}
|
||||
({
|
||||
type: "hidden",
|
||||
"aria-hidden": true,
|
||||
@@ -3104,6 +3105,12 @@ function lightable(value) {
|
||||
}
|
||||
return { subscribe };
|
||||
}
|
||||
function getElementByMeltId(id) {
|
||||
if (!isBrowser)
|
||||
return null;
|
||||
const el = document.querySelector(`[data-melt-id="${id}"]`);
|
||||
return isHTMLElement(el) ? el : null;
|
||||
}
|
||||
const hiddenAction = (obj) => {
|
||||
return new Proxy(obj, {
|
||||
get(target, prop, receiver) {
|
||||
@@ -3169,12 +3176,12 @@ function builder(name2, args) {
|
||||
function createElHelpers(prefix) {
|
||||
const name2 = (part) => part ? `${prefix}-${part}` : prefix;
|
||||
const attribute = (part) => `data-melt-${prefix}${part ? `-${part}` : ""}`;
|
||||
const selector = (part) => `[data-melt-${prefix}${part ? `-${part}` : ""}]`;
|
||||
const getEl = (part) => document.querySelector(selector(part));
|
||||
const selector2 = (part) => `[data-melt-${prefix}${part ? `-${part}` : ""}]`;
|
||||
const getEl = (part) => document.querySelector(selector2(part));
|
||||
return {
|
||||
name: name2,
|
||||
attribute,
|
||||
selector,
|
||||
selector: selector2,
|
||||
getEl
|
||||
};
|
||||
}
|
||||
@@ -3402,6 +3409,201 @@ function getPortalDestination(node, portalProp) {
|
||||
return document.body;
|
||||
return null;
|
||||
}
|
||||
const { name: name$1, selector } = createElHelpers("accordion");
|
||||
const defaults$2 = {
|
||||
multiple: false,
|
||||
disabled: false,
|
||||
forceVisible: false
|
||||
};
|
||||
const createAccordion = (props) => {
|
||||
const withDefaults = { ...defaults$2, ...props };
|
||||
const options = toWritableStores(omit(withDefaults, "value", "onValueChange", "defaultValue"));
|
||||
const meltIds = generateIds(["root"]);
|
||||
const { disabled, forceVisible } = options;
|
||||
const valueWritable = withDefaults.value ?? writable(withDefaults.defaultValue);
|
||||
const value = overridable(valueWritable, withDefaults?.onValueChange);
|
||||
const isSelected = (key, v) => {
|
||||
if (v === void 0)
|
||||
return false;
|
||||
if (typeof v === "string")
|
||||
return v === key;
|
||||
return v.includes(key);
|
||||
};
|
||||
const isSelectedStore = derived(value, ($value) => {
|
||||
return (key) => isSelected(key, $value);
|
||||
});
|
||||
const root = builder(name$1(), {
|
||||
returned: () => ({
|
||||
"data-melt-id": meltIds.root
|
||||
})
|
||||
});
|
||||
const parseItemProps = (props2) => {
|
||||
if (typeof props2 === "string") {
|
||||
return { value: props2 };
|
||||
} else {
|
||||
return props2;
|
||||
}
|
||||
};
|
||||
const parseHeadingProps = (props2) => {
|
||||
if (typeof props2 === "number") {
|
||||
return { level: props2 };
|
||||
} else {
|
||||
return props2;
|
||||
}
|
||||
};
|
||||
const item = builder(name$1("item"), {
|
||||
stores: value,
|
||||
returned: ($value) => {
|
||||
return (props2) => {
|
||||
const { value: itemValue, disabled: disabled2 } = parseItemProps(props2);
|
||||
return {
|
||||
"data-state": isSelected(itemValue, $value) ? "open" : "closed",
|
||||
"data-disabled": disabledAttr(disabled2)
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
const trigger = builder(name$1("trigger"), {
|
||||
stores: [value, disabled],
|
||||
returned: ([$value, $disabled]) => {
|
||||
return (props2) => {
|
||||
const { value: itemValue, disabled: disabled2 } = parseItemProps(props2);
|
||||
return {
|
||||
disabled: disabledAttr($disabled || disabled2),
|
||||
"aria-expanded": isSelected(itemValue, $value) ? true : false,
|
||||
"aria-disabled": disabled2 ? true : false,
|
||||
"data-disabled": disabledAttr(disabled2),
|
||||
"data-value": itemValue,
|
||||
"data-state": isSelected(itemValue, $value) ? "open" : "closed"
|
||||
};
|
||||
};
|
||||
},
|
||||
action: (node) => {
|
||||
const unsub = executeCallbacks(addMeltEventListener(node, "click", () => {
|
||||
const disabled2 = node.dataset.disabled === "true";
|
||||
const itemValue = node.dataset.value;
|
||||
if (disabled2 || !itemValue)
|
||||
return;
|
||||
handleValueUpdate(itemValue);
|
||||
}), addMeltEventListener(node, "keydown", (e) => {
|
||||
if (![kbd.ARROW_DOWN, kbd.ARROW_UP, kbd.HOME, kbd.END].includes(e.key)) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
if (e.key === kbd.SPACE || e.key === kbd.ENTER) {
|
||||
const disabled2 = node.dataset.disabled === "true";
|
||||
const itemValue = node.dataset.value;
|
||||
if (disabled2 || !itemValue)
|
||||
return;
|
||||
handleValueUpdate(itemValue);
|
||||
return;
|
||||
}
|
||||
const el = e.target;
|
||||
const rootEl = getElementByMeltId(meltIds.root);
|
||||
if (!rootEl || !isHTMLElement(el))
|
||||
return;
|
||||
const items = Array.from(rootEl.querySelectorAll(selector("trigger")));
|
||||
const candidateItems = items.filter((item2) => {
|
||||
if (!isHTMLElement(item2))
|
||||
return false;
|
||||
return item2.dataset.disabled !== "true";
|
||||
});
|
||||
if (!candidateItems.length)
|
||||
return;
|
||||
const elIdx = candidateItems.indexOf(el);
|
||||
if (e.key === kbd.ARROW_DOWN) {
|
||||
candidateItems[(elIdx + 1) % candidateItems.length].focus();
|
||||
}
|
||||
if (e.key === kbd.ARROW_UP) {
|
||||
candidateItems[(elIdx - 1 + candidateItems.length) % candidateItems.length].focus();
|
||||
}
|
||||
if (e.key === kbd.HOME) {
|
||||
candidateItems[0].focus();
|
||||
}
|
||||
if (e.key === kbd.END) {
|
||||
candidateItems[candidateItems.length - 1].focus();
|
||||
}
|
||||
}));
|
||||
return {
|
||||
destroy: unsub
|
||||
};
|
||||
}
|
||||
});
|
||||
const content = builder(name$1("content"), {
|
||||
stores: [value, disabled, forceVisible],
|
||||
returned: ([$value, $disabled, $forceVisible]) => {
|
||||
return (props2) => {
|
||||
const { value: itemValue } = parseItemProps(props2);
|
||||
const isVisible = isSelected(itemValue, $value) || $forceVisible;
|
||||
return {
|
||||
"data-state": isVisible ? "open" : "closed",
|
||||
"data-disabled": disabledAttr($disabled),
|
||||
"data-value": itemValue,
|
||||
hidden: isVisible ? void 0 : true,
|
||||
style: styleToString$1({
|
||||
display: isVisible ? void 0 : "none"
|
||||
})
|
||||
};
|
||||
};
|
||||
},
|
||||
action: (node) => {
|
||||
tick().then(() => {
|
||||
const contentId = generateId();
|
||||
const triggerId = generateId();
|
||||
const parentTrigger = document.querySelector(`${selector("trigger")}, [data-value="${node.dataset.value}"]`);
|
||||
if (!isHTMLElement(parentTrigger))
|
||||
return;
|
||||
node.id = contentId;
|
||||
parentTrigger.setAttribute("aria-controls", contentId);
|
||||
parentTrigger.id = triggerId;
|
||||
});
|
||||
}
|
||||
});
|
||||
const heading = builder(name$1("heading"), {
|
||||
returned: () => {
|
||||
return (props2) => {
|
||||
const { level } = parseHeadingProps(props2);
|
||||
return {
|
||||
role: "heading",
|
||||
"aria-level": level,
|
||||
"data-heading-level": level
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
function handleValueUpdate(itemValue) {
|
||||
value.update(($value) => {
|
||||
if ($value === void 0) {
|
||||
return withDefaults.multiple ? [itemValue] : itemValue;
|
||||
}
|
||||
if (Array.isArray($value)) {
|
||||
if ($value.includes(itemValue)) {
|
||||
return $value.filter((v) => v !== itemValue);
|
||||
}
|
||||
$value.push(itemValue);
|
||||
return $value;
|
||||
}
|
||||
return $value === itemValue ? void 0 : itemValue;
|
||||
});
|
||||
}
|
||||
return {
|
||||
ids: meltIds,
|
||||
elements: {
|
||||
root,
|
||||
item,
|
||||
trigger,
|
||||
content,
|
||||
heading
|
||||
},
|
||||
states: {
|
||||
value
|
||||
},
|
||||
helpers: {
|
||||
isSelected: isSelectedStore
|
||||
},
|
||||
options
|
||||
};
|
||||
};
|
||||
const documentClickStore = readable(void 0, (set) => {
|
||||
function clicked(event) {
|
||||
set(event);
|
||||
@@ -4066,8 +4268,39 @@ function getOptionUpdater(options) {
|
||||
};
|
||||
}
|
||||
const NAME$l = "accordion";
|
||||
const ITEM_NAME = "accordion-item";
|
||||
const PARTS$l = ["root", "content", "header", "item", "trigger"];
|
||||
createBitAttrs(NAME$l, PARTS$l);
|
||||
const getAttrs$2 = createBitAttrs(NAME$l, PARTS$l);
|
||||
function setCtx$2(props) {
|
||||
const accordion = createAccordion(removeUndefined(props));
|
||||
setContext(NAME$l, accordion);
|
||||
return {
|
||||
...accordion,
|
||||
updateOption: getOptionUpdater(accordion.options)
|
||||
};
|
||||
}
|
||||
function getCtx$1() {
|
||||
return getContext(NAME$l);
|
||||
}
|
||||
function setItem(props) {
|
||||
setContext(ITEM_NAME, { ...props });
|
||||
const { elements: { item } } = getCtx$1();
|
||||
return { item, props };
|
||||
}
|
||||
function getItemProps() {
|
||||
const itemProps = getContext(ITEM_NAME);
|
||||
return itemProps;
|
||||
}
|
||||
function getContent() {
|
||||
const { elements: { content }, helpers: { isSelected }, states: { value } } = getCtx$1();
|
||||
const { value: props } = getItemProps();
|
||||
return { content, props, isSelected, value };
|
||||
}
|
||||
function getTrigger() {
|
||||
const { elements: { trigger } } = getCtx$1();
|
||||
const { value: props } = getItemProps();
|
||||
return { props, trigger };
|
||||
}
|
||||
const NAME$k = "alert-dialog";
|
||||
const PARTS$k = [
|
||||
"action",
|
||||
@@ -4204,29 +4437,6 @@ createBitAttrs(NAME$1, PARTS$1);
|
||||
const NAME = "tooltip";
|
||||
const PARTS = ["arrow", "content", "trigger"];
|
||||
createBitAttrs(NAME, PARTS);
|
||||
const buttonVariants = tv({
|
||||
base: "inline-flex items-center justify-center rounded-md text-sm font-medium whitespace-nowrap ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
||||
variants: {
|
||||
variant: {
|
||||
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
||||
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
||||
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
||||
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
||||
ghost: "hover:bg-accent hover:text-accent-foreground",
|
||||
link: "text-primary underline-offset-4 hover:underline"
|
||||
},
|
||||
size: {
|
||||
default: "h-10 px-4 py-2",
|
||||
sm: "h-9 rounded-md px-3",
|
||||
lg: "h-11 rounded-md px-8",
|
||||
icon: "h-10 w-10"
|
||||
}
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: "default",
|
||||
size: "default"
|
||||
}
|
||||
});
|
||||
|
||||
export { setCtx$1 as a, buttonVariants as b, getCtx as c, getAttrs$1 as d, getAttrs as g, setCtx as s };
|
||||
//# sourceMappingURL=index3-0d676326.js.map
|
||||
export { setItem as a, getTrigger as b, getContent as c, getAttrs$2 as d, setCtx as e, getAttrs as f, getCtx$1 as g, setCtx$1 as h, getCtx as i, getAttrs$1 as j, setCtx$2 as s };
|
||||
//# sourceMappingURL=ctx-168edc6f.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,230 @@
|
||||
import axios from 'axios';
|
||||
import { G as GetMinuteStartNowTimestampUTC } from './tool-153dc604.js';
|
||||
import { marked } from 'marked';
|
||||
|
||||
const GH_TOKEN = process.env.GH_TOKEN;
|
||||
const GhnotconfireguredMsg = "owner or repo or GH_TOKEN is undefined. Read the docs to configure github: https://kener.ing/docs#h2github-setup";
|
||||
function getAxiosOptions(url) {
|
||||
const options = {
|
||||
url,
|
||||
method: "GET",
|
||||
headers: {
|
||||
Accept: "application/vnd.github+json",
|
||||
Authorization: "Bearer " + GH_TOKEN,
|
||||
"X-GitHub-Api-Version": "2022-11-28"
|
||||
}
|
||||
};
|
||||
return options;
|
||||
}
|
||||
function postAxiosOptions(url, data) {
|
||||
const options = {
|
||||
url,
|
||||
method: "POST",
|
||||
headers: {
|
||||
Accept: "application/vnd.github+json",
|
||||
Authorization: "Bearer " + GH_TOKEN,
|
||||
"X-GitHub-Api-Version": "2022-11-28"
|
||||
},
|
||||
data
|
||||
};
|
||||
return options;
|
||||
}
|
||||
function patchAxiosOptions(url, data) {
|
||||
const options = {
|
||||
url,
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
Accept: "application/vnd.github+json",
|
||||
Authorization: "Bearer " + GH_TOKEN,
|
||||
"X-GitHub-Api-Version": "2022-11-28"
|
||||
},
|
||||
data
|
||||
};
|
||||
return options;
|
||||
}
|
||||
const GetStartTimeFromBody = function(text) {
|
||||
const pattern = /\[start_datetime:(\d+)\]/;
|
||||
const matches = pattern.exec(text);
|
||||
if (matches) {
|
||||
const timestamp = matches[1];
|
||||
return parseInt(timestamp);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const GetEndTimeFromBody = function(text) {
|
||||
const pattern = /\[end_datetime:(\d+)\]/;
|
||||
const matches = pattern.exec(text);
|
||||
if (matches) {
|
||||
const timestamp = matches[1];
|
||||
return parseInt(timestamp);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const GetIncidentByNumber = async function(githubConfig, incidentNumber) {
|
||||
if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;
|
||||
const options = getAxiosOptions(url);
|
||||
try {
|
||||
const response = await axios.request(options);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.message, options, url);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
const GetIncidents = async function(tagName, githubConfig, state = "all") {
|
||||
if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return [];
|
||||
}
|
||||
if (tagName === void 0) {
|
||||
return [];
|
||||
}
|
||||
const since = GetMinuteStartNowTimestampUTC() - githubConfig.incidentSince * 60 * 60;
|
||||
const sinceISO = new Date(since * 1e3).toISOString();
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues?state=${state}&labels=${tagName},incident&sort=created&direction=desc&since=${sinceISO}`;
|
||||
const options = getAxiosOptions(url);
|
||||
try {
|
||||
const response = await axios.request(options);
|
||||
let issues = response.data;
|
||||
issues = issues.filter((issue) => {
|
||||
return new Date(issue.created_at) >= new Date(sinceISO);
|
||||
});
|
||||
return issues;
|
||||
} catch (error) {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
async function Mapper(issue) {
|
||||
const html = marked.parse(issue.body);
|
||||
const comments = await GetCommentsForIssue(issue.number, this.github);
|
||||
const issueCreatedAt = new Date(issue.created_at);
|
||||
const issueCreatedAtTimestamp = issueCreatedAt.getTime() / 1e3;
|
||||
let issueClosedAtTimestamp = null;
|
||||
if (issue.closed_at !== null) {
|
||||
const issueClosedAt = new Date(issue.closed_at);
|
||||
issueClosedAtTimestamp = issueClosedAt.getTime() / 1e3;
|
||||
}
|
||||
return {
|
||||
title: issue.title,
|
||||
incident_start_time: GetStartTimeFromBody(issue.body) || issueCreatedAtTimestamp,
|
||||
incident_end_time: GetEndTimeFromBody(issue.body) || issueClosedAtTimestamp,
|
||||
number: issue.number,
|
||||
body: html,
|
||||
created_at: issue.created_at,
|
||||
updated_at: issue.updated_at,
|
||||
collapsed: true,
|
||||
comments: issue.comments,
|
||||
// @ts-ignore
|
||||
state: issue.state,
|
||||
closed_at: issue.closed_at,
|
||||
// @ts-ignore
|
||||
labels: issue.labels.map(function(label) {
|
||||
return label.name;
|
||||
}),
|
||||
html_url: issue.html_url,
|
||||
// @ts-ignore
|
||||
comments: comments.map((comment) => {
|
||||
const html2 = marked.parse(comment.body);
|
||||
return {
|
||||
body: html2,
|
||||
created_at: comment.created_at,
|
||||
updated_at: comment.updated_at,
|
||||
html_url: comment.html_url
|
||||
};
|
||||
})
|
||||
};
|
||||
}
|
||||
async function GetCommentsForIssue(issueID, githubConfig) {
|
||||
if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return [];
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${issueID}/comments`;
|
||||
try {
|
||||
const response = await axios.request(getAxiosOptions(url));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.response.data);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
async function CreateIssue(githubConfig, issueTitle, issueBody, issueLabels) {
|
||||
if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues`;
|
||||
try {
|
||||
const payload = {
|
||||
title: issueTitle,
|
||||
body: issueBody,
|
||||
labels: issueLabels
|
||||
};
|
||||
const response = await axios.request(postAxiosOptions(url, payload));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.response.data);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
async function UpdateIssue(githubConfig, incidentNumber, issueTitle, issueBody, issueLabels) {
|
||||
if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;
|
||||
try {
|
||||
const payload = {
|
||||
title: issueTitle,
|
||||
body: issueBody,
|
||||
labels: issueLabels
|
||||
};
|
||||
const response = await axios.request(patchAxiosOptions(url, payload));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.response.data);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
async function AddComment(githubConfig, incidentNumber, commentBody) {
|
||||
if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}/comments`;
|
||||
try {
|
||||
const payload = {
|
||||
body: commentBody
|
||||
};
|
||||
const response = await axios.request(postAxiosOptions(url, payload));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.response.data);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
async function UpdateIssueLabels(githubConfig, incidentNumber, issueLabels, body) {
|
||||
if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;
|
||||
try {
|
||||
const payload = {
|
||||
labels: issueLabels,
|
||||
body
|
||||
};
|
||||
const response = await axios.request(postAxiosOptions(url, payload));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.response.data);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export { AddComment as A, CreateIssue as C, GetIncidents as G, Mapper as M, UpdateIssue as U, GetIncidentByNumber as a, GetCommentsForIssue as b, UpdateIssueLabels as c, GetStartTimeFromBody as d, GetEndTimeFromBody as e };
|
||||
//# sourceMappingURL=github-54c09baa.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,114 +0,0 @@
|
||||
import axios from 'axios';
|
||||
import { G as GetMinuteStartNowTimestampUTC } from './tool-153dc604.js';
|
||||
import Markdoc from '@markdoc/markdoc';
|
||||
|
||||
const GH_TOKEN = process.env.GH_TOKEN;
|
||||
function getAxiosOptions(url) {
|
||||
const options = {
|
||||
url,
|
||||
method: "GET",
|
||||
headers: {
|
||||
Accept: "application/vnd.github+json",
|
||||
Authorization: "Bearer " + GH_TOKEN,
|
||||
"X-GitHub-Api-Version": "2022-11-28"
|
||||
}
|
||||
};
|
||||
return options;
|
||||
}
|
||||
const GetStartTimeFromBody = function(text) {
|
||||
const pattern = /\[start_datetime:(\d+)\]/;
|
||||
const matches = pattern.exec(text);
|
||||
if (matches) {
|
||||
const timestamp = matches[1];
|
||||
return parseInt(timestamp);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const GetEndTimeFromBody = function(text) {
|
||||
const pattern = /\[end_datetime:(\d+)\]/;
|
||||
const matches = pattern.exec(text);
|
||||
if (matches) {
|
||||
const timestamp = matches[1];
|
||||
return parseInt(timestamp);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const GetIncidents = async function(tagName, githubConfig, state = "all") {
|
||||
if (tagName === void 0) {
|
||||
return [];
|
||||
}
|
||||
if (githubConfig === void 0) {
|
||||
return [];
|
||||
}
|
||||
const since = GetMinuteStartNowTimestampUTC() - githubConfig.incidentSince * 60 * 60;
|
||||
const sinceISO = new Date(since * 1e3).toISOString();
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues?state=${state}&labels=${tagName},incident&sort=created&direction=desc&since=${sinceISO}`;
|
||||
const options = getAxiosOptions(url);
|
||||
try {
|
||||
const response = await axios.request(options);
|
||||
let issues = response.data;
|
||||
issues = issues.filter((issue) => {
|
||||
return new Date(issue.created_at) >= new Date(sinceISO);
|
||||
});
|
||||
return issues;
|
||||
} catch (error) {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
async function Mapper(issue) {
|
||||
const ast = Markdoc.parse(issue.body);
|
||||
const content = Markdoc.transform(ast);
|
||||
const html = Markdoc.renderers.html(content);
|
||||
const comments = await GetCommentsForIssue(issue.number, this.github);
|
||||
const issueCreatedAt = new Date(issue.created_at);
|
||||
const issueCreatedAtTimestamp = issueCreatedAt.getTime() / 1e3;
|
||||
let issueClosedAtTimestamp = null;
|
||||
if (issue.closed_at !== null) {
|
||||
const issueClosedAt = new Date(issue.closed_at);
|
||||
issueClosedAtTimestamp = issueClosedAt.getTime() / 1e3;
|
||||
}
|
||||
return {
|
||||
title: issue.title,
|
||||
incident_start_time: GetStartTimeFromBody(issue.body) || issueCreatedAtTimestamp,
|
||||
incident_end_time: GetEndTimeFromBody(issue.body) || issueClosedAtTimestamp,
|
||||
number: issue.number,
|
||||
body: html,
|
||||
created_at: issue.created_at,
|
||||
updated_at: issue.updated_at,
|
||||
collapsed: true,
|
||||
comments: issue.comments,
|
||||
// @ts-ignore
|
||||
state: issue.state,
|
||||
closed_at: issue.closed_at,
|
||||
// @ts-ignore
|
||||
labels: issue.labels.map(function(label) {
|
||||
return label.name;
|
||||
}),
|
||||
html_url: issue.html_url,
|
||||
// @ts-ignore
|
||||
comments: comments.map((comment) => {
|
||||
const ast2 = Markdoc.parse(comment.body);
|
||||
const content2 = Markdoc.transform(ast2);
|
||||
const html2 = Markdoc.renderers.html(content2);
|
||||
return {
|
||||
body: html2,
|
||||
created_at: comment.created_at,
|
||||
updated_at: comment.updated_at,
|
||||
html_url: comment.html_url
|
||||
};
|
||||
})
|
||||
};
|
||||
}
|
||||
async function GetCommentsForIssue(issueID, githubConfig) {
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${issueID}/comments`;
|
||||
try {
|
||||
const response = await axios.request(getAxiosOptions(url));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.response.data);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
export { GetIncidents as G, Mapper as M };
|
||||
//# sourceMappingURL=github-e1662b86.js.map
|
||||
File diff suppressed because one or more lines are too long
+7
-84
@@ -1,28 +1,13 @@
|
||||
import { c as create_ssr_component, f as compute_rest_props, h as spread, j as escape_attribute_value, i as escape_object, v as validate_component, b as add_attribute, e as escape, a as each, d as subscribe, k as createEventDispatcher } from './ssr-c85d451a.js';
|
||||
import { c as cn, C as Card, a as Card_content, f as flyAndScale } from './card-content-512872f2.js';
|
||||
import { c as create_ssr_component, f as compute_rest_props, h as spread, j as escape_attribute_value, i as escape_object, v as validate_component, b as add_attribute, e as escape, a as each, d as subscribe } from './ssr-c85d451a.js';
|
||||
import { c as cn, i as is_void, C as Card, b as ChevronDown, a as Card_content, d as createDispatcher, f as flyAndScale, I as Icon$1 } from './chevron-down-226abe3e.js';
|
||||
import 'clsx';
|
||||
import { b as buttonVariants, a as setCtx$1, c as getCtx, d as getAttrs$1 } from './index3-0d676326.js';
|
||||
import { h as setCtx$1, i as getCtx, j as getAttrs$1 } from './ctx-168edc6f.js';
|
||||
import { d as derived } from './index2-d9c461ad.js';
|
||||
import { S as StatusObj } from './helpers-eac5677c.js';
|
||||
import moment from 'moment';
|
||||
import { b as buttonVariants } from './index3-58d8c192.js';
|
||||
import { tv } from 'tailwind-variants';
|
||||
|
||||
const void_element_names = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;
|
||||
function is_void(name) {
|
||||
return void_element_names.test(name) || name.toLowerCase() === "!doctype";
|
||||
}
|
||||
function createDispatcher() {
|
||||
const dispatch = createEventDispatcher();
|
||||
return (e) => {
|
||||
const { originalEvent } = e.detail;
|
||||
const { cancelable } = e;
|
||||
const type = originalEvent.type;
|
||||
const shouldContinue = dispatch(type, { originalEvent, currentTarget: originalEvent.currentTarget }, { cancelable });
|
||||
if (!shouldContinue) {
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
}
|
||||
function getAttrs(builders) {
|
||||
const attrs = {};
|
||||
builders.forEach((builder) => {
|
||||
@@ -410,68 +395,6 @@ const Hover_card_content = create_ssr_component(($$result, $$props, $$bindings,
|
||||
});
|
||||
const Root = LinkPreview;
|
||||
const Trigger = LinkPreviewTrigger;
|
||||
const defaultAttributes = {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
width: 24,
|
||||
height: 24,
|
||||
viewBox: "0 0 24 24",
|
||||
fill: "none",
|
||||
stroke: "currentColor",
|
||||
"stroke-width": 2,
|
||||
"stroke-linecap": "round",
|
||||
"stroke-linejoin": "round"
|
||||
};
|
||||
const Icon = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["name", "color", "size", "strokeWidth", "absoluteStrokeWidth", "iconNode"]);
|
||||
let { name } = $$props;
|
||||
let { color = "currentColor" } = $$props;
|
||||
let { size = 24 } = $$props;
|
||||
let { strokeWidth = 2 } = $$props;
|
||||
let { absoluteStrokeWidth = false } = $$props;
|
||||
let { iconNode } = $$props;
|
||||
if ($$props.name === void 0 && $$bindings.name && name !== void 0)
|
||||
$$bindings.name(name);
|
||||
if ($$props.color === void 0 && $$bindings.color && color !== void 0)
|
||||
$$bindings.color(color);
|
||||
if ($$props.size === void 0 && $$bindings.size && size !== void 0)
|
||||
$$bindings.size(size);
|
||||
if ($$props.strokeWidth === void 0 && $$bindings.strokeWidth && strokeWidth !== void 0)
|
||||
$$bindings.strokeWidth(strokeWidth);
|
||||
if ($$props.absoluteStrokeWidth === void 0 && $$bindings.absoluteStrokeWidth && absoluteStrokeWidth !== void 0)
|
||||
$$bindings.absoluteStrokeWidth(absoluteStrokeWidth);
|
||||
if ($$props.iconNode === void 0 && $$bindings.iconNode && iconNode !== void 0)
|
||||
$$bindings.iconNode(iconNode);
|
||||
return `<svg${spread(
|
||||
[
|
||||
escape_object(defaultAttributes),
|
||||
escape_object($$restProps),
|
||||
{ width: escape_attribute_value(size) },
|
||||
{ height: escape_attribute_value(size) },
|
||||
{ stroke: escape_attribute_value(color) },
|
||||
{
|
||||
"stroke-width": escape_attribute_value(absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth)
|
||||
},
|
||||
{
|
||||
class: escape_attribute_value(`lucide-icon lucide lucide-${name} ${$$props.class ?? ""}`)
|
||||
}
|
||||
],
|
||||
{}
|
||||
)}>${each(iconNode, ([tag, attrs]) => {
|
||||
return `${((tag$1) => {
|
||||
return tag$1 ? `<${tag}${spread([escape_object(attrs)], {})}>${is_void(tag$1) ? "" : ``}${is_void(tag$1) ? "" : `</${tag$1}>`}` : "";
|
||||
})(tag)}`;
|
||||
})}${slots.default ? slots.default({}) : ``}</svg>`;
|
||||
});
|
||||
const Icon$1 = Icon;
|
||||
const Chevron_down = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
const iconNode = [["path", { "d": "m6 9 6 6 6-6" }]];
|
||||
return `${validate_component(Icon$1, "Icon").$$render($$result, Object.assign({}, { name: "chevron-down" }, $$props, { iconNode }), {}, {
|
||||
default: () => {
|
||||
return `${slots.default ? slots.default({}) : ``}`;
|
||||
}
|
||||
})}`;
|
||||
});
|
||||
const ChevronDown = Chevron_down;
|
||||
const Chevron_up = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
const iconNode = [["path", { "d": "m18 15-6-6-6 6" }]];
|
||||
return `${validate_component(Icon$1, "Icon").$$render($$result, Object.assign({}, { name: "chevron-up" }, $$props, { iconNode }), {}, {
|
||||
@@ -566,7 +489,7 @@ const Incident = create_ssr_component(($$result, $$props, $$bindings, slots) =>
|
||||
}
|
||||
})} ${validate_component(Card_description, "Card.Description").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${escape(moment(incident.created_at).format("MMMM Do YYYY, h:mm:ss a"))} <!-- HTML_TAG_START -->${incidentMessage}<!-- HTML_TAG_END -->`;
|
||||
return `${escape(moment(incident.created_at).format("MMMM Do YYYY, h:mm:ss a"))} <!-- HTML_TAG_START -->${incidentMessage}<!-- HTML_TAG_END --> <p class="mt-2">${incident.labels.includes("identified") ? `<span class="bg-yellow-100 text-yellow-800 mt-1 text-sm font-medium me-2 px-2.5 py-0.5 rounded dark:bg-yellow-900 dark:text-yellow-300" data-svelte-h="svelte-1shyy7e">Identified</span>` : ``} ${incident.labels.includes("resolved") ? `<span class="bg-green-100 text-green-800 text-sm font-medium me-2 px-2.5 py-0.5 rounded dark:bg-green-900 dark:text-green-300" data-svelte-h="svelte-h35mlk">Resolved</span>` : ``}</p>`;
|
||||
}
|
||||
})}`;
|
||||
}
|
||||
@@ -581,5 +504,5 @@ const Incident = create_ssr_component(($$result, $$props, $$bindings, slots) =>
|
||||
})}</div></div>`;
|
||||
});
|
||||
|
||||
export { Badge as B, Hover_card_content as H, Incident as I, Root as R, Trigger as T, Icon$1 as a };
|
||||
//# sourceMappingURL=incident-fe6a229f.js.map
|
||||
export { Badge as B, Hover_card_content as H, Incident as I, Root as R, Trigger as T };
|
||||
//# sourceMappingURL=incident-3b62e478.js.map
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,30 @@
|
||||
import './ctx-168edc6f.js';
|
||||
import 'clsx';
|
||||
import { tv } from 'tailwind-variants';
|
||||
|
||||
const buttonVariants = tv({
|
||||
base: "inline-flex items-center justify-center rounded-md text-sm font-medium whitespace-nowrap ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
||||
variants: {
|
||||
variant: {
|
||||
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
||||
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
||||
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
||||
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
||||
ghost: "hover:bg-accent hover:text-accent-foreground",
|
||||
link: "text-primary underline-offset-4 hover:underline"
|
||||
},
|
||||
size: {
|
||||
default: "h-10 px-4 py-2",
|
||||
sm: "h-9 rounded-md px-3",
|
||||
lg: "h-11 rounded-md px-8",
|
||||
icon: "h-10 w-10"
|
||||
}
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: "default",
|
||||
size: "default"
|
||||
}
|
||||
});
|
||||
|
||||
export { buttonVariants as b };
|
||||
//# sourceMappingURL=index3-58d8c192.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index3-58d8c192.js","sources":["../../../.svelte-kit/adapter-node/chunks/index3.js"],"sourcesContent":["import \"dequal\";\nimport \"./ctx.js\";\nimport \"clsx\";\nimport { tv } from \"tailwind-variants\";\nconst buttonVariants = tv({\n base: \"inline-flex items-center justify-center rounded-md text-sm font-medium whitespace-nowrap ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline: \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\"\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\"\n }\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n});\nexport {\n buttonVariants as b\n};\n"],"names":[],"mappings":";;;;AAIK,MAAC,cAAc,GAAG,EAAE,CAAC;AAC1B,EAAE,IAAI,EAAE,wRAAwR;AAChS,EAAE,QAAQ,EAAE;AACZ,IAAI,OAAO,EAAE;AACb,MAAM,OAAO,EAAE,wDAAwD;AACvE,MAAM,WAAW,EAAE,oEAAoE;AACvF,MAAM,OAAO,EAAE,gFAAgF;AAC/F,MAAM,SAAS,EAAE,8DAA8D;AAC/E,MAAM,KAAK,EAAE,8CAA8C;AAC3D,MAAM,IAAI,EAAE,iDAAiD;AAC7D,KAAK;AACL,IAAI,IAAI,EAAE;AACV,MAAM,OAAO,EAAE,gBAAgB;AAC/B,MAAM,EAAE,EAAE,qBAAqB;AAC/B,MAAM,EAAE,EAAE,sBAAsB;AAChC,MAAM,IAAI,EAAE,WAAW;AACvB,KAAK;AACL,GAAG;AACH,EAAE,eAAe,EAAE;AACnB,IAAI,OAAO,EAAE,SAAS;AACtB,IAAI,IAAI,EAAE,SAAS;AACnB,GAAG;AACH,CAAC;;;;"}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,176 @@
|
||||
import fs from 'fs-extra';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import { a as GetNowTimestampUTC, b as GetMinuteStartTimestampUTC, G as GetMinuteStartNowTimestampUTC } from './tool-153dc604.js';
|
||||
import { d as GetStartTimeFromBody, e as GetEndTimeFromBody } from './github-54c09baa.js';
|
||||
import Randomstring from 'randomstring';
|
||||
|
||||
const API_TOKEN = process.env.API_TOKEN;
|
||||
const API_IP = process.env.API_IP;
|
||||
const CheckIfValidTag = function(tag) {
|
||||
let tags = [];
|
||||
let monitors = [];
|
||||
try {
|
||||
monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
|
||||
tags = monitors.map((monitor) => monitor.tag);
|
||||
if (tags.indexOf(tag) == -1) {
|
||||
throw new Error("not a valid tag");
|
||||
}
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const auth = function(request) {
|
||||
const authHeader = request.headers.get("authorization");
|
||||
const authToken = authHeader.replace("Bearer ", "");
|
||||
let ip = "";
|
||||
try {
|
||||
ip = request.headers.get("x-forwarded-for") || request.socket.remoteAddress || request.headers.get("x-real-ip");
|
||||
} catch (err) {
|
||||
console.log("IP Not Found " + err.message);
|
||||
}
|
||||
if (authToken !== API_TOKEN) {
|
||||
return new Error("invalid token");
|
||||
}
|
||||
if (API_IP !== void 0 && ip != "" && ip !== API_IP) {
|
||||
return new Error("invalid ip");
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const store = function(data) {
|
||||
const tag = data.tag;
|
||||
const resp = {};
|
||||
if (data.status === void 0 || ["UP", "DOWN", "DEGRADED"].indexOf(data.status) === -1) {
|
||||
return { error: "status missing", status: 400 };
|
||||
}
|
||||
if (data.latency === void 0 || isNaN(data.latency)) {
|
||||
return { error: "latency missing or not a number", status: 400 };
|
||||
}
|
||||
if (data.timestampInSeconds !== void 0 && isNaN(data.timestampInSeconds)) {
|
||||
return { error: "timestampInSeconds not a number", status: 400 };
|
||||
}
|
||||
if (data.timestampInSeconds === void 0) {
|
||||
data.timestampInSeconds = GetNowTimestampUTC();
|
||||
}
|
||||
data.timestampInSeconds = GetMinuteStartTimestampUTC(data.timestampInSeconds);
|
||||
resp.status = data.status;
|
||||
resp.latency = data.latency;
|
||||
resp.type = "webhook";
|
||||
let timestamp = GetMinuteStartNowTimestampUTC();
|
||||
try {
|
||||
if (data.timestampInSeconds > timestamp) {
|
||||
throw new Error("timestampInSeconds is in future");
|
||||
}
|
||||
if (timestamp - data.timestampInSeconds > 90 * 24 * 60 * 60) {
|
||||
throw new Error("timestampInSeconds is older than 90days");
|
||||
}
|
||||
} catch (err) {
|
||||
return { error: err.message, status: 400 };
|
||||
}
|
||||
if (!CheckIfValidTag(tag)) {
|
||||
return { error: "invalid tag", status: 400 };
|
||||
}
|
||||
let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
|
||||
const monitor = monitors.find((monitor2) => monitor2.tag === tag);
|
||||
let day0 = {};
|
||||
day0[data.timestampInSeconds] = resp;
|
||||
fs.writeFileSync(public_env.PUBLIC_KENER_FOLDER + `/${monitor.folderName}.webhook.${Randomstring.generate()}.json`, JSON.stringify(day0, null, 2));
|
||||
return { status: 200, message: "success at " + data.timestampInSeconds };
|
||||
};
|
||||
const GHIssueToKenerIncident = function(issue) {
|
||||
let issueLabels = issue.labels.map((label) => {
|
||||
return label.name;
|
||||
});
|
||||
let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
|
||||
let tagsAvailable = monitors.map((monitor) => {
|
||||
return monitor.tag;
|
||||
});
|
||||
let commonTags = tagsAvailable.filter((tag) => issueLabels.includes(tag));
|
||||
let resp = {
|
||||
createdAt: Math.floor(new Date(issue.created_at).getTime() / 1e3),
|
||||
//in seconds
|
||||
closedAt: issue.closed_at ? Math.floor(new Date(issue.closed_at).getTime() / 1e3) : null,
|
||||
title: issue.title,
|
||||
tag: commonTags[0],
|
||||
incidentNumber: issue.number
|
||||
};
|
||||
resp.startDatetime = GetStartTimeFromBody(issue.body);
|
||||
resp.endDatetime = GetEndTimeFromBody(issue.body);
|
||||
let body = issue.body;
|
||||
body = body.replace(/\[start_datetime:(\d+)\]/g, "");
|
||||
body = body.replace(/\[end_datetime:(\d+)\]/g, "");
|
||||
resp.body = body.trim();
|
||||
resp.impact = null;
|
||||
if (issueLabels.includes("incident-down")) {
|
||||
resp.impact = "DOWN";
|
||||
} else if (issueLabels.includes("incident-degraded")) {
|
||||
resp.impact = "DEGRADED";
|
||||
}
|
||||
resp.isMaintenance = false;
|
||||
if (issueLabels.includes("maintenance")) {
|
||||
resp.isMaintenance = true;
|
||||
}
|
||||
resp.isIdentified = false;
|
||||
resp.isResolved = false;
|
||||
if (issueLabels.includes("identified")) {
|
||||
resp.isIdentified = true;
|
||||
}
|
||||
if (issueLabels.includes("resolved")) {
|
||||
resp.isResolved = true;
|
||||
}
|
||||
return resp;
|
||||
};
|
||||
const ParseIncidentPayload = function(payload) {
|
||||
let startDatetime = payload.startDatetime;
|
||||
let endDatetime = payload.endDatetime;
|
||||
let title = payload.title;
|
||||
let body = payload.body || "";
|
||||
let tag = payload.tag;
|
||||
let impact = payload.impact;
|
||||
let isMaintenance = payload.isMaintenance;
|
||||
let isIdentified = payload.isIdentified;
|
||||
let isResolved = payload.isResolved;
|
||||
if (startDatetime && typeof startDatetime !== "number") {
|
||||
return { error: "Invalid startDatetime" };
|
||||
}
|
||||
if (endDatetime && (typeof endDatetime !== "number" || endDatetime <= startDatetime)) {
|
||||
return { error: "Invalid endDatetime" };
|
||||
}
|
||||
if (!title || typeof title !== "string") {
|
||||
return { error: "Invalid title" };
|
||||
}
|
||||
if (!tag || typeof tag !== "string") {
|
||||
return { error: "Invalid tag" };
|
||||
}
|
||||
if (body && typeof body !== "string") {
|
||||
return { error: "Invalid body" };
|
||||
}
|
||||
if (impact && (typeof impact !== "string" || ["DOWN", "DEGRADED"].indexOf(impact) === -1)) {
|
||||
return { error: "Invalid impact" };
|
||||
}
|
||||
if (!CheckIfValidTag(tag)) {
|
||||
return { error: "Invalid tag" };
|
||||
}
|
||||
let githubLabels = ["incident"];
|
||||
githubLabels.push(tag);
|
||||
if (impact) {
|
||||
githubLabels.push("incident-" + impact.toLowerCase());
|
||||
}
|
||||
if (isMaintenance) {
|
||||
githubLabels.push("maintenance");
|
||||
}
|
||||
if (isResolved !== void 0 && isResolved === true) {
|
||||
githubLabels.push("resolved");
|
||||
}
|
||||
if (isIdentified !== void 0 && isIdentified === true) {
|
||||
githubLabels.push("identified");
|
||||
}
|
||||
if (startDatetime)
|
||||
body = body + ` [start_datetime:${startDatetime}]`;
|
||||
if (endDatetime)
|
||||
body = body + ` [end_datetime:${endDatetime}]`;
|
||||
return { title, body, githubLabels };
|
||||
};
|
||||
|
||||
export { GHIssueToKenerIncident as G, ParseIncidentPayload as P, auth as a, store as s };
|
||||
//# sourceMappingURL=webhook-bd364d16.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -171,7 +171,7 @@ const options = {
|
||||
<div class="error">
|
||||
<span class="status">` + status + '</span>\n <div class="message">\n <h1>' + message + "</h1>\n </div>\n </div>\n </body>\n</html>\n"
|
||||
},
|
||||
version_hash: "1yr8f85"
|
||||
version_hash: "1az4y2g"
|
||||
};
|
||||
function get_hooks() {
|
||||
return {};
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -10,13 +10,13 @@ return {
|
||||
assets: new Set([".DS_Store","confetti.gif","earth.png","google.png","kener/cashfree-payments.0day.utc.json","kener/cashfree-payouts.0day.utc.json","kener/earth.0day.utc.json","kener/google-search.0day.utc.json","kener/monitors.json","kener/site.json","kener/svelte-website.0day.utc.json","logo.png","logo96.png","robots.txt","ss.png","ss2.png","ss3.png","svelte.svg"]),
|
||||
mimeTypes: {".gif":"image/gif",".png":"image/png",".json":"application/json",".txt":"text/plain",".svg":"image/svg+xml"},
|
||||
_: {
|
||||
client: {"start":"_app/immutable/entry/start.27f59ffc.js","app":"_app/immutable/entry/app.ea979ae0.js","imports":["_app/immutable/entry/start.27f59ffc.js","_app/immutable/chunks/scheduler.1b18627c.js","_app/immutable/chunks/singletons.8407d17b.js","_app/immutable/chunks/index.3e0e01a3.js","_app/immutable/entry/app.ea979ae0.js","_app/immutable/chunks/scheduler.1b18627c.js","_app/immutable/chunks/index.a0ccbbe4.js"],"stylesheets":[],"fonts":[]},
|
||||
client: {"start":"_app/immutable/entry/start.599de931.js","app":"_app/immutable/entry/app.a93f341a.js","imports":["_app/immutable/entry/start.599de931.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/singletons.19f82a08.js","_app/immutable/chunks/index.3cd3e9b4.js","_app/immutable/entry/app.a93f341a.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/index.7fa4eb0f.js"],"stylesheets":[],"fonts":[]},
|
||||
nodes: [
|
||||
__memo(() => import('./chunks/0-34da3b44.js')),
|
||||
__memo(() => import('./chunks/1-459271f2.js')),
|
||||
__memo(() => import('./chunks/2-3c01972e.js')),
|
||||
__memo(() => import('./chunks/3-8cfd0bbd.js')),
|
||||
__memo(() => import('./chunks/4-2402dca6.js'))
|
||||
__memo(() => import('./chunks/0-cb0211dd.js')),
|
||||
__memo(() => import('./chunks/1-3a88ccd5.js')),
|
||||
__memo(() => import('./chunks/2-6ac0edba.js')),
|
||||
__memo(() => import('./chunks/3-96344d28.js')),
|
||||
__memo(() => import('./chunks/4-a823779f.js'))
|
||||
],
|
||||
routes: [
|
||||
{
|
||||
@@ -26,12 +26,40 @@ return {
|
||||
page: { layouts: [0,], errors: [1,], leaf: 2 },
|
||||
endpoint: null
|
||||
},
|
||||
{
|
||||
id: "/api/incident",
|
||||
pattern: /^\/api\/incident\/?$/,
|
||||
params: [],
|
||||
page: null,
|
||||
endpoint: __memo(() => import('./chunks/_server-589e42d1.js'))
|
||||
},
|
||||
{
|
||||
id: "/api/incident/[incidentNumber]",
|
||||
pattern: /^\/api\/incident\/([^/]+?)\/?$/,
|
||||
params: [{"name":"incidentNumber","optional":false,"rest":false,"chained":false}],
|
||||
page: null,
|
||||
endpoint: __memo(() => import('./chunks/_server-21dfbd18.js'))
|
||||
},
|
||||
{
|
||||
id: "/api/incident/[incidentNumber]/comment",
|
||||
pattern: /^\/api\/incident\/([^/]+?)\/comment\/?$/,
|
||||
params: [{"name":"incidentNumber","optional":false,"rest":false,"chained":false}],
|
||||
page: null,
|
||||
endpoint: __memo(() => import('./chunks/_server-d9ce737b.js'))
|
||||
},
|
||||
{
|
||||
id: "/api/incident/[incidentNumber]/status",
|
||||
pattern: /^\/api\/incident\/([^/]+?)\/status\/?$/,
|
||||
params: [{"name":"incidentNumber","optional":false,"rest":false,"chained":false}],
|
||||
page: null,
|
||||
endpoint: __memo(() => import('./chunks/_server-e0c327de.js'))
|
||||
},
|
||||
{
|
||||
id: "/api/status",
|
||||
pattern: /^\/api\/status\/?$/,
|
||||
params: [],
|
||||
page: null,
|
||||
endpoint: __memo(() => import('./chunks/_server-b3ec6621.js'))
|
||||
endpoint: __memo(() => import('./chunks/_server-e6873bc7.js'))
|
||||
},
|
||||
{
|
||||
id: "/api/today",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -39,7 +39,7 @@ Kener has two parts. One is a svelte app which you can find in the src folder an
|
||||
|
||||
|
||||
## Folder structure
|
||||
```
|
||||
```shell
|
||||
├── src (svelte frontend files)
|
||||
├── static (things put here can be referenced directly example static/logo.png -> /logo.png)
|
||||
├── scripts (nodejs server files)
|
||||
@@ -91,9 +91,9 @@ npm run build
|
||||
npm run serve
|
||||
```
|
||||
|
||||
It also needs to yaml files to work
|
||||
- site.yaml
|
||||
- monitors.yaml
|
||||
It also needs 2 yaml files to work
|
||||
- site.yaml: Contains information about the site
|
||||
- monitors.yaml: Contains your monitors and their related specifications
|
||||
|
||||
By default these are present in `config/`. However you can use different location either passing them as argument or having the path as enviorment variable
|
||||
|
||||
@@ -104,19 +104,19 @@ export SITE_YAML_PATH=/your/path/site.yaml
|
||||
```
|
||||
### Add as argument to prod.js
|
||||
```shell
|
||||
node prod.js --monitors /your/path/monitors.yaml --site /your/path/site.yaml
|
||||
npm run serve -- --monitors /your/path/monitors.yaml --site /your/path/site.yaml
|
||||
```
|
||||
|
||||
```shell
|
||||
export PUBLIC_KENER_FOLDER=./build/client/kener
|
||||
npm i
|
||||
npm run kener:build
|
||||
node prod.js
|
||||
```
|
||||
## Github Setup
|
||||
Kener uses github for incident management. Issues created in github using certain tags go to kener as incidents.
|
||||
### Step 1: Github Repositiory
|
||||
Create a Github Repositiory. It can be either public or private
|
||||
### Step 1: Github Repositiory and Add to site.yaml
|
||||
Create a Github Repositiory. It can be either public or private. After you have created a repository open `site.yaml` and add them like this
|
||||
|
||||
```yaml
|
||||
github:
|
||||
owner: "username"
|
||||
repo: "respository"
|
||||
```
|
||||
### Step 2: Create Github Token
|
||||
You can create either a classic token or personal access token
|
||||
#### Creating Personal Access Token
|
||||
@@ -136,6 +136,7 @@ You can create either a classic token or personal access token
|
||||
- Click on generate Token
|
||||
|
||||
Set the token as an environment variable
|
||||
|
||||
```shell
|
||||
export GH_TOKEN=github_pat_11AD3ZA3Y0
|
||||
```
|
||||
@@ -259,12 +260,16 @@ hero:
|
||||
|
||||
## nav
|
||||
You can add more links to your navbar.
|
||||
|
||||
```yaml
|
||||
nav:
|
||||
- name: "Home"
|
||||
url: "/home"
|
||||
```
|
||||

|
||||
|
||||
## scripts
|
||||
You can include any script in the app.html file like google analytics etc
|
||||
|
||||
---
|
||||
# Add Monitors
|
||||
Inside `config/` folder there is a file called `monitors.yaml`. We will be adding our monitors here. Please note that your yaml must be valid. It is an array.
|
||||
@@ -314,7 +319,6 @@ Sample
|
||||
| api.body | Optional | HTTP Body as string |
|
||||
| api.eval | Optional | Evaluator written in JS, to parse HTTP response and calculate uptime and latency |
|
||||
| defaultStatus | Optional | If no API is given this will be the default status. can be UP/DOWN/DEGRADED |
|
||||
|
|
||||
|
||||
## cron
|
||||
|
||||
@@ -454,6 +458,18 @@ Assuming `ORDER_ID` is present in env
|
||||
}
|
||||
})
|
||||
```
|
||||
## With defaultStatus UP
|
||||
|
||||
This will not make any API call, each minute it will set the status as UP
|
||||
|
||||
```yaml
|
||||
- name: Earth
|
||||
description: Our Planent
|
||||
tag: "earth"
|
||||
defaultStatus: UP
|
||||
```
|
||||
|
||||
---
|
||||
# Incident Management
|
||||
Kener uses Github to power incident management using labels
|
||||
## Labels
|
||||
@@ -468,8 +484,7 @@ Kener auto creates labels for your monitors using the `tag` parameter
|
||||
- Create an issue. Give it a title
|
||||
- In the body add [start_datetime:1702651340] and [end_datetime:1702651140] and add some description. Time is UTC
|
||||
- Add `incident`, `incident-down` and the monitor tag. This will make the monitor down for 4 minutes
|
||||
|
||||
|
||||
---
|
||||
# API
|
||||
Kener also gives APIs to push data and create incident. Before you use kener apis you will have to set an authorization token called `API_TOKEN`. This also has to be set as an environment variable.
|
||||
```shell
|
||||
@@ -482,31 +497,294 @@ export API_IP=127.0.0.1
|
||||
```
|
||||
|
||||
## Update Status
|
||||
The update status API can be used to manually update the state of a monitor from a remote server.
|
||||
### Request Body
|
||||
| Parameter | Description |
|
||||
| ------------------ | ------------------------------------------------------------------------------------ |
|
||||
| status | `Required` Can be only UP/DOWN/DEGRADED |
|
||||
| latency | `Required` In Seconds. Leave 0 if not required |
|
||||
| timestampInSeconds | `Optional` Timestamp in UTC seconds. Defaults to now. Should between 90 Days and now |
|
||||
| tag | `Required` Monitor Tag set in monitors.yaml |
|
||||
|
||||
```shell
|
||||
curl --request POST \
|
||||
--url http://your-kener.com/api/status \
|
||||
--url http://your-kener.host/api/status \
|
||||
--header 'Authorization: Bearer some-token-set-by-you' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data '{
|
||||
"status": "UP",
|
||||
"status": "DOWN",
|
||||
"latency": 1213,
|
||||
"timestampInSeconds": 1702405860,
|
||||
"tag": "google-search"
|
||||
}'
|
||||
```
|
||||
### Response
|
||||
```json
|
||||
{
|
||||
"status": 200,
|
||||
"message": "success at 1702405860"
|
||||
}
|
||||
```
|
||||
|
||||
This will update the status of the monitor with tag `google-search` to DOWN at UTC 1702405860
|
||||
|
||||
## Create an Incident
|
||||
Can be use to create an incident from a remote server
|
||||
|
||||
### Request Body
|
||||
| Parameter | Description |
|
||||
| ------------------ | ------------------------------------------------------------------------------------ |
|
||||
| startDatetime | `Optional` When did the incident start in UTC second |
|
||||
| endDatetime | `Optional` When did the incident end in UTC seconds |
|
||||
| title | `Required` Title of the incident |
|
||||
| body | `Optional` Body of the incident |
|
||||
| tag | `Required` Monitor Tag of the incident |
|
||||
| impact | `Optional` Can be only DOWN/DEGRADED |
|
||||
| isMaintenance | `Optional` Boolean if incident is a maitainance |
|
||||
| isIdentified | `Optional` Incident identified |
|
||||
| isResolved | `Optional` Incident resolved |
|
||||
|
||||
```shell
|
||||
curl --request POST \
|
||||
--url http://your-kener.host/api/incident \
|
||||
--header 'Authorization: Bearer some-token-set-by-you' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data '{
|
||||
"startDatetime": 1702405740,
|
||||
"endDatetime": 1702405920,
|
||||
"title": "Outage in Mumbai",
|
||||
"body": "Login cluster is down in mumbai region",
|
||||
"tag": "google-search",
|
||||
"impact": "DOWN",
|
||||
"isMaintenance": false,
|
||||
"isIdentified": true,
|
||||
"isResolved": false
|
||||
}'
|
||||
```
|
||||
|
||||
### Response
|
||||
```json
|
||||
{
|
||||
"createdAt": 1703940450,
|
||||
"closedAt": null,
|
||||
"title": "Outage in Mumbai",
|
||||
"tag": "google-search",
|
||||
"incidentNumber": 12,
|
||||
"startDatetime": 1702405740,
|
||||
"endDatetime": 1702405920,
|
||||
"body": "Login cluster is down in mumbai region",
|
||||
"impact": "DOWN",
|
||||
"isMaintenance": false,
|
||||
"isIdentified": true,
|
||||
"isResolved": false
|
||||
}
|
||||
```
|
||||
## Update an Incident
|
||||
Can be use to update an incident from a remote server. It will clear values if not passed
|
||||
|
||||
### Request Param
|
||||
|
||||
- `incidentNumber`: Number of the incident
|
||||
|
||||
### Request Body
|
||||
| Parameter | Description |
|
||||
| ------------------ | ------------------------------------------------------------------------------------ |
|
||||
| startDatetime | `Optional` When did the incident start in UTC second |
|
||||
| endDatetime | `Optional` When did the incident end in UTC seconds |
|
||||
| title | `Required` Title of the incident |
|
||||
| body | `Optional` Body of the incident |
|
||||
| tag | `Required` Monitor Tag of the incident |
|
||||
| impact | `Optional` Can be only DOWN/DEGRADED |
|
||||
| isMaintenance | `Optional` Boolean if incident is a maitainance |
|
||||
| isIdentified | `Optional` Incident identified |
|
||||
| isResolved | `Optional` Incident resolved |
|
||||
|
||||
```shell
|
||||
curl --request PATCH \
|
||||
--url http://your-kener.host/api/incident/{incidentNumber} \
|
||||
--header 'Authorization: Bearer some-token-set-by-you' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data '{
|
||||
"startDatetime": 1702405740,
|
||||
"endDatetime": 1702405920,
|
||||
"title": "Outage in Mumbai",
|
||||
"body": "Login cluster is down in mumbai region",
|
||||
"tag": "google-search",
|
||||
"impact": "DOWN",
|
||||
"isMaintenance": false,
|
||||
"isIdentified": true,
|
||||
"isResolved": false
|
||||
}'
|
||||
```
|
||||
|
||||
### Response
|
||||
```json
|
||||
{
|
||||
"createdAt": 1703940450,
|
||||
"closedAt": null,
|
||||
"title": "Outage in Mumbai",
|
||||
"tag": "google-search",
|
||||
"incidentNumber": 12,
|
||||
"startDatetime": 1702405740,
|
||||
"endDatetime": 1702405920,
|
||||
"body": "Login cluster is down in mumbai region",
|
||||
"impact": "DOWN",
|
||||
"isMaintenance": false,
|
||||
"isIdentified": true,
|
||||
"isResolved": false
|
||||
}
|
||||
```
|
||||
|
||||
## Get an Incident
|
||||
|
||||
Use `incidentNumber` to fetch an incident
|
||||
|
||||
### Request Body
|
||||
|
||||
```shell
|
||||
curl --request GET \
|
||||
--url http://your-kener.host/api/incident/{incidentNumber} \
|
||||
--header 'Authorization: Bearer some-token-set-by-you' \
|
||||
```
|
||||
|
||||
### Response
|
||||
```json
|
||||
{
|
||||
"createdAt": 1703940450,
|
||||
"closedAt": null,
|
||||
"title": "Outage in Mumbai",
|
||||
"tag": "google-search",
|
||||
"incidentNumber": 12,
|
||||
"startDatetime": 1702405740,
|
||||
"endDatetime": 1702405920,
|
||||
"body": "Login cluster is down in mumbai region",
|
||||
"impact": "DOWN",
|
||||
"isMaintenance": false,
|
||||
"isIdentified": true,
|
||||
"isResolved": false
|
||||
}
|
||||
```
|
||||
|
||||
## Add Comment
|
||||
|
||||
Add comments for incident using `incidentNumber`
|
||||
|
||||
### Request
|
||||
|
||||
```shell
|
||||
curl --request POST \
|
||||
--url http://your-kener.host/api/incident/{incidentNumber}/comment \
|
||||
--header 'Authorization: Bearer some-token-set-by-you' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data '{
|
||||
"body": "comment 1"
|
||||
}'
|
||||
```
|
||||
### Response
|
||||
```json
|
||||
{
|
||||
"commentID": 1873376745,
|
||||
"body": "comment 1",
|
||||
"createdAt": 1704123938
|
||||
}
|
||||
```
|
||||
|
||||
## Get Comments
|
||||
|
||||
Use this API to fetch all the comments for an incident
|
||||
|
||||
### Request
|
||||
```shell
|
||||
curl --request GET \
|
||||
--url http://your-kener.host/api/incident/{incidentNumber}/comment \
|
||||
--header 'Authorization: Bearer some-token-set-by-you' \
|
||||
```
|
||||
|
||||
### Response
|
||||
```json
|
||||
[
|
||||
{
|
||||
"commentID": 1873372042,
|
||||
"body": "comment 1",
|
||||
"createdAt": 1704123116
|
||||
},
|
||||
{
|
||||
"commentID": 1873372169,
|
||||
"body": "comment 2",
|
||||
"createdAt": 1704123139
|
||||
}
|
||||
]
|
||||
```
|
||||
## Update Incident Status
|
||||
Use this to API to update the status of an ongoing incident.
|
||||
|
||||
### Request Body
|
||||
| Parameter | Description |
|
||||
| ------------------ | ------------------------------------------------------------------------------------ |
|
||||
| isIdentified | `Optional` Boolean, set it when incident has been identified |
|
||||
| isResolved | `Optional` Boolean, set it when incident has been resolved |
|
||||
| endDatetime | `Optional` When did the incident end in UTC seconds |
|
||||
|
||||
|
||||
### Request
|
||||
```shell
|
||||
curl --request POST \
|
||||
--url http://your-kener.host/api/incident/{incidentNumber}/status \
|
||||
--header 'Authorization: Bearer some-token-set-by-you' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data '{
|
||||
"isIdentified": true,
|
||||
"isResolved": false
|
||||
"endDatetime": 1702405920
|
||||
}'
|
||||
```
|
||||
### Response
|
||||
```json
|
||||
{
|
||||
"createdAt": 1703940450,
|
||||
"closedAt": null,
|
||||
"title": "Outage in Mumbai",
|
||||
"tag": "google-search",
|
||||
"incidentNumber": 12,
|
||||
"startDatetime": 1702405740,
|
||||
"endDatetime": 1702405920,
|
||||
"body": "Login cluster is down in mumbai region",
|
||||
"impact": "DOWN",
|
||||
"isMaintenance": false,
|
||||
"isIdentified": true,
|
||||
"isResolved": false
|
||||
}
|
||||
```
|
||||
---
|
||||
# Badge
|
||||
There are two types of badges
|
||||
|
||||
Syntax
|
||||
```md
|
||||
http://[hostname]/badge/[tag]/status
|
||||
http://[hostname]/badge/[tag]/uptime
|
||||
```
|
||||
## Status
|
||||
Shows the last health check was UP/DOWN/DEGRADED
|
||||
 -> https://kener.ing/badge/earth/status
|
||||

|
||||
|
||||
Example in HTML
|
||||
```html
|
||||
<img src="https://kener.ing/badge/earth/status">
|
||||
```
|
||||

|
||||
Example in MarkDown
|
||||
```md
|
||||

|
||||
```
|
||||
## Uptime
|
||||
Shows the 90 Day uptime
|
||||
 -> https://kener.ing/badge/earth/uptime
|
||||

|
||||
|
||||
Example in HTML
|
||||
```html
|
||||
<img src="https://kener.ing/badge/earth/uptime">
|
||||
```
|
||||
Example in MarkDown
|
||||
```md
|
||||

|
||||
```
|
||||

|
||||
```
|
||||
Generated
+15
-49
@@ -1,23 +1,23 @@
|
||||
{
|
||||
"name": "kener",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "kener",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@markdoc/markdoc": "^0.3.5",
|
||||
"axios": "^1.6.2",
|
||||
"bits-ui": "^0.9.8",
|
||||
"bits-ui": "^0.9.9",
|
||||
"clsx": "^2.0.0",
|
||||
"croner": "^7.0.5",
|
||||
"express": "^4.18.2",
|
||||
"fs-extra": "^11.1.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"lucide-svelte": "^0.292.0",
|
||||
"marked": "^11.1.1",
|
||||
"moment": "^2.29.4",
|
||||
"moment-timezone": "^0.5.43",
|
||||
"node-cache": "^5.1.2",
|
||||
@@ -511,29 +511,6 @@
|
||||
"@jridgewell/sourcemap-codec": "^1.4.14"
|
||||
}
|
||||
},
|
||||
"node_modules/@markdoc/markdoc": {
|
||||
"version": "0.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@markdoc/markdoc/-/markdoc-0.3.5.tgz",
|
||||
"integrity": "sha512-Z3agu2wnodoOYd5kzKbtwZduSfX19Kbsg/FlK0TeMn29cTTEEVPJtjfgKSMTN/Wq+kUQXnPtOEhHRgke5d/Xiw==",
|
||||
"engines": {
|
||||
"node": ">=14.7.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@types/markdown-it": "12.2.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "*",
|
||||
"react": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
"optional": true
|
||||
},
|
||||
"react": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@melt-ui/svelte": {
|
||||
"version": "0.61.2",
|
||||
"resolved": "https://registry.npmjs.org/@melt-ui/svelte/-/svelte-0.61.2.tgz",
|
||||
@@ -842,28 +819,6 @@
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
|
||||
"integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw=="
|
||||
},
|
||||
"node_modules/@types/linkify-it": {
|
||||
"version": "3.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.5.tgz",
|
||||
"integrity": "sha512-yg6E+u0/+Zjva+buc3EIb+29XEg4wltq7cSmd4Uc2EE/1nUVmxyzpX6gUXD0V8jIrG0r7YeOGVIbYRkxeooCtw==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/@types/markdown-it": {
|
||||
"version": "12.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz",
|
||||
"integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@types/linkify-it": "*",
|
||||
"@types/mdurl": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/mdurl": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.5.tgz",
|
||||
"integrity": "sha512-6L6VymKTzYSrEf4Nev4Xa1LCHKrlTlYCBMTlQKFuddo1CvQcE52I0mwfOJayueUC7MJuXOeHTcIU683lzd0cUA==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/@types/pug": {
|
||||
"version": "2.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/pug/-/pug-2.0.10.tgz",
|
||||
@@ -2332,6 +2287,17 @@
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/marked": {
|
||||
"version": "11.1.1",
|
||||
"resolved": "https://registry.npmjs.org/marked/-/marked-11.1.1.tgz",
|
||||
"integrity": "sha512-EgxRjgK9axsQuUa/oKMx5DEY8oXpKJfk61rT5iY3aRlgU6QJtUcxU5OAymdhCvWvhYcd9FKmO5eQoX8m9VGJXg==",
|
||||
"bin": {
|
||||
"marked": "bin/marked.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/mdn-data": {
|
||||
"version": "2.0.30",
|
||||
"resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz",
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "kener",
|
||||
"version": "0.0.2",
|
||||
"version": "0.0.3",
|
||||
"private": false,
|
||||
"license": "MIT",
|
||||
"description": "Kener: An open-source Node.js status page application for real-time service monitoring, incident management, and customizable reporting. Simplify service outage tracking, enhance incident communication, and ensure a seamless user experience with Kener's intuitive dashboard and robust features.",
|
||||
@@ -52,15 +52,15 @@
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@markdoc/markdoc": "^0.3.5",
|
||||
"axios": "^1.6.2",
|
||||
"bits-ui": "^0.9.8",
|
||||
"bits-ui": "^0.9.9",
|
||||
"clsx": "^2.0.0",
|
||||
"croner": "^7.0.5",
|
||||
"express": "^4.18.2",
|
||||
"fs-extra": "^11.1.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"lucide-svelte": "^0.292.0",
|
||||
"marked": "^11.1.1",
|
||||
"moment": "^2.29.4",
|
||||
"moment-timezone": "^0.5.43",
|
||||
"node-cache": "^5.1.2",
|
||||
|
||||
@@ -2,7 +2,7 @@ import axios from "axios";
|
||||
import fs from "fs-extra";
|
||||
import { UP, DOWN, DEGRADED } from "./constants.js";
|
||||
import { GetNowTimestampUTC, GetMinuteStartNowTimestampUTC,GetMinuteStartTimestampUTC } from "./tool.js";
|
||||
import { GetIncidents, GetEndTimeFromBody, GetStartTimeFromBody } from "./github.js";
|
||||
import { GetIncidents, GetEndTimeFromBody, GetStartTimeFromBody, CloseIssue } from "./github.js";
|
||||
import Randomstring from "randomstring";
|
||||
import Queue from "queue";
|
||||
|
||||
@@ -14,7 +14,7 @@ const apiQueue = new Queue({
|
||||
});
|
||||
|
||||
async function manualIncident(monitor, githubConfig){
|
||||
let incidentsResp = await GetIncidents(monitor.tag, githubConfig);
|
||||
let incidentsResp = await GetIncidents(monitor.tag, githubConfig, "open");
|
||||
|
||||
let manualData = {};
|
||||
if (incidentsResp.length == 0) {
|
||||
@@ -26,6 +26,7 @@ async function manualIncident(monitor, githubConfig){
|
||||
let timeDegradedEnd = 0;
|
||||
for (let i = 0; i < incidentsResp.length; i++) {
|
||||
const incident = incidentsResp[i];
|
||||
const incidentNumber = incident.number;
|
||||
let start_time = GetStartTimeFromBody(incident.body);
|
||||
let allLabels = incident.labels.map((label) => label.name);
|
||||
if (allLabels.indexOf("incident-degraded") == -1 && allLabels.indexOf("incident-down") == -1) {
|
||||
@@ -42,6 +43,9 @@ async function manualIncident(monitor, githubConfig){
|
||||
|
||||
if (end_time !== null) {
|
||||
newIncident.end_time = end_time;
|
||||
if(end_time <= GetNowTimestampUTC() && incident.state === "open"){
|
||||
await CloseIssue(githubConfig, incidentNumber)
|
||||
}
|
||||
} else {
|
||||
newIncident.end_time = GetNowTimestampUTC();
|
||||
}
|
||||
|
||||
+163
-36
@@ -1,8 +1,9 @@
|
||||
// @ts-nocheck
|
||||
import axios from "axios";
|
||||
import {GetMinuteStartNowTimestampUTC} from "./tool.js";
|
||||
import Markdoc from "@markdoc/markdoc";
|
||||
import { GetMinuteStartNowTimestampUTC } from "./tool.js";
|
||||
import { marked } from "marked";
|
||||
const GH_TOKEN = process.env.GH_TOKEN;
|
||||
const GhnotconfireguredMsg = "owner or repo or GH_TOKEN is undefined. Read the docs to configure github: https://kener.ing/docs#h2github-setup";
|
||||
/**
|
||||
* @param {any} url
|
||||
*/
|
||||
@@ -31,9 +32,25 @@ function postAxiosOptions(url, data) {
|
||||
};
|
||||
return options;
|
||||
}
|
||||
|
||||
function patchAxiosOptions(url, data) {
|
||||
const options = {
|
||||
url: url,
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
Accept: "application/vnd.github+json",
|
||||
Authorization: "Bearer " + GH_TOKEN,
|
||||
"X-GitHub-Api-Version": "2022-11-28",
|
||||
},
|
||||
data: data,
|
||||
};
|
||||
return options;
|
||||
}
|
||||
|
||||
const GetAllGHLabels = async function (owner, repo) {
|
||||
if (owner === undefined || repo === undefined || GH_TOKEN === undefined) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return [];
|
||||
}
|
||||
const options = getAxiosOptions(`https://api.github.com/repos/${owner}/${repo}/labels`);
|
||||
|
||||
let labels = [];
|
||||
@@ -52,11 +69,15 @@ function generateRandomColor() {
|
||||
//random color will be freshly served
|
||||
}
|
||||
const CreateGHLabel = async function (owner, repo, label, description, color) {
|
||||
if(color === undefined){
|
||||
color = generateRandomColor();
|
||||
}
|
||||
if (owner === undefined || repo === undefined || GH_TOKEN === undefined) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
if (color === undefined) {
|
||||
color = generateRandomColor();
|
||||
}
|
||||
|
||||
const options = postAxiosOptions(`https://api.github.com/repos/${owner}/${repo}/labels`, {
|
||||
const options = postAxiosOptions(`https://api.github.com/repos/${owner}/${repo}/labels`, {
|
||||
name: label,
|
||||
color: color,
|
||||
description: description,
|
||||
@@ -91,25 +112,41 @@ const GetEndTimeFromBody = function (text) {
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const GetIncidentByNumber = async function (githubConfig, incidentNumber) {
|
||||
if (githubConfig.owner === undefined || githubConfig.repo === undefined || GH_TOKEN === undefined) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;
|
||||
const options = getAxiosOptions(url);
|
||||
try {
|
||||
const response = await axios.request(options);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.message, options, url);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
const GetIncidents = async function (tagName, githubConfig, state = "all") {
|
||||
if (githubConfig.owner === undefined || githubConfig.repo === undefined || GH_TOKEN === undefined) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return [];
|
||||
}
|
||||
if (tagName === undefined) {
|
||||
return [];
|
||||
}
|
||||
if (githubConfig === undefined) {
|
||||
return [];
|
||||
}
|
||||
const since = GetMinuteStartNowTimestampUTC() - githubConfig.incidentSince * 60 * 60;
|
||||
const sinceISO = new Date(since * 1000).toISOString();
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues?state=${state}&labels=${tagName},incident&sort=created&direction=desc&since=${sinceISO}`;
|
||||
const sinceISO = new Date(since * 1000).toISOString();
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues?state=${state}&labels=${tagName},incident&sort=created&direction=desc&since=${sinceISO}`;
|
||||
const options = getAxiosOptions(url);
|
||||
try {
|
||||
const response = await axios.request(options);
|
||||
let issues = response.data;
|
||||
//issues.createAt should be after sinceISO
|
||||
issues = issues.filter((issue) => {
|
||||
return new Date(issue.created_at) >= new Date(sinceISO);
|
||||
});
|
||||
return issues;
|
||||
issues = issues.filter((issue) => {
|
||||
return new Date(issue.created_at) >= new Date(sinceISO);
|
||||
});
|
||||
return issues;
|
||||
} catch (error) {
|
||||
//console.log(error.message, options, url);
|
||||
return [];
|
||||
@@ -117,27 +154,24 @@ const GetIncidents = async function (tagName, githubConfig, state = "all") {
|
||||
};
|
||||
|
||||
async function Mapper(issue) {
|
||||
const ast = Markdoc.parse(issue.body);
|
||||
const content = Markdoc.transform(ast);
|
||||
const html = Markdoc.renderers.html(content);
|
||||
const html = marked.parse(issue.body);
|
||||
const comments = await GetCommentsForIssue(issue.number, this.github);
|
||||
|
||||
//convert issue.created_at from iso to timestamp UTC minutes
|
||||
const issueCreatedAt = new Date(issue.created_at);
|
||||
const issueCreatedAtTimestamp = issueCreatedAt.getTime() / 1000;
|
||||
//convert issue.created_at from iso to timestamp UTC minutes
|
||||
const issueCreatedAt = new Date(issue.created_at);
|
||||
const issueCreatedAtTimestamp = issueCreatedAt.getTime() / 1000;
|
||||
|
||||
//convert issue.closed_at from iso to timestamp UTC minutes
|
||||
let issueClosedAtTimestamp = null;
|
||||
if(issue.closed_at !== null){
|
||||
const issueClosedAt = new Date(issue.closed_at);
|
||||
issueClosedAtTimestamp = issueClosedAt.getTime() / 1000;
|
||||
}
|
||||
//convert issue.closed_at from iso to timestamp UTC minutes
|
||||
let issueClosedAtTimestamp = null;
|
||||
if (issue.closed_at !== null) {
|
||||
const issueClosedAt = new Date(issue.closed_at);
|
||||
issueClosedAtTimestamp = issueClosedAt.getTime() / 1000;
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
title: issue.title,
|
||||
incident_start_time: GetStartTimeFromBody(issue.body) || issueCreatedAtTimestamp,
|
||||
incident_end_time: GetEndTimeFromBody(issue.body) || issueClosedAtTimestamp,
|
||||
incident_end_time: GetEndTimeFromBody(issue.body) || issueClosedAtTimestamp,
|
||||
number: issue.number,
|
||||
body: html,
|
||||
created_at: issue.created_at,
|
||||
@@ -154,9 +188,7 @@ async function Mapper(issue) {
|
||||
html_url: issue.html_url,
|
||||
// @ts-ignore
|
||||
comments: comments.map((/** @type {{ body: string | import("markdown-it/lib/token")[]; created_at: any; updated_at: any; html_url: any; }} */ comment) => {
|
||||
const ast = Markdoc.parse(comment.body);
|
||||
const content = Markdoc.transform(ast);
|
||||
const html = Markdoc.renderers.html(content);
|
||||
const html = marked.parse(comment.body);
|
||||
return {
|
||||
body: html,
|
||||
created_at: comment.created_at,
|
||||
@@ -167,6 +199,10 @@ async function Mapper(issue) {
|
||||
};
|
||||
}
|
||||
async function GetCommentsForIssue(issueID, githubConfig) {
|
||||
if (githubConfig.owner === undefined || githubConfig.repo === undefined || GH_TOKEN === undefined) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return [];
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${issueID}/comments`;
|
||||
try {
|
||||
const response = await axios.request(getAxiosOptions(url));
|
||||
@@ -175,8 +211,12 @@ async function GetCommentsForIssue(issueID, githubConfig) {
|
||||
console.log(error.response.data);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
async function CreateIssue(githubConfig, issueTitle, issueBody, issueLabels) {
|
||||
if (githubConfig.owner === undefined || githubConfig.repo === undefined || GH_TOKEN === undefined) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues`;
|
||||
try {
|
||||
const payload = {
|
||||
@@ -188,7 +228,94 @@ async function CreateIssue(githubConfig, issueTitle, issueBody, issueLabels) {
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.response.data);
|
||||
return [];
|
||||
return null;
|
||||
}
|
||||
}
|
||||
export { GetAllGHLabels, CreateGHLabel, GetIncidents, GetStartTimeFromBody, GetEndTimeFromBody, GetCommentsForIssue, Mapper };
|
||||
async function UpdateIssue(githubConfig, incidentNumber, issueTitle, issueBody, issueLabels) {
|
||||
if (githubConfig.owner === undefined || githubConfig.repo === undefined || GH_TOKEN === undefined) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;
|
||||
try {
|
||||
const payload = {
|
||||
title: issueTitle,
|
||||
body: issueBody,
|
||||
labels: issueLabels,
|
||||
};
|
||||
const response = await axios.request(patchAxiosOptions(url, payload));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.response.data);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
async function CloseIssue(githubConfig, incidentNumber) {
|
||||
if (githubConfig.owner === undefined || githubConfig.repo === undefined || GH_TOKEN === undefined) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;
|
||||
try {
|
||||
const payload = {
|
||||
state: "closed"
|
||||
};
|
||||
const response = await axios.request(patchAxiosOptions(url, payload));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.response.data);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
async function AddComment(githubConfig, incidentNumber, commentBody) {
|
||||
if (githubConfig.owner === undefined || githubConfig.repo === undefined || GH_TOKEN === undefined) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}/comments`;
|
||||
try {
|
||||
const payload = {
|
||||
body: commentBody,
|
||||
};
|
||||
const response = await axios.request(postAxiosOptions(url, payload));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.response.data);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
//update issue labels
|
||||
async function UpdateIssueLabels(githubConfig, incidentNumber, issueLabels, body) {
|
||||
if (githubConfig.owner === undefined || githubConfig.repo === undefined || GH_TOKEN === undefined) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;
|
||||
try {
|
||||
const payload = {
|
||||
labels: issueLabels,
|
||||
body: body,
|
||||
};
|
||||
const response = await axios.request(postAxiosOptions(url, payload));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.response.data);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
GetAllGHLabels,
|
||||
CreateGHLabel,
|
||||
GetIncidents,
|
||||
GetStartTimeFromBody,
|
||||
GetEndTimeFromBody,
|
||||
GetCommentsForIssue,
|
||||
Mapper,
|
||||
CreateIssue,
|
||||
AddComment,
|
||||
GetIncidentByNumber,
|
||||
UpdateIssueLabels,
|
||||
UpdateIssue,
|
||||
CloseIssue,
|
||||
};
|
||||
|
||||
+15
-5
@@ -7,11 +7,7 @@
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100%;
|
||||
height: 100svh;
|
||||
background: rgb(34, 193, 195);
|
||||
background: linear-gradient(177deg, rgba(255, 137, 131, 0.5) 0%, rgba(35, 136, 224, 0.05) 60%);
|
||||
/* background-size: 300% 300%; */
|
||||
/* clip-path: polygon(0 0, 100% 0, 100% 16%, 0% 100%); */
|
||||
/* animation: gradient-animation 30s ease infinite; */
|
||||
clip-path: polygon(0 0, 100% 0, 100% 54%, 0% 100%);
|
||||
}
|
||||
|
||||
@@ -207,4 +203,18 @@ section {
|
||||
background: url("https://www.frogment.com/images/grunge-underline.svg") no-repeat;
|
||||
background-size: contain;
|
||||
background-position: bottom;
|
||||
}
|
||||
}
|
||||
.sidebar-a.active{
|
||||
text-decoration: underline;
|
||||
}
|
||||
#markdown code:not([class^="language-"]) {
|
||||
background-color: #faf6b2;
|
||||
border-radius: 4px;
|
||||
padding: 2px 4px;
|
||||
font-size: 0.833em;
|
||||
color: #000;
|
||||
}
|
||||
.h1.inactive ~ .h2 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,9 @@
|
||||
<div class="scroll-m-20 text-2xl font-semibold tracking-tight">
|
||||
{#if monitor.image}
|
||||
<img src="{monitor.image}" class="w-6 h-6 inline" alt="" srcset="" />
|
||||
{/if} {monitor.name} {#if monitor.description}
|
||||
{/if}
|
||||
{monitor.name}
|
||||
{#if monitor.description}
|
||||
<HoverCard.Root>
|
||||
<HoverCard.Trigger>
|
||||
<svg
|
||||
@@ -78,7 +80,9 @@
|
||||
<path d="M12 8h.01" />
|
||||
</svg>
|
||||
</HoverCard.Trigger>
|
||||
<HoverCard.Content class="dark:invert"> {monitor.description} </HoverCard.Content>
|
||||
<HoverCard.Content class="dark:invert">
|
||||
{monitor.description}
|
||||
</HoverCard.Content>
|
||||
</HoverCard.Root>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -106,6 +110,16 @@
|
||||
<Card.Description>
|
||||
{moment(incident.created_at).format("MMMM Do YYYY, h:mm:ss a")}
|
||||
{@html incidentMessage}
|
||||
<p class="mt-2">
|
||||
{#if incident.labels.includes("identified")}
|
||||
<span class="bg-yellow-100 text-yellow-800 mt-1 text-sm font-medium me-2 px-2.5 py-0.5 rounded dark:bg-yellow-900 dark:text-yellow-300">Identified</span>
|
||||
{/if}
|
||||
{#if incident.labels.includes("resolved")}
|
||||
<span class="bg-green-100 text-green-800 text-sm font-medium me-2 px-2.5 py-0.5 rounded dark:bg-green-900 dark:text-green-300">Resolved</span>
|
||||
{/if}
|
||||
</p>
|
||||
|
||||
|
||||
</Card.Description>
|
||||
</Card.Header>
|
||||
{#if (variant.includes("body") || variant.includes("comments")) && state == "open"}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user