@mframework/adapter-betterauth 0.0.3 → 0.0.5
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/package.json +6 -8
- package/src/index.ts +38 -0
- package/src/types.d.ts +5 -0
- package/index.ts +0 -38
package/package.json
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mframework/adapter-betterauth",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Official Better-Auth adapter for M Framework Auth Layer",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"types": "module",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"import": "./src/index.ts",
|
|
10
|
-
"types": "./src/types.d.ts"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
7
|
"scripts": {
|
|
14
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
15
9
|
"build": "tsc -p tsconfig.json",
|
|
@@ -19,7 +13,11 @@
|
|
|
19
13
|
"keywords": [
|
|
20
14
|
"meeovi",
|
|
21
15
|
"adapter",
|
|
22
|
-
"
|
|
16
|
+
"authentication",
|
|
17
|
+
"better-auth",
|
|
18
|
+
"auth",
|
|
19
|
+
"typescript",
|
|
20
|
+
"m-framework"
|
|
23
21
|
],
|
|
24
22
|
"author": "M Framework",
|
|
25
23
|
"license": "MIT",
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
setAuthAdapter
|
|
3
|
+
} from '@mframework/sdk'
|
|
4
|
+
|
|
5
|
+
import { createAuthTransport } from './transport'
|
|
6
|
+
import { createAuthAdapter } from './auth'
|
|
7
|
+
|
|
8
|
+
export const installAuthAdapter = (config: { baseUrl: string; apiKey?: string }) => {
|
|
9
|
+
const transport = createAuthTransport(config)
|
|
10
|
+
|
|
11
|
+
setAuthAdapter(createAuthAdapter(transport))
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Export the server-side BetterAuth instance (if present) so other layers can
|
|
15
|
+
// import the runtime `auth` instance from this package. The file is optional
|
|
16
|
+
// and will only exist when BetterAuth is configured for the adapter.
|
|
17
|
+
export { auth, Auth } from './betterauth'
|
|
18
|
+
export { default as BetterAuthProvider } from './provider'
|
|
19
|
+
export { getAuthPlugins } from './plugins'
|
|
20
|
+
|
|
21
|
+
export * from './types'
|
|
22
|
+
export * from './auth'
|
|
23
|
+
export * from './utils'
|
|
24
|
+
export * from './transport'
|
|
25
|
+
export * from './framework'
|
|
26
|
+
export * from './registry'
|
|
27
|
+
export * from './validation'
|
|
28
|
+
export * from './config'
|
|
29
|
+
export * from 'better-auth/client/plugins'
|
|
30
|
+
export * from '@polar-sh/better-auth'
|
|
31
|
+
export * as BetterAuth from 'better-auth'
|
|
32
|
+
export { getAuthConfig } from './config'
|
|
33
|
+
export { getFrameworkContext } from './framework'
|
|
34
|
+
export type { AuthProvider } from './types'
|
|
35
|
+
export { registerAuthProvider } from './registry'
|
|
36
|
+
export { polarClient } from '@polar-sh/better-auth'
|
|
37
|
+
export { adminClient, inferAdditionalFields } from 'better-auth/client/plugins'
|
|
38
|
+
export { stripeClient } from '@better-auth/stripe/client'
|
package/src/types.d.ts
CHANGED
|
@@ -11,3 +11,8 @@ export { prisma, useDB, isValidTable } from '@mframework/api'
|
|
|
11
11
|
export function getAuthPlugins(opts?: any): any[]
|
|
12
12
|
export const BetterAuthProvider: any
|
|
13
13
|
export default BetterAuthProvider
|
|
14
|
+
|
|
15
|
+
// Re-export the concrete types from the source `types.ts` so the package's
|
|
16
|
+
// declared `.d.ts` entry exposes `AuthProvider` and related interfaces to
|
|
17
|
+
// consumers importing from the package root.
|
|
18
|
+
export type { AuthProvider, AuthCredentials, AuthRegistration, AuthSession } from './types'
|
package/index.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
setAuthAdapter
|
|
3
|
-
} from '@mframework/sdk'
|
|
4
|
-
|
|
5
|
-
import { createAuthTransport } from './src/transport'
|
|
6
|
-
import { createAuthAdapter } from './src/auth'
|
|
7
|
-
|
|
8
|
-
export const installAuthAdapter = (config: { baseUrl: string; apiKey?: string }) => {
|
|
9
|
-
const transport = createAuthTransport(config)
|
|
10
|
-
|
|
11
|
-
setAuthAdapter(createAuthAdapter(transport))
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// Export the server-side BetterAuth instance (if present) so other layers can
|
|
15
|
-
// import the runtime `auth` instance from this package. The file is optional
|
|
16
|
-
// and will only exist when BetterAuth is configured for the adapter.
|
|
17
|
-
export { auth, Auth } from './src/betterauth'
|
|
18
|
-
export { default as BetterAuthProvider } from './src/provider'
|
|
19
|
-
export { getAuthPlugins } from './src/plugins'
|
|
20
|
-
|
|
21
|
-
export * from './src/types'
|
|
22
|
-
export * from './src/auth'
|
|
23
|
-
export * from './src/utils'
|
|
24
|
-
export * from './src/transport'
|
|
25
|
-
export * from './src/framework'
|
|
26
|
-
export * from './src/registry'
|
|
27
|
-
export * from './src/validation'
|
|
28
|
-
export * from './src/config'
|
|
29
|
-
export * from 'better-auth/client/plugins'
|
|
30
|
-
export * from '@polar-sh/better-auth'
|
|
31
|
-
export * as BetterAuth from 'better-auth'
|
|
32
|
-
export { getAuthConfig } from './src/config'
|
|
33
|
-
export { getFrameworkContext } from './src/framework'
|
|
34
|
-
export type { AuthProvider } from './src/types'
|
|
35
|
-
export { registerAuthProvider } from './src/registry'
|
|
36
|
-
export { polarClient } from '@polar-sh/better-auth'
|
|
37
|
-
export { adminClient, inferAdditionalFields } from 'better-auth/client/plugins'
|
|
38
|
-
export { stripeClient } from '@better-auth/stripe/client'
|