@better-auth-ui/core 1.6.5 → 1.6.7
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/lib/auth-query-keys.d.ts +2 -0
- package/dist/lib/auth-query-keys.js +5 -0
- package/dist/plugins/api-key/api-key-localization.d.ts +25 -0
- package/dist/plugins/api-key/api-key-localization.js +16 -0
- package/dist/plugins/api-key/api-key-mutation-keys.d.ts +9 -0
- package/dist/plugins/api-key/api-key-mutation-keys.js +15 -0
- package/dist/plugins/api-key/api-key-plugin.d.ts +27 -0
- package/dist/plugins/api-key/api-key-plugin.js +9 -0
- package/dist/plugins/index.d.ts +3 -0
- package/dist/plugins.js +18 -15
- package/package.json +4 -4
- package/src/lib/auth-query-keys.ts +6 -0
- package/src/plugins/api-key/api-key-localization.ts +29 -0
- package/src/plugins/api-key/api-key-mutation-keys.ts +9 -0
- package/src/plugins/api-key/api-key-plugin.ts +20 -0
- package/src/plugins/index.ts +3 -0
|
@@ -31,6 +31,8 @@ export declare const authQueryKeys: {
|
|
|
31
31
|
readonly listDeviceSessions: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "listDeviceSessions", NonNullable<TQuery> | null];
|
|
32
32
|
/** Key for the user's passkey list. */
|
|
33
33
|
readonly listPasskeys: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "listPasskeys", NonNullable<TQuery> | null];
|
|
34
|
+
/** Key for the user's API keys list (`apiKey.list`). */
|
|
35
|
+
readonly listApiKeys: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "listApiKeys", NonNullable<TQuery> | null];
|
|
34
36
|
/** Key for `accountInfo` for the given user. */
|
|
35
37
|
readonly accountInfo: <TQuery = undefined>(userId: string | undefined, query?: TQuery) => readonly ["auth", "user", string | undefined, "accountInfo", NonNullable<TQuery> | null];
|
|
36
38
|
/** Key for `listAccounts` for the given user. */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const apiKeyLocalization: {
|
|
2
|
+
/** @remarks `"API key"` */
|
|
3
|
+
apiKey: string;
|
|
4
|
+
/** @remarks `"API keys"` */
|
|
5
|
+
apiKeys: string;
|
|
6
|
+
/** @remarks `"Create an API key for programmatic access to your account."` */
|
|
7
|
+
apiKeysDescription: string;
|
|
8
|
+
/** @remarks `"Create API key"` */
|
|
9
|
+
createApiKey: string;
|
|
10
|
+
/** @remarks `"No API keys"` */
|
|
11
|
+
noApiKeys: string;
|
|
12
|
+
/** @remarks `"Name"` */
|
|
13
|
+
name: string;
|
|
14
|
+
/** @remarks `"New API key"` */
|
|
15
|
+
newApiKey: string;
|
|
16
|
+
/** @remarks `"Copy this key now. For security reasons you will not be able to see it again."` */
|
|
17
|
+
newApiKeyWarning: string;
|
|
18
|
+
/** @remarks `"Delete API key"` */
|
|
19
|
+
deleteApiKey: string;
|
|
20
|
+
/** @remarks `"This action cannot be undone. Any service using this API key will stop working immediately."` */
|
|
21
|
+
deleteApiKeyWarning: string;
|
|
22
|
+
/** @remarks `"I've saved my key"` */
|
|
23
|
+
dismissNewKey: string;
|
|
24
|
+
};
|
|
25
|
+
export type ApiKeyLocalization = typeof apiKeyLocalization;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/plugins/api-key/api-key-localization.ts
|
|
2
|
+
var e = {
|
|
3
|
+
apiKey: "API key",
|
|
4
|
+
apiKeys: "API keys",
|
|
5
|
+
apiKeysDescription: "Create an API key for programmatic access to your account.",
|
|
6
|
+
createApiKey: "Create API key",
|
|
7
|
+
noApiKeys: "No API keys",
|
|
8
|
+
name: "Name",
|
|
9
|
+
newApiKey: "New API key",
|
|
10
|
+
newApiKeyWarning: "This is the only time you'll see this API key. Copy and store it somewhere safe.",
|
|
11
|
+
deleteApiKey: "Delete API key",
|
|
12
|
+
deleteApiKeyWarning: "This action cannot be undone. Any service using this API key will stop working immediately.",
|
|
13
|
+
dismissNewKey: "I've saved my key"
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { e as apiKeyLocalization };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mutation keys contributed by the API key plugin.
|
|
3
|
+
*/
|
|
4
|
+
export declare const apiKeyMutationKeys: {
|
|
5
|
+
/** Key for `apiKey.create`. */
|
|
6
|
+
readonly createApiKey: readonly ["auth", "apiKey", "create"];
|
|
7
|
+
/** Key for `apiKey.delete`. */
|
|
8
|
+
readonly deleteApiKey: readonly ["auth", "apiKey", "delete"];
|
|
9
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ApiKeyLocalization } from './api-key-localization';
|
|
2
|
+
export type ApiKeyPluginOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* Override the plugin's default localization strings.
|
|
5
|
+
* @remarks `ApiKeyLocalization`
|
|
6
|
+
*/
|
|
7
|
+
localization?: Partial<ApiKeyLocalization>;
|
|
8
|
+
};
|
|
9
|
+
export declare const apiKeyPlugin: ((options?: ApiKeyPluginOptions | undefined) => Omit<{
|
|
10
|
+
localization: {
|
|
11
|
+
apiKey: string;
|
|
12
|
+
apiKeys: string;
|
|
13
|
+
apiKeysDescription: string;
|
|
14
|
+
createApiKey: string;
|
|
15
|
+
noApiKeys: string;
|
|
16
|
+
name: string;
|
|
17
|
+
newApiKey: string;
|
|
18
|
+
newApiKeyWarning: string;
|
|
19
|
+
deleteApiKey: string;
|
|
20
|
+
deleteApiKeyWarning: string;
|
|
21
|
+
dismissNewKey: string;
|
|
22
|
+
};
|
|
23
|
+
}, "id"> & {
|
|
24
|
+
id: "apiKey";
|
|
25
|
+
}) & {
|
|
26
|
+
id: "apiKey";
|
|
27
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createAuthPlugin as e } from "../../lib/create-auth-plugin.js";
|
|
2
|
+
import { apiKeyLocalization as t } from "./api-key-localization.js";
|
|
3
|
+
//#region src/plugins/api-key/api-key-plugin.ts
|
|
4
|
+
var n = e("apiKey", (e = {}) => ({ localization: {
|
|
5
|
+
...t,
|
|
6
|
+
...e.localization
|
|
7
|
+
} }));
|
|
8
|
+
//#endregion
|
|
9
|
+
export { n as apiKeyPlugin };
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export * from './api-key/api-key-localization';
|
|
2
|
+
export * from './api-key/api-key-mutation-keys';
|
|
3
|
+
export * from './api-key/api-key-plugin';
|
|
1
4
|
export * from './delete-user/delete-user-localization';
|
|
2
5
|
export * from './delete-user/delete-user-plugin';
|
|
3
6
|
export * from './magic-link/magic-link-localization';
|
package/dist/plugins.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
1
|
+
import { apiKeyLocalization as e } from "./plugins/api-key/api-key-localization.js";
|
|
2
|
+
import { apiKeyMutationKeys as t } from "./plugins/api-key/api-key-mutation-keys.js";
|
|
3
|
+
import { apiKeyPlugin as n } from "./plugins/api-key/api-key-plugin.js";
|
|
4
|
+
import { deleteUserLocalization as r } from "./plugins/delete-user/delete-user-localization.js";
|
|
5
|
+
import { deleteUserPlugin as i } from "./plugins/delete-user/delete-user-plugin.js";
|
|
6
|
+
import { magicLinkLocalization as a } from "./plugins/magic-link/magic-link-localization.js";
|
|
7
|
+
import { magicLinkMutationKeys as o } from "./plugins/magic-link/magic-link-mutation-keys.js";
|
|
8
|
+
import { magicLinkPlugin as s } from "./plugins/magic-link/magic-link-plugin.js";
|
|
9
|
+
import { multiSessionLocalization as c } from "./plugins/multi-session/multi-session-localization.js";
|
|
10
|
+
import { multiSessionPlugin as l } from "./plugins/multi-session/multi-session-plugin.js";
|
|
11
|
+
import { passkeyLocalization as u } from "./plugins/passkey/passkey-localization.js";
|
|
12
|
+
import { passkeyMutationKeys as d } from "./plugins/passkey/passkey-mutation-keys.js";
|
|
13
|
+
import { passkeyPlugin as f } from "./plugins/passkey/passkey-plugin.js";
|
|
14
|
+
import { themeLocalization as p } from "./plugins/theme/theme-localization.js";
|
|
15
|
+
import { themePlugin as m } from "./plugins/theme/theme-plugin.js";
|
|
16
|
+
import { usernameLocalization as h } from "./plugins/username/username-localization.js";
|
|
17
|
+
import { usernamePlugin as g } from "./plugins/username/username-plugin.js";
|
|
18
|
+
export { e as apiKeyLocalization, t as apiKeyMutationKeys, n as apiKeyPlugin, r as deleteUserLocalization, i as deleteUserPlugin, a as magicLinkLocalization, o as magicLinkMutationKeys, s as magicLinkPlugin, c as multiSessionLocalization, l as multiSessionPlugin, u as passkeyLocalization, d as passkeyMutationKeys, f as passkeyPlugin, p as themeLocalization, m as themePlugin, h as usernameLocalization, g as usernamePlugin };
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth-ui/core",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "vite build",
|
|
7
|
-
"dev": "
|
|
7
|
+
"dev": "tsc --watch",
|
|
8
8
|
"test": "vitest"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"better-auth": "^1.6.
|
|
27
|
+
"better-auth": "^1.6.10",
|
|
28
28
|
"vitest": "^4.1.5"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"better-auth": ">=1.6.
|
|
31
|
+
"better-auth": ">=1.6.10"
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|
|
@@ -48,6 +48,12 @@ export const authQueryKeys = {
|
|
|
48
48
|
query?: TQuery
|
|
49
49
|
) => [...authQueryKeys.user(userId), "listPasskeys", query ?? null] as const,
|
|
50
50
|
|
|
51
|
+
/** Key for the user's API keys list (`apiKey.list`). */
|
|
52
|
+
listApiKeys: <TQuery = undefined>(
|
|
53
|
+
userId: string | undefined,
|
|
54
|
+
query?: TQuery
|
|
55
|
+
) => [...authQueryKeys.user(userId), "listApiKeys", query ?? null] as const,
|
|
56
|
+
|
|
51
57
|
/** Key for `accountInfo` for the given user. */
|
|
52
58
|
accountInfo: <TQuery = undefined>(
|
|
53
59
|
userId: string | undefined,
|
|
@@ -0,0 +1,29 @@
|
|
|
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:
|
|
8
|
+
"Create an API key for programmatic access to your account.",
|
|
9
|
+
/** @remarks `"Create API key"` */
|
|
10
|
+
createApiKey: "Create API key",
|
|
11
|
+
/** @remarks `"No API keys"` */
|
|
12
|
+
noApiKeys: "No API keys",
|
|
13
|
+
/** @remarks `"Name"` */
|
|
14
|
+
name: "Name",
|
|
15
|
+
/** @remarks `"New API key"` */
|
|
16
|
+
newApiKey: "New API key",
|
|
17
|
+
/** @remarks `"Copy this key now. For security reasons you will not be able to see it again."` */
|
|
18
|
+
newApiKeyWarning:
|
|
19
|
+
"This is the only time you'll see this API key. Copy and store it somewhere safe.",
|
|
20
|
+
/** @remarks `"Delete API key"` */
|
|
21
|
+
deleteApiKey: "Delete API key",
|
|
22
|
+
/** @remarks `"This action cannot be undone. Any service using this API key will stop working immediately."` */
|
|
23
|
+
deleteApiKeyWarning:
|
|
24
|
+
"This action cannot be undone. Any service using this API key will stop working immediately.",
|
|
25
|
+
/** @remarks `"I've saved my key"` */
|
|
26
|
+
dismissNewKey: "I've saved my key"
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type ApiKeyLocalization = typeof apiKeyLocalization
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mutation keys contributed by the API key plugin.
|
|
3
|
+
*/
|
|
4
|
+
export const apiKeyMutationKeys = {
|
|
5
|
+
/** Key for `apiKey.create`. */
|
|
6
|
+
createApiKey: ["auth", "apiKey", "create"] as const,
|
|
7
|
+
/** Key for `apiKey.delete`. */
|
|
8
|
+
deleteApiKey: ["auth", "apiKey", "delete"] as const
|
|
9
|
+
} as const
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createAuthPlugin } from "../../lib/create-auth-plugin"
|
|
2
|
+
import {
|
|
3
|
+
type ApiKeyLocalization,
|
|
4
|
+
apiKeyLocalization
|
|
5
|
+
} from "./api-key-localization"
|
|
6
|
+
|
|
7
|
+
export type ApiKeyPluginOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* Override the plugin's default localization strings.
|
|
10
|
+
* @remarks `ApiKeyLocalization`
|
|
11
|
+
*/
|
|
12
|
+
localization?: Partial<ApiKeyLocalization>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const apiKeyPlugin = createAuthPlugin(
|
|
16
|
+
"apiKey",
|
|
17
|
+
(options: ApiKeyPluginOptions = {}) => ({
|
|
18
|
+
localization: { ...apiKeyLocalization, ...options.localization }
|
|
19
|
+
})
|
|
20
|
+
)
|
package/src/plugins/index.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export * from "./api-key/api-key-localization"
|
|
2
|
+
export * from "./api-key/api-key-mutation-keys"
|
|
3
|
+
export * from "./api-key/api-key-plugin"
|
|
1
4
|
export * from "./delete-user/delete-user-localization"
|
|
2
5
|
export * from "./delete-user/delete-user-plugin"
|
|
3
6
|
export * from "./magic-link/magic-link-localization"
|