@envelop/generic-auth 4.4.1-alpha-20220824165935-4720f031 → 4.5.0
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/README.md +0 -5
- package/package.json +4 -3
- package/typings/index.d.cts +1 -1
- package/typings/index.d.ts +1 -1
package/README.md
CHANGED
|
@@ -78,7 +78,6 @@ This mode offers complete protection for the entire API. It protects your entire
|
|
|
78
78
|
To setup this mode, use the following config:
|
|
79
79
|
|
|
80
80
|
```ts
|
|
81
|
-
import { parse, validate, execute, subscribe } from 'graphql'
|
|
82
81
|
import { envelop } from '@envelop/core'
|
|
83
82
|
import { useGenericAuth, ResolveUserFn, ValidateUserFn } from '@envelop/generic-auth'
|
|
84
83
|
|
|
@@ -93,10 +92,6 @@ const validateUser: ValidateUserFn<UserType> = params => {
|
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
const getEnveloped = envelop({
|
|
96
|
-
parse,
|
|
97
|
-
validate,
|
|
98
|
-
execute,
|
|
99
|
-
subscribe,
|
|
100
95
|
plugins: [
|
|
101
96
|
// ... other plugins ...
|
|
102
97
|
useGenericAuth({
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/generic-auth",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "2.
|
|
6
|
+
"@envelop/core": "^2.6.0",
|
|
7
7
|
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@envelop/extended-validation": "1.
|
|
10
|
+
"@envelop/extended-validation": "^1.9.0",
|
|
11
|
+
"tslib": "^2.4.0"
|
|
11
12
|
},
|
|
12
13
|
"repository": {
|
|
13
14
|
"type": "git",
|
package/typings/index.d.cts
CHANGED
|
@@ -75,6 +75,6 @@ export declare type GenericAuthPluginOptions<UserType extends {} = {}, ContextTy
|
|
|
75
75
|
});
|
|
76
76
|
export declare function defaultProtectAllValidateFn<UserType>(params: ValidateUserFnParams<UserType>): void | UnauthenticatedError;
|
|
77
77
|
export declare function defaultProtectSingleValidateFn<UserType>(params: ValidateUserFnParams<UserType>): void | UnauthenticatedError;
|
|
78
|
-
export declare const useGenericAuth: <UserType extends {} = {}, ContextType = DefaultContext, CurrentUserKey extends string = "currentUser">(options: GenericAuthPluginOptions<UserType, ContextType, CurrentUserKey>) => Plugin<{
|
|
78
|
+
export declare const useGenericAuth: <UserType extends {} = {}, ContextType extends Record<any, any> = DefaultContext, CurrentUserKey extends string = "currentUser">(options: GenericAuthPluginOptions<UserType, ContextType, CurrentUserKey>) => Plugin<{
|
|
79
79
|
validateUser: ValidateUserFn<UserType>;
|
|
80
80
|
} & Record<CurrentUserKey, UserType>>;
|
package/typings/index.d.ts
CHANGED
|
@@ -75,6 +75,6 @@ export declare type GenericAuthPluginOptions<UserType extends {} = {}, ContextTy
|
|
|
75
75
|
});
|
|
76
76
|
export declare function defaultProtectAllValidateFn<UserType>(params: ValidateUserFnParams<UserType>): void | UnauthenticatedError;
|
|
77
77
|
export declare function defaultProtectSingleValidateFn<UserType>(params: ValidateUserFnParams<UserType>): void | UnauthenticatedError;
|
|
78
|
-
export declare const useGenericAuth: <UserType extends {} = {}, ContextType = DefaultContext, CurrentUserKey extends string = "currentUser">(options: GenericAuthPluginOptions<UserType, ContextType, CurrentUserKey>) => Plugin<{
|
|
78
|
+
export declare const useGenericAuth: <UserType extends {} = {}, ContextType extends Record<any, any> = DefaultContext, CurrentUserKey extends string = "currentUser">(options: GenericAuthPluginOptions<UserType, ContextType, CurrentUserKey>) => Plugin<{
|
|
79
79
|
validateUser: ValidateUserFn<UserType>;
|
|
80
80
|
} & Record<CurrentUserKey, UserType>>;
|