@better-auth-ui/core 1.6.9 → 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 +8 -8
- package/dist/config/index.d.ts +4 -4
- package/dist/create-auth-plugin-CnH7jMHA.js +199 -0
- package/dist/index.d.ts +11 -11
- package/dist/index.js +103 -11
- package/dist/lib/auth-plugin.d.ts +1 -1
- package/dist/lib/create-auth-plugin.d.ts +1 -1
- package/dist/lib/provider-names.d.ts +1 -1
- package/dist/lib/utils.d.ts +1 -1
- package/dist/plugins/api-key/api-key-plugin.d.ts +1 -1
- package/dist/plugins/delete-user/delete-user-plugin.d.ts +1 -1
- package/dist/plugins/magic-link/magic-link-plugin.d.ts +1 -1
- package/dist/plugins/multi-session/multi-session-plugin.d.ts +1 -1
- package/dist/plugins/organization/organization-plugin.d.ts +3 -3
- package/dist/plugins/passkey/passkey-plugin.d.ts +1 -1
- package/dist/plugins/theme/theme-plugin.d.ts +1 -1
- package/dist/plugins/username/username-plugin.d.ts +1 -1
- package/dist/plugins.d.ts +28 -28
- package/dist/plugins.js +360 -28
- package/package.json +2 -2
- package/dist/config/additional-fields-config.js +0 -39
- package/dist/config/auth-config.js +0 -34
- package/dist/config/avatar-config.js +0 -1
- package/dist/config/email-and-password-config.js +0 -1
- package/dist/config/index.js +0 -4
- package/dist/lib/auth-mutation-keys.js +0 -70
- package/dist/lib/auth-plugin.js +0 -1
- package/dist/lib/auth-query-keys.js +0 -42
- package/dist/lib/base-paths.js +0 -5
- package/dist/lib/create-auth-plugin.js +0 -23
- package/dist/lib/deep-partial.js +0 -1
- package/dist/lib/localization.js +0 -150
- package/dist/lib/provider-names.js +0 -50
- package/dist/lib/utils.js +0 -116
- package/dist/lib/view-paths.js +0 -13
- package/dist/plugins/api-key/api-key-localization.js +0 -24
- package/dist/plugins/api-key/api-key-mutation-keys.js +0 -11
- package/dist/plugins/api-key/api-key-plugin.js +0 -6
- package/dist/plugins/api-key/api-key-query-keys.js +0 -7
- package/dist/plugins/delete-user/delete-user-localization.js +0 -10
- package/dist/plugins/delete-user/delete-user-mutation-keys.js +0 -7
- package/dist/plugins/delete-user/delete-user-plugin.js +0 -6
- package/dist/plugins/magic-link/magic-link-localization.js +0 -8
- package/dist/plugins/magic-link/magic-link-mutation-keys.js +0 -17
- package/dist/plugins/magic-link/magic-link-plugin.js +0 -8
- package/dist/plugins/multi-session/multi-session-localization.js +0 -10
- package/dist/plugins/multi-session/multi-session-mutation-keys.js +0 -11
- package/dist/plugins/multi-session/multi-session-plugin.js +0 -5
- package/dist/plugins/multi-session/multi-session-query-keys.js +0 -7
- package/dist/plugins/organization/organization-localization.js +0 -114
- package/dist/plugins/organization/organization-mutation-keys.js +0 -40
- package/dist/plugins/organization/organization-plugin.js +0 -35
- package/dist/plugins/organization/organization-query-keys.js +0 -54
- package/dist/plugins/organization/organization-view-paths.js +0 -1
- package/dist/plugins/passkey/passkey-localization.js +0 -20
- package/dist/plugins/passkey/passkey-mutation-keys.js +0 -15
- package/dist/plugins/passkey/passkey-plugin.js +0 -5
- package/dist/plugins/passkey/passkey-query-keys.js +0 -7
- package/dist/plugins/theme/theme-localization.js +0 -12
- package/dist/plugins/theme/theme-plugin.js +0 -8
- package/dist/plugins/username/username-localization.js +0 -16
- package/dist/plugins/username/username-mutation-keys.js +0 -17
- package/dist/plugins/username/username-plugin.js +0 -36
package/dist/lib/localization.js
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
export const localization = {
|
|
2
|
-
auth: {
|
|
3
|
-
/** @remarks `"Account"` */
|
|
4
|
-
account: "Account",
|
|
5
|
-
/** @remarks `"Already have an account?"` */
|
|
6
|
-
alreadyHaveAnAccount: "Already have an account?",
|
|
7
|
-
/** @remarks `"Confirm password"` */
|
|
8
|
-
confirmPassword: "Confirm password",
|
|
9
|
-
/** @remarks `"Confirm your password"` */
|
|
10
|
-
confirmPasswordPlaceholder: "Confirm your password",
|
|
11
|
-
/** @remarks `"Continue with {{provider}}"` */
|
|
12
|
-
continueWith: "Continue with {{provider}}",
|
|
13
|
-
/** @remarks `"Email"` */
|
|
14
|
-
email: "Email",
|
|
15
|
-
/** @remarks `"Enter your email"` */
|
|
16
|
-
emailPlaceholder: "Enter your email",
|
|
17
|
-
/** @remarks `"Forgot Password"` */
|
|
18
|
-
forgotPassword: "Forgot Password",
|
|
19
|
-
/** @remarks `"Forgot password?"` */
|
|
20
|
-
forgotPasswordLink: "Forgot password?",
|
|
21
|
-
/** @remarks `"Hide password"` */
|
|
22
|
-
hidePassword: "Hide password",
|
|
23
|
-
/** @remarks `"Invalid reset password token"` */
|
|
24
|
-
invalidResetPasswordToken: "Invalid reset password token",
|
|
25
|
-
/** @remarks `"Name"` */
|
|
26
|
-
name: "Name",
|
|
27
|
-
/** @remarks `"Enter your name"` */
|
|
28
|
-
namePlaceholder: "Enter your name",
|
|
29
|
-
/** @remarks `"Need to create an account?"` */
|
|
30
|
-
needToCreateAnAccount: "Need to create an account?",
|
|
31
|
-
/** @remarks `"New password"` */
|
|
32
|
-
newPassword: "New password",
|
|
33
|
-
/** @remarks `"Enter your new password"` */
|
|
34
|
-
newPasswordPlaceholder: "Enter your new password",
|
|
35
|
-
/** @remarks `"OR"` */
|
|
36
|
-
or: "OR",
|
|
37
|
-
/** @remarks `"Password"` */
|
|
38
|
-
password: "Password",
|
|
39
|
-
/** @remarks `"Enter your password"` */
|
|
40
|
-
passwordPlaceholder: "Enter your password",
|
|
41
|
-
/** @remarks `"Password reset email sent"` */
|
|
42
|
-
passwordResetEmailSent: "Password reset email sent",
|
|
43
|
-
/** @remarks `"Password reset successfully"` */
|
|
44
|
-
passwordResetSuccess: "Password reset successfully",
|
|
45
|
-
/** @remarks `"Passwords do not match"` */
|
|
46
|
-
passwordsDoNotMatch: "Passwords do not match",
|
|
47
|
-
/** @remarks `"Remember me"` */
|
|
48
|
-
rememberMe: "Remember me",
|
|
49
|
-
/** @remarks `"Remember your password?"` */
|
|
50
|
-
rememberYourPassword: "Remember your password?",
|
|
51
|
-
/** @remarks `"Resend"` */
|
|
52
|
-
resend: "Resend",
|
|
53
|
-
/** @remarks `"Reset Password"` */
|
|
54
|
-
resetPassword: "Reset Password",
|
|
55
|
-
/** @remarks `"Send reset link"` */
|
|
56
|
-
sendResetLink: "Send reset link",
|
|
57
|
-
/** @remarks `"Show password"` */
|
|
58
|
-
showPassword: "Show password",
|
|
59
|
-
/** @remarks `"Sign In"` */
|
|
60
|
-
signIn: "Sign In",
|
|
61
|
-
/** @remarks `"Sign Out"` */
|
|
62
|
-
signOut: "Sign Out",
|
|
63
|
-
/** @remarks `"Sign Up"` */
|
|
64
|
-
signUp: "Sign Up",
|
|
65
|
-
/** @remarks `"Verification email sent!"` */
|
|
66
|
-
verificationEmailSent: "Verification email sent!",
|
|
67
|
-
/** @remarks `"Verify your email"` */
|
|
68
|
-
verifyYourEmail: "Verify your email"
|
|
69
|
-
},
|
|
70
|
-
settings: {
|
|
71
|
-
/** @remarks `"Account"` */
|
|
72
|
-
account: "Account",
|
|
73
|
-
/** @remarks `"Account unlinked"` */
|
|
74
|
-
accountUnlinked: "Account unlinked",
|
|
75
|
-
/** @remarks `"Active"` */
|
|
76
|
-
active: "Active",
|
|
77
|
-
/** @remarks `"Active sessions"` */
|
|
78
|
-
activeSessions: "Active sessions",
|
|
79
|
-
/** @remarks `"Avatar"` */
|
|
80
|
-
avatar: "Avatar",
|
|
81
|
-
/** @remarks `"Current session"` */
|
|
82
|
-
currentSession: "Current session",
|
|
83
|
-
/** @remarks `"Avatar changed successfully"` */
|
|
84
|
-
avatarChangedSuccess: "Avatar changed successfully",
|
|
85
|
-
/** @remarks `"Avatar deleted successfully"` */
|
|
86
|
-
avatarDeletedSuccess: "Avatar deleted successfully",
|
|
87
|
-
/** @remarks `"Change avatar"` */
|
|
88
|
-
changeAvatar: "Change avatar",
|
|
89
|
-
/** @remarks `"Delete avatar"` */
|
|
90
|
-
deleteAvatar: "Delete avatar",
|
|
91
|
-
/** @remarks `"Link"` */
|
|
92
|
-
link: "Link",
|
|
93
|
-
/** @remarks `"Linked accounts"` */
|
|
94
|
-
linkedAccounts: "Linked accounts",
|
|
95
|
-
/** @remarks `"Link your {{provider}} account"` */
|
|
96
|
-
linkProvider: "Link your {{provider}} account",
|
|
97
|
-
/** @remarks `"Cancel"` */
|
|
98
|
-
cancel: "Cancel",
|
|
99
|
-
/** @remarks `"Copy to clipboard"` */
|
|
100
|
-
copyToClipboard: "Copy to clipboard",
|
|
101
|
-
/** @remarks `"Change email"` */
|
|
102
|
-
changeEmail: "Change email",
|
|
103
|
-
/** @remarks `"Check your email to confirm the change"` */
|
|
104
|
-
changeEmailSuccess: "Check your email to confirm the change",
|
|
105
|
-
/** @remarks `"Change password"` */
|
|
106
|
-
changePassword: "Change password",
|
|
107
|
-
/** @remarks `"Password changed successfully"` */
|
|
108
|
-
changePasswordSuccess: "Password changed successfully",
|
|
109
|
-
/** @remarks `"Current password"` */
|
|
110
|
-
currentPassword: "Current password",
|
|
111
|
-
/** @remarks `"Enter your current password"` */
|
|
112
|
-
currentPasswordPlaceholder: "Enter your current password",
|
|
113
|
-
/** @remarks `"Danger zone"` */
|
|
114
|
-
dangerZone: "Danger zone",
|
|
115
|
-
/** @remarks `"Delete"` */
|
|
116
|
-
delete: "Delete",
|
|
117
|
-
/** @remarks `"Optional"` */
|
|
118
|
-
optional: "Optional",
|
|
119
|
-
/** @remarks `"Profile updated successfully"` */
|
|
120
|
-
profileUpdatedSuccess: "Profile updated successfully",
|
|
121
|
-
/** @remarks `"Revoke"` */
|
|
122
|
-
revoke: "Revoke",
|
|
123
|
-
/** @remarks `"Revoke session"` */
|
|
124
|
-
revokeSession: "Revoke session",
|
|
125
|
-
/** @remarks `"Session revoked successfully"` */
|
|
126
|
-
revokeSessionSuccess: "Session revoked successfully",
|
|
127
|
-
/** @remarks `"Save changes"` */
|
|
128
|
-
saveChanges: "Save changes",
|
|
129
|
-
/** @remarks `"Set password"` */
|
|
130
|
-
setPassword: "Set password",
|
|
131
|
-
/** @remarks `"You don't have a password yet. Request a reset link to set one up."` */
|
|
132
|
-
setPasswordDescription: "You don't have a password yet. Request a reset link to set one up.",
|
|
133
|
-
/** @remarks `"Security"` */
|
|
134
|
-
security: "Security",
|
|
135
|
-
/** @remarks `"Settings"` */
|
|
136
|
-
settings: "Settings",
|
|
137
|
-
/** @remarks `"Time"` */
|
|
138
|
-
time: "Time",
|
|
139
|
-
/** @remarks `"Unlink {{provider}}"` */
|
|
140
|
-
unlinkProvider: "Unlink {{provider}}",
|
|
141
|
-
/** @remarks `"Update email"` */
|
|
142
|
-
updateEmail: "Update email",
|
|
143
|
-
/** @remarks `"Update password"` */
|
|
144
|
-
updatePassword: "Update password",
|
|
145
|
-
/** @remarks `"Upload avatar"` */
|
|
146
|
-
uploadAvatar: "Upload avatar",
|
|
147
|
-
/** @remarks `"User profile"` */
|
|
148
|
-
userProfile: "User profile"
|
|
149
|
-
}
|
|
150
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mapping of social authentication provider identifiers to their human-readable display names.
|
|
3
|
-
*/
|
|
4
|
-
export const providerNames = {
|
|
5
|
-
apple: "Apple",
|
|
6
|
-
atlassian: "Atlassian",
|
|
7
|
-
cognito: "Cognito",
|
|
8
|
-
discord: "Discord",
|
|
9
|
-
dropbox: "Dropbox",
|
|
10
|
-
facebook: "Facebook",
|
|
11
|
-
figma: "Figma",
|
|
12
|
-
github: "GitHub",
|
|
13
|
-
gitlab: "GitLab",
|
|
14
|
-
google: "Google",
|
|
15
|
-
huggingface: "Hugging Face",
|
|
16
|
-
kakao: "Kakao",
|
|
17
|
-
kick: "Kick",
|
|
18
|
-
line: "LINE",
|
|
19
|
-
linear: "Linear",
|
|
20
|
-
linkedin: "LinkedIn",
|
|
21
|
-
microsoft: "Microsoft",
|
|
22
|
-
naver: "Naver",
|
|
23
|
-
notion: "Notion",
|
|
24
|
-
paybin: "Paybin",
|
|
25
|
-
paypal: "PayPal",
|
|
26
|
-
polar: "Polar",
|
|
27
|
-
railway: "Railway",
|
|
28
|
-
reddit: "Reddit",
|
|
29
|
-
roblox: "Roblox",
|
|
30
|
-
salesforce: "Salesforce",
|
|
31
|
-
slack: "Slack",
|
|
32
|
-
spotify: "Spotify",
|
|
33
|
-
tiktok: "TikTok",
|
|
34
|
-
twitch: "Twitch",
|
|
35
|
-
twitter: "X",
|
|
36
|
-
vercel: "Vercel",
|
|
37
|
-
vk: "VK",
|
|
38
|
-
wechat: "WeChat",
|
|
39
|
-
zoom: "Zoom"
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Get the human-readable display name for an authentication provider.
|
|
43
|
-
*
|
|
44
|
-
* @param provider - The provider identifier (e.g., "github", "google").
|
|
45
|
-
* @returns The mapped display name for `provider` if available, otherwise `provider` with its first character capitalized.
|
|
46
|
-
*/
|
|
47
|
-
export function getProviderName(provider) {
|
|
48
|
-
return (providerNames[provider] ||
|
|
49
|
-
provider.charAt(0).toUpperCase() + provider.slice(1));
|
|
50
|
-
}
|
package/dist/lib/utils.js
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type guard that checks whether a value is a non-null, non-array object.
|
|
3
|
-
*/
|
|
4
|
-
function isObject(item) {
|
|
5
|
-
return item !== null && typeof item === "object" && !Array.isArray(item);
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Type guard that checks whether a value is a plain object suitable for deep merging.
|
|
9
|
-
* Excludes `Date`, `RegExp`, and other special object types.
|
|
10
|
-
*/
|
|
11
|
-
function isPlainObject(item) {
|
|
12
|
-
if (!isObject(item))
|
|
13
|
-
return false;
|
|
14
|
-
// Handle special object types that should not be merged
|
|
15
|
-
if (item instanceof Date)
|
|
16
|
-
return false;
|
|
17
|
-
if (item instanceof RegExp)
|
|
18
|
-
return false;
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Resize and square-crop an image file for use as an avatar.
|
|
23
|
-
*
|
|
24
|
-
* The image is center-cropped to a square, scaled down to at most {@link size} pixels,
|
|
25
|
-
* and converted to the specified output format.
|
|
26
|
-
*
|
|
27
|
-
* @param file - The source image file.
|
|
28
|
-
* @param size - Max dimension in pixels for the output image.
|
|
29
|
-
* @param extension - Output format. Use `"inherit"` to keep the original format.
|
|
30
|
-
* @returns A promise that resolves to the processed `File`.
|
|
31
|
-
*/
|
|
32
|
-
export function resizeAvatar(file, size = 256, extension = "png") {
|
|
33
|
-
const MAX_SIZE = size;
|
|
34
|
-
const resolvedExtension = extension === "inherit" ? file.name.split(".").pop() : extension;
|
|
35
|
-
const mimeType = extension === "inherit"
|
|
36
|
-
? file.type
|
|
37
|
-
: `image/${extension === "jpg" ? "jpeg" : extension}`;
|
|
38
|
-
return new Promise((resolve, reject) => {
|
|
39
|
-
const img = new Image();
|
|
40
|
-
const url = URL.createObjectURL(file);
|
|
41
|
-
img.onload = () => {
|
|
42
|
-
URL.revokeObjectURL(url);
|
|
43
|
-
const { naturalWidth: w, naturalHeight: h } = img;
|
|
44
|
-
const side = Math.min(w, h);
|
|
45
|
-
const cropX = (w - side) / 2;
|
|
46
|
-
const cropY = (h - side) / 2;
|
|
47
|
-
const outSize = Math.min(side, MAX_SIZE);
|
|
48
|
-
const canvas = document.createElement("canvas");
|
|
49
|
-
canvas.width = outSize;
|
|
50
|
-
canvas.height = outSize;
|
|
51
|
-
const ctx = canvas.getContext("2d");
|
|
52
|
-
if (!ctx) {
|
|
53
|
-
reject(new Error("Could not get canvas context"));
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
ctx.drawImage(img, cropX, cropY, side, side, 0, 0, outSize, outSize);
|
|
57
|
-
canvas.toBlob((blob) => {
|
|
58
|
-
if (!blob) {
|
|
59
|
-
reject(new Error("Could not create blob from canvas"));
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
resolve(new File([blob], file.name.replace(/\.[^.]+$/, `.${resolvedExtension}`), {
|
|
63
|
-
type: mimeType
|
|
64
|
-
}));
|
|
65
|
-
}, mimeType, 1);
|
|
66
|
-
};
|
|
67
|
-
img.onerror = () => {
|
|
68
|
-
URL.revokeObjectURL(url);
|
|
69
|
-
reject(new Error("Failed to load image"));
|
|
70
|
-
};
|
|
71
|
-
img.src = url;
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Convert a `File` to a base64-encoded data URL string.
|
|
76
|
-
*
|
|
77
|
-
* @param file - The file to encode.
|
|
78
|
-
* @returns A promise that resolves to the base64 data URL.
|
|
79
|
-
*/
|
|
80
|
-
export function fileToBase64(file) {
|
|
81
|
-
return new Promise((resolve, reject) => {
|
|
82
|
-
const reader = new FileReader();
|
|
83
|
-
reader.onload = () => resolve(reader.result);
|
|
84
|
-
reader.onerror = () => reject(new Error("Failed to read file"));
|
|
85
|
-
reader.readAsDataURL(file);
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Recursively merge `source` into `target`, producing a new object.
|
|
90
|
-
*
|
|
91
|
-
* - Plain objects are merged key-by-key; nested objects are merged recursively.
|
|
92
|
-
* - `undefined` values in `source` are skipped (existing `target` values are preserved).
|
|
93
|
-
* - Non-plain values (arrays, `Date`, `RegExp`, primitives, functions) in `source`
|
|
94
|
-
* replace the corresponding `target` value outright.
|
|
95
|
-
*
|
|
96
|
-
* @param target - The base object.
|
|
97
|
-
* @param source - Partial overrides to apply on top of `target`.
|
|
98
|
-
* @returns A new merged object of type `T`.
|
|
99
|
-
*/
|
|
100
|
-
export function deepmerge(target, source) {
|
|
101
|
-
if (isPlainObject(target) && isPlainObject(source)) {
|
|
102
|
-
const result = { ...target };
|
|
103
|
-
for (const [key, value] of Object.entries(source)) {
|
|
104
|
-
if (value === undefined)
|
|
105
|
-
continue; // skip undefineds
|
|
106
|
-
if (key in target) {
|
|
107
|
-
result[key] = deepmerge(target[key], value);
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
result[key] = value;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return result;
|
|
114
|
-
}
|
|
115
|
-
return source;
|
|
116
|
-
}
|
package/dist/lib/view-paths.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export const apiKeyLocalization = {
|
|
2
|
-
/** @remarks `"API key"` */
|
|
3
|
-
apiKey: "API key",
|
|
4
|
-
/** @remarks `"API keys"` */
|
|
5
|
-
apiKeys: "API keys",
|
|
6
|
-
/** @remarks `"Create an API key for programmatic access to your account."` */
|
|
7
|
-
apiKeysDescription: "Create an API key for programmatic access to your account.",
|
|
8
|
-
/** @remarks `"Create API key"` */
|
|
9
|
-
createApiKey: "Create API key",
|
|
10
|
-
/** @remarks `"No API keys"` */
|
|
11
|
-
noApiKeys: "No API keys",
|
|
12
|
-
/** @remarks `"Name"` */
|
|
13
|
-
name: "Name",
|
|
14
|
-
/** @remarks `"New API key"` */
|
|
15
|
-
newApiKey: "New API key",
|
|
16
|
-
/** @remarks `"Copy this key now. For security reasons you will not be able to see it again."` */
|
|
17
|
-
newApiKeyWarning: "This is the only time you'll see this API key. Copy and store it somewhere safe.",
|
|
18
|
-
/** @remarks `"Delete API key"` */
|
|
19
|
-
deleteApiKey: "Delete API key",
|
|
20
|
-
/** @remarks `"This action cannot be undone. Any service using this API key will stop working immediately."` */
|
|
21
|
-
deleteApiKeyWarning: "This action cannot be undone. Any service using this API key will stop working immediately.",
|
|
22
|
-
/** @remarks `"I've saved my key"` */
|
|
23
|
-
dismissNewKey: "I've saved my key"
|
|
24
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mutation keys contributed by the API key plugin.
|
|
3
|
-
*/
|
|
4
|
-
export const apiKeyMutationKeys = {
|
|
5
|
-
/** Root key for every api key mutation. */
|
|
6
|
-
all: ["auth", "apiKey"],
|
|
7
|
-
/** Key for `apiKey.create`. */
|
|
8
|
-
create: ["auth", "apiKey", "create"],
|
|
9
|
-
/** Key for `apiKey.delete`. */
|
|
10
|
-
delete: ["auth", "apiKey", "delete"]
|
|
11
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { createAuthPlugin } from "../../lib/create-auth-plugin";
|
|
2
|
-
import { apiKeyLocalization } from "./api-key-localization";
|
|
3
|
-
export const apiKeyPlugin = createAuthPlugin("apiKey", (options = {}) => ({
|
|
4
|
-
localization: { ...apiKeyLocalization, ...options.localization },
|
|
5
|
-
organization: options.organization ?? false
|
|
6
|
-
}));
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { authQueryKeys } from "../../lib/auth-query-keys";
|
|
2
|
-
/** Query key factory for API key queries, scoped per user. */
|
|
3
|
-
export const apiKeyQueryKeys = {
|
|
4
|
-
all: (userId) => [...authQueryKeys.user(userId), "apiKey"],
|
|
5
|
-
lists: (userId) => [...apiKeyQueryKeys.all(userId), "list"],
|
|
6
|
-
list: (userId, query) => [...apiKeyQueryKeys.lists(userId), query ?? null]
|
|
7
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export const deleteUserLocalization = {
|
|
2
|
-
/** @remarks `"Delete account"` */
|
|
3
|
-
deleteAccount: "Delete account",
|
|
4
|
-
/** @remarks `"Permanently remove your account and all associated data. This cannot be undone."` */
|
|
5
|
-
deleteAccountDescription: "Permanently remove your account and all associated data. This cannot be undone.",
|
|
6
|
-
/** @remarks `"Check your email to confirm account deletion."` */
|
|
7
|
-
deleteUserVerificationSent: "Check your email to confirm account deletion.",
|
|
8
|
-
/** @remarks `"Your account has been deleted."` */
|
|
9
|
-
deleteUserSuccess: "Your account has been deleted."
|
|
10
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { createAuthPlugin } from "../../lib/create-auth-plugin";
|
|
2
|
-
import { deleteUserLocalization } from "./delete-user-localization";
|
|
3
|
-
export const deleteUserPlugin = createAuthPlugin("deleteUser", (options = {}) => ({
|
|
4
|
-
localization: { ...deleteUserLocalization, ...options.localization },
|
|
5
|
-
sendDeleteAccountVerification: options.sendDeleteAccountVerification ?? false
|
|
6
|
-
}));
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export const magicLinkLocalization = {
|
|
2
|
-
/** @remarks `"Magic Link"` */
|
|
3
|
-
magicLink: "Magic Link",
|
|
4
|
-
/** @remarks `"Send Magic Link"` */
|
|
5
|
-
sendMagicLink: "Send Magic Link",
|
|
6
|
-
/** @remarks `"Check your email for the magic link"` */
|
|
7
|
-
magicLinkSent: "Check your email for the magic link"
|
|
8
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mutation keys contributed by the magic-link plugin.
|
|
3
|
-
*
|
|
4
|
-
* Kept under the shared `["auth", "signIn", ...]` namespace as the built-in
|
|
5
|
-
* sign-in mutation keys so consumers can match the whole sign-in surface
|
|
6
|
-
* with `useIsMutating({ mutationKey: ["auth", "signIn"] })` regardless of
|
|
7
|
-
* which strategy is in flight.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* useIsMutating({ mutationKey: magicLinkMutationKeys.signIn })
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
export const magicLinkMutationKeys = {
|
|
15
|
-
/** Key for `signIn.magicLink`. */
|
|
16
|
-
signIn: ["auth", "signIn", "magicLink"]
|
|
17
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createAuthPlugin } from "../../lib/create-auth-plugin";
|
|
2
|
-
import { magicLinkLocalization } from "./magic-link-localization";
|
|
3
|
-
export const magicLinkPlugin = createAuthPlugin("magicLink", (options = {}) => ({
|
|
4
|
-
localization: { ...magicLinkLocalization, ...options.localization },
|
|
5
|
-
viewPaths: {
|
|
6
|
-
auth: { magicLink: options.path ?? "magic-link" }
|
|
7
|
-
}
|
|
8
|
-
}));
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export const multiSessionLocalization = {
|
|
2
|
-
/** @remarks `"Switch Account"` */
|
|
3
|
-
switchAccount: "Switch Account",
|
|
4
|
-
/** @remarks `"Add Account"` */
|
|
5
|
-
addAccount: "Add Account",
|
|
6
|
-
/** @remarks `"Manage accounts"` */
|
|
7
|
-
manageAccounts: "Manage accounts",
|
|
8
|
-
/** @remarks `"Manage your accounts for secure access."` */
|
|
9
|
-
manageAccountsDescription: "Manage your accounts for secure access."
|
|
10
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mutation keys contributed by the multi-session plugin.
|
|
3
|
-
*/
|
|
4
|
-
export const multiSessionMutationKeys = {
|
|
5
|
-
/** Root key for every multi-session mutation. */
|
|
6
|
-
all: ["auth", "multiSession"],
|
|
7
|
-
/** Key for `multiSession.revoke`. */
|
|
8
|
-
revoke: ["auth", "multiSession", "revoke"],
|
|
9
|
-
/** Key for `multiSession.setActive`. */
|
|
10
|
-
setActive: ["auth", "multiSession", "setActive"]
|
|
11
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { createAuthPlugin } from "../../lib/create-auth-plugin";
|
|
2
|
-
import { multiSessionLocalization } from "./multi-session-localization";
|
|
3
|
-
export const multiSessionPlugin = createAuthPlugin("multiSession", (options = {}) => ({
|
|
4
|
-
localization: { ...multiSessionLocalization, ...options.localization }
|
|
5
|
-
}));
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { authQueryKeys } from "../../lib/auth-query-keys";
|
|
2
|
-
/** Query key factory for multi-session queries, scoped per user. */
|
|
3
|
-
export const multiSessionQueryKeys = {
|
|
4
|
-
all: (userId) => [...authQueryKeys.user(userId), "multiSession"],
|
|
5
|
-
lists: (userId) => [...multiSessionQueryKeys.all(userId), "list"],
|
|
6
|
-
list: (userId, query) => [...multiSessionQueryKeys.lists(userId), query ?? null]
|
|
7
|
-
};
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
export const organizationLocalization = {
|
|
2
|
-
/** @remarks `"Accept"` */
|
|
3
|
-
accept: "Accept",
|
|
4
|
-
/** @remarks `"Accepted"` */
|
|
5
|
-
accepted: "Accepted",
|
|
6
|
-
/** @remarks `"Actions"` */
|
|
7
|
-
actions: "Actions",
|
|
8
|
-
/** @remarks `"Admin"` */
|
|
9
|
-
admin: "Admin",
|
|
10
|
-
/** @remarks `"All"` */
|
|
11
|
-
all: "All",
|
|
12
|
-
/** @remarks `"Canceled"` */
|
|
13
|
-
canceled: "Canceled",
|
|
14
|
-
/** @remarks `"Cancel invitation"` */
|
|
15
|
-
cancelInvitation: "Cancel invitation",
|
|
16
|
-
/** @remarks `"Change logo"` */
|
|
17
|
-
changeLogo: "Change logo",
|
|
18
|
-
/** @remarks `"Change role"` */
|
|
19
|
-
changeMemberRole: "Change role",
|
|
20
|
-
/** @remarks `"Clear"` */
|
|
21
|
-
clear: "Clear",
|
|
22
|
-
/** @remarks `"Create organization"` */
|
|
23
|
-
createOrganization: "Create organization",
|
|
24
|
-
/** @remarks `"Delete logo"` */
|
|
25
|
-
deleteLogo: "Delete logo",
|
|
26
|
-
/** @remarks `"Delete organization"` */
|
|
27
|
-
deleteOrganization: "Delete organization",
|
|
28
|
-
/** @remarks `"Permanently delete this organization and all of its data. All members will lose access and this cannot be undone."` */
|
|
29
|
-
deleteOrganizationDescription: "Permanently delete this organization and all of its data. All members will lose access and this cannot be undone.",
|
|
30
|
-
/** @remarks `"Invitations"` */
|
|
31
|
-
invitations: "Invitations",
|
|
32
|
-
/** @remarks `"Invited at"` */
|
|
33
|
-
invitedAt: "Invited at",
|
|
34
|
-
/** @remarks `"Invite member"` */
|
|
35
|
-
inviteMember: "Invite member",
|
|
36
|
-
/** @remarks `"Member invited successfully"` */
|
|
37
|
-
inviteMemberSuccess: "Member invited successfully",
|
|
38
|
-
/** @remarks `"We'll email them a link to join this organization. Choose the role they'll have once they accept."` */
|
|
39
|
-
inviteMemberDescription: "We'll email them a link to join this organization. Choose the role they'll have once they accept.",
|
|
40
|
-
/** @remarks `"You left the organization"` */
|
|
41
|
-
leftOrganization: "You left the organization",
|
|
42
|
-
/** @remarks `"Leave organization"` */
|
|
43
|
-
leaveOrganization: "Leave organization",
|
|
44
|
-
/** @remarks `"Leave this organization and lose access to its data and resources. You'll need a new invitation to rejoin."` */
|
|
45
|
-
leaveOrganizationDescription: "Leave this organization and lose access to its data and resources. You'll need a new invitation to rejoin.",
|
|
46
|
-
/** @remarks `"Logo"` */
|
|
47
|
-
logo: "Logo",
|
|
48
|
-
/** @remarks `"Logo updated successfully"` */
|
|
49
|
-
logoChangedSuccess: "Logo updated successfully",
|
|
50
|
-
/** @remarks `"Logo removed successfully"` */
|
|
51
|
-
logoDeletedSuccess: "Logo removed successfully",
|
|
52
|
-
/** @remarks `"Manage"` */
|
|
53
|
-
manage: "Manage",
|
|
54
|
-
/** @remarks `"Member"` */
|
|
55
|
-
member: "Member",
|
|
56
|
-
/** @remarks `"Member removed"` */
|
|
57
|
-
memberRemoved: "Member removed",
|
|
58
|
-
/** @remarks `"Member role updated"` */
|
|
59
|
-
memberRoleUpdated: "Member role updated",
|
|
60
|
-
/** @remarks `"Members"` */
|
|
61
|
-
members: "Members",
|
|
62
|
-
/** @remarks `"People"` */
|
|
63
|
-
people: "People",
|
|
64
|
-
/** @remarks `"Name"` */
|
|
65
|
-
name: "Name",
|
|
66
|
-
/** @remarks `"Enter the organization name"` */
|
|
67
|
-
namePlaceholder: "Enter the organization name",
|
|
68
|
-
/** @remarks `"No invitations"` */
|
|
69
|
-
noInvitations: "No invitations",
|
|
70
|
-
/** @remarks `"No organizations"` */
|
|
71
|
-
noOrganizations: "No organizations",
|
|
72
|
-
/** @remarks `"Organization"` */
|
|
73
|
-
organization: "Organization",
|
|
74
|
-
/** @remarks `"Organization deleted"` */
|
|
75
|
-
organizationDeleted: "Organization deleted",
|
|
76
|
-
/** @remarks `"Invite a teammate to collaborate in this organization."` */
|
|
77
|
-
organizationInvitationsEmptyDescription: "Invite a teammate to collaborate in this organization.",
|
|
78
|
-
/** @remarks `"Organizations"` */
|
|
79
|
-
organizations: "Organizations",
|
|
80
|
-
/** @remarks `"Create an organization to collaborate with others and manage shared access."` */
|
|
81
|
-
organizationsDescription: "Create an organization to collaborate with others and manage shared access.",
|
|
82
|
-
/** @remarks `"Organization profile"` */
|
|
83
|
-
organizationProfile: "Organization profile",
|
|
84
|
-
/** @remarks `"Organization updated successfully"` */
|
|
85
|
-
organizationUpdatedSuccess: "Organization updated successfully",
|
|
86
|
-
/** @remarks `"Owner"` */
|
|
87
|
-
owner: "Owner",
|
|
88
|
-
/** @remarks `"Pending"` */
|
|
89
|
-
pending: "Pending",
|
|
90
|
-
/** @remarks `"Personal account"` */
|
|
91
|
-
personalAccount: "Personal account",
|
|
92
|
-
/** @remarks `"Rejected"` */
|
|
93
|
-
rejected: "Rejected",
|
|
94
|
-
/** @remarks `"Reject invitation"` */
|
|
95
|
-
rejectInvitation: "Reject invitation",
|
|
96
|
-
/** @remarks `"Remove member"` */
|
|
97
|
-
removeMember: "Remove member",
|
|
98
|
-
/** @remarks `"Are you sure you want to remove this member from the organization? They will lose access immediately."` */
|
|
99
|
-
removeMemberWarning: "Are you sure you want to remove this member from the organization? They will lose access immediately.",
|
|
100
|
-
/** @remarks `"Role"` */
|
|
101
|
-
role: "Role",
|
|
102
|
-
/** @remarks `"Search..."` */
|
|
103
|
-
search: "Search...",
|
|
104
|
-
/** @remarks `"Slug"` */
|
|
105
|
-
slug: "Slug",
|
|
106
|
-
/** @remarks `"organization-slug"` */
|
|
107
|
-
slugPlaceholder: "organization-slug",
|
|
108
|
-
/** @remarks `"Status"` */
|
|
109
|
-
status: "Status",
|
|
110
|
-
/** @remarks `"Upload logo"` */
|
|
111
|
-
uploadLogo: "Upload logo",
|
|
112
|
-
/** @remarks `"Invitations to join an organization will show up here."` */
|
|
113
|
-
userInvitationsEmptyDescription: "Invitations to join an organization will show up here."
|
|
114
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
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 const organizationMutationKeys = {
|
|
14
|
-
/** Root key for every organization mutation. */
|
|
15
|
-
all: ["auth", "organization"],
|
|
16
|
-
/** Key for `organization.create`. */
|
|
17
|
-
create: ["auth", "organization", "create"],
|
|
18
|
-
/** Key for `organization.delete`. */
|
|
19
|
-
delete: ["auth", "organization", "delete"],
|
|
20
|
-
/** Key for `organization.update`. */
|
|
21
|
-
update: ["auth", "organization", "update"],
|
|
22
|
-
/** Key for `organization.setActive`. */
|
|
23
|
-
setActive: ["auth", "organization", "setActive"],
|
|
24
|
-
/** Key for `organization.inviteMember`. */
|
|
25
|
-
inviteMember: ["auth", "organization", "inviteMember"],
|
|
26
|
-
/** Key for `organization.removeMember`. */
|
|
27
|
-
removeMember: ["auth", "organization", "removeMember"],
|
|
28
|
-
/** Key for `organization.leave`. */
|
|
29
|
-
leave: ["auth", "organization", "leave"],
|
|
30
|
-
/** Key for `organization.updateMemberRole`. */
|
|
31
|
-
updateMemberRole: ["auth", "organization", "updateMemberRole"],
|
|
32
|
-
/** Key for `organization.acceptInvitation`. */
|
|
33
|
-
acceptInvitation: ["auth", "organization", "acceptInvitation"],
|
|
34
|
-
/** Key for `organization.cancelInvitation`. */
|
|
35
|
-
cancelInvitation: ["auth", "organization", "cancelInvitation"],
|
|
36
|
-
/** Key for `organization.rejectInvitation` (invitee declines). */
|
|
37
|
-
rejectInvitation: ["auth", "organization", "rejectInvitation"],
|
|
38
|
-
/** Key for `organization.checkSlug`. */
|
|
39
|
-
checkSlug: ["auth", "organization", "checkSlug"]
|
|
40
|
-
};
|