import{M as f,O as o,P as u}from"./index-DHiyXWqE.js";const n=f.injectEndpoints({endpoints:s=>({getNonSharedKafkaTopics:s.query({query:a=>({url:`project/${a}/kafka/topics?filter_by=shared:false`}),transformResponse:a=>a.items??[],providesTags:u.providesList(o.ProjectTags.KafkaTopics)}),getKafkaTopic:s.query({query:({projectId:a,topicId:e})=>({url:`project/${a}/kafka/topics/${e}`}),transformResponse:a=>a.items??[]}),getKafkaTopics:s.query({query:a=>({url:`project/${a}/kafka/topics`}),transformResponse:a=>a.items??[],providesTags:u.providesList(o.ProjectTags.KafkaTopics)}),createKafkaTopic:s.mutation({query:({id:a,data:e})=>({url:`project/${a}/kafka/topics`,method:"post",data:e}),invalidatesTags:[o.ProjectTags.KafkaTopics]}),deleteKafkaTopic:s.mutation({query:({id:a,topicName:e})=>({url:`project/${a}/kafka/topics/${e}`,method:"delete"}),invalidatesTags:[o.ProjectTags.KafkaTopics]}),createKafkaSubject:s.mutation({query:({id:a,subjectName:e,data:t})=>({url:`project/${a}/kafka/subjects/${e}/versions`,method:"post",data:t}),invalidatesTags:[o.ProjectTags.KafkaSchemas]}),deleteKafkaSubject:s.mutation({query:({id:a,version:e,subjectName:t,deleteAll:r})=>({url:r?`project/${a}/kafka/subjects/${t}`:`project/${a}/kafka/subjects/${t}/versions/${e}`,method:"delete"}),invalidatesTags:[o.ProjectTags.KafkaSchemas]}),getKafkaSubjectNames:s.query({query:a=>({url:`project/${a}/kafka/subjects`}),transformResponse:a=>a.replace(/\[|\]/g,"").split(", "),providesTags:[o.ProjectTags.KafkaSchemas]}),getKafkaSubjects:s.query({async queryFn({subjectNames:a,projectId:e},t,r,i){const p=a.map(async c=>{const{data:k}=await i({url:`project/${e}/kafka/subjects/${c}/versions`});return{name:c,versions:k}});return{data:await Promise.all(p)}}}),getKafkaSubjectSchema:s.query({query:({subjectName:a,projectId:e,version:t})=>({url:`project/${e}/kafka/subjects/${a}/versions/${t}/schema`})})})}),{useGetKafkaTopicQuery:y,useGetKafkaTopicsQuery:m,useGetKafkaSubjectsQuery:K,useDeleteKafkaTopicMutation:g,useCreateKafkaTopicMutation:$,useGetKafkaSubjectNamesQuery:l,useGetKafkaSubjectSchemaQuery:q,useDeleteKafkaSubjectMutation:S,useCreateKafkaSubjectMutation:d}=n;export{g as a,S as b,l as c,K as d,y as e,$ as f,q as g,d as h,m as u};
