@effectify/node-better-auth 1.0.0-alpha.1 → 1.0.0-alpha.2
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/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { betterAuth, type BetterAuthOptions, type Session, type User } from "better-auth";
|
|
2
|
-
import * as
|
|
2
|
+
import * as Context from "effect/Context";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as Layer from "effect/Layer";
|
|
5
5
|
export declare namespace AuthService {
|
|
6
6
|
export type AuthInstance = ReturnType<typeof betterAuth>;
|
|
7
|
-
const AuthServiceContext_base:
|
|
7
|
+
const AuthServiceContext_base: Context.ServiceClass<AuthServiceContext, "AuthServiceContext", {
|
|
8
8
|
auth: import("better-auth").Auth<BetterAuthOptions>;
|
|
9
9
|
}> & {
|
|
10
10
|
readonly make: (options: BetterAuthOptions) => Effect.Effect<{
|
|
@@ -14,13 +14,13 @@ export declare namespace AuthService {
|
|
|
14
14
|
/**
|
|
15
15
|
* AuthServiceContext provides access to the better-auth instance.
|
|
16
16
|
*
|
|
17
|
-
* In Effect v4, services are created with
|
|
17
|
+
* In Effect v4 beta57, services are created with Context.Service and still compose through Layers.
|
|
18
18
|
* for easy Layer composition.
|
|
19
19
|
*/
|
|
20
20
|
export class AuthServiceContext extends AuthServiceContext_base {
|
|
21
21
|
static readonly layer: (options: BetterAuthOptions) => Layer.Layer<AuthServiceContext, never, never>;
|
|
22
22
|
}
|
|
23
|
-
const AuthContext_base:
|
|
23
|
+
const AuthContext_base: Context.ServiceClass<AuthContext, "AuthContext", {
|
|
24
24
|
readonly user: User;
|
|
25
25
|
readonly session: Session;
|
|
26
26
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { betterAuth } from "better-auth";
|
|
2
|
-
import * as
|
|
2
|
+
import * as Context from "effect/Context";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as Layer from "effect/Layer";
|
|
5
5
|
import * as Data from "effect/Data";
|
|
@@ -8,10 +8,10 @@ export var AuthService;
|
|
|
8
8
|
/**
|
|
9
9
|
* AuthServiceContext provides access to the better-auth instance.
|
|
10
10
|
*
|
|
11
|
-
* In Effect v4, services are created with
|
|
11
|
+
* In Effect v4 beta57, services are created with Context.Service and still compose through Layers.
|
|
12
12
|
* for easy Layer composition.
|
|
13
13
|
*/
|
|
14
|
-
class AuthServiceContext extends
|
|
14
|
+
class AuthServiceContext extends Context.Service()("AuthServiceContext", {
|
|
15
15
|
make: (options) => Effect.gen(function* () {
|
|
16
16
|
// Try to extract database path from Database instance for logging
|
|
17
17
|
const dbPathForLog = options.database &&
|
|
@@ -40,7 +40,7 @@ export var AuthService;
|
|
|
40
40
|
*
|
|
41
41
|
* This is request-scoped context provided at runtime during request handling.
|
|
42
42
|
*/
|
|
43
|
-
class AuthContext extends
|
|
43
|
+
class AuthContext extends Context.Service()("AuthContext") {
|
|
44
44
|
}
|
|
45
45
|
AuthService.AuthContext = AuthContext;
|
|
46
46
|
// In v4, use Data.TaggedError instead of Schema.TaggedError for simple errors
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effectify/node-better-auth",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.2",
|
|
4
4
|
"description": "Integration of better-auth with Effect for Node.js applications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
],
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"better-auth": "1.4.10",
|
|
31
|
-
"effect": "4.0.0-beta.
|
|
31
|
+
"effect": "4.0.0-beta.57"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@effect/platform-node": "4.0.0-beta.
|
|
35
|
-
"@effect/vitest": "4.0.0-beta.
|
|
34
|
+
"@effect/platform-node": "4.0.0-beta.57",
|
|
35
|
+
"@effect/vitest": "4.0.0-beta.57",
|
|
36
36
|
"@types/better-sqlite3": "7.6.13",
|
|
37
37
|
"@types/node": "20.19.25",
|
|
38
38
|
"better-sqlite3": "12.6.2",
|
|
39
|
-
"effect": "4.0.0-beta.
|
|
39
|
+
"effect": "4.0.0-beta.57",
|
|
40
40
|
"vitest": "4.1.2"
|
|
41
41
|
},
|
|
42
42
|
"dependenciesMeta": {},
|