import{v as T,dX as y,w as i,x as s,dw as n,W as $,m as F,dY as v,G as g,dZ as m,B as l,d_ as j,z as P}from"./index-d6499a22.js";const q=T.injectEndpoints({endpoints:o=>({getFeatureViews:o.query({query:({pId:e,fsId:t,params:r={}})=>{const a=y.stringify(r);return{url:`project/${e}/featurestores/${t}/featureview?${a}`}},providesTags:i.providesListItems(s.ProjectTags.FeatureView,"name"),extraOptions:{skipError:!0}}),getFeatureViewVersions:o.query({query:({pId:e,fsId:t,id:r})=>({url:`project/${e}/featurestores/${t}/featureview/${r}`}),providesTags:i.providesListItems(s.ProjectTags.FeatureView,"name"),extraOptions:{skipError:!0}}),getFeatureView:o.query({query:({id:e,version:t,pId:r,fsId:a,params:u={}})=>{const p=y.stringify(u);return{url:`
          project/${r}/
          featurestores/${a}/
          featureview/${e}/version/${t}
          ?${p}
          `.replace(/\s/g,"")}},transformResponse:e=>n({tags:$(g([],"items"),F(v))},e),providesTags:i.cacheByIdArgProperty(s.ProjectTags.FeatureView),extraOptions:{skipError:!0}}),getFeatureViewTransformationFunctions:o.query({query:({id:e,version:t,pId:r,fsId:a})=>({url:`
          project/${r}/
          featurestores/${a}/
          featureview/${e}/version/${t}/
          transformation
          `.replace(/\s/g,"")}),providesTags:i.cacheByIdArgProperty(s.ProjectTags.FeatureViewTransformations),extraOptions:{skipError:!0}}),updateFeatureView:o.mutation({query:({id:e,version:t,pId:r,fsId:a,data:u})=>({url:`
          project/${r}/
          featurestores/${a}/
          featureview/${e}/version/${t}
          `.replace(/\s/g,""),method:"put",data:u}),invalidatesTags:i.cacheByIdArgProperty(s.ProjectTags.FeatureView)}),createFeatureView:o.mutation({query:({pId:e,fsId:t,data:r})=>({url:`project/${e}/featurestores/${t}/featureview`,method:"post",data:{...r,type:"featureViewDTO"}}),invalidatesTags:[{type:s.ProjectTags.FeatureView,id:"LIST"}]}),addFeatureViewTags:o.mutation({async queryFn({pId:e,fsId:t,tags:r,id:a,version:u},p,h,V){const f=m(r).map(w=>V({url:`
            project/${e}/
            featurestores/${t}/
            featureview/${a}/version/${u}/
            tags/${w.key}
            `.replace(/\s/g,""),method:"put",data:w.formattedArray})),d=await Promise.all(f),c=l(j(["error","response"]),d);return c?{error:n({error:$(g({data:{usrMsg:"Error while adding tags"}},"response"),n({data:P("usrMsg")}))},c)}:{data:d}},invalidatesTags:i.cacheByIdArgProperty(s.ProjectTags.FeatureView)}),addFeatureViewSingleTag:o.mutation({query:({pId:e,fsId:t,id:r,version:a,tagName:u,tagData:p})=>({url:`
            project/${e}/
            featurestores/${t}/
            featureview/${r}/version/${a}/
            tags/${u}
            `.replace(/\s/g,""),method:"put",data:p}),invalidatesTags:i.cacheByIdArgProperty(s.ProjectTags.FeatureView)}),getFeatureViewKeywords:o.query({query:({id:e,version:t,pId:r,fsId:a})=>({url:`
          project/${r}/
          featurestores/${a}/
          featureview/${e}/version/${t}/
          keywords
          `.replace(/\s/g,"")}),transformResponse:g([],"keywords"),extraOptions:{skipError:!0},providesTags:i.cacheByIdArgProperty(s.ProjectTags.FeatureView)}),addFeatureViewKeywords:o.mutation({query:({pId:e,fsId:t,data:r,id:a,version:u})=>({url:`
        project/${e}/
        featurestores/${t}/
        featureview/${a}/version/${u}/
        keywords
        `.replace(/\s/g,""),method:"post",data:r}),invalidatesTags:i.cacheByIdArgProperty(s.ProjectTags.FeatureView)}),deleteFeatureView:o.mutation({query:({pId:e,fsId:t,id:r,version:a})=>({url:`
        project/${e}/
        featurestores/${t}/
        featureview/${r}/version/${a}
        `.replace(/\s/g,""),method:"delete"}),invalidatesTags:(e,t,{id:r})=>[{type:s.ProjectTags.FeatureView,id:"LIST"},{type:s.ProjectTags.FeatureView,id:r}]})})}),{useGetFeatureViewsQuery:I,useGetFeatureViewQuery:M,useGetFeatureViewVersionsQuery:x,useGetFeatureViewTransformationFunctionsQuery:B,useGetFeatureViewKeywordsQuery:E,useUpdateFeatureViewMutation:O,useCreateFeatureViewMutation:G,useAddFeatureViewKeywordsMutation:Q,useAddFeatureViewTagsMutation:S,useAddFeatureViewSingleTagMutation:_,useDeleteFeatureViewMutation:K,endpoints:L}=q;export{E as a,_ as b,S as c,I as d,Q as e,x as f,B as g,K as h,G as i,M as u};
