1"use strict";(globalThis.webpackChunkvoiden_docs=globalThis.webpackChunkvoiden_docs||[]).push([[3419],{1470:(e,n,s)=>{s.d(n,{A:()=>k});var r=s(6540),t=s(4164),i=s(7559),a=s(3104),o=s(6347),l=s(205),d=s(7485),c=s(1682),u=s(679);function h(e){return r.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw new Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:n,children:s}=e;return(0,r.useMemo)(()=>{const e=n??function(e){return h(e).map(({props:{value:e,label:n,attributes:s,default:r}})=>({value:e,label:n,attributes:s,default:r}))}(s);return function(e){const n=(0,c.XI)(e,(e,n)=>e.value===n.value);if(n.length>0)throw new Error(`Docusaurus error: Duplicate values "${n.map(e=>e.value).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e},[n,s])}function v({value:e,tabValues:n}){return n.some(n=>n.value===e)}function g({queryString:e=!1,groupId:n}){const s=(0,o.W6)(),t=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,d.aZ)(t),(0,r.useCallback)(e=>{if(!t)return;const n=new URLSearchParams(s.location.search);n.set(t,e),s.replace({...s.location,search:n.toString()})},[t,s])]}function x(e){const{defaultValue:n,queryString:s=!1,groupId:t}=e,i=p(e),[a,o]=(0,r.useState)(()=>function({defaultValue:e,tabValues:n}){if(0===n.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!v({value:e,tabValues:n}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const s=n.find(e=>e.default)??n[0];if(!s)throw new Error("Unexpected error: 0 tabValues");return s.value}({defaultValue:n,tabValues:i})),[d,c]=g({queryString:s,groupId:t}),[h,x]=function({groupId:e}){const n=function(e){return e?`docusaurus.tab.${e}`:null}(e),[s,t]=(0,u.Dv)(n);return[s,(0,r.useCallback)(e=>{n&&t.set(e)},[n,t])]}({groupId:t}),j=(()=>{const e=d??h;return v({value:e,tabValues:i})?e:null})();(0,l.A)(()=>{j&&o(j)},[j]);return{selectedValue:a,selectValue:(0,r.useCallback)(e=>{if(!v({value:e,tabValues:i}))throw new Error(`Can't select invalid tab value=${e}`);o(e),c(e),x(e)},[c,x,i]),tabValues:i}}var j=s(2303);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var m=s(4848);function f({className:e,block:n,selectedValue:s,selectValue:r,tabValues:i}){const o=[],{blockElementScrollPositionUntilNextRender:l}=(0,a.a_)(),d=e=>{const n=e.currentTarget,t=o.indexOf(n),a=i[t].value;a!==s&&(l(n),r(a))},c=e=>{let n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{const s=o.indexOf(e.currentTarget)+1;n=o[s]??o[0];break}case"ArrowLeft":{const s=o.indexOf(e.currentTarget)-1;n=o[s]??o[o.length-1];break}}n?.focus()};return(0,m.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,t.A)("tabs",{"tabs--block":n},e),children:i.map(({value:e,label:n,attributes:r})=>(0,m.jsx)("li",{role:"tab",tabIndex:s===e?0:-1,"aria-selected":s===e,ref:e=>{o.push(e)},onKeyDown:c,onClick:d,...r,className:(0,t.A)("tabs__item",b.tabItem,r?.className,{"tabs__item--active":s===e}),children:n??e},e))})}function y({lazy:e,children:n,selectedValue:s}){const i=(Array.isArray(n)?n:[n]).filter(Boolean);if(e){const e=i.find(e=>e.props.value===s);return e?(0,r.cloneElement)(e,{className:(0,t.A)("margin-top--md",e.props.className)}):null}return(0,m.jsx)("div",{className:"margin-top--md",children:i.map((e,n)=>(0,r.cloneElement)(e,{key:n,hidden:e.props.value!==s}))})}function A(e){const n=x(e);return(0,m.jsxs)("div",{className:(0,t.A)(i.G.tabs.container,"tabs-container",b.tabList),
1children:[(0,m.jsx)(f,{...n,...e}),(0,m.jsx)(y,{...n,...e})]})}function k(e){const n=(0,j.A)();return(0,m.jsx)(A,{...e,children:h(e.children)},String(n))}},3979:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>p,frontMatter:()=>l,metadata:()=>r,toc:()=>u});const r=JSON.parse('{"id":"plugins/core-plugins/voiden-scripting","title":"Voiden Scripting","description":"Scripting is a core part of serious API tooling. It lets you go beyond static requests \u2014 dynamically injecting auth tokens, chaining requests by passing data between them, validating responses automatically, and encoding custom logic that no UI alone can express. Most API clients that support scripting limit you to JavaScript. Voiden takes a different approach: it ships with JavaScript, Python, and Shell (bash) support out of the box, so you can write scripts in the language you already work in.","source":"@site/docs/plugins/core-plugins/voiden-scripting.md","sourceDirName":"plugins/core-plugins","slug":"/plugins/core-plugins/voiden-scripting","permalink":"/docs/plugins/core-plugins/voiden-scripting","draft":false,"unlisted":false,"editUrl":"https://github.com/VoidenHQ/docs/tree/main/docs/plugins/core-plugins/voiden-scripting.md","tags":[],"version":"current","lastUpdatedAt":1773934382000,"sidebarPosition":1,"frontMatter":{"id":"voiden-scripting","title":"Voiden Scripting","sidebar_label":"Voiden Scripting","sidebar_position":1},"sidebar":"tutorialSidebar","previous":{"title":"GraphQL","permalink":"/docs/plugins/core-plugins/voiden-graphql"},"next":{"title":"Voiden Stitch","permalink":"/docs/plugins/core-plugins/voiden-stitch/"}}');var t=s(4848),i=s(8453),a=s(1470),o=s(9365);const l={id:"voiden-scripting",title:"Voiden Scripting",sidebar_label:"Voiden Scripting",sidebar_position:1},d=void 0,c={},u=[{value:"Blocks",id:"blocks",level:2},{value:"How Scripts Run",id:"how-scripts-run",level:2},{value:"Voiden API",id:"voiden-api",level:2},{value:"Environment Variables",id:"environment-variables",level:2},{value:"Runtime Variables",id:"runtime-variables",level:2},{value:"Logging",id:"logging",level:2},{value:"Assertions",id:"assertions",level:2}];function h(e){const n={a:"a",blockquote:"blockquote",code:"code",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["Scripting is a core part of serious API tooling. It lets you go beyond static requests \u2014 dynamically injecting auth tokens, chaining requests by passing data between them, validating responses automatically, and encoding custom logic that no UI alone can express. Most API clients that support scripting limit you to JavaScript. Voiden takes a different approach: it ships with ",(0,t.jsx)(n.strong,{children:"JavaScript"}),", ",(0,t.jsx)(n.strong,{children:"Python"}),", and ",(0,t.jsx)(n.strong,{children:"Shell (bash)"})," support out of the box, so you can write scripts in the language you already work in."]}),"\n",(0,t.jsx)(n.p,{children:"Scripts run at two stages:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Pre Script"})," \u2014 executes before the request is sent. Use it to inject headers, set variables, or cancel the request."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.strong,{children:"Post Script"})," \u2014 executes after the response is received. Use it to assert values, extract data, or store results."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["Both stages share the same ",(0,t.jsx)(n.code,{children:"voiden"})," API, giving you full access to env, variables, logging, and assertions."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"blocks",children:"Blocks"}),"\n",(0,t.jsxs)(n.p,{children:["Voiden Scripting introduces two blocks you can add to your ",(0,t.jsx)(n.code,{children:".void"})," file:"]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Block"}),(0,t.jsx)(n.th,{children:"Description"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.a,{href:"/docs/core-features-section/voiden-blocks/pre-post-script/pre-script",children:(0,t.jsx)(n.strong,{children:"Pre-Script"})})}),(0,t.jsx)(n.td,{children:"Runs before the request is sent. Use it to modify headers, body, params, or cancel the request entirely."})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.a,{href:"/docs/core-features-section/voiden-blocks/pre-post-script/post-script",children:(0,t.jsx)(n.strong,{children:"Post-Script"})})}),(0,t.jsx)(n.td,{children:"Runs after the response is received. Use it to assert values, extract data, and store variables for later requests."})]})]})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"how-scripts-run",children:"How Scripts Run"}),"\n",(0,t.jsx)(n.p,{children:"Voiden runs your scripts in an isolated environment so they can't interfere with the app. The way this works differs slightly between languages."}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"JavaScript"})," scripts are sent to a separate Node.js process. The ",(0,t.jsx)(n.code,{children:"voiden"})," API (env, variables) communicates back to the app via message passing, so every API call returns a Promise. This is why you need ",(0,t.jsx)(n.code,{children:"await"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Python"})," scripts also run in a separate process, but before the script starts, Voiden pre-loads all your environment variables and runtime variables and passes them in directly. So the ",(0,t.jsx)(n.code,{children:"voiden"})," API is just plain synchronous method calls \u2014 no ",(0,t.jsx)(n.code,{children:"await"})," needed."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Shell (bash)"})," scripts run in a bash subprocess. The ",(0,t.jsx)(n.code,{children:"voiden"})," API is exposed as shell functions. Use ",(0,t.jsx)(n.code,{children:"$(voiden.command)"})," to capture return values, and call setters without parentheses \u2014 bash will treat ",(0,t.jsx)(n.code,{children:"(
1)"})," as a syntax error."]}),"\n",(0,t.jsxs)(a.A,{children:[(0,t.jsx)(o.A,{value:"js",label:"JavaScript",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'// Pre-request script Example\n\ntry {\n // Timestamp\n const timestamp = new Date().toISOString();\n await voiden.variables.set("REQUEST_TIMESTAMP", timestamp);\n\n // Random request ID\n const requestId = "req_" + Math.random().toString(36).substring(2, 10);\n await voiden.variables.set("REQUEST_ID", requestId);\n\n // Add header\n voiden.request.headers.push({\n key: "X-Request-Id",\n value: requestId,\n });\n\n // Inject auth token\n const token = await voiden.variables.get("AUTH_TOKEN");\n\n if (token) {\n voiden.request.headers.push({\n key: "Authorization",\n value: `Bearer ${token}`,\n });\n }\n\n voiden.log("Pre-script executed successfully");\n\n} catch (error) {\n voiden.log("error", "Pre-script error:", error);\n}\n'})})}),(0,t.jsx)(o.A,{value:"py",label:"Python",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-py",children:'# Pre-request script Example\n\ntry:\n import random\n import string\n from datetime import datetime\n\n # Timestamp\n timestamp = datetime.utcnow().isoformat()\n voiden.variables.set("REQUEST_TIMESTAMP", timestamp)\n # Random request ID\n request_id = "req_" + \'\'.join(random.choices(string.ascii_lowercase + string.digits, k=8))\n voiden.variables.set("REQUEST_ID", request_id)\n # Add header\n voiden.request.headers.push({\n "key": "X-Request-Id",\n "value": request_id\n })\n # Inject auth token\n token = voiden.variables.get("AUTH_TOKEN")\n\n if token:\n voiden.request.headers.push({\n "key": "Authorization",\n "value": f"Bearer {token}"\n })\n\n voiden.log("Pre-script executed successfully")\n\nexcept Exception as e:\n voiden.log("error", "Pre-script error:", str(e))\n'})})}),(0,t.jsx)(o.A,{value:"sh",label:"Shell",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'# Pre-request script Example\n\n# Timestamp (requires date command)\ntimestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")\nvoiden.variables.set "REQUEST_TIMESTAMP" "$timestamp"\n\n# Random request ID\nrequest_id="req_$(cat /dev/urandom | LC_ALL=C tr -dc \'a-z0-9\' | head -c 8)"\nvoiden.variables.set "REQUEST_ID" "$request_id"\n\n# Add header\nvoiden.request.headers.push "X-Request-Id" "$request_id"\n\n# Inject auth token\ntoken=$(voiden.variables.get "AUTH_TOKEN")\n\nif [ -n "$token" ]; then\n voiden.request.headers.push "Authorization" "Bearer $token"\nfi\n\nvoiden.log "Pre-script executed successfully"\n'})})})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"voiden-api",children:"Voiden API"}),"\n",(0,t.jsxs)(n.p,{children:["Voiden injects a global ",(0,t.jsx)(n.code,{children:"voiden"})," object into every script. This is the main interface for interacting with your request, response, environment, and runtime state."]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"API"}),(0,t.jsx)(n.th,{children:"Description"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"voiden.env"})}),(0,t.jsx)(n.td,{children:"Read environment variables from the active environment"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"voiden.variables"})}),(0,t.jsx)(n.td,{children:"Get and set runtime variables shared across requests"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"voiden.log()"})}),(0,t.jsx)(n.td,{children:"Output messages to Voiden's script log panel"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"voiden.assert()"})}),(0,t.jsx)(n.td,{children:"Run assertions and surface results in the Response panel"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"voiden.request"})}),(0,t.jsx)(n.td,{children:"Access and mutate the outgoing request (headers, body, params)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"voiden.response"})}
1),(0,t.jsx)(n.td,{children:"Read the received response (status, body, headers)"})]})]})]}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"JavaScript"})," \u2014 most ",(0,t.jsx)(n.code,{children:"voiden"})," API calls are async and require ",(0,t.jsx)(n.code,{children:"await"})," since they communicate via message passing to the main app process."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Python"})," \u2014 all calls are synchronous. Voiden pre-loads state before the script runs, so no ",(0,t.jsx)(n.code,{children:"await"})," is needed."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Shell"})," \u2014 all ",(0,t.jsx)(n.code,{children:"voiden"})," API calls are bash functions. Use ",(0,t.jsx)(n.code,{children:"$(voiden.command)"})," to capture return values. Do not use parentheses for calls \u2014 use ",(0,t.jsx)(n.code,{children:'voiden.log "msg"'}),", not ",(0,t.jsx)(n.code,{children:'voiden.log("msg")'}),"."]}),"\n"]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"environment-variables",children:"Environment Variables"}),"\n",(0,t.jsx)(n.p,{children:"Environment variables are read-only values configured in your active environment."}),"\n",(0,t.jsxs)(a.A,{children:[(0,t.jsx)(o.A,{value:"js",label:"JavaScript",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'const token = await voiden.env.get("API_TOKEN");\n'})})}),(0,t.jsx)(o.A,{value:"py",label:"Python",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-py",children:'token = voiden.env.get("API_TOKEN")\n'})})}),(0,t.jsx)(o.A,{value:"sh",label:"Shell",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'token=$(voiden.env.get "API_TOKEN")\n'})})})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"runtime-variables",children:"Runtime Variables"}),"\n",(0,t.jsx)(n.p,{children:"Runtime variables are dynamic values you can create, read, and update during execution. They are useful for passing data between requests."}),"\n",(0,t.jsxs)(a.A,{children:[(0,t.jsx)(o.A,{value:"js",label:"JavaScript",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'await voiden.variables.set("key", "value");\nconst val = await voiden.variables.get("key");\n'})})}),(0,t.jsx)(o.A,{value:"py",label:"Python",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-py",children:'voiden.variables.set("key", "value")\nval = voiden.variables.get("key")\n'})})}),(0,t.jsx)(o.A,{value:"sh",label:"Shell",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'voiden.variables.set "key" "value"\nval=$(voiden.variables.get "key")\n'})})})]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"pre-runtime",src:s(8793).A+"",width:"2440",height:"1638"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"logging",children:"Logging"}),"\n",(0,t.jsx)(n.p,{children:"Logs appear in Voiden's UI and help you debug, trace flow, or monitor values during script execution."}),"\n",(0,t.jsxs)(a.A,{children:[(0,t.jsx)(o.A,{value:"js",label:"JavaScript",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'voiden.log("message");\nvoiden.log("info", "pre-script ran");\nvoiden.log("warn", "token missing");\nvoiden.log("error", "request aborted");\nvoiden.log("debug", "body:", voiden.request.body);\n'})})}),(0,t.jsx)(o.A,{value:"py",label:"Python",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-py",children:'voiden.log("message")\nvoiden.log("info", "pre-script ran")\nvoiden.log("warn", "token missing")\nvoiden.log("error", "request aborted")\nvoiden.log("debug", "body:", voiden.request.body)\n'})})}),(0,t.jsx)(o.A,{value:"sh",label:"Shell",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'voiden.log "message"\nvoiden.log info "pre-script ran"\nvoiden.log warn "token missing"\nvoiden.log error "request aborted"\nvoiden.log debug "body: $(voiden.request.body)"\n'})})})]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Voiden Script Log",src:s(7151).A+"",width:"2450",height:"1638"})}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Supported levels:"})," ",(0,t.jsx)(n.code,{children:"log"})," \xb7 ",(0,t.jsx)(n.code,{children:"info"})," \xb7 ",(0,t.jsx)(n.code,{children:"debug"})," \xb7 ",(0,t.jsx)(n.code,{children:"warn"})," \xb7 ",(0,t.jsx)(n.code,{children:"error"})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h2,{id:"assertions",children:"Assertions"}),"\n",(0,t.jsx)(n.p,{children:"Assertions let you validate values and surface pass/fail results in the Response panel."}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"Voiden Script Assertion",
1src:s(5228).A+"",width:"2450",height:"1100"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:"voiden.assert(actual, operator, expectedValue, message);\n"})}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Description"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"actual"})}),(0,t.jsxs)(n.td,{children:["The value to test (e.g. ",(0,t.jsx)(n.code,{children:"voiden.response.status"}),")"]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"operator"})}),(0,t.jsxs)(n.td,{children:["Comparison operator (e.g. ",(0,t.jsx)(n.code,{children:'"=="'}),", ",(0,t.jsx)(n.code,{children:'"contains"'}),", ",(0,t.jsx)(n.code,{children:'"greater"'}),")"]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"expectedValue"})}),(0,t.jsx)(n.td,{children:"The value you expect"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"message"})}),(0,t.jsx)(n.td,{children:"(Optional) Label shown in the assertion result"})]})]})]}),"\n",(0,t.jsxs)(a.A,{children:[(0,t.jsx)(o.A,{value:"js",label:"JavaScript",default:!0,children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-js",children:'voiden.assert(voiden.response.status, "==", 200, "Status should be 200");\nvoiden.assert(voiden.response.body.name, "contains", "Voiden", "Name check");\n'})})}),(0,t.jsx)(o.A,{value:"py",label:"Python",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-py",children:'voiden.assert_(voiden.response.status, "==", 200, "Status should be 200")\nvoiden.assert_(voiden.response.body.name, "contains", "Voiden", "Name check")\n'})})}),(0,t.jsx)(o.A,{value:"sh",label:"Shell",children:(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'voiden.assert "$(voiden.response.status)" "==" "200" "Status should be 200"\nvoiden.assert "$(voiden.response.body)" "contains" "Voiden" "Name check"\n'})})})]})]})}function p(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},5228:(e,n,s)=>{s.d(n,{A:()=>r});const r=s.p+"assets/images/voiden-script-2e4d825ea51a6e234c7121303021b0bc.png"},7151:(e,n,s)=>{s.d(n,{A:()=>r});const r=s.p+"assets/images/voiden-log-1b9e861060cfc82a003d155a2c4f69d5.gif"},8453:(e,n,s)=>{s.d(n,{R:()=>a,x:()=>o});var r=s(6540);const t={},i=r.createContext(t);function a(e){const n=r.useContext(i);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),r.createElement(i.Provider,{value:n},e.children)}},8793:(e,n,s)=>{s.d(n,{A:()=>r});const r=s.p+"assets/images/output-5a740e1f33373010f1f864f7d4e89353.gif"},9365:(e,n,s)=>{s.d(n,{A:()=>a});s(6540);var r=s(4164);const t={tabItem:"tabItem_Ymn6"};var i=s(4848);function a({children:e,hidden:n,className:s}){return(0,i.jsx)("div",{role:"tabpanel",className:(0,r.A)(t.tabItem,s),hidden:n,children:e})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.