@withstudiocms/auth-kit 0.1.1 → 0.1.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/index.d.ts +5 -5
- package/dist/modules/session.d.ts +4 -4
- package/dist/modules/user.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -29,10 +29,10 @@ declare const AuthKit_base: Effect.Service.Class<AuthKit, "@withstudiocms/AuthKi
|
|
|
29
29
|
readonly createSession: (token: string, userId: string) => Effect.Effect<import("./types.js").UserSession, import("./errors.js").SessionError, never>;
|
|
30
30
|
readonly validateSessionToken: (token: string) => Effect.Effect<import("./types.js").SessionValidationResult, import("./errors.js").SessionError, never>;
|
|
31
31
|
readonly invalidateSession: (sessionId: string) => Effect.Effect<void, import("./errors.js").SessionError, never>;
|
|
32
|
-
readonly setSessionTokenCookie: (context: import("astro").APIContext
|
|
33
|
-
readonly deleteSessionTokenCookie: (context: import("astro").APIContext
|
|
34
|
-
readonly setOAuthSessionTokenCookie: (context: import("astro").APIContext
|
|
35
|
-
readonly createUserSession: (userId: string, context: import("astro").APIContext
|
|
32
|
+
readonly setSessionTokenCookie: (context: import("astro").APIContext | import("astro").AstroGlobal<Record<string, any>, import("astro/runtime/server/index.js").AstroComponentFactory, Record<string, string | undefined>>, token: string, expiresAt: Date, secure?: boolean | undefined) => Effect.Effect<void, import("./errors.js").SessionError, never>;
|
|
33
|
+
readonly deleteSessionTokenCookie: (context: import("astro").APIContext | import("astro").AstroGlobal<Record<string, any>, import("astro/runtime/server/index.js").AstroComponentFactory, Record<string, string | undefined>>, secure?: boolean | undefined) => Effect.Effect<void, import("./errors.js").SessionError, never>;
|
|
34
|
+
readonly setOAuthSessionTokenCookie: (context: import("astro").APIContext | import("astro").AstroGlobal<Record<string, any>, import("astro/runtime/server/index.js").AstroComponentFactory, Record<string, string | undefined>>, key: string, value: string, secure?: boolean | undefined) => Effect.Effect<void, import("./errors.js").SessionError, never>;
|
|
35
|
+
readonly createUserSession: (userId: string, context: import("astro").APIContext | import("astro").AstroGlobal<Record<string, any>, import("astro/runtime/server/index.js").AstroComponentFactory, Record<string, string | undefined>>, secure?: boolean | undefined) => Effect.Effect<void, import("./errors.js").SessionError, never>;
|
|
36
36
|
}, import("./errors.js").SessionError, never>;
|
|
37
37
|
readonly User: Effect.Effect<{
|
|
38
38
|
readonly verifyUsernameInput: (username: string) => Effect.Effect<string | true, import("./errors.js").CheckIfUnsafeError | import("./errors.js").UserError, never>;
|
|
@@ -45,7 +45,7 @@ declare const AuthKit_base: Effect.Service.Class<AuthKit, "@withstudiocms/AuthKi
|
|
|
45
45
|
readonly updateUserPassword: (userId: string, password: string) => Effect.Effect<import("./types.js").UserData, import("@withstudiocms/effect/scrypt").ScryptError | import("./errors.js").UserError, never>;
|
|
46
46
|
readonly getUserPasswordHash: (userId: string) => Effect.Effect<string, import("./errors.js").UserError, never>;
|
|
47
47
|
readonly getUserFromEmail: (email: string) => Effect.Effect<import("./types.js").CombinedUserData | null | undefined, import("./errors.js").UserError, never>;
|
|
48
|
-
readonly getUserData: (context: import("astro").APIContext
|
|
48
|
+
readonly getUserData: (context: import("astro").APIContext | import("astro").AstroGlobal<Record<string, any>, import("astro/runtime/server/index.js").AstroComponentFactory, Record<string, string | undefined>>) => Effect.Effect<import("./types.js").UserSessionData, import("./errors.js").SessionError | import("./errors.js").UserError, never>;
|
|
49
49
|
readonly getUserPermissionLevel: (userData: import("./types.js").UserSessionData | import("./types.js").CombinedUserData | null) => Effect.Effect<import("./types.js").UserPermissionLevel, import("./errors.js").UserError, never>;
|
|
50
50
|
readonly isUserAllowed: (userData: import("./types.js").UserSessionData | import("./types.js").CombinedUserData | null, requiredPerms: "owner" | "admin" | "editor" | "visitor" | "unknown") => Effect.Effect<boolean, import("./errors.js").UserError, never>;
|
|
51
51
|
}, import("./errors.js").SessionError | import("./errors.js").UserError, never>;
|
|
@@ -27,8 +27,8 @@ export declare const Session: (config: SessionConfig) => Effect.Effect<{
|
|
|
27
27
|
readonly createSession: (token: string, userId: string) => Effect.Effect<import("../types.js").UserSession, SessionError, never>;
|
|
28
28
|
readonly validateSessionToken: (token: string) => Effect.Effect<SessionValidationResult, SessionError, never>;
|
|
29
29
|
readonly invalidateSession: (sessionId: string) => Effect.Effect<void, SessionError, never>;
|
|
30
|
-
readonly setSessionTokenCookie: (context: APIContext
|
|
31
|
-
readonly deleteSessionTokenCookie: (context: APIContext
|
|
32
|
-
readonly setOAuthSessionTokenCookie: (context: APIContext
|
|
33
|
-
readonly createUserSession: (userId: string, context: APIContext
|
|
30
|
+
readonly setSessionTokenCookie: (context: APIContext | AstroGlobal<Record<string, any>, import("astro/runtime/server/index.js").AstroComponentFactory, Record<string, string | undefined>>, token: string, expiresAt: Date, secure?: boolean | undefined) => Effect.Effect<void, SessionError, never>;
|
|
31
|
+
readonly deleteSessionTokenCookie: (context: APIContext | AstroGlobal<Record<string, any>, import("astro/runtime/server/index.js").AstroComponentFactory, Record<string, string | undefined>>, secure?: boolean | undefined) => Effect.Effect<void, SessionError, never>;
|
|
32
|
+
readonly setOAuthSessionTokenCookie: (context: APIContext | AstroGlobal<Record<string, any>, import("astro/runtime/server/index.js").AstroComponentFactory, Record<string, string | undefined>>, key: string, value: string, secure?: boolean | undefined) => Effect.Effect<void, SessionError, never>;
|
|
33
|
+
readonly createUserSession: (userId: string, context: APIContext | AstroGlobal<Record<string, any>, import("astro/runtime/server/index.js").AstroComponentFactory, Record<string, string | undefined>>, secure?: boolean | undefined) => Effect.Effect<void, SessionError, never>;
|
|
34
34
|
}, SessionError, never>;
|
package/dist/modules/user.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export declare const User: ({ Scrypt, session, userTools }: UserConfig) => Effec
|
|
|
43
43
|
readonly updateUserPassword: (userId: string, password: string) => Effect.Effect<import("../types.js").UserData, import("@withstudiocms/effect/scrypt").ScryptError | UserError, never>;
|
|
44
44
|
readonly getUserPasswordHash: (userId: string) => Effect.Effect<string, UserError, never>;
|
|
45
45
|
readonly getUserFromEmail: (email: string) => Effect.Effect<CombinedUserData | null | undefined, UserError, never>;
|
|
46
|
-
readonly getUserData: (context: APIContext
|
|
46
|
+
readonly getUserData: (context: APIContext | AstroGlobal<Record<string, any>, import("astro/runtime/server/index.js").AstroComponentFactory, Record<string, string | undefined>>) => Effect.Effect<UserSessionData, import("../errors.js").SessionError | UserError, never>;
|
|
47
47
|
readonly getUserPermissionLevel: (userData: UserSessionData | CombinedUserData | null) => Effect.Effect<UserPermissionLevel, UserError, never>;
|
|
48
48
|
readonly isUserAllowed: (userData: UserSessionData | CombinedUserData | null, requiredPerms: "owner" | "admin" | "editor" | "visitor" | "unknown") => Effect.Effect<boolean, UserError, never>;
|
|
49
49
|
}, import("../errors.js").SessionError | UserError, never>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@withstudiocms/auth-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Utilities for managing authentication",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "withstudiocms",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@oslojs/binary": "^1.0.0",
|
|
60
60
|
"@oslojs/crypto": "^1.0.1",
|
|
61
61
|
"@oslojs/encoding": "^1.1.0",
|
|
62
|
-
"@withstudiocms/effect": "^0.
|
|
62
|
+
"@withstudiocms/effect": "^0.2.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@types/node": "^22.0.0"
|