apitestcenter 0.17.0 → 0.17.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/LICENSE.txt +2 -2
- package/README.md +1 -1
- package/dist/THIRD-PARTY-NOTICES-UI.txt +1 -1
- package/dist/THIRD-PARTY-NOTICES.txt +1 -1
- package/dist/cli.mjs +359 -354
- package/dist/ui/404/index.html +1 -1
- package/dist/ui/404.html +1 -1
- package/dist/ui/__next.__PAGE__.txt +11 -11
- package/dist/ui/__next._full.txt +12 -12
- package/dist/ui/__next._tree.txt +2 -2
- package/dist/ui/_next/static/chunks/0a88gfjsl2a31.css +3 -0
- package/dist/ui/_next/static/chunks/0wrod6xlhsv0m.js +3 -0
- package/dist/ui/_next/static/chunks/23_x0u07xh89v.js +123 -0
- package/dist/ui/_next/static/chunks/2nsf1ik-sgmcf.js +27 -0
- package/dist/ui/_not-found/__next._full.txt +11 -11
- package/dist/ui/_not-found/__next._not-found.__PAGE__.txt +10 -10
- 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 +11 -11
- package/dist/ui/compare/__next._full.txt +12 -12
- package/dist/ui/compare/__next._tree.txt +2 -2
- package/dist/ui/compare/__next.compare.__PAGE__.txt +11 -11
- package/dist/ui/compare/index.html +1 -1
- package/dist/ui/compare/index.txt +12 -12
- package/dist/ui/connections/__next._full.txt +12 -12
- package/dist/ui/connections/__next._tree.txt +2 -2
- package/dist/ui/connections/__next.connections.__PAGE__.txt +11 -11
- package/dist/ui/connections/index.html +2 -2
- package/dist/ui/connections/index.txt +12 -12
- package/dist/ui/history/__next._full.txt +13 -13
- package/dist/ui/history/__next._tree.txt +2 -2
- package/dist/ui/history/__next.history.__PAGE__.txt +12 -12
- package/dist/ui/history/index.html +1 -1
- package/dist/ui/history/index.txt +13 -13
- package/dist/ui/home/__next._full.txt +12 -12
- package/dist/ui/home/__next._tree.txt +2 -2
- package/dist/ui/home/__next.home.__PAGE__.txt +11 -11
- package/dist/ui/home/index.html +1 -1
- package/dist/ui/home/index.txt +12 -12
- package/dist/ui/index.html +1 -1
- package/dist/ui/index.txt +12 -12
- package/dist/ui/preview/__next._full.txt +13 -13
- package/dist/ui/preview/__next._tree.txt +2 -2
- package/dist/ui/preview/__next.preview.__PAGE__.txt +12 -12
- package/dist/ui/preview/index.html +1 -1
- package/dist/ui/preview/index.txt +13 -13
- package/dist/ui/suite/__next._full.txt +12 -12
- package/dist/ui/suite/__next._tree.txt +2 -2
- package/dist/ui/suite/__next.suite.__PAGE__.txt +11 -11
- package/dist/ui/suite/index.html +1 -1
- package/dist/ui/suite/index.txt +12 -12
- package/dist/ui/tests/__next._full.txt +11 -11
- package/dist/ui/tests/__next._tree.txt +2 -2
- package/dist/ui/tests/__next.tests.__PAGE__.txt +10 -10
- package/dist/ui/tests/index.html +1 -1
- package/dist/ui/tests/index.txt +11 -11
- package/package.json +1 -1
- package/dist/ui/_next/static/chunks/0ed__sgjyhon8.css +0 -3
- package/dist/ui/_next/static/chunks/1wd-qahqqdfeq.js +0 -27
- package/dist/ui/_next/static/chunks/3r75fvzmnyvck.js +0 -123
- package/dist/ui/_next/static/chunks/40y4-vb2nag2l.js +0 -3
- /package/dist/ui/_next/static/{u2V4Oq6faI2f3slbxdtb5 → 0pb5ehfBVj_I-XduzZBR3}/_buildManifest.js +0 -0
- /package/dist/ui/_next/static/{u2V4Oq6faI2f3slbxdtb5 → 0pb5ehfBVj_I-XduzZBR3}/_clientMiddlewareManifest.js +0 -0
- /package/dist/ui/_next/static/{u2V4Oq6faI2f3slbxdtb5 → 0pb5ehfBVj_I-XduzZBR3}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93639,e=>{"use strict";var t=e.i(14368);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 l(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 i=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.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),m=(0,u.default)("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),b=e.i(60961),f=e.i(40945),g=e.i(75117);let v=(0,u.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 y=e.i(29091),k=e.i(27813);let w=(0,u.default)("circle-minus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);var j=e.i(3792),$=e.i(66478),N=e.i(27122),C=e.i(36994),S=e.i(99181),M=e.i(69578),z=e.i(80707),q=e.i(56396);function A({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 E=e.i(17219);async function R(e,t){var s;let a,n=await fetch(`/engine/suites/export?collection=${encodeURIComponent(e)}`,{cache:"no-store"}),l=await n.json().catch(()=>null);if(!n.ok||!l?.files)throw Error(l?.error??`Engine error (${n.status})`);let i=l.secrets??[],r={};for(let e of l.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,l=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
|
+
${A(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}${l} --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}),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: ${A(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,E.zipStore)(r),name:`${o}-for-ci.zip`,secrets:i}}var P=e.i(15060),T=e.i(14168),L=e.i(6278),I=e.i(15868),O=e.i(92084),U=e.i(13643);let D=(0,u.default)("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"}]]),F=(0,u.default)("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.default)("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 B=e.i(49913),J=e.i(96659),V=e.i(39170),_=e.i(727),G=e.i(44505),K=e.i(43101),Y=e.i(60889);let W=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(O.NOTIFY_LABELS);function Q({collection:e,environment:s}){let a=(0,q.useToast)(),n=(0,V.useConfirm)(),{environments:l}=(0,L.useWorkspace)(),i=(0,K.useSchedules)(),r=(0,_.useNoticeState)(),[o,d]=(0,S.useState)(15),[c,u]=(0,S.useState)("changes"),[p,m]=(0,S.useState)(null),x=(0,Y.usePlanGate)(),h=e=>e?l.find(t=>t.id===e)?.name??"an environment that was removed":"no environment",b=i?.find(t=>t.collection===e&&t.environment===s);async function f(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)(F,{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,G.desktop)()?.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,_.toggleNotices)(),children:[(0,t.jsx)(D,{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)(U.BellOff,{size:12,"aria-hidden":!0})," Notifications are blocked — you'll see them in the app only"]}):null]}),null===e||b?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:O.SCHEDULE_EVERY.map(e=>(0,t.jsx)("option",{value:e,children:(0,O.everyLabel)(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",(i?.length??0)+1)&&void f("add",()=>K.schedulesApi.add({collection:e,environment:s,everyMinutes:o,notify:c}),()=>`Scheduled: ${e||"requests outside a folder"} ${(0,O.everyLabel)(o)} — the first run starts now`),children:["add"===p?(0,t.jsx)(k.Loader2,{size:14,className:"animate-spin"}):(0,t.jsx)(F,{size:14}),"Schedule it"]})]}),null===i?(0,t.jsx)("p",{className:"px-4 py-3 text-sm text-mute",children:"Loading…"}):i.length?(0,t.jsx)("ul",{className:"divide-y divide-line","aria-label":"Scheduled collections",children:i.map(e=>(0,t.jsx)(Z,{s:e,env:h(e.environment),busy:p,current:e.id===b?.id,act:f,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 f(`rm:${e.id}`,()=>K.schedulesApi.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:l,onRemove:i}){let r=e.results.at(-1),[o,d]=(0,S.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.CheckCircle2,{size:16,className:"shrink-0 text-ok","aria-label":"Last run passed"}):(0,t.jsx)(N.XCircle,{size:16,className:"shrink-0 text-bad","aria-label":"Last run failed"}):(0,t.jsx)(F,{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,O.everyLabel)(e.everyMinutes)," · ",s," · ",e.enabled?r?`next at ${W(Math.max((0,O.nextRunAt)(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:`${W(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:[W(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 l(`run:${e.id}`,()=>K.schedulesApi.run(e.id),e=>e.passed?`${c}: ${e.headline}`:null),title:"Run it now",children:[a===`run:${e.id}`?(0,t.jsx)(k.Loader2,{size:12,className:"animate-spin"}):(0,t.jsx)(B.RotateCw,{size:12})," Run now"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",onClick:()=>void l(`pause:${e.id}`,()=>K.schedulesApi.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)(j.Play,{size:12})," ",e.enabled?"Pause":"Resume"]}),(0,t.jsx)("button",{type:"button",className:"rounded p-1 text-mute hover:text-bad",onClick:i,"aria-label":`Remove the schedule of ${c}`,children:(0,t.jsx)(J.Trash2,{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 l(`notify:${e.id}`,()=>K.schedulesApi.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 l(`every:${e.id}`,()=>K.schedulesApi.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([...O.SCHEDULE_EVERY,e.everyMinutes])].sort((e,t)=>e-t).map(e=>(0,t.jsx)("option",{value:e,children:(0,O.everyLabel)(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.CheckCircle2,{size:16,className:"text-ok","aria-label":"Passed"}):"failed"===e?(0,t.jsx)(N.XCircle,{size:16,className:"text-bad","aria-label":"Failed"}):"error"===e?(0,t.jsx)(c.AlertTriangle,{size:16,className:"text-bad","aria-label":"Could not run"}):"skipped"===e?(0,t.jsx)(w,{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.Circle,{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,C.useRouter)(),c=(0,C.useSearchParams)(),u=(0,q.useToast)(),{index:f,environments:w,activeEnv:A,setActiveEnv:E}=(0,L.useWorkspace)(),O=(0,S.useMemo)(()=>f?.requests??[],[f]),U=(0,S.useMemo)(()=>[...new Set(O.flatMap(e=>e.collection?(0,s.folderChain)(e.collection):[""]))].sort((e,t)=>""===e?1:""===t?-1:e.localeCompare(t)),[O]),D=(0,S.useCallback)(e=>O.filter(t=>e?(0,s.inFolder)(t.collection,e):""===t.collection),[O]),F=c.get("c"),H=null!==F&&U.includes(F)?F:U[0]??null,B=(0,S.useMemo)(()=>null===H?[]:D(H),[D,H]),[J,V]=(0,S.useState)(null),[_,G]=(0,S.useState)(null),[K,Y]=(0,S.useState)(!1),[W,X]=(0,S.useState)(new Set),[Z,en]=(0,S.useState)(!1),[el,ei]=(0,S.useState)(!1),er=(0,S.useRef)(null);(0,S.useEffect)(()=>{try{Y("1"===localStorage.getItem(et))}catch{}},[]),(0,S.useEffect)(()=>{if(null===H)return;V(null),G(null),X(new Set);let e=!0;return T.suiteApi.plan(H).then(t=>e&&V(t)).catch(()=>e&&V({order:[],skip:[]})),()=>{e=!1}},[H]),(0,S.useEffect)(()=>()=>void(er.current&&window.clearInterval(er.current)),[]);let eo=(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 l=new Set(t?.skip??[]);return n.map(e=>({item:e,skipped:l.has(e.id)}))})(B,J),[B,J]),ed=_?.status==="running";(0,S.useMemo)(()=>new Map((_?.steps??[]).map(e=>[e.id,e])),[_]);let ec=_?_.steps.flatMap(e=>{let t=B.find(t=>t.id===e.id);return t?[{item:t,skipped:"skipped"===e.state&&!!e.message?.startsWith("Left out"),step:e}]:[]}):eo,eu=(0,S.useCallback)(e=>{null!==H&&(V(e),T.suiteApi.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]],G(null),eu({order:s,skip:J?.skip??[]}))}async function em(){if(null!==H&&!Z){en(!0),X(new Set);try{let e=await T.suiteApi.start({collection:H,environmentId:A?.id??null,stopOnFail:K});G(e),er.current&&window.clearInterval(er.current),er.current=window.setInterval(async()=>{try{let t=await T.suiteApi.get(e.id);G(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){ei(!0);try{let{blob:e,name:t,secrets:s}=await R(H,A?.name??null);(0,P.downloadBlob)(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{ei(!1)}}}async function eh(){_&&await T.suiteApi.stop(_.id).catch(()=>void 0)}let eb=_?a(_.steps):null,ef=_&&"running"!==_.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===U.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.Select,{label:"Collection",value:H??"",disabled:ed,onChange:t=>e.replace((0,T.suiteHref)(t)),minWidth:240,buttonContent:null===H?"":`${H||"No collection"} (${B.length})`,options:U.map(e=>({value:e,label:(0,t.jsx)("span",{style:{paddingLeft:`${.9*Math.max(0,(0,s.folderChain)(e).length-1)}rem`},children:e?(0,s.folderName)(e):"No collection"}),hint:`${D(e).length} request${1===D(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:A?.id??"",disabled:ed,onChange:e=>E(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"}),w.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:K,disabled:ed,onChange:e=>{Y(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:el||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:[el?(0,t.jsx)(k.Loader2,{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)($.Square,{size:14})," Stop"]}):(0,t.jsxs)("button",{type:"button",className:"btn btn-primary",disabled:!J||0===eg||Z,onClick:()=>void em(),children:[Z?(0,t.jsx)(k.Loader2,{size:14,className:"animate-spin"}):(0,t.jsx)(j.Play,{size:14}),"Run ",eg," request",1===eg?"":"s"]})]})]}),_?(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(_)?"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.Loader2,{size:16,className:"animate-spin text-accent"}):n(_)?(0,t.jsx)(x.CheckCircle2,{size:16,className:"text-ok"}):(0,t.jsx)(N.XCircle,{size:16,className:"text-bad"}),ed?"Running…":n(_)?"All requests passed":"Not all requests passed"]}),(0,t.jsx)("span",{className:"text-sm text-mute",children:l(_)}),eb&&ef?(0,t.jsxs)("span",{className:"text-sm text-mute",children:["· ",(eb.durationMs/1e3).toFixed(1)," s of response time"]}):null,ef?(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)(`${ea(_)}.html`,function(e,t={}){let s=a(e.steps),i=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>`:"",l=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}${l}${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 ${i?"ok":"bad"}">${i?"✓ All requests passed":"✕ Not all requests passed"} — ${o(l(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
|
+
`}(_),"text/html"),children:[(0,t.jsx)(g.Download,{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,P.downloadText)(`${ea(_)}.xml`,(e=a(_.steps),t=_.collection||"Saved requests",s=_.steps.map(e=>{let s=`${e.method} ${e.name}`,a=` <testcase classname="${i(t)}" name="${i(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="${i(e.message??"Not run")}"/>
|
|
112
|
+
</testcase>`;let n="error"===e.state?"error":"failure",l=[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="${i(e.message??e.state)}">${i(l)}</${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="${i(t)}" tests="${e.total}" failures="${e.failed}" errors="${e.errors}" skipped="${e.skipped}" time="${n}" timestamp="${i(_.startedAt)}">
|
|
119
|
+
${s.join("\n")}
|
|
120
|
+
</testsuite>
|
|
121
|
+
</testsuites>
|
|
122
|
+
`),"application/xml")},title:"JUnit XML for CI dashboards",children:[(0,t.jsx)(g.Download,{size:12})," JUnit"]}),(0,t.jsxs)("button",{type:"button",className:"btn btn-secondary py-1 text-xs",onClick:()=>(0,P.downloadText)(`${ea(_)}.json`,`${JSON.stringify({kind:"apitestcenter-suite",version:1,..._,totals:a(_.steps),passed:n(_)},null,2)}
|
|
123
|
+
`,"application/json"),children:[(0,t.jsx)(g.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)(y.ListChecks,{size:14,"aria-hidden":!0}),(0,t.jsx)("span",{children:_?"Results":"Run order — untick to leave a request out; use the arrows to reorder. Saved for next time and for the CLI."})]}),J?(0,t.jsx)("ol",{children:ec.map(({item:s,skipped:a,step:n},l)=>{let i=W.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&&!_?"opacity-50":""}`,children:[_?(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(J?.skip??[])).has(e)?t.delete(e):t.add(e),G(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:l+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?i: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?i?(0,t.jsx)(h.ChevronDown,{size:14,className:"shrink-0 text-mute"}):(0,t.jsx)(b.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,_?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===l,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:l===ec.length-1,onClick:()=>ep(s.id,1),"aria-label":`Move ${s.name} down`,children:(0,t.jsx)(p,{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,!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.OPEN_REQUEST_KEY,t)}catch{}(0,I.startNavProgress)(),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…"}),ef?(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:()=>G(null),children:"Edit the run order"})}):null]}),(0,t.jsx)(Q,{collection:H,environment:A?.id??null})]})})]})}],93639)},17219,e=>{"use strict";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(["zipStore",0,function(e){let l=new TextEncoder,i=[],r=[],o=0;for(let[d,c]of Object.entries(e)){let e=l.encode(d),u="string"==typeof c?l.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]);i.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([...i,d,c]);return new Blob([u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength)],{type:"application/zip"})}])},13643,e=>{"use strict";let t=(0,e.i(99522).default)("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(["BellOff",0,t],13643)},3792,e=>{"use strict";let t=(0,e.i(99522).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,t],3792)},66478,14168,e=>{"use strict";let t=(0,e.i(99522).default)("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(["Square",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(["suiteApi",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))},"suiteHref",0,function(e){return`/suite?c=${encodeURIComponent(e)}`}],14168)}]);
|