upating hapi-auth-bearer-token to use the newest hapi__hapi typings instead of the old hapi ones (#43020)

This commit is contained in:
Rodrigo Saboya 2020-03-12 20:13:30 -03:00 committed by GitHub
parent b2292f9963
commit cd06f6a8c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 3 deletions

View File

@ -1,6 +1,6 @@
// from https://github.com/johnbrett/hapi-auth-bearer-token
import { Server } from 'hapi';
import { Server } from '@hapi/hapi';
import * as AuthBearer from 'hapi-auth-bearer-token';
const server = new Server({ port: 8080 });

View File

@ -9,11 +9,11 @@ import {
Plugin,
ResponseToolkit,
AuthenticationData,
} from 'hapi';
} from '@hapi/hapi';
type ValidateReturn = AuthenticationData & { isValid: boolean };
declare module 'hapi' {
declare module '@hapi/hapi' {
interface ServerAuth {
strategy(name: string, scheme: 'bearer-access-token', options: BearerToken.SchemaOptions): void;
}

View File

@ -12,6 +12,32 @@
"typeRoots": [
"../"
],
"paths": {
"@hapi/hapi": [
"hapi__hapi"
],
"@hapi/boom": [
"hapi__boom"
],
"@hapi/shot": [
"hapi__shot"
],
"@hapi/mimos": [
"hapi__mimos"
],
"@hapi/iron": [
"hapi__iron"
],
"@hapi/joi": [
"hapi__joi"
],
"@hapi/podium": [
"hapi__podium"
],
"@hapi/catbox": [
"hapi__catbox"
]
},
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true