import{t as e}from"./api-DqXJkjY6.js";var{useListRolesQuery:t,useGetRoleQuery:n,useCreateRoleMutation:r,useUpdateRoleMutation:i,useDeleteRoleMutation:a,useSetRolePermissionsMutation:o,useSetRoleDataAccessMutation:s,useSetRoleFieldMasksMutation:c,useListAdminUsersQuery:l,useCreateAdminUserMutation:u,useUpdateAdminUserMutation:d,useDeactivateAdminUserMutation:f,useAssignUserRoleMutation:p,useGetPermissionSummaryQuery:m,useGetPermissionModulesQuery:h}=e.injectEndpoints({endpoints:e=>({listRoles:e.query({query:e=>({url:`/auth/roles/`,params:e||void 0}),providesTags:e=>e?[...e.results.map(({id:e})=>({type:`Role`,id:e})),{type:`Role`,id:`LIST`}]:[{type:`Role`,id:`LIST`}]}),getRole:e.query({query:e=>`/auth/roles/${e}/`,transformResponse:e=>e.data,providesTags:(e,t,n)=>[{type:`Role`,id:n}]}),createRole:e.mutation({query:e=>({url:`/auth/roles/`,method:`POST`,body:e}),transformResponse:e=>e.data,invalidatesTags:[{type:`Role`,id:`LIST`}]}),updateRole:e.mutation({query:({id:e,body:t})=>({url:`/auth/roles/${e}/`,method:`PATCH`,body:t}),invalidatesTags:(e,t,{id:n})=>[{type:`Role`,id:n},{type:`Role`,id:`LIST`}]}),deleteRole:e.mutation({query:e=>({url:`/auth/roles/${e}/`,method:`DELETE`}),invalidatesTags:[{type:`Role`,id:`LIST`}]}),setRolePermissions:e.mutation({query:({roleId:e,body:t})=>({url:`/auth/roles/${e}/set-permissions/`,method:`POST`,body:t}),transformResponse:e=>e.data,invalidatesTags:(e,t,{roleId:n})=>[{type:`Role`,id:n}]}),setRoleDataAccess:e.mutation({query:({roleId:e,body:t})=>({url:`/auth/roles/${e}/set-data-access/`,method:`POST`,body:t}),transformResponse:e=>e.data,invalidatesTags:(e,t,{roleId:n})=>[{type:`Role`,id:n}]}),setRoleFieldMasks:e.mutation({query:({roleId:e,body:t})=>({url:`/auth/roles/${e}/set-field-masks/`,method:`POST`,body:t}),transformResponse:e=>e.data,invalidatesTags:(e,t,{roleId:n})=>[{type:`Role`,id:n}]}),listAdminUsers:e.query({query:e=>({url:`/auth/users/`,params:e||void 0}),providesTags:e=>e?[...e.results.map(({id:e})=>({type:`User`,id:e})),{type:`User`,id:`LIST`}]:[{type:`User`,id:`LIST`}]}),createAdminUser:e.mutation({query:e=>({url:`/auth/users/`,method:`POST`,body:e}),transformResponse:e=>e.data,invalidatesTags:[{type:`User`,id:`LIST`}]}),updateAdminUser:e.mutation({query:({id:e,body:t})=>({url:`/auth/users/${e}/`,method:`PATCH`,body:t}),invalidatesTags:(e,t,{id:n})=>[{type:`User`,id:n},{type:`User`,id:`LIST`}]}),deactivateAdminUser:e.mutation({query:e=>({url:`/auth/users/${e}/`,method:`DELETE`}),invalidatesTags:(e,t,n)=>[{type:`User`,id:n},{type:`User`,id:`LIST`}]}),assignUserRole:e.mutation({query:({userId:e,roleId:t})=>({url:`/auth/users/${e}/assign-role/`,method:`POST`,body:{role_id:t}}),transformResponse:e=>e.data,invalidatesTags:(e,t,{userId:n})=>[{type:`User`,id:n},{type:`User`,id:`LIST`}]}),getPermissionSummary:e.query({query:()=>`/auth/permissions/`,transformResponse:e=>e.data}),getPermissionModules:e.query({query:()=>`/auth/permission-modules/`,transformResponse:e=>e.data})})});export{h as a,l as c,c as d,o as f,a as i,t as l,i as m,r as n,m as o,d as p,f as r,n as s,u as t,s as u};