apitestcenter 0.6.0 → 0.7.0
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 +1 -1
- package/dist/THIRD-PARTY-NOTICES.txt +336 -1
- package/dist/cli.mjs +20969 -1746
- package/dist/ui/404/index.html +1 -1
- package/dist/ui/404.html +1 -1
- package/dist/ui/__next.__PAGE__.txt +10 -10
- package/dist/ui/__next._full.txt +11 -11
- package/dist/ui/__next._tree.txt +2 -2
- package/dist/ui/_next/static/chunks/0-898cb98enjv.css +3 -0
- package/dist/ui/_next/static/chunks/02myfb0nlri-z.js +119 -0
- package/dist/ui/_next/static/chunks/0kfr8kv4cj_kv.js +1 -0
- package/dist/ui/_next/static/chunks/{12eajgls1n2zi.js → 0txpfp028djv6.js} +71 -71
- package/dist/ui/_next/static/chunks/0vkcbl8nakdh1.js +2 -0
- package/dist/ui/_next/static/chunks/13nvl7bxr0ra-.js +1 -0
- package/dist/ui/_next/static/chunks/1w_q4qvvuinj2.js +1 -0
- package/dist/ui/_next/static/chunks/{065oy54s0-cwr.js → 2idsynwg5lkk7.js} +2 -2
- package/dist/ui/_next/static/chunks/{0mlyz754peers.js → 2lw9bsrnh8k4u.js} +1 -1
- package/dist/ui/_next/static/chunks/2nxnxp6p-40kg.js +1 -0
- package/dist/ui/_next/static/chunks/3ad2zh-p8_xhv.js +59 -0
- package/dist/ui/_not-found/__next._full.txt +10 -10
- package/dist/ui/_not-found/__next._not-found.__PAGE__.txt +9 -9
- package/dist/ui/_not-found/__next._tree.txt +2 -2
- package/dist/ui/_not-found/index.html +1 -1
- package/dist/ui/_not-found/index.txt +10 -10
- package/dist/ui/compare/__next._full.txt +11 -11
- package/dist/ui/compare/__next._tree.txt +2 -2
- package/dist/ui/compare/__next.compare.__PAGE__.txt +10 -10
- package/dist/ui/compare/index.html +1 -1
- package/dist/ui/compare/index.txt +11 -11
- package/dist/ui/history/__next._full.txt +12 -12
- package/dist/ui/history/__next._tree.txt +2 -2
- package/dist/ui/history/__next.history.__PAGE__.txt +11 -11
- package/dist/ui/history/index.html +1 -1
- package/dist/ui/history/index.txt +12 -12
- package/dist/ui/index.html +1 -1
- package/dist/ui/index.txt +11 -11
- package/dist/ui/preview/__next._full.txt +12 -12
- package/dist/ui/preview/__next._tree.txt +2 -2
- package/dist/ui/preview/__next.preview.__PAGE__.txt +11 -11
- package/dist/ui/preview/index.html +1 -1
- package/dist/ui/preview/index.txt +12 -12
- package/dist/ui/suite/__next._full.txt +11 -11
- package/dist/ui/suite/__next._tree.txt +2 -2
- package/dist/ui/suite/__next.suite.__PAGE__.txt +10 -10
- package/dist/ui/suite/index.html +1 -1
- package/dist/ui/suite/index.txt +11 -11
- package/dist/ui/tests/__next._full.txt +10 -10
- package/dist/ui/tests/__next._tree.txt +2 -2
- package/dist/ui/tests/__next.tests.__PAGE__.txt +9 -9
- package/dist/ui/tests/index.html +1 -1
- package/dist/ui/tests/index.txt +10 -10
- package/package.json +1 -1
- package/dist/ui/_next/static/chunks/03vwb47zropf0.js +0 -1
- package/dist/ui/_next/static/chunks/0dscs2dqej_33.css +0 -3
- package/dist/ui/_next/static/chunks/0kfnlqyz56lid.js +0 -2
- package/dist/ui/_next/static/chunks/117zwf3ps9-d0.js +0 -1
- package/dist/ui/_next/static/chunks/13hazp8hyksry.js +0 -59
- package/dist/ui/_next/static/chunks/1s74dc_u9f8bv.js +0 -1
- package/dist/ui/_next/static/chunks/1tpf12evb0w6s.js +0 -1
- package/dist/ui/_next/static/chunks/202n35227m-qn.js +0 -119
- /package/dist/ui/_next/static/{nzVJlcyPooozLLxcLfxub → lBYayPKoT6YJhgfHFuw6O}/_buildManifest.js +0 -0
- /package/dist/ui/_next/static/{nzVJlcyPooozLLxcLfxub → lBYayPKoT6YJhgfHFuw6O}/_clientMiddlewareManifest.js +0 -0
- /package/dist/ui/_next/static/{nzVJlcyPooozLLxcLfxub → lBYayPKoT6YJhgfHFuw6O}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,14168,e=>{"use strict";async function t(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Engine error (${e.status})`);return t}let n=(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(["suiteApi",0,{plan:e=>fetch(`/engine/suites/plan?collection=${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>t(e)),savePlan:(e,o)=>n("PUT","/engine/suites/plan",{collection:e,...o}).then(e=>t(e)),start:e=>n("POST","/engine/suites/runs",e).then(e=>t(e)),get:e=>fetch(`/engine/suites/runs/${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>t(e)),stop:e=>n("POST",`/engine/suites/runs/${encodeURIComponent(e)}/stop`).then(e=>t(e))},"suiteHref",0,function(e){return`/suite?c=${encodeURIComponent(e)}`}])},95486,17219,15060,e=>{"use strict";let t=(0,e.i(99522).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],95486);let n=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 o(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 i(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let o of e)t.set(o,n),n+=o.length;return t}function l(e,t){let n=URL.createObjectURL(t),o=document.createElement("a");o.href=n,o.download=e,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(n)}e.s(["zipStore",0,function(e){let t=new TextEncoder,l=[],s=[],c=0;for(let[f,u]of Object.entries(e)){let e=t.encode(f),a="string"==typeof u?t.encode(u):u,h=function(e){let t=0xffffffff;for(let o of e)t=n[(t^o)&255]^t>>>8;return(0xffffffff^t)>>>0}(a),d=i([r(0x4034b50),o(20),o(0),o(0),o(0),o(0),r(h),r(a.length),r(a.length),o(e.length),o(0),e,a]),p=i([r(0x2014b50),o(20),o(20),o(0),o(0),o(0),o(0),r(h),r(a.length),r(a.length),o(e.length),o(0),o(0),o(0),o(0),r(0),r(c),e]);l.push(d),s.push(p),c+=d.length}let f=i(s),u=i([r(0x6054b50),o(0),o(0),o(Object.keys(e).length),o(Object.keys(e).length),r(f.length),r(c),o(0)]),a=i([...l,f,u]);return new Blob([a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength)],{type:"application/zip"})}],17219),e.s(["downloadBlob",0,l,"downloadText",0,function(e,t,n){l(e,new Blob([t],{type:n}))}],15060)},60961,e=>{"use strict";let t=(0,e.i(99522).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],60961)},3792,66478,e=>{"use strict";var t=e.i(99522);let n=(0,t.default)("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(["Play",0,n],3792);let o=(0,t.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,o],66478)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69578,2603,e=>{"use strict";e.s(["CommandPalette",()=>f,"OPEN_REQUEST_EVENT",()=>p,"OPEN_REQUEST_KEY",()=>h],69578);var t=e.i(61666),s=e.i(78739),n=e.i(7641),a=e.i(67217),r=e.i(5831),i=e.i(86856),l=e.i(88293),o=e.i(48317),c=e.i(46443),d=e.i(83067);function u(){let[e,t]=(0,d.useState)("Ctrl");return(0,d.useEffect)(()=>t("u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform)?"⌘":"Ctrl"),[]),e}e.s(["useModKey",0,u,"useShortcuts",0,function(e){let t=(0,d.useRef)(e);t.current=e,(0,d.useEffect)(()=>{let e=e=>{if(document.querySelector("[aria-modal='true']"))return;let s=e.ctrlKey||e.metaKey;if(s&&!e.shiftKey&&"s"===e.key.toLowerCase()&&t.current.save){e.preventDefault(),t.current.save();return}if(s&&"Enter"===e.key){e.preventDefault(),e.shiftKey?t.current.run?.():t.current.send?.();return}if("/"===e.key&&!s&&!e.altKey){let s=e.target;!(s&&(s.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(s.tagName)))&&t.current.focusUrl&&(e.preventDefault(),t.current.focusUrl())}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[])}],2603);var m=e.i(6278);let h="apitestcenter-open-request",p="atc:open-request";function x(e){window.dispatchEvent(new KeyboardEvent("keydown",{key:"Enter",ctrlKey:!0,metaKey:!0,shiftKey:e,bubbles:!0}))}function f(){let e=(0,c.useRouter)(),f=(0,c.usePathname)(),g=u(),{setTheme:b}=(0,o.useTheme)(),{index:w,environments:y,setActiveEnv:v,activeEnv:k}=(0,m.useWorkspace)(),[j,N]=(0,d.useState)(!1),[E,S]=(0,d.useState)(""),[C,T]=(0,d.useState)(0),A=(0,d.useRef)(null),q=(0,d.useRef)(null);(0,d.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&"k"===e.key.toLowerCase()&&(e.preventDefault(),N(e=>!e))},t=()=>N(!0);return window.addEventListener("keydown",e),window.addEventListener("atc:palette",t),()=>{window.removeEventListener("keydown",e),window.removeEventListener("atc:palette",t)}},[]),(0,d.useEffect)(()=>{if(!j)return;S(""),T(0);let e=document.activeElement;return window.setTimeout(()=>A.current?.focus(),0),()=>e?.focus?.()},[j]);let L=(0,d.useMemo)(()=>{let t=e=>()=>{N(!1),window.setTimeout(e,0)},i=s=>t(()=>e.push(s)),l="/"===f||"/compare"===f,o=[{id:"go-test",group:"Go to",label:"Test API",run:i("/")},{id:"go-suite",group:"Go to",label:"Run collection",run:i("/suite")},{id:"go-compare",group:"Go to",label:"Compare",run:i("/compare")},{id:"go-history",group:"Go to",label:"History",run:i("/history")},{id:"go-open",group:"Go to",label:"Open report",run:i("/preview")},{id:"import",group:"Actions",label:"Import from Postman or OpenAPI",run:t(a.openImport)},{id:"help",group:"Help",label:"Help: what do these words mean?",run:t(n.openHelp)},{id:"about",group:"Help",label:"About APITestCenter — version and updates",run:t(s.openAbout)},{id:"tour",group:"Help",label:"Take the 1-minute tour",run:t(()=>"/"===f?(0,r.startTour)():(e.push("/"),window.setTimeout(r.startTour,900)))}];for(let s of(l&&o.push({id:"send",group:"Actions",label:"Send request",hint:`${g}+Enter`,run:t(()=>x(!1))},{id:"run",group:"Actions",label:"/compare"===f?"Compare load":"Run load test",hint:`${g}+Shift+Enter`,run:t(()=>x(!0))}),w?.requests??[]))o.push({id:`req-${s.id}`,group:"Saved requests",label:`${s.collection?`${s.collection} / `:""}${s.name}`,hint:s.method,run:t(()=>{try{sessionStorage.setItem(h,s.id)}catch{}"/"===f?window.dispatchEvent(new Event(p)):e.push("/")})});for(let e of(o.push({id:"env-none",group:"Environment",label:"Use no environment",hint:k?void 0:"current",run:t(()=>v(null))}),y))o.push({id:`env-${e.id}`,group:"Environment",label:`Use environment: ${e.name}`,hint:k?.id===e.id?"current":`${e.variables.length} vars`,run:t(()=>v(e.id))});for(let e of["system","light","dark"])o.push({id:`theme-${e}`,group:"Theme",label:`Theme: ${e[0].toUpperCase()}${e.slice(1)}`,run:t(()=>b(e))});return o},[w,y,k,f,e,g,v,b]),P=(0,d.useMemo)(()=>L.map(e=>({item:e,s:function(e,t){if(!t)return 1;let s=e.toLowerCase(),n=t.toLowerCase(),a=0,r=0;for(let e of n){let t=s.indexOf(e,a);if(t<0)return 0;r+=0===t||/[\s/·:-]/.test(s[t-1]??"")?3:t===a?2:1,a=t+1}return r}(`${e.group} ${e.label}`,E)})).filter(e=>e.s>0).sort((e,t)=>E?t.s-e.s:0).map(e=>e.item).slice(0,50),[L,E]);return((0,d.useEffect)(()=>{q.current?.querySelector(`[data-index="${C}"]`)?.scrollIntoView({block:"nearest"})},[C]),j)?(0,t.jsx)("div",{className:"fixed inset-0 z-[60] flex items-start justify-center bg-black/50 p-4 pt-[12vh] backdrop-blur-sm",onMouseDown:e=>e.target===e.currentTarget&&N(!1),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Command palette",className:"w-full max-w-xl overflow-hidden rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-line px-3",children:[(0,t.jsx)(l.Search,{size:16,className:"text-mute","aria-hidden":!0}),(0,t.jsx)("input",{ref:A,value:E,role:"combobox","aria-expanded":"true","aria-controls":"palette-list","aria-activedescendant":P[C]?`palette-${P[C].id}`:void 0,onChange:e=>{S(e.target.value),T(0)},onKeyDown:e=>{"Escape"===e.key?N(!1):"ArrowDown"===e.key?(e.preventDefault(),T(e=>Math.min(P.length-1,e+1))):"ArrowUp"===e.key?(e.preventDefault(),T(e=>Math.max(0,e-1))):"Enter"===e.key&&(e.preventDefault(),P[C]?.run())},placeholder:"Go to a page, open a saved request, switch environment…",className:"min-w-0 flex-1 bg-transparent py-3 text-sm text-ink outline-none placeholder:text-mute"}),(0,t.jsx)("span",{className:"kbd",children:"Esc"})]}),(0,t.jsxs)("ul",{id:"palette-list",ref:q,role:"listbox","aria-label":"Commands",className:"max-h-[50vh] overflow-auto p-1",children:[0===P.length?(0,t.jsx)("li",{className:"px-3 py-6 text-center text-sm text-mute",children:"No matches."}):null,P.map((e,s)=>{let n=0===s||P[s-1].group!==e.group;return(0,t.jsxs)("li",{children:[n?(0,t.jsx)("div",{className:"px-2 pt-2 pb-1 text-[11px] font-medium tracking-wide text-mute uppercase",children:e.group}):null,(0,t.jsxs)("div",{id:`palette-${e.id}`,role:"option","aria-selected":s===C,"data-index":s,onMouseMove:()=>T(s),onClick:()=>e.run(),className:`flex cursor-pointer items-center justify-between gap-3 rounded-md px-2.5 py-2 text-sm ${s===C?"bg-accent-dim text-ink":"text-ink"}`,children:[(0,t.jsx)("span",{className:"min-w-0 truncate",children:e.label}),e.hint?(0,t.jsx)("span",{className:"shrink-0 font-mono text-xs text-mute",children:e.hint}):null]})]},e.id)})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 border-t border-line px-3 py-2 text-xs text-mute",children:[(0,t.jsx)(i.Command,{size:12,"aria-hidden":!0})," ",(0,t.jsx)("span",{className:"kbd",children:g}),"+",(0,t.jsx)("span",{className:"kbd",children:"K"})," anywhere · ↑↓ to move · Enter to run"]})]})}):null}},78739,8055,e=>{"use strict";var t=e.i(61666),s=e.i(17118),n=e.i(75117),a=e.i(80190),r=e.i(20621),i=e.i(27813),l=e.i(458),o=e.i(49913),c=e.i(42709),d=e.i(87283),u=e.i(83067),m=e.i(56396),h=e.i(20054),p=e.i(59180);let x="atc:about",f=[{href:"https://apitestcenter.com/docs/",label:"User guide — how everything works"},{href:"https://apitestcenter.com/whats-new.html",label:"What's new in each version"},{href:"https://apitestcenter.com",label:"apitestcenter.com"},{href:"https://apitestcenter.com/privacy.html",label:"Privacy"},{href:"mailto:support@apitestcenter.com",label:"Report a problem — support@apitestcenter.com"}];function g({status:e}){if(!e)return(0,t.jsx)("p",{className:"text-sm text-mute",children:"Updates are checked by the desktop app. This copy runs in a browser."});switch(e.state){case"unsupported":return(0,t.jsx)("p",{className:"text-sm text-mute",children:"store"===e.reason?"This copy comes from the Microsoft Store, which keeps it up to date.":"off"===e.reason?"Update checks are turned off on this computer (ATC_NO_UPDATE).":"This is a development build; it does not update itself."});case"idle":return(0,t.jsx)("p",{className:"text-sm text-mute",children:"Checks for a new version shortly after opening and every 6 hours."});case"checking":return(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-ink",children:[(0,t.jsx)(i.Loader2,{size:14,className:"animate-spin text-accent"})," Checking for a new version…"]});case"current":return(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-ink",children:[(0,t.jsx)(s.CheckCircle2,{size:14,className:"text-ok"})," You have the latest version."]});case"available":return(0,t.jsxs)("p",{className:"text-sm text-ink",children:["Version ",e.version," is available. Download it from apitestcenter.com — your tests and history stay as they are."]});case"downloading":return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-ink",children:[(0,t.jsx)(i.Loader2,{size:14,className:"animate-spin text-accent"})," Downloading version ",e.version,"… ",e.percent,"%"]}),(0,t.jsx)("div",{className:"h-1.5 overflow-hidden rounded bg-panel-2",children:(0,t.jsx)("div",{className:"h-full bg-accent",style:{width:`${e.percent}%`}})})]});case"ready":return(0,t.jsxs)("p",{className:"text-sm text-ink",children:["Version ",e.version," is ready. Restart to finish updating — or it updates the next time you close the app."]});case"error":return(0,t.jsxs)("p",{className:"flex items-start gap-2 text-sm text-ink",children:[(0,t.jsx)(c.TriangleAlert,{size:14,className:"mt-0.5 shrink-0 text-warn"})," ",e.message]})}}e.s(["AboutDialog",0,function(){let e=(0,m.useToast)(),{appVersion:s,k6Label:i,k6Ready:c,dataDir:b,online:w}=(0,h.useEngineHealth)(),[y,v]=(0,u.useState)(!1),[k,j]=(0,u.useState)(null),N=(0,u.useRef)(null),E=window.atcDesktop??null;if((0,u.useEffect)(()=>{let e=()=>v(!0);window.addEventListener(x,e);let t=E?.onUpdateStatus(j);return()=>{window.removeEventListener(x,e),t?.()}},[E]),(0,u.useEffect)(()=>{if(!y)return;E?.updateStatus().then(e=>e&&j(e)),window.setTimeout(()=>N.current?.focus(),0);let e=e=>"Escape"===e.key&&v(!1);return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[y,E]),!y)return null;let S=k?.state==="checking"||k?.state==="downloading",C=E&&k&&"unsupported"!==k.state&&"ready"!==k.state;return(0,t.jsx)("div",{className:"fixed inset-0 z-[75] flex items-start justify-center overflow-y-auto bg-black/50 p-4 sm:p-16",role:"presentation",onMouseDown:e=>e.target===e.currentTarget&&v(!1),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"about-title",className:"w-full max-w-lg rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-center gap-3 border-b border-line px-5 py-4",children:[(0,t.jsx)("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-accent-dim text-xs font-semibold tracking-wider text-accent","aria-hidden":!0,children:"ATC"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{id:"about-title",className:"text-base font-medium text-ink",children:"APITestCenter"}),(0,t.jsxs)("p",{className:"text-xs text-mute",children:["Version ",(0,t.jsx)("span",{className:"font-mono text-ink",children:s&&"dev"!==s?s:"development build"})," · ",w?c?i:"k6 not found":"engine starting…"]})]}),(0,t.jsx)("button",{ref:N,type:"button",onClick:()=>v(!1),"aria-label":"Close",className:"ml-auto self-start rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(d.X,{size:16})})]}),(0,t.jsxs)("section",{className:"space-y-3 border-b border-line px-5 py-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium tracking-wide text-mute uppercase",children:"Updates"}),(0,t.jsx)(g,{status:E?k:null}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[C?(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",disabled:S,onClick:async()=>{j({state:"checking",canInstall:!!k&&"canInstall"in k&&k.canInstall});let e=await E.checkForUpdates().catch(()=>null);e&&j(e)},children:[(0,t.jsx)(l.RefreshCw,{size:14,className:S?"animate-spin":""})," Check for updates"]}):null,k?.state==="ready"?(0,t.jsxs)("button",{type:"button",className:"btn btn-primary py-1.5 text-sm",onClick:()=>void E?.restartToUpdate(),children:[(0,t.jsx)(o.RotateCw,{size:14})," Restart and update"]}):null,k?.state==="available"||k?.state==="error"&&E?(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",onClick:()=>void E?.openDownloadPage(),children:[(0,t.jsx)(n.Download,{size:14})," Open the download page"]}):null]})]}),(0,t.jsxs)("section",{className:"space-y-2 border-b border-line px-5 py-4",children:[(0,t.jsx)("h3",{className:"text-xs font-medium tracking-wide text-mute uppercase",children:"Your files"}),(0,t.jsx)("p",{className:"text-sm text-mute",children:"Saved requests, environments, and history are plain files on this computer:"}),(0,t.jsx)("p",{className:"truncate rounded-md bg-panel-2 px-2 py-1.5 font-mono text-xs text-ink",title:b,children:b??(w?"…":"Waiting for the engine to start…")}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1.5 text-sm",disabled:!b,onClick:()=>p.historyApi.reveal().catch(t=>e(t instanceof Error?t.message:"Could not open the folder","error")),children:[(0,t.jsx)(r.FolderOpen,{size:14})," Open folder"]})]}),(0,t.jsxs)("section",{className:"px-5 py-4",children:[(0,t.jsx)("ul",{className:"space-y-1.5 text-sm",children:f.map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)("a",{href:e.href,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-accent hover:underline",children:[e.label," ",(0,t.jsx)(a.ExternalLink,{size:12,"aria-hidden":!0})]})},e.href))}),(0,t.jsx)("p",{className:"mt-3 text-xs text-mute",children:"© 2026 Ratul Roy. Free to use. Includes open-source software such as Grafana k6 (AGPL-3.0); the full list ships with the app as THIRD-PARTY-NOTICES.txt."})]})]})})},"openAbout",0,function(){window.dispatchEvent(new Event(x))}],78739);let b=(0,e.i(99522).default)("compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Compass",0,b],8055)},89142,5831,19286,e=>{"use strict";e.s(["GLOSSARY",0,[{group:"Reading results",term:"Response time",tech:"p95 latency",text:"How long requests took. “p95 200 ms” means 95 of every 100 requests finished within 200 ms. It is a better guide than the average, because people notice the slow ones."},{group:"Reading results",term:"Typical response time",tech:"p50 · median",text:"Half of the requests were faster than this, half slower."},{group:"Reading results",term:"Slowest responses",tech:"p99 · max",text:"p99: the slowest 1 in 100 requests took at least this long. Max: the single slowest one."},{group:"Reading results",term:"Requests per second",tech:"throughput · RPS",text:"How many requests the API answered each second. Higher is better, as long as response time stays reasonable."},{group:"Reading results",term:"Failed requests",tech:"error rate",text:"The share of requests that got no answer, or an error status (400 or higher)."},{group:"Reading results",term:"Requests not sent",tech:"dropped iterations",text:"In request-rate tests: requests that could not start on time because every simulated user was still waiting for an answer. A sign the API — or this computer — could not keep up."},{group:"Reading results",term:"User satisfaction score",tech:"Apdex",text:"From 0 to 1. Counts answers that were fast (within your response-time goal) and ones that were slow but bearable (within 4×). 1 means everyone would be happy."},{group:"Reading results",term:"Server time",tech:"TTFB · time to first byte",text:"From sending the request to the first byte of the answer — mostly your API doing its work. Connection times (TCP, TLS) are the network and this computer."},{group:"Reading results",term:"Result",tech:"verdict",text:"The app's plain summary of a run: looks healthy, usable with warnings, or failing. It explains each part underneath."},{group:"Reading results",term:"Reference run",tech:"baseline",text:"A run you choose to compare later runs of the same API against, to see if they got faster or slower. Pick one in a report or in History."},{group:"Setting up a test",term:"Simulated users",tech:"virtual users · VUs",text:"Pretend users. Each one sends a request, waits for the answer, maybe pauses, and sends the next. A slow API gets fewer requests."},{group:"Setting up a test",term:"Request rate",tech:"arrival rate",text:"Instead of users, hold a fixed number of requests per second whatever the API does. The honest way to find how much an API can take."},{group:"Setting up a test",term:"Presets",text:"Smoke: tiny, just checks it works. Average: a normal day. Stress: more than usual. Spike: a sudden burst. Soak: a long run that finds slow leaks."},{group:"Setting up a test",term:"Ramp up / step by step",tech:"stages",text:"Change the load over time — for example, go up to 50 users over a minute, stay there, then go down."},{group:"Setting up a test",term:"Pause between requests",tech:"think time",text:"How long each simulated user waits before sending the next request, like a person reading the page."},{group:"Setting up a test",term:"Checks",text:"Your rules for a correct answer, like “status is 200” or “has a name field”. A fast answer with an error inside fails a good check."},{group:"Setting up a test",term:"Goals",tech:"thresholds",text:"Pass/fail limits for the whole test, like “95% of requests within 500 ms” and “fewer than 1% failed”."},{group:"Setting up a test",term:"Environment",tech:"{{variables}}",text:"A named set of values such as a base URL or a token. Write {{name}} in a request and switch environments (Dev, UAT) without editing it."},{group:"Setting up a test",term:"Run first",tech:"request chaining",text:"Send another saved request first — usually signing in — and use values from its answer, like a token, in this request."},{group:"Setting up a test",term:"Test data",tech:"CSV",text:"A spreadsheet file whose columns become {{variables}}. Each request uses the next row, so a test can use many users or IDs."},{group:"Setting up a test",term:"Auth",tech:"authentication",text:"How the request proves who it is: a Bearer token, a username and password (Basic), or an API key."},{group:"About the app",term:"k6",text:"The open-source load-testing engine the app runs on this computer for load tests."},{group:"About the app",term:"Practice API",text:"A small pretend shop built into the app — products, sign-in, orders, a slow and a flaky endpoint — so you can learn without testing a real system."},{group:"About the app",term:"Where results are kept",text:"On this computer only, as plain files in your app-data folder. History shows them and lets you delete them."}]],89142);var t=e.i(61666),s=e.i(83067),n=e.i(65296);let a="atc:tour",r=[{target:"#request-url",title:"1. Where the request goes",body:"Type or paste a URL here — or a whole curl command copied from your browser. {{name}} takes a value from the chosen environment."},{target:"section[aria-label=Request] [role=tablist]",title:"2. What to send",body:"Add parameters, headers, sign-in (Auth), and a body. Checks are your rules for a correct answer; Run first and Test data feed in values."},{target:"[data-tour=send]",title:"3. Try it once",body:"Send one request and see the answer on the right. Always do this first, so you know it works before testing it under load."},{target:"[data-tour=run]",title:"4. Test it under load",body:"Run load test sends many requests at once with simulated users. Choose how many in the Load tab, and pass/fail limits in Goals."},{target:"section[aria-label=Results]",title:"5. Read the result",body:"Answers and load reports appear here. Every report is saved on this computer, and you can rearrange its charts with Customize."},{target:"a[href='/history']",title:"6. Look back",body:"History keeps every run. Mark one as your reference run to see whether later runs got faster or slower."},{target:"[data-tour=help]",title:"Any word unclear?",body:"Help explains every term in plain language, and can start this tour again."}];e.s(["Tour",0,function(){let[e,i]=(0,s.useState)(null),[l,o]=(0,s.useState)(null),c=(0,s.useRef)(null),d=(0,s.useRef)(null),u=(0,s.useCallback)(e=>{let t=document.querySelector(r[e].target);return t&&t.getBoundingClientRect().width>0?t:null},[]),m=(0,s.useCallback)((e,t)=>{for(let s=e;s>=0&&s<r.length;s+=t)if(u(s))return i(s);i(null)},[u]);if((0,s.useEffect)(()=>{let e=()=>m(0,1);return window.addEventListener(a,e),()=>window.removeEventListener(a,e)},[m]),(0,s.useLayoutEffect)(()=>{if(null===e)return;let t=()=>{let t=u(e);if(!t)return;t.scrollIntoView({block:"nearest",inline:"nearest"});let s=t.getBoundingClientRect();o({top:s.top-6,left:s.left-6,width:s.width+12,height:Math.min(s.height+12,window.innerHeight-24)})};return t(),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[e,u]),(0,s.useEffect)(()=>{if(null===e)return;d.current?.focus();let t=t=>{"Escape"===t.key&&i(null),"ArrowRight"===t.key&&m(e+1,1),"ArrowLeft"===t.key&&e>0&&m(e-1,-1)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,m]),null===e||!l||"u"<typeof document)return null;let h=r[e],p=!r.slice(e+1).some((t,s)=>u(e+1+s)),x=l.top+l.height+180<window.innerHeight?l.top+l.height+10:Math.max(12,l.top-10-(c.current?.offsetHeight??170)),f=Math.min(Math.max(12,l.left),window.innerWidth-320-12);return(0,n.createPortal)((0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none fixed z-[80] rounded-lg ring-2 ring-accent transition-all duration-200",style:{...l,boxShadow:"0 0 0 9999px rgb(0 0 0 / 0.55)"}}),(0,t.jsxs)("div",{ref:c,role:"dialog","aria-modal":"false","aria-labelledby":"tour-title",className:"fixed z-[81] rounded-lg border border-line bg-panel p-4 shadow-2xl",style:{top:x,left:f,width:320},children:[(0,t.jsx)("h2",{id:"tour-title",className:"text-sm font-medium text-ink",children:h.title}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-mute",children:h.body}),(0,t.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"text-xs text-mute",children:[e+1," of ",r.length]}),(0,t.jsx)("button",{type:"button",onClick:()=>i(null),className:"ml-auto rounded-md px-2 py-1 text-xs text-mute hover:text-ink",children:"Skip tour"}),e>0?(0,t.jsx)("button",{type:"button",onClick:()=>m(e-1,-1),className:"rounded-md border border-line px-2.5 py-1 text-xs text-ink hover:border-accent",children:"Back"}):null,(0,t.jsx)("button",{ref:d,type:"button",onClick:()=>p?i(null):m(e+1,1),className:"btn btn-primary px-3 py-1 text-xs",children:p?"Done":"Next"})]})]})]}),document.body)},"startTour",0,function(){window.dispatchEvent(new Event(a))}],5831);let i=(0,e.i(99522).default)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);e.s(["KeyRound",0,i],19286)},7641,45672,51554,e=>{"use strict";var t=e.i(61666),s=e.i(8055),n=e.i(88293),a=e.i(87283),r=e.i(46443),i=e.i(83067),l=e.i(89142),o=e.i(5831),c=e.i(19286),d=e.i(50962);let u="apitestcenter-welcome",m="atc:welcome";function h(e){try{e?localStorage.setItem(u,"hidden"):localStorage.removeItem(u)}catch{}window.dispatchEvent(new Event(m))}function p({icon:e,title:s,text:n,onClick:a,disabled:r}){return(0,t.jsxs)("button",{type:"button",onClick:a,disabled:r,className:"flex flex-col items-start gap-1.5 rounded-lg border border-line bg-panel-2 px-4 py-3 text-left hover:border-accent disabled:opacity-50 disabled:hover:border-line",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm font-medium text-ink",children:[(0,t.jsx)("span",{className:"text-accent",children:e}),s]}),(0,t.jsx)("span",{className:"text-xs text-mute",children:n})]})}e.s(["WELCOME_EVENT",0,m,"WelcomeCard",0,function({practiceReady:e,onSimple:n,onSignIn:r,onHide:i}){return(0,t.jsxs)("div",{className:"relative flex flex-1 flex-col justify-center rounded-lg border border-line bg-panel px-6 py-8",children:[(0,t.jsx)("button",{type:"button",onClick:i,className:"absolute top-3 right-3 rounded p-1 text-mute hover:text-ink","aria-label":"Hide the getting-started guide",title:"Hide (bring it back from Help)",children:(0,t.jsx)(a.X,{size:15})}),(0,t.jsx)("h2",{className:"text-lg font-medium text-ink",children:"New here? Start with something safe to test"}),(0,t.jsx)("p",{className:"mt-1 max-w-xl text-sm text-mute",children:"The app has a small practice shop API built in. Nothing leaves this computer, so you can send requests and run load tests without worrying about a real system."}),(0,t.jsxs)("div",{className:"mt-5 grid gap-3",children:[(0,t.jsx)(p,{icon:(0,t.jsx)(d.Send,{size:16,"aria-hidden":!0}),title:"Try a simple request",text:"Fill in a request for the product list, with a check that the answer is right. Then press Send.",disabled:!e,onClick:n}),(0,t.jsx)(p,{icon:(0,t.jsx)(c.KeyRound,{size:16,"aria-hidden":!0}),title:"Try a sign-in example",text:"Adds two requests to Saved requests → Practice: Sign in, and My orders, which signs in first and uses the token.",disabled:!e,onClick:r}),(0,t.jsx)(p,{icon:(0,t.jsx)(s.Compass,{size:16,"aria-hidden":!0}),title:"Take the 1-minute tour",text:"See where to type, how to try a request once, then test it under load.",onClick:o.startTour})]}),e?null:(0,t.jsx)("p",{className:"mt-3 text-xs text-warn",children:"The practice API starts with the engine — it is offline right now."}),(0,t.jsx)("p",{className:"mt-5 text-xs text-mute",children:"Have your own API? Paste its URL — or a curl command from your browser's DevTools — into the bar above."})]})},"setWelcomeHidden",0,h,"welcomeHidden",0,function(){try{return"hidden"===localStorage.getItem(u)}catch{return!1}}],45672);var x=e.i(78739);let f=(0,e.i(99522).default)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]),g=()=>fetch("/engine/settings/usage",{cache:"no-store"}).then(e=>e.ok?e.json():null),b=e=>fetch("/engine/settings/usage",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:e})}).then(e=>e.json());function w(){let[e,s]=(0,i.useState)(null),[n,a]=(0,i.useState)(!1);return((0,i.useEffect)(()=>{g().then(s).catch(()=>void 0)},[]),e)?(0,t.jsxs)("section",{className:"space-y-2 rounded-lg border border-line px-3 py-2.5",children:[(0,t.jsxs)("label",{className:"flex items-center justify-between gap-3 text-sm text-ink",children:[(0,t.jsxs)("span",{children:["Share anonymous usage counts",(0,t.jsx)("span",{className:"block text-xs text-mute",children:e.available?"Once a day: counts, app version, OS. Never URLs or results.":"Only the desktop app can send these; this window never does."})]}),(0,t.jsx)("input",{type:"checkbox",disabled:!e.available,checked:!0===e.enabled,onChange:e=>void b(e.target.checked).then(s),className:"h-4 w-4 accent-[var(--accent)]"})]}),(0,t.jsxs)("button",{type:"button",className:"text-xs text-accent hover:underline",onClick:()=>a(e=>!e),children:[n?"Hide":"Show"," exactly what would be sent"]}),n?(0,t.jsx)("pre",{className:"max-h-40 overflow-auto rounded-md bg-panel-2 p-2 font-mono text-[11px] text-mute",children:JSON.stringify(e.next,null,2)}):null]}):null}e.s(["UsageConsent",0,function(){let[e,s]=(0,i.useState)(null),[n,l]=(0,i.useState)(!1),[o,c]=(0,i.useState)(!1),d=(0,r.usePathname)();async function u(t){l(!1),s(await b(t).catch(()=>e))}return((0,i.useEffect)(()=>{let e=!1;return g().then(t=>{!e&&t&&(s(t),l(t.available&&null===t.enabled&&t.used))}).catch(()=>void 0),()=>{e=!0}},[d]),n&&e)?(0,t.jsxs)("aside",{role:"dialog","aria-labelledby":"usage-title",className:"fixed right-4 bottom-4 z-[60] w-[min(380px,calc(100vw-2rem))] rounded-xl border border-line bg-panel p-4 shadow-2xl",children:[(0,t.jsx)("button",{type:"button",onClick:()=>void u(!1),className:"absolute top-3 right-3 rounded p-1 text-mute hover:text-ink","aria-label":"No thanks",children:(0,t.jsx)(a.X,{size:14})}),(0,t.jsxs)("h2",{id:"usage-title",className:"flex items-center gap-2 pr-6 text-sm font-medium text-ink",children:[(0,t.jsx)(f,{size:16,className:"text-accent","aria-hidden":!0})," Help improve APITestCenter?"]}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-mute",children:["Share ",(0,t.jsx)("span",{className:"text-ink",children:"anonymous counts"})," once a day — how many requests and load tests you ran, the app version, and your operating system. ",(0,t.jsx)("span",{className:"text-ink",children:"Never"})," URLs, results, or anything you type."]}),o?(0,t.jsx)("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-panel-2 p-2 font-mono text-[11px] text-mute",children:JSON.stringify(e.next,null,2)}):(0,t.jsx)("button",{type:"button",onClick:()=>c(!0),className:"mt-1 text-xs text-accent hover:underline",children:"See exactly what would be sent"}),(0,t.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>void u(!0),className:"btn btn-primary py-1.5 text-xs",children:"Yes, share counts"}),(0,t.jsx)("button",{type:"button",onClick:()=>void u(!1),className:"rounded-md px-3 py-1.5 text-xs text-mute hover:text-ink",children:"No thanks"})]}),(0,t.jsx)("p",{className:"mt-2 text-[11px] text-mute",children:"You can change this any time in Help."})]}):null},"UsageSetting",0,w],51554);let y="atc:help";e.s(["HelpPanel",0,function(){let[e,c]=(0,i.useState)(!1),[d,u]=(0,i.useState)(""),m=(0,i.useRef)(null),p=(0,i.useRef)(null),f=(0,r.usePathname)(),g=(0,r.useRouter)();function b(){c(!1),p.current?.focus()}(0,i.useEffect)(()=>{let e=()=>{p.current=document.activeElement,c(!0)};return window.addEventListener(y,e),()=>window.removeEventListener(y,e)},[]),(0,i.useEffect)(()=>{if(!e)return;window.setTimeout(()=>m.current?.focus(),0);let t=e=>"Escape"===e.key&&b();return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]);let v=(0,i.useMemo)(()=>{let e=d.trim().toLowerCase(),t=l.GLOSSARY.filter(t=>!e||`${t.term} ${t.tech??""} ${t.text}`.toLowerCase().includes(e)),s=new Map;for(let e of t)s.set(e.group,[...s.get(e.group)??[],e]);return[...s]},[d]);return e?(0,t.jsxs)("div",{className:"fixed inset-0 z-[75] flex justify-end",children:[(0,t.jsx)("button",{type:"button","aria-label":"Close help",className:"absolute inset-0 bg-black/40",onClick:b}),(0,t.jsxs)("aside",{role:"dialog","aria-modal":"true","aria-labelledby":"help-title",className:"relative flex h-full w-full max-w-md flex-col border-l border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-center gap-2 border-b border-line px-5 py-4",children:[(0,t.jsx)("h2",{id:"help-title",className:"text-base font-medium text-ink",children:"Help"}),(0,t.jsx)("button",{type:"button",onClick:b,"aria-label":"Close",className:"ml-auto rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(a.X,{size:16})})]}),(0,t.jsxs)("div",{className:"space-y-3 border-b border-line px-5 py-4",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{c(!1),"/"!==f&&g.push("/"),window.setTimeout(o.startTour,"/"===f?50:900)},className:"flex w-full items-center gap-3 rounded-lg border border-line px-3 py-2.5 text-left hover:border-accent",children:[(0,t.jsx)(s.Compass,{size:18,className:"text-accent","aria-hidden":!0}),(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"block text-sm text-ink",children:"Take the 1-minute tour"}),(0,t.jsx)("span",{className:"block text-xs text-mute",children:"Where to type, how to test once, then under load"})]})]}),(0,t.jsx)("button",{type:"button",onClick:()=>{h(!1),c(!1),"/"!==f&&g.push("/")},className:"text-xs text-accent hover:underline",children:"Show the getting-started guide on Test API again"}),(0,t.jsx)(w,{}),(0,t.jsx)("button",{type:"button",onClick:()=>{c(!1),(0,x.openAbout)()},className:"text-left text-xs text-accent hover:underline",children:"About APITestCenter — version, updates, your files"}),(0,t.jsx)("a",{href:"https://apitestcenter.com/docs/",target:"_blank",rel:"noreferrer",className:"block text-xs text-accent hover:underline",children:"User guide — every feature explained, at apitestcenter.com/docs"}),(0,t.jsxs)("label",{className:"relative block",children:[(0,t.jsx)("span",{className:"sr-only",children:"Search words"}),(0,t.jsx)(n.Search,{size:14,className:"pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-mute","aria-hidden":!0}),(0,t.jsx)("input",{ref:m,value:d,onChange:e=>u(e.target.value),placeholder:"What does … mean?",className:"input py-1.5 pl-8"})]})]}),(0,t.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 py-4",children:[0===v.length?(0,t.jsxs)("p",{className:"text-sm text-mute",children:["No word matches “",d,"”."]}):null,v.map(([e,s])=>(0,t.jsxs)("section",{className:"mb-6",children:[(0,t.jsx)("h3",{className:"mb-2 text-xs font-medium tracking-wide text-mute uppercase",children:e}),(0,t.jsx)("dl",{className:"space-y-3",children:s.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("dt",{className:"text-sm font-medium text-ink",children:[e.term,e.tech?(0,t.jsx)("span",{className:"ml-2 text-xs font-normal text-mute",children:e.tech}):null]}),(0,t.jsx)("dd",{className:"mt-0.5 text-sm text-mute",children:e.text})]},e.term))})]},e))]})]})]}):null},"openHelp",0,function(){window.dispatchEvent(new Event(y))}],7641)},67217,e=>{"use strict";e.s(["ImportDialog",()=>f,"openImport",()=>h]);var t=e.i(61666);e.i(24856);var s=e.i(90372),n=e.i(67938),a=e.i(27813),r=e.i(42709),i=e.i(87283),l=e.i(46443),o=e.i(83067),c=e.i(69578),d=e.i(56396),u=e.i(6278);let m="atc:import";function h(){window.dispatchEvent(new Event(m))}let p={postman:"Postman collection","postman-environment":"Postman environment",openapi:"OpenAPI",swagger:"Swagger 2.0"},x={GET:"text-ok",POST:"text-warn",PUT:"text-accent",PATCH:"text-accent",DELETE:"text-bad"};function f(){let[e,h]=(0,o.useState)(!1),[f,g]=(0,o.useState)(null),[b,w]=(0,o.useState)(""),[y,v]=(0,o.useState)(""),[k,j]=(0,o.useState)(null),[N,E]=(0,o.useState)(!1),[S,C]=(0,o.useState)(""),[T,A]=(0,o.useState)(!1),q=(0,o.useRef)(null),L=(0,o.useRef)(null),{refresh:P,index:R}=(0,u.useWorkspace)(),I=(0,d.useToast)(),M=(0,l.useRouter)(),O=(0,l.usePathname)();function H(e,t){j(null);try{let n=(0,s.importFile)(e,t);g(n),w(t),v(n.title.slice(0,60))}catch(e){g(null),j(e instanceof Error?e.message:"Could not read that file")}}async function $(e){if(e.size>0x1400000)return j(`${e.name} is larger than 20 MB`);H(await e.text(),e.name)}(0,o.useEffect)(()=>{let e=()=>{h(!0),g(null),j(null),E(!1),C("")};return window.addEventListener(m,e),()=>window.removeEventListener(m,e)},[]),(0,o.useEffect)(()=>{if(!e)return;L.current?.focus();let t=e=>"Escape"===e.key&&!T&&h(!1);return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,T]);let z=(0,o.useMemo)(()=>{if(!f)return 0;let e=y.trim().toLowerCase();return(R?.requests??[]).filter(t=>t.collection.toLowerCase()===e).length},[R,f,y]);async function U(){if(f){A(!0);try{let e=y.trim()||f.title,t=await u.workspaceApi.importAll({requests:f.requests.map(t=>({collection:e,name:t.name.slice(0,200),request:t.request})),environments:f.environments});await P(),h(!1);let s=t.environments.added||t.environments.merged?` and ${t.environments.added+t.environments.merged} environment${t.environments.added+t.environments.merged===1?"":"s"}`:"";I(`Imported ${t.requests} request${1===t.requests?"":"s"}${s} — pick the environment next to the URL`,"success"),t.firstId&&(sessionStorage.setItem(c.OPEN_REQUEST_KEY,t.firstId),"/"===O?window.dispatchEvent(new Event(c.OPEN_REQUEST_EVENT)):M.push("/"))}catch(e){j(e instanceof Error?e.message:"Import failed")}finally{A(!1)}}}return e?(0,t.jsx)("div",{className:"fixed inset-0 z-[75] flex items-start justify-center overflow-y-auto bg-black/50 p-4 sm:p-10",role:"presentation",onMouseDown:e=>e.target===e.currentTarget&&!T&&h(!1),children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"import-title",className:"w-full max-w-2xl rounded-xl border border-line bg-panel shadow-2xl",children:[(0,t.jsxs)("header",{className:"flex items-center gap-2 border-b border-line px-5 py-4",children:[(0,t.jsx)("h2",{id:"import-title",className:"text-base font-medium text-ink",children:"Import requests"}),(0,t.jsx)("button",{ref:L,type:"button",onClick:()=>h(!1),disabled:T,"aria-label":"Close",className:"ml-auto rounded p-1 text-mute hover:text-ink",children:(0,t.jsx)(i.X,{size:16})})]}),(0,t.jsxs)("div",{className:"space-y-4 px-5 py-4",children:[(0,t.jsxs)("p",{className:"text-sm text-mute",children:["From a ",(0,t.jsx)("span",{className:"text-ink",children:"Postman"})," collection or environment (v2.1 export), or an ",(0,t.jsx)("span",{className:"text-ink",children:"OpenAPI 3"})," / ",(0,t.jsx)("span",{className:"text-ink",children:"Swagger 2"})," file in JSON or YAML. Your current requests are not changed."]}),(0,t.jsx)("input",{ref:q,type:"file",accept:".json,.yaml,.yml,application/json,text/yaml",className:"sr-only","aria-label":"Choose a file to import",onChange:e=>{let t=e.target.files?.[0];e.target.value="",t&&$(t)}}),f||N?null:(0,t.jsxs)("button",{type:"button",onClick:()=>q.current?.click(),onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault();let t=e.dataTransfer.files[0];t&&$(t)},className:"flex w-full flex-col items-center gap-1 rounded-lg border border-dashed border-line px-4 py-8 text-sm text-mute hover:border-accent hover:text-ink",children:[(0,t.jsx)(n.FileUp,{size:20,"aria-hidden":!0}),(0,t.jsx)("span",{className:"text-ink",children:"Choose a file"}),(0,t.jsx)("span",{className:"text-xs",children:"or drop it here · .json, .yaml, .yml"})]}),f?null:N?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("textarea",{value:S,onChange:e=>C(e.target.value),rows:8,placeholder:"Paste the JSON or YAML here","aria-label":"Paste a file's contents",className:"input w-full font-mono text-xs"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("button",{type:"button",className:"btn btn-primary py-1.5 text-xs",disabled:!S.trim(),onClick:()=>H(S,"pasted"),children:"Read it"}),(0,t.jsx)("button",{type:"button",className:"rounded-md px-2 py-1.5 text-xs text-mute hover:text-ink",onClick:()=>E(!1),children:"Back"})]})]}):(0,t.jsx)("button",{type:"button",className:"text-xs text-accent hover:underline",onClick:()=>E(!0),children:"Or paste it instead"}),f?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"rounded-full border border-line px-2 py-0.5 text-xs text-mute",children:p[f.kind]}),(0,t.jsx)("span",{className:"font-medium text-ink",children:f.title}),(0,t.jsxs)("span",{className:"text-mute",children:["from ",b]}),(0,t.jsx)("button",{type:"button",className:"ml-auto text-xs text-accent hover:underline",onClick:()=>g(null),children:"Choose another file"})]}),f.requests.length?(0,t.jsxs)("label",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"text-mute",children:"Put the requests in collection"}),(0,t.jsx)("input",{value:y,onChange:e=>v(e.target.value.slice(0,60)),className:"input w-56 py-1","aria-label":"Collection name"}),z?(0,t.jsxs)("span",{className:"text-xs text-warn",children:[z," request",1===z?"":"s"," already in it — they are kept, new ones are added"]}):null]}):null,(0,t.jsxs)("ul",{className:"max-h-64 space-y-0.5 overflow-y-auto rounded-md border border-line p-2 text-sm",children:[f.requests.slice(0,300).map((e,s)=>(0,t.jsxs)("li",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)("span",{className:`w-14 shrink-0 font-mono text-xs ${x[e.request.method]??"text-mute"}`,children:e.request.method}),(0,t.jsx)("span",{className:"truncate text-ink",children:e.name})]},s)),f.requests.length>300?(0,t.jsxs)("li",{className:"text-xs text-mute",children:["…and ",f.requests.length-300," more"]}):null,f.environments.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)("span",{className:"w-14 shrink-0 text-xs text-mute",children:"ENV"}),(0,t.jsx)("span",{className:"truncate text-ink",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-mute",children:["· ",e.variables.length," variable",1===e.variables.length?"":"s",e.variables.some(e=>e.secret)?", secrets encrypted":""]})]},e.name))]}),f.warnings.length?(0,t.jsxs)("div",{className:"rounded-md border border-warn/40 bg-warn/5 px-3 py-2 text-xs text-warn",children:[(0,t.jsxs)("p",{className:"mb-1 flex items-center gap-1.5 font-medium",children:[(0,t.jsx)(r.TriangleAlert,{size:13,"aria-hidden":!0})," ",f.warnings.length," thing",1===f.warnings.length?"":"s"," to know"]}),(0,t.jsxs)("ul",{className:"list-disc space-y-0.5 pl-5",children:[f.warnings.slice(0,12).map(e=>(0,t.jsx)("li",{children:e},e)),f.warnings.length>12?(0,t.jsxs)("li",{children:["…and ",f.warnings.length-12," more"]}):null]})]}):null]}):null,k?(0,t.jsx)("p",{role:"alert",className:"text-sm text-bad",children:k}):null]}),(0,t.jsxs)("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[(0,t.jsx)("button",{type:"button",className:"rounded-md px-3 py-1.5 text-sm text-mute hover:text-ink",disabled:T,onClick:()=>h(!1),children:"Cancel"}),(0,t.jsxs)("button",{type:"button",className:"btn btn-primary",disabled:!f||T||!f.requests.length&&!f.environments.length,onClick:()=>void U(),children:[T?(0,t.jsx)(a.Loader2,{size:16,className:"animate-spin"}):null,f?`Import ${[f.requests.length?`${f.requests.length} request${1===f.requests.length?"":"s"}`:"",f.environments.length?`${f.environments.length} environment${1===f.environments.length?"":"s"}`:""].filter(Boolean).join(" and ")}`:"Import"]})]})]})}):null}},6278,20054,e=>{"use strict";var t=e.i(61666);e.i(24856);var s=e.i(78451),n=e.i(83067);let a={checked:!1,online:!1,k6Ready:!1,k6Label:"Checking engine…"},r=(0,n.createContext)(a);function i(){return(0,n.useContext)(r)}async function l(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Engine error (${e.status})`);return t}e.s(["EngineHealthProvider",0,function({children:e}){let[s,i]=(0,n.useState)(a);return(0,n.useEffect)(()=>{let e=!1,t=async()=>{try{var t;let s,n=await fetch("/engine/health",{cache:"no-store"});if(!n.ok)throw Error(String(n.status));let a=await n.json();if(e)return;let r=!!a.k6?.available;i({checked:!0,online:"ok"===a.status,k6Ready:r,k6Label:r?(t=a.k6?.version,(s=t?.match(/v?\d+\.\d+\.\d+/))?`k6 ${s[0].startsWith("v")?s[0]:`v${s[0]}`}`:"k6 ready"):a.k6?.reason??"k6 not found",demoApi:a.demoApi,appVersion:a.version,dataDir:a.dataDir})}catch{e||i({checked:!0,online:!1,k6Ready:!1,k6Label:"Engine offline"})}};t();let s=window.setInterval(()=>void t(),8e3),n=()=>void t();return window.addEventListener("focus",n),()=>{e=!0,window.clearInterval(s),window.removeEventListener("focus",n)}},[]),(0,t.jsx)(r.Provider,{value:s,children:e})},"useEngineHealth",0,i],20054);let o=(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)}),c={index:()=>fetch("/engine/workspace",{cache:"no-store"}).then(e=>l(e)),get:e=>fetch(`/engine/workspace/requests/${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>l(e)),create:e=>o("POST","/engine/workspace/requests",e).then(e=>l(e)),update:(e,t)=>o("PUT",`/engine/workspace/requests/${encodeURIComponent(e)}`,t).then(e=>l(e)),remove:e=>o("DELETE",`/engine/workspace/requests/${encodeURIComponent(e)}`).then(e=>l(e)),importAll:e=>o("POST","/engine/workspace/import",e).then(e=>l(e)),saveEnvironments:e=>o("PUT","/engine/workspace/environments",e).then(e=>l(e))},d=(0,n.createContext)({index:null,refresh:async()=>{},environments:[],activeEnv:null,setActiveEnv:()=>{},vars:{},saveEnvironments:async()=>{},savedValues:{},rememberValues:()=>{},clearSavedValues:()=>{}}),u="apitestcenter-active-env",m="apitestcenter-saved-values";e.s(["WorkspaceProvider",0,function({children:e}){let[a,r]=(0,n.useState)(null),[l,o]=(0,n.useState)(null),[h,p]=(0,n.useState)({}),x=(0,n.useCallback)(async()=>{try{r(await c.index())}catch{}},[]);(0,n.useEffect)(()=>{try{o(localStorage.getItem(u))}catch{}try{let e=sessionStorage.getItem(m);e&&p(JSON.parse(e))}catch{}x();let e=()=>void x();return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[x]);let f=(0,n.useCallback)(e=>{o(e);try{e?localStorage.setItem(u,e):localStorage.removeItem(u)}catch{}},[]),g=(0,n.useCallback)(async e=>{await c.saveEnvironments(e),await x()},[x]),b=(0,n.useCallback)(e=>{p(e);try{Object.keys(e).length?sessionStorage.setItem(m,JSON.stringify(e)):sessionStorage.removeItem(m)}catch{}},[]),w=(0,n.useCallback)((e,t)=>{e.length&&p(s=>{let n={...s};for(let s of e)n[s.name]={value:s.value,from:t};try{sessionStorage.setItem(m,JSON.stringify(n))}catch{}return n})},[]),y=(0,n.useCallback)(()=>b({}),[b]),{demoApi:v}=i(),k=(0,n.useMemo)(()=>{let e=a?.environments??[],t=e.find(e=>e.id===l)??null,n=v?{practiceApi:v}:{},r=Object.fromEntries(Object.entries(h).map(([e,t])=>[e,t.value]));return{index:a,refresh:x,environments:e,activeEnv:t,setActiveEnv:f,vars:{...n,...(0,s.variablesOf)(t),...r},saveEnvironments:g,savedValues:h,rememberValues:w,clearSavedValues:y}},[a,l,x,f,g,v,h,w,y]);return(0,t.jsx)(d.Provider,{value:k,children:e})},"useWorkspace",0,function(){return(0,n.useContext)(d)},"workspaceApi",0,c],6278)},86856,e=>{"use strict";let t=(0,e.i(99522).default)("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);e.s(["Command",0,t],86856)},80190,e=>{"use strict";let t=(0,e.i(99522).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],80190)},20621,e=>{"use strict";let t=(0,e.i(99522).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",0,t],20621)},458,49913,e=>{"use strict";var t=e.i(99522);let s=(0,t.default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,s],458);let n=(0,t.default)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);e.s(["RotateCw",0,n],49913)},88293,e=>{"use strict";let t=(0,e.i(99522).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",0,t],88293)},50962,e=>{"use strict";let t=(0,e.i(99522).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["Send",0,t],50962)},42709,e=>{"use strict";var t=e.i(30844);e.s(["TriangleAlert",()=>t.default])},48317,e=>{"use strict";var t=e.i(83067),s=(e,t,s,n,a,r,i,l)=>{let o=document.documentElement,c=["light","dark"];function d(t){var s;(Array.isArray(e)?e:[e]).forEach(e=>{let s="class"===e,n=s&&r?a.map(e=>r[e]||e):a;s?(o.classList.remove(...n),o.classList.add(r&&r[t]?r[t]:t)):o.setAttribute(e,t)}),s=t,l&&c.includes(s)&&(o.style.colorScheme=s)}if(n)d(n);else try{let e=localStorage.getItem(t)||s,n=i&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;d(n)}catch(e){}},n=["light","dark"],a="(prefers-color-scheme: dark)",r="u"<typeof window,i=t.createContext(void 0),l={setTheme:e=>{},themes:[]},o=["light","dark"],c=({forcedTheme:e,disableTransitionOnChange:s=!1,enableSystem:r=!0,enableColorScheme:l=!0,storageKey:c="theme",themes:p=o,defaultTheme:x=r?"system":"light",attribute:f="data-theme",value:g,children:b,nonce:w,scriptProps:y})=>{let[v,k]=t.useState(()=>u(c,x)),[j,N]=t.useState(()=>"system"===v?h():v),E=g?Object.values(g):p,S=t.useCallback(e=>{let t=e;if(!t)return;"system"===e&&r&&(t=h());let a=g?g[t]:t,i=s?m(w):null,o=document.documentElement,c=e=>{"class"===e?(o.classList.remove(...E),a&&o.classList.add(a)):e.startsWith("data-")&&(a?o.setAttribute(e,a):o.removeAttribute(e))};if(Array.isArray(f)?f.forEach(c):c(f),l){let e=n.includes(x)?x:null,s=n.includes(t)?t:e;o.style.colorScheme=s}null==i||i()},[w]),C=t.useCallback(e=>{let t="function"==typeof e?e(v):e;k(t);try{localStorage.setItem(c,t)}catch(e){}},[v]),T=t.useCallback(t=>{N(h(t)),"system"===v&&r&&!e&&S("system")},[v,e]);t.useEffect(()=>{let e=window.matchMedia(a);return e.addListener(T),T(e),()=>e.removeListener(T)},[T]),t.useEffect(()=>{let e=e=>{e.key===c&&(e.newValue?k(e.newValue):C(x))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[C]),t.useEffect(()=>{S(null!=e?e:v)},[e,v]);let A=t.useMemo(()=>({theme:v,setTheme:C,forcedTheme:e,resolvedTheme:"system"===v?j:v,themes:r?[...p,"system"]:p,systemTheme:r?j:void 0}),[v,C,e,j,r,p]);return t.createElement(i.Provider,{value:A},t.createElement(d,{forcedTheme:e,storageKey:c,attribute:f,enableSystem:r,enableColorScheme:l,defaultTheme:x,value:g,themes:p,nonce:w,scriptProps:y}),b)},d=t.memo(({forcedTheme:e,storageKey:n,attribute:a,enableSystem:r,enableColorScheme:i,defaultTheme:l,value:o,themes:c,nonce:d,scriptProps:u})=>{let m=JSON.stringify([a,n,l,e,c,o,r,i]).slice(1,-1);return t.createElement("script",{...u,suppressHydrationWarning:!0,nonce:"u"<typeof window?d:"",dangerouslySetInnerHTML:{__html:`(${s.toString()})(${m})`}})}),u=(e,t)=>{let s;if(!r){try{s=localStorage.getItem(e)||void 0}catch(e){}return s||t}},m=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},h=e=>(e||(e=window.matchMedia(a)),e.matches?"dark":"light");e.s(["ThemeProvider",0,e=>t.useContext(i)?t.createElement(t.Fragment,null,e.children):t.createElement(c,{...e}),"useTheme",0,()=>{var e;return null!=(e=t.useContext(i))?e:l}])},46443,(e,t,s)=>{t.exports=e.r(42512)}]);
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93639,e=>{"use strict";var t=e.i(61666);function s(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 a(e){let t=s(e.steps);return t.passed>0&&0===t.failed&&0===t.errors}function n(e){let t=s(e.steps),a=t.total-t.skipped;if("running"===e.status)return`Running ${t.passed+t.failed+t.errors+1} of ${a}…`;if(!a)return"Nothing ran";let n=[`${t.passed} of ${a} 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(" · ")}e.i(24856);let r=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),i=e=>((e??0)/1e3).toFixed(3),l=e=>String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),o={passed:"Passed",failed:"Failed",error:"Could not run",skipped:"Skipped",pending:"Not run",running:"Not finished"};var d=e.i(53012),c=e.i(99522);let u=(0,c.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),p=(0,c.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);var m=e.i(17118),h=e.i(95486),x=e.i(60961);let f=(0,c.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var b=e.i(75117);let g=(0,c.default)("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 v=e.i(29091),k=e.i(27813);let y=(0,c.default)("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),j=e.i(27122),N=e.i(46443),S=e.i(83067),C=e.i(69578),q=e.i(56396);function z({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 M=e.i(17219);async function A(e,t){var s;let a,n=await fetch(`/engine/suites/export?collection=${encodeURIComponent(e)}`,{cache:"no-store"}),r=await n.json().catch(()=>null);if(!n.ok||!r?.files)throw Error(r?.error??`Engine error (${n.status})`);let i=r.secrets??[],l={};for(let e of r.files)l[`api-tests/${e.path}`]=e.text;l["api-tests/README.md"]=function(e){let{collection:t,environment:s,secrets:a=[],data:n="api-tests"}=e,r=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
|
-
${z(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}${r} --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:i}),l[".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
|
-
|
|
33
|
-
jobs:
|
|
34
|
-
api-checks:
|
|
35
|
-
runs-on: ubuntu-latest
|
|
36
|
-
steps:
|
|
37
|
-
- uses: actions/checkout@v4
|
|
38
|
-
|
|
39
|
-
- uses: actions/setup-node@v4
|
|
40
|
-
with:
|
|
41
|
-
node-version: 22
|
|
42
|
-
|
|
43
|
-
# Fails the job when any request fails. Secrets: add --var name=\${{ secrets.NAME }}
|
|
44
|
-
- name: Check every request
|
|
45
|
-
run: ${z(s)}
|
|
46
|
-
|
|
47
|
-
- name: Keep the results
|
|
48
|
-
if: always()
|
|
49
|
-
uses: actions/upload-artifact@v4
|
|
50
|
-
with:
|
|
51
|
-
name: api-check-results
|
|
52
|
-
path: atc-results.xml
|
|
53
|
-
`);let o=(e||"requests").replace(/[^\w.-]+/g,"-").replace(/^-|-$/g,"")||"requests";return{blob:(0,M.zipStore)(l),name:`${o}-for-ci.zip`,secrets:i}}var P=e.i(15060),R=e.i(14168),T=e.i(6278);let E={GET:"text-ok",POST:"text-warn",PUT:"text-accent",PATCH:"text-accent",DELETE:"text-bad"},I="apitestcenter-suite-stop-on-fail";function U({state:e}){return"passed"===e?(0,t.jsx)(m.CheckCircle2,{size:16,className:"text-ok","aria-label":"Passed"}):"failed"===e?(0,t.jsx)(j.XCircle,{size:16,className:"text-bad","aria-label":"Failed"}):"error"===e?(0,t.jsx)(d.AlertTriangle,{size:16,className:"text-bad","aria-label":"Could not run"}):"skipped"===e?(0,t.jsx)(y,{size:16,className:"text-mute","aria-label":"Skipped"}):"running"===e?(0,t.jsx)(k.Loader2,{size:16,className:"animate-spin text-accent","aria-label":"Running"}):(0,t.jsx)(f,{size:16,className:"text-line","aria-label":"Not run yet"})}let O=e=>`${(e.collection||"requests").replace(/[^\w.-]+/g,"-")}-${e.startedAt.slice(0,16).replace(/[:T]/g,"-")}`;e.s(["SuitePage",0,function(){let e=(0,N.useRouter)(),d=(0,N.useSearchParams)(),c=(0,q.useToast)(),{index:f,environments:y,activeEnv:z,setActiveEnv:M}=(0,T.useWorkspace)(),L=(0,S.useMemo)(()=>f?.requests??[],[f]),F=(0,S.useMemo)(()=>[...new Set(L.map(e=>e.collection))].sort((e,t)=>""===e?1:""===t?-1:e.localeCompare(t)),[L]),D=d.get("c"),B=null!==D&&F.includes(D)?D:F[0]??null,J=(0,S.useMemo)(()=>L.filter(e=>e.collection===B),[L,B]),[H,G]=(0,S.useState)(null),[K,V]=(0,S.useState)(null),[_,X]=(0,S.useState)(!1),[W,Y]=(0,S.useState)(new Set),[Q,Z]=(0,S.useState)(!1),[ee,et]=(0,S.useState)(!1),es=(0,S.useRef)(null);(0,S.useEffect)(()=>{try{X("1"===localStorage.getItem(I))}catch{}},[]),(0,S.useEffect)(()=>{if(null===B)return;G(null),V(null),Y(new Set);let e=!0;return R.suiteApi.plan(B).then(t=>e&&G(t)).catch(()=>e&&G({order:[],skip:[]})),()=>{e=!1}},[B]),(0,S.useEffect)(()=>()=>void(es.current&&window.clearInterval(es.current)),[]);let ea=(0,S.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 r=new Set(t?.skip??[]);return n.map(e=>({item:e,skipped:r.has(e.id)}))})(J,H),[J,H]),en=K?.status==="running";(0,S.useMemo)(()=>new Map((K?.steps??[]).map(e=>[e.id,e])),[K]);let er=K?K.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}]:[]}):ea,ei=(0,S.useCallback)(e=>{null!==B&&(G(e),R.suiteApi.savePlan(B,e).catch(e=>c(e instanceof Error?e.message:"Could not save the order","error")))},[B,c]);function el(e,t){let s=ea.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]],V(null),ei({order:s,skip:H?.skip??[]}))}async function eo(){if(null!==B&&!Q){Z(!0),Y(new Set);try{let e=await R.suiteApi.start({collection:B,environmentId:z?.id??null,stopOnFail:_});V(e),es.current&&window.clearInterval(es.current),es.current=window.setInterval(async()=>{try{let t=await R.suiteApi.get(e.id);V(t),"running"!==t.status&&(window.clearInterval(es.current),es.current=null,Y(new Set(t.steps.filter(e=>"failed"===e.state||"error"===e.state).map(e=>e.id))))}catch{}},400)}catch(e){c(e instanceof Error?e.message:"Could not start the run","error")}finally{Z(!1)}}}async function ed(){if(null!==B){et(!0);try{let{blob:e,name:t,secrets:s}=await A(B,z?.name??null);(0,P.downloadBlob)(t,e),c(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){c(e instanceof Error?e.message:"Could not export","error")}finally{et(!1)}}}async function ec(){K&&await R.suiteApi.stop(K.id).catch(()=>void 0)}let eu=K?s(K.steps):null,ep=K&&"running"!==K.status,em=ea.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===F.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)("select",{value:B??"",disabled:en,onChange:t=>e.replace((0,R.suiteHref)(t.target.value)),className:"min-w-48 rounded-md border border-line bg-panel-2 px-2 py-1.5 text-sm text-ink",children:F.map(e=>(0,t.jsxs)("option",{value:e,children:[e||"No collection"," (",L.filter(t=>t.collection===e).length,")"]},e||"(none)"))})]}),(0,t.jsxs)("label",{className:"flex flex-col gap-1 text-xs text-mute",children:["Environment",(0,t.jsxs)("select",{value:z?.id??"",disabled:en,onChange:e=>M(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"}),y.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:_,disabled:en,onChange:e=>{X(e.target.checked);try{localStorage.setItem(I,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:ee||null===B,onClick:()=>void ed(),title:"A zip for your repository: this collection's requests, environments and run order (never secrets), plus a ready GitHub Actions pipeline",children:[ee?(0,t.jsx)(k.Loader2,{size:14,className:"animate-spin"}):(0,t.jsx)(g,{size:14}),"Download for CI"]}),en?(0,t.jsxs)("button",{type:"button",className:"btn btn-danger",onClick:()=>void ec(),children:[(0,t.jsx)($.Square,{size:14})," Stop"]}):(0,t.jsxs)("button",{type:"button",className:"btn btn-primary",disabled:!H||0===em||Q,onClick:()=>void eo(),children:[Q?(0,t.jsx)(k.Loader2,{size:14,className:"animate-spin"}):(0,t.jsx)(w.Play,{size:14}),"Run ",em," request",1===em?"":"s"]})]})]}),K?(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 ${en?"border-line bg-panel":a(K)?"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:[en?(0,t.jsx)(k.Loader2,{size:16,className:"animate-spin text-accent"}):a(K)?(0,t.jsx)(m.CheckCircle2,{size:16,className:"text-ok"}):(0,t.jsx)(j.XCircle,{size:16,className:"text-bad"}),en?"Running…":a(K)?"All requests passed":"Not all requests passed"]}),(0,t.jsx)("span",{className:"text-sm text-mute",children:n(K)}),eu&&ep?(0,t.jsxs)("span",{className:"text-sm text-mute",children:["· ",(eu.durationMs/1e3).toFixed(1)," s of response time"]}):null,ep?(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,P.downloadText)(`${O(K)}.html`,function(e,t={}){let r=s(e.steps),i=a(e),d=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?"✓":"✕"} ${l(e.name)}</li>`).join("")}</ul>`:"",a=e.bodyPreview?`<details><summary>Response body</summary><pre>${l(e.bodyPreview)}</pre></details>`:"",n=e.runFirst?`<div class="sub">Run first: ${l(e.runFirst.label)}${e.runFirst.reused?" (reused)":""}</div>`:"",r=e.saved?.length?`<div class="sub">${e.saved.map(e=>e.found?`Saved {{${l(e.name)}}} = ${l(e.preview??"")}`:`✕ {{${l(e.name)}}} not found`).join(" · ")}</div>`:"";return`<tr>
|
|
54
|
-
<td class="n">${t+1}</td>
|
|
55
|
-
<td><span class="state ${c(e.state)}">${o[e.state]}</span></td>
|
|
56
|
-
<td><div><b class="m">${l(e.method)}</b> ${l(e.name)}</div><div class="sub mono">${l(e.url)}</div>${n}${r}${e.message?`<div class="msg ${c(e.state)}">${l(e.message)}</div>`:""}${s}${a}</td>
|
|
57
|
-
<td class="num">${e.status??"–"}</td>
|
|
58
|
-
<td class="num">${null!=e.durationMs?`${Math.round(e.durationMs)} ms`:"–"}</td>
|
|
59
|
-
</tr>`}).join("\n");return`<!doctype html>
|
|
60
|
-
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
61
|
-
<title>${l(d)} — collection run</title>
|
|
62
|
-
<style>
|
|
63
|
-
:root { --ink:#12151c; --mute:#5c6778; --line:#d5dce6; --panel:#fff; --canvas:#f4f6f9; --ok:#137333; --bad:#c62828; --okbg:#e6f4ea; --badbg:#fce8e6; }
|
|
64
|
-
* { box-sizing:border-box; }
|
|
65
|
-
body { margin:0; background:var(--canvas); color:var(--ink); font:14px/1.5 "Segoe UI",system-ui,-apple-system,sans-serif; }
|
|
66
|
-
main { max-width:1000px; margin:0 auto; padding:28px 16px 48px; }
|
|
67
|
-
h1 { font-size:22px; margin:0 0 4px; }
|
|
68
|
-
.meta { color:var(--mute); font-size:13px; margin-bottom:18px; }
|
|
69
|
-
.banner { border-radius:10px; padding:14px 16px; font-weight:600; margin-bottom:16px; }
|
|
70
|
-
.banner.ok { background:var(--okbg); color:var(--ok); } .banner.bad { background:var(--badbg); color:var(--bad); }
|
|
71
|
-
.tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; margin-bottom:18px; }
|
|
72
|
-
.tile { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:10px 14px; }
|
|
73
|
-
.tile b { display:block; font-size:24px; }
|
|
74
|
-
.tile span { color:var(--mute); font-size:12.5px; }
|
|
75
|
-
table { width:100%; border-collapse:collapse; background:var(--panel); border:1px solid var(--line); border-radius:10px; overflow:hidden; }
|
|
76
|
-
th, td { text-align:left; vertical-align:top; padding:9px 10px; border-bottom:1px solid var(--line); }
|
|
77
|
-
th { font-size:12px; color:var(--mute); font-weight:600; background:#eef1f6; }
|
|
78
|
-
.n, .num { white-space:nowrap; font-variant-numeric:tabular-nums; } .num { text-align:right; }
|
|
79
|
-
.state { display:inline-block; font-size:12px; font-weight:600; padding:1px 8px; border-radius:999px; white-space:nowrap; }
|
|
80
|
-
.state.ok { background:var(--okbg); color:var(--ok); } .state.bad { background:var(--badbg); color:var(--bad); } .state.mute { background:#eef1f6; color:var(--mute); }
|
|
81
|
-
.m { font-family:ui-monospace,Consolas,monospace; font-size:12px; }
|
|
82
|
-
.sub { color:var(--mute); font-size:12.5px; } .mono { font-family:ui-monospace,Consolas,monospace; word-break:break-all; }
|
|
83
|
-
.msg { font-size:13px; margin-top:4px; } .msg.bad { color:var(--bad); } .msg.mute { color:var(--mute); }
|
|
84
|
-
.checks { list-style:none; padding:0; margin:6px 0 0; font-size:12.5px; } .checks .ok { color:var(--ok); } .checks .bad { color:var(--bad); }
|
|
85
|
-
details { margin-top:6px; font-size:12.5px; } summary { cursor:pointer; color:var(--mute); }
|
|
86
|
-
pre { white-space:pre-wrap; word-break:break-all; background:#eef1f6; padding:8px; border-radius:6px; max-height:300px; overflow:auto; }
|
|
87
|
-
footer { color:var(--mute); font-size:12px; margin-top:16px; }
|
|
88
|
-
</style></head><body><main>
|
|
89
|
-
<h1>${l(d)}</h1>
|
|
90
|
-
<div class="meta">Collection run \xb7 ${l(new Date(e.startedAt).toLocaleString("en-GB"))}${e.environment?` \xb7 environment ${l(e.environment)}`:""}</div>
|
|
91
|
-
<div class="banner ${i?"ok":"bad"}">${i?"✓ All requests passed":"✕ Not all requests passed"} — ${l(n(e))}</div>
|
|
92
|
-
<div class="tiles">
|
|
93
|
-
<div class="tile"><b>${r.passed}</b><span>passed</span></div>
|
|
94
|
-
<div class="tile"><b>${r.failed}</b><span>failed</span></div>
|
|
95
|
-
<div class="tile"><b>${r.errors}</b><span>could not run</span></div>
|
|
96
|
-
<div class="tile"><b>${r.skipped}</b><span>skipped</span></div>
|
|
97
|
-
<div class="tile"><b>${(r.durationMs/1e3).toFixed(1)} s</b><span>total response time</span></div>
|
|
98
|
-
</div>
|
|
99
|
-
<table>
|
|
100
|
-
<thead><tr><th>#</th><th>Result</th><th>Request</th><th class="num">Status</th><th class="num">Time</th></tr></thead>
|
|
101
|
-
<tbody>
|
|
102
|
-
${u}
|
|
103
|
-
</tbody></table>
|
|
104
|
-
<footer>Made with APITestCenter \xb7 ${l(t.generatedAt??new Date().toISOString())}. A request passes when all its checks pass; without checks, on any 2xx or 3xx status.</footer>
|
|
105
|
-
</main></body></html>
|
|
106
|
-
`}(K),"text/html"),children:[(0,t.jsx)(b.Download,{size:12})," HTML"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",onClick:()=>{let e,t,a,n;return(0,P.downloadText)(`${O(K)}.xml`,(e=s(K.steps),t=K.collection||"Saved requests",a=K.steps.map(e=>{let s=`${e.method} ${e.name}`,a=` <testcase classname="${r(t)}" name="${r(s)}" time="${i(e.durationMs)}">`;if("passed"===e.state)return`${a}</testcase>`;if("skipped"===e.state||"pending"===e.state||"running"===e.state)return`${a}
|
|
107
|
-
<skipped message="${r(e.message??"Not run")}"/>
|
|
108
|
-
</testcase>`;let n="error"===e.state?"error":"failure",l=[e.status?`Status ${e.status}`:"",...(e.checks??[]).map(e=>`${e.ok?"✓":"✕"} ${e.name}`),e.bodyPreview?`
|
|
109
|
-
Response:
|
|
110
|
-
${e.bodyPreview}`:""].filter(Boolean).join("\n");return`${a}
|
|
111
|
-
<${n} message="${r(e.message??e.state)}">${r(l)}</${n}>
|
|
112
|
-
</testcase>`}),n=i(e.durationMs),`<?xml version="1.0" encoding="UTF-8"?>
|
|
113
|
-
<testsuites name="APITestCenter" tests="${e.total}" failures="${e.failed}" errors="${e.errors}" skipped="${e.skipped}" time="${n}">
|
|
114
|
-
<testsuite name="${r(t)}" tests="${e.total}" failures="${e.failed}" errors="${e.errors}" skipped="${e.skipped}" time="${n}" timestamp="${r(K.startedAt)}">
|
|
115
|
-
${a.join("\n")}
|
|
116
|
-
</testsuite>
|
|
117
|
-
</testsuites>
|
|
118
|
-
`),"application/xml")},title:"JUnit XML for CI dashboards",children:[(0,t.jsx)(b.Download,{size:12})," JUnit"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",onClick:()=>(0,P.downloadText)(`${O(K)}.json`,`${JSON.stringify({kind:"apitestcenter-suite",version:1,...K,totals:s(K.steps),passed:a(K)},null,2)}
|
|
119
|
-
`,"application/json"),children:[(0,t.jsx)(b.Download,{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)(v.ListChecks,{size:14,"aria-hidden":!0}),(0,t.jsx)("span",{children:K?"Results":"Run order — untick to leave a request out; use the arrows to reorder. Saved for next time and for the CLI."})]}),H?(0,t.jsx)("ol",{children:er.map(({item:s,skipped:a,step:n},r)=>{let i=W.has(s.id),l=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&&!K?"opacity-50":""}`,children:[K?(0,t.jsx)(U,{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(H?.skip??[])).has(e)?t.delete(e):t.add(e),V(null),ei({order:ea.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:r+1}),(0,t.jsxs)("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left",onClick:()=>l?Y(e=>{let t=new Set(e);return t.has(s.id)?t.delete(s.id):t.add(s.id),t}):void 0,"aria-expanded":l?i:void 0,children:[(0,t.jsx)("span",{className:`w-14 shrink-0 font-mono text-xs font-medium ${E[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})]}),l?i?(0,t.jsx)(h.ChevronDown,{size:14,className:"shrink-0 text-mute"}):(0,t.jsx)(x.ChevronRight,{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,K?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===r,onClick:()=>el(s.id,-1),"aria-label":`Move ${s.name} up`,children:(0,t.jsx)(p,{size:14})}),(0,t.jsx)("button",{type:"button",className:"rounded p-1 text-mute hover:text-ink disabled:opacity-30",disabled:r===er.length-1,onClick:()=>el(s.id,1),"aria-label":`Move ${s.name} down`,children:(0,t.jsx)(u,{size:14})})]})]}),i&&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]},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(C.OPEN_REQUEST_KEY,t)}catch{}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…"}),ep?(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:()=>V(null),children:"Edit the run order"})}):null]})]})})]})}],93639)},14168,e=>{"use strict";async function t(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Engine error (${e.status})`);return t}let s=(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(["suiteApi",0,{plan:e=>fetch(`/engine/suites/plan?collection=${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>t(e)),savePlan:(e,a)=>s("PUT","/engine/suites/plan",{collection:e,...a}).then(e=>t(e)),start:e=>s("POST","/engine/suites/runs",e).then(e=>t(e)),get:e=>fetch(`/engine/suites/runs/${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>t(e)),stop:e=>s("POST",`/engine/suites/runs/${encodeURIComponent(e)}/stop`).then(e=>t(e))},"suiteHref",0,function(e){return`/suite?c=${encodeURIComponent(e)}`}])},95486,17219,15060,e=>{"use strict";let t=(0,e.i(99522).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],95486);let s=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 a(e){let t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e,!0),t}function n(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)),s=0;for(let a of e)t.set(a,s),s+=a.length;return t}function i(e,t){let s=URL.createObjectURL(t),a=document.createElement("a");a.href=s,a.download=e,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(s)}e.s(["zipStore",0,function(e){let t=new TextEncoder,i=[],l=[],o=0;for(let[d,c]of Object.entries(e)){let e=t.encode(d),u="string"==typeof c?t.encode(c):c,p=function(e){let t=0xffffffff;for(let a of e)t=s[(t^a)&255]^t>>>8;return(0xffffffff^t)>>>0}(u),m=r([n(0x4034b50),a(20),a(0),a(0),a(0),a(0),n(p),n(u.length),n(u.length),a(e.length),a(0),e,u]),h=r([n(0x2014b50),a(20),a(20),a(0),a(0),a(0),a(0),n(p),n(u.length),n(u.length),a(e.length),a(0),a(0),a(0),a(0),n(0),n(o),e]);i.push(m),l.push(h),o+=m.length}let d=r(l),c=r([n(0x6054b50),a(0),a(0),a(Object.keys(e).length),a(Object.keys(e).length),n(d.length),n(o),a(0)]),u=r([...i,d,c]);return new Blob([u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength)],{type:"application/zip"})}],17219),e.s(["downloadBlob",0,i,"downloadText",0,function(e,t,s){i(e,new Blob([t],{type:s}))}],15060)},60961,e=>{"use strict";let t=(0,e.i(99522).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],60961)},3792,66478,e=>{"use strict";var t=e.i(99522);let s=(0,t.default)("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(["Play",0,s],3792);let a=(0,t.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,a],66478)}]);
|
/package/dist/ui/_next/static/{nzVJlcyPooozLLxcLfxub → lBYayPKoT6YJhgfHFuw6O}/_buildManifest.js
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/ui/_next/static/{nzVJlcyPooozLLxcLfxub → lBYayPKoT6YJhgfHFuw6O}/_ssgManifest.js
RENAMED
|
File without changes
|