apitestcenter 0.18.0 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD-PARTY-NOTICES-UI.txt +11 -11
- package/dist/THIRD-PARTY-NOTICES.txt +6 -6
- package/dist/cli.mjs +600 -593
- package/dist/ui/404/index.html +1 -1
- package/dist/ui/404.html +1 -1
- package/dist/ui/__next.__PAGE__.txt +32 -21
- package/dist/ui/__next._full.txt +29 -18
- package/dist/ui/__next._tree.txt +5 -4
- package/dist/ui/_next/static/chunks/0-zga2d528cxt.js +50 -0
- package/dist/ui/_next/static/chunks/03ligbvtk7nsc.js +123 -0
- package/dist/ui/_next/static/chunks/03y58w9gmwqc-.js +50 -0
- package/dist/ui/_next/static/chunks/08rlo-0gnct9m.js +50 -0
- package/dist/ui/_next/static/chunks/0bgmfb8f3pd8e.js +1 -0
- package/dist/ui/_next/static/chunks/0g9k0swrer6i5.js +1 -0
- package/dist/ui/_next/static/chunks/0q8iq_7i4ohjr.js +50 -0
- package/dist/ui/_next/static/chunks/1-t79a3q7gmjn.js +31 -0
- package/dist/ui/_next/static/chunks/12whdxhkvkd-y.js +1 -0
- package/dist/ui/_next/static/chunks/14dtemzsvcfmn.js +50 -0
- package/dist/ui/_next/static/chunks/1mm60-ywpri7b.js +2 -0
- package/dist/ui/_next/static/chunks/20j4wusnbtqa2.js +4 -0
- package/dist/ui/_next/static/chunks/243c1-49gb3pr.js +1 -0
- package/dist/ui/_next/static/chunks/2c1b5jqwxl4ra.js +906 -0
- package/dist/ui/_next/static/chunks/2sb9zma7ae-_f.js +27 -0
- package/dist/ui/_next/static/chunks/2sjog4to0fmbb.css +3 -0
- package/dist/ui/_next/static/chunks/2su0ql-zu4q0_.js +3 -0
- package/dist/ui/_next/static/chunks/3-rdixjnndtyk.js +51 -0
- package/dist/ui/_next/static/chunks/32_tmz8ibsdo3.js +22 -0
- package/dist/ui/_next/static/chunks/3wtqdtu331_vc.js +50 -0
- package/dist/ui/_next/static/chunks/3wzu1zkfqdmn6.js +2 -0
- package/dist/ui/_next/static/chunks/turbopack-3-ry682tkyiqk.js +1 -0
- package/dist/ui/_not-found/__next._full.txt +25 -17
- package/dist/ui/_not-found/__next._not-found.__PAGE__.txt +28 -20
- package/dist/ui/_not-found/__next._tree.txt +4 -2
- package/dist/ui/_not-found/index.html +1 -1
- package/dist/ui/_not-found/index.txt +25 -17
- package/dist/ui/compare/__next._full.txt +32 -20
- package/dist/ui/compare/__next._tree.txt +6 -4
- package/dist/ui/compare/__next.compare.__PAGE__.txt +36 -24
- package/dist/ui/compare/index.html +1 -1
- package/dist/ui/compare/index.txt +32 -20
- package/dist/ui/connections/__next._full.txt +30 -20
- package/dist/ui/connections/__next._tree.txt +6 -4
- package/dist/ui/connections/__next.connections.__PAGE__.txt +34 -24
- package/dist/ui/connections/index.html +2 -2
- package/dist/ui/connections/index.txt +30 -20
- package/dist/ui/history/__next._full.txt +35 -23
- package/dist/ui/history/__next._tree.txt +6 -4
- package/dist/ui/history/__next.history.__PAGE__.txt +39 -27
- package/dist/ui/history/index.html +1 -1
- package/dist/ui/history/index.txt +35 -23
- package/dist/ui/home/__next._full.txt +32 -20
- package/dist/ui/home/__next._tree.txt +6 -4
- package/dist/ui/home/__next.home.__PAGE__.txt +36 -24
- package/dist/ui/home/index.html +1 -1
- package/dist/ui/home/index.txt +32 -20
- package/dist/ui/index.html +1 -1
- package/dist/ui/index.txt +29 -18
- package/dist/ui/preview/__next._full.txt +33 -23
- package/dist/ui/preview/__next._tree.txt +6 -4
- package/dist/ui/preview/__next.preview.__PAGE__.txt +37 -27
- package/dist/ui/preview/index.html +1 -1
- package/dist/ui/preview/index.txt +33 -23
- package/dist/ui/suite/__next._full.txt +29 -20
- package/dist/ui/suite/__next._tree.txt +6 -4
- package/dist/ui/suite/__next.suite.__PAGE__.txt +33 -24
- package/dist/ui/suite/index.html +1 -1
- package/dist/ui/suite/index.txt +29 -20
- package/dist/ui/tests/__next._full.txt +28 -20
- package/dist/ui/tests/__next._tree.txt +6 -4
- package/dist/ui/tests/__next.tests.__PAGE__.txt +32 -24
- package/dist/ui/tests/index.html +1 -1
- package/dist/ui/tests/index.txt +28 -20
- package/package.json +1 -1
- package/dist/ui/_next/static/chunks/01sqehfan_2j_.js +0 -1
- package/dist/ui/_next/static/chunks/036rg3itpc5ge.js +0 -50
- package/dist/ui/_next/static/chunks/0e8f1i6w6dqos.js +0 -50
- package/dist/ui/_next/static/chunks/0hvubzjy33qo9.js +0 -2
- package/dist/ui/_next/static/chunks/0ktc3lx37s0t5.js +0 -4
- package/dist/ui/_next/static/chunks/0wrod6xlhsv0m.js +0 -3
- package/dist/ui/_next/static/chunks/1-d6f0jo8p7jc.js +0 -913
- package/dist/ui/_next/static/chunks/15pu58j0qz9i8.js +0 -31
- package/dist/ui/_next/static/chunks/1apjslkz52j1a.js +0 -22
- package/dist/ui/_next/static/chunks/1nfb0xrm2a6di.css +0 -3
- package/dist/ui/_next/static/chunks/1pz4ugabfd0qn.js +0 -1
- package/dist/ui/_next/static/chunks/1t823xy7gguwx.js +0 -1
- package/dist/ui/_next/static/chunks/23_x0u07xh89v.js +0 -123
- package/dist/ui/_next/static/chunks/2aifruy-vhchn.js +0 -50
- package/dist/ui/_next/static/chunks/2t65s4y0z2a60.js +0 -50
- package/dist/ui/_next/static/chunks/33kvaxr7qvnue.js +0 -50
- package/dist/ui/_next/static/chunks/36wzwezwmtzq7.js +0 -51
- package/dist/ui/_next/static/chunks/3b26__7yusttj.js +0 -1
- package/dist/ui/_next/static/chunks/3n2xlaj16gyb-.js +0 -2
- package/dist/ui/_next/static/chunks/3vso5wrs90xx-.js +0 -50
- package/dist/ui/_next/static/chunks/3yck6s93oif7s.js +0 -27
- package/dist/ui/_next/static/chunks/turbopack-2qka98q_-4ca1.js +0 -1
- /package/dist/ui/_next/static/{J-qCjmc7bhdChQe8noGbb → 8uBf4sRL82dkVbEC6zib9}/_buildManifest.js +0 -0
- /package/dist/ui/_next/static/{J-qCjmc7bhdChQe8noGbb → 8uBf4sRL82dkVbEC6zib9}/_clientMiddlewareManifest.js +0 -0
- /package/dist/ui/_next/static/{J-qCjmc7bhdChQe8noGbb → 8uBf4sRL82dkVbEC6zib9}/_ssgManifest.js +0 -0
- /package/dist/ui/_next/static/media/{8a480f0b521d4e75-s.1qq4vpdcun5oj.woff2 → 07935285219a259d-s.1qq4vpdcun5oj.woff2} +0 -0
- /package/dist/ui/_next/static/media/{797e433ab948586e-s.p.0r6juujl39pe6.woff2 → 07a39a8a4660cc7c-s.p.0r6juujl39pe6.woff2} +0 -0
- /package/dist/ui/_next/static/media/{bbc41e54d2fcbd21-s.1rgnod-3esatf.woff2 → 2a04751c893bf294-s.1rgnod-3esatf.woff2} +0 -0
- /package/dist/ui/_next/static/media/{6306c77e7c8268e4-s.2dbetqa9o8jxf.woff2 → 2bb852295097cd96-s.2dbetqa9o8jxf.woff2} +0 -0
- /package/dist/ui/_next/static/media/{fef07dbb0973bf53-s.3p2_lha1f2xer.woff2 → 4f6667dd39116621-s.3p2_lha1f2xer.woff2} +0 -0
- /package/dist/ui/_next/static/media/{caa3a2e1cccd8315-s.p.0wgildi0cnwt9.woff2 → 605ce01b664af129-s.p.0wgildi0cnwt9.woff2} +0 -0
- /package/dist/ui/_next/static/media/{4fa387ec64143e14-s.2tuy5pz7dlieh.woff2 → 6e342921ee4dcd9d-s.2tuy5pz7dlieh.woff2} +0 -0
- /package/dist/ui/_next/static/media/{7178b3e590c64307-s.21jp631_3pja2.woff2 → 77814b00d5ca94a4-s.21jp631_3pja2.woff2} +0 -0
- /package/dist/ui/_next/static/media/{7d817b4c03b0c5f1-s.1uyisp29ctx0d.woff2 → 9eb5a876700c0028-s.1uyisp29ctx0d.woff2} +0 -0
- /package/dist/ui/_next/static/media/{5ce348bf30bf5439-s.31988l_ccedte.woff2 → b0c6b664fd57c2c6-s.31988l_ccedte.woff2} +0 -0
- /package/dist/ui/_next/static/media/{53b9e256198e5412-s.390ncx5urfkfu.woff2 → f58031ded4338640-s.390ncx5urfkfu.woff2} +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,37837,e=>{var t=e.i(72587),n=e.i(55218),s=e.i(90484),r=e.i(14865);e.s(["f",0,function({anchor:e,open:o,onClose:a,children:l,label:i,width:c=280,role:d="dialog"}){let p=(0,n.useRef)(null),[u,h]=(0,n.useState)(null);return((0,n.useLayoutEffect)(()=>{if(!o)return;let t=()=>{if(!e.current)return;let t=(0,r.C)(e.current),n=(0,r.v)(),s=p.current?.offsetHeight??320,o=n.height-t.bottom-8,a=t.top-8,l=o<Math.min(s,240)&&a>o,i=Math.min(Math.max(8,t.right-c),n.width-c-8);h({top:l?Math.max(8,t.top-Math.min(s,a)-4):t.bottom+4,left:i,maxHeight:Math.max(160,(l?a:o)-4)})};t();let n=window.requestAnimationFrame(t);return window.addEventListener("resize",t),()=>{window.cancelAnimationFrame(n),window.removeEventListener("resize",t)}},[o,e,c]),(0,n.useEffect)(()=>{if(!o)return;let t=t=>{let n=t.target;p.current?.contains(n)||e.current?.contains(n)||a()},n=t=>{"Escape"===t.key&&(t.stopPropagation(),a(),e.current?.focus())},s=e=>{p.current?.contains(e.target)||a()},r=t=>{e.current?.contains(t.target)&&(t.stopPropagation(),t.preventDefault(),a())};return document.addEventListener("pointerdown",t,!0),document.addEventListener("click",r,!0),document.addEventListener("keydown",n,!0),document.addEventListener("scroll",s,!0),()=>{document.removeEventListener("pointerdown",t,!0),document.removeEventListener("click",r,!0),document.removeEventListener("keydown",n,!0),document.removeEventListener("scroll",s,!0)}},[o,a,e]),(0,n.useEffect)(()=>{o&&window.setTimeout(()=>p.current?.querySelector("[role=menuitem], input, select, button")?.focus(),0)},[o]),!o||"u"<typeof document)?null:(0,s.createPortal)((0,t.jsx)("div",{ref:p,role:d,"aria-label":i,style:{top:u?.top??-9999,left:u?.left??-9999,width:c,maxHeight:u?.maxHeight},className:"anim-pop fixed z-[70] overflow-auto rounded-lg border border-line bg-panel p-3 shadow-2xl",children:l}),document.body)}])},32610,e=>{var t=e.i(72587),n=e.i(55218);e.s(["f",0,function({orientation:e,label:s,value:r,onMove:o,onStep:a,onReset:l,onDragging:i,className:c="",style:d}){let[p,u]=(0,n.useState)(!1);(0,n.useEffect)(()=>i?.(p),[p,i]),(0,n.useEffect)(()=>{if(!p)return;let t=e=>o(e.clientX,e.clientY),n=()=>u(!1);return document.body.style.userSelect="none",document.body.style.cursor="vertical"===e?"col-resize":"row-resize",window.addEventListener("pointermove",t),window.addEventListener("pointerup",n),()=>{document.body.style.userSelect="",document.body.style.cursor="",window.removeEventListener("pointermove",t),window.removeEventListener("pointerup",n)}},[p,o,e]);let h="vertical"===e;return(0,t.jsx)("div",{role:"separator",tabIndex:0,"aria-orientation":e,"aria-label":s,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r),title:`${s} — drag, or double-click to reset`,onPointerDown:e=>{0===e.button&&(e.preventDefault(),u(!0))},onDoubleClick:l,style:{...d,outline:"none"},onKeyDown:e=>{let t=h?"ArrowLeft":"ArrowUp";e.key===t||e.key===(h?"ArrowRight":"ArrowDown")?(e.preventDefault(),a(e.key===t?-1:1,e.shiftKey)):("Enter"===e.key||"Home"===e.key)&&(e.preventDefault(),l())},className:`group z-20 hidden touch-none outline-none lg:block ${h?"w-2 cursor-col-resize":"h-2 cursor-row-resize"} ${c}`,children:(0,t.jsx)("span",{"aria-hidden":!0,className:`pointer-events-none absolute bg-accent opacity-0 transition-opacity group-hover:opacity-60 group-focus-visible:opacity-100 ${p?"opacity-100":""} ${h?"inset-y-0 left-1/2 w-0.5 -translate-x-1/2":"inset-x-0 top-1/2 h-0.5 -translate-y-1/2"}`})})}])},30617,e=>{e.i(24856);var t=e.i(46306),n=e.i(36558),s=e.i(2385),r=e.i(17219);let o={base:0,header:1,desc:2,pass:3,warn:4,fail:5};function a(e){return String(e).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("\n"," ")}function l(e,t,n){if("level"===e)return"pass"===t?o.pass:"warn"===t?o.warn:"fail"===t?o.fail:o.base;let s="number"==typeof t?t:Number(t);return"errors"===e?s>=n.errorFail?o.fail:s>=n.errorWarn?o.warn:o.pass:s>=n.p95FailMs?o.fail:s>=n.p95WarnMs?o.warn:o.pass}let i=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
|
+
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
|
|
3
|
+
<fonts count="3">
|
|
4
|
+
<font><sz val="11"/><name val="Calibri"/></font>
|
|
5
|
+
<font><b/><sz val="11"/><color rgb="FFFFFFFF"/><name val="Calibri"/></font>
|
|
6
|
+
<font><sz val="10"/><color rgb="FF5C6778"/><name val="Calibri"/></font>
|
|
7
|
+
</fonts>
|
|
8
|
+
<fills count="6">
|
|
9
|
+
<fill><patternFill patternType="none"/></fill>
|
|
10
|
+
<fill><patternFill patternType="gray125"/></fill>
|
|
11
|
+
<fill><patternFill patternType="solid"><fgColor rgb="FF0B8F7C"/></patternFill></fill>
|
|
12
|
+
<fill><patternFill patternType="solid"><fgColor rgb="FFDCFCE7"/></patternFill></fill>
|
|
13
|
+
<fill><patternFill patternType="solid"><fgColor rgb="FFFEF3C7"/></patternFill></fill>
|
|
14
|
+
<fill><patternFill patternType="solid"><fgColor rgb="FFFECACA"/></patternFill></fill>
|
|
15
|
+
</fills>
|
|
16
|
+
<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>
|
|
17
|
+
<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>
|
|
18
|
+
<cellXfs count="6">
|
|
19
|
+
<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>
|
|
20
|
+
<xf numFmtId="0" fontId="1" fillId="2" borderId="0" xfId="0" applyFont="1" applyFill="1" applyAlignment="1"><alignment horizontal="center" vertical="center"/></xf>
|
|
21
|
+
<xf numFmtId="0" fontId="2" fillId="0" borderId="0" xfId="0" applyFont="1" applyAlignment="1"><alignment wrapText="1" vertical="center"/></xf>
|
|
22
|
+
<xf numFmtId="0" fontId="0" fillId="3" borderId="0" xfId="0" applyFill="1"/>
|
|
23
|
+
<xf numFmtId="0" fontId="0" fillId="4" borderId="0" xfId="0" applyFill="1"/>
|
|
24
|
+
<xf numFmtId="0" fontId="0" fillId="5" borderId="0" xfId="0" applyFill="1"/>
|
|
25
|
+
</cellXfs>
|
|
26
|
+
</styleSheet>`;async function c(e,r,a){let i=(0,s.s)(e,{slo:r}),c=(0,s.v)(r),p=(0,t.$)(a,(0,t.L)(e));return d([{name:"Overview",rows:[[{v:"Key",s:o.header},{v:"Value",s:o.header},{v:"What this means",s:o.header}],...(0,n.E)(e).map(e=>{let t=o.base;return"failed_rate"===e.key&&(t=l("errors",e.value,c)),"latency_p95_ms"===e.key&&(t=l("latency",e.value,c)),(e.key.startsWith("status_5")||"status_0"===e.key)&&(t=Number(e.value)>0?o.fail:o.pass),e.key.startsWith("status_4")&&Number(e.value)>0&&(t=o.warn),e.key.startsWith("threshold:")&&(t="pass"===e.value?o.pass:o.fail),[{v:e.key},{v:e.value,s:t},{v:e.description,s:o.desc}]})]},{name:"Result summary",rows:[[{v:"Field",s:o.header},{v:"Level",s:o.header},{v:"What this means",s:o.header}],[{v:"overall"},{v:i.overall,s:l("level",i.overall,c)},{v:i.headline,s:o.desc}],...i.aspects.map(e=>[{v:e.title},{v:e.level,s:l("level",e.level,c)},{v:e.summary,s:o.desc}]),[{v:"disclaimer"},{v:""},{v:i.disclaimer,s:o.desc}],...p.map((e,n)=>[{v:`chart_${n+1}`},{v:`${e.w}x${e.h}`},{v:t.p[e.id],s:o.desc}])]},{name:"Second by second",rows:[n.V.map(e=>({v:e.header,s:o.header})),...e.buckets.map(e=>(0,n.u)(e).map((e,t)=>{let s=n.V[t]?.key,r=o.base;return"p95_ms"===s&&(r=l("latency",e,c)),"failed_rate"===s&&(r=l("errors",e,c)),"http_5xx"===s&&Number(e)>0&&(r=o.fail),"http_0"===s&&Number(e)>0&&(r=o.fail),"http_4xx"===s&&Number(e)>0&&(r=o.warn),"http_2xx"===s&&Number(e)>0&&(r=o.pass),{v:e,s:r}}))]}])}function d(e){let t={"[Content_Types].xml":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
27
|
+
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
|
28
|
+
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
|
|
29
|
+
<Default Extension="xml" ContentType="application/xml"/>
|
|
30
|
+
<Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>
|
|
31
|
+
<Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>
|
|
32
|
+
${e.map((e,t)=>` <Override PartName="/xl/worksheets/sheet${t+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("\n")}
|
|
33
|
+
</Types>`,"_rels/.rels":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
34
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
35
|
+
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>
|
|
36
|
+
</Relationships>`,"xl/workbook.xml":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
37
|
+
<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
|
|
38
|
+
<sheets>
|
|
39
|
+
${e.map((e,t)=>` <sheet name="${a(e.name.replace(/[:\\/?*[\]]/g," ").trim().slice(0,31)||"Sheet")}" sheetId="${t+1}" r:id="rId${t+1}"/>`).join("\n")}
|
|
40
|
+
</sheets>
|
|
41
|
+
</workbook>`,"xl/_rels/workbook.xml.rels":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
42
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
43
|
+
${e.map((e,t)=>` <Relationship Id="rId${t+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${t+1}.xml"/>`).join("\n")}
|
|
44
|
+
<Relationship Id="rId${e.length+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
|
|
45
|
+
</Relationships>`,"xl/styles.xml":i};return e.forEach((e,n)=>{var s;let r,o,l;return t[`xl/worksheets/sheet${n+1}.xml`]=(s=e.rows,o=Array.from({length:r=s[0]?.length??0},(e,t)=>{let n=function(e,t,n=10,s=48){let r=n;for(let n of e){let e=n[t]?.v;void 0!==e&&(r=Math.max(r,String(e).length+2))}return Math.min(s,r)}(s,t,t===r-1&&r>=3?36:12,t===r-1&&r>=3?72:42);return`<col min="${t+1}" max="${t+1}" width="${n}" customWidth="1"/>`}).join(""),l=s.map((e,t)=>`<row r="${t+1}" ht="${0===t?22:18}" customHeight="1">${e.map((e,n)=>{var s;let r,o;return s=t+1,r=`${function(e){let t=e+1,n="";for(;t>0;)n=String.fromCharCode(65+(t-1)%26)+n,t=Math.floor((t-1)/26);return n}(n)}${s}`,o=void 0!==e.s?` s="${e.s}"`:"","number"==typeof e.v&&Number.isFinite(e.v)?`<c r="${r}"${o}><v>${e.v}</v></c>`:`<c r="${r}"${o} t="inlineStr"><is><t xml:space="preserve">${a(e.v)}</t></is></c>`}).join("")}</row>`).join(""),`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
46
|
+
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
|
|
47
|
+
<sheetViews><sheetView workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/></sheetView></sheetViews>
|
|
48
|
+
<cols>${o}</cols>
|
|
49
|
+
<sheetData>${l}</sheetData>
|
|
50
|
+
</worksheet>`)}),new Blob([(0,r.f)(t)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})}e.s(["S",0,o,"a",0,c,"F",0,d])},62766,e=>{var t=e.i(55218);let n="apitestcenter-pane-sizes",s=(e,t,n)=>Math.min(n,Math.max(t,e));function r(e){let[n,s]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{let t=window.matchMedia(e),n=()=>s(t.matches);return n(),t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[e]),n}e.s(["K",0,function(e,{min:o=220,max:a=900,rest:l=360}={}){let i=r("(min-width: 1024px)"),c=(0,t.useRef)(null),d=`${n}:${e}`,[p,u]=(0,t.useState)(null),[h,m]=(0,t.useState)(0);(0,t.useEffect)(()=>{try{let e=Number(JSON.parse(localStorage.getItem(d)??"null"));Number.isFinite(e)&&e>0&&u(e)}catch{}},[d]),(0,t.useEffect)(()=>{let e=[...c.current?.children??[]].find(e=>"separator"!==e.getAttribute("role"));if(!e)return;let t=new ResizeObserver(()=>m(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[i]);let f=(0,t.useCallback)(e=>{let t=c.current?.getBoundingClientRect(),n=null===e?null:Math.round(s(e,o,Math.max(o,Math.min(a,(t?.width??a+l)-l))));u(n);try{null===n?localStorage.removeItem(d):localStorage.setItem(d,JSON.stringify(n))}catch{}},[a,o,l,d]),y=()=>c.current?.getBoundingClientRect();return{wide:i,gridRef:c,gridStyle:i&&null!==p?{gridTemplateColumns:`${p}px minmax(0,1fr)`}:void 0,splitter:{orientation:"vertical",value:(p??h)/Math.max(1,y()?.width??1)*100,onMove:e=>{let t=y();t&&f(e-t.left)},onStep:(e,t)=>f((p??h)+16*e*(t?4:1)),onReset:()=>f(null),className:"absolute inset-y-0 -translate-x-1/2",style:{left:`${h}px`}}}},"f",0,function(e,o){let a=r("(min-width: 1024px)"),l=r("(min-width: 1536px)"),i=(0,t.useRef)(null),[c,d]=(0,t.useState)({panel:null,beside:null,below:null});(0,t.useEffect)(()=>{try{let e=JSON.parse(localStorage.getItem(n)??"null"),t=e=>"number"==typeof e&&Number.isFinite(e)?e:null;e&&d({panel:t(e.panel),beside:t(e.beside),below:t(e.below)})}catch{}},[]);let p=(0,t.useCallback)(e=>{d(t=>{let s={...t,...e};try{localStorage.setItem(n,JSON.stringify(s))}catch{}return s})},[]),u=s(c.panel??(l?256:240),180,480),h=o?u:0,m=s("below"===e?c.below??.5:c.beside??(l?5/12:.5),.2,.8),f=a?"below"===e?{gridTemplateColumns:`${h}px minmax(0,1fr)`,gridTemplateRows:`minmax(0,${m}fr) minmax(0,${1-m}fr)`}:{gridTemplateColumns:`${h}px minmax(0,${m}fr) minmax(0,${1-m}fr)`}:void 0,y=()=>i.current?.getBoundingClientRect(),v=(0,t.useCallback)(e=>{let t=y();t&&p({panel:s(e-t.left,180,Math.min(480,.4*t.width))})},[p]),x=(0,t.useCallback)((t,n)=>{let r=y();r&&("below"===e?p({below:s((n-r.top)/r.height,.2,.8)}):p({beside:s((t-r.left-h)/Math.max(1,r.width-h),.2,.8)}))},[p,e,h]);return{wide:a,gridRef:i,gridStyle:f,panelWidth:a?u:void 0,panel:{value:u/480*100,onMove:e=>v(e),onStep:(e,t)=>p({panel:s(u+16*e*(t?4:1),180,480)}),onReset:()=>p({panel:null}),style:{left:`${h}px`}},split:{value:100*m,onMove:x,onStep:(t,n)=>p("below"===e?{below:s(m+.02*t*(n?5:1),.2,.8)}:{beside:s(m+.02*t*(n?5:1),.2,.8)}),onReset:()=>p("below"===e?{below:null}:{beside:null}),style:"below"===e?{top:`${100*m}%`,left:`${h}px`,right:0}:{left:`calc(${h}px + (100% - ${h}px) * ${m})`,top:0,bottom:0}}}}])},61230,17847,e=>{e.s(["f",0,function(e){try{return decodeURI(e.replace(/\+/g,"%20")).replace(/%2C/gi,",").replace(/%24/g,"$").replace(/%27/g,"'").replace(/%3A/gi,":").replace(/%2F/gi,"/").replace(/%3D/gi,"=")}catch{return e}}],61230);var t=e.i(72587),n=e.i(55218),s=e.i(90484),r=e.i(14865);e.s(["c",0,function({at:e,label:o,onClose:a,children:l}){let i=(0,n.useRef)(null),[c,d]=(0,n.useState)(null);return((0,n.useLayoutEffect)(()=>{let t=i.current;if(!t)return;let n=(0,r.v)();d({left:Math.max(8,Math.min(e.x,n.width-t.offsetWidth-8)),top:Math.max(8,Math.min(e.y,n.height-t.offsetHeight-8))}),t.querySelector('[role="menuitem"]:not(:disabled)')?.focus()},[e]),(0,n.useEffect)(()=>{let e=e=>{i.current?.contains(e.target)||a()},t=e=>{if("Escape"===e.key)e.stopPropagation(),a();else if("ArrowDown"===e.key||"ArrowUp"===e.key){e.preventDefault();let t=[...i.current?.querySelectorAll('[role="menuitem"]:not(:disabled)')??[]],n=t.indexOf(document.activeElement);t[(n+("ArrowDown"===e.key?1:-1)+t.length)%t.length]?.focus()}};return document.addEventListener("pointerdown",e,!0),document.addEventListener("scroll",e,!0),window.addEventListener("resize",a),window.addEventListener("keydown",t,!0),()=>{document.removeEventListener("pointerdown",e,!0),document.removeEventListener("scroll",e,!0),window.removeEventListener("resize",a),window.removeEventListener("keydown",t,!0)}},[a]),"u"<typeof document)?null:(0,s.createPortal)((0,t.jsx)("div",{ref:i,role:"menu","aria-label":o,style:{left:c?.left??-9999,top:c?.top??-9999},className:"fixed z-[80] w-56 rounded-lg border border-line bg-panel p-1 shadow-2xl",children:l}),document.body)},"d",0,function({icon:e,label:n,hint:s,onSelect:r,danger:o=!1,disabled:a=!1}){return(0,t.jsxs)("button",{type:"button",role:"menuitem",disabled:a,onClick:r,className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-left text-sm disabled:opacity-40 ${o?"text-bad hover:bg-bad/10":"text-ink hover:bg-panel-2"}`,children:[(0,t.jsx)("span",{className:`flex w-4 shrink-0 justify-center ${o?"":"text-mute"}`,"aria-hidden":!0,children:e?(0,t.jsx)(e,{size:14}):null}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:n}),s?(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-mute",children:s}):null]})},"U",0,function({children:e}){return(0,t.jsx)("div",{className:"px-2.5 pt-1.5 pb-1 text-[11px] font-medium tracking-wide text-mute uppercase",children:e})},"Z",0,function(){return(0,t.jsx)("div",{role:"separator",className:"my-1 h-px bg-line"})}],17847)},17219,e=>{let t=new Uint32Array(256).map((e,t)=>{let n=t;for(let e=0;e<8;e++)n=1&n?0xedb88320^n>>>1:n>>>1;return n>>>0});function n(e){let t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e,!0),t}function s(e){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),t}function r(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let s of e)t.set(s,n),n+=s.length;return t}e.s(["f",0,function(e){let o=new TextEncoder,a=[],l=[],i=0;for(let[c,d]of Object.entries(e)){let e=o.encode(c),p="string"==typeof d?o.encode(d):d,u=function(e){let n=0xffffffff;for(let s of e)n=t[(n^s)&255]^n>>>8;return(0xffffffff^n)>>>0}(p),h=r([s(0x4034b50),n(20),n(0),n(0),n(0),n(0),s(u),s(p.length),s(p.length),n(e.length),n(0),e,p]),m=r([s(0x2014b50),n(20),n(20),n(0),n(0),n(0),n(0),s(u),s(p.length),s(p.length),n(e.length),n(0),n(0),n(0),n(0),s(0),s(i),e]);a.push(h),l.push(m),i+=h.length}let c=r(l),d=r([s(0x6054b50),n(0),n(0),n(Object.keys(e).length),n(Object.keys(e).length),s(c.length),s(i),n(0)]),p=r([...a,c,d]);return new Blob([p.buffer.slice(p.byteOffset,p.byteOffset+p.byteLength)],{type:"application/zip"})}])},13643,e=>{let t=(0,e.i(99522).f)("bell-off",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]);e.s(["f",0,t],13643)},95211,e=>{let t=(0,e.i(99522).f)("columns-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);e.s(["f",0,t],95211)},81538,e=>{let t=(0,e.i(99522).f)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);e.s(["f",0,t],81538)},13163,e=>{let t=(0,e.i(99522).f)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["f",0,t],13163)},3792,e=>{let t=(0,e.i(99522).f)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["f",0,t],3792)},95927,e=>{let t=(0,e.i(99522).f)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["f",0,t],95927)},66478,14168,e=>{let t=(0,e.i(99522).f)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);async function n(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Engine error (${e.status})`);return t}e.s(["f",0,t],66478);let s=(e,t,n)=>fetch(t,{method:e,headers:void 0===n?void 0:{"content-type":"application/json"},body:void 0===n?void 0:JSON.stringify(n)});e.s(["Y",0,{plan:e=>fetch(`/engine/suites/plan?collection=${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>n(e)),savePlan:(e,t)=>s("PUT","/engine/suites/plan",{collection:e,...t}).then(e=>n(e)),start:e=>s("POST","/engine/suites/runs",e).then(e=>n(e)),get:e=>fetch(`/engine/suites/runs/${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>n(e)),stop:e=>s("POST",`/engine/suites/runs/${encodeURIComponent(e)}/stop`).then(e=>n(e))},"W",0,function(e){return`/suite?c=${encodeURIComponent(e)}`}],14168)},36558,e=>{function t(e,n=2){if(!Number.isFinite(e))return 0;let s=10**n;return Math.round(e*s)/s}function n(e){return e>=100?Math.round(e):e>=10?t(e,1):t(e,2)}function s(e){return e>=10?Math.round(e):t(e,1)}function r(e,t=e=>e){return null==e?"":t(e)}e.s(["V",0,[{key:"elapsed_s",header:"Seconds into test",description:"Seconds from the start of the run."},{key:"ts",header:"Clock time",description:"Wall-clock time for this one-second sample."},{key:"vus",header:"Concurrent users",description:"Virtual users (VUs) active in this second."},{key:"rps",header:"Requests per second",description:"Completed requests in this second."},{key:"p50_ms",header:"Median latency (ms)",description:"Half of requests this second were faster than this."},{key:"p95_ms",header:"95th percentile (ms)",description:"95% of requests this second were faster than this."},{key:"p99_ms",header:"99th percentile (ms)",description:"The slow tail this second — 1 in 100 was slower."},{key:"failed_rate",header:"Error rate",description:"Share of requests that failed in this second (0–1)."},{key:"http_2xx",header:"Success (2xx)",description:"Successful HTTP responses this second."},{key:"http_4xx",header:"Client errors (4xx)",description:"Client / auth errors this second."},{key:"http_5xx",header:"Server errors (5xx)",description:"Server errors this second."},{key:"http_0",header:"Network failures",description:"No HTTP status (timeout / reset) this second."},{key:"bytes_in",header:"Bytes received",description:"Response bytes this second."},{key:"bytes_out",header:"Bytes sent",description:"Request bytes this second."},{key:"p90_ms",header:"90th percentile (ms)",description:"90% of requests this second were faster than this."},{key:"p999_ms",header:"99.9th percentile (ms)",description:"1 in 1,000 requests this second was slower than this."},{key:"max_ms",header:"Slowest (ms)",description:"Slowest request this second."},{key:"ttfb_ms",header:"Server time (ms)",description:"Average time to first byte this second — the server's own work."},{key:"connect_ms",header:"TCP connect (ms)",description:"Average TCP connect time this second (0 when connections are reused)."},{key:"tls_ms",header:"TLS handshake (ms)",description:"Average TLS handshake time this second."},{key:"checks_passed",header:"Checks passed",description:"Response checks that passed this second."},{key:"checks_failed",header:"Checks failed",description:"Response checks that failed this second."},{key:"dropped",header:"Dropped requests",description:"Rate mode: requests k6 could not start this second."}],"u",0,function(e){return[e.elapsedS,e.ts,t(e.vus,1),n(e.rps),s(e.p50Ms),s(e.p95Ms),s(e.p99Ms),t(e.failedRate,4),e.http2xx,e.http4xx,e.http5xx,e.http0,e.bytesIn,e.bytesOut,r(e.p90Ms,s),r(e.p999Ms,s),r(e.maxMs,s),r(e.ttfbMs,s),r(e.connectMs,s),r(e.tlsMs,s),r(e.checksPassed),r(e.checksFailed),r(e.dropped)]},"E",0,function(e){let{summary:r}=e,o=[{key:"run_id",value:e.id,description:"Id of this run in this browser tab."},{key:"test_name",value:e.testName,description:"Display name (method, path, time)."},{key:"status",value:e.status,description:"completed, failed, cancelled, or still running."},{key:"started_at",value:e.startedAt,description:"When the load test started (UTC)."},{key:"ended_at",value:e.endedAt,description:"When the load test finished (UTC)."},{key:"method",value:e.definition.method,description:"HTTP method that was repeated."},{key:"url",value:e.definition.url,description:"Target URL (secrets are not exported)."},{key:"auth_mode",value:e.definition.auth.mode,description:"Auth used: none, bearer, basic, or api_key. The secret is not exported."},{key:"executor",value:e.definition.load.executor,description:"Load pattern: constant-vus (steady) or ramping-vus (ramp / hold / down)."},{key:"requests",value:r.http.requests,description:"How many HTTP calls finished. Zero usually means the target never answered."},{key:"rps_avg",value:n(r.http.rps.avg),description:"Average requests per second completed by this generator."},{key:"rps_max",value:n(r.http.rps.max),description:"Peak requests per second in any one-second sample."},{key:"failed_count",value:r.http.failed.count,description:"Requests that failed (4xx, 5xx, timeout, or no status)."},{key:"failed_rate",value:t(r.http.failed.rate,4),description:"Failed / total. Default warning bar is 1% (0.01)."},{key:"latency_min_ms",value:s(r.latencyMs.min),description:"Fastest request (milliseconds)."},{key:"latency_mean_ms",value:s(r.latencyMs.mean),description:"Average response time. Slow outliers pull this up."},{key:"latency_p50_ms",value:s(r.latencyMs.median),description:"Median — half of requests were faster than this."},{key:"latency_p95_ms",value:s(r.latencyMs.p95),description:"95th percentile — 95% of requests were faster. Usual headline latency."},{key:"latency_p99_ms",value:s(r.latencyMs.p99),description:"99th percentile — the slow tail (1 in 100 was slower)."},{key:"latency_max_ms",value:s(r.latencyMs.max),description:"Slowest single request."},{key:"vus_max",value:r.vus.max,description:"Peak concurrent users (virtual users / VUs)."},{key:"vus_avg",value:t(r.vus.avg,1),description:"Average concurrent users over the run."},{key:"bytes_in",value:r.data.bytesIn,description:"Response bytes received by the generator."},{key:"bytes_out",value:r.data.bytesOut,description:"Request bytes sent by the generator."},{key:"phase_ttfb_avg_ms",value:s(r.phasesMs.ttfb.avg),description:"Time to first byte — waiting on the server after the connection is up."},{key:"phase_tls_avg_ms",value:s(r.phasesMs.tls.avg),description:"TLS handshake time. High values often mean a far or overloaded endpoint."}];for(let[e,t]of Object.entries(r.http.status)){let n="0"===e?"No HTTP status (timeout / network).":Number(e)>=500?"Server error.":Number(e)>=400?"Client / auth error.":"Success-class response.";o.push({key:`status_${e}`,value:t,description:`How many responses had status ${e}. ${n}`})}for(let e of r.thresholds)o.push({key:`threshold:${e.name}`,value:e.ok?"pass":"fail",description:"k6 threshold result for this run."});return o}])}])})();
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93639,e=>{var t=e.i(72587);e.i(24856);var s=e.i(78451);function a(e){let t=t=>e.filter(e=>e.state===t).length;return{total:e.length,passed:t("passed"),failed:t("failed"),errors:t("error"),skipped:t("skipped"),durationMs:Math.round(e.reduce((e,t)=>e+(t.durationMs??0),0))}}function n(e){let t=a(e.steps);return t.passed>0&&0===t.failed&&0===t.errors}function i(e){let t=a(e.steps),s=t.total-t.skipped;if("running"===e.status)return`Running ${t.passed+t.failed+t.errors+1} of ${s}…`;if(!s)return"Nothing ran";let n=[`${t.passed} of ${s} passed`];return t.failed&&n.push(`${t.failed} failed`),t.errors&&n.push(`${t.errors} could not run`),t.skipped&&n.push(`${t.skipped} skipped`),"stopped"===e.status&&n.push("stopped early"),n.join(" · ")}let l=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),r=e=>((e??0)/1e3).toFixed(3),o=e=>String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),d={passed:"Passed",failed:"Failed",error:"Could not run",skipped:"Skipped",pending:"Not run",running:"Not finished"};var c=e.i(53012),u=e.i(99522);let p=(0,u.f)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),m=(0,u.f)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);var x=e.i(17118),h=e.i(95486),f=e.i(60961),b=e.i(40945),g=e.i(75117);let v=(0,u.f)("file-archive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]]);var y=e.i(29091),k=e.i(27813);let j=(0,u.f)("circle-minus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);var w=e.i(3792),$=e.i(66478),N=e.i(27122),S=e.i(70989),C=e.i(55218),M=e.i(69578),z=e.i(80707),q=e.i(56396);function R({collection:e,environment:t,data:s="api-tests"}){let a=t?` --env ${JSON.stringify(t)}`:"";return`npx --yes apitestcenter suite ${JSON.stringify(e)} --data ${s}${a} --junit atc-results.xml`}var P=e.i(17219);async function A(e,t){var s;let a,n=await fetch(`/engine/suites/export?collection=${encodeURIComponent(e)}`,{cache:"no-store"}),i=await n.json().catch(()=>null);if(!n.ok||!i?.files)throw Error(i?.error??`Engine error (${n.status})`);let l=i.secrets??[],r={};for(let e of i.files)r[`api-tests/${e.path}`]=e.text;r["api-tests/README.md"]=function(e){let{collection:t,environment:s,secrets:a=[],data:n="api-tests"}=e,i=s?` --env ${JSON.stringify(s)}`:"";return`# API checks — ${t||"requests outside a collection"}
|
|
2
|
+
|
|
3
|
+
Every request in this collection is sent once, in the saved order, and checked. The run fails
|
|
4
|
+
(exit code 1) when any request fails.
|
|
5
|
+
|
|
6
|
+
${R(e)}
|
|
7
|
+
|
|
8
|
+
- Nothing to install first: \`npx\` fetches the command line (Node.js 20 or later).
|
|
9
|
+
- Edit these tests in a window: \`npx apitestcenter ui --data ${n}\` (or the desktop app).
|
|
10
|
+
- \`${n}/requests\` holds the saved requests, \`environments.json\` the environments, and
|
|
11
|
+
\`suites.json\` the run order. Secret values are never in these files.
|
|
12
|
+
- Pass secrets from your CI's secret store: write \`{{token}}\` in the request, then add
|
|
13
|
+
\`--var token=$MY_TOKEN\` to the command.
|
|
14
|
+
${a.length?`
|
|
15
|
+
**These requests have a secret typed straight into them, which is not exported** — change it to a
|
|
16
|
+
{{variable}} and pass it with --var, or they will not run here:
|
|
17
|
+
|
|
18
|
+
${a.map(e=>`- ${e}`).join("\n")}
|
|
19
|
+
`:""}
|
|
20
|
+
To check speed too, load-test one request with goals, and compare with a baseline:
|
|
21
|
+
|
|
22
|
+
npx --yes apitestcenter run "${t?`${t}/`:""}<request name>" --data ${n}${i} --p95 500 --errors 1 --baseline ${n}/baseline.json --max-slower 10
|
|
23
|
+
|
|
24
|
+
Guide: https://apitestcenter.com/docs/ci-walkthrough.html
|
|
25
|
+
`}({collection:e,environment:t,secrets:l}),r[".github/workflows/api-checks.yml"]=(a=(s={collection:e,environment:t}).collection||"requests outside a collection",`# Runs the "${a}" API checks on every push. Made by APITestCenter.
|
|
26
|
+
# Guide: https://apitestcenter.com/docs/ci-walkthrough.html
|
|
27
|
+
name: API checks
|
|
28
|
+
|
|
29
|
+
on:
|
|
30
|
+
push:
|
|
31
|
+
workflow_dispatch:
|
|
32
|
+
# Every hour too, even when nobody pushes (a scheduled check that runs while your computer is off):
|
|
33
|
+
# remove the # from the next two lines.
|
|
34
|
+
# schedule:
|
|
35
|
+
# - cron: "0 * * * *"
|
|
36
|
+
|
|
37
|
+
jobs:
|
|
38
|
+
api-checks:
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@v4
|
|
42
|
+
|
|
43
|
+
- uses: actions/setup-node@v4
|
|
44
|
+
with:
|
|
45
|
+
node-version: 22
|
|
46
|
+
|
|
47
|
+
# Fails the job when any request fails. Secrets: add --var name=$\{{ secrets.NAME }}
|
|
48
|
+
- name: Check every request
|
|
49
|
+
run: ${R(s)}
|
|
50
|
+
|
|
51
|
+
- name: Keep the results
|
|
52
|
+
if: always()
|
|
53
|
+
uses: actions/upload-artifact@v4
|
|
54
|
+
with:
|
|
55
|
+
name: api-check-results
|
|
56
|
+
path: atc-results.xml
|
|
57
|
+
`);let o=(e||"requests").replace(/[^\w.-]+/g,"-").replace(/^-|-$/g,"")||"requests";return{blob:(0,P.f)(r),name:`${o}-for-ci.zip`,secrets:l}}var I=e.i(15060),T=e.i(14168),E=e.i(6278),O=e.i(15868),U=e.i(92084),L=e.i(13643);let F=(0,u.f)("bell-ring",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]]),D=(0,u.f)("calendar-clock",[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]),H=(0,u.f)("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]);var J=e.i(49913),Y=e.i(96659),V=e.i(39170),W=e.i(727),B=e.i(44505),G=e.i(43101),K=e.i(60889);let _=e=>{let t=new Date(e);return new Date().toDateString()===t.toDateString()?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},X=Object.entries(U.S);function Q({collection:e,environment:s}){let a=(0,q.d)(),n=(0,V.L)(),{environments:i}=(0,E.U)(),l=(0,G.C)(),r=(0,W.I)(),[o,d]=(0,C.useState)(15),[c,u]=(0,C.useState)("changes"),[p,m]=(0,C.useState)(null),x=(0,K.d)(),h=e=>e?i.find(t=>t.id===e)?.name??"an environment that was removed":"no environment",f=l?.find(t=>t.collection===e&&t.environment===s);async function b(e,t,s){m(e);try{let e=await t(),n=s?.(e);n&&a(n,"success")}catch(e){a(e instanceof Error?e.message:"That didn't work","error")}finally{m(null)}}return(0,t.jsxs)("section",{"aria-label":"Scheduled checks",className:"rounded-lg border border-line bg-panel",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-line px-4 py-2 text-xs text-mute",children:[(0,t.jsx)(D,{size:14,"aria-hidden":!0}),(0,t.jsx)("span",{className:"font-medium text-ink",children:"Scheduled checks"}),(0,t.jsxs)("span",{children:["— a collection run every few minutes while the app runs, with a notification when it starts failing.",(0,B.f)()?.background?" Closing the window keeps it running in the tray.":""]}),"ask"===r||"off"===r?(0,t.jsxs)("button",{type:"button",className:"ml-auto inline-flex items-center gap-1 text-accent hover:underline",onClick:()=>void(0,W.y)(),children:[(0,t.jsx)(F,{size:12,"aria-hidden":!0})," Turn on desktop notifications"]}):"blocked"===r?(0,t.jsxs)("span",{className:"ml-auto inline-flex items-center gap-1",children:[(0,t.jsx)(L.f,{size:12,"aria-hidden":!0})," Notifications are blocked — you'll see them in the app only"]}):null]}),null===e||f?null:(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-3 border-b border-line px-4 py-3",children:[(0,t.jsxs)("p",{className:"w-full text-sm text-ink",children:["Run ",(0,t.jsx)("span",{className:"font-medium",children:e||"requests outside a folder"})," with ",h(s),":"]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-mute",children:["How often",(0,t.jsx)("select",{value:o,onChange:e=>d(Number(e.target.value)),className:"rounded-md border border-line bg-panel-2 px-2 py-1.5 text-sm text-ink",children:U.l.map(e=>(0,t.jsx)("option",{value:e,children:(0,U.s)(e).replace(/^every /,"Every ")},e))})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-mute",children:["Notify me",(0,t.jsx)("select",{value:c,onChange:e=>u(e.target.value),className:"rounded-md border border-line bg-panel-2 px-2 py-1.5 text-sm text-ink",children:X.map(([e,s])=>(0,t.jsx)("option",{value:e,children:s},e))})]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-primary",disabled:"add"===p,onClick:async()=>await x("schedules",(l?.length??0)+1)&&void b("add",()=>G.c.add({collection:e,environment:s,everyMinutes:o,notify:c}),()=>`Scheduled: ${e||"requests outside a folder"} ${(0,U.s)(o)} — the first run starts now`),children:["add"===p?(0,t.jsx)(k.f,{size:14,className:"animate-spin"}):(0,t.jsx)(D,{size:14}),"Schedule it"]})]}),null===l?(0,t.jsx)("p",{className:"px-4 py-3 text-sm text-mute",children:"Loading…"}):l.length?(0,t.jsx)("ul",{className:"divide-y divide-line","aria-label":"Scheduled collections",children:l.map(e=>(0,t.jsx)(Z,{s:e,env:h(e.environment),busy:p,current:e.id===f?.id,act:b,onRemove:async()=>{await n({title:`Stop running ${e.collection||"requests outside a folder"} on a schedule?`,body:"Its results go too. The requests stay.",confirmLabel:"Remove",tone:"danger"})&&await b(`rm:${e.id}`,()=>G.c.remove(e.id))}},e.id))}):(0,t.jsx)("p",{className:"px-4 py-3 text-sm text-mute",children:"None yet. A scheduled check keeps running while you work on something else."})]})}function Z({s:e,env:s,busy:a,current:n,act:i,onRemove:l}){let r=e.results.at(-1),[o,d]=(0,C.useState)(!1),c=e.collection||"Requests outside a folder";return(0,t.jsxs)("li",{className:n?"bg-accent-dim/30":void 0,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5 px-4 py-2.5",children:[r?r.passed?(0,t.jsx)(x.f,{size:16,className:"shrink-0 text-ok","aria-label":"Last run passed"}):(0,t.jsx)(N.f,{size:16,className:"shrink-0 text-bad","aria-label":"Last run failed"}):(0,t.jsx)(D,{size:16,className:"shrink-0 text-mute","aria-label":"Not run yet"}),(0,t.jsxs)("button",{type:"button",className:"min-w-0 text-left",onClick:()=>d(e=>!e),"aria-expanded":o,children:[(0,t.jsx)("span",{className:"block truncate text-sm font-medium text-ink",children:c}),(0,t.jsxs)("span",{className:"block text-xs text-mute",children:[(0,U.s)(e.everyMinutes)," · ",s," · ",e.enabled?r?`next at ${_(Math.max((0,U.K)(e),Date.now()))}`:"first run starting":"paused"]})]}),(0,t.jsx)("span",{className:"flex items-center gap-0.5","aria-label":`Last ${e.results.length} runs`,title:"Oldest on the left",children:e.results.slice(-20).map(e=>(0,t.jsx)("span",{title:`${_(e.at)} — ${e.headline}`,className:`h-3.5 w-1.5 rounded-sm ${e.passed?"bg-ok":"bg-bad"}`},e.at))}),(0,t.jsxs)("span",{className:"ml-auto flex items-center gap-1",children:[r?(0,t.jsxs)("span",{className:"mr-2 hidden text-xs text-mute sm:inline",children:[_(r.at),": ",r.headline]}):null,(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",disabled:a===`run:${e.id}`,onClick:()=>void i(`run:${e.id}`,()=>G.c.run(e.id),e=>e.passed?`${c}: ${e.headline}`:null),title:"Run it now",children:[a===`run:${e.id}`?(0,t.jsx)(k.f,{size:12,className:"animate-spin"}):(0,t.jsx)(J.f,{size:12})," Run now"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",onClick:()=>void i(`pause:${e.id}`,()=>G.c.update(e.id,{enabled:!e.enabled})),"aria-label":e.enabled?`Pause ${c}`:`Resume ${c}`,children:[e.enabled?(0,t.jsx)(H,{size:12}):(0,t.jsx)(w.f,{size:12})," ",e.enabled?"Pause":"Resume"]}),(0,t.jsx)("button",{type:"button",className:"rounded p-1 text-mute hover:text-bad",onClick:l,"aria-label":`Remove the schedule of ${c}`,children:(0,t.jsx)(Y.f,{size:14})})]})]}),o||r&&!r.passed?(0,t.jsxs)("div",{className:"space-y-2 px-4 pb-3 pl-11 text-xs text-mute",children:[r&&!r.passed?(0,t.jsxs)("div",{className:"rounded-md border border-bad/30 bg-bad/5 px-3 py-2",children:[(0,t.jsx)("p",{className:"text-ink",children:r.headline}),r.failed.length?(0,t.jsx)("ul",{className:"mt-1 list-disc space-y-0.5 pl-4",children:r.failed.map(e=>(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"text-ink",children:e.name}),e.message?` — ${e.message}`:""]},e.name))}):null]}):null,o?(0,t.jsxs)("label",{className:"flex flex-wrap items-center gap-2",children:["Notify me",(0,t.jsx)("select",{value:e.notify,onChange:t=>void i(`notify:${e.id}`,()=>G.c.update(e.id,{notify:t.target.value})),className:"rounded-md border border-line bg-panel-2 px-2 py-1 text-xs text-ink",children:X.map(([e,s])=>(0,t.jsx)("option",{value:e,children:s},e))}),"How often",(0,t.jsx)("select",{value:e.everyMinutes,onChange:t=>void i(`every:${e.id}`,()=>G.c.update(e.id,{everyMinutes:Number(t.target.value)})),className:"rounded-md border border-line bg-panel-2 px-2 py-1 text-xs text-ink",children:[...new Set([...U.l,e.everyMinutes])].sort((e,t)=>e-t).map(e=>(0,t.jsx)("option",{value:e,children:(0,U.s)(e).replace(/^every /,"Every ")},e))})]}):null]}):null]})}let ee={GET:"text-ok",POST:"text-warn",PUT:"text-accent",PATCH:"text-accent",DELETE:"text-bad"},et="apitestcenter-suite-stop-on-fail";function es({state:e}){return"passed"===e?(0,t.jsx)(x.f,{size:16,className:"text-ok","aria-label":"Passed"}):"failed"===e?(0,t.jsx)(N.f,{size:16,className:"text-bad","aria-label":"Failed"}):"error"===e?(0,t.jsx)(c.f,{size:16,className:"text-bad","aria-label":"Could not run"}):"skipped"===e?(0,t.jsx)(j,{size:16,className:"text-mute","aria-label":"Skipped"}):"running"===e?(0,t.jsx)(k.f,{size:16,className:"animate-spin text-accent","aria-label":"Running"}):(0,t.jsx)(b.f,{size:16,className:"text-line","aria-label":"Not run yet"})}let ea=e=>`${(e.collection||"requests").replace(/[^\w.-]+/g,"-")}-${e.startedAt.slice(0,16).replace(/[:T]/g,"-")}`;e.s(["SuitePage",0,function(){let e=(0,S.useRouter)(),c=(0,S.useSearchParams)(),u=(0,q.d)(),{index:b,environments:j,activeEnv:R,setActiveEnv:P}=(0,E.U)(),U=(0,C.useMemo)(()=>b?.requests??[],[b]),L=(0,C.useMemo)(()=>[...new Set(U.flatMap(e=>e.collection?(0,s.W)(e.collection):[""]))].sort((e,t)=>""===e?1:""===t?-1:e.localeCompare(t)),[U]),F=(0,C.useCallback)(e=>U.filter(t=>e?(0,s.T)(t.collection,e):""===t.collection),[U]),D=c.get("c"),H=null!==D&&L.includes(D)?D:L[0]??null,J=(0,C.useMemo)(()=>null===H?[]:F(H),[F,H]),[Y,V]=(0,C.useState)(null),[W,B]=(0,C.useState)(null),[G,K]=(0,C.useState)(!1),[_,X]=(0,C.useState)(new Set),[Z,en]=(0,C.useState)(!1),[ei,el]=(0,C.useState)(!1),er=(0,C.useRef)(null);(0,C.useEffect)(()=>{try{K("1"===localStorage.getItem(et))}catch{}},[]),(0,C.useEffect)(()=>{if(null===H)return;V(null),B(null),X(new Set);let e=!0;return T.Y.plan(H).then(t=>e&&V(t)).catch(()=>e&&V({order:[],skip:[]})),()=>{e=!1}},[H]),(0,C.useEffect)(()=>()=>void(er.current&&window.clearInterval(er.current)),[]);let eo=(0,C.useMemo)(()=>(function(e,t){let s=new Map(e.map(e=>[e.id,e])),a=new Set,n=[];for(let e of t?.order??[]){let t=s.get(e);t&&!a.has(e)&&(n.push(t),a.add(e))}for(let t of e)a.has(t.id)||n.push(t);let i=new Set(t?.skip??[]);return n.map(e=>({item:e,skipped:i.has(e.id)}))})(J,Y),[J,Y]),ed=W?.status==="running";(0,C.useMemo)(()=>new Map((W?.steps??[]).map(e=>[e.id,e])),[W]);let ec=W?W.steps.flatMap(e=>{let t=J.find(t=>t.id===e.id);return t?[{item:t,skipped:"skipped"===e.state&&!!e.message?.startsWith("Left out"),step:e}]:[]}):eo,eu=(0,C.useCallback)(e=>{null!==H&&(V(e),T.Y.savePlan(H,e).catch(e=>u(e instanceof Error?e.message:"Could not save the order","error")))},[H,u]);function ep(e,t){let s=eo.map(e=>e.item.id),a=s.indexOf(e),n=a+t;a<0||n<0||n>=s.length||([s[a],s[n]]=[s[n],s[a]],B(null),eu({order:s,skip:Y?.skip??[]}))}async function em(){if(null!==H&&!Z){en(!0),X(new Set);try{let e=await T.Y.start({collection:H,environmentId:R?.id??null,stopOnFail:G});B(e),er.current&&window.clearInterval(er.current),er.current=window.setInterval(async()=>{try{let t=await T.Y.get(e.id);B(t),"running"!==t.status&&(window.clearInterval(er.current),er.current=null,X(new Set(t.steps.filter(e=>"failed"===e.state||"error"===e.state).map(e=>e.id))))}catch{}},400)}catch(e){u(e instanceof Error?e.message:"Could not start the run","error")}finally{en(!1)}}}async function ex(){if(null!==H){el(!0);try{let{blob:e,name:t,secrets:s}=await A(H,R?.name??null);(0,I.h)(t,e),u(s.length?`Saved ${t}. ${s.length} request${1===s.length?" has":"s have"} a secret typed in — switch to a {{variable}} for CI (see README in the zip).`:`Saved ${t} — unzip it into your repository. No secrets are in it.`,s.length?"info":"success")}catch(e){u(e instanceof Error?e.message:"Could not export","error")}finally{el(!1)}}}async function eh(){W&&await T.Y.stop(W.id).catch(()=>void 0)}let ef=W?a(W.steps):null,eb=W&&"running"!==W.status,eg=eo.filter(e=>!e.skipped).length;return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)("header",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-line bg-panel px-4 py-3 lg:px-6",children:(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h1",{className:"text-lg font-medium text-ink",children:"Run a collection"}),(0,t.jsx)("p",{className:"text-xs text-mute",children:"Sends every request once, in order, and checks each one. Passes when all its checks pass, or on any 2xx/3xx when it has none."})]})}),0===L.length?(0,t.jsx)("div",{className:"m-6 max-w-xl space-y-2 text-sm text-mute",children:(0,t.jsx)("p",{children:"No saved requests yet. Save requests into a collection on the Test API page (Ctrl+S), or import a Postman collection, then come back here to run them all."})}):(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4 lg:px-6",children:(0,t.jsxs)("div",{className:"mx-auto max-w-5xl space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-mute",children:["Collection",(0,t.jsx)(z.f,{label:"Collection",value:H??"",disabled:ed,onChange:t=>e.replace((0,T.W)(t)),minWidth:240,buttonContent:null===H?"":`${H||"No collection"} (${J.length})`,options:L.map(e=>({value:e,label:(0,t.jsx)("span",{style:{paddingLeft:`${.9*Math.max(0,(0,s.W)(e).length-1)}rem`},children:e?(0,s.g)(e):"No collection"}),hint:`${F(e).length} request${1===F(e).length?"":"s"}${e.includes("/")?` \xb7 ${e}`:""}`,text:e||"no collection"})),className:"min-w-48 rounded-md border border-line bg-panel-2 px-2 py-1.5 text-sm text-ink"})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-mute",children:["Environment",(0,t.jsxs)("select",{value:R?.id??"",disabled:ed,onChange:e=>P(e.target.value||null),className:"min-w-40 rounded-md border border-line bg-panel-2 px-2 py-1.5 text-sm text-ink",children:[(0,t.jsx)("option",{value:"",children:"None"}),j.map(e=>(0,t.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,t.jsxs)("label",{className:"flex items-center gap-2 pb-1.5 text-sm text-ink",children:[(0,t.jsx)("input",{type:"checkbox",checked:G,disabled:ed,onChange:e=>{K(e.target.checked);try{localStorage.setItem(et,e.target.checked?"1":"0")}catch{}}}),"Stop at the first failure"]}),(0,t.jsxs)("span",{className:"ml-auto flex items-center gap-2",children:[(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary",disabled:ei||null===H,onClick:()=>void ex(),title:"A zip for your repository: this collection's requests, environments and run order (never secrets), plus a ready GitHub Actions pipeline",children:[ei?(0,t.jsx)(k.f,{size:14,className:"animate-spin"}):(0,t.jsx)(v,{size:14}),"Download for CI"]}),ed?(0,t.jsxs)("button",{type:"button",className:"btn btn-danger",onClick:()=>void eh(),children:[(0,t.jsx)($.f,{size:14})," Stop"]}):(0,t.jsxs)("button",{type:"button",className:"btn btn-primary",disabled:!Y||0===eg||Z,onClick:()=>void em(),children:[Z?(0,t.jsx)(k.f,{size:14,className:"animate-spin"}):(0,t.jsx)(w.f,{size:14}),"Run ",eg," request",1===eg?"":"s"]})]})]}),W?(0,t.jsxs)("div",{role:"status",className:`flex flex-wrap items-center gap-x-4 gap-y-2 rounded-lg border px-4 py-3 ${ed?"border-line bg-panel":n(W)?"border-ok/40 bg-ok/10":"border-bad/40 bg-bad/10"}`,children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium text-ink",children:[ed?(0,t.jsx)(k.f,{size:16,className:"animate-spin text-accent"}):n(W)?(0,t.jsx)(x.f,{size:16,className:"text-ok"}):(0,t.jsx)(N.f,{size:16,className:"text-bad"}),ed?"Running…":n(W)?"All requests passed":"Not all requests passed"]}),(0,t.jsx)("span",{className:"text-sm text-mute",children:i(W)}),ef&&eb?(0,t.jsxs)("span",{className:"text-sm text-mute",children:["· ",(ef.durationMs/1e3).toFixed(1)," s of response time"]}):null,eb?(0,t.jsxs)("span",{className:"ml-auto flex flex-wrap items-center gap-1",children:[(0,t.jsx)("span",{className:"mr-1 text-xs text-mute",children:"Save as"}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",onClick:()=>(0,I.N)(`${ea(W)}.html`,function(e,t={}){let s=a(e.steps),l=n(e),r=e.collection||"Saved requests",c=e=>"passed"===e?"ok":"failed"===e||"error"===e?"bad":"mute",u=e.steps.map((e,t)=>{let s=e.checks?.length?`<ul class="checks">${e.checks.map(e=>`<li class="${e.ok?"ok":"bad"}">${e.ok?"✓":"✕"} ${o(e.name)}</li>`).join("")}</ul>`:"",a=e.bodyPreview?`<details><summary>Response body</summary><pre>${o(e.bodyPreview)}</pre></details>`:"",n=e.runFirst?`<div class="sub">Run first: ${o(e.runFirst.label)}${e.runFirst.reused?" (reused)":""}</div>`:"",i=e.saved?.length?`<div class="sub">${e.saved.map(e=>e.found?`Saved {{${o(e.name)}}} = ${o(e.preview??"")}`:`✕ {{${o(e.name)}}} not found`).join(" · ")}</div>`:"";return`<tr>
|
|
58
|
+
<td class="n">${t+1}</td>
|
|
59
|
+
<td><span class="state ${c(e.state)}">${d[e.state]}</span></td>
|
|
60
|
+
<td><div><b class="m">${o(e.method)}</b> ${o(e.name)}</div><div class="sub mono">${o(e.url)}</div>${n}${i}${e.message?`<div class="msg ${c(e.state)}">${o(e.message)}</div>`:""}${s}${a}</td>
|
|
61
|
+
<td class="num">${e.status??"–"}</td>
|
|
62
|
+
<td class="num">${null!=e.durationMs?`${Math.round(e.durationMs)} ms`:"–"}</td>
|
|
63
|
+
</tr>`}).join("\n");return`<!doctype html>
|
|
64
|
+
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
65
|
+
<title>${o(r)} — collection run</title>
|
|
66
|
+
<style>
|
|
67
|
+
:root { --ink:#12151c; --mute:#5c6778; --line:#d5dce6; --panel:#fff; --canvas:#f4f6f9; --ok:#137333; --bad:#c62828; --okbg:#e6f4ea; --badbg:#fce8e6; }
|
|
68
|
+
* { box-sizing:border-box; }
|
|
69
|
+
body { margin:0; background:var(--canvas); color:var(--ink); font:14px/1.5 "Segoe UI",system-ui,-apple-system,sans-serif; }
|
|
70
|
+
main { max-width:1000px; margin:0 auto; padding:28px 16px 48px; }
|
|
71
|
+
h1 { font-size:22px; margin:0 0 4px; }
|
|
72
|
+
.meta { color:var(--mute); font-size:13px; margin-bottom:18px; }
|
|
73
|
+
.banner { border-radius:10px; padding:14px 16px; font-weight:600; margin-bottom:16px; }
|
|
74
|
+
.banner.ok { background:var(--okbg); color:var(--ok); } .banner.bad { background:var(--badbg); color:var(--bad); }
|
|
75
|
+
.tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; margin-bottom:18px; }
|
|
76
|
+
.tile { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:10px 14px; }
|
|
77
|
+
.tile b { display:block; font-size:24px; }
|
|
78
|
+
.tile span { color:var(--mute); font-size:12.5px; }
|
|
79
|
+
table { width:100%; border-collapse:collapse; background:var(--panel); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
|
|
80
|
+
th, td { text-align:left; vertical-align:top; padding:9px 10px; border-bottom:1px solid var(--line); }
|
|
81
|
+
th { font-size:12px; color:var(--mute); font-weight:600; background:#eef1f6; }
|
|
82
|
+
.n, .num { white-space:nowrap; font-variant-numeric:tabular-nums; } .num { text-align:right; }
|
|
83
|
+
.state { display:inline-block; font-size:12px; font-weight:600; padding:1px 8px; border-radius:999px; white-space:nowrap; }
|
|
84
|
+
.state.ok { background:var(--okbg); color:var(--ok); } .state.bad { background:var(--badbg); color:var(--bad); } .state.mute { background:#eef1f6; color:var(--mute); }
|
|
85
|
+
.m { font-family:ui-monospace,Consolas,monospace; font-size:12px; }
|
|
86
|
+
.sub { color:var(--mute); font-size:12.5px; } .mono { font-family:ui-monospace,Consolas,monospace; word-break:break-all; }
|
|
87
|
+
.msg { font-size:13px; margin-top:4px; } .msg.bad { color:var(--bad); } .msg.mute { color:var(--mute); }
|
|
88
|
+
.checks { list-style:none; padding:0; margin:6px 0 0; font-size:12.5px; } .checks .ok { color:var(--ok); } .checks .bad { color:var(--bad); }
|
|
89
|
+
details { margin-top:6px; font-size:12.5px; } summary { cursor:pointer; color:var(--mute); }
|
|
90
|
+
pre { white-space:pre-wrap; word-break:break-all; background:#eef1f6; padding:8px; border-radius:6px; max-height:300px; overflow:auto; }
|
|
91
|
+
footer { color:var(--mute); font-size:12px; margin-top:16px; }
|
|
92
|
+
</style></head><body><main>
|
|
93
|
+
<h1>${o(r)}</h1>
|
|
94
|
+
<div class="meta">Collection run \xb7 ${o(new Date(e.startedAt).toLocaleString("en-GB"))}${e.environment?` \xb7 environment ${o(e.environment)}`:""}</div>
|
|
95
|
+
<div class="banner ${l?"ok":"bad"}">${l?"✓ All requests passed":"✕ Not all requests passed"} — ${o(i(e))}</div>
|
|
96
|
+
<div class="tiles">
|
|
97
|
+
<div class="tile"><b>${s.passed}</b><span>passed</span></div>
|
|
98
|
+
<div class="tile"><b>${s.failed}</b><span>failed</span></div>
|
|
99
|
+
<div class="tile"><b>${s.errors}</b><span>could not run</span></div>
|
|
100
|
+
<div class="tile"><b>${s.skipped}</b><span>skipped</span></div>
|
|
101
|
+
<div class="tile"><b>${(s.durationMs/1e3).toFixed(1)} s</b><span>total response time</span></div>
|
|
102
|
+
</div>
|
|
103
|
+
<table>
|
|
104
|
+
<thead><tr><th>#</th><th>Result</th><th>Request</th><th class="num">Status</th><th class="num">Time</th></tr></thead>
|
|
105
|
+
<tbody>
|
|
106
|
+
${u}
|
|
107
|
+
</tbody></table>
|
|
108
|
+
<footer>Made with APITestCenter \xb7 ${o(t.generatedAt??new Date().toISOString())}. A request passes when all its checks pass; without checks, on any 2xx or 3xx status.</footer>
|
|
109
|
+
</main></body></html>
|
|
110
|
+
`}(W),"text/html"),children:[(0,t.jsx)(g.f,{size:12})," HTML"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",onClick:()=>{let e,t,s,n;return(0,I.N)(`${ea(W)}.xml`,(e=a(W.steps),t=W.collection||"Saved requests",s=W.steps.map(e=>{let s=`${e.method} ${e.name}`,a=` <testcase classname="${l(t)}" name="${l(s)}" time="${r(e.durationMs)}">`;if("passed"===e.state)return`${a}</testcase>`;if("skipped"===e.state||"pending"===e.state||"running"===e.state)return`${a}
|
|
111
|
+
<skipped message="${l(e.message??"Not run")}"/>
|
|
112
|
+
</testcase>`;let n="error"===e.state?"error":"failure",i=[e.status?`Status ${e.status}`:"",...(e.checks??[]).map(e=>`${e.ok?"✓":"✕"} ${e.name}`),e.bodyPreview?`
|
|
113
|
+
Response:
|
|
114
|
+
${e.bodyPreview}`:""].filter(Boolean).join("\n");return`${a}
|
|
115
|
+
<${n} message="${l(e.message??e.state)}">${l(i)}</${n}>
|
|
116
|
+
</testcase>`}),n=r(e.durationMs),`<?xml version="1.0" encoding="UTF-8"?>
|
|
117
|
+
<testsuites name="APITestCenter" tests="${e.total}" failures="${e.failed}" errors="${e.errors}" skipped="${e.skipped}" time="${n}">
|
|
118
|
+
<testsuite name="${l(t)}" tests="${e.total}" failures="${e.failed}" errors="${e.errors}" skipped="${e.skipped}" time="${n}" timestamp="${l(W.startedAt)}">
|
|
119
|
+
${s.join("\n")}
|
|
120
|
+
</testsuite>
|
|
121
|
+
</testsuites>
|
|
122
|
+
`),"application/xml")},title:"JUnit XML for CI dashboards",children:[(0,t.jsx)(g.f,{size:12})," JUnit"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",onClick:()=>(0,I.N)(`${ea(W)}.json`,`${JSON.stringify({kind:"apitestcenter-suite",version:1,...W,totals:a(W.steps),passed:n(W)},null,2)}
|
|
123
|
+
`,"application/json"),children:[(0,t.jsx)(g.f,{size:12})," JSON"]})]}):null]}):null,(0,t.jsxs)("section",{"aria-label":"Requests in run order",className:"overflow-hidden rounded-lg border border-line bg-panel",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-line px-4 py-2 text-xs text-mute",children:[(0,t.jsx)(y.f,{size:14,"aria-hidden":!0}),(0,t.jsx)("span",{children:W?"Results":"Run order — untick to leave a request out; use the arrows to reorder. Saved for next time and for the CLI."})]}),Y?(0,t.jsx)("ol",{children:ec.map(({item:s,skipped:a,step:n},i)=>{let l=_.has(s.id),r=n&&(n.message||n.checks?.length||n.bodyPreview||n.runFirst||n.saved?.length);return(0,t.jsxs)("li",{className:"border-b border-line last:border-b-0",children:[(0,t.jsxs)("div",{className:`flex items-center gap-3 px-4 py-2 ${a&&!W?"opacity-50":""}`,children:[W?(0,t.jsx)(es,{state:n?.state??"pending"}):(0,t.jsx)("input",{type:"checkbox",checked:!a,onChange:()=>{var e;let t;return e=s.id,void((t=new Set(Y?.skip??[])).has(e)?t.delete(e):t.add(e),B(null),eu({order:eo.map(e=>e.item.id),skip:[...t]}))},"aria-label":`Include ${s.name}`}),(0,t.jsx)("span",{className:"w-6 shrink-0 text-right font-mono text-xs text-mute",children:i+1}),(0,t.jsxs)("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left",onClick:()=>r?X(e=>{let t=new Set(e);return t.has(s.id)?t.delete(s.id):t.add(s.id),t}):void 0,"aria-expanded":r?l:void 0,children:[(0,t.jsx)("span",{className:`w-14 shrink-0 font-mono text-xs font-medium ${ee[s.method]??"text-mute"}`,children:s.method}),(0,t.jsxs)("span",{className:"min-w-0",children:[(0,t.jsx)("span",{className:"block truncate text-sm text-ink",children:s.name}),(0,t.jsx)("span",{className:"block truncate font-mono text-[11px] text-mute",children:s.url})]}),r?l?(0,t.jsx)(h.f,{size:14,className:"shrink-0 text-mute"}):(0,t.jsx)(f.f,{size:14,className:"shrink-0 text-mute"}):null]}),n?.status?(0,t.jsx)("span",{className:`font-mono text-xs ${n.status<400?"text-ok":"text-bad"}`,children:n.status}):null,n?.durationMs!=null?(0,t.jsxs)("span",{className:"w-16 text-right font-mono text-xs text-mute",children:[Math.round(n.durationMs)," ms"]}):null,W?null:(0,t.jsxs)("span",{className:"flex items-center",children:[(0,t.jsx)("button",{type:"button",className:"rounded p-1 text-mute hover:text-ink disabled:opacity-30",disabled:0===i,onClick:()=>ep(s.id,-1),"aria-label":`Move ${s.name} up`,children:(0,t.jsx)(m,{size:14})}),(0,t.jsx)("button",{type:"button",className:"rounded p-1 text-mute hover:text-ink disabled:opacity-30",disabled:i===ec.length-1,onClick:()=>ep(s.id,1),"aria-label":`Move ${s.name} down`,children:(0,t.jsx)(p,{size:14})})]})]}),l&&n?(0,t.jsxs)("div",{className:"space-y-2 bg-panel-2 px-4 py-3 pl-[4.75rem] text-sm",children:[n.message?(0,t.jsx)("p",{className:"skipped"===n.state?"text-mute":"text-bad",children:n.message}):null,n.runFirst?(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Run first: ",n.runFirst.label,n.runFirst.reused?" (reused from an earlier request)":""]}):null,n.saved?.length?(0,t.jsx)("p",{className:"text-xs",children:n.saved.map(e=>(0,t.jsx)("span",{className:`mr-3 ${e.found?"text-ok":"text-bad"}`,children:e.found?`Saved {{${e.name}}} = ${e.preview??""}`:`✕ {{${e.name}}} not found`},e.name))}):null,n.checks?.length?(0,t.jsx)("ul",{className:"space-y-0.5 text-xs",children:n.checks.map((e,s)=>(0,t.jsxs)("li",{className:e.ok?"text-ok":"text-bad",children:[e.ok?"✓":"✕"," ",e.name,!e.ok&&e.detail?(0,t.jsxs)("span",{className:"text-mute",children:[" — ",e.detail]}):null]},s))}):null,n.bodyPreview?(0,t.jsx)("pre",{className:"max-h-48 overflow-auto rounded-md border border-line bg-canvas p-2 font-mono text-[11px] whitespace-pre-wrap text-ink",children:n.bodyPreview}):null,(0,t.jsx)("button",{type:"button",className:"text-xs text-accent hover:underline",onClick:()=>(function(t){try{sessionStorage.setItem(M.M,t)}catch{}(0,O.m)(),e.push("/")})(s.id),children:"Open this request"})]}):null]},s.id)})}):(0,t.jsx)("p",{className:"px-4 py-6 text-sm text-mute",children:"Loading…"}),eb?(0,t.jsx)("div",{className:"border-t border-line px-4 py-2 text-right",children:(0,t.jsx)("button",{type:"button",className:"text-xs text-accent hover:underline",onClick:()=>B(null),children:"Edit the run order"})}):null]}),(0,t.jsx)(Q,{collection:H,environment:R?.id??null})]})})]})}],93639)},17219,e=>{let t=new Uint32Array(256).map((e,t)=>{let s=t;for(let e=0;e<8;e++)s=1&s?0xedb88320^s>>>1:s>>>1;return s>>>0});function s(e){let t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e,!0),t}function a(e){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),t}function n(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),s=0;for(let a of e)t.set(a,s),s+=a.length;return t}e.s(["f",0,function(e){let i=new TextEncoder,l=[],r=[],o=0;for(let[d,c]of Object.entries(e)){let e=i.encode(d),u="string"==typeof c?i.encode(c):c,p=function(e){let s=0xffffffff;for(let a of e)s=t[(s^a)&255]^s>>>8;return(0xffffffff^s)>>>0}(u),m=n([a(0x4034b50),s(20),s(0),s(0),s(0),s(0),a(p),a(u.length),a(u.length),s(e.length),s(0),e,u]),x=n([a(0x2014b50),s(20),s(20),s(0),s(0),s(0),s(0),a(p),a(u.length),a(u.length),s(e.length),s(0),s(0),s(0),s(0),a(0),a(o),e]);l.push(m),r.push(x),o+=m.length}let d=n(r),c=n([a(0x6054b50),s(0),s(0),s(Object.keys(e).length),s(Object.keys(e).length),a(d.length),a(o),s(0)]),u=n([...l,d,c]);return new Blob([u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength)],{type:"application/zip"})}])},13643,e=>{let t=(0,e.i(99522).f)("bell-off",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]);e.s(["f",0,t],13643)},3792,e=>{let t=(0,e.i(99522).f)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["f",0,t],3792)},66478,14168,e=>{let t=(0,e.i(99522).f)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);async function s(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Engine error (${e.status})`);return t}e.s(["f",0,t],66478);let a=(e,t,s)=>fetch(t,{method:e,headers:void 0===s?void 0:{"content-type":"application/json"},body:void 0===s?void 0:JSON.stringify(s)});e.s(["Y",0,{plan:e=>fetch(`/engine/suites/plan?collection=${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>s(e)),savePlan:(e,t)=>a("PUT","/engine/suites/plan",{collection:e,...t}).then(e=>s(e)),start:e=>a("POST","/engine/suites/runs",e).then(e=>s(e)),get:e=>fetch(`/engine/suites/runs/${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>s(e)),stop:e=>a("POST",`/engine/suites/runs/${encodeURIComponent(e)}/stop`).then(e=>s(e))},"W",0,function(e){return`/suite?c=${encodeURIComponent(e)}`}],14168)}])})();
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33622,e=>{var t=e.i(72587);e.i(24856);var s=e.i(48191);function r(e){return!!e&&"object"==typeof e&&"string"==typeof e.id&&"string"==typeof e.testName&&Array.isArray(e.buckets)&&"object"==typeof e.summary&&null!==e.summary}var n=e.i(45404),a=e.i(29724),o=e.i(88153),i=e.i(56396),l=e.i(59180),c=e.i(67938),d=e.i(75998),p=e.i(55218);e.s(["default",0,function(){let[e,m]=(0,p.useState)(null),[h,u]=(0,p.useState)(null),[f,x]=(0,p.useState)(null),[y,v]=(0,p.useState)(null),[b,k]=(0,p.useState)(!1),[g,w]=(0,p.useState)(!1),[_,F]=(0,p.useState)(null),[T,j]=(0,p.useState)(!1),N=(0,i.d)(),{refresh:S}=(0,l.K)();async function C(){j(!0);try{await l.c.import(_),await S(),w(!0),N("Saved to History","success")}catch(e){N(e instanceof Error?e.message:"Could not save to History","error")}finally{j(!1)}}let I=(0,p.useCallback)(async e=>{x(null),w(!1),m(null),u(null);let t=e.name.toLowerCase();if(t.endsWith(".html")||t.endsWith(".xlsx")||t.endsWith(".csv")||t.endsWith(".zip")){v(e.name),x("Preview needs the JSON export from the lab. HTML and Excel are for sharing, not for opening back here.");return}try{let t=await e.text(),n=JSON.parse(t),a=function(e){if(!e||"object"!=typeof e)throw Error("That file is not JSON we can open.");if("compare"===e.kind||Array.isArray(e.apis)&&e.apis.length>0){if(!(e&&"object"==typeof e&&"compare"===e.kind&&Array.isArray(e.apis)&&e.apis.length>=1&&e.apis.every(e=>e&&"object"==typeof e&&r(e.report))))throw Error("Not a valid APITestCenter compare export.");return{kind:"compare",doc:{...e,apis:e.apis.map(e=>({...e,report:(0,s.Q)(e.report)}))}}}if(r(e.report))return{kind:"report",report:(0,s.Q)(e.report)};if(r(e))return{kind:"report",report:(0,s.Q)(e)};throw Error("Not an APITestCenter report. Export JSON from the lab (not HTML or Excel).")}(n);F(n),v(e.name),"compare"===a.kind?u(a.doc):m(a.report)}catch(t){v(e.name),x(t instanceof Error?t.message:"Could not read that file.")}},[]);function M(e){e.preventDefault(),k(!0)}function A(e){e.preventDefault(),k(!1);let t=e.dataTransfer.files[0];t&&I(t)}let $=b?"border-accent bg-accent-dim":"border-line bg-panel",E=h?.apis.map(e=>e.title)??[],{slo:L}=(0,o.G)();return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col p-6 lg:p-8",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-xl font-medium text-ink",children:"Open a report"}),(0,t.jsx)("p",{className:"mt-1 max-w-xl text-sm text-mute",children:"Reopen a JSON report you exported earlier — a single run or a compare. Excel and HTML exports are for sharing and can't be reopened."})]}),e||h?(0,t.jsxs)("label",{onDragOver:M,onDragLeave:()=>k(!1),onDrop:A,className:`inline-flex cursor-pointer items-center gap-2 rounded-md border border-dashed px-3 py-2 text-xs ${$}`,children:[(0,t.jsx)(c.f,{size:14,className:"text-accent"}),"Replace JSON",(0,t.jsx)("input",{type:"file",accept:"application/json,.json",className:"sr-only",onChange:e=>{let t=e.target.files?.[0];t&&I(t),e.target.value=""}})]}):null]}),f?(0,t.jsx)("p",{className:"mt-4 text-sm text-bad",children:f}):null,h?(0,t.jsxs)("div",{className:"mt-6 space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("p",{className:"text-xs text-mute",children:[y," · compare · ",h.mode]}),(0,t.jsx)("button",{type:"button",disabled:g||T,onClick:()=>void C(),className:"rounded-md border border-line px-3 py-1.5 text-xs text-ink hover:border-accent disabled:opacity-40",children:g?"Saved to History":"Keep in History"})]}),(0,t.jsx)(n.f,{scope:"compare",data:{reports:h.apis.map(e=>e.report),titles:E,slo:L,live:!1}}),(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Open"," ",(0,t.jsx)(d.default,{href:"/compare",className:"text-accent hover:underline",children:"Compare"})," ","to re-run these APIs live."]})]}):e?(0,t.jsxs)("div",{className:"mt-6 space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-xs text-mute",children:y}),(0,t.jsx)("button",{type:"button",disabled:g||T,onClick:()=>void C(),className:"rounded-md border border-line px-3 py-1.5 text-xs text-ink hover:border-accent disabled:opacity-40",children:g?"Saved to History":"Keep in History"})]}),g?(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Open it anytime on"," ",(0,t.jsx)(d.default,{href:"/history",className:"text-accent hover:underline",children:"History"}),"."]}):null,(0,t.jsx)("div",{className:"rounded-lg border border-line bg-panel p-4",children:(0,t.jsx)(a.f,{report:e,source:"file"})})]}):(0,t.jsxs)("label",{onDragOver:M,onDragLeave:()=>k(!1),onDrop:A,className:`mt-6 flex min-h-0 flex-1 cursor-pointer flex-col items-center justify-center rounded-lg border border-dashed px-8 py-16 text-center ${$}`,children:[(0,t.jsx)(c.f,{size:28,className:"text-accent"}),(0,t.jsx)("span",{className:"mt-4 text-base text-ink",children:"Drop a JSON report here, or click to choose"}),(0,t.jsx)("span",{className:"mt-2 max-w-md text-sm text-mute",children:"Single-run or compare JSON from Export. HTML, Excel, and zip are for sharing — they will not open here."}),(0,t.jsx)("span",{className:"mt-4 font-mono text-xs text-mute",children:"apitestcenter-*.json"}),(0,t.jsx)("input",{type:"file",accept:"application/json,.json",className:"sr-only",onChange:e=>{let t=e.target.files?.[0];t&&I(t),e.target.value=""}})]})]})}],33622)},37837,e=>{var t=e.i(72587),s=e.i(55218),r=e.i(90484),n=e.i(14865);e.s(["f",0,function({anchor:e,open:a,onClose:o,children:i,label:l,width:c=280,role:d="dialog"}){let p=(0,s.useRef)(null),[m,h]=(0,s.useState)(null);return((0,s.useLayoutEffect)(()=>{if(!a)return;let t=()=>{if(!e.current)return;let t=(0,n.C)(e.current),s=(0,n.v)(),r=p.current?.offsetHeight??320,a=s.height-t.bottom-8,o=t.top-8,i=a<Math.min(r,240)&&o>a,l=Math.min(Math.max(8,t.right-c),s.width-c-8);h({top:i?Math.max(8,t.top-Math.min(r,o)-4):t.bottom+4,left:l,maxHeight:Math.max(160,(i?o:a)-4)})};t();let s=window.requestAnimationFrame(t);return window.addEventListener("resize",t),()=>{window.cancelAnimationFrame(s),window.removeEventListener("resize",t)}},[a,e,c]),(0,s.useEffect)(()=>{if(!a)return;let t=t=>{let s=t.target;p.current?.contains(s)||e.current?.contains(s)||o()},s=t=>{"Escape"===t.key&&(t.stopPropagation(),o(),e.current?.focus())},r=e=>{p.current?.contains(e.target)||o()},n=t=>{e.current?.contains(t.target)&&(t.stopPropagation(),t.preventDefault(),o())};return document.addEventListener("pointerdown",t,!0),document.addEventListener("click",n,!0),document.addEventListener("keydown",s,!0),document.addEventListener("scroll",r,!0),()=>{document.removeEventListener("pointerdown",t,!0),document.removeEventListener("click",n,!0),document.removeEventListener("keydown",s,!0),document.removeEventListener("scroll",r,!0)}},[a,o,e]),(0,s.useEffect)(()=>{a&&window.setTimeout(()=>p.current?.querySelector("[role=menuitem], input, select, button")?.focus(),0)},[a]),!a||"u"<typeof document)?null:(0,r.createPortal)((0,t.jsx)("div",{ref:p,role:d,"aria-label":l,style:{top:m?.top??-9999,left:m?.left??-9999,width:c,maxHeight:m?.maxHeight},className:"anim-pop fixed z-[70] overflow-auto rounded-lg border border-line bg-panel p-3 shadow-2xl",children:i}),document.body)}])},30617,e=>{e.i(24856);var t=e.i(46306),s=e.i(36558),r=e.i(2385),n=e.i(17219);let a={base:0,header:1,desc:2,pass:3,warn:4,fail:5};function o(e){return String(e).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("\n"," ")}function i(e,t,s){if("level"===e)return"pass"===t?a.pass:"warn"===t?a.warn:"fail"===t?a.fail:a.base;let r="number"==typeof t?t:Number(t);return"errors"===e?r>=s.errorFail?a.fail:r>=s.errorWarn?a.warn:a.pass:r>=s.p95FailMs?a.fail:r>=s.p95WarnMs?a.warn:a.pass}let l=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
|
+
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
|
|
3
|
+
<fonts count="3">
|
|
4
|
+
<font><sz val="11"/><name val="Calibri"/></font>
|
|
5
|
+
<font><b/><sz val="11"/><color rgb="FFFFFFFF"/><name val="Calibri"/></font>
|
|
6
|
+
<font><sz val="10"/><color rgb="FF5C6778"/><name val="Calibri"/></font>
|
|
7
|
+
</fonts>
|
|
8
|
+
<fills count="6">
|
|
9
|
+
<fill><patternFill patternType="none"/></fill>
|
|
10
|
+
<fill><patternFill patternType="gray125"/></fill>
|
|
11
|
+
<fill><patternFill patternType="solid"><fgColor rgb="FF0B8F7C"/></patternFill></fill>
|
|
12
|
+
<fill><patternFill patternType="solid"><fgColor rgb="FFDCFCE7"/></patternFill></fill>
|
|
13
|
+
<fill><patternFill patternType="solid"><fgColor rgb="FFFEF3C7"/></patternFill></fill>
|
|
14
|
+
<fill><patternFill patternType="solid"><fgColor rgb="FFFECACA"/></patternFill></fill>
|
|
15
|
+
</fills>
|
|
16
|
+
<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>
|
|
17
|
+
<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>
|
|
18
|
+
<cellXfs count="6">
|
|
19
|
+
<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>
|
|
20
|
+
<xf numFmtId="0" fontId="1" fillId="2" borderId="0" xfId="0" applyFont="1" applyFill="1" applyAlignment="1"><alignment horizontal="center" vertical="center"/></xf>
|
|
21
|
+
<xf numFmtId="0" fontId="2" fillId="0" borderId="0" xfId="0" applyFont="1" applyAlignment="1"><alignment wrapText="1" vertical="center"/></xf>
|
|
22
|
+
<xf numFmtId="0" fontId="0" fillId="3" borderId="0" xfId="0" applyFill="1"/>
|
|
23
|
+
<xf numFmtId="0" fontId="0" fillId="4" borderId="0" xfId="0" applyFill="1"/>
|
|
24
|
+
<xf numFmtId="0" fontId="0" fillId="5" borderId="0" xfId="0" applyFill="1"/>
|
|
25
|
+
</cellXfs>
|
|
26
|
+
</styleSheet>`;async function c(e,n,o){let l=(0,r.s)(e,{slo:n}),c=(0,r.v)(n),p=(0,t.$)(o,(0,t.L)(e));return d([{name:"Overview",rows:[[{v:"Key",s:a.header},{v:"Value",s:a.header},{v:"What this means",s:a.header}],...(0,s.E)(e).map(e=>{let t=a.base;return"failed_rate"===e.key&&(t=i("errors",e.value,c)),"latency_p95_ms"===e.key&&(t=i("latency",e.value,c)),(e.key.startsWith("status_5")||"status_0"===e.key)&&(t=Number(e.value)>0?a.fail:a.pass),e.key.startsWith("status_4")&&Number(e.value)>0&&(t=a.warn),e.key.startsWith("threshold:")&&(t="pass"===e.value?a.pass:a.fail),[{v:e.key},{v:e.value,s:t},{v:e.description,s:a.desc}]})]},{name:"Result summary",rows:[[{v:"Field",s:a.header},{v:"Level",s:a.header},{v:"What this means",s:a.header}],[{v:"overall"},{v:l.overall,s:i("level",l.overall,c)},{v:l.headline,s:a.desc}],...l.aspects.map(e=>[{v:e.title},{v:e.level,s:i("level",e.level,c)},{v:e.summary,s:a.desc}]),[{v:"disclaimer"},{v:""},{v:l.disclaimer,s:a.desc}],...p.map((e,s)=>[{v:`chart_${s+1}`},{v:`${e.w}x${e.h}`},{v:t.p[e.id],s:a.desc}])]},{name:"Second by second",rows:[s.V.map(e=>({v:e.header,s:a.header})),...e.buckets.map(e=>(0,s.u)(e).map((e,t)=>{let r=s.V[t]?.key,n=a.base;return"p95_ms"===r&&(n=i("latency",e,c)),"failed_rate"===r&&(n=i("errors",e,c)),"http_5xx"===r&&Number(e)>0&&(n=a.fail),"http_0"===r&&Number(e)>0&&(n=a.fail),"http_4xx"===r&&Number(e)>0&&(n=a.warn),"http_2xx"===r&&Number(e)>0&&(n=a.pass),{v:e,s:n}}))]}])}function d(e){let t={"[Content_Types].xml":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
27
|
+
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
|
28
|
+
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
|
|
29
|
+
<Default Extension="xml" ContentType="application/xml"/>
|
|
30
|
+
<Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>
|
|
31
|
+
<Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>
|
|
32
|
+
${e.map((e,t)=>` <Override PartName="/xl/worksheets/sheet${t+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("\n")}
|
|
33
|
+
</Types>`,"_rels/.rels":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
34
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
35
|
+
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>
|
|
36
|
+
</Relationships>`,"xl/workbook.xml":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
37
|
+
<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
|
|
38
|
+
<sheets>
|
|
39
|
+
${e.map((e,t)=>` <sheet name="${o(e.name.replace(/[:\\/?*[\]]/g," ").trim().slice(0,31)||"Sheet")}" sheetId="${t+1}" r:id="rId${t+1}"/>`).join("\n")}
|
|
40
|
+
</sheets>
|
|
41
|
+
</workbook>`,"xl/_rels/workbook.xml.rels":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
42
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
43
|
+
${e.map((e,t)=>` <Relationship Id="rId${t+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${t+1}.xml"/>`).join("\n")}
|
|
44
|
+
<Relationship Id="rId${e.length+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
|
|
45
|
+
</Relationships>`,"xl/styles.xml":l};return e.forEach((e,s)=>{var r;let n,a,i;return t[`xl/worksheets/sheet${s+1}.xml`]=(r=e.rows,a=Array.from({length:n=r[0]?.length??0},(e,t)=>{let s=function(e,t,s=10,r=48){let n=s;for(let s of e){let e=s[t]?.v;void 0!==e&&(n=Math.max(n,String(e).length+2))}return Math.min(r,n)}(r,t,t===n-1&&n>=3?36:12,t===n-1&&n>=3?72:42);return`<col min="${t+1}" max="${t+1}" width="${s}" customWidth="1"/>`}).join(""),i=r.map((e,t)=>`<row r="${t+1}" ht="${0===t?22:18}" customHeight="1">${e.map((e,s)=>{var r;let n,a;return r=t+1,n=`${function(e){let t=e+1,s="";for(;t>0;)s=String.fromCharCode(65+(t-1)%26)+s,t=Math.floor((t-1)/26);return s}(s)}${r}`,a=void 0!==e.s?` s="${e.s}"`:"","number"==typeof e.v&&Number.isFinite(e.v)?`<c r="${n}"${a}><v>${e.v}</v></c>`:`<c r="${n}"${a} t="inlineStr"><is><t xml:space="preserve">${o(e.v)}</t></is></c>`}).join("")}</row>`).join(""),`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
46
|
+
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
|
|
47
|
+
<sheetViews><sheetView workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/></sheetView></sheetViews>
|
|
48
|
+
<cols>${a}</cols>
|
|
49
|
+
<sheetData>${i}</sheetData>
|
|
50
|
+
</worksheet>`)}),new Blob([(0,n.f)(t)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})}e.s(["S",0,a,"a",0,c,"F",0,d])},17219,e=>{let t=new Uint32Array(256).map((e,t)=>{let s=t;for(let e=0;e<8;e++)s=1&s?0xedb88320^s>>>1:s>>>1;return s>>>0});function s(e){let t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e,!0),t}function r(e){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),t}function n(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),s=0;for(let r of e)t.set(r,s),s+=r.length;return t}e.s(["f",0,function(e){let a=new TextEncoder,o=[],i=[],l=0;for(let[c,d]of Object.entries(e)){let e=a.encode(c),p="string"==typeof d?a.encode(d):d,m=function(e){let s=0xffffffff;for(let r of e)s=t[(s^r)&255]^s>>>8;return(0xffffffff^s)>>>0}(p),h=n([r(0x4034b50),s(20),s(0),s(0),s(0),s(0),r(m),r(p.length),r(p.length),s(e.length),s(0),e,p]),u=n([r(0x2014b50),s(20),s(20),s(0),s(0),s(0),s(0),r(m),r(p.length),r(p.length),s(e.length),s(0),s(0),s(0),s(0),r(0),r(l),e]);o.push(h),i.push(u),l+=h.length}let c=n(i),d=n([r(0x6054b50),s(0),s(0),s(Object.keys(e).length),s(Object.keys(e).length),r(c.length),r(l),s(0)]),p=n([...o,c,d]);return new Blob([p.buffer.slice(p.byteOffset,p.byteOffset+p.byteLength)],{type:"application/zip"})}])},13643,e=>{let t=(0,e.i(99522).f)("bell-off",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]);e.s(["f",0,t],13643)},95211,e=>{let t=(0,e.i(99522).f)("columns-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);e.s(["f",0,t],95211)},81538,e=>{let t=(0,e.i(99522).f)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);e.s(["f",0,t],81538)},36558,e=>{function t(e,s=2){if(!Number.isFinite(e))return 0;let r=10**s;return Math.round(e*r)/r}function s(e){return e>=100?Math.round(e):e>=10?t(e,1):t(e,2)}function r(e){return e>=10?Math.round(e):t(e,1)}function n(e,t=e=>e){return null==e?"":t(e)}e.s(["V",0,[{key:"elapsed_s",header:"Seconds into test",description:"Seconds from the start of the run."},{key:"ts",header:"Clock time",description:"Wall-clock time for this one-second sample."},{key:"vus",header:"Concurrent users",description:"Virtual users (VUs) active in this second."},{key:"rps",header:"Requests per second",description:"Completed requests in this second."},{key:"p50_ms",header:"Median latency (ms)",description:"Half of requests this second were faster than this."},{key:"p95_ms",header:"95th percentile (ms)",description:"95% of requests this second were faster than this."},{key:"p99_ms",header:"99th percentile (ms)",description:"The slow tail this second — 1 in 100 was slower."},{key:"failed_rate",header:"Error rate",description:"Share of requests that failed in this second (0–1)."},{key:"http_2xx",header:"Success (2xx)",description:"Successful HTTP responses this second."},{key:"http_4xx",header:"Client errors (4xx)",description:"Client / auth errors this second."},{key:"http_5xx",header:"Server errors (5xx)",description:"Server errors this second."},{key:"http_0",header:"Network failures",description:"No HTTP status (timeout / reset) this second."},{key:"bytes_in",header:"Bytes received",description:"Response bytes this second."},{key:"bytes_out",header:"Bytes sent",description:"Request bytes this second."},{key:"p90_ms",header:"90th percentile (ms)",description:"90% of requests this second were faster than this."},{key:"p999_ms",header:"99.9th percentile (ms)",description:"1 in 1,000 requests this second was slower than this."},{key:"max_ms",header:"Slowest (ms)",description:"Slowest request this second."},{key:"ttfb_ms",header:"Server time (ms)",description:"Average time to first byte this second — the server's own work."},{key:"connect_ms",header:"TCP connect (ms)",description:"Average TCP connect time this second (0 when connections are reused)."},{key:"tls_ms",header:"TLS handshake (ms)",description:"Average TLS handshake time this second."},{key:"checks_passed",header:"Checks passed",description:"Response checks that passed this second."},{key:"checks_failed",header:"Checks failed",description:"Response checks that failed this second."},{key:"dropped",header:"Dropped requests",description:"Rate mode: requests k6 could not start this second."}],"u",0,function(e){return[e.elapsedS,e.ts,t(e.vus,1),s(e.rps),r(e.p50Ms),r(e.p95Ms),r(e.p99Ms),t(e.failedRate,4),e.http2xx,e.http4xx,e.http5xx,e.http0,e.bytesIn,e.bytesOut,n(e.p90Ms,r),n(e.p999Ms,r),n(e.maxMs,r),n(e.ttfbMs,r),n(e.connectMs,r),n(e.tlsMs,r),n(e.checksPassed),n(e.checksFailed),n(e.dropped)]},"E",0,function(e){let{summary:n}=e,a=[{key:"run_id",value:e.id,description:"Id of this run in this browser tab."},{key:"test_name",value:e.testName,description:"Display name (method, path, time)."},{key:"status",value:e.status,description:"completed, failed, cancelled, or still running."},{key:"started_at",value:e.startedAt,description:"When the load test started (UTC)."},{key:"ended_at",value:e.endedAt,description:"When the load test finished (UTC)."},{key:"method",value:e.definition.method,description:"HTTP method that was repeated."},{key:"url",value:e.definition.url,description:"Target URL (secrets are not exported)."},{key:"auth_mode",value:e.definition.auth.mode,description:"Auth used: none, bearer, basic, or api_key. The secret is not exported."},{key:"executor",value:e.definition.load.executor,description:"Load pattern: constant-vus (steady) or ramping-vus (ramp / hold / down)."},{key:"requests",value:n.http.requests,description:"How many HTTP calls finished. Zero usually means the target never answered."},{key:"rps_avg",value:s(n.http.rps.avg),description:"Average requests per second completed by this generator."},{key:"rps_max",value:s(n.http.rps.max),description:"Peak requests per second in any one-second sample."},{key:"failed_count",value:n.http.failed.count,description:"Requests that failed (4xx, 5xx, timeout, or no status)."},{key:"failed_rate",value:t(n.http.failed.rate,4),description:"Failed / total. Default warning bar is 1% (0.01)."},{key:"latency_min_ms",value:r(n.latencyMs.min),description:"Fastest request (milliseconds)."},{key:"latency_mean_ms",value:r(n.latencyMs.mean),description:"Average response time. Slow outliers pull this up."},{key:"latency_p50_ms",value:r(n.latencyMs.median),description:"Median — half of requests were faster than this."},{key:"latency_p95_ms",value:r(n.latencyMs.p95),description:"95th percentile — 95% of requests were faster. Usual headline latency."},{key:"latency_p99_ms",value:r(n.latencyMs.p99),description:"99th percentile — the slow tail (1 in 100 was slower)."},{key:"latency_max_ms",value:r(n.latencyMs.max),description:"Slowest single request."},{key:"vus_max",value:n.vus.max,description:"Peak concurrent users (virtual users / VUs)."},{key:"vus_avg",value:t(n.vus.avg,1),description:"Average concurrent users over the run."},{key:"bytes_in",value:n.data.bytesIn,description:"Response bytes received by the generator."},{key:"bytes_out",value:n.data.bytesOut,description:"Request bytes sent by the generator."},{key:"phase_ttfb_avg_ms",value:r(n.phasesMs.ttfb.avg),description:"Time to first byte — waiting on the server after the connection is up."},{key:"phase_tls_avg_ms",value:r(n.phasesMs.tls.avg),description:"TLS handshake time. High values often mean a far or overloaded endpoint."}];for(let[e,t]of Object.entries(n.http.status)){let s="0"===e?"No HTTP status (timeout / network).":Number(e)>=500?"Server error.":Number(e)>=400?"Client / auth error.":"Success-class response.";a.push({key:`status_${e}`,value:t,description:`How many responses had status ${e}. ${s}`})}for(let e of n.thresholds)a.push({key:`threshold:${e.name}`,value:e.ok?"pass":"fail",description:"k6 threshold result for this run."});return a}])}])})();
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,92016,e=>{var t=e.i(72587);e.i(24856);var n=e.i(2385),s=e.i(42447),r=e.i(67938),a=e.i(84355),l=e.i(20621),i=e.i(99522);let o=(0,i.f)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);var c=e.i(30197),d=e.i(27813),u=e.i(81538),p=e.i(13163),m=e.i(71189),h=e.i(96659);let f=(0,i.f)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);var x=e.i(75998),y=e.i(70989),v=e.i(55218),b=e.i(6980),g=e.i(839),w=e.i(39170),k=e.i(37837),j=e.i(17847),N=e.i(56396),$=e.i(67217),C=e.i(44505),F=e.i(20054),S=e.i(19656),_=e.i(59180),T=e.i(30635),I=e.i(88153);function M({project:e,onOpen:n,onRename:s,onRemove:r,onDelete:a}){let[l,i]=(0,v.useState)(!1),[d,m]=(0,v.useState)(!1),f=(0,v.useRef)(null);return(0,t.jsxs)("div",{className:`group relative flex h-full flex-col gap-3 rounded-xl border p-4 ${e.current?"border-accent/60 bg-accent-dim/40":"border-line bg-panel hover:border-mute"}`,children:[(0,t.jsxs)("button",{type:"button",onClick:n,className:"flex flex-col gap-3 text-left","aria-label":e.current?`Go to ${e.name} (in use)`:`Open ${e.name}`,children:[(0,t.jsxs)("span",{className:"flex items-center gap-3 pr-8",children:[(0,t.jsx)("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg text-sm font-bold text-[#10140a]",style:{background:(0,T.W)(e.id)},"aria-hidden":!0,children:e.name.slice(0,1).toUpperCase()}),(0,t.jsxs)("span",{className:"min-w-0",children:[d?null:(0,t.jsx)("span",{className:"block truncate text-[15px] font-semibold text-ink",children:e.name}),(0,t.jsx)("span",{className:"block truncate font-mono text-[11px] text-mute",title:e.path,children:e.path})]})]}),(0,t.jsx)("span",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-mute",children:e.exists?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{children:[e.requests," request",1===e.requests?"":"s"]}),(0,t.jsxs)("span",{children:[e.environments," environment",1===e.environments?"":"s"]})]}):(0,t.jsx)("span",{className:"text-bad",children:"Folder not found"})}),(0,t.jsxs)("span",{className:"flex items-center gap-2 border-t border-line pt-3 text-xs",children:[e.current?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 font-medium text-accent",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-accent","aria-hidden":!0})," In use"]}):(0,t.jsx)("span",{className:"text-mute",children:function(e){if(!e)return"Not opened yet";let t=Math.round((Date.now()-Date.parse(e))/6e4);if(t<60)return t<2?"Opened just now":`Opened ${t} minutes ago`;let n=Math.round(t/60);if(n<24)return`Opened ${n} hour${1===n?"":"s"} ago`;let s=Math.round(n/24);return 1===s?"Opened yesterday":`Opened ${s} days ago`}(e.lastOpenedAt)}),e.git?(0,t.jsxs)("span",{className:"ml-auto inline-flex items-center gap-1 font-mono text-[11px] text-mute",children:[(0,t.jsx)(o,{size:11,"aria-hidden":!0})," ",e.git]}):null]})]}),d?(0,t.jsx)("input",{autoFocus:!0,defaultValue:e.name,"aria-label":`New name for ${e.name}`,className:"input absolute top-4 right-10 left-16 py-1 text-sm",onKeyDown:e=>{"Enter"===e.key&&(s?.(e.target.value),m(!1)),"Escape"===e.key&&m(!1)},onBlur:e=>{s?.(e.target.value),m(!1)}}):null,s||r||a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{ref:f,type:"button","aria-label":`Actions for ${e.name}`,"aria-haspopup":"menu","aria-expanded":l,onClick:()=>i(e=>!e),className:"absolute top-3 right-3 rounded p-1 text-mute opacity-0 group-hover:opacity-100 hover:text-ink focus:opacity-100",children:(0,t.jsx)(u.f,{size:15})}),(0,t.jsx)(k.f,{anchor:f,open:l,onClose:()=>i(!1),label:`Actions for ${e.name}`,width:200,role:"menu",children:(0,t.jsxs)("div",{className:"-m-2",children:[s?(0,t.jsx)(j.d,{icon:p.f,label:"Rename",onSelect:()=>(i(!1),m(!0))}):null,r?(0,t.jsx)(j.d,{icon:c.f,label:"Take off the list",onSelect:()=>(i(!1),r())}):null,a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Z,{}),(0,t.jsx)(j.d,{icon:h.f,label:"Delete project…",danger:!0,onSelect:()=>(i(!1),a())})]}):null]})})]}):null]})}function A({href:e,onClick:n,icon:s,title:r,body:a}){let l=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-accent",children:s}),(0,t.jsx)("span",{className:"text-sm font-semibold text-ink",children:r}),(0,t.jsx)("span",{className:"text-xs text-mute",children:a})]}),i="flex h-full flex-col gap-1.5 rounded-xl border border-line bg-panel p-4 text-left hover:border-mute";return e?(0,t.jsx)(x.default,{href:e,className:i,children:l}):(0,t.jsx)("button",{type:"button",onClick:n,className:i,children:l})}e.s(["HomePage",0,function(){let e=(0,N.d)(),i=(0,w.L)(),{slo:o}=(0,I.G)(),{dataDir:c}=(0,F.J)(),{projects:u,refresh:p,supported:h}=(0,T.O)(),{index:k}=(0,_.K)(),[j,E]=(0,v.useState)(!1),[R,L]=(0,v.useState)(""),[q,D]=(0,v.useState)(null),[O,P]=(0,v.useState)(null),z=(0,C.f)()?.projects,U=(0,y.useRouter)();async function H(t){return t.current?U.push("/"):z?t.exists?void(P(t.name),!await z.open(t.id).catch(()=>!1)&&(P(null),e(`Could not open “${t.name}”`,"error"))):e(`The folder for “${t.name}” isn't there any more: ${t.path}`,"error"):void 0}async function V(){if(!z||!R.trim())return;let t=await z.add({name:R.trim(),folder:q??void 0}).catch(()=>null);if(!t)return e("Could not make the project","error");E(!1),L(""),D(null),await p();let n=(await z.list()).find(e=>e.id===t.id);n&&await H(n)}async function B(){if(!z)return;let e=await z.chooseFolder("open");if(!e)return;let t=await z.add({folder:e});await p();let n=t?(await z.list()).find(e=>e.id===t.id):void 0;n&&await H(n)}async function W(e){!z||await i({title:`Take “${e.name}” off the list?`,body:`Its folder and files stay where they are (${e.path}). Open the folder again to bring it back.`,confirmLabel:"Take off the list"})&&(await z.remove(e.id),await p())}async function K(n){if(!z||!await i({title:`Delete the project “${n.name}”?`,body:(0,t.jsxs)(t.Fragment,{children:["Its requests, environments, history, versions and Trash go to the Recycle Bin, so you can still get them back from there. Anything else in"," ",(0,t.jsx)("span",{className:"font-mono text-ink",children:n.path})," is left alone.",n.current?" The app switches to My workspace first.":""]}),confirmLabel:"Delete project",tone:"danger"}))return;n.current&&P("My workspace");let s=await z.delete(n.id).catch(()=>({ok:!1,keptOthers:!1}));if(!s.ok)return P(null),e(`Could not delete “${n.name}”`,"error");e(s.keptOthers?`Deleted “${n.name}” — the folder's other files were kept`:`Deleted “${n.name}” — it's in the Recycle Bin`,"success"),await p()}async function J(e,t){z&&t.trim()&&t.trim()!==e.name&&(await z.rename(e.id,t.trim()),await p())}let X=(k?.runs??[]).slice().sort((e,t)=>t.startedAt.localeCompare(e.startedAt)).slice(0,6);return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",children:[O?(0,t.jsx)("div",{role:"status",className:"fixed inset-0 z-[80] grid place-items-center bg-canvas/80 backdrop-blur-sm",children:(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-ink",children:[(0,t.jsx)(d.f,{size:16,className:"animate-spin"})," Opening ",O,"…"]})}):null,(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-7xl flex-wrap gap-8 px-6 py-8 lg:px-10",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-[999_1_40rem] flex-col gap-8",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,t.jsxs)("div",{className:"min-w-60 flex-1",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight text-ink",children:"Projects"}),(0,t.jsx)("p",{className:"mt-1 text-sm text-mute",children:"Each project is a folder on this computer — its requests, environments and history, as plain files you can keep in Git."})]}),h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary",onClick:()=>void B(),children:[(0,t.jsx)(l.f,{size:15,"aria-hidden":!0})," Open folder…"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-primary",onClick:()=>E(!0),children:[(0,t.jsx)(m.f,{size:15,"aria-hidden":!0})," New project"]})]}):null]}),j?(0,t.jsxs)("form",{className:"flex flex-wrap items-end gap-3 rounded-xl border border-line bg-panel p-4",onSubmit:e=>{e.preventDefault(),V()},children:[(0,t.jsxs)("label",{className:"flex min-w-56 flex-1 flex-col gap-1 text-xs text-mute",children:["Name",(0,t.jsx)("input",{autoFocus:!0,value:R,onChange:e=>L(e.target.value),placeholder:"Payments API",className:"input","aria-label":"Project name"})]}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-[2] flex-col gap-1 text-xs text-mute",children:["Folder",(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate rounded-md border border-line bg-panel-2 px-2 py-1.5 font-mono text-xs text-ink",title:q??void 0,children:q??`Documents/APITestCenter Projects/${R.trim()||"…"}`}),(0,t.jsx)("button",{type:"button",className:"btn btn-secondary py-1.5 text-xs",onClick:async()=>D(await z?.chooseFolder("new")??q),children:"Choose…"})]})]}),(0,t.jsx)("button",{type:"submit",className:"btn btn-primary",disabled:!R.trim(),children:"Create and open"}),(0,t.jsx)("button",{type:"button",className:"btn btn-secondary",onClick:()=>E(!1),children:"Cancel"})]}):null,(0,t.jsx)("ul",{className:"grid grid-cols-[repeat(auto-fill,minmax(17rem,1fr))] gap-4",children:(u??(c?[{id:"default",name:"This folder",path:c,lastOpenedAt:"",current:!0,exists:!0,requests:0,environments:0,git:null,builtIn:!0}]:[])).map(e=>(0,t.jsx)("li",{children:(0,t.jsx)(M,{project:e,onOpen:()=>void H(e),onRename:e.builtIn?void 0:t=>void J(e,t),onRemove:e.builtIn||e.current?void 0:()=>void W(e),onDelete:e.builtIn||!h?void 0:()=>void K(e)})},e.id))}),h?null:(0,t.jsxs)("p",{className:"text-sm text-mute",children:["Several projects need the desktop app. On the command line, pick a folder with ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"--data"}),": ",(0,t.jsx)("code",{className:"font-mono text-ink",children:"npx apitestcenter ui --data api-tests"}),"."]}),(0,t.jsxs)("section",{"aria-labelledby":"start-title",children:[(0,t.jsx)("h2",{id:"start-title",className:"mb-3 text-base font-semibold text-ink",children:"Start something"}),(0,t.jsxs)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(14rem,1fr))] gap-3",children:[(0,t.jsx)(A,{href:"/",icon:(0,t.jsx)(a.f,{size:16,"aria-hidden":!0}),title:"Send a request",body:"Try the practice API built in"}),(0,t.jsx)(A,{onClick:()=>(0,$.F)(),icon:(0,t.jsx)(r.f,{size:16,"aria-hidden":!0}),title:"Bring your requests",body:"Postman, Insomnia, Bruno, OpenAPI, .http, Hurl"}),(0,t.jsx)(A,{href:"/",icon:(0,t.jsx)(f,{size:16,"aria-hidden":!0}),title:"Performance test an endpoint",body:"k6 runs it here — nothing is uploaded"}),(0,t.jsx)(A,{onClick:()=>(0,g.j)(),icon:(0,t.jsx)(s.f,{size:16,"aria-hidden":!0}),title:"Connect your AI assistant",body:"MCP for Claude, Cursor, VS Code"})]})]})]}),(0,t.jsxs)("aside",{"aria-labelledby":"recent-title",className:"flex min-w-0 flex-[1_1_18rem] flex-col gap-3",children:[(0,t.jsx)("h2",{id:"recent-title",className:"text-base font-semibold text-ink",children:"Recent performance tests"}),X.length?(0,t.jsx)("ul",{className:"overflow-hidden rounded-xl border border-line bg-panel",children:X.map((e,s)=>(0,t.jsx)("li",{className:s?"border-t border-line":"",children:(0,t.jsxs)(x.default,{href:"/history",className:"flex items-center gap-3 px-4 py-3 hover:bg-panel-2",children:[(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block truncate text-sm text-ink",children:e.name}),(0,t.jsxs)("span",{className:"block truncate font-mono text-xs text-mute",children:["p95 ",(0,S.E)(e.p95)," · ",new Date(e.startedAt).toLocaleDateString(void 0,{day:"numeric",month:"short"})]})]}),(0,t.jsx)(b.VerdictTag,{level:(0,n.F)(e.verdict,{slo:o}).overall})]})},e.id))}):(0,t.jsx)("p",{className:"rounded-xl border border-dashed border-line px-4 py-6 text-sm text-mute",children:"Performance tests in this project will show here."})]})]})]})}],92016)},37837,e=>{var t=e.i(72587),n=e.i(55218),s=e.i(90484),r=e.i(14865);e.s(["f",0,function({anchor:e,open:a,onClose:l,children:i,label:o,width:c=280,role:d="dialog"}){let u=(0,n.useRef)(null),[p,m]=(0,n.useState)(null);return((0,n.useLayoutEffect)(()=>{if(!a)return;let t=()=>{if(!e.current)return;let t=(0,r.C)(e.current),n=(0,r.v)(),s=u.current?.offsetHeight??320,a=n.height-t.bottom-8,l=t.top-8,i=a<Math.min(s,240)&&l>a,o=Math.min(Math.max(8,t.right-c),n.width-c-8);m({top:i?Math.max(8,t.top-Math.min(s,l)-4):t.bottom+4,left:o,maxHeight:Math.max(160,(i?l:a)-4)})};t();let n=window.requestAnimationFrame(t);return window.addEventListener("resize",t),()=>{window.cancelAnimationFrame(n),window.removeEventListener("resize",t)}},[a,e,c]),(0,n.useEffect)(()=>{if(!a)return;let t=t=>{let n=t.target;u.current?.contains(n)||e.current?.contains(n)||l()},n=t=>{"Escape"===t.key&&(t.stopPropagation(),l(),e.current?.focus())},s=e=>{u.current?.contains(e.target)||l()},r=t=>{e.current?.contains(t.target)&&(t.stopPropagation(),t.preventDefault(),l())};return document.addEventListener("pointerdown",t,!0),document.addEventListener("click",r,!0),document.addEventListener("keydown",n,!0),document.addEventListener("scroll",s,!0),()=>{document.removeEventListener("pointerdown",t,!0),document.removeEventListener("click",r,!0),document.removeEventListener("keydown",n,!0),document.removeEventListener("scroll",s,!0)}},[a,l,e]),(0,n.useEffect)(()=>{a&&window.setTimeout(()=>u.current?.querySelector("[role=menuitem], input, select, button")?.focus(),0)},[a]),!a||"u"<typeof document)?null:(0,s.createPortal)((0,t.jsx)("div",{ref:u,role:d,"aria-label":o,style:{top:p?.top??-9999,left:p?.left??-9999,width:c,maxHeight:p?.maxHeight},className:"anim-pop fixed z-[70] overflow-auto rounded-lg border border-line bg-panel p-3 shadow-2xl",children:i}),document.body)}])},32610,e=>{var t=e.i(72587),n=e.i(55218);e.s(["f",0,function({orientation:e,label:s,value:r,onMove:a,onStep:l,onReset:i,onDragging:o,className:c="",style:d}){let[u,p]=(0,n.useState)(!1);(0,n.useEffect)(()=>o?.(u),[u,o]),(0,n.useEffect)(()=>{if(!u)return;let t=e=>a(e.clientX,e.clientY),n=()=>p(!1);return document.body.style.userSelect="none",document.body.style.cursor="vertical"===e?"col-resize":"row-resize",window.addEventListener("pointermove",t),window.addEventListener("pointerup",n),()=>{document.body.style.userSelect="",document.body.style.cursor="",window.removeEventListener("pointermove",t),window.removeEventListener("pointerup",n)}},[u,a,e]);let m="vertical"===e;return(0,t.jsx)("div",{role:"separator",tabIndex:0,"aria-orientation":e,"aria-label":s,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r),title:`${s} — drag, or double-click to reset`,onPointerDown:e=>{0===e.button&&(e.preventDefault(),p(!0))},onDoubleClick:i,style:{...d,outline:"none"},onKeyDown:e=>{let t=m?"ArrowLeft":"ArrowUp";e.key===t||e.key===(m?"ArrowRight":"ArrowDown")?(e.preventDefault(),l(e.key===t?-1:1,e.shiftKey)):("Enter"===e.key||"Home"===e.key)&&(e.preventDefault(),i())},className:`group z-20 hidden touch-none outline-none lg:block ${m?"w-2 cursor-col-resize":"h-2 cursor-row-resize"} ${c}`,children:(0,t.jsx)("span",{"aria-hidden":!0,className:`pointer-events-none absolute bg-accent opacity-0 transition-opacity group-hover:opacity-60 group-focus-visible:opacity-100 ${u?"opacity-100":""} ${m?"inset-y-0 left-1/2 w-0.5 -translate-x-1/2":"inset-x-0 top-1/2 h-0.5 -translate-y-1/2"}`})})}])},30617,e=>{e.i(24856);var t=e.i(46306),n=e.i(36558),s=e.i(2385),r=e.i(17219);let a={base:0,header:1,desc:2,pass:3,warn:4,fail:5};function l(e){return String(e).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("\n"," ")}function i(e,t,n){if("level"===e)return"pass"===t?a.pass:"warn"===t?a.warn:"fail"===t?a.fail:a.base;let s="number"==typeof t?t:Number(t);return"errors"===e?s>=n.errorFail?a.fail:s>=n.errorWarn?a.warn:a.pass:s>=n.p95FailMs?a.fail:s>=n.p95WarnMs?a.warn:a.pass}let o=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
|
+
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
|
|
3
|
+
<fonts count="3">
|
|
4
|
+
<font><sz val="11"/><name val="Calibri"/></font>
|
|
5
|
+
<font><b/><sz val="11"/><color rgb="FFFFFFFF"/><name val="Calibri"/></font>
|
|
6
|
+
<font><sz val="10"/><color rgb="FF5C6778"/><name val="Calibri"/></font>
|
|
7
|
+
</fonts>
|
|
8
|
+
<fills count="6">
|
|
9
|
+
<fill><patternFill patternType="none"/></fill>
|
|
10
|
+
<fill><patternFill patternType="gray125"/></fill>
|
|
11
|
+
<fill><patternFill patternType="solid"><fgColor rgb="FF0B8F7C"/></patternFill></fill>
|
|
12
|
+
<fill><patternFill patternType="solid"><fgColor rgb="FFDCFCE7"/></patternFill></fill>
|
|
13
|
+
<fill><patternFill patternType="solid"><fgColor rgb="FFFEF3C7"/></patternFill></fill>
|
|
14
|
+
<fill><patternFill patternType="solid"><fgColor rgb="FFFECACA"/></patternFill></fill>
|
|
15
|
+
</fills>
|
|
16
|
+
<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>
|
|
17
|
+
<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>
|
|
18
|
+
<cellXfs count="6">
|
|
19
|
+
<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>
|
|
20
|
+
<xf numFmtId="0" fontId="1" fillId="2" borderId="0" xfId="0" applyFont="1" applyFill="1" applyAlignment="1"><alignment horizontal="center" vertical="center"/></xf>
|
|
21
|
+
<xf numFmtId="0" fontId="2" fillId="0" borderId="0" xfId="0" applyFont="1" applyAlignment="1"><alignment wrapText="1" vertical="center"/></xf>
|
|
22
|
+
<xf numFmtId="0" fontId="0" fillId="3" borderId="0" xfId="0" applyFill="1"/>
|
|
23
|
+
<xf numFmtId="0" fontId="0" fillId="4" borderId="0" xfId="0" applyFill="1"/>
|
|
24
|
+
<xf numFmtId="0" fontId="0" fillId="5" borderId="0" xfId="0" applyFill="1"/>
|
|
25
|
+
</cellXfs>
|
|
26
|
+
</styleSheet>`;async function c(e,r,l){let o=(0,s.s)(e,{slo:r}),c=(0,s.v)(r),u=(0,t.$)(l,(0,t.L)(e));return d([{name:"Overview",rows:[[{v:"Key",s:a.header},{v:"Value",s:a.header},{v:"What this means",s:a.header}],...(0,n.E)(e).map(e=>{let t=a.base;return"failed_rate"===e.key&&(t=i("errors",e.value,c)),"latency_p95_ms"===e.key&&(t=i("latency",e.value,c)),(e.key.startsWith("status_5")||"status_0"===e.key)&&(t=Number(e.value)>0?a.fail:a.pass),e.key.startsWith("status_4")&&Number(e.value)>0&&(t=a.warn),e.key.startsWith("threshold:")&&(t="pass"===e.value?a.pass:a.fail),[{v:e.key},{v:e.value,s:t},{v:e.description,s:a.desc}]})]},{name:"Result summary",rows:[[{v:"Field",s:a.header},{v:"Level",s:a.header},{v:"What this means",s:a.header}],[{v:"overall"},{v:o.overall,s:i("level",o.overall,c)},{v:o.headline,s:a.desc}],...o.aspects.map(e=>[{v:e.title},{v:e.level,s:i("level",e.level,c)},{v:e.summary,s:a.desc}]),[{v:"disclaimer"},{v:""},{v:o.disclaimer,s:a.desc}],...u.map((e,n)=>[{v:`chart_${n+1}`},{v:`${e.w}x${e.h}`},{v:t.p[e.id],s:a.desc}])]},{name:"Second by second",rows:[n.V.map(e=>({v:e.header,s:a.header})),...e.buckets.map(e=>(0,n.u)(e).map((e,t)=>{let s=n.V[t]?.key,r=a.base;return"p95_ms"===s&&(r=i("latency",e,c)),"failed_rate"===s&&(r=i("errors",e,c)),"http_5xx"===s&&Number(e)>0&&(r=a.fail),"http_0"===s&&Number(e)>0&&(r=a.fail),"http_4xx"===s&&Number(e)>0&&(r=a.warn),"http_2xx"===s&&Number(e)>0&&(r=a.pass),{v:e,s:r}}))]}])}function d(e){let t={"[Content_Types].xml":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
27
|
+
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
|
28
|
+
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
|
|
29
|
+
<Default Extension="xml" ContentType="application/xml"/>
|
|
30
|
+
<Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>
|
|
31
|
+
<Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>
|
|
32
|
+
${e.map((e,t)=>` <Override PartName="/xl/worksheets/sheet${t+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("\n")}
|
|
33
|
+
</Types>`,"_rels/.rels":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
34
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
35
|
+
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>
|
|
36
|
+
</Relationships>`,"xl/workbook.xml":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
37
|
+
<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
|
|
38
|
+
<sheets>
|
|
39
|
+
${e.map((e,t)=>` <sheet name="${l(e.name.replace(/[:\\/?*[\]]/g," ").trim().slice(0,31)||"Sheet")}" sheetId="${t+1}" r:id="rId${t+1}"/>`).join("\n")}
|
|
40
|
+
</sheets>
|
|
41
|
+
</workbook>`,"xl/_rels/workbook.xml.rels":`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
42
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
43
|
+
${e.map((e,t)=>` <Relationship Id="rId${t+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${t+1}.xml"/>`).join("\n")}
|
|
44
|
+
<Relationship Id="rId${e.length+1}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
|
|
45
|
+
</Relationships>`,"xl/styles.xml":o};return e.forEach((e,n)=>{var s;let r,a,i;return t[`xl/worksheets/sheet${n+1}.xml`]=(s=e.rows,a=Array.from({length:r=s[0]?.length??0},(e,t)=>{let n=function(e,t,n=10,s=48){let r=n;for(let n of e){let e=n[t]?.v;void 0!==e&&(r=Math.max(r,String(e).length+2))}return Math.min(s,r)}(s,t,t===r-1&&r>=3?36:12,t===r-1&&r>=3?72:42);return`<col min="${t+1}" max="${t+1}" width="${n}" customWidth="1"/>`}).join(""),i=s.map((e,t)=>`<row r="${t+1}" ht="${0===t?22:18}" customHeight="1">${e.map((e,n)=>{var s;let r,a;return s=t+1,r=`${function(e){let t=e+1,n="";for(;t>0;)n=String.fromCharCode(65+(t-1)%26)+n,t=Math.floor((t-1)/26);return n}(n)}${s}`,a=void 0!==e.s?` s="${e.s}"`:"","number"==typeof e.v&&Number.isFinite(e.v)?`<c r="${r}"${a}><v>${e.v}</v></c>`:`<c r="${r}"${a} t="inlineStr"><is><t xml:space="preserve">${l(e.v)}</t></is></c>`}).join("")}</row>`).join(""),`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
46
|
+
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
|
|
47
|
+
<sheetViews><sheetView workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/></sheetView></sheetViews>
|
|
48
|
+
<cols>${a}</cols>
|
|
49
|
+
<sheetData>${i}</sheetData>
|
|
50
|
+
</worksheet>`)}),new Blob([(0,r.f)(t)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})}e.s(["S",0,a,"a",0,c,"F",0,d])},62766,e=>{var t=e.i(55218);let n="apitestcenter-pane-sizes",s=(e,t,n)=>Math.min(n,Math.max(t,e));function r(e){let[n,s]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{let t=window.matchMedia(e),n=()=>s(t.matches);return n(),t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[e]),n}e.s(["K",0,function(e,{min:a=220,max:l=900,rest:i=360}={}){let o=r("(min-width: 1024px)"),c=(0,t.useRef)(null),d=`${n}:${e}`,[u,p]=(0,t.useState)(null),[m,h]=(0,t.useState)(0);(0,t.useEffect)(()=>{try{let e=Number(JSON.parse(localStorage.getItem(d)??"null"));Number.isFinite(e)&&e>0&&p(e)}catch{}},[d]),(0,t.useEffect)(()=>{let e=[...c.current?.children??[]].find(e=>"separator"!==e.getAttribute("role"));if(!e)return;let t=new ResizeObserver(()=>h(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[o]);let f=(0,t.useCallback)(e=>{let t=c.current?.getBoundingClientRect(),n=null===e?null:Math.round(s(e,a,Math.max(a,Math.min(l,(t?.width??l+i)-i))));p(n);try{null===n?localStorage.removeItem(d):localStorage.setItem(d,JSON.stringify(n))}catch{}},[l,a,i,d]),x=()=>c.current?.getBoundingClientRect();return{wide:o,gridRef:c,gridStyle:o&&null!==u?{gridTemplateColumns:`${u}px minmax(0,1fr)`}:void 0,splitter:{orientation:"vertical",value:(u??m)/Math.max(1,x()?.width??1)*100,onMove:e=>{let t=x();t&&f(e-t.left)},onStep:(e,t)=>f((u??m)+16*e*(t?4:1)),onReset:()=>f(null),className:"absolute inset-y-0 -translate-x-1/2",style:{left:`${m}px`}}}},"f",0,function(e,a){let l=r("(min-width: 1024px)"),i=r("(min-width: 1536px)"),o=(0,t.useRef)(null),[c,d]=(0,t.useState)({panel:null,beside:null,below:null});(0,t.useEffect)(()=>{try{let e=JSON.parse(localStorage.getItem(n)??"null"),t=e=>"number"==typeof e&&Number.isFinite(e)?e:null;e&&d({panel:t(e.panel),beside:t(e.beside),below:t(e.below)})}catch{}},[]);let u=(0,t.useCallback)(e=>{d(t=>{let s={...t,...e};try{localStorage.setItem(n,JSON.stringify(s))}catch{}return s})},[]),p=s(c.panel??(i?256:240),180,480),m=a?p:0,h=s("below"===e?c.below??.5:c.beside??(i?5/12:.5),.2,.8),f=l?"below"===e?{gridTemplateColumns:`${m}px minmax(0,1fr)`,gridTemplateRows:`minmax(0,${h}fr) minmax(0,${1-h}fr)`}:{gridTemplateColumns:`${m}px minmax(0,${h}fr) minmax(0,${1-h}fr)`}:void 0,x=()=>o.current?.getBoundingClientRect(),y=(0,t.useCallback)(e=>{let t=x();t&&u({panel:s(e-t.left,180,Math.min(480,.4*t.width))})},[u]),v=(0,t.useCallback)((t,n)=>{let r=x();r&&("below"===e?u({below:s((n-r.top)/r.height,.2,.8)}):u({beside:s((t-r.left-m)/Math.max(1,r.width-m),.2,.8)}))},[u,e,m]);return{wide:l,gridRef:o,gridStyle:f,panelWidth:l?p:void 0,panel:{value:p/480*100,onMove:e=>y(e),onStep:(e,t)=>u({panel:s(p+16*e*(t?4:1),180,480)}),onReset:()=>u({panel:null}),style:{left:`${m}px`}},split:{value:100*h,onMove:v,onStep:(t,n)=>u("below"===e?{below:s(h+.02*t*(n?5:1),.2,.8)}:{beside:s(h+.02*t*(n?5:1),.2,.8)}),onReset:()=>u("below"===e?{below:null}:{beside:null}),style:"below"===e?{top:`${100*h}%`,left:`${m}px`,right:0}:{left:`calc(${m}px + (100% - ${m}px) * ${h})`,top:0,bottom:0}}}}])},61230,17847,e=>{e.s(["f",0,function(e){try{return decodeURI(e.replace(/\+/g,"%20")).replace(/%2C/gi,",").replace(/%24/g,"$").replace(/%27/g,"'").replace(/%3A/gi,":").replace(/%2F/gi,"/").replace(/%3D/gi,"=")}catch{return e}}],61230);var t=e.i(72587),n=e.i(55218),s=e.i(90484),r=e.i(14865);e.s(["c",0,function({at:e,label:a,onClose:l,children:i}){let o=(0,n.useRef)(null),[c,d]=(0,n.useState)(null);return((0,n.useLayoutEffect)(()=>{let t=o.current;if(!t)return;let n=(0,r.v)();d({left:Math.max(8,Math.min(e.x,n.width-t.offsetWidth-8)),top:Math.max(8,Math.min(e.y,n.height-t.offsetHeight-8))}),t.querySelector('[role="menuitem"]:not(:disabled)')?.focus()},[e]),(0,n.useEffect)(()=>{let e=e=>{o.current?.contains(e.target)||l()},t=e=>{if("Escape"===e.key)e.stopPropagation(),l();else if("ArrowDown"===e.key||"ArrowUp"===e.key){e.preventDefault();let t=[...o.current?.querySelectorAll('[role="menuitem"]:not(:disabled)')??[]],n=t.indexOf(document.activeElement);t[(n+("ArrowDown"===e.key?1:-1)+t.length)%t.length]?.focus()}};return document.addEventListener("pointerdown",e,!0),document.addEventListener("scroll",e,!0),window.addEventListener("resize",l),window.addEventListener("keydown",t,!0),()=>{document.removeEventListener("pointerdown",e,!0),document.removeEventListener("scroll",e,!0),window.removeEventListener("resize",l),window.removeEventListener("keydown",t,!0)}},[l]),"u"<typeof document)?null:(0,s.createPortal)((0,t.jsx)("div",{ref:o,role:"menu","aria-label":a,style:{left:c?.left??-9999,top:c?.top??-9999},className:"fixed z-[80] w-56 rounded-lg border border-line bg-panel p-1 shadow-2xl",children:i}),document.body)},"d",0,function({icon:e,label:n,hint:s,onSelect:r,danger:a=!1,disabled:l=!1}){return(0,t.jsxs)("button",{type:"button",role:"menuitem",disabled:l,onClick:r,className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-left text-sm disabled:opacity-40 ${a?"text-bad hover:bg-bad/10":"text-ink hover:bg-panel-2"}`,children:[(0,t.jsx)("span",{className:`flex w-4 shrink-0 justify-center ${a?"":"text-mute"}`,"aria-hidden":!0,children:e?(0,t.jsx)(e,{size:14}):null}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate",children:n}),s?(0,t.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-mute",children:s}):null]})},"U",0,function({children:e}){return(0,t.jsx)("div",{className:"px-2.5 pt-1.5 pb-1 text-[11px] font-medium tracking-wide text-mute uppercase",children:e})},"Z",0,function(){return(0,t.jsx)("div",{role:"separator",className:"my-1 h-px bg-line"})}],17847)},17219,e=>{let t=new Uint32Array(256).map((e,t)=>{let n=t;for(let e=0;e<8;e++)n=1&n?0xedb88320^n>>>1:n>>>1;return n>>>0});function n(e){let t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e,!0),t}function s(e){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),t}function r(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let s of e)t.set(s,n),n+=s.length;return t}e.s(["f",0,function(e){let a=new TextEncoder,l=[],i=[],o=0;for(let[c,d]of Object.entries(e)){let e=a.encode(c),u="string"==typeof d?a.encode(d):d,p=function(e){let n=0xffffffff;for(let s of e)n=t[(n^s)&255]^n>>>8;return(0xffffffff^n)>>>0}(u),m=r([s(0x4034b50),n(20),n(0),n(0),n(0),n(0),s(p),s(u.length),s(u.length),n(e.length),n(0),e,u]),h=r([s(0x2014b50),n(20),n(20),n(0),n(0),n(0),n(0),s(p),s(u.length),s(u.length),n(e.length),n(0),n(0),n(0),n(0),s(0),s(o),e]);l.push(m),i.push(h),o+=m.length}let c=r(i),d=r([s(0x6054b50),n(0),n(0),n(Object.keys(e).length),n(Object.keys(e).length),s(c.length),s(o),n(0)]),u=r([...l,c,d]);return new Blob([u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength)],{type:"application/zip"})}])},13643,e=>{let t=(0,e.i(99522).f)("bell-off",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]);e.s(["f",0,t],13643)},95211,e=>{let t=(0,e.i(99522).f)("columns-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);e.s(["f",0,t],95211)},81538,e=>{let t=(0,e.i(99522).f)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);e.s(["f",0,t],81538)},13163,e=>{let t=(0,e.i(99522).f)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["f",0,t],13163)},3792,e=>{let t=(0,e.i(99522).f)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["f",0,t],3792)},95927,e=>{let t=(0,e.i(99522).f)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["f",0,t],95927)},66478,14168,e=>{let t=(0,e.i(99522).f)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);async function n(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Engine error (${e.status})`);return t}e.s(["f",0,t],66478);let s=(e,t,n)=>fetch(t,{method:e,headers:void 0===n?void 0:{"content-type":"application/json"},body:void 0===n?void 0:JSON.stringify(n)});e.s(["Y",0,{plan:e=>fetch(`/engine/suites/plan?collection=${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>n(e)),savePlan:(e,t)=>s("PUT","/engine/suites/plan",{collection:e,...t}).then(e=>n(e)),start:e=>s("POST","/engine/suites/runs",e).then(e=>n(e)),get:e=>fetch(`/engine/suites/runs/${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>n(e)),stop:e=>s("POST",`/engine/suites/runs/${encodeURIComponent(e)}/stop`).then(e=>n(e))},"W",0,function(e){return`/suite?c=${encodeURIComponent(e)}`}],14168)},36558,e=>{function t(e,n=2){if(!Number.isFinite(e))return 0;let s=10**n;return Math.round(e*s)/s}function n(e){return e>=100?Math.round(e):e>=10?t(e,1):t(e,2)}function s(e){return e>=10?Math.round(e):t(e,1)}function r(e,t=e=>e){return null==e?"":t(e)}e.s(["V",0,[{key:"elapsed_s",header:"Seconds into test",description:"Seconds from the start of the run."},{key:"ts",header:"Clock time",description:"Wall-clock time for this one-second sample."},{key:"vus",header:"Concurrent users",description:"Virtual users (VUs) active in this second."},{key:"rps",header:"Requests per second",description:"Completed requests in this second."},{key:"p50_ms",header:"Median latency (ms)",description:"Half of requests this second were faster than this."},{key:"p95_ms",header:"95th percentile (ms)",description:"95% of requests this second were faster than this."},{key:"p99_ms",header:"99th percentile (ms)",description:"The slow tail this second — 1 in 100 was slower."},{key:"failed_rate",header:"Error rate",description:"Share of requests that failed in this second (0–1)."},{key:"http_2xx",header:"Success (2xx)",description:"Successful HTTP responses this second."},{key:"http_4xx",header:"Client errors (4xx)",description:"Client / auth errors this second."},{key:"http_5xx",header:"Server errors (5xx)",description:"Server errors this second."},{key:"http_0",header:"Network failures",description:"No HTTP status (timeout / reset) this second."},{key:"bytes_in",header:"Bytes received",description:"Response bytes this second."},{key:"bytes_out",header:"Bytes sent",description:"Request bytes this second."},{key:"p90_ms",header:"90th percentile (ms)",description:"90% of requests this second were faster than this."},{key:"p999_ms",header:"99.9th percentile (ms)",description:"1 in 1,000 requests this second was slower than this."},{key:"max_ms",header:"Slowest (ms)",description:"Slowest request this second."},{key:"ttfb_ms",header:"Server time (ms)",description:"Average time to first byte this second — the server's own work."},{key:"connect_ms",header:"TCP connect (ms)",description:"Average TCP connect time this second (0 when connections are reused)."},{key:"tls_ms",header:"TLS handshake (ms)",description:"Average TLS handshake time this second."},{key:"checks_passed",header:"Checks passed",description:"Response checks that passed this second."},{key:"checks_failed",header:"Checks failed",description:"Response checks that failed this second."},{key:"dropped",header:"Dropped requests",description:"Rate mode: requests k6 could not start this second."}],"u",0,function(e){return[e.elapsedS,e.ts,t(e.vus,1),n(e.rps),s(e.p50Ms),s(e.p95Ms),s(e.p99Ms),t(e.failedRate,4),e.http2xx,e.http4xx,e.http5xx,e.http0,e.bytesIn,e.bytesOut,r(e.p90Ms,s),r(e.p999Ms,s),r(e.maxMs,s),r(e.ttfbMs,s),r(e.connectMs,s),r(e.tlsMs,s),r(e.checksPassed),r(e.checksFailed),r(e.dropped)]},"E",0,function(e){let{summary:r}=e,a=[{key:"run_id",value:e.id,description:"Id of this run in this browser tab."},{key:"test_name",value:e.testName,description:"Display name (method, path, time)."},{key:"status",value:e.status,description:"completed, failed, cancelled, or still running."},{key:"started_at",value:e.startedAt,description:"When the load test started (UTC)."},{key:"ended_at",value:e.endedAt,description:"When the load test finished (UTC)."},{key:"method",value:e.definition.method,description:"HTTP method that was repeated."},{key:"url",value:e.definition.url,description:"Target URL (secrets are not exported)."},{key:"auth_mode",value:e.definition.auth.mode,description:"Auth used: none, bearer, basic, or api_key. The secret is not exported."},{key:"executor",value:e.definition.load.executor,description:"Load pattern: constant-vus (steady) or ramping-vus (ramp / hold / down)."},{key:"requests",value:r.http.requests,description:"How many HTTP calls finished. Zero usually means the target never answered."},{key:"rps_avg",value:n(r.http.rps.avg),description:"Average requests per second completed by this generator."},{key:"rps_max",value:n(r.http.rps.max),description:"Peak requests per second in any one-second sample."},{key:"failed_count",value:r.http.failed.count,description:"Requests that failed (4xx, 5xx, timeout, or no status)."},{key:"failed_rate",value:t(r.http.failed.rate,4),description:"Failed / total. Default warning bar is 1% (0.01)."},{key:"latency_min_ms",value:s(r.latencyMs.min),description:"Fastest request (milliseconds)."},{key:"latency_mean_ms",value:s(r.latencyMs.mean),description:"Average response time. Slow outliers pull this up."},{key:"latency_p50_ms",value:s(r.latencyMs.median),description:"Median — half of requests were faster than this."},{key:"latency_p95_ms",value:s(r.latencyMs.p95),description:"95th percentile — 95% of requests were faster. Usual headline latency."},{key:"latency_p99_ms",value:s(r.latencyMs.p99),description:"99th percentile — the slow tail (1 in 100 was slower)."},{key:"latency_max_ms",value:s(r.latencyMs.max),description:"Slowest single request."},{key:"vus_max",value:r.vus.max,description:"Peak concurrent users (virtual users / VUs)."},{key:"vus_avg",value:t(r.vus.avg,1),description:"Average concurrent users over the run."},{key:"bytes_in",value:r.data.bytesIn,description:"Response bytes received by the generator."},{key:"bytes_out",value:r.data.bytesOut,description:"Request bytes sent by the generator."},{key:"phase_ttfb_avg_ms",value:s(r.phasesMs.ttfb.avg),description:"Time to first byte — waiting on the server after the connection is up."},{key:"phase_tls_avg_ms",value:s(r.phasesMs.tls.avg),description:"TLS handshake time. High values often mean a far or overloaded endpoint."}];for(let[e,t]of Object.entries(r.http.status)){let n="0"===e?"No HTTP status (timeout / network).":Number(e)>=500?"Server error.":Number(e)>=400?"Client / auth error.":"Success-class response.";a.push({key:`status_${e}`,value:t,description:`How many responses had status ${e}. ${n}`})}for(let e of r.thresholds)a.push({key:`threshold:${e.name}`,value:e.ok?"pass":"fail",description:"k6 threshold result for this run."});return a}])}])})();
|