@quantabit/rbac-sdk 1.0.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 QuantaBit Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,95 @@
1
+ # @quantabit/rbac-sdk
2
+
3
+ > QuantaBit RBAC SDK - Role-based access control and fine-grained API resource management
4
+
5
+ ## 📦 Installation
6
+
7
+ ```bash
8
+ npm install @quantabit/rbac-sdk
9
+ # or
10
+ yarn add @quantabit/rbac-sdk
11
+ ```
12
+
13
+ ## 🚀 Quick Start
14
+
15
+ ### Using Components
16
+
17
+ ```jsx
18
+ import { RoleGrid, RoleCard, PermissionList, PermissionTag, Rbac } from '@quantabit/rbac-sdk';
19
+ import '@quantabit/rbac-sdk/styles';
20
+
21
+ <RoleGrid />
22
+ <RoleCard />
23
+ <PermissionList />
24
+ ```
25
+
26
+ ### Using Hooks
27
+
28
+ ```jsx
29
+ import { useRoles, usePermissions, useUserRoles, useRbacActions, useRbac } from '@quantabit/rbac-sdk';
30
+
31
+ function MyComponent() {
32
+ const result = useRoles();
33
+ const result = usePermissions();
34
+ const result = useUserRoles();
35
+ return <div>...</div>;
36
+ }
37
+ ```
38
+
39
+ ### API Client
40
+
41
+ ```javascript
42
+ import { rbacApi } from '@quantabit/rbac-sdk';
43
+
44
+ // Use rbacApi for direct API calls
45
+ const data = await rbacApi.list();
46
+ ```
47
+
48
+ ## 📚 Components
49
+
50
+ | Component | Description |
51
+ | --------- | ----------- |
52
+ | `RoleGrid` | Role Grid component |
53
+ | `RoleCard` | Role Card component |
54
+ | `PermissionList` | Permission List component |
55
+ | `PermissionTag` | Permission Tag component |
56
+ | `Rbac` | Rbac component |
57
+
58
+ ## 🪝 Hooks
59
+
60
+ | Hook | Description |
61
+ | ---- | ----------- |
62
+ | `useRoles` | Roles management |
63
+ | `usePermissions` | Permissions management |
64
+ | `useUserRoles` | User Roles management |
65
+ | `useRbacActions` | Rbac Actions management |
66
+ | `useRbac` | Rbac management |
67
+
68
+ ## 📖 Type Definitions
69
+
70
+ ```javascript
71
+ import { PermissionEffect, ResourceType, ActionType } from '@quantabit/rbac-sdk';
72
+ ```
73
+
74
+ ## 🌐 Internationalization
75
+
76
+ ```javascript
77
+ import { setLanguage, t } from '@quantabit/rbac-sdk';
78
+
79
+ setLanguage("en");
80
+ ```
81
+
82
+ ## 📄 License
83
+
84
+ MIT License
85
+
86
+
87
+
88
+ ---
89
+
90
+ ## 🌐 Brand & Links
91
+ - Official Mainnet: [QuantaBit Chain](https://qbitchain.io/)
92
+ - Developer Platform: [Developer Platform](https://developer.quantabit.io/)
93
+ - Open Platform: [Open Platform](https://open.quantabit.io/)
94
+ - Payment Platform: [Pay Platform](https://pay.qbitwallet.io/)
95
+ - Feedback: [Feedback](https://xwin.live/qbit)