@types/feathersjs__authentication-oauth1
TypeScript icon, indicating that this package has built-in type declarations

1.0.10 • Public • Published

Installation

npm install --save @types/feathersjs__authentication-oauth1

Summary

This package contains type definitions for @feathersjs/authentication-oauth1 (https://feathersjs.com).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/feathersjs__authentication-oauth1.

import { Application, Paginated } from "@feathersjs/feathers";
import { Request } from "express";
// eslint-disable-next-line @definitelytyped/no-self-import
import * as self from "@feathersjs/authentication-oauth1";

declare const feathersAuthenticationOAuth1:
    & ((options?: FeathersAuthenticationOAuth1Options) => () => void)
    & typeof self;
export default feathersAuthenticationOAuth1;

export interface FeathersAuthenticationOAuth1Options {
    /**
     * The field to look up the entity by when logging in with the provider. Defaults to '<provider>Id' (ie. 'twitterId').
     */
    idField: string;
    /**
     * The route to register the middleware
     */
    path: string;
    /**
     * The route to register the callback handler
     */
    callbackPath: string;
    /**
     * hostname[:port]/auth/<provider>/callback',
     */
    callbackURL: string;
    /**
     * the entity that you are looking up
     */
    entity: string;
    /**
     * the service to look up the entity
     */
    service: string;
    /**
     * whether the request object should be passed to `verify`
     */
    passReqToCallback: boolean;
    /**
     * whether to use sessions,
     */
    session: boolean;
    /**
     * Express middleware for handling the oauth callback. Defaults to the built in middleware. todo: needs a proper type
     */
    handler: any;
    /**
     * The response formatter. Defaults the the built in feathers-rest formatter, which returns JSON. todo: needs a proper type
     */
    formatter: any;
    /**
     * A Verifier class. Defaults to the built-in one but can be a custom one. See below for details.
     */
    Verifier: OAuth1Verifier;
}

export class OAuth1Verifier {
    constructor(app: Application, options: any);

    _updateEntity(entity: any, data: { profile: any; accessToken: string; refreshToken: string }): Promise<any>; // updates an existing entity
    _createEntity(data: { profile: any; accessToken: string; refreshToken: string }): Promise<any>; // creates an entity if they didn't exist already
    _normalizeResult<T>(results: T[] | Paginated<T>): Promise<T>; // normalizes result from service to account for pagination
    verify(
        req: Request,
        accessToken: string,
        refreshToken: string,
        profile: any,
        done: (err: Error | null, user: object, info: object) => void,
    ): void;
}

Additional Details

Credits

These definitions were written by Jan Lohage.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.70ts4.3
1.0.70ts4.4
1.0.60ts3.2
1.0.60ts3.3
1.0.60ts3.4
1.0.60ts3.5
1.0.60ts3.6
1.0.60ts3.7
1.0.60ts3.8
1.0.60ts3.9
1.0.60ts4.0
1.0.60ts4.1
1.0.60ts4.2
1.0.50ts3.1
1.0.40ts2.8
1.0.40ts2.9
1.0.40ts3.0
1.0.30ts2.3
1.0.30ts2.4
1.0.30ts2.5
1.0.30ts2.6
1.0.30ts2.7
1.0.00ts2.2
1.0.102ts5.8
1.0.102ts5.7
1.0.102latest
1.0.102ts4.5
1.0.102ts4.6
1.0.102ts4.7
1.0.102ts4.8
1.0.102ts4.9
1.0.102ts5.0
1.0.102ts5.1
1.0.102ts5.2
1.0.102ts5.3
1.0.102ts5.4
1.0.102ts5.5
1.0.102ts5.6
1.0.102ts5.9

Version History

VersionDownloads (Last 7 Days)Published
1.0.102
1.0.90
1.0.80
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i @types/feathersjs__authentication-oauth1

Weekly Downloads

2

Version

1.0.10

License

MIT

Unpacked Size

7.68 kB

Total Files

5

Last publish

Collaborators

  • types