@better-auth-ui/core 1.6.8 → 1.6.10
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/config/auth-config.d.ts +1 -1
- package/dist/create-auth-plugin-CnH7jMHA.js +199 -0
- package/dist/index.js +103 -11
- package/dist/lib/auth-mutation-keys.d.ts +9 -20
- package/dist/lib/auth-plugin.d.ts +5 -6
- package/dist/lib/auth-query-keys.d.ts +6 -6
- package/dist/lib/create-auth-plugin.d.ts +5 -21
- package/dist/lib/localization.d.ts +2 -2
- package/dist/lib/view-paths.d.ts +0 -4
- package/dist/plugins/api-key/api-key-mutation-keys.d.ts +4 -2
- package/dist/plugins/api-key/api-key-plugin.d.ts +23 -2
- package/dist/plugins/api-key/api-key-query-keys.d.ts +6 -0
- package/dist/plugins/delete-user/delete-user-localization.d.ts +3 -3
- package/dist/plugins/delete-user/delete-user-mutation-keys.d.ts +7 -0
- package/dist/plugins/delete-user/delete-user-plugin.d.ts +4 -4
- package/dist/plugins/magic-link/magic-link-plugin.d.ts +2 -2
- package/dist/plugins/multi-session/multi-session-mutation-keys.d.ts +11 -0
- package/dist/plugins/multi-session/multi-session-plugin.d.ts +2 -2
- package/dist/plugins/multi-session/multi-session-query-keys.d.ts +6 -0
- package/dist/plugins/organization/organization-localization.d.ts +115 -0
- package/dist/plugins/organization/organization-mutation-keys.d.ts +40 -0
- package/dist/plugins/organization/organization-plugin.d.ts +152 -0
- package/dist/plugins/organization/organization-query-keys.d.ts +40 -0
- package/dist/plugins/organization/organization-view-paths.d.ts +19 -0
- package/dist/plugins/passkey/passkey-plugin.d.ts +2 -2
- package/dist/plugins/passkey/passkey-query-keys.d.ts +6 -0
- package/dist/plugins/theme/theme-plugin.d.ts +2 -2
- package/dist/plugins/username/username-mutation-keys.d.ts +17 -0
- package/dist/plugins/username/username-plugin.d.ts +3 -3
- package/dist/plugins.d.ts +28 -0
- package/dist/plugins.js +360 -18
- package/package.json +7 -6
- package/src/config/auth-config.ts +1 -1
- package/src/lib/auth-mutation-keys.ts +11 -24
- package/src/lib/auth-plugin.ts +4 -5
- package/src/lib/auth-query-keys.ts +6 -23
- package/src/lib/create-auth-plugin.ts +9 -26
- package/src/lib/localization.ts +4 -4
- package/src/lib/view-paths.ts +0 -4
- package/src/plugins/api-key/api-key-mutation-keys.ts +4 -2
- package/src/plugins/api-key/api-key-plugin.ts +22 -1
- package/src/plugins/api-key/api-key-query-keys.ts +13 -0
- package/src/plugins/delete-user/delete-user-localization.ts +3 -3
- package/src/plugins/delete-user/delete-user-mutation-keys.ts +7 -0
- package/src/plugins/multi-session/multi-session-mutation-keys.ts +11 -0
- package/src/plugins/multi-session/multi-session-query-keys.ts +13 -0
- package/src/plugins/organization/organization-localization.ts +123 -0
- package/src/plugins/organization/organization-mutation-keys.ts +52 -0
- package/src/plugins/organization/organization-plugin.ts +112 -0
- package/src/plugins/organization/organization-query-keys.ts +86 -0
- package/src/plugins/organization/organization-view-paths.ts +20 -0
- package/src/plugins/passkey/passkey-query-keys.ts +13 -0
- package/src/plugins/username/username-mutation-keys.ts +17 -0
- package/src/plugins.ts +28 -0
- package/dist/config/additional-fields-config.js +0 -27
- package/dist/config/auth-config.js +0 -32
- package/dist/lib/auth-mutation-keys.js +0 -57
- package/dist/lib/auth-query-keys.js +0 -39
- package/dist/lib/base-paths.js +0 -8
- package/dist/lib/create-auth-plugin.js +0 -9
- package/dist/lib/localization.js +0 -81
- package/dist/lib/provider-names.js +0 -43
- package/dist/lib/utils.js +0 -48
- package/dist/lib/view-paths.js +0 -16
- package/dist/plugins/api-key/api-key-localization.js +0 -16
- package/dist/plugins/api-key/api-key-mutation-keys.js +0 -15
- package/dist/plugins/api-key/api-key-plugin.js +0 -9
- package/dist/plugins/delete-user/delete-user-localization.js +0 -9
- package/dist/plugins/delete-user/delete-user-plugin.js +0 -12
- package/dist/plugins/index.d.ts +0 -17
- package/dist/plugins/magic-link/magic-link-localization.js +0 -8
- package/dist/plugins/magic-link/magic-link-mutation-keys.js +0 -8
- package/dist/plugins/magic-link/magic-link-plugin.js +0 -12
- package/dist/plugins/multi-session/multi-session-localization.js +0 -9
- package/dist/plugins/multi-session/multi-session-plugin.js +0 -9
- package/dist/plugins/passkey/passkey-localization.js +0 -14
- package/dist/plugins/passkey/passkey-mutation-keys.js +0 -20
- package/dist/plugins/passkey/passkey-plugin.js +0 -9
- package/dist/plugins/theme/theme-localization.js +0 -10
- package/dist/plugins/theme/theme-plugin.js +0 -18
- package/dist/plugins/username/username-localization.js +0 -12
- package/dist/plugins/username/username-plugin.js +0 -33
- package/src/plugins/index.ts +0 -17
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Query key factory for multi-session queries, scoped per user. */
|
|
2
|
+
export declare const multiSessionQueryKeys: {
|
|
3
|
+
readonly all: (userId: string | undefined) => readonly ["auth", "user", string | undefined, "multiSession"];
|
|
4
|
+
readonly lists: (userId: string | undefined) => readonly ["auth", "user", string | undefined, "multiSession", "list"];
|
|
5
|
+
readonly list: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "multiSession", "list", NonNullable<TQuery> | null];
|
|
6
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
export declare const organizationLocalization: {
|
|
2
|
+
/** @remarks `"Accept"` */
|
|
3
|
+
accept: string;
|
|
4
|
+
/** @remarks `"Accepted"` */
|
|
5
|
+
accepted: string;
|
|
6
|
+
/** @remarks `"Actions"` */
|
|
7
|
+
actions: string;
|
|
8
|
+
/** @remarks `"Admin"` */
|
|
9
|
+
admin: string;
|
|
10
|
+
/** @remarks `"All"` */
|
|
11
|
+
all: string;
|
|
12
|
+
/** @remarks `"Canceled"` */
|
|
13
|
+
canceled: string;
|
|
14
|
+
/** @remarks `"Cancel invitation"` */
|
|
15
|
+
cancelInvitation: string;
|
|
16
|
+
/** @remarks `"Change logo"` */
|
|
17
|
+
changeLogo: string;
|
|
18
|
+
/** @remarks `"Change role"` */
|
|
19
|
+
changeMemberRole: string;
|
|
20
|
+
/** @remarks `"Clear"` */
|
|
21
|
+
clear: string;
|
|
22
|
+
/** @remarks `"Create organization"` */
|
|
23
|
+
createOrganization: string;
|
|
24
|
+
/** @remarks `"Delete logo"` */
|
|
25
|
+
deleteLogo: string;
|
|
26
|
+
/** @remarks `"Delete organization"` */
|
|
27
|
+
deleteOrganization: string;
|
|
28
|
+
/** @remarks `"Permanently delete this organization and all of its data. All members will lose access and this cannot be undone."` */
|
|
29
|
+
deleteOrganizationDescription: string;
|
|
30
|
+
/** @remarks `"Invitations"` */
|
|
31
|
+
invitations: string;
|
|
32
|
+
/** @remarks `"Invited at"` */
|
|
33
|
+
invitedAt: string;
|
|
34
|
+
/** @remarks `"Invite member"` */
|
|
35
|
+
inviteMember: string;
|
|
36
|
+
/** @remarks `"Member invited successfully"` */
|
|
37
|
+
inviteMemberSuccess: string;
|
|
38
|
+
/** @remarks `"We'll email them a link to join this organization. Choose the role they'll have once they accept."` */
|
|
39
|
+
inviteMemberDescription: string;
|
|
40
|
+
/** @remarks `"You left the organization"` */
|
|
41
|
+
leftOrganization: string;
|
|
42
|
+
/** @remarks `"Leave organization"` */
|
|
43
|
+
leaveOrganization: string;
|
|
44
|
+
/** @remarks `"Leave this organization and lose access to its data and resources. You'll need a new invitation to rejoin."` */
|
|
45
|
+
leaveOrganizationDescription: string;
|
|
46
|
+
/** @remarks `"Logo"` */
|
|
47
|
+
logo: string;
|
|
48
|
+
/** @remarks `"Logo updated successfully"` */
|
|
49
|
+
logoChangedSuccess: string;
|
|
50
|
+
/** @remarks `"Logo removed successfully"` */
|
|
51
|
+
logoDeletedSuccess: string;
|
|
52
|
+
/** @remarks `"Manage"` */
|
|
53
|
+
manage: string;
|
|
54
|
+
/** @remarks `"Member"` */
|
|
55
|
+
member: string;
|
|
56
|
+
/** @remarks `"Member removed"` */
|
|
57
|
+
memberRemoved: string;
|
|
58
|
+
/** @remarks `"Member role updated"` */
|
|
59
|
+
memberRoleUpdated: string;
|
|
60
|
+
/** @remarks `"Members"` */
|
|
61
|
+
members: string;
|
|
62
|
+
/** @remarks `"People"` */
|
|
63
|
+
people: string;
|
|
64
|
+
/** @remarks `"Name"` */
|
|
65
|
+
name: string;
|
|
66
|
+
/** @remarks `"Enter the organization name"` */
|
|
67
|
+
namePlaceholder: string;
|
|
68
|
+
/** @remarks `"No invitations"` */
|
|
69
|
+
noInvitations: string;
|
|
70
|
+
/** @remarks `"No organizations"` */
|
|
71
|
+
noOrganizations: string;
|
|
72
|
+
/** @remarks `"Organization"` */
|
|
73
|
+
organization: string;
|
|
74
|
+
/** @remarks `"Organization deleted"` */
|
|
75
|
+
organizationDeleted: string;
|
|
76
|
+
/** @remarks `"Invite a teammate to collaborate in this organization."` */
|
|
77
|
+
organizationInvitationsEmptyDescription: string;
|
|
78
|
+
/** @remarks `"Organizations"` */
|
|
79
|
+
organizations: string;
|
|
80
|
+
/** @remarks `"Create an organization to collaborate with others and manage shared access."` */
|
|
81
|
+
organizationsDescription: string;
|
|
82
|
+
/** @remarks `"Organization profile"` */
|
|
83
|
+
organizationProfile: string;
|
|
84
|
+
/** @remarks `"Organization updated successfully"` */
|
|
85
|
+
organizationUpdatedSuccess: string;
|
|
86
|
+
/** @remarks `"Owner"` */
|
|
87
|
+
owner: string;
|
|
88
|
+
/** @remarks `"Pending"` */
|
|
89
|
+
pending: string;
|
|
90
|
+
/** @remarks `"Personal account"` */
|
|
91
|
+
personalAccount: string;
|
|
92
|
+
/** @remarks `"Rejected"` */
|
|
93
|
+
rejected: string;
|
|
94
|
+
/** @remarks `"Reject invitation"` */
|
|
95
|
+
rejectInvitation: string;
|
|
96
|
+
/** @remarks `"Remove member"` */
|
|
97
|
+
removeMember: string;
|
|
98
|
+
/** @remarks `"Are you sure you want to remove this member from the organization? They will lose access immediately."` */
|
|
99
|
+
removeMemberWarning: string;
|
|
100
|
+
/** @remarks `"Role"` */
|
|
101
|
+
role: string;
|
|
102
|
+
/** @remarks `"Search..."` */
|
|
103
|
+
search: string;
|
|
104
|
+
/** @remarks `"Slug"` */
|
|
105
|
+
slug: string;
|
|
106
|
+
/** @remarks `"organization-slug"` */
|
|
107
|
+
slugPlaceholder: string;
|
|
108
|
+
/** @remarks `"Status"` */
|
|
109
|
+
status: string;
|
|
110
|
+
/** @remarks `"Upload logo"` */
|
|
111
|
+
uploadLogo: string;
|
|
112
|
+
/** @remarks `"Invitations to join an organization will show up here."` */
|
|
113
|
+
userInvitationsEmptyDescription: string;
|
|
114
|
+
};
|
|
115
|
+
export type OrganizationLocalization = typeof organizationLocalization;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hierarchical mutation key factory for organization-related mutations.
|
|
3
|
+
*
|
|
4
|
+
* Mutation keys are mostly used for `useIsMutating` and global
|
|
5
|
+
* `MutationCache` observers (e.g. toast handling), so the keys are static
|
|
6
|
+
* tuples rather than parameterised factories. Each grouping exposes an
|
|
7
|
+
* `all` prefix so consumers can match a whole feature at once:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* useIsMutating({ mutationKey: organizationMutationKeys.all })
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare const organizationMutationKeys: {
|
|
14
|
+
/** Root key for every organization mutation. */
|
|
15
|
+
readonly all: readonly ["auth", "organization"];
|
|
16
|
+
/** Key for `organization.create`. */
|
|
17
|
+
readonly create: readonly ["auth", "organization", "create"];
|
|
18
|
+
/** Key for `organization.delete`. */
|
|
19
|
+
readonly delete: readonly ["auth", "organization", "delete"];
|
|
20
|
+
/** Key for `organization.update`. */
|
|
21
|
+
readonly update: readonly ["auth", "organization", "update"];
|
|
22
|
+
/** Key for `organization.setActive`. */
|
|
23
|
+
readonly setActive: readonly ["auth", "organization", "setActive"];
|
|
24
|
+
/** Key for `organization.inviteMember`. */
|
|
25
|
+
readonly inviteMember: readonly ["auth", "organization", "inviteMember"];
|
|
26
|
+
/** Key for `organization.removeMember`. */
|
|
27
|
+
readonly removeMember: readonly ["auth", "organization", "removeMember"];
|
|
28
|
+
/** Key for `organization.leave`. */
|
|
29
|
+
readonly leave: readonly ["auth", "organization", "leave"];
|
|
30
|
+
/** Key for `organization.updateMemberRole`. */
|
|
31
|
+
readonly updateMemberRole: readonly ["auth", "organization", "updateMemberRole"];
|
|
32
|
+
/** Key for `organization.acceptInvitation`. */
|
|
33
|
+
readonly acceptInvitation: readonly ["auth", "organization", "acceptInvitation"];
|
|
34
|
+
/** Key for `organization.cancelInvitation`. */
|
|
35
|
+
readonly cancelInvitation: readonly ["auth", "organization", "cancelInvitation"];
|
|
36
|
+
/** Key for `organization.rejectInvitation` (invitee declines). */
|
|
37
|
+
readonly rejectInvitation: readonly ["auth", "organization", "rejectInvitation"];
|
|
38
|
+
/** Key for `organization.checkSlug`. */
|
|
39
|
+
readonly checkSlug: readonly ["auth", "organization", "checkSlug"];
|
|
40
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { AvatarConfig } from '../../config/avatar-config';
|
|
2
|
+
import { OrganizationLocalization } from './organization-localization';
|
|
3
|
+
import { OrganizationViewPaths } from './organization-view-paths';
|
|
4
|
+
declare module "../../lib/view-paths" {
|
|
5
|
+
/** Widens `SettingsViewPaths` by adding the `"organizations"` path when this plugin is imported. */
|
|
6
|
+
interface SettingsViewPaths {
|
|
7
|
+
/** @default "organizations" */
|
|
8
|
+
organizations?: string;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
declare module "../../lib/auth-plugin" {
|
|
12
|
+
interface AuthPluginViewPaths {
|
|
13
|
+
organization?: Partial<OrganizationViewPaths>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export type OrganizationPluginOptions = {
|
|
17
|
+
/**
|
|
18
|
+
* Whether to call `organization.checkSlug` when entering an organization slug.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
checkSlug?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Override the plugin's default localization strings.
|
|
24
|
+
* @remarks `OrganizationLocalization`
|
|
25
|
+
*/
|
|
26
|
+
localization?: Partial<OrganizationLocalization>;
|
|
27
|
+
/**
|
|
28
|
+
* Override URL segments contributed by this plugin.
|
|
29
|
+
*
|
|
30
|
+
* - `settings.organizations` — segment for the organizations settings view (default `"organizations"`).
|
|
31
|
+
* - `organization.settings` — segment for the `/organization/...` profile and danger zone tab (default `"settings"`).
|
|
32
|
+
* - `organization.people` — segment for the `/organization/...` members and invitations tab (default `"people"`).
|
|
33
|
+
*/
|
|
34
|
+
viewPaths?: {
|
|
35
|
+
settings?: {
|
|
36
|
+
/** @default "organizations" */
|
|
37
|
+
organizations?: string;
|
|
38
|
+
};
|
|
39
|
+
organization?: Partial<OrganizationViewPaths>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Organization logo upload, optimization, and deletion configuration.
|
|
43
|
+
* Same shape as {@link AvatarConfig} used for user avatars (`AuthConfig.avatar`).
|
|
44
|
+
* @remarks `AvatarConfig`
|
|
45
|
+
* @default { enabled: true, resize: resizeAvatar, size: 256, extension: "png" }
|
|
46
|
+
*/
|
|
47
|
+
logo?: Partial<AvatarConfig>;
|
|
48
|
+
/**
|
|
49
|
+
* Map of role keys to display labels. When omitted, defaults to localized
|
|
50
|
+
* labels for `owner`, `admin`, and `member` (from `localization.owner`
|
|
51
|
+
* etc.) plus {@link OrganizationPluginOptions.additionalRoles}. When set,
|
|
52
|
+
* replaces that default map entirely; use {@link OrganizationPluginOptions.additionalRoles}
|
|
53
|
+
* to add more labels on top. Looked up at render time via `roles?.[role]`.
|
|
54
|
+
* @remarks `Record<string, string>`
|
|
55
|
+
*/
|
|
56
|
+
roles?: Record<string, string>;
|
|
57
|
+
/**
|
|
58
|
+
* Extra role labels merged after the effective role map (either
|
|
59
|
+
* {@link OrganizationPluginOptions.roles} when provided, or the localized
|
|
60
|
+
* defaults). Use this for custom server roles without redefining built-in
|
|
61
|
+
* labels.
|
|
62
|
+
* @remarks `Record<string, string>`
|
|
63
|
+
*/
|
|
64
|
+
additionalRoles?: Record<string, string>;
|
|
65
|
+
slug?: string | null;
|
|
66
|
+
};
|
|
67
|
+
export declare const organizationPlugin: ((options?: OrganizationPluginOptions | undefined) => {
|
|
68
|
+
slug: string | null | undefined;
|
|
69
|
+
checkSlug: boolean;
|
|
70
|
+
localization: {
|
|
71
|
+
accept: string;
|
|
72
|
+
accepted: string;
|
|
73
|
+
actions: string;
|
|
74
|
+
admin: string;
|
|
75
|
+
all: string;
|
|
76
|
+
canceled: string;
|
|
77
|
+
cancelInvitation: string;
|
|
78
|
+
changeLogo: string;
|
|
79
|
+
changeMemberRole: string;
|
|
80
|
+
clear: string;
|
|
81
|
+
createOrganization: string;
|
|
82
|
+
deleteLogo: string;
|
|
83
|
+
deleteOrganization: string;
|
|
84
|
+
deleteOrganizationDescription: string;
|
|
85
|
+
invitations: string;
|
|
86
|
+
invitedAt: string;
|
|
87
|
+
inviteMember: string;
|
|
88
|
+
inviteMemberSuccess: string;
|
|
89
|
+
inviteMemberDescription: string;
|
|
90
|
+
leftOrganization: string;
|
|
91
|
+
leaveOrganization: string;
|
|
92
|
+
leaveOrganizationDescription: string;
|
|
93
|
+
logo: string;
|
|
94
|
+
logoChangedSuccess: string;
|
|
95
|
+
logoDeletedSuccess: string;
|
|
96
|
+
manage: string;
|
|
97
|
+
member: string;
|
|
98
|
+
memberRemoved: string;
|
|
99
|
+
memberRoleUpdated: string;
|
|
100
|
+
members: string;
|
|
101
|
+
people: string;
|
|
102
|
+
name: string;
|
|
103
|
+
namePlaceholder: string;
|
|
104
|
+
noInvitations: string;
|
|
105
|
+
noOrganizations: string;
|
|
106
|
+
organization: string;
|
|
107
|
+
organizationDeleted: string;
|
|
108
|
+
organizationInvitationsEmptyDescription: string;
|
|
109
|
+
organizations: string;
|
|
110
|
+
organizationsDescription: string;
|
|
111
|
+
organizationProfile: string;
|
|
112
|
+
organizationUpdatedSuccess: string;
|
|
113
|
+
owner: string;
|
|
114
|
+
pending: string;
|
|
115
|
+
personalAccount: string;
|
|
116
|
+
rejected: string;
|
|
117
|
+
rejectInvitation: string;
|
|
118
|
+
removeMember: string;
|
|
119
|
+
removeMemberWarning: string;
|
|
120
|
+
role: string;
|
|
121
|
+
search: string;
|
|
122
|
+
slug: string;
|
|
123
|
+
slugPlaceholder: string;
|
|
124
|
+
status: string;
|
|
125
|
+
uploadLogo: string;
|
|
126
|
+
userInvitationsEmptyDescription: string;
|
|
127
|
+
};
|
|
128
|
+
logo: {
|
|
129
|
+
delete?: (url: string) => Promise<void>;
|
|
130
|
+
enabled: boolean;
|
|
131
|
+
extension: "png" | "jpg" | "webp" | "inherit";
|
|
132
|
+
resize: (file: File, size?: number, extension?: "png" | "jpg" | "webp" | "inherit") => Promise<File>;
|
|
133
|
+
size: number;
|
|
134
|
+
upload?: (file: File) => Promise<string>;
|
|
135
|
+
};
|
|
136
|
+
roles: {
|
|
137
|
+
[x: string]: string;
|
|
138
|
+
};
|
|
139
|
+
viewPaths: {
|
|
140
|
+
settings: {
|
|
141
|
+
organizations: string;
|
|
142
|
+
};
|
|
143
|
+
organization: {
|
|
144
|
+
settings: string;
|
|
145
|
+
people: string;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
} & {
|
|
149
|
+
id: "organization";
|
|
150
|
+
}) & {
|
|
151
|
+
id: "organization";
|
|
152
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Query key factory for organization queries, scoped per user. */
|
|
2
|
+
export declare const organizationQueryKeys: {
|
|
3
|
+
readonly all: (userId: string | undefined) => readonly ["auth", "user", string | undefined, "organization"];
|
|
4
|
+
readonly lists: (userId: string | undefined) => readonly ["auth", "user", string | undefined, "organization", "list"];
|
|
5
|
+
readonly list: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "organization", "list", NonNullable<TQuery> | null];
|
|
6
|
+
readonly fullDetails: (userId: string | undefined) => readonly ["auth", "user", string | undefined, "organization", "fullDetails"];
|
|
7
|
+
readonly fullDetail: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "organization", "fullDetails", NonNullable<TQuery> | null];
|
|
8
|
+
/**
|
|
9
|
+
* Prefix for every active-organization cache entry (used for invalidation
|
|
10
|
+
* across slug-partitioned variants).
|
|
11
|
+
*/
|
|
12
|
+
readonly activeOrganizations: (userId: string | undefined) => readonly ["auth", "user", string | undefined, "organization", "active"];
|
|
13
|
+
/**
|
|
14
|
+
* Cache entry for the currently active organization. Holds a {@link
|
|
15
|
+
* ListOrganization}-shaped value — distinct from `fullDetail`, which
|
|
16
|
+
* carries members and invitations — so `setActive`'s optimistic update
|
|
17
|
+
* (which can only produce a list-shaped org) doesn't corrupt the full
|
|
18
|
+
* cache.
|
|
19
|
+
*/
|
|
20
|
+
readonly activeOrganization: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "organization", "active", NonNullable<TQuery> | null];
|
|
21
|
+
readonly members: {
|
|
22
|
+
readonly all: (userId: string | undefined) => readonly ["auth", "user", string | undefined, "organization", "members"];
|
|
23
|
+
readonly lists: (userId: string | undefined) => readonly ["auth", "user", string | undefined, "organization", "members", "list"];
|
|
24
|
+
readonly list: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "organization", "members", "list", NonNullable<TQuery> | null];
|
|
25
|
+
};
|
|
26
|
+
readonly invitations: {
|
|
27
|
+
readonly all: (userId: string | undefined) => readonly ["auth", "user", string | undefined, "organization", "invitations"];
|
|
28
|
+
readonly lists: (userId: string | undefined) => readonly ["auth", "user", string | undefined, "organization", "invitations", "list"];
|
|
29
|
+
readonly list: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "organization", "invitations", "list", NonNullable<TQuery> | null];
|
|
30
|
+
};
|
|
31
|
+
readonly userInvitations: {
|
|
32
|
+
readonly all: (userId: string | undefined) => readonly ["auth", "user", string | undefined, "organization", "userInvitations"];
|
|
33
|
+
readonly lists: (userId: string | undefined) => readonly ["auth", "user", string | undefined, "organization", "userInvitations", "list"];
|
|
34
|
+
readonly list: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "organization", "userInvitations", "list", NonNullable<TQuery> | null];
|
|
35
|
+
};
|
|
36
|
+
readonly permissions: {
|
|
37
|
+
readonly all: (userId: string | undefined) => readonly ["auth", "user", string | undefined, "organization", "permissions"];
|
|
38
|
+
readonly has: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "organization", "permissions", "has", NonNullable<TQuery> | null];
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path segments under `/organization/...` contributed by `organizationPlugin`.
|
|
3
|
+
*
|
|
4
|
+
* Read at runtime via `useAuthPlugin(organizationPlugin).viewPaths.organization`.
|
|
5
|
+
*/
|
|
6
|
+
export interface OrganizationViewPaths {
|
|
7
|
+
/**
|
|
8
|
+
* Path segment for organization profile and danger zone
|
|
9
|
+
* @default "settings"
|
|
10
|
+
*/
|
|
11
|
+
settings: string;
|
|
12
|
+
/**
|
|
13
|
+
* Path segment for members and invitations
|
|
14
|
+
* @default "people"
|
|
15
|
+
*/
|
|
16
|
+
people: string;
|
|
17
|
+
}
|
|
18
|
+
/** Valid organization management tab / route key. */
|
|
19
|
+
export type OrganizationView = keyof OrganizationViewPaths;
|
|
@@ -6,7 +6,7 @@ export type PasskeyPluginOptions = {
|
|
|
6
6
|
*/
|
|
7
7
|
localization?: Partial<PasskeyLocalization>;
|
|
8
8
|
};
|
|
9
|
-
export declare const passkeyPlugin: ((options?: PasskeyPluginOptions | undefined) =>
|
|
9
|
+
export declare const passkeyPlugin: ((options?: PasskeyPluginOptions | undefined) => {
|
|
10
10
|
localization: {
|
|
11
11
|
passkey: string;
|
|
12
12
|
addPasskey: string;
|
|
@@ -18,7 +18,7 @@ export declare const passkeyPlugin: ((options?: PasskeyPluginOptions | undefined
|
|
|
18
18
|
noPasskeys: string;
|
|
19
19
|
name: string;
|
|
20
20
|
};
|
|
21
|
-
}
|
|
21
|
+
} & {
|
|
22
22
|
id: "passkey";
|
|
23
23
|
}) & {
|
|
24
24
|
id: "passkey";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Query key factory for passkey queries, scoped per user. */
|
|
2
|
+
export declare const passkeyQueryKeys: {
|
|
3
|
+
readonly all: (userId: string | undefined) => readonly ["auth", "user", string | undefined, "passkey"];
|
|
4
|
+
readonly lists: (userId: string | undefined) => readonly ["auth", "user", string | undefined, "passkey", "list"];
|
|
5
|
+
readonly list: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "passkey", "list", NonNullable<TQuery> | null];
|
|
6
|
+
};
|
|
@@ -19,7 +19,7 @@ export type ThemePluginOptions = {
|
|
|
19
19
|
*/
|
|
20
20
|
themes?: string[];
|
|
21
21
|
};
|
|
22
|
-
export declare const themePlugin: ((options: ThemePluginOptions) =>
|
|
22
|
+
export declare const themePlugin: ((options: ThemePluginOptions) => {
|
|
23
23
|
localization: {
|
|
24
24
|
appearance: string;
|
|
25
25
|
theme: string;
|
|
@@ -30,7 +30,7 @@ export declare const themePlugin: ((options: ThemePluginOptions) => Omit<{
|
|
|
30
30
|
theme: string;
|
|
31
31
|
setTheme: (theme: string) => void;
|
|
32
32
|
themes: string[];
|
|
33
|
-
}
|
|
33
|
+
} & {
|
|
34
34
|
id: "theme";
|
|
35
35
|
}) & {
|
|
36
36
|
id: "theme";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mutation keys contributed by the username plugin.
|
|
3
|
+
*
|
|
4
|
+
* `signIn` is kept under the shared `["auth", "signIn", ...]` namespace so
|
|
5
|
+
* consumers can match the whole sign-in surface with
|
|
6
|
+
* `useIsMutating({ mutationKey: ["auth", "signIn"] })`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const usernameMutationKeys: {
|
|
9
|
+
/** Key for `signIn.username`. */
|
|
10
|
+
readonly signIn: readonly ["auth", "signIn", "username"];
|
|
11
|
+
/**
|
|
12
|
+
* Key for `isUsernameAvailable`. This is technically a read, but it's
|
|
13
|
+
* exposed via better-auth's mutation surface and lives under the mutation
|
|
14
|
+
* factories for parity with other username flows.
|
|
15
|
+
*/
|
|
16
|
+
readonly isUsernameAvailable: readonly ["auth", "isUsernameAvailable"];
|
|
17
|
+
};
|
|
@@ -24,7 +24,7 @@ export type UsernamePluginOptions = {
|
|
|
24
24
|
*/
|
|
25
25
|
localization?: Partial<UsernameLocalization>;
|
|
26
26
|
};
|
|
27
|
-
export declare const usernamePlugin: ((options?: UsernamePluginOptions | undefined) =>
|
|
27
|
+
export declare const usernamePlugin: ((options?: UsernamePluginOptions | undefined) => {
|
|
28
28
|
minUsernameLength: number;
|
|
29
29
|
maxUsernameLength: number;
|
|
30
30
|
localization: {
|
|
@@ -43,7 +43,7 @@ export declare const usernamePlugin: ((options?: UsernamePluginOptions | undefin
|
|
|
43
43
|
placeholder: string;
|
|
44
44
|
inputType: "input";
|
|
45
45
|
signUp: "above";
|
|
46
|
-
required:
|
|
46
|
+
required: true;
|
|
47
47
|
} | {
|
|
48
48
|
name: string;
|
|
49
49
|
type: "string";
|
|
@@ -61,7 +61,7 @@ export declare const usernamePlugin: ((options?: UsernamePluginOptions | undefin
|
|
|
61
61
|
* Whether to check username availability on sign-up and user profile.
|
|
62
62
|
*/
|
|
63
63
|
isUsernameAvailable?: boolean;
|
|
64
|
-
}
|
|
64
|
+
} & {
|
|
65
65
|
id: "username";
|
|
66
66
|
}) & {
|
|
67
67
|
id: "username";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export * from './plugins/api-key/api-key-localization';
|
|
2
|
+
export * from './plugins/api-key/api-key-mutation-keys';
|
|
3
|
+
export * from './plugins/api-key/api-key-plugin';
|
|
4
|
+
export * from './plugins/api-key/api-key-query-keys';
|
|
5
|
+
export * from './plugins/delete-user/delete-user-localization';
|
|
6
|
+
export * from './plugins/delete-user/delete-user-mutation-keys';
|
|
7
|
+
export * from './plugins/delete-user/delete-user-plugin';
|
|
8
|
+
export * from './plugins/magic-link/magic-link-localization';
|
|
9
|
+
export * from './plugins/magic-link/magic-link-mutation-keys';
|
|
10
|
+
export * from './plugins/magic-link/magic-link-plugin';
|
|
11
|
+
export * from './plugins/multi-session/multi-session-localization';
|
|
12
|
+
export * from './plugins/multi-session/multi-session-mutation-keys';
|
|
13
|
+
export * from './plugins/multi-session/multi-session-plugin';
|
|
14
|
+
export * from './plugins/multi-session/multi-session-query-keys';
|
|
15
|
+
export * from './plugins/organization/organization-localization';
|
|
16
|
+
export * from './plugins/organization/organization-mutation-keys';
|
|
17
|
+
export * from './plugins/organization/organization-plugin';
|
|
18
|
+
export * from './plugins/organization/organization-query-keys';
|
|
19
|
+
export * from './plugins/organization/organization-view-paths';
|
|
20
|
+
export * from './plugins/passkey/passkey-localization';
|
|
21
|
+
export * from './plugins/passkey/passkey-mutation-keys';
|
|
22
|
+
export * from './plugins/passkey/passkey-plugin';
|
|
23
|
+
export * from './plugins/passkey/passkey-query-keys';
|
|
24
|
+
export * from './plugins/theme/theme-localization';
|
|
25
|
+
export * from './plugins/theme/theme-plugin';
|
|
26
|
+
export * from './plugins/username/username-localization';
|
|
27
|
+
export * from './plugins/username/username-mutation-keys';
|
|
28
|
+
export * from './plugins/username/username-plugin';
|