New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@envelop/generic-auth

Package Overview
Dependencies
Maintainers
1
Versions
1450
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@envelop/generic-auth - npm Package Compare versions

Comparing version

to
4.2.4-alpha-19ed430.0

12

index.d.ts

@@ -1,6 +0,6 @@

import { DefaultContext, Plugin } from '@envelop/core';
import { DefaultContext, Maybe, Plugin, PromiseOrValue } from '@envelop/core';
import { DirectiveNode, FieldNode, GraphQLError, GraphQLObjectType } from 'graphql';
export declare class UnauthenticatedError extends GraphQLError {
}
export declare type ResolveUserFn<UserType, ContextType = DefaultContext> = (context: ContextType) => null | UserType | Promise<UserType | null>;
export declare type ResolveUserFn<UserType, ContextType = DefaultContext> = (context: ContextType) => PromiseOrValue<Maybe<UserType>>;
export declare type ValidateUserFnParams<UserType> = {

@@ -21,3 +21,3 @@ /** The user object. */

export declare const SKIP_AUTH_DIRECTIVE_SDL = "\n directive @skipAuth on FIELD_DEFINITION\n";
export declare type GenericAuthPluginOptions<UserType extends {} = {}, ContextType extends DefaultContext = DefaultContext> = {
export declare type GenericAuthPluginOptions<UserType extends {} = {}, ContextType = DefaultContext, CurrentUserKey extends string = 'currentUser'> = {
/**

@@ -34,3 +34,3 @@ * Here you can implement any custom sync/async code, and use the context built so far in Envelop and the HTTP request

*/
contextFieldName?: 'currentUser' | string;
contextFieldName?: CurrentUserKey;
} & ({

@@ -80,4 +80,4 @@ /**

export declare function defaultProtectSingleValidateFn<UserType>(params: ValidateUserFnParams<UserType>): void | UnauthenticatedError;
export declare const useGenericAuth: <UserType extends {} = {}, ContextType extends DefaultContext = DefaultContext>(options: GenericAuthPluginOptions<UserType, ContextType>) => Plugin<{
export declare const useGenericAuth: <UserType extends {} = {}, ContextType = DefaultContext, CurrentUserKey extends string = "currentUser">(options: GenericAuthPluginOptions<UserType, ContextType, CurrentUserKey>) => Plugin<{
validateUser: ValidateUserFn<UserType>;
}>;
} & Record<CurrentUserKey, UserType>>;
{
"name": "@envelop/generic-auth",
"version": "4.2.3",
"version": "4.2.4-alpha-19ed430.0",
"sideEffects": false,

@@ -5,0 +5,0 @@ "peerDependencies": {