@adonis-agora/authkit-react 0.12.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.
Files changed (82) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +146 -0
  3. package/build/index.d.ts +68 -0
  4. package/build/index.js +36 -0
  5. package/build/src/authkit_provider.d.ts +13 -0
  6. package/build/src/authkit_provider.js +11 -0
  7. package/build/src/client/client.d.ts +172 -0
  8. package/build/src/client/client.js +218 -0
  9. package/build/src/client/context.d.ts +11 -0
  10. package/build/src/client/context.js +28 -0
  11. package/build/src/client/types.d.ts +425 -0
  12. package/build/src/client/types.js +1 -0
  13. package/build/src/components/authenticated.d.ts +11 -0
  14. package/build/src/components/authenticated.js +10 -0
  15. package/build/src/components/authorized_apps.d.ts +10 -0
  16. package/build/src/components/authorized_apps.js +34 -0
  17. package/build/src/components/avatar.d.ts +22 -0
  18. package/build/src/components/avatar.js +15 -0
  19. package/build/src/components/can.d.ts +10 -0
  20. package/build/src/components/can.js +19 -0
  21. package/build/src/components/key_rotation.d.ts +8 -0
  22. package/build/src/components/key_rotation.js +36 -0
  23. package/build/src/components/organization_profile.d.ts +10 -0
  24. package/build/src/components/organization_profile.js +94 -0
  25. package/build/src/components/organization_switcher.d.ts +9 -0
  26. package/build/src/components/organization_switcher.js +65 -0
  27. package/build/src/components/password_strength_meter.d.ts +11 -0
  28. package/build/src/components/password_strength_meter.js +39 -0
  29. package/build/src/components/sign_in_button.d.ts +297 -0
  30. package/build/src/components/sign_in_button.js +16 -0
  31. package/build/src/components/sign_out_button.d.ts +296 -0
  32. package/build/src/components/sign_out_button.js +16 -0
  33. package/build/src/components/user_button.d.ts +8 -0
  34. package/build/src/components/user_button.js +31 -0
  35. package/build/src/components/user_profile.d.ts +8 -0
  36. package/build/src/components/user_profile.js +35 -0
  37. package/build/src/config.d.ts +30 -0
  38. package/build/src/config.js +42 -0
  39. package/build/src/hooks/use_authorized_apps.d.ts +16 -0
  40. package/build/src/hooks/use_authorized_apps.js +15 -0
  41. package/build/src/hooks/use_org_invitations.d.ts +19 -0
  42. package/build/src/hooks/use_org_invitations.js +20 -0
  43. package/build/src/hooks/use_organization.d.ts +23 -0
  44. package/build/src/hooks/use_organization.js +8 -0
  45. package/build/src/hooks/use_organizations.d.ts +18 -0
  46. package/build/src/hooks/use_organizations.js +14 -0
  47. package/build/src/hooks/use_passkey_autofill.d.ts +8 -0
  48. package/build/src/hooks/use_passkey_autofill.js +76 -0
  49. package/build/src/hooks/use_password_strength.d.ts +11 -0
  50. package/build/src/hooks/use_password_strength.js +34 -0
  51. package/build/src/hooks/use_profile.d.ts +13 -0
  52. package/build/src/hooks/use_profile.js +28 -0
  53. package/build/src/hooks/use_resource.d.ts +11 -0
  54. package/build/src/hooks/use_resource.js +48 -0
  55. package/build/src/hooks/use_sessions.d.ts +16 -0
  56. package/build/src/hooks/use_sessions.js +15 -0
  57. package/build/src/hooks/use_sign_in.d.ts +6 -0
  58. package/build/src/hooks/use_sign_in.js +13 -0
  59. package/build/src/hooks/use_sign_out.d.ts +6 -0
  60. package/build/src/hooks/use_sign_out.js +11 -0
  61. package/build/src/hooks/use_switch_organization.d.ts +7 -0
  62. package/build/src/hooks/use_switch_organization.js +42 -0
  63. package/build/src/hooks/use_user.d.ts +6 -0
  64. package/build/src/hooks/use_user.js +5 -0
  65. package/build/src/provider.d.ts +16 -0
  66. package/build/src/provider.js +5 -0
  67. package/build/src/queries/account/index.d.ts +86 -0
  68. package/build/src/queries/account/index.js +150 -0
  69. package/build/src/queries/admin/index.d.ts +226 -0
  70. package/build/src/queries/admin/index.js +287 -0
  71. package/build/src/queries/keys.d.ts +50 -0
  72. package/build/src/queries/keys.js +34 -0
  73. package/build/src/roles.d.ts +7 -0
  74. package/build/src/roles.js +39 -0
  75. package/build/src/types.d.ts +27 -0
  76. package/build/src/types.js +1 -0
  77. package/build/src/use_auth.d.ts +2 -0
  78. package/build/src/use_auth.js +33 -0
  79. package/build/src/utils.d.ts +2 -0
  80. package/build/src/utils.js +18 -0
  81. package/package.json +68 -0
  82. package/styles.css +303 -0
