@mostajs/rbac 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/categories-id.js +1 -1
- package/dist/api/categories.js +1 -1
- package/dist/api/matrix.js +1 -1
- package/dist/api/permissions-id.js +1 -1
- package/dist/api/permissions.js +1 -1
- package/dist/api/roles-id.js +1 -1
- package/dist/api/roles.js +1 -1
- package/dist/api/seed.js +1 -1
- package/dist/api/users-id.js +1 -1
- package/dist/api/users.js +1 -1
- package/dist/components/CategoriesManager.js +9 -9
- package/dist/components/PermissionMatrix.js +6 -6
- package/dist/components/PermissionsManager.js +10 -10
- package/dist/components/RBACManager.js +5 -5
- package/dist/components/RolesManager.js +9 -9
- package/dist/components/UsersManager.js +10 -10
- package/dist/index.js +15 -15
- package/dist/repositories/permission-category.repository.js +1 -1
- package/dist/repositories/permission.repository.js +1 -1
- package/dist/repositories/role.repository.js +1 -1
- package/dist/repositories/user.repository.js +1 -1
- package/dist/server.js +18 -18
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Author: Dr Hamid MADANI drmdh@msn.com
|
|
2
2
|
// RBAC API handler: PUT/DELETE /admin/categories/[id]
|
|
3
3
|
import { NextResponse } from 'next/server';
|
|
4
|
-
import { getRbacRepos } from '../lib/repos-factory';
|
|
4
|
+
import { getRbacRepos } from '../lib/repos-factory.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
const updateCategorySchema = z.object({
|
|
7
7
|
label: z.string().min(1).optional(),
|
package/dist/api/categories.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Author: Dr Hamid MADANI drmdh@msn.com
|
|
2
2
|
// RBAC API handler: GET/POST /admin/categories
|
|
3
3
|
import { NextResponse } from 'next/server';
|
|
4
|
-
import { getRbacRepos } from '../lib/repos-factory';
|
|
4
|
+
import { getRbacRepos } from '../lib/repos-factory.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
const createCategorySchema = z.object({
|
|
7
7
|
name: z.string().min(1).regex(/^[a-z][a-z0-9_]*$/, 'Format requis : minuscules, chiffres et underscores'),
|
package/dist/api/matrix.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Author: Dr Hamid MADANI drmdh@msn.com
|
|
2
2
|
// RBAC API handler: GET/POST /admin/permissions/matrix
|
|
3
3
|
import { NextResponse } from 'next/server';
|
|
4
|
-
import { getRbacRepos } from '../lib/repos-factory';
|
|
4
|
+
import { getRbacRepos } from '../lib/repos-factory.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
export function createMatrixHandler(config) {
|
|
7
7
|
const { checkPermission, adminPermission, categoryDefinitions = [] } = config;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Author: Dr Hamid MADANI drmdh@msn.com
|
|
2
2
|
// RBAC API handler: PUT/DELETE /admin/permissions/[id]
|
|
3
3
|
import { NextResponse } from 'next/server';
|
|
4
|
-
import { getRbacRepos } from '../lib/repos-factory';
|
|
4
|
+
import { getRbacRepos } from '../lib/repos-factory.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
const updatePermissionSchema = z.object({
|
|
7
7
|
description: z.string().optional(),
|
package/dist/api/permissions.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Author: Dr Hamid MADANI drmdh@msn.com
|
|
2
2
|
// RBAC API handler: GET/POST /admin/permissions
|
|
3
3
|
import { NextResponse } from 'next/server';
|
|
4
|
-
import { getRbacRepos } from '../lib/repos-factory';
|
|
4
|
+
import { getRbacRepos } from '../lib/repos-factory.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
const createPermissionSchema = z.object({
|
|
7
7
|
name: z.string().min(1).regex(/^[a-z_]+:[a-z_]+$/, 'Format requis : categorie:action'),
|
package/dist/api/roles-id.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Author: Dr Hamid MADANI drmdh@msn.com
|
|
2
2
|
// RBAC API handler: GET/PUT/DELETE /admin/roles/[id]
|
|
3
3
|
import { NextResponse } from 'next/server';
|
|
4
|
-
import { getRbacRepos } from '../lib/repos-factory';
|
|
4
|
+
import { getRbacRepos } from '../lib/repos-factory.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
const updateRoleSchema = z.object({
|
|
7
7
|
name: z.string().min(1).regex(/^[a-z][a-z0-9_]*$/).optional(),
|
package/dist/api/roles.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Author: Dr Hamid MADANI drmdh@msn.com
|
|
2
2
|
// RBAC API handler: GET/POST /admin/roles
|
|
3
3
|
import { NextResponse } from 'next/server';
|
|
4
|
-
import { getRbacRepos } from '../lib/repos-factory';
|
|
4
|
+
import { getRbacRepos } from '../lib/repos-factory.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
const createRoleSchema = z.object({
|
|
7
7
|
name: z.string().min(1).regex(/^[a-z][a-z0-9_]*$/, 'Le nom doit être en minuscules (lettres, chiffres, underscores)'),
|
package/dist/api/seed.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Author: Dr Hamid MADANI drmdh@msn.com
|
|
2
2
|
// RBAC API handler: POST /admin/permissions/seed
|
|
3
3
|
import { NextResponse } from 'next/server';
|
|
4
|
-
import { getRbacRepos } from '../lib/repos-factory';
|
|
4
|
+
import { getRbacRepos } from '../lib/repos-factory.js';
|
|
5
5
|
export function createSeedHandler(config) {
|
|
6
6
|
const { checkPermission, adminPermission, permissionDefinitions, defaultRoles, categoryDefinitions, } = config;
|
|
7
7
|
async function POST() {
|
package/dist/api/users-id.js
CHANGED
|
@@ -13,7 +13,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
// RBAC API handler: GET/PUT/DELETE /users/[id]
|
|
14
14
|
import { NextResponse } from 'next/server';
|
|
15
15
|
import { hashPassword } from '@mostajs/auth/lib/password';
|
|
16
|
-
import { getRbacRepos } from '../lib/repos-factory';
|
|
16
|
+
import { getRbacRepos } from '../lib/repos-factory.js';
|
|
17
17
|
import { z } from 'zod';
|
|
18
18
|
const updateUserSchema = z.object({
|
|
19
19
|
email: z.string().email().optional(),
|
package/dist/api/users.js
CHANGED
|
@@ -13,7 +13,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
// RBAC API handler: GET/POST /users
|
|
14
14
|
import { NextResponse } from 'next/server';
|
|
15
15
|
import { hashPassword } from '@mostajs/auth/lib/password';
|
|
16
|
-
import { getRbacRepos } from '../lib/repos-factory';
|
|
16
|
+
import { getRbacRepos } from '../lib/repos-factory.js';
|
|
17
17
|
import { z } from 'zod';
|
|
18
18
|
const createUserSchema = z.object({
|
|
19
19
|
email: z.string().email(),
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { Button } from './ui/button';
|
|
7
|
-
import { Input } from './ui/input';
|
|
8
|
-
import { Label } from './ui/label';
|
|
9
|
-
import { Badge } from './ui/badge';
|
|
10
|
-
import { Card, CardContent } from './ui/card';
|
|
11
|
-
import { Dialog, DialogContent, DialogHeader, DialogTitle, } from './ui/dialog';
|
|
12
|
-
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from './ui/alert-dialog';
|
|
13
|
-
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from './ui/table';
|
|
6
|
+
import { Button } from './ui/button.js';
|
|
7
|
+
import { Input } from './ui/input.js';
|
|
8
|
+
import { Label } from './ui/label.js';
|
|
9
|
+
import { Badge } from './ui/badge.js';
|
|
10
|
+
import { Card, CardContent } from './ui/card.js';
|
|
11
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, } from './ui/dialog.js';
|
|
12
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from './ui/alert-dialog.js';
|
|
13
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from './ui/table.js';
|
|
14
14
|
import { Plus, Pencil, Trash2, Loader2 } from 'lucide-react';
|
|
15
15
|
import { toast } from 'sonner';
|
|
16
|
-
import { createCategoriesApi, createPermissionsApi } from '../lib/rbac-api';
|
|
16
|
+
import { createCategoriesApi, createPermissionsApi } from '../lib/rbac-api.js';
|
|
17
17
|
const defaultT = (key) => key;
|
|
18
18
|
export function CategoriesManager({ apiBasePath = '/api', t = defaultT, }) {
|
|
19
19
|
const catApi = createCategoriesApi(apiBasePath);
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { useState, useCallback, Fragment } from 'react';
|
|
5
5
|
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { Button } from './ui/button';
|
|
7
|
-
import { Badge } from './ui/badge';
|
|
8
|
-
import { Card, CardContent } from './ui/card';
|
|
9
|
-
import { Checkbox } from './ui/checkbox';
|
|
10
|
-
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from './ui/table';
|
|
6
|
+
import { Button } from './ui/button.js';
|
|
7
|
+
import { Badge } from './ui/badge.js';
|
|
8
|
+
import { Card, CardContent } from './ui/card.js';
|
|
9
|
+
import { Checkbox } from './ui/checkbox.js';
|
|
10
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from './ui/table.js';
|
|
11
11
|
import { Loader2, Save, Database } from 'lucide-react';
|
|
12
12
|
import { toast } from 'sonner';
|
|
13
|
-
import { createMatrixApi } from '../lib/rbac-api';
|
|
13
|
+
import { createMatrixApi } from '../lib/rbac-api.js';
|
|
14
14
|
const defaultT = (key) => key;
|
|
15
15
|
export function PermissionMatrix({ apiBasePath = '/api', t = defaultT, }) {
|
|
16
16
|
const api = createMatrixApi(apiBasePath);
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { Button } from './ui/button';
|
|
7
|
-
import { Input } from './ui/input';
|
|
8
|
-
import { Label } from './ui/label';
|
|
9
|
-
import { Badge } from './ui/badge';
|
|
10
|
-
import { Card, CardContent } from './ui/card';
|
|
11
|
-
import { Dialog, DialogContent, DialogHeader, DialogTitle, } from './ui/dialog';
|
|
12
|
-
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from './ui/alert-dialog';
|
|
13
|
-
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from './ui/table';
|
|
14
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from './ui/select';
|
|
6
|
+
import { Button } from './ui/button.js';
|
|
7
|
+
import { Input } from './ui/input.js';
|
|
8
|
+
import { Label } from './ui/label.js';
|
|
9
|
+
import { Badge } from './ui/badge.js';
|
|
10
|
+
import { Card, CardContent } from './ui/card.js';
|
|
11
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, } from './ui/dialog.js';
|
|
12
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from './ui/alert-dialog.js';
|
|
13
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from './ui/table.js';
|
|
14
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from './ui/select.js';
|
|
15
15
|
import { Plus, Pencil, Trash2, Loader2 } from 'lucide-react';
|
|
16
16
|
import { toast } from 'sonner';
|
|
17
|
-
import { createPermissionsApi, createCategoriesApi } from '../lib/rbac-api';
|
|
17
|
+
import { createPermissionsApi, createCategoriesApi } from '../lib/rbac-api.js';
|
|
18
18
|
const defaultT = (key) => key;
|
|
19
19
|
export function PermissionsManager({ apiBasePath = '/api', t = defaultT, }) {
|
|
20
20
|
const permApi = createPermissionsApi(apiBasePath);
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
'use client';
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { useState } from 'react';
|
|
5
|
-
import { Tabs, TabsContent, TabsList, TabsTrigger } from './ui/tabs';
|
|
5
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from './ui/tabs.js';
|
|
6
6
|
import { Shield } from 'lucide-react';
|
|
7
|
-
import { PermissionMatrix } from './PermissionMatrix';
|
|
8
|
-
import { RolesManager } from './RolesManager';
|
|
9
|
-
import { PermissionsManager } from './PermissionsManager';
|
|
10
|
-
import { CategoriesManager } from './CategoriesManager';
|
|
7
|
+
import { PermissionMatrix } from './PermissionMatrix.js';
|
|
8
|
+
import { RolesManager } from './RolesManager.js';
|
|
9
|
+
import { PermissionsManager } from './PermissionsManager.js';
|
|
10
|
+
import { CategoriesManager } from './CategoriesManager.js';
|
|
11
11
|
const defaultT = (key) => key;
|
|
12
12
|
export function RBACManager({ apiBasePath = '/api', t = defaultT, systemRoles = [], roleColors, statusColors, }) {
|
|
13
13
|
const [tab, setTab] = useState('matrix');
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { Button } from './ui/button';
|
|
7
|
-
import { Input } from './ui/input';
|
|
8
|
-
import { Label } from './ui/label';
|
|
9
|
-
import { Badge } from './ui/badge';
|
|
10
|
-
import { Card, CardContent } from './ui/card';
|
|
11
|
-
import { Dialog, DialogContent, DialogHeader, DialogTitle, } from './ui/dialog';
|
|
12
|
-
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from './ui/alert-dialog';
|
|
13
|
-
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from './ui/table';
|
|
6
|
+
import { Button } from './ui/button.js';
|
|
7
|
+
import { Input } from './ui/input.js';
|
|
8
|
+
import { Label } from './ui/label.js';
|
|
9
|
+
import { Badge } from './ui/badge.js';
|
|
10
|
+
import { Card, CardContent } from './ui/card.js';
|
|
11
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, } from './ui/dialog.js';
|
|
12
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from './ui/alert-dialog.js';
|
|
13
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from './ui/table.js';
|
|
14
14
|
import { Plus, Pencil, Trash2, Loader2 } from 'lucide-react';
|
|
15
15
|
import { toast } from 'sonner';
|
|
16
|
-
import { createRolesApi } from '../lib/rbac-api';
|
|
16
|
+
import { createRolesApi } from '../lib/rbac-api.js';
|
|
17
17
|
const defaultT = (key) => key;
|
|
18
18
|
export function RolesManager({ apiBasePath = '/api', t = defaultT, systemRoles = [], }) {
|
|
19
19
|
const api = createRolesApi(apiBasePath);
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { Button } from './ui/button';
|
|
7
|
-
import { Input } from './ui/input';
|
|
8
|
-
import { Label } from './ui/label';
|
|
9
|
-
import { Badge } from './ui/badge';
|
|
10
|
-
import { Card, CardContent } from './ui/card';
|
|
11
|
-
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger, } from './ui/dialog';
|
|
12
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from './ui/select';
|
|
13
|
-
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from './ui/table';
|
|
6
|
+
import { Button } from './ui/button.js';
|
|
7
|
+
import { Input } from './ui/input.js';
|
|
8
|
+
import { Label } from './ui/label.js';
|
|
9
|
+
import { Badge } from './ui/badge.js';
|
|
10
|
+
import { Card, CardContent } from './ui/card.js';
|
|
11
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger, } from './ui/dialog.js';
|
|
12
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from './ui/select.js';
|
|
13
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from './ui/table.js';
|
|
14
14
|
import { Plus, Pencil, Trash2, Loader2 } from 'lucide-react';
|
|
15
|
-
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from './ui/alert-dialog';
|
|
15
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from './ui/alert-dialog.js';
|
|
16
16
|
import { toast } from 'sonner';
|
|
17
|
-
import { createUsersApi } from '../lib/rbac-api';
|
|
17
|
+
import { createUsersApi } from '../lib/rbac-api.js';
|
|
18
18
|
const defaultT = (key) => key;
|
|
19
19
|
export function UsersManager({ apiBasePath = '/api', t = defaultT, roleColors = {}, statusColors = {}, fallbackRoles, }) {
|
|
20
20
|
const api = createUsersApi(apiBasePath);
|
package/dist/index.js
CHANGED
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
// @mostajs/rbac — Client-safe barrel (NO ORM imports)
|
|
3
3
|
// For server-side code (repos, seed, permissions-server), use '@mostajs/rbac/server'
|
|
4
4
|
// Schemas (pure data definitions — no ORM dependency)
|
|
5
|
-
export { UserSchema } from './schemas/user.schema';
|
|
6
|
-
export { RoleSchema } from './schemas/role.schema';
|
|
7
|
-
export { PermissionSchema } from './schemas/permission.schema';
|
|
8
|
-
export { PermissionCategorySchema } from './schemas/permission-category.schema';
|
|
5
|
+
export { UserSchema } from './schemas/user.schema.js';
|
|
6
|
+
export { RoleSchema } from './schemas/role.schema.js';
|
|
7
|
+
export { PermissionSchema } from './schemas/permission.schema.js';
|
|
8
|
+
export { PermissionCategorySchema } from './schemas/permission-category.schema.js';
|
|
9
9
|
// Menu contribution
|
|
10
|
-
export { rbacMenuContribution } from './lib/menu';
|
|
10
|
+
export { rbacMenuContribution } from './lib/menu.js';
|
|
11
11
|
// Pages (client-side, registered via PageRegistration)
|
|
12
|
-
export { default as UsersPage } from './pages/UsersPage';
|
|
13
|
-
export { default as RolesPage } from './pages/RolesPage';
|
|
12
|
+
export { default as UsersPage } from './pages/UsersPage.js';
|
|
13
|
+
export { default as RolesPage } from './pages/RolesPage.js';
|
|
14
14
|
// i18n
|
|
15
|
-
export { t as rbacT } from './lib/i18n';
|
|
15
|
+
export { t as rbacT } from './lib/i18n.js';
|
|
16
16
|
// Components (client-side)
|
|
17
|
-
export { UsersManager } from './components/UsersManager';
|
|
18
|
-
export { RBACManager } from './components/RBACManager';
|
|
19
|
-
export { RolesManager } from './components/RolesManager';
|
|
20
|
-
export { PermissionsManager } from './components/PermissionsManager';
|
|
21
|
-
export { CategoriesManager } from './components/CategoriesManager';
|
|
22
|
-
export { PermissionMatrix } from './components/PermissionMatrix';
|
|
17
|
+
export { UsersManager } from './components/UsersManager.js';
|
|
18
|
+
export { RBACManager } from './components/RBACManager.js';
|
|
19
|
+
export { RolesManager } from './components/RolesManager.js';
|
|
20
|
+
export { PermissionsManager } from './components/PermissionsManager.js';
|
|
21
|
+
export { CategoriesManager } from './components/CategoriesManager.js';
|
|
22
|
+
export { PermissionMatrix } from './components/PermissionMatrix.js';
|
|
23
23
|
// API helpers (client-side fetch wrappers — no server deps)
|
|
24
|
-
export { createUsersApi, createRolesApi, createPermissionsApi, createMatrixApi, createCategoriesApi, } from './lib/rbac-api';
|
|
24
|
+
export { createUsersApi, createRolesApi, createPermissionsApi, createMatrixApi, createCategoriesApi, } from './lib/rbac-api.js';
|
|
25
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @mostajs/rbac — PermissionCategoryRepository
|
|
2
2
|
// Author: Dr Hamid MADANI drmdh@msn.com
|
|
3
3
|
import { BaseRepository } from '@mostajs/orm';
|
|
4
|
-
import { PermissionCategorySchema } from '../schemas/permission-category.schema';
|
|
4
|
+
import { PermissionCategorySchema } from '../schemas/permission-category.schema.js';
|
|
5
5
|
export class PermissionCategoryRepository extends BaseRepository {
|
|
6
6
|
constructor(dialect) {
|
|
7
7
|
super(PermissionCategorySchema, dialect);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @mostajs/rbac — PermissionRepository
|
|
2
2
|
// Author: Dr Hamid MADANI drmdh@msn.com
|
|
3
3
|
import { BaseRepository } from '@mostajs/orm';
|
|
4
|
-
import { PermissionSchema } from '../schemas/permission.schema';
|
|
4
|
+
import { PermissionSchema } from '../schemas/permission.schema.js';
|
|
5
5
|
export class PermissionRepository extends BaseRepository {
|
|
6
6
|
constructor(dialect) {
|
|
7
7
|
super(PermissionSchema, dialect);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @mostajs/rbac — RoleRepository
|
|
2
2
|
// Author: Dr Hamid MADANI drmdh@msn.com
|
|
3
3
|
import { BaseRepository } from '@mostajs/orm';
|
|
4
|
-
import { RoleSchema } from '../schemas/role.schema';
|
|
4
|
+
import { RoleSchema } from '../schemas/role.schema.js';
|
|
5
5
|
export class RoleRepository extends BaseRepository {
|
|
6
6
|
constructor(dialect) {
|
|
7
7
|
super(RoleSchema, dialect);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @mostajs/rbac — UserRepository
|
|
2
2
|
// Author: Dr Hamid MADANI drmdh@msn.com
|
|
3
3
|
import { BaseRepository } from '@mostajs/orm';
|
|
4
|
-
import { UserSchema } from '../schemas/user.schema';
|
|
4
|
+
import { UserSchema } from '../schemas/user.schema.js';
|
|
5
5
|
export class UserRepository extends BaseRepository {
|
|
6
6
|
constructor(dialect) {
|
|
7
7
|
super(UserSchema, dialect);
|
package/dist/server.js
CHANGED
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
// @mostajs/rbac/server — Server-side exports (ORM-dependent)
|
|
3
3
|
// Import from '@mostajs/rbac/server' in API routes and server code
|
|
4
4
|
// Repositories (depend on @mostajs/orm)
|
|
5
|
-
export { UserRepository } from './repositories/user.repository';
|
|
6
|
-
export { RoleRepository } from './repositories/role.repository';
|
|
7
|
-
export { PermissionRepository } from './repositories/permission.repository';
|
|
8
|
-
export { PermissionCategoryRepository } from './repositories/permission-category.repository';
|
|
5
|
+
export { UserRepository } from './repositories/user.repository.js';
|
|
6
|
+
export { RoleRepository } from './repositories/role.repository.js';
|
|
7
|
+
export { PermissionRepository } from './repositories/permission.repository.js';
|
|
8
|
+
export { PermissionCategoryRepository } from './repositories/permission-category.repository.js';
|
|
9
9
|
// RBAC seed (depends on repos → ORM)
|
|
10
|
-
export { seedRBAC } from './lib/rbac-seed';
|
|
10
|
+
export { seedRBAC } from './lib/rbac-seed.js';
|
|
11
11
|
// Create admin (depends on repos → ORM + bcrypt)
|
|
12
|
-
export { createAdmin } from './lib/create-admin';
|
|
12
|
+
export { createAdmin } from './lib/create-admin.js';
|
|
13
13
|
// Module info (schemas, seeds, metadata — for setup discovery)
|
|
14
|
-
export { getSchemas, moduleInfo } from './lib/module-info';
|
|
14
|
+
export { getSchemas, moduleInfo } from './lib/module-info.js';
|
|
15
15
|
// Server-side permission DB lookup (depends on repos → ORM)
|
|
16
|
-
export { getPermissionsForRoleFromDB } from './lib/permissions-server';
|
|
16
|
+
export { getPermissionsForRoleFromDB } from './lib/permissions-server.js';
|
|
17
17
|
// API handler factories
|
|
18
|
-
export { createUsersHandler } from './api/users';
|
|
19
|
-
export { createUsersIdHandler } from './api/users-id';
|
|
20
|
-
export { createRolesHandler } from './api/roles';
|
|
21
|
-
export { createRolesIdHandler } from './api/roles-id';
|
|
22
|
-
export { createPermissionsHandler } from './api/permissions';
|
|
23
|
-
export { createPermissionsIdHandler } from './api/permissions-id';
|
|
24
|
-
export { createMatrixHandler } from './api/matrix';
|
|
25
|
-
export { createCategoriesHandler } from './api/categories';
|
|
26
|
-
export { createCategoriesIdHandler } from './api/categories-id';
|
|
27
|
-
export { createSeedHandler } from './api/seed';
|
|
18
|
+
export { createUsersHandler } from './api/users.js';
|
|
19
|
+
export { createUsersIdHandler } from './api/users-id.js';
|
|
20
|
+
export { createRolesHandler } from './api/roles.js';
|
|
21
|
+
export { createRolesIdHandler } from './api/roles-id.js';
|
|
22
|
+
export { createPermissionsHandler } from './api/permissions.js';
|
|
23
|
+
export { createPermissionsIdHandler } from './api/permissions-id.js';
|
|
24
|
+
export { createMatrixHandler } from './api/matrix.js';
|
|
25
|
+
export { createCategoriesHandler } from './api/categories.js';
|
|
26
|
+
export { createCategoriesIdHandler } from './api/categories-id.js';
|
|
27
|
+
export { createSeedHandler } from './api/seed.js';
|
|
28
28
|
//# sourceMappingURL=server.js.map
|