@envelop/generic-auth
Advanced tools
Comparing version 0.0.1 to 0.0.2-alpha-a204f5e.0
@@ -6,4 +6,4 @@ import { DefaultContext, Plugin } from '@envelop/types'; | ||
} | ||
export declare type ResolveUserFn<UserType, ContextType = unknown> = (context: ContextType) => null | UserType | Promise<UserType | null>; | ||
export declare type ValidateUserFn<UserType, ContextType = unknown> = (user: UserType, context: ContextType, resolverInfo?: { | ||
export declare type ResolveUserFn<UserType, ContextType = DefaultContext> = (context: ContextType) => null | UserType | Promise<UserType | null>; | ||
export declare type ValidateUserFn<UserType, ContextType = DefaultContext> = (user: UserType, context: ContextType, resolverInfo?: { | ||
root: unknown; | ||
@@ -15,3 +15,3 @@ args: Record<string, unknown>; | ||
export declare const DIRECTIVE_SDL = "\n directive @auth on FIELD_DEFINITION\n"; | ||
export declare type GenericAuthPluginOptions<UserType, ContextType> = { | ||
export declare type GenericAuthPluginOptions<UserType extends {} = {}, ContextType extends DefaultContext = DefaultContext> = { | ||
/** | ||
@@ -59,2 +59,4 @@ * Here you can implement any custom sync/async code, and use the context built so far in Envelop and the HTTP request | ||
export declare function defaultValidateFn<UserType, ContextType>(user: UserType, contextType: ContextType): void; | ||
export declare const useGenericAuth: <UserType extends {}, ContextType extends DefaultContext = DefaultContext>(options: GenericAuthPluginOptions<UserType, ContextType>) => Plugin<ContextType>; | ||
export declare const useGenericAuth: <UserType extends {} = {}, ContextType extends DefaultContext = DefaultContext>(options: GenericAuthPluginOptions<UserType, ContextType>) => Plugin<{ | ||
validateUser: ValidateUserFn<UserType, ContextType>; | ||
}>; |
{ | ||
"name": "@envelop/generic-auth", | ||
"version": "0.0.1", | ||
"version": "0.0.2-alpha-a204f5e.0", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "peerDependencies": { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
27789
215
0