@@ -0,0 +1,42 @@
1
+ import { useCallback, useState } from 'react';
2
+ import { useAuthkitConfig } from '../config.js';
3
+ import { jsonRequest } from './use_resource.js';
4
+ export function useSwitchOrganization() {
5
+ const config = useAuthkitConfig();
6
+ const base = config.endpoints.orgs.replace('/json', '');
7
+ const [loading, setLoading] = useState(false);
8
+ const [error, setError] = useState(null);
9
+ const activate = useCallback(async (orgId) => {
10
+ setLoading(true);
11
+ setError(null);
12
+ try {
13
+ await jsonRequest(`${base}/${encodeURIComponent(orgId)}/activate`, {
14
+ method: 'POST',
15
+ csrfToken: config.csrfToken,
16
+ });
17
+ }
18
+ catch (err) {
19
+ setError(err);
20
+ }
21
+ finally {
22
+ setLoading(false);
23
+ }
24
+ }, [base, config.csrfToken]);
25
+ const deactivate = useCallback(async () => {
26
+ setLoading(true);
27
+ setError(null);
28
+ try {
29
+ await jsonRequest(`${base}/deactivate`, {
30
+ method: 'POST',
31
+ csrfToken: config.csrfToken,
32
+ });
33
+ }
34
+ catch (err) {
35
+ setError(err);
36
+ }
37
+ finally {
38
+ setLoading(false);
39
+ }
40
+ }, [base, config.csrfToken]);
41
+ return { loading, error, activate, deactivate };
42
+ }
@@ -0,0 +1,6 @@
1
+ import type { AuthUser } from '../types.js';
2
+ export interface UseUserResult {
3
+ user: AuthUser | null;
4
+ isAuthenticated: boolean;
5
+ }
6
+ export declare function useUser(): UseUserResult;
@@ -0,0 +1,5 @@
1
+ import { useAuth } from '../use_auth.js';
2
+ export function useUser() {
3
+ const { user, isAuthenticated } = useAuth();
4
+ return { user, isAuthenticated };
5
+ }
@@ -0,0 +1,16 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { AuthSharedProps } from './types.js';
3
+ export declare const AuthContext: import("react").Context<{
4
+ user: import("./types.js").AuthUser | null;
5
+ globalRoles: string[];
6
+ appRoles?: string[];
7
+ } | undefined>;
8
+ export interface AuthProviderProps {
9
+ value: AuthSharedProps['authkit'];
10
+ children: ReactNode;
11
+ }
12
+ export declare function AuthProvider({ value, children }: AuthProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<{
13
+ user: import("./types.js").AuthUser | null;
14
+ globalRoles: string[];
15
+ appRoles?: string[];
16
+ } | undefined>>;
@@ -0,0 +1,5 @@
1
+ import { createContext, createElement } from 'react';
2
+ export const AuthContext = createContext(undefined);
3
+ export function AuthProvider({ value, children }) {
4
+ return createElement(AuthContext.Provider, { value }, children);
5
+ }
@@ -0,0 +1,86 @@
1
+ import type { AccountMe, AccountSecurityOverview, UpdateProfileInput, UpdateProfileResult, ChangePasswordInput, RequestEmailChangeInput, OkResult, EmailChangeResult, AccountSessionsResult, RevokeSessionResult, RevokeOthersResult, RevokeAllResult, AccountAppsResult, RevokeAppResult, AccountMfaStatus, AccountPasskeysResult, RemovePasskeyResult, AccountTokensResult, CreatedPatResult, RevokeTokenResult, CreateTokenInput, AccountOrgsResult, AccountOrgDetail, AccountOrgInvitationsResult } from '../../client/types.js';
2
+ export declare function useMeQueryOptions(): {
3
+ queryKey: readonly ["authkit", "account", "me"];
4
+ queryFn: () => Promise<AccountMe>;
5
+ };
6
+ export declare function useSecurityQueryOptions(): {
7
+ queryKey: readonly ["authkit", "account", "security"];
8
+ queryFn: () => Promise<AccountSecurityOverview>;
9
+ };
10
+ export declare function useUpdateProfileMutationOptions(): {
11
+ mutationKey: string[];
12
+ mutationFn: (data: UpdateProfileInput) => Promise<UpdateProfileResult>;
13
+ };
14
+ export declare function useChangePasswordMutationOptions(): {
15
+ mutationKey: string[];
16
+ mutationFn: (data: ChangePasswordInput) => Promise<OkResult>;
17
+ };
18
+ export declare function useEmailChangeMutationOptions(): {
19
+ mutationKey: string[];
20
+ mutationFn: (data: RequestEmailChangeInput) => Promise<EmailChangeResult>;
21
+ };
22
+ export declare function useCancelEmailChangeMutationOptions(): {
23
+ mutationKey: string[];
24
+ mutationFn: () => Promise<OkResult>;
25
+ };
26
+ export declare function useAccountSessionsQueryOptions(): {
27
+ queryKey: readonly ["authkit", "account", "sessions"];
28
+ queryFn: () => Promise<AccountSessionsResult>;
29
+ };
30
+ export declare function useRevokeSessionMutationOptions(): {
31
+ mutationKey: string[];
32
+ mutationFn: (id: string) => Promise<RevokeSessionResult>;
33
+ };
34
+ export declare function useRevokeOtherSessionsMutationOptions(): {
35
+ mutationKey: string[];
36
+ mutationFn: () => Promise<RevokeOthersResult>;
37
+ };
38
+ export declare function useAccountRevokeAllSessionsMutationOptions(): {
39
+ mutationKey: string[];
40
+ mutationFn: () => Promise<RevokeAllResult>;
41
+ };
42
+ export declare function useAppsQueryOptions(): {
43
+ queryKey: readonly ["authkit", "account", "apps"];
44
+ queryFn: () => Promise<AccountAppsResult>;
45
+ };
46
+ export declare function useRevokeAppMutationOptions(): {
47
+ mutationKey: string[];
48
+ mutationFn: (clientId: string) => Promise<RevokeAppResult>;
49
+ };
50
+ export declare function useMfaQueryOptions(): {
51
+ queryKey: readonly ["authkit", "account", "mfa"];
52
+ queryFn: () => Promise<AccountMfaStatus>;
53
+ };
54
+ export declare function usePasskeysQueryOptions(): {
55
+ queryKey: readonly ["authkit", "account", "passkeys"];
56
+ queryFn: () => Promise<AccountPasskeysResult>;
57
+ };
58
+ export declare function useRemovePasskeyMutationOptions(): {
59
+ mutationKey: string[];
60
+ mutationFn: (id: string) => Promise<RemovePasskeyResult>;
61
+ };
62
+ export declare function useTokensQueryOptions(): {
63
+ queryKey: readonly ["authkit", "account", "tokens"];
64
+ queryFn: () => Promise<AccountTokensResult>;
65
+ };
66
+ export declare function useCreateTokenMutationOptions(): {
67
+ mutationKey: string[];
68
+ mutationFn: (data?: CreateTokenInput) => Promise<CreatedPatResult>;
69
+ };
70
+ export declare function useRevokeTokenMutationOptions(): {
71
+ mutationKey: string[];
72
+ mutationFn: (id: string) => Promise<RevokeTokenResult>;
73
+ };
74
+ export declare function useAccountOrgsQueryOptions(): {
75
+ queryKey: readonly ["authkit", "account", "orgs"];
76
+ queryFn: () => Promise<AccountOrgsResult>;
77
+ };
78
+ export declare function useAccountOrgQueryOptions(id: string): {
79
+ queryKey: readonly ["authkit", "account", "orgs", string];
80
+ queryFn: () => Promise<AccountOrgDetail>;
81
+ enabled: boolean;
82
+ };
83
+ export declare function useAccountOrgInvitationsQueryOptions(): {
84
+ queryKey: readonly ["authkit", "account", "orgs", "invitations"];
85
+ queryFn: () => Promise<AccountOrgInvitationsResult>;
86
+ };
@@ -0,0 +1,150 @@
1
+ import { useAuthkitClient } from '../../client/context.js';
2
+ import { authkitKeys } from '../keys.js';
3
+ export function useMeQueryOptions() {
4
+ const client = useAuthkitClient();
5
+ return {
6
+ queryKey: authkitKeys.account.me(),
7
+ queryFn: () => client.account.me(),
8
+ };
9
+ }
10
+ export function useSecurityQueryOptions() {
11
+ const client = useAuthkitClient();
12
+ return {
13
+ queryKey: authkitKeys.account.security(),
14
+ queryFn: () => client.account.security(),
15
+ };
16
+ }
17
+ export function useUpdateProfileMutationOptions() {
18
+ const client = useAuthkitClient();
19
+ return {
20
+ mutationKey: ['authkit', 'account', 'profile', 'update'],
21
+ mutationFn: (data) => client.account.updateProfile(data),
22
+ };
23
+ }
24
+ export function useChangePasswordMutationOptions() {
25
+ const client = useAuthkitClient();
26
+ return {
27
+ mutationKey: ['authkit', 'account', 'password', 'change'],
28
+ mutationFn: (data) => client.account.changePassword(data),
29
+ };
30
+ }
31
+ export function useEmailChangeMutationOptions() {
32
+ const client = useAuthkitClient();
33
+ return {
34
+ mutationKey: ['authkit', 'account', 'email-change'],
35
+ mutationFn: (data) => client.account.emailChange(data),
36
+ };
37
+ }
38
+ export function useCancelEmailChangeMutationOptions() {
39
+ const client = useAuthkitClient();
40
+ return {
41
+ mutationKey: ['authkit', 'account', 'email-change', 'cancel'],
42
+ mutationFn: () => client.account.cancelEmailChange(),
43
+ };
44
+ }
45
+ export function useAccountSessionsQueryOptions() {
46
+ const client = useAuthkitClient();
47
+ return {
48
+ queryKey: authkitKeys.account.sessions(),
49
+ queryFn: () => client.account.sessions.list(),
50
+ };
51
+ }
52
+ export function useRevokeSessionMutationOptions() {
53
+ const client = useAuthkitClient();
54
+ return {
55
+ mutationKey: ['authkit', 'account', 'sessions', 'revoke'],
56
+ mutationFn: (id) => client.account.sessions.revoke(id),
57
+ };
58
+ }
59
+ export function useRevokeOtherSessionsMutationOptions() {
60
+ const client = useAuthkitClient();
61
+ return {
62
+ mutationKey: ['authkit', 'account', 'sessions', 'revoke-others'],
63
+ mutationFn: () => client.account.sessions.revokeOthers(),
64
+ };
65
+ }
66
+ export function useAccountRevokeAllSessionsMutationOptions() {
67
+ const client = useAuthkitClient();
68
+ return {
69
+ mutationKey: ['authkit', 'account', 'sessions', 'revoke-all'],
70
+ mutationFn: () => client.account.sessions.revokeAll(),
71
+ };
72
+ }
73
+ export function useAppsQueryOptions() {
74
+ const client = useAuthkitClient();
75
+ return {
76
+ queryKey: authkitKeys.account.apps(),
77
+ queryFn: () => client.account.apps.list(),
78
+ };
79
+ }
80
+ export function useRevokeAppMutationOptions() {
81
+ const client = useAuthkitClient();
82
+ return {
83
+ mutationKey: ['authkit', 'account', 'apps', 'revoke'],
84
+ mutationFn: (clientId) => client.account.apps.revoke(clientId),
85
+ };
86
+ }
87
+ export function useMfaQueryOptions() {
88
+ const client = useAuthkitClient();
89
+ return {
90
+ queryKey: authkitKeys.account.mfa(),
91
+ queryFn: () => client.account.mfa(),
92
+ };
93
+ }
94
+ export function usePasskeysQueryOptions() {
95
+ const client = useAuthkitClient();
96
+ return {
97
+ queryKey: authkitKeys.account.passkeys(),
98
+ queryFn: () => client.account.passkeys.list(),
99
+ };
100
+ }
101
+ export function useRemovePasskeyMutationOptions() {
102
+ const client = useAuthkitClient();
103
+ return {
104
+ mutationKey: ['authkit', 'account', 'passkeys', 'remove'],
105
+ mutationFn: (id) => client.account.passkeys.remove(id),
106
+ };
107
+ }
108
+ export function useTokensQueryOptions() {
109
+ const client = useAuthkitClient();
110
+ return {
111
+ queryKey: authkitKeys.account.tokens(),
112
+ queryFn: () => client.account.tokens.list(),
113
+ };
114
+ }
115
+ export function useCreateTokenMutationOptions() {
116
+ const client = useAuthkitClient();
117
+ return {
118
+ mutationKey: ['authkit', 'account', 'tokens', 'create'],
119
+ mutationFn: (data) => client.account.tokens.create(data),
120
+ };
121
+ }
122
+ export function useRevokeTokenMutationOptions() {
123
+ const client = useAuthkitClient();
124
+ return {
125
+ mutationKey: ['authkit', 'account', 'tokens', 'revoke'],
126
+ mutationFn: (id) => client.account.tokens.remove(id),
127
+ };
128
+ }
129
+ export function useAccountOrgsQueryOptions() {
130
+ const client = useAuthkitClient();
131
+ return {
132
+ queryKey: authkitKeys.account.orgs(),
133
+ queryFn: () => client.account.orgs.list(),
134
+ };
135
+ }
136
+ export function useAccountOrgQueryOptions(id) {
137
+ const client = useAuthkitClient();
138
+ return {
139
+ queryKey: authkitKeys.account.org(id),
140
+ queryFn: () => client.account.orgs.get(id),
141
+ enabled: !!id,
142
+ };
143
+ }
144
+ export function useAccountOrgInvitationsQueryOptions() {
145
+ const client = useAuthkitClient();
146
+ return {
147
+ queryKey: authkitKeys.account.orgInvitations(),
148
+ queryFn: () => client.account.orgs.invitations(),
149
+ };
150
+ }
@@ -0,0 +1,226 @@
1
+ import type { AdminOverview, AdminUser, AdminUserListResult, CreateUserInput, UpdateUserInput, UserSessionsResult, RevokeSessionsResult, AdminClientListResult, AdminClient, CreatedClientResult, RegenerateSecretResult, CreateClientInput, UpdateClientInput, RoleListResult, RoleCatalogEntry, CreateRoleInput, UpdateRoleInput, AdminOrgListResult, AdminOrgDetail, AdminOrgInvitation, AuditListResult, AuditListParams, SettingListResult, SettingEntry, ImpersonationPanel, AdminOrgEntry, CreateOrgInput, UpdateOrgInput, KeysStatus, KeysRotateInput, KeysRotateResult } from '../../client/types.js';
2
+ export declare function useOverviewQueryOptions(): {
3
+ queryKey: readonly ["authkit", "admin", "overview"];
4
+ queryFn: () => Promise<AdminOverview>;
5
+ };
6
+ export declare function useUsersQueryOptions(params?: {
7
+ search?: string;
8
+ page?: number;
9
+ limit?: number;
10
+ }): {
11
+ queryKey: readonly ["authkit", "admin", "users", {
12
+ search?: string;
13
+ page?: number;
14
+ limit?: number;
15
+ }];
16
+ queryFn: () => Promise<AdminUserListResult>;
17
+ };
18
+ export declare function useUserQueryOptions(id: string): {
19
+ queryKey: readonly ["authkit", "admin", "users", string];
20
+ queryFn: () => Promise<AdminUser>;
21
+ enabled: boolean;
22
+ };
23
+ export declare function useUserSessionsQueryOptions(id: string): {
24
+ queryKey: readonly ["authkit", "admin", "users", string, "sessions"];
25
+ queryFn: () => Promise<UserSessionsResult>;
26
+ enabled: boolean;
27
+ };
28
+ export declare function useCreateUserMutationOptions(): {
29
+ mutationKey: string[];
30
+ mutationFn: (data: CreateUserInput) => Promise<AdminUser & {
31
+ invited?: boolean;
32
+ }>;
33
+ };
34
+ export declare function useUpdateUserMutationOptions(id: string): {
35
+ mutationKey: string[];
36
+ mutationFn: (data: UpdateUserInput) => Promise<AdminUser>;
37
+ };
38
+ export declare function useDisableUserMutationOptions(id: string): {
39
+ mutationKey: string[];
40
+ mutationFn: () => Promise<{
41
+ id: string;
42
+ disabled: true;
43
+ }>;
44
+ };
45
+ export declare function useEnableUserMutationOptions(id: string): {
46
+ mutationKey: string[];
47
+ mutationFn: () => Promise<{
48
+ id: string;
49
+ disabled: false;
50
+ }>;
51
+ };
52
+ export declare function useResetPasswordMutationOptions(id: string): {
53
+ mutationKey: string[];
54
+ mutationFn: () => Promise<{
55
+ id: string;
56
+ sent: boolean;
57
+ }>;
58
+ };
59
+ export declare function useDeleteUserMutationOptions(id: string): {
60
+ mutationKey: string[];
61
+ mutationFn: () => Promise<{
62
+ id: string;
63
+ deleted: boolean;
64
+ }>;
65
+ };
66
+ export declare function useRevokeUserSessionsMutationOptions(id: string): {
67
+ mutationKey: string[];
68
+ mutationFn: () => Promise<RevokeSessionsResult>;
69
+ };
70
+ export declare function useSessionsQueryOptions(accountId?: string): {
71
+ queryKey: readonly ["authkit", "admin", "sessions", string | null];
72
+ queryFn: () => Promise<UserSessionsResult>;
73
+ };
74
+ export declare function useRevokeAllSessionsMutationOptions(accountId?: string): {
75
+ mutationKey: (string | null)[];
76
+ mutationFn: () => Promise<RevokeSessionsResult>;
77
+ };
78
+ export declare function useClientsQueryOptions(): {
79
+ queryKey: readonly ["authkit", "admin", "clients"];
80
+ queryFn: () => Promise<AdminClientListResult>;
81
+ };
82
+ export declare function useClientQueryOptions(id: string): {
83
+ queryKey: readonly ["authkit", "admin", "clients", string];
84
+ queryFn: () => Promise<AdminClient>;
85
+ enabled: boolean;
86
+ };
87
+ export declare function useCreateClientMutationOptions(): {
88
+ mutationKey: string[];
89
+ mutationFn: (data?: CreateClientInput) => Promise<CreatedClientResult>;
90
+ };
91
+ export declare function useUpdateClientMutationOptions(id: string): {
92
+ mutationKey: string[];
93
+ mutationFn: (data?: UpdateClientInput) => Promise<AdminClient>;
94
+ };
95
+ export declare function useDeleteClientMutationOptions(id: string): {
96
+ mutationKey: string[];
97
+ mutationFn: () => Promise<{
98
+ clientId: string;
99
+ deleted: boolean;
100
+ }>;
101
+ };
102
+ export declare function useRegenerateClientSecretMutationOptions(id: string): {
103
+ mutationKey: string[];
104
+ mutationFn: () => Promise<RegenerateSecretResult>;
105
+ };
106
+ export declare function useRolesQueryOptions(): {
107
+ queryKey: readonly ["authkit", "admin", "roles"];
108
+ queryFn: () => Promise<RoleListResult>;
109
+ };
110
+ export declare function useCreateRoleMutationOptions(): {
111
+ mutationKey: string[];
112
+ mutationFn: (data: CreateRoleInput) => Promise<RoleCatalogEntry>;
113
+ };
114
+ export declare function useUpdateRoleMutationOptions(name: string): {
115
+ mutationKey: string[];
116
+ mutationFn: (data: UpdateRoleInput) => Promise<RoleCatalogEntry>;
117
+ };
118
+ export declare function useDeleteRoleMutationOptions(name: string): {
119
+ mutationKey: string[];
120
+ mutationFn: () => Promise<{
121
+ ok: boolean;
122
+ deleted: string;
123
+ }>;
124
+ };
125
+ export declare function useOrgsQueryOptions(): {
126
+ queryKey: readonly ["authkit", "admin", "orgs"];
127
+ queryFn: () => Promise<AdminOrgListResult>;
128
+ };
129
+ export declare function useOrgQueryOptions(id: string): {
130
+ queryKey: readonly ["authkit", "admin", "orgs", string];
131
+ queryFn: () => Promise<AdminOrgDetail>;
132
+ enabled: boolean;
133
+ };
134
+ export declare function useCreateOrgMutationOptions(): {
135
+ mutationKey: string[];
136
+ mutationFn: (data: CreateOrgInput) => Promise<AdminOrgEntry>;
137
+ };
138
+ export declare function useUpdateOrgMutationOptions(id: string): {
139
+ mutationKey: string[];
140
+ mutationFn: (data: UpdateOrgInput) => Promise<AdminOrgEntry>;
141
+ };
142
+ export declare function useDeleteOrgMutationOptions(id: string): {
143
+ mutationKey: string[];
144
+ mutationFn: () => Promise<{
145
+ id: string;
146
+ deleted: boolean;
147
+ }>;
148
+ };
149
+ export declare function useAddOrgMemberMutationOptions(orgId: string): {
150
+ mutationKey: string[];
151
+ mutationFn: (data: {
152
+ accountId: string;
153
+ role: string;
154
+ }) => Promise<{
155
+ ok: boolean;
156
+ }>;
157
+ };
158
+ export declare function useRemoveOrgMemberMutationOptions(orgId: string, accountId: string): {
159
+ mutationKey: string[];
160
+ mutationFn: () => Promise<{
161
+ ok: boolean;
162
+ }>;
163
+ };
164
+ export declare function useUpdateOrgMemberRoleMutationOptions(orgId: string, accountId: string): {
165
+ mutationKey: string[];
166
+ mutationFn: (role: string) => Promise<{
167
+ ok: boolean;
168
+ }>;
169
+ };
170
+ export declare function useCreateOrgInvitationMutationOptions(orgId: string): {
171
+ mutationKey: string[];
172
+ mutationFn: (data: {
173
+ email: string;
174
+ role: string;
175
+ }) => Promise<{
176
+ ok: boolean;
177
+ invitation: AdminOrgInvitation;
178
+ }>;
179
+ };
180
+ export declare function useRevokeOrgInvitationMutationOptions(orgId: string, invitationId: string): {
181
+ mutationKey: string[];
182
+ mutationFn: () => Promise<{
183
+ ok: boolean;
184
+ }>;
185
+ };
186
+ export declare function useAuditQueryOptions(params?: AuditListParams): {
187
+ queryKey: readonly ["authkit", "admin", "audit", {
188
+ type?: string;
189
+ page?: number;
190
+ limit?: number;
191
+ subject?: string;
192
+ }];
193
+ queryFn: () => Promise<AuditListResult>;
194
+ };
195
+ export declare function useSettingsQueryOptions(orgId?: string | null): {
196
+ queryKey: readonly ["authkit", "admin", "settings", string] | readonly ["authkit", "admin", "settings"];
197
+ queryFn: () => Promise<SettingListResult>;
198
+ };
199
+ export declare function useSetSettingMutationOptions(orgId?: string | null): {
200
+ mutationKey: (string | null)[];
201
+ mutationFn: ({ key, value }: {
202
+ key: string;
203
+ value: unknown;
204
+ }) => Promise<SettingEntry>;
205
+ };
206
+ export declare function useRemoveSettingMutationOptions(orgId?: string | null): {
207
+ mutationKey: (string | null)[];
208
+ mutationFn: (key: string) => Promise<{
209
+ key: string;
210
+ organizationId: string | null;
211
+ deleted: boolean;
212
+ }>;
213
+ };
214
+ export declare function useImpersonationQueryOptions(userId: string): {
215
+ queryKey: readonly ["authkit", "admin", "impersonation", string];
216
+ queryFn: () => Promise<ImpersonationPanel>;
217
+ enabled: boolean;
218
+ };
219
+ export declare function useKeysQueryOptions(): {
220
+ queryKey: readonly ["authkit", "admin", "keys"];
221
+ queryFn: () => Promise<KeysStatus>;
222
+ };
223
+ export declare function useRotateKeysMutationOptions(): {
224
+ mutationKey: string[];
225
+ mutationFn: (input?: KeysRotateInput) => Promise<KeysRotateResult>;
226
+ };