From c6baf360d5a85694bc5667b979780cc38539a10b Mon Sep 17 00:00:00 2001 From: Dmitry Maganov Date: Mon, 23 Sep 2019 22:47:13 +0300 Subject: [PATCH] fix: minor stuff - `authentication-client`: `params` as a second optional argument for `authenticate`. - `primus`: does not have `SOCKET_KEY` anymore and the options argument is optional. - `socketio` and `primus`: return configure functions that take an app as an argument. --- packages/authentication-client/src/core.ts | 6 +++--- packages/primus/index.d.ts | 3 +-- packages/socketio/index.d.ts | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/authentication-client/src/core.ts b/packages/authentication-client/src/core.ts index 47b4040ed1..effec73b8f 100644 --- a/packages/authentication-client/src/core.ts +++ b/packages/authentication-client/src/core.ts @@ -1,5 +1,5 @@ import { NotAuthenticated, FeathersError } from '@feathersjs/errors'; -import { Application } from '@feathersjs/feathers'; +import { Application, Params } from '@feathersjs/feathers'; import { AuthenticationRequest, AuthenticationResult } from '@feathersjs/authentication'; import { Storage, StorageWrapper } from './storage'; @@ -149,12 +149,12 @@ export class AuthenticationClient { return authPromise; } - authenticate (authentication: AuthenticationRequest): Promise { + authenticate (authentication: AuthenticationRequest, params?: Params): Promise { if (!authentication) { return this.reAuthenticate(); } - const promise = this.service.create(authentication) + const promise = this.service.create(authentication, params) .then((authResult: AuthenticationResult) => { const { accessToken } = authResult; diff --git a/packages/primus/index.d.ts b/packages/primus/index.d.ts index b6a0f92e54..7226d5c3ea 100644 --- a/packages/primus/index.d.ts +++ b/packages/primus/index.d.ts @@ -6,7 +6,6 @@ declare const configurePrimus: FeathersPrimus; export = configurePrimus; interface FeathersPrimus { - (options: any, callback?: (primus: any) => void): () => void; - readonly SOCKET_KEY: unique symbol; + (options?: any, callback?: (primus: any) => void): (app: any) => void; default: FeathersPrimus; } diff --git a/packages/socketio/index.d.ts b/packages/socketio/index.d.ts index c17797a2a8..3bd63b2d5c 100644 --- a/packages/socketio/index.d.ts +++ b/packages/socketio/index.d.ts @@ -5,8 +5,8 @@ declare const socketio: FeathersSocketIO; export = socketio; interface FeathersSocketIO { - (callback?: (io: io.Server) => void): () => void; - (options: number | io.ServerOptions, callback?: (io: io.Server) => void): () => void; - (port: number, options?: io.ServerOptions, callback?: (io: io.Server) => void): () => void; + (callback?: (io: io.Server) => void): (app: any) => void; + (options: number | io.ServerOptions, callback?: (io: io.Server) => void): (app: any) => void; + (port: number, options?: io.ServerOptions, callback?: (io: io.Server) => void): (app: any) => void; default: FeathersSocketIO; }