@whoz-oss/coday-client 0.206.0 → 0.207.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/chunk-22RX22JY.js +1 -0
- package/browser/chunk-26MGIRJF.js +1 -0
- package/browser/{chunk-JWURN5PB.js → chunk-2O4IDVFE.js} +1 -1
- package/browser/chunk-2P74VZU4.js +1 -0
- package/browser/{chunk-WXOBY3EY.js → chunk-3AOPEZPX.js} +1 -1
- package/browser/{chunk-KKZABPQU.js → chunk-3NOI65IY.js} +1 -1
- package/browser/{chunk-A5C4DTSU.js → chunk-43DMEMMQ.js} +1 -1
- package/browser/{chunk-ZJUUFIFM.js → chunk-4KEHW6KL.js} +1 -1
- package/browser/{chunk-4734TK7R.js → chunk-5CBZIB6D.js} +1 -1
- package/browser/{chunk-L3L75XR6.js → chunk-5K5EFCNT.js} +1 -1
- package/browser/chunk-5OPQ2IC6.js +1 -0
- package/browser/chunk-6VCRRGXF.js +1 -0
- package/browser/{chunk-5EHY76TA.js → chunk-A2R5GVPT.js} +1 -1
- package/browser/{chunk-YMLYNSOP.js → chunk-BMUZTI7K.js} +1 -1
- package/browser/{chunk-QDRJZVVJ.js → chunk-BQHUHW7P.js} +1 -1
- package/browser/{chunk-G32LX34P.js → chunk-CCPU2LL3.js} +1 -1
- package/browser/chunk-CU4C25HM.js +1 -0
- package/browser/{chunk-XXFLSKH4.js → chunk-F42BGKID.js} +1 -1
- package/browser/{chunk-2J5DAOVJ.js → chunk-FOAW6HUH.js} +1 -1
- package/browser/chunk-G2BRVRGR.js +1 -0
- package/browser/{chunk-P6ABEFHB.js → chunk-GUB4VYOT.js} +1 -1
- package/browser/{chunk-ERQUBIFQ.js → chunk-IOREZEED.js} +1 -1
- package/browser/{chunk-53URG3R4.js → chunk-JIHPEYRG.js} +1 -1
- package/browser/{chunk-6F2QS5ZN.js → chunk-KZJRQ6RN.js} +1 -1
- package/browser/{chunk-ZMCXRMG2.js → chunk-LH4ATU27.js} +1 -1
- package/browser/{chunk-6YFVWUFP.js → chunk-LMFI6Y77.js} +1 -1
- package/browser/chunk-LX5DYIMF.js +1 -0
- package/browser/{chunk-E64XBDJ4.js → chunk-M6ORKUDA.js} +1 -1
- package/browser/{chunk-BWMTUVRQ.js → chunk-NIWF7LLH.js} +1 -1
- package/browser/{chunk-SO5P7HTY.js → chunk-OSQQAYJZ.js} +1 -1
- package/browser/{chunk-55QD2MSQ.js → chunk-PNFA7PN2.js} +1 -1
- package/browser/{chunk-XXPGZDVF.js → chunk-RJBF3TIH.js} +1 -1
- package/browser/chunk-RRBTVPFV.js +1 -0
- package/browser/{chunk-CIMPBK5N.js → chunk-S7MAZ5PQ.js} +1 -1
- package/browser/chunk-SF7PCURW.js +1 -0
- package/browser/{chunk-OSVXE7XF.js → chunk-UAHCUD67.js} +1 -1
- package/browser/chunk-UDA26TV3.js +1 -0
- package/browser/{chunk-42QJEAX4.js → chunk-VHC775VZ.js} +1 -1
- package/browser/{chunk-JHUUVBVD.js → chunk-VIDPCJ3F.js} +1 -1
- package/browser/chunk-Y6K6VJYJ.js +1 -0
- package/browser/index.html +1 -1
- package/browser/{main-UE2RLE5B.js → main-VRT323QR.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-2L7CAI22.js +0 -1
- package/browser/chunk-3ODG3JTW.js +0 -1
- package/browser/chunk-7BGJAFEA.js +0 -1
- package/browser/chunk-7TME2YLZ.js +0 -1
- package/browser/chunk-BD6N2UN6.js +0 -1
- package/browser/chunk-HM6HNJMS.js +0 -1
- package/browser/chunk-LH2YTDIO.js +0 -1
- package/browser/chunk-OBNBWBWU.js +0 -1
- package/browser/chunk-RMRAPNZV.js +0 -1
- package/browser/chunk-TWMYRLVR.js +0 -1
- package/browser/chunk-WSIKJ6LY.js +0 -1
- package/browser/chunk-ZAKB7MFY.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Rc as ne,Sc as h,Tc as w,Uc as j,Z as A,a as f,aa as X,b as u,ba as x,ca as B,da as ee,g as Z,pa as te}from"./chunk-5J7BTB5J.js";var v=new X("basePath");var R=class{encodeKey(C){return encodeURIComponent(C)}encodeValue(C){return encodeURIComponent(C)}decodeKey(C){return decodeURIComponent(C)}decodeValue(C){return decodeURIComponent(C)}};var m=class{apiKeys;username;password;accessToken;basePath;withCredentials;encoder;encodeParam;credentials;constructor({accessToken:C,apiKeys:n,basePath:r,credentials:l,encodeParam:o,encoder:t,password:e,username:i,withCredentials:p}={}){n&&(this.apiKeys=n),i!==void 0&&(this.username=i),e!==void 0&&(this.password=e),C!==void 0&&(this.accessToken=C),r!==void 0&&(this.basePath=r),p!==void 0&&(this.withCredentials=p),t&&(this.encoder=t),this.encodeParam=o??(a=>this.defaultEncodeParam(a)),this.credentials=l??{}}selectHeaderContentType(C){if(C.length===0)return;let n=C.find(r=>this.isJsonMime(r));return n===void 0?C[0]:n}selectHeaderAccept(C){if(C.length===0)return;let n=C.find(r=>this.isJsonMime(r));return n===void 0?C[0]:n}isJsonMime(C){let n=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return C!==null&&(n.test(C)||C.toLowerCase()==="application/json-patch+json")}lookupCredential(C){let n=this.credentials[C];return typeof n=="function"?n():n}addCredentialToHeaders(C,n,r,l){let o=this.lookupCredential(C);return o?r.set(n,(l??"")+o):r}addCredentialToQuery(C,n,r){let l=this.lookupCredential(C);return l?r.set(n,l):r}defaultEncodeParam(C){let n=C.dataFormat==="date-time"&&C.value instanceof Date?C.value.toISOString():C.value;return encodeURIComponent(String(n))}};var P=class{basePath="http://localhost:8124";defaultHeaders=new ne;configuration;encoder;constructor(C,n){if(this.configuration=n||new m,typeof this.configuration.basePath!="string"){let r=Array.isArray(C)?C[0]:void 0;r!=null&&(C=r),typeof C!="string"&&(C=this.basePath),this.configuration.basePath=C}this.encoder=this.configuration.encoder||new R}canConsumeForm(C){return C.indexOf("multipart/form-data")!==-1}addToHttpParams(C,n,r,l=!1){return typeof n=="object"&&!(n instanceof Date)?this.addToHttpParamsRecursive(C,n,l?r:void 0,l):this.addToHttpParamsRecursive(C,n,r)}addToHttpParamsRecursive(C,n,r,l=!1){if(n==null)return C;if(typeof n=="object"){if(r!=null)return l?Object.keys(n).reduce((o,t)=>o.append(`${r}[${t}]`,n[t]),C):C.append(r,JSON.stringify(n));if(Array.isArray(n))n.forEach(o=>C=this.addToHttpParamsRecursive(C,o,r));else if(n instanceof Date)if(r!=null)C=C.append(r,n.toISOString());else throw Error("key may not be null if value is Date");else Object.keys(n).forEach(o=>{let t=r?`${r}.${o}`:o;C=this.addToHttpParamsRecursive(C,n[o],t)});return C}else if(r!=null)return C.append(r,n);throw Error("key may not be null if value is not object or array")}};var $=class H extends P{constructor(n,r,l){super(r,l);this.httpClient=n}createAgentConfig(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter agentConfig was null or undefined when calling createAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/agent-configs",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}deleteAgentConfig(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/agent-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}disableAgentConfig(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling disableAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/agent-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/disable`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}enableAgentConfig(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling enableAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/agent-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/enable`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getByIdAgentConfig(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/agent-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getByIdsAgentConfig(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter getByIdsRequest was null or undefined when calling getByIdsAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/agent-configs/by-ids",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getDefinitionAgentConfig(n,r,l,o="body",t=!1,e){if(n==null)throw new Error("Required parameter id was null or undefined when calling getDefinitionAgentConfig.");let i=new w({encoder:this.encoder});i=this.addToHttpParams(i,r,"withUserOverlay"),i=this.addToHttpParams(i,l,"namespaceId");let p=this.defaultHeaders,a=e?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);a!==void 0&&(p=p.set("Accept",a));let d=e?.context??new h,s=e?.transferCache??!0,c="json";a&&(a.startsWith("text")?c="text":this.configuration.isJsonMime(a)?c="json":c="blob");let g=`/api/agent-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/definition`,{basePath:b,withCredentials:y}=this.configuration;return this.httpClient.request("get",`${b}${g}`,u(f({context:d,params:i,responseType:c},y?{withCredentials:y}:{}),{headers:p,observe:o,transferCache:s,reportProgress:t}))}listByParentAgentConfig(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentAgentConfig.");let e=new w({encoder:this.encoder});e=this.addToHttpParams(e,r,"withDisabled");let i=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);p!==void 0&&(i=i.set("Accept",p));let a=t?.context??new h,d=t?.transferCache??!0,s="json";p&&(p.startsWith("text")?s="text":this.configuration.isJsonMime(p)?s="json":s="blob");let c=`/api/agent-configs/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("get",`${g}${c}`,u(f({context:a,params:e,responseType:s},b?{withCredentials:b}:{}),{headers:i,observe:l,transferCache:d,reportProgress:o}))}listPlatformAgentsAgentConfig(n,r="body",l=!1,o){let t=new w({encoder:this.encoder});t=this.addToHttpParams(t,n,"withDisabled");let e=this.defaultHeaders,i=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let p=o?.context??new h,a=o?.transferCache??!0,d="json";i&&(i.startsWith("text")?d="text":this.configuration.isJsonMime(i)?d="json":d="blob");let s="/api/agent-configs/platform",{basePath:c,withCredentials:g}=this.configuration;return this.httpClient.request("get",`${c}${s}`,u(f({context:p,params:t,responseType:d},g?{withCredentials:g}:{}),{headers:e,observe:r,transferCache:a,reportProgress:l}))}searchAgentConfig(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter agentConfigSearchRequest was null or undefined when calling searchAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/agent-configs/search",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}updateAgentConfig(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateAgentConfig.");if(r==null)throw new Error("Required parameter agentConfig was null or undefined when calling updateAgentConfig.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/agent-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:b,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${b}${g}`,u(f({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(m,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var M=class H extends P{constructor(n,r,l){super(r,l);this.httpClient=n}createAiModel(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter aiModel was null or undefined when calling createAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/ai-models",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}deleteAiModel(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/ai-models/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getByIdAiModel(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/ai-models/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getByIdsAiModel(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter getByIdsRequest was null or undefined when calling getByIdsAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/ai-models/by-ids",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}listByNamespaceIdAiModel(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling listByNamespaceIdAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/ai-models/by-namespaceId/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}listByParentAiModel(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/ai-models/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}listPlatformLevelAiModel(n="body",r=!1,l){let o=this.defaultHeaders,t=l?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=l?.context??new h,i=l?.transferCache??!0,p="json";t&&(t.startsWith("text")?p="text":this.configuration.isJsonMime(t)?p="json":p="blob");let a="/api/ai-models/platform",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${a}`,u(f({context:e,responseType:p},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}updateAiModel(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateAiModel.");if(r==null)throw new Error("Required parameter aiModel was null or undefined when calling updateAiModel.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/ai-models/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:b,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${b}${g}`,u(f({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(m,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var S=class H extends P{constructor(n,r,l){super(r,l);this.httpClient=n}createAiProvider(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter aiProvider was null or undefined when calling createAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/ai-providers",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}deleteAiProvider(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/ai-providers/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getByIdAiProvider(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/ai-providers/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getByIdsAiProvider(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter getByIdsRequest was null or undefined when calling getByIdsAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/ai-providers/by-ids",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}listAiProvider(n,r,l="body",o=!1,t){let e=new w({encoder:this.encoder});e=this.addToHttpParams(e,n,"namespaceId"),e=this.addToHttpParams(e,r,"userId");let i=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);p!==void 0&&(i=i.set("Accept",p));let a=t?.context??new h,d=t?.transferCache??!0,s="json";p&&(p.startsWith("text")?s="text":this.configuration.isJsonMime(p)?s="json":s="blob");let c="/api/ai-providers",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("get",`${g}${c}`,u(f({context:a,params:e,responseType:s},b?{withCredentials:b}:{}),{headers:i,observe:l,transferCache:d,reportProgress:o}))}updateAiProvider(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateAiProvider.");if(r==null)throw new Error("Required parameter aiProvider was null or undefined when calling updateAiProvider.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/ai-providers/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:b,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${b}${g}`,u(f({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(m,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var U=class H extends P{constructor(n,r,l){super(r,l);this.httpClient=n}addMessageCase(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling addMessageCase.");if(r==null)throw new Error("Required parameter addMessageRequest was null or undefined when calling addMessageCase.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/messages`,{basePath:b,withCredentials:y}=this.configuration;return this.httpClient.request("post",`${b}${g}`,u(f({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}createCase(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter _case was null or undefined when calling createCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/cases",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}deleteCase(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getByIdCase(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getByIdsCase(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter getByIdsRequest was null or undefined when calling getByIdsCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/cases/by-ids",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}interruptCase(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling interruptCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/interrupt`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}killCase(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling killCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/kill`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}listByParentCase(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}listByUserCase(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter userId was null or undefined when calling listByUserCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/by-user/${this.configuration.encodeParam({name:"userId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}listByUserExternalIdCase(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter externalId was null or undefined when calling listByUserExternalIdCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/by-user/external/${this.configuration.encodeParam({name:"externalId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}listByUserInNamespaceCase(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter listByUserInNamespaceRequest was null or undefined when calling listByUserInNamespaceCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/cases/by-user/in-namespace",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}updateCase(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateCase.");if(r==null)throw new Error("Required parameter _case was null or undefined when calling updateCase.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/cases/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:b,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${b}${g}`,u(f({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(m,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var F=class H extends P{constructor(n,r,l){super(r,l);this.httpClient=n}createIntegrationConfig(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter integrationConfig was null or undefined when calling createIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/integration-configs",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}deleteIntegrationConfig(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/integration-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getByIdIntegrationConfig(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/integration-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getByIdsIntegrationConfig(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter getByIdsRequest was null or undefined when calling getByIdsIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/integration-configs/by-ids",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}listIntegrationConfig(n,r,l="body",o=!1,t){let e=new w({encoder:this.encoder});e=this.addToHttpParams(e,n,"namespaceId"),e=this.addToHttpParams(e,r,"userId");let i=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);p!==void 0&&(i=i.set("Accept",p));let a=t?.context??new h,d=t?.transferCache??!0,s="json";p&&(p.startsWith("text")?s="text":this.configuration.isJsonMime(p)?s="json":s="blob");let c="/api/integration-configs",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("get",`${g}${c}`,u(f({context:a,params:e,responseType:s},b?{withCredentials:b}:{}),{headers:i,observe:l,transferCache:d,reportProgress:o}))}updateIntegrationConfig(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateIntegrationConfig.");if(r==null)throw new Error("Required parameter integrationConfig was null or undefined when calling updateIntegrationConfig.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/integration-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:b,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${b}${g}`,u(f({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(m,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var N=class H extends P{constructor(n,r,l){super(r,l);this.httpClient=n}getTypeIntegrationType(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter type was null or undefined when calling getTypeIntegrationType.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/integration-types/${this.configuration.encodeParam({name:"type",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}listTypesIntegrationType(n="body",r=!1,l){let o=this.defaultHeaders,t=l?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=l?.context??new h,i=l?.transferCache??!0,p="json";t&&(t.startsWith("text")?p="text":this.configuration.isJsonMime(t)?p="json":p="blob");let a="/api/integration-types",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${a}`,u(f({context:e,responseType:p},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(m,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var G=class H extends P{constructor(n,r,l){super(r,l);this.httpClient=n}createNamespace(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter namespace was null or undefined when calling createNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/namespaces",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}deleteNamespace(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}deployAgentsNamespace(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling deployAgentsNamespace.");if(r==null)throw new Error("Required parameter namespaceAgentDeployRequest was null or undefined when calling deployAgentsNamespace.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/deploy-agents`,{basePath:b,withCredentials:y}=this.configuration;return this.httpClient.request("post",`${b}${g}`,u(f({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}getByIdNamespace(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getByIdsNamespace(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter getByIdsRequest was null or undefined when calling getByIdsNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/namespaces/by-ids",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}listAllNamespace(n="body",r=!1,l){let o=this.defaultHeaders,t=l?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=l?.context??new h,i=l?.transferCache??!0,p="json";t&&(t.startsWith("text")?p="text":this.configuration.isJsonMime(t)?p="json":p="blob");let a="/api/namespaces",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${a}`,u(f({context:e,responseType:p},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}listByExternalIdsNamespace(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling listByExternalIdsNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/namespaces/by-external-ids",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}undeployAgentsNamespace(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling undeployAgentsNamespace.");if(r==null)throw new Error("Required parameter namespaceAgentDeployRequest was null or undefined when calling undeployAgentsNamespace.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/undeploy-agents`,{basePath:b,withCredentials:y}=this.configuration;return this.httpClient.request("post",`${b}${g}`,u(f({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}updateNamespace(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateNamespace.");if(r==null)throw new Error("Required parameter namespace was null or undefined when calling updateNamespace.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:b,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${b}${g}`,u(f({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(m,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var oe=(o=>(o.OpenAI="OpenAI",o.Anthropic="Anthropic",o.Gemini="Gemini",o.vLLM="vLLM",o.Ollama="Ollama",o))(oe||{});var J=class H extends P{constructor(n,r,l){super(r,l);this.httpClient=n}getByIdCaseEventRest(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdCaseEventRest.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getByIdsCaseEventRest(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsCaseEventRest.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/case-events/by-ids",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}listByCaseCaseEventRest(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling listByCaseCaseEventRest.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/by-parentId/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(m,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var W=class H extends P{constructor(n,r,l){super(r,l);this.httpClient=n}deleteCaseFileExchange(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling deleteCaseFileExchange.");if(r==null)throw new Error("Required parameter path was null or undefined when calling deleteCaseFileExchange.");let e=new w({encoder:this.encoder});e=this.addToHttpParams(e,r,"path");let i=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);p!==void 0&&(i=i.set("Accept",p));let a=t?.context??new h,d=t?.transferCache??!0,s="json";p&&(p.startsWith("text")?s="text":this.configuration.isJsonMime(p)?s="json":s="blob");let c=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/files`,{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("delete",`${g}${c}`,u(f({context:a,params:e,responseType:s},b?{withCredentials:b}:{}),{headers:i,observe:l,transferCache:d,reportProgress:o}))}deleteNamespaceFileExchange(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling deleteNamespaceFileExchange.");if(r==null)throw new Error("Required parameter path was null or undefined when calling deleteNamespaceFileExchange.");let e=new w({encoder:this.encoder});e=this.addToHttpParams(e,r,"path");let i=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);p!==void 0&&(i=i.set("Accept",p));let a=t?.context??new h,d=t?.transferCache??!0,s="json";p&&(p.startsWith("text")?s="text":this.configuration.isJsonMime(p)?s="json":s="blob");let c=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/files`,{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("delete",`${g}${c}`,u(f({context:a,params:e,responseType:s},b?{withCredentials:b}:{}),{headers:i,observe:l,transferCache:d,reportProgress:o}))}downloadCaseFileExchange(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling downloadCaseFileExchange.");if(r==null)throw new Error("Required parameter path was null or undefined when calling downloadCaseFileExchange.");let e=new w({encoder:this.encoder});e=this.addToHttpParams(e,r,"path");let i=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/octet-stream"]);p!==void 0&&(i=i.set("Accept",p));let a=t?.context??new h,d=t?.transferCache??!0,s="json";p&&(p.startsWith("text")?s="text":this.configuration.isJsonMime(p)?s="json":s="blob");let c=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/files/download`,{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("get",`${g}${c}`,u(f({context:a,params:e,responseType:s},b?{withCredentials:b}:{}),{headers:i,observe:l,transferCache:d,reportProgress:o}))}downloadNamespaceFileExchange(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling downloadNamespaceFileExchange.");if(r==null)throw new Error("Required parameter path was null or undefined when calling downloadNamespaceFileExchange.");let e=new w({encoder:this.encoder});e=this.addToHttpParams(e,r,"path");let i=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/octet-stream"]);p!==void 0&&(i=i.set("Accept",p));let a=t?.context??new h,d=t?.transferCache??!0,s="json";p&&(p.startsWith("text")?s="text":this.configuration.isJsonMime(p)?s="json":s="blob");let c=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/files/download`,{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("get",`${g}${c}`,u(f({context:a,params:e,responseType:s},b?{withCredentials:b}:{}),{headers:i,observe:l,transferCache:d,reportProgress:o}))}getCaseFileContentExchange(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling getCaseFileContentExchange.");if(r==null)throw new Error("Required parameter path was null or undefined when calling getCaseFileContentExchange.");let e=new w({encoder:this.encoder});e=this.addToHttpParams(e,r,"path");let i=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);p!==void 0&&(i=i.set("Accept",p));let a=t?.context??new h,d=t?.transferCache??!0,s="json";p&&(p.startsWith("text")?s="text":this.configuration.isJsonMime(p)?s="json":s="blob");let c=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/files/content`,{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("get",`${g}${c}`,u(f({context:a,params:e,responseType:s},b?{withCredentials:b}:{}),{headers:i,observe:l,transferCache:d,reportProgress:o}))}getCaseFilesManifestExchange(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling getCaseFilesManifestExchange.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/files/manifest`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getNamespaceFileContentExchange(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling getNamespaceFileContentExchange.");if(r==null)throw new Error("Required parameter path was null or undefined when calling getNamespaceFileContentExchange.");let e=new w({encoder:this.encoder});e=this.addToHttpParams(e,r,"path");let i=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);p!==void 0&&(i=i.set("Accept",p));let a=t?.context??new h,d=t?.transferCache??!0,s="json";p&&(p.startsWith("text")?s="text":this.configuration.isJsonMime(p)?s="json":s="blob");let c=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/files/content`,{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("get",`${g}${c}`,u(f({context:a,params:e,responseType:s},b?{withCredentials:b}:{}),{headers:i,observe:l,transferCache:d,reportProgress:o}))}getNamespaceFilesManifestExchange(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling getNamespaceFilesManifestExchange.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/files/manifest`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}uploadCaseFileExchange(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling uploadCaseFileExchange.");if(r==null)throw new Error("Required parameter file was null or undefined when calling uploadCaseFileExchange.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d=["multipart/form-data"],s=this.canConsumeForm(d),c,g=!1,b=!1;g=s,g?c=new FormData:c=new w({encoder:this.encoder}),r!==void 0&&(c=c.append("file",r)||c);let y="json";i&&(i.startsWith("text")?y="text":this.configuration.isJsonMime(i)?y="json":y="blob");let O=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/files`,{basePath:q,withCredentials:E}=this.configuration;return this.httpClient.request("post",`${q}${O}`,u(f({context:p,body:b?c.toString():c,responseType:y},E?{withCredentials:E}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}uploadNamespaceFileExchange(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling uploadNamespaceFileExchange.");if(r==null)throw new Error("Required parameter file was null or undefined when calling uploadNamespaceFileExchange.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d=["multipart/form-data"],s=this.canConsumeForm(d),c,g=!1,b=!1;g=s,g?c=new FormData:c=new w({encoder:this.encoder}),r!==void 0&&(c=c.append("file",r)||c);let y="json";i&&(i.startsWith("text")?y="text":this.configuration.isJsonMime(i)?y="json":y="blob");let O=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/files`,{basePath:q,withCredentials:E}=this.configuration;return this.httpClient.request("post",`${q}${O}`,u(f({context:p,body:b?c.toString():c,responseType:y},E?{withCredentials:E}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(m,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var _=class H extends P{constructor(n,r,l){super(r,l);this.httpClient=n}createFeedback(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter feedbackInput was null or undefined when calling createFeedback.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/feedbacks",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}listByCaseEventFeedback(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter caseEventId was null or undefined when calling listByCaseEventFeedback.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/feedbacks/by-case-event/${this.configuration.encodeParam({name:"caseEventId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}listByCaseFeedback(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling listByCaseFeedback.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/feedbacks/by-parentId/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(m,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var D=class H extends P{constructor(n,r,l){super(r,l);this.httpClient=n}grantAdmin(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling grantAdmin.");if(r==null)throw new Error("Required parameter targetUserId was null or undefined when calling grantAdmin.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d="json";i&&(i.startsWith("text")?d="text":this.configuration.isJsonMime(i)?d="json":d="blob");let s=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/admins/${this.configuration.encodeParam({name:"targetUserId",value:r,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:c,withCredentials:g}=this.configuration;return this.httpClient.request("put",`${c}${s}`,u(f({context:p,responseType:d},g?{withCredentials:g}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}grantMember(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling grantMember.");if(r==null)throw new Error("Required parameter targetUserId was null or undefined when calling grantMember.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d="json";i&&(i.startsWith("text")?d="text":this.configuration.isJsonMime(i)?d="json":d="blob");let s=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/members/${this.configuration.encodeParam({name:"targetUserId",value:r,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:c,withCredentials:g}=this.configuration;return this.httpClient.request("put",`${c}${s}`,u(f({context:p,responseType:d},g?{withCredentials:g}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}listNamespaceUsers(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling listNamespaceUsers.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/users`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}revokeAdmin(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling revokeAdmin.");if(r==null)throw new Error("Required parameter targetUserId was null or undefined when calling revokeAdmin.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d="json";i&&(i.startsWith("text")?d="text":this.configuration.isJsonMime(i)?d="json":d="blob");let s=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/admins/${this.configuration.encodeParam({name:"targetUserId",value:r,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:c,withCredentials:g}=this.configuration;return this.httpClient.request("delete",`${c}${s}`,u(f({context:p,responseType:d},g?{withCredentials:g}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}revokeMember(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling revokeMember.");if(r==null)throw new Error("Required parameter targetUserId was null or undefined when calling revokeMember.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d="json";i&&(i.startsWith("text")?d="text":this.configuration.isJsonMime(i)?d="json":d="blob");let s=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/members/${this.configuration.encodeParam({name:"targetUserId",value:r,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:c,withCredentials:g}=this.configuration;return this.httpClient.request("delete",`${c}${s}`,u(f({context:p,responseType:d},g?{withCredentials:g}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}updateRolesByExternalId(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter syncUserRolesRequest was null or undefined when calling updateRolesByExternalId.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/namespaces/update-roles-by-external-id",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(m,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var k=class H extends P{constructor(n,r,l){super(r,l);this.httpClient=n}debugAllPlugins(n="body",r=!1,l){let o=this.defaultHeaders,t=l?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=l?.context??new h,i=l?.transferCache??!0,p="json";t&&(t.startsWith("text")?p="text":this.configuration.isJsonMime(t)?p="json":p="blob");let a="/api/plugins/debug",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${a}`,u(f({context:e,responseType:p},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}debugPlugin(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling debugPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/debug`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getAllPlugins(n="body",r=!1,l){let o=this.defaultHeaders,t=l?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=l?.context??new h,i=l?.transferCache??!0,p="json";t&&(t.startsWith("text")?p="text":this.configuration.isJsonMime(t)?p="json":p="blob");let a="/api/plugins",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${a}`,u(f({context:e,responseType:p},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}getPlugin(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling getPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}reloadAllAgentsPlugin(n="body",r=!1,l){let o=this.defaultHeaders,t=l?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=l?.context??new h,i=l?.transferCache??!0,p="json";t&&(t.startsWith("text")?p="text":this.configuration.isJsonMime(t)?p="json":p="blob");let a="/api/plugins/reload-agents",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("post",`${d}${a}`,u(f({context:e,responseType:p},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}reloadPlugin(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling reloadPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/reload`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}startPlugin(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling startPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/start`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}stopPlugin(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling stopPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/stop`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}unloadPlugin(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling unloadPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}uploadPlugin(n="body",r=!1,l){let o=this.defaultHeaders,t=l?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=l?.context??new h,i=l?.transferCache??!0,p="json";t&&(t.startsWith("text")?p="text":this.configuration.isJsonMime(t)?p="json":p="blob");let a="/api/plugins/upload",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("post",`${d}${a}`,u(f({context:e,responseType:p},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(m,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var L=class H extends P{constructor(n,r,l){super(r,l);this.httpClient=n}createPrompt(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter prompt was null or undefined when calling createPrompt.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/prompts",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}deletePrompt(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deletePrompt.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/prompts/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}findEffectiveByNamespaceIdPrompt(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling findEffectiveByNamespaceIdPrompt.");let t=new w({encoder:this.encoder});t=this.addToHttpParams(t,n,"namespaceId");let e=this.defaultHeaders,i=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let p=o?.context??new h,a=o?.transferCache??!0,d="json";i&&(i.startsWith("text")?d="text":this.configuration.isJsonMime(i)?d="json":d="blob");let s="/api/prompts/effective",{basePath:c,withCredentials:g}=this.configuration;return this.httpClient.request("get",`${c}${s}`,u(f({context:p,params:t,responseType:d},g?{withCredentials:g}:{}),{headers:e,observe:r,transferCache:a,reportProgress:l}))}getByIdPrompt(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdPrompt.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/prompts/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getByIdsPrompt(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter getByIdsRequest was null or undefined when calling getByIdsPrompt.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/prompts/by-ids",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}listByParentPrompt(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentPrompt.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/prompts/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}listPrompt(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter scope was null or undefined when calling listPrompt.");let e=new w({encoder:this.encoder});e=this.addToHttpParams(e,n,"scope"),e=this.addToHttpParams(e,r,"namespaceId");let i=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);p!==void 0&&(i=i.set("Accept",p));let a=t?.context??new h,d=t?.transferCache??!0,s="json";p&&(p.startsWith("text")?s="text":this.configuration.isJsonMime(p)?s="json":s="blob");let c="/api/prompts",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("get",`${g}${c}`,u(f({context:a,params:e,responseType:s},b?{withCredentials:b}:{}),{headers:i,observe:l,transferCache:d,reportProgress:o}))}updatePrompt(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updatePrompt.");if(r==null)throw new Error("Required parameter prompt was null or undefined when calling updatePrompt.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/prompts/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:b,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${b}${g}`,u(f({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(m,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var Q=class H extends P{constructor(n,r,l){super(r,l);this.httpClient=n}streamEventsCaseEventSse(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling streamEventsCaseEventSse.");let e=new w({encoder:this.encoder});e=this.addToHttpParams(e,r,"includePreviousEvents");let i=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["text/event-stream"]);p!==void 0&&(i=i.set("Accept",p));let a=t?.context??new h,d=t?.transferCache??!0,s="json";p&&(p.startsWith("text")?s="text":this.configuration.isJsonMime(p)?s="json":s="blob");let c=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/events`,{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("get",`${g}${c}`,u(f({context:a,params:e,responseType:s},b?{withCredentials:b}:{}),{headers:i,observe:l,transferCache:d,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(m,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var K=class H extends P{constructor(n,r,l){super(r,l);this.httpClient=n}createUser(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter user was null or undefined when calling createUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/users",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}deleteUser(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/users/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getByIdUser(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/users/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getByIdsUser(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter getByIdsRequest was null or undefined when calling getByIdsUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/users/by-ids",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getGroupsByExternalIdsUser(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter groupsByExternalIdsRequest was null or undefined when calling getGroupsByExternalIdsUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/users/groups-by-external-ids",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}getMeUser(n="body",r=!1,l){let o=this.defaultHeaders,t=l?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=l?.context??new h,i=l?.transferCache??!0,p="json";t&&(t.startsWith("text")?p="text":this.configuration.isJsonMime(t)?p="json":p="blob");let a="/api/users/me",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${a}`,u(f({context:e,responseType:p},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}listAllUser(n="body",r=!1,l){let o=this.defaultHeaders,t=l?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=l?.context??new h,i=l?.transferCache??!0,p="json";t&&(t.startsWith("text")?p="text":this.configuration.isJsonMime(t)?p="json":p="blob");let a="/api/users",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${a}`,u(f({context:e,responseType:p},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}listByExternalIdsUser(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling listByExternalIdsUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/users/by-external-ids",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}updateUser(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateUser.");if(r==null)throw new Error("Required parameter user was null or undefined when calling updateUser.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/users/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:b,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${b}${g}`,u(f({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(m,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var z=class H extends P{constructor(n,r,l){super(r,l);this.httpClient=n}createUserGroup(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter userGroupCreateRequest was null or undefined when calling createUserGroup.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/user-groups",{basePath:g,withCredentials:b}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(f({context:i,body:n,responseType:s},b?{withCredentials:b}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}deleteUserGroup(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter userGroupId was null or undefined when calling deleteUserGroup.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/user-groups/${this.configuration.encodeParam({name:"userGroupId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}findByNamespaceIdUserGroup(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling findByNamespaceIdUserGroup.");let t=new w({encoder:this.encoder});t=this.addToHttpParams(t,n,"namespaceId");let e=this.defaultHeaders,i=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let p=o?.context??new h,a=o?.transferCache??!0,d="json";i&&(i.startsWith("text")?d="text":this.configuration.isJsonMime(i)?d="json":d="blob");let s="/api/user-groups",{basePath:c,withCredentials:g}=this.configuration;return this.httpClient.request("get",`${c}${s}`,u(f({context:p,params:t,responseType:d},g?{withCredentials:g}:{}),{headers:e,observe:r,transferCache:a,reportProgress:l}))}getByIdUserGroup(n,r="body",l=!1,o){if(n==null)throw new Error("Required parameter userGroupId was null or undefined when calling getByIdUserGroup.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/user-groups/${this.configuration.encodeParam({name:"userGroupId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(f({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:p,reportProgress:l}))}updateUserGroup(n,r,l="body",o=!1,t){if(n==null)throw new Error("Required parameter userGroupId was null or undefined when calling updateUserGroup.");if(r==null)throw new Error("Required parameter userGroupUpdateRequest was null or undefined when calling updateUserGroup.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let p=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/user-groups/${this.configuration.encodeParam({name:"userGroupId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:b,withCredentials:y}=this.configuration;return this.httpClient.request("post",`${b}${g}`,u(f({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:l,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(m,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};function Nr(H){return ee([typeof H=="string"?{provide:v,useValue:H}:{provide:m,useValue:new m(f({},H))}])}var Y=class H{config=B(m);zone=B(te);connect(C){let n=`${this.config.basePath}/api/cases/${C}/events`;return new Z(r=>{let l=this.zone.runOutsideAngular(()=>new EventSource(n));return l.onmessage=o=>{try{let t=JSON.parse(o.data);this.zone.run(()=>r.next(t))}catch(t){this.zone.run(()=>r.error(new Error(`Failed to parse SSE event: ${t}`)))}},l.onerror=o=>{l.readyState===EventSource.CLOSED?this.zone.run(()=>r.complete()):this.zone.run(()=>r.error(new Error(`SSE connection error for case ${C}`))),l.close()},()=>l.close()})}static \u0275fac=function(n){return new(n||H)};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};export{m as a,$ as b,M as c,S as d,U as e,F as f,N as g,G as h,D as i,k as j,L as k,K as l,oe as m,Nr as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Y}from"./chunk-4734TK7R.js";import{a as Z}from"./chunk-ZMCXRMG2.js";import"./chunk-PRFGHN7L.js";import"./chunk-JHUUVBVD.js";import{g as B}from"./chunk-BD6N2UN6.js";import{a as R,c as L}from"./chunk-7MQRVE7E.js";import{p as X}from"./chunk-BGEXT3EN.js";import"./chunk-PKBNMAQJ.js";import"./chunk-OBV4LQBZ.js";import{a as v,c as y}from"./chunk-IRZNRZ5Q.js";import"./chunk-FAM7HWYV.js";import{F as W,c as z,e as x,g as A,h as G,i as q,l as u,n as j,p as $,s as J,w as U,x as H,y as K,z as Q}from"./chunk-WLSXA23B.js";import"./chunk-E3XC4CVU.js";import{Bb as T,Db as g,Fb as p,Ka as a,Tb as l,Ub as b,Vb as N,Wa as w,ca as m,ga as _,ha as h,kb as I,lb as M,lc as D,m as E,ma as F,mb as P,pb as O,qb as k,rb as s,sb as i,ta as d,tb as o,ua as V,ub as C}from"./chunk-5J7BTB5J.js";function te(r,e){r&1&&(i(0,"p",5),l(1,"Loading\u2026"),o())}function ne(r,e){if(r&1&&(i(0,"label",10),C(1,"input",25),i(2,"span"),l(3),o()()),r&2){let t=e.$implicit,n=p(2);a(),s("value",t.value)("formControl",n.scopeControl)("disabled",t.value==="namespace"&&!n.isAdmin()),a(2),b(t.label)}}function oe(r,e){if(r&1&&(i(0,"option",16),l(1),o()),r&2){let t=e.$implicit;s("value",t.type),a(),b(t.displayName)}}function ie(r,e){if(r&1){let t=T();i(0,"div",21)(1,"ds-json-schema-form",26),g("valueChange",function(c){_(t);let f=p(2);return h(f.onParamsChange(c))}),o()()}if(r&2){let t=p(2);a(),s("schema",e)("value",t.initialParams())}}function re(r,e){if(r&1){let t=T();i(0,"form",7),g("ngSubmit",function(){_(t);let c=p();return h(c.submit())}),i(1,"fieldset",8)(2,"legend",9),l(3,"Scope"),o(),O(4,ne,4,4,"label",10,I().trackByScope,!0),o(),i(6,"div",11)(7,"label",12),l(8,"Type "),i(9,"span",13),l(10,"*"),o()(),i(11,"select",14)(12,"option",15),l(13,"Select type"),o(),O(14,oe,2,2,"option",16,I().trackByType,!0),o()(),i(16,"div",11)(17,"label",17),l(18,"Name "),i(19,"span",13),l(20,"*"),o()(),C(21,"input",18),o(),i(22,"div",11)(23,"label",19),l(24,"Description"),o(),C(25,"textarea",20),o(),M(26,ie,2,2,"div",21),i(27,"div",22)(28,"button",23),l(29),o(),i(30,"button",24),g("click",function(){_(t);let c=p();return h(c.cancel())}),l(31,"Cancel"),o()()()}if(r&2){let t,n=p();s("formGroup",n.form),a(),s("disabled",n.isEditMode()),a(3),k(n.scopeOptions),a(7),s("formControl",n.typeControl),a(3),k(n.integrationTypes()),a(7),s("formControl",n.nameControl),a(4),s("formControl",n.descriptionControl),a(),P((t=n.schema())?26:-1,t),a(2),s("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),a(),N(" ",n.isEditMode()?"Save changes":"Create"," ")}}var ae=new Set(["platform","namespace","userOnNs","userGlobal"]),S=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ee=class r{route=m(R);router=m(L);destroyRef=m(F);state=m(Y);integrationTypeController=m(B);namespaceRole=m(Z);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=y(this.isPlatformMode?E(!0):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new q({name:new u("",{nonNullable:!0,validators:[x.required,x.minLength(1)]}),description:new u(null),type:new u("",{nonNullable:!0,validators:[x.required]}),scope:new u("namespace",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}isEditMode=d(!1);isSubmitting=d(!1);isLoading=d(!1);scopeOptions=[{value:"platform",label:S.platform},{value:"namespace",label:S.namespace},{value:"userOnNs",label:S.userOnNs},{value:"userGlobal",label:S.userGlobal}];paramsValue=d(null);initialParams=d(null);integrationTypes=y(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=y(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});schema=D(()=>{let e=this.selectedType();return e?this.integrationTypes().find(n=>n.type===e)?.configSchema??null:null});existingConfig=null;constructor(){V(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs")})}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let e=this.route.snapshot.paramMap,t=this.route.snapshot.queryParamMap,n=e.get("integrationId");if(n){this.isEditMode.set(!0),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let c=this.parseScope(t.get("scope"));this.scopeControl.setValue(c);let f=t.get("template");f&&this.hydrateFromTemplate(f)}parseScope(e){return e&&ae.has(e)?e:"namespace"}deriveScopeFromConfig(e){return!e.userId&&!e.namespaceId?"platform":e.userId?e.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(e){this.isLoading.set(!0),this.state.getById(e).pipe(v(this.destroyRef)).subscribe({next:t=>{this.existingConfig=t,this.scopeControl.setValue(this.deriveScopeFromConfig(t)),this.applyConfigToForm(t),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),console.warn(`[IntegrationForm] Could not load config '${e}' \u2014 navigating back`),this.navigateBack()}})}hydrateFromTemplate(e){this.isLoading.set(!0),this.state.getById(e).pipe(v(this.destroyRef)).subscribe({next:t=>{this.applyConfigToForm(t),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})},error:t=>{console.warn(`[IntegrationForm] Could not hydrate from template ${e}:`,t),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})}})}applyConfigToForm(e){this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.typeControl.setValue(e.integrationType),this.initialParams.set(e.parameters),this.paramsValue.set(e.parameters)}onParamsChange(e){this.paramsValue.set(e)}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(!0);let e=this.descriptionControl.value?.trim(),t={name:this.nameControl.value.trim(),description:e||null,integrationType:this.typeControl.value,parameters:this.paramsValue()},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,t,n,this.existingConfig):this.state.create(t,n,this.namespaceId??null)).pipe(v(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"])}trackByType(e,t){return t.type}trackByScope(e,t){return t.value}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=w({type:r,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[3,"valueChange","schema","value"]],template:function(t,n){t&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),g("click",function(){return n.cancel()}),i(3,"span",3),l(4,"\u2190"),o(),l(5," Integrations "),o(),i(6,"h1",4),l(7),o()(),M(8,te,2,0,"p",5)(9,re,32,8,"form",6),o()),t&2&&(a(7),b(n.isEditMode()?"Edit integration":"New integration"),a(),P(n.isLoading()?8:9))},dependencies:[W,j,K,Q,z,H,$,A,G,J,U,X],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-border-light, rgba(0, 0, 0, .06));border-radius:10px;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text, #1d1d1f);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:10px;border:1px solid var(--color-border-light, rgba(0, 0, 0, .06));background:var(--glass-bg, rgba(255, 255, 255, .5));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px))}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{ee as IntegrationFormComponent};
|
|
1
|
+
import{a as Y}from"./chunk-5CBZIB6D.js";import{a as Z}from"./chunk-LH4ATU27.js";import"./chunk-PRFGHN7L.js";import"./chunk-VIDPCJ3F.js";import{g as B}from"./chunk-G2BRVRGR.js";import{a as R,c as L}from"./chunk-7MQRVE7E.js";import{p as X}from"./chunk-BGEXT3EN.js";import"./chunk-PKBNMAQJ.js";import"./chunk-OBV4LQBZ.js";import{a as v,c as y}from"./chunk-IRZNRZ5Q.js";import"./chunk-FAM7HWYV.js";import{F as W,c as z,e as x,g as A,h as G,i as q,l as u,n as j,p as $,s as J,w as U,x as H,y as K,z as Q}from"./chunk-WLSXA23B.js";import"./chunk-E3XC4CVU.js";import{Bb as T,Db as g,Fb as p,Ka as a,Tb as l,Ub as b,Vb as N,Wa as w,ca as m,ga as _,ha as h,kb as I,lb as M,lc as D,m as E,ma as F,mb as P,pb as O,qb as k,rb as s,sb as i,ta as d,tb as o,ua as V,ub as C}from"./chunk-5J7BTB5J.js";function te(r,e){r&1&&(i(0,"p",5),l(1,"Loading\u2026"),o())}function ne(r,e){if(r&1&&(i(0,"label",10),C(1,"input",25),i(2,"span"),l(3),o()()),r&2){let t=e.$implicit,n=p(2);a(),s("value",t.value)("formControl",n.scopeControl)("disabled",t.value==="namespace"&&!n.isAdmin()),a(2),b(t.label)}}function oe(r,e){if(r&1&&(i(0,"option",16),l(1),o()),r&2){let t=e.$implicit;s("value",t.type),a(),b(t.displayName)}}function ie(r,e){if(r&1){let t=T();i(0,"div",21)(1,"ds-json-schema-form",26),g("valueChange",function(c){_(t);let f=p(2);return h(f.onParamsChange(c))}),o()()}if(r&2){let t=p(2);a(),s("schema",e)("value",t.initialParams())}}function re(r,e){if(r&1){let t=T();i(0,"form",7),g("ngSubmit",function(){_(t);let c=p();return h(c.submit())}),i(1,"fieldset",8)(2,"legend",9),l(3,"Scope"),o(),O(4,ne,4,4,"label",10,I().trackByScope,!0),o(),i(6,"div",11)(7,"label",12),l(8,"Type "),i(9,"span",13),l(10,"*"),o()(),i(11,"select",14)(12,"option",15),l(13,"Select type"),o(),O(14,oe,2,2,"option",16,I().trackByType,!0),o()(),i(16,"div",11)(17,"label",17),l(18,"Name "),i(19,"span",13),l(20,"*"),o()(),C(21,"input",18),o(),i(22,"div",11)(23,"label",19),l(24,"Description"),o(),C(25,"textarea",20),o(),M(26,ie,2,2,"div",21),i(27,"div",22)(28,"button",23),l(29),o(),i(30,"button",24),g("click",function(){_(t);let c=p();return h(c.cancel())}),l(31,"Cancel"),o()()()}if(r&2){let t,n=p();s("formGroup",n.form),a(),s("disabled",n.isEditMode()),a(3),k(n.scopeOptions),a(7),s("formControl",n.typeControl),a(3),k(n.integrationTypes()),a(7),s("formControl",n.nameControl),a(4),s("formControl",n.descriptionControl),a(),P((t=n.schema())?26:-1,t),a(2),s("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),a(),N(" ",n.isEditMode()?"Save changes":"Create"," ")}}var ae=new Set(["platform","namespace","userOnNs","userGlobal"]),S=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ee=class r{route=m(R);router=m(L);destroyRef=m(F);state=m(Y);integrationTypeController=m(B);namespaceRole=m(Z);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=y(this.isPlatformMode?E(!0):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new q({name:new u("",{nonNullable:!0,validators:[x.required,x.minLength(1)]}),description:new u(null),type:new u("",{nonNullable:!0,validators:[x.required]}),scope:new u("namespace",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}isEditMode=d(!1);isSubmitting=d(!1);isLoading=d(!1);scopeOptions=[{value:"platform",label:S.platform},{value:"namespace",label:S.namespace},{value:"userOnNs",label:S.userOnNs},{value:"userGlobal",label:S.userGlobal}];paramsValue=d(null);initialParams=d(null);integrationTypes=y(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=y(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});schema=D(()=>{let e=this.selectedType();return e?this.integrationTypes().find(n=>n.type===e)?.configSchema??null:null});existingConfig=null;constructor(){V(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs")})}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let e=this.route.snapshot.paramMap,t=this.route.snapshot.queryParamMap,n=e.get("integrationId");if(n){this.isEditMode.set(!0),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let c=this.parseScope(t.get("scope"));this.scopeControl.setValue(c);let f=t.get("template");f&&this.hydrateFromTemplate(f)}parseScope(e){return e&&ae.has(e)?e:"namespace"}deriveScopeFromConfig(e){return!e.userId&&!e.namespaceId?"platform":e.userId?e.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(e){this.isLoading.set(!0),this.state.getById(e).pipe(v(this.destroyRef)).subscribe({next:t=>{this.existingConfig=t,this.scopeControl.setValue(this.deriveScopeFromConfig(t)),this.applyConfigToForm(t),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),console.warn(`[IntegrationForm] Could not load config '${e}' \u2014 navigating back`),this.navigateBack()}})}hydrateFromTemplate(e){this.isLoading.set(!0),this.state.getById(e).pipe(v(this.destroyRef)).subscribe({next:t=>{this.applyConfigToForm(t),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})},error:t=>{console.warn(`[IntegrationForm] Could not hydrate from template ${e}:`,t),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})}})}applyConfigToForm(e){this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.typeControl.setValue(e.integrationType),this.initialParams.set(e.parameters),this.paramsValue.set(e.parameters)}onParamsChange(e){this.paramsValue.set(e)}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(!0);let e=this.descriptionControl.value?.trim(),t={name:this.nameControl.value.trim(),description:e||null,integrationType:this.typeControl.value,parameters:this.paramsValue()},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,t,n,this.existingConfig):this.state.create(t,n,this.namespaceId??null)).pipe(v(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"])}trackByType(e,t){return t.type}trackByScope(e,t){return t.value}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=w({type:r,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[3,"valueChange","schema","value"]],template:function(t,n){t&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),g("click",function(){return n.cancel()}),i(3,"span",3),l(4,"\u2190"),o(),l(5," Integrations "),o(),i(6,"h1",4),l(7),o()(),M(8,te,2,0,"p",5)(9,re,32,8,"form",6),o()),t&2&&(a(7),b(n.isEditMode()?"Edit integration":"New integration"),a(),P(n.isLoading()?8:9))},dependencies:[W,j,K,Q,z,H,$,A,G,J,U,X],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-border-light, rgba(0, 0, 0, .06));border-radius:10px;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text, #1d1d1f);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:10px;border:1px solid var(--color-border-light, rgba(0, 0, 0, .06));background:var(--glass-bg, rgba(255, 255, 255, .5));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px))}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{ee as IntegrationFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as S}from"./chunk-
|
|
1
|
+
import{a as S}from"./chunk-Y6K6VJYJ.js";import{c as E,d as B}from"./chunk-G2BRVRGR.js";import{c as $}from"./chunk-7MQRVE7E.js";import{t as D}from"./chunk-BGEXT3EN.js";import"./chunk-PKBNMAQJ.js";import"./chunk-OBV4LQBZ.js";import{a as f}from"./chunk-IRZNRZ5Q.js";import"./chunk-FAM7HWYV.js";import"./chunk-WLSXA23B.js";import"./chunk-E3XC4CVU.js";import{Bb as P,Db as l,Fb as d,Ic as q,Pb as I,S as v,Tb as R,Wa as C,ab as A,bc as w,ca as n,ec as x,fc as T,ga as m,ha as p,i as u,ic as k,lb as b,ma as g,mb as h,rb as c,sb as a,t as M,tb as _,u as y}from"./chunk-5J7BTB5J.js";var N=()=>[];function V(r,t){if(r&1){let o=P();a(0,"agentos-ai-model-item",4),l("editRequested",function(e){m(o);let s=d(2);return p(s.onEdit(e))})("deleteRequested",function(e){m(o);let s=d(2);return p(s.deleteModel(e))}),_()}r&2&&c("model",t)}function F(r,t){if(r&1&&b(0,V,1,1,"agentos-ai-model-item",3),r&2){let o,i=t.$implicit,e=d();h((o=e.resolveModel(i.id))?0:-1,o)}}var L=class r{router=n($);destroyRef=n(g);aiModelController=n(E);aiProviderController=n(B);refresh$=new u(void 0);data$=this.refresh$.pipe(v(()=>y([this.aiModelController.listPlatformLevelAiModel(),this.aiProviderController.listAiProvider("none")])));modelItems$=this.data$.pipe(M(([t,o])=>{let i=new Map(o.map(e=>[e.id??"",e.name]));return t.map(e=>({id:e.id??"",name:e.alias??e.apiModelName,description:e.apiModelName,groupKey:e.aiProviderId,groupLabel:i.get(e.aiProviderId)??e.aiProviderId}))}));modelsById=new Map;constructor(){this.data$.pipe(f(this.destroyRef)).subscribe(([t])=>{this.modelsById=new Map(t.map(o=>[o.id??"",o]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","ai-models","new"])}deleteModel(t){this.aiModelController.deleteAiModel(t.id??"").pipe(f(this.destroyRef)).subscribe(()=>this.refresh$.next())}onEdit(t){t.id&&this.router.navigate(["/agentos","admin","ai-models",t.id,"edit"])}resolveModel(t){return this.modelsById.get(t)??null}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=C({type:r,selectors:[["agentos-platform-ai-models"]],decls:6,vars:6,consts:[["aiModelItemTpl",""],["title","Platform AI Models","emptyMessage","No platform AI models defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","type","button",1,"platform-ai-models__back",3,"click"],[3,"model"],[3,"editRequested","deleteRequested","model"]],template:function(o,i){if(o&1&&(a(0,"ds-entity-list",1),x(1,"async"),l("createRequested",function(){return i.openCreateForm()}),a(2,"button",2),l("click",function(){return i.goBack()}),R(3,"\u2190 Admin"),_()(),A(4,F,1,1,"ng-template",null,0,k)),o&2){let e=I(5);c("items",T(1,3,i.modelItems$)??w(5,N))("showCreate",!0)("itemTemplate",e)}},dependencies:[D,S,q],styles:[".platform-ai-models__back[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);padding:.25rem .5rem;border-radius:4px;transition:color .15s ease}.platform-ai-models__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"],changeDetection:0})};export{L as PlatformAiModelsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as L}from"./chunk-LM2BKZRF.js";import{b as z}from"./chunk-BD6N2UN6.js";import"./chunk-4F2LQOD7.js";import{a as T,c as A,d as D}from"./chunk-7MQRVE7E.js";import{a as N}from"./chunk-IRZNRZ5Q.js";import{Bb as b,Db as f,Fb as l,Ga as M,Ka as r,Rb as u,Tb as a,Ub as p,Vb as h,Wa as I,ca as _,ec as O,fc as w,ga as C,ha as x,jb as v,lb as d,ma as P,mb as s,pb as S,qb as E,rb as y,sb as i,ta as m,tb as t,ub as k}from"./chunk-5J7BTB5J.js";var F=(n,o)=>o.name;function B(n,o){n&1&&(i(0,"p",6),a(1,"Loading\u2026"),t())}function $(n,o){n&1&&(i(0,"p",7),a(1,"Failed to load agent definition."),t())}function j(n,o){if(n&1&&(i(0,"dt",12),a(1,"User context"),t(),i(2,"dd",14),a(3),t()),n&2){let e=l();r(3),p(e.userId)}}function H(n,o){if(n&1&&(i(0,"pre",21),a(1),t()),n&2){let e=l(2);r(),p(e.systemPrompt)}}function J(n,o){if(n&1){let e=b();i(0,"section",9)(1,"button",19),f("click",function(){C(e);let g=l(2);return x(g.toggleSystemPrompt())}),i(2,"h2",10),a(3,"System Prompt"),t(),i(4,"span",20),a(5," \u25BC "),t()(),d(6,H,2,1,"pre",21),t()}if(n&2){let e=l(2);r(),v("aria-expanded",!e.systemPromptCollapsed()),r(3),u("agent-config-inspect__chevron--open",!e.systemPromptCollapsed()),r(2),s(e.systemPromptCollapsed()?-1:6)}}function U(n,o){if(n&1&&(i(0,"pre",21),a(1),t()),n&2){let e=l(2);r(),p(e.instructions)}}function G(n,o){if(n&1){let e=b();i(0,"section",9)(1,"button",19),f("click",function(){C(e);let g=l(2);return x(g.toggleInstructions())}),i(2,"h2",10),a(3,"Instructions"),t(),i(4,"span",20),a(5," \u25BC "),t()(),d(6,U,2,1,"pre",21),t()}if(n&2){let e=l(2);r(),v("aria-expanded",!e.instructionsCollapsed()),r(3),u("agent-config-inspect__chevron--open",!e.instructionsCollapsed()),r(2),s(e.instructionsCollapsed()?-1:6)}}function q(n,o){n&1&&(i(0,"p",17),a(1,"No tools available for this agent."),t())}function K(n,o){if(n&1&&(k(0,"div",26),O(1,"agentosMarkdown")),n&2){let e=l(2).$implicit;y("innerHTML",w(1,1,e.description),M)}}function Q(n,o){if(n&1&&(i(0,"div",25),d(1,K,2,3,"div",26),i(2,"pre",27),a(3),t()()),n&2){let e=l().$implicit,c=l(3);r(),s(e.description?1:-1),r(2),p(c.formatSchema(e.inputSchema))}}function W(n,o){if(n&1){let e=b();i(0,"li",22)(1,"button",23),f("click",function(){let g=C(e).$implicit,V=l(3);return x(V.toggleTool(g))}),i(2,"span",24),a(3),t(),i(4,"span",20),a(5," \u25BC "),t()(),d(6,Q,4,2,"div",25),t()}if(n&2){let e=o.$implicit,c=l(3);r(),v("aria-expanded",c.isToolExpanded(e)),r(2),p(e.name),r(),u("agent-config-inspect__chevron--open",c.isToolExpanded(e)),r(2),s(c.isToolExpanded(e)?6:-1)}}function X(n,o){if(n&1&&(i(0,"ul",18),S(1,W,7,5,"li",22,F),t()),n&2){let e=l();r(),E(e.tools)}}function Y(n,o){if(n&1&&(i(0,"div",8)(1,"section",9)(2,"h2",10),a(3,"General"),t(),i(4,"dl",11)(5,"dt",12),a(6,"Name"),t(),i(7,"dd",13),a(8),t(),i(9,"dt",12),a(10,"Resolved model"),t(),i(11,"dd",14),a(12),t(),i(13,"dt",12),a(14,"Provider"),t(),i(15,"dd",13),a(16),t(),i(17,"dt",12),a(18,"Advanced execution"),t(),i(19,"dd",13)(20,"span",15),a(21),t()(),d(22,j,4,1),t()(),d(23,J,7,4,"section",9),d(24,G,7,4,"section",9),i(25,"section",9)(26,"h2",10),a(27," Tools "),i(28,"span",16),a(29),t()(),d(30,q,2,0,"p",17)(31,X,3,0,"ul",18),t()()),n&2){let e=o;r(8),p(e.name),r(4),p(e.resolvedModelApiName),r(4),p(e.resolvedProviderName),r(4),u("agent-config-inspect__badge--active",e.advancedExecution),r(),h(" ",e.advancedExecution?"Enabled":"Disabled"," "),r(),s(e.userId?22:-1),r(),s(e.systemPrompt?23:-1),r(),s(e.instructions?24:-1),r(5),h("(",e.tools.length,")"),r(),s(e.tools.length===0?30:31)}}var R=class n{route=_(T);router=_(A);destroyRef=_(P);agentConfigController=_(z);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=m(!0);hasError=m(!1);definition=m(null);expandedTools=m(new Set);systemPromptCollapsed=m(!0);instructionsCollapsed=m(!0);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(N(this.destroyRef)).subscribe({next:o=>{this.definition.set(o),this.isLoading.set(!1)},error:()=>{this.hasError.set(!0),this.isLoading.set(!1)}})}toggleTool(o){this.expandedTools.update(e=>{let c=new Set(e);return c.has(o.name)?c.delete(o.name):c.add(o.name),c})}isToolExpanded(o){return this.expandedTools().has(o.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(o=>!o)}toggleInstructions(){this.instructionsCollapsed.update(o=>!o)}formatSchema(o){try{return JSON.stringify(JSON.parse(o),null,2)}catch(e){return o}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"])}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=I({type:n,selectors:[["agentos-agent-config-inspect"]],decls:13,vars:2,consts:[[1,"agent-config-inspect"],[1,"agent-config-inspect__header"],["type","button","title","Back to agent configs",1,"agent-config-inspect__back",3,"click"],[1,"agent-config-inspect__back-icon"],[1,"agent-config-inspect__title"],[1,"agent-config-inspect__sibling-link",3,"routerLink"],[1,"agent-config-inspect__loading"],[1,"agent-config-inspect__error"],[1,"agent-config-inspect__content"],[1,"agent-config-inspect__section"],[1,"agent-config-inspect__section-title"],[1,"agent-config-inspect__dl"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__dd","agent-config-inspect__dd--mono"],[1,"agent-config-inspect__badge"],[1,"agent-config-inspect__count"],[1,"agent-config-inspect__empty"],[1,"agent-config-inspect__tools"],["type","button",1,"agent-config-inspect__collapsible",3,"click"],[1,"agent-config-inspect__chevron"],[1,"agent-config-inspect__instructions"],[1,"agent-config-inspect__tool"],["type","button",1,"agent-config-inspect__tool-header",3,"click"],[1,"agent-config-inspect__tool-name"],[1,"agent-config-inspect__tool-body"],[1,"agent-config-inspect__tool-description",3,"innerHTML"],[1,"agent-config-inspect__schema"]],template:function(e,c){if(e&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),f("click",function(){return c.back()}),i(3,"span",3),a(4,"\u2190"),t(),a(5," Agent Configs "),t(),i(6,"h1",4),a(7,"Agent definition"),t(),i(8,"a",5),a(9,"Edit config \u2192"),t()(),d(10,B,2,0,"p",6)(11,$,2,0,"p",7)(12,Y,32,11,"div",8),t()),e&2){let g;r(8),y("routerLink",c.editRoute()),r(2),s(c.isLoading()?10:c.hasError()?11:(g=c.definition())?12:-1,g)}},dependencies:[D,L],styles:[".agent-config-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.agent-config-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__loading[_ngcontent-%COMP%], .agent-config-inspect__error[_ngcontent-%COMP%], .agent-config-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-config-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.agent-config-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.agent-config-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.agent-config-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.agent-config-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.agent-config-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.agent-config-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.agent-config-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.agent-config-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__badge--active[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.agent-config-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.agent-config-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.agent-config-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.agent-config-inspect__instructions[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:inherit;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:400px;overflow-y:auto}.agent-config-inspect__tools[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__tool[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.agent-config-inspect__tool-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;padding:.75rem 1rem;background:none;border:none;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s ease}.agent-config-inspect__tool-header[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.agent-config-inspect__tool-name[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-inspect__tool-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:0 1rem .75rem;border-top:1px solid var(--color-border, rgba(0, 0, 0, .08))}.agent-config-inspect__tool-description[_ngcontent-%COMP%]{margin:0;padding-top:.75rem;font-size:.8125rem;line-height:1.5;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .25rem}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.agent-config-inspect__tool-description[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:monospace;font-size:.8em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:3px}.agent-config-inspect__schema[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.8125rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre;overflow-x:auto;line-height:1.5;max-height:360px;overflow-y:auto}"],changeDetection:0})};export{R as AgentConfigInspectComponent};
|
|
1
|
+
import{a as L}from"./chunk-LM2BKZRF.js";import{b as z}from"./chunk-G2BRVRGR.js";import"./chunk-4F2LQOD7.js";import{a as T,c as A,d as D}from"./chunk-7MQRVE7E.js";import{a as N}from"./chunk-IRZNRZ5Q.js";import{Bb as b,Db as f,Fb as l,Ga as M,Ka as r,Rb as u,Tb as a,Ub as p,Vb as h,Wa as I,ca as _,ec as O,fc as w,ga as C,ha as x,jb as v,lb as d,ma as P,mb as s,pb as S,qb as E,rb as y,sb as i,ta as m,tb as t,ub as k}from"./chunk-5J7BTB5J.js";var F=(n,o)=>o.name;function B(n,o){n&1&&(i(0,"p",6),a(1,"Loading\u2026"),t())}function $(n,o){n&1&&(i(0,"p",7),a(1,"Failed to load agent definition."),t())}function j(n,o){if(n&1&&(i(0,"dt",12),a(1,"User context"),t(),i(2,"dd",14),a(3),t()),n&2){let e=l();r(3),p(e.userId)}}function H(n,o){if(n&1&&(i(0,"pre",21),a(1),t()),n&2){let e=l(2);r(),p(e.systemPrompt)}}function J(n,o){if(n&1){let e=b();i(0,"section",9)(1,"button",19),f("click",function(){C(e);let g=l(2);return x(g.toggleSystemPrompt())}),i(2,"h2",10),a(3,"System Prompt"),t(),i(4,"span",20),a(5," \u25BC "),t()(),d(6,H,2,1,"pre",21),t()}if(n&2){let e=l(2);r(),v("aria-expanded",!e.systemPromptCollapsed()),r(3),u("agent-config-inspect__chevron--open",!e.systemPromptCollapsed()),r(2),s(e.systemPromptCollapsed()?-1:6)}}function U(n,o){if(n&1&&(i(0,"pre",21),a(1),t()),n&2){let e=l(2);r(),p(e.instructions)}}function G(n,o){if(n&1){let e=b();i(0,"section",9)(1,"button",19),f("click",function(){C(e);let g=l(2);return x(g.toggleInstructions())}),i(2,"h2",10),a(3,"Instructions"),t(),i(4,"span",20),a(5," \u25BC "),t()(),d(6,U,2,1,"pre",21),t()}if(n&2){let e=l(2);r(),v("aria-expanded",!e.instructionsCollapsed()),r(3),u("agent-config-inspect__chevron--open",!e.instructionsCollapsed()),r(2),s(e.instructionsCollapsed()?-1:6)}}function q(n,o){n&1&&(i(0,"p",17),a(1,"No tools available for this agent."),t())}function K(n,o){if(n&1&&(k(0,"div",26),O(1,"agentosMarkdown")),n&2){let e=l(2).$implicit;y("innerHTML",w(1,1,e.description),M)}}function Q(n,o){if(n&1&&(i(0,"div",25),d(1,K,2,3,"div",26),i(2,"pre",27),a(3),t()()),n&2){let e=l().$implicit,c=l(3);r(),s(e.description?1:-1),r(2),p(c.formatSchema(e.inputSchema))}}function W(n,o){if(n&1){let e=b();i(0,"li",22)(1,"button",23),f("click",function(){let g=C(e).$implicit,V=l(3);return x(V.toggleTool(g))}),i(2,"span",24),a(3),t(),i(4,"span",20),a(5," \u25BC "),t()(),d(6,Q,4,2,"div",25),t()}if(n&2){let e=o.$implicit,c=l(3);r(),v("aria-expanded",c.isToolExpanded(e)),r(2),p(e.name),r(),u("agent-config-inspect__chevron--open",c.isToolExpanded(e)),r(2),s(c.isToolExpanded(e)?6:-1)}}function X(n,o){if(n&1&&(i(0,"ul",18),S(1,W,7,5,"li",22,F),t()),n&2){let e=l();r(),E(e.tools)}}function Y(n,o){if(n&1&&(i(0,"div",8)(1,"section",9)(2,"h2",10),a(3,"General"),t(),i(4,"dl",11)(5,"dt",12),a(6,"Name"),t(),i(7,"dd",13),a(8),t(),i(9,"dt",12),a(10,"Resolved model"),t(),i(11,"dd",14),a(12),t(),i(13,"dt",12),a(14,"Provider"),t(),i(15,"dd",13),a(16),t(),i(17,"dt",12),a(18,"Advanced execution"),t(),i(19,"dd",13)(20,"span",15),a(21),t()(),d(22,j,4,1),t()(),d(23,J,7,4,"section",9),d(24,G,7,4,"section",9),i(25,"section",9)(26,"h2",10),a(27," Tools "),i(28,"span",16),a(29),t()(),d(30,q,2,0,"p",17)(31,X,3,0,"ul",18),t()()),n&2){let e=o;r(8),p(e.name),r(4),p(e.resolvedModelApiName),r(4),p(e.resolvedProviderName),r(4),u("agent-config-inspect__badge--active",e.advancedExecution),r(),h(" ",e.advancedExecution?"Enabled":"Disabled"," "),r(),s(e.userId?22:-1),r(),s(e.systemPrompt?23:-1),r(),s(e.instructions?24:-1),r(5),h("(",e.tools.length,")"),r(),s(e.tools.length===0?30:31)}}var R=class n{route=_(T);router=_(A);destroyRef=_(P);agentConfigController=_(z);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=m(!0);hasError=m(!1);definition=m(null);expandedTools=m(new Set);systemPromptCollapsed=m(!0);instructionsCollapsed=m(!0);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(N(this.destroyRef)).subscribe({next:o=>{this.definition.set(o),this.isLoading.set(!1)},error:()=>{this.hasError.set(!0),this.isLoading.set(!1)}})}toggleTool(o){this.expandedTools.update(e=>{let c=new Set(e);return c.has(o.name)?c.delete(o.name):c.add(o.name),c})}isToolExpanded(o){return this.expandedTools().has(o.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(o=>!o)}toggleInstructions(){this.instructionsCollapsed.update(o=>!o)}formatSchema(o){try{return JSON.stringify(JSON.parse(o),null,2)}catch(e){return o}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"])}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=I({type:n,selectors:[["agentos-agent-config-inspect"]],decls:13,vars:2,consts:[[1,"agent-config-inspect"],[1,"agent-config-inspect__header"],["type","button","title","Back to agent configs",1,"agent-config-inspect__back",3,"click"],[1,"agent-config-inspect__back-icon"],[1,"agent-config-inspect__title"],[1,"agent-config-inspect__sibling-link",3,"routerLink"],[1,"agent-config-inspect__loading"],[1,"agent-config-inspect__error"],[1,"agent-config-inspect__content"],[1,"agent-config-inspect__section"],[1,"agent-config-inspect__section-title"],[1,"agent-config-inspect__dl"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__dd","agent-config-inspect__dd--mono"],[1,"agent-config-inspect__badge"],[1,"agent-config-inspect__count"],[1,"agent-config-inspect__empty"],[1,"agent-config-inspect__tools"],["type","button",1,"agent-config-inspect__collapsible",3,"click"],[1,"agent-config-inspect__chevron"],[1,"agent-config-inspect__instructions"],[1,"agent-config-inspect__tool"],["type","button",1,"agent-config-inspect__tool-header",3,"click"],[1,"agent-config-inspect__tool-name"],[1,"agent-config-inspect__tool-body"],[1,"agent-config-inspect__tool-description",3,"innerHTML"],[1,"agent-config-inspect__schema"]],template:function(e,c){if(e&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),f("click",function(){return c.back()}),i(3,"span",3),a(4,"\u2190"),t(),a(5," Agent Configs "),t(),i(6,"h1",4),a(7,"Agent definition"),t(),i(8,"a",5),a(9,"Edit config \u2192"),t()(),d(10,B,2,0,"p",6)(11,$,2,0,"p",7)(12,Y,32,11,"div",8),t()),e&2){let g;r(8),y("routerLink",c.editRoute()),r(2),s(c.isLoading()?10:c.hasError()?11:(g=c.definition())?12:-1,g)}},dependencies:[D,L],styles:[".agent-config-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.agent-config-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__loading[_ngcontent-%COMP%], .agent-config-inspect__error[_ngcontent-%COMP%], .agent-config-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-config-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.agent-config-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.agent-config-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.agent-config-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.agent-config-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.agent-config-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.agent-config-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.agent-config-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.agent-config-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__badge--active[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.agent-config-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.agent-config-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.agent-config-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.agent-config-inspect__instructions[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:inherit;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:400px;overflow-y:auto}.agent-config-inspect__tools[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__tool[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.agent-config-inspect__tool-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;padding:.75rem 1rem;background:none;border:none;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s ease}.agent-config-inspect__tool-header[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.agent-config-inspect__tool-name[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-inspect__tool-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:0 1rem .75rem;border-top:1px solid var(--color-border, rgba(0, 0, 0, .08))}.agent-config-inspect__tool-description[_ngcontent-%COMP%]{margin:0;padding-top:.75rem;font-size:.8125rem;line-height:1.5;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .25rem}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.agent-config-inspect__tool-description[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:monospace;font-size:.8em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:3px}.agent-config-inspect__schema[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.8125rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre;overflow-x:auto;line-height:1.5;max-height:360px;overflow-y:auto}"],changeDetection:0})};export{R as AgentConfigInspectComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as K}from"./chunk-YMLYNSOP.js";import"./chunk-BD6N2UN6.js";import{a as T,c as G}from"./chunk-7MQRVE7E.js";import{a as w}from"./chunk-IRZNRZ5Q.js";import{F as J,c as z,e as c,g as $,h as R,i as F,l as v,n as L,r as N,s as B,t as q,u as U,v as j,w as H}from"./chunk-WLSXA23B.js";import{Bb as y,Db as s,Fb as d,Ka as a,Rb as P,Tb as r,Ub as b,Vb as k,Wa as D,a as A,b as V,ca as h,ga as f,ha as _,lb as u,ma as I,mb as g,nb as S,pb as E,qb as O,rb as p,sb as n,ta as C,tb as o,ub as x}from"./chunk-5J7BTB5J.js";function W(m,t){m&1&&(n(0,"p",5),r(1,"Loading\u2026"),o())}function X(m,t){m&1&&(n(0,"span",12),r(1,"Name is required."),o())}function Y(m,t){m&1&&(n(0,"p",19),r(1,"No parameters defined."),o())}function Z(m,t){m&1&&(n(0,"span",12),r(1,"Parameter name is required."),o())}function ee(m,t){if(m&1){let e=y();n(0,"div",20)(1,"div",27)(2,"div",28)(3,"label",29),r(4,"Name "),n(5,"span",10),r(6,"*"),o()(),x(7,"input",30),u(8,Z,2,0,"span",12),o(),n(9,"div",28)(10,"label",29),r(11,"Description"),o(),x(12,"input",31),o(),n(13,"div",28)(14,"label",29),r(15,"Default value"),o(),x(16,"input",32),o()(),n(17,"button",33),s("click",function(){let l=f(e).$index,M=d(2);return _(M.removeParameter(l))}),r(18," \xD7 "),o()()}if(m&2){let e=t.$implicit,i=t.$index;p("formGroupName",i),a(3),p("for","param-name-"+i),a(4),P("prompt-form__input--invalid",e.controls.name.invalid&&e.controls.name.touched),p("id","param-name-"+i),a(),g(e.controls.name.invalid&&e.controls.name.touched?8:-1),a(2),p("for","param-desc-"+i),a(2),p("id","param-desc-"+i),a(2),p("for","param-default-"+i),a(2),p("id","param-default-"+i)}}function te(m,t){m&1&&(n(0,"span",12),r(1,"Content entry must not be blank."),o())}function re(m,t){if(m&1){let e=y();n(0,"div",22)(1,"span",34),r(2),o(),n(3,"div",35),x(4,"textarea",36),u(5,te,2,0,"span",12),o(),n(6,"button",37),s("click",function(){let l=f(e).$index,M=d(2);return _(M.removeContentEntry(l))}),r(7," \xD7 "),o()()}if(m&2){let e=t.$implicit,i=t.$index,l=d(2);a(2),b(i+1),a(2),P("prompt-form__textarea--invalid",e.invalid&&e.touched),p("formControlName",i),a(),g(e.invalid&&e.touched?5:-1),a(),p("disabled",l.contentArray.length===1)}}function oe(m,t){if(m&1&&(n(0,"p",23),r(1),o()),m&2){let e=d(2);a(),b(e.errorMessage())}}function ne(m,t){if(m&1){let e=y();n(0,"form",7),s("ngSubmit",function(){f(e);let l=d();return _(l.submit())}),n(1,"div",8)(2,"label",9),r(3,"Name "),n(4,"span",10),r(5,"*"),o()(),x(6,"input",11),u(7,X,2,0,"span",12),o(),n(8,"div",8)(9,"label",13),r(10,"Description"),o(),x(11,"input",14),o(),n(12,"fieldset",15)(13,"legend",16),r(14," Parameters "),n(15,"span",17),r(16,"Named placeholders used in content"),o()(),n(17,"p",18),r(18," Each parameter must have a name and a default value. Use "),n(19,"code"),r(20),o(),r(21," in content entries to reference them. "),o(),u(22,Y,2,0,"p",19),E(23,ee,19,10,"div",20,S),n(25,"button",21),s("click",function(){f(e);let l=d();return _(l.addParameter())}),r(26,"+ Add parameter"),o()(),n(27,"fieldset",15)(28,"legend",16),r(29," Content "),n(30,"span",10),r(31,"*"),o(),n(32,"span",17),r(33,"Ordered list of text commands"),o()(),n(34,"p",18),r(35," Each content entry is a command. Use "),n(36,"code"),r(37,"@AgentName"),o(),r(38," to target an agent, "),n(39,"code"),r(40,"/promptName param1 param2"),o(),r(41," to call another prompt, and "),n(42,"code"),r(43),o(),r(44," for parameter placeholders. "),o(),E(45,re,8,6,"div",22,S),n(47,"button",21),s("click",function(){f(e);let l=d();return _(l.addContentEntry())}),r(48,"+ Add content entry"),o()(),u(49,oe,2,1,"p",23),n(50,"div",24)(51,"button",25),r(52),o(),n(53,"button",26),s("click",function(){f(e);let l=d();return _(l.cancel())}),r(54,"Cancel"),o()()()}if(m&2){let e=d();p("formGroup",e.form),a(6),P("prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),p("formControl",e.nameControl),a(),g(e.nameControl.invalid&&e.nameControl.touched?7:-1),a(4),p("formControl",e.descriptionControl),a(),p("formArrayName","parameters"),a(8),b(e.paramPlaceholderSyntax),a(2),g(e.parametersArray.length===0?22:-1),a(),O(e.parametersArray.controls),a(4),p("formArrayName","content"),a(16),b(e.paramPlaceholderSyntax),a(2),O(e.contentArray.controls),a(4),g(e.errorMessage()?49:-1),a(2),p("disabled",e.form.invalid||e.isSubmitting()),a(),k(" ",e.isEditMode()?"Save changes":"Create"," ")}}var Q=class m{route=h(T);router=h(G);destroyRef=h(I);promptState=h(K);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new F({name:new v("",{nonNullable:!0,validators:[c.required,c.minLength(1)]}),description:new v(null),content:new N([this.createContentControl()],{validators:[c.required]}),parameters:new N([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=C(!1);isSubmitting=C(!1);isLoading=C(!1);errorMessage=C(null);paramPlaceholderSyntax="{{paramName}}";existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(!0),this.loadPrompt(t))}loadPrompt(t){this.isLoading.set(!0),this.promptState.getById(t).pipe(w(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(i=>this.contentArray.push(this.createContentControl(i))),this.parametersArray.clear(),(t.parameters??[]).forEach(i=>this.parametersArray.push(this.createParameterGroup(i)))}createContentControl(t=""){return new v(t,{nonNullable:!0,validators:[c.required,c.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl())}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t)}createParameterGroup(t){return new F({name:new v(t?.name??"",{nonNullable:!0,validators:[c.required,c.minLength(1)]}),description:new v(t?.description??null),defaultValue:new v(t?.defaultValue??"",{nonNullable:!0,validators:[c.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup())}removeParameter(t){this.parametersArray.removeAt(t)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(!0);let t=V(A({},this.existingPrompt??{}),{namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(i=>i.value.trim()),parameters:this.parametersArray.controls.map(i=>({name:i.controls.name.value.trim(),description:i.controls.description.value?.trim()||void 0,defaultValue:i.controls.defaultValue.value.trim()}))}),e=this.isEditMode()&&this.existingPrompt?.id?this.promptState.update(this.existingPrompt.id,t):this.promptState.create(t);this.errorMessage.set(null),e.pipe(w(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:i=>{this.isSubmitting.set(!1),i.status===409?this.errorMessage.set(`A prompt named "${t.name}" already exists in this scope.`):i.status===400?this.errorMessage.set(i.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.")}})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"])}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=D({type:m,selectors:[["agentos-prompt-form"]],decls:10,vars:3,consts:[[1,"prompt-form"],[1,"prompt-form__header"],["type","button","title","Back to prompts",1,"prompt-form__back",3,"click"],[1,"prompt-form__back-icon"],[1,"prompt-form__title"],[1,"prompt-form__loading"],[1,"prompt-form__form",3,"formGroup"],[1,"prompt-form__form",3,"ngSubmit","formGroup"],[1,"prompt-form__field"],["for","prompt-name",1,"prompt-form__label"],["aria-hidden","true"],["id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__field-error"],["for","prompt-description",1,"prompt-form__label"],["id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__section",3,"formArrayName"],[1,"prompt-form__label"],[1,"prompt-form__label-hint"],[1,"prompt-form__section-hint"],[1,"prompt-form__empty-hint"],[1,"prompt-form__param-row",3,"formGroupName"],["type","button",1,"prompt-form__add-btn",3,"click"],[1,"prompt-form__content-row"],[1,"prompt-form__error"],[1,"prompt-form__actions"],["type","submit",1,"prompt-form__btn","prompt-form__btn--primary",3,"disabled"],["type","button",1,"prompt-form__btn",3,"click"],[1,"prompt-form__param-fields"],[1,"prompt-form__field","prompt-form__field--inline"],[1,"prompt-form__label",3,"for"],["type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","Optional","formControlName","description","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",1,"prompt-form__input",3,"id"],["type","button","title","Remove this parameter",1,"prompt-form__remove-btn",3,"click"],[1,"prompt-form__content-index"],[1,"prompt-form__content-field"],["rows","4","placeholder","Enter a command\u2026",1,"prompt-form__textarea",3,"formControlName"],["type","button","title","Remove this entry",1,"prompt-form__remove-btn",3,"click","disabled"]],template:function(e,i){e&1&&(n(0,"div",0)(1,"header",1)(2,"button",2),s("click",function(){return i.cancel()}),n(3,"span",3),r(4,"\u2190"),o(),r(5),o(),n(6,"h1",4),r(7),o()(),u(8,W,2,0,"p",5)(9,ne,55,14,"form",6),o()),e&2&&(a(5),k(" ",i.isPlatformMode?"Platform prompts":"Prompts"," "),a(2),b(i.isEditMode()?"Edit prompt":"New prompt"),a(),g(i.isLoading()?8:9))},dependencies:[J,L,z,$,R,B,H,j,q,U],styles:[".prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.prompt-form__field--inline[_ngcontent-%COMP%]{flex:1}.prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.prompt-form__label-hint[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);margin-left:.375rem}.prompt-form__input[_ngcontent-%COMP%], .prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.prompt-form__input[_ngcontent-%COMP%]:focus, .prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.prompt-form__input[_ngcontent-%COMP%]::placeholder, .prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.prompt-form__section[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.prompt-form__section-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.prompt-form__empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73);font-style:italic}.prompt-form__content-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-start}.prompt-form__content-field[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.25rem}.prompt-form__content-index[_ngcontent-%COMP%]{flex-shrink:0;width:1.5rem;padding-top:.6rem;font-size:.8rem;font-weight:600;color:var(--color-text-secondary, #6e6e73);text-align:right;-webkit-user-select:none;user-select:none}.prompt-form__param-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-end;padding:.75rem;border-radius:6px;background:var(--color-surface-hover, rgba(0, 0, 0, .03))}.prompt-form__param-fields[_ngcontent-%COMP%]{flex:1;display:flex;gap:.75rem;flex-wrap:wrap}.prompt-form__add-btn[_ngcontent-%COMP%]{align-self:flex-start;padding:.4rem .875rem;border-radius:6px;border:1px dashed var(--color-border, rgba(0, 0, 0, .15));background:transparent;color:var(--color-primary, #007aff);font-size:.875rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.prompt-form__add-btn[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.prompt-form__remove-btn[_ngcontent-%COMP%]{flex-shrink:0;width:1.75rem;height:1.75rem;display:flex;align-items:center;justify-content:center;border-radius:50%;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:1rem;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease}.prompt-form__remove-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-error-light, rgba(255, 59, 48, .08));color:var(--color-error, #ff3b30);border-color:var(--color-error, #ff3b30)}.prompt-form__remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.prompt-form__error[_ngcontent-%COMP%]{margin:0;padding:.625rem .875rem;border-radius:8px;background:var(--color-error-light, rgba(255, 59, 48, .08));border:1px solid var(--color-error, #ff3b30);color:var(--color-error, #ff3b30);font-size:.875rem;line-height:1.4}.prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);line-height:1.3}.prompt-form__input--invalid[_ngcontent-%COMP%], .prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.prompt-form__input--invalid[_ngcontent-%COMP%]:focus, .prompt-form__textarea--invalid[_ngcontent-%COMP%]:focus{border-color:var(--color-error, #ff3b30)}.prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{Q as PromptFormComponent};
|
|
1
|
+
import{a as K}from"./chunk-BMUZTI7K.js";import"./chunk-G2BRVRGR.js";import{a as T,c as G}from"./chunk-7MQRVE7E.js";import{a as w}from"./chunk-IRZNRZ5Q.js";import{F as J,c as z,e as c,g as $,h as R,i as F,l as v,n as L,r as N,s as B,t as q,u as U,v as j,w as H}from"./chunk-WLSXA23B.js";import{Bb as y,Db as s,Fb as d,Ka as a,Rb as P,Tb as r,Ub as b,Vb as k,Wa as D,a as A,b as V,ca as h,ga as f,ha as _,lb as u,ma as I,mb as g,nb as S,pb as E,qb as O,rb as p,sb as n,ta as C,tb as o,ub as x}from"./chunk-5J7BTB5J.js";function W(m,t){m&1&&(n(0,"p",5),r(1,"Loading\u2026"),o())}function X(m,t){m&1&&(n(0,"span",12),r(1,"Name is required."),o())}function Y(m,t){m&1&&(n(0,"p",19),r(1,"No parameters defined."),o())}function Z(m,t){m&1&&(n(0,"span",12),r(1,"Parameter name is required."),o())}function ee(m,t){if(m&1){let e=y();n(0,"div",20)(1,"div",27)(2,"div",28)(3,"label",29),r(4,"Name "),n(5,"span",10),r(6,"*"),o()(),x(7,"input",30),u(8,Z,2,0,"span",12),o(),n(9,"div",28)(10,"label",29),r(11,"Description"),o(),x(12,"input",31),o(),n(13,"div",28)(14,"label",29),r(15,"Default value"),o(),x(16,"input",32),o()(),n(17,"button",33),s("click",function(){let l=f(e).$index,M=d(2);return _(M.removeParameter(l))}),r(18," \xD7 "),o()()}if(m&2){let e=t.$implicit,i=t.$index;p("formGroupName",i),a(3),p("for","param-name-"+i),a(4),P("prompt-form__input--invalid",e.controls.name.invalid&&e.controls.name.touched),p("id","param-name-"+i),a(),g(e.controls.name.invalid&&e.controls.name.touched?8:-1),a(2),p("for","param-desc-"+i),a(2),p("id","param-desc-"+i),a(2),p("for","param-default-"+i),a(2),p("id","param-default-"+i)}}function te(m,t){m&1&&(n(0,"span",12),r(1,"Content entry must not be blank."),o())}function re(m,t){if(m&1){let e=y();n(0,"div",22)(1,"span",34),r(2),o(),n(3,"div",35),x(4,"textarea",36),u(5,te,2,0,"span",12),o(),n(6,"button",37),s("click",function(){let l=f(e).$index,M=d(2);return _(M.removeContentEntry(l))}),r(7," \xD7 "),o()()}if(m&2){let e=t.$implicit,i=t.$index,l=d(2);a(2),b(i+1),a(2),P("prompt-form__textarea--invalid",e.invalid&&e.touched),p("formControlName",i),a(),g(e.invalid&&e.touched?5:-1),a(),p("disabled",l.contentArray.length===1)}}function oe(m,t){if(m&1&&(n(0,"p",23),r(1),o()),m&2){let e=d(2);a(),b(e.errorMessage())}}function ne(m,t){if(m&1){let e=y();n(0,"form",7),s("ngSubmit",function(){f(e);let l=d();return _(l.submit())}),n(1,"div",8)(2,"label",9),r(3,"Name "),n(4,"span",10),r(5,"*"),o()(),x(6,"input",11),u(7,X,2,0,"span",12),o(),n(8,"div",8)(9,"label",13),r(10,"Description"),o(),x(11,"input",14),o(),n(12,"fieldset",15)(13,"legend",16),r(14," Parameters "),n(15,"span",17),r(16,"Named placeholders used in content"),o()(),n(17,"p",18),r(18," Each parameter must have a name and a default value. Use "),n(19,"code"),r(20),o(),r(21," in content entries to reference them. "),o(),u(22,Y,2,0,"p",19),E(23,ee,19,10,"div",20,S),n(25,"button",21),s("click",function(){f(e);let l=d();return _(l.addParameter())}),r(26,"+ Add parameter"),o()(),n(27,"fieldset",15)(28,"legend",16),r(29," Content "),n(30,"span",10),r(31,"*"),o(),n(32,"span",17),r(33,"Ordered list of text commands"),o()(),n(34,"p",18),r(35," Each content entry is a command. Use "),n(36,"code"),r(37,"@AgentName"),o(),r(38," to target an agent, "),n(39,"code"),r(40,"/promptName param1 param2"),o(),r(41," to call another prompt, and "),n(42,"code"),r(43),o(),r(44," for parameter placeholders. "),o(),E(45,re,8,6,"div",22,S),n(47,"button",21),s("click",function(){f(e);let l=d();return _(l.addContentEntry())}),r(48,"+ Add content entry"),o()(),u(49,oe,2,1,"p",23),n(50,"div",24)(51,"button",25),r(52),o(),n(53,"button",26),s("click",function(){f(e);let l=d();return _(l.cancel())}),r(54,"Cancel"),o()()()}if(m&2){let e=d();p("formGroup",e.form),a(6),P("prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),p("formControl",e.nameControl),a(),g(e.nameControl.invalid&&e.nameControl.touched?7:-1),a(4),p("formControl",e.descriptionControl),a(),p("formArrayName","parameters"),a(8),b(e.paramPlaceholderSyntax),a(2),g(e.parametersArray.length===0?22:-1),a(),O(e.parametersArray.controls),a(4),p("formArrayName","content"),a(16),b(e.paramPlaceholderSyntax),a(2),O(e.contentArray.controls),a(4),g(e.errorMessage()?49:-1),a(2),p("disabled",e.form.invalid||e.isSubmitting()),a(),k(" ",e.isEditMode()?"Save changes":"Create"," ")}}var Q=class m{route=h(T);router=h(G);destroyRef=h(I);promptState=h(K);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new F({name:new v("",{nonNullable:!0,validators:[c.required,c.minLength(1)]}),description:new v(null),content:new N([this.createContentControl()],{validators:[c.required]}),parameters:new N([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=C(!1);isSubmitting=C(!1);isLoading=C(!1);errorMessage=C(null);paramPlaceholderSyntax="{{paramName}}";existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(!0),this.loadPrompt(t))}loadPrompt(t){this.isLoading.set(!0),this.promptState.getById(t).pipe(w(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(i=>this.contentArray.push(this.createContentControl(i))),this.parametersArray.clear(),(t.parameters??[]).forEach(i=>this.parametersArray.push(this.createParameterGroup(i)))}createContentControl(t=""){return new v(t,{nonNullable:!0,validators:[c.required,c.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl())}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t)}createParameterGroup(t){return new F({name:new v(t?.name??"",{nonNullable:!0,validators:[c.required,c.minLength(1)]}),description:new v(t?.description??null),defaultValue:new v(t?.defaultValue??"",{nonNullable:!0,validators:[c.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup())}removeParameter(t){this.parametersArray.removeAt(t)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(!0);let t=V(A({},this.existingPrompt??{}),{namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(i=>i.value.trim()),parameters:this.parametersArray.controls.map(i=>({name:i.controls.name.value.trim(),description:i.controls.description.value?.trim()||void 0,defaultValue:i.controls.defaultValue.value.trim()}))}),e=this.isEditMode()&&this.existingPrompt?.id?this.promptState.update(this.existingPrompt.id,t):this.promptState.create(t);this.errorMessage.set(null),e.pipe(w(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:i=>{this.isSubmitting.set(!1),i.status===409?this.errorMessage.set(`A prompt named "${t.name}" already exists in this scope.`):i.status===400?this.errorMessage.set(i.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.")}})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"])}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=D({type:m,selectors:[["agentos-prompt-form"]],decls:10,vars:3,consts:[[1,"prompt-form"],[1,"prompt-form__header"],["type","button","title","Back to prompts",1,"prompt-form__back",3,"click"],[1,"prompt-form__back-icon"],[1,"prompt-form__title"],[1,"prompt-form__loading"],[1,"prompt-form__form",3,"formGroup"],[1,"prompt-form__form",3,"ngSubmit","formGroup"],[1,"prompt-form__field"],["for","prompt-name",1,"prompt-form__label"],["aria-hidden","true"],["id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__field-error"],["for","prompt-description",1,"prompt-form__label"],["id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__section",3,"formArrayName"],[1,"prompt-form__label"],[1,"prompt-form__label-hint"],[1,"prompt-form__section-hint"],[1,"prompt-form__empty-hint"],[1,"prompt-form__param-row",3,"formGroupName"],["type","button",1,"prompt-form__add-btn",3,"click"],[1,"prompt-form__content-row"],[1,"prompt-form__error"],[1,"prompt-form__actions"],["type","submit",1,"prompt-form__btn","prompt-form__btn--primary",3,"disabled"],["type","button",1,"prompt-form__btn",3,"click"],[1,"prompt-form__param-fields"],[1,"prompt-form__field","prompt-form__field--inline"],[1,"prompt-form__label",3,"for"],["type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","Optional","formControlName","description","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",1,"prompt-form__input",3,"id"],["type","button","title","Remove this parameter",1,"prompt-form__remove-btn",3,"click"],[1,"prompt-form__content-index"],[1,"prompt-form__content-field"],["rows","4","placeholder","Enter a command\u2026",1,"prompt-form__textarea",3,"formControlName"],["type","button","title","Remove this entry",1,"prompt-form__remove-btn",3,"click","disabled"]],template:function(e,i){e&1&&(n(0,"div",0)(1,"header",1)(2,"button",2),s("click",function(){return i.cancel()}),n(3,"span",3),r(4,"\u2190"),o(),r(5),o(),n(6,"h1",4),r(7),o()(),u(8,W,2,0,"p",5)(9,ne,55,14,"form",6),o()),e&2&&(a(5),k(" ",i.isPlatformMode?"Platform prompts":"Prompts"," "),a(2),b(i.isEditMode()?"Edit prompt":"New prompt"),a(),g(i.isLoading()?8:9))},dependencies:[J,L,z,$,R,B,H,j,q,U],styles:[".prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.prompt-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.prompt-form__field--inline[_ngcontent-%COMP%]{flex:1}.prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.prompt-form__label-hint[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);margin-left:.375rem}.prompt-form__input[_ngcontent-%COMP%], .prompt-form__textarea[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.prompt-form__input[_ngcontent-%COMP%]:focus, .prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.prompt-form__input[_ngcontent-%COMP%]::placeholder, .prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.prompt-form__section[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.prompt-form__section-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.prompt-form__empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73);font-style:italic}.prompt-form__content-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-start}.prompt-form__content-field[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.25rem}.prompt-form__content-index[_ngcontent-%COMP%]{flex-shrink:0;width:1.5rem;padding-top:.6rem;font-size:.8rem;font-weight:600;color:var(--color-text-secondary, #6e6e73);text-align:right;-webkit-user-select:none;user-select:none}.prompt-form__param-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-end;padding:.75rem;border-radius:6px;background:var(--color-surface-hover, rgba(0, 0, 0, .03))}.prompt-form__param-fields[_ngcontent-%COMP%]{flex:1;display:flex;gap:.75rem;flex-wrap:wrap}.prompt-form__add-btn[_ngcontent-%COMP%]{align-self:flex-start;padding:.4rem .875rem;border-radius:6px;border:1px dashed var(--color-border, rgba(0, 0, 0, .15));background:transparent;color:var(--color-primary, #007aff);font-size:.875rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.prompt-form__add-btn[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.prompt-form__remove-btn[_ngcontent-%COMP%]{flex-shrink:0;width:1.75rem;height:1.75rem;display:flex;align-items:center;justify-content:center;border-radius:50%;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:1rem;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease}.prompt-form__remove-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-error-light, rgba(255, 59, 48, .08));color:var(--color-error, #ff3b30);border-color:var(--color-error, #ff3b30)}.prompt-form__remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.prompt-form__error[_ngcontent-%COMP%]{margin:0;padding:.625rem .875rem;border-radius:8px;background:var(--color-error-light, rgba(255, 59, 48, .08));border:1px solid var(--color-error, #ff3b30);color:var(--color-error, #ff3b30);font-size:.875rem;line-height:1.4}.prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);line-height:1.3}.prompt-form__input--invalid[_ngcontent-%COMP%], .prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.prompt-form__input--invalid[_ngcontent-%COMP%]:focus, .prompt-form__textarea--invalid[_ngcontent-%COMP%]:focus{border-color:var(--color-error, #ff3b30)}.prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.prompt-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{Q as PromptFormComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
1
|
+
import{a as h}from"./chunk-VIDPCJ3F.js";import{i as b}from"./chunk-G2BRVRGR.js";import{b as u}from"./chunk-IRZNRZ5Q.js";import{D as p,P as f,S as m,Z as l,ca as a,m as r,t as c}from"./chunk-5J7BTB5J.js";var v=class i{userState=a(h);permissions=a(b);currentUser$=u(this.userState.currentUser);cache=new Map;isAdminOfNamespace$(e){if(!e)return r(!1);let t=this.cache.get(e);if(t)return t;let o=this.currentUser$.pipe(m(s=>s?s.isAdmin?r(!0):this.permissions.listNamespaceUsers(e).pipe(c(d=>d.some(n=>n.id===s.id&&n.role==="ADMIN")),p(()=>r(!1))):r(!1)),f({bufferSize:1,refCount:!1}));return this.cache.set(e,o),o}static \u0275fac=function(t){return new(t||i)};static \u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})};export{v as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as a}from"./chunk-
|
|
1
|
+
import{d as a}from"./chunk-PNFA7PN2.js";import"./chunk-G2BRVRGR.js";import"./chunk-7MQRVE7E.js";import"./chunk-BGEXT3EN.js";import"./chunk-PKBNMAQJ.js";import"./chunk-OBV4LQBZ.js";import"./chunk-IRZNRZ5Q.js";import"./chunk-FAM7HWYV.js";import"./chunk-WLSXA23B.js";import"./chunk-E3XC4CVU.js";import"./chunk-5J7BTB5J.js";export{a as NamespaceListComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as k}from"./chunk-Y6K6VJYJ.js";import{c as q,d as O}from"./chunk-G2BRVRGR.js";import{a as E,c as $}from"./chunk-7MQRVE7E.js";import{o as D,t as S}from"./chunk-BGEXT3EN.js";import"./chunk-PKBNMAQJ.js";import"./chunk-OBV4LQBZ.js";import{a as M}from"./chunk-IRZNRZ5Q.js";import"./chunk-FAM7HWYV.js";import"./chunk-WLSXA23B.js";import"./chunk-E3XC4CVU.js";import{Bb as R,D as g,Db as l,Fb as s,Ic as L,Pb as N,S as A,Wa as h,ab as I,bc as w,ca as r,ec as x,fc as B,ga as p,ha as m,i as u,ic as T,lb as b,m as f,ma as C,mb as P,rb as c,sb as d,t as y,tb as _,z as v}from"./chunk-5J7BTB5J.js";var V=()=>[];function K(n,t){if(n&1){let i=R();d(0,"agentos-ai-model-item",4),l("deleteRequested",function(a){p(i);let e=s(2);return m(e.deleteModel(a))})("editRequested",function(a){p(i);let e=s(2);return m(e.editModel(a))}),_()}if(n&2){let i=s().$implicit,o=s();c("model",t)("namespaceId",o.namespaceId)("readOnly",o.isPlatformModel(i.id))}}function U(n,t){if(n&1&&b(0,K,1,3,"agentos-ai-model-item",3),n&2){let i,o=t.$implicit,a=s();P((i=a.resolveModel(o.id))?0:-1,i)}}var j="__platform__",G="Platform (read-only)",F=class n{route=r(E);router=r($);destroyRef=r(C);aiModelController=r(q);aiProviderController=r(O);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new u(void 0);data$=this.refresh$.pipe(A(()=>v({namespace:this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),platform:this.aiModelController.listPlatformLevelAiModel().pipe(g(()=>f([]))),providers:this.aiProviderController.listAiProvider(this.namespaceId)})));modelItems$=this.data$.pipe(y(({namespace:t,platform:i,providers:o})=>{let a=new Map(o.map(e=>[e.id??"",e.name]));return[...i.map(e=>({id:e.id??"",name:e.alias??e.apiModelName,description:e.apiModelName,groupKey:j,groupLabel:G})),...t.map(e=>({id:e.id??"",name:e.alias??e.apiModelName,description:e.apiModelName,groupKey:e.aiProviderId,groupLabel:a.get(e.aiProviderId)??e.aiProviderId}))]}));namespaceModelsById=new Map;platformModelsById=new Map;constructor(){this.data$.pipe(M(this.destroyRef)).subscribe(({namespace:t,platform:i})=>{this.namespaceModelsById=new Map(t.map(o=>[o.id??"",o])),this.platformModelsById=new Map(i.map(o=>[o.id??"",o]))})}goBack(){this.router.navigate(["/agentos","namespaces"])}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-models","new"])}editModel(t){this.router.navigate(["/agentos",this.namespaceId,"ai-models",t.id,"edit"])}deleteModel(t){this.aiModelController.deleteAiModel(t.id??"").pipe(M(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveModel(t){return this.namespaceModelsById.get(t)??this.platformModelsById.get(t)??null}isPlatformModel(t){return this.platformModelsById.has(t)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=h({type:n,selectors:[["agentos-namespace-ai-models"]],decls:5,vars:6,consts:[["aiModelItemTpl",""],["title","AI models","emptyMessage","No AI models configured yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"model","namespaceId","readOnly"],[3,"deleteRequested","editRequested","model","namespaceId","readOnly"]],template:function(i,o){if(i&1&&(d(0,"ds-entity-list",1),x(1,"async"),l("createRequested",function(){return o.openCreateForm()}),d(2,"ds-icon-button",2),l("action",function(){return o.goBack()}),_()(),I(3,U,1,1,"ng-template",null,0,T)),i&2){let a=N(4);c("items",B(1,3,o.modelItems$)??w(5,V))("showCreate",!0)("itemTemplate",a)}},dependencies:[S,k,D,L],encapsulation:2,changeDetection:0})};export{F as NamespaceAiModelsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a}from"./chunk-
|
|
1
|
+
import{b as a}from"./chunk-3NOI65IY.js";import"./chunk-5K5EFCNT.js";import"./chunk-G2BRVRGR.js";import"./chunk-7MQRVE7E.js";import"./chunk-BGEXT3EN.js";import"./chunk-PKBNMAQJ.js";import"./chunk-OBV4LQBZ.js";import"./chunk-IRZNRZ5Q.js";import"./chunk-FAM7HWYV.js";import"./chunk-WLSXA23B.js";import"./chunk-E3XC4CVU.js";import"./chunk-5J7BTB5J.js";export{a as UserListComponent};
|