@envelop/auth0 3.4.1-alpha-ffbace6f.0 → 3.4.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/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@envelop/auth0",
3
- "version": "3.4.1-alpha-ffbace6f.0",
3
+ "version": "3.4.2",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@envelop/core": "2.4.1-alpha-ffbace6f.0",
6
+ "@envelop/core": "^2.4.2",
7
7
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
8
8
  },
9
9
  "dependencies": {
@@ -27,7 +27,7 @@
27
27
  "exports": {
28
28
  ".": {
29
29
  "require": {
30
- "types": "./typings/index.d.ts",
30
+ "types": "./typings/index.d.cts",
31
31
  "default": "./cjs/index.js"
32
32
  },
33
33
  "import": {
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "./*": {
43
43
  "require": {
44
- "types": "./typings/*.d.ts",
44
+ "types": "./typings/*.d.cts",
45
45
  "default": "./cjs/*.js"
46
46
  },
47
47
  "import": {
@@ -0,0 +1,30 @@
1
+ import { Plugin } from '@envelop/core';
2
+ import * as JwksRsa from 'jwks-rsa';
3
+ import { VerifyOptions, DecodeOptions } from 'jsonwebtoken';
4
+ import { GraphQLError } from 'graphql';
5
+ export declare type Auth0PluginOptions = {
6
+ domain: string;
7
+ audience: string;
8
+ preventUnauthenticatedAccess?: boolean;
9
+ onError?: (error: Error) => void;
10
+ extractTokenFn?: (context: unknown) => Promise<string> | string;
11
+ jwksClientOptions?: JwksRsa.Options;
12
+ jwtVerifyOptions?: VerifyOptions;
13
+ jwtDecodeOptions?: DecodeOptions;
14
+ extendContextField?: '_auth0' | string;
15
+ tokenType?: string;
16
+ headerName?: string;
17
+ };
18
+ export declare class UnauthenticatedError extends GraphQLError {
19
+ }
20
+ export declare type UserPayload = {
21
+ sub: string;
22
+ [key: string]: any;
23
+ };
24
+ declare type BuildContext<TOptions extends Auth0PluginOptions> = TOptions['extendContextField'] extends string ? {
25
+ [TName in TOptions['extendContextField'] as TOptions['extendContextField']]: UserPayload;
26
+ } : {
27
+ _auth0: UserPayload;
28
+ };
29
+ export declare const useAuth0: <TOptions extends Auth0PluginOptions>(options: TOptions) => Plugin<BuildContext<TOptions>>;
30
+ export {};