@lunora/auth 1.0.0-alpha.56 → 1.0.0-alpha.58
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{passkeyClient as e}from"@better-auth/passkey/client";import{organizationClient as r,twoFactorClient as l,magicLinkClient as u,emailOTPClient as p,adminClient as g}from"better-auth/client/plugins";const h=(t={})=>{const n=[];return t.organization&&n.push(r()),t.twoFactor&&n.push(l()),t.passkey&&n.push(e()),t.magicLink&&n.push(u()),t.emailOtp&&n.push(p()),t.admin&&n.push(g()),n},m=()=>globalThis.location?.origin,L=(t,n={})=>{const{baseURL:a,extraPlugins:i=[],plugins:o,...s}=n;return t({...s,baseURL:a??m(),plugins:[...h(o),...i]})};export{L as createLunoraAuthClient,h as lunoraAuthPlugins};
|
|
@@ -1,3 +1,47 @@
|
|
|
1
|
+
import { organizationClient } from 'better-auth/client/plugins';
|
|
2
|
+
export { adminClient, anonymousClient, customSessionClient, deviceAuthorizationClient, emailOTPClient, inferAdditionalFields, inferOrgAdditionalFields, jwtClient, lastLoginMethodClient, magicLinkClient, multiSessionClient, oneTimeTokenClient, organizationClient, phoneNumberClient, siweClient, twoFactorClient, usernameClient } from 'better-auth/client/plugins';
|
|
1
3
|
export { oauthProviderClient } from '@better-auth/oauth-provider/client';
|
|
2
4
|
export { passkeyClient } from '@better-auth/passkey/client';
|
|
3
|
-
|
|
5
|
+
/** Which client plugins to include. Each defaults to `false`. */
|
|
6
|
+
interface LunoraAuthPluginToggles {
|
|
7
|
+
admin?: boolean;
|
|
8
|
+
emailOtp?: boolean;
|
|
9
|
+
magicLink?: boolean;
|
|
10
|
+
organization?: boolean;
|
|
11
|
+
passkey?: boolean;
|
|
12
|
+
twoFactor?: boolean;
|
|
13
|
+
}
|
|
14
|
+
type LunoraAuthClientPlugin = ReturnType<typeof organizationClient>;
|
|
15
|
+
declare const lunoraAuthPlugins: (toggles?: LunoraAuthPluginToggles) => LunoraAuthClientPlugin[];
|
|
16
|
+
/** Options for {@link createLunoraAuthClient}; anything else is forwarded to `createAuthClient`. */
|
|
17
|
+
interface CreateLunoraAuthClientOptions {
|
|
18
|
+
[option: string]: unknown;
|
|
19
|
+
/** Defaults to the current origin, which is right for a same-origin app. */
|
|
20
|
+
baseURL?: string;
|
|
21
|
+
/** Your own client plugins, appended after the standard set. */
|
|
22
|
+
extraPlugins?: LunoraAuthClientPlugin[];
|
|
23
|
+
/** Which standard client plugins to include. */
|
|
24
|
+
plugins?: LunoraAuthPluginToggles;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Build a better-auth client with Lunora's standard plugin set from toggles.
|
|
28
|
+
*
|
|
29
|
+
* You pass your framework's `createAuthClient` in — `better-auth/react`,
|
|
30
|
+
* `/vue`, `/svelte`, or `/solid` — because the variant has to match the UI
|
|
31
|
+
* framework, and a helper that picked for you would either guess wrong or drag
|
|
32
|
+
* every variant into your bundle.
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* import { createAuthClient } from "better-auth/react";
|
|
36
|
+
* import { createLunoraAuthClient } from "@lunora/auth/plugins/client";
|
|
37
|
+
*
|
|
38
|
+
* export const authClient = createLunoraAuthClient(createAuthClient, {
|
|
39
|
+
* plugins: { organization: true, passkey: true, twoFactor: true },
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* Reach for {@link lunoraAuthPlugins} instead when you want to own the
|
|
44
|
+
* `createAuthClient` call and only borrow the plugin array.
|
|
45
|
+
*/
|
|
46
|
+
declare const createLunoraAuthClient: <TClient>(createAuthClient: (options: Record<string, unknown>) => TClient, options?: CreateLunoraAuthClientOptions) => TClient;
|
|
47
|
+
export { type CreateLunoraAuthClientOptions, type LunoraAuthClientPlugin, type LunoraAuthPluginToggles, createLunoraAuthClient, lunoraAuthPlugins };
|
package/dist/plugins-client.d.ts
CHANGED
|
@@ -1,3 +1,47 @@
|
|
|
1
|
+
import { organizationClient } from 'better-auth/client/plugins';
|
|
2
|
+
export { adminClient, anonymousClient, customSessionClient, deviceAuthorizationClient, emailOTPClient, inferAdditionalFields, inferOrgAdditionalFields, jwtClient, lastLoginMethodClient, magicLinkClient, multiSessionClient, oneTimeTokenClient, organizationClient, phoneNumberClient, siweClient, twoFactorClient, usernameClient } from 'better-auth/client/plugins';
|
|
1
3
|
export { oauthProviderClient } from '@better-auth/oauth-provider/client';
|
|
2
4
|
export { passkeyClient } from '@better-auth/passkey/client';
|
|
3
|
-
|
|
5
|
+
/** Which client plugins to include. Each defaults to `false`. */
|
|
6
|
+
interface LunoraAuthPluginToggles {
|
|
7
|
+
admin?: boolean;
|
|
8
|
+
emailOtp?: boolean;
|
|
9
|
+
magicLink?: boolean;
|
|
10
|
+
organization?: boolean;
|
|
11
|
+
passkey?: boolean;
|
|
12
|
+
twoFactor?: boolean;
|
|
13
|
+
}
|
|
14
|
+
type LunoraAuthClientPlugin = ReturnType<typeof organizationClient>;
|
|
15
|
+
declare const lunoraAuthPlugins: (toggles?: LunoraAuthPluginToggles) => LunoraAuthClientPlugin[];
|
|
16
|
+
/** Options for {@link createLunoraAuthClient}; anything else is forwarded to `createAuthClient`. */
|
|
17
|
+
interface CreateLunoraAuthClientOptions {
|
|
18
|
+
[option: string]: unknown;
|
|
19
|
+
/** Defaults to the current origin, which is right for a same-origin app. */
|
|
20
|
+
baseURL?: string;
|
|
21
|
+
/** Your own client plugins, appended after the standard set. */
|
|
22
|
+
extraPlugins?: LunoraAuthClientPlugin[];
|
|
23
|
+
/** Which standard client plugins to include. */
|
|
24
|
+
plugins?: LunoraAuthPluginToggles;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Build a better-auth client with Lunora's standard plugin set from toggles.
|
|
28
|
+
*
|
|
29
|
+
* You pass your framework's `createAuthClient` in — `better-auth/react`,
|
|
30
|
+
* `/vue`, `/svelte`, or `/solid` — because the variant has to match the UI
|
|
31
|
+
* framework, and a helper that picked for you would either guess wrong or drag
|
|
32
|
+
* every variant into your bundle.
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* import { createAuthClient } from "better-auth/react";
|
|
36
|
+
* import { createLunoraAuthClient } from "@lunora/auth/plugins/client";
|
|
37
|
+
*
|
|
38
|
+
* export const authClient = createLunoraAuthClient(createAuthClient, {
|
|
39
|
+
* plugins: { organization: true, passkey: true, twoFactor: true },
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* Reach for {@link lunoraAuthPlugins} instead when you want to own the
|
|
44
|
+
* `createAuthClient` call and only borrow the plugin array.
|
|
45
|
+
*/
|
|
46
|
+
declare const createLunoraAuthClient: <TClient>(createAuthClient: (options: Record<string, unknown>) => TClient, options?: CreateLunoraAuthClientOptions) => TClient;
|
|
47
|
+
export { type CreateLunoraAuthClientOptions, type LunoraAuthClientPlugin, type LunoraAuthPluginToggles, createLunoraAuthClient, lunoraAuthPlugins };
|
package/dist/plugins-client.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createLunoraAuthClient as n,lunoraAuthPlugins as t}from"./packem_shared/createLunoraAuthClient-BM6pkmrM.mjs";import{oauthProviderClient as l}from"@better-auth/oauth-provider/client";import{passkeyClient as C}from"@better-auth/passkey/client";import{adminClient as s,anonymousClient as m,customSessionClient as u,deviceAuthorizationClient as d,emailOTPClient as f,inferAdditionalFields as h,inferOrgAdditionalFields as p,jwtClient as c,lastLoginMethodClient as g,magicLinkClient as A,multiSessionClient as x,oneTimeTokenClient as k,organizationClient as w,phoneNumberClient as F,siweClient as L,twoFactorClient as P,usernameClient as T}from"better-auth/client/plugins";export{s as adminClient,m as anonymousClient,n as createLunoraAuthClient,u as customSessionClient,d as deviceAuthorizationClient,f as emailOTPClient,h as inferAdditionalFields,p as inferOrgAdditionalFields,c as jwtClient,g as lastLoginMethodClient,t as lunoraAuthPlugins,A as magicLinkClient,x as multiSessionClient,l as oauthProviderClient,k as oneTimeTokenClient,w as organizationClient,C as passkeyClient,F as phoneNumberClient,L as siweClient,P as twoFactorClient,T as usernameClient};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/auth",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.58",
|
|
4
4
|
"description": "Auth for Lunora — a thin better-auth wrapper: email/password, OAuth, plugins, D1-backed",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"auth",
|
|
@@ -103,9 +103,9 @@
|
|
|
103
103
|
"@better-auth/oauth-provider": "1.7.0-rc.2",
|
|
104
104
|
"@better-auth/passkey": "1.7.0-rc.2",
|
|
105
105
|
"@better-auth/scim": "1.7.0-rc.2",
|
|
106
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
107
|
-
"@lunora/server": "1.0.0-alpha.
|
|
108
|
-
"@lunora/values": "1.0.0-alpha.
|
|
106
|
+
"@lunora/errors": "1.0.0-alpha.9",
|
|
107
|
+
"@lunora/server": "1.0.0-alpha.51",
|
|
108
|
+
"@lunora/values": "1.0.0-alpha.12",
|
|
109
109
|
"@visulima/disposable-email-domains": "1.0.1",
|
|
110
110
|
"@visulima/email-verifier": "1.0.1",
|
|
111
111
|
"@visulima/free-email-domains": "1.0.0",
|