@explita/cloud-auth-client 0.1.0 → 0.1.2

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.
Files changed (34) hide show
  1. package/dist/components/change-password.js +58 -75
  2. package/dist/components/icons/alert-circle.d.ts +5 -0
  3. package/dist/components/icons/alert-circle.js +13 -0
  4. package/dist/components/icons/chevron-down.d.ts +5 -0
  5. package/dist/components/icons/chevron-down.js +11 -0
  6. package/dist/components/icons/lock.d.ts +2 -1
  7. package/dist/components/icons/lock.js +2 -2
  8. package/dist/components/icons/logout.d.ts +2 -1
  9. package/dist/components/icons/logout.js +2 -2
  10. package/dist/components/icons/setting.d.ts +2 -1
  11. package/dist/components/icons/setting.js +2 -2
  12. package/dist/components/icons/shield.d.ts +5 -0
  13. package/dist/components/icons/shield.js +11 -0
  14. package/dist/components/icons/user.d.ts +5 -0
  15. package/dist/components/icons/user.js +12 -0
  16. package/dist/components/login-form.d.ts +3 -1
  17. package/dist/components/login-form.js +45 -34
  18. package/dist/components/reset-password.d.ts +2 -1
  19. package/dist/components/reset-password.js +62 -60
  20. package/dist/components/settings.js +16 -8
  21. package/dist/components/signup-form.d.ts +4 -3
  22. package/dist/components/signup-form.js +72 -60
  23. package/dist/components/toggle-2fa.js +42 -26
  24. package/dist/components/toggle-account-status.js +55 -64
  25. package/dist/components/ui/input.js +1 -1
  26. package/dist/components/user-card.js +48 -23
  27. package/dist/contexts/auth-provider.js +1 -1
  28. package/dist/index.d.ts +1 -1
  29. package/dist/lib/utils.js +7 -1
  30. package/dist/server/user.d.ts +3 -1
  31. package/dist/server/user.js +33 -0
  32. package/dist/styles.css +901 -61
  33. package/dist/types.d.ts +21 -7
  34. package/package.json +2 -2
package/dist/types.d.ts CHANGED
@@ -85,17 +85,30 @@ export type Login = {
85
85
  authToken?: string | null;
86
86
  };
87
87
  export type CreateUser = {
88
- roleId?: string | null;
89
- groupId?: string | null;
88
+ groupId: string | number;
90
89
  firstName: string;
91
90
  lastName: string;
92
- username?: string | null;
91
+ username?: string;
93
92
  email: string;
94
93
  password: string;
95
94
  confirmPassword: string;
96
95
  metadata?: Record<string, any>;
97
- isSuperAdmin?: boolean;
98
- };
96
+ } & ({
97
+ roleId: string;
98
+ } | {
99
+ isSuperAdmin: boolean;
100
+ });
101
+ export type CreateServiceSub = {
102
+ serviceKey: string;
103
+ userId: string;
104
+ groupId: string;
105
+ metadata?: Record<string, any>;
106
+ shouldGenerateAuthToken?: boolean;
107
+ } & ({
108
+ isSuperAdmin: boolean;
109
+ } | {
110
+ roleId: string;
111
+ });
99
112
  export type UpdateUser = Omit<CreateUser, "password" | "confirmPassword">;
100
113
  export type GeneralResponse = {
101
114
  status: "failure";
@@ -141,7 +154,7 @@ export type ResetPasswordWithUserId = ResetPassword & {
141
154
  };
142
155
  export type AuthContextType = {
143
156
  user: User | null;
144
- authLoading: boolean;
157
+ isLoading: boolean;
145
158
  isAuthenticated: boolean;
146
159
  error: AuthError | null;
147
160
  login: (credentials: Login) => Promise<Partial<AuthError> | null>;
@@ -154,8 +167,9 @@ export type AuthContextType = {
154
167
  };
155
168
  export type User = {
156
169
  id: string;
170
+ subId: string;
157
171
  roleId?: string | null;
158
- groupId?: string | null;
172
+ groupId: string;
159
173
  email: string;
160
174
  username: string | null;
161
175
  firstName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@explita/cloud-auth-client",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "author": "Explita",
5
5
  "license": "MIT",
6
6
  "description": "A simple authentication library for React",
@@ -47,7 +47,7 @@
47
47
  "class-variance-authority": "^0.7.1"
48
48
  },
49
49
  "optionalDependencies": {
50
- "@explita/cloud-otp-client": "^0.0.1"
50
+ "@explita/cloud-otp-client": "^0.1.1"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@radix-ui/react-dialog": "^1",