import{P as f,Q as o,T as u}from"./index-Cc-6WbPt.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:K,useGetKafkaSubjectsQuery:m,useDeleteKafkaTopicMutation:g,useCreateKafkaTopicMutation:$,useGetKafkaSubjectNamesQuery:l,useGetKafkaSubjectSchemaQuery:q,useDeleteKafkaSubjectMutation:S,useCreateKafkaSubjectMutation:d,useGetNonSharedKafkaTopicsQuery:h}=n;export{y as a,K as b,g as c,S as d,l as e,m as f,$ as g,q as h,d as i,h as u};
