import { j as p, i as $ } from "./index-CwSaRXXg.js";
const d = (r) => ({
  get: (t, e) => p.get(t, {
    ...e,
    headers: r ? { ...e?.headers, "X-Tenant-Slug": r } : e?.headers
  }).then((s) => s.data),
  post: (t, e, s) => p.post(t, e, {
    ...s,
    headers: r ? { ...s?.headers, "X-Tenant-Slug": r } : s?.headers
  }).then((n) => n.data),
  put: (t, e, s) => p.put(t, e, {
    ...s,
    headers: r ? { ...s?.headers, "X-Tenant-Slug": r } : s?.headers
  }).then((n) => n.data),
  patch: (t, e, s) => p.patch(t, e, {
    ...s,
    headers: r ? { ...s?.headers, "X-Tenant-Slug": r } : s?.headers
  }).then((n) => n.data),
  delete: (t, e) => p.delete(t, {
    ...e,
    headers: r ? { ...e?.headers, "X-Tenant-Slug": r } : e?.headers
  }).then((s) => s.data)
}), a = "/api/administration/users/groups", h = (r) => {
  const t = r ? d(r) : $;
  return {
    // === CRUD OPERATIONS ===
    getAll: async (e, s, n) => {
      const o = new URLSearchParams();
      e && o.append("search", e), s !== void 0 && o.append("isActive", String(s)), n !== void 0 && o.append("syncedFromEntra", String(n));
      const c = o.toString(), i = c ? `${a}?${c}` : a;
      return await t.get(i);
    },
    getById: async (e) => await t.get(`${a}/${e}`),
    create: async (e) => await t.post(a, e),
    update: async (e, s) => await t.put(`${a}/${e}`, s),
    delete: async (e) => {
      await t.delete(`${a}/${e}`);
    },
    activate: async (e) => {
      await t.patch(`${a}/${e}/activate`);
    },
    deactivate: async (e) => {
      await t.patch(`${a}/${e}/deactivate`);
    },
    // === ENTRA LINKING ===
    linkToEntra: async (e, s) => {
      await t.post(`${a}/${e}/link-entra`, s);
    },
    unlinkFromEntra: async (e) => {
      await t.post(`${a}/${e}/unlink-entra`);
    },
    // === MEMBER MANAGEMENT ===
    getMembers: async (e) => await t.get(`${a}/${e}/members`),
    addMember: async (e, s) => {
      await t.post(`${a}/${e}/members`, s);
    },
    removeMember: async (e, s) => {
      await t.delete(`${a}/${e}/members/${s}`);
    },
    // === ROLE MANAGEMENT ===
    getRoles: async (e) => await t.get(`${a}/${e}/roles`),
    assignRole: async (e, s) => {
      await t.post(`${a}/${e}/roles`, s);
    },
    removeRole: async (e, s, n) => {
      const o = n ? `?tenantId=${n}` : "";
      await t.delete(`${a}/${e}/roles/${s}${o}`);
    },
    setRoleInheritable: async (e, s, n) => {
      await t.patch(`${a}/${e}/roles/${s}/inheritable`, n);
    },
    // === HIERARCHY ===
    getChildGroups: async (e) => await t.get(`${a}/${e}/children`),
    setParentGroup: async (e, s) => {
      await t.patch(`${a}/${e}/parent`, s);
    },
    // === TENANT MANAGEMENT ===
    getTenants: async (e) => await t.get(`${a}/${e}/tenants`),
    getInheritedTenants: async (e) => await t.get(`${a}/${e}/inherited-tenants`),
    getInheritedMembers: async (e) => await t.get(`${a}/${e}/inherited-members`),
    getInheritedRoles: async (e) => await t.get(`${a}/${e}/inherited-roles`),
    addToTenant: async (e, s) => {
      await t.post(`${a}/${e}/tenants`, s);
    },
    removeFromTenant: async (e, s) => {
      await t.delete(`${a}/${e}/tenants/${s}`);
    },
    // === APPLICATION ACCESS ===
    getApplicationAccess: async (e, s) => {
      const n = s ? `${a}/${e}/application-access?tenantId=${s}` : `${a}/${e}/application-access`;
      return await t.get(n);
    },
    // === CUSTOM ROLE ===
    getCustomRole: async (e) => await t.get(`${a}/${e}/custom-role`),
    createCustomRole: async (e) => await t.post(`${a}/${e}/custom-role`),
    deleteCustomRole: async (e) => {
      await t.delete(`${a}/${e}/custom-role`);
    }
  };
}, l = h, y = l();
export {
  l as c,
  y as g
};
//# sourceMappingURL=groupsApi-BgCk2fsp.js.map
