import{a7 as y,a4 as a,aQ as i,a as p,aR as c,e as w,h as f,m as M,aS as m,aT as g,aa as v}from"./index-dNe6i2rS.js";import{u as V}from"./uniq--Ej6WwWR.js";const l=(s,e)=>{const r=s==null?[]:v([s]);return V([...r,e])},q=y.injectEndpoints({endpoints:s=>({getFeatureViews:s.query({query:({pId:e,fsId:r,params:t={}})=>{const o=g.stringify({...t,expand:l(t.expand,"mandatorytags")});return{url:`project/${e}/featurestores/${r}/featureview?${o}`}},providesTags:i.providesListItems(a.ProjectTags.FeatureView,"name"),extraOptions:{skipError:!0}}),getFeatureViewVersions:s.query({query:({pId:e,fsId:r,id:t})=>({url:`project/${e}/featurestores/${r}/featureview/${t}?${g.stringify({expand:"mandatorytags"})}`}),providesTags:i.providesListItems(a.ProjectTags.FeatureView,"name"),extraOptions:{skipError:!0}}),getFeatureView:s.query({query:({id:e,version:r,pId:t,fsId:o,params:u={}})=>{const n=g.stringify({...u,expand:l(u.expand,"mandatorytags")});return{url:`
          project/${t}/
          featurestores/${o}/
          featureview/${e}/version/${r}
          ?${n}
          `.replace(/\s/g,"")}},transformResponse:e=>w({tags:f(p([],"items"),M(m))},e),providesTags:i.cacheByIdArgProperty(a.ProjectTags.FeatureView),extraOptions:{skipError:!0}}),getFeatureViewTransformationFunctions:s.query({query:({id:e,version:r,pId:t,fsId:o})=>({url:`
          project/${t}/
          featurestores/${o}/
          featureview/${e}/version/${r}/
          transformation
          `.replace(/\s/g,"")}),providesTags:i.cacheByIdArgProperty(a.ProjectTags.FeatureViewTransformations),extraOptions:{skipError:!0}}),updateFeatureView:s.mutation({query:({id:e,version:r,pId:t,fsId:o,data:u})=>({url:`
          project/${t}/
          featurestores/${o}/
          featureview/${e}/version/${r}
          `.replace(/\s/g,""),method:"put",data:u}),invalidatesTags:i.cacheByIdArgProperty(a.ProjectTags.FeatureView)}),createFeatureView:s.mutation({query:({pId:e,fsId:r,data:t})=>({url:`project/${e}/featurestores/${r}/featureview`,method:"post",data:{...t,type:"featureViewDTO"}}),invalidatesTags:[{type:a.ProjectTags.FeatureView,id:"LIST"}]}),addFeatureViewTags:s.mutation({queryFn:({pId:e,fsId:r,tags:t,id:o,version:u},n,d,$)=>c($,t,T=>`
          project/${e}/
          featurestores/${r}/
          featureview/${o}/version/${u}/
          tags/${T}
          `.replace(/\s/g,"")),invalidatesTags:i.cacheByIdArgProperty(a.ProjectTags.FeatureView)}),deleteFeatureViewTag:s.mutation({query:({pId:e,fsId:r,id:t,version:o,tagName:u})=>({url:`
            project/${e}/
            featurestores/${r}/
            featureview/${t}/version/${o}/
            tags/${u}
            `.replace(/\s/g,""),method:"delete"}),invalidatesTags:i.cacheByIdArgProperty(a.ProjectTags.FeatureView)}),getFeatureViewKeywords:s.query({query:({id:e,version:r,pId:t,fsId:o})=>({url:`
          project/${t}/
          featurestores/${o}/
          featureview/${e}/version/${r}/
          keywords
          `.replace(/\s/g,"")}),transformResponse:p([],"keywords"),extraOptions:{skipError:!0},providesTags:i.cacheByIdArgProperty(a.ProjectTags.FeatureView)}),addFeatureViewKeywords:s.mutation({query:({pId:e,fsId:r,data:t,id:o,version:u})=>({url:`
        project/${e}/
        featurestores/${r}/
        featureview/${o}/version/${u}/
        keywords
        `.replace(/\s/g,""),method:"post",data:t}),invalidatesTags:i.cacheByIdArgProperty(a.ProjectTags.FeatureView)}),deleteFeatureView:s.mutation({query:({pId:e,fsId:r,id:t,version:o,force:u})=>({url:`
        project/${e}/
        featurestores/${r}/
        featureview/${t}/version/${o}${u?"?force=true":""}
        `.replace(/\s/g,""),method:"delete"}),extraOptions:{skipError:!0},invalidatesTags:(e,r,{id:t})=>[{type:a.ProjectTags.FeatureView,id:"LIST"},{type:a.ProjectTags.FeatureView,id:t}]})})}),{useGetFeatureViewsQuery:h,useGetFeatureViewQuery:k,useGetFeatureViewVersionsQuery:E,useGetFeatureViewTransformationFunctionsQuery:_,useGetFeatureViewKeywordsQuery:A,useUpdateFeatureViewMutation:O,useCreateFeatureViewMutation:L,useAddFeatureViewKeywordsMutation:G,useAddFeatureViewTagsMutation:Q,useDeleteFeatureViewTagMutation:S,useDeleteFeatureViewMutation:B,endpoints:I}=q,F=(s,e)=>{const r=s==null?void 0:s.expand,t=r==null?[]:[].concat(r);return{...s,expand:Array.from(new Set([...t,e]))}},j=y.injectEndpoints({endpoints:s=>({getModelsList:s.query({query:({pId:e,params:r={offset:0,limit:40}})=>({url:`project/${e}/modelregistries/${e}/models?${g.stringify(F(r,"mandatorytags"))}`}),extraOptions:{skipError:!0},providesTags:i.providesListItems(a.ProjectTags.ModelVersions)}),getModel:s.query({query:({projectId:e,modelName:r})=>({url:`project/${e}/modelregistries/${e}/models?filter_by=name_eq:${r}&expand=mandatorytags`}),providesTags:i.providesListItems(a.ProjectTags.Model)}),getModelVersion:s.query({query:({projectId:e,modelName:r,modelVersion:t})=>({url:`project/${e}/modelregistries/${e}/models/${r}_${t}?expand=modelschema&expand=inputexample&expand=mandatorytags`}),providesTags:(e,r,{modelName:t,modelVersion:o})=>[{type:a.ProjectTags.ModelVersions,id:`${t}_${o}`}]}),validateModelVersion:s.query({query:({projectId:e,modelName:r,modelVersion:t})=>({url:`project/${e}/modelregistries/${e}/models/${r}_${t}`}),extraOptions:{skipError:!0}}),getModelProvenance:s.query({query:({projectId:e,modelName:r,modelVersion:t})=>({url:`project/${e}/modelregistries/${e}/models/${r}_${t}/provenance/links?expand=provenance_artifacts&upstreamLvls=2&downstreamLvls=0`}),extraOptions:{skipError:!0}}),getModelMonitoringConfigs:s.query({query:({projectId:e,modelName:r,modelVersion:t})=>({url:`project/${e}/modelregistries/${e}/models/${r}_${t}/featuremonitoring`}),extraOptions:{skipError:!0},providesTags:(e,r,{modelName:t,modelVersion:o})=>[{type:a.ProjectTags.ModelMonitoringConfig,id:`${t}_${o}`}]}),deleteModelVersion:s.mutation({query:({projectId:e,mlId:r})=>({url:`project/${e}/modelregistries/${e}/models/${r}`,method:"delete"}),invalidatesTags:[{type:a.ProjectTags.Model,id:"LIST"},{type:a.ProjectTags.ModelVersions,id:"LIST"}]}),getModelTags:s.query({query:({projectId:e,modelId:r})=>({url:`project/${e}/modelregistries/${e}/models/${r}/tags?expand=tag_schemas`}),extraOptions:{skipError:!0},transformResponse:e=>{var r;return((r=e.items)==null?void 0:r.map(m))||[]},providesTags:i.cacheByIdArgProperty(a.ProjectTags.ModelTag,"modelId")}),addModelTags:s.mutation({queryFn:({projectId:e,modelId:r,tags:t},o,u,n)=>c(n,t,d=>`
          project/${e}/
          modelregistries/${e}/
          models/${r}/
          tags/${d}
          `.replace(/\s/g,"")),invalidatesTags:i.cacheByIdArgProperty(a.ProjectTags.ModelTag,"modelId")}),deleteModelTag:s.mutation({query:({projectId:e,modelId:r,tagName:t})=>({url:`project/${e}/modelregistries/${e}/models/${r}/tags/${t}`,method:"delete"}),invalidatesTags:i.cacheByIdArgProperty(a.ProjectTags.ModelTag,"modelId")}),updateModelVersionFramework:s.mutation({query:({projectId:e,mlId:r,framework:t})=>({url:`project/${e}/modelregistries/${e}/models/${r}`,method:"patch",data:{framework:t}}),invalidatesTags:(e,r,{mlId:t})=>[{type:a.ProjectTags.ModelVersions,id:t},{type:a.ProjectTags.ModelVersions,id:"LIST"},{type:a.ProjectTags.Model,id:"LIST"}]}),inspectHuggingFaceModel:s.mutation({query:({projectId:e,body:r})=>({url:`project/${e}/modelregistries/${e}/models/huggingface/inspect`,method:"post",data:r}),extraOptions:{skipError:!0}}),startHuggingFaceImport:s.mutation({query:({projectId:e,body:r})=>({url:`project/${e}/modelregistries/${e}/models/huggingface`,method:"post",data:r}),extraOptions:{skipError:!0}}),getHuggingFaceStatus:s.query({query:({projectId:e,jobId:r})=>({url:`project/${e}/modelregistries/${e}/models/huggingface/status/${r}`}),extraOptions:{skipError:!0}}),cancelHuggingFaceDownload:s.mutation({query:({projectId:e,jobId:r,cleanup:t})=>({url:`project/${e}/modelregistries/${e}/models/huggingface/status/${r}${t?"?cleanup=true":""}`,method:"delete"}),extraOptions:{skipError:!0},invalidatesTags:[{type:a.ProjectTags.ModelVersions,id:"LIST"},{type:a.ProjectTags.Model,id:"LIST"}]}),generateVllmConfig:s.mutation({query:({projectId:e,mlId:r,body:t})=>({url:`project/${e}/modelregistries/${e}/models/${r}/generate-vllmconfig`,method:"post",data:t}),extraOptions:{skipError:!0}}),generateDeployment:s.mutation({query:({projectId:e,mlId:r,body:t})=>({url:`project/${e}/modelregistries/${e}/models/${r}/generate-deployment`,method:"post",data:t}),extraOptions:{skipError:!0}})})}),{useGetModelsListQuery:D,useGetModelQuery:C,useGetModelVersionQuery:H,useGetModelProvenanceQuery:R,useLazyGetModelProvenanceQuery:K,useGetModelMonitoringConfigsQuery:z,useLazyGetModelMonitoringConfigsQuery:U,useDeleteModelVersionMutation:J,useGetModelTagsQuery:N,useAddModelTagsMutation:W,useDeleteModelTagMutation:X,useUpdateModelVersionFrameworkMutation:Y,useInspectHuggingFaceModelMutation:Z,useStartHuggingFaceImportMutation:b,useGetHuggingFaceStatusQuery:ee,useCancelHuggingFaceDownloadMutation:re,useGenerateVllmConfigMutation:te,useGenerateDeploymentMutation:se}=j;export{Y as A,J as B,D as a,H as b,k as c,A as d,q as e,I as f,Q as g,S as h,W as i,X as j,N as k,se as l,j as m,te as n,z as o,U as p,G as q,_ as r,E as s,B as t,h as u,Z as v,b as w,re as x,ee as y,C as z};
