@mframework/adapter-betterauth 0.0.8 → 0.0.9
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/index.js +1 -1
- package/dist/src/auth.d.ts +1 -1
- package/dist/src/auth.js +1 -1
- package/dist/src/betterauth.js +1 -1
- package/dist/src/provider.js +2 -2
- package/dist/src/registry.d.ts +1 -1
- package/package.json +2 -4
- package/src/auth.ts +2 -2
- package/src/betterauth.ts +1 -1
- package/src/provider.ts +2 -2
- package/src/registry.ts +1 -1
- package/src/types-shims.d.ts +3 -3
- package/src/types.d.ts +3 -3
package/dist/index.js
CHANGED
package/dist/src/auth.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AuthAdapter, TransportAdapter } from '@mframework/
|
|
1
|
+
import type { AuthAdapter, TransportAdapter } from '@mframework/core';
|
|
2
2
|
export declare const createAuthAdapter: (transport: TransportAdapter) => AuthAdapter;
|
package/dist/src/auth.js
CHANGED
package/dist/src/betterauth.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "dotenv/config";
|
|
2
2
|
import { betterAuth } from "better-auth";
|
|
3
3
|
import { prismaAdapter } from "better-auth/adapters/prisma";
|
|
4
|
-
import { prisma } from "@mframework/
|
|
4
|
+
import { prisma } from "@mframework/core";
|
|
5
5
|
// Create and export the BetterAuth runtime instance using the centralized
|
|
6
6
|
// Prisma client exported from packages/modules/api. Layers can import `auth`
|
|
7
7
|
// from this package to get the configured auth instance.
|
package/dist/src/provider.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as BetterAuth from 'better-auth';
|
|
2
|
-
import { getAuthConfig } from './config';
|
|
3
|
-
import { getFrameworkContext } from './framework';
|
|
2
|
+
import { getAuthConfig } from './config.js';
|
|
3
|
+
import { getFrameworkContext } from './framework.js';
|
|
4
4
|
// Create a single shared Better Auth client instance
|
|
5
5
|
let client = null;
|
|
6
6
|
function resolveClientFactory() {
|
package/dist/src/registry.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthProvider } from './types';
|
|
1
|
+
import type { AuthProvider } from './types.js';
|
|
2
2
|
export declare function registerAuthProvider(name: string, provider: AuthProvider): void;
|
|
3
3
|
export declare function setActiveAuthProvider(name: string): void;
|
|
4
4
|
export declare function getAuthProvider(): AuthProvider;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mframework/adapter-betterauth",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Official Better-Auth adapter for M Framework Auth Layer",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -29,9 +29,7 @@
|
|
|
29
29
|
"@better-auth/scim": "^1.4.15",
|
|
30
30
|
"@better-auth/sso": "^1.4.12",
|
|
31
31
|
"@better-auth/stripe": "^1.4.15",
|
|
32
|
-
"@mframework/
|
|
33
|
-
"@mframework/core": "^0.0.1",
|
|
34
|
-
"@mframework/sdk": "^0.0.2",
|
|
32
|
+
"@mframework/core": "^0.0.2",
|
|
35
33
|
"@polar-sh/better-auth": "^1.6.3",
|
|
36
34
|
"better-auth": "^1.4.12",
|
|
37
35
|
"typescript": "^5.9.3"
|
package/src/auth.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
AuthAdapter,
|
|
3
3
|
TransportAdapter
|
|
4
|
-
} from '@mframework/
|
|
4
|
+
} from '@mframework/core'
|
|
5
5
|
|
|
6
6
|
import type {
|
|
7
7
|
LoginInput,
|
|
@@ -11,7 +11,7 @@ import type {
|
|
|
11
11
|
User
|
|
12
12
|
} from '@mframework/core'
|
|
13
13
|
|
|
14
|
-
import { unwrap } from './utils'
|
|
14
|
+
import { unwrap } from './utils.js'
|
|
15
15
|
|
|
16
16
|
export const createAuthAdapter = (
|
|
17
17
|
transport: TransportAdapter
|
package/src/betterauth.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "dotenv/config"
|
|
2
2
|
import { betterAuth } from "better-auth"
|
|
3
3
|
import { prismaAdapter } from "better-auth/adapters/prisma"
|
|
4
|
-
import { prisma } from "@mframework/
|
|
4
|
+
import { prisma } from "@mframework/core"
|
|
5
5
|
|
|
6
6
|
// Create and export the BetterAuth runtime instance using the centralized
|
|
7
7
|
// Prisma client exported from packages/modules/api. Layers can import `auth`
|
package/src/provider.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as BetterAuth from 'better-auth'
|
|
2
|
-
import { getAuthConfig } from './config'
|
|
3
|
-
import { getFrameworkContext } from './framework'
|
|
2
|
+
import { getAuthConfig } from './config.js'
|
|
3
|
+
import { getFrameworkContext } from './framework.js'
|
|
4
4
|
|
|
5
5
|
// Create a single shared Better Auth client instance
|
|
6
6
|
let client: any = null
|
package/src/registry.ts
CHANGED
package/src/types-shims.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare module '@mframework/
|
|
1
|
+
declare module '@mframework/core' {
|
|
2
2
|
export type TransportAdapter = {
|
|
3
3
|
request<T = any>(method: string, path: string, opts?: any): Promise<any>
|
|
4
4
|
}
|
|
@@ -16,12 +16,12 @@ declare module '@mframework/core' {
|
|
|
16
16
|
export type Result<T = any> = any
|
|
17
17
|
export type Session = any
|
|
18
18
|
export type User = any
|
|
19
|
-
export type TransportAdapter = import('@mframework/
|
|
19
|
+
export type TransportAdapter = import('@mframework/core').TransportAdapter
|
|
20
20
|
export type RequestOptions = any
|
|
21
21
|
export type APIResponse<T = any> = any
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
declare module '@mframework/
|
|
24
|
+
declare module '@mframework/core' {
|
|
25
25
|
export const prisma: any
|
|
26
26
|
export function useDB(_event?: any): Promise<any>
|
|
27
27
|
export function isValidTable(name: string): boolean
|
package/src/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Re-export the canonical SDK/core types so consumers of this adapter can import
|
|
2
2
|
// from the adapter package and still get accurate types from the source
|
|
3
3
|
// modules.
|
|
4
|
-
export type { TransportAdapter, AuthAdapter, CommerceAdapter, SearchAdapter } from '@mframework/
|
|
4
|
+
export type { TransportAdapter, AuthAdapter, CommerceAdapter, SearchAdapter } from '@mframework/core'
|
|
5
5
|
export type { LoginInput, RegisterInput, Result, Session, User } from '@mframework/core'
|
|
6
6
|
|
|
7
|
-
// Re-export prisma utilities from the
|
|
8
|
-
export { prisma, useDB, isValidTable } from '@mframework/
|
|
7
|
+
// Re-export prisma utilities from the core package for convenience.
|
|
8
|
+
export { prisma, useDB, isValidTable } from '@mframework/core'
|
|
9
9
|
|
|
10
10
|
// Adapter exports
|
|
11
11
|
export function getAuthPlugins(opts?: any): any[]
|