From 94877a056a0799a51eba9722c14cffa84b440fda Mon Sep 17 00:00:00 2001 From: Raj Nandan Sharma Date: Fri, 12 Apr 2024 09:38:41 +0530 Subject: [PATCH 1/3] feat(api): added an incident search api CHANGE: feature request in https://github.com/rajnandan1/kener/issues/64 --- package-lock.json | 4 +- package.json | 2 +- scripts/github.js | 39 ++++++++++++++ src/routes/api/incident/+server.js | 85 +++++++++++++++++++++++++++++- 4 files changed, 126 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5dab22f1..e0f0e6d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kener", - "version": "0.0.5", + "version": "0.0.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kener", - "version": "0.0.5", + "version": "0.0.10", "license": "MIT", "dependencies": { "axios": "^1.6.2", diff --git a/package.json b/package.json index 06228778..f931623d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kener", - "version": "0.0.10", + "version": "0.0.11", "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.", diff --git a/scripts/github.js b/scripts/github.js index 6bbec741..0c5389b4 100644 --- a/scripts/github.js +++ b/scripts/github.js @@ -341,6 +341,44 @@ async function UpdateIssueLabels(githubConfig, incidentNumber, issueLabels, body } } +//search issue +async function SearchIssue(query, page, per_page) { + if (GH_TOKEN === undefined) { + console.log(GhnotconfireguredMsg); + return null; + } + + const searchQuery = + query + .filter(function (q) { + if (q == "" || q === undefined || q === null) { + return false; + } + const qs = q.split(":"); + if (qs.length < 2) { + return false; + } + if (qs[1] === "" || qs[1] === undefined || qs[1] === null) { + return false; + } + return true; + }) + .join(" ") + + const url = `https://api.github.com/search/issues?q=${encodeURIComponent( + searchQuery + )}&per_page=${per_page}&page=${page}`; + + try { + const response = await axios.request(getAxiosOptions(url)); + return response.data; + } catch (error) { + console.log(error.response.data); + return null; + } +} + + export { GetAllGHLabels, CreateGHLabel, @@ -357,4 +395,5 @@ export { CloseIssue, GetOpenIncidents, FilterAndInsertMonitorInIncident, + SearchIssue, }; diff --git a/src/routes/api/incident/+server.js b/src/routes/api/incident/+server.js index 477759bf..266f19e5 100644 --- a/src/routes/api/incident/+server.js +++ b/src/routes/api/incident/+server.js @@ -2,7 +2,7 @@ // @ts-ignore import { json } from "@sveltejs/kit"; import { ParseIncidentPayload, auth, GHIssueToKenerIncident } from "$lib/server/webhook"; -import { CreateIssue } from "../../../../scripts/github"; +import { CreateIssue, SearchIssue } from "../../../../scripts/github"; import { env } from "$env/dynamic/public"; import fs from "fs-extra"; @@ -43,4 +43,87 @@ export async function POST({ request }) { return json(GHIssueToKenerIncident(resp), { status: 200, }); +} + +export async function GET({ request, url }) { + const authError = auth(request); + if (authError !== null) { + return json( + { error: authError.message }, + { + status: 401, + } + ); + } + + const query = url.searchParams; + + const state = query.get("state") || "open"; + const tags = query.get("tags") || ""; //comma separated list of tags + const page = query.get("page") || 1; + const per_page = query.get("per_page") || 10; + const createdAfter = query.get("created_after_utc") || ""; + const createdBefore = query.get("created_before_utc") || ""; + const titleLike = query.get("title_like") || ""; + + + + //if state is not open or closed, return 400 + if (state !== "open" && state !== "closed") { + return json( + { error: "state must be open or closed" }, + { + status: 400, + } + ); + } + let site = JSON.parse( + fs.readFileSync(env.PUBLIC_KENER_FOLDER + "/site.json", "utf8") + ); + let github = site.github; + const repo = `${github.owner}/${github.repo}`; + const is = "issue"; + + + const filterArray = [ + `repo:${repo}`, + `is:${is}`, + `state:${state}`, + `label:incident`, + `sort:created-desc`, + `label:${tags.split(",").map((tag) => tag.trim()).join(",")}` + + ]; + //if createdAfter and createdBefore are both set, use the range filter + if (createdBefore && createdAfter) { + let dateFilter = ""; + let iso = new Date(createdAfter * 1000).toISOString(); + dateFilter += `created:${iso}`; + iso = new Date(createdBefore * 1000).toISOString(); + dateFilter += `..${iso}`; + filterArray.push(dateFilter); + } else if(createdAfter){ //if only createdAfter is set, use the greater than or equal to filter + let iso = new Date(createdAfter * 1000).toISOString(); + filterArray.push(`created:>=${iso}`); + } else if(createdBefore){//if only createdBefore is set, use the less than or equal to filter + let iso = new Date(createdBefore * 1000).toISOString(); + filterArray.push(`created:<=${iso}`); + } + if(titleLike){ + filterArray.unshift(`${titleLike} in:title`); + } + + const resp = await SearchIssue(filterArray, page, per_page); + + const incidents = resp.items.map((issue) => GHIssueToKenerIncident(issue)); + + return json( + incidents, + { + status: 200, + } + ); + + + } \ No newline at end of file From 1078607805371adbff574e5e774532e399da1bf3 Mon Sep 17 00:00:00 2001 From: Raj Nandan Sharma Date: Fri, 12 Apr 2024 09:40:46 +0530 Subject: [PATCH 2/3] feat(api): added an incident search api CHANGE: feature request in https://github.com/rajnandan1/kener/issues/64 --- .okgit/branches.json | 1 + scripts/github.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 .okgit/branches.json diff --git a/.okgit/branches.json b/.okgit/branches.json new file mode 100644 index 00000000..e0628a2e --- /dev/null +++ b/.okgit/branches.json @@ -0,0 +1 @@ +{"release/0.0.11":[{"Type":"feat","Scope":"api","Summary":"added an incident search api","Details":"feature request in https://github.com/rajnandan1/kener/issues/64","BreakingChange":false,"BreakingMessage":"","Footer":""}]} \ No newline at end of file diff --git a/scripts/github.js b/scripts/github.js index 0c5389b4..4096772b 100644 --- a/scripts/github.js +++ b/scripts/github.js @@ -368,13 +368,13 @@ async function SearchIssue(query, page, per_page) { const url = `https://api.github.com/search/issues?q=${encodeURIComponent( searchQuery )}&per_page=${per_page}&page=${page}`; - + try { const response = await axios.request(getAxiosOptions(url)); return response.data; } catch (error) { console.log(error.response.data); - return null; + return []; } } From b166df13b0e17cfd2fe1409435fdc83e5b5ecdeb Mon Sep 17 00:00:00 2001 From: Raj Nandan Sharma Date: Fri, 12 Apr 2024 09:46:00 +0530 Subject: [PATCH 3/3] feat(api): added an incident search api CHANGE: feature request in https://github.com/rajnandan1/kener/issues/64 --- .gitignore | 1 + .okgit/branches.json | 1 - .../_app/immutable/chunks/paths.0183ef73.js | 1 - .../_app/immutable/chunks/paths.504696e9.js | 1 + ...ons.a5bf3c68.js => singletons.09f1db94.js} | 2 +- ...{stores.ba51b889.js => stores.b8369d52.js} | 2 +- .../{app.9590db44.js => app.36a8be43.js} | 2 +- .../{start.b7fe0db6.js => start.a758e6b1.js} | 2 +- .../nodes/{1.369b6ef7.js => 1.7cee7167.js} | 2 +- .../nodes/{3.5419bf7f.js => 3.5e894945.js} | 2 +- .../nodes/{5.dec378a2.js => 5.c348aae9.js} | 2 +- .../nodes/{7.11a20832.js => 7.18ad8054.js} | 2 +- build/client/_app/version.json | 2 +- .../chunks/{1-5200298c.js => 1-c2b013f6.js} | 4 +- .../{1-5200298c.js.map => 1-c2b013f6.js.map} | 2 +- .../chunks/{2-33c4e9d5.js => 2-3c89c25e.js} | 4 +- .../{2-33c4e9d5.js.map => 2-3c89c25e.js.map} | 2 +- .../chunks/{3-817f823c.js => 3-7822e551.js} | 6 +- .../{3-817f823c.js.map => 3-7822e551.js.map} | 2 +- .../chunks/{5-f1e9d0b4.js => 5-56fbbe77.js} | 4 +- .../{5-f1e9d0b4.js.map => 5-56fbbe77.js.map} | 2 +- .../chunks/{6-98296fd1.js => 6-862852f6.js} | 4 +- .../{6-98296fd1.js.map => 6-862852f6.js.map} | 2 +- .../chunks/{7-998fb83e.js => 7-2b6475c8.js} | 6 +- .../{7-998fb83e.js.map => 7-2b6475c8.js.map} | 2 +- ...server-63565456.js => _server-00acfba6.js} | 6 +- ...3565456.js.map => _server-00acfba6.js.map} | 2 +- ...server-7b4a554d.js => _server-1eceb496.js} | 6 +- ...b4a554d.js.map => _server-1eceb496.js.map} | 2 +- build/server/chunks/_server-26398a09.js | 49 -------- build/server/chunks/_server-26398a09.js.map | 1 - build/server/chunks/_server-4d31f7cf.js | 115 ++++++++++++++++++ build/server/chunks/_server-4d31f7cf.js.map | 1 + ...server-8c01e71b.js => _server-694895e5.js} | 6 +- ...c01e71b.js.map => _server-694895e5.js.map} | 2 +- ...server-cdb4368c.js => _server-9ca44fa7.js} | 4 +- ...db4368c.js.map => _server-9ca44fa7.js.map} | 2 +- ...server-5029a90c.js => _server-ae1296e5.js} | 6 +- ...029a90c.js.map => _server-ae1296e5.js.map} | 2 +- build/server/chunks/github-31d08953.js.map | 1 - ...{github-31d08953.js => github-c018834c.js} | 33 ++++- build/server/chunks/github-c018834c.js.map | 1 + ...ebhook-926b85d0.js => webhook-c20a13d6.js} | 4 +- ...26b85d0.js.map => webhook-c20a13d6.js.map} | 2 +- build/server/index.js | 2 +- build/server/index.js.map | 2 +- build/server/manifest.js | 28 ++--- build/server/manifest.js.map | 2 +- 48 files changed, 218 insertions(+), 123 deletions(-) delete mode 100644 .okgit/branches.json delete mode 100644 build/client/_app/immutable/chunks/paths.0183ef73.js create mode 100644 build/client/_app/immutable/chunks/paths.504696e9.js rename build/client/_app/immutable/chunks/{singletons.a5bf3c68.js => singletons.09f1db94.js} (97%) rename build/client/_app/immutable/chunks/{stores.ba51b889.js => stores.b8369d52.js} (73%) rename build/client/_app/immutable/entry/{app.9590db44.js => app.36a8be43.js} (89%) rename build/client/_app/immutable/entry/{start.b7fe0db6.js => start.a758e6b1.js} (99%) rename build/client/_app/immutable/nodes/{1.369b6ef7.js => 1.7cee7167.js} (92%) rename build/client/_app/immutable/nodes/{3.5419bf7f.js => 3.5e894945.js} (98%) rename build/client/_app/immutable/nodes/{5.dec378a2.js => 5.c348aae9.js} (98%) rename build/client/_app/immutable/nodes/{7.11a20832.js => 7.18ad8054.js} (99%) rename build/server/chunks/{1-5200298c.js => 1-c2b013f6.js} (51%) rename build/server/chunks/{1-5200298c.js.map => 1-c2b013f6.js.map} (67%) rename build/server/chunks/{2-33c4e9d5.js => 2-3c89c25e.js} (96%) rename build/server/chunks/{2-33c4e9d5.js.map => 2-3c89c25e.js.map} (98%) rename build/server/chunks/{3-817f823c.js => 3-7822e551.js} (88%) rename build/server/chunks/{3-817f823c.js.map => 3-7822e551.js.map} (94%) rename build/server/chunks/{5-f1e9d0b4.js => 5-56fbbe77.js} (88%) rename build/server/chunks/{5-f1e9d0b4.js.map => 5-56fbbe77.js.map} (91%) rename build/server/chunks/{6-98296fd1.js => 6-862852f6.js} (94%) rename build/server/chunks/{6-98296fd1.js.map => 6-862852f6.js.map} (98%) rename build/server/chunks/{7-998fb83e.js => 7-2b6475c8.js} (90%) rename build/server/chunks/{7-998fb83e.js.map => 7-2b6475c8.js.map} (93%) rename build/server/chunks/{_server-63565456.js => _server-00acfba6.js} (95%) rename build/server/chunks/{_server-63565456.js.map => _server-00acfba6.js.map} (98%) rename build/server/chunks/{_server-7b4a554d.js => _server-1eceb496.js} (95%) rename build/server/chunks/{_server-7b4a554d.js.map => _server-1eceb496.js.map} (98%) delete mode 100644 build/server/chunks/_server-26398a09.js delete mode 100644 build/server/chunks/_server-26398a09.js.map create mode 100644 build/server/chunks/_server-4d31f7cf.js create mode 100644 build/server/chunks/_server-4d31f7cf.js.map rename build/server/chunks/{_server-8c01e71b.js => _server-694895e5.js} (96%) rename build/server/chunks/{_server-8c01e71b.js.map => _server-694895e5.js.map} (98%) rename build/server/chunks/{_server-cdb4368c.js => _server-9ca44fa7.js} (87%) rename build/server/chunks/{_server-cdb4368c.js.map => _server-9ca44fa7.js.map} (96%) rename build/server/chunks/{_server-5029a90c.js => _server-ae1296e5.js} (91%) rename build/server/chunks/{_server-5029a90c.js.map => _server-ae1296e5.js.map} (97%) delete mode 100644 build/server/chunks/github-31d08953.js.map rename build/server/chunks/{github-31d08953.js => github-c018834c.js} (89%) create mode 100644 build/server/chunks/github-c018834c.js.map rename build/server/chunks/{webhook-926b85d0.js => webhook-c20a13d6.js} (99%) rename build/server/chunks/{webhook-926b85d0.js.map => webhook-c20a13d6.js.map} (99%) diff --git a/.gitignore b/.gitignore index 6cf8b474..faafdb2b 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ config/site.yaml vite.config.js.timestamp-* vite.config.ts.timestamp-* nodemon.json +.okgit/ \ No newline at end of file diff --git a/.okgit/branches.json b/.okgit/branches.json deleted file mode 100644 index e0628a2e..00000000 --- a/.okgit/branches.json +++ /dev/null @@ -1 +0,0 @@ -{"release/0.0.11":[{"Type":"feat","Scope":"api","Summary":"added an incident search api","Details":"feature request in https://github.com/rajnandan1/kener/issues/64","BreakingChange":false,"BreakingMessage":"","Footer":""}]} \ No newline at end of file diff --git a/build/client/_app/immutable/chunks/paths.0183ef73.js b/build/client/_app/immutable/chunks/paths.0183ef73.js deleted file mode 100644 index f4b9ff66..00000000 --- a/build/client/_app/immutable/chunks/paths.0183ef73.js +++ /dev/null @@ -1 +0,0 @@ -var s;const e=((s=globalThis.__sveltekit_2uw5wz)==null?void 0:s.base)??"";var a;const t=((a=globalThis.__sveltekit_2uw5wz)==null?void 0:a.assets)??e;export{t as a,e as b}; diff --git a/build/client/_app/immutable/chunks/paths.504696e9.js b/build/client/_app/immutable/chunks/paths.504696e9.js new file mode 100644 index 00000000..f548720e --- /dev/null +++ b/build/client/_app/immutable/chunks/paths.504696e9.js @@ -0,0 +1 @@ +var s;const e=((s=globalThis.__sveltekit_1uv9na3)==null?void 0:s.base)??"";var a;const t=((a=globalThis.__sveltekit_1uv9na3)==null?void 0:a.assets)??e;export{t as a,e as b}; diff --git a/build/client/_app/immutable/chunks/singletons.a5bf3c68.js b/build/client/_app/immutable/chunks/singletons.09f1db94.js similarity index 97% rename from build/client/_app/immutable/chunks/singletons.a5bf3c68.js rename to build/client/_app/immutable/chunks/singletons.09f1db94.js index b68f43d8..6bab25d9 100644 --- a/build/client/_app/immutable/chunks/singletons.a5bf3c68.js +++ b/build/client/_app/immutable/chunks/singletons.09f1db94.js @@ -1 +1 @@ -import{w as u}from"./index.97524e95.js";import{a as b}from"./paths.0183ef73.js";const v="1711082439422",A="sveltekit:snapshot",R="sveltekit:scroll",y="sveltekit:index",f={tap:1,hover:2,viewport:3,eager:4,off:-1},_=location.origin;function I(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function S(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function g(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function T(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=g(e)}}function x(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const s=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!s||k(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=(n==null?void 0:n.origin)===_&&e.hasAttribute("download");return{url:n,external:r,target:s,download:l}}function O(e){let t=null,n=null,s=null,r=null,l=null,o=null,a=e;for(;a&&a!==document.documentElement;)s===null&&(s=c(a,"preload-code")),r===null&&(r=c(a,"preload-data")),t===null&&(t=c(a,"keepfocus")),n===null&&(n=c(a,"noscroll")),l===null&&(l=c(a,"reload")),o===null&&(o=c(a,"replacestate")),a=g(a);function i(h){switch(h){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:d[s??"off"],preload_data:d[r??"off"],keep_focus:i(t),noscroll:i(n),reload:i(l),replace_state:i(o)}}function p(e){const t=u(e);let n=!0;function s(){n=!0,t.update(o=>o)}function r(o){n=!1,t.set(o)}function l(o){let a;return t.subscribe(i=>{(a===void 0||n&&i!==a)&&o(a=i)})}return{notify:s,set:r,subscribe:l}}function m(){const{set:e,subscribe:t}=u(!1);let n;async function s(){clearTimeout(n);try{const r=await fetch(`${b}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const o=(await r.json()).version!==v;return o&&(e(!0),clearTimeout(n)),o}catch{return!1}}return{subscribe:t,check:s}}function k(e,t){return e.origin!==_||!e.pathname.startsWith(t)}function U(e){e.client}const L={url:p({}),page:p({}),navigating:u(null),updated:m()};export{y as I,f as P,R as S,A as a,x as b,O as c,L as d,U as e,T as f,I as g,k as i,_ as o,S as s}; +import{w as u}from"./index.97524e95.js";import{a as b}from"./paths.504696e9.js";const v="1712895187809",A="sveltekit:snapshot",R="sveltekit:scroll",y="sveltekit:index",f={tap:1,hover:2,viewport:3,eager:4,off:-1},_=location.origin;function I(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function S(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function g(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function T(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=g(e)}}function x(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const s=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!s||k(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=(n==null?void 0:n.origin)===_&&e.hasAttribute("download");return{url:n,external:r,target:s,download:l}}function O(e){let t=null,n=null,s=null,r=null,l=null,o=null,a=e;for(;a&&a!==document.documentElement;)s===null&&(s=c(a,"preload-code")),r===null&&(r=c(a,"preload-data")),t===null&&(t=c(a,"keepfocus")),n===null&&(n=c(a,"noscroll")),l===null&&(l=c(a,"reload")),o===null&&(o=c(a,"replacestate")),a=g(a);function i(h){switch(h){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:d[s??"off"],preload_data:d[r??"off"],keep_focus:i(t),noscroll:i(n),reload:i(l),replace_state:i(o)}}function p(e){const t=u(e);let n=!0;function s(){n=!0,t.update(o=>o)}function r(o){n=!1,t.set(o)}function l(o){let a;return t.subscribe(i=>{(a===void 0||n&&i!==a)&&o(a=i)})}return{notify:s,set:r,subscribe:l}}function m(){const{set:e,subscribe:t}=u(!1);let n;async function s(){clearTimeout(n);try{const r=await fetch(`${b}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const o=(await r.json()).version!==v;return o&&(e(!0),clearTimeout(n)),o}catch{return!1}}return{subscribe:t,check:s}}function k(e,t){return e.origin!==_||!e.pathname.startsWith(t)}function U(e){e.client}const L={url:p({}),page:p({}),navigating:u(null),updated:m()};export{y as I,f as P,R as S,A as a,x as b,O as c,L as d,U as e,T as f,I as g,k as i,_ as o,S as s}; diff --git a/build/client/_app/immutable/chunks/stores.ba51b889.js b/build/client/_app/immutable/chunks/stores.b8369d52.js similarity index 73% rename from build/client/_app/immutable/chunks/stores.ba51b889.js rename to build/client/_app/immutable/chunks/stores.b8369d52.js index bc119e17..bfce1a3c 100644 --- a/build/client/_app/immutable/chunks/stores.ba51b889.js +++ b/build/client/_app/immutable/chunks/stores.b8369d52.js @@ -1 +1 @@ -import{d as e}from"./singletons.a5bf3c68.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p}; +import{d as e}from"./singletons.09f1db94.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p}; diff --git a/build/client/_app/immutable/entry/app.9590db44.js b/build/client/_app/immutable/entry/app.36a8be43.js similarity index 89% rename from build/client/_app/immutable/entry/app.9590db44.js rename to build/client/_app/immutable/entry/app.36a8be43.js index 0e881726..4082389a 100644 --- a/build/client/_app/immutable/entry/app.9590db44.js +++ b/build/client/_app/immutable/entry/app.36a8be43.js @@ -1 +1 @@ -import{s as q,a as B,e as p,c as U,i as b,d as h,b as j,o as W,f as z,g as F,h as G,j as D,k as m,l as H,m as J,n as K,t as M,p as I,q as k}from"../chunks/scheduler.8852886c.js";import{S as Q,i as X,t as g,c as L,a as w,g as P,b as v,d as O,m as R,e as y}from"../chunks/index.fb8f3617.js";const Y="modulepreload",Z=function(o,e){return new URL(o,e).href},T={},d=function(e,n,i){if(!n||n.length===0)return e();const r=document.getElementsByTagName("link");return Promise.all(n.map(f=>{if(f=Z(f,i),f in T)return;T[f]=!0;const t=f.endsWith(".css"),s=t?'[rel="stylesheet"]':"";if(!!i)for(let a=r.length-1;a>=0;a--){const u=r[a];if(u.href===f&&(!t||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${s}`))return;const c=document.createElement("link");if(c.rel=t?"stylesheet":Y,t||(c.as="script",c.crossOrigin=""),c.href=f,document.head.appendChild(c),t)return new Promise((a,u)=>{c.addEventListener("load",a),c.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${f}`)))})})).then(()=>e()).catch(f=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=f,window.dispatchEvent(t),!t.defaultPrevented)throw f})},se={};function $(o){let e,n,i;var r=o[1][0];function f(t,s){return{props:{data:t[3],form:t[2]}}}return r&&(e=k(r,f(o)),o[12](e)),{c(){e&&v(e.$$.fragment),n=p()},l(t){e&&O(e.$$.fragment,t),n=p()},m(t,s){e&&R(e,t,s),b(t,n,s),i=!0},p(t,s){if(s&2&&r!==(r=t[1][0])){if(e){P();const l=e;g(l.$$.fragment,1,0,()=>{y(l,1)}),L()}r?(e=k(r,f(t)),t[12](e),v(e.$$.fragment),w(e.$$.fragment,1),R(e,n.parentNode,n)):e=null}else if(r){const l={};s&8&&(l.data=t[3]),s&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&g(e.$$.fragment,t),i=!1},d(t){t&&h(n),o[12](null),e&&y(e,t)}}}function x(o){let e,n,i;var r=o[1][0];function f(t,s){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return r&&(e=k(r,f(o)),o[11](e)),{c(){e&&v(e.$$.fragment),n=p()},l(t){e&&O(e.$$.fragment,t),n=p()},m(t,s){e&&R(e,t,s),b(t,n,s),i=!0},p(t,s){if(s&2&&r!==(r=t[1][0])){if(e){P();const l=e;g(l.$$.fragment,1,0,()=>{y(l,1)}),L()}r?(e=k(r,f(t)),t[11](e),v(e.$$.fragment),w(e.$$.fragment,1),R(e,n.parentNode,n)):e=null}else if(r){const l={};s&8&&(l.data=t[3]),s&8215&&(l.$$scope={dirty:s,ctx:t}),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&g(e.$$.fragment,t),i=!1},d(t){t&&h(n),o[11](null),e&&y(e,t)}}}function ee(o){let e,n,i;var r=o[1][1];function f(t,s){return{props:{data:t[4],form:t[2]}}}return r&&(e=k(r,f(o)),o[10](e)),{c(){e&&v(e.$$.fragment),n=p()},l(t){e&&O(e.$$.fragment,t),n=p()},m(t,s){e&&R(e,t,s),b(t,n,s),i=!0},p(t,s){if(s&2&&r!==(r=t[1][1])){if(e){P();const l=e;g(l.$$.fragment,1,0,()=>{y(l,1)}),L()}r?(e=k(r,f(t)),t[10](e),v(e.$$.fragment),w(e.$$.fragment,1),R(e,n.parentNode,n)):e=null}else if(r){const l={};s&16&&(l.data=t[4]),s&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&g(e.$$.fragment,t),i=!1},d(t){t&&h(n),o[10](null),e&&y(e,t)}}}function V(o){let e,n=o[6]&&A(o);return{c(){e=z("div"),n&&n.c(),this.h()},l(i){e=F(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var r=G(e);n&&n.l(r),r.forEach(h),this.h()},h(){D(e,"id","svelte-announcer"),D(e,"aria-live","assertive"),D(e,"aria-atomic","true"),m(e,"position","absolute"),m(e,"left","0"),m(e,"top","0"),m(e,"clip","rect(0 0 0 0)"),m(e,"clip-path","inset(50%)"),m(e,"overflow","hidden"),m(e,"white-space","nowrap"),m(e,"width","1px"),m(e,"height","1px")},m(i,r){b(i,e,r),n&&n.m(e,null)},p(i,r){i[6]?n?n.p(i,r):(n=A(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&h(e),n&&n.d()}}}function A(o){let e;return{c(){e=H(o[7])},l(n){e=J(n,o[7])},m(n,i){b(n,e,i)},p(n,i){i&128&&K(e,n[7])},d(n){n&&h(e)}}}function te(o){let e,n,i,r,f;const t=[x,$],s=[];function l(a,u){return a[1][1]?0:1}e=l(o),n=s[e]=t[e](o);let c=o[5]&&V(o);return{c(){n.c(),i=B(),c&&c.c(),r=p()},l(a){n.l(a),i=U(a),c&&c.l(a),r=p()},m(a,u){s[e].m(a,u),b(a,i,u),c&&c.m(a,u),b(a,r,u),f=!0},p(a,[u]){let E=e;e=l(a),e===E?s[e].p(a,u):(P(),g(s[E],1,1,()=>{s[E]=null}),L(),n=s[e],n?n.p(a,u):(n=s[e]=t[e](a),n.c()),w(n,1),n.m(i.parentNode,i)),a[5]?c?c.p(a,u):(c=V(a),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},i(a){f||(w(n),f=!0)},o(a){g(n),f=!1},d(a){a&&(h(i),h(r)),s[e].d(a),c&&c.d(a)}}}function ne(o,e,n){let{stores:i}=e,{page:r}=e,{constructors:f}=e,{components:t=[]}=e,{form:s}=e,{data_0:l=null}=e,{data_1:c=null}=e;j(i.page.notify);let a=!1,u=!1,E=null;W(()=>{const _=i.page.subscribe(()=>{a&&(n(6,u=!0),M().then(()=>{n(7,E=document.title||"untitled page")}))});return n(5,a=!0),_});function N(_){I[_?"unshift":"push"](()=>{t[1]=_,n(0,t)})}function S(_){I[_?"unshift":"push"](()=>{t[0]=_,n(0,t)})}function C(_){I[_?"unshift":"push"](()=>{t[0]=_,n(0,t)})}return o.$$set=_=>{"stores"in _&&n(8,i=_.stores),"page"in _&&n(9,r=_.page),"constructors"in _&&n(1,f=_.constructors),"components"in _&&n(0,t=_.components),"form"in _&&n(2,s=_.form),"data_0"in _&&n(3,l=_.data_0),"data_1"in _&&n(4,c=_.data_1)},o.$$.update=()=>{o.$$.dirty&768&&i.page.set(r)},[t,f,s,l,c,a,u,E,i,r,N,S,C]}class oe extends Q{constructor(e){super(),X(this,e,ne,te,q,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ae=[()=>d(()=>import("../nodes/0.762daf68.js"),["../nodes/0.762daf68.js","../chunks/scheduler.8852886c.js","../chunks/index.fb8f3617.js","../chunks/globals.7f7f1b26.js","../chunks/ctx.1e61a5a6.js","../chunks/index.97524e95.js","../chunks/index.cd89ef46.js","../assets/0.1c2a189f.css"],import.meta.url),()=>d(()=>import("../nodes/1.369b6ef7.js"),["../nodes/1.369b6ef7.js","../chunks/scheduler.8852886c.js","../chunks/index.fb8f3617.js","../chunks/stores.ba51b889.js","../chunks/singletons.a5bf3c68.js","../chunks/index.97524e95.js","../chunks/paths.0183ef73.js"],import.meta.url),()=>d(()=>import("../nodes/2.6a901bcb.js"),["../nodes/2.6a901bcb.js","../chunks/scheduler.8852886c.js","../chunks/index.fb8f3617.js","../chunks/ctx.1e61a5a6.js","../chunks/index.97524e95.js","../chunks/monitor.b8d7520d.js","../chunks/axios.baaa6432.js","../chunks/Icon.7b7db889.js","../chunks/index.cd89ef46.js","../chunks/events.b4751e74.js","../assets/monitor.13f869bc.css","../chunks/incident.fe542872.js","../chunks/chevron-down.f8b4fb7d.js","../assets/incident.d0acbf00.css"],import.meta.url),()=>d(()=>import("../nodes/3.5419bf7f.js"),["../nodes/3.5419bf7f.js","../chunks/scheduler.8852886c.js","../chunks/index.fb8f3617.js","../chunks/ctx.1e61a5a6.js","../chunks/index.97524e95.js","../chunks/monitor.b8d7520d.js","../chunks/axios.baaa6432.js","../chunks/Icon.7b7db889.js","../chunks/index.cd89ef46.js","../chunks/events.b4751e74.js","../assets/monitor.13f869bc.css","../chunks/incident.fe542872.js","../chunks/chevron-down.f8b4fb7d.js","../assets/incident.d0acbf00.css","../chunks/stores.ba51b889.js","../chunks/singletons.a5bf3c68.js","../chunks/paths.0183ef73.js"],import.meta.url),()=>d(()=>import("../nodes/4.67b330c5.js"),["../nodes/4.67b330c5.js","../chunks/scheduler.8852886c.js","../chunks/index.fb8f3617.js","../chunks/globals.7f7f1b26.js","../chunks/ctx.1e61a5a6.js","../chunks/index.97524e95.js","../chunks/Icon.7b7db889.js","../chunks/events.b4751e74.js","../chunks/chevron-down.f8b4fb7d.js"],import.meta.url),()=>d(()=>import("../nodes/5.dec378a2.js"),["../nodes/5.dec378a2.js","../chunks/scheduler.8852886c.js","../chunks/index.fb8f3617.js","../chunks/ctx.1e61a5a6.js","../chunks/index.97524e95.js","../chunks/monitor.b8d7520d.js","../chunks/axios.baaa6432.js","../chunks/Icon.7b7db889.js","../chunks/index.cd89ef46.js","../chunks/events.b4751e74.js","../assets/monitor.13f869bc.css","../chunks/stores.ba51b889.js","../chunks/singletons.a5bf3c68.js","../chunks/paths.0183ef73.js"],import.meta.url),()=>d(()=>import("../nodes/6.b99c92be.js"),["../nodes/6.b99c92be.js","../chunks/scheduler.8852886c.js","../chunks/index.fb8f3617.js","../chunks/ctx.1e61a5a6.js","../chunks/index.97524e95.js","../chunks/incident.fe542872.js","../chunks/Icon.7b7db889.js","../chunks/index.cd89ef46.js","../chunks/axios.baaa6432.js","../chunks/chevron-down.f8b4fb7d.js","../assets/incident.d0acbf00.css"],import.meta.url),()=>d(()=>import("../nodes/7.11a20832.js"),["../nodes/7.11a20832.js","../chunks/scheduler.8852886c.js","../chunks/index.fb8f3617.js","../chunks/ctx.1e61a5a6.js","../chunks/index.97524e95.js","../chunks/monitor.b8d7520d.js","../chunks/axios.baaa6432.js","../chunks/Icon.7b7db889.js","../chunks/index.cd89ef46.js","../chunks/events.b4751e74.js","../assets/monitor.13f869bc.css","../chunks/incident.fe542872.js","../chunks/chevron-down.f8b4fb7d.js","../assets/incident.d0acbf00.css","../chunks/paths.0183ef73.js"],import.meta.url)],le=[0],fe={"/":[-3],"/category-[category]":[-4],"/docs":[-5],"/embed-[tag]":[-6],"/incident/[id]":[-7],"/monitor-[tag]":[-8]},ce={handleError:({error:o})=>{console.error(o)}};export{fe as dictionary,ce as hooks,se as matchers,ae as nodes,oe as root,le as server_loads}; +import{s as q,a as B,e as p,c as U,i as b,d as h,b as j,o as W,f as z,g as F,h as G,j as D,k as m,l as H,m as J,n as K,t as M,p as I,q as k}from"../chunks/scheduler.8852886c.js";import{S as Q,i as X,t as g,c as L,a as w,g as P,b as v,d as O,m as R,e as y}from"../chunks/index.fb8f3617.js";const Y="modulepreload",Z=function(o,e){return new URL(o,e).href},T={},d=function(e,n,i){if(!n||n.length===0)return e();const r=document.getElementsByTagName("link");return Promise.all(n.map(f=>{if(f=Z(f,i),f in T)return;T[f]=!0;const t=f.endsWith(".css"),s=t?'[rel="stylesheet"]':"";if(!!i)for(let a=r.length-1;a>=0;a--){const u=r[a];if(u.href===f&&(!t||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${s}`))return;const c=document.createElement("link");if(c.rel=t?"stylesheet":Y,t||(c.as="script",c.crossOrigin=""),c.href=f,document.head.appendChild(c),t)return new Promise((a,u)=>{c.addEventListener("load",a),c.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${f}`)))})})).then(()=>e()).catch(f=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=f,window.dispatchEvent(t),!t.defaultPrevented)throw f})},se={};function $(o){let e,n,i;var r=o[1][0];function f(t,s){return{props:{data:t[3],form:t[2]}}}return r&&(e=k(r,f(o)),o[12](e)),{c(){e&&v(e.$$.fragment),n=p()},l(t){e&&O(e.$$.fragment,t),n=p()},m(t,s){e&&R(e,t,s),b(t,n,s),i=!0},p(t,s){if(s&2&&r!==(r=t[1][0])){if(e){P();const l=e;g(l.$$.fragment,1,0,()=>{y(l,1)}),L()}r?(e=k(r,f(t)),t[12](e),v(e.$$.fragment),w(e.$$.fragment,1),R(e,n.parentNode,n)):e=null}else if(r){const l={};s&8&&(l.data=t[3]),s&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&g(e.$$.fragment,t),i=!1},d(t){t&&h(n),o[12](null),e&&y(e,t)}}}function x(o){let e,n,i;var r=o[1][0];function f(t,s){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return r&&(e=k(r,f(o)),o[11](e)),{c(){e&&v(e.$$.fragment),n=p()},l(t){e&&O(e.$$.fragment,t),n=p()},m(t,s){e&&R(e,t,s),b(t,n,s),i=!0},p(t,s){if(s&2&&r!==(r=t[1][0])){if(e){P();const l=e;g(l.$$.fragment,1,0,()=>{y(l,1)}),L()}r?(e=k(r,f(t)),t[11](e),v(e.$$.fragment),w(e.$$.fragment,1),R(e,n.parentNode,n)):e=null}else if(r){const l={};s&8&&(l.data=t[3]),s&8215&&(l.$$scope={dirty:s,ctx:t}),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&g(e.$$.fragment,t),i=!1},d(t){t&&h(n),o[11](null),e&&y(e,t)}}}function ee(o){let e,n,i;var r=o[1][1];function f(t,s){return{props:{data:t[4],form:t[2]}}}return r&&(e=k(r,f(o)),o[10](e)),{c(){e&&v(e.$$.fragment),n=p()},l(t){e&&O(e.$$.fragment,t),n=p()},m(t,s){e&&R(e,t,s),b(t,n,s),i=!0},p(t,s){if(s&2&&r!==(r=t[1][1])){if(e){P();const l=e;g(l.$$.fragment,1,0,()=>{y(l,1)}),L()}r?(e=k(r,f(t)),t[10](e),v(e.$$.fragment),w(e.$$.fragment,1),R(e,n.parentNode,n)):e=null}else if(r){const l={};s&16&&(l.data=t[4]),s&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&g(e.$$.fragment,t),i=!1},d(t){t&&h(n),o[10](null),e&&y(e,t)}}}function V(o){let e,n=o[6]&&A(o);return{c(){e=z("div"),n&&n.c(),this.h()},l(i){e=F(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var r=G(e);n&&n.l(r),r.forEach(h),this.h()},h(){D(e,"id","svelte-announcer"),D(e,"aria-live","assertive"),D(e,"aria-atomic","true"),m(e,"position","absolute"),m(e,"left","0"),m(e,"top","0"),m(e,"clip","rect(0 0 0 0)"),m(e,"clip-path","inset(50%)"),m(e,"overflow","hidden"),m(e,"white-space","nowrap"),m(e,"width","1px"),m(e,"height","1px")},m(i,r){b(i,e,r),n&&n.m(e,null)},p(i,r){i[6]?n?n.p(i,r):(n=A(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&h(e),n&&n.d()}}}function A(o){let e;return{c(){e=H(o[7])},l(n){e=J(n,o[7])},m(n,i){b(n,e,i)},p(n,i){i&128&&K(e,n[7])},d(n){n&&h(e)}}}function te(o){let e,n,i,r,f;const t=[x,$],s=[];function l(a,u){return a[1][1]?0:1}e=l(o),n=s[e]=t[e](o);let c=o[5]&&V(o);return{c(){n.c(),i=B(),c&&c.c(),r=p()},l(a){n.l(a),i=U(a),c&&c.l(a),r=p()},m(a,u){s[e].m(a,u),b(a,i,u),c&&c.m(a,u),b(a,r,u),f=!0},p(a,[u]){let E=e;e=l(a),e===E?s[e].p(a,u):(P(),g(s[E],1,1,()=>{s[E]=null}),L(),n=s[e],n?n.p(a,u):(n=s[e]=t[e](a),n.c()),w(n,1),n.m(i.parentNode,i)),a[5]?c?c.p(a,u):(c=V(a),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},i(a){f||(w(n),f=!0)},o(a){g(n),f=!1},d(a){a&&(h(i),h(r)),s[e].d(a),c&&c.d(a)}}}function ne(o,e,n){let{stores:i}=e,{page:r}=e,{constructors:f}=e,{components:t=[]}=e,{form:s}=e,{data_0:l=null}=e,{data_1:c=null}=e;j(i.page.notify);let a=!1,u=!1,E=null;W(()=>{const _=i.page.subscribe(()=>{a&&(n(6,u=!0),M().then(()=>{n(7,E=document.title||"untitled page")}))});return n(5,a=!0),_});function N(_){I[_?"unshift":"push"](()=>{t[1]=_,n(0,t)})}function S(_){I[_?"unshift":"push"](()=>{t[0]=_,n(0,t)})}function C(_){I[_?"unshift":"push"](()=>{t[0]=_,n(0,t)})}return o.$$set=_=>{"stores"in _&&n(8,i=_.stores),"page"in _&&n(9,r=_.page),"constructors"in _&&n(1,f=_.constructors),"components"in _&&n(0,t=_.components),"form"in _&&n(2,s=_.form),"data_0"in _&&n(3,l=_.data_0),"data_1"in _&&n(4,c=_.data_1)},o.$$.update=()=>{o.$$.dirty&768&&i.page.set(r)},[t,f,s,l,c,a,u,E,i,r,N,S,C]}class oe extends Q{constructor(e){super(),X(this,e,ne,te,q,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ae=[()=>d(()=>import("../nodes/0.762daf68.js"),["../nodes/0.762daf68.js","../chunks/scheduler.8852886c.js","../chunks/index.fb8f3617.js","../chunks/globals.7f7f1b26.js","../chunks/ctx.1e61a5a6.js","../chunks/index.97524e95.js","../chunks/index.cd89ef46.js","../assets/0.1c2a189f.css"],import.meta.url),()=>d(()=>import("../nodes/1.7cee7167.js"),["../nodes/1.7cee7167.js","../chunks/scheduler.8852886c.js","../chunks/index.fb8f3617.js","../chunks/stores.b8369d52.js","../chunks/singletons.09f1db94.js","../chunks/index.97524e95.js","../chunks/paths.504696e9.js"],import.meta.url),()=>d(()=>import("../nodes/2.6a901bcb.js"),["../nodes/2.6a901bcb.js","../chunks/scheduler.8852886c.js","../chunks/index.fb8f3617.js","../chunks/ctx.1e61a5a6.js","../chunks/index.97524e95.js","../chunks/monitor.b8d7520d.js","../chunks/axios.baaa6432.js","../chunks/Icon.7b7db889.js","../chunks/index.cd89ef46.js","../chunks/events.b4751e74.js","../assets/monitor.13f869bc.css","../chunks/incident.fe542872.js","../chunks/chevron-down.f8b4fb7d.js","../assets/incident.d0acbf00.css"],import.meta.url),()=>d(()=>import("../nodes/3.5e894945.js"),["../nodes/3.5e894945.js","../chunks/scheduler.8852886c.js","../chunks/index.fb8f3617.js","../chunks/ctx.1e61a5a6.js","../chunks/index.97524e95.js","../chunks/monitor.b8d7520d.js","../chunks/axios.baaa6432.js","../chunks/Icon.7b7db889.js","../chunks/index.cd89ef46.js","../chunks/events.b4751e74.js","../assets/monitor.13f869bc.css","../chunks/incident.fe542872.js","../chunks/chevron-down.f8b4fb7d.js","../assets/incident.d0acbf00.css","../chunks/stores.b8369d52.js","../chunks/singletons.09f1db94.js","../chunks/paths.504696e9.js"],import.meta.url),()=>d(()=>import("../nodes/4.67b330c5.js"),["../nodes/4.67b330c5.js","../chunks/scheduler.8852886c.js","../chunks/index.fb8f3617.js","../chunks/globals.7f7f1b26.js","../chunks/ctx.1e61a5a6.js","../chunks/index.97524e95.js","../chunks/Icon.7b7db889.js","../chunks/events.b4751e74.js","../chunks/chevron-down.f8b4fb7d.js"],import.meta.url),()=>d(()=>import("../nodes/5.c348aae9.js"),["../nodes/5.c348aae9.js","../chunks/scheduler.8852886c.js","../chunks/index.fb8f3617.js","../chunks/ctx.1e61a5a6.js","../chunks/index.97524e95.js","../chunks/monitor.b8d7520d.js","../chunks/axios.baaa6432.js","../chunks/Icon.7b7db889.js","../chunks/index.cd89ef46.js","../chunks/events.b4751e74.js","../assets/monitor.13f869bc.css","../chunks/stores.b8369d52.js","../chunks/singletons.09f1db94.js","../chunks/paths.504696e9.js"],import.meta.url),()=>d(()=>import("../nodes/6.b99c92be.js"),["../nodes/6.b99c92be.js","../chunks/scheduler.8852886c.js","../chunks/index.fb8f3617.js","../chunks/ctx.1e61a5a6.js","../chunks/index.97524e95.js","../chunks/incident.fe542872.js","../chunks/Icon.7b7db889.js","../chunks/index.cd89ef46.js","../chunks/axios.baaa6432.js","../chunks/chevron-down.f8b4fb7d.js","../assets/incident.d0acbf00.css"],import.meta.url),()=>d(()=>import("../nodes/7.18ad8054.js"),["../nodes/7.18ad8054.js","../chunks/scheduler.8852886c.js","../chunks/index.fb8f3617.js","../chunks/ctx.1e61a5a6.js","../chunks/index.97524e95.js","../chunks/monitor.b8d7520d.js","../chunks/axios.baaa6432.js","../chunks/Icon.7b7db889.js","../chunks/index.cd89ef46.js","../chunks/events.b4751e74.js","../assets/monitor.13f869bc.css","../chunks/incident.fe542872.js","../chunks/chevron-down.f8b4fb7d.js","../assets/incident.d0acbf00.css","../chunks/paths.504696e9.js"],import.meta.url)],le=[0],fe={"/":[-3],"/category-[category]":[-4],"/docs":[-5],"/embed-[tag]":[-6],"/incident/[id]":[-7],"/monitor-[tag]":[-8]},ce={handleError:({error:o})=>{console.error(o)}};export{fe as dictionary,ce as hooks,se as matchers,ae as nodes,oe as root,le as server_loads}; diff --git a/build/client/_app/immutable/entry/start.b7fe0db6.js b/build/client/_app/immutable/entry/start.a758e6b1.js similarity index 99% rename from build/client/_app/immutable/entry/start.b7fe0db6.js rename to build/client/_app/immutable/entry/start.a758e6b1.js index f41e74e2..f6c224a7 100644 --- a/build/client/_app/immutable/entry/start.b7fe0db6.js +++ b/build/client/_app/immutable/entry/start.a758e6b1.js @@ -1,3 +1,3 @@ -import{o as me,t as we}from"../chunks/scheduler.8852886c.js";import{S as Ge,a as Je,I as V,g as De,f as Ce,b as _e,c as le,s as te,i as ye,d as H,o as Me,P as Ve,e as Ze}from"../chunks/singletons.a5bf3c68.js";import{b as G}from"../chunks/paths.0183ef73.js";function Qe(t,r){return t==="/"||r==="ignore"?t:r==="never"?t.endsWith("/")?t.slice(0,-1):t:r==="always"&&!t.endsWith("/")?t+"/":t}function et(t){return t.split("%25").map(decodeURI).join("%25")}function tt(t){for(const r in t)t[r]=decodeURIComponent(t[r]);return t}const nt=["href","pathname","search","searchParams","toString","toJSON"];function at(t,r){const f=new URL(t);for(const i of nt)Object.defineProperty(f,i,{get(){return r(),t[i]},enumerable:!0,configurable:!0});return rt(f),f}function rt(t){Object.defineProperty(t,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const ot="/__data.json";function it(t){return t.replace(/\/$/,"")+ot}function st(...t){let r=5381;for(const f of t)if(typeof f=="string"){let i=f.length;for(;i;)r=r*33^f.charCodeAt(--i)}else if(ArrayBuffer.isView(f)){const i=new Uint8Array(f.buffer,f.byteOffset,f.byteLength);let h=i.length;for(;h;)r=r*33^i[--h]}else throw new TypeError("value must be a string or TypedArray");return(r>>>0).toString(36)}const Ke=window.fetch;window.fetch=(t,r)=>((t instanceof Request?t.method:(r==null?void 0:r.method)||"GET")!=="GET"&&ae.delete(Se(t)),Ke(t,r));const ae=new Map;function ct(t,r){const f=Se(t,r),i=document.querySelector(f);if(i!=null&&i.textContent){const{body:h,...u}=JSON.parse(i.textContent),E=i.getAttribute("data-ttl");return E&&ae.set(f,{body:h,init:u,ttl:1e3*Number(E)}),Promise.resolve(new Response(h,u))}return window.fetch(t,r)}function lt(t,r,f){if(ae.size>0){const i=Se(t,f),h=ae.get(i);if(h){if(performance.now(){const h=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(i);if(h)return r.push({name:h[1],matcher:h[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const u=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(i);if(u)return r.push({name:u[1],matcher:u[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!i)return;const E=i.split(/\[(.+?)\](?!\])/);return"/"+E.map((g,m)=>{if(m%2){if(g.startsWith("x+"))return ve(String.fromCharCode(parseInt(g.slice(2),16)));if(g.startsWith("u+"))return ve(String.fromCharCode(...g.slice(2).split("-").map(U=>parseInt(U,16))));const d=ft.exec(g);if(!d)throw new Error(`Invalid param: ${g}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,j,T,R,C]=d;return r.push({name:R,matcher:C,optional:!!j,rest:!!T,chained:T?m===1&&E[0]==="":!1}),T?"(.*?)":j?"([^/]*)?":"([^/]+?)"}return ve(g)}).join("")}).join("")}/?$`),params:r}}function dt(t){return!/^\([^)]+\)$/.test(t)}function pt(t){return t.slice(1).split("/").filter(dt)}function ht(t,r,f){const i={},h=t.slice(1),u=h.filter(l=>l!==void 0);let E=0;for(let l=0;ld).join("/"),E=0),m===void 0){g.rest&&(i[g.name]="");continue}if(!g.matcher||f[g.matcher](m)){i[g.name]=m;const d=r[l+1],j=h[l+1];d&&!d.rest&&d.optional&&j&&g.chained&&(E=0),!d&&!j&&Object.keys(i).length===u.length&&(E=0);continue}if(g.optional&&g.chained){E++;continue}return}if(!E)return i}function ve(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function gt({nodes:t,server_loads:r,dictionary:f,matchers:i}){const h=new Set(r);return Object.entries(f).map(([l,[g,m,d]])=>{const{pattern:j,params:T}=ut(l),R={id:l,exec:C=>{const U=j.exec(C);if(U)return ht(U,T,i)},errors:[1,...d||[]].map(C=>t[C]),layouts:[0,...m||[]].map(E),leaf:u(g)};return R.errors.length=R.layouts.length=Math.max(R.errors.length,R.layouts.length),R});function u(l){const g=l<0;return g&&(l=~l),[g,t[l]]}function E(l){return l===void 0?l:[h.has(l),t[l]]}}function ze(t){try{return JSON.parse(sessionStorage[t])}catch{}}function qe(t,r){const f=JSON.stringify(r);try{sessionStorage[t]=f}catch{}}const mt=-1,wt=-2,_t=-3,yt=-4,vt=-5,bt=-6;function Et(t,r){if(typeof t=="number")return h(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const f=t,i=Array(f.length);function h(u,E=!1){if(u===mt)return;if(u===_t)return NaN;if(u===yt)return 1/0;if(u===vt)return-1/0;if(u===bt)return-0;if(E)throw new Error("Invalid input");if(u in i)return i[u];const l=f[u];if(!l||typeof l!="object")i[u]=l;else if(Array.isArray(l))if(typeof l[0]=="string"){const g=l[0],m=r==null?void 0:r[g];if(m)return i[u]=m(h(l[1]));switch(g){case"Date":i[u]=new Date(l[1]);break;case"Set":const d=new Set;i[u]=d;for(let R=1;Rr!=null)}const We=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...We];const kt=new Set([...We]);[...kt];async function Rt(t){var r;for(const f in t)if(typeof((r=t[f])==null?void 0:r.then)=="function")return Object.fromEntries(await Promise.all(Object.entries(t).map(async([i,h])=>[i,await h])));return t}class ne{constructor(r,f){this.status=r,typeof f=="string"?this.body={message:f}:f?this.body=f:this.body={message:`Error: ${r}`}}toString(){return JSON.stringify(this.body)}}class Fe{constructor(r,f){this.status=r,this.location=f}}const At="x-sveltekit-invalidated",It="x-sveltekit-trailing-slash",J=ze(Ge)??{},ee=ze(Je)??{};function be(t){J[t]=te()}function K(t){return location.href=t.href,new Promise(()=>{})}function Lt(t,r){var Ne;const f=gt(t),i=t.nodes[0],h=t.nodes[1];i(),h();const u=document.documentElement,E=[],l=[];let g=null;const m={before_navigate:[],on_navigate:[],after_navigate:[]};let d={branch:[],error:null,url:null},j=!1,T=!1,R=!0,C=!1,U=!1,D=!1,z=!1,q,x=(Ne=history.state)==null?void 0:Ne[V];x||(x=Date.now(),history.replaceState({...history.state,[V]:x},"",location.href));const fe=J[x];fe&&(history.scrollRestoration="manual",scrollTo(fe.x,fe.y));let F,W,Y;async function ke(){if(Y=Y||Promise.resolve(),await Y,!Y)return;Y=null;const e=new URL(location.href),s=Z(e,!0);g=null;const n=W={},o=s&&await pe(s);if(n===W&&o){if(o.type==="redirect")return re(new URL(o.location,e).href,{},1,n);o.props.page!==void 0&&(F=o.props.page),q.$set(o.props)}}function Re(e){l.some(s=>s==null?void 0:s.snapshot)&&(ee[e]=l.map(s=>{var n;return(n=s==null?void 0:s.snapshot)==null?void 0:n.capture()}))}function Ae(e){var s;(s=ee[e])==null||s.forEach((n,o)=>{var a,c;(c=(a=l[o])==null?void 0:a.snapshot)==null||c.restore(n)})}function Ie(){be(x),qe(Ge,J),Re(x),qe(Je,ee)}async function re(e,{noScroll:s=!1,replaceState:n=!1,keepFocus:o=!1,state:a={},invalidateAll:c=!1},p,v){return typeof e=="string"&&(e=new URL(e,De(document))),ce({url:e,scroll:s?te():null,keepfocus:o,redirect_count:p,details:{state:a,replaceState:n},nav_token:v,accepted:()=>{c&&(z=!0)},blocked:()=>{},type:"goto"})}async function Le(e){return g={id:e.id,promise:pe(e).then(s=>(s.type==="loaded"&&s.state.error&&(g=null),s))},g.promise}async function oe(...e){const n=f.filter(o=>e.some(a=>o.exec(a))).map(o=>Promise.all([...o.layouts,o.leaf].map(a=>a==null?void 0:a[1]())));await Promise.all(n)}function Pe(e){var o;d=e.state;const s=document.querySelector("style[data-sveltekit]");s&&s.remove(),F=e.props.page,q=new t.root({target:r,props:{...e.props,stores:H,components:l},hydrate:!0}),Ae(x);const n={from:null,to:{params:d.params,route:{id:((o=d.route)==null?void 0:o.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};m.after_navigate.forEach(a=>a(n)),T=!0}async function X({url:e,params:s,branch:n,status:o,error:a,route:c,form:p}){let v="never";for(const _ of n)(_==null?void 0:_.slash)!==void 0&&(v=_.slash);e.pathname=Qe(e.pathname,v),e.search=e.search;const b={type:"loaded",state:{url:e,params:s,branch:n,error:a,route:c},props:{constructors:St(n).map(_=>_.node.component)}};p!==void 0&&(b.props.form=p);let y={},L=!F,A=0;for(let _=0;_(v.route=!0,w[O])}),params:new Proxy(o,{get:(w,O)=>(v.params.add(O),w[O])}),data:(c==null?void 0:c.data)??null,url:at(n,()=>{v.url=!0}),async fetch(w,O){let N;w instanceof Request?(N=w.url,O={body:w.method==="GET"||w.method==="HEAD"?void 0:await w.blob(),cache:w.cache,credentials:w.credentials,headers:w.headers,integrity:w.integrity,keepalive:w.keepalive,method:w.method,mode:w.mode,redirect:w.redirect,referrer:w.referrer,referrerPolicy:w.referrerPolicy,signal:w.signal,...O}):N=w;const M=new URL(N,n);return P(M.href),M.origin===n.origin&&(N=M.href.slice(n.origin.length)),T?lt(N,M.href,O):ct(N,O)},setHeaders:()=>{},depends:P,parent(){return v.parent=!0,s()}};p=await b.universal.load.call(null,_)??null,p=p?await Rt(p):null}return{node:b,loader:e,server:c,universal:(L=b.universal)!=null&&L.load?{type:"data",data:p,uses:v}:null,data:p??(c==null?void 0:c.data)??null,slash:((A=b.universal)==null?void 0:A.trailingSlash)??(c==null?void 0:c.slash)}}function Oe(e,s,n,o,a){if(z)return!0;if(!o)return!1;if(o.parent&&e||o.route&&s||o.url&&n)return!0;for(const c of o.params)if(a[c]!==d.params[c])return!0;for(const c of o.dependencies)if(E.some(p=>p(new URL(c))))return!0;return!1}function de(e,s){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?s??null:null}async function pe({id:e,invalidating:s,url:n,params:o,route:a}){if((g==null?void 0:g.id)===e)return g.promise;const{errors:c,layouts:p,leaf:v}=a,b=[...p,v];c.forEach(S=>S==null?void 0:S().catch(()=>{})),b.forEach(S=>S==null?void 0:S[1]().catch(()=>{}));let y=null;const L=d.url?e!==d.url.pathname+d.url.search:!1,A=d.route?a.id!==d.route.id:!1;let P=!1;const _=b.map((S,I)=>{var B;const k=d.branch[I],$=!!(S!=null&&S[0])&&((k==null?void 0:k.loader)!==S[1]||Oe(P,A,L,(B=k.server)==null?void 0:B.uses,o));return $&&(P=!0),$});if(_.some(Boolean)){try{y=await He(n,_)}catch(S){return ie({status:S instanceof ne?S.status:500,error:await Q(S,{url:n,params:o,route:{id:a.id}}),url:n,route:a})}if(y.type==="redirect")return y}const w=y==null?void 0:y.nodes;let O=!1;const N=b.map(async(S,I)=>{var he;if(!S)return;const k=d.branch[I],$=w==null?void 0:w[I];if((!$||$.type==="skip")&&S[1]===(k==null?void 0:k.loader)&&!Oe(O,A,L,(he=k.universal)==null?void 0:he.uses,o))return k;if(O=!0,($==null?void 0:$.type)==="error")throw $;return ue({loader:S[1],url:n,params:o,route:a,parent:async()=>{var Te;const $e={};for(let ge=0;ge{});const M=[];for(let S=0;SPromise.resolve({}),server_data_node:de(c)}),b={node:await h(),loader:h,universal:null,server:null,data:null};return await X({url:n,params:a,branch:[v,b],status:e,error:s,route:null})}function Z(e,s){if(ye(e,G))return;const n=se(e);for(const o of f){const a=o.exec(n);if(a)return{id:e.pathname+e.search,invalidating:s,route:o,params:tt(a),url:e}}}function se(e){return et(e.pathname.slice(G.length)||"/")}function Ue({url:e,type:s,intent:n,delta:o}){let a=!1;const c=Be(d,n,e,s);o!==void 0&&(c.navigation.delta=o);const p={...c.navigation,cancel:()=>{a=!0,c.reject(new Error("navigation was cancelled"))}};return U||m.before_navigate.forEach(v=>v(p)),a?null:c}async function ce({url:e,scroll:s,keepfocus:n,redirect_count:o,details:a,type:c,delta:p,nav_token:v={},accepted:b,blocked:y}){var N,M,S;const L=Z(e,!1),A=Ue({url:e,type:c,delta:p,intent:L});if(!A){y();return}const P=x;b(),U=!0,T&&H.navigating.set(A.navigation),W=v;let _=L&&await pe(L);if(!_){if(ye(e,G))return await K(e);_=await je(e,{id:null},await Q(new Error(`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404)}if(e=(L==null?void 0:L.url)||e,W!==v)return A.reject(new Error("navigation was aborted")),!1;if(_.type==="redirect")if(o>=20)_=await ie({status:500,error:await Q(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}});else return re(new URL(_.location,e).href,{},o+1,v),!1;else((N=_.props.page)==null?void 0:N.status)>=400&&await H.updated.check()&&await K(e);if(E.length=0,z=!1,C=!0,be(P),Re(P),(M=_.props.page)!=null&&M.url&&_.props.page.url.pathname!==e.pathname&&(e.pathname=(S=_.props.page)==null?void 0:S.url.pathname),a){const I=a.replaceState?0:1;if(a.state[V]=x+=I,history[a.replaceState?"replaceState":"pushState"](a.state,"",e),!a.replaceState){let k=x+1;for(;ee[k]||J[k];)delete ee[k],delete J[k],k+=1}}if(g=null,T){d=_.state,_.props.page&&(_.props.page.url=e);const I=(await Promise.all(m.on_navigate.map(k=>k(A.navigation)))).filter(k=>typeof k=="function");if(I.length>0){let k=function(){m.after_navigate=m.after_navigate.filter($=>!I.includes($))};I.push(k),m.after_navigate.push(...I)}q.$set(_.props)}else Pe(_);const{activeElement:w}=document;if(await we(),R){const I=e.hash&&document.getElementById(decodeURIComponent(e.hash.slice(1)));s?scrollTo(s.x,s.y):I?I.scrollIntoView():scrollTo(0,0)}const O=document.activeElement!==w&&document.activeElement!==document.body;!n&&!O&&Ee(),R=!0,_.props.page&&(F=_.props.page),U=!1,c==="popstate"&&Ae(x),A.fulfil(void 0),m.after_navigate.forEach(I=>I(A.navigation)),H.navigating.set(null),C=!1}async function je(e,s,n,o){return e.origin===Me&&e.pathname===location.pathname&&!j?await ie({status:o,error:n,url:e,route:s}):await K(e)}function Xe(){let e;u.addEventListener("mousemove",c=>{const p=c.target;clearTimeout(e),e=setTimeout(()=>{o(p,2)},20)});function s(c){o(c.composedPath()[0],1)}u.addEventListener("mousedown",s),u.addEventListener("touchstart",s,{passive:!0});const n=new IntersectionObserver(c=>{for(const p of c)p.isIntersecting&&(oe(se(new URL(p.target.href))),n.unobserve(p.target))},{threshold:0});function o(c,p){const v=Ce(c,u);if(!v)return;const{url:b,external:y,download:L}=_e(v,G);if(y||L)return;const A=le(v);if(!A.reload)if(p<=A.preload_data){const P=Z(b,!1);P&&Le(P)}else p<=A.preload_code&&oe(se(b))}function a(){n.disconnect();for(const c of u.querySelectorAll("a")){const{url:p,external:v,download:b}=_e(c,G);if(v||b)continue;const y=le(c);y.reload||(y.preload_code===Ve.viewport&&n.observe(c),y.preload_code===Ve.eager&&oe(se(p)))}}m.after_navigate.push(a),a()}function Q(e,s){return e instanceof ne?e.body:t.hooks.handleError({error:e,event:s})??{message:s.route.id!=null?"Internal Error":"Not Found"}}return{after_navigate:e=>{me(()=>(m.after_navigate.push(e),()=>{const s=m.after_navigate.indexOf(e);m.after_navigate.splice(s,1)}))},before_navigate:e=>{me(()=>(m.before_navigate.push(e),()=>{const s=m.before_navigate.indexOf(e);m.before_navigate.splice(s,1)}))},on_navigate:e=>{me(()=>(m.on_navigate.push(e),()=>{const s=m.on_navigate.indexOf(e);m.on_navigate.splice(s,1)}))},disable_scroll_handling:()=>{(C||!T)&&(R=!1)},goto:(e,s={})=>re(e,s,0),invalidate:e=>{if(typeof e=="function")E.push(e);else{const{href:s}=new URL(e,location.href);E.push(n=>n.href===s)}return ke()},invalidate_all:()=>(z=!0,ke()),preload_data:async e=>{const s=new URL(e,De(document)),n=Z(s,!1);if(!n)throw new Error(`Attempted to preload a URL that does not belong to this app: ${s}`);await Le(n)},preload_code:oe,apply_action:async e=>{if(e.type==="error"){const s=new URL(location.href),{branch:n,route:o}=d;if(!o)return;const a=await xe(d.branch.length,n,o.errors);if(a){const c=await X({url:s,params:d.params,branch:n.slice(0,a.idx).concat(a.node),status:e.status??500,error:e.error,route:o});d=c.state,q.$set(c.props),we().then(Ee)}}else e.type==="redirect"?re(e.location,{invalidateAll:!0},0):(q.$set({form:null,page:{...F,form:e.data,status:e.status}}),await we(),q.$set({form:e.data}),e.type==="success"&&Ee())},_start_router:()=>{var s;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let o=!1;if(Ie(),!U){const a=Be(d,void 0,null,"leave"),c={...a.navigation,cancel:()=>{o=!0,a.reject(new Error("navigation was cancelled"))}};m.before_navigate.forEach(p=>p(c))}o?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ie()}),(s=navigator.connection)!=null&&s.saveData||Xe(),u.addEventListener("click",n=>{var P;if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const o=Ce(n.composedPath()[0],u);if(!o)return;const{url:a,external:c,target:p,download:v}=_e(o,G);if(!a)return;if(p==="_parent"||p==="_top"){if(window.parent!==window)return}else if(p&&p!=="_self")return;const b=le(o);if(!(o instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||v)return;if(c||b.reload){Ue({url:a,type:"link"})?U=!0:n.preventDefault();return}const[L,A]=a.href.split("#");if(A!==void 0&&L===location.href.split("#")[0]){if(d.url.hash===a.hash){n.preventDefault(),(P=o.ownerDocument.getElementById(A))==null||P.scrollIntoView();return}if(D=!0,be(x),e(a),!b.replace_state)return;D=!1,n.preventDefault()}ce({url:a,scroll:b.noscroll?te():null,keepfocus:b.keep_focus??!1,redirect_count:0,details:{state:{},replaceState:b.replace_state??a.href===location.href},accepted:()=>n.preventDefault(),blocked:()=>n.preventDefault(),type:"link"})}),u.addEventListener("submit",n=>{if(n.defaultPrevented)return;const o=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formMethod)||o.method)!=="get")return;const p=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||o.action);if(ye(p,G))return;const v=n.target,{keep_focus:b,noscroll:y,reload:L,replace_state:A}=le(v);if(L)return;n.preventDefault(),n.stopPropagation();const P=new FormData(v),_=a==null?void 0:a.getAttribute("name");_&&P.append(_,(a==null?void 0:a.getAttribute("value"))??""),p.search=new URLSearchParams(P).toString(),ce({url:p,scroll:y?te():null,keepfocus:b??!1,redirect_count:0,details:{state:{},replaceState:A??p.href===location.href},nav_token:{},accepted:()=>{},blocked:()=>{},type:"form"})}),addEventListener("popstate",async n=>{var o;if(W={},(o=n.state)!=null&&o[V]){if(n.state[V]===x)return;const a=J[n.state[V]],c=new URL(location.href);if(d.url.href.split("#")[0]===location.href.split("#")[0]){e(c),J[x]=te(),x=n.state[V],scrollTo(a.x,a.y);return}const p=n.state[V]-x;await ce({url:c,scroll:a,keepfocus:!1,redirect_count:0,details:null,accepted:()=>{x=n.state[V]},blocked:()=>{history.go(-p)},type:"popstate",delta:p,nav_token:W})}else if(!D){const a=new URL(location.href);e(a)}}),addEventListener("hashchange",()=>{D&&(D=!1,history.replaceState({...history.state,[V]:++x},"",location.href))});for(const n of document.querySelectorAll("link"))n.rel==="icon"&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&H.navigating.set(null)});function e(n){d.url=n,H.page.set({...F,url:n}),H.page.notify()}},_hydrate:async({status:e=200,error:s,node_ids:n,params:o,route:a,data:c,form:p})=>{j=!0;const v=new URL(location.href);({params:o={},route:a={id:null}}=Z(v,!1)||{});let b;try{const y=n.map(async(P,_)=>{const w=c[_];return w!=null&&w.uses&&(w.uses=Ye(w.uses)),ue({loader:t.nodes[P],url:v,params:o,route:a,parent:async()=>{const O={};for(let N=0;N<_;N+=1)Object.assign(O,(await y[N]).data);return O},server_data_node:de(w)})}),L=await Promise.all(y),A=f.find(({id:P})=>P===a.id);if(A){const P=A.layouts;for(let _=0;_u?"1":"0").join(""));const i=await Ke(f.href);if((h=i.headers.get("content-type"))!=null&&h.includes("text/html")&&await K(t),!i.ok)throw new ne(i.status,await i.json());return new Promise(async u=>{var j;const E=new Map,l=i.body.getReader(),g=new TextDecoder;function m(T){return Et(T,{Promise:R=>new Promise((C,U)=>{E.set(R,{fulfil:C,reject:U})})})}let d="";for(;;){const{done:T,value:R}=await l.read();if(T&&!d)break;for(d+=!R&&d?` +import{o as me,t as we}from"../chunks/scheduler.8852886c.js";import{S as Ge,a as Je,I as V,g as De,f as Ce,b as _e,c as le,s as te,i as ye,d as H,o as Me,P as Ve,e as Ze}from"../chunks/singletons.09f1db94.js";import{b as G}from"../chunks/paths.504696e9.js";function Qe(t,r){return t==="/"||r==="ignore"?t:r==="never"?t.endsWith("/")?t.slice(0,-1):t:r==="always"&&!t.endsWith("/")?t+"/":t}function et(t){return t.split("%25").map(decodeURI).join("%25")}function tt(t){for(const r in t)t[r]=decodeURIComponent(t[r]);return t}const nt=["href","pathname","search","searchParams","toString","toJSON"];function at(t,r){const f=new URL(t);for(const i of nt)Object.defineProperty(f,i,{get(){return r(),t[i]},enumerable:!0,configurable:!0});return rt(f),f}function rt(t){Object.defineProperty(t,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const ot="/__data.json";function it(t){return t.replace(/\/$/,"")+ot}function st(...t){let r=5381;for(const f of t)if(typeof f=="string"){let i=f.length;for(;i;)r=r*33^f.charCodeAt(--i)}else if(ArrayBuffer.isView(f)){const i=new Uint8Array(f.buffer,f.byteOffset,f.byteLength);let h=i.length;for(;h;)r=r*33^i[--h]}else throw new TypeError("value must be a string or TypedArray");return(r>>>0).toString(36)}const Ke=window.fetch;window.fetch=(t,r)=>((t instanceof Request?t.method:(r==null?void 0:r.method)||"GET")!=="GET"&&ae.delete(Se(t)),Ke(t,r));const ae=new Map;function ct(t,r){const f=Se(t,r),i=document.querySelector(f);if(i!=null&&i.textContent){const{body:h,...u}=JSON.parse(i.textContent),E=i.getAttribute("data-ttl");return E&&ae.set(f,{body:h,init:u,ttl:1e3*Number(E)}),Promise.resolve(new Response(h,u))}return window.fetch(t,r)}function lt(t,r,f){if(ae.size>0){const i=Se(t,f),h=ae.get(i);if(h){if(performance.now(){const h=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(i);if(h)return r.push({name:h[1],matcher:h[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const u=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(i);if(u)return r.push({name:u[1],matcher:u[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!i)return;const E=i.split(/\[(.+?)\](?!\])/);return"/"+E.map((g,m)=>{if(m%2){if(g.startsWith("x+"))return ve(String.fromCharCode(parseInt(g.slice(2),16)));if(g.startsWith("u+"))return ve(String.fromCharCode(...g.slice(2).split("-").map(U=>parseInt(U,16))));const d=ft.exec(g);if(!d)throw new Error(`Invalid param: ${g}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,j,T,R,C]=d;return r.push({name:R,matcher:C,optional:!!j,rest:!!T,chained:T?m===1&&E[0]==="":!1}),T?"(.*?)":j?"([^/]*)?":"([^/]+?)"}return ve(g)}).join("")}).join("")}/?$`),params:r}}function dt(t){return!/^\([^)]+\)$/.test(t)}function pt(t){return t.slice(1).split("/").filter(dt)}function ht(t,r,f){const i={},h=t.slice(1),u=h.filter(l=>l!==void 0);let E=0;for(let l=0;ld).join("/"),E=0),m===void 0){g.rest&&(i[g.name]="");continue}if(!g.matcher||f[g.matcher](m)){i[g.name]=m;const d=r[l+1],j=h[l+1];d&&!d.rest&&d.optional&&j&&g.chained&&(E=0),!d&&!j&&Object.keys(i).length===u.length&&(E=0);continue}if(g.optional&&g.chained){E++;continue}return}if(!E)return i}function ve(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function gt({nodes:t,server_loads:r,dictionary:f,matchers:i}){const h=new Set(r);return Object.entries(f).map(([l,[g,m,d]])=>{const{pattern:j,params:T}=ut(l),R={id:l,exec:C=>{const U=j.exec(C);if(U)return ht(U,T,i)},errors:[1,...d||[]].map(C=>t[C]),layouts:[0,...m||[]].map(E),leaf:u(g)};return R.errors.length=R.layouts.length=Math.max(R.errors.length,R.layouts.length),R});function u(l){const g=l<0;return g&&(l=~l),[g,t[l]]}function E(l){return l===void 0?l:[h.has(l),t[l]]}}function ze(t){try{return JSON.parse(sessionStorage[t])}catch{}}function qe(t,r){const f=JSON.stringify(r);try{sessionStorage[t]=f}catch{}}const mt=-1,wt=-2,_t=-3,yt=-4,vt=-5,bt=-6;function Et(t,r){if(typeof t=="number")return h(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const f=t,i=Array(f.length);function h(u,E=!1){if(u===mt)return;if(u===_t)return NaN;if(u===yt)return 1/0;if(u===vt)return-1/0;if(u===bt)return-0;if(E)throw new Error("Invalid input");if(u in i)return i[u];const l=f[u];if(!l||typeof l!="object")i[u]=l;else if(Array.isArray(l))if(typeof l[0]=="string"){const g=l[0],m=r==null?void 0:r[g];if(m)return i[u]=m(h(l[1]));switch(g){case"Date":i[u]=new Date(l[1]);break;case"Set":const d=new Set;i[u]=d;for(let R=1;Rr!=null)}const We=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...We];const kt=new Set([...We]);[...kt];async function Rt(t){var r;for(const f in t)if(typeof((r=t[f])==null?void 0:r.then)=="function")return Object.fromEntries(await Promise.all(Object.entries(t).map(async([i,h])=>[i,await h])));return t}class ne{constructor(r,f){this.status=r,typeof f=="string"?this.body={message:f}:f?this.body=f:this.body={message:`Error: ${r}`}}toString(){return JSON.stringify(this.body)}}class Fe{constructor(r,f){this.status=r,this.location=f}}const At="x-sveltekit-invalidated",It="x-sveltekit-trailing-slash",J=ze(Ge)??{},ee=ze(Je)??{};function be(t){J[t]=te()}function K(t){return location.href=t.href,new Promise(()=>{})}function Lt(t,r){var Ne;const f=gt(t),i=t.nodes[0],h=t.nodes[1];i(),h();const u=document.documentElement,E=[],l=[];let g=null;const m={before_navigate:[],on_navigate:[],after_navigate:[]};let d={branch:[],error:null,url:null},j=!1,T=!1,R=!0,C=!1,U=!1,D=!1,z=!1,q,x=(Ne=history.state)==null?void 0:Ne[V];x||(x=Date.now(),history.replaceState({...history.state,[V]:x},"",location.href));const fe=J[x];fe&&(history.scrollRestoration="manual",scrollTo(fe.x,fe.y));let F,W,Y;async function ke(){if(Y=Y||Promise.resolve(),await Y,!Y)return;Y=null;const e=new URL(location.href),s=Z(e,!0);g=null;const n=W={},o=s&&await pe(s);if(n===W&&o){if(o.type==="redirect")return re(new URL(o.location,e).href,{},1,n);o.props.page!==void 0&&(F=o.props.page),q.$set(o.props)}}function Re(e){l.some(s=>s==null?void 0:s.snapshot)&&(ee[e]=l.map(s=>{var n;return(n=s==null?void 0:s.snapshot)==null?void 0:n.capture()}))}function Ae(e){var s;(s=ee[e])==null||s.forEach((n,o)=>{var a,c;(c=(a=l[o])==null?void 0:a.snapshot)==null||c.restore(n)})}function Ie(){be(x),qe(Ge,J),Re(x),qe(Je,ee)}async function re(e,{noScroll:s=!1,replaceState:n=!1,keepFocus:o=!1,state:a={},invalidateAll:c=!1},p,v){return typeof e=="string"&&(e=new URL(e,De(document))),ce({url:e,scroll:s?te():null,keepfocus:o,redirect_count:p,details:{state:a,replaceState:n},nav_token:v,accepted:()=>{c&&(z=!0)},blocked:()=>{},type:"goto"})}async function Le(e){return g={id:e.id,promise:pe(e).then(s=>(s.type==="loaded"&&s.state.error&&(g=null),s))},g.promise}async function oe(...e){const n=f.filter(o=>e.some(a=>o.exec(a))).map(o=>Promise.all([...o.layouts,o.leaf].map(a=>a==null?void 0:a[1]())));await Promise.all(n)}function Pe(e){var o;d=e.state;const s=document.querySelector("style[data-sveltekit]");s&&s.remove(),F=e.props.page,q=new t.root({target:r,props:{...e.props,stores:H,components:l},hydrate:!0}),Ae(x);const n={from:null,to:{params:d.params,route:{id:((o=d.route)==null?void 0:o.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};m.after_navigate.forEach(a=>a(n)),T=!0}async function X({url:e,params:s,branch:n,status:o,error:a,route:c,form:p}){let v="never";for(const _ of n)(_==null?void 0:_.slash)!==void 0&&(v=_.slash);e.pathname=Qe(e.pathname,v),e.search=e.search;const b={type:"loaded",state:{url:e,params:s,branch:n,error:a,route:c},props:{constructors:St(n).map(_=>_.node.component)}};p!==void 0&&(b.props.form=p);let y={},L=!F,A=0;for(let _=0;_(v.route=!0,w[O])}),params:new Proxy(o,{get:(w,O)=>(v.params.add(O),w[O])}),data:(c==null?void 0:c.data)??null,url:at(n,()=>{v.url=!0}),async fetch(w,O){let N;w instanceof Request?(N=w.url,O={body:w.method==="GET"||w.method==="HEAD"?void 0:await w.blob(),cache:w.cache,credentials:w.credentials,headers:w.headers,integrity:w.integrity,keepalive:w.keepalive,method:w.method,mode:w.mode,redirect:w.redirect,referrer:w.referrer,referrerPolicy:w.referrerPolicy,signal:w.signal,...O}):N=w;const M=new URL(N,n);return P(M.href),M.origin===n.origin&&(N=M.href.slice(n.origin.length)),T?lt(N,M.href,O):ct(N,O)},setHeaders:()=>{},depends:P,parent(){return v.parent=!0,s()}};p=await b.universal.load.call(null,_)??null,p=p?await Rt(p):null}return{node:b,loader:e,server:c,universal:(L=b.universal)!=null&&L.load?{type:"data",data:p,uses:v}:null,data:p??(c==null?void 0:c.data)??null,slash:((A=b.universal)==null?void 0:A.trailingSlash)??(c==null?void 0:c.slash)}}function Oe(e,s,n,o,a){if(z)return!0;if(!o)return!1;if(o.parent&&e||o.route&&s||o.url&&n)return!0;for(const c of o.params)if(a[c]!==d.params[c])return!0;for(const c of o.dependencies)if(E.some(p=>p(new URL(c))))return!0;return!1}function de(e,s){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?s??null:null}async function pe({id:e,invalidating:s,url:n,params:o,route:a}){if((g==null?void 0:g.id)===e)return g.promise;const{errors:c,layouts:p,leaf:v}=a,b=[...p,v];c.forEach(S=>S==null?void 0:S().catch(()=>{})),b.forEach(S=>S==null?void 0:S[1]().catch(()=>{}));let y=null;const L=d.url?e!==d.url.pathname+d.url.search:!1,A=d.route?a.id!==d.route.id:!1;let P=!1;const _=b.map((S,I)=>{var B;const k=d.branch[I],$=!!(S!=null&&S[0])&&((k==null?void 0:k.loader)!==S[1]||Oe(P,A,L,(B=k.server)==null?void 0:B.uses,o));return $&&(P=!0),$});if(_.some(Boolean)){try{y=await He(n,_)}catch(S){return ie({status:S instanceof ne?S.status:500,error:await Q(S,{url:n,params:o,route:{id:a.id}}),url:n,route:a})}if(y.type==="redirect")return y}const w=y==null?void 0:y.nodes;let O=!1;const N=b.map(async(S,I)=>{var he;if(!S)return;const k=d.branch[I],$=w==null?void 0:w[I];if((!$||$.type==="skip")&&S[1]===(k==null?void 0:k.loader)&&!Oe(O,A,L,(he=k.universal)==null?void 0:he.uses,o))return k;if(O=!0,($==null?void 0:$.type)==="error")throw $;return ue({loader:S[1],url:n,params:o,route:a,parent:async()=>{var Te;const $e={};for(let ge=0;ge{});const M=[];for(let S=0;SPromise.resolve({}),server_data_node:de(c)}),b={node:await h(),loader:h,universal:null,server:null,data:null};return await X({url:n,params:a,branch:[v,b],status:e,error:s,route:null})}function Z(e,s){if(ye(e,G))return;const n=se(e);for(const o of f){const a=o.exec(n);if(a)return{id:e.pathname+e.search,invalidating:s,route:o,params:tt(a),url:e}}}function se(e){return et(e.pathname.slice(G.length)||"/")}function Ue({url:e,type:s,intent:n,delta:o}){let a=!1;const c=Be(d,n,e,s);o!==void 0&&(c.navigation.delta=o);const p={...c.navigation,cancel:()=>{a=!0,c.reject(new Error("navigation was cancelled"))}};return U||m.before_navigate.forEach(v=>v(p)),a?null:c}async function ce({url:e,scroll:s,keepfocus:n,redirect_count:o,details:a,type:c,delta:p,nav_token:v={},accepted:b,blocked:y}){var N,M,S;const L=Z(e,!1),A=Ue({url:e,type:c,delta:p,intent:L});if(!A){y();return}const P=x;b(),U=!0,T&&H.navigating.set(A.navigation),W=v;let _=L&&await pe(L);if(!_){if(ye(e,G))return await K(e);_=await je(e,{id:null},await Q(new Error(`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404)}if(e=(L==null?void 0:L.url)||e,W!==v)return A.reject(new Error("navigation was aborted")),!1;if(_.type==="redirect")if(o>=20)_=await ie({status:500,error:await Q(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}});else return re(new URL(_.location,e).href,{},o+1,v),!1;else((N=_.props.page)==null?void 0:N.status)>=400&&await H.updated.check()&&await K(e);if(E.length=0,z=!1,C=!0,be(P),Re(P),(M=_.props.page)!=null&&M.url&&_.props.page.url.pathname!==e.pathname&&(e.pathname=(S=_.props.page)==null?void 0:S.url.pathname),a){const I=a.replaceState?0:1;if(a.state[V]=x+=I,history[a.replaceState?"replaceState":"pushState"](a.state,"",e),!a.replaceState){let k=x+1;for(;ee[k]||J[k];)delete ee[k],delete J[k],k+=1}}if(g=null,T){d=_.state,_.props.page&&(_.props.page.url=e);const I=(await Promise.all(m.on_navigate.map(k=>k(A.navigation)))).filter(k=>typeof k=="function");if(I.length>0){let k=function(){m.after_navigate=m.after_navigate.filter($=>!I.includes($))};I.push(k),m.after_navigate.push(...I)}q.$set(_.props)}else Pe(_);const{activeElement:w}=document;if(await we(),R){const I=e.hash&&document.getElementById(decodeURIComponent(e.hash.slice(1)));s?scrollTo(s.x,s.y):I?I.scrollIntoView():scrollTo(0,0)}const O=document.activeElement!==w&&document.activeElement!==document.body;!n&&!O&&Ee(),R=!0,_.props.page&&(F=_.props.page),U=!1,c==="popstate"&&Ae(x),A.fulfil(void 0),m.after_navigate.forEach(I=>I(A.navigation)),H.navigating.set(null),C=!1}async function je(e,s,n,o){return e.origin===Me&&e.pathname===location.pathname&&!j?await ie({status:o,error:n,url:e,route:s}):await K(e)}function Xe(){let e;u.addEventListener("mousemove",c=>{const p=c.target;clearTimeout(e),e=setTimeout(()=>{o(p,2)},20)});function s(c){o(c.composedPath()[0],1)}u.addEventListener("mousedown",s),u.addEventListener("touchstart",s,{passive:!0});const n=new IntersectionObserver(c=>{for(const p of c)p.isIntersecting&&(oe(se(new URL(p.target.href))),n.unobserve(p.target))},{threshold:0});function o(c,p){const v=Ce(c,u);if(!v)return;const{url:b,external:y,download:L}=_e(v,G);if(y||L)return;const A=le(v);if(!A.reload)if(p<=A.preload_data){const P=Z(b,!1);P&&Le(P)}else p<=A.preload_code&&oe(se(b))}function a(){n.disconnect();for(const c of u.querySelectorAll("a")){const{url:p,external:v,download:b}=_e(c,G);if(v||b)continue;const y=le(c);y.reload||(y.preload_code===Ve.viewport&&n.observe(c),y.preload_code===Ve.eager&&oe(se(p)))}}m.after_navigate.push(a),a()}function Q(e,s){return e instanceof ne?e.body:t.hooks.handleError({error:e,event:s})??{message:s.route.id!=null?"Internal Error":"Not Found"}}return{after_navigate:e=>{me(()=>(m.after_navigate.push(e),()=>{const s=m.after_navigate.indexOf(e);m.after_navigate.splice(s,1)}))},before_navigate:e=>{me(()=>(m.before_navigate.push(e),()=>{const s=m.before_navigate.indexOf(e);m.before_navigate.splice(s,1)}))},on_navigate:e=>{me(()=>(m.on_navigate.push(e),()=>{const s=m.on_navigate.indexOf(e);m.on_navigate.splice(s,1)}))},disable_scroll_handling:()=>{(C||!T)&&(R=!1)},goto:(e,s={})=>re(e,s,0),invalidate:e=>{if(typeof e=="function")E.push(e);else{const{href:s}=new URL(e,location.href);E.push(n=>n.href===s)}return ke()},invalidate_all:()=>(z=!0,ke()),preload_data:async e=>{const s=new URL(e,De(document)),n=Z(s,!1);if(!n)throw new Error(`Attempted to preload a URL that does not belong to this app: ${s}`);await Le(n)},preload_code:oe,apply_action:async e=>{if(e.type==="error"){const s=new URL(location.href),{branch:n,route:o}=d;if(!o)return;const a=await xe(d.branch.length,n,o.errors);if(a){const c=await X({url:s,params:d.params,branch:n.slice(0,a.idx).concat(a.node),status:e.status??500,error:e.error,route:o});d=c.state,q.$set(c.props),we().then(Ee)}}else e.type==="redirect"?re(e.location,{invalidateAll:!0},0):(q.$set({form:null,page:{...F,form:e.data,status:e.status}}),await we(),q.$set({form:e.data}),e.type==="success"&&Ee())},_start_router:()=>{var s;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let o=!1;if(Ie(),!U){const a=Be(d,void 0,null,"leave"),c={...a.navigation,cancel:()=>{o=!0,a.reject(new Error("navigation was cancelled"))}};m.before_navigate.forEach(p=>p(c))}o?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ie()}),(s=navigator.connection)!=null&&s.saveData||Xe(),u.addEventListener("click",n=>{var P;if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const o=Ce(n.composedPath()[0],u);if(!o)return;const{url:a,external:c,target:p,download:v}=_e(o,G);if(!a)return;if(p==="_parent"||p==="_top"){if(window.parent!==window)return}else if(p&&p!=="_self")return;const b=le(o);if(!(o instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||v)return;if(c||b.reload){Ue({url:a,type:"link"})?U=!0:n.preventDefault();return}const[L,A]=a.href.split("#");if(A!==void 0&&L===location.href.split("#")[0]){if(d.url.hash===a.hash){n.preventDefault(),(P=o.ownerDocument.getElementById(A))==null||P.scrollIntoView();return}if(D=!0,be(x),e(a),!b.replace_state)return;D=!1,n.preventDefault()}ce({url:a,scroll:b.noscroll?te():null,keepfocus:b.keep_focus??!1,redirect_count:0,details:{state:{},replaceState:b.replace_state??a.href===location.href},accepted:()=>n.preventDefault(),blocked:()=>n.preventDefault(),type:"link"})}),u.addEventListener("submit",n=>{if(n.defaultPrevented)return;const o=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formMethod)||o.method)!=="get")return;const p=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||o.action);if(ye(p,G))return;const v=n.target,{keep_focus:b,noscroll:y,reload:L,replace_state:A}=le(v);if(L)return;n.preventDefault(),n.stopPropagation();const P=new FormData(v),_=a==null?void 0:a.getAttribute("name");_&&P.append(_,(a==null?void 0:a.getAttribute("value"))??""),p.search=new URLSearchParams(P).toString(),ce({url:p,scroll:y?te():null,keepfocus:b??!1,redirect_count:0,details:{state:{},replaceState:A??p.href===location.href},nav_token:{},accepted:()=>{},blocked:()=>{},type:"form"})}),addEventListener("popstate",async n=>{var o;if(W={},(o=n.state)!=null&&o[V]){if(n.state[V]===x)return;const a=J[n.state[V]],c=new URL(location.href);if(d.url.href.split("#")[0]===location.href.split("#")[0]){e(c),J[x]=te(),x=n.state[V],scrollTo(a.x,a.y);return}const p=n.state[V]-x;await ce({url:c,scroll:a,keepfocus:!1,redirect_count:0,details:null,accepted:()=>{x=n.state[V]},blocked:()=>{history.go(-p)},type:"popstate",delta:p,nav_token:W})}else if(!D){const a=new URL(location.href);e(a)}}),addEventListener("hashchange",()=>{D&&(D=!1,history.replaceState({...history.state,[V]:++x},"",location.href))});for(const n of document.querySelectorAll("link"))n.rel==="icon"&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&H.navigating.set(null)});function e(n){d.url=n,H.page.set({...F,url:n}),H.page.notify()}},_hydrate:async({status:e=200,error:s,node_ids:n,params:o,route:a,data:c,form:p})=>{j=!0;const v=new URL(location.href);({params:o={},route:a={id:null}}=Z(v,!1)||{});let b;try{const y=n.map(async(P,_)=>{const w=c[_];return w!=null&&w.uses&&(w.uses=Ye(w.uses)),ue({loader:t.nodes[P],url:v,params:o,route:a,parent:async()=>{const O={};for(let N=0;N<_;N+=1)Object.assign(O,(await y[N]).data);return O},server_data_node:de(w)})}),L=await Promise.all(y),A=f.find(({id:P})=>P===a.id);if(A){const P=A.layouts;for(let _=0;_u?"1":"0").join(""));const i=await Ke(f.href);if((h=i.headers.get("content-type"))!=null&&h.includes("text/html")&&await K(t),!i.ok)throw new ne(i.status,await i.json());return new Promise(async u=>{var j;const E=new Map,l=i.body.getReader(),g=new TextDecoder;function m(T){return Et(T,{Promise:R=>new Promise((C,U)=>{E.set(R,{fulfil:C,reject:U})})})}let d="";for(;;){const{done:T,value:R}=await l.read();if(T&&!d)break;for(d+=!R&&d?` `:g.decode(R);;){const C=d.indexOf(` `);if(C===-1)break;const U=JSON.parse(d.slice(0,C));if(d=d.slice(C+1),U.type==="redirect")return u(U);if(U.type==="data")(j=U.nodes)==null||j.forEach(D=>{(D==null?void 0:D.type)==="data"&&(D.uses=Ye(D.uses),D.data=m(D.data))}),u(U);else if(U.type==="chunk"){const{id:D,data:z,error:q}=U,x=E.get(D);E.delete(D),q?x.reject(m(q)):x.fulfil(m(z))}}}})}function Ye(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url)}}function Ee(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const r=document.body,f=r.getAttribute("tabindex");r.tabIndex=-1,r.focus({preventScroll:!0,focusVisible:!1}),f!==null?r.setAttribute("tabindex",f):r.removeAttribute("tabindex");const i=getSelection();if(i&&i.type!=="None"){const h=[];for(let u=0;u{if(i.rangeCount===h.length){for(let u=0;u{h=d,u=j});return E.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((g=t.route)==null?void 0:g.id)??null},url:t.url},to:f&&{params:(r==null?void 0:r.params)??null,route:{id:((m=r==null?void 0:r.route)==null?void 0:m.id)??null},url:f},willUnload:!r,type:i,complete:E},fulfil:h,reject:u}}async function Ut(t,r,f){const i=Lt(t,r);Ze({client:i}),f?await i._hydrate(f):i.goto(location.href,{replaceState:!0}),i._start_router()}export{Ut as start}; diff --git a/build/client/_app/immutable/nodes/1.369b6ef7.js b/build/client/_app/immutable/nodes/1.7cee7167.js similarity index 92% rename from build/client/_app/immutable/nodes/1.369b6ef7.js rename to build/client/_app/immutable/nodes/1.7cee7167.js index b32c5039..b3d764c4 100644 --- a/build/client/_app/immutable/nodes/1.369b6ef7.js +++ b/build/client/_app/immutable/nodes/1.7cee7167.js @@ -1 +1 @@ -import{s as x,f as u,l as h,a as S,g as d,h as v,m as g,d as m,c as q,i as _,r as E,n as $,u as b,E as y}from"../chunks/scheduler.8852886c.js";import{S as C,i as H}from"../chunks/index.fb8f3617.js";import{p as P}from"../chunks/stores.ba51b889.js";function j(i){var f;let a,s=i[0].status+"",r,o,n,p=((f=i[0].error)==null?void 0:f.message)+"",c;return{c(){a=u("h1"),r=h(s),o=S(),n=u("p"),c=h(p)},l(e){a=d(e,"H1",{});var t=v(a);r=g(t,s),t.forEach(m),o=q(e),n=d(e,"P",{});var l=v(n);c=g(l,p),l.forEach(m)},m(e,t){_(e,a,t),E(a,r),_(e,o,t),_(e,n,t),E(n,c)},p(e,[t]){var l;t&1&&s!==(s=e[0].status+"")&&$(r,s),t&1&&p!==(p=((l=e[0].error)==null?void 0:l.message)+"")&&$(c,p)},i:b,o:b,d(e){e&&(m(a),m(o),m(n))}}}function k(i,a,s){let r;return y(i,P,o=>s(0,r=o)),[r]}class B extends C{constructor(a){super(),H(this,a,k,j,x,{})}}export{B as component}; +import{s as x,f as u,l as h,a as S,g as d,h as v,m as g,d as m,c as q,i as _,r as E,n as $,u as b,E as y}from"../chunks/scheduler.8852886c.js";import{S as C,i as H}from"../chunks/index.fb8f3617.js";import{p as P}from"../chunks/stores.b8369d52.js";function j(i){var f;let a,s=i[0].status+"",r,o,n,p=((f=i[0].error)==null?void 0:f.message)+"",c;return{c(){a=u("h1"),r=h(s),o=S(),n=u("p"),c=h(p)},l(e){a=d(e,"H1",{});var t=v(a);r=g(t,s),t.forEach(m),o=q(e),n=d(e,"P",{});var l=v(n);c=g(l,p),l.forEach(m)},m(e,t){_(e,a,t),E(a,r),_(e,o,t),_(e,n,t),E(n,c)},p(e,[t]){var l;t&1&&s!==(s=e[0].status+"")&&$(r,s),t&1&&p!==(p=((l=e[0].error)==null?void 0:l.message)+"")&&$(c,p)},i:b,o:b,d(e){e&&(m(a),m(o),m(n))}}}function k(i,a,s){let r;return y(i,P,o=>s(0,r=o)),[r]}class B extends C{constructor(a){super(),H(this,a,k,j,x,{})}}export{B as component}; diff --git a/build/client/_app/immutable/nodes/3.5419bf7f.js b/build/client/_app/immutable/nodes/3.5e894945.js similarity index 98% rename from build/client/_app/immutable/nodes/3.5419bf7f.js rename to build/client/_app/immutable/nodes/3.5e894945.js index acfb2db9..0bcbb45e 100644 --- a/build/client/_app/immutable/nodes/3.5419bf7f.js +++ b/build/client/_app/immutable/nodes/3.5e894945.js @@ -1,2 +1,2 @@ -import{s as X,e as V,a as N,f as b,z as Y,d as c,c as S,g as v,h as E,j as g,r as P,i as $,E as Z,u as z,l as M,m as B,x as J,F as j}from"../chunks/scheduler.8852886c.js";import{S as ee,i as te,t as I,c as L,a as C,b as T,d as D,m as A,g as q,e as O}from"../chunks/index.fb8f3617.js";import{e as y}from"../chunks/ctx.1e61a5a6.js";import{M as le}from"../chunks/monitor.b8d7520d.js";import{C as K,a as Q}from"../chunks/Icon.7b7db889.js";import{I as ne}from"../chunks/incident.fe542872.js";import{B as F}from"../chunks/axios.baaa6432.js";import{p as se}from"../chunks/stores.ba51b889.js";function G(i,e,n){const t=i.slice();return t[4]=e[n],t}function R(i,e,n){const t=i.slice();return t[7]=e[n],t[9]=n,t}function ae(i){let e,n,t;document.title=e=i[1].name+" Categorry Page";let l=i[1].description&&re(i);return{c(){n=N(),l&&l.c(),t=V()},l(a){n=S(a),l&&l.l(a),t=V()},m(a,s){$(a,n,s),l&&l.m(a,s),$(a,t,s)},p(a,s){s&2&&e!==(e=a[1].name+" Categorry Page")&&(document.title=e),a[1].description&&l.p(a,s)},d(a){a&&(c(n),c(t)),l&&l.d(a)}}}function re(i){let e;return{c(){e=b("meta"),this.h()},l(n){e=v(n,"META",{name:!0,content:!0}),this.h()},h(){g(e,"name","description"),g(e,"content",i[1].description)},m(n,t){$(n,e,t)},p:z,d(n){n&&c(e)}}}function oe(i){let e,n,t,l,a=i[1].name&&ie(i),s=i[1].description&&ce(i);return{c(){e=b("section"),n=b("div"),t=b("div"),a&&a.c(),l=N(),s&&s.c(),this.h()},l(r){e=v(r,"SECTION",{class:!0});var o=E(e);n=v(o,"DIV",{class:!0});var m=E(n);t=v(m,"DIV",{class:!0});var x=E(t);a&&a.l(x),l=S(x),s&&s.l(x),x.forEach(c),m.forEach(c),o.forEach(c),this.h()},h(){g(t,"class","mx-auto max-w-3xl text-center blurry-bg"),g(n,"class","mx-auto max-w-screen-xl px-4 lg:flex lg:items-center"),g(e,"class","mx-auto flex w-full max-w-4xl mb-8 flex-1 flex-col items-start justify-center")},m(r,o){$(r,e,o),P(e,n),P(n,t),a&&a.m(t,null),P(t,l),s&&s.m(t,null)},p(r,o){r[1].name&&a.p(r,o),r[1].description&&s.p(r,o)},d(r){r&&c(e),a&&a.d(),s&&s.d()}}}function ie(i){let e,n=i[1].name+"",t;return{c(){e=b("h1"),t=M(n),this.h()},l(l){e=v(l,"H1",{class:!0});var a=E(e);t=B(a,n),a.forEach(c),this.h()},h(){g(e,"class","bg-gradient-to-r from-green-300 via-blue-500 to-purple-600 bg-clip-text text-5xl font-extrabold text-transparent leading-snug")},m(l,a){$(l,e,a),P(e,t)},p:z,d(l){l&&c(e)}}}function ce(i){let e,n=i[1].description+"",t;return{c(){e=b("p"),t=M(n),this.h()},l(l){e=v(l,"P",{class:!0});var a=E(e);t=B(a,n),a.forEach(c),this.h()},h(){g(e,"class","mx-auto mt-4 max-w-xl sm:text-xl")},m(l,a){$(l,e,a),P(e,t)},p:z,d(l){l&&c(e)}}}function fe(i){let e,n,t,l,a,s,r;l=new F({props:{variant:"outline",$$slots:{default:[ue]},$$scope:{ctx:i}}});let o=y(i[0].openIncidents),m=[];for(let u=0;uI(m[u],1,1,()=>{m[u]=null});return{c(){e=b("section"),n=b("div"),t=b("div"),T(l.$$.fragment),a=N(),s=b("section");for(let u=0;uI(m[u],1,1,()=>{m[u]=null});return{c(){e=b("section"),n=b("div"),t=b("div"),T(l.$$.fragment),a=N(),s=b("section");for(let u=0;uhere.`;return{c(){e=b("h1"),e.textContent=n,t=N(),l=b("p"),l.innerHTML=a,this.h()},l(s){e=v(s,"H1",{class:!0,"data-svelte-h":!0}),j(e)!=="svelte-pnpgii"&&(e.textContent=n),t=S(s),l=v(s,"P",{class:!0,"data-svelte-h":!0}),j(l)!=="svelte-x3h5nn"&&(l.innerHTML=a),this.h()},h(){g(e,"class","scroll-m-20 text-2xl font-extrabold tracking-tight lg:text-2xl text-center"),g(l,"class","mt-3 text-center")},m(s,r){$(s,e,r),$(s,t,r),$(s,l,r)},p:z,d(s){s&&(c(e),c(t),c(l))}}}function de(i){let e,n;return e=new Q({props:{class:"pt-4",$$slots:{default:[_e]},$$scope:{ctx:i}}}),{c(){T(e.$$.fragment)},l(t){D(e.$$.fragment,t)},m(t,l){A(e,t,l),n=!0},p(t,l){const a={};l&1024&&(a.$$scope={dirty:l,ctx:t}),e.$set(a)},i(t){n||(C(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){O(e,t)}}}function $e(i){let e;return{c(){e=M("Availability per Component")},l(n){e=B(n,"Availability per Component")},m(n,t){$(n,e,t)},d(n){n&&c(e)}}}function he(i){let e,n,t,l="UP",a,s,r,o,m="DEGRADED",x,u,f,_,h="DOWN";return{c(){e=b("span"),n=N(),t=b("span"),t.textContent=l,a=N(),s=b("span"),r=N(),o=b("span"),o.textContent=m,x=N(),u=b("span"),f=N(),_=b("span"),_.textContent=h,this.h()},l(p){e=v(p,"SPAN",{class:!0}),E(e).forEach(c),n=S(p),t=v(p,"SPAN",{class:!0,"data-svelte-h":!0}),j(t)!=="svelte-fd8nbr"&&(t.textContent=l),a=S(p),s=v(p,"SPAN",{class:!0}),E(s).forEach(c),r=S(p),o=v(p,"SPAN",{class:!0,"data-svelte-h":!0}),j(o)!=="svelte-ddctvm"&&(o.textContent=m),x=S(p),u=v(p,"SPAN",{class:!0}),E(u).forEach(c),f=S(p),_=v(p,"SPAN",{class:!0,"data-svelte-h":!0}),j(_)!=="svelte-1o75psw"&&(_.textContent=h),this.h()},h(){g(e,"class","w-[8px] h-[8px] inline-flex rounded-full bg-api-up opacity-75 mr-1"),g(t,"class","mr-3"),g(s,"class","w-[8px] h-[8px] inline-flex rounded-full bg-api-degraded opacity-75 mr-1"),g(o,"class","mr-3"),g(u,"class","w-[8px] h-[8px] inline-flex rounded-full bg-api-down opacity-75 mr-1"),g(_,"class","mr-3")},m(p,k){$(p,e,k),$(p,n,k),$(p,t,k),$(p,a,k),$(p,s,k),$(p,r,k),$(p,o,k),$(p,x,k),$(p,u,k),$(p,f,k),$(p,_,k)},p:z,d(p){p&&(c(e),c(n),c(t),c(a),c(s),c(r),c(o),c(x),c(u),c(f),c(_))}}}function W(i){let e,n;return e=new le({props:{monitor:i[4],localTz:i[0].localTz}}),{c(){T(e.$$.fragment)},l(t){D(e.$$.fragment,t)},m(t,l){A(e,t,l),n=!0},p(t,l){const a={};l&1&&(a.monitor=t[4]),l&1&&(a.localTz=t[0].localTz),e.$set(a)},i(t){n||(C(e.$$.fragment,t),n=!0)},o(t){I(e.$$.fragment,t),n=!1},d(t){O(e,t)}}}function ge(i){let e,n,t=y(i[0].monitors),l=[];for(let s=0;sI(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s0?0:1}return r=k(i),o=p[r]=h[r](i),{c(){u&&u.c(),e=V(),n=N(),t=b("div"),l=N(),f&&f.c(),a=N(),_&&_.c(),s=N(),o.c(),m=V(),this.h()},l(d){const w=Y("svelte-zgbzo2",document.head);u&&u.l(w),e=V(),w.forEach(c),n=S(d),t=v(d,"DIV",{class:!0}),E(t).forEach(c),l=S(d),f&&f.l(d),a=S(d),_&&_.l(d),s=S(d),o.l(d),m=V(),this.h()},h(){g(t,"class","mt-32")},m(d,w){u&&u.m(document.head,null),P(document.head,e),$(d,n,w),$(d,t,w),$(d,l,w),f&&f.m(d,w),$(d,a,w),_&&_.m(d,w),$(d,s,w),p[r].m(d,w),$(d,m,w),x=!0},p(d,[w]){d[1]&&u.p(d,w),d[1]&&f.p(d,w),d[2]&&_.p(d,w);let H=r;r=k(d),r===H?p[r].p(d,w):(q(),I(p[H],1,1,()=>{p[H]=null}),L(),o=p[r],o?o.p(d,w):(o=p[r]=h[r](d),o.c()),C(o,1),o.m(m.parentNode,m))},i(d){x||(C(_),C(o),x=!0)},o(d){I(_),I(o),x=!1},d(d){d&&(c(n),c(t),c(l),c(a),c(s),c(m)),u&&u.d(d),c(e),f&&f.d(d),_&&_.d(d),p[r].d(d)}}}function ve(i,e,n){let t;Z(i,se,r=>n(3,t=r));let{data:l}=e,a=l.site.categories.find(r=>r.name===t.params.category),s=l.openIncidents.length>0;return i.$$set=r=>{"data"in r&&n(0,l=r.data)},[l,a,s]}class Te extends ee{constructor(e){super(),te(this,e,ve,be,X,{data:0})}}export{Te as component}; diff --git a/build/client/_app/immutable/nodes/5.dec378a2.js b/build/client/_app/immutable/nodes/5.c348aae9.js similarity index 98% rename from build/client/_app/immutable/nodes/5.dec378a2.js rename to build/client/_app/immutable/nodes/5.c348aae9.js index 05cbf494..1b2dce02 100644 --- a/build/client/_app/immutable/nodes/5.dec378a2.js +++ b/build/client/_app/immutable/nodes/5.c348aae9.js @@ -1,2 +1,2 @@ -import{s as S,e as b,i as _,d as u,E as y,o as P,p as j,f as k,g as x,h as M,j as d,a as F,F as C,c as I,u as O,x as q}from"../chunks/scheduler.8852886c.js";import{S as B,i as W,t as m,c as L,a as i,g as H,b as p,d as h,m as $,e as g}from"../chunks/index.fb8f3617.js";import{e as v}from"../chunks/ctx.1e61a5a6.js";import{M as A}from"../chunks/monitor.b8d7520d.js";import{C as N,a as z}from"../chunks/Icon.7b7db889.js";import"../chunks/axios.baaa6432.js";import{p as D}from"../chunks/stores.ba51b889.js";function E(l,t,o){const n=l.slice();return n[5]=t[o],n}function G(l){let t,o,n;return o=new N({props:{class:"mx-auto",$$slots:{default:[Q]},$$scope:{ctx:l}}}),{c(){t=k("section"),p(o.$$.fragment),this.h()},l(e){t=x(e,"SECTION",{class:!0,id:!0});var a=M(t);h(o.$$.fragment,a),a.forEach(u),this.h()},h(){d(t,"class","mx-auto bg-transparent mb-4 flex w-full max-w-[890px] flex-1 flex-col items-start justify-center"),d(t,"id","")},m(e,a){_(e,t,a),$(o,t,null),n=!0},p(e,a){const r={};a&256&&(r.$$scope={dirty:a,ctx:e}),o.$set(r)},i(e){n||(i(o.$$.fragment,e),n=!0)},o(e){m(o.$$.fragment,e),n=!1},d(e){e&&u(t),g(o)}}}function J(l){let t,o,n;return o=new N({props:{class:"w-[580px] border-0 shadow-none",$$slots:{default:[U]},$$scope:{ctx:l}}}),{c(){t=k("section"),p(o.$$.fragment),this.h()},l(e){t=x(e,"SECTION",{class:!0});var a=M(t);h(o.$$.fragment,a),a.forEach(u),this.h()},h(){d(t,"class","w-fit p-0")},m(e,a){_(e,t,a),$(o,t,null),l[3](t),n=!0},p(e,a){const r={};a&257&&(r.$$scope={dirty:a,ctx:e}),o.$set(r)},i(e){n||(i(o.$$.fragment,e),n=!0)},o(e){m(o.$$.fragment,e),n=!1},d(e){e&&u(t),g(o),l[3](null)}}}function K(l){let t,o="No Monitor Found.",n,e,a=`Please read the documentation on how to add monitors +import{s as S,e as b,i as _,d as u,E as y,o as P,p as j,f as k,g as x,h as M,j as d,a as F,F as C,c as I,u as O,x as q}from"../chunks/scheduler.8852886c.js";import{S as B,i as W,t as m,c as L,a as i,g as H,b as p,d as h,m as $,e as g}from"../chunks/index.fb8f3617.js";import{e as v}from"../chunks/ctx.1e61a5a6.js";import{M as A}from"../chunks/monitor.b8d7520d.js";import{C as N,a as z}from"../chunks/Icon.7b7db889.js";import"../chunks/axios.baaa6432.js";import{p as D}from"../chunks/stores.b8369d52.js";function E(l,t,o){const n=l.slice();return n[5]=t[o],n}function G(l){let t,o,n;return o=new N({props:{class:"mx-auto",$$slots:{default:[Q]},$$scope:{ctx:l}}}),{c(){t=k("section"),p(o.$$.fragment),this.h()},l(e){t=x(e,"SECTION",{class:!0,id:!0});var a=M(t);h(o.$$.fragment,a),a.forEach(u),this.h()},h(){d(t,"class","mx-auto bg-transparent mb-4 flex w-full max-w-[890px] flex-1 flex-col items-start justify-center"),d(t,"id","")},m(e,a){_(e,t,a),$(o,t,null),n=!0},p(e,a){const r={};a&256&&(r.$$scope={dirty:a,ctx:e}),o.$set(r)},i(e){n||(i(o.$$.fragment,e),n=!0)},o(e){m(o.$$.fragment,e),n=!1},d(e){e&&u(t),g(o)}}}function J(l){let t,o,n;return o=new N({props:{class:"w-[580px] border-0 shadow-none",$$slots:{default:[U]},$$scope:{ctx:l}}}),{c(){t=k("section"),p(o.$$.fragment),this.h()},l(e){t=x(e,"SECTION",{class:!0});var a=M(t);h(o.$$.fragment,a),a.forEach(u),this.h()},h(){d(t,"class","w-fit p-0")},m(e,a){_(e,t,a),$(o,t,null),l[3](t),n=!0},p(e,a){const r={};a&257&&(r.$$scope={dirty:a,ctx:e}),o.$set(r)},i(e){n||(i(o.$$.fragment,e),n=!0)},o(e){m(o.$$.fragment,e),n=!1},d(e){e&&u(t),g(o),l[3](null)}}}function K(l){let t,o="No Monitor Found.",n,e,a=`Please read the documentation on how to add monitors here.`;return{c(){t=k("h1"),t.textContent=o,n=F(),e=k("p"),e.innerHTML=a,this.h()},l(r){t=x(r,"H1",{class:!0,"data-svelte-h":!0}),C(t)!=="svelte-1vwlrnd"&&(t.textContent=o),n=I(r),e=x(r,"P",{class:!0,"data-svelte-h":!0}),C(e)!=="svelte-oy4ufi"&&(e.innerHTML=a),this.h()},h(){d(t,"class","scroll-m-20 text-2xl font-extrabold tracking-tight lg:text-2xl text-center"),d(e,"class","mt-3 text-center")},m(r,c){_(r,t,c),_(r,n,c),_(r,e,c)},p:O,d(r){r&&(u(t),u(n),u(e))}}}function Q(l){let t,o;return t=new z({props:{class:"pt-4",$$slots:{default:[K]},$$scope:{ctx:l}}}),{c(){p(t.$$.fragment)},l(n){h(t.$$.fragment,n)},m(n,e){$(t,n,e),o=!0},p(n,e){const a={};e&256&&(a.$$scope={dirty:e,ctx:n}),t.$set(a)},i(n){o||(i(t.$$.fragment,n),o=!0)},o(n){m(t.$$.fragment,n),o=!1},d(n){g(t,n)}}}function T(l){let t,o;return t=new A({props:{monitor:l[5],localTz:l[0].localTz}}),t.$on("heightChange",l[2]),{c(){p(t.$$.fragment)},l(n){h(t.$$.fragment,n)},m(n,e){$(t,n,e),o=!0},p(n,e){const a={};e&1&&(a.monitor=n[5]),e&1&&(a.localTz=n[0].localTz),t.$set(a)},i(n){o||(i(t.$$.fragment,n),o=!0)},o(n){m(t.$$.fragment,n),o=!1},d(n){g(t,n)}}}function R(l){let t,o,n=v(l[0].monitors),e=[];for(let r=0;rm(e[r],1,1,()=>{e[r]=null});return{c(){for(let r=0;r0?0:1}return t=c(l),o=r[t]=a[t](l),{c(){o.c(),n=b()},l(s){o.l(s),n=b()},m(s,f){r[t].m(s,f),_(s,n,f),e=!0},p(s,[f]){let w=t;t=c(s),t===w?r[t].p(s,f):(H(),m(r[w],1,1,()=>{r[w]=null}),L(),o=r[t],o?o.p(s,f):(o=r[t]=a[t](s),o.c()),i(o,1),o.m(n.parentNode,n))},i(s){e||(i(o),e=!0)},o(s){m(o),e=!1},d(s){s&&u(n),r[t].d(s)}}}function X(l,t,o){let n;y(l,D,s=>o(4,n=s));let e,{data:a}=t;function r(s){window.parent.postMessage({height:e.offsetHeight,width:e.offsetWidth,slug:n.params.tag},"*")}P(()=>{a.theme==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.classList.add("dark:bg-background")):(document.documentElement.classList.remove("dark"),document.documentElement.classList.remove("dark:bg-background"))});function c(s){j[s?"unshift":"push"](()=>{e=s,o(1,e)})}return l.$$set=s=>{"data"in s&&o(0,a=s.data)},[a,e,r,c]}class se extends B{constructor(t){super(),W(this,t,X,V,S,{data:0})}}export{se as component}; diff --git a/build/client/_app/immutable/nodes/7.11a20832.js b/build/client/_app/immutable/nodes/7.18ad8054.js similarity index 99% rename from build/client/_app/immutable/nodes/7.11a20832.js rename to build/client/_app/immutable/nodes/7.18ad8054.js index c607f277..d2fd639c 100644 --- a/build/client/_app/immutable/nodes/7.11a20832.js +++ b/build/client/_app/immutable/nodes/7.18ad8054.js @@ -1,2 +1,2 @@ -import{s as Q,e as O,a as E,f as v,z as X,d as u,c as I,g as b,h as C,j as x,r as A,i as g,u as j,x as R,l as U,m as W,F as M}from"../chunks/scheduler.8852886c.js";import{S as Y,i as Z,t as k,c as y,a as w,b as N,d as S,m as P,g as B,e as T}from"../chunks/index.fb8f3617.js";import{e as V}from"../chunks/ctx.1e61a5a6.js";import{M as ee}from"../chunks/monitor.b8d7520d.js";import{C as J,a as K}from"../chunks/Icon.7b7db889.js";import{I as te}from"../chunks/incident.fe542872.js";import{B as z}from"../chunks/axios.baaa6432.js";import"../chunks/paths.0183ef73.js";function H(p,t,n){const e=p.slice();return e[2]=t[n],e}function F(p,t,n){const e=p.slice();return e[5]=t[n],e[7]=n,e}function L(p){return document.title=p[0].monitors[0].name+" Monitor Page",{c:j,l:j,m:j,d:j}}function le(p){let t,n,e,l,f,s,r;l=new z({props:{variant:"outline",$$slots:{default:[ne]},$$scope:{ctx:p}}});let c=V(p[0].openIncidents),m=[];for(let a=0;ak(m[a],1,1,()=>{m[a]=null});return{c(){t=v("section"),n=v("div"),e=v("div"),N(l.$$.fragment),f=E(),s=v("section");for(let a=0;ak(m[a],1,1,()=>{m[a]=null});return{c(){t=v("section"),n=v("div"),e=v("div"),N(l.$$.fragment),f=E(),s=v("section");for(let a=0;ahere.`;return{c(){t=v("h1"),t.textContent=n,e=E(),l=v("p"),l.innerHTML=f,this.h()},l(s){t=b(s,"H1",{class:!0,"data-svelte-h":!0}),M(t)!=="svelte-pnpgii"&&(t.textContent=n),e=I(s),l=b(s,"P",{class:!0,"data-svelte-h":!0}),M(l)!=="svelte-x3h5nn"&&(l.innerHTML=f),this.h()},h(){x(t,"class","scroll-m-20 text-2xl font-extrabold tracking-tight lg:text-2xl text-center"),x(l,"class","mt-3 text-center")},m(s,r){g(s,t,r),g(s,e,r),g(s,l,r)},p:j,d(s){s&&(u(t),u(e),u(l))}}}function re(p){let t,n;return t=new K({props:{class:"pt-4",$$slots:{default:[ae]},$$scope:{ctx:p}}}),{c(){N(t.$$.fragment)},l(e){S(t.$$.fragment,e)},m(e,l){P(t,e,l),n=!0},p(e,l){const f={};l&256&&(f.$$scope={dirty:l,ctx:e}),t.$set(f)},i(e){n||(w(t.$$.fragment,e),n=!0)},o(e){k(t.$$.fragment,e),n=!1},d(e){T(t,e)}}}function ce(p){let t;return{c(){t=U("Availability per Component")},l(n){t=W(n,"Availability per Component")},m(n,e){g(n,t,e)},d(n){n&&u(t)}}}function ie(p){let t,n,e,l="UP",f,s,r,c,m="DEGRADED",h,a,i,d,$="DOWN";return{c(){t=v("span"),n=E(),e=v("span"),e.textContent=l,f=E(),s=v("span"),r=E(),c=v("span"),c.textContent=m,h=E(),a=v("span"),i=E(),d=v("span"),d.textContent=$,this.h()},l(o){t=b(o,"SPAN",{class:!0}),C(t).forEach(u),n=I(o),e=b(o,"SPAN",{class:!0,"data-svelte-h":!0}),M(e)!=="svelte-fd8nbr"&&(e.textContent=l),f=I(o),s=b(o,"SPAN",{class:!0}),C(s).forEach(u),r=I(o),c=b(o,"SPAN",{class:!0,"data-svelte-h":!0}),M(c)!=="svelte-ddctvm"&&(c.textContent=m),h=I(o),a=b(o,"SPAN",{class:!0}),C(a).forEach(u),i=I(o),d=b(o,"SPAN",{class:!0,"data-svelte-h":!0}),M(d)!=="svelte-1o75psw"&&(d.textContent=$),this.h()},h(){x(t,"class","w-[8px] h-[8px] inline-flex rounded-full bg-api-up opacity-75 mr-1"),x(e,"class","mr-3"),x(s,"class","w-[8px] h-[8px] inline-flex rounded-full bg-api-degraded opacity-75 mr-1"),x(c,"class","mr-3"),x(a,"class","w-[8px] h-[8px] inline-flex rounded-full bg-api-down opacity-75 mr-1"),x(d,"class","mr-3")},m(o,_){g(o,t,_),g(o,n,_),g(o,e,_),g(o,f,_),g(o,s,_),g(o,r,_),g(o,c,_),g(o,h,_),g(o,a,_),g(o,i,_),g(o,d,_)},p:j,d(o){o&&(u(t),u(n),u(e),u(f),u(s),u(r),u(c),u(h),u(a),u(i),u(d))}}}function G(p){let t,n;return t=new ee({props:{monitor:p[2],localTz:p[0].localTz}}),{c(){N(t.$$.fragment)},l(e){S(t.$$.fragment,e)},m(e,l){P(t,e,l),n=!0},p(e,l){const f={};l&1&&(f.monitor=e[2]),l&1&&(f.localTz=e[0].localTz),t.$set(f)},i(e){n||(w(t.$$.fragment,e),n=!0)},o(e){k(t.$$.fragment,e),n=!1},d(e){T(t,e)}}}function fe(p){let t,n,e=V(p[0].monitors),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s0&&L(p),a=p[1]&&le(p);const i=[oe,se],d=[];function $(o,_){return o[0].monitors.length>0?0:1}return s=$(p),r=d[s]=i[s](p),{c(){h&&h.c(),t=O(),n=E(),e=v("div"),l=E(),a&&a.c(),f=E(),r.c(),c=O(),this.h()},l(o){const _=X("svelte-11ekmvk",document.head);h&&h.l(_),t=O(),_.forEach(u),n=I(o),e=b(o,"DIV",{class:!0}),C(e).forEach(u),l=I(o),a&&a.l(o),f=I(o),r.l(o),c=O(),this.h()},h(){x(e,"class","mt-32")},m(o,_){h&&h.m(document.head,null),A(document.head,t),g(o,n,_),g(o,e,_),g(o,l,_),a&&a.m(o,_),g(o,f,_),d[s].m(o,_),g(o,c,_),m=!0},p(o,[_]){o[0].monitors.length>0?h||(h=L(o),h.c(),h.m(t.parentNode,t)):h&&(h.d(1),h=null),o[1]&&a.p(o,_);let D=s;s=$(o),s===D?d[s].p(o,_):(B(),k(d[D],1,1,()=>{d[D]=null}),y(),r=d[s],r?r.p(o,_):(r=d[s]=i[s](o),r.c()),w(r,1),r.m(c.parentNode,c))},i(o){m||(w(a),w(r),m=!0)},o(o){k(a),k(r),m=!1},d(o){o&&(u(n),u(e),u(l),u(f),u(c)),h&&h.d(o),u(t),a&&a.d(o),d[s].d(o)}}}function pe(p,t,n){let{data:e}=t,l=e.openIncidents.length>0;return p.$$set=f=>{"data"in f&&n(0,e=f.data)},[e,l]}class we extends Y{constructor(t){super(),Z(this,t,pe,me,Q,{data:0})}}export{we as component}; diff --git a/build/client/_app/version.json b/build/client/_app/version.json index c5665d4d..c95ab0d4 100644 --- a/build/client/_app/version.json +++ b/build/client/_app/version.json @@ -1 +1 @@ -{"version":"1711082439422"} \ No newline at end of file +{"version":"1712895187809"} \ No newline at end of file diff --git a/build/server/chunks/1-5200298c.js b/build/server/chunks/1-c2b013f6.js similarity index 51% rename from build/server/chunks/1-5200298c.js rename to build/server/chunks/1-c2b013f6.js index b6abd443..8600939e 100644 --- a/build/server/chunks/1-5200298c.js +++ b/build/server/chunks/1-c2b013f6.js @@ -1,9 +1,9 @@ const index = 1; let component_cache; const component = async () => component_cache ??= (await import('./error.svelte-e53c3896.js')).default; -const imports = ["_app/immutable/nodes/1.369b6ef7.js","_app/immutable/chunks/scheduler.8852886c.js","_app/immutable/chunks/index.fb8f3617.js","_app/immutable/chunks/stores.ba51b889.js","_app/immutable/chunks/singletons.a5bf3c68.js","_app/immutable/chunks/index.97524e95.js","_app/immutable/chunks/paths.0183ef73.js"]; +const imports = ["_app/immutable/nodes/1.7cee7167.js","_app/immutable/chunks/scheduler.8852886c.js","_app/immutable/chunks/index.fb8f3617.js","_app/immutable/chunks/stores.b8369d52.js","_app/immutable/chunks/singletons.09f1db94.js","_app/immutable/chunks/index.97524e95.js","_app/immutable/chunks/paths.504696e9.js"]; const stylesheets = []; const fonts = []; export { component, fonts, imports, index, stylesheets }; -//# sourceMappingURL=1-5200298c.js.map +//# sourceMappingURL=1-c2b013f6.js.map diff --git a/build/server/chunks/1-5200298c.js.map b/build/server/chunks/1-c2b013f6.js.map similarity index 67% rename from build/server/chunks/1-5200298c.js.map rename to build/server/chunks/1-c2b013f6.js.map index 86151032..1b589c71 100644 --- a/build/server/chunks/1-5200298c.js.map +++ b/build/server/chunks/1-c2b013f6.js.map @@ -1 +1 @@ -{"version":3,"file":"1-5200298c.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.369b6ef7.js\",\"_app/immutable/chunks/scheduler.8852886c.js\",\"_app/immutable/chunks/index.fb8f3617.js\",\"_app/immutable/chunks/stores.ba51b889.js\",\"_app/immutable/chunks/singletons.a5bf3c68.js\",\"_app/immutable/chunks/index.97524e95.js\",\"_app/immutable/chunks/paths.0183ef73.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,0CAA0C,CAAC,8CAA8C,CAAC,yCAAyC,CAAC,yCAAyC,EAAE;AACxT,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"} \ No newline at end of file +{"version":3,"file":"1-c2b013f6.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.7cee7167.js\",\"_app/immutable/chunks/scheduler.8852886c.js\",\"_app/immutable/chunks/index.fb8f3617.js\",\"_app/immutable/chunks/stores.b8369d52.js\",\"_app/immutable/chunks/singletons.09f1db94.js\",\"_app/immutable/chunks/index.97524e95.js\",\"_app/immutable/chunks/paths.504696e9.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,0CAA0C,CAAC,8CAA8C,CAAC,yCAAyC,CAAC,yCAAyC,EAAE;AACxT,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"} \ No newline at end of file diff --git a/build/server/chunks/2-33c4e9d5.js b/build/server/chunks/2-3c89c25e.js similarity index 96% rename from build/server/chunks/2-33c4e9d5.js rename to build/server/chunks/2-3c89c25e.js index e7af649c..8dd00c5a 100644 --- a/build/server/chunks/2-33c4e9d5.js +++ b/build/server/chunks/2-3c89c25e.js @@ -1,4 +1,4 @@ -import { G as GetOpenIncidents, M as Mapper, F as FilterAndInsertMonitorInIncident } from './github-31d08953.js'; +import { G as GetOpenIncidents, M as Mapper, F as FilterAndInsertMonitorInIncident } from './github-c018834c.js'; import { F as FetchData } from './page-576e2fb0.js'; import { p as public_env } from './shared-server-58a5f352.js'; import fs from 'fs-extra'; @@ -48,4 +48,4 @@ const stylesheets = ["_app/immutable/assets/monitor.13f869bc.css","_app/immutabl const fonts = []; export { component, fonts, imports, index, _page_server as server, server_id, stylesheets }; -//# sourceMappingURL=2-33c4e9d5.js.map +//# sourceMappingURL=2-3c89c25e.js.map diff --git a/build/server/chunks/2-33c4e9d5.js.map b/build/server/chunks/2-3c89c25e.js.map similarity index 98% rename from build/server/chunks/2-33c4e9d5.js.map rename to build/server/chunks/2-3c89c25e.js.map index bf3bb7ed..949ecd7e 100644 --- a/build/server/chunks/2-33c4e9d5.js.map +++ b/build/server/chunks/2-3c89c25e.js.map @@ -1 +1 @@ -{"version":3,"file":"2-33c4e9d5.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/_page.server.js","../../../.svelte-kit/adapter-node/nodes/2.js"],"sourcesContent":["import { e as GetOpenIncidents, M as Mapper, F as FilterAndInsertMonitorInIncident } from \"../../chunks/github.js\";\nimport { F as FetchData } from \"../../chunks/page.js\";\nimport { p as public_env } from \"../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nasync function load({ parent }) {\n let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\n const parentData = await parent();\n const siteData = parentData.site;\n const github = siteData.github;\n const monitorsActive = [];\n for (let i = 0; i < monitors.length; i++) {\n if (monitors[i].hidden !== void 0 && monitors[i].hidden === true) {\n continue;\n }\n if (monitors[i].category !== void 0 && monitors[i].category !== \"home\") {\n continue;\n }\n delete monitors[i].api;\n delete monitors[i].defaultStatus;\n let data = await FetchData(monitors[i], parentData.localTz);\n monitors[i].pageData = data;\n monitors[i].activeIncidents = [];\n monitorsActive.push(monitors[i]);\n }\n let openIncidents = await GetOpenIncidents(github);\n let openIncidentsReduced = openIncidents.map(Mapper);\n return {\n monitors: monitorsActive,\n openIncidents: FilterAndInsertMonitorInIncident(openIncidentsReduced, monitorsActive)\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/_page.server.js';\n\nexport const index = 2;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/2.6a901bcb.js\",\"_app/immutable/chunks/scheduler.8852886c.js\",\"_app/immutable/chunks/index.fb8f3617.js\",\"_app/immutable/chunks/ctx.1e61a5a6.js\",\"_app/immutable/chunks/index.97524e95.js\",\"_app/immutable/chunks/monitor.b8d7520d.js\",\"_app/immutable/chunks/axios.baaa6432.js\",\"_app/immutable/chunks/Icon.7b7db889.js\",\"_app/immutable/chunks/index.cd89ef46.js\",\"_app/immutable/chunks/events.b4751e74.js\",\"_app/immutable/chunks/incident.fe542872.js\",\"_app/immutable/chunks/chevron-down.f8b4fb7d.js\"];\nexport const stylesheets = [\"_app/immutable/assets/monitor.13f869bc.css\",\"_app/immutable/assets/incident.d0acbf00.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":";;;;;;;;AAIA,eAAe,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE;AAChC,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,UAAU,GAAG,MAAM,MAAM,EAAE,CAAC;AACpC,EAAE,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC;AACnC,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;AACjC,EAAE,MAAM,cAAc,GAAG,EAAE,CAAC;AAC5B,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC5C,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,IAAI,EAAE;AACtE,MAAM,SAAS;AACf,KAAK;AACL,IAA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C,0CAA0C,CAAC,4CAA4C,CAAC,gDAAgD,EAAE;AAC9gB,MAAC,WAAW,GAAG,CAAC,4CAA4C,CAAC,6CAA6C,EAAE;AAC5G,MAAC,KAAK,GAAG;;;;"} \ No newline at end of file +{"version":3,"file":"2-3c89c25e.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/_page.server.js","../../../.svelte-kit/adapter-node/nodes/2.js"],"sourcesContent":["import { e as GetOpenIncidents, M as Mapper, F as FilterAndInsertMonitorInIncident } from \"../../chunks/github.js\";\nimport { F as FetchData } from \"../../chunks/page.js\";\nimport { p as public_env } from \"../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nasync function load({ parent }) {\n let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\n const parentData = await parent();\n const siteData = parentData.site;\n const github = siteData.github;\n const monitorsActive = [];\n for (let i = 0; i < monitors.length; i++) {\n if (monitors[i].hidden !== void 0 && monitors[i].hidden === true) {\n continue;\n }\n if (monitors[i].category !== void 0 && monitors[i].category !== \"home\") {\n continue;\n }\n delete monitors[i].api;\n delete monitors[i].defaultStatus;\n let data = await FetchData(monitors[i], parentData.localTz);\n monitors[i].pageData = data;\n monitors[i].activeIncidents = [];\n monitorsActive.push(monitors[i]);\n }\n let openIncidents = await GetOpenIncidents(github);\n let openIncidentsReduced = openIncidents.map(Mapper);\n return {\n monitors: monitorsActive,\n openIncidents: FilterAndInsertMonitorInIncident(openIncidentsReduced, monitorsActive)\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/_page.server.js';\n\nexport const index = 2;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/2.6a901bcb.js\",\"_app/immutable/chunks/scheduler.8852886c.js\",\"_app/immutable/chunks/index.fb8f3617.js\",\"_app/immutable/chunks/ctx.1e61a5a6.js\",\"_app/immutable/chunks/index.97524e95.js\",\"_app/immutable/chunks/monitor.b8d7520d.js\",\"_app/immutable/chunks/axios.baaa6432.js\",\"_app/immutable/chunks/Icon.7b7db889.js\",\"_app/immutable/chunks/index.cd89ef46.js\",\"_app/immutable/chunks/events.b4751e74.js\",\"_app/immutable/chunks/incident.fe542872.js\",\"_app/immutable/chunks/chevron-down.f8b4fb7d.js\"];\nexport const stylesheets = [\"_app/immutable/assets/monitor.13f869bc.css\",\"_app/immutable/assets/incident.d0acbf00.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":";;;;;;;;AAIA,eAAe,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE;AAChC,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,UAAU,GAAG,MAAM,MAAM,EAAE,CAAC;AACpC,EAAE,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC;AACnC,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;AACjC,EAAE,MAAM,cAAc,GAAG,EAAE,CAAC;AAC5B,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC5C,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,IAAI,EAAE;AACtE,MAAM,SAAS;AACf,KAAK;AACL,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,KAAK,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,MAAM,EAAE;AAC5E,MAAM,SAAS;AACf,KAAK;AACL,IAAI,OAAO,QAAQ,CAAC,CAAC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e551.js similarity index 88% rename from build/server/chunks/3-817f823c.js rename to build/server/chunks/3-7822e551.js index a463bbc4..e194a365 100644 --- a/build/server/chunks/3-817f823c.js +++ b/build/server/chunks/3-7822e551.js @@ -1,4 +1,4 @@ -import { G as GetOpenIncidents, M as Mapper, F as FilterAndInsertMonitorInIncident } from './github-31d08953.js'; +import { G as GetOpenIncidents, M as Mapper, F as FilterAndInsertMonitorInIncident } from './github-c018834c.js'; import { F as FetchData } from './page-576e2fb0.js'; import { p as public_env } from './shared-server-58a5f352.js'; import fs from 'fs-extra'; @@ -42,9 +42,9 @@ const index = 3; let component_cache; const component = async () => component_cache ??= (await import('./_page.svelte-85f71bac.js')).default; const server_id = "src/routes/category-[category]/+page.server.js"; -const imports = ["_app/immutable/nodes/3.5419bf7f.js","_app/immutable/chunks/scheduler.8852886c.js","_app/immutable/chunks/index.fb8f3617.js","_app/immutable/chunks/ctx.1e61a5a6.js","_app/immutable/chunks/index.97524e95.js","_app/immutable/chunks/monitor.b8d7520d.js","_app/immutable/chunks/axios.baaa6432.js","_app/immutable/chunks/Icon.7b7db889.js","_app/immutable/chunks/index.cd89ef46.js","_app/immutable/chunks/events.b4751e74.js","_app/immutable/chunks/incident.fe542872.js","_app/immutable/chunks/chevron-down.f8b4fb7d.js","_app/immutable/chunks/stores.ba51b889.js","_app/immutable/chunks/singletons.a5bf3c68.js","_app/immutable/chunks/paths.0183ef73.js"]; +const imports = ["_app/immutable/nodes/3.5e894945.js","_app/immutable/chunks/scheduler.8852886c.js","_app/immutable/chunks/index.fb8f3617.js","_app/immutable/chunks/ctx.1e61a5a6.js","_app/immutable/chunks/index.97524e95.js","_app/immutable/chunks/monitor.b8d7520d.js","_app/immutable/chunks/axios.baaa6432.js","_app/immutable/chunks/Icon.7b7db889.js","_app/immutable/chunks/index.cd89ef46.js","_app/immutable/chunks/events.b4751e74.js","_app/immutable/chunks/incident.fe542872.js","_app/immutable/chunks/chevron-down.f8b4fb7d.js","_app/immutable/chunks/stores.b8369d52.js","_app/immutable/chunks/singletons.09f1db94.js","_app/immutable/chunks/paths.504696e9.js"]; const stylesheets = ["_app/immutable/assets/monitor.13f869bc.css","_app/immutable/assets/incident.d0acbf00.css"]; const fonts = []; export { component, fonts, imports, index, _page_server as server, server_id, stylesheets }; -//# sourceMappingURL=3-817f823c.js.map +//# sourceMappingURL=3-7822e551.js.map diff --git a/build/server/chunks/3-817f823c.js.map b/build/server/chunks/3-7822e551.js.map similarity index 94% rename from build/server/chunks/3-817f823c.js.map rename to build/server/chunks/3-7822e551.js.map index 2b68bc31..9692ccec 100644 --- a/build/server/chunks/3-817f823c.js.map +++ b/build/server/chunks/3-7822e551.js.map @@ -1 +1 @@ -{"version":3,"file":"3-817f823c.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/category-_category_/_page.server.js","../../../.svelte-kit/adapter-node/nodes/3.js"],"sourcesContent":["import { e as GetOpenIncidents, M as Mapper, F as FilterAndInsertMonitorInIncident } from \"../../../chunks/github.js\";\nimport { F as FetchData } from \"../../../chunks/page.js\";\nimport { p as public_env } from \"../../../chunks/shared-server.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 parentData = await parent();\n const siteData = parentData.site;\n const github = siteData.github;\n const monitorsActive = [];\n for (let i = 0; i < monitors.length; i++) {\n if (monitors[i].hidden !== void 0 && monitors[i].hidden === true) {\n continue;\n }\n if (monitors[i].category === void 0 || monitors[i].category !== params.category) {\n continue;\n }\n delete monitors[i].api;\n delete monitors[i].defaultStatus;\n let data = await FetchData(monitors[i], parentData.localTz);\n monitors[i].pageData = data;\n monitorsActive.push(monitors[i]);\n }\n let openIncidents = await GetOpenIncidents(github);\n let openIncidentsReduced = openIncidents.map(Mapper);\n return {\n monitors: monitorsActive,\n openIncidents: FilterAndInsertMonitorInIncident(openIncidentsReduced, monitorsActive)\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/category-_category_/_page.server.js';\n\nexport const index = 3;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/category-_category_/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/category-[category]/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/3.5419bf7f.js\",\"_app/immutable/chunks/scheduler.8852886c.js\",\"_app/immutable/chunks/index.fb8f3617.js\",\"_app/immutable/chunks/ctx.1e61a5a6.js\",\"_app/immutable/chunks/index.97524e95.js\",\"_app/immutable/chunks/monitor.b8d7520d.js\",\"_app/immutable/chunks/axios.baaa6432.js\",\"_app/immutable/chunks/Icon.7b7db889.js\",\"_app/immutable/chunks/index.cd89ef46.js\",\"_app/immutable/chunks/events.b4751e74.js\",\"_app/immutable/chunks/incident.fe542872.js\",\"_app/immutable/chunks/chevron-down.f8b4fb7d.js\",\"_app/immutable/chunks/stores.ba51b889.js\",\"_app/immutable/chunks/singletons.a5bf3c68.js\",\"_app/immutable/chunks/paths.0183ef73.js\"];\nexport const stylesheets = [\"_app/immutable/assets/monitor.13f869bc.css\",\"_app/immutable/assets/incident.d0acbf00.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":";;;;;;;;AAIA,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,UAAU,GAAG,MAAM,MAAM,EAAE,CAAC;AACpC,EAAE,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC;AACnC,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;AACjC,EAAE,MAAM,cAAc,GAAG,EAAE,CAAC;AAC5B,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE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S,GAAG,iDAAiD;AAC9D,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,uCAAuC,CAAC,yCAAyC,CAAC,2CAA2C,CAAC,yCAAyC,CAAC,wCAAwC,CAAC,yCAAyC,CAAC,0CAA0C,CAAC,4CAA4C,CAAC,gDAAgD,CAAC,0CAA0C,CAAC,8CAA8C,CAAC,yCAAyC,EAAE;AAClpB,MAAC,WAAW,GAAG,CAAC,4CAA4C,CAAC,6CAA6C,EAAE;AAC5G,MAAC,KAAK,GAAG;;;;"} \ No newline at end of file +{"version":3,"file":"3-7822e551.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/category-_category_/_page.server.js","../../../.svelte-kit/adapter-node/nodes/3.js"],"sourcesContent":["import { e as GetOpenIncidents, M as Mapper, F as FilterAndInsertMonitorInIncident } from \"../../../chunks/github.js\";\nimport { F as FetchData } from \"../../../chunks/page.js\";\nimport { p as public_env } from \"../../../chunks/shared-server.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 parentData = await parent();\n const siteData = parentData.site;\n const github = siteData.github;\n const monitorsActive = [];\n for (let i = 0; i < monitors.length; i++) {\n if (monitors[i].hidden !== void 0 && monitors[i].hidden === true) {\n continue;\n }\n if (monitors[i].category === void 0 || monitors[i].category !== params.category) {\n continue;\n }\n delete monitors[i].api;\n delete monitors[i].defaultStatus;\n let data = await FetchData(monitors[i], parentData.localTz);\n monitors[i].pageData = data;\n monitorsActive.push(monitors[i]);\n }\n let openIncidents = await GetOpenIncidents(github);\n let openIncidentsReduced = openIncidents.map(Mapper);\n return {\n monitors: monitorsActive,\n openIncidents: FilterAndInsertMonitorInIncident(openIncidentsReduced, monitorsActive)\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/category-_category_/_page.server.js';\n\nexport const index = 3;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/category-_category_/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/category-[category]/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/3.5e894945.js\",\"_app/immutable/chunks/scheduler.8852886c.js\",\"_app/immutable/chunks/index.fb8f3617.js\",\"_app/immutable/chunks/ctx.1e61a5a6.js\",\"_app/immutable/chunks/index.97524e95.js\",\"_app/immutable/chunks/monitor.b8d7520d.js\",\"_app/immutable/chunks/axios.baaa6432.js\",\"_app/immutable/chunks/Icon.7b7db889.js\",\"_app/immutable/chunks/index.cd89ef46.js\",\"_app/immutable/chunks/events.b4751e74.js\",\"_app/immutable/chunks/incident.fe542872.js\",\"_app/immutable/chunks/chevron-down.f8b4fb7d.js\",\"_app/immutable/chunks/stores.b8369d52.js\",\"_app/immutable/chunks/singletons.09f1db94.js\",\"_app/immutable/chunks/paths.504696e9.js\"];\nexport const stylesheets = [\"_app/immutable/assets/monitor.13f869bc.css\",\"_app/immutable/assets/incident.d0acbf00.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":";;;;;;;;AAIA,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,UAAU,GAAG,MAAM,MAAM,EAAE,CAAC;AACpC,EAAE,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC;AACnC,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;AACjC,EAAE,MAAM,cAAc,GAAG,EAAE,CAAC;AAC5B,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC5C,IA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A6C,CAAC,yCAAyC,CAAC,uCAAuC,CAAC,yCAAyC,CAAC,2CAA2C,CAAC,yCAAyC,CAAC,wCAAwC,CAAC,yCAAyC,CAAC,0CAA0C,CAAC,4CAA4C,CAAC,gDAAgD,CAAC,0CAA0C,CAAC,8CAA8C,CAAC,yCAAyC,EAAE;AAClpB,MAAC,WAAW,GAAG,CAAC,4CAA4C,CAAC,6CAA6C,EAAE;AAC5G,MAAC,KAAK,GAAG;;;;"} \ No newline at end of file diff --git a/build/server/chunks/5-f1e9d0b4.js b/build/server/chunks/5-56fbbe77.js similarity index 88% rename from build/server/chunks/5-f1e9d0b4.js rename to build/server/chunks/5-56fbbe77.js index bf66dde3..435e472a 100644 --- a/build/server/chunks/5-f1e9d0b4.js +++ b/build/server/chunks/5-56fbbe77.js @@ -35,9 +35,9 @@ const index = 5; let component_cache; const component = async () => component_cache ??= (await import('./_page.svelte-e60523b0.js')).default; const server_id = "src/routes/embed-[tag]/+page.server.js"; -const imports = ["_app/immutable/nodes/5.dec378a2.js","_app/immutable/chunks/scheduler.8852886c.js","_app/immutable/chunks/index.fb8f3617.js","_app/immutable/chunks/ctx.1e61a5a6.js","_app/immutable/chunks/index.97524e95.js","_app/immutable/chunks/monitor.b8d7520d.js","_app/immutable/chunks/axios.baaa6432.js","_app/immutable/chunks/Icon.7b7db889.js","_app/immutable/chunks/index.cd89ef46.js","_app/immutable/chunks/events.b4751e74.js","_app/immutable/chunks/stores.ba51b889.js","_app/immutable/chunks/singletons.a5bf3c68.js","_app/immutable/chunks/paths.0183ef73.js"]; +const imports = ["_app/immutable/nodes/5.c348aae9.js","_app/immutable/chunks/scheduler.8852886c.js","_app/immutable/chunks/index.fb8f3617.js","_app/immutable/chunks/ctx.1e61a5a6.js","_app/immutable/chunks/index.97524e95.js","_app/immutable/chunks/monitor.b8d7520d.js","_app/immutable/chunks/axios.baaa6432.js","_app/immutable/chunks/Icon.7b7db889.js","_app/immutable/chunks/index.cd89ef46.js","_app/immutable/chunks/events.b4751e74.js","_app/immutable/chunks/stores.b8369d52.js","_app/immutable/chunks/singletons.09f1db94.js","_app/immutable/chunks/paths.504696e9.js"]; const stylesheets = ["_app/immutable/assets/monitor.13f869bc.css"]; const fonts = []; export { component, fonts, imports, index, _page_server as server, server_id, stylesheets }; -//# sourceMappingURL=5-f1e9d0b4.js.map +//# sourceMappingURL=5-56fbbe77.js.map diff --git a/build/server/chunks/5-f1e9d0b4.js.map b/build/server/chunks/5-56fbbe77.js.map similarity index 91% rename from build/server/chunks/5-f1e9d0b4.js.map rename to build/server/chunks/5-56fbbe77.js.map index b667d0aa..33febab0 100644 --- a/build/server/chunks/5-f1e9d0b4.js.map +++ b/build/server/chunks/5-56fbbe77.js.map @@ -1 +1 @@ -{"version":3,"file":"5-f1e9d0b4.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/embed-_tag_/_page.server.js","../../../.svelte-kit/adapter-node/nodes/5.js"],"sourcesContent":["import { F as FetchData } from \"../../../chunks/page.js\";\nimport { p as public_env } from \"../../../chunks/shared-server.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 parentData = await parent();\n const monitorsActive = [];\n const query = url.searchParams;\n const theme = query.get(\"theme\");\n for (let i = 0; i < monitors.length; i++) {\n if (monitors[i].tag !== params.tag) {\n continue;\n }\n delete monitors[i].api;\n delete monitors[i].defaultStatus;\n monitors[i].embed = true;\n let data = await FetchData(monitors[i], parentData.localTz);\n monitors[i].pageData = data;\n monitorsActive.push(monitors[i]);\n }\n return {\n monitors: monitorsActive,\n theme,\n openIncidents: []\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/embed-_tag_/_page.server.js';\n\nexport const index = 5;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/embed-_tag_/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/embed-[tag]/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/5.dec378a2.js\",\"_app/immutable/chunks/scheduler.8852886c.js\",\"_app/immutable/chunks/index.fb8f3617.js\",\"_app/immutable/chunks/ctx.1e61a5a6.js\",\"_app/immutable/chunks/index.97524e95.js\",\"_app/immutable/chunks/monitor.b8d7520d.js\",\"_app/immutable/chunks/axios.baaa6432.js\",\"_app/immutable/chunks/Icon.7b7db889.js\",\"_app/immutable/chunks/index.cd89ef46.js\",\"_app/immutable/chunks/events.b4751e74.js\",\"_app/immutable/chunks/stores.ba51b889.js\",\"_app/immutable/chunks/singletons.a5bf3c68.js\",\"_app/immutable/chunks/paths.0183ef73.js\"];\nexport const stylesheets = [\"_app/immutable/assets/monitor.13f869bc.css\"];\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,UAAU,GAAG,MAAM,MAAM,EAAE,CAAC;AACpC,EAAE,MAAM,cAAc,GAAG,EAAE,CAAC;AAC5B,EAAE,MAAM,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC;AACjC,EAAE,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACnC,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC5C,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,EAAE;AACxC,MAAM,SAAS;AACf,KAAK;AACL,IAAI,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAC3B,IAAI,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;AACrC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC;AAC7B,IAAI,IAAI,IAAI,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;AAChE,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC;AAChC,IAAI,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,GAAG;AACH,EAAE,OAAO;AACT,IAAI,QAAQ,EAAE,cAAc;AAC5B,IAAI,KAAK;AACT,IAAI,aAAa,EAAE,EAAE;AACrB,GAAG,CAAC;AACJ;;;;;;;ACvBY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAA8C,CAAC,EAAE,QAAQ;AAEpH,MAAC,SAAS,GAAG,yCAAyC;AACtD,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,uCAAuC,CAAC,yCAAyC,CAAC,2CAA2C,CAAC,yCAAyC,CAAC,wCAAwC,CAAC,yCAAyC,CAAC,0CAA0C,CAAC,0CAA0C,CAAC,8CAA8C,CAAC,yCAAyC,EAAE;AACpjB,MAAC,WAAW,GAAG,CAAC,4CAA4C,EAAE;AAC9D,MAAC,KAAK,GAAG;;;;"} \ No newline at end of file +{"version":3,"file":"5-56fbbe77.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/embed-_tag_/_page.server.js","../../../.svelte-kit/adapter-node/nodes/5.js"],"sourcesContent":["import { F as FetchData } from \"../../../chunks/page.js\";\nimport { p as public_env } from \"../../../chunks/shared-server.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 parentData = await parent();\n const monitorsActive = [];\n const query = url.searchParams;\n const theme = query.get(\"theme\");\n for (let i = 0; i < monitors.length; i++) {\n if (monitors[i].tag !== params.tag) {\n continue;\n }\n delete monitors[i].api;\n delete monitors[i].defaultStatus;\n monitors[i].embed = true;\n let data = await FetchData(monitors[i], parentData.localTz);\n monitors[i].pageData = data;\n monitorsActive.push(monitors[i]);\n }\n return {\n monitors: monitorsActive,\n theme,\n openIncidents: []\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/embed-_tag_/_page.server.js';\n\nexport const index = 5;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/embed-_tag_/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/embed-[tag]/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/5.c348aae9.js\",\"_app/immutable/chunks/scheduler.8852886c.js\",\"_app/immutable/chunks/index.fb8f3617.js\",\"_app/immutable/chunks/ctx.1e61a5a6.js\",\"_app/immutable/chunks/index.97524e95.js\",\"_app/immutable/chunks/monitor.b8d7520d.js\",\"_app/immutable/chunks/axios.baaa6432.js\",\"_app/immutable/chunks/Icon.7b7db889.js\",\"_app/immutable/chunks/index.cd89ef46.js\",\"_app/immutable/chunks/events.b4751e74.js\",\"_app/immutable/chunks/stores.b8369d52.js\",\"_app/immutable/chunks/singletons.09f1db94.js\",\"_app/immutable/chunks/paths.504696e9.js\"];\nexport const stylesheets = [\"_app/immutable/assets/monitor.13f869bc.css\"];\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,C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G,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,uCAAuC,CAAC,yCAAyC,CAAC,2CAA2C,CAAC,yCAAyC,CAAC,wCAAwC,CAAC,yCAAyC,CAAC,0CAA0C,CAAC,0CAA0C,CAAC,8CAA8C,CAAC,yCAAyC,EAAE;AACpjB,MAAC,WAAW,GAAG,CAAC,4CAA4C,EAAE;AAC9D,MAAC,KAAK,GAAG;;;;"} \ No newline at end of file diff --git a/build/server/chunks/6-98296fd1.js b/build/server/chunks/6-862852f6.js similarity index 94% rename from build/server/chunks/6-98296fd1.js rename to build/server/chunks/6-862852f6.js index 15aa5464..2b14befc 100644 --- a/build/server/chunks/6-98296fd1.js +++ b/build/server/chunks/6-862852f6.js @@ -1,5 +1,5 @@ import { p as public_env } from './shared-server-58a5f352.js'; -import { a as GetIncidents, M as Mapper } from './github-31d08953.js'; +import { a as GetIncidents, M as Mapper } from './github-c018834c.js'; import fs from 'fs-extra'; import 'axios'; import './tool-b4b3e524.js'; @@ -40,4 +40,4 @@ const stylesheets = ["_app/immutable/assets/incident.d0acbf00.css"]; const fonts = []; export { component, fonts, imports, index, _page_server as server, server_id, stylesheets }; -//# sourceMappingURL=6-98296fd1.js.map +//# sourceMappingURL=6-862852f6.js.map diff --git a/build/server/chunks/6-98296fd1.js.map b/build/server/chunks/6-862852f6.js.map similarity index 98% rename from build/server/chunks/6-98296fd1.js.map rename to build/server/chunks/6-862852f6.js.map index 0f632125..8eccd8e1 100644 --- a/build/server/chunks/6-98296fd1.js.map +++ b/build/server/chunks/6-862852f6.js.map @@ -1 +1 @@ -{"version":3,"file":"6-98296fd1.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/incident/_id_/_page.server.js","../../../.svelte-kit/adapter-node/nodes/6.js"],"sourcesContent":["import { p as public_env } from \"../../../../chunks/shared-server.js\";\nimport { f 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 = 6;\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/6.b99c92be.js\",\"_app/immutable/chunks/scheduler.8852886c.js\",\"_app/immutable/chunks/index.fb8f3617.js\",\"_app/immutable/chunks/ctx.1e61a5a6.js\",\"_app/immutable/chunks/index.97524e95.js\",\"_app/immutable/chunks/incident.fe542872.js\",\"_app/immutable/chunks/Icon.7b7db889.js\",\"_app/immutable/chunks/index.cd89ef46.js\",\"_app/immutable/chunks/axios.baaa6432.js\",\"_app/immutable/chunks/chevron-down.f8b4fb7d.js\"];\nexport const stylesheets = [\"_app/immutable/assets/incident.d0acbf00.css\"];\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;A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AAM,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,wCAAwC,CAAC,yCAAyC,CAAC,yCAAyC,CAAC,gDAAgD,EAAE;AACvb,MAAC,WAAW,GAAG,CAAC,6CAA6C,EAAE;AAC/D,MAAC,KAAK,GAAG;;;;"} \ No newline at end of file +{"version":3,"file":"6-862852f6.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/incident/_id_/_page.server.js","../../../.svelte-kit/adapter-node/nodes/6.js"],"sourcesContent":["import { p as public_env } from \"../../../../chunks/shared-server.js\";\nimport { f 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 = 6;\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/6.b99c92be.js\",\"_app/immutable/chunks/scheduler.8852886c.js\",\"_app/immutable/chunks/index.fb8f3617.js\",\"_app/immutable/chunks/ctx.1e61a5a6.js\",\"_app/immutable/chunks/index.97524e95.js\",\"_app/immutable/chunks/incident.fe542872.js\",\"_app/immutable/chunks/Icon.7b7db889.js\",\"_app/immutable/chunks/index.cd89ef46.js\",\"_app/immutable/chunks/axios.baaa6432.js\",\"_app/immutable/chunks/chevron-down.f8b4fb7d.js\"];\nexport const stylesheets = [\"_app/immutable/assets/incident.d0acbf00.css\"];\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,wCAAwC,CAAC,yCAAyC,CAAC,yCAAyC,CAAC,gDAAgD,EAAE;AACvb,MAAC,WAAW,GAAG,CAAC,6CAA6C,EAAE;AAC/D,MAAC,KAAK,GAAG;;;;"} \ No newline at end of file diff --git a/build/server/chunks/7-998fb83e.js b/build/server/chunks/7-2b6475c8.js similarity index 90% rename from build/server/chunks/7-998fb83e.js rename to build/server/chunks/7-2b6475c8.js index 33592a4f..b51c8a39 100644 --- a/build/server/chunks/7-998fb83e.js +++ b/build/server/chunks/7-2b6475c8.js @@ -1,4 +1,4 @@ -import { G as GetOpenIncidents, M as Mapper, F as FilterAndInsertMonitorInIncident } from './github-31d08953.js'; +import { G as GetOpenIncidents, M as Mapper, F as FilterAndInsertMonitorInIncident } from './github-c018834c.js'; import { F as FetchData } from './page-576e2fb0.js'; import { p as public_env } from './shared-server-58a5f352.js'; import fs from 'fs-extra'; @@ -39,9 +39,9 @@ const index = 7; let component_cache; const component = async () => component_cache ??= (await import('./_page.svelte-277c90e9.js')).default; const server_id = "src/routes/monitor-[tag]/+page.server.js"; -const imports = ["_app/immutable/nodes/7.11a20832.js","_app/immutable/chunks/scheduler.8852886c.js","_app/immutable/chunks/index.fb8f3617.js","_app/immutable/chunks/ctx.1e61a5a6.js","_app/immutable/chunks/index.97524e95.js","_app/immutable/chunks/monitor.b8d7520d.js","_app/immutable/chunks/axios.baaa6432.js","_app/immutable/chunks/Icon.7b7db889.js","_app/immutable/chunks/index.cd89ef46.js","_app/immutable/chunks/events.b4751e74.js","_app/immutable/chunks/incident.fe542872.js","_app/immutable/chunks/chevron-down.f8b4fb7d.js","_app/immutable/chunks/paths.0183ef73.js"]; +const imports = ["_app/immutable/nodes/7.18ad8054.js","_app/immutable/chunks/scheduler.8852886c.js","_app/immutable/chunks/index.fb8f3617.js","_app/immutable/chunks/ctx.1e61a5a6.js","_app/immutable/chunks/index.97524e95.js","_app/immutable/chunks/monitor.b8d7520d.js","_app/immutable/chunks/axios.baaa6432.js","_app/immutable/chunks/Icon.7b7db889.js","_app/immutable/chunks/index.cd89ef46.js","_app/immutable/chunks/events.b4751e74.js","_app/immutable/chunks/incident.fe542872.js","_app/immutable/chunks/chevron-down.f8b4fb7d.js","_app/immutable/chunks/paths.504696e9.js"]; const stylesheets = ["_app/immutable/assets/monitor.13f869bc.css","_app/immutable/assets/incident.d0acbf00.css"]; const fonts = []; export { component, fonts, imports, index, _page_server as server, server_id, stylesheets }; -//# sourceMappingURL=7-998fb83e.js.map +//# sourceMappingURL=7-2b6475c8.js.map diff --git a/build/server/chunks/7-998fb83e.js.map b/build/server/chunks/7-2b6475c8.js.map similarity index 93% rename from build/server/chunks/7-998fb83e.js.map rename to build/server/chunks/7-2b6475c8.js.map index 969ab572..0722e9b7 100644 --- a/build/server/chunks/7-998fb83e.js.map +++ b/build/server/chunks/7-2b6475c8.js.map @@ -1 +1 @@ -{"version":3,"file":"7-998fb83e.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/monitor-_tag_/_page.server.js","../../../.svelte-kit/adapter-node/nodes/7.js"],"sourcesContent":["import { e as GetOpenIncidents, M as Mapper, F as FilterAndInsertMonitorInIncident } from \"../../../chunks/github.js\";\nimport { F as FetchData } from \"../../../chunks/page.js\";\nimport { p as public_env } from \"../../../chunks/shared-server.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 parentData = await parent();\n const siteData = parentData.site;\n const github = siteData.github;\n const monitorsActive = [];\n for (let i = 0; i < monitors.length; i++) {\n if (monitors[i].tag !== params.tag) {\n continue;\n }\n delete monitors[i].api;\n delete monitors[i].defaultStatus;\n let data = await FetchData(monitors[i], parentData.localTz);\n monitors[i].pageData = data;\n monitorsActive.push(monitors[i]);\n }\n let openIncidents = await GetOpenIncidents(github);\n let openIncidentsReduced = openIncidents.map(Mapper);\n return {\n monitors: monitorsActive,\n openIncidents: FilterAndInsertMonitorInIncident(openIncidentsReduced, monitorsActive)\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/monitor-_tag_/_page.server.js';\n\nexport const index = 7;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/monitor-_tag_/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/monitor-[tag]/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/7.11a20832.js\",\"_app/immutable/chunks/scheduler.8852886c.js\",\"_app/immutable/chunks/index.fb8f3617.js\",\"_app/immutable/chunks/ctx.1e61a5a6.js\",\"_app/immutable/chunks/index.97524e95.js\",\"_app/immutable/chunks/monitor.b8d7520d.js\",\"_app/immutable/chunks/axios.baaa6432.js\",\"_app/immutable/chunks/Icon.7b7db889.js\",\"_app/immutable/chunks/index.cd89ef46.js\",\"_app/immutable/chunks/events.b4751e74.js\",\"_app/immutable/chunks/incident.fe542872.js\",\"_app/immutable/chunks/chevron-down.f8b4fb7d.js\",\"_app/immutable/chunks/paths.0183ef73.js\"];\nexport const stylesheets = [\"_app/immutable/assets/monitor.13f869bc.css\",\"_app/immutable/assets/incident.d0acbf00.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":";;;;;;;;AAIA,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,UAAU,GAAG,MAAM,MAAM,EAAE,CAAC;AACpC,EAAE,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC;AACnC,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;AACjC,EAAE,MAAM,cAAc,GAAG,EAAE,CAAC;AAC5B,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC5C,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,EAAE;AACxC,MAAM,SAAS;AACf,KAAK;AACL,IAAI,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAC3B,IAAI,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;AACrC,IAAI,IAAI,IAAI,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;AAChE,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC;AAChC,IAAI,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,GAAG;AACH,EAAE,IAAI,aAAa,GAAG,MAAM,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACrD,EAAE,IAAI,oBAAoB,GAAG,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACvD,EAAE,OAAO;AACT,IAAI,QAAQ,EAAE,cAAc;AAC5B,IAAI,aAAa,EAAE,gCAAgC,CAAC,oBAAoB,EAAE,cAAc,CAAC;AACzF,GAAG,CAAC;AACJ;;;;;;;ACxBY,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,2CAA2C,CAAC,yCAAyC,CAAC,wCAAwC,CAAC,yCAAyC,CAAC,0CAA0C,CAAC,4CAA4C,CAAC,gDAAgD,CAAC,yCAAyC,EAAE;AACxjB,MAAC,WAAW,GAAG,CAAC,4CAA4C,CAAC,6CAA6C,EAAE;AAC5G,MAAC,KAAK,GAAG;;;;"} \ No newline at end of file +{"version":3,"file":"7-2b6475c8.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/monitor-_tag_/_page.server.js","../../../.svelte-kit/adapter-node/nodes/7.js"],"sourcesContent":["import { e as GetOpenIncidents, M as Mapper, F as FilterAndInsertMonitorInIncident } from \"../../../chunks/github.js\";\nimport { F as FetchData } from \"../../../chunks/page.js\";\nimport { p as public_env } from \"../../../chunks/shared-server.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 parentData = await parent();\n const siteData = parentData.site;\n const github = siteData.github;\n const monitorsActive = [];\n for (let i = 0; i < monitors.length; i++) {\n if (monitors[i].tag !== params.tag) {\n continue;\n }\n delete monitors[i].api;\n delete monitors[i].defaultStatus;\n let data = await FetchData(monitors[i], parentData.localTz);\n monitors[i].pageData = data;\n monitorsActive.push(monitors[i]);\n }\n let openIncidents = await GetOpenIncidents(github);\n let openIncidentsReduced = openIncidents.map(Mapper);\n return {\n monitors: monitorsActive,\n openIncidents: FilterAndInsertMonitorInIncident(openIncidentsReduced, monitorsActive)\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/monitor-_tag_/_page.server.js';\n\nexport const index = 7;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/monitor-_tag_/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/monitor-[tag]/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/7.18ad8054.js\",\"_app/immutable/chunks/scheduler.8852886c.js\",\"_app/immutable/chunks/index.fb8f3617.js\",\"_app/immutable/chunks/ctx.1e61a5a6.js\",\"_app/immutable/chunks/index.97524e95.js\",\"_app/immutable/chunks/monitor.b8d7520d.js\",\"_app/immutable/chunks/axios.baaa6432.js\",\"_app/immutable/chunks/Icon.7b7db889.js\",\"_app/immutable/chunks/index.cd89ef46.js\",\"_app/immutable/chunks/events.b4751e74.js\",\"_app/immutable/chunks/incident.fe542872.js\",\"_app/immutable/chunks/chevron-down.f8b4fb7d.js\",\"_app/immutable/chunks/paths.504696e9.js\"];\nexport const stylesheets = [\"_app/immutable/assets/monitor.13f869bc.css\",\"_app/immutable/assets/incident.d0acbf00.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":";;;;;;;;AAIA,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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,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,2CAA2C,CAAC,yCAAyC,CAAC,wCAAwC,CAAC,yCAAyC,CAAC,0CAA0C,CAAC,4CAA4C,CAAC,gDAAgD,CAAC,yCAAyC,EAAE;AACxjB,MAAC,WAAW,GAAG,CAAC,4CAA4C,CAAC,6CAA6C,EAAE;AAC5G,MAAC,KAAK,GAAG;;;;"} \ No newline at end of file diff --git a/build/server/chunks/_server-63565456.js b/build/server/chunks/_server-00acfba6.js similarity index 95% rename from build/server/chunks/_server-63565456.js rename to build/server/chunks/_server-00acfba6.js index 47502594..62a928e5 100644 --- a/build/server/chunks/_server-63565456.js +++ b/build/server/chunks/_server-00acfba6.js @@ -1,6 +1,6 @@ import { j as json } from './index-2b68e648.js'; -import { a as auth, P as ParseIncidentPayload, G as GHIssueToKenerIncident } from './webhook-926b85d0.js'; -import { U as UpdateIssue, b as GetIncidentByNumber } from './github-31d08953.js'; +import { a as auth, P as ParseIncidentPayload, G as GHIssueToKenerIncident } from './webhook-c20a13d6.js'; +import { U as UpdateIssue, b as GetIncidentByNumber } from './github-c018834c.js'; import { p as public_env } from './shared-server-58a5f352.js'; import fs from 'fs-extra'; import './helpers-0acb6e43.js'; @@ -81,4 +81,4 @@ async function GET({ request, params }) { } export { GET, PATCH }; -//# sourceMappingURL=_server-63565456.js.map +//# sourceMappingURL=_server-00acfba6.js.map diff --git a/build/server/chunks/_server-63565456.js.map b/build/server/chunks/_server-00acfba6.js.map similarity index 98% rename from build/server/chunks/_server-63565456.js.map rename to build/server/chunks/_server-00acfba6.js.map index fd80adcc..d4e142de 100644 --- a/build/server/chunks/_server-63565456.js.map +++ b/build/server/chunks/_server-00acfba6.js.map @@ -1 +1 @@ -{"version":3,"file":"_server-63565456.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 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 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,MA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C,CAAC;AACL;;;;"} \ No newline at end of file +{"version":3,"file":"_server-00acfba6.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 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 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,EA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AG;AACf,GAAG,CAAC,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/build/server/chunks/_server-7b4a554d.js b/build/server/chunks/_server-1eceb496.js similarity index 95% rename from build/server/chunks/_server-7b4a554d.js rename to build/server/chunks/_server-1eceb496.js index 20365c06..1fc0180e 100644 --- a/build/server/chunks/_server-7b4a554d.js +++ b/build/server/chunks/_server-1eceb496.js @@ -1,6 +1,6 @@ import { j as json } from './index-2b68e648.js'; -import { a as auth } from './webhook-926b85d0.js'; -import { c as GetCommentsForIssue, A as AddComment } from './github-31d08953.js'; +import { a as auth } from './webhook-c20a13d6.js'; +import { c as GetCommentsForIssue, A as AddComment } from './github-c018834c.js'; import { p as public_env } from './shared-server-58a5f352.js'; import fs from 'fs-extra'; import './helpers-0acb6e43.js'; @@ -97,4 +97,4 @@ async function POST({ request, params }) { } export { GET, POST }; -//# sourceMappingURL=_server-7b4a554d.js.map +//# sourceMappingURL=_server-1eceb496.js.map diff --git a/build/server/chunks/_server-7b4a554d.js.map b/build/server/chunks/_server-1eceb496.js.map similarity index 98% rename from build/server/chunks/_server-7b4a554d.js.map rename to build/server/chunks/_server-1eceb496.js.map index 8b176b89..ede17940 100644 --- a/build/server/chunks/_server-7b4a554d.js.map +++ b/build/server/chunks/_server-1eceb496.js.map @@ -1 +1 @@ -{"version":3,"file":"_server-7b4a554d.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/incident/_incidentNumber_/comment/_server.js"],"sourcesContent":["import { j as json } from \"../../../../../../chunks/index.js\";\nimport { a as auth } from \"../../../../../../chunks/webhook.js\";\nimport { a as GetCommentsForIssue, A as AddComment } from \"../../../../../../chunks/github.js\";\nimport { p as public_env } from \"../../../../../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nasync function GET({ 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 if (!incidentNumber || isNaN(incidentNumber)) {\n return json(\n { error: \"Invalid incidentNumber\" },\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 GetCommentsForIssue(incidentNumber, github);\n return json(\n resp.map((comment) => {\n return {\n commentID: comment.id,\n body: comment.body,\n createdAt: Math.floor(new Date(comment.created_at).getTime() / 1e3)\n };\n }),\n {\n status: 200\n }\n );\n}\nasync function POST({ 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 if (!incidentNumber || isNaN(incidentNumber)) {\n return json(\n { error: \"Invalid incidentNumber\" },\n {\n status: 400\n }\n );\n }\n const payload = await request.json();\n let body = payload.body;\n if (!body || typeof body !== \"string\") {\n return json(\n { error: \"Invalid body\" },\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 AddComment(github, incidentNumber, body);\n if (resp === null) {\n return json(\n { error: \"github error\" },\n {\n status: 400\n }\n );\n }\n return json(\n {\n commentID: resp.id,\n body: resp.body,\n createdAt: Math.floor(new Date(resp.created_at).getTime() / 1e3)\n },\n {\n status: 200\n }\n );\n}\nexport {\n GET,\n POST\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAKA,eAAe,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;AACxC,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,CAA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MAAM,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC;AACtE,KAAK;AACL,IAAI;AACJ,MAAM,MAAM,EAAE,GAAG;AACjB,KAAK;AACL,GAAG,CAAC;AACJ;;;;"} \ No newline at end of file +{"version":3,"file":"_server-1eceb496.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/incident/_incidentNumber_/comment/_server.js"],"sourcesContent":["import { j as json } from \"../../../../../../chunks/index.js\";\nimport { a as auth } from \"../../../../../../chunks/webhook.js\";\nimport { a as GetCommentsForIssue, A as AddComment } from \"../../../../../../chunks/github.js\";\nimport { p as public_env } from \"../../../../../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nasync function GET({ 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 if (!incidentNumber || isNaN(incidentNumber)) {\n return json(\n { error: \"Invalid incidentNumber\" },\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 GetCommentsForIssue(incidentNumber, github);\n return json(\n resp.map((comment) => {\n return {\n commentID: comment.id,\n body: comment.body,\n createdAt: Math.floor(new Date(comment.created_at).getTime() / 1e3)\n };\n }),\n {\n status: 200\n }\n );\n}\nasync function POST({ 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 if (!incidentNumber || isNaN(incidentNumber)) {\n return json(\n { error: \"Invalid incidentNumber\" },\n {\n status: 400\n }\n );\n }\n const payload = await request.json();\n let body = payload.body;\n if (!body || typeof body !== \"string\") {\n return json(\n { error: \"Invalid body\" },\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 AddComment(github, incidentNumber, body);\n if (resp === null) {\n return json(\n { error: \"github error\" },\n {\n status: 400\n }\n );\n }\n return json(\n {\n commentID: resp.id,\n body: resp.body,\n createdAt: Math.floor(new Date(resp.created_at).getTime() / 1e3)\n },\n {\n status: 200\n }\n );\n}\nexport {\n GET,\n POST\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAKA,eAAe,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;AACxC,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,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,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,mBAAmB,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;AAC/D,EAAE,OAAO,IAAI;AACb,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK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E,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,UAAU,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;AAC5D,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;AACb,IAAI;AACJ,MAAM,SAAS,EAAE,IAAI,CAAC,EAAE;AACxB,MAAM,IAAI,EAAE,IAAI,CAAC,IAAI;AACrB,MAAM,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC;AACtE,KAAK;AACL,IAAI;AACJ,MAAM,MAAM,EAAE,GAAG;AACjB,KAAK;AACL,GAAG,CAAC;AACJ;;;;"} \ No newline at end of file diff --git a/build/server/chunks/_server-26398a09.js b/build/server/chunks/_server-26398a09.js deleted file mode 100644 index b1495710..00000000 --- a/build/server/chunks/_server-26398a09.js +++ /dev/null @@ -1,49 +0,0 @@ -import { j as json } from './index-2b68e648.js'; -import { a as auth, P as ParseIncidentPayload, G as GHIssueToKenerIncident } from './webhook-926b85d0.js'; -import { C as CreateIssue } from './github-31d08953.js'; -import { p as public_env } from './shared-server-58a5f352.js'; -import fs from 'fs-extra'; -import './helpers-0acb6e43.js'; -import './tool-b4b3e524.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-26398a09.js.map diff --git a/build/server/chunks/_server-26398a09.js.map b/build/server/chunks/_server-26398a09.js.map deleted file mode 100644 index 1aedfde7..00000000 --- a/build/server/chunks/_server-26398a09.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_server-26398a09.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,I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,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/build/server/chunks/_server-4d31f7cf.js b/build/server/chunks/_server-4d31f7cf.js new file mode 100644 index 00000000..b4a87b2a --- /dev/null +++ b/build/server/chunks/_server-4d31f7cf.js @@ -0,0 +1,115 @@ +import { j as json } from './index-2b68e648.js'; +import { a as auth, P as ParseIncidentPayload, G as GHIssueToKenerIncident } from './webhook-c20a13d6.js'; +import { C as CreateIssue, S as SearchIssue } from './github-c018834c.js'; +import { p as public_env } from './shared-server-58a5f352.js'; +import fs from 'fs-extra'; +import './helpers-0acb6e43.js'; +import './tool-b4b3e524.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 + }); +} +async function GET({ request, url }) { + const authError = auth(request); + if (authError !== null) { + return json( + { error: authError.message }, + { + status: 401 + } + ); + } + const query = url.searchParams; + const state = query.get("state") || "open"; + const tags = query.get("tags") || ""; + const page = query.get("page") || 1; + const per_page = query.get("per_page") || 10; + const createdAfter = query.get("created_after_utc") || ""; + const createdBefore = query.get("created_before_utc") || ""; + const titleLike = query.get("title_like") || ""; + if (state !== "open" && state !== "closed") { + return json( + { error: "state must be open or closed" }, + { + status: 400 + } + ); + } + let site = JSON.parse( + fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8") + ); + let github = site.github; + const repo = `${github.owner}/${github.repo}`; + const is = "issue"; + const filterArray = [ + `repo:${repo}`, + `is:${is}`, + `state:${state}`, + `label:incident`, + `sort:created-desc`, + `label:${tags.split(",").map((tag) => tag.trim()).join(",")}` + ]; + if (createdBefore && createdAfter) { + let dateFilter = ""; + let iso = new Date(createdAfter * 1e3).toISOString(); + dateFilter += `created:${iso}`; + iso = new Date(createdBefore * 1e3).toISOString(); + dateFilter += `..${iso}`; + filterArray.push(dateFilter); + } else if (createdAfter) { + let iso = new Date(createdAfter * 1e3).toISOString(); + filterArray.push(`created:>=${iso}`); + } else if (createdBefore) { + let iso = new Date(createdBefore * 1e3).toISOString(); + filterArray.push(`created:<=${iso}`); + } + if (titleLike) { + filterArray.unshift(`${titleLike} in:title`); + } + const resp = await SearchIssue(filterArray, page, per_page); + const incidents = resp.items.map((issue) => GHIssueToKenerIncident(issue)); + return json( + incidents, + { + status: 200 + } + ); +} + +export { GET, POST }; +//# sourceMappingURL=_server-4d31f7cf.js.map diff --git a/build/server/chunks/_server-4d31f7cf.js.map b/build/server/chunks/_server-4d31f7cf.js.map new file mode 100644 index 00000000..aa3d0bca --- /dev/null +++ b/build/server/chunks/_server-4d31f7cf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"_server-4d31f7cf.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, S as SearchIssue } 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}\nasync function GET({ request, url }) {\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 query = url.searchParams;\n const state = query.get(\"state\") || \"open\";\n const tags = query.get(\"tags\") || \"\";\n const page = query.get(\"page\") || 1;\n const per_page = query.get(\"per_page\") || 10;\n const createdAfter = query.get(\"created_after_utc\") || \"\";\n const createdBefore = query.get(\"created_before_utc\") || \"\";\n const titleLike = query.get(\"title_like\") || \"\";\n if (state !== \"open\" && state !== \"closed\") {\n return json(\n { error: \"state must be open or closed\" },\n {\n status: 400\n }\n );\n }\n let site = JSON.parse(\n fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/site.json\", \"utf8\")\n );\n let github = site.github;\n const repo = `${github.owner}/${github.repo}`;\n const is = \"issue\";\n const filterArray = [\n `repo:${repo}`,\n `is:${is}`,\n `state:${state}`,\n `label:incident`,\n `sort:created-desc`,\n `label:${tags.split(\",\").map((tag) => tag.trim()).join(\",\")}`\n ];\n if (createdBefore && createdAfter) {\n let dateFilter = \"\";\n let iso = new Date(createdAfter * 1e3).toISOString();\n dateFilter += `created:${iso}`;\n iso = new Date(createdBefore * 1e3).toISOString();\n dateFilter += `..${iso}`;\n filterArray.push(dateFilter);\n } else if (createdAfter) {\n let iso = new Date(createdAfter * 1e3).toISOString();\n filterArray.push(`created:>=${iso}`);\n } else if (createdBefore) {\n let iso = new Date(createdBefore * 1e3).toISOString();\n filterArray.push(`created:<=${iso}`);\n }\n if (titleLike) {\n filterArray.unshift(`${titleLike} in:title`);\n }\n const resp = await SearchIssue(filterArray, page, per_page);\n const incidents = resp.items.map((issue) => GHIssueToKenerIncident(issue));\n return json(\n incidents,\n {\n status: 200\n }\n );\n}\nexport {\n GET,\n POST\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAKA,eAA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AC;AACjC,GAAG,MAAM,IAAI,YAAY,EAAE;AAC3B,IAAI,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;AACzD,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AACzC,GAAG,MAAM,IAAI,aAAa,EAAE;AAC5B,IAAI,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;AAC1D,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AACzC,GAAG;AACH,EAAE,IAAI,SAAS,EAAE;AACjB,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;AACjD,GAAG;AACH,EAAE,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,WAAW,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC9D,EAAE,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7E,EAAE,OAAO,IAAI;AACb,IAAI,SAAS;AACb,IAAI;AACJ,MAAM,MAAM,EAAE,GAAG;AACjB,KAAK;AACL,GAAG,CAAC;AACJ;;;;"} \ No newline at end of file diff --git a/build/server/chunks/_server-8c01e71b.js b/build/server/chunks/_server-694895e5.js similarity index 96% rename from build/server/chunks/_server-8c01e71b.js rename to build/server/chunks/_server-694895e5.js index 66f96b4e..c991a18a 100644 --- a/build/server/chunks/_server-8c01e71b.js +++ b/build/server/chunks/_server-694895e5.js @@ -1,6 +1,6 @@ import { j as json } from './index-2b68e648.js'; -import { a as auth, G as GHIssueToKenerIncident } from './webhook-926b85d0.js'; -import { b as GetIncidentByNumber, d as UpdateIssueLabels } from './github-31d08953.js'; +import { a as auth, G as GHIssueToKenerIncident } from './webhook-c20a13d6.js'; +import { b as GetIncidentByNumber, d as UpdateIssueLabels } from './github-c018834c.js'; import { p as public_env } from './shared-server-58a5f352.js'; import fs from 'fs-extra'; import './helpers-0acb6e43.js'; @@ -87,4 +87,4 @@ async function POST({ request, params }) { } export { POST }; -//# sourceMappingURL=_server-8c01e71b.js.map +//# sourceMappingURL=_server-694895e5.js.map diff --git a/build/server/chunks/_server-8c01e71b.js.map b/build/server/chunks/_server-694895e5.js.map similarity index 98% rename from build/server/chunks/_server-8c01e71b.js.map rename to build/server/chunks/_server-694895e5.js.map index f90d0016..d6597bf7 100644 --- a/build/server/chunks/_server-8c01e71b.js.map +++ b/build/server/chunks/_server-694895e5.js.map @@ -1 +1 @@ -{"version":3,"file":"_server-8c01e71b.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/incident/_incidentNumber_/status/_server.js"],"sourcesContent":["import { j as json } from \"../../../../../../chunks/index.js\";\nimport { a as auth, G as GHIssueToKenerIncident } from \"../../../../../../chunks/webhook.js\";\nimport { G as GetIncidentByNumber, b as UpdateIssueLabels } from \"../../../../../../chunks/github.js\";\nimport { p as public_env } from \"../../../../../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nasync function POST({ request, params }) {\n const payload = await request.json();\n const incidentNumber = params.incidentNumber;\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 isIdentified = payload.isIdentified;\n let isResolved = payload.isResolved;\n let endDatetime = payload.endDatetime;\n if (!incidentNumber || isNaN(incidentNumber)) {\n return json(\n { error: \"Invalid incidentNumber\" },\n {\n status: 400\n }\n );\n }\n if (endDatetime && typeof endDatetime !== \"number\") {\n return json(\n { error: \"Invalid endDatetime\" },\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 issue = await GetIncidentByNumber(github, incidentNumber);\n if (issue === null) {\n return json(\n { error: \"github error\" },\n {\n status: 400\n }\n );\n }\n let labels = issue.labels.map((label) => {\n return label.name;\n });\n if (isIdentified !== void 0) {\n labels = labels.filter((label) => label !== \"identified\");\n if (isIdentified === true) {\n labels.push(\"identified\");\n }\n }\n if (isResolved !== void 0) {\n labels = labels.filter((label) => label !== \"resolved\");\n if (isResolved === true) {\n labels.push(\"resolved\");\n }\n }\n let body = issue.body;\n if (endDatetime) {\n body = body.replace(/\\[end_datetime:(\\d+)\\]/g, \"\");\n body = body.trim();\n body = body + ` [end_datetime:${endDatetime}]`;\n }\n let resp = await UpdateIssueLabels(github, incidentNumber, labels, body);\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,MAAM,EAAE,EAAE;AACzC,EAAE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;AACvC,EAAE,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAC/C,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,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAC1C,EAAE,IAAI,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;AACtC,EAAE,IAAI,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;AACxC,EAAE,IAAI,CAAC,cAAc,IAAI,KAAK,CAAC,cAAc,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ChC,KAAK;AACL,GAAG;AACH,EAAE,IAAI,UAAU,KAAK,KAAK,CAAC,EAAE;AAC7B,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,KAAK,UAAU,CAAC,CAAC;AAC5D,IAAI,IAAI,UAAU,KAAK,IAAI,EAAE;AAC7B,MAAM,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG;AACH,EAAE,IAAI,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;AACxB,EAAE,IAAI,WAAW,EAAE;AACnB,IAAI,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC;AACvD,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;AACvB,IAAI,IAAI,GAAG,IAAI,GAAG,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;AACnD,GAAG;AACH,EAAE,IAAI,IAAI,GAAG,MAAM,iBAAiB,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AAC3E,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;;;;"} \ No newline at end of file +{"version":3,"file":"_server-694895e5.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/incident/_incidentNumber_/status/_server.js"],"sourcesContent":["import { j as json } from \"../../../../../../chunks/index.js\";\nimport { a as auth, G as GHIssueToKenerIncident } from \"../../../../../../chunks/webhook.js\";\nimport { G as GetIncidentByNumber, b as UpdateIssueLabels } from \"../../../../../../chunks/github.js\";\nimport { p as public_env } from \"../../../../../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nasync function POST({ request, params }) {\n const payload = await request.json();\n const incidentNumber = params.incidentNumber;\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 isIdentified = payload.isIdentified;\n let isResolved = payload.isResolved;\n let endDatetime = payload.endDatetime;\n if (!incidentNumber || isNaN(incidentNumber)) {\n return json(\n { error: \"Invalid incidentNumber\" },\n {\n status: 400\n }\n );\n }\n if (endDatetime && typeof endDatetime !== \"number\") {\n return json(\n { error: \"Invalid endDatetime\" },\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 issue = await GetIncidentByNumber(github, incidentNumber);\n if (issue === null) {\n return json(\n { error: \"github error\" },\n {\n status: 400\n }\n );\n }\n let labels = issue.labels.map((label) => {\n return label.name;\n });\n if (isIdentified !== void 0) {\n labels = labels.filter((label) => label !== \"identified\");\n if (isIdentified === true) {\n labels.push(\"identified\");\n }\n }\n if (isResolved !== void 0) {\n labels = labels.filter((label) => label !== \"resolved\");\n if (isResolved === true) {\n labels.push(\"resolved\");\n }\n }\n let body = issue.body;\n if (endDatetime) {\n body = body.replace(/\\[end_datetime:(\\d+)\\]/g, \"\");\n body = body.trim();\n body = body + ` [end_datetime:${endDatetime}]`;\n }\n let resp = await UpdateIssueLabels(github, incidentNumber, labels, body);\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,MAAM,EAAE,EAAE;AACzC,EAAE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAA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AC,CAAC;AAC3E,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;;;;"} \ No newline at end of file diff --git a/build/server/chunks/_server-cdb4368c.js b/build/server/chunks/_server-9ca44fa7.js similarity index 87% rename from build/server/chunks/_server-cdb4368c.js rename to build/server/chunks/_server-9ca44fa7.js index 4cbeca07..d5a1970c 100644 --- a/build/server/chunks/_server-cdb4368c.js +++ b/build/server/chunks/_server-9ca44fa7.js @@ -1,7 +1,7 @@ import { j as json } from './index-2b68e648.js'; import { p as public_env } from './shared-server-58a5f352.js'; import fs from 'fs-extra'; -import { c as GetCommentsForIssue } from './github-31d08953.js'; +import { c as GetCommentsForIssue } from './github-c018834c.js'; import { marked } from 'marked'; import 'axios'; import './tool-b4b3e524.js'; @@ -23,4 +23,4 @@ async function GET({ params }) { } export { GET }; -//# sourceMappingURL=_server-cdb4368c.js.map +//# sourceMappingURL=_server-9ca44fa7.js.map diff --git a/build/server/chunks/_server-cdb4368c.js.map b/build/server/chunks/_server-9ca44fa7.js.map similarity index 96% rename from build/server/chunks/_server-cdb4368c.js.map rename to build/server/chunks/_server-9ca44fa7.js.map index 89e74b25..a65f4561 100644 --- a/build/server/chunks/_server-cdb4368c.js.map +++ b/build/server/chunks/_server-9ca44fa7.js.map @@ -1 +1 @@ -{"version":3,"file":"_server-cdb4368c.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/incident/_id_/comments/_server.js"],"sourcesContent":["import { j as json } from \"../../../../../chunks/index.js\";\nimport { p as public_env } from \"../../../../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nimport { a as GetCommentsForIssue } from \"../../../../../chunks/github.js\";\nimport { marked } from \"marked\";\nasync function GET({ params }) {\n const incidentNumber = params.id;\n let siteData = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/site.json\", \"utf8\"));\n let comments = await GetCommentsForIssue(incidentNumber, siteData.github);\n comments = comments.map((comment) => {\n const html = marked.parse(comment.body);\n return {\n body: html,\n created_at: comment.created_at,\n updated_at: comment.updated_at,\n html_url: comment.html_url\n };\n });\n return json(comments);\n}\nexport {\n GET\n};\n"],"names":[],"mappings":";;;;;;;;AAKA,eAAe,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE;AAC/B,EAAE,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAC;AACnC,EAAE,IAAI,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AACpG,EAAE,IAAI,QAAQ,GAAG,MAAM,mBAAmB,CAAC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC5E,EAAE,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK;AACvC,IAAI,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC5C,IAAI,OAAO;AACX,MAAM,IAAI,EAAE,IAAI;AAChB,MAAM,UAAU,EAAE,OAAO,CAAC,UAAU;AACpC,MAAM,UAAU,EAAE,OAAO,CAAC,UAAU;AACpC,MAAM,QAAQ,EAAE,OAAO,CAAC,QAAQ;AAChC,KAAK,CAAC;AACN,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC;AACxB;;;;"} \ No newline at end of file +{"version":3,"file":"_server-9ca44fa7.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/incident/_id_/comments/_server.js"],"sourcesContent":["import { j as json } from \"../../../../../chunks/index.js\";\nimport { p as public_env } from \"../../../../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nimport { a as GetCommentsForIssue } from \"../../../../../chunks/github.js\";\nimport { marked } from \"marked\";\nasync function GET({ params }) {\n const incidentNumber = params.id;\n let siteData = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/site.json\", \"utf8\"));\n let comments = await GetCommentsForIssue(incidentNumber, siteData.github);\n comments = comments.map((comment) => {\n const html = marked.parse(comment.body);\n return {\n body: html,\n created_at: comment.created_at,\n updated_at: comment.updated_at,\n html_url: comment.html_url\n };\n });\n return json(comments);\n}\nexport {\n GET\n};\n"],"names":[],"mappings":";;;;;;;;AAKA,eAAe,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE;AAC/B,EAAE,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAC;AACnC,EAAE,IAAI,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AACpG,EAAE,IAAI,QAAQ,GAAG,MAAM,mBAAmB,CAAC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC5E,EAAE,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK;AACvC,IAAI,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC5C,IAAI,OAAO;AACX,MAAM,IAAI,EAAE,IAAI;AAChB,MAAM,UAAU,EAAE,OAAO,CAAC,UAAU;AACpC,MAAM,UAAU,EAAE,OAAO,CAAC,UAAU;AACpC,MAAM,QAAQ,EAAE,OAAO,CAAC,QAAQ;AAChC,KAAK,CAAC;AACN,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC;AACxB;;;;"} \ No newline at end of file diff --git a/build/server/chunks/_server-5029a90c.js b/build/server/chunks/_server-ae1296e5.js similarity index 91% rename from build/server/chunks/_server-5029a90c.js rename to build/server/chunks/_server-ae1296e5.js index 3f88e736..18a4fb2c 100644 --- a/build/server/chunks/_server-5029a90c.js +++ b/build/server/chunks/_server-ae1296e5.js @@ -1,10 +1,10 @@ import { j as json } from './index-2b68e648.js'; -import { a as auth, s as store, b as GetMonitorStatusByTag } from './webhook-926b85d0.js'; +import { a as auth, s as store, b as GetMonitorStatusByTag } from './webhook-c20a13d6.js'; import 'fs-extra'; import './shared-server-58a5f352.js'; import './helpers-0acb6e43.js'; import './tool-b4b3e524.js'; -import './github-31d08953.js'; +import './github-c018834c.js'; import 'axios'; import 'marked'; import 'randomstring'; @@ -51,4 +51,4 @@ async function GET({ request, url }) { } export { GET, POST }; -//# sourceMappingURL=_server-5029a90c.js.map +//# sourceMappingURL=_server-ae1296e5.js.map diff --git a/build/server/chunks/_server-5029a90c.js.map b/build/server/chunks/_server-ae1296e5.js.map similarity index 97% rename from build/server/chunks/_server-5029a90c.js.map rename to build/server/chunks/_server-ae1296e5.js.map index 48405f2c..91633f40 100644 --- a/build/server/chunks/_server-5029a90c.js.map +++ b/build/server/chunks/_server-ae1296e5.js.map @@ -1 +1 @@ -{"version":3,"file":"_server-5029a90c.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, b as GetMonitorStatusByTag } 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}\nasync function GET({ request, url }) {\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 query = url.searchParams;\n const tag = query.get(\"tag\");\n if (!!!tag) {\n return json(\n { error: \"tag missing\" },\n {\n status: 400\n }\n );\n }\n return json(GetMonitorStatusByTag(tag), {\n status: 200\n });\n}\nexport {\n GET,\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,CAAC;AACD,eAAe,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE;AACrC,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,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC;AACjC,EAAE,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC/B,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE;AACd,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE;AAC9B,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE;AAC1C,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL;;;;"} \ No newline at end of file +{"version":3,"file":"_server-ae1296e5.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, b as GetMonitorStatusByTag } 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}\nasync function GET({ request, url }) {\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 query = url.searchParams;\n const tag = query.get(\"tag\");\n if (!!!tag) {\n return json(\n { error: \"tag missing\" },\n {\n status: 400\n }\n );\n }\n return json(GetMonitorStatusByTag(tag), {\n status: 200\n });\n}\nexport {\n GET,\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,CAAC;AACD,eAAe,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE;AACrC,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,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC;AACjC,EAAE,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC/B,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE;AACd,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE;AAC9B,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE;AAC1C,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/build/server/chunks/github-31d08953.js.map b/build/server/chunks/github-31d08953.js.map deleted file mode 100644 index 4070c9ba..00000000 --- a/build/server/chunks/github-31d08953.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"github-31d08953.js","sources":["../../../.svelte-kit/adapter-node/chunks/github.js"],"sourcesContent":["import axios from \"axios\";\nimport { b as GetMinuteStartNowTimestampUTC } from \"./tool.js\";\nimport { marked } from \"marked\";\nconst GH_TOKEN = process.env.GH_TOKEN;\nconst GhnotconfireguredMsg = \"owner or repo or GH_TOKEN is undefined. Read the docs to configure github: https://kener.ing/docs#h2github-setup\";\nfunction getAxiosOptions(url) {\n const options = {\n url,\n method: \"GET\",\n headers: {\n Accept: \"application/vnd.github+json\",\n Authorization: \"Bearer \" + GH_TOKEN,\n \"X-GitHub-Api-Version\": \"2022-11-28\"\n }\n };\n return options;\n}\nfunction postAxiosOptions(url, data) {\n const options = {\n url,\n method: \"POST\",\n headers: {\n Accept: \"application/vnd.github+json\",\n Authorization: \"Bearer \" + GH_TOKEN,\n \"X-GitHub-Api-Version\": \"2022-11-28\"\n },\n data\n };\n return options;\n}\nfunction patchAxiosOptions(url, data) {\n const options = {\n url,\n method: \"PATCH\",\n headers: {\n Accept: \"application/vnd.github+json\",\n Authorization: \"Bearer \" + GH_TOKEN,\n \"X-GitHub-Api-Version\": \"2022-11-28\"\n },\n data\n };\n return options;\n}\nconst GetStartTimeFromBody = function(text) {\n const pattern = /\\[start_datetime:(\\d+)\\]/;\n const matches = pattern.exec(text);\n if (matches) {\n const timestamp = matches[1];\n return parseInt(timestamp);\n }\n return null;\n};\nconst GetEndTimeFromBody = function(text) {\n const pattern = /\\[end_datetime:(\\d+)\\]/;\n const matches = pattern.exec(text);\n if (matches) {\n const timestamp = matches[1];\n return parseInt(timestamp);\n }\n return null;\n};\nconst GetIncidentByNumber = async function(githubConfig, incidentNumber) {\n if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return null;\n }\n const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;\n const options = getAxiosOptions(url);\n try {\n const response = await axios.request(options);\n return response.data;\n } catch (error) {\n console.log(error.message, options, url);\n return null;\n }\n};\nconst GetIncidents = async function(tagName, githubConfig, state = \"all\") {\n if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return [];\n }\n if (tagName === void 0) {\n return [];\n }\n const since = GetMinuteStartNowTimestampUTC() - githubConfig.incidentSince * 60 * 60;\n const sinceISO = new Date(since * 1e3).toISOString();\n const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues?state=${state}&labels=${tagName},incident&sort=created&direction=desc&since=${sinceISO}`;\n const options = getAxiosOptions(url);\n try {\n const response = await axios.request(options);\n let issues = response.data;\n issues = issues.filter((issue) => {\n return new Date(issue.created_at) >= new Date(sinceISO);\n });\n return issues;\n } catch (error) {\n console.log(error.response.data);\n return [];\n }\n};\nconst GetOpenIncidents = async function(githubConfig) {\n if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return [];\n }\n const since = GetMinuteStartNowTimestampUTC() - githubConfig.incidentSince * 60 * 60;\n const sinceISO = new Date(since * 1e3).toISOString();\n const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues?state=open&labels=incident&sort=created&direction=desc&since=${sinceISO}`;\n const options = getAxiosOptions(url);\n try {\n const response = await axios.request(options);\n let issues = response.data;\n issues = issues.filter((issue) => {\n return new Date(issue.created_at) >= new Date(sinceISO);\n });\n return issues;\n } catch (error) {\n console.log(error.response.data);\n return [];\n }\n};\nfunction FilterAndInsertMonitorInIncident(openIncidentsReduced, monitorsActive) {\n let openIncidentExploded = [];\n for (let i = 0; i < openIncidentsReduced.length; i++) {\n for (let j = 0; j < monitorsActive.length; j++) {\n if (openIncidentsReduced[i].labels.includes(monitorsActive[j].tag)) {\n let incident = JSON.parse(JSON.stringify(openIncidentsReduced[i]));\n incident.monitor = {\n name: monitorsActive[j].name,\n tag: monitorsActive[j].tag,\n image: monitorsActive[j].image,\n description: monitorsActive[j].description\n };\n openIncidentExploded.push(incident);\n }\n }\n }\n return openIncidentExploded;\n}\nfunction Mapper(issue) {\n const html = marked.parse(issue.body);\n const issueCreatedAt = new Date(issue.created_at);\n const issueCreatedAtTimestamp = issueCreatedAt.getTime() / 1e3;\n let issueClosedAtTimestamp = null;\n if (issue.closed_at !== null) {\n const issueClosedAt = new Date(issue.closed_at);\n issueClosedAtTimestamp = issueClosedAt.getTime() / 1e3;\n }\n let labels = issue.labels.map(function(label) {\n return label.name;\n });\n let res = {\n title: issue.title,\n incident_start_time: GetStartTimeFromBody(issue.body) || issueCreatedAtTimestamp,\n incident_end_time: GetEndTimeFromBody(issue.body) || issueClosedAtTimestamp,\n number: issue.number,\n body: html,\n created_at: issue.created_at,\n updated_at: issue.updated_at,\n collapsed: true,\n // @ts-ignore\n state: issue.state,\n closed_at: issue.closed_at,\n // @ts-ignore\n labels,\n html_url: issue.html_url,\n comments: []\n };\n return res;\n}\nasync function GetCommentsForIssue(issueID, githubConfig) {\n if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return [];\n }\n const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${issueID}/comments`;\n try {\n const response = await axios.request(getAxiosOptions(url));\n return response.data;\n } catch (error) {\n console.log(error.response.data);\n return [];\n }\n}\nasync function CreateIssue(githubConfig, issueTitle, issueBody, issueLabels) {\n if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return null;\n }\n const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues`;\n try {\n const payload = {\n title: issueTitle,\n body: issueBody,\n labels: issueLabels\n };\n const response = await axios.request(postAxiosOptions(url, payload));\n return response.data;\n } catch (error) {\n console.log(error.response.data);\n return null;\n }\n}\nasync function UpdateIssue(githubConfig, incidentNumber, issueTitle, issueBody, issueLabels, state = \"open\") {\n if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return null;\n }\n const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;\n try {\n const payload = {\n title: issueTitle,\n body: issueBody,\n labels: issueLabels,\n state\n };\n const response = await axios.request(patchAxiosOptions(url, payload));\n return response.data;\n } catch (error) {\n console.log(error.response.data);\n return null;\n }\n}\nasync function AddComment(githubConfig, incidentNumber, commentBody) {\n if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return null;\n }\n const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}/comments`;\n try {\n const payload = {\n body: commentBody\n };\n const response = await axios.request(postAxiosOptions(url, payload));\n return response.data;\n } catch (error) {\n console.log(error.response.data);\n return null;\n }\n}\nasync function UpdateIssueLabels(githubConfig, incidentNumber, issueLabels, body, state = \"open\") {\n if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return null;\n }\n const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;\n try {\n const payload = {\n labels: issueLabels,\n body,\n state\n };\n const response = await axios.request(patchAxiosOptions(url, payload));\n return response.data;\n } catch (error) {\n console.log(error.response.data);\n return null;\n }\n}\nexport {\n AddComment as A,\n CreateIssue as C,\n FilterAndInsertMonitorInIncident as F,\n GetIncidentByNumber as G,\n Mapper as M,\n UpdateIssue as U,\n GetCommentsForIssue as a,\n UpdateIssueLabels as b,\n GetStartTimeFromBody as c,\n GetEndTimeFromBody as d,\n GetOpenIncidents as e,\n GetIncidents as f\n};\n"],"names":[],"mappings":";;;;AAGA,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;AACtC,MAAM,oBAAoB,GAAG,kHAAkH,CAAC;AAChJ,SAAS,eAAe,CAAC,GAAG,EAAE;AAC9B,EAAE,MAAM,OAAO,GAAG;AAClB,IAAI,GAAG;AACP,IAAI,MAAM,EAAE,KAAK;AACjB,IAAI,OAAO,EAAE;AACb,MAAM,MAAM,EAAE,6BAA6B;AAC3C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O,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;AACtC,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH,EAAE,MAAM,GAAG,GAAG,CAAC,6BAA6B,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC;AACjH,EAAE,IAAI;AACN,IAAI,MAAM,OAAO,GAAG;AACpB,MAAM,MAAM,EAAE,WAAW;AACzB,MAAM,IAAI;AACV,MAAM,KAAK;AACX,KAAK,CAAC;AACN,IAAI,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1E,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC;AACzB,GAAG,CAAC,OAAO,KAAK,EAAE;AAClB,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACrC,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG;AACH;;;;"} \ No newline at end of file diff --git a/build/server/chunks/github-31d08953.js b/build/server/chunks/github-c018834c.js similarity index 89% rename from build/server/chunks/github-31d08953.js rename to build/server/chunks/github-c018834c.js index 19ab8ff0..f3b8839a 100644 --- a/build/server/chunks/github-31d08953.js +++ b/build/server/chunks/github-c018834c.js @@ -258,6 +258,35 @@ async function UpdateIssueLabels(githubConfig, incidentNumber, issueLabels, body return null; } } +async function SearchIssue(query, page, per_page) { + if (GH_TOKEN === void 0) { + console.log(GhnotconfireguredMsg); + return null; + } + const searchQuery = query.filter(function(q) { + if (q == "" || q === void 0 || q === null) { + return false; + } + const qs = q.split(":"); + if (qs.length < 2) { + return false; + } + if (qs[1] === "" || qs[1] === void 0 || qs[1] === null) { + return false; + } + return true; + }).join(" "); + const url = `https://api.github.com/search/issues?q=${encodeURIComponent( + searchQuery + )}&per_page=${per_page}&page=${page}`; + try { + const response = await axios.request(getAxiosOptions(url)); + return response.data; + } catch (error) { + console.log(error.response.data); + return []; + } +} -export { AddComment as A, CreateIssue as C, FilterAndInsertMonitorInIncident as F, GetOpenIncidents as G, Mapper as M, UpdateIssue as U, GetIncidents as a, GetIncidentByNumber as b, GetCommentsForIssue as c, UpdateIssueLabels as d, GetStartTimeFromBody as e, GetEndTimeFromBody as f }; -//# sourceMappingURL=github-31d08953.js.map +export { AddComment as A, CreateIssue as C, FilterAndInsertMonitorInIncident as F, GetOpenIncidents as G, Mapper as M, SearchIssue as S, UpdateIssue as U, GetIncidents as a, GetIncidentByNumber as b, GetCommentsForIssue as c, UpdateIssueLabels as d, GetStartTimeFromBody as e, GetEndTimeFromBody as f }; +//# sourceMappingURL=github-c018834c.js.map diff --git a/build/server/chunks/github-c018834c.js.map b/build/server/chunks/github-c018834c.js.map new file mode 100644 index 00000000..89622d79 --- /dev/null +++ b/build/server/chunks/github-c018834c.js.map @@ -0,0 +1 @@ +{"version":3,"file":"github-c018834c.js","sources":["../../../.svelte-kit/adapter-node/chunks/github.js"],"sourcesContent":["import axios from \"axios\";\nimport { b as GetMinuteStartNowTimestampUTC } from \"./tool.js\";\nimport { marked } from \"marked\";\nconst GH_TOKEN = process.env.GH_TOKEN;\nconst GhnotconfireguredMsg = \"owner or repo or GH_TOKEN is undefined. Read the docs to configure github: https://kener.ing/docs#h2github-setup\";\nfunction getAxiosOptions(url) {\n const options = {\n url,\n method: \"GET\",\n headers: {\n Accept: \"application/vnd.github+json\",\n Authorization: \"Bearer \" + GH_TOKEN,\n \"X-GitHub-Api-Version\": \"2022-11-28\"\n }\n };\n return options;\n}\nfunction postAxiosOptions(url, data) {\n const options = {\n url,\n method: \"POST\",\n headers: {\n Accept: \"application/vnd.github+json\",\n Authorization: \"Bearer \" + GH_TOKEN,\n \"X-GitHub-Api-Version\": \"2022-11-28\"\n },\n data\n };\n return options;\n}\nfunction patchAxiosOptions(url, data) {\n const options = {\n url,\n method: \"PATCH\",\n headers: {\n Accept: \"application/vnd.github+json\",\n Authorization: \"Bearer \" + GH_TOKEN,\n \"X-GitHub-Api-Version\": \"2022-11-28\"\n },\n data\n };\n return options;\n}\nconst GetStartTimeFromBody = function(text) {\n const pattern = /\\[start_datetime:(\\d+)\\]/;\n const matches = pattern.exec(text);\n if (matches) {\n const timestamp = matches[1];\n return parseInt(timestamp);\n }\n return null;\n};\nconst GetEndTimeFromBody = function(text) {\n const pattern = /\\[end_datetime:(\\d+)\\]/;\n const matches = pattern.exec(text);\n if (matches) {\n const timestamp = matches[1];\n return parseInt(timestamp);\n }\n return null;\n};\nconst GetIncidentByNumber = async function(githubConfig, incidentNumber) {\n if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return null;\n }\n const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;\n const options = getAxiosOptions(url);\n try {\n const response = await axios.request(options);\n return response.data;\n } catch (error) {\n console.log(error.message, options, url);\n return null;\n }\n};\nconst GetIncidents = async function(tagName, githubConfig, state = \"all\") {\n if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return [];\n }\n if (tagName === void 0) {\n return [];\n }\n const since = GetMinuteStartNowTimestampUTC() - githubConfig.incidentSince * 60 * 60;\n const sinceISO = new Date(since * 1e3).toISOString();\n const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues?state=${state}&labels=${tagName},incident&sort=created&direction=desc&since=${sinceISO}`;\n const options = getAxiosOptions(url);\n try {\n const response = await axios.request(options);\n let issues = response.data;\n issues = issues.filter((issue) => {\n return new Date(issue.created_at) >= new Date(sinceISO);\n });\n return issues;\n } catch (error) {\n console.log(error.response.data);\n return [];\n }\n};\nconst GetOpenIncidents = async function(githubConfig) {\n if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return [];\n }\n const since = GetMinuteStartNowTimestampUTC() - githubConfig.incidentSince * 60 * 60;\n const sinceISO = new Date(since * 1e3).toISOString();\n const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues?state=open&labels=incident&sort=created&direction=desc&since=${sinceISO}`;\n const options = getAxiosOptions(url);\n try {\n const response = await axios.request(options);\n let issues = response.data;\n issues = issues.filter((issue) => {\n return new Date(issue.created_at) >= new Date(sinceISO);\n });\n return issues;\n } catch (error) {\n console.log(error.response.data);\n return [];\n }\n};\nfunction FilterAndInsertMonitorInIncident(openIncidentsReduced, monitorsActive) {\n let openIncidentExploded = [];\n for (let i = 0; i < openIncidentsReduced.length; i++) {\n for (let j = 0; j < monitorsActive.length; j++) {\n if (openIncidentsReduced[i].labels.includes(monitorsActive[j].tag)) {\n let incident = JSON.parse(JSON.stringify(openIncidentsReduced[i]));\n incident.monitor = {\n name: monitorsActive[j].name,\n tag: monitorsActive[j].tag,\n image: monitorsActive[j].image,\n description: monitorsActive[j].description\n };\n openIncidentExploded.push(incident);\n }\n }\n }\n return openIncidentExploded;\n}\nfunction Mapper(issue) {\n const html = marked.parse(issue.body);\n const issueCreatedAt = new Date(issue.created_at);\n const issueCreatedAtTimestamp = issueCreatedAt.getTime() / 1e3;\n let issueClosedAtTimestamp = null;\n if (issue.closed_at !== null) {\n const issueClosedAt = new Date(issue.closed_at);\n issueClosedAtTimestamp = issueClosedAt.getTime() / 1e3;\n }\n let labels = issue.labels.map(function(label) {\n return label.name;\n });\n let res = {\n title: issue.title,\n incident_start_time: GetStartTimeFromBody(issue.body) || issueCreatedAtTimestamp,\n incident_end_time: GetEndTimeFromBody(issue.body) || issueClosedAtTimestamp,\n number: issue.number,\n body: html,\n created_at: issue.created_at,\n updated_at: issue.updated_at,\n collapsed: true,\n // @ts-ignore\n state: issue.state,\n closed_at: issue.closed_at,\n // @ts-ignore\n labels,\n html_url: issue.html_url,\n comments: []\n };\n return res;\n}\nasync function GetCommentsForIssue(issueID, githubConfig) {\n if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return [];\n }\n const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${issueID}/comments`;\n try {\n const response = await axios.request(getAxiosOptions(url));\n return response.data;\n } catch (error) {\n console.log(error.response.data);\n return [];\n }\n}\nasync function CreateIssue(githubConfig, issueTitle, issueBody, issueLabels) {\n if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return null;\n }\n const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues`;\n try {\n const payload = {\n title: issueTitle,\n body: issueBody,\n labels: issueLabels\n };\n const response = await axios.request(postAxiosOptions(url, payload));\n return response.data;\n } catch (error) {\n console.log(error.response.data);\n return null;\n }\n}\nasync function UpdateIssue(githubConfig, incidentNumber, issueTitle, issueBody, issueLabels, state = \"open\") {\n if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return null;\n }\n const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;\n try {\n const payload = {\n title: issueTitle,\n body: issueBody,\n labels: issueLabels,\n state\n };\n const response = await axios.request(patchAxiosOptions(url, payload));\n return response.data;\n } catch (error) {\n console.log(error.response.data);\n return null;\n }\n}\nasync function AddComment(githubConfig, incidentNumber, commentBody) {\n if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return null;\n }\n const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}/comments`;\n try {\n const payload = {\n body: commentBody\n };\n const response = await axios.request(postAxiosOptions(url, payload));\n return response.data;\n } catch (error) {\n console.log(error.response.data);\n return null;\n }\n}\nasync function UpdateIssueLabels(githubConfig, incidentNumber, issueLabels, body, state = \"open\") {\n if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return null;\n }\n const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;\n try {\n const payload = {\n labels: issueLabels,\n body,\n state\n };\n const response = await axios.request(patchAxiosOptions(url, payload));\n return response.data;\n } catch (error) {\n console.log(error.response.data);\n return null;\n }\n}\nasync function SearchIssue(query, page, per_page) {\n if (GH_TOKEN === void 0) {\n console.log(GhnotconfireguredMsg);\n return null;\n }\n const searchQuery = query.filter(function(q) {\n if (q == \"\" || q === void 0 || q === null) {\n return false;\n }\n const qs = q.split(\":\");\n if (qs.length < 2) {\n return false;\n }\n if (qs[1] === \"\" || qs[1] === void 0 || qs[1] === null) {\n return false;\n }\n return true;\n }).join(\" \");\n const url = `https://api.github.com/search/issues?q=${encodeURIComponent(\n searchQuery\n )}&per_page=${per_page}&page=${page}`;\n try {\n const response = await axios.request(getAxiosOptions(url));\n return response.data;\n } catch (error) {\n console.log(error.response.data);\n return [];\n }\n}\nexport {\n AddComment as A,\n CreateIssue as C,\n FilterAndInsertMonitorInIncident as F,\n GetIncidentByNumber as G,\n Mapper as M,\n SearchIssue as S,\n UpdateIssue as U,\n GetCommentsForIssue as a,\n UpdateIssueLabels as b,\n GetStartTimeFromBody as c,\n GetEndTimeFromBody as d,\n GetOpenIncidents as e,\n GetIncidents as f\n};\n"],"names":[],"mappings":";;;;AAGA,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;AACtC,MAAM,oBAAoB,GAAG,kHAAkH,CAAC;AAChJ,SAAS,eAAe,CAAC,GAAG,EAAE;AAC9B,EAAE,MAAM,OAAO,GAAG;AAClB,IAAI,GAAG;AACP,IAAI,MAAM,EAAE,KAAK;AACjB,IAAI,OAAO,EAAE;AACb,MAAM,MAAM,EAAE,6BAA6B;AAC3C,MAAM,aAAa,EAAE,SAAS,GAA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ACnB,KAAK;AACL,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;AAC5D,MAAM,OAAO,KAAK,CAAC;AACnB,KAAK;AACL,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,EAAE,MAAM,GAAG,GAAG,CAAC,uCAAuC,EAAE,kBAAkB;AAC1E,IAAI,WAAW;AACf,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI;AACN,IAAI,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC;AACzB,GAAG,CAAC,OAAO,KAAK,EAAE;AAClB,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACrC,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH;;;;"} \ No newline at end of file diff --git a/build/server/chunks/webhook-926b85d0.js b/build/server/chunks/webhook-c20a13d6.js similarity index 99% rename from build/server/chunks/webhook-926b85d0.js rename to build/server/chunks/webhook-c20a13d6.js index 706a383d..26b2593c 100644 --- a/build/server/chunks/webhook-926b85d0.js +++ b/build/server/chunks/webhook-c20a13d6.js @@ -2,7 +2,7 @@ import fs from 'fs-extra'; import { p as public_env } from './shared-server-58a5f352.js'; import { P as ParseUptime } from './helpers-0acb6e43.js'; import { G as GetNowTimestampUTC, a as GetMinuteStartTimestampUTC, b as GetMinuteStartNowTimestampUTC } from './tool-b4b3e524.js'; -import { e as GetStartTimeFromBody, f as GetEndTimeFromBody } from './github-31d08953.js'; +import { e as GetStartTimeFromBody, f as GetEndTimeFromBody } from './github-c018834c.js'; import Randomstring from 'randomstring'; const API_TOKEN = process.env.API_TOKEN; @@ -228,4 +228,4 @@ const GetMonitorStatusByTag = function(tag) { }; export { GHIssueToKenerIncident as G, ParseIncidentPayload as P, auth as a, GetMonitorStatusByTag as b, store as s }; -//# sourceMappingURL=webhook-926b85d0.js.map +//# sourceMappingURL=webhook-c20a13d6.js.map diff --git a/build/server/chunks/webhook-926b85d0.js.map b/build/server/chunks/webhook-c20a13d6.js.map similarity index 99% rename from build/server/chunks/webhook-926b85d0.js.map rename to build/server/chunks/webhook-c20a13d6.js.map index 49142b3f..2f9764e2 100644 --- a/build/server/chunks/webhook-926b85d0.js.map +++ b/build/server/chunks/webhook-c20a13d6.js.map @@ -1 +1 @@ -{"version":3,"file":"webhook-926b85d0.js","sources":["../../../.svelte-kit/adapter-node/chunks/webhook.js"],"sourcesContent":["import fs from \"fs-extra\";\nimport { p as public_env } from \"./shared-server.js\";\nimport { P as ParseUptime } from \"./helpers.js\";\nimport { G as GetNowTimestampUTC, a as GetMinuteStartTimestampUTC, b as GetMinuteStartNowTimestampUTC } from \"./tool.js\";\nimport { c as GetStartTimeFromBody, d as GetEndTimeFromBody } from \"./github.js\";\nimport Randomstring from \"randomstring\";\nconst API_TOKEN = process.env.API_TOKEN;\nconst API_IP = process.env.API_IP;\nconst GetAllTags = function() {\n let tags = [];\n let monitors = [];\n try {\n monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\n tags = monitors.map((monitor) => monitor.tag);\n } catch (err) {\n return [];\n }\n return tags;\n};\nconst CheckIfValidTag = function(tag) {\n let tags = [];\n let monitors = [];\n try {\n monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\n tags = monitors.map((monitor) => monitor.tag);\n if (tags.indexOf(tag) == -1) {\n throw new Error(\"not a valid tag\");\n }\n } catch (err) {\n return false;\n }\n return true;\n};\nconst auth = function(request) {\n const authHeader = request.headers.get(\"authorization\");\n const authToken = authHeader.replace(\"Bearer \", \"\");\n let ip = \"\";\n try {\n if (request.headers.get(\"x-forwarded-for\") !== null) {\n ip = request.headers.get(\"x-forwarded-for\").split(\",\")[0];\n } else if (request.headers.get(\"x-real-ip\") !== null) {\n ip = request.headers.get(\"x-real-ip\");\n } else if (request.connection && request.connection.remoteAddress !== null) {\n ip = request.connection.remoteAddress;\n } else if (request.socket && request.socket.remoteAddress !== null) {\n ip = request.socket.remoteAddress;\n }\n } catch (err) {\n console.log(\"IP Not Found \" + err.message);\n }\n if (authToken !== API_TOKEN) {\n return new Error(\"invalid token\");\n }\n if (API_IP !== void 0 && ip != \"\" && ip !== API_IP) {\n return new Error(\"invalid ip\");\n }\n return null;\n};\nconst store = function(data) {\n const tag = data.tag;\n const resp = {};\n if (data.status === void 0 || [\"UP\", \"DOWN\", \"DEGRADED\"].indexOf(data.status) === -1) {\n return { error: \"status missing\", status: 400 };\n }\n if (data.latency === void 0 || isNaN(data.latency)) {\n return { error: \"latency missing or not a number\", status: 400 };\n }\n if (data.timestampInSeconds !== void 0 && isNaN(data.timestampInSeconds)) {\n return { error: \"timestampInSeconds not a number\", status: 400 };\n }\n if (data.timestampInSeconds === void 0) {\n data.timestampInSeconds = GetNowTimestampUTC();\n }\n data.timestampInSeconds = GetMinuteStartTimestampUTC(data.timestampInSeconds);\n resp.status = data.status;\n resp.latency = data.latency;\n resp.type = \"webhook\";\n let timestamp = GetMinuteStartNowTimestampUTC();\n try {\n if (data.timestampInSeconds > timestamp) {\n throw new Error(\"timestampInSeconds is in future\");\n }\n if (timestamp - data.timestampInSeconds > 90 * 24 * 60 * 60) {\n throw new Error(\"timestampInSeconds is older than 90days\");\n }\n } catch (err) {\n return { error: err.message, status: 400 };\n }\n if (!CheckIfValidTag(tag)) {\n return { error: \"invalid tag\", status: 400 };\n }\n let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\n const monitor = monitors.find((monitor2) => monitor2.tag === tag);\n let day0 = {};\n day0[data.timestampInSeconds] = resp;\n fs.writeFileSync(public_env.PUBLIC_KENER_FOLDER + `/${monitor.folderName}.webhook.${Randomstring.generate()}.json`, JSON.stringify(day0, null, 2));\n return { status: 200, message: \"success at \" + data.timestampInSeconds };\n};\nconst GHIssueToKenerIncident = function(issue) {\n let issueLabels = issue.labels.map((label) => {\n return label.name;\n });\n let tagsAvailable = GetAllTags();\n let commonTags = tagsAvailable.filter((tag) => issueLabels.includes(tag));\n let resp = {\n createdAt: Math.floor(new Date(issue.created_at).getTime() / 1e3),\n //in seconds\n closedAt: issue.closed_at ? Math.floor(new Date(issue.closed_at).getTime() / 1e3) : null,\n title: issue.title,\n tags: commonTags,\n incidentNumber: issue.number\n };\n resp.startDatetime = GetStartTimeFromBody(issue.body);\n resp.endDatetime = GetEndTimeFromBody(issue.body);\n let body = issue.body;\n body = body.replace(/\\[start_datetime:(\\d+)\\]/g, \"\");\n body = body.replace(/\\[end_datetime:(\\d+)\\]/g, \"\");\n resp.body = body.trim();\n resp.impact = null;\n if (issueLabels.includes(\"incident-down\")) {\n resp.impact = \"DOWN\";\n } else if (issueLabels.includes(\"incident-degraded\")) {\n resp.impact = \"DEGRADED\";\n }\n resp.isMaintenance = false;\n if (issueLabels.includes(\"maintenance\")) {\n resp.isMaintenance = true;\n }\n resp.isIdentified = false;\n resp.isResolved = false;\n if (issueLabels.includes(\"identified\")) {\n resp.isIdentified = true;\n }\n if (issueLabels.includes(\"resolved\")) {\n resp.isResolved = true;\n }\n return resp;\n};\nconst ParseIncidentPayload = function(payload) {\n let startDatetime = payload.startDatetime;\n let endDatetime = payload.endDatetime;\n let title = payload.title;\n let body = payload.body || \"\";\n let tags = payload.tags;\n let impact = payload.impact;\n let isMaintenance = payload.isMaintenance;\n let isIdentified = payload.isIdentified;\n let isResolved = payload.isResolved;\n if (startDatetime && typeof startDatetime !== \"number\") {\n return { error: \"Invalid startDatetime\" };\n }\n if (endDatetime && (typeof endDatetime !== \"number\" || endDatetime <= startDatetime)) {\n return { error: \"Invalid endDatetime\" };\n }\n if (!title || typeof title !== \"string\") {\n return { error: \"Invalid title\" };\n }\n if (!tags || !Array.isArray(tags) || tags.length === 0 || tags.some((tag) => typeof tag !== \"string\")) {\n return { error: \"Invalid tags\" };\n }\n if (body && typeof body !== \"string\") {\n return { error: \"Invalid body\" };\n }\n if (impact && (typeof impact !== \"string\" || [\"DOWN\", \"DEGRADED\"].indexOf(impact) === -1)) {\n return { error: \"Invalid impact\" };\n }\n const allTags = GetAllTags();\n if (tags.some((tag) => allTags.indexOf(tag) === -1)) {\n return { error: \"Unknown tags\" };\n }\n if (isMaintenance && typeof isMaintenance !== \"boolean\") {\n return { error: \"Invalid isMaintenance\" };\n }\n let githubLabels = [\"incident\"];\n tags.forEach((tag) => {\n githubLabels.push(tag);\n });\n if (impact) {\n githubLabels.push(\"incident-\" + impact.toLowerCase());\n }\n if (isMaintenance) {\n githubLabels.push(\"maintenance\");\n }\n if (isResolved !== void 0 && isResolved === true) {\n githubLabels.push(\"resolved\");\n }\n if (isIdentified !== void 0 && isIdentified === true) {\n githubLabels.push(\"identified\");\n }\n if (startDatetime)\n body = body + ` [start_datetime:${startDatetime}]`;\n if (endDatetime)\n body = body + ` [end_datetime:${endDatetime}]`;\n return { title, body, githubLabels };\n};\nconst GetMonitorStatusByTag = function(tag) {\n if (!CheckIfValidTag(tag)) {\n return { error: \"invalid tag\", status: 400 };\n }\n const resp = {\n status: null,\n uptime: null,\n lastUpdatedAt: null\n };\n let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\n const { path0Day } = monitors.find((monitor) => monitor.tag === tag);\n const dayData = JSON.parse(fs.readFileSync(path0Day, \"utf8\"));\n const lastUpdatedAt = Object.keys(dayData)[Object.keys(dayData).length - 1];\n const lastObj = dayData[lastUpdatedAt];\n resp.status = lastObj.status;\n let ups = 0;\n let downs = 0;\n let degradeds = 0;\n for (const timestamp in dayData) {\n const obj = dayData[timestamp];\n if (obj.status == \"UP\") {\n ups++;\n } else if (obj.status == \"DEGRADED\") {\n degradeds++;\n } else if (obj.status == \"DOWN\") {\n downs++;\n }\n }\n resp.uptime = ParseUptime(ups + degradeds, ups + degradeds + downs);\n resp.lastUpdatedAt = Number(lastUpdatedAt);\n return { status: 200, ...resp };\n};\nexport {\n GHIssueToKenerIncident as G,\n ParseIncidentPayload as P,\n auth as a,\n GetMonitorStatusByTag as b,\n store as s\n};\n"],"names":[],"mappings":";;;;;;;AAMA,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;AACxC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;AAClC,MAAM,UAAU,GAAG,WAAW;AAC9B,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC;AAChB,EAAE,IAAI,QAAQ,GAAG,EAAE,CAAC;AACpB,EAAE,IAAI;AACN,IAAI,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC;AACtG,IAAI,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAClD,GAAG,CAAC,OAAO,GAAG,EAAE;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AACF,MAAM,eAAe,GAAG,SAAS,GAAG,EAAE;AACtC,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC;AAChB,EAAE,IAAI,QAAQ,GAAG,EAAE,CAAC;AACpB,EAAE,IAAI;AACN,IAAI,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,gBAAgB,EAAE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C,CAAC;AAC7C,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;AAClC;;;;"} \ No newline at end of file +{"version":3,"file":"webhook-c20a13d6.js","sources":["../../../.svelte-kit/adapter-node/chunks/webhook.js"],"sourcesContent":["import fs from \"fs-extra\";\nimport { p as public_env } from \"./shared-server.js\";\nimport { P as ParseUptime } from \"./helpers.js\";\nimport { G as GetNowTimestampUTC, a as GetMinuteStartTimestampUTC, b as GetMinuteStartNowTimestampUTC } from \"./tool.js\";\nimport { c as GetStartTimeFromBody, d as GetEndTimeFromBody } from \"./github.js\";\nimport Randomstring from \"randomstring\";\nconst API_TOKEN = process.env.API_TOKEN;\nconst API_IP = process.env.API_IP;\nconst GetAllTags = function() {\n let tags = [];\n let monitors = [];\n try {\n monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\n tags = monitors.map((monitor) => monitor.tag);\n } catch (err) {\n return [];\n }\n return tags;\n};\nconst CheckIfValidTag = function(tag) {\n let tags = [];\n let monitors = [];\n try {\n monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\n tags = monitors.map((monitor) => monitor.tag);\n if (tags.indexOf(tag) == -1) {\n throw new Error(\"not a valid tag\");\n }\n } catch (err) {\n return false;\n }\n return true;\n};\nconst auth = function(request) {\n const authHeader = request.headers.get(\"authorization\");\n const authToken = authHeader.replace(\"Bearer \", \"\");\n let ip = \"\";\n try {\n if (request.headers.get(\"x-forwarded-for\") !== null) {\n ip = request.headers.get(\"x-forwarded-for\").split(\",\")[0];\n } else if (request.headers.get(\"x-real-ip\") !== null) {\n ip = request.headers.get(\"x-real-ip\");\n } else if (request.connection && request.connection.remoteAddress !== null) {\n ip = request.connection.remoteAddress;\n } else if (request.socket && request.socket.remoteAddress !== null) {\n ip = request.socket.remoteAddress;\n }\n } catch (err) {\n console.log(\"IP Not Found \" + err.message);\n }\n if (authToken !== API_TOKEN) {\n return new Error(\"invalid token\");\n }\n if (API_IP !== void 0 && ip != \"\" && ip !== API_IP) {\n return new Error(\"invalid ip\");\n }\n return null;\n};\nconst store = function(data) {\n const tag = data.tag;\n const resp = {};\n if (data.status === void 0 || [\"UP\", \"DOWN\", \"DEGRADED\"].indexOf(data.status) === -1) {\n return { error: \"status missing\", status: 400 };\n }\n if (data.latency === void 0 || isNaN(data.latency)) {\n return { error: \"latency missing or not a number\", status: 400 };\n }\n if (data.timestampInSeconds !== void 0 && isNaN(data.timestampInSeconds)) {\n return { error: \"timestampInSeconds not a number\", status: 400 };\n }\n if (data.timestampInSeconds === void 0) {\n data.timestampInSeconds = GetNowTimestampUTC();\n }\n data.timestampInSeconds = GetMinuteStartTimestampUTC(data.timestampInSeconds);\n resp.status = data.status;\n resp.latency = data.latency;\n resp.type = \"webhook\";\n let timestamp = GetMinuteStartNowTimestampUTC();\n try {\n if (data.timestampInSeconds > timestamp) {\n throw new Error(\"timestampInSeconds is in future\");\n }\n if (timestamp - data.timestampInSeconds > 90 * 24 * 60 * 60) {\n throw new Error(\"timestampInSeconds is older than 90days\");\n }\n } catch (err) {\n return { error: err.message, status: 400 };\n }\n if (!CheckIfValidTag(tag)) {\n return { error: \"invalid tag\", status: 400 };\n }\n let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\n const monitor = monitors.find((monitor2) => monitor2.tag === tag);\n let day0 = {};\n day0[data.timestampInSeconds] = resp;\n fs.writeFileSync(public_env.PUBLIC_KENER_FOLDER + `/${monitor.folderName}.webhook.${Randomstring.generate()}.json`, JSON.stringify(day0, null, 2));\n return { status: 200, message: \"success at \" + data.timestampInSeconds };\n};\nconst GHIssueToKenerIncident = function(issue) {\n let issueLabels = issue.labels.map((label) => {\n return label.name;\n });\n let tagsAvailable = GetAllTags();\n let commonTags = tagsAvailable.filter((tag) => issueLabels.includes(tag));\n let resp = {\n createdAt: Math.floor(new Date(issue.created_at).getTime() / 1e3),\n //in seconds\n closedAt: issue.closed_at ? Math.floor(new Date(issue.closed_at).getTime() / 1e3) : null,\n title: issue.title,\n tags: commonTags,\n incidentNumber: issue.number\n };\n resp.startDatetime = GetStartTimeFromBody(issue.body);\n resp.endDatetime = GetEndTimeFromBody(issue.body);\n let body = issue.body;\n body = body.replace(/\\[start_datetime:(\\d+)\\]/g, \"\");\n body = body.replace(/\\[end_datetime:(\\d+)\\]/g, \"\");\n resp.body = body.trim();\n resp.impact = null;\n if (issueLabels.includes(\"incident-down\")) {\n resp.impact = \"DOWN\";\n } else if (issueLabels.includes(\"incident-degraded\")) {\n resp.impact = \"DEGRADED\";\n }\n resp.isMaintenance = false;\n if (issueLabels.includes(\"maintenance\")) {\n resp.isMaintenance = true;\n }\n resp.isIdentified = false;\n resp.isResolved = false;\n if (issueLabels.includes(\"identified\")) {\n resp.isIdentified = true;\n }\n if (issueLabels.includes(\"resolved\")) {\n resp.isResolved = true;\n }\n return resp;\n};\nconst ParseIncidentPayload = function(payload) {\n let startDatetime = payload.startDatetime;\n let endDatetime = payload.endDatetime;\n let title = payload.title;\n let body = payload.body || \"\";\n let tags = payload.tags;\n let impact = payload.impact;\n let isMaintenance = payload.isMaintenance;\n let isIdentified = payload.isIdentified;\n let isResolved = payload.isResolved;\n if (startDatetime && typeof startDatetime !== \"number\") {\n return { error: \"Invalid startDatetime\" };\n }\n if (endDatetime && (typeof endDatetime !== \"number\" || endDatetime <= startDatetime)) {\n return { error: \"Invalid endDatetime\" };\n }\n if (!title || typeof title !== \"string\") {\n return { error: \"Invalid title\" };\n }\n if (!tags || !Array.isArray(tags) || tags.length === 0 || tags.some((tag) => typeof tag !== \"string\")) {\n return { error: \"Invalid tags\" };\n }\n if (body && typeof body !== \"string\") {\n return { error: \"Invalid body\" };\n }\n if (impact && (typeof impact !== \"string\" || [\"DOWN\", \"DEGRADED\"].indexOf(impact) === -1)) {\n return { error: \"Invalid impact\" };\n }\n const allTags = GetAllTags();\n if (tags.some((tag) => allTags.indexOf(tag) === -1)) {\n return { error: \"Unknown tags\" };\n }\n if (isMaintenance && typeof isMaintenance !== \"boolean\") {\n return { error: \"Invalid isMaintenance\" };\n }\n let githubLabels = [\"incident\"];\n tags.forEach((tag) => {\n githubLabels.push(tag);\n });\n if (impact) {\n githubLabels.push(\"incident-\" + impact.toLowerCase());\n }\n if (isMaintenance) {\n githubLabels.push(\"maintenance\");\n }\n if (isResolved !== void 0 && isResolved === true) {\n githubLabels.push(\"resolved\");\n }\n if (isIdentified !== void 0 && isIdentified === true) {\n githubLabels.push(\"identified\");\n }\n if (startDatetime)\n body = body + ` [start_datetime:${startDatetime}]`;\n if (endDatetime)\n body = body + ` [end_datetime:${endDatetime}]`;\n return { title, body, githubLabels };\n};\nconst GetMonitorStatusByTag = function(tag) {\n if (!CheckIfValidTag(tag)) {\n return { error: \"invalid tag\", status: 400 };\n }\n const resp = {\n status: null,\n uptime: null,\n lastUpdatedAt: null\n };\n let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\n const { path0Day } = monitors.find((monitor) => monitor.tag === tag);\n const dayData = JSON.parse(fs.readFileSync(path0Day, \"utf8\"));\n const lastUpdatedAt = Object.keys(dayData)[Object.keys(dayData).length - 1];\n const lastObj = dayData[lastUpdatedAt];\n resp.status = lastObj.status;\n let ups = 0;\n let downs = 0;\n let degradeds = 0;\n for (const timestamp in dayData) {\n const obj = dayData[timestamp];\n if (obj.status == \"UP\") {\n ups++;\n } else if (obj.status == \"DEGRADED\") {\n degradeds++;\n } else if (obj.status == \"DOWN\") {\n downs++;\n }\n }\n resp.uptime = ParseUptime(ups + degradeds, ups + degradeds + downs);\n resp.lastUpdatedAt = Number(lastUpdatedAt);\n return { status: 200, ...resp };\n};\nexport {\n GHIssueToKenerIncident as G,\n ParseIncidentPayload as P,\n auth as a,\n GetMonitorStatusByTag as b,\n store as s\n};\n"],"names":[],"mappings":";;;;;;;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CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC9E,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACzC,EAAE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAC/B,EAAE,IAAI,GAAG,GAAG,CAAC,CAAC;AACd,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC;AAChB,EAAE,IAAI,SAAS,GAAG,CAAC,CAAC;AACpB,EAAE,KAAK,MAAM,SAAS,IAAI,OAAO,EAAE;AACnC,IAAI,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACnC,IAAI,IAAI,GAAG,CAAC,MAAM,IAAI,IAAI,EAAE;AAC5B,MAAM,GAAG,EAAE,CAAC;AACZ,KAAK,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,UAAU,EAAE;AACzC,MAAM,SAAS,EAAE,CAAC;AAClB,KAAK,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,MAAM,EAAE;AACrC,MAAM,KAAK,EAAE,CAAC;AACd,KAAK;AACL,GAAG;AACH,EAAE,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,GAAG,GAAG,SAAS,EAAE,GAAG,GAAG,SAAS,GAAG,KAAK,CAAC,CAAC;AACtE,EAAE,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAC7C,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;AAClC;;;;"} \ No newline at end of file diff --git a/build/server/index.js b/build/server/index.js index 11ef7ccb..e8f62847 100644 --- a/build/server/index.js +++ b/build/server/index.js @@ -171,7 +171,7 @@ const options = {
` + status + '\n
\n

' + message + "

\n
\n
\n \n\n" }, - version_hash: "2uw5wz" + version_hash: "1uv9na3" }; function get_hooks() { return {}; diff --git a/build/server/index.js.map b/build/server/index.js.map index 1e802f18..2cbd1315 100644 --- a/build/server/index.js.map +++ b/build/server/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../../.svelte-kit/adapter-node/chunks/internal.js","../../node_modules/devalue/src/utils.js","../../node_modules/devalue/src/uneval.js","../../node_modules/devalue/src/constants.js","../../node_modules/devalue/src/stringify.js","../../node_modules/cookie/index.js","../../node_modules/set-cookie-parser/lib/set-cookie.js","../../.svelte-kit/adapter-node/index.js"],"sourcesContent":["import { c as create_ssr_component, s as setContext, v as validate_component, m as missing_component } from \"./ssr.js\";\nimport \"./shared-server.js\";\nlet base = \"\";\nlet assets = base;\nconst initial = { base, assets };\nfunction reset() {\n base = initial.base;\n assets = initial.assets;\n}\nfunction set_assets(path) {\n assets = initial.assets = path;\n}\nfunction afterUpdate() {\n}\nfunction set_building() {\n}\nconst Root = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n let { stores } = $$props;\n let { page } = $$props;\n let { constructors } = $$props;\n let { components = [] } = $$props;\n let { form } = $$props;\n let { data_0 = null } = $$props;\n let { data_1 = null } = $$props;\n {\n setContext(\"__svelte__\", stores);\n }\n afterUpdate(stores.page.notify);\n if ($$props.stores === void 0 && $$bindings.stores && stores !== void 0)\n $$bindings.stores(stores);\n if ($$props.page === void 0 && $$bindings.page && page !== void 0)\n $$bindings.page(page);\n if ($$props.constructors === void 0 && $$bindings.constructors && constructors !== void 0)\n $$bindings.constructors(constructors);\n if ($$props.components === void 0 && $$bindings.components && components !== void 0)\n $$bindings.components(components);\n if ($$props.form === void 0 && $$bindings.form && form !== void 0)\n $$bindings.form(form);\n if ($$props.data_0 === void 0 && $$bindings.data_0 && data_0 !== void 0)\n $$bindings.data_0(data_0);\n if ($$props.data_1 === void 0 && $$bindings.data_1 && data_1 !== void 0)\n $$bindings.data_1(data_1);\n let $$settled;\n let $$rendered;\n let previous_head = $$result.head;\n do {\n $$settled = true;\n $$result.head = previous_head;\n {\n stores.page.set(page);\n }\n $$rendered = ` ${constructors[1] ? `${validate_component(constructors[0] || missing_component, \"svelte:component\").$$render(\n $$result,\n { data: data_0, this: components[0] },\n {\n this: ($$value) => {\n components[0] = $$value;\n $$settled = false;\n }\n },\n {\n default: () => {\n return `${validate_component(constructors[1] || missing_component, \"svelte:component\").$$render(\n $$result,\n { data: data_1, form, this: components[1] },\n {\n this: ($$value) => {\n components[1] = $$value;\n $$settled = false;\n }\n },\n {}\n )}`;\n }\n }\n )}` : `${validate_component(constructors[0] || missing_component, \"svelte:component\").$$render(\n $$result,\n { data: data_0, form, this: components[0] },\n {\n this: ($$value) => {\n components[0] = $$value;\n $$settled = false;\n }\n },\n {}\n )}`} ${``}`;\n } while (!$$settled);\n return $$rendered;\n});\nconst options = {\n app_template_contains_nonce: false,\n csp: { \"mode\": \"auto\", \"directives\": { \"upgrade-insecure-requests\": false, \"block-all-mixed-content\": false }, \"reportOnly\": { \"upgrade-insecure-requests\": false, \"block-all-mixed-content\": false } },\n csrf_check_origin: true,\n track_server_fetches: false,\n embedded: false,\n env_public_prefix: \"PUBLIC_\",\n env_private_prefix: \"\",\n hooks: null,\n // added lazily, via `get_hooks`\n preload_strategy: \"modulepreload\",\n root: Root,\n service_worker: false,\n templates: {\n app: ({ head, body, assets: assets2, nonce, env }) => '\\n\\n \\n \\n \\n \\n\\n \\n\\n ' + head + '\\n \\n \\n
' + body + '
\\n\\n\t\t\\n