hackagent-webui 0.5.19.dev58__py3-none-any.whl → 0.5.22.dev61__py3-none-any.whl
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.
- hackagent_webui/__init__.py +1 -1
- hackagent_webui/static/404.html +1 -1
- hackagent_webui/static/VERSION +1 -1
- hackagent_webui/static/_next/static/chunks/634-67a19c764fc7a25a.js +1 -0
- hackagent_webui/static/_next/static/chunks/{924-a45ad002025944dc.js → 924-4691ca4c204d197d.js} +1 -1
- hackagent_webui/static/_next/static/chunks/app/agents/page-2e581fcca5116a94.js +1 -0
- hackagent_webui/static/_next/static/chunks/app/attacks/page-b2413be2a8ab61fc.js +1 -0
- hackagent_webui/static/_next/static/chunks/app/{layout-4344f2819815c745.js → layout-53ae64504962d5fe.js} +1 -1
- hackagent_webui/static/_next/static/chunks/app/profile/{page-41bc4e813fb2d240.js → page-4f889aaa12e23fb7.js} +1 -1
- hackagent_webui/static/_next/static/chunks/app/secrets/page-62bf5dba3522de29.js +1 -0
- hackagent_webui/static/_next/static/chunks/app/stats/page-275a2b415a2f1e9b.js +1 -0
- hackagent_webui/static/_next/static/css/62a118f1cf702f73.css +1 -0
- hackagent_webui/static/agents.html +1 -1
- hackagent_webui/static/agents.txt +5 -5
- hackagent_webui/static/api-keys.html +1 -1
- hackagent_webui/static/api-keys.txt +5 -5
- hackagent_webui/static/attacks.html +1 -1
- hackagent_webui/static/attacks.txt +5 -5
- hackagent_webui/static/campaign-export/styles.css +1 -1
- hackagent_webui/static/index.html +1 -1
- hackagent_webui/static/index.txt +5 -5
- hackagent_webui/static/profile.html +1 -1
- hackagent_webui/static/profile.txt +5 -5
- hackagent_webui/static/secrets.html +1 -1
- hackagent_webui/static/secrets.txt +5 -5
- hackagent_webui/static/stats.html +1 -1
- hackagent_webui/static/stats.txt +5 -5
- {hackagent_webui-0.5.19.dev58.dist-info → hackagent_webui-0.5.22.dev61.dist-info}/METADATA +1 -1
- {hackagent_webui-0.5.19.dev58.dist-info → hackagent_webui-0.5.22.dev61.dist-info}/RECORD +32 -32
- hackagent_webui/static/_next/static/chunks/634-0167d7c9c4879699.js +0 -1
- hackagent_webui/static/_next/static/chunks/app/agents/page-30de78974cc31585.js +0 -1
- hackagent_webui/static/_next/static/chunks/app/attacks/page-5350dcc2a9e9b220.js +0 -1
- hackagent_webui/static/_next/static/chunks/app/secrets/page-03ea34f740709d10.js +0 -1
- hackagent_webui/static/_next/static/chunks/app/stats/page-27c2367c193a9b7f.js +0 -1
- hackagent_webui/static/_next/static/css/3e762cbf3dad6acd.css +0 -1
- /hackagent_webui/static/_next/static/{VzQ9KvyvIVrq3jqBS3rC5 → 82FgAZ1KSMGssrdAF3Y7w}/_buildManifest.js +0 -0
- /hackagent_webui/static/_next/static/{VzQ9KvyvIVrq3jqBS3rC5 → 82FgAZ1KSMGssrdAF3Y7w}/_ssgManifest.js +0 -0
- {hackagent_webui-0.5.19.dev58.dist-info → hackagent_webui-0.5.22.dev61.dist-info}/WHEEL +0 -0
hackagent_webui/__init__.py
CHANGED
|
@@ -23,7 +23,7 @@ from pathlib import Path
|
|
|
23
23
|
|
|
24
24
|
# Replaced at build time with the PEP 440 version derived from the git tag
|
|
25
25
|
# (scripts/pep440-version.mjs). The placeholder is what a source checkout shows.
|
|
26
|
-
__version__ = "0.5.
|
|
26
|
+
__version__ = "0.5.22.dev61"
|
|
27
27
|
|
|
28
28
|
#: Present in every real bundle; its absence means the wheel was built without
|
|
29
29
|
#: running the export.
|
hackagent_webui/static/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--82FgAZ1KSMGssrdAF3Y7w--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/62a118f1cf702f73.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-ecae86322f0a33a1.js"/><script src="/_next/static/chunks/4bd1b696-409494caf8c83275.js" async=""></script><script src="/_next/static/chunks/493-34228dd02f768bba.js" async=""></script><script src="/_next/static/chunks/main-app-641b4390ed531d52.js" async=""></script><script src="/_next/static/chunks/abf9ae41-a2ad9357d01c2a31.js" async=""></script><script src="/_next/static/chunks/133-3d48df8e6274f1e3.js" async=""></script><script src="/_next/static/chunks/574-0cc0eddd7440f9e6.js" async=""></script><script src="/_next/static/chunks/619-7c7bed420eb7c654.js" async=""></script><script src="/_next/static/chunks/41-19701c9e1d5392fe.js" async=""></script><script src="/_next/static/chunks/583-78ba13009c3dc8f0.js" async=""></script><script src="/_next/static/chunks/727-3d5d954e608613b1.js" async=""></script><script src="/_next/static/chunks/784-27c51ffcb299d644.js" async=""></script><script src="/_next/static/chunks/259-252d18d6e44b253a.js" async=""></script><script src="/_next/static/chunks/924-4691ca4c204d197d.js" async=""></script><script src="/_next/static/chunks/app/layout-53ae64504962d5fe.js" async=""></script><script src="/_next/static/chunks/app/not-found-60bbe1f5c6cf66f2.js" async=""></script><meta name="robots" content="noindex"/><title>HackAgent Dashboard</title><meta name="description" content="Dashboard for HackAgent API"/><link rel="icon" href="/favicon.ico"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><script src="/_next/static/chunks/webpack-ecae86322f0a33a1.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[49359,[\"330\",\"static/chunks/abf9ae41-a2ad9357d01c2a31.js\",\"133\",\"static/chunks/133-3d48df8e6274f1e3.js\",\"574\",\"static/chunks/574-0cc0eddd7440f9e6.js\",\"619\",\"static/chunks/619-7c7bed420eb7c654.js\",\"41\",\"static/chunks/41-19701c9e1d5392fe.js\",\"583\",\"static/chunks/583-78ba13009c3dc8f0.js\",\"727\",\"static/chunks/727-3d5d954e608613b1.js\",\"784\",\"static/chunks/784-27c51ffcb299d644.js\",\"259\",\"static/chunks/259-252d18d6e44b253a.js\",\"924\",\"static/chunks/924-4691ca4c204d197d.js\",\"177\",\"static/chunks/app/layout-53ae64504962d5fe.js\"],\"Authorization\"]\n3:I[96280,[\"330\",\"static/chunks/abf9ae41-a2ad9357d01c2a31.js\",\"133\",\"static/chunks/133-3d48df8e6274f1e3.js\",\"574\",\"static/chunks/574-0cc0eddd7440f9e6.js\",\"619\",\"static/chunks/619-7c7bed420eb7c654.js\",\"41\",\"static/chunks/41-19701c9e1d5392fe.js\",\"583\",\"static/chunks/583-78ba13009c3dc8f0.js\",\"727\",\"static/chunks/727-3d5d954e608613b1.js\",\"784\",\"static/chunks/784-27c51ffcb299d644.js\",\"259\",\"static/chunks/259-252d18d6e44b253a.js\",\"924\",\"static/chunks/924-4691ca4c204d197d.js\",\"177\",\"static/chunks/app/layout-53ae64504962d5fe.js\"],\"default\"]\n4:I[9766,[],\"\"]\n5:I[98924,[],\"\"]\n6:I[52619,[\"619\",\"static/chunks/619-7c7bed420eb7c654.js\",\"345\",\"static/chunks/app/not-found-60bbe1f5c6cf66f2.js\"],\"\"]\n7:I[24431,[],\"OutletBoundary\"]\n9:I[15278,[],\"AsyncMetadataOutlet\"]\nb:I[24431,[],\"ViewportBoundary\"]\nd:I[24431,[],\"MetadataBoundary\"]\ne:\"$Sreact.suspense\"\n10:I[57150,[],\"\"]\n:HL[\"/_next/static/css/62a118f1cf702f73.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"82FgAZ1KSMGssrdAF3Y7w\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/62a118f1cf702f73.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"div\",null,{\"className\":\"flex items-center justify-center min-h-screen\",\"children\":[\"$\",\"div\",null,{\"className\":\"text-center\",\"children\":[[\"$\",\"h1\",null,{\"className\":\"text-4xl font-bold mb-4\",\"children\":\"404\"}],[\"$\",\"p\",null,{\"className\":\"text-gray-600 mb-8\",\"children\":\"Page not found\"}],[\"$\",\"$L6\",null,{\"href\":\"/\",\"className\":\"text-blue-600 hover:underline\",\"children\":\"Back to home\"}]]}]}],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]}]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"div\",null,{\"className\":\"flex items-center justify-center min-h-screen\",\"children\":[\"$\",\"div\",null,{\"className\":\"text-center\",\"children\":[[\"$\",\"h1\",null,{\"className\":\"text-4xl font-bold mb-4\",\"children\":\"404\"}],[\"$\",\"p\",null,{\"className\":\"text-gray-600 mb-8\",\"children\":\"Page not found\"}],[\"$\",\"$L6\",null,{\"href\":\"/\",\"className\":\"text-blue-600 hover:underline\",\"children\":\"Back to home\"}]]}]}],null,[\"$\",\"$L7\",null,{\"children\":[\"$L8\",[\"$\",\"$L9\",null,{\"promise\":\"$@a\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$Lb\",null,{\"children\":\"$Lc\"}],null],[\"$\",\"$Ld\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$e\",null,{\"fallback\":null,\"children\":\"$Lf\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$10\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"c:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n8:null\n"])</script><script>self.__next_f.push([1,"11:I[80622,[],\"IconMark\"]\na:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"HackAgent Dashboard\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Dashboard for HackAgent API\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/favicon.ico\"}],[\"$\",\"$L11\",\"3\",{}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"f:\"$a:metadata\"\n"])</script></body></html>
|
hackagent_webui/static/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.5.
|
|
1
|
+
0.5.22-stage
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[634],{1088:(e,t,a)=>{a.d(t,{DV:()=>E,Fj:()=>w,HF:()=>g,Iu:()=>A,MM:()=>k,MR:()=>x,QO:()=>l,Wk:()=>p,ZR:()=>f,ZW:()=>S,aV:()=>u,gK:()=>m,ky:()=>C,qn:()=>function e(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=[],r=e=>a?"".concat(a,".").concat(e):String(e);if(Array.isArray(t))t.forEach((t,a)=>n.push(...e(t,r(a))));else if(h(t))for(let[a,s]of Object.entries(t))(function(e){let t=e.trim().toLowerCase();return!t.endsWith("_env")&&Z.test(t)})(a)&&("api_key"===a?null!=s&&null===o(s):"string"==typeof s?""!==s&&"[REDACTED]"!==s:"number"==typeof s)?n.push(r(a)):n.push(...e(s,r(a)));return n},r6:()=>d,rR:()=>o,s6:()=>_,uZ:()=>c});let n={name:"hackagent/attacker-v1",connection:{provider:"hackagent",type:"OPENAI"}},r={name:"hackagent/judge-v1",connection:{provider:"hackagent",type:"OPENAI"}},s=/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;function l(e){return"${"+e+"}"}function o(e){var t,a;return"string"!=typeof e?null:null!=(a=null==(t=s.exec(e))?void 0:t[1])?a:null}function i(e){return{name:e.name,connection:{...e.connection}}}let c=["majority","any","mean","max"],d="majority",u=7,f=0,g=10,m=3;function x(e){return"mean"===e||"max"===e}let p={name:"",description:"",agentId:"",goals:{kind:"inline",goals:[]},attacks:[],judges:{count:1},passthrough:{}},h=e=>"object"==typeof e&&null!==e&&!Array.isArray(e);function v(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,a)=>v(e,t[a]));if(h(e)&&h(t)){let a=Object.keys(e);return a.length===Object.keys(t).length&&a.every(a=>a in t&&v(e[a],t[a]))}return!1}function j(e,t){return Object.fromEntries(Object.entries(e).filter(e=>{let[a]=e;return!t.includes(a)}))}function b(e,t){return e.find(e=>e.attackType===t)}let y=(e,t)=>v(e,t);function k(e){return Object.fromEntries(e.fields.map(e=>[e.key,e.default]))}function w(e,t){let a=e.description.trim(),{count:s,aggregation:l,threshold:o,custom:c=[]}=e.judges;return function e(t,a){let n={...t};for(let[t,r]of Object.entries(a))n[t]=h(n[t])&&h(r)?e(n[t],r):r;return n}({version:1,campaign:{name:e.name.trim(),...a?{description:a}:{}},dataset:{source:function(e){switch(e.kind){case"preset":return{type:"preset",name:e.name};case"inline":return{type:"inline",goals:e.goals};case"custom":return e.source}}(e.goals)},attacks:e.attacks.map(e=>(function(e,t){var a;let r=b(t,e.attackType),s=new Map(null==r?void 0:r.fields.map(e=>[e.key,e.default])),l={};for(let[t,a]of Object.entries(e.parameters))void 0!==a&&(s.has(t)&&v(a,s.get(t))||function(e,t,a){let n=t.split("."),r=e;for(let e of n.slice(0,-1))h(r[e])||(r[e]={}),r=r[e];r[n[n.length-1]]=a}(l,t,a));let o={...Object.fromEntries((null!=(a=null==r?void 0:r.requiredRoles)?a:[]).map(e=>[e,i(n)])),...e.roles};return{name:e.attackType,...Object.keys(l).length?{parameters:l}:{},...Object.keys(o).length?{roles:o}:{}}})(e,t)),evaluation:{judges:[...Array.from({length:s},()=>i(r)),...c],...l?{aggregation:l}:{},...void 0!==o?{threshold:o}:{}}},e.passthrough)}let N=["version","campaign","dataset","attacks","evaluation"],O=["target","execution"];function A(e,t){var a;if(!h(e))return{...p,goals:{kind:"inline",goals:[]},judges:{count:1},passthrough:{}};let s=h(e.campaign)?e.campaign:{},l=h(e.dataset)?e.dataset:{},o=h(e.evaluation)?e.evaluation:{},i=Array.isArray(o.judges)?o.judges:[],d=i.filter(e=>!y(e,r)),u=i.length-d.length,f={count:0===i.length?1:u};c.includes(o.aggregation)&&(f.aggregation=o.aggregation),"number"==typeof o.threshold&&(f.threshold=o.threshold),d.length&&(f.custom=d);let g=j(e,[...N,...O]),m=j(s,["name","description"]);Object.keys(m).length&&(g.campaign=m);let x=j(l,["source"]);Object.keys(x).length&&(g.dataset=x);let v=j(o,["judges","aggregation","threshold"]);return Object.keys(v).length&&(g.evaluation=v),{name:"string"==typeof s.name?s.name:"",description:"string"==typeof s.description?s.description:"",agentId:"",goals:"preset"===(a=h(l.source)?l.source:{}).type&&"string"==typeof a.name&&2===Object.keys(a).length?{kind:"preset",name:a.name}:"inline"===a.type&&Array.isArray(a.goals)&&2===Object.keys(a).length?{kind:"inline",goals:a.goals.map(String)}:Object.keys(a).length?{kind:"custom",source:a}:{kind:"inline",goals:[]},attacks:Array.isArray(e.attacks)?e.attacks.map(e=>(function(e,t){var a;let r=h(e)?e:{},s="string"==typeof r.name?r.name:"",l=b(t,s),o=null!=(a=null==l?void 0:l.requiredRoles)?a:[],i=Object.fromEntries(Object.entries(h(r.roles)?r.roles:{}).filter(e=>{let[t,a]=e;return!(o.includes(t)&&y(a,n))}));return{attackType:s,parameters:function(e,t){var a;let n=null!=(a=null==t?void 0:t.fields)?a:[],r=new Set(n.map(e=>e.key)),s={};for(let t of n){let a=function(e,t){let a=e;for(let e of t.split(".")){if(!h(a))return;a=a[e]}return a}(e,t.key);s[t.key]=void 0===a?t.default:a}let l=(e,t)=>{for(let[a,o]of Object.entries(e)){let e=t?"".concat(t,".").concat(a):a;r.has(e)||(n.some(t=>t.key.startsWith("".concat(e,".")))&&h(o)?l(o,e):s[e]=o)}};return l(e,""),s}(h(r.parameters)?r.parameters:{},l),...Object.keys(i).length?{roles:i}:{}}})(e,t)):[],judges:f,passthrough:g}}function C(e){var t,a;return Object.keys(e.passthrough).length>0||"custom"===e.goals.kind||(null!=(a=null==(t=e.judges.custom)?void 0:t.length)?a:0)>0||e.attacks.some(e=>e.roles&&Object.keys(e.roles).length>0)}function E(e){return"inline"===e.kind?e.goals.length>0:"preset"!==e.kind||""!==e.name}function _(e){let t={campaign:{},dataset:{},attacks:{},attackCards:{},evaluation:{},other:{}};for(let[r,s]of Object.entries(e)){let[e,...l]=r.split("."),o=l.join(".");if("attacks"===e){let e=Number(l[0]);if(l.length&&Number.isInteger(e)){var a,n;(null!=(n=(a=t.attackCards)[e])?n:a[e]={})[l.slice(1).join(".")]=s}else t.attacks[o]=s}else"campaign"===e||"dataset"===e||"evaluation"===e?t[e][o]=s:t.other[r]=s}return t}let z=e=>Array.isArray(e)?e.map(String).join(" "):String(e);function S(e){let t={spec:{},fields:{}};if(!h(e))return t;for(let[a,n]of Object.entries(e))if("spec"===a)if(h(n))for(let[e,a]of Object.entries(n))t.spec[e]=z(a);else t.spec.spec=z(n);else t.fields[a]=z(n);return t}let Z=/(?:^|[^a-z])(?:[a-z]*key|token|secret|password|passwd|auth|authorization|cookie|credentials?|signature|session)(?:$|[^a-z])/},18332:(e,t,a)=>{a.d(t,{Fc:()=>o,TN:()=>c,XL:()=>i});var n=a(95155);a(12115);var r=a(83101),s=a(64269);let l=(0,r.F)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function o(e){let{className:t,variant:a,...r}=e;return(0,n.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,s.cn)(l({variant:a}),t),...r})}function i(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"alert-title",className:(0,s.cn)("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...a})}function c(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"alert-description",className:(0,s.cn)("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...a})}},20243:(e,t,a)=>{a.d(t,{E:()=>s});var n=a(95155),r=a(64269);function s(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"skeleton",className:(0,r.cn)("bg-accent animate-pulse rounded-md",t),...a})}},22470:(e,t,a)=>{a.d(t,{M:()=>r});var n=a(95155);a(12115);let r=e=>{let{title:t,description:a,action:r,children:s,maxWidth:l="full",compact:o=!1}=e;return(0,n.jsxs)("div",{className:"w-full ".concat({full:"max-w-full","8xl":"max-w-[90rem]","7xl":"max-w-7xl","6xl":"max-w-6xl","5xl":"max-w-5xl","4xl":"max-w-4xl","3xl":"max-w-3xl","2xl":"max-w-2xl"}[l]||"max-w-full"," mx-auto ").concat(o?"py-3 space-y-3":"py-6 space-y-6"),children:[t&&(0,n.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 border-b ".concat(o?"px-4 pb-3":"px-6 pb-5"),children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:t}),a&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:a})]}),r&&(0,n.jsx)("div",{className:"flex-shrink-0 pt-0.5",children:r})]}),s]})}},25733:(e,t,a)=>{a.d(t,{i:()=>n});async function n(e){let t=[];for(let n=1;;n++){var a;let r=await e(n);if(t.push(...null!=(a=r.results)?a:[]),!r.next)return t}}},35835:(e,t,a)=>{a.d(t,{T:()=>s});var n=a(95155);a(12115);var r=a(98053);let s=e=>{let{open:t,onOpenChange:a,title:s,description:l,onConfirm:o,confirmText:i="Confirm",cancelText:c="Cancel",variant:d="default"}=e;return(0,n.jsx)(r.Lt,{open:t,onOpenChange:a,children:(0,n.jsxs)(r.EO,{children:[(0,n.jsxs)(r.wd,{children:[(0,n.jsx)(r.r7,{children:s}),(0,n.jsx)(r.$v,{children:l})]}),(0,n.jsxs)(r.ck,{children:[(0,n.jsx)(r.Zr,{children:c}),(0,n.jsx)(r.Rx,{onClick:()=>{o(),a(!1)},className:"destructive"===d?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"",children:i})]})]})})}},51834:(e,t,a)=>{a.d(t,{Cf:()=>u,Es:()=>g,HM:()=>c,L3:()=>m,c7:()=>f,lG:()=>o,rr:()=>x});var n=a(95155);a(12115);var r=a(88292),s=a(65229),l=a(64269);function o(e){let{...t}=e;return(0,n.jsx)(r.bL,{"data-slot":"dialog",...t})}function i(e){let{...t}=e;return(0,n.jsx)(r.ZL,{"data-slot":"dialog-portal",...t})}function c(e){let{...t}=e;return(0,n.jsx)(r.bm,{"data-slot":"dialog-close",...t})}function d(e){let{className:t,...a}=e;return(0,n.jsx)(r.hJ,{"data-slot":"dialog-overlay",className:(0,l.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function u(e){let{className:t,children:a,...o}=e;return(0,n.jsxs)(i,{"data-slot":"dialog-portal",children:[(0,n.jsx)(d,{}),(0,n.jsxs)(r.UC,{"data-slot":"dialog-content",className:(0,l.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...o,children:[a,(0,n.jsxs)(r.bm,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,n.jsx)(s.A,{}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function f(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"dialog-header",className:(0,l.cn)("flex flex-col gap-2 text-center sm:text-left",t),...a})}function g(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"dialog-footer",className:(0,l.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function m(e){let{className:t,...a}=e;return(0,n.jsx)(r.hE,{"data-slot":"dialog-title",className:(0,l.cn)("text-lg leading-none font-semibold",t),...a})}function x(e){let{className:t,...a}=e;return(0,n.jsx)(r.VY,{"data-slot":"dialog-description",className:(0,l.cn)("text-muted-foreground text-sm",t),...a})}},56419:(e,t,a)=>{a.d(t,{p:()=>r});var n=a(95155);a(12115);let r=e=>{let{icon:t,title:a,description:r,action:s}=e;return(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center text-center py-12 px-4",children:[(0,n.jsx)("div",{className:"rounded-full bg-muted p-3 mb-4",children:(0,n.jsx)(t,{className:"h-10 w-10 text-muted-foreground"})}),(0,n.jsx)("h3",{className:"text-lg font-semibold mb-2",children:a}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground max-w-sm mb-6",children:r}),s&&(0,n.jsx)("div",{children:s})]})}},65142:(e,t,a)=>{a.d(t,{p:()=>s});var n=a(95155);a(12115);var r=a(64269);function s(e){let{className:t,type:a,...s}=e;return(0,n.jsx)("input",{type:a,"data-slot":"input",className:(0,r.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...s})}},74672:(e,t,a)=>{a.d(t,{q:()=>g});var n=a(95155),r=a(12115),s=a(38775),l=a(3998),o=a(51834),i=a(65142),c=a(76444),d=a(7831);let u=/^[A-Z][A-Z0-9_]{1,63}$/;async function f(e){if(e instanceof s.o3e){let t=null;try{t=await e.response.json()}catch(e){}if(t&&"object"==typeof t){let e=t;if("string"==typeof e.error)return e.error;if("string"==typeof e.detail)return e.detail;let a=Object.entries(e).map(e=>{let[t,a]=e;return"".concat(t,": ").concat(Array.isArray(a)?a.join(" "):String(a))});if(a.length)return a.join("; ")}return"Could not save the secret (HTTP ".concat(e.response.status,").")}return"Could not save the secret."}function g(e){let{open:t,onOpenChange:a,presetName:s,onSaved:g}=e,[m,x]=(0,r.useState)(null!=s?s:""),[p,h]=(0,r.useState)(""),[v,j]=(0,r.useState)(!1),[b,y]=(0,r.useState)(null);(0,r.useEffect)(()=>{h(""),y(null),t&&x(null!=s?s:"")},[t,s]);let k=u.test(m),w=k&&p.length>0&&!v,N=async()=>{if(w){j(!0),y(null);try{await d.Ft.secretCreate({secretWriteRequest:{name:m,value:p}}),h(""),g(m)}catch(e){y(await f(e))}finally{j(!1)}}};return(0,n.jsx)(o.lG,{open:t,onOpenChange:a,children:(0,n.jsxs)(o.Cf,{children:[(0,n.jsxs)(o.c7,{children:[(0,n.jsx)(o.L3,{children:"Add secret"}),(0,n.jsx)(o.rr,{children:"Stored encrypted for your organization. The value cannot be read back after saving."})]}),(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)(c.J,{htmlFor:"secret-name",children:"Name"}),(0,n.jsx)(i.p,{id:"secret-name",value:m,readOnly:!!s,onChange:e=>x(e.target.value),placeholder:"OPENAI_API_KEY",autoComplete:"off"}),m&&!k&&(0,n.jsx)("p",{className:"text-xs text-destructive",children:"Use capital letters, digits and underscores, starting with a letter (2 to 64 characters)."})]}),(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)(c.J,{htmlFor:"secret-value",children:"Value"}),(0,n.jsx)(i.p,{id:"secret-value",type:"password",value:p,onChange:e=>h(e.target.value),autoComplete:"off"})]}),b&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:b})]}),(0,n.jsxs)(o.Es,{children:[(0,n.jsx)(l.$,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),(0,n.jsx)(l.$,{onClick:N,disabled:!w,children:v?"Saving…":"Save secret"})]})]})})}},76444:(e,t,a)=>{a.d(t,{J:()=>l});var n=a(95155);a(12115);var r=a(85408),s=a(64269);function l(e){let{className:t,...a}=e;return(0,n.jsx)(r.b,{"data-slot":"label",className:(0,s.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...a})}},87270:(e,t,a)=>{a.d(t,{A0:()=>l,BF:()=>o,Hj:()=>i,XI:()=>s,nA:()=>d,nd:()=>c,r6:()=>u});var n=a(95155);a(12115);var r=a(64269);function s(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,n.jsx)("table",{"data-slot":"table",className:(0,r.cn)("w-full caption-bottom text-sm",t),...a})})}function l(e){let{className:t,...a}=e;return(0,n.jsx)("thead",{"data-slot":"table-header",className:(0,r.cn)("[&_tr]:border-b",t),...a})}function o(e){let{className:t,...a}=e;return(0,n.jsx)("tbody",{"data-slot":"table-body",className:(0,r.cn)("[&_tr:last-child]:border-0",t),...a})}function i(e){let{className:t,...a}=e;return(0,n.jsx)("tr",{"data-slot":"table-row",className:(0,r.cn)("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...a})}function c(e){let{className:t,...a}=e;return(0,n.jsx)("th",{"data-slot":"table-head",className:(0,r.cn)("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...a})}function d(e){let{className:t,...a}=e;return(0,n.jsx)("td",{"data-slot":"table-cell",className:(0,r.cn)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...a})}function u(e){let{className:t,...a}=e;return(0,n.jsx)("caption",{"data-slot":"table-caption",className:(0,r.cn)("text-muted-foreground mt-4 text-sm",t),...a})}},98053:(e,t,a)=>{a.d(t,{$v:()=>x,EO:()=>u,Lt:()=>o,Rx:()=>p,Zr:()=>h,ck:()=>g,r7:()=>m,tv:()=>i,wd:()=>f});var n=a(95155);a(12115);var r=a(35646),s=a(64269),l=a(3998);function o(e){let{...t}=e;return(0,n.jsx)(r.bL,{"data-slot":"alert-dialog",...t})}function i(e){let{...t}=e;return(0,n.jsx)(r.l9,{"data-slot":"alert-dialog-trigger",...t})}function c(e){let{...t}=e;return(0,n.jsx)(r.ZL,{"data-slot":"alert-dialog-portal",...t})}function d(e){let{className:t,...a}=e;return(0,n.jsx)(r.hJ,{"data-slot":"alert-dialog-overlay",className:(0,s.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function u(e){let{className:t,...a}=e;return(0,n.jsxs)(c,{children:[(0,n.jsx)(d,{}),(0,n.jsx)(r.UC,{"data-slot":"alert-dialog-content",className:(0,s.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...a})]})}function f(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,s.cn)("flex flex-col gap-2 text-center sm:text-left",t),...a})}function g(e){let{className:t,...a}=e;return(0,n.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,s.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function m(e){let{className:t,...a}=e;return(0,n.jsx)(r.hE,{"data-slot":"alert-dialog-title",className:(0,s.cn)("text-lg font-semibold",t),...a})}function x(e){let{className:t,...a}=e;return(0,n.jsx)(r.VY,{"data-slot":"alert-dialog-description",className:(0,s.cn)("text-muted-foreground text-sm",t),...a})}function p(e){let{className:t,...a}=e;return(0,n.jsx)(r.rc,{className:(0,s.cn)((0,l.r)(),t),...a})}function h(e){let{className:t,...a}=e;return(0,n.jsx)(r.ZD,{className:(0,s.cn)((0,l.r)({variant:"outline"}),t),...a})}}}]);
|
hackagent_webui/static/_next/static/chunks/{924-a45ad002025944dc.js → 924-4691ca4c204d197d.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[924],{3998:(e,t,a)=>{a.d(t,{$:()=>c,r:()=>s});var n=a(95155);a(12115);var i=a(32467),o=a(83101),r=a(64269);let s=(0,o.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function c(e){let{className:t,variant:a,size:o,asChild:c=!1,...u}=e,l=c?i.DX:"button";return(0,n.jsx)(l,{"data-slot":"button",className:(0,r.cn)(s({variant:a,size:o,className:t})),...u})}},7831:(e,t,a)=>{a.d(t,{Bm:()=>k,DR:()=>c,Ft:()=>y,Iu:()=>w,KC:()=>p,ME:()=>l,gb:()=>g,in:()=>u,ki:()=>r,nu:()=>T,ui:()=>h,userApi:()=>f,vm:()=>d});var n=a(38775);let i=(0,a(41444).h)("apiClient"),o=null;function r(e){o=e,i.debug(e?"Access token set":"Access token cleared")}let s=async()=>(o||i.debug("No access token available."),o),c=new n.Vk6({basePath:"/api/proxy",middleware:[{pre:async e=>{i.debug("Running pre-request middleware...");let t=await s();t?(i.debug("Token found, adding Authorization header."),e.init.headers={...e.init.headers,Authorization:"Bearer ".concat(t)}):i.warn("No token found, Authorization header not added.")},post:async e=>{let t=e.response.headers.get("content-type");if(!e.response.ok&&t&&!t.includes("application/json")){let a=await e.response.text();throw i.error({status:e.response.status,contentType:t,preview:a.substring(0,200)},"API returned non-JSON response"),Error("API error ".concat(e.response.status,": Server returned ").concat(t," instead of JSON. Check API endpoint and CORS configuration."))}}}]}),u=new n.cwn(c),l=new n.uzR(c),h=new n.cdi(c),d=new n.Lev(c),g=new n.At2(c),f=new n.ipj(c),w=new n.UYx(c),p=new n.OgW(c),T=new n.XoK(c),k=new n.jhh(c),y=new n.ZLz(c)},38775:(e,t,a)=>{a.d(t,{cwn:()=>F,OgW:()=>H,Lev:()=>V,jhh:()=>$,Vk6:()=>i,XoK:()=>X,on2:()=>C,At2:()=>Y,UYx:()=>Z,o3e:()=>s,cdi:()=>Q,v3H:()=>ee,uzR:()=>et,qjb:()=>q,isU:()=>x,ZLz:()=>ea,S5d:()=>v,Esj:()=>z,ipj:()=>en,JlS:()=>U});let n="http://localhost".replace(/\/+$/,"");class i{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:n}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(n=>(function t(a,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=i+(i.length?"[".concat(a,"]"):a);if(n instanceof Array){let e=n.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(o),"="));return"".concat(encodeURIComponent(o),"=").concat(e)}return n instanceof Set?t(a,Array.from(n),i):n instanceof Date?"".concat(encodeURIComponent(o),"=").concat(encodeURIComponent(n.toISOString())):n instanceof Object?e(n,o):"".concat(encodeURIComponent(o),"=").concat(encodeURIComponent(String(n)))})(n,t[n],a)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){this.configuration=e}}let o=new i;class r{withMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=this.clone();return n.middleware=n.middleware.concat(...t),n}withPreMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=t.map(e=>({pre:e}));return this.withMiddleware(...n)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=t.map(e=>({post:e}));return this.withMiddleware(...n)}isJsonMime(e){return!!e&&r.jsonRegex.test(e)}async request(e,t){let{url:a,init:n}=await this.createFetchParams(e,t),i=await this.fetchApi(a,n);if(i&&i.status>=200&&i.status<300)return i;throw new s(i,"Response returned an error code")}async createFetchParams(e,t){var a,n;let i,o=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(o+="?"+this.configuration.queryParamsStringify(e.query));let r=Object.assign({},this.configuration.headers,e.headers);Object.keys(r).forEach(e=>void 0===r[e]?delete r[e]:{});let s={method:e.method,headers:r,body:e.body,credentials:this.configuration.credentials},c={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return a=c.body,i="undefined"!=typeof FormData&&a instanceof FormData||c.body instanceof URLSearchParams||(n=c.body,"undefined"!=typeof Blob&&n instanceof Blob)?c.body:this.isJsonMime(r["Content-Type"])?JSON.stringify(c.body):c.body,{url:o,init:{...c,body:i}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=o){this.configuration=e,this.fetchApi=async(e,t)=>{let a,n={url:e,init:t};for(let e of this.middleware)e.pre&&(n=await e.pre({fetch:this.fetchApi,...n})||n);try{a=await (this.configuration.fetchApi||fetch)(n.url,n.init)}catch(e){for(let t of this.middleware)t.onError&&(a=await t.onError({fetch:this.fetchApi,url:n.url,init:n.init,error:e,response:a?a.clone():void 0})||a);if(void 0===a)if(e instanceof Error)throw new c(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(a=await e.post({fetch:this.fetchApi,url:n.url,init:n.init,response:a.clone()})||a);return a},this.middleware=e.middleware}}r.jsonRegex=RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");class s extends Error{constructor(e,t){super(t),this.response=e,this.name="ResponseError"}}class c extends Error{constructor(e,t){super(t),this.cause=e,this.name="FetchError"}}class u extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}class l{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){this.raw=e,this.transformer=t}}class h{async value(){}constructor(e){this.raw=e}}function d(e){var t;return null==(t=e)?t:{id:t.id,timestamp:new Date(t.timestamp),apiKeyPrefix:t.api_key_prefix,userUsername:t.user_username,organizationName:t.organization_name,modelIdUsed:t.model_id_used,apiEndpoint:t.api_endpoint,inputTokens:t.input_tokens,outputTokens:t.output_tokens,creditsDeducted:t.credits_deducted,requestPayloadPreview:t.request_payload_preview,responsePayloadPreview:t.response_payload_preview}}function g(e,t){return null==e?e:{id:e.id,name:e.name}}function f(e,t){return null==e?e:{user:e.user,username:e.username,organization:e.organization}}function w(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,endpoint:t.endpoint,agentType:t.agent_type,description:null==t.description?void 0:t.description,config:t.config,organization:t.organization,organizationDetail:g(t.organization_detail,!1),owner:t.owner,ownerDetail:f(t.owner_detail,!1),createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function p(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,config:e.config}}function T(e){var t;return null==(t=e)?t:{id:t.id,type:t.type,agent:t.agent,agentName:t.agent_name,owner:t.owner,ownerUsername:t.owner_username,organization:t.organization,organizationName:t.organization_name,_configuration:t.configuration,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function k(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{type:e.type,agent:e.agent,configuration:e._configuration}}function y(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,description:null==t.description?void 0:t.description,agent:t.agent,spec:t.spec,organization:t.organization,owner:t.owner,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function m(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,agent:e.agent,spec:e.spec}}function A(e){var t;return null==(t=e)?t:{name:t.name,description:t.description}}function R(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{claimed_by:e.claimedBy}}let v={Pending:"PENDING",Running:"RUNNING",Completed:"COMPLETED",Failed:"FAILED",Cancelled:"CANCELLED"},q={Cloud:"cloud",Local:"local",Cli:"cli"},z={ToolCall:"TOOL_CALL",ToolResponse:"TOOL_RESPONSE",AgentThought:"AGENT_THOUGHT",AgentResponseChunk:"AGENT_RESPONSE_CHUNK",Other:"OTHER",McpStep:"MCP_STEP",A2AComm:"A2A_COMM"};function _(e){var t,a=e;if(null==a)return a;return{id:a.id,result:a.result,sequence:a.sequence,stepType:null==a.step_type?void 0:(t=a.step_type,t),timestamp:new Date(a.timestamp),content:null==a.content?void 0:a.content}}let C={NotEvaluated:"NOT_EVALUATED",SuccessfulJailbreak:"SUCCESSFUL_JAILBREAK",FailedJailbreak:"FAILED_JAILBREAK",ErrorAgentResponse:"ERROR_AGENT_RESPONSE",ErrorTestFramework:"ERROR_TEST_FRAMEWORK",PassedCriteria:"PASSED_CRITERIA",FailedCriteria:"FAILED_CRITERIA"};function B(e){var t,a=e;if(null==a)return a;return{id:a.id,run:a.run,runId:a.run_id,requestPayload:null==a.request_payload?void 0:a.request_payload,responseStatusCode:null==a.response_status_code?void 0:a.response_status_code,responseHeaders:null==a.response_headers?void 0:a.response_headers,responseBody:null==a.response_body?void 0:a.response_body,latencyMs:null==a.latency_ms?void 0:a.latency_ms,detectedToolCalls:null==a.detected_tool_calls?void 0:a.detected_tool_calls,evaluationStatus:null==a.evaluation_status?void 0:(t=a.evaluation_status,t),evaluationNotes:null==a.evaluation_notes?void 0:a.evaluation_notes,evaluationMetrics:null==a.evaluation_metrics?void 0:a.evaluation_metrics,agentSpecificData:null==a.agent_specific_data?void 0:a.agent_specific_data,goal:null==a.goal?void 0:a.goal,goalIndex:null==a.goal_index?void 0:a.goal_index,timestamp:new Date(a.timestamp),traces:null==a.traces?void 0:a.traces.map(_)}}function P(e,t){var a,n;if(null==e)return e;return{id:e.id,agent:e.agent,agentName:e.agent_name,attack:e.attack,owner:e.owner,ownerUsername:e.owner_username,organization:e.organization,organizationName:e.organization_name,runConfig:e.run_config,timestamp:new Date(e.timestamp),status:(a=e.status,a),runNotes:e.run_notes,executor:(n=e.executor,n),campaign:e.campaign,parent:e.parent,claimedAt:null==e.claimed_at?null:new Date(e.claimed_at),claimedBy:e.claimed_by,heartbeatAt:null==e.heartbeat_at?null:new Date(e.heartbeat_at),cancelRequestedAt:null==e.cancel_requested_at?null:new Date(e.cancel_requested_at),finishedAt:null==e.finished_at?null:new Date(e.finished_at),results:e.results.map(B),runToken:null==e.run_token?void 0:e.run_token,env:null==e.env?void 0:e.env}}function I(e,t){var a,n;if(null==e)return e;return{id:e.id,agent:e.agent,agentName:e.agent_name,attack:e.attack,owner:e.owner,ownerUsername:e.owner_username,organization:e.organization,organizationName:e.organization_name,runConfig:e.run_config,timestamp:new Date(e.timestamp),status:(a=e.status,a),runNotes:e.run_notes,executor:(n=e.executor,n),campaign:e.campaign,parent:e.parent,claimedAt:null==e.claimed_at?null:new Date(e.claimed_at),claimedBy:e.claimed_by,heartbeatAt:null==e.heartbeat_at?null:new Date(e.heartbeat_at),cancelRequestedAt:null==e.cancel_requested_at?null:new Date(e.cancel_requested_at),finishedAt:null==e.finished_at?null:new Date(e.finished_at),results:e.results.map(B),command:null==e.command?void 0:e.command}}function K(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at),credits:t.credits,creditsLastUpdated:new Date(t.credits_last_updated)}}function b(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name}}let U={Jailbroken:"JAILBROKEN",Mitigated:"MITIGATED",Error:"ERROR",Pending:"PENDING"};function S(e){var t,a=e;if(null==a)return a;return{goalIndex:a.goal_index,goal:a.goal,category:a.category,attempts:a.attempts,successfulJailbreaks:a.successful_jailbreaks,failedJailbreaks:a.failed_jailbreaks,errors:a.errors,notEvaluated:a.not_evaluated,verdict:(t=a.verdict,t),bestScore:a.best_score,decidingResult:a.deciding_result,firstTimestamp:new Date(a.first_timestamp),lastTimestamp:new Date(a.last_timestamp)}}function x(e){var t,a,n=e;if(null==n)return n;return{id:n.id,agent:n.agent,agentName:n.agent_name,attack:n.attack,attackType:n.attack_type,owner:n.owner,ownerUsername:n.owner_username,organization:n.organization,organizationName:n.organization_name,runConfig:n.run_config,timestamp:new Date(n.timestamp),status:(t=n.status,t),runNotes:n.run_notes,executor:(a=n.executor,a),campaign:n.campaign,parent:n.parent,claimedAt:null==n.claimed_at?null:new Date(n.claimed_at),claimedBy:n.claimed_by,heartbeatAt:null==n.heartbeat_at?null:new Date(n.heartbeat_at),cancelRequestedAt:null==n.cancel_requested_at?null:new Date(n.cancel_requested_at),finishedAt:null==n.finished_at?null:new Date(n.finished_at),totalResults:n.total_results,successfulJailbreaks:n.successful_jailbreaks,failedJailbreaks:n.failed_jailbreaks,errors:n.errors,notEvaluated:n.not_evaluated,totalGoals:n.total_goals,jailbrokenGoals:n.jailbroken_goals}}function E(e){var t;return null==(t=e)?t:{name:t.name,createdByUsername:t.created_by_username,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function D(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,prefix:t.prefix,created:new Date(t.created),revoked:t.revoked,expiryDate:null==t.expiry_date?null:new Date(t.expiry_date),user:t.user,userDetail:f(t.user_detail,!1),organization:t.organization,organizationDetail:g(t.organization_detail,!1)}}function J(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1],e}function L(e){var t,a=e;if(null==a)return a;return{id:a.id,user:a.user,username:a.username,email:null==a.email?void 0:a.email,firstName:null==a.first_name?void 0:a.first_name,lastName:null==a.last_name?void 0:a.last_name,organization:a.organization,organizationName:a.organization_name,auth0UserId:a.auth0_user_id,keycloakUserId:a.keycloak_user_id,analyticsConsent:null==a.analytics_consent?void 0:(t=a.analytics_consent,t)}}function W(e){var t;return null==(t=e)?t:{code:t.code,message:t.message,details:t.details}}function O(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{run:e.run,request_payload:e.requestPayload,response_status_code:e.responseStatusCode,response_headers:e.responseHeaders,response_body:e.responseBody,latency_ms:e.latencyMs,detected_tool_calls:e.detectedToolCalls,evaluation_status:e.evaluationStatus,evaluation_notes:e.evaluationNotes,evaluation_metrics:e.evaluationMetrics,agent_specific_data:e.agentSpecificData,goal:e.goal,goal_index:e.goalIndex}}function j(e){var t,a,n=e;if(null==n)return n;return{id:n.id,agent:n.agent,agentName:n.agent_name,attack:n.attack,owner:n.owner,ownerUsername:n.owner_username,organization:n.organization,organizationName:n.organization_name,runConfig:n.run_config,timestamp:new Date(n.timestamp),status:(t=n.status,t),runNotes:n.run_notes,executor:(a=n.executor,a),campaign:n.campaign,parent:n.parent,claimedAt:null==n.claimed_at?null:new Date(n.claimed_at),claimedBy:n.claimed_by,heartbeatAt:null==n.heartbeat_at?null:new Date(n.heartbeat_at),cancelRequestedAt:null==n.cancel_requested_at?null:new Date(n.cancel_requested_at),finishedAt:null==n.finished_at?null:new Date(n.finished_at),results:null==n.results?void 0:n.results.map(B)}}function N(e){var t;return null==(t=e)?t:{key:t.key,label:t.label,type:t.type,_default:t.default,description:t.description,required:t.required,choices:null==t.choices?null:t.choices,min:t.min,max:t.max,section:t.section,advanced:t.advanced}}function G(e){var t;return null==(t=e)?t:{attackType:t.attack_type,label:t.label,description:t.description,category:t.category,categoryLabel:t.category_label,categoryDescription:t.category_description,tags:t.tags,tagLabels:t.tag_labels,primaryOrder:t.primary_order,fields:t.fields.map(N),paramsSchema:t.params_schema,requiredRoles:t.required_roles,optionalRoles:t.optional_roles}}function M(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{email:e.email,first_name:e.firstName,last_name:e.lastName,analytics_consent:J(e.analyticsConsent,!1)}}class F extends r{async agentCreateRaw(e,t){if(null==e.agentRequest)throw new u("agentRequest",'Required parameter "agentRequest" was null or undefined when calling agentCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent",method:"POST",headers:a,query:{},body:p(e.agentRequest,!1)},t),e=>w(e))}async agentCreate(e,t){let a=await this.agentCreateRaw(e,t);return await a.value()}async agentDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling agentDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async agentDestroy(e,t){await this.agentDestroyRaw(e,t)}async agentListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(w)}})}async agentList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.agentListRaw(e,t);return await a.value()}async agentPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling agentPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,config:e.config}}(e.patchedAgentRequest,!1)},t),e=>w(e))}async agentPartialUpdate(e,t){let a=await this.agentPartialUpdateRaw(e,t);return await a.value()}async agentRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling agentRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>w(e))}async agentRetrieve(e,t){let a=await this.agentRetrieveRaw(e,t);return await a.value()}async agentUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling agentUpdate().');if(null==e.agentRequest)throw new u("agentRequest",'Required parameter "agentRequest" was null or undefined when calling agentUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:p(e.agentRequest,!1)},t),e=>w(e))}async agentUpdate(e,t){let a=await this.agentUpdateRaw(e,t);return await a.value()}}class H extends r{async apilogsListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(d)}})}async apilogsList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.apilogsListRaw(e,t);return await a.value()}async apilogsRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling apilogsRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>d(e))}async apilogsRetrieve(e,t){let a=await this.apilogsRetrieveRaw(e,t);return await a.value()}async apilogsSummaryRetrieveRaw(e,t){if(null==e.endDate)throw new u("endDate",'Required parameter "endDate" was null or undefined when calling apilogsSummaryRetrieve().');if(null==e.startDate)throw new u("startDate",'Required parameter "startDate" was null or undefined when calling apilogsSummaryRetrieve().');let a={};null!=e.byKey&&(a.by_key=e.byKey),null!=e.endDate&&(a.end_date=e.endDate.toISOString().substring(0,10)),null!=e.startDate&&(a.start_date=e.startDate.toISOString().substring(0,10)),null!=e.tz&&(a.tz=e.tz);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs/summary",method:"GET",headers:n,query:a},t),e=>d(e))}async apilogsSummaryRetrieve(e,t){let a=await this.apilogsSummaryRetrieveRaw(e,t);return await a.value()}}class V extends r{async attackCreateRaw(e,t){if(null==e.attackRequest)throw new u("attackRequest",'Required parameter "attackRequest" was null or undefined when calling attackCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack",method:"POST",headers:a,query:{},body:k(e.attackRequest,!1)},t),e=>T(e))}async attackCreate(e,t){let a=await this.attackCreateRaw(e,t);return await a.value()}async attackDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling attackDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async attackDestroy(e,t){await this.attackDestroyRaw(e,t)}async attackListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(T)}})}async attackList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.attackListRaw(e,t);return await a.value()}async attackPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling attackPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{type:e.type,agent:e.agent,configuration:e._configuration}}(e.patchedAttackRequest,!1)},t),e=>T(e))}async attackPartialUpdate(e,t){let a=await this.attackPartialUpdateRaw(e,t);return await a.value()}async attackRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling attackRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>T(e))}async attackRetrieve(e,t){let a=await this.attackRetrieveRaw(e,t);return await a.value()}async attackUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling attackUpdate().');if(null==e.attackRequest)throw new u("attackRequest",'Required parameter "attackRequest" was null or undefined when calling attackUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:k(e.attackRequest,!1)},t),e=>T(e))}async attackUpdate(e,t){let a=await this.attackUpdateRaw(e,t);return await a.value()}}class $ extends r{async campaignCreateRaw(e,t){if(null==e.campaignRequest)throw new u("campaignRequest",'Required parameter "campaignRequest" was null or undefined when calling campaignCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign",method:"POST",headers:a,query:{},body:m(e.campaignRequest,!1)},t),e=>y(e))}async campaignCreate(e,t){let a=await this.campaignCreateRaw(e,t);return await a.value()}async campaignDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/campaign/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async campaignDestroy(e,t){await this.campaignDestroyRaw(e,t)}async campaignLaunchAdhocRaw(e,t){if(null==e.adhocLaunchRequest)throw new u("adhocLaunchRequest",'Required parameter "adhocLaunchRequest" was null or undefined when calling campaignLaunchAdhoc().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/launch",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,agent:e.agent,spec:e.spec,executor:e.executor}}(e.adhocLaunchRequest,!1)},t),e=>I(e,!1))}async campaignLaunchAdhoc(e,t){let a=await this.campaignLaunchAdhocRaw(e,t);return await a.value()}async campaignLaunchCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignLaunchCreate().');if(null==e.launchRequest)throw new u("launchRequest",'Required parameter "launchRequest" was null or undefined when calling campaignLaunchCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}/launch".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{executor:e.executor}}(e.launchRequest,!1)},t),e=>I(e,!1))}async campaignLaunchCreate(e,t){let a=await this.campaignLaunchCreateRaw(e,t);return await a.value()}async campaignListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(y)}})}async campaignList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.campaignListRaw(e,t);return await a.value()}async campaignPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,agent:e.agent,spec:e.spec}}(e.patchedCampaignRequest,!1)},t),e=>y(e))}async campaignPartialUpdate(e,t){let a=await this.campaignPartialUpdateRaw(e,t);return await a.value()}async campaignPreflightRetrieveRaw(e,t){if(null==e.executor)throw new u("executor",'Required parameter "executor" was null or undefined when calling campaignPreflightRetrieve().');if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignPreflightRetrieve().');let a={};null!=e.executor&&(a.executor=e.executor);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}/preflight".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{ok:t.ok,problems:t.problems.map(W)}})}async campaignPreflightRetrieve(e,t){let a=await this.campaignPreflightRetrieveRaw(e,t);return await a.value()}async campaignRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>y(e))}async campaignRetrieve(e,t){let a=await this.campaignRetrieveRaw(e,t);return await a.value()}async campaignSchemaRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/campaign/schema",method:"GET",headers:t,query:{}},e),e=>{var t;return null==(t=e)?t:{schema:t.schema,datasetPresets:t.dataset_presets.map(A)}})}async campaignSchemaRetrieve(e){let t=await this.campaignSchemaRetrieveRaw(e);return await t.value()}async campaignStartCreateRaw(e,t){if(null==e.campaignStartRequest)throw new u("campaignStartRequest",'Required parameter "campaignStartRequest" was null or undefined when calling campaignStartCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/start",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{agent:e.agent,spec:e.spec,claimed_by:e.claimedBy}}(e.campaignStartRequest,!1)},t),e=>j(e))}async campaignStartCreate(e,t){let a=await this.campaignStartCreateRaw(e,t);return await a.value()}async campaignTechniquesListRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/campaign/techniques",method:"GET",headers:t,query:{}},e),e=>e.map(G))}async campaignTechniquesList(e){let t=await this.campaignTechniquesListRaw(e);return await t.value()}async campaignUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignUpdate().');if(null==e.campaignRequest)throw new u("campaignRequest",'Required parameter "campaignRequest" was null or undefined when calling campaignUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:m(e.campaignRequest,!1)},t),e=>y(e))}async campaignUpdate(e,t){let a=await this.campaignUpdateRaw(e,t);return await a.value()}}class X extends r{async creditsRequestCreateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/credits/request",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{amount:e.amount,reason:e.reason}}(e.creditRequestRequest,!1)},t),e=>{var t;return null==(t=e)?t:{status:t.status}})}async creditsRequestCreate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.creditsRequestCreateRaw(e,t);return await a.value()}}class Y extends r{async keyContextRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/key/context",method:"GET",headers:t,query:{}},e),e=>{var t;return null==(t=e)?t:{userId:null==t.user_id?void 0:t.user_id,username:null==t.username?void 0:t.username,organizationId:null==t.organization_id?void 0:t.organization_id,organizationName:null==t.organization_name?void 0:t.organization_name}})}async keyContextRetrieve(e){let t=await this.keyContextRetrieveRaw(e);return await t.value()}async keyCreateRaw(e,t){if(null==e.userAPIKeyRequest)throw new u("userAPIKeyRequest",'Required parameter "userAPIKeyRequest" was null or undefined when calling keyCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,key:e.key}}(e.userAPIKeyRequest,!1)},t),e=>D(e))}async keyCreate(e,t){let a=await this.keyCreateRaw(e,t);return await a.value()}async keyDestroyRaw(e,t){if(null==e.prefix)throw new u("prefix",'Required parameter "prefix" was null or undefined when calling keyDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/key/{prefix}".replace("{prefix}",encodeURIComponent(String(e.prefix))),method:"DELETE",headers:a,query:{}},t))}async keyDestroy(e,t){await this.keyDestroyRaw(e,t)}async keyListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(D)}})}async keyList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.keyListRaw(e,t);return await a.value()}async keyRetrieveRaw(e,t){if(null==e.prefix)throw new u("prefix",'Required parameter "prefix" was null or undefined when calling keyRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key/{prefix}".replace("{prefix}",encodeURIComponent(String(e.prefix))),method:"GET",headers:a,query:{}},t),e=>D(e))}async keyRetrieve(e,t){let a=await this.keyRetrieveRaw(e,t);return await a.value()}}class Z extends r{async organizationCreateRaw(e,t){if(null==e.organizationRequest)throw new u("organizationRequest",'Required parameter "organizationRequest" was null or undefined when calling organizationCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization",method:"POST",headers:a,query:{},body:b(e.organizationRequest,!1)},t),e=>K(e))}async organizationCreate(e,t){let a=await this.organizationCreateRaw(e,t);return await a.value()}async organizationDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling organizationDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async organizationDestroy(e,t){await this.organizationDestroyRaw(e,t)}async organizationListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(K)}})}async organizationList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.organizationListRaw(e,t);return await a.value()}async organizationMeRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/organization/me",method:"GET",headers:t,query:{}},e),e=>K(e))}async organizationMeRetrieve(e){let t=await this.organizationMeRetrieveRaw(e);return await t.value()}async organizationPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling organizationPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name}}(e.patchedOrganizationRequest,!1)},t),e=>K(e))}async organizationPartialUpdate(e,t){let a=await this.organizationPartialUpdateRaw(e,t);return await a.value()}async organizationRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling organizationRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>K(e))}async organizationRetrieve(e,t){let a=await this.organizationRetrieveRaw(e,t);return await a.value()}async organizationUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling organizationUpdate().');if(null==e.organizationRequest)throw new u("organizationRequest",'Required parameter "organizationRequest" was null or undefined when calling organizationUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:b(e.organizationRequest,!1)},t),e=>K(e))}async organizationUpdate(e,t){let a=await this.organizationUpdateRaw(e,t);return await a.value()}}class Q extends r{async resultCreateRaw(e,t){if(null==e.resultRequest)throw new u("resultRequest",'Required parameter "resultRequest" was null or undefined when calling resultCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result",method:"POST",headers:a,query:{},body:O(e.resultRequest,!1)},t),e=>B(e))}async resultCreate(e,t){let a=await this.resultCreateRaw(e,t);return await a.value()}async resultDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async resultDestroy(e,t){await this.resultDestroyRaw(e,t)}async resultListRaw(e,t){let a={};null!=e.evaluationStatus&&(a.evaluation_status=e.evaluationStatus),null!=e.goalIndex&&(a.goal_index=e.goalIndex),null!=e.includeTraces&&(a.include_traces=e.includeTraces),null!=e.ordering&&(a.ordering=e.ordering),null!=e.page&&(a.page=e.page),null!=e.pageSize&&(a.page_size=e.pageSize),null!=e.run&&(a.run=e.run),null!=e.runOrganization&&(a.run__organization=e.runOrganization);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(B)}})}async resultList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.resultListRaw(e,t);return await a.value()}async resultPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{run:e.run,request_payload:e.requestPayload,response_status_code:e.responseStatusCode,response_headers:e.responseHeaders,response_body:e.responseBody,latency_ms:e.latencyMs,detected_tool_calls:e.detectedToolCalls,evaluation_status:e.evaluationStatus,evaluation_notes:e.evaluationNotes,evaluation_metrics:e.evaluationMetrics,agent_specific_data:e.agentSpecificData,goal:e.goal,goal_index:e.goalIndex}}(e.patchedResultRequest,!1)},t),e=>B(e))}async resultPartialUpdate(e,t){let a=await this.resultPartialUpdateRaw(e,t);return await a.value()}async resultRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>B(e))}async resultRetrieve(e,t){let a=await this.resultRetrieveRaw(e,t);return await a.value()}async resultTraceCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultTraceCreate().');if(null==e.traceRequest)throw new u("traceRequest",'Required parameter "traceRequest" was null or undefined when calling resultTraceCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}/trace".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{sequence:e.sequence,step_type:e.stepType,content:e.content}}(e.traceRequest,!1)},t),e=>_(e))}async resultTraceCreate(e,t){let a=await this.resultTraceCreateRaw(e,t);return await a.value()}async resultUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultUpdate().');if(null==e.resultRequest)throw new u("resultRequest",'Required parameter "resultRequest" was null or undefined when calling resultUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:O(e.resultRequest,!1)},t),e=>B(e))}async resultUpdate(e,t){let a=await this.resultUpdateRaw(e,t);return await a.value()}}let ee={ErrorAgentResponse:"ERROR_AGENT_RESPONSE",ErrorTestFramework:"ERROR_TEST_FRAMEWORK",FailedCriteria:"FAILED_CRITERIA",FailedJailbreak:"FAILED_JAILBREAK",NotEvaluated:"NOT_EVALUATED",PassedCriteria:"PASSED_CRITERIA",SuccessfulJailbreak:"SUCCESSFUL_JAILBREAK"};class et extends r{async runCancelCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runCancelCreate().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/cancel".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{}},t),e=>j(e))}async runCancelCreate(e,t){let a=await this.runCancelCreateRaw(e,t);return await a.value()}async runChildrenCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runChildrenCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/children".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{attack:e.attack,agent:e.agent,run_config:e.runConfig}}(e.childRunRequest,!1)},t),e=>j(e))}async runChildrenCreate(e,t){let a=await this.runChildrenCreateRaw(e,t);return await a.value()}async runClaimCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runClaimCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("WorkerTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/claim".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:R(e.claimRequest,!1)},t),e=>P(e,!1))}async runClaimCreate(e,t){let a=await this.runClaimCreateRaw(e,t);return await a.value()}async runClaimNextCreateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("WorkerTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/claim-next",method:"POST",headers:a,query:{},body:R(e.claimRequest,!1)},t),e=>P(e,!1))}async runClaimNextCreate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.runClaimNextCreateRaw(e,t);switch(a.raw.status){case 200:default:return await a.value();case 204:return null}}async runDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async runDestroy(e,t){await this.runDestroyRaw(e,t)}async runFinishCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runFinishCreate().');if(null==e.finishRequest)throw new u("finishRequest",'Required parameter "finishRequest" was null or undefined when calling runFinishCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/finish".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{status:e.status,note:e.note}}(e.finishRequest,!1)},t),e=>j(e))}async runFinishCreate(e,t){let a=await this.runFinishCreateRaw(e,t);return await a.value()}async runGoalsListRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runGoalsList().');let a={};null!=e.page&&(a.page=e.page),null!=e.pageSize&&(a.page_size=e.pageSize);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/goals".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(S)}})}async runGoalsList(e,t){let a=await this.runGoalsListRaw(e,t);return await a.value()}async runHeartbeatCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runHeartbeatCreate().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/heartbeat".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{cancelRequested:t.cancel_requested}})}async runHeartbeatCreate(e,t){let a=await this.runHeartbeatCreateRaw(e,t);return await a.value()}async runListRaw(e,t){let a={};null!=e.agent&&(a.agent=e.agent),null!=e.attack&&(a.attack=e.attack),null!=e.campaign&&(a.campaign=e.campaign),null!=e.executor&&(a.executor=e.executor),null!=e.organization&&(a.organization=e.organization),null!=e.page&&(a.page=e.page),null!=e.pageSize&&(a.page_size=e.pageSize),null!=e.parent&&(a.parent=e.parent),null!=e.parentIsnull&&(a.parent__isnull=e.parentIsnull),null!=e.status&&(a.status=e.status);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(x)}})}async runList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.runListRaw(e,t);return await a.value()}async runPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{run_notes:e.runNotes,run_config:e.runConfig}}(e.patchedRunUpdateRequest,!1)},t),e=>j(e))}async runPartialUpdate(e,t){let a=await this.runPartialUpdateRaw(e,t);return await a.value()}async runResultCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runResultCreate().');if(null==e.resultRequest)throw new u("resultRequest",'Required parameter "resultRequest" was null or undefined when calling runResultCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/result".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:O(e.resultRequest,!1)},t),e=>B(e))}async runResultCreate(e,t){let a=await this.runResultCreateRaw(e,t);return await a.value()}async runRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runRetrieve().');let a={};null!=e.includeResults&&(a.include_results=e.includeResults);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:a},t),e=>j(e))}async runRetrieve(e,t){let a=await this.runRetrieveRaw(e,t);return await a.value()}}class ea extends r{async secretCreateRaw(e,t){if(null==e.secretWriteRequest)throw new u("secretWriteRequest",'Required parameter "secretWriteRequest" was null or undefined when calling secretCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/secret",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,value:e.value}}(e.secretWriteRequest,!1)},t),e=>E(e))}async secretCreate(e,t){let a=await this.secretCreateRaw(e,t);return await a.value()}async secretDestroyRaw(e,t){if(null==e.name)throw new u("name",'Required parameter "name" was null or undefined when calling secretDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/secret/{name}".replace("{name}",encodeURIComponent(String(e.name))),method:"DELETE",headers:a,query:{}},t),e=>(function(e,t){var a;if(null==e)return e;return{referencedBy:(a=e.referenced_by,null==a?a:{agents:a.agents,campaigns:a.campaigns})}})(e,0))}async secretDestroy(e,t){let a=await this.secretDestroyRaw(e,t);return await a.value()}async secretListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/secret",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(E)}})}async secretList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.secretListRaw(e,t);return await a.value()}async secretUpdateRaw(e,t){if(null==e.name)throw new u("name",'Required parameter "name" was null or undefined when calling secretUpdate().');if(null==e.secretValueRequest)throw new u("secretValueRequest",'Required parameter "secretValueRequest" was null or undefined when calling secretUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/secret/{name}".replace("{name}",encodeURIComponent(String(e.name))),method:"PUT",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{value:e.value}}(e.secretValueRequest,!1)},t),e=>E(e))}async secretUpdate(e,t){let a=await this.secretUpdateRaw(e,t);return await a.value()}}class en extends r{async userCreateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user",method:"POST",headers:a,query:{},body:M(e.userProfileRequest,!1)},t),e=>L(e))}async userCreate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userCreateRaw(e,t);return await a.value()}async userDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling userDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async userDestroy(e,t){await this.userDestroyRaw(e,t)}async userListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(L)}})}async userList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userListRaw(e,t);return await a.value()}async userMeRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/user/me",method:"GET",headers:t,query:{}},e),e=>L(e))}async userMeRetrieve(e){let t=await this.userMeRetrieveRaw(e);return await t.value()}async userMeUpdateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/me",method:"PUT",headers:a,query:{},body:M(e.userProfileRequest,!1)},t),e=>L(e))}async userMeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userMeUpdateRaw(e,t);return await a.value()}async userPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling userPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{email:e.email,first_name:e.firstName,last_name:e.lastName,analytics_consent:J(e.analyticsConsent,!1)}}(e.patchedUserProfileRequest,!1)},t),e=>L(e))}async userPartialUpdate(e,t){let a=await this.userPartialUpdateRaw(e,t);return await a.value()}async userRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling userRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>L(e))}async userRetrieve(e,t){let a=await this.userRetrieveRaw(e,t);return await a.value()}async userUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling userUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:M(e.userProfileRequest,!1)},t),e=>L(e))}async userUpdate(e,t){let a=await this.userUpdateRaw(e,t);return await a.value()}}},41444:(e,t,a)=>{a.d(t,{h:()=>o});var n=a(65727);let i=a.n(n)()({level:"info",browser:{asObject:!1,write:{debug:e=>!1,info:e=>console.info(e),warn:e=>console.warn(e),error:e=>console.error(e)}},redact:{paths:["token","password","authorization","apiKey","api_key","wallet.address","user.wallet.address","privateKey","private_key"],censor:"[REDACTED]"}}),o=e=>i.child({module:e})},64269:(e,t,a)=>{a.d(t,{cn:()=>o});var n=a(2821),i=a(75889);function o(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,i.QP)((0,n.$)(t))}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[924],{3998:(e,t,a)=>{a.d(t,{$:()=>c,r:()=>s});var n=a(95155);a(12115);var i=a(32467),o=a(83101),r=a(64269);let s=(0,o.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function c(e){let{className:t,variant:a,size:o,asChild:c=!1,...u}=e,l=c?i.DX:"button";return(0,n.jsx)(l,{"data-slot":"button",className:(0,r.cn)(s({variant:a,size:o,className:t})),...u})}},7831:(e,t,a)=>{a.d(t,{Bm:()=>k,DR:()=>c,Ft:()=>y,Iu:()=>w,KC:()=>p,ME:()=>l,gb:()=>g,in:()=>u,ki:()=>r,nu:()=>T,ui:()=>h,userApi:()=>f,vm:()=>d});var n=a(38775);let i=(0,a(41444).h)("apiClient"),o=null;function r(e){o=e,i.debug(e?"Access token set":"Access token cleared")}let s=async()=>(o||i.debug("No access token available."),o),c=new n.Vk6({basePath:"/api/proxy",middleware:[{pre:async e=>{i.debug("Running pre-request middleware...");let t=await s();t?(i.debug("Token found, adding Authorization header."),e.init.headers={...e.init.headers,Authorization:"Bearer ".concat(t)}):i.warn("No token found, Authorization header not added.")},post:async e=>{let t=e.response.headers.get("content-type");if(!e.response.ok&&t&&!t.includes("application/json")){let a=await e.response.text();throw i.error({status:e.response.status,contentType:t,preview:a.substring(0,200)},"API returned non-JSON response"),Error("API error ".concat(e.response.status,": Server returned ").concat(t," instead of JSON. Check API endpoint and CORS configuration."))}}}]}),u=new n.cwn(c),l=new n.uzR(c),h=new n.cdi(c),d=new n.Lev(c),g=new n.At2(c),f=new n.ipj(c),w=new n.UYx(c),p=new n.OgW(c),T=new n.XoK(c),k=new n.jhh(c),y=new n.ZLz(c)},38775:(e,t,a)=>{a.d(t,{cwn:()=>F,OgW:()=>H,Lev:()=>V,jhh:()=>$,Vk6:()=>i,XoK:()=>X,on2:()=>C,At2:()=>Y,UYx:()=>Z,o3e:()=>s,cdi:()=>Q,v3H:()=>ee,uzR:()=>et,qjb:()=>q,isU:()=>x,ZLz:()=>ea,S5d:()=>v,Esj:()=>z,ipj:()=>en,JlS:()=>U});let n="http://localhost".replace(/\/+$/,"");class i{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:n}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(n=>(function t(a,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=i+(i.length?"[".concat(a,"]"):a);if(n instanceof Array){let e=n.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(o),"="));return"".concat(encodeURIComponent(o),"=").concat(e)}return n instanceof Set?t(a,Array.from(n),i):n instanceof Date?"".concat(encodeURIComponent(o),"=").concat(encodeURIComponent(n.toISOString())):n instanceof Object?e(n,o):"".concat(encodeURIComponent(o),"=").concat(encodeURIComponent(String(n)))})(n,t[n],a)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){this.configuration=e}}let o=new i;class r{withMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=this.clone();return n.middleware=n.middleware.concat(...t),n}withPreMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=t.map(e=>({pre:e}));return this.withMiddleware(...n)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let n=t.map(e=>({post:e}));return this.withMiddleware(...n)}isJsonMime(e){return!!e&&r.jsonRegex.test(e)}async request(e,t){let{url:a,init:n}=await this.createFetchParams(e,t),i=await this.fetchApi(a,n);if(i&&i.status>=200&&i.status<300)return i;throw new s(i,"Response returned an error code")}async createFetchParams(e,t){var a,n;let i,o=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(o+="?"+this.configuration.queryParamsStringify(e.query));let r=Object.assign({},this.configuration.headers,e.headers);Object.keys(r).forEach(e=>void 0===r[e]?delete r[e]:{});let s={method:e.method,headers:r,body:e.body,credentials:this.configuration.credentials},c={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return a=c.body,i="undefined"!=typeof FormData&&a instanceof FormData||c.body instanceof URLSearchParams||(n=c.body,"undefined"!=typeof Blob&&n instanceof Blob)?c.body:this.isJsonMime(r["Content-Type"])?JSON.stringify(c.body):c.body,{url:o,init:{...c,body:i}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=o){this.configuration=e,this.fetchApi=async(e,t)=>{let a,n={url:e,init:t};for(let e of this.middleware)e.pre&&(n=await e.pre({fetch:this.fetchApi,...n})||n);try{a=await (this.configuration.fetchApi||fetch)(n.url,n.init)}catch(e){for(let t of this.middleware)t.onError&&(a=await t.onError({fetch:this.fetchApi,url:n.url,init:n.init,error:e,response:a?a.clone():void 0})||a);if(void 0===a)if(e instanceof Error)throw new c(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(a=await e.post({fetch:this.fetchApi,url:n.url,init:n.init,response:a.clone()})||a);return a},this.middleware=e.middleware}}r.jsonRegex=RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");class s extends Error{constructor(e,t){super(t),this.response=e,this.name="ResponseError"}}class c extends Error{constructor(e,t){super(t),this.cause=e,this.name="FetchError"}}class u extends Error{constructor(e,t){super(t),this.field=e,this.name="RequiredError"}}class l{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){this.raw=e,this.transformer=t}}class h{async value(){}constructor(e){this.raw=e}}function d(e){var t;return null==(t=e)?t:{id:t.id,timestamp:new Date(t.timestamp),apiKeyPrefix:t.api_key_prefix,userUsername:t.user_username,organizationName:t.organization_name,modelIdUsed:t.model_id_used,apiEndpoint:t.api_endpoint,inputTokens:t.input_tokens,outputTokens:t.output_tokens,creditsDeducted:t.credits_deducted,requestPayloadPreview:t.request_payload_preview,responsePayloadPreview:t.response_payload_preview}}function g(e,t){return null==e?e:{id:e.id,name:e.name}}function f(e,t){return null==e?e:{user:e.user,username:e.username,organization:e.organization}}function w(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,endpoint:t.endpoint,agentType:t.agent_type,description:null==t.description?void 0:t.description,config:t.config,organization:t.organization,organizationDetail:g(t.organization_detail,!1),owner:t.owner,ownerDetail:f(t.owner_detail,!1),createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function p(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,config:e.config}}function T(e){var t;return null==(t=e)?t:{id:t.id,type:t.type,agent:t.agent,agentName:t.agent_name,owner:t.owner,ownerUsername:t.owner_username,organization:t.organization,organizationName:t.organization_name,_configuration:t.configuration,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function k(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{type:e.type,agent:e.agent,configuration:e._configuration}}function y(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,description:null==t.description?void 0:t.description,agent:t.agent,spec:t.spec,organization:t.organization,owner:t.owner,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function m(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,agent:e.agent,spec:e.spec}}function A(e){var t;return null==(t=e)?t:{name:t.name,description:t.description}}function R(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{claimed_by:e.claimedBy}}let v={Pending:"PENDING",Running:"RUNNING",Completed:"COMPLETED",Failed:"FAILED",Cancelled:"CANCELLED"},q={Cloud:"cloud",Local:"local",Cli:"cli"},z={ToolCall:"TOOL_CALL",ToolResponse:"TOOL_RESPONSE",AgentThought:"AGENT_THOUGHT",AgentResponseChunk:"AGENT_RESPONSE_CHUNK",Other:"OTHER",McpStep:"MCP_STEP",A2AComm:"A2A_COMM"};function _(e){var t,a=e;if(null==a)return a;return{id:a.id,result:a.result,sequence:a.sequence,stepType:null==a.step_type?void 0:(t=a.step_type,t),timestamp:new Date(a.timestamp),content:null==a.content?void 0:a.content}}let C={NotEvaluated:"NOT_EVALUATED",SuccessfulJailbreak:"SUCCESSFUL_JAILBREAK",FailedJailbreak:"FAILED_JAILBREAK",ErrorAgentResponse:"ERROR_AGENT_RESPONSE",ErrorTestFramework:"ERROR_TEST_FRAMEWORK",PassedCriteria:"PASSED_CRITERIA",FailedCriteria:"FAILED_CRITERIA"};function B(e){var t,a=e;if(null==a)return a;return{id:a.id,run:a.run,runId:a.run_id,requestPayload:null==a.request_payload?void 0:a.request_payload,responseStatusCode:null==a.response_status_code?void 0:a.response_status_code,responseHeaders:null==a.response_headers?void 0:a.response_headers,responseBody:null==a.response_body?void 0:a.response_body,latencyMs:null==a.latency_ms?void 0:a.latency_ms,detectedToolCalls:null==a.detected_tool_calls?void 0:a.detected_tool_calls,evaluationStatus:null==a.evaluation_status?void 0:(t=a.evaluation_status,t),evaluationNotes:null==a.evaluation_notes?void 0:a.evaluation_notes,evaluationMetrics:null==a.evaluation_metrics?void 0:a.evaluation_metrics,agentSpecificData:null==a.agent_specific_data?void 0:a.agent_specific_data,goal:null==a.goal?void 0:a.goal,goalIndex:null==a.goal_index?void 0:a.goal_index,timestamp:new Date(a.timestamp),traces:null==a.traces?void 0:a.traces.map(_)}}function P(e,t){var a,n;if(null==e)return e;return{id:e.id,agent:e.agent,agentName:e.agent_name,attack:e.attack,owner:e.owner,ownerUsername:e.owner_username,organization:e.organization,organizationName:e.organization_name,runConfig:e.run_config,timestamp:new Date(e.timestamp),status:(a=e.status,a),runNotes:e.run_notes,executor:(n=e.executor,n),campaign:e.campaign,parent:e.parent,claimedAt:null==e.claimed_at?null:new Date(e.claimed_at),claimedBy:e.claimed_by,heartbeatAt:null==e.heartbeat_at?null:new Date(e.heartbeat_at),cancelRequestedAt:null==e.cancel_requested_at?null:new Date(e.cancel_requested_at),finishedAt:null==e.finished_at?null:new Date(e.finished_at),results:e.results.map(B),runToken:null==e.run_token?void 0:e.run_token,env:null==e.env?void 0:e.env}}function I(e,t){var a,n;if(null==e)return e;return{id:e.id,agent:e.agent,agentName:e.agent_name,attack:e.attack,owner:e.owner,ownerUsername:e.owner_username,organization:e.organization,organizationName:e.organization_name,runConfig:e.run_config,timestamp:new Date(e.timestamp),status:(a=e.status,a),runNotes:e.run_notes,executor:(n=e.executor,n),campaign:e.campaign,parent:e.parent,claimedAt:null==e.claimed_at?null:new Date(e.claimed_at),claimedBy:e.claimed_by,heartbeatAt:null==e.heartbeat_at?null:new Date(e.heartbeat_at),cancelRequestedAt:null==e.cancel_requested_at?null:new Date(e.cancel_requested_at),finishedAt:null==e.finished_at?null:new Date(e.finished_at),results:e.results.map(B),command:null==e.command?void 0:e.command}}function K(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at),credits:t.credits,creditsLastUpdated:new Date(t.credits_last_updated)}}function b(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name}}let U={Jailbroken:"JAILBROKEN",Mitigated:"MITIGATED",Error:"ERROR",Pending:"PENDING"};function S(e){var t,a=e;if(null==a)return a;return{goalIndex:a.goal_index,goal:a.goal,category:a.category,attempts:a.attempts,successfulJailbreaks:a.successful_jailbreaks,failedJailbreaks:a.failed_jailbreaks,errors:a.errors,notEvaluated:a.not_evaluated,verdict:(t=a.verdict,t),bestScore:a.best_score,decidingResult:a.deciding_result,firstTimestamp:new Date(a.first_timestamp),lastTimestamp:new Date(a.last_timestamp)}}function x(e){var t,a,n=e;if(null==n)return n;return{id:n.id,agent:n.agent,agentName:n.agent_name,attack:n.attack,attackType:n.attack_type,owner:n.owner,ownerUsername:n.owner_username,organization:n.organization,organizationName:n.organization_name,runConfig:n.run_config,timestamp:new Date(n.timestamp),status:(t=n.status,t),runNotes:n.run_notes,executor:(a=n.executor,a),campaign:n.campaign,parent:n.parent,claimedAt:null==n.claimed_at?null:new Date(n.claimed_at),claimedBy:n.claimed_by,heartbeatAt:null==n.heartbeat_at?null:new Date(n.heartbeat_at),cancelRequestedAt:null==n.cancel_requested_at?null:new Date(n.cancel_requested_at),finishedAt:null==n.finished_at?null:new Date(n.finished_at),totalResults:n.total_results,successfulJailbreaks:n.successful_jailbreaks,failedJailbreaks:n.failed_jailbreaks,errors:n.errors,notEvaluated:n.not_evaluated,totalGoals:n.total_goals,jailbrokenGoals:n.jailbroken_goals}}function E(e){var t;return null==(t=e)?t:{name:t.name,createdByUsername:t.created_by_username,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at)}}function D(e){var t;return null==(t=e)?t:{id:t.id,name:t.name,prefix:t.prefix,created:new Date(t.created),revoked:t.revoked,expiryDate:null==t.expiry_date?null:new Date(t.expiry_date),user:t.user,userDetail:f(t.user_detail,!1),organization:t.organization,organizationDetail:g(t.organization_detail,!1)}}function J(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1],e}function L(e){var t,a=e;if(null==a)return a;return{id:a.id,user:a.user,username:a.username,email:null==a.email?void 0:a.email,firstName:null==a.first_name?void 0:a.first_name,lastName:null==a.last_name?void 0:a.last_name,organization:a.organization,organizationName:a.organization_name,auth0UserId:a.auth0_user_id,keycloakUserId:a.keycloak_user_id,analyticsConsent:null==a.analytics_consent?void 0:(t=a.analytics_consent,t)}}function W(e){var t;return null==(t=e)?t:{code:t.code,message:t.message,details:t.details}}function O(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{run:e.run,request_payload:e.requestPayload,response_status_code:e.responseStatusCode,response_headers:e.responseHeaders,response_body:e.responseBody,latency_ms:e.latencyMs,detected_tool_calls:e.detectedToolCalls,evaluation_status:e.evaluationStatus,evaluation_notes:e.evaluationNotes,evaluation_metrics:e.evaluationMetrics,agent_specific_data:e.agentSpecificData,goal:e.goal,goal_index:e.goalIndex}}function j(e){var t,a,n=e;if(null==n)return n;return{id:n.id,agent:n.agent,agentName:n.agent_name,attack:n.attack,owner:n.owner,ownerUsername:n.owner_username,organization:n.organization,organizationName:n.organization_name,runConfig:n.run_config,timestamp:new Date(n.timestamp),status:(t=n.status,t),runNotes:n.run_notes,executor:(a=n.executor,a),campaign:n.campaign,parent:n.parent,claimedAt:null==n.claimed_at?null:new Date(n.claimed_at),claimedBy:n.claimed_by,heartbeatAt:null==n.heartbeat_at?null:new Date(n.heartbeat_at),cancelRequestedAt:null==n.cancel_requested_at?null:new Date(n.cancel_requested_at),finishedAt:null==n.finished_at?null:new Date(n.finished_at),results:null==n.results?void 0:n.results.map(B)}}function N(e){var t;return null==(t=e)?t:{key:t.key,label:t.label,type:t.type,_default:t.default,description:t.description,required:t.required,choices:null==t.choices?null:t.choices,min:t.min,max:t.max,section:t.section,advanced:t.advanced}}function G(e){var t;return null==(t=e)?t:{attackType:t.attack_type,label:t.label,description:t.description,category:t.category,categoryLabel:t.category_label,categoryDescription:t.category_description,tags:t.tags,tagLabels:t.tag_labels,primaryOrder:t.primary_order,fields:t.fields.map(N),paramsSchema:t.params_schema,requiredRoles:t.required_roles,optionalRoles:t.optional_roles}}function M(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{email:e.email,first_name:e.firstName,last_name:e.lastName,analytics_consent:J(e.analyticsConsent,!1)}}class F extends r{async agentCreateRaw(e,t){if(null==e.agentRequest)throw new u("agentRequest",'Required parameter "agentRequest" was null or undefined when calling agentCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent",method:"POST",headers:a,query:{},body:p(e.agentRequest,!1)},t),e=>w(e))}async agentCreate(e,t){let a=await this.agentCreateRaw(e,t);return await a.value()}async agentDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling agentDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async agentDestroy(e,t){await this.agentDestroyRaw(e,t)}async agentListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(w)}})}async agentList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.agentListRaw(e,t);return await a.value()}async agentPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling agentPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,config:e.config}}(e.patchedAgentRequest,!1)},t),e=>w(e))}async agentPartialUpdate(e,t){let a=await this.agentPartialUpdateRaw(e,t);return await a.value()}async agentRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling agentRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>w(e))}async agentRetrieve(e,t){let a=await this.agentRetrieveRaw(e,t);return await a.value()}async agentUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling agentUpdate().');if(null==e.agentRequest)throw new u("agentRequest",'Required parameter "agentRequest" was null or undefined when calling agentUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/agent/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:p(e.agentRequest,!1)},t),e=>w(e))}async agentUpdate(e,t){let a=await this.agentUpdateRaw(e,t);return await a.value()}}class H extends r{async apilogsListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(d)}})}async apilogsList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.apilogsListRaw(e,t);return await a.value()}async apilogsRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling apilogsRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>d(e))}async apilogsRetrieve(e,t){let a=await this.apilogsRetrieveRaw(e,t);return await a.value()}async apilogsSummaryRetrieveRaw(e,t){if(null==e.endDate)throw new u("endDate",'Required parameter "endDate" was null or undefined when calling apilogsSummaryRetrieve().');if(null==e.startDate)throw new u("startDate",'Required parameter "startDate" was null or undefined when calling apilogsSummaryRetrieve().');let a={};null!=e.byKey&&(a.by_key=e.byKey),null!=e.endDate&&(a.end_date=e.endDate.toISOString().substring(0,10)),null!=e.startDate&&(a.start_date=e.startDate.toISOString().substring(0,10)),null!=e.tz&&(a.tz=e.tz);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/apilogs/summary",method:"GET",headers:n,query:a},t),e=>d(e))}async apilogsSummaryRetrieve(e,t){let a=await this.apilogsSummaryRetrieveRaw(e,t);return await a.value()}}class V extends r{async attackCreateRaw(e,t){if(null==e.attackRequest)throw new u("attackRequest",'Required parameter "attackRequest" was null or undefined when calling attackCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack",method:"POST",headers:a,query:{},body:k(e.attackRequest,!1)},t),e=>T(e))}async attackCreate(e,t){let a=await this.attackCreateRaw(e,t);return await a.value()}async attackDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling attackDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async attackDestroy(e,t){await this.attackDestroyRaw(e,t)}async attackListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(T)}})}async attackList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.attackListRaw(e,t);return await a.value()}async attackPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling attackPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{type:e.type,agent:e.agent,configuration:e._configuration}}(e.patchedAttackRequest,!1)},t),e=>T(e))}async attackPartialUpdate(e,t){let a=await this.attackPartialUpdateRaw(e,t);return await a.value()}async attackRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling attackRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>T(e))}async attackRetrieve(e,t){let a=await this.attackRetrieveRaw(e,t);return await a.value()}async attackUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling attackUpdate().');if(null==e.attackRequest)throw new u("attackRequest",'Required parameter "attackRequest" was null or undefined when calling attackUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/attack/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:k(e.attackRequest,!1)},t),e=>T(e))}async attackUpdate(e,t){let a=await this.attackUpdateRaw(e,t);return await a.value()}}class $ extends r{async campaignCreateRaw(e,t){if(null==e.campaignRequest)throw new u("campaignRequest",'Required parameter "campaignRequest" was null or undefined when calling campaignCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign",method:"POST",headers:a,query:{},body:m(e.campaignRequest,!1)},t),e=>y(e))}async campaignCreate(e,t){let a=await this.campaignCreateRaw(e,t);return await a.value()}async campaignDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/campaign/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async campaignDestroy(e,t){await this.campaignDestroyRaw(e,t)}async campaignLaunchAdhocRaw(e,t){if(null==e.adhocLaunchRequest)throw new u("adhocLaunchRequest",'Required parameter "adhocLaunchRequest" was null or undefined when calling campaignLaunchAdhoc().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/launch",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,agent:e.agent,spec:e.spec,executor:e.executor}}(e.adhocLaunchRequest,!1)},t),e=>I(e,!1))}async campaignLaunchAdhoc(e,t){let a=await this.campaignLaunchAdhocRaw(e,t);return await a.value()}async campaignLaunchCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignLaunchCreate().');if(null==e.launchRequest)throw new u("launchRequest",'Required parameter "launchRequest" was null or undefined when calling campaignLaunchCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}/launch".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{executor:e.executor}}(e.launchRequest,!1)},t),e=>I(e,!1))}async campaignLaunchCreate(e,t){let a=await this.campaignLaunchCreateRaw(e,t);return await a.value()}async campaignListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(y)}})}async campaignList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.campaignListRaw(e,t);return await a.value()}async campaignPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,agent:e.agent,spec:e.spec}}(e.patchedCampaignRequest,!1)},t),e=>y(e))}async campaignPartialUpdate(e,t){let a=await this.campaignPartialUpdateRaw(e,t);return await a.value()}async campaignPreflightRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignPreflightRetrieve().');let a={};null!=e.executor&&(a.executor=e.executor);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}/preflight".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:a},t),e=>(function(e,t){var a;if(null==e)return e;return{executor:(a=e.executor,a),ok:e.ok,problems:e.problems.map(W)}})(e,0))}async campaignPreflightRetrieve(e,t){let a=await this.campaignPreflightRetrieveRaw(e,t);return await a.value()}async campaignRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>y(e))}async campaignRetrieve(e,t){let a=await this.campaignRetrieveRaw(e,t);return await a.value()}async campaignSchemaRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/campaign/schema",method:"GET",headers:t,query:{}},e),e=>{var t;return null==(t=e)?t:{schema:t.schema,datasetPresets:t.dataset_presets.map(A)}})}async campaignSchemaRetrieve(e){let t=await this.campaignSchemaRetrieveRaw(e);return await t.value()}async campaignStartCreateRaw(e,t){if(null==e.campaignStartRequest)throw new u("campaignStartRequest",'Required parameter "campaignStartRequest" was null or undefined when calling campaignStartCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/start",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{agent:e.agent,spec:e.spec,claimed_by:e.claimedBy}}(e.campaignStartRequest,!1)},t),e=>j(e))}async campaignStartCreate(e,t){let a=await this.campaignStartCreateRaw(e,t);return await a.value()}async campaignTechniquesListRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/campaign/techniques",method:"GET",headers:t,query:{}},e),e=>e.map(G))}async campaignTechniquesList(e){let t=await this.campaignTechniquesListRaw(e);return await t.value()}async campaignUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling campaignUpdate().');if(null==e.campaignRequest)throw new u("campaignRequest",'Required parameter "campaignRequest" was null or undefined when calling campaignUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/campaign/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:m(e.campaignRequest,!1)},t),e=>y(e))}async campaignUpdate(e,t){let a=await this.campaignUpdateRaw(e,t);return await a.value()}}class X extends r{async creditsRequestCreateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/credits/request",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{amount:e.amount,reason:e.reason}}(e.creditRequestRequest,!1)},t),e=>{var t;return null==(t=e)?t:{status:t.status}})}async creditsRequestCreate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.creditsRequestCreateRaw(e,t);return await a.value()}}class Y extends r{async keyContextRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/key/context",method:"GET",headers:t,query:{}},e),e=>{var t;return null==(t=e)?t:{userId:null==t.user_id?void 0:t.user_id,username:null==t.username?void 0:t.username,organizationId:null==t.organization_id?void 0:t.organization_id,organizationName:null==t.organization_name?void 0:t.organization_name}})}async keyContextRetrieve(e){let t=await this.keyContextRetrieveRaw(e);return await t.value()}async keyCreateRaw(e,t){if(null==e.userAPIKeyRequest)throw new u("userAPIKeyRequest",'Required parameter "userAPIKeyRequest" was null or undefined when calling keyCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,key:e.key}}(e.userAPIKeyRequest,!1)},t),e=>D(e))}async keyCreate(e,t){let a=await this.keyCreateRaw(e,t);return await a.value()}async keyDestroyRaw(e,t){if(null==e.prefix)throw new u("prefix",'Required parameter "prefix" was null or undefined when calling keyDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/key/{prefix}".replace("{prefix}",encodeURIComponent(String(e.prefix))),method:"DELETE",headers:a,query:{}},t))}async keyDestroy(e,t){await this.keyDestroyRaw(e,t)}async keyListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(D)}})}async keyList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.keyListRaw(e,t);return await a.value()}async keyRetrieveRaw(e,t){if(null==e.prefix)throw new u("prefix",'Required parameter "prefix" was null or undefined when calling keyRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/key/{prefix}".replace("{prefix}",encodeURIComponent(String(e.prefix))),method:"GET",headers:a,query:{}},t),e=>D(e))}async keyRetrieve(e,t){let a=await this.keyRetrieveRaw(e,t);return await a.value()}}class Z extends r{async organizationCreateRaw(e,t){if(null==e.organizationRequest)throw new u("organizationRequest",'Required parameter "organizationRequest" was null or undefined when calling organizationCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization",method:"POST",headers:a,query:{},body:b(e.organizationRequest,!1)},t),e=>K(e))}async organizationCreate(e,t){let a=await this.organizationCreateRaw(e,t);return await a.value()}async organizationDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling organizationDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async organizationDestroy(e,t){await this.organizationDestroyRaw(e,t)}async organizationListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(K)}})}async organizationList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.organizationListRaw(e,t);return await a.value()}async organizationMeRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/organization/me",method:"GET",headers:t,query:{}},e),e=>K(e))}async organizationMeRetrieve(e){let t=await this.organizationMeRetrieveRaw(e);return await t.value()}async organizationPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling organizationPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name}}(e.patchedOrganizationRequest,!1)},t),e=>K(e))}async organizationPartialUpdate(e,t){let a=await this.organizationPartialUpdateRaw(e,t);return await a.value()}async organizationRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling organizationRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>K(e))}async organizationRetrieve(e,t){let a=await this.organizationRetrieveRaw(e,t);return await a.value()}async organizationUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling organizationUpdate().');if(null==e.organizationRequest)throw new u("organizationRequest",'Required parameter "organizationRequest" was null or undefined when calling organizationUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/organization/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:b(e.organizationRequest,!1)},t),e=>K(e))}async organizationUpdate(e,t){let a=await this.organizationUpdateRaw(e,t);return await a.value()}}class Q extends r{async resultCreateRaw(e,t){if(null==e.resultRequest)throw new u("resultRequest",'Required parameter "resultRequest" was null or undefined when calling resultCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result",method:"POST",headers:a,query:{},body:O(e.resultRequest,!1)},t),e=>B(e))}async resultCreate(e,t){let a=await this.resultCreateRaw(e,t);return await a.value()}async resultDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async resultDestroy(e,t){await this.resultDestroyRaw(e,t)}async resultListRaw(e,t){let a={};null!=e.evaluationStatus&&(a.evaluation_status=e.evaluationStatus),null!=e.goalIndex&&(a.goal_index=e.goalIndex),null!=e.includeTraces&&(a.include_traces=e.includeTraces),null!=e.ordering&&(a.ordering=e.ordering),null!=e.page&&(a.page=e.page),null!=e.pageSize&&(a.page_size=e.pageSize),null!=e.run&&(a.run=e.run),null!=e.runOrganization&&(a.run__organization=e.runOrganization);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(B)}})}async resultList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.resultListRaw(e,t);return await a.value()}async resultPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{run:e.run,request_payload:e.requestPayload,response_status_code:e.responseStatusCode,response_headers:e.responseHeaders,response_body:e.responseBody,latency_ms:e.latencyMs,detected_tool_calls:e.detectedToolCalls,evaluation_status:e.evaluationStatus,evaluation_notes:e.evaluationNotes,evaluation_metrics:e.evaluationMetrics,agent_specific_data:e.agentSpecificData,goal:e.goal,goal_index:e.goalIndex}}(e.patchedResultRequest,!1)},t),e=>B(e))}async resultPartialUpdate(e,t){let a=await this.resultPartialUpdateRaw(e,t);return await a.value()}async resultRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>B(e))}async resultRetrieve(e,t){let a=await this.resultRetrieveRaw(e,t);return await a.value()}async resultTraceCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultTraceCreate().');if(null==e.traceRequest)throw new u("traceRequest",'Required parameter "traceRequest" was null or undefined when calling resultTraceCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}/trace".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{sequence:e.sequence,step_type:e.stepType,content:e.content}}(e.traceRequest,!1)},t),e=>_(e))}async resultTraceCreate(e,t){let a=await this.resultTraceCreateRaw(e,t);return await a.value()}async resultUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling resultUpdate().');if(null==e.resultRequest)throw new u("resultRequest",'Required parameter "resultRequest" was null or undefined when calling resultUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/result/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:O(e.resultRequest,!1)},t),e=>B(e))}async resultUpdate(e,t){let a=await this.resultUpdateRaw(e,t);return await a.value()}}let ee={ErrorAgentResponse:"ERROR_AGENT_RESPONSE",ErrorTestFramework:"ERROR_TEST_FRAMEWORK",FailedCriteria:"FAILED_CRITERIA",FailedJailbreak:"FAILED_JAILBREAK",NotEvaluated:"NOT_EVALUATED",PassedCriteria:"PASSED_CRITERIA",SuccessfulJailbreak:"SUCCESSFUL_JAILBREAK"};class et extends r{async runCancelCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runCancelCreate().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/cancel".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{}},t),e=>j(e))}async runCancelCreate(e,t){let a=await this.runCancelCreateRaw(e,t);return await a.value()}async runChildrenCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runChildrenCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/children".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{attack:e.attack,agent:e.agent,run_config:e.runConfig}}(e.childRunRequest,!1)},t),e=>j(e))}async runChildrenCreate(e,t){let a=await this.runChildrenCreateRaw(e,t);return await a.value()}async runClaimCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runClaimCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("WorkerTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/claim".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:R(e.claimRequest,!1)},t),e=>P(e,!1))}async runClaimCreate(e,t){let a=await this.runClaimCreateRaw(e,t);return await a.value()}async runClaimNextCreateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("WorkerTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/claim-next",method:"POST",headers:a,query:{},body:R(e.claimRequest,!1)},t),e=>P(e,!1))}async runClaimNextCreate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.runClaimNextCreateRaw(e,t);switch(a.raw.status){case 200:default:return await a.value();case 204:return null}}async runDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async runDestroy(e,t){await this.runDestroyRaw(e,t)}async runFinishCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runFinishCreate().');if(null==e.finishRequest)throw new u("finishRequest",'Required parameter "finishRequest" was null or undefined when calling runFinishCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/finish".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{status:e.status,note:e.note}}(e.finishRequest,!1)},t),e=>j(e))}async runFinishCreate(e,t){let a=await this.runFinishCreateRaw(e,t);return await a.value()}async runGoalsListRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runGoalsList().');let a={};null!=e.page&&(a.page=e.page),null!=e.pageSize&&(a.page_size=e.pageSize);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/goals".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(S)}})}async runGoalsList(e,t){let a=await this.runGoalsListRaw(e,t);return await a.value()}async runHeartbeatCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runHeartbeatCreate().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/heartbeat".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{}},t),e=>{var t;return null==(t=e)?t:{cancelRequested:t.cancel_requested}})}async runHeartbeatCreate(e,t){let a=await this.runHeartbeatCreateRaw(e,t);return await a.value()}async runListRaw(e,t){let a={};null!=e.agent&&(a.agent=e.agent),null!=e.attack&&(a.attack=e.attack),null!=e.campaign&&(a.campaign=e.campaign),null!=e.executor&&(a.executor=e.executor),null!=e.organization&&(a.organization=e.organization),null!=e.page&&(a.page=e.page),null!=e.pageSize&&(a.page_size=e.pageSize),null!=e.parent&&(a.parent=e.parent),null!=e.parentIsnull&&(a.parent__isnull=e.parentIsnull),null!=e.status&&(a.status=e.status);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(x)}})}async runList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.runListRaw(e,t);return await a.value()}async runPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{run_notes:e.runNotes,run_config:e.runConfig}}(e.patchedRunUpdateRequest,!1)},t),e=>j(e))}async runPartialUpdate(e,t){let a=await this.runPartialUpdateRaw(e,t);return await a.value()}async runResultCreateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runResultCreate().');if(null==e.resultRequest)throw new u("resultRequest",'Required parameter "resultRequest" was null or undefined when calling runResultCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}/result".replace("{id}",encodeURIComponent(String(e.id))),method:"POST",headers:a,query:{},body:O(e.resultRequest,!1)},t),e=>B(e))}async runResultCreate(e,t){let a=await this.runResultCreateRaw(e,t);return await a.value()}async runRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling runRetrieve().');let a={};null!=e.includeResults&&(a.include_results=e.includeResults);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("RunTokenAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/run/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:n,query:a},t),e=>j(e))}async runRetrieve(e,t){let a=await this.runRetrieveRaw(e,t);return await a.value()}}class ea extends r{async secretCreateRaw(e,t){if(null==e.secretWriteRequest)throw new u("secretWriteRequest",'Required parameter "secretWriteRequest" was null or undefined when calling secretCreate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/secret",method:"POST",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,value:e.value}}(e.secretWriteRequest,!1)},t),e=>E(e))}async secretCreate(e,t){let a=await this.secretCreateRaw(e,t);return await a.value()}async secretDestroyRaw(e,t){if(null==e.name)throw new u("name",'Required parameter "name" was null or undefined when calling secretDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/secret/{name}".replace("{name}",encodeURIComponent(String(e.name))),method:"DELETE",headers:a,query:{}},t),e=>(function(e,t){var a;if(null==e)return e;return{referencedBy:(a=e.referenced_by,null==a?a:{agents:a.agents,campaigns:a.campaigns})}})(e,0))}async secretDestroy(e,t){let a=await this.secretDestroyRaw(e,t);return await a.value()}async secretListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/secret",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(E)}})}async secretList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.secretListRaw(e,t);return await a.value()}async secretUpdateRaw(e,t){if(null==e.name)throw new u("name",'Required parameter "name" was null or undefined when calling secretUpdate().');if(null==e.secretValueRequest)throw new u("secretValueRequest",'Required parameter "secretValueRequest" was null or undefined when calling secretUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/secret/{name}".replace("{name}",encodeURIComponent(String(e.name))),method:"PUT",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{value:e.value}}(e.secretValueRequest,!1)},t),e=>E(e))}async secretUpdate(e,t){let a=await this.secretUpdateRaw(e,t);return await a.value()}}class en extends r{async userCreateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user",method:"POST",headers:a,query:{},body:M(e.userProfileRequest,!1)},t),e=>L(e))}async userCreate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userCreateRaw(e,t);return await a.value()}async userDestroyRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling userDestroy().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new h(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:a,query:{}},t))}async userDestroy(e,t){await this.userDestroyRaw(e,t)}async userListRaw(e,t){let a={};null!=e.page&&(a.page=e.page);let n={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(n.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(n.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user",method:"GET",headers:n,query:a},t),e=>{var t;return null==(t=e)?t:{count:t.count,next:null==t.next?void 0:t.next,previous:null==t.previous?void 0:t.previous,results:t.results.map(L)}})}async userList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userListRaw(e,t);return await a.value()}async userMeRetrieveRaw(e){let t={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("KeycloakJWTAccessToken",[]);a&&(t.Authorization="Bearer ".concat(a))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,a=await e("APIKeyAuth",[]);a&&(t.Authorization="Bearer ".concat(a))}return new l(await this.request({path:"/user/me",method:"GET",headers:t,query:{}},e),e=>L(e))}async userMeRetrieve(e){let t=await this.userMeRetrieveRaw(e);return await t.value()}async userMeUpdateRaw(e,t){let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/me",method:"PUT",headers:a,query:{},body:M(e.userProfileRequest,!1)},t),e=>L(e))}async userMeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=await this.userMeUpdateRaw(e,t);return await a.value()}async userPartialUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling userPartialUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PATCH",headers:a,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{email:e.email,first_name:e.firstName,last_name:e.lastName,analytics_consent:J(e.analyticsConsent,!1)}}(e.patchedUserProfileRequest,!1)},t),e=>L(e))}async userPartialUpdate(e,t){let a=await this.userPartialUpdateRaw(e,t);return await a.value()}async userRetrieveRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling userRetrieve().');let a={};if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:a,query:{}},t),e=>L(e))}async userRetrieve(e,t){let a=await this.userRetrieveRaw(e,t);return await a.value()}async userUpdateRaw(e,t){if(null==e.id)throw new u("id",'Required parameter "id" was null or undefined when calling userUpdate().');let a={};if(a["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("KeycloakJWTAccessToken",[]);t&&(a.Authorization="Bearer ".concat(t))}if(this.configuration&&this.configuration.accessToken){let e=this.configuration.accessToken,t=await e("APIKeyAuth",[]);t&&(a.Authorization="Bearer ".concat(t))}return new l(await this.request({path:"/user/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:a,query:{},body:M(e.userProfileRequest,!1)},t),e=>L(e))}async userUpdate(e,t){let a=await this.userUpdateRaw(e,t);return await a.value()}}},41444:(e,t,a)=>{a.d(t,{h:()=>o});var n=a(65727);let i=a.n(n)()({level:"info",browser:{asObject:!1,write:{debug:e=>!1,info:e=>console.info(e),warn:e=>console.warn(e),error:e=>console.error(e)}},redact:{paths:["token","password","authorization","apiKey","api_key","wallet.address","user.wallet.address","privateKey","private_key"],censor:"[REDACTED]"}}),o=e=>i.child({module:e})},64269:(e,t,a)=>{a.d(t,{cn:()=>o});var n=a(2821),i=a(75889);function o(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,i.QP)((0,n.$)(t))}}}]);
|