+ { - adapter?: A - paginate?: PaginationParams -} - -/** - * Hook-less (internal) service methods. Directly call database adapter service methods - * without running any service-level hooks or sanitization. This can be useful if you need the raw data - * from the service and don't want to trigger any of its hooks. - * - * Important: These methods are only available internally on the server, not on the client - * side and only for the Feathers database adapters. - * - * These methods do not trigger events. - * - * @see {@link https://docs.feathersjs.com/guides/migrating.html#hook-less-service-methods} - */ -export interface InternalServiceMethods< - Result = any, - Data = Result, - PatchData = Partial, - Params extends AdapterParams = AdapterParams, - IdType = Id -> { - /** - * Retrieve all resources from this service. - * Does not sanitize the query and should only be used on the server. - * - * @param _params - Service call parameters {@link Params} - */ - _find(_params?: Params & { paginate?: PaginationOptions }): Promise> - _find(_params?: Params & { paginate: false }): Promise - _find(params?: Params): Promise > - - /** - * Retrieve a single resource matching the given ID, skipping any service-level hooks. - * Does not sanitize the query and should only be used on the server. - * - * @param id - ID of the resource to locate - * @param params - Service call parameters {@link Params} - * @see {@link HookLessServiceMethods} - * @see {@link https://docs.feathersjs.com/api/services.html#get-id-params|Feathers API Documentation: .get(id, params)} - */ - _get(id: IdType, params?: Params): Promise - - /** - * Create a new resource for this service, skipping any service-level hooks. - * Does not sanitize data or checks if multiple updates are allowed and should only be used on the server. - * - * @param data - Data to insert into this service. - * @param params - Service call parameters {@link Params} - * @see {@link HookLessServiceMethods} - * @see {@link https://docs.feathersjs.com/api/services.html#create-data-params|Feathers API Documentation: .create(data, params)} - */ - _create(data: Data, params?: Params): Promise - _create(data: Data[], params?: Params): Promise - _create(data: Data | Data[], params?: Params): Promise - - /** - * Completely replace the resource identified by id, skipping any service-level hooks. - * Does not sanitize data or query and should only be used on the server. - * - * @param id - ID of the resource to be updated - * @param data - Data to be put in place of the current resource. - * @param params - Service call parameters {@link Params} - * @see {@link HookLessServiceMethods} - * @see {@link https://docs.feathersjs.com/api/services.html#update-id-data-params|Feathers API Documentation: .update(id, data, params)} - */ - _update(id: IdType, data: Data, params?: Params): Promise - - /** - * Merge any resources matching the given ID with the given data, skipping any service-level hooks. - * Does not sanitize the data or query and should only be used on the server. - * - * @param id - ID of the resource to be patched - * @param data - Data to merge with the current resource. - * @param params - Service call parameters {@link Params} - * @see {@link HookLessServiceMethods} - * @see {@link https://docs.feathersjs.com/api/services.html#patch-id-data-params|Feathers API Documentation: .patch(id, data, params)} - */ - _patch(id: null, data: PatchData, params?: Params): Promise - _patch(id: IdType, data: PatchData, params?: Params): Promise - _patch(id: IdType | null, data: PatchData, params?: Params): Promise - - /** - * Remove resources matching the given ID from the this service, skipping any service-level hooks. - * Does not sanitize query and should only be used on the server. - * - * @param id - ID of the resource to be removed - * @param params - Service call parameters {@link Params} - * @see {@link HookLessServiceMethods} - * @see {@link https://docs.feathersjs.com/api/services.html#remove-id-params|Feathers API Documentation: .remove(id, params)} - */ - _remove(id: null, params?: Params): Promise - _remove(id: IdType, params?: Params): Promise - _remove(id: IdType | null, params?: Params): Promise -} diff --git a/packages/adapter-commons/src/index.ts b/packages/adapter-commons/src/index.ts deleted file mode 100644 index 8007e44e00..0000000000 --- a/packages/adapter-commons/src/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { _ } from '@feathersjs/commons' -import { Params } from '@feathersjs/feathers' - -export * from './declarations' -export * from './service' -export * from './query' -export * from './sort' - -// Return a function that filters a result object or array -// and picks only the fields passed as `params.query.$select` -// and additional `otherFields` -export function select(params: Params, ...otherFields: string[]) { - const queryFields: string[] | undefined = params?.query?.$select - - if (!queryFields) { - return (result: any) => result - } - - const resultFields = queryFields.concat(otherFields) - const convert = (result: any) => _.pick(result, ...resultFields) - - return (result: any) => { - if (Array.isArray(result)) { - return result.map(convert) - } - - return convert(result) - } -} diff --git a/packages/adapter-commons/src/query.ts b/packages/adapter-commons/src/query.ts deleted file mode 100644 index 1dc31ffdec..0000000000 --- a/packages/adapter-commons/src/query.ts +++ /dev/null @@ -1,158 +0,0 @@ -import { _ } from '@feathersjs/commons' -import { BadRequest } from '@feathersjs/errors' -import { Query } from '@feathersjs/feathers' -import { FilterQueryOptions, FilterSettings, PaginationParams } from './declarations' - -const parse = (value: any) => (typeof value !== 'undefined' ? parseInt(value, 10) : value) - -const isPlainObject = (value: any) => _.isObject(value) && value.constructor === {}.constructor - -const validateQueryProperty = (query: any, operators: string[] = []): Query => { - if (!isPlainObject(query)) { - return query - } - - for (const key of Object.keys(query)) { - if (key.startsWith('$') && !operators.includes(key)) { - throw new BadRequest(`Invalid query parameter ${key}`, query) - } - - const value = query[key] - - if (isPlainObject(value)) { - query[key] = validateQueryProperty(value, operators) - } - } - - return { - ...query - } -} - -const getFilters = (query: Query, settings: FilterQueryOptions) => { - const filterNames = Object.keys(settings.filters) - - return filterNames.reduce( - (current, key) => { - const queryValue = query[key] - const filter = settings.filters[key] - - if (filter) { - const value = typeof filter === 'function' ? filter(queryValue, settings) : queryValue - - if (value !== undefined) { - current[key] = value - } - } - - return current - }, - {} as { [key: string]: any } - ) -} - -const getQuery = (query: Query, settings: FilterQueryOptions) => { - const keys = Object.keys(query).concat(Object.getOwnPropertySymbols(query) as any as string[]) - - return keys.reduce((result, key) => { - if (typeof key === 'string' && key.startsWith('$')) { - if (settings.filters[key] === undefined) { - throw new BadRequest(`Invalid filter value ${key}`) - } - } else { - result[key] = validateQueryProperty(query[key], settings.operators) - } - - return result - }, {} as Query) -} - -/** - * Returns the converted `$limit` value based on the `paginate` configuration. - * @param _limit The limit value - * @param paginate The pagination options - * @returns The converted $limit value - */ -export const getLimit = (_limit: any, paginate?: PaginationParams) => { - const limit = parse(_limit) - - if (paginate && (paginate.default || paginate.max)) { - const base = paginate.default || 0 - const lower = typeof limit === 'number' && !isNaN(limit) && limit >= 0 ? limit : base - const upper = typeof paginate.max === 'number' ? paginate.max : Number.MAX_VALUE - - return Math.min(lower, upper) - } - - return limit -} - -export const OPERATORS = ['$in', '$nin', '$lt', '$lte', '$gt', '$gte', '$ne', '$or'] - -export const FILTERS: FilterSettings = { - $skip: (value: any) => parse(value), - $sort: (sort: any): { [key: string]: number } => { - if (typeof sort !== 'object' || Array.isArray(sort)) { - return sort - } - - return Object.keys(sort).reduce( - (result, key) => { - result[key] = typeof sort[key] === 'object' ? sort[key] : parse(sort[key]) - - return result - }, - {} as { [key: string]: number } - ) - }, - $limit: (_limit: any, { paginate }: FilterQueryOptions) => getLimit(_limit, paginate), - $select: (select: any) => { - if (Array.isArray(select)) { - return select.map((current) => `${current}`) - } - - return select - }, - $or: (or: any, { operators }: FilterQueryOptions) => { - if (Array.isArray(or)) { - return or.map((current) => validateQueryProperty(current, operators)) - } - - return or - }, - $and: (and: any, { operators }: FilterQueryOptions) => { - if (Array.isArray(and)) { - return and.map((current) => validateQueryProperty(current, operators)) - } - - return and - } -} - -/** - * Converts Feathers special query parameters and pagination settings - * and returns them separately as `filters` and the rest of the query - * as `query`. `options` also gets passed the pagination settings and - * a list of additional `operators` to allow when querying properties. - * - * @param query The initial query - * @param options Options for filtering the query - * @returns An object with `query` which contains the query without `filters` - * and `filters` which contains the converted values for each filter. - */ -export function filterQuery(_query: Query, options: FilterQueryOptions = {}) { - const query = _query || {} - const settings = { - ...options, - filters: { - ...FILTERS, - ...options.filters - }, - operators: OPERATORS.concat(options.operators || []) - } - - return { - filters: getFilters(query, settings), - query: getQuery(query, settings) - } -} diff --git a/packages/adapter-commons/src/service.ts b/packages/adapter-commons/src/service.ts deleted file mode 100644 index cbaeb38718..0000000000 --- a/packages/adapter-commons/src/service.ts +++ /dev/null @@ -1,188 +0,0 @@ -import { Id, Paginated, Query } from '@feathersjs/feathers' -import { - AdapterParams, - AdapterServiceOptions, - InternalServiceMethods, - PaginationOptions -} from './declarations' -import { filterQuery } from './query' - -export const VALIDATED = Symbol.for('@feathersjs/adapter/sanitized') - -const alwaysMulti: { [key: string]: boolean } = { - find: true, - get: false, - update: false -} - -/** - * An abstract base class that a database adapter can extend from to implement the - * `__find`, `__get`, `__update`, `__patch` and `__remove` methods. - */ -export abstract class AdapterBase< - Result = any, - Data = Result, - PatchData = Partial, - ServiceParams extends AdapterParams = AdapterParams, - Options extends AdapterServiceOptions = AdapterServiceOptions, - IdType = Id -> implements InternalServiceMethods -{ - options: Options - - constructor(options: Options) { - this.options = { - id: 'id', - events: [], - paginate: false, - multi: false, - filters: {}, - operators: [], - ...options - } - } - - get id() { - return this.options.id - } - - get events() { - return this.options.events - } - - /** - * Check if this adapter allows multiple updates for a method. - * @param method The method name to check. - * @param params The service call params. - * @returns Wether or not multiple updates are allowed. - */ - allowsMulti(method: string, params: ServiceParams = {} as ServiceParams) { - const always = alwaysMulti[method] - - if (typeof always !== 'undefined') { - return always - } - - const { multi } = this.getOptions(params) - - if (multi === true || !multi) { - return multi - } - - return multi.includes(method) - } - - /** - * Returns the combined options for a service call. Options will be merged - * with `this.options` and `params.adapter` for dynamic overrides. - * - * @param params The parameters for the service method call - * @returns The actual options for this call - */ - getOptions(params: ServiceParams): Options { - const paginate = params.paginate !== undefined ? params.paginate : this.options.paginate - - return { - ...this.options, - paginate, - ...params.adapter - } - } - - /** - * Returns a sanitized version of `params.query`, converting filter values - * (like $limit and $skip) into the expected type. Will throw an error if - * a `$` prefixed filter or operator value that is not allowed in `filters` - * or `operators` is encountered. - * - * @param params The service call parameter. - * @returns A new object containing the sanitized query. - */ - async sanitizeQuery(params: ServiceParams = {} as ServiceParams): Promise { - // We don't need legacy query sanitisation if the query has been validated by a schema already - if (params.query && (params.query as any)[VALIDATED]) { - return params.query || {} - } - - const options = this.getOptions(params) - const { query, filters } = filterQuery(params.query, options) - - return { - ...filters, - ...query - } - } - - /** - * Retrieve all resources from this service. - * Does not sanitize the query and should only be used on the server. - * - * @param _params - Service call parameters {@link ServiceParams} - */ - abstract _find(_params?: ServiceParams & { paginate?: PaginationOptions }): Promise > - abstract _find(_params?: ServiceParams & { paginate: false }): Promise - abstract _find(params?: ServiceParams): Promise > - - /** - * Retrieve a single resource matching the given ID, skipping any service-level hooks. - * Does not sanitize the query and should only be used on the server. - * - * @param id - ID of the resource to locate - * @param params - Service call parameters {@link ServiceParams} - * @see {@link HookLessServiceMethods} - * @see {@link https://docs.feathersjs.com/api/services.html#get-id-params|Feathers API Documentation: .get(id, params)} - */ - abstract _get(id: IdType, params?: ServiceParams): Promise - - /** - * Create a new resource for this service, skipping any service-level hooks. - * Does not check if multiple updates are allowed and should only be used on the server. - * - * @param data - Data to insert into this service. - * @param params - Service call parameters {@link ServiceParams} - * @see {@link HookLessServiceMethods} - * @see {@link https://docs.feathersjs.com/api/services.html#create-data-params|Feathers API Documentation: .create(data, params)} - */ - abstract _create(data: Data, params?: ServiceParams): Promise - abstract _create(data: Data[], params?: ServiceParams): Promise - abstract _create(data: Data | Data[], params?: ServiceParams): Promise - - /** - * Completely replace the resource identified by id, skipping any service-level hooks. - * Does not sanitize the query and should only be used on the server. - * - * @param id - ID of the resource to be updated - * @param data - Data to be put in place of the current resource. - * @param params - Service call parameters {@link ServiceParams} - * @see {@link HookLessServiceMethods} - * @see {@link https://docs.feathersjs.com/api/services.html#update-id-data-params|Feathers API Documentation: .update(id, data, params)} - */ - abstract _update(id: IdType, data: Data, params?: ServiceParams): Promise - - /** - * Merge any resources matching the given ID with the given data, skipping any service-level hooks. - * Does not sanitize the query and should only be used on the server. - * - * @param id - ID of the resource to be patched - * @param data - Data to merge with the current resource. - * @param params - Service call parameters {@link ServiceParams} - * @see {@link HookLessServiceMethods} - * @see {@link https://docs.feathersjs.com/api/services.html#patch-id-data-params|Feathers API Documentation: .patch(id, data, params)} - */ - abstract _patch(id: null, data: PatchData, params?: ServiceParams): Promise - abstract _patch(id: IdType, data: PatchData, params?: ServiceParams): Promise - abstract _patch(id: IdType | null, data: PatchData, params?: ServiceParams): Promise - - /** - * Remove resources matching the given ID from the this service, skipping any service-level hooks. - * Does not sanitize query and should only be used on the server. - * - * @param id - ID of the resource to be removed - * @param params - Service call parameters {@link ServiceParams} - * @see {@link HookLessServiceMethods} - * @see {@link https://docs.feathersjs.com/api/services.html#remove-id-params|Feathers API Documentation: .remove(id, params)} - */ - abstract _remove(id: null, params?: ServiceParams): Promise - abstract _remove(id: IdType, params?: ServiceParams): Promise - abstract _remove(id: IdType | null, params?: ServiceParams): Promise -} diff --git a/packages/adapter-commons/src/sort.ts b/packages/adapter-commons/src/sort.ts deleted file mode 100644 index d84cb69cc1..0000000000 --- a/packages/adapter-commons/src/sort.ts +++ /dev/null @@ -1,129 +0,0 @@ -// Sorting algorithm taken from NeDB (https://github.com/louischatriot/nedb) -// See https://github.com/louischatriot/nedb/blob/e3f0078499aa1005a59d0c2372e425ab789145c1/lib/model.js#L189 - -export function compareNSB(a: number | string | boolean, b: number | string | boolean): 0 | 1 | -1 { - if (a === b) { - return 0 - } - - return a < b ? -1 : 1 -} - -export function compareArrays(a: any[], b: any[]): 0 | 1 | -1 { - for (let i = 0, l = Math.min(a.length, b.length); i < l; i++) { - const comparison = compare(a[i], b[i]) - - if (comparison !== 0) { - return comparison - } - } - - // Common section was identical, longest one wins - return compareNSB(a.length, b.length) -} - -export function compare( - a: any, - b: any, - compareStrings: (a: any, b: any) => 0 | 1 | -1 = compareNSB -): 0 | 1 | -1 { - if (a === b) { - return 0 - } - - // null or undefined - if (a == null) { - return -1 - } - if (b == null) { - return 1 - } - - // detect typeof once - const typeofA = typeof a - const typeofB = typeof b - - // Numbers - if (typeofA === 'number') { - return typeofB === 'number' ? compareNSB(a, b) : -1 - } - if (typeofB === 'number') { - return 1 - } - - // Strings - if (typeofA === 'string') { - return typeofB === 'string' ? compareStrings(a, b) : -1 - } - if (typeofB === 'string') { - return 1 - } - - // Booleans - if (typeofA === 'boolean') { - return typeofB === 'boolean' ? compareNSB(a, b) : -1 - } - if (typeofB === 'boolean') { - return 1 - } - - // Dates - if (a instanceof Date) { - return b instanceof Date ? compareNSB(a.getTime(), b.getTime()) : -1 - } - if (b instanceof Date) { - return 1 - } - - // Arrays (first element is most significant and so on) - if (Array.isArray(a)) { - return Array.isArray(b) ? compareArrays(a, b) : -1 - } - if (Array.isArray(b)) { - return 1 - } - - // Objects - const aKeys = Object.keys(a).sort() - const bKeys = Object.keys(b).sort() - - for (let i = 0, l = Math.min(aKeys.length, bKeys.length); i < l; i++) { - const comparison = compare(a[aKeys[i]], b[bKeys[i]]) - - if (comparison !== 0) { - return comparison - } - } - - return compareNSB(aKeys.length, bKeys.length) -} - -// lodash-y get - probably want to use lodash get instead -const get = (value: any, path: string[]) => path.reduce((value, key) => value[key], value) - -// An in-memory sorting function according to the -// $sort special query parameter -export function sorter($sort: { [key: string]: -1 | 1 }) { - const compares = Object.keys($sort).map((key) => { - const direction = $sort[key] - - if (!key.includes('.')) { - return (a: any, b: any) => direction * compare(a[key], b[key]) - } else { - const path = key.split('.') - return (a: any, b: any) => direction * compare(get(a, path), get(b, path)) - } - }) - - return function (a: any, b: any) { - for (const compare of compares) { - const comparison = compare(a, b) - - if (comparison !== 0) { - return comparison - } - } - - return 0 - } -} diff --git a/packages/adapter-commons/test/commons.test.ts b/packages/adapter-commons/test/commons.test.ts deleted file mode 100644 index b0f5eb8d23..0000000000 --- a/packages/adapter-commons/test/commons.test.ts +++ /dev/null @@ -1,91 +0,0 @@ -import assert from 'assert' -import { select } from '../src' - -describe('@feathersjs/adapter-commons', () => { - describe('select', () => { - it('select', () => { - const selector = select({ - query: { $select: ['name', 'age'] } - }) - - return Promise.resolve({ - name: 'David', - age: 3, - test: 'me' - }) - .then(selector) - .then((result) => - assert.deepStrictEqual(result, { - name: 'David', - age: 3 - }) - ) - }) - - it('select with arrays', () => { - const selector = select({ - query: { $select: ['name', 'age'] } - }) - - return Promise.resolve([ - { - name: 'David', - age: 3, - test: 'me' - }, - { - name: 'D', - age: 4, - test: 'you' - } - ]) - .then(selector) - .then((result) => - assert.deepStrictEqual(result, [ - { - name: 'David', - age: 3 - }, - { - name: 'D', - age: 4 - } - ]) - ) - }) - - it('select with no query', () => { - const selector = select({}) - const data = { - name: 'David' - } - - return Promise.resolve(data) - .then(selector) - .then((result) => assert.deepStrictEqual(result, data)) - }) - - it('select with other fields', () => { - const selector = select( - { - query: { $select: ['name'] } - }, - 'id' - ) - const data = { - id: 'me', - name: 'David', - age: 10 - } - - return Promise.resolve(data) - .then(selector) - .then((result) => - assert.deepStrictEqual(result, { - id: 'me', - name: 'David' - }) - ) - }) - }) -}) diff --git a/packages/adapter-commons/test/fixture.ts b/packages/adapter-commons/test/fixture.ts deleted file mode 100644 index 43bd667d06..0000000000 --- a/packages/adapter-commons/test/fixture.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { AdapterBase, AdapterParams, PaginationOptions } from '../src' -import { Id, NullableId, Paginated } from '@feathersjs/feathers' -import { BadRequest, MethodNotAllowed } from '@feathersjs/errors/lib' - -export type Data = { - id: Id -} - -export class MethodBase extends AdapterBase, AdapterParams> { - async _find(_params?: AdapterParams & { paginate?: PaginationOptions }): Promise > - async _find(_params?: AdapterParams & { paginate: false }): Promise - async _find(params?: AdapterParams): Promise> { - if (params && params.paginate === false) { - return [] - } - - return { - total: 0, - limit: 10, - skip: 0, - data: [] - } - } - - async _get(id: Id, _params?: AdapterParams): Promise { - return { id } - } - - async _create(data: Data, _params?: AdapterParams): Promise - async _create(data: Data[], _params?: AdapterParams): Promise - async _create(data: Data | Data[], _params?: AdapterParams): Promise - async _create(data: Data | Data[], _params?: AdapterParams): Promise { - if (Array.isArray(data)) { - return [ - { - id: 'something' - } - ] - } - - return { - id: 'something' - } - } - - async _update(id: Id, _data: Data, _params?: AdapterParams) { - return Promise.resolve({ id: id ?? _data.id }) - } - - async _patch(id: null, _data: Partial, _params?: AdapterParams): Promise - async _patch(id: Id, _data: Partial, _params?: AdapterParams): Promise - async _patch(id: NullableId, _data: Partial, _params?: AdapterParams): Promise - async _patch(id: NullableId, _data: Partial, _params?: AdapterParams): Promise { - if (id === null) { - return [] - } - - return { id } - } - - async _remove(id: null, _params?: AdapterParams): Promise - async _remove(id: Id, _params?: AdapterParams): Promise - async _remove(id: NullableId, _params?: AdapterParams): Promise - async _remove(id: NullableId, _params?: AdapterParams) { - if (id === null) { - return [] as Data[] - } - - return { id } - } -} - -export class MethodService extends MethodBase { - find(params?: AdapterParams): Promise> { - return this._find(params) - } - - get(id: Id, params?: AdapterParams): Promise { - return this._get(id, params) - } - - async create(data: Data[], _params?: AdapterParams): Promise - async create(data: Data, _params?: AdapterParams): Promise - async create(data: Data | Data[], params?: AdapterParams): Promise { - if (Array.isArray(data) && !this.allowsMulti('create', params)) { - throw new MethodNotAllowed('Can not create multiple entries') - } - - return this._create(data, params) - } - - async update(id: Id, data: Data, params?: AdapterParams) { - if (id === null || Array.isArray(data)) { - throw new BadRequest("You can not replace multiple instances. Did you mean 'patch'?") - } - - return this._update(id, data, params) - } - - async patch(id: NullableId, data: Partial, params?: AdapterParams) { - if (id === null && !this.allowsMulti('patch', params)) { - throw new MethodNotAllowed('Can not patch multiple entries') - } - - return this._patch(id, data, params) - } - - async remove(id: NullableId, params?: AdapterParams) { - if (id === null && !this.allowsMulti('remove', params)) { - throw new MethodNotAllowed('Can not remove multiple entries') - } - - return this._remove(id, params) - } -} diff --git a/packages/adapter-commons/test/query.test.ts b/packages/adapter-commons/test/query.test.ts deleted file mode 100644 index 805704c97e..0000000000 --- a/packages/adapter-commons/test/query.test.ts +++ /dev/null @@ -1,313 +0,0 @@ -import assert from 'assert' -import { ObjectId } from 'mongodb' -import { filterQuery } from '../src' - -describe('@feathersjs/adapter-commons/filterQuery', () => { - describe('$sort', () => { - it('returns $sort when present in query', () => { - const originalQuery = { $sort: { name: 1 } } - const { filters, query } = filterQuery(originalQuery) - - assert.strictEqual(filters.$sort.name, 1) - assert.deepStrictEqual(query, {}) - assert.deepStrictEqual( - originalQuery, - { - $sort: { name: 1 } - }, - 'does not modify original query' - ) - }) - - it('returns $sort when present in query as an object', () => { - const { filters, query } = filterQuery({ - $sort: { name: { something: 10 } } - }) - - assert.strictEqual(filters.$sort.name.something, 10) - assert.deepStrictEqual(query, {}) - }) - - it('converts strings in $sort', () => { - const { filters, query } = filterQuery({ $sort: { test: '-1' } }) - - assert.strictEqual(filters.$sort.test, -1) - assert.deepStrictEqual(query, {}) - }) - - it('does not convert $sort arrays', () => { - const $sort = [ - ['test', '-1'], - ['a', '1'] - ] - const { filters, query } = filterQuery({ $sort }) - - assert.strictEqual(filters.$sort, $sort) - assert.deepStrictEqual(query, {}) - }) - - it('throws an error when special parameter is not known', () => { - try { - const query = { $foo: 1 } - filterQuery(query) - assert.ok(false, 'Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'BadRequest') - assert.strictEqual(error.message, 'Invalid filter value $foo') - } - }) - - it('returns undefined when not present in query', () => { - const query = { foo: 1 } - const { filters } = filterQuery(query) - - assert.strictEqual(filters.$sort, undefined) - }) - }) - - describe('$limit', () => { - let testQuery: any - - beforeEach(() => { - testQuery = { $limit: 1 } - }) - - it('returns $limit when present in query', () => { - const { filters, query } = filterQuery(testQuery) - - assert.strictEqual(filters.$limit, 1) - assert.deepStrictEqual(query, {}) - }) - - it('returns undefined when not present in query', () => { - const query = { foo: 1 } - const { filters } = filterQuery(query) - - assert.strictEqual(filters.$limit, undefined) - }) - - it('removes $limit from query when present', () => { - assert.deepStrictEqual(filterQuery(testQuery).query, {}) - }) - - it('parses $limit strings into integers (#4)', () => { - const { filters } = filterQuery({ $limit: '2' }) - - assert.strictEqual(filters.$limit, 2) - }) - - it('allows $limit 0', () => { - const { filters } = filterQuery({ $limit: 0 }, { paginate: { default: 10 } }) - - assert.strictEqual(filters.$limit, 0) - }) - - describe('pagination', () => { - it('limits with default pagination', () => { - const { filters } = filterQuery({}, { paginate: { default: 10 } }) - const { filters: filtersNeg } = filterQuery({ $limit: -20 }, { paginate: { default: 5, max: 10 } }) - - assert.strictEqual(filters.$limit, 10) - assert.strictEqual(filtersNeg.$limit, 5) - }) - - it('limits with max pagination', () => { - const { filters } = filterQuery({ $limit: 20 }, { paginate: { default: 5, max: 10 } }) - - assert.strictEqual(filters.$limit, 10) - }) - - it('limits with default pagination when not a number', () => { - const { filters } = filterQuery({ $limit: 'something' }, { paginate: { default: 5, max: 10 } }) - - assert.strictEqual(filters.$limit, 5) - }) - - it('limits to 0 when no paginate.default and not a number', () => { - const { filters } = filterQuery({ $limit: 'something' }, { paginate: { max: 10 } }) - - assert.strictEqual(filters.$limit, 0) - }) - - it('still uses paginate.max when there is no paginate.default (#2104)', () => { - const { filters } = filterQuery({ $limit: 100 }, { paginate: { max: 10 } }) - - assert.strictEqual(filters.$limit, 10) - }) - }) - }) - - describe('$skip', () => { - let testQuery: any - - beforeEach(() => { - testQuery = { $skip: 1 } - }) - - it('returns $skip when present in query', () => { - const { filters } = filterQuery(testQuery) - - assert.strictEqual(filters.$skip, 1) - }) - - it('removes $skip from query when present', () => { - assert.deepStrictEqual(filterQuery(testQuery).query, {}) - }) - - it('returns undefined when not present in query', () => { - const query = { foo: 1 } - const { filters } = filterQuery(query) - - assert.strictEqual(filters.$skip, undefined) - }) - - it('parses $skip strings into integers (#4)', () => { - const { filters } = filterQuery({ $skip: '33' }) - - assert.strictEqual(filters.$skip, 33) - }) - }) - - describe('$select', () => { - let testQuery: any - - beforeEach(() => { - testQuery = { $select: 1 } - }) - - it('returns $select when present in query', () => { - const { filters } = filterQuery(testQuery) - - assert.strictEqual(filters.$select, 1) - }) - - it('removes $select from query when present', () => { - assert.deepStrictEqual(filterQuery(testQuery).query, {}) - }) - - it('returns undefined when not present in query', () => { - const query = { foo: 1 } - const { filters } = filterQuery(query) - - assert.strictEqual(filters.$select, undefined) - }) - - it('includes Symbols', () => { - const TEST = Symbol('testing') - const original = { - [TEST]: 'message', - other: true, - sub: { [TEST]: 'othermessage' } - } - - const { query } = filterQuery(original) - - assert.deepStrictEqual(query, { - [TEST]: 'message', - other: true, - sub: { [TEST]: 'othermessage' } - }) - }) - - it('only converts plain objects', () => { - const userId = new ObjectId() - const original = { - userId - } - - const { query } = filterQuery(original) - - assert.deepStrictEqual(query, original) - }) - }) - - describe('arrays', () => { - it('validates queries in arrays', () => { - assert.throws( - () => { - filterQuery({ - $or: [{ $exists: false }] - }) - }, - { - name: 'BadRequest', - message: 'Invalid query parameter $exists' - } - ) - }) - - it('allows default operators in $or', () => { - const { filters } = filterQuery({ - $or: [{ value: { $gte: 10 } }] - }) - - assert.deepStrictEqual(filters, { - $or: [{ value: { $gte: 10 } }] - }) - }) - }) - - describe('additional filters', () => { - it('throw error when not set as additionals', () => { - try { - filterQuery({ $select: 1, $known: 1 }) - assert.ok(false, 'Should never get here') - } catch (error: any) { - assert.strictEqual(error.message, 'Invalid filter value $known') - } - }) - - it('returns default and known additional filters (array)', () => { - const query = { $select: ['a', 'b'], $known: 1, $unknown: 1 } - const { filters } = filterQuery(query, { - filters: { - $known: true, - $unknown: true - } - }) - - assert.strictEqual(filters.$unknown, 1) - assert.strictEqual(filters.$known, 1) - assert.deepStrictEqual(filters.$select, ['a', 'b']) - }) - - it('returns default and known additional filters (object)', () => { - const { filters } = filterQuery( - { - $known: 1, - $select: 1 - }, - { filters: { $known: (value: any) => value.toString() } } - ) - - assert.strictEqual(filters.$unknown, undefined) - assert.strictEqual(filters.$known, '1') - assert.strictEqual(filters.$select, 1) - }) - }) - - describe('additional operators', () => { - it('returns query with default and known additional operators', () => { - const { query } = filterQuery( - { - prop: { $ne: 1, $known: 1 } - }, - { operators: ['$known'] } - ) - - assert.deepStrictEqual(query, { prop: { $ne: 1, $known: 1 } }) - }) - - it('throws an error with unknown query operator', () => { - assert.throws( - () => - filterQuery({ - prop: { $unknown: 'something' } - }), - { - message: 'Invalid query parameter $unknown' - } - ) - }) - }) -}) diff --git a/packages/adapter-commons/test/service.test.ts b/packages/adapter-commons/test/service.test.ts deleted file mode 100644 index ed5cc4a4c6..0000000000 --- a/packages/adapter-commons/test/service.test.ts +++ /dev/null @@ -1,227 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/ban-ts-comment */ -import assert from 'assert' -import { VALIDATED } from '../src' -import { MethodService } from './fixture' - -const METHODS: ['find', 'get', 'create', 'update', 'patch', 'remove'] = [ - 'find', - 'get', - 'create', - 'update', - 'patch', - 'remove' -] - -describe('@feathersjs/adapter-commons/service', () => { - describe('works when methods exist', () => { - METHODS.forEach((method) => { - it(`${method}`, () => { - const service = new MethodService({}) - const args: any[] = [] - - if (method !== 'find') { - args.push('test') - } - - if (method === 'update' || method === 'patch') { - args.push({}) - } - - // @ts-ignore - return service[method](...args) - }) - }) - - it('does not allow multi patch', async () => { - const service = new MethodService({}) - - await assert.rejects(() => service.patch(null, {}), { - name: 'MethodNotAllowed', - message: 'Can not patch multiple entries' - }) - }) - - it('does not allow multi remove', async () => { - const service = new MethodService({}) - - await assert.rejects(() => service.remove(null, {}), { - name: 'MethodNotAllowed', - message: 'Can not remove multiple entries' - }) - }) - - it('does not allow multi create', async () => { - const service = new MethodService({}) - - await assert.rejects(() => service.create([], {}), { - name: 'MethodNotAllowed', - message: 'Can not create multiple entries' - }) - }) - - it('multi can be set to true', async () => { - const service = new MethodService({}) - - service.options.multi = true - - await service.create([]) - }) - }) - - it('sanitizeQuery', async () => { - const service = new MethodService({ - filters: { - $something: true - }, - operators: ['$test'] - }) - - assert.deepStrictEqual( - await service.sanitizeQuery({ - query: { $limit: '10', test: 'me' } as any - }), - { $limit: 10, test: 'me' } - ) - - assert.deepStrictEqual( - await service.sanitizeQuery({ - adapter: { - paginate: { max: 2 } - }, - query: { $limit: '10', test: 'me' } as any - }), - { $limit: 2, test: 'me' } - ) - - await assert.rejects( - () => - service.sanitizeQuery({ - query: { name: { $bla: 'me' } } - }), - { - message: 'Invalid query parameter $bla' - } - ) - - assert.deepStrictEqual( - await service.sanitizeQuery({ - adapter: { - operators: ['$bla'] - }, - query: { name: { $bla: 'Dave' } } - }), - { name: { $bla: 'Dave' } } - ) - - const validatedQuery = { name: { $bla: 'me' } } - - Object.defineProperty(validatedQuery, VALIDATED, { value: true }) - - assert.deepStrictEqual( - await service.sanitizeQuery({ - query: validatedQuery - }), - validatedQuery, - 'validated queries are not sanitized' - ) - }) - - it('getOptions', () => { - const service = new MethodService({ - multi: true, - paginate: { - default: 1, - max: 10 - } - }) - const opts = service.getOptions({ - adapter: { - multi: ['create'], - paginate: { - default: 10, - max: 100 - } - } - }) - - assert.deepStrictEqual(opts, { - id: 'id', - events: [], - paginate: { default: 10, max: 100 }, - multi: ['create'], - filters: {}, - operators: [] - }) - - const notPaginated = service.getOptions({ - paginate: false - }) - - assert.deepStrictEqual(notPaginated, { - id: 'id', - events: [], - paginate: false, - multi: true, - filters: {}, - operators: [] - }) - }) - - it('allowsMulti', () => { - context('with true', () => { - const service = new MethodService({ multi: true }) - - it('does return true for multiple methodes', () => { - assert.equal(service.allowsMulti('patch'), true) - }) - - it('does return false for always non-multiple methodes', () => { - assert.equal(service.allowsMulti('update'), false) - }) - - it('does return true for unknown methods', () => { - assert.equal(service.allowsMulti('other'), true) - }) - }) - - context('with false', () => { - const service = new MethodService({ multi: false }) - - it('does return false for multiple methodes', () => { - assert.equal(service.allowsMulti('remove'), false) - }) - - it('does return true for always multiple methodes', () => { - assert.equal(service.allowsMulti('find'), true) - }) - - it('does return false for unknown methods', () => { - assert.equal(service.allowsMulti('other'), false) - }) - }) - - context('with array', () => { - const service = new MethodService({ multi: ['create', 'get', 'other'] }) - - it('does return true for specified multiple methodes', () => { - assert.equal(service.allowsMulti('create'), true) - }) - - it('does return false for non-specified multiple methodes', () => { - assert.equal(service.allowsMulti('patch'), false) - }) - - it('does return false for specified always multiple methodes', () => { - assert.equal(service.allowsMulti('get'), false) - }) - - it('does return true for specified unknown methodes', () => { - assert.equal(service.allowsMulti('other'), true) - }) - - it('does return false for non-specified unknown methodes', () => { - assert.equal(service.allowsMulti('another'), false) - }) - }) - }) -}) diff --git a/packages/adapter-commons/test/sort.test.ts b/packages/adapter-commons/test/sort.test.ts deleted file mode 100644 index d361c681af..0000000000 --- a/packages/adapter-commons/test/sort.test.ts +++ /dev/null @@ -1,384 +0,0 @@ -import assert from 'assert' -import { sorter } from '../src' - -describe('@feathersjs/adapter-commons', () => { - describe('sorter', () => { - it('simple sorter', () => { - const array = [ - { - name: 'David' - }, - { - name: 'Eric' - } - ] - - const sort = sorter({ - name: -1 - }) - - assert.deepStrictEqual(array.sort(sort), [ - { - name: 'Eric' - }, - { - name: 'David' - } - ]) - }) - - it('simple sorter with arrays', () => { - const array = [ - { - names: ['a', 'b'] - }, - { - names: ['c', 'd'] - } - ] - - const sort = sorter({ - names: -1 - }) - - assert.deepStrictEqual(array.sort(sort), [ - { - names: ['c', 'd'] - }, - { - names: ['a', 'b'] - } - ]) - }) - - it('simple sorter with objects', () => { - const array = [ - { - names: { - first: 'Dave', - last: 'L' - } - }, - { - names: { - first: 'A', - last: 'B' - } - } - ] - - const sort = sorter({ - names: 1 - }) - - assert.deepStrictEqual(array.sort(sort), [ - { - names: { - first: 'A', - last: 'B' - } - }, - { - names: { - first: 'Dave', - last: 'L' - } - } - ]) - }) - - it('two property sorter', () => { - const array = [ - { - name: 'David', - counter: 0 - }, - { - name: 'Eric', - counter: 1 - }, - { - name: 'David', - counter: 1 - }, - { - name: 'Eric', - counter: 0 - } - ] - - const sort = sorter({ - name: -1, - counter: 1 - }) - - assert.deepStrictEqual(array.sort(sort), [ - { name: 'Eric', counter: 0 }, - { name: 'Eric', counter: 1 }, - { name: 'David', counter: 0 }, - { name: 'David', counter: 1 } - ]) - }) - - it('two property sorter with names', () => { - const array = [ - { - name: 'David', - counter: 0 - }, - { - name: 'Eric', - counter: 1 - }, - { - name: 'Andrew', - counter: 1 - }, - { - name: 'David', - counter: 1 - }, - { - name: 'Andrew', - counter: 0 - }, - { - name: 'Eric', - counter: 0 - } - ] - - const sort = sorter({ - name: -1, - counter: 1 - }) - - assert.deepStrictEqual(array.sort(sort), [ - { name: 'Eric', counter: 0 }, - { name: 'Eric', counter: 1 }, - { name: 'David', counter: 0 }, - { name: 'David', counter: 1 }, - { name: 'Andrew', counter: 0 }, - { name: 'Andrew', counter: 1 } - ]) - }) - - it('three property sorter with names', () => { - const array = [ - { - name: 'David', - counter: 0, - age: 2 - }, - { - name: 'Eric', - counter: 1, - age: 2 - }, - { - name: 'David', - counter: 1, - age: 1 - }, - { - name: 'Eric', - counter: 0, - age: 1 - }, - { - name: 'Andrew', - counter: 0, - age: 2 - }, - { - name: 'Andrew', - counter: 0, - age: 1 - } - ] - - const sort = sorter({ - name: -1, - counter: 1, - age: -1 - }) - - assert.deepStrictEqual(array.sort(sort), [ - { name: 'Eric', counter: 0, age: 1 }, - { name: 'Eric', counter: 1, age: 2 }, - { name: 'David', counter: 0, age: 2 }, - { name: 'David', counter: 1, age: 1 }, - { name: 'Andrew', counter: 0, age: 2 }, - { name: 'Andrew', counter: 0, age: 1 } - ]) - }) - }) - - describe('sorter mongoDB-like sorting on embedded objects', () => { - let data: any[] = [] - - beforeEach(() => { - data = [ - { _id: 1, item: { category: 'cake', type: 'chiffon' }, amount: 10 }, - { - _id: 2, - item: { category: 'cookies', type: 'chocolate chip' }, - amount: 50 - }, - { - _id: 3, - item: { category: 'cookies', type: 'chocolate chip' }, - amount: 15 - }, - { _id: 4, item: { category: 'cake', type: 'lemon' }, amount: 30 }, - { _id: 5, item: { category: 'cake', type: 'carrot' }, amount: 20 }, - { _id: 6, item: { category: 'brownies', type: 'blondie' }, amount: 10 } - ] - }) - - it('straight test', () => { - const sort = sorter({ - amount: -1 - }) - - assert.deepStrictEqual(data.sort(sort), [ - { - _id: 2, - item: { category: 'cookies', type: 'chocolate chip' }, - amount: 50 - }, - { _id: 4, item: { category: 'cake', type: 'lemon' }, amount: 30 }, - { _id: 5, item: { category: 'cake', type: 'carrot' }, amount: 20 }, - { - _id: 3, - item: { category: 'cookies', type: 'chocolate chip' }, - amount: 15 - }, - { _id: 1, item: { category: 'cake', type: 'chiffon' }, amount: 10 }, - { _id: 6, item: { category: 'brownies', type: 'blondie' }, amount: 10 } - ]) - }) - - it('embedded sort 1', () => { - const sort = sorter({ - 'item.category': 1, - 'item.type': 1 - }) - - assert.deepStrictEqual(data.sort(sort), [ - { _id: 6, item: { category: 'brownies', type: 'blondie' }, amount: 10 }, - { _id: 5, item: { category: 'cake', type: 'carrot' }, amount: 20 }, - { _id: 1, item: { category: 'cake', type: 'chiffon' }, amount: 10 }, - { _id: 4, item: { category: 'cake', type: 'lemon' }, amount: 30 }, - { - _id: 2, - item: { category: 'cookies', type: 'chocolate chip' }, - amount: 50 - }, - { - _id: 3, - item: { category: 'cookies', type: 'chocolate chip' }, - amount: 15 - } - ]) - }) - - it('embedded sort 2', () => { - const sort = sorter({ - 'item.category': 1, - 'item.type': 1, - amount: 1 - }) - - assert.deepStrictEqual(data.sort(sort), [ - { _id: 6, item: { category: 'brownies', type: 'blondie' }, amount: 10 }, - { _id: 5, item: { category: 'cake', type: 'carrot' }, amount: 20 }, - { _id: 1, item: { category: 'cake', type: 'chiffon' }, amount: 10 }, - { _id: 4, item: { category: 'cake', type: 'lemon' }, amount: 30 }, - { - _id: 3, - item: { category: 'cookies', type: 'chocolate chip' }, - amount: 15 - }, - { - _id: 2, - item: { category: 'cookies', type: 'chocolate chip' }, - amount: 50 - } - ]) - }) - - it('embedded sort 3', () => { - const sort = sorter({ - 'item.category': 1, - 'item.type': 1, - amount: -1 - }) - - assert.deepStrictEqual(data.sort(sort), [ - { _id: 6, item: { category: 'brownies', type: 'blondie' }, amount: 10 }, - { _id: 5, item: { category: 'cake', type: 'carrot' }, amount: 20 }, - { _id: 1, item: { category: 'cake', type: 'chiffon' }, amount: 10 }, - { _id: 4, item: { category: 'cake', type: 'lemon' }, amount: 30 }, - { - _id: 2, - item: { category: 'cookies', type: 'chocolate chip' }, - amount: 50 - }, - { - _id: 3, - item: { category: 'cookies', type: 'chocolate chip' }, - amount: 15 - } - ]) - }) - - it('embedded sort 4', () => { - const sort = sorter({ - amount: -1, - 'item.category': 1 - }) - - assert.deepStrictEqual(data.sort(sort), [ - { - _id: 2, - item: { category: 'cookies', type: 'chocolate chip' }, - amount: 50 - }, - { _id: 4, item: { category: 'cake', type: 'lemon' }, amount: 30 }, - { _id: 5, item: { category: 'cake', type: 'carrot' }, amount: 20 }, - { - _id: 3, - item: { category: 'cookies', type: 'chocolate chip' }, - amount: 15 - }, - { _id: 6, item: { category: 'brownies', type: 'blondie' }, amount: 10 }, - { _id: 1, item: { category: 'cake', type: 'chiffon' }, amount: 10 } - ]) - }) - - it('embedded sort 5', () => { - const sort = sorter({ - 'item.category': 1, - amount: 1 - }) - - assert.deepStrictEqual(data.sort(sort), [ - { _id: 6, item: { category: 'brownies', type: 'blondie' }, amount: 10 }, - { _id: 1, item: { category: 'cake', type: 'chiffon' }, amount: 10 }, - { _id: 5, item: { category: 'cake', type: 'carrot' }, amount: 20 }, - { _id: 4, item: { category: 'cake', type: 'lemon' }, amount: 30 }, - { - _id: 3, - item: { category: 'cookies', type: 'chocolate chip' }, - amount: 15 - }, - { - _id: 2, - item: { category: 'cookies', type: 'chocolate chip' }, - amount: 50 - } - ]) - }) - }) -}) diff --git a/packages/adapter-commons/tsconfig.json b/packages/adapter-commons/tsconfig.json deleted file mode 100644 index 316fd41336..0000000000 --- a/packages/adapter-commons/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig", - "include": [ - "src/**/*.ts" - ], - "compilerOptions": { - "outDir": "lib" - } -} diff --git a/packages/adapter-tests/CHANGELOG.md b/packages/adapter-tests/CHANGELOG.md deleted file mode 100644 index 178df23c33..0000000000 --- a/packages/adapter-tests/CHANGELOG.md +++ /dev/null @@ -1,509 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [5.0.34](https://github.com/feathersjs/feathers/compare/v5.0.33...v5.0.34) (2025-05-03) - -### Bug Fixes - -- Update dependencies ([#3584](https://github.com/feathersjs/feathers/issues/3584)) ([119fa4e](https://github.com/feathersjs/feathers/commit/119fa4e1ade8b0078aa235083d566e2538b3a084)) - -## [5.0.33](https://github.com/feathersjs/feathers/compare/v5.0.32...v5.0.33) (2025-02-24) - -### Bug Fixes - -- **dependencies:** Update dependencies ([#3571](https://github.com/feathersjs/feathers/issues/3571)) ([ad611cb](https://github.com/feathersjs/feathers/commit/ad611cb6ffb1dc31d603ba5817331318c5a23217)) - -## [5.0.32](https://github.com/feathersjs/feathers/compare/v5.0.31...v5.0.32) (2025-02-01) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.31](https://github.com/feathersjs/feathers/compare/v5.0.30...v5.0.31) (2024-10-31) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3545](https://github.com/feathersjs/feathers/issues/3545)) ([221b92b](https://github.com/feathersjs/feathers/commit/221b92bb0ee5d54fb1036742968797cb02e56da2)) - -## [5.0.30](https://github.com/feathersjs/feathers/compare/v5.0.29...v5.0.30) (2024-09-02) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.29](https://github.com/feathersjs/feathers/compare/v5.0.28...v5.0.29) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.28](https://github.com/feathersjs/feathers/compare/v5.0.27...v5.0.28) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.27](https://github.com/feathersjs/feathers/compare/v5.0.26...v5.0.27) (2024-06-18) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.26](https://github.com/feathersjs/feathers/compare/v5.0.25...v5.0.26) (2024-06-09) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.25](https://github.com/feathersjs/feathers/compare/v5.0.24...v5.0.25) (2024-05-03) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.24](https://github.com/feathersjs/feathers/compare/v5.0.23...v5.0.24) (2024-03-13) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.23](https://github.com/feathersjs/feathers/compare/v5.0.22...v5.0.23) (2024-02-25) - -### Bug Fixes - -- **core:** Update to latest feathersjs/hooks ([#3434](https://github.com/feathersjs/feathers/issues/3434)) ([1499ccc](https://github.com/feathersjs/feathers/commit/1499ccc41fb3ebba97b2c84e0cb19bc48ad3c651)) - -## [5.0.22](https://github.com/feathersjs/feathers/compare/v5.0.21...v5.0.22) (2024-02-15) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.21](https://github.com/feathersjs/feathers/compare/v5.0.20...v5.0.21) (2024-01-25) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.20](https://github.com/feathersjs/feathers/compare/v5.0.19...v5.0.20) (2024-01-24) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.19](https://github.com/feathersjs/feathers/compare/v5.0.18...v5.0.19) (2024-01-23) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.18](https://github.com/feathersjs/feathers/compare/v5.0.17...v5.0.18) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.17](https://github.com/feathersjs/feathers/compare/v5.0.16...v5.0.17) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.16](https://github.com/feathersjs/feathers/compare/v5.0.15...v5.0.16) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.15](https://github.com/feathersjs/feathers/compare/v5.0.14...v5.0.15) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.14](https://github.com/feathersjs/feathers/compare/v5.0.13...v5.0.14) (2024-01-05) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.13](https://github.com/feathersjs/feathers/compare/v5.0.12...v5.0.13) (2023-12-29) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.12](https://github.com/feathersjs/feathers/compare/v5.0.11...v5.0.12) (2023-11-28) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.11](https://github.com/feathersjs/feathers/compare/v5.0.10...v5.0.11) (2023-10-11) - -### Bug Fixes - -- **knex:** Update all dependencies and Knex peer ([#3308](https://github.com/feathersjs/feathers/issues/3308)) ([d2f9860](https://github.com/feathersjs/feathers/commit/d2f986036c4741cce2339d8abbcc6b2eb037a12a)) - -## [5.0.10](https://github.com/feathersjs/feathers/compare/v5.0.9...v5.0.10) (2023-10-03) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.9](https://github.com/feathersjs/feathers/compare/v5.0.8...v5.0.9) (2023-09-27) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.8](https://github.com/feathersjs/feathers/compare/v5.0.7...v5.0.8) (2023-07-19) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.7](https://github.com/feathersjs/feathers/compare/v5.0.6...v5.0.7) (2023-07-14) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.6](https://github.com/feathersjs/feathers/compare/v5.0.5...v5.0.6) (2023-06-15) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [5.0.5](https://github.com/feathersjs/feathers/compare/v5.0.4...v5.0.5) (2023-04-28) - -### Bug Fixes - -- **typebox:** Revert to TypeBox 0.25 ([#3183](https://github.com/feathersjs/feathers/issues/3183)) ([cacedf5](https://github.com/feathersjs/feathers/commit/cacedf59e3d2df836777f0cd06ab1b2484ed87c5)) - -## [5.0.4](https://github.com/feathersjs/feathers/compare/v5.0.3...v5.0.4) (2023-04-12) - -### Bug Fixes - -- **adapter-commons:** Support non-default import to ease use with ESM projects ([d06f2cf](https://github.com/feathersjs/feathers/commit/d06f2cfcadda7dc23f0e2bec44f64e6be8500d02)) - -## [5.0.3](https://github.com/feathersjs/feathers/compare/v5.0.2...v5.0.3) (2023-04-05) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3139](https://github.com/feathersjs/feathers/issues/3139)) ([f24276e](https://github.com/feathersjs/feathers/commit/f24276e9a909e2e58a0730c730258ce1f70f4028)) - -## [5.0.1](https://github.com/feathersjs/feathers/compare/v5.0.0...v5.0.1) (2023-03-15) - -### Bug Fixes - -- **memory/mongodb:** $select as only property & force 'id' in '$select' ([#3081](https://github.com/feathersjs/feathers/issues/3081)) ([fbe3cf5](https://github.com/feathersjs/feathers/commit/fbe3cf5199e102b5aeda2ae33828d5034df3d105)) - -# [5.0.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.38...v5.0.0) (2023-02-24) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.38](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.37...v5.0.0-pre.38) (2023-02-17) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.37](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.36...v5.0.0-pre.37) (2023-02-09) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.36](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.35...v5.0.0-pre.36) (2023-01-29) - -### Bug Fixes - -- **databases:** Improve documentation for adapters and allow dynamic Knex adapter options ([#3019](https://github.com/feathersjs/feathers/issues/3019)) ([66c4b5e](https://github.com/feathersjs/feathers/commit/66c4b5e72000dd03acb57fca1cad4737c85c9c9e)) - -### Features - -- **database:** Add and to the query syntax ([#3021](https://github.com/feathersjs/feathers/issues/3021)) ([00cb0d9](https://github.com/feathersjs/feathers/commit/00cb0d9c302ae951ae007d3d6ceba33e254edd9c)) - -# [5.0.0-pre.35](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.34...v5.0.0-pre.35) (2023-01-12) - -### Features - -- **generators:** Move core code generators to shared generators package ([#2982](https://github.com/feathersjs/feathers/issues/2982)) ([0328d22](https://github.com/feathersjs/feathers/commit/0328d2292153870bc43958f73d2c6f288a8cec17)) - -# [5.0.0-pre.34](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.33...v5.0.0-pre.34) (2022-12-14) - -### Features - -- **adapter:** Add patch data type to adapters and refactor AdapterBase usage ([#2906](https://github.com/feathersjs/feathers/issues/2906)) ([9ddc2e6](https://github.com/feathersjs/feathers/commit/9ddc2e6b028f026f939d6af68125847e5c6734b4)) - -# [5.0.0-pre.33](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.32...v5.0.0-pre.33) (2022-11-08) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.32](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.31...v5.0.0-pre.32) (2022-10-26) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.31](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.30...v5.0.0-pre.31) (2022-10-12) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.30](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.29...v5.0.0-pre.30) (2022-10-07) - -### Features - -- **core:** Allow to unregister services at runtime ([#2756](https://github.com/feathersjs/feathers/issues/2756)) ([d16601f](https://github.com/feathersjs/feathers/commit/d16601f2277dca5357866ffdefba2a611f6dc7fa)) - -# [5.0.0-pre.29](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.28...v5.0.0-pre.29) (2022-09-16) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.28](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.27...v5.0.0-pre.28) (2022-08-03) - -### Bug Fixes - -- **cli:** Improve generated application and client ([#2701](https://github.com/feathersjs/feathers/issues/2701)) ([bd55ffb](https://github.com/feathersjs/feathers/commit/bd55ffb812e89bf215f4515e7f137656ea888c3f)) - -# [5.0.0-pre.27](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.26...v5.0.0-pre.27) (2022-07-13) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.26](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.25...v5.0.0-pre.26) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.25](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.24...v5.0.0-pre.25) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.24](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.23...v5.0.0-pre.24) (2022-06-21) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.23](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.22...v5.0.0-pre.23) (2022-06-06) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.22](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.21...v5.0.0-pre.22) (2022-05-24) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.20](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.19...v5.0.0-pre.20) (2022-05-04) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.19](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.18...v5.0.0-pre.19) (2022-05-01) - -### Bug Fixes - -- **adapter-commons:** Clarify adapter query filtering ([#2607](https://github.com/feathersjs/feathers/issues/2607)) ([2dac771](https://github.com/feathersjs/feathers/commit/2dac771b0a3298d6dd25994d05186701b0617718)) -- **adapter-tests:** Ensure multi tests can run standalone ([#2608](https://github.com/feathersjs/feathers/issues/2608)) ([d7243f2](https://github.com/feathersjs/feathers/commit/d7243f20e84d9dde428ad8dfc7f48388ca569e6e)) - -### BREAKING CHANGES - -- **adapter-commons:** Changes the common adapter base class to use `sanitizeQuery` and `sanitizeData` - -# [5.0.0-pre.18](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.17...v5.0.0-pre.18) (2022-04-11) - -### Bug Fixes - -- **adapter-tests:** Add tests for pagination in multi updates ([#2472](https://github.com/feathersjs/feathers/issues/2472)) ([98a811a](https://github.com/feathersjs/feathers/commit/98a811ac605575ff812a08d0504729a5efe7a69c)) - -# [5.0.0-pre.17](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.16...v5.0.0-pre.17) (2022-02-15) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.16](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.15...v5.0.0-pre.16) (2022-01-12) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.15](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.14...v5.0.0-pre.15) (2021-11-27) - -### Bug Fixes - -- **typescript:** Overall typing improvements ([#2478](https://github.com/feathersjs/feathers/issues/2478)) ([b8eb804](https://github.com/feathersjs/feathers/commit/b8eb804158556d9651a8607e3c3fda15e0bfd110)) - -# [5.0.0-pre.14](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.13...v5.0.0-pre.14) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.13](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.12...v5.0.0-pre.13) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.12](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.11...v5.0.0-pre.12) (2021-10-12) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.11](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.10...v5.0.0-pre.11) (2021-10-06) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.10](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.9...v5.0.0-pre.10) (2021-09-19) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.9](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.8...v5.0.0-pre.9) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.8](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.7...v5.0.0-pre.8) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.7](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.6...v5.0.0-pre.7) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.6](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.5...v5.0.0-pre.6) (2021-08-08) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.4...v5.0.0-pre.5) (2021-06-23) - -### Bug Fixes - -- Update database adapter common repository urls ([#2380](https://github.com/feathersjs/feathers/issues/2380)) ([3f4db68](https://github.com/feathersjs/feathers/commit/3f4db68d6700c7d9023ecd17d0d39893f75a19fd)) - -### Features - -- **adapter-commons:** Add support for params.adapter option and move memory adapter to @feathersjs/memory ([#2367](https://github.com/feathersjs/feathers/issues/2367)) ([a43e7da](https://github.com/feathersjs/feathers/commit/a43e7da22b6b981a96d1321736ea9a0cb924fb4f)) - -# [5.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.3...v5.0.0-pre.4) (2021-05-13) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.2...v5.0.0-pre.3) (2021-04-21) - -### Bug Fixes - -- **typescript:** Improve TypeScript backwards compatibility ([#2310](https://github.com/feathersjs/feathers/issues/2310)) ([f33be73](https://github.com/feathersjs/feathers/commit/f33be73fc46a533efb15df9aab0658e3240d3897)) - -# [5.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.1...v5.0.0-pre.2) (2021-04-06) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [5.0.0-beta.1](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2021-04-03) - -### Bug Fixes - -- **adapter-tests:** Add test that verified paginated total ([#2273](https://github.com/feathersjs/feathers/issues/2273)) ([879bd6b](https://github.com/feathersjs/feathers/commit/879bd6b24f42e04eeeeba110ddddda3e1e1dea34)) - -# [5.0.0-beta.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.1...v5.0.0-beta.0) (2021-03-28) - -### Features - -- **core:** Remove Uberproto ([#2178](https://github.com/feathersjs/feathers/issues/2178)) ([ddf8821](https://github.com/feathersjs/feathers/commit/ddf8821f53317e6a378657f7d66acb03a037ee47)) - -### BREAKING CHANGES - -- **core:** Services no longer extend Uberproto objects and - `service.mixin()` is no longer available. - -# [5.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.5.11...v5.0.0-pre.1) (2020-12-17) - -### Features - -- **memory:** Move feathers-memory into @feathersjs/memory ([#2153](https://github.com/feathersjs/feathers/issues/2153)) ([dd61fe3](https://github.com/feathersjs/feathers/commit/dd61fe371fb0502f78b8ccbe1f45a030e31ecff6)) - -## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [4.5.4](https://github.com/feathersjs/feathers/compare/v4.5.3...v4.5.4) (2020-09-27) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## 4.5.3 (2020-09-24) - -### Bug Fixes - -- **adapter-tests:** Update multi patch + query tests ([#5](https://github.com/feathersjs/databases/issues/5)) ([84f1fe4](https://github.com/feathersjs/databases/commit/84f1fe4f13dc3a26891e43b965f75d08243f6c6f)) - -## [4.5.2](https://github.com/feathersjs/feathers/compare/v4.5.1...v4.5.2) (2020-03-04) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [4.5.1](https://github.com/feathersjs/feathers/compare/v4.5.0...v4.5.1) (2020-01-24) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [4.5.0](https://github.com/feathersjs/feathers/compare/v4.4.3...v4.5.0) (2020-01-18) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [4.4.3](https://github.com/feathersjs/feathers/compare/v4.4.1...v4.4.3) (2019-12-06) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [4.4.1](https://github.com/feathersjs/feathers/compare/v4.4.0...v4.4.1) (2019-11-27) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [4.4.0](https://github.com/feathersjs/feathers/compare/v4.3.11...v4.4.0) (2019-11-27) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [4.3.11](https://github.com/feathersjs/feathers/compare/v4.3.10...v4.3.11) (2019-11-11) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [4.3.10](https://github.com/feathersjs/feathers/compare/v4.3.9...v4.3.10) (2019-10-26) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [4.3.9](https://github.com/feathersjs/feathers/compare/v4.3.8...v4.3.9) (2019-10-26) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [4.3.7](https://github.com/feathersjs/feathers/compare/v4.3.6...v4.3.7) (2019-10-14) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [4.3.4](https://github.com/feathersjs/feathers/compare/v4.3.3...v4.3.4) (2019-10-03) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [4.3.3](https://github.com/feathersjs/feathers/compare/v4.3.2...v4.3.3) (2019-09-21) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [4.3.2](https://github.com/feathersjs/feathers/compare/v4.3.1...v4.3.2) (2019-09-16) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -## [4.3.1](https://github.com/feathersjs/feathers/compare/v4.3.0...v4.3.1) (2019-09-09) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [4.3.0](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.4...v4.3.0) (2019-08-27) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [4.3.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.3...v4.3.0-pre.4) (2019-08-22) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [4.3.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.2...v4.3.0-pre.3) (2019-08-19) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [4.3.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.1...v4.3.0-pre.2) (2019-08-02) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [4.3.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.5...v4.3.0-pre.1) (2019-07-11) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [4.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.4...v4.0.0-pre.5) (2019-07-10) - -### Bug Fixes - -- Fix feathers-memory dependency that did not get updated ([9422b13](https://github.com/feathersjs/feathers/commit/9422b13)) - -# [4.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.3...v4.0.0-pre.4) (2019-07-05) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [4.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.2...v4.0.0-pre.3) (2019-06-01) - -### Bug Fixes - -- Update dependencies and fix tests ([#1373](https://github.com/feathersjs/feathers/issues/1373)) ([d743a7f](https://github.com/feathersjs/feathers/commit/d743a7f)) - -# [4.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.1...v4.0.0-pre.2) (2019-05-15) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [4.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.0...v4.0.0-pre.1) (2019-05-08) - -**Note:** Version bump only for package @feathersjs/adapter-tests - -# [4.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v3.2.0-pre.1...v4.0.0-pre.0) (2019-04-21) - -### Bug Fixes - -- Add test to make sure different id in adapter query works ([#1165](https://github.com/feathersjs/feathers/issues/1165)) ([0ba4580](https://github.com/feathersjs/feathers/commit/0ba4580)) -- Update adapter tests to not rely on error instance ([#1202](https://github.com/feathersjs/feathers/issues/1202)) ([6885e0e](https://github.com/feathersjs/feathers/commit/6885e0e)) -- Update all dependencies to latest ([#1206](https://github.com/feathersjs/feathers/issues/1206)) ([e51e0f6](https://github.com/feathersjs/feathers/commit/e51e0f6)) - -### chore - -- **package:** Move adapter tests into their own module ([#1164](https://github.com/feathersjs/feathers/issues/1164)) ([dcc1e6b](https://github.com/feathersjs/feathers/commit/dcc1e6b)) - -### Features - -- Add TypeScript definitions ([#1275](https://github.com/feathersjs/feathers/issues/1275)) ([9dd6713](https://github.com/feathersjs/feathers/commit/9dd6713)) -- Authentication v3 core server implementation ([#1205](https://github.com/feathersjs/feathers/issues/1205)) ([1bd7591](https://github.com/feathersjs/feathers/commit/1bd7591)) - -### BREAKING CHANGES - -- **package:** Removes adapter tests from @feathersjs/adapter-commons - -## [1.0.1](https://github.com/feathersjs/feathers/compare/@feathersjs/adapter-tests@1.0.0...@feathersjs/adapter-tests@1.0.1) (2019-01-10) - -### Bug Fixes - -- Add test to make sure different id in adapter query works ([#1165](https://github.com/feathersjs/feathers/issues/1165)) ([0ba4580](https://github.com/feathersjs/feathers/commit/0ba4580)) - -# 1.0.0 (2019-01-10) - -### chore - -- **package:** Move adapter tests into their own module ([#1164](https://github.com/feathersjs/feathers/issues/1164)) ([dcc1e6b](https://github.com/feathersjs/feathers/commit/dcc1e6b)) - -### BREAKING CHANGES - -- **package:** Removes adapter tests from @feathersjs/adapter-commons diff --git a/packages/adapter-tests/LICENSE b/packages/adapter-tests/LICENSE deleted file mode 100644 index 7712f870f3..0000000000 --- a/packages/adapter-tests/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2024 Feathers Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/packages/adapter-tests/README.md b/packages/adapter-tests/README.md deleted file mode 100644 index ebbe6fddc2..0000000000 --- a/packages/adapter-tests/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Feathers Adapter Tests - -[](https://github.com/feathersjs/feathers/actions?query=workflow%3A%22Node.js+CI%22) -[](https://www.npmjs.com/package/@feathersjs/adapter-commons) -[](https://discord.gg/qa8kez8QBx) - -> Feathers shared database adapter test suite - -## About - -This is a repository that contains the test suite for the common database adapter syntax. See the [API documentation](https://docs.feathersjs.com/api/databases/common.html) for more information. - -## Authors - -[Feathers contributors](https://github.com/feathersjs/adapter-tests/graphs/contributors) - -## License - -Copyright (c) 2024 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors) - -Licensed under the [MIT license](LICENSE). diff --git a/packages/adapter-tests/package.json b/packages/adapter-tests/package.json deleted file mode 100644 index 7af3b02f5b..0000000000 --- a/packages/adapter-tests/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "@feathersjs/adapter-tests", - "version": "5.0.34", - "description": "Feathers shared database adapter test suite", - "homepage": "https://feathersjs.com", - "keywords": [ - "feathers" - ], - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/feathers" - }, - "repository": { - "type": "git", - "url": "git://github.com/feathersjs/feathers.git", - "directory": "packages/adapter-tests" - }, - "author": { - "name": "Feathers contributor", - "email": "hello@feathersjs.com", - "url": "https://feathersjs.com" - }, - "contributors": [], - "bugs": { - "url": "https://github.com/feathersjs/feathers/issues" - }, - "engines": { - "node": ">= 12" - }, - "main": "lib/", - "types": "lib/", - "scripts": { - "prepublish": "npm run compile", - "pack": "npm pack --pack-destination ../generators/test/build", - "compile": "shx rm -rf lib/ && tsc && npm run pack", - "test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts" - }, - "directories": { - "lib": "lib" - }, - "files": [ - "CHANGELOG.md", - "LICENSE", - "README.md", - "src/**", - "lib/**" - ], - "publishConfig": { - "access": "public" - }, - "devDependencies": { - "@types/mocha": "^10.0.10", - "@types/node": "^24.1.0", - "mocha": "^11.7.1", - "shx": "^0.4.0", - "ts-node": "^10.9.2", - "typescript": "^5.9.2" - }, - "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5" -} diff --git a/packages/adapter-tests/src/basic.ts b/packages/adapter-tests/src/basic.ts deleted file mode 100644 index c19ad64a76..0000000000 --- a/packages/adapter-tests/src/basic.ts +++ /dev/null @@ -1,50 +0,0 @@ -import assert from 'assert' -import { AdapterBasicTest } from './declarations' - -export default (test: AdapterBasicTest, app: any, _errors: any, serviceName: string, idProp: string) => { - describe('Basic Functionality', () => { - let service: any - - beforeEach(() => { - service = app.service(serviceName) - }) - - it('.id', () => { - assert.strictEqual(service.id, idProp, 'id property is set to expected name') - }) - - test('.options', () => { - assert.ok(service.options, 'Options are available in service.options') - }) - - test('.events', () => { - assert.ok(service.events.includes('testing'), 'service.events is set and includes "testing"') - }) - - describe('Raw Methods', () => { - test('._get', () => { - assert.strictEqual(typeof service._get, 'function') - }) - - test('._find', () => { - assert.strictEqual(typeof service._find, 'function') - }) - - test('._create', () => { - assert.strictEqual(typeof service._create, 'function') - }) - - test('._update', () => { - assert.strictEqual(typeof service._update, 'function') - }) - - test('._patch', () => { - assert.strictEqual(typeof service._patch, 'function') - }) - - test('._remove', () => { - assert.strictEqual(typeof service._remove, 'function') - }) - }) - }) -} diff --git a/packages/adapter-tests/src/declarations.ts b/packages/adapter-tests/src/declarations.ts deleted file mode 100644 index 1674ced7bd..0000000000 --- a/packages/adapter-tests/src/declarations.ts +++ /dev/null @@ -1,98 +0,0 @@ -export type AdapterTest = (name: AdapterTestName, runner: any) => void - -export type AdapterBasicTest = (name: AdapterBasicTestName, runner: any) => void -export type AdapterMethodsTest = (name: AdapterMethodsTestName, runner: any) => void -export type AdapterSyntaxTest = (name: AdapterSyntaxTestName, runner: any) => void - -export type AdapterTestName = AdapterBasicTestName | AdapterMethodsTestName | AdapterSyntaxTestName - -export type AdapterBasicTestName = - | '.id' - | '.options' - | '.events' - | '._get' - | '._find' - | '._create' - | '._update' - | '._patch' - | '._remove' - | '.$get' - | '.$find' - | '.$create' - | '.$update' - | '.$patch' - | '.$remove' - -export type AdapterMethodsTestName = - | '.get' - | '.get + $select' - | '.get + id + query' - | '.get + NotFound' - | '.get + NotFound (integer)' - | '.get + id + query id' - | '.find' - | '.remove' - | '.remove + $select' - | '.remove + id + query' - | '.remove + NotFound' - | '.remove + NotFound (integer)' - | '.remove + multi' - | '.remove + multi no pagination' - | '.remove + id + query id' - | '.update' - | '.update + $select' - | '.update + id + query' - | '.update + NotFound' - | '.update + NotFound (integer)' - | '.update + query + NotFound' - | '.update + id + query id' - | '.patch' - | '.patch + $select' - | '.patch + id + query' - | '.patch multiple' - | '.patch multiple no pagination' - | '.patch multi query same' - | '.patch multi query changed' - | '.patch + NotFound' - | '.patch + NotFound (integer)' - | '.patch + query + NotFound' - | '.patch + id + query id' - | '.create' - | '.create + $select' - | '.create multi' - | '.create ignores query' - | 'internal .find' - | 'internal .get' - | 'internal .create' - | 'internal .update' - | 'internal .patch' - | 'internal .remove' - -export type AdapterSyntaxTestName = - | '.find + equal' - | '.find + equal multiple' - | '.find + $sort' - | '.find + $sort + string' - | '.find + $limit' - | '.find + $limit 0' - | '.find + $skip' - | '.find + $select' - | '.find + $or' - | '.find + $in' - | '.find + $nin' - | '.find + $lt' - | '.find + $lte' - | '.find + $gt' - | '.find + $gte' - | '.find + $ne' - | '.find + $gt + $lt + $sort' - | '.find + $or nested + $sort' - | '.find + $and' - | '.find + $and + $or' - | 'params.adapter + paginate' - | 'params.adapter + multi' - | '.find + paginate' - | '.find + paginate + query' - | '.find + paginate + $limit + $skip' - | '.find + paginate + $limit 0' - | '.find + paginate + params' diff --git a/packages/adapter-tests/src/index.ts b/packages/adapter-tests/src/index.ts deleted file mode 100644 index 9a86033698..0000000000 --- a/packages/adapter-tests/src/index.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* eslint-disable no-console */ -import basicTests from './basic' -import { AdapterTestName } from './declarations' -import methodTests from './methods' -import syntaxTests from './syntax' - -export const adapterTests = (testNames: AdapterTestName[]) => { - return (app: any, errors: any, serviceName: any, idProp = 'id') => { - if (!serviceName) { - throw new Error('You must pass a service name') - } - - const skippedTests: AdapterTestName[] = [] - const allTests: AdapterTestName[] = [] - - const test = (name: AdapterTestName, runner: any) => { - const skip = !testNames.includes(name) - const its = skip ? it.skip : it - - if (skip) { - skippedTests.push(name) - } - - allTests.push(name) - - its(name, runner) - } - - describe(`Adapter tests for '${serviceName}' service with '${idProp}' id property`, () => { - after(() => { - testNames.forEach((name) => { - if (!allTests.includes(name)) { - console.error(`WARNING: '${name}' test is not part of the test suite`) - } - }) - if (skippedTests.length) { - console.log( - `\nSkipped the following ${skippedTests.length} Feathers adapter test(s) out of ${allTests.length} total:` - ) - console.log(JSON.stringify(skippedTests, null, ' ')) - } - }) - - basicTests(test, app, errors, serviceName, idProp) - methodTests(test, app, errors, serviceName, idProp) - syntaxTests(test, app, errors, serviceName, idProp) - }) - } -} - -export * from './declarations' - -export default adapterTests - -if (typeof module !== 'undefined') { - module.exports = Object.assign(adapterTests, module.exports) -} diff --git a/packages/adapter-tests/src/methods.ts b/packages/adapter-tests/src/methods.ts deleted file mode 100644 index 84d6c3f18f..0000000000 --- a/packages/adapter-tests/src/methods.ts +++ /dev/null @@ -1,773 +0,0 @@ -import assert from 'assert' -import { AdapterMethodsTest } from './declarations' - -export default (test: AdapterMethodsTest, app: any, _errors: any, serviceName: string, idProp: string) => { - describe(' Methods', () => { - let doug: any - let service: any - - beforeEach(async () => { - service = app.service(serviceName) - doug = await app.service(serviceName).create({ - name: 'Doug', - age: 32 - }) - }) - - afterEach(async () => { - try { - await app.service(serviceName).remove(doug[idProp]) - } catch (error: any) {} - }) - - describe('get', () => { - test('.get', async () => { - const data = await service.get(doug[idProp]) - - assert.strictEqual(data[idProp].toString(), doug[idProp].toString(), `${idProp} id matches`) - assert.strictEqual(data.name, 'Doug', 'data.name matches') - assert.strictEqual(data.age, 32, 'data.age matches') - }) - - test('.get + $select', async () => { - const data = await service.get(doug[idProp], { - query: { $select: ['name'] } - }) - - assert.strictEqual(data[idProp].toString(), doug[idProp].toString(), `${idProp} id property matches`) - assert.strictEqual(data.name, 'Doug', 'data.name matches') - assert.ok(!data.age, 'data.age is falsy') - }) - - test('.get + id + query', async () => { - try { - await service.get(doug[idProp], { - query: { name: 'Tester' } - }) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Got a NotFound Feathers error') - } - }) - - test('.get + NotFound', async () => { - try { - await service.get('568225fbfe21222432e836ff') - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Error is a NotFound Feathers error') - } - }) - - test('.get + NotFound (integer)', async () => { - try { - await service.get(123456789) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Error is a NotFound Feathers error') - } - }) - - test('.get + id + query id', async () => { - const alice = await service.create({ - name: 'Alice', - age: 12 - }) - - try { - await service.get(doug[idProp], { - query: { [idProp]: alice[idProp] } - }) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Got a NotFound Feathers error') - } - - await service.remove(alice[idProp]) - }) - }) - - describe('find', () => { - test('.find', async () => { - const data = await service.find() - - assert.ok(Array.isArray(data), 'Data is an array') - assert.strictEqual(data.length, 1, 'Got one entry') - }) - }) - - describe('remove', () => { - test('.remove', async () => { - const data = await service.remove(doug[idProp]) - - assert.strictEqual(data.name, 'Doug', 'data.name matches') - }) - - test('.remove + $select', async () => { - const data = await service.remove(doug[idProp], { - query: { $select: ['name'] } - }) - - assert.strictEqual(data[idProp].toString(), doug[idProp].toString(), `${idProp} id property matches`) - assert.strictEqual(data.name, 'Doug', 'data.name matches') - assert.ok(!data.age, 'data.age is falsy') - }) - - test('.remove + id + query', async () => { - try { - await service.remove(doug[idProp], { - query: { name: 'Tester' } - }) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Got a NotFound Feathers error') - } - }) - - test('.remove + NotFound', async () => { - try { - await service.remove('568225fbfe21222432e836ff') - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Error is a NotFound Feathers error') - } - }) - - test('.remove + NotFound (integer)', async () => { - try { - await service.remove(123456789) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Error is a NotFound Feathers error') - } - }) - - test('.remove + multi', async () => { - try { - await service.remove(null) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual( - error.name, - 'MethodNotAllowed', - 'Removing multiple without option set throws MethodNotAllowed' - ) - } - - service.options.multi = ['remove'] - - await service.create({ name: 'Dave', age: 29, created: true }) - await service.create({ - name: 'David', - age: 3, - created: true - }) - - const data = await service.remove(null, { - query: { created: true } - }) - - assert.strictEqual(data.length, 2) - - const names = data.map((person: any) => person.name) - - assert.ok(names.includes('Dave'), 'Dave removed') - assert.ok(names.includes('David'), 'David removed') - }) - - test('.remove + multi no pagination', async () => { - try { - await service.remove(doug[idProp]) - } catch (error: any) {} - - const count = 14 - const defaultPaginate = 10 - - assert.ok(count > defaultPaginate, 'count is bigger than default pagination') - - const multiBefore = service.options.multi - const paginateBefore = service.options.paginate - - try { - service.options.multi = true - service.options.paginate = { - default: defaultPaginate, - max: 100 - } - - const emptyItems = await service.find({ paginate: false }) - assert.strictEqual(emptyItems.length, 0, 'no items before') - - const createdItems = await service.create( - Array.from(Array(count)).map((_, i) => ({ - name: `name-${i}`, - age: 3, - created: true - })) - ) - assert.strictEqual(createdItems.length, count, `created ${count} items`) - - const foundItems = await service.find({ paginate: false }) - assert.strictEqual(foundItems.length, count, `created ${count} items`) - - const foundPaginatedItems = await service.find({}) - assert.strictEqual(foundPaginatedItems.data.length, defaultPaginate, 'found paginated items') - - const allItems = await service.remove(null, { - query: { created: true } - }) - - assert.strictEqual(allItems.length, count, `removed all ${count} items`) - } finally { - await service.remove(null, { - query: { created: true }, - paginate: false - }) - - service.options.multi = multiBefore - service.options.paginate = paginateBefore - } - }) - - test('.remove + id + query id', async () => { - const alice = await service.create({ - name: 'Alice', - age: 12 - }) - - try { - await service.remove(doug[idProp], { - query: { [idProp]: alice[idProp] } - }) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Got a NotFound Feathers error') - } - - await service.remove(alice[idProp]) - }) - }) - - describe('update', () => { - test('.update', async () => { - const originalData = { [idProp]: doug[idProp], name: 'Dougler' } - const originalCopy = Object.assign({}, originalData) - - const data = await service.update(doug[idProp], originalData) - - assert.deepStrictEqual(originalData, originalCopy, 'data was not modified') - assert.strictEqual(data[idProp].toString(), doug[idProp].toString(), `${idProp} id matches`) - assert.strictEqual(data.name, 'Dougler', 'data.name matches') - assert.ok(!data.age, 'data.age is falsy') - }) - - test('.update + $select', async () => { - const originalData = { - [idProp]: doug[idProp], - name: 'Dougler', - age: 10 - } - - const data = await service.update(doug[idProp], originalData, { - query: { $select: ['name'] } - }) - - assert.strictEqual(data[idProp].toString(), doug[idProp].toString(), `${idProp} id property matches`) - assert.strictEqual(data.name, 'Dougler', 'data.name matches') - assert.ok(!data.age, 'data.age is falsy') - }) - - test('.update + id + query', async () => { - try { - await service.update( - doug[idProp], - { - name: 'Dougler' - }, - { - query: { name: 'Tester' } - } - ) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Got a NotFound Feathers error') - } - }) - - test('.update + NotFound', async () => { - try { - await service.update('568225fbfe21222432e836ff', { - name: 'NotFound' - }) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Error is a NotFound Feathers error') - } - }) - - test('.update + NotFound (integer)', async () => { - try { - await service.update(123456789, { - name: 'NotFound' - }) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Error is a NotFound Feathers error') - } - }) - - test('.update + query + NotFound', async () => { - const dave = await service.create({ name: 'Dave' }) - try { - await service.update(dave[idProp], { name: 'UpdatedDave' }, { query: { name: 'NotDave' } }) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Error is a NotFound Feathers error') - } - await service.remove(dave[idProp]) - }) - - test('.update + id + query id', async () => { - const alice = await service.create({ - name: 'Alice', - age: 12 - }) - - try { - await service.update( - doug[idProp], - { - name: 'Dougler', - age: 33 - }, - { - query: { [idProp]: alice[idProp] } - } - ) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Got a NotFound Feathers error') - } - - await service.remove(alice[idProp]) - }) - }) - - describe('patch', () => { - test('.patch', async () => { - const originalData = { [idProp]: doug[idProp], name: 'PatchDoug' } - const originalCopy = Object.assign({}, originalData) - - const data = await service.patch(doug[idProp], originalData) - - assert.deepStrictEqual(originalData, originalCopy, 'original data was not modified') - assert.strictEqual(data[idProp].toString(), doug[idProp].toString(), `${idProp} id matches`) - assert.strictEqual(data.name, 'PatchDoug', 'data.name matches') - assert.strictEqual(data.age, 32, 'data.age matches') - }) - - test('.patch + $select', async () => { - const originalData = { [idProp]: doug[idProp], name: 'PatchDoug' } - - const data = await service.patch(doug[idProp], originalData, { - query: { $select: ['name'] } - }) - - assert.strictEqual(data[idProp].toString(), doug[idProp].toString(), `${idProp} id property matches`) - assert.strictEqual(data.name, 'PatchDoug', 'data.name matches') - assert.ok(!data.age, 'data.age is falsy') - }) - - test('.patch + id + query', async () => { - try { - await service.patch( - doug[idProp], - { - name: 'id patched doug' - }, - { - query: { name: 'Tester' } - } - ) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Got a NotFound Feathers error') - } - }) - - test('.patch multiple', async () => { - try { - await service.patch(null, {}) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual( - error.name, - 'MethodNotAllowed', - 'Removing multiple without option set throws MethodNotAllowed' - ) - } - - const params = { - query: { created: true } - } - const dave = await service.create({ - name: 'Dave', - age: 29, - created: true - }) - const david = await service.create({ - name: 'David', - age: 3, - created: true - }) - - service.options.multi = ['patch'] - - const data = await service.patch( - null, - { - age: 2 - }, - params - ) - - assert.strictEqual(data.length, 2, 'returned two entries') - assert.strictEqual(data[0].age, 2, 'First entry age was updated') - assert.strictEqual(data[1].age, 2, 'Second entry age was updated') - - await service.remove(dave[idProp]) - await service.remove(david[idProp]) - }) - - test('.patch multiple no pagination', async () => { - try { - await service.remove(doug[idProp]) - } catch (error: any) {} - - const count = 14 - const defaultPaginate = 10 - - assert.ok(count > defaultPaginate, 'count is bigger than default pagination') - - const multiBefore = service.options.multi - const paginateBefore = service.options.paginate - - let ids: any[] - - try { - service.options.multi = true - service.options.paginate = { - default: defaultPaginate, - max: 100 - } - - const emptyItems = await service.find({ paginate: false }) - assert.strictEqual(emptyItems.length, 0, 'no items before') - - const createdItems = await service.create( - Array.from(Array(count)).map((_, i) => ({ - name: `name-${i}`, - age: 3, - created: true - })) - ) - assert.strictEqual(createdItems.length, count, `created ${count} items`) - ids = createdItems.map((item: any) => item[idProp]) - - const foundItems = await service.find({ paginate: false }) - assert.strictEqual(foundItems.length, count, `created ${count} items`) - - const foundPaginatedItems = await service.find({}) - assert.strictEqual(foundPaginatedItems.data.length, defaultPaginate, 'found paginated data') - - const allItems = await service.patch(null, { age: 4 }, { query: { created: true } }) - - assert.strictEqual(allItems.length, count, `patched all ${count} items`) - } finally { - service.options.multi = multiBefore - service.options.paginate = paginateBefore - if (ids) { - await Promise.all(ids.map((id) => service.remove(id))) - } - } - }) - - test('.patch multi query same', async () => { - const service = app.service(serviceName) - const multiBefore = service.options.multi - - service.options.multi = true - - const params = { - query: { age: { $lt: 10 } } - } - const dave = await service.create({ - name: 'Dave', - age: 8, - created: true - }) - const david = await service.create({ - name: 'David', - age: 4, - created: true - }) - - const data = await service.patch( - null, - { - age: 2 - }, - params - ) - - assert.strictEqual(data.length, 2, 'returned two entries') - assert.strictEqual(data[0].age, 2, 'First entry age was updated') - assert.strictEqual(data[1].age, 2, 'Second entry age was updated') - - await service.remove(dave[idProp]) - await service.remove(david[idProp]) - - service.options.multi = multiBefore - }) - - test('.patch multi query changed', async () => { - const service = app.service(serviceName) - const multiBefore = service.options.multi - - service.options.multi = true - - const params = { - query: { age: 10 } - } - const dave = await service.create({ - name: 'Dave', - age: 10, - created: true - }) - const david = await service.create({ - name: 'David', - age: 10, - created: true - }) - - const data = await service.patch( - null, - { - age: 2 - }, - params - ) - - assert.strictEqual(data.length, 2, 'returned two entries') - assert.strictEqual(data[0].age, 2, 'First entry age was updated') - assert.strictEqual(data[1].age, 2, 'Second entry age was updated') - - await service.remove(dave[idProp]) - await service.remove(david[idProp]) - - service.options.multi = multiBefore - }) - - test('.patch + NotFound', async () => { - try { - await service.patch('568225fbfe21222432e836ff', { - name: 'PatchDoug' - }) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Error is a NotFound Feathers error') - } - }) - - test('.patch + NotFound (integer)', async () => { - try { - await service.patch(123456789, { - name: 'PatchDoug' - }) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Error is a NotFound Feathers error') - } - }) - - test('.patch + query + NotFound', async () => { - const dave = await service.create({ name: 'Dave' }) - try { - await service.patch(dave[idProp], { name: 'PatchedDave' }, { query: { name: 'NotDave' } }) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Error is a NotFound Feathers error') - } - await service.remove(dave[idProp]) - }) - - test('.patch + id + query id', async () => { - const alice = await service.create({ - name: 'Alice', - age: 12 - }) - - try { - await service.patch( - doug[idProp], - { - age: 33 - }, - { - query: { [idProp]: alice[idProp] } - } - ) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotFound', 'Got a NotFound Feathers error') - } - - await service.remove(alice[idProp]) - }) - }) - - describe('create', () => { - test('.create', async () => { - const originalData = { - name: 'Bill', - age: 40 - } - const originalCopy = Object.assign({}, originalData) - - const data = await service.create(originalData) - - assert.deepStrictEqual(originalData, originalCopy, 'original data was not modified') - assert.ok(data instanceof Object, 'data is an object') - assert.strictEqual(data.name, 'Bill', 'data.name matches') - - await service.remove(data[idProp]) - }) - - test('.create ignores query', async () => { - const originalData = { - name: 'Billy', - age: 42 - } - const data = await service.create(originalData, { - query: { - name: 'Dave' - } - }) - - assert.strictEqual(data.name, 'Billy', 'data.name matches') - - await service.remove(data[idProp]) - }) - - test('.create + $select', async () => { - const originalData = { - name: 'William', - age: 23 - } - - const data = await service.create(originalData, { - query: { $select: ['name'] } - }) - - assert.ok(idProp in data, 'data has id') - assert.strictEqual(data.name, 'William', 'data.name matches') - assert.ok(!data.age, 'data.age is falsy') - - await service.remove(data[idProp]) - }) - - test('.create multi', async () => { - try { - await service.create([], {}) - throw new Error('Should never get here') - } catch (error: any) { - assert.strictEqual( - error.name, - 'MethodNotAllowed', - 'Removing multiple without option set throws MethodNotAllowed' - ) - } - - const items = [ - { - name: 'Gerald', - age: 18 - }, - { - name: 'Herald', - age: 18 - } - ] - - service.options.multi = ['create', 'patch'] - - const data = await service.create(items) - - assert.ok(Array.isArray(data), 'data is an array') - assert.ok(typeof data[0][idProp] !== 'undefined', 'id is set') - assert.strictEqual(data[0].name, 'Gerald', 'first name matches') - assert.ok(typeof data[1][idProp] !== 'undefined', 'id is set') - assert.strictEqual(data[1].name, 'Herald', 'second name macthes') - - await service.remove(data[0][idProp]) - await service.remove(data[1][idProp]) - }) - }) - - describe("doesn't call public methods internally", () => { - let throwing: any - - before(() => { - throwing = Object.assign(Object.create(app.service(serviceName)), { - get store() { - return app.service(serviceName).store - }, - - find() { - throw new Error('find method called') - }, - get() { - throw new Error('get method called') - }, - create() { - throw new Error('create method called') - }, - update() { - throw new Error('update method called') - }, - patch() { - throw new Error('patch method called') - }, - remove() { - throw new Error('remove method called') - } - }) - }) - - test('internal .find', () => app.service(serviceName).find.call(throwing)) - - test('internal .get', () => service.get.call(throwing, doug[idProp])) - - test('internal .create', async () => { - const bob = await service.create.call(throwing, { - name: 'Bob', - age: 25 - }) - - await service.remove(bob[idProp]) - }) - - test('internal .update', () => - service.update.call(throwing, doug[idProp], { - name: 'Dougler' - })) - - test('internal .patch', () => - service.patch.call(throwing, doug[idProp], { - name: 'PatchDoug' - })) - - test('internal .remove', () => service.remove.call(throwing, doug[idProp])) - }) - }) -} diff --git a/packages/adapter-tests/src/syntax.ts b/packages/adapter-tests/src/syntax.ts deleted file mode 100644 index e559d394c2..0000000000 --- a/packages/adapter-tests/src/syntax.ts +++ /dev/null @@ -1,423 +0,0 @@ -import assert from 'assert' -import { AdapterSyntaxTest } from './declarations' - -export default (test: AdapterSyntaxTest, app: any, _errors: any, serviceName: string, idProp: string) => { - describe('Query Syntax', () => { - let bob: any - let alice: any - let doug: any - let service: any - - beforeEach(async () => { - service = app.service(serviceName) - bob = await app.service(serviceName).create({ - name: 'Bob', - age: 25 - }) - doug = await app.service(serviceName).create({ - name: 'Doug', - age: 32 - }) - alice = await app.service(serviceName).create({ - name: 'Alice', - age: 19 - }) - }) - - afterEach(async () => { - await service.remove(bob[idProp]) - await service.remove(alice[idProp]) - await service.remove(doug[idProp]) - }) - - test('.find + equal', async () => { - const params = { query: { name: 'Alice' } } - const data = await service.find(params) - - assert.ok(Array.isArray(data)) - assert.strictEqual(data.length, 1) - assert.strictEqual(data[0].name, 'Alice') - }) - - test('.find + equal multiple', async () => { - const data = await service.find({ - query: { name: 'Alice', age: 20 } - }) - - assert.strictEqual(data.length, 0) - }) - - describe('special filters', () => { - test('.find + $sort', async () => { - let data = await service.find({ - query: { - $sort: { name: 1 } - } - }) - - assert.strictEqual(data.length, 3) - assert.strictEqual(data[0].name, 'Alice') - assert.strictEqual(data[1].name, 'Bob') - assert.strictEqual(data[2].name, 'Doug') - - data = await service.find({ - query: { - $sort: { name: -1 } - } - }) - - assert.strictEqual(data.length, 3) - assert.strictEqual(data[0].name, 'Doug') - assert.strictEqual(data[1].name, 'Bob') - assert.strictEqual(data[2].name, 'Alice') - }) - - test('.find + $sort + string', async () => { - const data = await service.find({ - query: { - $sort: { name: '1' } - } - }) - - assert.strictEqual(data.length, 3) - assert.strictEqual(data[0].name, 'Alice') - assert.strictEqual(data[1].name, 'Bob') - assert.strictEqual(data[2].name, 'Doug') - }) - - test('.find + $limit', async () => { - const data = await service.find({ - query: { - $limit: 2 - } - }) - - assert.strictEqual(data.length, 2) - }) - - test('.find + $limit 0', async () => { - const data = await service.find({ - query: { - $limit: 0 - } - }) - - assert.strictEqual(data.length, 0) - }) - - test('.find + $skip', async () => { - const data = await service.find({ - query: { - $sort: { name: 1 }, - $skip: 1 - } - }) - - assert.strictEqual(data.length, 2) - assert.strictEqual(data[0].name, 'Bob') - assert.strictEqual(data[1].name, 'Doug') - }) - - test('.find + $select', async () => { - const data = await service.find({ - query: { - name: 'Alice', - $select: ['name'] - } - }) - - assert.strictEqual(data.length, 1) - assert.ok(idProp in data[0], 'data has id') - assert.strictEqual(data[0].name, 'Alice') - assert.strictEqual(data[0].age, undefined) - }) - - test('.find + $or', async () => { - const data = await service.find({ - query: { - $or: [{ name: 'Alice' }, { name: 'Bob' }], - $sort: { name: 1 } - } - }) - - assert.strictEqual(data.length, 2) - assert.strictEqual(data[0].name, 'Alice') - assert.strictEqual(data[1].name, 'Bob') - }) - - test('.find + $in', async () => { - const data = await service.find({ - query: { - name: { - $in: ['Alice', 'Bob'] - }, - $sort: { name: 1 } - } - }) - - assert.strictEqual(data.length, 2) - assert.strictEqual(data[0].name, 'Alice') - assert.strictEqual(data[1].name, 'Bob') - }) - - test('.find + $nin', async () => { - const data = await service.find({ - query: { - name: { - $nin: ['Alice', 'Bob'] - } - } - }) - - assert.strictEqual(data.length, 1) - assert.strictEqual(data[0].name, 'Doug') - }) - - test('.find + $lt', async () => { - const data = await service.find({ - query: { - age: { - $lt: 30 - } - } - }) - - assert.strictEqual(data.length, 2) - }) - - test('.find + $lte', async () => { - const data = await service.find({ - query: { - age: { - $lte: 25 - } - } - }) - - assert.strictEqual(data.length, 2) - }) - - test('.find + $gt', async () => { - const data = await service.find({ - query: { - age: { - $gt: 30 - } - } - }) - - assert.strictEqual(data.length, 1) - }) - - test('.find + $gte', async () => { - const data = await service.find({ - query: { - age: { - $gte: 25 - } - } - }) - - assert.strictEqual(data.length, 2) - }) - - test('.find + $ne', async () => { - const data = await service.find({ - query: { - age: { - $ne: 25 - } - } - }) - - assert.strictEqual(data.length, 2) - }) - }) - - test('.find + $gt + $lt + $sort', async () => { - const params = { - query: { - age: { - $gt: 18, - $lt: 30 - }, - $sort: { name: 1 } - } - } - - const data = await service.find(params) - - assert.strictEqual(data.length, 2) - assert.strictEqual(data[0].name, 'Alice') - assert.strictEqual(data[1].name, 'Bob') - }) - - test('.find + $or nested + $sort', async () => { - const params = { - query: { - $or: [ - { name: 'Doug' }, - { - age: { - $gte: 18, - $lt: 25 - } - } - ], - $sort: { name: 1 } - } - } - - const data = await service.find(params) - - assert.strictEqual(data.length, 2) - assert.strictEqual(data[0].name, 'Alice') - assert.strictEqual(data[1].name, 'Doug') - }) - - test('.find + $and', async () => { - const params = { - query: { - $and: [{ age: 19 }], - $sort: { name: 1 } - } - } - - const data = await service.find(params) - - assert.strictEqual(data.length, 1) - assert.strictEqual(data[0].name, 'Alice') - }) - - test('.find + $and + $or', async () => { - const params = { - query: { - $and: [{ $or: [{ name: 'Alice' }] }], - $sort: { name: 1 } - } - } - - const data = await service.find(params) - - assert.strictEqual(data.length, 1) - assert.strictEqual(data[0].name, 'Alice') - }) - - describe('params.adapter', () => { - test('params.adapter + paginate', async () => { - const page = await service.find({ - adapter: { - paginate: { default: 3 } - } - }) - - assert.strictEqual(page.limit, 3) - assert.strictEqual(page.skip, 0) - }) - - test('params.adapter + multi', async () => { - const items = [ - { - name: 'Garald', - age: 200 - }, - { - name: 'Harald', - age: 24 - } - ] - const multiParams = { - adapter: { - multi: ['create'] - } - } - const users = await service.create(items, multiParams) - - assert.strictEqual(users.length, 2) - - await service.remove(users[0][idProp]) - await service.remove(users[1][idProp]) - await assert.rejects(() => service.patch(null, { age: 2 }, multiParams), { - message: 'Can not patch multiple entries' - }) - }) - }) - - describe('paginate', function () { - beforeEach(() => { - service.options.paginate = { - default: 1, - max: 2 - } - }) - - afterEach(() => { - service.options.paginate = {} - }) - - test('.find + paginate', async () => { - const page = await service.find({ - query: { $sort: { name: -1 } } - }) - - assert.strictEqual(page.total, 3) - assert.strictEqual(page.limit, 1) - assert.strictEqual(page.skip, 0) - assert.strictEqual(page.data[0].name, 'Doug') - }) - - test('.find + paginate + query', async () => { - const page = await service.find({ - query: { - $sort: { name: -1 }, - name: 'Doug' - } - }) - - assert.strictEqual(page.total, 1) - assert.strictEqual(page.limit, 1) - assert.strictEqual(page.skip, 0) - assert.strictEqual(page.data[0].name, 'Doug') - }) - - test('.find + paginate + $limit + $skip', async () => { - const params = { - query: { - $skip: 1, - $limit: 4, - $sort: { name: -1 } - } - } - - const page = await service.find(params) - - assert.strictEqual(page.total, 3) - assert.strictEqual(page.limit, 2) - assert.strictEqual(page.skip, 1) - assert.strictEqual(page.data[0].name, 'Bob') - assert.strictEqual(page.data[1].name, 'Alice') - }) - - test('.find + paginate + $limit 0', async () => { - const page = await service.find({ - query: { $limit: 0 } - }) - - assert.strictEqual(page.total, 3) - assert.strictEqual(page.data.length, 0) - }) - - test('.find + paginate + params', async () => { - const page = await service.find({ paginate: { default: 3 } }) - - assert.strictEqual(page.limit, 3) - assert.strictEqual(page.skip, 0) - - const results = await service.find({ paginate: false }) - - assert.ok(Array.isArray(results)) - assert.strictEqual(results.length, 3) - }) - }) - }) -} diff --git a/packages/adapter-tests/test/index.test.ts b/packages/adapter-tests/test/index.test.ts deleted file mode 100644 index fc4a3ad0ec..0000000000 --- a/packages/adapter-tests/test/index.test.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { strict as assert } from 'assert' -import adapterTests from '../src' - -const testSuite = adapterTests([ - '.events', - '._get', - '._find', - '._create', - '._update', - '._patch', - '._remove', - '.$get', - '.$find', - '.$create', - '.$update', - '.$patch', - '.$remove', - '.get', - '.get + $select', - '.get + id + query', - '.get + NotFound', - '.find', - '.remove', - '.remove + $select', - '.remove + id + query', - '.remove + multi', - '.remove + multi no pagination', - '.update', - '.update + $select', - '.update + id + query', - '.update + NotFound', - '.patch', - '.patch + $select', - '.patch + id + query', - '.patch multiple', - '.patch multiple no pagination', - '.patch multi query changed', - '.patch multi query same', - '.patch + NotFound', - '.create', - '.create + $select', - '.create multi', - 'internal .find', - 'internal .get', - 'internal .create', - 'internal .update', - 'internal .patch', - 'internal .remove', - '.find + equal', - '.find + equal multiple', - '.find + $sort', - '.find + $sort + string', - '.find + $limit', - '.find + $limit 0', - '.find + $skip', - '.find + $select', - '.find + $or', - '.find + $in', - '.find + $nin', - '.find + $lt', - '.find + $lte', - '.find + $gt', - '.find + $gte', - '.find + $ne', - '.find + $gt + $lt + $sort', - '.find + $or nested + $sort', - '.find + paginate', - '.find + paginate + $limit + $skip', - '.find + paginate + $limit 0', - '.find + paginate + params', - '.get + id + query id', - '.remove + id + query id', - '.update + id + query id', - '.patch + id + query id' -]) - -describe('Feathers Memory Service', () => { - it('loads the test suite', () => { - assert.ok(typeof testSuite === 'function') - }) - - it('exports as CommonJS', () => { - assert.equal(typeof require('../lib'), 'function') - }) -}) diff --git a/packages/adapter-tests/tsconfig.json b/packages/adapter-tests/tsconfig.json deleted file mode 100644 index 316fd41336..0000000000 --- a/packages/adapter-tests/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig", - "include": [ - "src/**/*.ts" - ], - "compilerOptions": { - "outDir": "lib" - } -} diff --git a/packages/authentication-client/CHANGELOG.md b/packages/authentication-client/CHANGELOG.md deleted file mode 100644 index 3c6ccb1098..0000000000 --- a/packages/authentication-client/CHANGELOG.md +++ /dev/null @@ -1,869 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [5.0.34](https://github.com/feathersjs/feathers/compare/v5.0.33...v5.0.34) (2025-05-03) - -### Bug Fixes - -- Update dependencies ([#3584](https://github.com/feathersjs/feathers/issues/3584)) ([119fa4e](https://github.com/feathersjs/feathers/commit/119fa4e1ade8b0078aa235083d566e2538b3a084)) - -## [5.0.33](https://github.com/feathersjs/feathers/compare/v5.0.32...v5.0.33) (2025-02-24) - -### Bug Fixes - -- **dependencies:** Update dependencies ([#3571](https://github.com/feathersjs/feathers/issues/3571)) ([ad611cb](https://github.com/feathersjs/feathers/commit/ad611cb6ffb1dc31d603ba5817331318c5a23217)) - -## [5.0.32](https://github.com/feathersjs/feathers/compare/v5.0.31...v5.0.32) (2025-02-01) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.31](https://github.com/feathersjs/feathers/compare/v5.0.30...v5.0.31) (2024-10-31) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3545](https://github.com/feathersjs/feathers/issues/3545)) ([221b92b](https://github.com/feathersjs/feathers/commit/221b92bb0ee5d54fb1036742968797cb02e56da2)) - -## [5.0.30](https://github.com/feathersjs/feathers/compare/v5.0.29...v5.0.30) (2024-09-02) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.29](https://github.com/feathersjs/feathers/compare/v5.0.28...v5.0.29) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.28](https://github.com/feathersjs/feathers/compare/v5.0.27...v5.0.28) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.27](https://github.com/feathersjs/feathers/compare/v5.0.26...v5.0.27) (2024-06-18) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.26](https://github.com/feathersjs/feathers/compare/v5.0.25...v5.0.26) (2024-06-09) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.25](https://github.com/feathersjs/feathers/compare/v5.0.24...v5.0.25) (2024-05-03) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.24](https://github.com/feathersjs/feathers/compare/v5.0.23...v5.0.24) (2024-03-13) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.23](https://github.com/feathersjs/feathers/compare/v5.0.22...v5.0.23) (2024-02-25) - -### Bug Fixes - -- **core:** Update to latest feathersjs/hooks ([#3434](https://github.com/feathersjs/feathers/issues/3434)) ([1499ccc](https://github.com/feathersjs/feathers/commit/1499ccc41fb3ebba97b2c84e0cb19bc48ad3c651)) - -## [5.0.22](https://github.com/feathersjs/feathers/compare/v5.0.21...v5.0.22) (2024-02-15) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.21](https://github.com/feathersjs/feathers/compare/v5.0.20...v5.0.21) (2024-01-25) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.20](https://github.com/feathersjs/feathers/compare/v5.0.19...v5.0.20) (2024-01-24) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.19](https://github.com/feathersjs/feathers/compare/v5.0.18...v5.0.19) (2024-01-23) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.18](https://github.com/feathersjs/feathers/compare/v5.0.17...v5.0.18) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.17](https://github.com/feathersjs/feathers/compare/v5.0.16...v5.0.17) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.16](https://github.com/feathersjs/feathers/compare/v5.0.15...v5.0.16) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.15](https://github.com/feathersjs/feathers/compare/v5.0.14...v5.0.15) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.14](https://github.com/feathersjs/feathers/compare/v5.0.13...v5.0.14) (2024-01-05) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.13](https://github.com/feathersjs/feathers/compare/v5.0.12...v5.0.13) (2023-12-29) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.12](https://github.com/feathersjs/feathers/compare/v5.0.11...v5.0.12) (2023-11-28) - -### Bug Fixes - -- **authentication-client:** Allow to abort fetch ([#3310](https://github.com/feathersjs/feathers/issues/3310)) ([ff3e104](https://github.com/feathersjs/feathers/commit/ff3e104b62d02d45261a293aff4e9491241f486f)) - -## [5.0.11](https://github.com/feathersjs/feathers/compare/v5.0.10...v5.0.11) (2023-10-11) - -### Bug Fixes - -- **knex:** Update all dependencies and Knex peer ([#3308](https://github.com/feathersjs/feathers/issues/3308)) ([d2f9860](https://github.com/feathersjs/feathers/commit/d2f986036c4741cce2339d8abbcc6b2eb037a12a)) - -## [5.0.10](https://github.com/feathersjs/feathers/compare/v5.0.9...v5.0.10) (2023-10-03) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.9](https://github.com/feathersjs/feathers/compare/v5.0.8...v5.0.9) (2023-09-27) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.8](https://github.com/feathersjs/feathers/compare/v5.0.7...v5.0.8) (2023-07-19) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.7](https://github.com/feathersjs/feathers/compare/v5.0.6...v5.0.7) (2023-07-14) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.6](https://github.com/feathersjs/feathers/compare/v5.0.5...v5.0.6) (2023-06-15) - -### Bug Fixes - -- **authentication-client:** Do not trigger storage methods if storage not defined ([#3210](https://github.com/feathersjs/feathers/issues/3210)) ([261acbc](https://github.com/feathersjs/feathers/commit/261acbcde387db731e434cb106a27b49dcb64a9a)) -- **authentication-client:** removeAccessToken throws error if storage not defined ([#3195](https://github.com/feathersjs/feathers/issues/3195)) ([b8e2769](https://github.com/feathersjs/feathers/commit/b8e27698f7958a91fe9a4ee64ec5591d23194c44)) - -## [5.0.5](https://github.com/feathersjs/feathers/compare/v5.0.4...v5.0.5) (2023-04-28) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.4](https://github.com/feathersjs/feathers/compare/v5.0.3...v5.0.4) (2023-04-12) - -### Bug Fixes - -- Make sure all Readme files are up to date ([#3154](https://github.com/feathersjs/feathers/issues/3154)) ([a5f0b38](https://github.com/feathersjs/feathers/commit/a5f0b38bbf2a11486415a39533bcc6c67fb51e3e)) - -## [5.0.3](https://github.com/feathersjs/feathers/compare/v5.0.2...v5.0.3) (2023-04-05) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3139](https://github.com/feathersjs/feathers/issues/3139)) ([f24276e](https://github.com/feathersjs/feathers/commit/f24276e9a909e2e58a0730c730258ce1f70f4028)) - -## [5.0.2](https://github.com/feathersjs/feathers/compare/v5.0.1...v5.0.2) (2023-03-23) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [5.0.1](https://github.com/feathersjs/feathers/compare/v5.0.0...v5.0.1) (2023-03-15) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.38...v5.0.0) (2023-02-24) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.38](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.37...v5.0.0-pre.38) (2023-02-17) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.37](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.36...v5.0.0-pre.37) (2023-02-09) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.36](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.35...v5.0.0-pre.36) (2023-01-29) - -### Bug Fixes - -- Update all dependencies ([#3024](https://github.com/feathersjs/feathers/issues/3024)) ([283dc47](https://github.com/feathersjs/feathers/commit/283dc4798d85584bc031e6e54b83b4ea77d1edd0)) - -# [5.0.0-pre.35](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.34...v5.0.0-pre.35) (2023-01-12) - -### Features - -- **generators:** Move core code generators to shared generators package ([#2982](https://github.com/feathersjs/feathers/issues/2982)) ([0328d22](https://github.com/feathersjs/feathers/commit/0328d2292153870bc43958f73d2c6f288a8cec17)) - -# [5.0.0-pre.34](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.33...v5.0.0-pre.34) (2022-12-14) - -### Bug Fixes - -- **authentication-client:** Do not cache authentication errors ([#2892](https://github.com/feathersjs/feathers/issues/2892)) ([cc4e767](https://github.com/feathersjs/feathers/commit/cc4e76726fce1ac73252cfd92e22570d4bdeca20)) -- **authentication-client:** Improve socket reauthentication handling ([#2895](https://github.com/feathersjs/feathers/issues/2895)) ([9db5e7a](https://github.com/feathersjs/feathers/commit/9db5e7adb0f6aea43d607f530d8258ade98b7362)) -- **authentication-client:** Remove access token for fatal 400 errors ([#2894](https://github.com/feathersjs/feathers/issues/2894)) ([cfc6c7a](https://github.com/feathersjs/feathers/commit/cfc6c7a6b9dbc7fb60816e2b7f15897c38deb98d)) - -# [5.0.0-pre.33](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.32...v5.0.0-pre.33) (2022-11-08) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.32](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.31...v5.0.0-pre.32) (2022-10-26) - -### Features - -- **cli:** Add authentication client to generated client ([#2801](https://github.com/feathersjs/feathers/issues/2801)) ([bd59f91](https://github.com/feathersjs/feathers/commit/bd59f91b45a01c2eea0c4386e567f4de5aa6ad99)) - -# [5.0.0-pre.31](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.30...v5.0.0-pre.31) (2022-10-12) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.30](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.29...v5.0.0-pre.30) (2022-10-07) - -### Features - -- **core:** Allow to unregister services at runtime ([#2756](https://github.com/feathersjs/feathers/issues/2756)) ([d16601f](https://github.com/feathersjs/feathers/commit/d16601f2277dca5357866ffdefba2a611f6dc7fa)) - -# [5.0.0-pre.29](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.28...v5.0.0-pre.29) (2022-09-16) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.28](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.27...v5.0.0-pre.28) (2022-08-03) - -### Bug Fixes - -- **authentication-client:** Properly handle missing token error ([#2700](https://github.com/feathersjs/feathers/issues/2700)) ([160746e](https://github.com/feathersjs/feathers/commit/160746e2bceb465fd1b6a003415f8ab38daba521)) -- **cli:** Improve generated application and client ([#2701](https://github.com/feathersjs/feathers/issues/2701)) ([bd55ffb](https://github.com/feathersjs/feathers/commit/bd55ffb812e89bf215f4515e7f137656ea888c3f)) - -# [5.0.0-pre.27](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.26...v5.0.0-pre.27) (2022-07-13) - -### Bug Fixes - -- **authentication-client:** Ensure reAuthenticate works in parallel with other requests ([#2690](https://github.com/feathersjs/feathers/issues/2690)) ([41b3761](https://github.com/feathersjs/feathers/commit/41b376106b47e2f40a8914db7a5ed2935e070c08)) - -# [5.0.0-pre.26](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.25...v5.0.0-pre.26) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.25](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.24...v5.0.0-pre.25) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.24](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.23...v5.0.0-pre.24) (2022-06-21) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.23](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.22...v5.0.0-pre.23) (2022-06-06) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.22](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.21...v5.0.0-pre.22) (2022-05-24) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.21](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.20...v5.0.0-pre.21) (2022-05-23) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.20](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.19...v5.0.0-pre.20) (2022-05-04) - -### Bug Fixes - -- **dependencies:** Lock monorepo package version numbers ([#2623](https://github.com/feathersjs/feathers/issues/2623)) ([5640c10](https://github.com/feathersjs/feathers/commit/5640c1020cc139994e695d658c08bad3494db507)) - -# [5.0.0-pre.19](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.18...v5.0.0-pre.19) (2022-05-01) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.18](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.17...v5.0.0-pre.18) (2022-04-11) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.17](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.16...v5.0.0-pre.17) (2022-02-15) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.16](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.15...v5.0.0-pre.16) (2022-01-12) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.15](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.14...v5.0.0-pre.15) (2021-11-27) - -### Bug Fixes - -- **typescript:** Overall typing improvements ([#2478](https://github.com/feathersjs/feathers/issues/2478)) ([b8eb804](https://github.com/feathersjs/feathers/commit/b8eb804158556d9651a8607e3c3fda15e0bfd110)) - -# [5.0.0-pre.14](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.13...v5.0.0-pre.14) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.13](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.12...v5.0.0-pre.13) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.12](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.11...v5.0.0-pre.12) (2021-10-12) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.11](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.10...v5.0.0-pre.11) (2021-10-06) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.10](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.9...v5.0.0-pre.10) (2021-09-19) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.9](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.8...v5.0.0-pre.9) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.8](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.7...v5.0.0-pre.8) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.7](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.6...v5.0.0-pre.7) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.6](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.5...v5.0.0-pre.6) (2021-08-08) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.4...v5.0.0-pre.5) (2021-06-23) - -### Bug Fixes - -- **hooks:** Migrate built-in hooks and allow backwards compatibility ([#2358](https://github.com/feathersjs/feathers/issues/2358)) ([759c5a1](https://github.com/feathersjs/feathers/commit/759c5a19327a731af965c3604119393b3d09a406)) -- **koa:** Use extended query parser for compatibility ([#2397](https://github.com/feathersjs/feathers/issues/2397)) ([b2944ba](https://github.com/feathersjs/feathers/commit/b2944bac3ec6d5ecc80dc518cd4e58093692db74)) - -### Features - -- **adapter-commons:** Add support for params.adapter option and move memory adapter to @feathersjs/memory ([#2367](https://github.com/feathersjs/feathers/issues/2367)) ([a43e7da](https://github.com/feathersjs/feathers/commit/a43e7da22b6b981a96d1321736ea9a0cb924fb4f)) - -# [5.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.3...v5.0.0-pre.4) (2021-05-13) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.2...v5.0.0-pre.3) (2021-04-21) - -### Bug Fixes - -- **typescript:** Improve TypeScript backwards compatibility ([#2310](https://github.com/feathersjs/feathers/issues/2310)) ([f33be73](https://github.com/feathersjs/feathers/commit/f33be73fc46a533efb15df9aab0658e3240d3897)) - -### Features - -- **dependencies:** Remove direct debug dependency ([#2296](https://github.com/feathersjs/feathers/issues/2296)) ([501d416](https://github.com/feathersjs/feathers/commit/501d4164d30c6a126906dc640cdfdc82207ba34a)) - -# [5.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.1...v5.0.0-pre.2) (2021-04-06) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-beta.1](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2021-04-03) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [5.0.0-beta.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.1...v5.0.0-beta.0) (2021-03-28) - -### Bug Fixes - -- Update Grant usage and other dependencies ([#2264](https://github.com/feathersjs/feathers/issues/2264)) ([7b0f8fa](https://github.com/feathersjs/feathers/commit/7b0f8fad252419ed0ad0bf259cdf3104d322ab60)) - -### Features - -- Application service types default to any ([#1566](https://github.com/feathersjs/feathers/issues/1566)) ([d93ba9a](https://github.com/feathersjs/feathers/commit/d93ba9a17edd20d3397bb00f4f6e82e804e42ed6)) -- Feathers v5 core refactoring and features ([#2255](https://github.com/feathersjs/feathers/issues/2255)) ([2dafb7c](https://github.com/feathersjs/feathers/commit/2dafb7ce14ba57406aeec13d10ca45b1e709bee9)) -- **authentication-client:** Throw separate OauthError in authentication client ([#2189](https://github.com/feathersjs/feathers/issues/2189)) ([fa45ec5](https://github.com/feathersjs/feathers/commit/fa45ec520b21834e103e6fe4200b06dced56c0e6)) - -# [5.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.5.11...v5.0.0-pre.1) (2020-12-17) - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -### chore - -- **package:** Remove @feathersjs/primus packages from core ([#1919](https://github.com/feathersjs/feathers/issues/1919)) ([d20b7d5](https://github.com/feathersjs/feathers/commit/d20b7d5a70f4d3306e294696156e8aa0337c35e9)), closes [#1899](https://github.com/feathersjs/feathers/issues/1899) - -### BREAKING CHANGES - -- **package:** Remove primus packages to be moved into the ecosystem. - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -### chore - -- **package:** Remove @feathersjs/primus packages from core ([#1919](https://github.com/feathersjs/feathers/issues/1919)) ([d20b7d5](https://github.com/feathersjs/feathers/commit/d20b7d5a70f4d3306e294696156e8aa0337c35e9)), closes [#1899](https://github.com/feathersjs/feathers/issues/1899) - -### BREAKING CHANGES - -- **package:** Remove primus packages to be moved into the ecosystem. - -## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05) - -### Bug Fixes - -- **authentication-client:** Allow reAuthentication using specific strategy ([#2140](https://github.com/feathersjs/feathers/issues/2140)) ([2a2bbf7](https://github.com/feathersjs/feathers/commit/2a2bbf7f8ee6d32b9fac8afab3421286b06e6443)) -- **socketio-client:** Throw an error and show a warning if someone tries to use socket.io-client v3 ([#2135](https://github.com/feathersjs/feathers/issues/2135)) ([cc3521c](https://github.com/feathersjs/feathers/commit/cc3521c935a1cbd690e29b7057998e3898f282db)) - -## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [4.5.9](https://github.com/feathersjs/feathers/compare/v4.5.8...v4.5.9) (2020-10-09) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [4.5.8](https://github.com/feathersjs/feathers/compare/v4.5.7...v4.5.8) (2020-08-12) - -### Bug Fixes - -- **authentication-client:** Fix storage type so it works with all supported interfaces ([#2041](https://github.com/feathersjs/feathers/issues/2041)) ([6ee0e78](https://github.com/feathersjs/feathers/commit/6ee0e78d55cf1214f61458f386b94c350eec32af)) - -## [4.5.7](https://github.com/feathersjs/feathers/compare/v4.5.6...v4.5.7) (2020-07-24) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [4.5.6](https://github.com/feathersjs/feathers/compare/v4.5.5...v4.5.6) (2020-07-12) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [4.5.5](https://github.com/feathersjs/feathers/compare/v4.5.4...v4.5.5) (2020-07-11) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [4.5.4](https://github.com/feathersjs/feathers/compare/v4.5.3...v4.5.4) (2020-04-29) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [4.5.3](https://github.com/feathersjs/feathers/compare/v4.5.2...v4.5.3) (2020-04-17) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [4.5.2](https://github.com/feathersjs/feathers/compare/v4.5.1...v4.5.2) (2020-03-04) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [4.5.1](https://github.com/feathersjs/feathers/compare/v4.5.0...v4.5.1) (2020-01-24) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [4.5.0](https://github.com/feathersjs/feathers/compare/v4.4.3...v4.5.0) (2020-01-18) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [4.4.3](https://github.com/feathersjs/feathers/compare/v4.4.1...v4.4.3) (2019-12-06) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [4.4.1](https://github.com/feathersjs/feathers/compare/v4.4.0...v4.4.1) (2019-11-27) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [4.4.0](https://github.com/feathersjs/feathers/compare/v4.3.11...v4.4.0) (2019-11-27) - -### Bug Fixes - -- **authentication-client:** Reset authentication promise on socket disconnect ([#1696](https://github.com/feathersjs/feathers/issues/1696)) ([3951626](https://github.com/feathersjs/feathers/commit/395162633ff22e95833a3c2900cb9464bb5b056f)) - -## [4.3.11](https://github.com/feathersjs/feathers/compare/v4.3.10...v4.3.11) (2019-11-11) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [4.3.10](https://github.com/feathersjs/feathers/compare/v4.3.9...v4.3.10) (2019-10-26) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [4.3.9](https://github.com/feathersjs/feathers/compare/v4.3.8...v4.3.9) (2019-10-26) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [4.3.7](https://github.com/feathersjs/feathers/compare/v4.3.6...v4.3.7) (2019-10-14) - -### Bug Fixes - -- Improve authentication client default storage initialization ([#1613](https://github.com/feathersjs/feathers/issues/1613)) ([d7f5107](https://github.com/feathersjs/feathers/commit/d7f5107ef76297b4ca6db580afc5e2b372f5ee4d)) - -## [4.3.5](https://github.com/feathersjs/feathers/compare/v4.3.4...v4.3.5) (2019-10-07) - -### Bug Fixes - -- Authentication type improvements and timeout fix ([#1605](https://github.com/feathersjs/feathers/issues/1605)) ([19854d3](https://github.com/feathersjs/feathers/commit/19854d3)) - -## [4.3.4](https://github.com/feathersjs/feathers/compare/v4.3.3...v4.3.4) (2019-10-03) - -### Bug Fixes - -- Typing improvements ([#1580](https://github.com/feathersjs/feathers/issues/1580)) ([7818aec](https://github.com/feathersjs/feathers/commit/7818aec)) - -## [4.3.3](https://github.com/feathersjs/feathers/compare/v4.3.2...v4.3.3) (2019-09-21) - -### Bug Fixes - -- Small improvements in dependencies and code sturcture ([#1562](https://github.com/feathersjs/feathers/issues/1562)) ([42c13e2](https://github.com/feathersjs/feathers/commit/42c13e2)) - -## [4.3.2](https://github.com/feathersjs/feathers/compare/v4.3.1...v4.3.2) (2019-09-16) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [4.3.1](https://github.com/feathersjs/feathers/compare/v4.3.0...v4.3.1) (2019-09-09) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [4.3.0](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.4...v4.3.0) (2019-08-27) - -### Bug Fixes - -- Only remove token on NotAuthenticated error in authentication client and handle error better ([#1525](https://github.com/feathersjs/feathers/issues/1525)) ([13a8758](https://github.com/feathersjs/feathers/commit/13a8758)) - -# [4.3.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.3...v4.3.0-pre.4) (2019-08-22) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [4.3.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.2...v4.3.0-pre.3) (2019-08-19) - -### Bug Fixes - -- Update all dependencies ([7d53a00](https://github.com/feathersjs/feathers/commit/7d53a00)) - -### Features - -- Let strategies handle the connection ([#1510](https://github.com/feathersjs/feathers/issues/1510)) ([4329feb](https://github.com/feathersjs/feathers/commit/4329feb)) - -# [4.3.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.1...v4.3.0-pre.2) (2019-08-02) - -### Bug Fixes - -- Do not error in authentication client on logout ([#1473](https://github.com/feathersjs/feathers/issues/1473)) ([8211b98](https://github.com/feathersjs/feathers/commit/8211b98)) - -# [4.3.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.5...v4.3.0-pre.1) (2019-07-11) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [4.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.4...v4.0.0-pre.5) (2019-07-10) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [4.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.3...v4.0.0-pre.4) (2019-07-05) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [4.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.2...v4.0.0-pre.3) (2019-06-01) - -### Bug Fixes - -- Make oAuth paths more consistent and improve authentication client ([#1377](https://github.com/feathersjs/feathers/issues/1377)) ([adb2543](https://github.com/feathersjs/feathers/commit/adb2543)) -- Typings fix and improvements. ([#1364](https://github.com/feathersjs/feathers/issues/1364)) ([515b916](https://github.com/feathersjs/feathers/commit/515b916)) -- Update dependencies and fix tests ([#1373](https://github.com/feathersjs/feathers/issues/1373)) ([d743a7f](https://github.com/feathersjs/feathers/commit/d743a7f)) - -# [4.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.1...v4.0.0-pre.2) (2019-05-15) - -**Note:** Version bump only for package @feathersjs/authentication-client - -# [4.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.0...v4.0.0-pre.1) (2019-05-08) - -### Bug Fixes - -- Guard against null in client side logout function ([#1319](https://github.com/feathersjs/feathers/issues/1319)) ([fa7f057](https://github.com/feathersjs/feathers/commit/fa7f057)) -- Handle error oAuth redirect in authentication client ([#1307](https://github.com/feathersjs/feathers/issues/1307)) ([12d48ee](https://github.com/feathersjs/feathers/commit/12d48ee)) -- Merge httpStrategies and authStrategies option ([#1308](https://github.com/feathersjs/feathers/issues/1308)) ([afa4d55](https://github.com/feathersjs/feathers/commit/afa4d55)) -- Rename jwtStrategies option to authStrategies ([#1305](https://github.com/feathersjs/feathers/issues/1305)) ([4aee151](https://github.com/feathersjs/feathers/commit/4aee151)) -- Update version number check ([53575c5](https://github.com/feathersjs/feathers/commit/53575c5)) - -# [4.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v3.2.0-pre.1...v4.0.0-pre.0) (2019-04-21) - -### Bug Fixes - -- Authentication core improvements ([#1260](https://github.com/feathersjs/feathers/issues/1260)) ([c5dc7a2](https://github.com/feathersjs/feathers/commit/c5dc7a2)) -- Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803)) -- Update adapter common tests ([#1135](https://github.com/feathersjs/feathers/issues/1135)) ([8166dda](https://github.com/feathersjs/feathers/commit/8166dda)) -- Update all dependencies to latest ([#1206](https://github.com/feathersjs/feathers/issues/1206)) ([e51e0f6](https://github.com/feathersjs/feathers/commit/e51e0f6)) -- **package:** update debug to version 3.0.0 ([#61](https://github.com/feathersjs/feathers/issues/61)) ([6f5009c](https://github.com/feathersjs/feathers/commit/6f5009c)) - -### Features - -- @feathersjs/authentication-oauth ([#1299](https://github.com/feathersjs/feathers/issues/1299)) ([656bae7](https://github.com/feathersjs/feathers/commit/656bae7)) -- Add authentication through oAuth redirect to authentication client ([#1301](https://github.com/feathersjs/feathers/issues/1301)) ([35d8043](https://github.com/feathersjs/feathers/commit/35d8043)) -- Add AuthenticationBaseStrategy and make authentication option handling more explicit ([#1284](https://github.com/feathersjs/feathers/issues/1284)) ([2667d92](https://github.com/feathersjs/feathers/commit/2667d92)) -- Add TypeScript definitions ([#1275](https://github.com/feathersjs/feathers/issues/1275)) ([9dd6713](https://github.com/feathersjs/feathers/commit/9dd6713)) -- Authentication v3 client ([#1240](https://github.com/feathersjs/feathers/issues/1240)) ([65b43bd](https://github.com/feathersjs/feathers/commit/65b43bd)) -- Authentication v3 core server implementation ([#1205](https://github.com/feathersjs/feathers/issues/1205)) ([1bd7591](https://github.com/feathersjs/feathers/commit/1bd7591)) - -### BREAKING CHANGES - -- Rewrite for authentication v3 - -## [1.0.11](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication-client@1.0.10...@feathersjs/authentication-client@1.0.11) (2019-01-26) - -**Note:** Version bump only for package @feathersjs/authentication-client - -## [1.0.10](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication-client@1.0.9...@feathersjs/authentication-client@1.0.10) (2019-01-02) - -### Bug Fixes - -- Update adapter common tests ([#1135](https://github.com/feathersjs/feathers/issues/1135)) ([8166dda](https://github.com/feathersjs/feathers/commit/8166dda)) - - - -## [1.0.9](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication-client@1.0.8...@feathersjs/authentication-client@1.0.9) (2018-12-16) - -**Note:** Version bump only for package @feathersjs/authentication-client - - - -## [1.0.8](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication-client@1.0.7...@feathersjs/authentication-client@1.0.8) (2018-10-26) - -**Note:** Version bump only for package @feathersjs/authentication-client - - - -## [1.0.7](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication-client@1.0.6...@feathersjs/authentication-client@1.0.7) (2018-10-25) - -### Bug Fixes - -- Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803)) - - - -## [1.0.6](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication-client@1.0.5...@feathersjs/authentication-client@1.0.6) (2018-09-21) - -**Note:** Version bump only for package @feathersjs/authentication-client - - - -## [1.0.5](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication-client@1.0.4...@feathersjs/authentication-client@1.0.5) (2018-09-17) - -**Note:** Version bump only for package @feathersjs/authentication-client - - - -## [1.0.4](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication-client@1.0.3...@feathersjs/authentication-client@1.0.4) (2018-09-02) - -**Note:** Version bump only for package @feathersjs/authentication-client - - - -## 1.0.3 - -- Migrate to Monorepo ([feathers#462](https://github.com/feathersjs/feathers/issues/462)) - -## [v1.0.2](https://github.com/feathersjs/authentication-client/tree/v1.0.2) (2018-01-03) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v1.0.1...v1.0.2) - -**Closed issues:** - -- No Auth header added when sending 1st request [\#80](https://github.com/feathersjs/authentication-client/issues/80) - -**Merged pull requests:** - -- Update to correspond with latest release [\#84](https://github.com/feathersjs/authentication-client/pull/84) ([daffl](https://github.com/daffl)) -- Update semistandard to the latest version 🚀 [\#83](https://github.com/feathersjs/authentication-client/pull/83) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update feathers-memory to the latest version 🚀 [\#82](https://github.com/feathersjs/authentication-client/pull/82) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.0.1](https://github.com/feathersjs/authentication-client/tree/v1.0.1) (2017-11-16) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v1.0.0...v1.0.1) - -**Merged pull requests:** - -- Add default export for better ES module \(TypeScript\) compatibility [\#81](https://github.com/feathersjs/authentication-client/pull/81) ([daffl](https://github.com/daffl)) -- Update @feathersjs/authentication to the latest version 🚀 [\#79](https://github.com/feathersjs/authentication-client/pull/79) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.0.0](https://github.com/feathersjs/authentication-client/tree/v1.0.0) (2017-11-01) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v1.0.0-pre.1...v1.0.0) - -**Merged pull requests:** - -- Update dependencies for release [\#78](https://github.com/feathersjs/authentication-client/pull/78) ([daffl](https://github.com/daffl)) - -## [v1.0.0-pre.1](https://github.com/feathersjs/authentication-client/tree/v1.0.0-pre.1) (2017-10-25) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v0.3.3...v1.0.0-pre.1) - -**Closed issues:** - -- Error authenticating! Error: Token provided to verifyJWT is missing or not a string ? [\#73](https://github.com/feathersjs/authentication-client/issues/73) -- Authorization Header not sent!! [\#69](https://github.com/feathersjs/authentication-client/issues/69) -- users.get\(id\) failed \(Not authenticated\) after successful login. [\#66](https://github.com/feathersjs/authentication-client/issues/66) - -**Merged pull requests:** - -- Updates for Feathers v3 [\#77](https://github.com/feathersjs/authentication-client/pull/77) ([daffl](https://github.com/daffl)) -- Update Codeclimate token and badges [\#76](https://github.com/feathersjs/authentication-client/pull/76) ([daffl](https://github.com/daffl)) -- Rename repository and use npm scope [\#75](https://github.com/feathersjs/authentication-client/pull/75) ([daffl](https://github.com/daffl)) -- Update to new plugin infrastructure [\#74](https://github.com/feathersjs/authentication-client/pull/74) ([daffl](https://github.com/daffl)) -- Update mocha to the latest version 🚀 [\#72](https://github.com/feathersjs/authentication-client/pull/72) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Add babel-polyfill and package-lock.json [\#68](https://github.com/feathersjs/authentication-client/pull/68) ([daffl](https://github.com/daffl)) -- Passport.verifyJWT should return Promise\ , not Promise\ [\#65](https://github.com/feathersjs/authentication-client/pull/65) ([zxh19890103](https://github.com/zxh19890103)) -- Update debug to the latest version 🚀 [\#61](https://github.com/feathersjs/authentication-client/pull/61) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update ws to the latest version 🚀 [\#60](https://github.com/feathersjs/authentication-client/pull/60) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v0.3.3](https://github.com/feathersjs/authentication-client/tree/v0.3.3) (2017-07-18) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v0.3.2...v0.3.3) - -**Closed issues:** - -- An in-range update of feathers is breaking the build 🚨 [\#59](https://github.com/feathersjs/authentication-client/issues/59) -- An in-range update of feathers is breaking the build 🚨 [\#58](https://github.com/feathersjs/authentication-client/issues/58) - -**Merged pull requests:** - -- typings: add auth methods to feathers.Application interface [\#57](https://github.com/feathersjs/authentication-client/pull/57) ([j2L4e](https://github.com/j2L4e)) -- Update feathers-authentication-local to the latest version 🚀 [\#55](https://github.com/feathersjs/authentication-client/pull/55) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update chai to the latest version 🚀 [\#54](https://github.com/feathersjs/authentication-client/pull/54) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update feathers-socketio to the latest version 🚀 [\#50](https://github.com/feathersjs/authentication-client/pull/50) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update socket.io-client to the latest version 🚀 [\#49](https://github.com/feathersjs/authentication-client/pull/49) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update README.md [\#47](https://github.com/feathersjs/authentication-client/pull/47) ([bertho-zero](https://github.com/bertho-zero)) - -## [v0.3.2](https://github.com/feathersjs/authentication-client/tree/v0.3.2) (2017-04-30) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v0.3.1...v0.3.2) - -**Closed issues:** - -- An in-range update of feathers-errors is breaking the build 🚨 [\#45](https://github.com/feathersjs/authentication-client/issues/45) -- Proper way to save jwt in cookies [\#41](https://github.com/feathersjs/authentication-client/issues/41) -- Allow customizing the `tokenField` [\#38](https://github.com/feathersjs/authentication-client/issues/38) -- Show blank page in safari@iOS 8.3 [\#37](https://github.com/feathersjs/authentication-client/issues/37) - -**Merged pull requests:** - -- Catch getJWT promise errors [\#46](https://github.com/feathersjs/authentication-client/pull/46) ([NikitaVlaznev](https://github.com/NikitaVlaznev)) -- Update semistandard to the latest version 🚀 [\#43](https://github.com/feathersjs/authentication-client/pull/43) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update feathers-hooks to the latest version 🚀 [\#42](https://github.com/feathersjs/authentication-client/pull/42) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update dependencies to enable Greenkeeper 🌴 [\#40](https://github.com/feathersjs/authentication-client/pull/40) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Note that auth must be configured after rest/socket clients [\#36](https://github.com/feathersjs/authentication-client/pull/36) ([hubgit](https://github.com/hubgit)) - -## [v0.3.1](https://github.com/feathersjs/authentication-client/tree/v0.3.1) (2017-03-10) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v0.3.0...v0.3.1) - -**Closed issues:** - -- The latest tag on NPM is wrong [\#35](https://github.com/feathersjs/authentication-client/issues/35) -- exp claim should be optional [\#33](https://github.com/feathersjs/authentication-client/issues/33) - -**Merged pull requests:** - -- Fix \#33 exp claim should be optional [\#34](https://github.com/feathersjs/authentication-client/pull/34) ([whollacsek](https://github.com/whollacsek)) - -## [v0.3.0](https://github.com/feathersjs/authentication-client/tree/v0.3.0) (2017-03-08) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v0.2.0...v0.3.0) - -## [v0.2.0](https://github.com/feathersjs/authentication-client/tree/v0.2.0) (2017-03-07) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v0.1.10...v0.2.0) - -**Closed issues:** - -- Support `authenticated` and `logout` client side events [\#29](https://github.com/feathersjs/authentication-client/issues/29) -- The default header mismatches the default feathers-authentication header [\#23](https://github.com/feathersjs/authentication-client/issues/23) -- Re-authenticating fails when passing options [\#22](https://github.com/feathersjs/authentication-client/issues/22) -- Socket.io timeout does nothing when there is JWT token available [\#19](https://github.com/feathersjs/authentication-client/issues/19) - -**Merged pull requests:** - -- Fix header casing [\#32](https://github.com/feathersjs/authentication-client/pull/32) ([daffl](https://github.com/daffl)) -- Add client side `authenticated` and `logout` events [\#31](https://github.com/feathersjs/authentication-client/pull/31) ([daffl](https://github.com/daffl)) -- Add support for socket timeouts and some refactoring [\#30](https://github.com/feathersjs/authentication-client/pull/30) ([daffl](https://github.com/daffl)) - -## [v0.1.10](https://github.com/feathersjs/authentication-client/tree/v0.1.10) (2017-03-03) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v0.1.9...v0.1.10) - -**Merged pull requests:** - -- Remove hardcoded values for Config and Credentials typings [\#28](https://github.com/feathersjs/authentication-client/pull/28) ([myknbani](https://github.com/myknbani)) - -## [v0.1.9](https://github.com/feathersjs/authentication-client/tree/v0.1.9) (2017-03-01) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v0.1.8...v0.1.9) - -**Merged pull requests:** - -- Typescript Definitions [\#25](https://github.com/feathersjs/authentication-client/pull/25) ([AbraaoAlves](https://github.com/AbraaoAlves)) - -## [v0.1.8](https://github.com/feathersjs/authentication-client/tree/v0.1.8) (2017-02-05) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v0.1.7...v0.1.8) - -**Closed issues:** - -- Uncaught TypeError: Cannot read property 'options' of undefined [\#26](https://github.com/feathersjs/authentication-client/issues/26) -- Browser Version [\#24](https://github.com/feathersjs/authentication-client/issues/24) - -**Merged pull requests:** - -- Hoist upgrade handler into current scope by using an arrow function [\#27](https://github.com/feathersjs/authentication-client/pull/27) ([daffl](https://github.com/daffl)) - -## [v0.1.7](https://github.com/feathersjs/authentication-client/tree/v0.1.7) (2017-01-29) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v0.1.6...v0.1.7) - -**Closed issues:** - -- \[Webpack\] TypeError: \_this4.storage.getItem is not a function [\#18](https://github.com/feathersjs/authentication-client/issues/18) -- \[Feature request\] Signup via socket [\#17](https://github.com/feathersjs/authentication-client/issues/17) -- Missing auth token when used with feathers-rest in comparison to feathers-socketio [\#16](https://github.com/feathersjs/authentication-client/issues/16) -- Cannot read property 'on' of undefined - feathers-authentication-client [\#12](https://github.com/feathersjs/authentication-client/issues/12) - -**Merged pull requests:** - -- Update passport.js [\#20](https://github.com/feathersjs/authentication-client/pull/20) ([bertho-zero](https://github.com/bertho-zero)) - -## [v0.1.6](https://github.com/feathersjs/authentication-client/tree/v0.1.6) (2016-12-14) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v0.1.5...v0.1.6) - -**Closed issues:** - -- `logout\(\)` doesn't resolve [\#10](https://github.com/feathersjs/authentication-client/issues/10) - -**Merged pull requests:** - -- Fix linting [\#13](https://github.com/feathersjs/authentication-client/pull/13) ([marshallswain](https://github.com/marshallswain)) - -## [v0.1.5](https://github.com/feathersjs/authentication-client/tree/v0.1.5) (2016-12-13) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v0.1.4...v0.1.5) - -## [v0.1.4](https://github.com/feathersjs/authentication-client/tree/v0.1.4) (2016-12-13) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v0.1.3...v0.1.4) - -**Closed issues:** - -- populateAccessToken tries to access non-existent property [\#11](https://github.com/feathersjs/authentication-client/issues/11) -- Socket client should automatically auth on reconnect [\#2](https://github.com/feathersjs/authentication-client/issues/2) - -**Merged pull requests:** - -- More specific imports for StealJS [\#14](https://github.com/feathersjs/authentication-client/pull/14) ([marshallswain](https://github.com/marshallswain)) - -## [v0.1.3](https://github.com/feathersjs/authentication-client/tree/v0.1.3) (2016-11-23) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v0.1.2...v0.1.3) - -**Closed issues:** - -- Client should ensure socket.io upgrade is complete before authenticating [\#4](https://github.com/feathersjs/authentication-client/issues/4) - -**Merged pull requests:** - -- Socket reconnect [\#9](https://github.com/feathersjs/authentication-client/pull/9) ([ekryski](https://github.com/ekryski)) - -## [v0.1.2](https://github.com/feathersjs/authentication-client/tree/v0.1.2) (2016-11-22) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v0.1.1...v0.1.2) - -**Merged pull requests:** - -- Custom jwt strategy names [\#8](https://github.com/feathersjs/authentication-client/pull/8) ([ekryski](https://github.com/ekryski)) - -## [v0.1.1](https://github.com/feathersjs/authentication-client/tree/v0.1.1) (2016-11-21) - -[Full Changelog](https://github.com/feathersjs/authentication-client/compare/v0.1.0...v0.1.1) - -**Merged pull requests:** - -- Socket reconnect upgrade auth [\#3](https://github.com/feathersjs/authentication-client/pull/3) ([marshallswain](https://github.com/marshallswain)) - -## [v0.1.0](https://github.com/feathersjs/authentication-client/tree/v0.1.0) (2016-11-18) - -**Closed issues:** - -- Relation with feathers-authentication [\#6](https://github.com/feathersjs/authentication-client/issues/6) -- Client: Docs for getJWT & verifyJWT [\#1](https://github.com/feathersjs/authentication-client/issues/1) - -**Merged pull requests:** - -- Feathers authentication 1.0 compatible client [\#7](https://github.com/feathersjs/authentication-client/pull/7) ([ekryski](https://github.com/ekryski)) - -\* _This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)_ diff --git a/packages/authentication-client/LICENSE b/packages/authentication-client/LICENSE deleted file mode 100644 index 7712f870f3..0000000000 --- a/packages/authentication-client/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2024 Feathers Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/packages/authentication-client/README.md b/packages/authentication-client/README.md deleted file mode 100644 index aa47ecfb25..0000000000 --- a/packages/authentication-client/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# @feathersjs/authentication-client - -[](https://github.com/feathersjs/feathers/actions?query=workflow%3ACI) -[](https://www.npmjs.com/package/@feathersjs/authentication-client) -[](https://discord.gg/qa8kez8QBx) - -> Feathers authentication client - -## Installation - -``` -npm install @feathersjs/authentication-client --save -``` - -## Documentation - -Refer to the [Feathers authentication client API documentation](https://feathersjs.com/api/authentication/client.html) for more details. - -## License - -Copyright (c) 2024 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors) - -Licensed under the [MIT license](LICENSE). diff --git a/packages/authentication-client/package.json b/packages/authentication-client/package.json deleted file mode 100644 index 7457b4645b..0000000000 --- a/packages/authentication-client/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "@feathersjs/authentication-client", - "description": "The authentication plugin for feathers-client", - "version": "5.0.34", - "homepage": "https://feathersjs.com", - "main": "lib/", - "types": "lib/", - "keywords": [ - "feathers", - "feathers-plugin" - ], - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/daffl" - }, - "repository": { - "type": "git", - "url": "git://github.com/feathersjs/feathers.git", - "directory": "packages/authentication-client" - }, - "author": { - "name": "Feathers contributors", - "email": "hello@feathersjs.com", - "url": "https://feathersjs.com" - }, - "contributors": [], - "bugs": { - "url": "https://github.com/feathersjs/feathers/issues" - }, - "engines": { - "node": ">= 12" - }, - "files": [ - "CHANGELOG.md", - "LICENSE", - "README.md", - "src/**", - "lib/**", - "*.d.ts", - "*.js" - ], - "scripts": { - "prepublish": "npm run compile", - "pack": "npm pack --pack-destination ../generators/test/build", - "compile": "shx rm -rf lib/ && tsc && npm run pack", - "test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts" - }, - "directories": { - "lib": "lib" - }, - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@feathersjs/authentication": "^5.0.34", - "@feathersjs/commons": "^5.0.34", - "@feathersjs/errors": "^5.0.34", - "@feathersjs/feathers": "^5.0.34" - }, - "devDependencies": { - "@feathersjs/authentication-local": "^5.0.34", - "@feathersjs/express": "^5.0.34", - "@feathersjs/memory": "^5.0.34", - "@feathersjs/rest-client": "^5.0.34", - "@feathersjs/socketio": "^5.0.34", - "@feathersjs/socketio-client": "^5.0.34", - "@types/mocha": "^10.0.10", - "@types/node": "^24.1.0", - "axios": "^1.11.0", - "mocha": "^11.7.1", - "shx": "^0.4.0", - "ts-node": "^10.9.2", - "typescript": "^5.9.2" - }, - "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5" -} diff --git a/packages/authentication-client/src/core.ts b/packages/authentication-client/src/core.ts deleted file mode 100644 index cad7754e67..0000000000 --- a/packages/authentication-client/src/core.ts +++ /dev/null @@ -1,248 +0,0 @@ -import { NotAuthenticated, FeathersError } from '@feathersjs/errors' -import { Application, Params } from '@feathersjs/feathers' -import { AuthenticationRequest, AuthenticationResult } from '@feathersjs/authentication' -import { Storage, StorageWrapper } from './storage' - -class OauthError extends FeathersError { - constructor(message: string, data?: any) { - super(message, 'OauthError', 401, 'oauth-error', data) - } -} - -const getMatch = (location: Location, key: string): [string, RegExp] => { - const regex = new RegExp(`(?:\&?)${key}=([^&]*)`) - const match = location.hash ? location.hash.match(regex) : null - - if (match !== null) { - const [, value] = match - - return [value, regex] - } - - return [null, regex] -} - -export type ClientConstructor = new ( - app: Application, - options: AuthenticationClientOptions -) => AuthenticationClient - -export interface AuthenticationClientOptions { - storage: Storage - header: string - scheme: string - storageKey: string - locationKey: string - locationErrorKey: string - jwtStrategy: string - path: string - Authentication: ClientConstructor -} - -export class AuthenticationClient { - app: Application - authenticated: boolean - options: AuthenticationClientOptions - - constructor(app: Application, options: AuthenticationClientOptions) { - const socket = app.io - const storage = new StorageWrapper(app.get('storage') || options.storage) - - this.app = app - this.options = options - this.authenticated = false - this.app.set('storage', storage) - - if (socket) { - this.handleSocket(socket) - } - } - - get service() { - return this.app.service(this.options.path) - } - - get storage() { - return this.app.get('storage') as Storage - } - - handleSocket(socket: any) { - // When the socket disconnects and we are still authenticated, try to reauthenticate right away - // the websocket connection will handle timeouts and retries - socket.on('disconnect', () => { - if (this.authenticated) { - this.reAuthenticate(true) - } - }) - } - - /** - * Parse the access token or authentication error from the window location hash. Will remove it from the hash - * if found. - * - * @param location The window location - * @returns The access token if available, will throw an error if found, otherwise null - */ - getFromLocation(location: Location) { - const [accessToken, tokenRegex] = getMatch(location, this.options.locationKey) - - if (accessToken !== null) { - location.hash = location.hash.replace(tokenRegex, '') - - return Promise.resolve(accessToken) - } - - const [message, errorRegex] = getMatch(location, this.options.locationErrorKey) - - if (message !== null) { - location.hash = location.hash.replace(errorRegex, '') - - return Promise.reject(new OauthError(decodeURIComponent(message))) - } - - return Promise.resolve(null) - } - - /** - * Set the access token in storage. - * - * @param accessToken The access token to set - * @returns - */ - setAccessToken(accessToken: string) { - return this.storage.setItem(this.options.storageKey, accessToken) - } - - /** - * Returns the access token from storage or the window location hash. - * - * @returns The access token from storage or location hash - */ - getAccessToken(): Promise { - return this.storage.getItem(this.options.storageKey).then((accessToken: string) => { - if (!accessToken && typeof window !== 'undefined' && window.location) { - return this.getFromLocation(window.location) - } - - return accessToken || null - }) - } - - /** - * Remove the access token from storage - * @returns The removed access token - */ - removeAccessToken() { - return this.storage.removeItem(this.options.storageKey) - } - - /** - * Reset the internal authentication state. Usually not necessary to call directly. - * - * @returns null - */ - reset() { - this.app.set('authentication', null) - this.authenticated = false - - return Promise.resolve(null) - } - - handleError(error: FeathersError, type: 'authenticate' | 'logout') { - // For NotAuthenticated, PaymentError, Forbidden, NotFound, MethodNotAllowed, NotAcceptable - // errors, remove the access token - if (error.code > 400 && error.code < 408) { - const promise = this.removeAccessToken().then(() => this.reset()) - - return type === 'logout' ? promise : promise.then(() => Promise.reject(error)) - } - - return this.reset().then(() => Promise.reject(error)) - } - - /** - * Try to reauthenticate using the token from storage. Will do nothing if already authenticated unless - * `force` is true. - * - * @param force force reauthentication with the server - * @param strategy The name of the strategy to use. Defaults to `options.jwtStrategy` - * @param authParams Additional authentication parameters - * @returns The reauthentication result - */ - reAuthenticate(force = false, strategy?: string, authParams?: Params): Promise { - // Either returns the authentication state or - // tries to re-authenticate with the stored JWT and strategy - let authPromise = this.app.get('authentication') - - if (!authPromise || force === true) { - authPromise = this.getAccessToken().then((accessToken) => { - if (!accessToken) { - return this.handleError(new NotAuthenticated('No accessToken found in storage'), 'authenticate') - } - - return this.authenticate( - { - strategy: strategy || this.options.jwtStrategy, - accessToken - }, - authParams - ) - }) - this.app.set('authentication', authPromise) - } - - return authPromise - } - - /** - * Authenticate using a specific strategy and data. - * - * @param authentication The authentication data - * @param params Additional parameters - * @returns The authentication result - */ - authenticate(authentication?: AuthenticationRequest, params?: Params): Promise { - if (!authentication) { - return this.reAuthenticate() - } - - const promise = this.service - .create(authentication, params) - .then((authResult: AuthenticationResult) => { - const { accessToken } = authResult - - this.authenticated = true - this.app.emit('login', authResult) - this.app.emit('authenticated', authResult) - - return this.setAccessToken(accessToken).then(() => authResult) - }) - .catch((error: FeathersError) => this.handleError(error, 'authenticate')) - - this.app.set('authentication', promise) - - return promise - } - - /** - * Log out the current user and remove their token. Will do nothing - * if not authenticated. - * - * @returns The log out result. - */ - logout(): Promise { - return Promise.resolve(this.app.get('authentication')) - .then(() => - this.service.remove(null).then((authResult: AuthenticationResult) => - this.removeAccessToken() - .then(() => this.reset()) - .then(() => { - this.app.emit('logout', authResult) - - return authResult - }) - ) - ) - .catch((error: FeathersError) => this.handleError(error, 'logout')) - } -} diff --git a/packages/authentication-client/src/hooks/authentication.ts b/packages/authentication-client/src/hooks/authentication.ts deleted file mode 100644 index bba7b2dc2d..0000000000 --- a/packages/authentication-client/src/hooks/authentication.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { HookContext, NextFunction } from '@feathersjs/feathers' -import { stripSlashes } from '@feathersjs/commons' - -export const authentication = () => { - return (context: HookContext, next: NextFunction) => { - const { - app, - params, - path, - method, - app: { authentication: service } - } = context - - if (stripSlashes(service.options.path) === path && method === 'create') { - return next() - } - - return Promise.resolve(app.get('authentication')) - .then((authResult) => { - if (authResult) { - context.params = Object.assign({}, authResult, params) - } - }) - .then(next) - } -} diff --git a/packages/authentication-client/src/hooks/index.ts b/packages/authentication-client/src/hooks/index.ts deleted file mode 100644 index ef7cf4ea53..0000000000 --- a/packages/authentication-client/src/hooks/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { authentication } from './authentication' -export { populateHeader } from './populate-header' diff --git a/packages/authentication-client/src/hooks/populate-header.ts b/packages/authentication-client/src/hooks/populate-header.ts deleted file mode 100644 index 1b4776187a..0000000000 --- a/packages/authentication-client/src/hooks/populate-header.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { HookContext, NextFunction } from '@feathersjs/feathers' - -export const populateHeader = () => { - return (context: HookContext, next: NextFunction) => { - const { - app, - params: { accessToken } - } = context - const authentication = app.authentication - - // Set REST header if necessary - if (app.rest && accessToken) { - const { scheme, header } = authentication.options - const authHeader = `${scheme} ${accessToken}` - - context.params.headers = Object.assign( - {}, - { - [header]: authHeader - }, - context.params.headers - ) - } - - return next() - } -} diff --git a/packages/authentication-client/src/index.ts b/packages/authentication-client/src/index.ts deleted file mode 100644 index 5ab704a8d7..0000000000 --- a/packages/authentication-client/src/index.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { AuthenticationClient, AuthenticationClientOptions } from './core' -import * as hooks from './hooks' -import { Application } from '@feathersjs/feathers' -import { Storage, MemoryStorage, StorageWrapper } from './storage' - -declare module '@feathersjs/feathers/lib/declarations' { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - interface Application { - // eslint-disable-line - io: any - rest?: any - authentication: AuthenticationClient - authenticate: AuthenticationClient['authenticate'] - reAuthenticate: AuthenticationClient['reAuthenticate'] - logout: AuthenticationClient['logout'] - } -} - -export const getDefaultStorage = () => { - try { - return new StorageWrapper(window.localStorage) - } catch (error: any) {} - - return new MemoryStorage() -} - -export { AuthenticationClient, AuthenticationClientOptions, Storage, MemoryStorage, hooks } - -export type ClientConstructor = new ( - app: Application, - options: AuthenticationClientOptions -) => AuthenticationClient - -export const defaultStorage: Storage = getDefaultStorage() - -export const defaults: AuthenticationClientOptions = { - header: 'Authorization', - scheme: 'Bearer', - storageKey: 'feathers-jwt', - locationKey: 'access_token', - locationErrorKey: 'error', - jwtStrategy: 'jwt', - path: '/authentication', - Authentication: AuthenticationClient, - storage: defaultStorage -} - -const init = (_options: Partial = {}) => { - const options: AuthenticationClientOptions = Object.assign({}, defaults, _options) - const { Authentication } = options - - return (app: Application) => { - const authentication = new Authentication(app, options) - - app.authentication = authentication - app.authenticate = authentication.authenticate.bind(authentication) - app.reAuthenticate = authentication.reAuthenticate.bind(authentication) - app.logout = authentication.logout.bind(authentication) - - app.hooks([hooks.authentication(), hooks.populateHeader()]) - } -} - -export default init - -if (typeof module !== 'undefined') { - module.exports = Object.assign(init, module.exports) -} diff --git a/packages/authentication-client/src/storage.ts b/packages/authentication-client/src/storage.ts deleted file mode 100644 index f344eabee6..0000000000 --- a/packages/authentication-client/src/storage.ts +++ /dev/null @@ -1,49 +0,0 @@ -export interface Storage { - getItem(key: string): any - setItem?(key: string, value: any): any - removeItem?(key: string): any -} - -export class MemoryStorage implements Storage { - store: { [key: string]: any } - - constructor() { - this.store = {} - } - - getItem(key: string) { - return Promise.resolve(this.store[key]) - } - - setItem(key: string, value: any) { - return Promise.resolve((this.store[key] = value)) - } - - removeItem(key: string) { - const value = this.store[key] - - delete this.store[key] - - return Promise.resolve(value) - } -} - -export class StorageWrapper implements Storage { - storage: any - - constructor(storage: any) { - this.storage = storage - } - - getItem(key: string) { - return Promise.resolve(this.storage?.getItem(key)) - } - - setItem(key: string, value: any) { - return Promise.resolve(this.storage?.setItem(key, value)) - } - - removeItem(key: string) { - return Promise.resolve(this.storage?.removeItem(key)) - } -} diff --git a/packages/authentication-client/test/index.test.ts b/packages/authentication-client/test/index.test.ts deleted file mode 100644 index 1720b45a4e..0000000000 --- a/packages/authentication-client/test/index.test.ts +++ /dev/null @@ -1,247 +0,0 @@ -import assert from 'assert' -import { feathers, Application } from '@feathersjs/feathers' - -import client from '../src' -import { AuthenticationClient } from '../src' -import { NotAuthenticated } from '@feathersjs/errors' - -describe('@feathersjs/authentication-client', () => { - const accessToken = 'testing' - const user = { - name: 'Test User' - } - let app: Application - - beforeEach(() => { - app = feathers() - - app.configure(client()) - app.use('/authentication', { - async create(data: any) { - if (data.error) { - throw new Error('Did not work') - } - - return { - accessToken, - data, - user - } - }, - - async remove(id) { - if (!app.get('authentication')) { - throw new NotAuthenticated('Not logged in') - } - - return { id } - } - }) - app.use('dummy', { - async find(params) { - return params - } - }) - }) - - it('initializes', () => { - assert.ok(app.authentication instanceof AuthenticationClient) - assert.strictEqual(app.get('storage'), app.authentication.storage) - assert.strictEqual(typeof app.authenticate, 'function') - assert.strictEqual(typeof app.logout, 'function') - }) - - it('setAccessToken, getAccessToken, removeAccessToken', async () => { - const auth = app.authentication - const token = 'hi' - - await auth.setAccessToken(token) - - const res = await auth.getAccessToken() - - assert.strictEqual(res, token) - - await auth.removeAccessToken() - assert.strictEqual(await auth.getAccessToken(), null) - }) - - it('getFromLocation', async () => { - const auth = app.authentication - let dummyLocation = { hash: 'access_token=testing' } as Location - - let token = await auth.getFromLocation(dummyLocation) - - assert.strictEqual(token, 'testing') - assert.strictEqual(dummyLocation.hash, '') - - dummyLocation.hash = 'a=b&access_token=otherTest&c=d' - token = await auth.getFromLocation(dummyLocation) - - assert.strictEqual(token, 'otherTest') - assert.strictEqual(dummyLocation.hash, 'a=b&c=d') - - dummyLocation = { search: 'access_token=testing' } as Location - token = await auth.getFromLocation(dummyLocation) - - assert.strictEqual(await auth.getFromLocation({} as Location), null) - - try { - await auth.getFromLocation({ - hash: 'error=Error Happened&x=y' - } as Location) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'OauthError') - assert.strictEqual(error.message, 'Error Happened') - } - }) - - it('authenticate, authentication hook, login event', async () => { - const data = { - strategy: 'testing' - } - - const promise = new Promise((resolve) => { - app.once('login', resolve) - }) - - app.authenticate(data) - - const result = await promise - - assert.deepStrictEqual(result, { - accessToken, - data, - user - }) - - let at = await app.authentication.getAccessToken() - - assert.strictEqual(at, accessToken, 'Set accessToken in storage') - - at = await Promise.resolve(app.get('storage').getItem('feathers-jwt')) - - assert.strictEqual(at, accessToken, 'Set accessToken in storage') - - const found = await app.service('dummy').find() - assert.deepStrictEqual(found.accessToken, accessToken) - assert.deepStrictEqual(found.user, user) - }) - - it('logout event', async () => { - const promise = new Promise((resolve) => app.once('logout', resolve)) - - app.authenticate({ strategy: 'testing' }).then(() => app.logout()) - - const result = await promise - - assert.deepStrictEqual(result, { id: null }) - }) - - it('does not remove AccessToken on other errors', async () => { - await app.authenticate({ strategy: 'testing' }) - await app.authenticate({ strategy: 'testing' }) - - const at = await app.authentication.getAccessToken() - - assert.strictEqual(at, accessToken) - }) - - it('resets after any error (#1947)', async () => { - await assert.rejects(() => app.authenticate({ strategy: 'testing', error: true }), { - message: 'Did not work' - }) - - const found = await app.service('dummy').find() - - assert.deepStrictEqual(found, {}) - }) - - it('logout when not logged in without error', async () => { - const result = await app.logout() - - assert.strictEqual(result, null) - }) - - describe('reauthenticate', () => { - it('fails when no token in storage and resets authentication state', async () => { - await assert.rejects(() => app.authentication.reAuthenticate(), { - message: 'No accessToken found in storage' - }) - assert.ok(!app.get('authentication'), 'Reset authentication') - }) - - it('reauthenticates when token is in storage', async () => { - const data = { - strategy: 'testing' - } - - const result = await app.authenticate(data) - - assert.deepStrictEqual(result, { - accessToken, - data, - user - }) - await app.authentication.reAuthenticate() - await app.authentication.reset() - - let at = await Promise.resolve(app.get('storage').getItem('feathers-jwt')) - - assert.strictEqual(at, accessToken, 'Set accessToken in storage') - - at = await app.authentication.reAuthenticate() - - assert.deepStrictEqual(at, { - accessToken, - data: { strategy: 'jwt', accessToken: 'testing' }, - user - }) - - await app.logout() - - at = await Promise.resolve(app.get('storage').getItem('feathers-jwt')) - assert.ok(!at) - assert.ok(!app.get('authentication')) - }) - - it('reAuthenticate works with parallel requests', async () => { - const data = { - strategy: 'testing' - } - - await app.authenticate(data) - await app.reAuthenticate() - await app.authentication.reset() - - app.reAuthenticate() - - const found = await app.service('dummy').find() - - assert.deepStrictEqual(found.accessToken, accessToken) - assert.deepStrictEqual(found.user, user) - }) - - it('reauthenticates using different strategy', async () => { - app.configure(client({ jwtStrategy: 'any' })) - - const data = { - strategy: 'testing' - } - - let result = await app.authenticate(data) - assert.deepStrictEqual(result, { - accessToken, - data, - user - }) - - result = await app.authentication.reAuthenticate(false, 'jwt') - assert.deepStrictEqual(result, { - accessToken, - data, - user - }) - }) - }) -}) diff --git a/packages/authentication-client/test/integration/commons.ts b/packages/authentication-client/test/integration/commons.ts deleted file mode 100644 index 4973530792..0000000000 --- a/packages/authentication-client/test/integration/commons.ts +++ /dev/null @@ -1,118 +0,0 @@ -import assert from 'assert' -import { Application } from '@feathersjs/feathers' -import '../../src' - -export default ( - getApp: () => Application, - getClient: () => Application, - { provider, email, password }: { provider: string; email: string; password: string } -) => { - describe('common tests', () => { - let client: Application - let user: any - - before( - async () => - (user = await getApp().service('users').create({ - email, - password - })) - ) - - beforeEach(() => { - client = getClient() - }) - - after(async () => { - await getApp().service('users').remove(user.id) - }) - - it('authenticates with local strategy', async () => { - const result = await client.authenticate({ - strategy: 'local', - email, - password - }) - - assert.ok(result.accessToken) - assert.strictEqual(result.authentication.strategy, 'local') - assert.strictEqual(result.user.email, email) - }) - - it('authentication with wrong credentials fails, does not maintain state', async () => { - await assert.rejects( - () => - client.authenticate({ - strategy: 'local', - email, - password: 'blabla' - }), - { - name: 'NotAuthenticated', - message: 'Invalid login' - } - ) - assert.ok(!client.get('authentication'), 'Reset client state') - }) - - it('errors when not authenticated', async () => { - await assert.rejects(() => client.service('dummy').find(), { - name: 'NotAuthenticated', - code: 401, - message: 'Not authenticated' - }) - }) - - it('authenticates and allows access', async () => { - await client.authenticate({ - strategy: 'local', - email, - password - }) - const result = await client.service('dummy').find() - - assert.strictEqual(result.provider, provider) - assert.ok(result.authentication) - assert.ok(result.authentication.payload) - assert.strictEqual(result.user.email, user.email) - assert.strictEqual(result.user.id, user.id) - }) - - it('re-authenticates', async () => { - await client.authenticate({ - strategy: 'local', - email, - password - }) - - client.authentication.reset() - client.authenticate() - const result = await client.service('dummy').find() - - assert.strictEqual(result.provider, provider) - assert.ok(result.authentication) - assert.ok(result.authentication.payload) - assert.strictEqual(result.user.email, user.email) - assert.strictEqual(result.user.id, user.id) - }) - - it('after logout does not allow subsequent access', async () => { - await client.authenticate({ - strategy: 'local', - email, - password - }) - - const result = await client.logout() - - assert.ok(result!.accessToken) - assert.ok(result!.user) - - assert.rejects(() => client.service('dummy').find(), { - name: 'NotAuthenticated', - code: 401, - message: 'Not authenticated' - }) - }) - }) -} diff --git a/packages/authentication-client/test/integration/express.test.ts b/packages/authentication-client/test/integration/express.test.ts deleted file mode 100644 index e5f7709c6b..0000000000 --- a/packages/authentication-client/test/integration/express.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import axios from 'axios' -import { Server } from 'http' -import { feathers, Application as FeathersApplication } from '@feathersjs/feathers' -import * as express from '@feathersjs/express' -import rest from '@feathersjs/rest-client' - -import authClient from '../../src' -import getApp from './fixture' -import commonTests from './commons' - -describe('@feathersjs/authentication-client Express integration', () => { - let app: express.Application - let server: Server - - before(async () => { - const restApp = express - .default(feathers()) - .use(express.json()) - .configure(express.rest()) - .use(express.parseAuthentication()) - app = getApp(restApp as unknown as FeathersApplication) as express.Application - app.use(express.errorHandler()) - - server = await app.listen(9776) - }) - - after((done) => server.close(() => done())) - - commonTests( - () => app, - () => { - return feathers().configure(rest('http://localhost:9776').axios(axios)).configure(authClient()) - }, - { - email: 'expressauth@feathersjs.com', - password: 'secret', - provider: 'rest' - } - ) -}) diff --git a/packages/authentication-client/test/integration/fixture.ts b/packages/authentication-client/test/integration/fixture.ts deleted file mode 100644 index 1ecef9f9b0..0000000000 --- a/packages/authentication-client/test/integration/fixture.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { authenticate } from '@feathersjs/authentication' -import { HookContext, Application } from '@feathersjs/feathers' -import { memory } from '@feathersjs/memory' -import { AuthenticationService, JWTStrategy } from '@feathersjs/authentication' -import { LocalStrategy, hooks } from '@feathersjs/authentication-local' - -const { hashPassword, protect } = hooks - -export default (app: Application) => { - const authentication = new AuthenticationService(app) - - app.set('authentication', { - entity: 'user', - service: 'users', - secret: 'supersecret', - authStrategies: ['local', 'jwt'], - local: { - usernameField: 'email', - passwordField: 'password' - } - }) - - authentication.register('jwt', new JWTStrategy()) - authentication.register('local', new LocalStrategy()) - - app.use('/authentication', authentication) - app.use( - '/users', - memory({ - paginate: { - default: 10, - max: 20 - } - }) - ) - - app.service('users').hooks({ - before: { - create: hashPassword('password') - }, - after: protect('password') - }) - - app.use('/dummy', { - find(params) { - return Promise.resolve(params) - } - }) - - app.service('dummy').hooks({ - before: authenticate('jwt') - }) - - app.service('users').hooks({ - before(context: HookContext) { - if (context.id !== undefined && context.id !== null) { - context.id = parseInt(context.id as string, 10) - } - - return context - } - }) - - return app -} diff --git a/packages/authentication-client/test/integration/socketio.test.ts b/packages/authentication-client/test/integration/socketio.test.ts deleted file mode 100644 index d6070e5259..0000000000 --- a/packages/authentication-client/test/integration/socketio.test.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { io } from 'socket.io-client' -import assert from 'assert' -import { feathers, Application } from '@feathersjs/feathers' -import socketio from '@feathersjs/socketio' -import socketioClient from '@feathersjs/socketio-client' - -import authClient from '../../src' -import getApp from './fixture' -import commonTests from './commons' -import { AuthenticationResult } from '@feathersjs/authentication/lib' - -describe('@feathersjs/authentication-client Socket.io integration', () => { - let app: Application - - before(async () => { - app = getApp(feathers().configure(socketio())) - - await app.listen(9777) - }) - - after((done) => { - app.io.close(() => done()) - }) - - it('allows to authenticate with handshake headers and sends login event', async () => { - const user = { email: 'authtest@example.com', password: 'alsosecret' } - - await app.service('users').create(user) - - const { accessToken } = await app.service('authentication').create({ - strategy: 'local', - ...user - }) - - const socket = io('http://localhost:9777', { - transports: ['websocket'], - transportOptions: { - websocket: { - extraHeaders: { - Authorization: `Bearer ${accessToken}` - } - } - } - }) - const authResult: any = await new Promise((resolve) => app.once('login', (res) => resolve(res))) - - assert.strictEqual(authResult.accessToken, accessToken) - - const dummy: any = await new Promise((resolve, reject) => { - socket.emit('find', 'dummy', {}, (error: Error, page: any) => (error ? reject(error) : resolve(page))) - }) - - assert.strictEqual(dummy.user.email, user.email) - assert.strictEqual(dummy.authentication.accessToken, accessToken) - assert.strictEqual(dummy.headers.authorization, `Bearer ${accessToken}`) - }) - - it('reconnects after socket disconnection', async () => { - const user = { email: 'disconnecttest@example.com', password: 'alsosecret' } - const socket = io('http://localhost:9777', { - timeout: 500, - reconnection: true, - reconnectionDelay: 100 - }) - const client = feathers().configure(socketioClient(socket)).configure(authClient()) - - await app.service('users').create(user) - await client.authenticate({ - strategy: 'local', - ...user - }) - - const onLogin = new Promise ((resolve) => app.once('login', (data) => resolve(data))) - - socket.once('disconnect', () => socket.connect()) - socket.disconnect() - - const { - authentication: { strategy } - } = await onLogin - const dummy = await client.service('dummy').find() - - assert.strictEqual(strategy, 'jwt') - assert.strictEqual(dummy.user.email, user.email) - }) - - commonTests( - () => app, - () => { - return feathers() - .configure(socketioClient(io('http://localhost:9777'))) - .configure(authClient()) - }, - { - email: 'socketioauth@feathersjs.com', - password: 'secretive', - provider: 'socketio' - } - ) -}) diff --git a/packages/authentication-client/tsconfig.json b/packages/authentication-client/tsconfig.json deleted file mode 100644 index 316fd41336..0000000000 --- a/packages/authentication-client/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig", - "include": [ - "src/**/*.ts" - ], - "compilerOptions": { - "outDir": "lib" - } -} diff --git a/packages/authentication-local/CHANGELOG.md b/packages/authentication-local/CHANGELOG.md deleted file mode 100644 index 6a4c92b758..0000000000 --- a/packages/authentication-local/CHANGELOG.md +++ /dev/null @@ -1,849 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [5.0.34](https://github.com/feathersjs/feathers/compare/v5.0.33...v5.0.34) (2025-05-03) - -### Bug Fixes - -- Update dependencies ([#3584](https://github.com/feathersjs/feathers/issues/3584)) ([119fa4e](https://github.com/feathersjs/feathers/commit/119fa4e1ade8b0078aa235083d566e2538b3a084)) - -## [5.0.33](https://github.com/feathersjs/feathers/compare/v5.0.32...v5.0.33) (2025-02-24) - -### Bug Fixes - -- **dependencies:** Update dependencies ([#3571](https://github.com/feathersjs/feathers/issues/3571)) ([ad611cb](https://github.com/feathersjs/feathers/commit/ad611cb6ffb1dc31d603ba5817331318c5a23217)) - -## [5.0.32](https://github.com/feathersjs/feathers/compare/v5.0.31...v5.0.32) (2025-02-01) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.31](https://github.com/feathersjs/feathers/compare/v5.0.30...v5.0.31) (2024-10-31) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3545](https://github.com/feathersjs/feathers/issues/3545)) ([221b92b](https://github.com/feathersjs/feathers/commit/221b92bb0ee5d54fb1036742968797cb02e56da2)) - -## [5.0.30](https://github.com/feathersjs/feathers/compare/v5.0.29...v5.0.30) (2024-09-02) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.29](https://github.com/feathersjs/feathers/compare/v5.0.28...v5.0.29) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.28](https://github.com/feathersjs/feathers/compare/v5.0.27...v5.0.28) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.27](https://github.com/feathersjs/feathers/compare/v5.0.26...v5.0.27) (2024-06-18) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.26](https://github.com/feathersjs/feathers/compare/v5.0.25...v5.0.26) (2024-06-09) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.25](https://github.com/feathersjs/feathers/compare/v5.0.24...v5.0.25) (2024-05-03) - -### Bug Fixes - -- Reduce usage of lodash ([#3455](https://github.com/feathersjs/feathers/issues/3455)) ([8ce807a](https://github.com/feathersjs/feathers/commit/8ce807a5ca53ff5b8d5107a0656c6329404e6e6c)) - -## [5.0.24](https://github.com/feathersjs/feathers/compare/v5.0.23...v5.0.24) (2024-03-13) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.23](https://github.com/feathersjs/feathers/compare/v5.0.22...v5.0.23) (2024-02-25) - -### Bug Fixes - -- **core:** Update to latest feathersjs/hooks ([#3434](https://github.com/feathersjs/feathers/issues/3434)) ([1499ccc](https://github.com/feathersjs/feathers/commit/1499ccc41fb3ebba97b2c84e0cb19bc48ad3c651)) - -## [5.0.22](https://github.com/feathersjs/feathers/compare/v5.0.21...v5.0.22) (2024-02-15) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.21](https://github.com/feathersjs/feathers/compare/v5.0.20...v5.0.21) (2024-01-25) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.20](https://github.com/feathersjs/feathers/compare/v5.0.19...v5.0.20) (2024-01-24) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.19](https://github.com/feathersjs/feathers/compare/v5.0.18...v5.0.19) (2024-01-23) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.18](https://github.com/feathersjs/feathers/compare/v5.0.17...v5.0.18) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.17](https://github.com/feathersjs/feathers/compare/v5.0.16...v5.0.17) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.16](https://github.com/feathersjs/feathers/compare/v5.0.15...v5.0.16) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.15](https://github.com/feathersjs/feathers/compare/v5.0.14...v5.0.15) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.14](https://github.com/feathersjs/feathers/compare/v5.0.13...v5.0.14) (2024-01-05) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.13](https://github.com/feathersjs/feathers/compare/v5.0.12...v5.0.13) (2023-12-29) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.12](https://github.com/feathersjs/feathers/compare/v5.0.11...v5.0.12) (2023-11-28) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.11](https://github.com/feathersjs/feathers/compare/v5.0.10...v5.0.11) (2023-10-11) - -### Bug Fixes - -- **knex:** Update all dependencies and Knex peer ([#3308](https://github.com/feathersjs/feathers/issues/3308)) ([d2f9860](https://github.com/feathersjs/feathers/commit/d2f986036c4741cce2339d8abbcc6b2eb037a12a)) - -## [5.0.10](https://github.com/feathersjs/feathers/compare/v5.0.9...v5.0.10) (2023-10-03) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.9](https://github.com/feathersjs/feathers/compare/v5.0.8...v5.0.9) (2023-09-27) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.8](https://github.com/feathersjs/feathers/compare/v5.0.7...v5.0.8) (2023-07-19) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.7](https://github.com/feathersjs/feathers/compare/v5.0.6...v5.0.7) (2023-07-14) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.6](https://github.com/feathersjs/feathers/compare/v5.0.5...v5.0.6) (2023-06-15) - -### Bug Fixes - -- **authentication-local:** Local Auth - Nested username & Password fields ([#3091](https://github.com/feathersjs/feathers/issues/3091)) ([d135526](https://github.com/feathersjs/feathers/commit/d135526da18ecf2dc620b82820e1d09d8af5c0b5)) - -## [5.0.5](https://github.com/feathersjs/feathers/compare/v5.0.4...v5.0.5) (2023-04-28) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [5.0.4](https://github.com/feathersjs/feathers/compare/v5.0.3...v5.0.4) (2023-04-12) - -### Bug Fixes - -- Make sure all Readme files are up to date ([#3154](https://github.com/feathersjs/feathers/issues/3154)) ([a5f0b38](https://github.com/feathersjs/feathers/commit/a5f0b38bbf2a11486415a39533bcc6c67fb51e3e)) - -## [5.0.3](https://github.com/feathersjs/feathers/compare/v5.0.2...v5.0.3) (2023-04-05) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3139](https://github.com/feathersjs/feathers/issues/3139)) ([f24276e](https://github.com/feathersjs/feathers/commit/f24276e9a909e2e58a0730c730258ce1f70f4028)) - -## [5.0.1](https://github.com/feathersjs/feathers/compare/v5.0.0...v5.0.1) (2023-03-15) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.38...v5.0.0) (2023-02-24) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.38](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.37...v5.0.0-pre.38) (2023-02-17) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.37](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.36...v5.0.0-pre.37) (2023-02-09) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.36](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.35...v5.0.0-pre.36) (2023-01-29) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.35](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.34...v5.0.0-pre.35) (2023-01-12) - -### Features - -- **generators:** Move core code generators to shared generators package ([#2982](https://github.com/feathersjs/feathers/issues/2982)) ([0328d22](https://github.com/feathersjs/feathers/commit/0328d2292153870bc43958f73d2c6f288a8cec17)) - -# [5.0.0-pre.34](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.33...v5.0.0-pre.34) (2022-12-14) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.33](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.32...v5.0.0-pre.33) (2022-11-08) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.32](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.31...v5.0.0-pre.32) (2022-10-26) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.31](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.30...v5.0.0-pre.31) (2022-10-12) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.30](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.29...v5.0.0-pre.30) (2022-10-07) - -### Features - -- **core:** Allow to unregister services at runtime ([#2756](https://github.com/feathersjs/feathers/issues/2756)) ([d16601f](https://github.com/feathersjs/feathers/commit/d16601f2277dca5357866ffdefba2a611f6dc7fa)) - -# [5.0.0-pre.29](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.28...v5.0.0-pre.29) (2022-09-16) - -### Features - -- **authentication-oauth:** Koa and transport independent oAuth authentication ([#2737](https://github.com/feathersjs/feathers/issues/2737)) ([9231525](https://github.com/feathersjs/feathers/commit/9231525a24bb790ba9c5d940f2867a9c727691c9)) - -# [5.0.0-pre.28](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.27...v5.0.0-pre.28) (2022-08-03) - -### Bug Fixes - -- **cli:** Improve generated application and client ([#2701](https://github.com/feathersjs/feathers/issues/2701)) ([bd55ffb](https://github.com/feathersjs/feathers/commit/bd55ffb812e89bf215f4515e7f137656ea888c3f)) - -# [5.0.0-pre.27](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.26...v5.0.0-pre.27) (2022-07-13) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.26](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.25...v5.0.0-pre.26) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.25](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.24...v5.0.0-pre.25) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.24](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.23...v5.0.0-pre.24) (2022-06-21) - -### Features - -- **authentication-local:** Add passwordHash property resolver ([#2660](https://github.com/feathersjs/feathers/issues/2660)) ([b41279b](https://github.com/feathersjs/feathers/commit/b41279b55eea3771a6fa4983a37be2413287bbc6)) - -# [5.0.0-pre.23](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.22...v5.0.0-pre.23) (2022-06-06) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.22](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.21...v5.0.0-pre.22) (2022-05-24) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.21](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.20...v5.0.0-pre.21) (2022-05-23) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.20](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.19...v5.0.0-pre.20) (2022-05-04) - -### Bug Fixes - -- **dependencies:** Lock monorepo package version numbers ([#2623](https://github.com/feathersjs/feathers/issues/2623)) ([5640c10](https://github.com/feathersjs/feathers/commit/5640c1020cc139994e695d658c08bad3494db507)) - -# [5.0.0-pre.19](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.18...v5.0.0-pre.19) (2022-05-01) - -### Features - -- **typescript:** Improve adapter typings ([#2605](https://github.com/feathersjs/feathers/issues/2605)) ([3b2ca0a](https://github.com/feathersjs/feathers/commit/3b2ca0a6a8e03e8390272c4d7e930b4bffdaacf5)) - -# [5.0.0-pre.18](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.17...v5.0.0-pre.18) (2022-04-11) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.17](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.16...v5.0.0-pre.17) (2022-02-15) - -### Bug Fixes - -- **hooks:** Allow all built-in hooks to be used the async and regular way ([#2559](https://github.com/feathersjs/feathers/issues/2559)) ([8f9f631](https://github.com/feathersjs/feathers/commit/8f9f631e0ce89de349207db72def84e7ab496a4a)) - -# [5.0.0-pre.16](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.15...v5.0.0-pre.16) (2022-01-12) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.15](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.14...v5.0.0-pre.15) (2021-11-27) - -### Bug Fixes - -- **typescript:** Overall typing improvements ([#2478](https://github.com/feathersjs/feathers/issues/2478)) ([b8eb804](https://github.com/feathersjs/feathers/commit/b8eb804158556d9651a8607e3c3fda15e0bfd110)) - -# [5.0.0-pre.14](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.13...v5.0.0-pre.14) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.13](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.12...v5.0.0-pre.13) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.12](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.11...v5.0.0-pre.12) (2021-10-12) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.11](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.10...v5.0.0-pre.11) (2021-10-06) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.10](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.9...v5.0.0-pre.10) (2021-09-19) - -### Bug Fixes - -- **authentication-local:** adds error handling for undefined/null password field ([#2444](https://github.com/feathersjs/feathers/issues/2444)) ([4323f98](https://github.com/feathersjs/feathers/commit/4323f9859a66a7fe3f7f15d81476bd81b735c226)) - -# [5.0.0-pre.9](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.8...v5.0.0-pre.9) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.8](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.7...v5.0.0-pre.8) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.7](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.6...v5.0.0-pre.7) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.6](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.5...v5.0.0-pre.6) (2021-08-08) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.4...v5.0.0-pre.5) (2021-06-23) - -### Bug Fixes - -- **hooks:** Migrate built-in hooks and allow backwards compatibility ([#2358](https://github.com/feathersjs/feathers/issues/2358)) ([759c5a1](https://github.com/feathersjs/feathers/commit/759c5a19327a731af965c3604119393b3d09a406)) -- **koa:** Use extended query parser for compatibility ([#2397](https://github.com/feathersjs/feathers/issues/2397)) ([b2944ba](https://github.com/feathersjs/feathers/commit/b2944bac3ec6d5ecc80dc518cd4e58093692db74)) - -### Features - -- **adapter-commons:** Add support for params.adapter option and move memory adapter to @feathersjs/memory ([#2367](https://github.com/feathersjs/feathers/issues/2367)) ([a43e7da](https://github.com/feathersjs/feathers/commit/a43e7da22b6b981a96d1321736ea9a0cb924fb4f)) - -# [5.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.3...v5.0.0-pre.4) (2021-05-13) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.2...v5.0.0-pre.3) (2021-04-21) - -### Bug Fixes - -- **typescript:** Improve TypeScript backwards compatibility ([#2310](https://github.com/feathersjs/feathers/issues/2310)) ([f33be73](https://github.com/feathersjs/feathers/commit/f33be73fc46a533efb15df9aab0658e3240d3897)) - -### Features - -- **dependencies:** Remove direct debug dependency ([#2296](https://github.com/feathersjs/feathers/issues/2296)) ([501d416](https://github.com/feathersjs/feathers/commit/501d4164d30c6a126906dc640cdfdc82207ba34a)) - -# [5.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.1...v5.0.0-pre.2) (2021-04-06) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-beta.1](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2021-04-03) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-beta.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.1...v5.0.0-beta.0) (2021-03-28) - -### Bug Fixes - -- Update Grant usage and other dependencies ([#2264](https://github.com/feathersjs/feathers/issues/2264)) ([7b0f8fa](https://github.com/feathersjs/feathers/commit/7b0f8fad252419ed0ad0bf259cdf3104d322ab60)) - -### Features - -- Feathers v5 core refactoring and features ([#2255](https://github.com/feathersjs/feathers/issues/2255)) ([2dafb7c](https://github.com/feathersjs/feathers/commit/2dafb7ce14ba57406aeec13d10ca45b1e709bee9)) - -# [5.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.5.11...v5.0.0-pre.1) (2020-12-17) - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [4.5.8](https://github.com/feathersjs/feathers/compare/v4.5.7...v4.5.8) (2020-08-12) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [4.5.7](https://github.com/feathersjs/feathers/compare/v4.5.6...v4.5.7) (2020-07-24) - -### Bug Fixes - -- **authentication:** Add JWT getEntityQuery ([#2013](https://github.com/feathersjs/feathers/issues/2013)) ([e0e7fb5](https://github.com/feathersjs/feathers/commit/e0e7fb5162940fe776731283b40026c61d9c8a33)) - -## [4.5.6](https://github.com/feathersjs/feathers/compare/v4.5.5...v4.5.6) (2020-07-12) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [4.5.5](https://github.com/feathersjs/feathers/compare/v4.5.4...v4.5.5) (2020-07-11) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [4.5.4](https://github.com/feathersjs/feathers/compare/v4.5.3...v4.5.4) (2020-04-29) - -### Bug Fixes - -- **authentication-local:** Allow to hash passwords in array data ([#1936](https://github.com/feathersjs/feathers/issues/1936)) ([64705f5](https://github.com/feathersjs/feathers/commit/64705f5d9d4dc27f799da3a074efaf74379a3398)) - -## [4.5.3](https://github.com/feathersjs/feathers/compare/v4.5.2...v4.5.3) (2020-04-17) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [4.5.2](https://github.com/feathersjs/feathers/compare/v4.5.1...v4.5.2) (2020-03-04) - -### Bug Fixes - -- **test:** typo in password ([#1797](https://github.com/feathersjs/feathers/issues/1797)) ([dfba6ec](https://github.com/feathersjs/feathers/commit/dfba6ec2f21adf3aa739218cf870eaaaa5df6e9c)) - -## [4.5.1](https://github.com/feathersjs/feathers/compare/v4.5.0...v4.5.1) (2020-01-24) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [4.5.0](https://github.com/feathersjs/feathers/compare/v4.4.3...v4.5.0) (2020-01-18) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [4.4.3](https://github.com/feathersjs/feathers/compare/v4.4.1...v4.4.3) (2019-12-06) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [4.4.1](https://github.com/feathersjs/feathers/compare/v4.4.0...v4.4.1) (2019-11-27) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [4.4.0](https://github.com/feathersjs/feathers/compare/v4.3.11...v4.4.0) (2019-11-27) - -### Features - -- **authentication:** Add parseStrategies to allow separate strategies for creating JWTs and parsing headers ([#1708](https://github.com/feathersjs/feathers/issues/1708)) ([5e65629](https://github.com/feathersjs/feathers/commit/5e65629b924724c3e81d7c81df047e123d1c8bd7)) - -## [4.3.11](https://github.com/feathersjs/feathers/compare/v4.3.10...v4.3.11) (2019-11-11) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [4.3.10](https://github.com/feathersjs/feathers/compare/v4.3.9...v4.3.10) (2019-10-26) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [4.3.9](https://github.com/feathersjs/feathers/compare/v4.3.8...v4.3.9) (2019-10-26) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [4.3.7](https://github.com/feathersjs/feathers/compare/v4.3.6...v4.3.7) (2019-10-14) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [4.3.5](https://github.com/feathersjs/feathers/compare/v4.3.4...v4.3.5) (2019-10-07) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [4.3.4](https://github.com/feathersjs/feathers/compare/v4.3.3...v4.3.4) (2019-10-03) - -**Note:** Version bump only for package @feathersjs/authentication-local - -## [4.3.3](https://github.com/feathersjs/feathers/compare/v4.3.2...v4.3.3) (2019-09-21) - -### Bug Fixes - -- Small improvements in dependencies and code sturcture ([#1562](https://github.com/feathersjs/feathers/issues/1562)) ([42c13e2](https://github.com/feathersjs/feathers/commit/42c13e2)) - -## [4.3.2](https://github.com/feathersjs/feathers/compare/v4.3.1...v4.3.2) (2019-09-16) - -### Bug Fixes - -- LocalStrategy authenticates without username ([#1560](https://github.com/feathersjs/feathers/issues/1560)) ([2b258fd](https://github.com/feathersjs/feathers/commit/2b258fd)), closes [#1559](https://github.com/feathersjs/feathers/issues/1559) - -## [4.3.1](https://github.com/feathersjs/feathers/compare/v4.3.0...v4.3.1) (2019-09-09) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [4.3.0](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.4...v4.3.0) (2019-08-27) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [4.3.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.3...v4.3.0-pre.4) (2019-08-22) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [4.3.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.2...v4.3.0-pre.3) (2019-08-19) - -### Bug Fixes - -- Update all dependencies ([7d53a00](https://github.com/feathersjs/feathers/commit/7d53a00)) - -# [4.3.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.1...v4.3.0-pre.2) (2019-08-02) - -### Bug Fixes - -- Add method to reliably get default authentication service ([#1470](https://github.com/feathersjs/feathers/issues/1470)) ([e542cb3](https://github.com/feathersjs/feathers/commit/e542cb3)) - -# [4.3.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.5...v4.3.0-pre.1) (2019-07-11) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [4.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.4...v4.0.0-pre.5) (2019-07-10) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [4.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.3...v4.0.0-pre.4) (2019-07-05) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [4.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.2...v4.0.0-pre.3) (2019-06-01) - -### Bug Fixes - -- Update dependencies and fix tests ([#1373](https://github.com/feathersjs/feathers/issues/1373)) ([d743a7f](https://github.com/feathersjs/feathers/commit/d743a7f)) - -# [4.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.1...v4.0.0-pre.2) (2019-05-15) - -**Note:** Version bump only for package @feathersjs/authentication-local - -# [4.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.0...v4.0.0-pre.1) (2019-05-08) - -### Bug Fixes - -- Always require strategy parameter in authentication ([#1327](https://github.com/feathersjs/feathers/issues/1327)) ([d4a8021](https://github.com/feathersjs/feathers/commit/d4a8021)) -- Improve authentication parameter handling ([#1333](https://github.com/feathersjs/feathers/issues/1333)) ([6e77204](https://github.com/feathersjs/feathers/commit/6e77204)) -- Merge httpStrategies and authStrategies option ([#1308](https://github.com/feathersjs/feathers/issues/1308)) ([afa4d55](https://github.com/feathersjs/feathers/commit/afa4d55)) -- Rename jwtStrategies option to authStrategies ([#1305](https://github.com/feathersjs/feathers/issues/1305)) ([4aee151](https://github.com/feathersjs/feathers/commit/4aee151)) - -### Features - -- Change and *JWT methods to *accessToken ([#1304](https://github.com/feathersjs/feathers/issues/1304)) ([5ac826b](https://github.com/feathersjs/feathers/commit/5ac826b)) - -# [4.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v3.2.0-pre.1...v4.0.0-pre.0) (2019-04-21) - -### Bug Fixes - -- Authentication core improvements ([#1260](https://github.com/feathersjs/feathers/issues/1260)) ([c5dc7a2](https://github.com/feathersjs/feathers/commit/c5dc7a2)) -- Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803)) -- Update adapter common tests ([#1135](https://github.com/feathersjs/feathers/issues/1135)) ([8166dda](https://github.com/feathersjs/feathers/commit/8166dda)) -- Update all dependencies to latest ([#1206](https://github.com/feathersjs/feathers/issues/1206)) ([e51e0f6](https://github.com/feathersjs/feathers/commit/e51e0f6)) -- **package:** update debug to version 3.0.0 ([#31](https://github.com/feathersjs/feathers/issues/31)) ([f23d617](https://github.com/feathersjs/feathers/commit/f23d617)) - -### Features - -- @feathersjs/authentication-oauth ([#1299](https://github.com/feathersjs/feathers/issues/1299)) ([656bae7](https://github.com/feathersjs/feathers/commit/656bae7)) -- Add AuthenticationBaseStrategy and make authentication option handling more explicit ([#1284](https://github.com/feathersjs/feathers/issues/1284)) ([2667d92](https://github.com/feathersjs/feathers/commit/2667d92)) -- Add TypeScript definitions ([#1275](https://github.com/feathersjs/feathers/issues/1275)) ([9dd6713](https://github.com/feathersjs/feathers/commit/9dd6713)) -- Authentication v3 core server implementation ([#1205](https://github.com/feathersjs/feathers/issues/1205)) ([1bd7591](https://github.com/feathersjs/feathers/commit/1bd7591)) -- Authentication v3 local authentication ([#1211](https://github.com/feathersjs/feathers/issues/1211)) ([0fa5f7c](https://github.com/feathersjs/feathers/commit/0fa5f7c)) - -### BREAKING CHANGES - -- Update authentication strategies for @feathersjs/authentication v3 - -## [1.2.9](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication-local@1.2.8...@feathersjs/authentication-local@1.2.9) (2019-01-02) - -### Bug Fixes - -- Update adapter common tests ([#1135](https://github.com/feathersjs/feathers/issues/1135)) ([8166dda](https://github.com/feathersjs/feathers/commit/8166dda)) - - - -## [1.2.8](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication-local@1.2.7...@feathersjs/authentication-local@1.2.8) (2018-12-16) - -**Note:** Version bump only for package @feathersjs/authentication-local - - - -## [1.2.7](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication-local@1.2.6...@feathersjs/authentication-local@1.2.7) (2018-10-26) - -**Note:** Version bump only for package @feathersjs/authentication-local - - - -## [1.2.6](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication-local@1.2.5...@feathersjs/authentication-local@1.2.6) (2018-10-25) - -### Bug Fixes - -- Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803)) - - - -## [1.2.5](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication-local@1.2.4...@feathersjs/authentication-local@1.2.5) (2018-09-21) - -**Note:** Version bump only for package @feathersjs/authentication-local - - - -## [1.2.4](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication-local@1.2.3...@feathersjs/authentication-local@1.2.4) (2018-09-17) - -**Note:** Version bump only for package @feathersjs/authentication-local - - - -## [1.2.3](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication-local@1.2.2...@feathersjs/authentication-local@1.2.3) (2018-09-02) - -**Note:** Version bump only for package @feathersjs/authentication-local - - - -## 1.2.2 - -- Migrate to Monorepo ([feathers#462](https://github.com/feathersjs/feathers/issues/462)) - -## [v1.2.1](https://github.com/feathersjs/authentication-local/tree/v1.2.1) (2018-05-02) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v1.2.0...v1.2.1) - -**Merged pull requests:** - -- Make sure the original object is not modified [\#65](https://github.com/feathersjs/authentication-local/pull/65) ([daffl](https://github.com/daffl)) - -## [v1.2.0](https://github.com/feathersjs/authentication-local/tree/v1.2.0) (2018-05-02) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v1.1.3...v1.2.0) - -**Merged pull requests:** - -- added support for nested password fields option in hash password hook [\#64](https://github.com/feathersjs/authentication-local/pull/64) ([ThePesta](https://github.com/ThePesta)) - -## [v1.1.3](https://github.com/feathersjs/authentication-local/tree/v1.1.3) (2018-04-20) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v1.1.2...v1.1.3) - -**Merged pull requests:** - -- Adding tests and calling to hasOwnProperty on Object.prototype instead of assuming valid prototype [\#63](https://github.com/feathersjs/authentication-local/pull/63) ([pmabres](https://github.com/pmabres)) - -## [v1.1.2](https://github.com/feathersjs/authentication-local/tree/v1.1.2) (2018-04-15) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v1.1.1...v1.1.2) - -**Closed issues:** - -- Protect hooks does not support dot notation [\#61](https://github.com/feathersjs/authentication-local/issues/61) - -**Merged pull requests:** - -- Use latest version of Lodash [\#62](https://github.com/feathersjs/authentication-local/pull/62) ([daffl](https://github.com/daffl)) - -## [v1.1.1](https://github.com/feathersjs/authentication-local/tree/v1.1.1) (2018-03-25) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v1.1.0...v1.1.1) - -**Closed issues:** - -- hash-password hook will skip users if they are missing password [\#58](https://github.com/feathersjs/authentication-local/issues/58) -- User service create method gets called upon each validation [\#56](https://github.com/feathersjs/authentication-local/issues/56) - -**Merged pull requests:** - -- Do not skip users that have no password [\#60](https://github.com/feathersjs/authentication-local/pull/60) ([daffl](https://github.com/daffl)) -- Update sinon to the latest version 🚀 [\#59](https://github.com/feathersjs/authentication-local/pull/59) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update sinon-chai to the latest version 🚀 [\#57](https://github.com/feathersjs/authentication-local/pull/57) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.1.0](https://github.com/feathersjs/authentication-local/tree/v1.1.0) (2018-01-23) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v1.0.4...v1.1.0) - -**Closed issues:** - -- protect hook attempts to map through 'result.data' on all service methods. [\#53](https://github.com/feathersjs/authentication-local/issues/53) -- Protect hook should check for toJSON [\#48](https://github.com/feathersjs/authentication-local/issues/48) - -**Merged pull requests:** - -- Use .toJSON if available [\#55](https://github.com/feathersjs/authentication-local/pull/55) ([daffl](https://github.com/daffl)) -- Only map data for find method [\#54](https://github.com/feathersjs/authentication-local/pull/54) ([daffl](https://github.com/daffl)) -- Update @feathersjs/authentication-jwt to the latest version 🚀 [\#52](https://github.com/feathersjs/authentication-local/pull/52) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update mocha to the latest version 🚀 [\#51](https://github.com/feathersjs/authentication-local/pull/51) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.0.4](https://github.com/feathersjs/authentication-local/tree/v1.0.4) (2018-01-03) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v1.0.3...v1.0.4) - -## [v1.0.3](https://github.com/feathersjs/authentication-local/tree/v1.0.3) (2018-01-03) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v1.0.2...v1.0.3) - -**Closed issues:** - -- local authentication bug with users as sequelize service [\#47](https://github.com/feathersjs/authentication-local/issues/47) - -**Merged pull requests:** - -- Update documentation to correspond with latest release [\#50](https://github.com/feathersjs/authentication-local/pull/50) ([daffl](https://github.com/daffl)) -- Update semistandard to the latest version 🚀 [\#49](https://github.com/feathersjs/authentication-local/pull/49) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.0.2](https://github.com/feathersjs/authentication-local/tree/v1.0.2) (2017-12-06) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v1.0.1...v1.0.2) - -**Closed issues:** - -- why is the password send as plain text instead of encrypting it on client side? [\#44](https://github.com/feathersjs/authentication-local/issues/44) - -**Merged pull requests:** - -- Update hook.result if an external provider is set [\#46](https://github.com/feathersjs/authentication-local/pull/46) ([daffl](https://github.com/daffl)) -- Update feathers-memory to the latest version 🚀 [\#45](https://github.com/feathersjs/authentication-local/pull/45) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.0.1](https://github.com/feathersjs/authentication-local/tree/v1.0.1) (2017-11-16) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v1.0.0...v1.0.1) - -**Merged pull requests:** - -- Add default export for better ES module \(TypeScript\) compatibility [\#43](https://github.com/feathersjs/authentication-local/pull/43) ([daffl](https://github.com/daffl)) -- Update @feathersjs/authentication to the latest version 🚀 [\#42](https://github.com/feathersjs/authentication-local/pull/42) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.0.0](https://github.com/feathersjs/authentication-local/tree/v1.0.0) (2017-11-01) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v1.0.0-pre.2...v1.0.0) - -**Merged pull requests:** - -- Update dependencies for release [\#41](https://github.com/feathersjs/authentication-local/pull/41) ([daffl](https://github.com/daffl)) - -## [v1.0.0-pre.2](https://github.com/feathersjs/authentication-local/tree/v1.0.0-pre.2) (2017-10-27) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v1.0.0-pre.1...v1.0.0-pre.2) - -**Merged pull requests:** - -- Safely dispatch without password [\#40](https://github.com/feathersjs/authentication-local/pull/40) ([daffl](https://github.com/daffl)) - -## [v1.0.0-pre.1](https://github.com/feathersjs/authentication-local/tree/v1.0.0-pre.1) (2017-10-25) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v0.4.4...v1.0.0-pre.1) - -**Closed issues:** - -- How configure local strategy to feathers-authentication? [\#36](https://github.com/feathersjs/authentication-local/issues/36) -- An in-range update of feathers is breaking the build 🚨 [\#32](https://github.com/feathersjs/authentication-local/issues/32) - -**Merged pull requests:** - -- Update to Feathers v3 [\#39](https://github.com/feathersjs/authentication-local/pull/39) ([daffl](https://github.com/daffl)) -- Rename repository and use npm scope [\#38](https://github.com/feathersjs/authentication-local/pull/38) ([daffl](https://github.com/daffl)) -- Update to new plugin infrastructure [\#37](https://github.com/feathersjs/authentication-local/pull/37) ([daffl](https://github.com/daffl)) -- Update mocha to the latest version 🚀 [\#35](https://github.com/feathersjs/authentication-local/pull/35) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update sinon to the latest version 🚀 [\#34](https://github.com/feathersjs/authentication-local/pull/34) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Add babel-polyfill and package-lock.json [\#33](https://github.com/feathersjs/authentication-local/pull/33) ([daffl](https://github.com/daffl)) -- Update sinon to the latest version 🚀 [\#29](https://github.com/feathersjs/authentication-local/pull/29) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v0.4.4](https://github.com/feathersjs/authentication-local/tree/v0.4.4) (2017-08-11) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v0.4.3...v0.4.4) - -**Closed issues:** - -- i18n support [\#28](https://github.com/feathersjs/authentication-local/issues/28) -- Couldn't store jwt token in cookies [\#17](https://github.com/feathersjs/authentication-local/issues/17) -- Strategy for subapp [\#9](https://github.com/feathersjs/authentication-local/issues/9) - -**Merged pull requests:** - -- Update debug to the latest version 🚀 [\#31](https://github.com/feathersjs/authentication-local/pull/31) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Increase bcrypt cost factor, add future cost factor auto-optimization [\#30](https://github.com/feathersjs/authentication-local/pull/30) ([micaksica2](https://github.com/micaksica2)) - -## [v0.4.3](https://github.com/feathersjs/authentication-local/tree/v0.4.3) (2017-06-22) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v0.4.2...v0.4.3) - -**Closed issues:** - -- Log a warning if service.id is undefined or null [\#19](https://github.com/feathersjs/authentication-local/issues/19) - -**Merged pull requests:** - -- throw error if service.id is missing [\#27](https://github.com/feathersjs/authentication-local/pull/27) ([marshallswain](https://github.com/marshallswain)) - -## [v0.4.2](https://github.com/feathersjs/authentication-local/tree/v0.4.2) (2017-06-22) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v0.4.1...v0.4.2) - -## [v0.4.1](https://github.com/feathersjs/authentication-local/tree/v0.4.1) (2017-06-22) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v0.4.0...v0.4.1) - -**Merged pull requests:** - -- Resolves \#14 - Passes Feathers params to service hooks [\#15](https://github.com/feathersjs/authentication-local/pull/15) ([thomas-p-wilson](https://github.com/thomas-p-wilson)) - -## [v0.4.0](https://github.com/feathersjs/authentication-local/tree/v0.4.0) (2017-06-22) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v0.3.4...v0.4.0) - -**Closed issues:** - -- Module is using the wrong default config key [\#21](https://github.com/feathersjs/authentication-local/issues/21) -- Feathers params not available to user service hooks [\#14](https://github.com/feathersjs/authentication-local/issues/14) -- Bad error message is returned for invalid credentials [\#10](https://github.com/feathersjs/authentication-local/issues/10) - -**Merged pull requests:** - -- Greenkeeper/chai 4.0.2 [\#26](https://github.com/feathersjs/authentication-local/pull/26) ([daffl](https://github.com/daffl)) -- Return Invalid login message when user doesn’t exist [\#25](https://github.com/feathersjs/authentication-local/pull/25) ([marshallswain](https://github.com/marshallswain)) -- Adding separate entity username and password fields [\#23](https://github.com/feathersjs/authentication-local/pull/23) ([adamvr](https://github.com/adamvr)) -- use the correct default config key. Closes \#21 [\#22](https://github.com/feathersjs/authentication-local/pull/22) ([ekryski](https://github.com/ekryski)) -- Update feathers-socketio to the latest version 🚀 [\#20](https://github.com/feathersjs/authentication-local/pull/20) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update semistandard to the latest version 🚀 [\#18](https://github.com/feathersjs/authentication-local/pull/18) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update feathers-hooks to the latest version 🚀 [\#16](https://github.com/feathersjs/authentication-local/pull/16) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update dependencies to enable Greenkeeper 🌴 [\#13](https://github.com/feathersjs/authentication-local/pull/13) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v0.3.4](https://github.com/feathersjs/authentication-local/tree/v0.3.4) (2017-03-28) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v0.3.3...v0.3.4) - -**Closed issues:** - -- Shouldn't it be `authentication` instead of the old `auth` there? [\#11](https://github.com/feathersjs/authentication-local/issues/11) - -**Merged pull requests:** - -- Fix default authentication config name [\#12](https://github.com/feathersjs/authentication-local/pull/12) ([marshallswain](https://github.com/marshallswain)) - -## [v0.3.3](https://github.com/feathersjs/authentication-local/tree/v0.3.3) (2017-01-27) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v0.3.2...v0.3.3) - -**Closed issues:** - -- Support dot notation [\#7](https://github.com/feathersjs/authentication-local/issues/7) -- Automatically register the authenticate hook with 'local' [\#4](https://github.com/feathersjs/authentication-local/issues/4) - -**Merged pull requests:** - -- Add support for dot notation, fix some whitespace [\#8](https://github.com/feathersjs/authentication-local/pull/8) ([elfey](https://github.com/elfey)) - -## [v0.3.2](https://github.com/feathersjs/authentication-local/tree/v0.3.2) (2016-12-14) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v0.3.1...v0.3.2) - -## [v0.3.1](https://github.com/feathersjs/authentication-local/tree/v0.3.1) (2016-12-14) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v0.3.0...v0.3.1) - -**Closed issues:** - -- Add docs section on expected request params. [\#5](https://github.com/feathersjs/authentication-local/issues/5) - -**Merged pull requests:** - -- Document expected request data [\#6](https://github.com/feathersjs/authentication-local/pull/6) ([marshallswain](https://github.com/marshallswain)) - -## [v0.3.0](https://github.com/feathersjs/authentication-local/tree/v0.3.0) (2016-11-23) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v0.2.0...v0.3.0) - -**Closed issues:** - -- Doesn't pull configuration from `auth.local` by default [\#2](https://github.com/feathersjs/authentication-local/issues/2) -- Does not pull from global auth config when strategy has a custom name [\#1](https://github.com/feathersjs/authentication-local/issues/1) - -**Merged pull requests:** - -- Payload support [\#3](https://github.com/feathersjs/authentication-local/pull/3) ([ekryski](https://github.com/ekryski)) - -## [v0.2.0](https://github.com/feathersjs/authentication-local/tree/v0.2.0) (2016-11-16) - -[Full Changelog](https://github.com/feathersjs/authentication-local/compare/v0.1.0...v0.2.0) - -## [v0.1.0](https://github.com/feathersjs/authentication-local/tree/v0.1.0) (2016-11-09) - -\* _This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)_ diff --git a/packages/authentication-local/LICENSE b/packages/authentication-local/LICENSE deleted file mode 100644 index 7712f870f3..0000000000 --- a/packages/authentication-local/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2024 Feathers Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/packages/authentication-local/README.md b/packages/authentication-local/README.md deleted file mode 100644 index 9215940bd5..0000000000 --- a/packages/authentication-local/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# @feathersjs/authentication-local - -[](https://github.com/feathersjs/feathers/actions?query=workflow%3ACI) -[](https://www.npmjs.com/package/@feathersjs/authentication-local) -[](https://discord.gg/qa8kez8QBx) - -> Local username and password authentication strategy for Feathers authentication - -## Installation - -``` -npm install @feathersjs/authentication-local --save -``` - -## Documentation - -Refer to the [Feathers local authentication API documentation](https://feathersjs.com/api/authentication/local.html) for more details. - -## License - -Copyright (c) 2024 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors) - -Licensed under the [MIT license](LICENSE). diff --git a/packages/authentication-local/package.json b/packages/authentication-local/package.json deleted file mode 100644 index 5ca85281a3..0000000000 --- a/packages/authentication-local/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "@feathersjs/authentication-local", - "description": "Local authentication strategy for @feathers/authentication", - "version": "5.0.34", - "homepage": "https://feathersjs.com", - "main": "lib/", - "types": "lib/", - "keywords": [ - "feathers", - "feathers-plugin" - ], - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/daffl" - }, - "repository": { - "type": "git", - "url": "git://github.com/feathersjs/feathers.git", - "directory": "packages/authentication-local" - }, - "author": { - "name": "Feathers contributors", - "email": "hello@feathersjs.com", - "url": "https://feathersjs.com" - }, - "contributors": [], - "bugs": { - "url": "https://github.com/feathersjs/feathers/issues" - }, - "engines": { - "node": ">= 12" - }, - "files": [ - "CHANGELOG.md", - "LICENSE", - "README.md", - "src/**", - "lib/**", - "*.d.ts", - "*.js" - ], - "scripts": { - "prepublish": "npm run compile", - "pack": "npm pack --pack-destination ../generators/test/build", - "compile": "shx rm -rf lib/ && tsc && npm run pack", - "test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts" - }, - "directories": { - "lib": "lib" - }, - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@feathersjs/authentication": "^5.0.34", - "@feathersjs/commons": "^5.0.34", - "@feathersjs/errors": "^5.0.34", - "@feathersjs/feathers": "^5.0.34", - "bcryptjs": "^3.0.2", - "lodash": "^4.17.21" - }, - "devDependencies": { - "@feathersjs/memory": "^5.0.34", - "@feathersjs/schema": "^5.0.34", - "@types/bcryptjs": "^2.4.6", - "@types/lodash": "^4.17.20", - "@types/mocha": "^10.0.10", - "@types/node": "^24.1.0", - "mocha": "^11.7.1", - "shx": "^0.4.0", - "ts-node": "^10.9.2", - "typescript": "^5.9.2" - }, - "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5" -} diff --git a/packages/authentication-local/src/hooks/hash-password.ts b/packages/authentication-local/src/hooks/hash-password.ts deleted file mode 100644 index 5a949bb856..0000000000 --- a/packages/authentication-local/src/hooks/hash-password.ts +++ /dev/null @@ -1,67 +0,0 @@ -import get from 'lodash/get' -import set from 'lodash/set' -import cloneDeep from 'lodash/cloneDeep' -import { BadRequest } from '@feathersjs/errors' -import { createDebug } from '@feathersjs/commons' -import { HookContext, NextFunction } from '@feathersjs/feathers' -import { LocalStrategy } from '../strategy' - -const debug = createDebug('@feathersjs/authentication-local/hooks/hash-password') - -export interface HashPasswordOptions { - authentication?: string - strategy?: string -} - -/** - * @deprecated Use Feathers schema resolvers and the `passwordHash` resolver instead - * @param field - * @param options - * @returns - * @see https://dove.feathersjs.com/api/authentication/local.html#passwordhash - */ -export default function hashPassword(field: string, options: HashPasswordOptions = {}) { - if (!field) { - throw new Error('The hashPassword hook requires a field name option') - } - - return async (context: HookContext, next?: NextFunction) => { - const { app, data, params } = context - - if (data !== undefined) { - const authService = app.defaultAuthentication(options.authentication) - const { strategy = 'local' } = options - - if (!authService || typeof authService.getStrategies !== 'function') { - throw new BadRequest('Could not find an authentication service to hash password') - } - - const [localStrategy] = authService.getStrategies(strategy) as LocalStrategy[] - - if (!localStrategy || typeof localStrategy.hashPassword !== 'function') { - throw new BadRequest(`Could not find '${strategy}' strategy to hash password`) - } - - const addHashedPassword = async (data: any) => { - const password = get(data, field) - - if (password === undefined) { - debug(`hook.data.${field} is undefined, not hashing password`) - return data - } - - const hashedPassword: string = await localStrategy.hashPassword(password, params) - - return set(cloneDeep(data), field, hashedPassword) - } - - context.data = Array.isArray(data) - ? await Promise.all(data.map(addHashedPassword)) - : await addHashedPassword(data) - } - - if (typeof next === 'function') { - return next() - } - } -} diff --git a/packages/authentication-local/src/hooks/protect.ts b/packages/authentication-local/src/hooks/protect.ts deleted file mode 100644 index eb1657e942..0000000000 --- a/packages/authentication-local/src/hooks/protect.ts +++ /dev/null @@ -1,42 +0,0 @@ -import omit from 'lodash/omit' -import { HookContext, NextFunction } from '@feathersjs/feathers' - -/** - * @deprecated For reliable safe data representations use Feathers schema dispatch resolvers. - * @see https://dove.feathersjs.comapi/authentication/local.html#protecting-fields - */ -export default (...fields: string[]) => { - const o = (current: any) => { - if (typeof current === 'object' && !Array.isArray(current)) { - const data = typeof current.toJSON === 'function' ? current.toJSON() : current - - return omit(data, fields) - } - - return current - } - - return async (context: HookContext, next?: NextFunction) => { - if (typeof next === 'function') { - await next() - } - - const result = context.dispatch || context.result - - if (result) { - if (Array.isArray(result)) { - context.dispatch = result.map(o) - } else if (result.data && context.method === 'find') { - context.dispatch = Object.assign({}, result, { - data: result.data.map(o) - }) - } else { - context.dispatch = o(result) - } - - if (context.params && context.params.provider) { - context.result = context.dispatch - } - } - } -} diff --git a/packages/authentication-local/src/index.ts b/packages/authentication-local/src/index.ts deleted file mode 100644 index 5e9b827e73..0000000000 --- a/packages/authentication-local/src/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { HookContext } from '@feathersjs/feathers' -import hashPassword from './hooks/hash-password' -import protect from './hooks/protect' -import { LocalStrategy } from './strategy' - -export const hooks = { hashPassword, protect } -export { LocalStrategy } - -/** - * Returns as property resolver that hashes a given plain text password using a Local - * authentication strategy. - * - * @param options The authentication `service` and `strategy` name - * @returns - */ -export const passwordHash = - (options: { service?: string; strategy: string }) => - async >(value: string | undefined, _data: any, context: H) => { - if (value === undefined) { - return value - } - - const { app, params } = context - const authService = app.defaultAuthentication(options.service) - const localStrategy = authService.getStrategy(options.strategy) as LocalStrategy - - return localStrategy.hashPassword(value, params) - } diff --git a/packages/authentication-local/src/strategy.ts b/packages/authentication-local/src/strategy.ts deleted file mode 100644 index 86129792b2..0000000000 --- a/packages/authentication-local/src/strategy.ts +++ /dev/null @@ -1,142 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import bcrypt from 'bcryptjs' -import get from 'lodash/get' -import { NotAuthenticated } from '@feathersjs/errors' -import { Query, Params } from '@feathersjs/feathers' -import { AuthenticationRequest, AuthenticationBaseStrategy } from '@feathersjs/authentication' -import { createDebug } from '@feathersjs/commons' - -const debug = createDebug('@feathersjs/authentication-local/strategy') - -export class LocalStrategy extends AuthenticationBaseStrategy { - verifyConfiguration() { - const config = this.configuration - - ;['usernameField', 'passwordField'].forEach((prop) => { - if (typeof config[prop] !== 'string') { - throw new Error(`'${this.name}' authentication strategy requires a '${prop}' setting`) - } - }) - } - - get configuration() { - const authConfig = this.authentication.configuration - const config = super.configuration || {} - - return { - hashSize: 10, - service: authConfig.service, - entity: authConfig.entity, - entityId: authConfig.entityId, - errorMessage: 'Invalid login', - entityPasswordField: config.passwordField, - entityUsernameField: config.usernameField, - ...config - } - } - - async getEntityQuery(query: Query, _params: Params) { - return { - $limit: 1, - ...query - } - } - - async findEntity(username: string, params: Params) { - const { entityUsernameField, errorMessage } = this.configuration - if (!username) { - // don't query for users without any condition set. - throw new NotAuthenticated(errorMessage) - } - - const query = await this.getEntityQuery( - { - [entityUsernameField]: username - }, - params - ) - - const findParams = Object.assign({}, params, { query }) - const entityService = this.entityService - - debug('Finding entity with query', params.query) - - const result = await entityService.find(findParams) - const list = Array.isArray(result) ? result : result.data - - if (!Array.isArray(list) || list.length === 0) { - debug('No entity found') - - throw new NotAuthenticated(errorMessage) - } - - const [entity] = list - - return entity - } - - async getEntity(result: any, params: Params) { - const entityService = this.entityService - const { entityId = (entityService as any).id, entity } = this.configuration - - if (!entityId || result[entityId] === undefined) { - throw new NotAuthenticated('Could not get local entity') - } - - if (!params.provider) { - return result - } - - return entityService.get(result[entityId], { - ...params, - [entity]: result - }) - } - - async comparePassword(entity: any, password: string) { - const { entityPasswordField, errorMessage } = this.configuration - // find password in entity, this allows for dot notation - const hash = get(entity, entityPasswordField) - - if (!hash) { - debug(`Record is missing the '${entityPasswordField}' password field`) - - throw new NotAuthenticated(errorMessage) - } - - debug('Verifying password') - - const result = await bcrypt.compare(password, hash) - - if (result) { - return entity - } - - throw new NotAuthenticated(errorMessage) - } - - async hashPassword(password: string, _params: Params) { - return bcrypt.hash(password, this.configuration.hashSize) - } - - async authenticate(data: AuthenticationRequest, params: Params) { - const { passwordField, usernameField, entity, errorMessage } = this.configuration - const username = get(data, usernameField) - const password = get(data, passwordField) - - if (!password) { - // exit early if there is no password - throw new NotAuthenticated(errorMessage) - } - - const { provider, ...paramsWithoutProvider } = params - - const result = await this.findEntity(username, paramsWithoutProvider) - await this.comparePassword(result, password) - - return { - authentication: { strategy: this.name }, - [entity]: await this.getEntity(result, params) - } - } -} diff --git a/packages/authentication-local/test/fixture.ts b/packages/authentication-local/test/fixture.ts deleted file mode 100644 index 32be7b476b..0000000000 --- a/packages/authentication-local/test/fixture.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { feathers } from '@feathersjs/feathers' -import { memory, MemoryService } from '@feathersjs/memory' -import { AuthenticationService, JWTStrategy } from '@feathersjs/authentication' - -import { LocalStrategy, hooks } from '../src' -const { hashPassword, protect } = hooks - -export type ServiceTypes = { - authentication: AuthenticationService - users: MemoryService -} - -export function createApplication( - app = feathers (), - authOptionOverrides: Record = {} -) { - const authentication = new AuthenticationService(app) - - const authConfig = { - entity: 'user', - service: 'users', - secret: 'supersecret', - authStrategies: ['local', 'jwt'], - parseStrategies: ['jwt'], - local: { - usernameField: 'email', - passwordField: 'password' - }, - ...authOptionOverrides - } - app.set('authentication', authConfig) - - authentication.register('jwt', new JWTStrategy()) - authentication.register('local', new LocalStrategy()) - - app.use('authentication', authentication) - app.use( - 'users', - memory({ - multi: ['create'], - paginate: { - default: 10, - max: 20 - } - }) - ) - - app.service('users').hooks([protect(authConfig.local.passwordField)]) - app.service('users').hooks({ - create: [hashPassword(authConfig.local.passwordField)], - get: [ - async (context, next) => { - await next() - - if (context.params.provider) { - context.result.fromGet = true - } - } - ] - }) - - return app -} diff --git a/packages/authentication-local/test/hooks/hash-password.test.ts b/packages/authentication-local/test/hooks/hash-password.test.ts deleted file mode 100644 index fb45bc928e..0000000000 --- a/packages/authentication-local/test/hooks/hash-password.test.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -import assert from 'assert' -import { Application } from '@feathersjs/feathers' - -import { hooks } from '../../src' -import { createApplication, ServiceTypes } from '../fixture' - -const { hashPassword } = hooks - -describe('@feathersjs/authentication-local/hooks/hash-password', () => { - let app: Application - - beforeEach(() => { - app = createApplication() - }) - - it('throws error when no field provided', () => { - try { - // @ts-ignore - hashPassword() - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.message, 'The hashPassword hook requires a field name option') - } - }) - - it('errors when authentication service does not exist', async () => { - delete app.services.authentication - - try { - await app.service('users').create({ - email: 'dave@hashpassword.com', - password: 'supersecret' - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.message, 'Could not find an authentication service to hash password') - } - }) - - it('errors when authentication strategy does not exist', async () => { - delete app.services.authentication.strategies.local - - try { - await app.service('users').create({ - email: 'dave@hashpassword.com', - password: 'supersecret' - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.message, "Could not find 'local' strategy to hash password") - } - }) - - it('hashes password on field', async () => { - const password = 'supersecret' - - const user = await app.service('users').create({ - email: 'dave@hashpassword.com', - password - }) - - assert.notStrictEqual(user.password, password) - }) - - it('hashes password on array data', async () => { - const password = 'supersecret' - - const users = await app.service('users').create([ - { - email: 'dave@hashpassword.com', - password - }, - { - email: 'dave2@hashpassword.com', - password: 'secret2' - } - ]) - - assert.notStrictEqual(users[0].password, password) - assert.notStrictEqual(users[1].password, 'secret2') - }) - - it('does nothing when field is not present', async () => { - const user = await app.service('users').create({ - email: 'dave@hashpassword.com' - }) - - assert.strictEqual(user.password, undefined) - }) -}) diff --git a/packages/authentication-local/test/hooks/protect.test.ts b/packages/authentication-local/test/hooks/protect.test.ts deleted file mode 100644 index 20e1320c3d..0000000000 --- a/packages/authentication-local/test/hooks/protect.test.ts +++ /dev/null @@ -1,183 +0,0 @@ -import assert from 'assert' -import { HookContext } from '@feathersjs/feathers' -import { hooks } from '../../src' - -const { protect } = hooks - -function testOmit(title: string, property: string) { - describe(title, () => { - const fn = protect('password') - - it('omits from object', async () => { - const data = { - email: 'test@user.com', - password: 'supersecret' - } - const context = { - [property]: data - } as unknown as HookContext - - await fn(context) - - assert.deepStrictEqual(context, { - [property]: data, - dispatch: { email: 'test@user.com' } - }) - }) - - it('omits from nested object', async () => { - const hook = protect('user.password') - const data = { - user: { - email: 'test@user.com', - password: 'supersecret' - } - } - const context = { - [property]: data - } as unknown as HookContext - - await hook(context) - - assert.deepStrictEqual(context, { - [property]: data, - dispatch: { user: { email: 'test@user.com' } } - }) - }) - - it('handles `data` property only for find', async () => { - const data = { - email: 'test@user.com', - password: 'supersecret', - data: 'yes' - } - const context = { - [property]: data - } as unknown as HookContext - - await fn(context) - - assert.deepStrictEqual(context, { - [property]: data, - dispatch: { email: 'test@user.com', data: 'yes' } - }) - }) - - it('uses .toJSON (#48)', async () => { - class MyUser { - toJSON() { - return { - email: 'test@user.com', - password: 'supersecret' - } - } - } - - const data = new MyUser() - const context = { - [property]: data - } as unknown as HookContext - - await fn(context) - - assert.deepStrictEqual(context, { - [property]: data, - dispatch: { email: 'test@user.com' } - }) - }) - - it('omits from array but only objects (#2053)', async () => { - const data = [ - { - email: 'test1@user.com', - password: 'supersecret' - }, - { - email: 'test2@user.com', - password: 'othersecret' - }, - ['one', 'two', 'three'], - 'test' - ] - const context = { - [property]: data - } as unknown as HookContext - - await fn(context) - - assert.deepStrictEqual(context, { - [property]: data, - dispatch: [{ email: 'test1@user.com' }, { email: 'test2@user.com' }, ['one', 'two', 'three'], 'test'] - }) - }) - - it('omits from pagination object', async () => { - const data = { - total: 2, - data: [ - { - email: 'test1@user.com', - password: 'supersecret' - }, - { - email: 'test2@user.com', - password: 'othersecret' - } - ] - } - const context = { - method: 'find', - [property]: data - } as unknown as HookContext - - await fn(context) - - assert.deepStrictEqual(context, { - method: 'find', - [property]: data, - dispatch: { - total: 2, - data: [{ email: 'test1@user.com' }, { email: 'test2@user.com' }] - } - }) - }) - - it('updates result if params.provider is set', async () => { - const data = [ - { - email: 'test1@user.com', - password: 'supersecret' - }, - { - email: 'test2@user.com', - password: 'othersecret' - } - ] - const params = { provider: 'test' } - const context = { - [property]: data, - params - } as unknown as HookContext - - await fn(context) - - assert.deepStrictEqual(context, { - [property]: data, - params, - result: [{ email: 'test1@user.com' }, { email: 'test2@user.com' }], - dispatch: [{ email: 'test1@user.com' }, { email: 'test2@user.com' }] - }) - }) - }) -} - -describe('@feathersjs/authentication-local/hooks/protect', () => { - it('does nothing when called with no result', async () => { - const fn = protect() - - assert.deepStrictEqual(await fn({} as any), undefined) - }) - - testOmit('with hook.result', 'result') - testOmit('with hook.dispatch already set', 'dispatch') -}) diff --git a/packages/authentication-local/test/strategy.test.ts b/packages/authentication-local/test/strategy.test.ts deleted file mode 100644 index a8fca0fe16..0000000000 --- a/packages/authentication-local/test/strategy.test.ts +++ /dev/null @@ -1,224 +0,0 @@ -import assert from 'assert' -import omit from 'lodash/omit' -import { Application, HookContext } from '@feathersjs/feathers' -import { resolve } from '@feathersjs/schema' - -import { LocalStrategy, passwordHash } from '../src' -import { createApplication, ServiceTypes } from './fixture' - -describe('@feathersjs/authentication-local/strategy', () => { - const password = 'localsecret' - const email = 'localtester@feathersjs.com' - - let app: Application - let user: any - - beforeEach(async () => { - app = createApplication() - user = await app.service('users').create({ email, password }) - }) - - it('throw error when configuration is not set', () => { - const auth = app.service('authentication') - - try { - auth.register('something', new LocalStrategy()) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual( - error.message, - "'something' authentication strategy requires a 'usernameField' setting" - ) - } - }) - - it('fails when entity not found', async () => { - const authService = app.service('authentication') - - try { - await authService.create({ - strategy: 'local', - email: 'not in database', - password - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual(error.message, 'Invalid login') - } - }) - - it('getEntity', async () => { - const [strategy] = app.service('authentication').getStrategies('local') as [LocalStrategy] - let entity = await strategy.getEntity(user, {}) - - assert.deepStrictEqual(entity, user) - - entity = await strategy.getEntity(user, { - provider: 'testing' - }) - - assert.deepStrictEqual(entity, { - ...omit(user, 'password'), - fromGet: true - }) - - try { - await strategy.getEntity({}, {}) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.message, 'Could not get local entity') - } - }) - - it('strategy fails when strategy is different', async () => { - const [local] = app.service('authentication').getStrategies('local') - - await assert.rejects( - () => - local.authenticate( - { - strategy: 'not-me', - password: 'dummy', - email - }, - {} - ), - { - name: 'NotAuthenticated', - message: 'Invalid login' - } - ) - }) - - it('fails when password is wrong', async () => { - const authService = app.service('authentication') - try { - await authService.create({ - strategy: 'local', - email, - password: 'dummy' - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual(error.message, 'Invalid login') - } - }) - - it('fails when password is not provided', async () => { - const authService = app.service('authentication') - try { - await authService.create({ - strategy: 'local', - email - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual(error.message, 'Invalid login') - } - }) - - it('fails when password field is not available', async () => { - const userEmail = 'someuser@localtest.com' - const authService = app.service('authentication') - - try { - await app.service('users').create({ - email: userEmail - }) - await authService.create({ - strategy: 'local', - password: 'dummy', - email: userEmail - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual(error.message, 'Invalid login') - } - }) - - it('authenticates an existing user', async () => { - const authService = app.service('authentication') - const authResult = await authService.create({ - strategy: 'local', - email, - password - }) - const { accessToken } = authResult - - assert.ok(accessToken) - assert.strictEqual(authResult.user.email, email) - - const decoded = await authService.verifyAccessToken(accessToken) - - assert.strictEqual(decoded.sub, `${user.id}`) - }) - - it('returns safe result when params.provider is set, works without pagination', async () => { - const authService = app.service('authentication') - const authResult = await authService.create( - { - strategy: 'local', - email, - password - }, - { - provider: 'rest', - paginate: false - } - ) - const { accessToken } = authResult - - assert.ok(accessToken) - assert.strictEqual(authResult.user.email, email) - assert.strictEqual(authResult.user.password, undefined) - assert.ok(authResult.user.fromGet) - - const decoded = await authService.verifyAccessToken(accessToken) - - assert.strictEqual(decoded.sub, `${user.id}`) - }) - - it('passwordHash property resolver', async () => { - const userResolver = resolve<{ password: string }, HookContext>({ - properties: { - password: passwordHash({ - strategy: 'local' - }) - } - }) - - const resolvedData = await userResolver.resolve({ password: 'supersecret' }, { app } as HookContext) - - assert.notStrictEqual(resolvedData.password, 'supersecret') - }) - it('should allow for nested values in the usernameField', async () => { - const appWithNestedFieldOverride = createApplication(undefined, { - local: { - usernameField: 'auth.email', - passwordField: 'auth.password' - } - }) - const nestedUser = await appWithNestedFieldOverride.service('users').create({ auth: { email, password } }) - const authService = appWithNestedFieldOverride.service('authentication') - const authResult = await authService.create({ - strategy: 'local', - auth: { - email, - password - } - }) - const { accessToken } = authResult - - assert.ok(accessToken) - assert.strictEqual(authResult.user.auth.email, email) - - const decoded = await authService.verifyAccessToken(accessToken) - - assert.strictEqual(decoded.sub, `${nestedUser.id}`) - // - }) -}) diff --git a/packages/authentication-local/tsconfig.json b/packages/authentication-local/tsconfig.json deleted file mode 100644 index 316fd41336..0000000000 --- a/packages/authentication-local/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig", - "include": [ - "src/**/*.ts" - ], - "compilerOptions": { - "outDir": "lib" - } -} diff --git a/packages/authentication-oauth/CHANGELOG.md b/packages/authentication-oauth/CHANGELOG.md deleted file mode 100644 index d9bded45fe..0000000000 --- a/packages/authentication-oauth/CHANGELOG.md +++ /dev/null @@ -1,577 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [5.0.34](https://github.com/feathersjs/feathers/compare/v5.0.33...v5.0.34) (2025-05-03) - -### Bug Fixes - -- Update dependencies ([#3584](https://github.com/feathersjs/feathers/issues/3584)) ([119fa4e](https://github.com/feathersjs/feathers/commit/119fa4e1ade8b0078aa235083d566e2538b3a084)) - -## [5.0.33](https://github.com/feathersjs/feathers/compare/v5.0.32...v5.0.33) (2025-02-24) - -### Bug Fixes - -- **dependencies:** Update dependencies ([#3571](https://github.com/feathersjs/feathers/issues/3571)) ([ad611cb](https://github.com/feathersjs/feathers/commit/ad611cb6ffb1dc31d603ba5817331318c5a23217)) - -## [5.0.32](https://github.com/feathersjs/feathers/compare/v5.0.31...v5.0.32) (2025-02-01) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.31](https://github.com/feathersjs/feathers/compare/v5.0.30...v5.0.31) (2024-10-31) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3545](https://github.com/feathersjs/feathers/issues/3545)) ([221b92b](https://github.com/feathersjs/feathers/commit/221b92bb0ee5d54fb1036742968797cb02e56da2)) - -## [5.0.30](https://github.com/feathersjs/feathers/compare/v5.0.29...v5.0.30) (2024-09-02) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.29](https://github.com/feathersjs/feathers/compare/v5.0.28...v5.0.29) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.28](https://github.com/feathersjs/feathers/compare/v5.0.27...v5.0.28) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.27](https://github.com/feathersjs/feathers/compare/v5.0.26...v5.0.27) (2024-06-18) - -### Bug Fixes - -- **authentication-oauth:** Allow POST oauth callbacks ([#3497](https://github.com/feathersjs/feathers/issues/3497)) ([ffcc90b](https://github.com/feathersjs/feathers/commit/ffcc90bb95329cbb4b8f310e37024d417c216d8c)) - -## [5.0.26](https://github.com/feathersjs/feathers/compare/v5.0.25...v5.0.26) (2024-06-09) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.25](https://github.com/feathersjs/feathers/compare/v5.0.24...v5.0.25) (2024-05-03) - -### Bug Fixes - -- **oauth:** Export OAuthService type ([#3479](https://github.com/feathersjs/feathers/issues/3479)) ([e7185cd](https://github.com/feathersjs/feathers/commit/e7185cde63990a0d24a7180c63b61dbc8ef6cd5b)) -- Reduce usage of lodash ([#3455](https://github.com/feathersjs/feathers/issues/3455)) ([8ce807a](https://github.com/feathersjs/feathers/commit/8ce807a5ca53ff5b8d5107a0656c6329404e6e6c)) - -## [5.0.24](https://github.com/feathersjs/feathers/compare/v5.0.23...v5.0.24) (2024-03-13) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.23](https://github.com/feathersjs/feathers/compare/v5.0.22...v5.0.23) (2024-02-25) - -### Bug Fixes - -- **core:** Update to latest feathersjs/hooks ([#3434](https://github.com/feathersjs/feathers/issues/3434)) ([1499ccc](https://github.com/feathersjs/feathers/commit/1499ccc41fb3ebba97b2c84e0cb19bc48ad3c651)) - -## [5.0.22](https://github.com/feathersjs/feathers/compare/v5.0.21...v5.0.22) (2024-02-15) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.21](https://github.com/feathersjs/feathers/compare/v5.0.20...v5.0.21) (2024-01-25) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.20](https://github.com/feathersjs/feathers/compare/v5.0.19...v5.0.20) (2024-01-24) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.19](https://github.com/feathersjs/feathers/compare/v5.0.18...v5.0.19) (2024-01-23) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.18](https://github.com/feathersjs/feathers/compare/v5.0.17...v5.0.18) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.17](https://github.com/feathersjs/feathers/compare/v5.0.16...v5.0.17) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.16](https://github.com/feathersjs/feathers/compare/v5.0.15...v5.0.16) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.15](https://github.com/feathersjs/feathers/compare/v5.0.14...v5.0.15) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.14](https://github.com/feathersjs/feathers/compare/v5.0.13...v5.0.14) (2024-01-05) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.13](https://github.com/feathersjs/feathers/compare/v5.0.12...v5.0.13) (2023-12-29) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.12](https://github.com/feathersjs/feathers/compare/v5.0.11...v5.0.12) (2023-11-28) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.11](https://github.com/feathersjs/feathers/compare/v5.0.10...v5.0.11) (2023-10-11) - -### Bug Fixes - -- **knex:** Update all dependencies and Knex peer ([#3308](https://github.com/feathersjs/feathers/issues/3308)) ([d2f9860](https://github.com/feathersjs/feathers/commit/d2f986036c4741cce2339d8abbcc6b2eb037a12a)) - -## [5.0.10](https://github.com/feathersjs/feathers/compare/v5.0.9...v5.0.10) (2023-10-03) - -### Bug Fixes - -- **authentication-oauth:** Move Grant error handling to the correct spot ([#3297](https://github.com/feathersjs/feathers/issues/3297)) ([e9c0828](https://github.com/feathersjs/feathers/commit/e9c0828937453c3f0a1bd16010089b825185eab6)) - -## [5.0.9](https://github.com/feathersjs/feathers/compare/v5.0.8...v5.0.9) (2023-09-27) - -### Bug Fixes - -- **authentication-oauth:** Properly handle all oAuth errors ([#3284](https://github.com/feathersjs/feathers/issues/3284)) ([148a9a3](https://github.com/feathersjs/feathers/commit/148a9a319b8e29138fda82d6c03bb489a7b4a6e1)) - -## [5.0.8](https://github.com/feathersjs/feathers/compare/v5.0.7...v5.0.8) (2023-07-19) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.7](https://github.com/feathersjs/feathers/compare/v5.0.6...v5.0.7) (2023-07-14) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.6](https://github.com/feathersjs/feathers/compare/v5.0.5...v5.0.6) (2023-06-15) - -### Bug Fixes - -- **authentication-oauth:** Update OAuth redirect to handle user requested redirect paths ([#3186](https://github.com/feathersjs/feathers/issues/3186)) ([3742028](https://github.com/feathersjs/feathers/commit/37420283c17bb8129c6ffdde841ce2034109cc6b)) - -## [5.0.5](https://github.com/feathersjs/feathers/compare/v5.0.4...v5.0.5) (2023-04-28) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [5.0.4](https://github.com/feathersjs/feathers/compare/v5.0.3...v5.0.4) (2023-04-12) - -### Bug Fixes - -- Make sure all Readme files are up to date ([#3154](https://github.com/feathersjs/feathers/issues/3154)) ([a5f0b38](https://github.com/feathersjs/feathers/commit/a5f0b38bbf2a11486415a39533bcc6c67fb51e3e)) - -## [5.0.3](https://github.com/feathersjs/feathers/compare/v5.0.2...v5.0.3) (2023-04-05) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3139](https://github.com/feathersjs/feathers/issues/3139)) ([f24276e](https://github.com/feathersjs/feathers/commit/f24276e9a909e2e58a0730c730258ce1f70f4028)) - -## [5.0.1](https://github.com/feathersjs/feathers/compare/v5.0.0...v5.0.1) (2023-03-15) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.38...v5.0.0) (2023-02-24) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.38](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.37...v5.0.0-pre.38) (2023-02-17) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.37](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.36...v5.0.0-pre.37) (2023-02-09) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.36](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.35...v5.0.0-pre.36) (2023-01-29) - -### Bug Fixes - -- **authentication-oauth:** Use original headers in oauth flow ([#3025](https://github.com/feathersjs/feathers/issues/3025)) ([fb3d8cc](https://github.com/feathersjs/feathers/commit/fb3d8cca123d68a77b096bc92e49baa55424afe0)) -- Update all dependencies ([#3024](https://github.com/feathersjs/feathers/issues/3024)) ([283dc47](https://github.com/feathersjs/feathers/commit/283dc4798d85584bc031e6e54b83b4ea77d1edd0)) - -# [5.0.0-pre.35](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.34...v5.0.0-pre.35) (2023-01-12) - -### Features - -- **generators:** Move core code generators to shared generators package ([#2982](https://github.com/feathersjs/feathers/issues/2982)) ([0328d22](https://github.com/feathersjs/feathers/commit/0328d2292153870bc43958f73d2c6f288a8cec17)) - -# [5.0.0-pre.34](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.33...v5.0.0-pre.34) (2022-12-14) - -### Bug Fixes - -- **core:** Improve service option usage and method option typings ([#2902](https://github.com/feathersjs/feathers/issues/2902)) ([164d75c](https://github.com/feathersjs/feathers/commit/164d75c0f11139a316baa91f1762de8f8eb7da2d)) - -# [5.0.0-pre.33](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.32...v5.0.0-pre.33) (2022-11-08) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.32](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.31...v5.0.0-pre.32) (2022-10-26) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.31](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.30...v5.0.0-pre.31) (2022-10-12) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.30](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.29...v5.0.0-pre.30) (2022-10-07) - -### Bug Fixes - -- **authentication-oauth:** Fix regression with prefix handling in OAuth ([#2773](https://github.com/feathersjs/feathers/issues/2773)) ([b1844b1](https://github.com/feathersjs/feathers/commit/b1844b1f27feeb7e66920ec9e318872857711834)) - -### Features - -- **core:** Allow to unregister services at runtime ([#2756](https://github.com/feathersjs/feathers/issues/2756)) ([d16601f](https://github.com/feathersjs/feathers/commit/d16601f2277dca5357866ffdefba2a611f6dc7fa)) - -# [5.0.0-pre.29](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.28...v5.0.0-pre.29) (2022-09-16) - -### Bug Fixes - -- **authentication-oauth:** Fix oAuth origin and error handling ([#2752](https://github.com/feathersjs/feathers/issues/2752)) ([f7e1c33](https://github.com/feathersjs/feathers/commit/f7e1c33de1b7af0672a302d2ba6e15d997f0aa83)) - -### Features - -- Add CORS support to oAuth, Express, Koa and generated application ([#2744](https://github.com/feathersjs/feathers/issues/2744)) ([fd218f2](https://github.com/feathersjs/feathers/commit/fd218f289f8ca4c101e9938e8683e2efef6e8131)) -- **authentication-oauth:** Koa and transport independent oAuth authentication ([#2737](https://github.com/feathersjs/feathers/issues/2737)) ([9231525](https://github.com/feathersjs/feathers/commit/9231525a24bb790ba9c5d940f2867a9c727691c9)) - -# [5.0.0-pre.28](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.27...v5.0.0-pre.28) (2022-08-03) - -### Bug Fixes - -- **cli:** Improve generated application and client ([#2701](https://github.com/feathersjs/feathers/issues/2701)) ([bd55ffb](https://github.com/feathersjs/feathers/commit/bd55ffb812e89bf215f4515e7f137656ea888c3f)) - -# [5.0.0-pre.27](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.26...v5.0.0-pre.27) (2022-07-13) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.26](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.25...v5.0.0-pre.26) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.25](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.24...v5.0.0-pre.25) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.24](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.23...v5.0.0-pre.24) (2022-06-21) - -### Bug Fixes - -- **authentication-oauth:** Fix bug and properly set Grant defaults ([#2659](https://github.com/feathersjs/feathers/issues/2659)) ([cb93bb9](https://github.com/feathersjs/feathers/commit/cb93bb911fd92282424da2db805cd685b7e4a45b)) - -### Features - -- **cli:** Add typed client to a generated app ([#2669](https://github.com/feathersjs/feathers/issues/2669)) ([5b801b5](https://github.com/feathersjs/feathers/commit/5b801b5017ddc3eaa95622b539f51d605916bc86)) - -# [5.0.0-pre.23](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.22...v5.0.0-pre.23) (2022-06-06) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.22](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.21...v5.0.0-pre.22) (2022-05-24) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.21](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.20...v5.0.0-pre.21) (2022-05-23) - -### Bug Fixes - -- **authentication-oauth:** Fix regression using incorrect callback and redirect_uri ([#2631](https://github.com/feathersjs/feathers/issues/2631)) ([43d8a08](https://github.com/feathersjs/feathers/commit/43d8a082d7e1807f8a431c44a1dbd9b04c3af0d2)) - -# [5.0.0-pre.20](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.19...v5.0.0-pre.20) (2022-05-04) - -### Bug Fixes - -- **authentication-oauth:** Don't send origins in Grant's config, as it will be considered another provider ([#2617](https://github.com/feathersjs/feathers/issues/2617)) ([ae3dddd](https://github.com/feathersjs/feathers/commit/ae3dddd8a654924465512d56b4651413912c6932)) -- **dependencies:** Lock monorepo package version numbers ([#2623](https://github.com/feathersjs/feathers/issues/2623)) ([5640c10](https://github.com/feathersjs/feathers/commit/5640c1020cc139994e695d658c08bad3494db507)) - -# [5.0.0-pre.19](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.18...v5.0.0-pre.19) (2022-05-01) - -### Bug Fixes - -- **authentication-oauth:** Fix issue with overriding the default Grant configuration ([#2615](https://github.com/feathersjs/feathers/issues/2615)) ([b345857](https://github.com/feathersjs/feathers/commit/b3458578532f9750de2940aeb8afdc75cb0b46f2)) -- **authentication-oauth:** Make oAuth authentication work with cookie-session ([#2614](https://github.com/feathersjs/feathers/issues/2614)) ([9f10bfc](https://github.com/feathersjs/feathers/commit/9f10bfc75083d5bcabea77cfb385aa3965cdf6d6)) - -### Features - -- **typescript:** Improve params and query typeability ([#2600](https://github.com/feathersjs/feathers/issues/2600)) ([df28b76](https://github.com/feathersjs/feathers/commit/df28b7619161f1df5e700326f52cca1a92dc5d28)) - -# [5.0.0-pre.18](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.17...v5.0.0-pre.18) (2022-04-11) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.17](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.16...v5.0.0-pre.17) (2022-02-15) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.16](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.15...v5.0.0-pre.16) (2022-01-12) - -### Bug Fixes - -- **authentication-oauth:** OAuth redirect lost sometimes due to session store race ([#2514](https://github.com/feathersjs/feathers/issues/2514)) ([#2515](https://github.com/feathersjs/feathers/issues/2515)) ([6109c44](https://github.com/feathersjs/feathers/commit/6109c44428c6b8f6bb4e089be760ea1a4ef3d01e)) - -# [5.0.0-pre.15](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.14...v5.0.0-pre.15) (2021-11-27) - -### Features - -- **authentication-oauth:** Allow dynamic oAuth redirect ([#2469](https://github.com/feathersjs/feathers/issues/2469)) ([b7143d4](https://github.com/feathersjs/feathers/commit/b7143d4c0fbe961e714f79512be04449b9bbd7d9)) - -# [5.0.0-pre.14](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.13...v5.0.0-pre.14) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.13](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.12...v5.0.0-pre.13) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.12](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.11...v5.0.0-pre.12) (2021-10-12) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.11](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.10...v5.0.0-pre.11) (2021-10-06) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.10](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.9...v5.0.0-pre.10) (2021-09-19) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.9](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.8...v5.0.0-pre.9) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.8](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.7...v5.0.0-pre.8) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.7](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.6...v5.0.0-pre.7) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.6](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.5...v5.0.0-pre.6) (2021-08-08) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.4...v5.0.0-pre.5) (2021-06-23) - -### Bug Fixes - -- **authentication-oauth:** Omit query from internal calls ([#2398](https://github.com/feathersjs/feathers/issues/2398)) ([04c7c83](https://github.com/feathersjs/feathers/commit/04c7c83eeaa6a7466c84b958071b468ed42f0b0f)) -- **koa:** Use extended query parser for compatibility ([#2397](https://github.com/feathersjs/feathers/issues/2397)) ([b2944ba](https://github.com/feathersjs/feathers/commit/b2944bac3ec6d5ecc80dc518cd4e58093692db74)) - -### Features - -- **adapter-commons:** Add support for params.adapter option and move memory adapter to @feathersjs/memory ([#2367](https://github.com/feathersjs/feathers/issues/2367)) ([a43e7da](https://github.com/feathersjs/feathers/commit/a43e7da22b6b981a96d1321736ea9a0cb924fb4f)) - -# [5.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.3...v5.0.0-pre.4) (2021-05-13) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.2...v5.0.0-pre.3) (2021-04-21) - -### Bug Fixes - -- **typescript:** Improve TypeScript backwards compatibility ([#2310](https://github.com/feathersjs/feathers/issues/2310)) ([f33be73](https://github.com/feathersjs/feathers/commit/f33be73fc46a533efb15df9aab0658e3240d3897)) - -### Features - -- **dependencies:** Remove direct debug dependency ([#2296](https://github.com/feathersjs/feathers/issues/2296)) ([501d416](https://github.com/feathersjs/feathers/commit/501d4164d30c6a126906dc640cdfdc82207ba34a)) - -# [5.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.1...v5.0.0-pre.2) (2021-04-06) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-beta.1](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2021-04-03) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-beta.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.1...v5.0.0-beta.0) (2021-03-28) - -### Bug Fixes - -- Update Grant usage and other dependencies ([#2264](https://github.com/feathersjs/feathers/issues/2264)) ([7b0f8fa](https://github.com/feathersjs/feathers/commit/7b0f8fad252419ed0ad0bf259cdf3104d322ab60)) - -### Features - -- Feathers v5 core refactoring and features ([#2255](https://github.com/feathersjs/feathers/issues/2255)) ([2dafb7c](https://github.com/feathersjs/feathers/commit/2dafb7ce14ba57406aeec13d10ca45b1e709bee9)) - -# [5.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.5.11...v5.0.0-pre.1) (2020-12-17) - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [4.5.9](https://github.com/feathersjs/feathers/compare/v4.5.8...v4.5.9) (2020-10-09) - -### Bug Fixes - -- **authentication-oauth:** Always end session after oAuth flows are finished ([#2087](https://github.com/feathersjs/feathers/issues/2087)) ([d219d0d](https://github.com/feathersjs/feathers/commit/d219d0d89c5e45aa289dd67cb0c8bdc05044c846)) - -## [4.5.8](https://github.com/feathersjs/feathers/compare/v4.5.7...v4.5.8) (2020-08-12) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [4.5.7](https://github.com/feathersjs/feathers/compare/v4.5.6...v4.5.7) (2020-07-24) - -### Bug Fixes - -- **typescript:** Revert add overload types for `find` service methods ([#1972](https://github.com/feathersjs/feathers/issues/1972))" ([#2025](https://github.com/feathersjs/feathers/issues/2025)) ([a9501ac](https://github.com/feathersjs/feathers/commit/a9501acb4d3ef58dfb87d62c57a9bf76569da281)) - -## [4.5.6](https://github.com/feathersjs/feathers/compare/v4.5.5...v4.5.6) (2020-07-12) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [4.5.5](https://github.com/feathersjs/feathers/compare/v4.5.4...v4.5.5) (2020-07-11) - -### Bug Fixes - -- **authentication-oauth:** Updated typings for projects with strictNullChecks ([#1941](https://github.com/feathersjs/feathers/issues/1941)) ([be91206](https://github.com/feathersjs/feathers/commit/be91206e3dba1e65a81412b7aa636bece3ab4aa2)) -- **typescript:** add overload types for `find` service methods ([#1972](https://github.com/feathersjs/feathers/issues/1972)) ([ef55af0](https://github.com/feathersjs/feathers/commit/ef55af088d05d9d36aba9d9f8d6c2c908a4f20dd)) - -## [4.5.4](https://github.com/feathersjs/feathers/compare/v4.5.3...v4.5.4) (2020-04-29) - -### Bug Fixes - -- **authentication-oauth:** Add getEntity method to oAuth authentication and remove provider field for other calls ([#1935](https://github.com/feathersjs/feathers/issues/1935)) ([d925c1b](https://github.com/feathersjs/feathers/commit/d925c1bd193b5c19cb23a246f04fc46d0429fc75)) - -## [4.5.3](https://github.com/feathersjs/feathers/compare/v4.5.2...v4.5.3) (2020-04-17) - -### Bug Fixes - -- **authentication-oauth:** Allow req.feathers to be used in oAuth authentication requests ([#1886](https://github.com/feathersjs/feathers/issues/1886)) ([854c9ca](https://github.com/feathersjs/feathers/commit/854c9cac9a9a5f8f89054a90feb24ab5c4766f5f)) - -## [4.5.2](https://github.com/feathersjs/feathers/compare/v4.5.1...v4.5.2) (2020-03-04) - -### Bug Fixes - -- **package:** update grant-profile to version 0.0.11 ([#1841](https://github.com/feathersjs/feathers/issues/1841)) ([5dcd2aa](https://github.com/feathersjs/feathers/commit/5dcd2aa3483059cc7a2546b145dd72b4705fe2fe)) - -## [4.5.1](https://github.com/feathersjs/feathers/compare/v4.5.0...v4.5.1) (2020-01-24) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [4.5.0](https://github.com/feathersjs/feathers/compare/v4.4.3...v4.5.0) (2020-01-18) - -### Features - -- **authentication-oauth:** Set oAuth redirect URL dynamically and pass query the service ([#1737](https://github.com/feathersjs/feathers/issues/1737)) ([0b05f0b](https://github.com/feathersjs/feathers/commit/0b05f0b58a257820fa61d695a36f36455209f6a1)) - -## [4.4.3](https://github.com/feathersjs/feathers/compare/v4.4.1...v4.4.3) (2019-12-06) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [4.4.1](https://github.com/feathersjs/feathers/compare/v4.4.0...v4.4.1) (2019-11-27) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [4.4.0](https://github.com/feathersjs/feathers/compare/v4.3.11...v4.4.0) (2019-11-27) - -### Features - -- **authentication-oauth:** Set oAuth redirect URL dynamically ([#1608](https://github.com/feathersjs/feathers/issues/1608)) ([1293e08](https://github.com/feathersjs/feathers/commit/1293e088abbb3d23f4a44680836645a8049ceaae)) - -## [4.3.11](https://github.com/feathersjs/feathers/compare/v4.3.10...v4.3.11) (2019-11-11) - -### Bug Fixes - -- **authentication-oauth:** Allow hash based redirects ([#1676](https://github.com/feathersjs/feathers/issues/1676)) ([ffe7cf3](https://github.com/feathersjs/feathers/commit/ffe7cf3fbb4e62d7689065cf7b61f25f602ce8cf)) - -## [4.3.10](https://github.com/feathersjs/feathers/compare/v4.3.9...v4.3.10) (2019-10-26) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [4.3.9](https://github.com/feathersjs/feathers/compare/v4.3.8...v4.3.9) (2019-10-26) - -### Bug Fixes - -- Only initialize default Express session if oAuth is actually used ([#1648](https://github.com/feathersjs/feathers/issues/1648)) ([9b9b43f](https://github.com/feathersjs/feathers/commit/9b9b43ff09af1080e4aaa537064bac37b881c9a2)) - -## [4.3.7](https://github.com/feathersjs/feathers/compare/v4.3.6...v4.3.7) (2019-10-14) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [4.3.5](https://github.com/feathersjs/feathers/compare/v4.3.4...v4.3.5) (2019-10-07) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [4.3.4](https://github.com/feathersjs/feathers/compare/v4.3.3...v4.3.4) (2019-10-03) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [4.3.3](https://github.com/feathersjs/feathers/compare/v4.3.2...v4.3.3) (2019-09-21) - -### Bug Fixes - -- Small improvements in dependencies and code sturcture ([#1562](https://github.com/feathersjs/feathers/issues/1562)) ([42c13e2](https://github.com/feathersjs/feathers/commit/42c13e2)) - -## [4.3.2](https://github.com/feathersjs/feathers/compare/v4.3.1...v4.3.2) (2019-09-16) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -## [4.3.1](https://github.com/feathersjs/feathers/compare/v4.3.0...v4.3.1) (2019-09-09) - -### Bug Fixes - -- Omit standard protocol ports from the default hostname ([#1543](https://github.com/feathersjs/feathers/issues/1543)) ([ef16d29](https://github.com/feathersjs/feathers/commit/ef16d29)) - -# [4.3.0](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.4...v4.3.0) (2019-08-27) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [4.3.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.3...v4.3.0-pre.4) (2019-08-22) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [4.3.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.2...v4.3.0-pre.3) (2019-08-19) - -### Bug Fixes - -- Update all dependencies ([7d53a00](https://github.com/feathersjs/feathers/commit/7d53a00)) -- Use WeakMap to connect socket to connection ([#1509](https://github.com/feathersjs/feathers/issues/1509)) ([64807e3](https://github.com/feathersjs/feathers/commit/64807e3)) - -# [4.3.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.1...v4.3.0-pre.2) (2019-08-02) - -### Bug Fixes - -- Add method to reliably get default authentication service ([#1470](https://github.com/feathersjs/feathers/issues/1470)) ([e542cb3](https://github.com/feathersjs/feathers/commit/e542cb3)) - -# [4.3.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.5...v4.3.0-pre.1) (2019-07-11) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [4.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.4...v4.0.0-pre.5) (2019-07-10) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [4.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.3...v4.0.0-pre.4) (2019-07-05) - -**Note:** Version bump only for package @feathersjs/authentication-oauth - -# [4.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.2...v4.0.0-pre.3) (2019-06-01) - -### Bug Fixes - -- Make oAuth paths more consistent and improve authentication client ([#1377](https://github.com/feathersjs/feathers/issues/1377)) ([adb2543](https://github.com/feathersjs/feathers/commit/adb2543)) -- Update dependencies and fix tests ([#1373](https://github.com/feathersjs/feathers/issues/1373)) ([d743a7f](https://github.com/feathersjs/feathers/commit/d743a7f)) - -# [4.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.1...v4.0.0-pre.2) (2019-05-15) - -### Bug Fixes - -- Correctly read the oauth strategy config ([#1349](https://github.com/feathersjs/feathers/issues/1349)) ([9abf314](https://github.com/feathersjs/feathers/commit/9abf314)) - -### Features - -- Add global disconnect event ([#1355](https://github.com/feathersjs/feathers/issues/1355)) ([85afcca](https://github.com/feathersjs/feathers/commit/85afcca)) - -# [4.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.0...v4.0.0-pre.1) (2019-05-08) - -### Bug Fixes - -- Always require strategy parameter in authentication ([#1327](https://github.com/feathersjs/feathers/issues/1327)) ([d4a8021](https://github.com/feathersjs/feathers/commit/d4a8021)) -- Improve authentication parameter handling ([#1333](https://github.com/feathersjs/feathers/issues/1333)) ([6e77204](https://github.com/feathersjs/feathers/commit/6e77204)) -- Improve oAuth option handling and usability ([#1335](https://github.com/feathersjs/feathers/issues/1335)) ([adb137d](https://github.com/feathersjs/feathers/commit/adb137d)) -- Merge httpStrategies and authStrategies option ([#1308](https://github.com/feathersjs/feathers/issues/1308)) ([afa4d55](https://github.com/feathersjs/feathers/commit/afa4d55)) -- Rename jwtStrategies option to authStrategies ([#1305](https://github.com/feathersjs/feathers/issues/1305)) ([4aee151](https://github.com/feathersjs/feathers/commit/4aee151)) - -### Features - -- Change and *JWT methods to *accessToken ([#1304](https://github.com/feathersjs/feathers/issues/1304)) ([5ac826b](https://github.com/feathersjs/feathers/commit/5ac826b)) - -# [4.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v3.2.0-pre.1...v4.0.0-pre.0) (2019-04-21) - -### Features - -- @feathersjs/authentication-oauth ([#1299](https://github.com/feathersjs/feathers/issues/1299)) ([656bae7](https://github.com/feathersjs/feathers/commit/656bae7)) diff --git a/packages/authentication-oauth/LICENSE b/packages/authentication-oauth/LICENSE deleted file mode 100644 index 7839c824d7..0000000000 --- a/packages/authentication-oauth/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2024 Feathers Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/authentication-oauth/README.md b/packages/authentication-oauth/README.md deleted file mode 100644 index 797a932308..0000000000 --- a/packages/authentication-oauth/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# @feathersjs/authentication-oauth - -[](https://github.com/feathersjs/feathers/actions?query=workflow%3ACI) -[](https://www.npmjs.com/package/@feathersjs/authentication-oauth) -[](https://discord.gg/qa8kez8QBx) - -> OAuth 1 and 2 authentication for Feathers. Powered by Grant. - -## Installation - -``` -npm install @feathersjs/authentication-oauth --save -``` - -## Documentation - -Refer to the [Feathers oAuth authentication API documentation](https://feathersjs.com/api/authentication/oauth.html) for more details. - -## License - -Copyright (c) 2024 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors) - -Licensed under the [MIT license](LICENSE). diff --git a/packages/authentication-oauth/package.json b/packages/authentication-oauth/package.json deleted file mode 100644 index 9406d3cfaf..0000000000 --- a/packages/authentication-oauth/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "name": "@feathersjs/authentication-oauth", - "description": "oAuth 1 and 2 authentication for Feathers. Powered by Grant.", - "version": "5.0.34", - "homepage": "https://feathersjs.com", - "main": "lib/", - "types": "lib/", - "keywords": [ - "feathers", - "feathers-plugin" - ], - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/daffl" - }, - "repository": { - "type": "git", - "url": "git://github.com/feathersjs/feathers.git", - "directory": "packages/authentication-oauth" - }, - "author": { - "name": "Feathers contributors", - "email": "hello@feathersjs.com", - "url": "https://feathersjs.com" - }, - "contributors": [], - "bugs": { - "url": "https://github.com/feathersjs/feathers/issues" - }, - "engines": { - "node": ">= 12" - }, - "files": [ - "CHANGELOG.md", - "LICENSE", - "README.md", - "src/**", - "lib/**", - "*.d.ts", - "*.js" - ], - "scripts": { - "start": "ts-node test/app", - "prepublish": "npm run compile", - "pack": "npm pack --pack-destination ../generators/test/build", - "compile": "shx rm -rf lib/ && tsc && npm run pack", - "test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts" - }, - "directories": { - "lib": "lib" - }, - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@feathersjs/authentication": "^5.0.34", - "@feathersjs/commons": "^5.0.34", - "@feathersjs/errors": "^5.0.34", - "@feathersjs/express": "^5.0.34", - "@feathersjs/feathers": "^5.0.34", - "@feathersjs/koa": "^5.0.34", - "@feathersjs/schema": "^5.0.34", - "cookie-session": "^2.1.1", - "grant": "^5.4.24", - "koa-session": "^7.0.2", - "qs": "^6.14.0" - }, - "devDependencies": { - "@feathersjs/memory": "^5.0.34", - "@types/cookie-session": "^2.0.49", - "@types/express": "^4.17.21", - "@types/koa-session": "^6.4.5", - "@types/mocha": "^10.0.10", - "@types/node": "^24.1.0", - "@types/tough-cookie": "^4.0.5", - "axios": "^1.11.0", - "mocha": "^11.7.1", - "shx": "^0.4.0", - "tough-cookie": "^5.1.2", - "ts-node": "^10.9.2", - "typescript": "^5.9.2" - }, - "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5" -} diff --git a/packages/authentication-oauth/src/index.ts b/packages/authentication-oauth/src/index.ts deleted file mode 100644 index 9d25b6f6c1..0000000000 --- a/packages/authentication-oauth/src/index.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { Application } from '@feathersjs/feathers' -import { createDebug } from '@feathersjs/commons' -import { resolveDispatch } from '@feathersjs/schema' - -import { OAuthStrategy, OAuthProfile } from './strategy' -import { redirectHook, OAuthService, OAuthCallbackService } from './service' -import { getGrantConfig, authenticationServiceOptions, OauthSetupSettings } from './utils' - -const debug = createDebug('@feathersjs/authentication-oauth') - -export { OauthSetupSettings, OAuthStrategy, OAuthProfile, OAuthService } - -export const oauth = - (settings: Partial = {}) => - (app: Application) => { - const authService = app.defaultAuthentication ? app.defaultAuthentication(settings.authService) : null - - if (!authService) { - throw new Error( - 'An authentication service must exist before registering @feathersjs/authentication-oauth' - ) - } - - if (!authService.configuration.oauth) { - debug('No oauth configuration found in authentication configuration. Skipping oAuth setup.') - return - } - - const oauthOptions = { - linkStrategy: 'jwt', - ...settings - } - - const grantConfig = getGrantConfig(authService) - const serviceOptions = authenticationServiceOptions(authService, oauthOptions) - const servicePath = `${grantConfig.defaults.prefix || 'oauth'}/:provider` - const callbackServicePath = `${servicePath}/callback` - const oauthService = new OAuthService(authService, oauthOptions) - - app.use(servicePath, oauthService, serviceOptions) - app.use(callbackServicePath, new OAuthCallbackService(oauthService), serviceOptions) - app.service(servicePath).hooks({ - around: { all: [resolveDispatch(), redirectHook()] } - }) - app.service(callbackServicePath).hooks({ - around: { all: [resolveDispatch(), redirectHook()] } - }) - - if (typeof app.service(servicePath).publish === 'function') { - app.service(servicePath).publish(() => null) - } - - if (typeof app.service(callbackServicePath).publish === 'function') { - app.service(callbackServicePath).publish(() => null) - } - } diff --git a/packages/authentication-oauth/src/service.ts b/packages/authentication-oauth/src/service.ts deleted file mode 100644 index 1ae575d6aa..0000000000 --- a/packages/authentication-oauth/src/service.ts +++ /dev/null @@ -1,203 +0,0 @@ -import { createDebug } from '@feathersjs/commons' -import { HookContext, NextFunction, Params } from '@feathersjs/feathers' -import { FeathersError, GeneralError } from '@feathersjs/errors' -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -//@ts-ignore -import Grant from 'grant/lib/grant' -import { AuthenticationService } from '@feathersjs/authentication' -import { OAuthStrategy } from './strategy' -import { getGrantConfig, OauthSetupSettings } from './utils' - -const debug = createDebug('@feathersjs/authentication-oauth/services') - -export type GrantResponse = { - location: string - session: any - state: any -} - -export type OAuthParams = Omit & { - session: any - state: Record - route: { - provider: string - } -} - -export class OAuthError extends FeathersError { - constructor( - message: string, - data: any, - public location: string - ) { - super(message, 'NotAuthenticated', 401, 'not-authenticated', data) - } -} - -export const redirectHook = () => async (context: HookContext, next: NextFunction) => { - try { - await next() - - const { location } = context.result - - debug(`oAuth redirect to ${location}`) - - if (location) { - context.http = { - ...context.http, - location - } - } - } catch (error: any) { - if (error.location) { - context.http = { - ...context.http, - location: error.location - } - context.result = typeof error.toJSON === 'function' ? error.toJSON() : error - } else { - throw error - } - } -} - -export class OAuthService { - grant: any - - constructor( - public service: AuthenticationService, - public settings: OauthSetupSettings - ) { - const config = getGrantConfig(service) - - this.grant = Grant({ config }) - } - - async handler(method: string, params: OAuthParams, body?: any, override?: string): Promise { - const { - session, - state, - query, - route: { provider } - } = params - - const result: GrantResponse = await this.grant({ - params: { provider, override }, - state: state.grant, - session: session.grant, - query, - method, - body - }) - - session.grant = result.session - state.grant = result.state - - return result - } - - async authenticate(params: OAuthParams, result: GrantResponse) { - const name = params.route.provider - const { linkStrategy, authService } = this.settings - const { accessToken, grant, headers, query = {}, redirect } = params.session - const strategy = this.service.getStrategy(name) as OAuthStrategy - const authParams = { - ...params, - headers, - authStrategies: [name], - authentication: accessToken - ? { - strategy: linkStrategy, - accessToken - } - : null, - query, - redirect - } - - const payload = grant?.response || result?.session?.response || result?.state?.response || params.query - const authentication = { - strategy: name, - ...payload - } - - try { - if (payload.error) { - throw new GeneralError(payload.error_description || payload.error, payload) - } - - debug(`Calling ${authService}.create authentication with strategy ${name}`) - - const authResult = await this.service.create(authentication, authParams) - - debug('Successful oAuth authentication, sending response') - - const location = await strategy.getRedirect(authResult, authParams) - - if (typeof params.session.destroy === 'function') { - await params.session.destroy() - } - - return { - ...authResult, - location - } - } catch (error: any) { - const location = await strategy.getRedirect(error, authParams) - const e = new OAuthError(error.message, error.data, location) - - if (typeof params.session.destroy === 'function') { - await params.session.destroy() - } - - e.stack = error.stack - throw e - } - } - - async find(params: OAuthParams) { - const { session, query, headers } = params - const { feathers_token, redirect, ...restQuery } = query - const handlerParams = { - ...params, - query: restQuery - } - - if (feathers_token) { - debug('Got feathers_token query parameter to link accounts', feathers_token) - session.accessToken = feathers_token - } - - session.redirect = redirect - session.query = restQuery - session.headers = headers - - return this.handler('GET', handlerParams, {}) - } - - async get(override: string, params: OAuthParams) { - const result = await this.handler('GET', params, {}, override) - - return result - } - - async create(data: any, params: OAuthParams) { - return this.handler('POST', params, data) - } -} - -export class OAuthCallbackService { - constructor(public service: OAuthService) {} - - async find(params: OAuthParams) { - const result = await this.service.handler('GET', params, {}, 'callback') - - return this.service.authenticate(params, result) - } - - async create(data: any, params: OAuthParams) { - const result = await this.service.handler('POST', params, data, 'callback') - - return this.service.authenticate(params, result) - } -} diff --git a/packages/authentication-oauth/src/strategy.ts b/packages/authentication-oauth/src/strategy.ts deleted file mode 100644 index 4bfe2589fc..0000000000 --- a/packages/authentication-oauth/src/strategy.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { - AuthenticationRequest, - AuthenticationBaseStrategy, - AuthenticationResult, - AuthenticationParams -} from '@feathersjs/authentication' -import { Params } from '@feathersjs/feathers' -import { NotAuthenticated } from '@feathersjs/errors' -import { createDebug, _ } from '@feathersjs/commons' -import qs from 'qs' - -const debug = createDebug('@feathersjs/authentication-oauth/strategy') - -export interface OAuthProfile { - id?: string | number - [key: string]: any -} - -export class OAuthStrategy extends AuthenticationBaseStrategy { - get configuration() { - const { entity, service, entityId, oauth } = this.authentication.configuration - const config = oauth[this.name] as any - - return { - entity, - service, - entityId, - ...config - } - } - - get entityId(): string { - const { entityService } = this - - return this.configuration.entityId || (entityService && (entityService as any).id) - } - - async getEntityQuery(profile: OAuthProfile, _params: Params) { - return { - [`${this.name}Id`]: profile.sub || profile.id - } - } - - async getEntityData(profile: OAuthProfile, _existingEntity: any, _params: Params) { - return { - [`${this.name}Id`]: profile.sub || profile.id - } - } - - async getProfile(data: AuthenticationRequest, _params: Params) { - return data.profile - } - - async getCurrentEntity(params: Params) { - const { authentication } = params - const { entity } = this.configuration - - if (authentication && authentication.strategy) { - debug('getCurrentEntity with authentication', authentication) - - const { strategy } = authentication - const authResult = await this.authentication.authenticate(authentication, params, strategy) - - return authResult[entity] - } - - return null - } - - async getAllowedOrigin(params?: Params) { - const { redirect, origins = this.app.get('origins') } = this.authentication.configuration.oauth - - if (Array.isArray(origins)) { - const referer = params?.headers?.referer || origins[0] - const allowedOrigin = origins.find((current) => referer.toLowerCase().startsWith(current.toLowerCase())) - - if (!allowedOrigin) { - throw new NotAuthenticated(`Referer "${referer}" is not allowed.`) - } - - return allowedOrigin - } - - return redirect - } - - async getRedirect( - data: AuthenticationResult | Error, - params?: AuthenticationParams - ): Promise { - const queryRedirect = (params && params.redirect) || '' - const redirect = await this.getAllowedOrigin(params) - - if (!redirect) { - return null - } - - const redirectUrl = `${redirect}${queryRedirect}` - const separator = redirectUrl.endsWith('?') ? '' : redirect.indexOf('#') !== -1 ? '?' : '#' - const authResult: AuthenticationResult = data - const query = authResult.accessToken - ? { access_token: authResult.accessToken } - : { error: data.message || 'OAuth Authentication not successful' } - - return `${redirectUrl}${separator}${qs.stringify(query)}` - } - - async findEntity(profile: OAuthProfile, params: Params) { - const query = await this.getEntityQuery(profile, params) - - debug('findEntity with query', query) - - const result = await this.entityService.find({ - ...params, - query - }) - const [entity = null] = result.data ? result.data : result - - debug('findEntity returning', entity) - - return entity - } - - async createEntity(profile: OAuthProfile, params: Params) { - const data = await this.getEntityData(profile, null, params) - - debug('createEntity with data', data) - - return this.entityService.create(data, _.omit(params, 'query')) - } - - async updateEntity(entity: any, profile: OAuthProfile, params: Params) { - const id = entity[this.entityId] - const data = await this.getEntityData(profile, entity, params) - - debug(`updateEntity with id ${id} and data`, data) - - return this.entityService.patch(id, data, _.omit(params, 'query')) - } - - async getEntity(result: any, params: Params) { - const { entityService } = this - const { entityId = (entityService as any).id, entity } = this.configuration - - if (!entityId || result[entityId] === undefined) { - throw new NotAuthenticated('Could not get oAuth entity') - } - - if (!params.provider) { - return result - } - - return entityService.get(result[entityId], { - ..._.omit(params, 'query'), - [entity]: result - }) - } - - async authenticate(authentication: AuthenticationRequest, originalParams: AuthenticationParams) { - const entity: string = this.configuration.entity - const { provider, ...params } = originalParams - const profile = await this.getProfile(authentication, params) - const existingEntity = (await this.findEntity(profile, params)) || (await this.getCurrentEntity(params)) - - debug('authenticate with (existing) entity', existingEntity) - - const authEntity = !existingEntity - ? await this.createEntity(profile, params) - : await this.updateEntity(existingEntity, profile, params) - - return { - authentication: { strategy: this.name }, - [entity]: await this.getEntity(authEntity, originalParams) - } - } -} diff --git a/packages/authentication-oauth/src/utils.ts b/packages/authentication-oauth/src/utils.ts deleted file mode 100644 index 21eff4217f..0000000000 --- a/packages/authentication-oauth/src/utils.ts +++ /dev/null @@ -1,127 +0,0 @@ -import type { RequestHandler } from 'express' -import type { Middleware, Application as KoaApplication } from '@feathersjs/koa' - -import type { ServiceOptions } from '@feathersjs/feathers' - -import '@feathersjs/koa' -import '@feathersjs/express' -import expressCookieSession from 'cookie-session' -import koaCookieSession from 'koa-session' - -import { AuthenticationService } from '@feathersjs/authentication' -import { GrantConfig } from 'grant' - -export interface OauthSetupSettings { - linkStrategy: string - authService?: string - expressSession?: RequestHandler - koaSession?: Middleware -} - -export const getGrantConfig = (service: AuthenticationService): GrantConfig => { - const { - app, - configuration: { oauth } - } = service - // Set up all the defaults - const port = app.get('port') - let host = app.get('host') - let protocol = 'https' - - // Development environments commonly run on HTTP with an extended port - if (process.env.NODE_ENV !== 'production') { - protocol = 'http' - if (String(port) !== '80') { - host += `:${port}` - } - } - - // omit 'redirect' and 'origins' from oauth - const { redirect, origins, ...oauthConfig } = oauth - - const grant: GrantConfig = { - ...oauthConfig, - defaults: { - prefix: '/oauth', - origin: `${protocol}://${host}`, - transport: 'state', - response: ['tokens', 'raw', 'profile'], - ...oauthConfig.defaults - } - } - - const getUrl = (url: string) => { - const { defaults } = grant - return `${defaults.origin}${defaults.prefix}/${url}` - } - - // iterate over grant object with key and value - for (const [name, value] of Object.entries(grant)) { - if (name !== 'defaults') { - value.redirect_uri = value.redirect_uri || getUrl(`${name}/callback`) - } - } - - return grant -} - -export const setExpressParams: RequestHandler = (req, res, next) => { - req.session.destroy ||= () => { - req.session = null - } - - req.feathers = { - ...req.feathers, - session: req.session, - state: res.locals - } - - next() -} - -export const setKoaParams: Middleware = async (ctx, next) => { - ctx.session.destroy ||= () => { - ctx.session = null - } - - ctx.feathers = { - ...ctx.feathers, - session: ctx.session, - state: ctx.state - } as any - - await next() -} - -export const authenticationServiceOptions = ( - service: AuthenticationService, - settings: OauthSetupSettings -): ServiceOptions => { - const { secret } = service.configuration - const koaApp = service.app as KoaApplication - - if (koaApp.context) { - koaApp.keys = [secret] - - const { koaSession = koaCookieSession({ key: 'feathers.oauth' }, koaApp as any) } = settings - - return { - koa: { - before: [koaSession, setKoaParams] - } - } - } - - const { - expressSession = expressCookieSession({ - name: 'feathers.oauth', - keys: [secret] - }) - } = settings - - return { - express: { - before: [expressSession, setExpressParams] - } - } -} diff --git a/packages/authentication-oauth/test/index.test.ts b/packages/authentication-oauth/test/index.test.ts deleted file mode 100644 index f4e192482e..0000000000 --- a/packages/authentication-oauth/test/index.test.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { strict as assert } from 'assert' -import { feathers } from '@feathersjs/feathers' -import { oauth, OauthSetupSettings } from '../src' -import { AuthenticationService } from '@feathersjs/authentication' - -describe('@feathersjs/authentication-oauth', () => { - describe('setup', () => { - it('errors when service does not exist', () => { - const app = feathers() - - assert.throws( - () => { - app.configure(oauth({ authService: 'something' } as OauthSetupSettings)) - }, - { - message: 'An authentication service must exist before registering @feathersjs/authentication-oauth' - } - ) - }) - - it('does not error when service is configured', () => { - const app = feathers() - - app.use('/authentication', new AuthenticationService(app)) - - app.configure(oauth()) - }) - }) -}) diff --git a/packages/authentication-oauth/test/service.test.ts b/packages/authentication-oauth/test/service.test.ts deleted file mode 100644 index a39310763a..0000000000 --- a/packages/authentication-oauth/test/service.test.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { strict as assert } from 'assert' -import axios, { AxiosResponse } from 'axios' -import { CookieJar } from 'tough-cookie' -import { expressFixture } from './utils/fixture' - -describe('@feathersjs/authentication-oauth service', () => { - const port = 9778 - const req = axios.create({ - withCredentials: true, - maxRedirects: 0 - }) - const cookie = new CookieJar() - let app: Awaited > - - const fetchErrorResponse = async (url: string): Promise => { - try { - await req.get(url) - } catch (error: any) { - return error.response - } - assert.fail('Should never get here') - } - - before(async () => { - app = await expressFixture(port, 5115) - }) - - after(async () => { - await app.teardown() - }) - - it('runs through the oAuth flow', async () => { - const host = `http://localhost:${port}` - let location = `${host}/oauth/github` - - const oauthResponse = await fetchErrorResponse(location) - assert.equal(oauthResponse.status, 303) - - oauthResponse.headers['set-cookie']?.forEach((value) => cookie.setCookie(value, host)) - - location = oauthResponse.data.location - - const providerResponse = await fetchErrorResponse(location) - assert.equal(providerResponse.status, 302) - - location = providerResponse.headers.location - - const { data } = await req.get(location, { - headers: { - cookie: await cookie.getCookieString(host) - } - }) - - assert.ok(data.accessToken) - assert.equal(data.authentication.strategy, 'github') - }) -}) diff --git a/packages/authentication-oauth/test/strategy.test.ts b/packages/authentication-oauth/test/strategy.test.ts deleted file mode 100644 index a4386fcbc2..0000000000 --- a/packages/authentication-oauth/test/strategy.test.ts +++ /dev/null @@ -1,200 +0,0 @@ -import { strict as assert } from 'assert' -import { expressFixture, TestOAuthStrategy } from './utils/fixture' -import { AuthenticationService } from '@feathersjs/authentication' - -describe('@feathersjs/authentication-oauth/strategy', () => { - let app: Awaited > - let authService: AuthenticationService - let strategy: TestOAuthStrategy - - before(async () => { - app = await expressFixture(9778, 5115) - authService = app.service('authentication') - strategy = authService.getStrategy('github') as TestOAuthStrategy - }) - - after(async () => { - await app.teardown() - }) - - it('initializes, has .entityId and configuration', () => { - assert.ok(strategy) - assert.strictEqual(strategy.entityId, 'id') - assert.ok(strategy.configuration.entity) - }) - - it('reads configuration from the oauth key', () => { - const testConfigValue = Math.random() - app.get('authentication').oauth.github.hello = testConfigValue - assert.strictEqual(strategy.configuration.hello, testConfigValue) - }) - - it('getRedirect', async () => { - app.get('authentication').oauth.redirect = '/home' - - let redirect = await strategy.getRedirect({ accessToken: 'testing' }) - assert.equal(redirect, '/home#access_token=testing') - - redirect = await strategy.getRedirect( - { accessToken: 'testing' }, - { - redirect: '/hi-there' - } - ) - assert.strictEqual('/home/hi-there#access_token=testing', redirect) - - redirect = await strategy.getRedirect( - { accessToken: 'testing' }, - { - redirect: '/hi-there?' - } - ) - assert.equal(redirect, '/home/hi-there?access_token=testing') - - redirect = await strategy.getRedirect(new Error('something went wrong')) - assert.equal(redirect, '/home#error=something%20went%20wrong') - - redirect = await strategy.getRedirect(new Error()) - assert.equal(redirect, '/home#error=OAuth%20Authentication%20not%20successful') - - app.get('authentication').oauth.redirect = '/home?' - - redirect = await strategy.getRedirect({ accessToken: 'testing' }) - assert.equal(redirect, '/home?access_token=testing') - - delete app.get('authentication').oauth.redirect - - redirect = await strategy.getRedirect({ accessToken: 'testing' }) - assert.equal(redirect, null) - - app.get('authentication').oauth.redirect = '/#dashboard' - - redirect = await strategy.getRedirect({ accessToken: 'testing' }) - assert.equal(redirect, '/#dashboard?access_token=testing') - }) - - it('getRedirect with referrer and allowed origins (#2430)', async () => { - app.get('authentication').oauth.origins = ['https://feathersjs.com', 'https://feathers.cloud'] - - let redirect = await strategy.getRedirect( - { accessToken: 'testing' }, - { - headers: { - referer: 'https://feathersjs.com/somewhere' - } - } - ) - assert.equal(redirect, 'https://feathersjs.com#access_token=testing') - - redirect = await strategy.getRedirect({ accessToken: 'testing' }, {}) - assert.equal(redirect, 'https://feathersjs.com#access_token=testing') - - redirect = await strategy.getRedirect( - { accessToken: 'testing' }, - { - headers: { - referer: 'HTTPS://feathers.CLOUD' - } - } - ) - assert.equal(redirect, 'https://feathers.cloud#access_token=testing') - - redirect = await strategy.getRedirect( - { accessToken: 'testing' }, - { - redirect: '/home', - headers: { - referer: 'https://feathersjs.com/somewhere' - } - } - ) - assert.equal(redirect, 'https://feathersjs.com/home#access_token=testing') - - await assert.rejects( - () => - strategy.getRedirect( - { accessToken: 'testing' }, - { - headers: { - referer: 'https://example.com' - } - } - ), - { - message: 'Referer "https://example.com" is not allowed.' - } - ) - }) - - describe('authenticate', () => { - it('with new user', async () => { - const authResult = await strategy.authenticate( - { - strategy: 'test', - profile: { - id: 'newEntity' - } - }, - {} - ) - - assert.deepEqual(authResult, { - authentication: { strategy: 'github' }, - user: { githubId: 'newEntity', id: authResult.user.id } - }) - }) - - it('with existing user and already linked strategy', async () => { - const existingUser = await app.service('users').create({ - githubId: 'existingEntity', - name: 'David' - }) - const authResult = await strategy.authenticate( - { - strategy: 'test', - profile: { - id: 'existingEntity' - } - }, - {} - ) - - assert.deepEqual(authResult, { - authentication: { strategy: 'github' }, - user: existingUser - }) - }) - - it('links user with existing authentication', async () => { - const user = await app.service('users').create({ - name: 'David' - }) - const jwt = await authService.createAccessToken( - {}, - { - subject: `${user.id}` - } - ) - - const authResult = await strategy.authenticate( - { - strategy: 'test', - profile: { - id: 'linkedEntity' - } - }, - { - authentication: { - strategy: 'jwt', - accessToken: jwt - } - } - ) - - assert.deepEqual(authResult, { - authentication: { strategy: 'github' }, - user: { id: user.id, name: user.name, githubId: 'linkedEntity' } - }) - }) - }) -}) diff --git a/packages/authentication-oauth/test/utils.test.ts b/packages/authentication-oauth/test/utils.test.ts deleted file mode 100644 index 76a3bd34e7..0000000000 --- a/packages/authentication-oauth/test/utils.test.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { AuthenticationService } from '@feathersjs/authentication/lib' -import { feathers } from '@feathersjs/feathers/lib' -import { strict as assert } from 'assert' -import { getGrantConfig } from '../src/utils' - -describe('@feathersjs/authentication-oauth/utils', () => { - it('getGrantConfig initialises Grant defaults', () => { - const app = feathers<{ authentication: AuthenticationService }>() - const auth = new AuthenticationService(app) - - app.set('host', '127.0.0.1') - app.set('port', '8877') - app.set('authentication', { - secret: 'supersecret', - entity: 'user', - service: 'users', - authStrategies: ['jwt'], - oauth: { - github: { - key: 'some-key', - secret: 'a secret secret', - authorize_url: '/github/authorize_url', - access_url: '/github/access_url', - dynamic: true - } - } - }) - const { defaults } = getGrantConfig(auth) - - assert.deepStrictEqual(defaults, { - prefix: '/oauth', - origin: 'http://127.0.0.1:8877', - transport: 'state', - response: ['tokens', 'raw', 'profile'] - }) - }) - - it('getGrantConfig uses Grant defaults when set', () => { - const app = feathers<{ authentication: AuthenticationService }>() - const auth = new AuthenticationService(app) - - app.set('host', '127.0.0.1') - app.set('port', '8877') - app.set('authentication', { - secret: 'supersecret', - entity: 'user', - service: 'users', - authStrategies: ['jwt'], - oauth: { - defaults: { - prefix: '/auth', - origin: 'https://localhost:3344' - }, - github: { - key: 'some-key', - secret: 'a secret secret', - authorize_url: '/github/authorize_url', - access_url: '/github/access_url', - dynamic: true - } - } - }) - const { defaults, github } = getGrantConfig(auth) - - assert.deepStrictEqual(defaults, { - prefix: '/auth', - origin: 'https://localhost:3344', - transport: 'state', - response: ['tokens', 'raw', 'profile'] - }) - assert.strictEqual(github?.redirect_uri, 'https://localhost:3344/auth/github/callback') - }) -}) diff --git a/packages/authentication-oauth/test/utils/fixture.ts b/packages/authentication-oauth/test/utils/fixture.ts deleted file mode 100644 index 0371f516ea..0000000000 --- a/packages/authentication-oauth/test/utils/fixture.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { Application, feathers, NextFunction } from '@feathersjs/feathers' -import express, { rest, errorHandler } from '@feathersjs/express' -import { memory, MemoryService } from '@feathersjs/memory' -import { - AuthenticationService, - JWTStrategy, - AuthenticationRequest, - AuthenticationParams -} from '@feathersjs/authentication' -import { provider } from './provider' -import { oauth, OAuthStrategy } from '../../src' - -export interface ServiceTypes { - authentication: AuthenticationService - users: MemoryService -} - -export class TestOAuthStrategy extends OAuthStrategy { - async authenticate(data: AuthenticationRequest, params: AuthenticationParams) { - const { fromMiddleware } = params - const authResult = await super.authenticate(data, params) - - if (fromMiddleware) { - authResult.fromMiddleware = fromMiddleware - } - - return authResult - } -} - -export const fixtureConfig = - (port: number, providerInstance: Awaited >) => (app: Application) => { - app.set('host', '127.0.0.1') - app.set('port', port) - app.set('authentication', { - secret: 'supersecret', - entity: 'user', - service: 'users', - authStrategies: ['jwt'], - oauth: { - github: { - key: 'some-key', - secret: 'a secret secret', - authorize_url: providerInstance.url(`/github/authorize_url`), - access_url: providerInstance.url(`/github/access_url`), - dynamic: true - } - } - }) - - return app - } - -export const expressFixture = async (serverPort: number, providerPort: number) => { - const providerInstance = await provider({ flow: 'oauth2', port: providerPort }) - const app = express (feathers()) - const auth = new AuthenticationService(app) - - auth.register('jwt', new JWTStrategy()) - auth.register('github', new TestOAuthStrategy()) - - app.configure(rest()) - app.configure(fixtureConfig(serverPort, providerInstance)) - - app.use((req, _res, next) => { - req.feathers = { fromMiddleware: 'testing' } - next() - }) - app.use('authentication', auth) - app.use('users', memory()) - - app.configure(oauth()) - app.use(errorHandler({ logger: false })) - app.hooks({ - teardown: [ - async (_context: any, next: NextFunction) => { - await providerInstance.close() - await next() - } - ] - }) - app.hooks({ - error: { - all: [ - async (context) => { - console.error(context.error) - } - ] - } - }) - - await app.listen(serverPort) - - return app -} diff --git a/packages/authentication-oauth/test/utils/provider.ts b/packages/authentication-oauth/test/utils/provider.ts deleted file mode 100644 index 7a63e25e87..0000000000 --- a/packages/authentication-oauth/test/utils/provider.ts +++ /dev/null @@ -1,282 +0,0 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ -/* eslint-disable @typescript-eslint/no-empty-function */ -// Ported from https://github.com/simov/grant/blob/master/test/util/provider.js -import http from 'http' -import _url from 'url' -import qs from 'qs' - -const buffer = (req: http.IncomingMessage, done: any) => { - let data = '' - req.on('data', (chunk: any) => (data += chunk)) - req.on('end', () => done(/^{.*}$/.test(data) ? JSON.parse(data) : qs.parse(data))) -} -const _query = (req: http.IncomingMessage) => { - const parsed = _url.parse(req.url as string, false) - const query = qs.parse(parsed.query as any) - return query -} -const _oauth = (req: http.IncomingMessage) => - qs.parse((req.headers.authorization || '').replace('OAuth ', '').replace(/"/g, '').replace(/,/g, '&')) - -const sign = (...args: any[]) => - args - .map((arg, index) => - index < 2 - ? Buffer.from(JSON.stringify(arg)) - .toString('base64') - .replace(/=/g, '') - .replace(/\+/g, '-') - .replace(/\//g, '_') - : arg - ) - .join('.') - -export const provider = async ({ flow, port = 5000 }: { flow: 'oauth2' | 'oauth1'; port: number }) => { - const server = await (flow === 'oauth2' ? oauth2(port) : oauth1(port)) - return { - oauth1, - oauth2, - on, - server, - url: (path: string) => `http://localhost:${port}${path}`, - close: () => new Promise((resolve) => server.close(resolve)) - } -} - -const oauth1 = (port: number) => - new Promise ((resolve) => { - let callback: any - const server = http.createServer() - server.on('request', (req, res) => { - const method = req.method - const url = req.url as string - const headers = req.headers - const oauth = _oauth(req) - const query = _query(req) - const provider = /^\/(.*)\/.*/.exec(url) && /^\/(.*)\/.*/.exec(url)![1] - - if (/request_url/.test(url)) { - callback = oauth.oauth_callback - buffer(req, (form: any) => { - if (provider === 'getpocket') { - callback = form.redirect_uri - } - on.request({ url, headers, query, form, oauth }) - provider === 'sellsy' - ? res.writeHead(200, { 'content-type': 'application/json' }) - : res.writeHead(200, { 'content-type': 'application/x-www-form-urlencoded' }) - provider === 'getpocket' - ? res.end(qs.stringify({ code: 'code' })) - : provider === 'sellsy' - ? res.end( - 'authentification_url=https://apifeed.sellsy.com/0/login.php&oauth_token=token&oauth_token_secret=secret&oauth_callback_confirmed=true' - ) - : res.end(qs.stringify({ oauth_token: 'token', oauth_token_secret: 'secret' })) - }) - } else if (/authorize_url/.test(url)) { - const location = callback + '?' + qs.stringify({ oauth_token: 'token', oauth_verifier: 'verifier' }) - on.authorize({ url, headers, query }) - res.writeHead(302, { location }) - res.end() - } else if (/access_url/.test(url)) { - buffer(req, (form: any) => { - on.access({ url, headers, query, form, oauth }) - res.writeHead(200, { 'content-type': 'application/json' }) - provider === 'getpocket' - ? res.end(JSON.stringify({ access_token: 'token' })) - : res.end( - JSON.stringify({ - oauth_token: 'token', - oauth_token_secret: 'secret', - user_id: provider === 'twitter' ? 'id' : undefined - }) - ) - }) - } else if (/request_error_message/.test(url)) { - callback = oauth.oauth_callback - buffer(req, (form: any) => { - on.request({ url, headers, query, form, oauth }) - res.writeHead(200, { 'content-type': 'application/x-www-form-urlencoded' }) - res.end(qs.stringify({ error: { message: 'invalid' } })) - }) - } else if (/request_error_token/.test(url)) { - callback = oauth.oauth_callback - buffer(req, (form: any) => { - on.request({ url, headers, query, form, oauth }) - res.writeHead(200, { 'content-type': 'application/x-www-form-urlencoded' }) - res.end() - }) - } else if (/request_error_status/.test(url)) { - callback = oauth.oauth_callback - buffer(req, (form: any) => { - on.request({ url, headers, query, form, oauth }) - res.writeHead(500, { 'content-type': 'application/x-www-form-urlencoded' }) - res.end(qs.stringify({ invalid: 'request_url' })) - }) - } else if (/authorize_error_message/.test(url)) { - const location = callback + '?' + qs.stringify({ error: { message: 'invalid' } }) - on.authorize({ url, headers, query }) - res.writeHead(302, { location }) - res.end() - } else if (/authorize_error_token/.test(url)) { - const location = callback as string - on.authorize({ url, headers, query }) - res.writeHead(302, { location }) - res.end() - } else if (/access_error_status/.test(url)) { - buffer(req, (form: any) => { - on.access({ url, headers, query, form, oauth }) - res.writeHead(500, { 'content-type': 'application/json' }) - res.end(JSON.stringify({ invalid: 'access_url' })) - }) - } else if (/profile_url/.test(url)) { - on.profile({ method, url, query, headers }) - res.writeHead(200, { 'content-type': 'application/json' }) - provider === 'flickr' - ? res.end('callback({"user": "simov"})') - : res.end(JSON.stringify({ user: 'simov' })) - } - }) - server.listen(port, () => resolve(server)) - }) - -const oauth2 = (port: number) => - new Promise ((resolve) => { - const server = http.createServer() - let openid: any - server.on('request', (req, res) => { - const method = req.method - const url = req.url as string - const headers = req.headers - const query = _query(req) as any - const provider = /^\/(.*)\/.*/.exec(url) && /^\/(.*)\/.*/.exec(url)![1] - - if (/authorize_url/.test(url)) { - openid = (query.scope || []).includes('openid') - on.authorize({ provider, method, url, headers, query }) - if (query.response_mode === 'form_post') { - provider === 'apple' - ? res.end( - qs.stringify({ - code: 'code', - user: { name: { firstName: 'jon', lastName: 'doe' }, email: 'jon@doe.com' } - }) - ) - : res.end('code') - return - } - const location = - query.redirect_uri + - '?' + - (provider === 'intuit' - ? qs.stringify({ code: 'code', realmId: '123' }) - : qs.stringify({ code: 'code' })) - res.writeHead(302, { location }) - res.end() - } else if (/access_url/.test(url)) { - buffer(req, (form: any) => { - on.access({ provider, method, url, headers, query, form }) - res.writeHead(200, { 'content-type': 'application/json' }) - provider === 'concur' - ? res.end(' token refresh ') - : provider === 'withings' - ? res.end( - JSON.stringify({ - body: { - access_token: 'token', - refresh_token: 'refresh', - expires_in: 3600 - } - }) - ) - : res.end( - JSON.stringify({ - access_token: 'token', - refresh_token: 'refresh', - expires_in: 3600, - id_token: openid ? sign({ typ: 'JWT' }, { nonce: 'whatever' }, 'signature') : undefined, - open_id: provider === 'tiktok' ? 'id' : undefined, - uid: provider === 'weibo' ? 'id' : undefined, - openid: provider === 'wechat' ? 'openid' : undefined - }) - ) - }) - } else if (/authorize_error_message/.test(url)) { - on.authorize({ url, query, headers }) - const location = query.redirect_uri + '?' + qs.stringify({ error: { message: 'invalid' } }) - res.writeHead(302, { location }) - res.end() - } else if (/authorize_error_code/.test(url)) { - on.authorize({ url, query, headers }) - const location = query.redirect_uri as string - res.writeHead(302, { location }) - res.end() - } else if (/authorize_error_state_mismatch/.test(url)) { - on.authorize({ url, query, headers }) - const location = query.redirect_uri + '?' + qs.stringify({ code: 'code', state: 'whatever' }) - res.writeHead(302, { location }) - res.end() - } else if (/authorize_error_state_missing/.test(url)) { - on.authorize({ url, query, headers }) - const location = query.redirect_uri + '?' + qs.stringify({ code: 'code' }) - res.writeHead(302, { location }) - res.end() - } else if (/access_error_nonce_mismatch/.test(url)) { - buffer(req, (form: any) => { - on.access({ method, url, query, headers, form }) - res.writeHead(200, { 'content-type': 'application/json' }) - res.end( - JSON.stringify({ - id_token: sign({ typ: 'JWT' }, { nonce: 'whatever' }, 'signature') - }) - ) - }) - } else if (/access_error_nonce_missing/.test(url)) { - buffer(req, (form: any) => { - on.access({ method, url, query, headers, form }) - res.writeHead(200, { 'content-type': 'application/json' }) - res.end( - JSON.stringify({ - id_token: sign({ typ: 'JWT' }, {}, 'signature') - }) - ) - }) - } else if (/access_error_message/.test(url)) { - buffer(req, (form: any) => { - on.access({ method, url, query, headers, form }) - res.writeHead(200, { 'content-type': 'application/json' }) - res.end(JSON.stringify({ error: { message: 'invalid' } })) - }) - } else if (/access_error_status/.test(url)) { - buffer(req, (form: any) => { - on.access({ method, url, query, headers, form }) - res.writeHead(500, { 'content-type': 'application/json' }) - res.end(JSON.stringify({ invalid: 'access_url' })) - }) - } else if (/profile_url/.test(url)) { - if (method === 'POST') { - buffer(req, (form: any) => { - on.profile({ method, url, query, headers, form }) - res.writeHead(200, { 'content-type': 'application/json' }) - res.end(JSON.stringify({ id: 'test', user: 'simov' })) - }) - } else { - on.profile({ method, url, query, headers }) - res.writeHead(200, { 'content-type': 'application/json' }) - res.end(JSON.stringify({ id: 'test', user: 'simov' })) - } - } else if (/profile_error/.test(url)) { - on.profile({ method, url, query, headers }) - res.writeHead(400, { 'content-type': 'application/json' }) - res.end(JSON.stringify({ error: { message: 'Not Found' } })) - } - }) - server.listen(port, () => resolve(server)) - }) - -const on = { - request: (_opts: any) => {}, - authorize: (_opts: any) => {}, - access: (_opts: any) => {}, - profile: (_opts: any) => {} -} diff --git a/packages/authentication-oauth/tsconfig.json b/packages/authentication-oauth/tsconfig.json deleted file mode 100644 index 316fd41336..0000000000 --- a/packages/authentication-oauth/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig", - "include": [ - "src/**/*.ts" - ], - "compilerOptions": { - "outDir": "lib" - } -} diff --git a/packages/authentication/CHANGELOG.md b/packages/authentication/CHANGELOG.md deleted file mode 100644 index fe93ba4c54..0000000000 --- a/packages/authentication/CHANGELOG.md +++ /dev/null @@ -1,1858 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [5.0.34](https://github.com/feathersjs/feathers/compare/v5.0.33...v5.0.34) (2025-05-03) - -### Bug Fixes - -- Update dependencies ([#3584](https://github.com/feathersjs/feathers/issues/3584)) ([119fa4e](https://github.com/feathersjs/feathers/commit/119fa4e1ade8b0078aa235083d566e2538b3a084)) - -## [5.0.33](https://github.com/feathersjs/feathers/compare/v5.0.32...v5.0.33) (2025-02-24) - -### Bug Fixes - -- **dependencies:** Update dependencies ([#3571](https://github.com/feathersjs/feathers/issues/3571)) ([ad611cb](https://github.com/feathersjs/feathers/commit/ad611cb6ffb1dc31d603ba5817331318c5a23217)) - -## [5.0.32](https://github.com/feathersjs/feathers/compare/v5.0.31...v5.0.32) (2025-02-01) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.31](https://github.com/feathersjs/feathers/compare/v5.0.30...v5.0.31) (2024-10-31) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3545](https://github.com/feathersjs/feathers/issues/3545)) ([221b92b](https://github.com/feathersjs/feathers/commit/221b92bb0ee5d54fb1036742968797cb02e56da2)) - -## [5.0.30](https://github.com/feathersjs/feathers/compare/v5.0.29...v5.0.30) (2024-09-02) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.29](https://github.com/feathersjs/feathers/compare/v5.0.28...v5.0.29) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.28](https://github.com/feathersjs/feathers/compare/v5.0.27...v5.0.28) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.27](https://github.com/feathersjs/feathers/compare/v5.0.26...v5.0.27) (2024-06-18) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.26](https://github.com/feathersjs/feathers/compare/v5.0.25...v5.0.26) (2024-06-09) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.25](https://github.com/feathersjs/feathers/compare/v5.0.24...v5.0.25) (2024-05-03) - -### Bug Fixes - -- Reduce usage of lodash ([#3455](https://github.com/feathersjs/feathers/issues/3455)) ([8ce807a](https://github.com/feathersjs/feathers/commit/8ce807a5ca53ff5b8d5107a0656c6329404e6e6c)) - -## [5.0.24](https://github.com/feathersjs/feathers/compare/v5.0.23...v5.0.24) (2024-03-13) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.23](https://github.com/feathersjs/feathers/compare/v5.0.22...v5.0.23) (2024-02-25) - -### Bug Fixes - -- **core:** Update to latest feathersjs/hooks ([#3434](https://github.com/feathersjs/feathers/issues/3434)) ([1499ccc](https://github.com/feathersjs/feathers/commit/1499ccc41fb3ebba97b2c84e0cb19bc48ad3c651)) - -## [5.0.22](https://github.com/feathersjs/feathers/compare/v5.0.21...v5.0.22) (2024-02-15) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.21](https://github.com/feathersjs/feathers/compare/v5.0.20...v5.0.21) (2024-01-25) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.20](https://github.com/feathersjs/feathers/compare/v5.0.19...v5.0.20) (2024-01-24) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.19](https://github.com/feathersjs/feathers/compare/v5.0.18...v5.0.19) (2024-01-23) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.18](https://github.com/feathersjs/feathers/compare/v5.0.17...v5.0.18) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.17](https://github.com/feathersjs/feathers/compare/v5.0.16...v5.0.17) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.16](https://github.com/feathersjs/feathers/compare/v5.0.15...v5.0.16) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.15](https://github.com/feathersjs/feathers/compare/v5.0.14...v5.0.15) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.14](https://github.com/feathersjs/feathers/compare/v5.0.13...v5.0.14) (2024-01-05) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.13](https://github.com/feathersjs/feathers/compare/v5.0.12...v5.0.13) (2023-12-29) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.12](https://github.com/feathersjs/feathers/compare/v5.0.11...v5.0.12) (2023-11-28) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.11](https://github.com/feathersjs/feathers/compare/v5.0.10...v5.0.11) (2023-10-11) - -### Bug Fixes - -- **knex:** Update all dependencies and Knex peer ([#3308](https://github.com/feathersjs/feathers/issues/3308)) ([d2f9860](https://github.com/feathersjs/feathers/commit/d2f986036c4741cce2339d8abbcc6b2eb037a12a)) - -## [5.0.10](https://github.com/feathersjs/feathers/compare/v5.0.9...v5.0.10) (2023-10-03) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.9](https://github.com/feathersjs/feathers/compare/v5.0.8...v5.0.9) (2023-09-27) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.8](https://github.com/feathersjs/feathers/compare/v5.0.7...v5.0.8) (2023-07-19) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.7](https://github.com/feathersjs/feathers/compare/v5.0.6...v5.0.7) (2023-07-14) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.6](https://github.com/feathersjs/feathers/compare/v5.0.5...v5.0.6) (2023-06-15) - -### Bug Fixes - -- **authentication:** Export JwtVerifyOptions ([#3214](https://github.com/feathersjs/feathers/issues/3214)) ([d59896e](https://github.com/feathersjs/feathers/commit/d59896eb0229f1490c712f19cf84eb2bcf123698)) - -## [5.0.5](https://github.com/feathersjs/feathers/compare/v5.0.4...v5.0.5) (2023-04-28) - -**Note:** Version bump only for package @feathersjs/authentication - -## [5.0.4](https://github.com/feathersjs/feathers/compare/v5.0.3...v5.0.4) (2023-04-12) - -### Bug Fixes - -- Make sure all Readme files are up to date ([#3154](https://github.com/feathersjs/feathers/issues/3154)) ([a5f0b38](https://github.com/feathersjs/feathers/commit/a5f0b38bbf2a11486415a39533bcc6c67fb51e3e)) - -## [5.0.3](https://github.com/feathersjs/feathers/compare/v5.0.2...v5.0.3) (2023-04-05) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3139](https://github.com/feathersjs/feathers/issues/3139)) ([f24276e](https://github.com/feathersjs/feathers/commit/f24276e9a909e2e58a0730c730258ce1f70f4028)) - -## [5.0.1](https://github.com/feathersjs/feathers/compare/v5.0.0...v5.0.1) (2023-03-15) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.38...v5.0.0) (2023-02-24) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.38](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.37...v5.0.0-pre.38) (2023-02-17) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.37](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.36...v5.0.0-pre.37) (2023-02-09) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.36](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.35...v5.0.0-pre.36) (2023-01-29) - -### Bug Fixes - -- Update all dependencies ([#3024](https://github.com/feathersjs/feathers/issues/3024)) ([283dc47](https://github.com/feathersjs/feathers/commit/283dc4798d85584bc031e6e54b83b4ea77d1edd0)) - -# [5.0.0-pre.35](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.34...v5.0.0-pre.35) (2023-01-12) - -### Features - -- **generators:** Move core code generators to shared generators package ([#2982](https://github.com/feathersjs/feathers/issues/2982)) ([0328d22](https://github.com/feathersjs/feathers/commit/0328d2292153870bc43958f73d2c6f288a8cec17)) - -# [5.0.0-pre.34](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.33...v5.0.0-pre.34) (2022-12-14) - -### Bug Fixes - -- **authentication:** Fix order of connection and login event handling ([#2909](https://github.com/feathersjs/feathers/issues/2909)) ([801a503](https://github.com/feathersjs/feathers/commit/801a503425062e27f2a32b91493b6ffae3822626)) -- **core:** `context.type` for around hooks ([#2890](https://github.com/feathersjs/feathers/issues/2890)) ([d606ac6](https://github.com/feathersjs/feathers/commit/d606ac660fd5335c95206784fea36530dd2e851a)) - -### Features - -- **schema:** Virtual property resolvers ([#2900](https://github.com/feathersjs/feathers/issues/2900)) ([7d03b57](https://github.com/feathersjs/feathers/commit/7d03b57ae2f633bdd4a368e0d5955011fbd6c329)) - -# [5.0.0-pre.33](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.32...v5.0.0-pre.33) (2022-11-08) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.32](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.31...v5.0.0-pre.32) (2022-10-26) - -### Bug Fixes - -- **authentication:** Improve logout and disconnect connection handling ([#2813](https://github.com/feathersjs/feathers/issues/2813)) ([dd77379](https://github.com/feathersjs/feathers/commit/dd77379d8bdcd32d529bef912e672639e4899823)) - -# [5.0.0-pre.31](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.30...v5.0.0-pre.31) (2022-10-12) - -### Features - -- **cli:** Generate full client test suite and improve typed client ([#2788](https://github.com/feathersjs/feathers/issues/2788)) ([57119b6](https://github.com/feathersjs/feathers/commit/57119b6bb2797f7297cf054268a248c093ecd538)) - -# [5.0.0-pre.30](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.29...v5.0.0-pre.30) (2022-10-07) - -### Features - -- **core:** Allow to unregister services at runtime ([#2756](https://github.com/feathersjs/feathers/issues/2756)) ([d16601f](https://github.com/feathersjs/feathers/commit/d16601f2277dca5357866ffdefba2a611f6dc7fa)) -- **schema:** Make schemas validation library independent and add TypeBox support ([#2772](https://github.com/feathersjs/feathers/issues/2772)) ([44172d9](https://github.com/feathersjs/feathers/commit/44172d99b566d11d9ceda04f1d0bf72b6d05ce76)) - -# [5.0.0-pre.29](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.28...v5.0.0-pre.29) (2022-09-16) - -### Features - -- **authentication-oauth:** Koa and transport independent oAuth authentication ([#2737](https://github.com/feathersjs/feathers/issues/2737)) ([9231525](https://github.com/feathersjs/feathers/commit/9231525a24bb790ba9c5d940f2867a9c727691c9)) - -# [5.0.0-pre.28](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.27...v5.0.0-pre.28) (2022-08-03) - -### Bug Fixes - -- **cli:** Improve generated application and client ([#2701](https://github.com/feathersjs/feathers/issues/2701)) ([bd55ffb](https://github.com/feathersjs/feathers/commit/bd55ffb812e89bf215f4515e7f137656ea888c3f)) - -# [5.0.0-pre.27](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.26...v5.0.0-pre.27) (2022-07-13) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.26](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.25...v5.0.0-pre.26) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.25](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.24...v5.0.0-pre.25) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.24](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.23...v5.0.0-pre.24) (2022-06-21) - -### Bug Fixes - -- **authentication:** Add safe dispatch data for authentication requests ([#2662](https://github.com/feathersjs/feathers/issues/2662)) ([d8104a1](https://github.com/feathersjs/feathers/commit/d8104a19ee9181e6a5ea81014af29ff9a3c28a8a)) - -# [5.0.0-pre.23](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.22...v5.0.0-pre.23) (2022-06-06) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.22](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.21...v5.0.0-pre.22) (2022-05-24) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.21](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.20...v5.0.0-pre.21) (2022-05-23) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.20](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.19...v5.0.0-pre.20) (2022-05-04) - -### Bug Fixes - -- **dependencies:** Lock monorepo package version numbers ([#2623](https://github.com/feathersjs/feathers/issues/2623)) ([5640c10](https://github.com/feathersjs/feathers/commit/5640c1020cc139994e695d658c08bad3494db507)) - -# [5.0.0-pre.19](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.18...v5.0.0-pre.19) (2022-05-01) - -### Features - -- **typescript:** Improve adapter typings ([#2605](https://github.com/feathersjs/feathers/issues/2605)) ([3b2ca0a](https://github.com/feathersjs/feathers/commit/3b2ca0a6a8e03e8390272c4d7e930b4bffdaacf5)) -- **typescript:** Improve params and query typeability ([#2600](https://github.com/feathersjs/feathers/issues/2600)) ([df28b76](https://github.com/feathersjs/feathers/commit/df28b7619161f1df5e700326f52cca1a92dc5d28)) - -# [5.0.0-pre.18](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.17...v5.0.0-pre.18) (2022-04-11) - -### Features - -- **authentication:** Add setup method for auth strategies ([#1611](https://github.com/feathersjs/feathers/issues/1611)) ([a3c3581](https://github.com/feathersjs/feathers/commit/a3c35814dccdbbf6de96f04f60b226ce206c6dbe)) -- **configuration:** Allow app configuration to be validated against a schema ([#2590](https://github.com/feathersjs/feathers/issues/2590)) ([a268f86](https://github.com/feathersjs/feathers/commit/a268f86da92a8ada14ed11ab456aac0a4bba5bb0)) - -# [5.0.0-pre.17](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.16...v5.0.0-pre.17) (2022-02-15) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.16](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.15...v5.0.0-pre.16) (2022-01-12) - -### Features - -- **express, koa:** make transports similar ([#2486](https://github.com/feathersjs/feathers/issues/2486)) ([26aa937](https://github.com/feathersjs/feathers/commit/26aa937c114fb8596dfefc599b1f53cead69c159)) - -# [5.0.0-pre.15](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.14...v5.0.0-pre.15) (2021-11-27) - -### Bug Fixes - -- **typescript:** Overall typing improvements ([#2478](https://github.com/feathersjs/feathers/issues/2478)) ([b8eb804](https://github.com/feathersjs/feathers/commit/b8eb804158556d9651a8607e3c3fda15e0bfd110)) - -### Features - -- **authentication-oauth:** Allow dynamic oAuth redirect ([#2469](https://github.com/feathersjs/feathers/issues/2469)) ([b7143d4](https://github.com/feathersjs/feathers/commit/b7143d4c0fbe961e714f79512be04449b9bbd7d9)) - -# [5.0.0-pre.14](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.13...v5.0.0-pre.14) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.13](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.12...v5.0.0-pre.13) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.12](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.11...v5.0.0-pre.12) (2021-10-12) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.11](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.10...v5.0.0-pre.11) (2021-10-06) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.10](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.9...v5.0.0-pre.10) (2021-09-19) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.9](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.8...v5.0.0-pre.9) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.8](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.7...v5.0.0-pre.8) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.7](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.6...v5.0.0-pre.7) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.6](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.5...v5.0.0-pre.6) (2021-08-08) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.4...v5.0.0-pre.5) (2021-06-23) - -### Bug Fixes - -- **hooks:** Migrate built-in hooks and allow backwards compatibility ([#2358](https://github.com/feathersjs/feathers/issues/2358)) ([759c5a1](https://github.com/feathersjs/feathers/commit/759c5a19327a731af965c3604119393b3d09a406)) -- **koa:** Use extended query parser for compatibility ([#2397](https://github.com/feathersjs/feathers/issues/2397)) ([b2944ba](https://github.com/feathersjs/feathers/commit/b2944bac3ec6d5ecc80dc518cd4e58093692db74)) - -### Features - -- **adapter-commons:** Add support for params.adapter option and move memory adapter to @feathersjs/memory ([#2367](https://github.com/feathersjs/feathers/issues/2367)) ([a43e7da](https://github.com/feathersjs/feathers/commit/a43e7da22b6b981a96d1321736ea9a0cb924fb4f)) - -# [5.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.3...v5.0.0-pre.4) (2021-05-13) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.2...v5.0.0-pre.3) (2021-04-21) - -### Bug Fixes - -- **typescript:** Improve TypeScript backwards compatibility ([#2310](https://github.com/feathersjs/feathers/issues/2310)) ([f33be73](https://github.com/feathersjs/feathers/commit/f33be73fc46a533efb15df9aab0658e3240d3897)) - -### Features - -- **dependencies:** Remove direct debug dependency ([#2296](https://github.com/feathersjs/feathers/issues/2296)) ([501d416](https://github.com/feathersjs/feathers/commit/501d4164d30c6a126906dc640cdfdc82207ba34a)) - -# [5.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.1...v5.0.0-pre.2) (2021-04-06) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-beta.1](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2021-04-03) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-beta.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.1...v5.0.0-beta.0) (2021-03-28) - -### Bug Fixes - -- Update Grant usage and other dependencies ([#2264](https://github.com/feathersjs/feathers/issues/2264)) ([7b0f8fa](https://github.com/feathersjs/feathers/commit/7b0f8fad252419ed0ad0bf259cdf3104d322ab60)) - -### Features - -- Application service types default to any ([#1566](https://github.com/feathersjs/feathers/issues/1566)) ([d93ba9a](https://github.com/feathersjs/feathers/commit/d93ba9a17edd20d3397bb00f4f6e82e804e42ed6)) -- Feathers v5 core refactoring and features ([#2255](https://github.com/feathersjs/feathers/issues/2255)) ([2dafb7c](https://github.com/feathersjs/feathers/commit/2dafb7ce14ba57406aeec13d10ca45b1e709bee9)) - -# [5.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.5.11...v5.0.0-pre.1) (2020-12-17) - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -**Note:** Version bump only for package @feathersjs/authentication - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05) - -**Note:** Version bump only for package @feathersjs/authentication - -## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08) - -### Bug Fixes - -- **authentication:** consistent response return between local and jwt strategy ([#2042](https://github.com/feathersjs/feathers/issues/2042)) ([8d25be1](https://github.com/feathersjs/feathers/commit/8d25be101a2593a9e789375c928a07780b9e28cf)) - -## [4.5.9](https://github.com/feathersjs/feathers/compare/v4.5.8...v4.5.9) (2020-10-09) - -**Note:** Version bump only for package @feathersjs/authentication - -## [4.5.8](https://github.com/feathersjs/feathers/compare/v4.5.7...v4.5.8) (2020-08-12) - -**Note:** Version bump only for package @feathersjs/authentication - -## [4.5.7](https://github.com/feathersjs/feathers/compare/v4.5.6...v4.5.7) (2020-07-24) - -### Bug Fixes - -- **authentication:** Add JWT getEntityQuery ([#2013](https://github.com/feathersjs/feathers/issues/2013)) ([e0e7fb5](https://github.com/feathersjs/feathers/commit/e0e7fb5162940fe776731283b40026c61d9c8a33)) - -## [4.5.6](https://github.com/feathersjs/feathers/compare/v4.5.5...v4.5.6) (2020-07-12) - -### Bug Fixes - -- **authentication:** Omit query in JWT strategy ([#2011](https://github.com/feathersjs/feathers/issues/2011)) ([04ce7e9](https://github.com/feathersjs/feathers/commit/04ce7e98515fe9d495cd0e83e0da097e9bcd7382)) - -## [4.5.5](https://github.com/feathersjs/feathers/compare/v4.5.4...v4.5.5) (2020-07-11) - -### Bug Fixes - -- **authentication:** Include query params when authenticating via authenticate hook [#2009](https://github.com/feathersjs/feathers/issues/2009) ([4cdb7bf](https://github.com/feathersjs/feathers/commit/4cdb7bf2898385ddac7a1692bc9ac2f6cf5ad446)) - -## [4.5.3](https://github.com/feathersjs/feathers/compare/v4.5.2...v4.5.3) (2020-04-17) - -### Bug Fixes - -- **authentication:** Remove entity from connection information on logout ([#1889](https://github.com/feathersjs/feathers/issues/1889)) ([b062753](https://github.com/feathersjs/feathers/commit/b0627530d61babe15dd84369d3093ccae4b780ca)) - -## [4.5.2](https://github.com/feathersjs/feathers/compare/v4.5.1...v4.5.2) (2020-03-04) - -### Bug Fixes - -- **authentication:** Improve JWT strategy configuration error message ([#1844](https://github.com/feathersjs/feathers/issues/1844)) ([2c771db](https://github.com/feathersjs/feathers/commit/2c771dbb22d53d4f7de3c3f514e57afa1a186322)) - -## [4.5.1](https://github.com/feathersjs/feathers/compare/v4.5.0...v4.5.1) (2020-01-24) - -**Note:** Version bump only for package @feathersjs/authentication - -# [4.5.0](https://github.com/feathersjs/feathers/compare/v4.4.3...v4.5.0) (2020-01-18) - -### Bug Fixes - -- Add `params.authentication` type, remove `hook.connection` type ([#1732](https://github.com/feathersjs/feathers/issues/1732)) ([d46b7b2](https://github.com/feathersjs/feathers/commit/d46b7b2abac8862c0e4dbfce20d71b8b8a96692f)) - -## [4.4.3](https://github.com/feathersjs/feathers/compare/v4.4.1...v4.4.3) (2019-12-06) - -**Note:** Version bump only for package @feathersjs/authentication - -## [4.4.1](https://github.com/feathersjs/feathers/compare/v4.4.0...v4.4.1) (2019-11-27) - -**Note:** Version bump only for package @feathersjs/authentication - -# [4.4.0](https://github.com/feathersjs/feathers/compare/v4.3.11...v4.4.0) (2019-11-27) - -**Note:** Version bump only for package @feathersjs/authentication - -## [4.3.11](https://github.com/feathersjs/feathers/compare/v4.3.10...v4.3.11) (2019-11-11) - -### Bug Fixes - -- **authentication:** Retain object references in authenticate hook ([#1675](https://github.com/feathersjs/feathers/issues/1675)) ([e1939be](https://github.com/feathersjs/feathers/commit/e1939be19d4e79d3f5e2fe69ba894a11c627ae99)) - -## [4.3.10](https://github.com/feathersjs/feathers/compare/v4.3.9...v4.3.10) (2019-10-26) - -**Note:** Version bump only for package @feathersjs/authentication - -## [4.3.9](https://github.com/feathersjs/feathers/compare/v4.3.8...v4.3.9) (2019-10-26) - -### Bug Fixes - -- Add jsonwebtoken TypeScript type dependency ([317c80a](https://github.com/feathersjs/feathers/commit/317c80a9205e8853bb830a12c3aa1a19e95f9abc)) -- Small type improvements ([#1624](https://github.com/feathersjs/feathers/issues/1624)) ([50162c6](https://github.com/feathersjs/feathers/commit/50162c6e562f0a47c6a280c4f01fff7c3afee293)) - -## [4.3.7](https://github.com/feathersjs/feathers/compare/v4.3.6...v4.3.7) (2019-10-14) - -**Note:** Version bump only for package @feathersjs/authentication - -## [4.3.5](https://github.com/feathersjs/feathers/compare/v4.3.4...v4.3.5) (2019-10-07) - -### Bug Fixes - -- Authentication type improvements and timeout fix ([#1605](https://github.com/feathersjs/feathers/issues/1605)) ([19854d3](https://github.com/feathersjs/feathers/commit/19854d3)) -- Improve error message when authentication strategy is not allowed ([#1600](https://github.com/feathersjs/feathers/issues/1600)) ([317a312](https://github.com/feathersjs/feathers/commit/317a312)) - -## [4.3.4](https://github.com/feathersjs/feathers/compare/v4.3.3...v4.3.4) (2019-10-03) - -**Note:** Version bump only for package @feathersjs/authentication - -## [4.3.3](https://github.com/feathersjs/feathers/compare/v4.3.2...v4.3.3) (2019-09-21) - -### Bug Fixes - -- check for undefined access token ([#1571](https://github.com/feathersjs/feathers/issues/1571)) ([976369d](https://github.com/feathersjs/feathers/commit/976369d)) -- Small improvements in dependencies and code sturcture ([#1562](https://github.com/feathersjs/feathers/issues/1562)) ([42c13e2](https://github.com/feathersjs/feathers/commit/42c13e2)) - -## [4.3.2](https://github.com/feathersjs/feathers/compare/v4.3.1...v4.3.2) (2019-09-16) - -**Note:** Version bump only for package @feathersjs/authentication - -## [4.3.1](https://github.com/feathersjs/feathers/compare/v4.3.0...v4.3.1) (2019-09-09) - -### Bug Fixes - -- Use long-timeout for JWT expiration timers ([#1552](https://github.com/feathersjs/feathers/issues/1552)) ([65637ec](https://github.com/feathersjs/feathers/commit/65637ec)) - -# [4.3.0](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.4...v4.3.0) (2019-08-27) - -**Note:** Version bump only for package @feathersjs/authentication - -# [4.3.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.3...v4.3.0-pre.4) (2019-08-22) - -### Bug Fixes - -- Fix auth publisher mistake ([08bad61](https://github.com/feathersjs/feathers/commit/08bad61)) - -# [4.3.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.2...v4.3.0-pre.3) (2019-08-19) - -### Bug Fixes - -- Expire and remove authenticated real-time connections ([#1512](https://github.com/feathersjs/feathers/issues/1512)) ([2707c33](https://github.com/feathersjs/feathers/commit/2707c33)) -- Update all dependencies ([7d53a00](https://github.com/feathersjs/feathers/commit/7d53a00)) - -### Features - -- Let strategies handle the connection ([#1510](https://github.com/feathersjs/feathers/issues/1510)) ([4329feb](https://github.com/feathersjs/feathers/commit/4329feb)) - -# [4.3.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.1...v4.3.0-pre.2) (2019-08-02) - -### Bug Fixes - -- Add getEntityId to JWT strategy and fix legacy Socket authentication ([#1488](https://github.com/feathersjs/feathers/issues/1488)) ([9a3b324](https://github.com/feathersjs/feathers/commit/9a3b324)) -- Add method to reliably get default authentication service ([#1470](https://github.com/feathersjs/feathers/issues/1470)) ([e542cb3](https://github.com/feathersjs/feathers/commit/e542cb3)) - -# [4.3.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.5...v4.3.0-pre.1) (2019-07-11) - -**Note:** Version bump only for package @feathersjs/authentication - -# [4.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.4...v4.0.0-pre.5) (2019-07-10) - -**Note:** Version bump only for package @feathersjs/authentication - -# [4.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.3...v4.0.0-pre.4) (2019-07-05) - -### Bug Fixes - -- Updated typings for ServiceMethods ([#1409](https://github.com/feathersjs/feathers/issues/1409)) ([b5ee7e2](https://github.com/feathersjs/feathers/commit/b5ee7e2)) - -# [4.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.2...v4.0.0-pre.3) (2019-06-01) - -### Bug Fixes - -- Make oAuth paths more consistent and improve authentication client ([#1377](https://github.com/feathersjs/feathers/issues/1377)) ([adb2543](https://github.com/feathersjs/feathers/commit/adb2543)) -- Set authenticated: true after successful authentication ([#1367](https://github.com/feathersjs/feathers/issues/1367)) ([9918cff](https://github.com/feathersjs/feathers/commit/9918cff)) -- Typings fix and improvements. ([#1364](https://github.com/feathersjs/feathers/issues/1364)) ([515b916](https://github.com/feathersjs/feathers/commit/515b916)) -- Update dependencies and fix tests ([#1373](https://github.com/feathersjs/feathers/issues/1373)) ([d743a7f](https://github.com/feathersjs/feathers/commit/d743a7f)) - -# [4.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.1...v4.0.0-pre.2) (2019-05-15) - -### Bug Fixes - -- Throw NotAuthenticated on token verification errors ([#1357](https://github.com/feathersjs/feathers/issues/1357)) ([e0120df](https://github.com/feathersjs/feathers/commit/e0120df)) - -# [4.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.0...v4.0.0-pre.1) (2019-05-08) - -### Bug Fixes - -- Always require strategy parameter in authentication ([#1327](https://github.com/feathersjs/feathers/issues/1327)) ([d4a8021](https://github.com/feathersjs/feathers/commit/d4a8021)) -- Bring back params.authenticated ([#1317](https://github.com/feathersjs/feathers/issues/1317)) ([a0ffd5e](https://github.com/feathersjs/feathers/commit/a0ffd5e)) -- Improve authentication parameter handling ([#1333](https://github.com/feathersjs/feathers/issues/1333)) ([6e77204](https://github.com/feathersjs/feathers/commit/6e77204)) -- Merge httpStrategies and authStrategies option ([#1308](https://github.com/feathersjs/feathers/issues/1308)) ([afa4d55](https://github.com/feathersjs/feathers/commit/afa4d55)) -- Rename jwtStrategies option to authStrategies ([#1305](https://github.com/feathersjs/feathers/issues/1305)) ([4aee151](https://github.com/feathersjs/feathers/commit/4aee151)) - -### Features - -- Change and *JWT methods to *accessToken ([#1304](https://github.com/feathersjs/feathers/issues/1304)) ([5ac826b](https://github.com/feathersjs/feathers/commit/5ac826b)) - -# [4.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v3.2.0-pre.1...v4.0.0-pre.0) (2019-04-21) - -### Bug Fixes - -- Added path and method in to express request for passport ([#1112](https://github.com/feathersjs/feathers/issues/1112)) ([afa1cb4](https://github.com/feathersjs/feathers/commit/afa1cb4)) -- Authentication core improvements ([#1260](https://github.com/feathersjs/feathers/issues/1260)) ([c5dc7a2](https://github.com/feathersjs/feathers/commit/c5dc7a2)) -- Improve JWT authentication option handling ([#1261](https://github.com/feathersjs/feathers/issues/1261)) ([31b956b](https://github.com/feathersjs/feathers/commit/31b956b)) -- Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803)) -- Only merge authenticated property on update ([8a564f7](https://github.com/feathersjs/feathers/commit/8a564f7)) -- reduce authentication connection hook complexity and remove unnecessary checks ([fa94b2f](https://github.com/feathersjs/feathers/commit/fa94b2f)) -- Update all dependencies to latest ([#1206](https://github.com/feathersjs/feathers/issues/1206)) ([e51e0f6](https://github.com/feathersjs/feathers/commit/e51e0f6)) -- **authentication:** Fall back when req.app is not the application when emitting events ([#1185](https://github.com/feathersjs/feathers/issues/1185)) ([6a534f0](https://github.com/feathersjs/feathers/commit/6a534f0)) -- Update adapter common tests ([#1135](https://github.com/feathersjs/feathers/issues/1135)) ([8166dda](https://github.com/feathersjs/feathers/commit/8166dda)) -- **docs/new-features:** syntax highlighting ([#347](https://github.com/feathersjs/feathers/issues/347)) ([4ab7c95](https://github.com/feathersjs/feathers/commit/4ab7c95)) -- **package:** update @feathersjs/commons to version 2.0.0 ([#692](https://github.com/feathersjs/feathers/issues/692)) ([ca665ab](https://github.com/feathersjs/feathers/commit/ca665ab)) -- **package:** update debug to version 3.0.0 ([#555](https://github.com/feathersjs/feathers/issues/555)) ([f788804](https://github.com/feathersjs/feathers/commit/f788804)) -- **package:** update jsonwebtoken to version 8.0.0 ([#567](https://github.com/feathersjs/feathers/issues/567)) ([6811626](https://github.com/feathersjs/feathers/commit/6811626)) -- **package:** update ms to version 2.0.0 ([#509](https://github.com/feathersjs/feathers/issues/509)) ([7e4b0b6](https://github.com/feathersjs/feathers/commit/7e4b0b6)) -- **package:** update passport to version 0.4.0 ([#558](https://github.com/feathersjs/feathers/issues/558)) ([dcb14a5](https://github.com/feathersjs/feathers/commit/dcb14a5)) - -### Features - -- @feathersjs/authentication-oauth ([#1299](https://github.com/feathersjs/feathers/issues/1299)) ([656bae7](https://github.com/feathersjs/feathers/commit/656bae7)) -- Add AuthenticationBaseStrategy and make authentication option handling more explicit ([#1284](https://github.com/feathersjs/feathers/issues/1284)) ([2667d92](https://github.com/feathersjs/feathers/commit/2667d92)) -- Add TypeScript definitions ([#1275](https://github.com/feathersjs/feathers/issues/1275)) ([9dd6713](https://github.com/feathersjs/feathers/commit/9dd6713)) -- Authentication v3 core server implementation ([#1205](https://github.com/feathersjs/feathers/issues/1205)) ([1bd7591](https://github.com/feathersjs/feathers/commit/1bd7591)) -- Authentication v3 local authentication ([#1211](https://github.com/feathersjs/feathers/issues/1211)) ([0fa5f7c](https://github.com/feathersjs/feathers/commit/0fa5f7c)) -- Remove (hook, next) signature and SKIP support ([#1269](https://github.com/feathersjs/feathers/issues/1269)) ([211c0f8](https://github.com/feathersjs/feathers/commit/211c0f8)) -- Support params symbol to skip authenticate hook ([#1296](https://github.com/feathersjs/feathers/issues/1296)) ([d16cf4d](https://github.com/feathersjs/feathers/commit/d16cf4d)) - -### BREAKING CHANGES - -- Update authentication strategies for @feathersjs/authentication v3 - -## [2.1.16](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication@2.1.15...@feathersjs/authentication@2.1.16) (2019-01-26) - -### Bug Fixes - -- **authentication:** Fall back when req.app is not the application when emitting events ([#1185](https://github.com/feathersjs/feathers/issues/1185)) ([6a534f0](https://github.com/feathersjs/feathers/commit/6a534f0)) - -## [2.1.15](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication@2.1.14...@feathersjs/authentication@2.1.15) (2019-01-02) - -### Bug Fixes - -- Update adapter common tests ([#1135](https://github.com/feathersjs/feathers/issues/1135)) ([8166dda](https://github.com/feathersjs/feathers/commit/8166dda)) - - - -## [2.1.14](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication@2.1.13...@feathersjs/authentication@2.1.14) (2018-12-16) - -### Bug Fixes - -- Added path and method in to express request for passport ([#1112](https://github.com/feathersjs/feathers/issues/1112)) ([afa1cb4](https://github.com/feathersjs/feathers/commit/afa1cb4)) - - - -## [2.1.13](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication@2.1.12...@feathersjs/authentication@2.1.13) (2018-10-26) - -**Note:** Version bump only for package @feathersjs/authentication - - - -## [2.1.12](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication@2.1.11...@feathersjs/authentication@2.1.12) (2018-10-25) - -### Bug Fixes - -- Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803)) -- Only merge authenticated property on update ([8a564f7](https://github.com/feathersjs/feathers/commit/8a564f7)) - - - -## [2.1.11](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication@2.1.10...@feathersjs/authentication@2.1.11) (2018-09-21) - -**Note:** Version bump only for package @feathersjs/authentication - - - -## [2.1.10](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication@2.1.9...@feathersjs/authentication@2.1.10) (2018-09-17) - -**Note:** Version bump only for package @feathersjs/authentication - - - -## [2.1.9](https://github.com/feathersjs/feathers/compare/@feathersjs/authentication@2.1.8...@feathersjs/authentication@2.1.9) (2018-09-02) - -**Note:** Version bump only for package @feathersjs/authentication - - - -## 2.1.8 - -- Migrate to Monorepo ([feathers#462](https://github.com/feathersjs/feathers/issues/462)) - -## [v2.1.7](https://github.com/feathersjs/authentication/tree/v2.1.7) (2018-06-29) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v2.1.6...v2.1.7) - -**Fixed bugs:** - -- XXXOrRestrict undermines provider \(security\) logic [\#395](https://github.com/feathersjs/authentication/issues/395) - -**Closed issues:** - -- Customize response of authentication service [\#679](https://github.com/feathersjs/authentication/issues/679) -- hook.params.user is null using REST [\#678](https://github.com/feathersjs/authentication/issues/678) -- Can't store JWT token to cookie on REST client [\#676](https://github.com/feathersjs/authentication/issues/676) -- Is there a way to get req.user without using the authentication middleware? [\#675](https://github.com/feathersjs/authentication/issues/675) - -**Merged pull requests:** - -- Remove subject from the JWT verification options [\#686](https://github.com/feathersjs/authentication/pull/686) ([rasendubi](https://github.com/rasendubi)) -- Replaced feathers.static with express.static [\#685](https://github.com/feathersjs/authentication/pull/685) ([georgehorrell](https://github.com/georgehorrell)) -- Remove dependency on Express and Express middleware [\#683](https://github.com/feathersjs/authentication/pull/683) ([daffl](https://github.com/daffl)) -- Update sinon to the latest version 🚀 [\#681](https://github.com/feathersjs/authentication/pull/681) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v2.1.6](https://github.com/feathersjs/authentication/tree/v2.1.6) (2018-06-01) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v2.1.5...v2.1.6) - -**Closed issues:** - -- Authentication local strategy not working with a Custom User service [\#672](https://github.com/feathersjs/authentication/issues/672) -- CLI command bug: 'Feathers generate authentication' produces bad working 'users' service [\#670](https://github.com/feathersjs/authentication/issues/670) -- config\default.json generated without callbackURL config needed to set redirect URL for Google Outh2 [\#669](https://github.com/feathersjs/authentication/issues/669) -- HELP WANTED: Authentication strategy 'jwt' is not registered. [\#668](https://github.com/feathersjs/authentication/issues/668) -- Authenticate shows error: No auth token [\#667](https://github.com/feathersjs/authentication/issues/667) -- authentication - Method: remove [\#662](https://github.com/feathersjs/authentication/issues/662) -- NotAuthenticated: jwt expired [\#633](https://github.com/feathersjs/authentication/issues/633) -- Authentication via phone number [\#616](https://github.com/feathersjs/authentication/issues/616) -- Persist auth tokens on db [\#569](https://github.com/feathersjs/authentication/issues/569) -- Tighter integration with feathers-authentication-management [\#393](https://github.com/feathersjs/authentication/issues/393) - -**Merged pull requests:** - -- Fix tests to work with latest Sinon [\#674](https://github.com/feathersjs/authentication/pull/674) ([daffl](https://github.com/daffl)) -- add option to allowUnauthenticated [\#599](https://github.com/feathersjs/authentication/pull/599) ([MichaelErmer](https://github.com/MichaelErmer)) - -## [v2.1.5](https://github.com/feathersjs/authentication/tree/v2.1.5) (2018-04-16) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v2.1.4...v2.1.5) - -**Closed issues:** - -- feathersjs Invalid token: expired [\#661](https://github.com/feathersjs/authentication/issues/661) -- Safari and iOS facebook login can't redirect back, but others can. [\#651](https://github.com/feathersjs/authentication/issues/651) - -**Merged pull requests:** - -- Remove payload and user entity on logout. [\#665](https://github.com/feathersjs/authentication/pull/665) ([bertho-zero](https://github.com/bertho-zero)) - -## [v2.1.4](https://github.com/feathersjs/authentication/tree/v2.1.4) (2018-04-12) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v2.1.3...v2.1.4) - -**Closed issues:** - -- Column "createdAt" does not exist" in Autentication [\#660](https://github.com/feathersjs/authentication/issues/660) -- How to make a user automatically logined on server side? [\#659](https://github.com/feathersjs/authentication/issues/659) -- authentication-jwt functional example [\#657](https://github.com/feathersjs/authentication/issues/657) -- "No auth token" with auth0 when following the guide [\#655](https://github.com/feathersjs/authentication/issues/655) -- Service returns \[No Auth Token\] same by passing Authorization Token on HEADER [\#641](https://github.com/feathersjs/authentication/issues/641) - -**Merged pull requests:** - -- Throw an error for unavailable strategy [\#663](https://github.com/feathersjs/authentication/pull/663) ([daffl](https://github.com/daffl)) -- Update sinon to the latest version 🚀 [\#656](https://github.com/feathersjs/authentication/pull/656) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v2.1.3](https://github.com/feathersjs/authentication/tree/v2.1.3) (2018-03-16) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v2.1.2...v2.1.3) - -**Closed issues:** - -- ts [\#647](https://github.com/feathersjs/authentication/issues/647) -- Using /auth/facebook gives a 404 from vue-router [\#643](https://github.com/feathersjs/authentication/issues/643) -- Crash after upgrade to feathersjs v3 [\#642](https://github.com/feathersjs/authentication/issues/642) -- SameSite cookie option [\#640](https://github.com/feathersjs/authentication/issues/640) -- context.params.user is empty object [\#635](https://github.com/feathersjs/authentication/issues/635) -- Token is undefined for authenticated user [\#500](https://github.com/feathersjs/authentication/issues/500) -- 1.x: logout timers need to be moved [\#467](https://github.com/feathersjs/authentication/issues/467) - -**Merged pull requests:** - -- Merge auk to master [\#653](https://github.com/feathersjs/authentication/pull/653) ([wnxhaja](https://github.com/wnxhaja)) -- Update ws to the latest version 🚀 [\#645](https://github.com/feathersjs/authentication/pull/645) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update sinon-chai to the latest version 🚀 [\#644](https://github.com/feathersjs/authentication/pull/644) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v2.1.2](https://github.com/feathersjs/authentication/tree/v2.1.2) (2018-02-14) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v2.1.1...v2.1.2) - -**Fixed bugs:** - -- hook failed with auth & sync [\#540](https://github.com/feathersjs/authentication/issues/540) -- JWT Cookie [\#389](https://github.com/feathersjs/authentication/issues/389) - -**Closed issues:** - -- forgot password [\#638](https://github.com/feathersjs/authentication/issues/638) -- registered many authentication services [\#634](https://github.com/feathersjs/authentication/issues/634) -- TypeError: Cannot read property '\_strategy' of undefined [\#632](https://github.com/feathersjs/authentication/issues/632) -- How to change 5000ms timeout? [\#628](https://github.com/feathersjs/authentication/issues/628) -- cookie reused from server in SSR app [\#619](https://github.com/feathersjs/authentication/issues/619) -- Express middleware not setCookie [\#617](https://github.com/feathersjs/authentication/issues/617) -- Server to Server Authentication Question [\#612](https://github.com/feathersjs/authentication/issues/612) -- No way to share token between socket-rest-express [\#607](https://github.com/feathersjs/authentication/issues/607) -- 404 when accessing route using customer authentication [\#579](https://github.com/feathersjs/authentication/issues/579) -- \[question\] is it possible to protect by role a create method? [\#564](https://github.com/feathersjs/authentication/issues/564) -- Authentication with server-side rendering [\#560](https://github.com/feathersjs/authentication/issues/560) -- Problem authenticating using REST middleware [\#495](https://github.com/feathersjs/authentication/issues/495) -- A supposed way to auth requests from SSR to Feathers API [\#469](https://github.com/feathersjs/authentication/issues/469) -- rename `app.authenticate\(\)` to `app.\_authenticate\(\)` [\#468](https://github.com/feathersjs/authentication/issues/468) - -**Merged pull requests:** - -- Delete slack link [\#637](https://github.com/feathersjs/authentication/pull/637) ([vodniciarv](https://github.com/vodniciarv)) -- Update @feathersjs/authentication-jwt to the latest version 🚀 [\#631](https://github.com/feathersjs/authentication/pull/631) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update mocha to the latest version 🚀 [\#629](https://github.com/feathersjs/authentication/pull/629) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update ws to the latest version 🚀 [\#625](https://github.com/feathersjs/authentication/pull/625) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Options merged [\#611](https://github.com/feathersjs/authentication/pull/611) ([Makingweb](https://github.com/Makingweb)) - -## [v2.1.1](https://github.com/feathersjs/authentication/tree/v2.1.1) (2018-01-03) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v2.1.0...v2.1.1) - -**Closed issues:** - -- Deleted user successfully signs in using JWT [\#615](https://github.com/feathersjs/authentication/issues/615) -- Feathers.authenticate gives window undefined \(server-rendered\) [\#573](https://github.com/feathersjs/authentication/issues/573) -- Be careful with discard\('password'\) in user [\#434](https://github.com/feathersjs/authentication/issues/434) - -**Merged pull requests:** - -- Update readme to correspond with latest release [\#621](https://github.com/feathersjs/authentication/pull/621) ([daffl](https://github.com/daffl)) -- Update semistandard to the latest version 🚀 [\#620](https://github.com/feathersjs/authentication/pull/620) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update mongodb to the latest version 🚀 [\#618](https://github.com/feathersjs/authentication/pull/618) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v2.1.0](https://github.com/feathersjs/authentication/tree/v2.1.0) (2017-12-06) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v2.0.1...v2.1.0) - -**Closed issues:** - -- Method "Remove" from Authentication Service gives Internal Server Error when using JWT Authentication with Cookies. [\#606](https://github.com/feathersjs/authentication/issues/606) -- Anonymous Authentication fails over Socket.io [\#457](https://github.com/feathersjs/authentication/issues/457) - -**Merged pull requests:** - -- Always prevent publishing of authentication events [\#614](https://github.com/feathersjs/authentication/pull/614) ([daffl](https://github.com/daffl)) -- Update feathers-memory to the latest version 🚀 [\#613](https://github.com/feathersjs/authentication/pull/613) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v2.0.1](https://github.com/feathersjs/authentication/tree/v2.0.1) (2017-11-16) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v2.0.0...v2.0.1) - -**Merged pull requests:** - -- Add default export for better ES module \(TypeScript\) compatibility [\#605](https://github.com/feathersjs/authentication/pull/605) ([daffl](https://github.com/daffl)) - -## [v2.0.0](https://github.com/feathersjs/authentication/tree/v2.0.0) (2017-11-09) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.3.1...v2.0.0) - -**Closed issues:** - -- is there a way to detect if the token used is correct or not ? [\#601](https://github.com/feathersjs/authentication/issues/601) -- option for non-JWT based session [\#597](https://github.com/feathersjs/authentication/issues/597) - -**Merged pull requests:** - -- Update nsp to the latest version 🚀 [\#603](https://github.com/feathersjs/authentication/pull/603) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.3.1](https://github.com/feathersjs/authentication/tree/v1.3.1) (2017-11-03) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.4.1...v1.3.1) - -**Merged pull requests:** - -- Only set the JWT UUID if it is not already set [\#600](https://github.com/feathersjs/authentication/pull/600) ([daffl](https://github.com/daffl)) - -## [v1.4.1](https://github.com/feathersjs/authentication/tree/v1.4.1) (2017-11-01) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.4.0...v1.4.1) - -**Merged pull requests:** - -- Update dependencies for release [\#598](https://github.com/feathersjs/authentication/pull/598) ([daffl](https://github.com/daffl)) -- Finalize v3 dependency updates [\#596](https://github.com/feathersjs/authentication/pull/596) ([daffl](https://github.com/daffl)) -- Update Codeclimate coverage token [\#595](https://github.com/feathersjs/authentication/pull/595) ([daffl](https://github.com/daffl)) - -## [v1.4.0](https://github.com/feathersjs/authentication/tree/v1.4.0) (2017-10-25) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.3.0...v1.4.0) - -**Closed issues:** - -- An in-range update of socket.io-client is breaking the build 🚨 [\#588](https://github.com/feathersjs/authentication/issues/588) -- An in-range update of feathers-hooks is breaking the build 🚨 [\#587](https://github.com/feathersjs/authentication/issues/587) - -**Merged pull requests:** - -- Move to npm scope [\#594](https://github.com/feathersjs/authentication/pull/594) ([daffl](https://github.com/daffl)) -- Update to Feathers v3 \(Buzzard\) [\#592](https://github.com/feathersjs/authentication/pull/592) ([daffl](https://github.com/daffl)) -- Update to new plugin infrastructure [\#591](https://github.com/feathersjs/authentication/pull/591) ([daffl](https://github.com/daffl)) - -## [v1.3.0](https://github.com/feathersjs/authentication/tree/v1.3.0) (2017-10-24) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.7.13...v1.3.0) - -**Merged pull requests:** - -- updating the codeclimate setup [\#589](https://github.com/feathersjs/authentication/pull/589) ([ekryski](https://github.com/ekryski)) - -## [v0.7.13](https://github.com/feathersjs/authentication/tree/v0.7.13) (2017-10-23) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.2.7...v0.7.13) - -**Closed issues:** - -- Error authenticating! Error: Token provided to verifyJWT is missing or not a string ? [\#584](https://github.com/feathersjs/authentication/issues/584) -- Visual Studio Code Debug no authentication [\#583](https://github.com/feathersjs/authentication/issues/583) -- \[Feature Request\] Cloud DB's [\#581](https://github.com/feathersjs/authentication/issues/581) -- Request doesn't contain any headers when user service requested [\#578](https://github.com/feathersjs/authentication/issues/578) -- No way to pass Options to auth.express.authenticate. Needed for Google API refreshToken [\#576](https://github.com/feathersjs/authentication/issues/576) -- /auth/google 404 Not Found [\#574](https://github.com/feathersjs/authentication/issues/574) -- unique email not working while create [\#572](https://github.com/feathersjs/authentication/issues/572) -- authentication service not return token jwt [\#571](https://github.com/feathersjs/authentication/issues/571) -- typo in jwt default options [\#570](https://github.com/feathersjs/authentication/issues/570) -- Generate new app, Google-only auth, throws error [\#568](https://github.com/feathersjs/authentication/issues/568) -- An in-range update of feathers is breaking the build 🚨 [\#565](https://github.com/feathersjs/authentication/issues/565) -- Documentation not understanding [\#563](https://github.com/feathersjs/authentication/issues/563) -- Checking hook.params.headers.authorization [\#552](https://github.com/feathersjs/authentication/issues/552) -- Ability to send token as part of URL [\#546](https://github.com/feathersjs/authentication/issues/546) -- Anonymous Authentication [\#544](https://github.com/feathersjs/authentication/issues/544) -- Quote Error [\#519](https://github.com/feathersjs/authentication/issues/519) -- \[example\] CustomStrategy using passport-custom [\#516](https://github.com/feathersjs/authentication/issues/516) -- \[Epic\] Auth 2.0.0 [\#513](https://github.com/feathersjs/authentication/issues/513) -- ID set to null - Unable to delete with customer ID field. [\#422](https://github.com/feathersjs/authentication/issues/422) -- Prefixing socket events [\#418](https://github.com/feathersjs/authentication/issues/418) -- Passwordless auth [\#409](https://github.com/feathersjs/authentication/issues/409) -- How to authenticate the application client? not only the users [\#405](https://github.com/feathersjs/authentication/issues/405) -- Multi-factor Local Auth [\#5](https://github.com/feathersjs/authentication/issues/5) - -**Merged pull requests:** - -- Features/typescript fix [\#585](https://github.com/feathersjs/authentication/pull/585) ([TimMensch](https://github.com/TimMensch)) -- Update mocha to the latest version 🚀 [\#582](https://github.com/feathersjs/authentication/pull/582) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update sinon to the latest version 🚀 [\#580](https://github.com/feathersjs/authentication/pull/580) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update jsonwebtoken to the latest version 🚀 [\#567](https://github.com/feathersjs/authentication/pull/567) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Include Babel Polyfill for Node 4 [\#566](https://github.com/feathersjs/authentication/pull/566) ([daffl](https://github.com/daffl)) -- Update passport to the latest version 🚀 [\#558](https://github.com/feathersjs/authentication/pull/558) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Revert "Make feathers-authentication match security documents" [\#556](https://github.com/feathersjs/authentication/pull/556) ([ekryski](https://github.com/ekryski)) -- Update debug to the latest version 🚀 [\#555](https://github.com/feathersjs/authentication/pull/555) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Make feathers-authentication match security documents [\#554](https://github.com/feathersjs/authentication/pull/554) ([micaksica2](https://github.com/micaksica2)) -- Update sinon to the latest version 🚀 [\#551](https://github.com/feathersjs/authentication/pull/551) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update ws to the latest version 🚀 [\#549](https://github.com/feathersjs/authentication/pull/549) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update chai to the latest version 🚀 [\#543](https://github.com/feathersjs/authentication/pull/543) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- adding a default jwt uuid. Refs \#513 [\#539](https://github.com/feathersjs/authentication/pull/539) ([ekryski](https://github.com/ekryski)) -- Refresh token must have a user ID [\#419](https://github.com/feathersjs/authentication/pull/419) ([francisco-sanchez-molina](https://github.com/francisco-sanchez-molina)) - -## [v1.2.7](https://github.com/feathersjs/authentication/tree/v1.2.7) (2017-07-11) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.2.6...v1.2.7) - -**Closed issues:** - -- Connection without password [\#541](https://github.com/feathersjs/authentication/issues/541) -- email in lower case ? [\#538](https://github.com/feathersjs/authentication/issues/538) -- Im unable to ping feathers server from react native. [\#537](https://github.com/feathersjs/authentication/issues/537) -- whats the official way to open cors in feather ? [\#536](https://github.com/feathersjs/authentication/issues/536) -- Error options.service does not exist after initial auth setup [\#535](https://github.com/feathersjs/authentication/issues/535) -- LogoutTimer not being cleared correctly [\#532](https://github.com/feathersjs/authentication/issues/532) -- logoutTimer causing early logouts [\#404](https://github.com/feathersjs/authentication/issues/404) - -**Merged pull requests:** - -- fixed meta undefined error [\#542](https://github.com/feathersjs/authentication/pull/542) ([markacola](https://github.com/markacola)) - -## [v1.2.6](https://github.com/feathersjs/authentication/tree/v1.2.6) (2017-06-22) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.2.5...v1.2.6) - -**Closed issues:** - -- OAuth 2 login for cordova [\#530](https://github.com/feathersjs/authentication/issues/530) - -**Merged pull requests:** - -- Change cleartimeout\(\) to lt.clearTimeout\(\) [\#534](https://github.com/feathersjs/authentication/pull/534) ([wnxhaja](https://github.com/wnxhaja)) -- Update feathers-authentication-local to the latest version 🚀 [\#533](https://github.com/feathersjs/authentication/pull/533) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.2.5](https://github.com/feathersjs/authentication/tree/v1.2.5) (2017-06-21) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.2.4...v1.2.5) - -**Closed issues:** - -- Cannot read property 'user' of undefined - lib\socket\update-entity.js:26:104 [\#529](https://github.com/feathersjs/authentication/issues/529) -- Provider is undefined when using restrictToRoles [\#525](https://github.com/feathersjs/authentication/issues/525) -- How to make a request to an Endpoint that requires authentication from nodejs? [\#523](https://github.com/feathersjs/authentication/issues/523) - -**Merged pull requests:** - -- fixes several issues with update-entity w/ test cases [\#531](https://github.com/feathersjs/authentication/pull/531) ([jerfowler](https://github.com/jerfowler)) - -## [v1.2.4](https://github.com/feathersjs/authentication/tree/v1.2.4) (2017-06-08) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.2.3...v1.2.4) - -**Fixed bugs:** - -- User \(Entity\) needs to be updated on the socket after authentication [\#293](https://github.com/feathersjs/authentication/issues/293) - -**Closed issues:** - -- Express Middleware local -\> jwt does not authorize on redirect [\#518](https://github.com/feathersjs/authentication/issues/518) -- Issue with feathers-authentication [\#512](https://github.com/feathersjs/authentication/issues/512) -- User Authentication Missing Credentials error \(and subsequent nav authorization\) [\#508](https://github.com/feathersjs/authentication/issues/508) -- passport log failure [\#505](https://github.com/feathersjs/authentication/issues/505) -- authenticate with a custom username field \(rather than email\) [\#502](https://github.com/feathersjs/authentication/issues/502) -- app.get\('auth'\) vs app.get\('authentication'\) [\#497](https://github.com/feathersjs/authentication/issues/497) -- Can't get success authorization with pure feathers server [\#491](https://github.com/feathersjs/authentication/issues/491) - -**Merged pull requests:** - -- Test and fix for authenticate event with invalid data [\#524](https://github.com/feathersjs/authentication/pull/524) ([daffl](https://github.com/daffl)) -- Remove hook.data.payload [\#522](https://github.com/feathersjs/authentication/pull/522) ([marshallswain](https://github.com/marshallswain)) -- Update socket entity [\#521](https://github.com/feathersjs/authentication/pull/521) ([marshallswain](https://github.com/marshallswain)) -- Made each option, optional [\#515](https://github.com/feathersjs/authentication/pull/515) ([cranesandcaff](https://github.com/cranesandcaff)) -- Add feathers-authentication-hooks in readme [\#510](https://github.com/feathersjs/authentication/pull/510) ([bertho-zero](https://github.com/bertho-zero)) -- Update ms to the latest version 🚀 [\#509](https://github.com/feathersjs/authentication/pull/509) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Fix default authentication config keys [\#506](https://github.com/feathersjs/authentication/pull/506) ([ekryski](https://github.com/ekryski)) - -## [v1.2.3](https://github.com/feathersjs/authentication/tree/v1.2.3) (2017-05-10) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.2.2...v1.2.3) - -**Closed issues:** - -- Validating custom express routes [\#498](https://github.com/feathersjs/authentication/issues/498) -- Payload won't include userId when logging in with stored localStorage token [\#496](https://github.com/feathersjs/authentication/issues/496) -- How to send oauth token authentication to another client server [\#493](https://github.com/feathersjs/authentication/issues/493) -- Unhandled Promise Rejection error. [\#489](https://github.com/feathersjs/authentication/issues/489) -- No Auth token on authentication resource [\#488](https://github.com/feathersjs/authentication/issues/488) -- How to verify JWT in feathers issued by another feathers instance ? [\#484](https://github.com/feathersjs/authentication/issues/484) -- hook.params.user [\#483](https://github.com/feathersjs/authentication/issues/483) -- Overriding JWT's expiresIn with a value more than 20d prevents users from signing in [\#458](https://github.com/feathersjs/authentication/issues/458) - -**Merged pull requests:** - -- Update feathers-socketio to the latest version 🚀 [\#503](https://github.com/feathersjs/authentication/pull/503) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update socket.io-client to the latest version 🚀 [\#501](https://github.com/feathersjs/authentication/pull/501) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Fix issue with very large token timeout. [\#499](https://github.com/feathersjs/authentication/pull/499) ([asdacap](https://github.com/asdacap)) -- Typo [\#492](https://github.com/feathersjs/authentication/pull/492) ([wdmtech](https://github.com/wdmtech)) -- Update migrating.md [\#490](https://github.com/feathersjs/authentication/pull/490) ([MichaelErmer](https://github.com/MichaelErmer)) -- Update semistandard to the latest version 🚀 [\#487](https://github.com/feathersjs/authentication/pull/487) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update feathers-hooks to the latest version 🚀 [\#485](https://github.com/feathersjs/authentication/pull/485) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update dependencies to enable Greenkeeper 🌴 [\#482](https://github.com/feathersjs/authentication/pull/482) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.2.2](https://github.com/feathersjs/authentication/tree/v1.2.2) (2017-04-12) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.2.1...v1.2.2) - -**Fixed bugs:** - -- accessToken not being used when provided by client over socketio [\#400](https://github.com/feathersjs/authentication/issues/400) - -**Closed issues:** - -- Incompatible old client dependency [\#479](https://github.com/feathersjs/authentication/issues/479) -- Using feathers-authentication-client for an existing API? [\#478](https://github.com/feathersjs/authentication/issues/478) -- app.authenticate error : UnhandledPromiseRejectionWarning: Unhandled promise rejection \(rejection id: 2\): \* Error \* [\#476](https://github.com/feathersjs/authentication/issues/476) -- Make `socket.feathers` data available in authentication hooks [\#475](https://github.com/feathersjs/authentication/issues/475) -- Allow the authenticate hook to be called with no parameters [\#473](https://github.com/feathersjs/authentication/issues/473) -- Authenticate : How to return more infos ? [\#471](https://github.com/feathersjs/authentication/issues/471) - -**Merged pull requests:** - -- Use latest version of feathers-authentication-client [\#480](https://github.com/feathersjs/authentication/pull/480) ([daffl](https://github.com/daffl)) -- Resolves \#475 - Socket params are made available to authentication hooks [\#477](https://github.com/feathersjs/authentication/pull/477) ([thomas-p-wilson](https://github.com/thomas-p-wilson)) - -## [v1.2.1](https://github.com/feathersjs/authentication/tree/v1.2.1) (2017-04-07) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.2.0...v1.2.1) - -**Fixed bugs:** - -- failureRedirect is never used when using with oauth2 [\#387](https://github.com/feathersjs/authentication/issues/387) - -**Closed issues:** - -- OAuth guides [\#470](https://github.com/feathersjs/authentication/issues/470) -- app.authenticate not working [\#466](https://github.com/feathersjs/authentication/issues/466) -- how can I logout using local authentication? [\#465](https://github.com/feathersjs/authentication/issues/465) -- How to do Socket.io Authentication [\#462](https://github.com/feathersjs/authentication/issues/462) -- Add event filtering by default \(socket.io\) [\#460](https://github.com/feathersjs/authentication/issues/460) -- Add ability to control if socket is marked as authenticated. [\#448](https://github.com/feathersjs/authentication/issues/448) -- Auth redirect issue [\#425](https://github.com/feathersjs/authentication/issues/425) -- E-mail verification step can be bypassed using Postman or Curl [\#391](https://github.com/feathersjs/authentication/issues/391) -- Example app [\#386](https://github.com/feathersjs/authentication/issues/386) - -**Merged pull requests:** - -- Allow the cookie to be set if action is not `remove` [\#474](https://github.com/feathersjs/authentication/pull/474) ([marshallswain](https://github.com/marshallswain)) - -## [v1.2.0](https://github.com/feathersjs/authentication/tree/v1.2.0) (2017-03-23) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.1.1...v1.2.0) - -**Fixed bugs:** - -- 1.0 authentication service hooks don't run when client uses feathers-socketio [\#455](https://github.com/feathersjs/authentication/issues/455) -- `hook.params.provider` is not set when calling `client.authenticate\(\)` [\#432](https://github.com/feathersjs/authentication/issues/432) -- remove method failed with JsonWebTokenError: invalid token [\#388](https://github.com/feathersjs/authentication/issues/388) - -**Closed issues:** - -- Token creation has side effect [\#454](https://github.com/feathersjs/authentication/issues/454) -- Question: When is userId set? [\#453](https://github.com/feathersjs/authentication/issues/453) -- How to authenticate SPA? More precisely how does the redirect works? [\#451](https://github.com/feathersjs/authentication/issues/451) -- POST to auth/facebook for FacebookTokenStrategy 404? [\#447](https://github.com/feathersjs/authentication/issues/447) -- feathers-authentication 1.1.1 `No auth token` [\#445](https://github.com/feathersjs/authentication/issues/445) -- Another readme incorrect and maybe docs to [\#441](https://github.com/feathersjs/authentication/issues/441) -- Readme incorrect and maybe docs to [\#440](https://github.com/feathersjs/authentication/issues/440) -- npm version issue? [\#439](https://github.com/feathersjs/authentication/issues/439) -- setCookie express middleware only works inside hooks [\#438](https://github.com/feathersjs/authentication/issues/438) -- createJWT throws 'secret must provided' [\#437](https://github.com/feathersjs/authentication/issues/437) -- Not useful error message on NotAuthenticated error [\#436](https://github.com/feathersjs/authentication/issues/436) -- Passwordfeld in auth.local does not work as expected [\#435](https://github.com/feathersjs/authentication/issues/435) -- Authentication via REST returns token without finding user on db [\#430](https://github.com/feathersjs/authentication/issues/430) - -**Merged pull requests:** - -- Filter out all events [\#461](https://github.com/feathersjs/authentication/pull/461) ([daffl](https://github.com/daffl)) -- Fix socket auth [\#459](https://github.com/feathersjs/authentication/pull/459) ([marshallswain](https://github.com/marshallswain)) -- Fix \#454 Token create has side effect [\#456](https://github.com/feathersjs/authentication/pull/456) ([whollacsek](https://github.com/whollacsek)) -- Windows compatible version of the original compile comand with public folder support. [\#442](https://github.com/feathersjs/authentication/pull/442) ([appurist](https://github.com/appurist)) -- Add client.js back for consistency [\#433](https://github.com/feathersjs/authentication/pull/433) ([daffl](https://github.com/daffl)) -- add string to authenticate \(typescript\) [\#431](https://github.com/feathersjs/authentication/pull/431) ([superbarne](https://github.com/superbarne)) -- Add support for Bearer scheme in remove method [\#403](https://github.com/feathersjs/authentication/pull/403) ([boybundit](https://github.com/boybundit)) - -## [v1.1.1](https://github.com/feathersjs/authentication/tree/v1.1.1) (2017-03-02) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.1.0...v1.1.1) - -**Closed issues:** - -- Authentication over socket.io never answers [\#428](https://github.com/feathersjs/authentication/issues/428) - -**Merged pull requests:** - -- Remove lots of hardcoded values for config, and adds the `authenticate` hook [\#427](https://github.com/feathersjs/authentication/pull/427) ([myknbani](https://github.com/myknbani)) - -## [v1.1.0](https://github.com/feathersjs/authentication/tree/v1.1.0) (2017-03-01) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.0.2...v1.1.0) - -**Fixed bugs:** - -- Mongo update error after logging into Facebook [\#244](https://github.com/feathersjs/authentication/issues/244) - -**Closed issues:** - -- Feature Request: Anonymous Authentication Strategy Support [\#423](https://github.com/feathersjs/authentication/issues/423) -- Error is not thrown if token that is provided is invalid [\#421](https://github.com/feathersjs/authentication/issues/421) -- Request body 'token' parameter disappears [\#420](https://github.com/feathersjs/authentication/issues/420) -- Auth2 issue getting JWT token from server when different ports [\#416](https://github.com/feathersjs/authentication/issues/416) -- Cookie-based authentication with XHR is not possible [\#413](https://github.com/feathersjs/authentication/issues/413) -- JWT Authentication setup failing [\#411](https://github.com/feathersjs/authentication/issues/411) -- how to disable service for external usage in version 1.0 [\#410](https://github.com/feathersjs/authentication/issues/410) -- v1.0 is removed from npm? [\#408](https://github.com/feathersjs/authentication/issues/408) -- Make JWT data more configurable [\#407](https://github.com/feathersjs/authentication/issues/407) -- Possible typo [\#406](https://github.com/feathersjs/authentication/issues/406) -- Authentication with an existing database with existing hashed \(md5\) passwords [\#398](https://github.com/feathersjs/authentication/issues/398) -- can modify selected fields only [\#397](https://github.com/feathersjs/authentication/issues/397) -- \[Discussion\] Migrating to 1.0 - hook changes [\#396](https://github.com/feathersjs/authentication/issues/396) -- feathers-authentication 'local' strategy requires token? [\#394](https://github.com/feathersjs/authentication/issues/394) -- JWT for local auth. [\#390](https://github.com/feathersjs/authentication/issues/390) -- Feathers 'Twitter API' style [\#385](https://github.com/feathersjs/authentication/issues/385) -- Missing code in example app [\#383](https://github.com/feathersjs/authentication/issues/383) -- feathers-authentication errors with any view error, and redirects to /auth/failure [\#381](https://github.com/feathersjs/authentication/issues/381) -- what does app.service\('authentication'\).remove\(...\) mean? [\#379](https://github.com/feathersjs/authentication/issues/379) -- Rest Endpoints. [\#375](https://github.com/feathersjs/authentication/issues/375) -- cordova google-plus signUp with id_token [\#373](https://github.com/feathersjs/authentication/issues/373) -- How to reconnect socket with cookie after page refresh ? [\#372](https://github.com/feathersjs/authentication/issues/372) -- Error: Could not find stored JWT and no authentication strategy was given [\#367](https://github.com/feathersjs/authentication/issues/367) -- "No auth token" using authenticate strategy: 'jwt' \(v.1.0.0-beta-2\) [\#366](https://github.com/feathersjs/authentication/issues/366) -- Navigating to /auth/\twice redirects to /auth/failed [\#344](https://github.com/feathersjs/authentication/issues/344) -- Meteor auth migration guide [\#334](https://github.com/feathersjs/authentication/issues/334) -- Auth 1.0 [\#330](https://github.com/feathersjs/authentication/issues/330) -- RSA token secret [\#309](https://github.com/feathersjs/authentication/issues/309) -- Add option to use bcrypt [\#300](https://github.com/feathersjs/authentication/issues/300) -- Better example of how to change hashing algorithm? \[Question\] [\#289](https://github.com/feathersjs/authentication/issues/289) -- issuer doesn't work [\#284](https://github.com/feathersjs/authentication/issues/284) -- passport auth question [\#274](https://github.com/feathersjs/authentication/issues/274) -- Add support for authenticating active users only [\#259](https://github.com/feathersjs/authentication/issues/259) -- 404 response from populateUser\(\) hook [\#258](https://github.com/feathersjs/authentication/issues/258) -- Responses hang when token.secret is undefined for local authentication [\#249](https://github.com/feathersjs/authentication/issues/249) -- Authentication without password [\#246](https://github.com/feathersjs/authentication/issues/246) -- Fix successRedirect to not override cookie path [\#243](https://github.com/feathersjs/authentication/issues/243) -- Deprecate verifyToken and populateUser hooks in favour of middleware [\#227](https://github.com/feathersjs/authentication/issues/227) -- Authenticating and creating [\#100](https://github.com/feathersjs/authentication/issues/100) -- Add a password service [\#83](https://github.com/feathersjs/authentication/issues/83) - -**Merged pull requests:** - -- Fix JWT options typo [\#415](https://github.com/feathersjs/authentication/pull/415) ([daffl](https://github.com/daffl)) -- Prevent setCookie from mutating authOptions [\#414](https://github.com/feathersjs/authentication/pull/414) ([adrien-k](https://github.com/adrien-k)) -- Typescript Definitions [\#412](https://github.com/feathersjs/authentication/pull/412) ([AbraaoAlves](https://github.com/AbraaoAlves)) -- Docs for migrating to auth.hooks.authenticate hook [\#399](https://github.com/feathersjs/authentication/pull/399) ([petermikitsh](https://github.com/petermikitsh)) -- Typo 'cookie.enable' should be 'cookie.enabled' [\#380](https://github.com/feathersjs/authentication/pull/380) ([whollacsek](https://github.com/whollacsek)) -- Docs: Equalize usage of feathers-authenticate [\#378](https://github.com/feathersjs/authentication/pull/378) ([eikaramba](https://github.com/eikaramba)) - -## [v1.0.2](https://github.com/feathersjs/authentication/tree/v1.0.2) (2016-12-14) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.0.1...v1.0.2) - -**Closed issues:** - -- successRedirect not redirecting [\#364](https://github.com/feathersjs/authentication/issues/364) - -## [v1.0.1](https://github.com/feathersjs/authentication/tree/v1.0.1) (2016-12-14) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.0.0...v1.0.1) - -## [v1.0.0](https://github.com/feathersjs/authentication/tree/v1.0.0) (2016-12-14) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.7.12...v1.0.0) - -**Fixed bugs:** - -- restrictToOwner does not support multi patch, update and remove [\#228](https://github.com/feathersjs/authentication/issues/228) - -**Closed issues:** - -- auth.express.authenticate got undefined [\#363](https://github.com/feathersjs/authentication/issues/363) -- Non-standard header structure [\#361](https://github.com/feathersjs/authentication/issues/361) -- localEndpoint without local strategy [\#359](https://github.com/feathersjs/authentication/issues/359) -- Using custom passport strategies [\#356](https://github.com/feathersjs/authentication/issues/356) -- Client-side app.on\('login'\) [\#355](https://github.com/feathersjs/authentication/issues/355) -- Payload limiting on `app.get\('user'\)`? [\#354](https://github.com/feathersjs/authentication/issues/354) -- Authentication token is missing [\#352](https://github.com/feathersjs/authentication/issues/352) -- \[1.0\] The entity on the socket should pull from the strategy options. [\#348](https://github.com/feathersjs/authentication/issues/348) -- \[1.0\] Only the first failure is returned on auth failure when chaining multiple strategies [\#346](https://github.com/feathersjs/authentication/issues/346) -- Build 0.7.11 does not contain current code on NPMJS [\#342](https://github.com/feathersjs/authentication/issues/342) -- feathers-authentication branch 0.8 did not work with payload \(tested on socket\) [\#264](https://github.com/feathersjs/authentication/issues/264) -- Add method for updating JWT [\#260](https://github.com/feathersjs/authentication/issues/260) -- 1.0 architecture considerations [\#226](https://github.com/feathersjs/authentication/issues/226) -- Features/RFC [\#213](https://github.com/feathersjs/authentication/issues/213) -- Support access_token based OAuth2 providers [\#169](https://github.com/feathersjs/authentication/issues/169) -- Support openID [\#154](https://github.com/feathersjs/authentication/issues/154) -- Disable cookie by default if not using OAuth [\#152](https://github.com/feathersjs/authentication/issues/152) -- Add token service tests [\#144](https://github.com/feathersjs/authentication/issues/144) -- Add local service tests [\#143](https://github.com/feathersjs/authentication/issues/143) -- Add OAuth2 service tests [\#142](https://github.com/feathersjs/authentication/issues/142) -- Add OAuth2 integration tests [\#141](https://github.com/feathersjs/authentication/issues/141) -- Add integration tests for custom redirects [\#125](https://github.com/feathersjs/authentication/issues/125) -- Support mobile authentication via OAuth1 [\#47](https://github.com/feathersjs/authentication/issues/47) -- Support OAuth1 [\#42](https://github.com/feathersjs/authentication/issues/42) -- Password-less Local Auth with Email / SMS [\#7](https://github.com/feathersjs/authentication/issues/7) - -**Merged pull requests:** - -- migrating to semistandard [\#371](https://github.com/feathersjs/authentication/pull/371) ([ekryski](https://github.com/ekryski)) -- Logout should always give a response. [\#369](https://github.com/feathersjs/authentication/pull/369) ([marshallswain](https://github.com/marshallswain)) -- Clarify that the authenticate hook is required. [\#368](https://github.com/feathersjs/authentication/pull/368) ([marshallswain](https://github.com/marshallswain)) -- Fix README example [\#365](https://github.com/feathersjs/authentication/pull/365) ([saiberz](https://github.com/saiberz)) -- Remove additional deprecation notice [\#362](https://github.com/feathersjs/authentication/pull/362) ([porsager](https://github.com/porsager)) -- fix typo [\#360](https://github.com/feathersjs/authentication/pull/360) ([osenvosem](https://github.com/osenvosem)) -- Update feathers-primus to version 2.0.0 🚀 [\#358](https://github.com/feathersjs/authentication/pull/358) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Create .codeclimate.yml [\#357](https://github.com/feathersjs/authentication/pull/357) ([larkinscott](https://github.com/larkinscott)) -- fixing redirect middleware [\#353](https://github.com/feathersjs/authentication/pull/353) ([ekryski](https://github.com/ekryski)) -- Remove useless quotes [\#351](https://github.com/feathersjs/authentication/pull/351) ([bertho-zero](https://github.com/bertho-zero)) -- A bunch of bug fixes [\#349](https://github.com/feathersjs/authentication/pull/349) ([ekryski](https://github.com/ekryski)) -- fix\(docs/new-features\): syntax highlighting [\#347](https://github.com/feathersjs/authentication/pull/347) ([justingreenberg](https://github.com/justingreenberg)) -- Update superagent to version 3.0.0 🚀 [\#345](https://github.com/feathersjs/authentication/pull/345) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-memory to version 1.0.0 🚀 [\#343](https://github.com/feathersjs/authentication/pull/343) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- 1.0 Pre-release [\#336](https://github.com/feathersjs/authentication/pull/336) ([ekryski](https://github.com/ekryski)) - -## [v0.7.12](https://github.com/feathersjs/authentication/tree/v0.7.12) (2016-11-11) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.7.11...v0.7.12) - -**Closed issues:** - -- App.authenticate uses wrong `this` reference [\#341](https://github.com/feathersjs/authentication/issues/341) -- Getting more done in GitHub with ZenHub [\#331](https://github.com/feathersjs/authentication/issues/331) -- Need help to use feathers authentication storage in vue vuex [\#329](https://github.com/feathersjs/authentication/issues/329) -- How to get user id in hooks? [\#322](https://github.com/feathersjs/authentication/issues/322) -- I checked out my new feathersjs app in another machine, created a new user but I can't log in! [\#320](https://github.com/feathersjs/authentication/issues/320) -- restrict-to-owner throws error when user id is 0 [\#319](https://github.com/feathersjs/authentication/issues/319) -- Not providing sufficient details for an auth provider should not be an error. [\#318](https://github.com/feathersjs/authentication/issues/318) -- \[Question\] Is there a way to verify a user with password? [\#316](https://github.com/feathersjs/authentication/issues/316) -- 0.8.0 beta 1 bug - this is not defined [\#315](https://github.com/feathersjs/authentication/issues/315) -- Client: Document getJWT & verifyJWT [\#313](https://github.com/feathersjs/authentication/issues/313) -- Socket client should automatically auth on reconnect [\#310](https://github.com/feathersjs/authentication/issues/310) -- app.get\('token'\) doesn't work after a browser refresh. [\#303](https://github.com/feathersjs/authentication/issues/303) -- Problem issuing multiple jwt's for the same user [\#302](https://github.com/feathersjs/authentication/issues/302) -- restrict-to-owner does not allow Service.remove\(null\) from internal systems [\#301](https://github.com/feathersjs/authentication/issues/301) -- How to migrate from restrictToOwner to checkPermissions [\#299](https://github.com/feathersjs/authentication/issues/299) -- "username" cannot be used as local strategy usernameField [\#294](https://github.com/feathersjs/authentication/issues/294) -- Bad Hook API Design: Hooks are inconsistent and impure functions [\#288](https://github.com/feathersjs/authentication/issues/288) -- Mutliple 'user' models for authentication [\#282](https://github.com/feathersjs/authentication/issues/282) -- Client should ensure socket.io upgrade is complete before authenticating [\#275](https://github.com/feathersjs/authentication/issues/275) -- JWT is not sent after socket reconnection [\#272](https://github.com/feathersjs/authentication/issues/272) -- 401 after service is moved/refactored [\#270](https://github.com/feathersjs/authentication/issues/270) -- Client side auth should subscribe to user updates so that app.get\('user'\) is fresh [\#195](https://github.com/feathersjs/authentication/issues/195) -- Make oauth2 more general [\#179](https://github.com/feathersjs/authentication/issues/179) -- Add integration tests for custom service endpoints [\#145](https://github.com/feathersjs/authentication/issues/145) -- Create a `requireAuth` wrapper for `verifyToken`, `populateUser`, `restrictToAuth` [\#118](https://github.com/feathersjs/authentication/issues/118) - -**Merged pull requests:** - -- babel-core@6.18.2 breaks build 🚨 [\#339](https://github.com/feathersjs/authentication/pull/339) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- 👻😱 Node.js 0.10 is unmaintained 😱👻 [\#337](https://github.com/feathersjs/authentication/pull/337) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- restrictToOwner -Fix check for methodNotAllowed [\#335](https://github.com/feathersjs/authentication/pull/335) ([daffl](https://github.com/daffl)) -- Implement login and logout events for REST authentication [\#325](https://github.com/feathersjs/authentication/pull/325) ([daffl](https://github.com/daffl)) -- Socket.io authentication tests and login logout event [\#324](https://github.com/feathersjs/authentication/pull/324) ([daffl](https://github.com/daffl)) -- Reorganization [\#321](https://github.com/feathersjs/authentication/pull/321) ([ekryski](https://github.com/ekryski)) -- client: use Authentication class, make `getJWT` and `verifyJWT` async [\#317](https://github.com/feathersjs/authentication/pull/317) ([marshallswain](https://github.com/marshallswain)) -- 0.8 client decode jwt [\#314](https://github.com/feathersjs/authentication/pull/314) ([marshallswain](https://github.com/marshallswain)) -- Store config at `app.config` [\#312](https://github.com/feathersjs/authentication/pull/312) ([marshallswain](https://github.com/marshallswain)) -- Cookies will match jwt expiry by default. [\#308](https://github.com/feathersjs/authentication/pull/308) ([marshallswain](https://github.com/marshallswain)) -- Remove permissions hooks and middleware [\#307](https://github.com/feathersjs/authentication/pull/307) ([daffl](https://github.com/daffl)) -- First cut for authentication middleware [\#305](https://github.com/feathersjs/authentication/pull/305) ([daffl](https://github.com/daffl)) -- 0.8 - OAuth fixes [\#304](https://github.com/feathersjs/authentication/pull/304) ([marshallswain](https://github.com/marshallswain)) - -## [v0.7.11](https://github.com/feathersjs/authentication/tree/v0.7.11) (2016-09-28) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.7.10...v0.7.11) - -**Closed issues:** - -- Unable to authenticate with passport-google-oauth20 [\#295](https://github.com/feathersjs/authentication/issues/295) -- "Unauthorized" Response with Hook Data [\#291](https://github.com/feathersjs/authentication/issues/291) -- hashPassword in patch [\#286](https://github.com/feathersjs/authentication/issues/286) -- Mobile App Facebook Login [\#276](https://github.com/feathersjs/authentication/issues/276) -- Socket user should update automatically [\#266](https://github.com/feathersjs/authentication/issues/266) -- Get user outside a service [\#261](https://github.com/feathersjs/authentication/issues/261) - -**Merged pull requests:** - -- hashPassword fall-through if there's no password [\#287](https://github.com/feathersjs/authentication/pull/287) ([marshallswain](https://github.com/marshallswain)) -- Update feathers-memory to version 0.8.0 🚀 [\#285](https://github.com/feathersjs/authentication/pull/285) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Allow multiple username fields for local auth [\#283](https://github.com/feathersjs/authentication/pull/283) ([sdbondi](https://github.com/sdbondi)) - -## [v0.7.10](https://github.com/feathersjs/authentication/tree/v0.7.10) (2016-08-31) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.7.9...v0.7.10) - -**Fixed bugs:** - -- restrictToOwner should not throw an error on mass deletions [\#175](https://github.com/feathersjs/authentication/issues/175) - -**Closed issues:** - -- Duplicate Email should be rejected by Default [\#281](https://github.com/feathersjs/authentication/issues/281) -- Auth0 & featherjs authorization only [\#277](https://github.com/feathersjs/authentication/issues/277) -- Cannot read property 'scope' of undefined [\#273](https://github.com/feathersjs/authentication/issues/273) -- Socker.js | Custom successHandler [\#271](https://github.com/feathersjs/authentication/issues/271) -- Use feathers-socketio? and rest&socket share session maybe? [\#269](https://github.com/feathersjs/authentication/issues/269) -- Ability to invalidate old token/session when user login with another machine. [\#267](https://github.com/feathersjs/authentication/issues/267) -- 0.8 authentication before hooks - only ever getting a 401 Unauthorised [\#263](https://github.com/feathersjs/authentication/issues/263) -- REST Middleware breaks local auth [\#262](https://github.com/feathersjs/authentication/issues/262) -- 0.8: Token Service errors on token auth using client [\#254](https://github.com/feathersjs/authentication/issues/254) -- 0.8: Cookies, turning off feathers-session cookie also turns off feathers-jwt cookie. [\#253](https://github.com/feathersjs/authentication/issues/253) -- Any example of how to do refresh token? [\#248](https://github.com/feathersjs/authentication/issues/248) -- Custom Authentication Hooks [\#236](https://github.com/feathersjs/authentication/issues/236) -- Is there an Authenticated Event [\#235](https://github.com/feathersjs/authentication/issues/235) -- Error while using /auth/local [\#233](https://github.com/feathersjs/authentication/issues/233) -- Providing token to feathers.authentication doesn't work [\#230](https://github.com/feathersjs/authentication/issues/230) -- bundled hooks customize errors [\#215](https://github.com/feathersjs/authentication/issues/215) -- Hooks should support a callback for conditionally running [\#210](https://github.com/feathersjs/authentication/issues/210) -- restrictToRoles hook: More complex determination of "owner". [\#205](https://github.com/feathersjs/authentication/issues/205) -- verifyToken hook option to error [\#200](https://github.com/feathersjs/authentication/issues/200) -- Allow using restrictToOwner as an after hook [\#123](https://github.com/feathersjs/authentication/issues/123) - -**Merged pull requests:** - -- Manually supply an endpoint to the Client authenticate\(\) method [\#278](https://github.com/feathersjs/authentication/pull/278) ([mcnamee](https://github.com/mcnamee)) -- Update mocha to version 3.0.0 🚀 [\#257](https://github.com/feathersjs/authentication/pull/257) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Don’t mix options when signing tokens [\#255](https://github.com/feathersjs/authentication/pull/255) ([marshallswain](https://github.com/marshallswain)) -- Attempt to get token right away. [\#252](https://github.com/feathersjs/authentication/pull/252) ([marshallswain](https://github.com/marshallswain)) -- Update async to version 2.0.0 🚀 [\#240](https://github.com/feathersjs/authentication/pull/240) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Creates better way or returning data in a familiar format [\#234](https://github.com/feathersjs/authentication/pull/234) ([codingfriend1](https://github.com/codingfriend1)) -- Throws an error if restriction methods are used outside of a find or get hook [\#232](https://github.com/feathersjs/authentication/pull/232) ([codingfriend1](https://github.com/codingfriend1)) -- RestrictToOwner now takes an array [\#231](https://github.com/feathersjs/authentication/pull/231) ([sscaff1](https://github.com/sscaff1)) -- Adds ability to limit queries unless authenticated and authorized [\#229](https://github.com/feathersjs/authentication/pull/229) ([codingfriend1](https://github.com/codingfriend1)) - -## [v0.7.9](https://github.com/feathersjs/authentication/tree/v0.7.9) (2016-06-20) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.7.8...v0.7.9) - -**Fixed bugs:** - -- Calling logout should revoke/blacklist a JWT [\#133](https://github.com/feathersjs/authentication/issues/133) - -**Closed issues:** - -- Query email rather than oauth provider id on /auth/\ [\#223](https://github.com/feathersjs/authentication/issues/223) -- Cannot read property \'service\' of undefined [\#222](https://github.com/feathersjs/authentication/issues/222) - -**Merged pull requests:** - -- added support for hashing passwords when hook.data is an array [\#225](https://github.com/feathersjs/authentication/pull/225) ([eblin](https://github.com/eblin)) -- jwt ssl warning [\#214](https://github.com/feathersjs/authentication/pull/214) ([aboutlo](https://github.com/aboutlo)) - -## [v0.7.8](https://github.com/feathersjs/authentication/tree/v0.7.8) (2016-06-09) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.7.7...v0.7.8) - -**Closed issues:** - -- Feathers-authentication assumptions [\#220](https://github.com/feathersjs/authentication/issues/220) -- Server-side header option does not accept capital letters [\#218](https://github.com/feathersjs/authentication/issues/218) -- How to figure out why redirect to /auth/failure? [\#217](https://github.com/feathersjs/authentication/issues/217) -- Getting token via REST is not documented [\#216](https://github.com/feathersjs/authentication/issues/216) -- How to use Feathers Client to Authenticate Facebook/Instagram credentials [\#204](https://github.com/feathersjs/authentication/issues/204) -- Remove token from localstorage [\#203](https://github.com/feathersjs/authentication/issues/203) -- Check user password [\#193](https://github.com/feathersjs/authentication/issues/193) -- app.authenticate\(\): Warning: a promise was rejected with a non-error: \[object Object\] [\#191](https://github.com/feathersjs/authentication/issues/191) -- Authentication provider for Facebook Account Kit [\#189](https://github.com/feathersjs/authentication/issues/189) - -**Merged pull requests:** - -- Lowercase custom header [\#219](https://github.com/feathersjs/authentication/pull/219) ([mmwtsn](https://github.com/mmwtsn)) -- mocha@2.5.0 breaks build 🚨 [\#212](https://github.com/feathersjs/authentication/pull/212) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Small refactoring to simplify structure and remove code duplication [\#209](https://github.com/feathersjs/authentication/pull/209) ([daffl](https://github.com/daffl)) -- Use removeItem in the storage on logout [\#208](https://github.com/feathersjs/authentication/pull/208) ([daffl](https://github.com/daffl)) -- Misspelled in a comment [\#201](https://github.com/feathersjs/authentication/pull/201) ([tryy3](https://github.com/tryy3)) -- Update babel-plugin-add-module-exports to version 0.2.0 🚀 [\#199](https://github.com/feathersjs/authentication/pull/199) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v0.7.7](https://github.com/feathersjs/authentication/tree/v0.7.7) (2016-05-05) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.7.6...v0.7.7) - -**Fixed bugs:** - -- OAuth2 authentication callback failing due to missing property [\#196](https://github.com/feathersjs/authentication/issues/196) - -**Merged pull requests:** - -- properly handle optional `\_json` property [\#197](https://github.com/feathersjs/authentication/pull/197) ([nyaaao](https://github.com/nyaaao)) - -## [v0.7.6](https://github.com/feathersjs/authentication/tree/v0.7.6) (2016-05-03) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.7.5...v0.7.6) - -**Fixed bugs:** - -- Facebook Authentication should do a patch not an update. [\#174](https://github.com/feathersjs/authentication/issues/174) - -**Closed issues:** - -- Authenticated user [\#192](https://github.com/feathersjs/authentication/issues/192) -- REST token revoke [\#185](https://github.com/feathersjs/authentication/issues/185) -- TypeError: Cannot read property 'service' of undefined [\#173](https://github.com/feathersjs/authentication/issues/173) -- Optionally Include password in the params.query object passed to User.find\(\) [\#171](https://github.com/feathersjs/authentication/issues/171) -- Pass more to local authentication params [\#165](https://github.com/feathersjs/authentication/issues/165) -- Support custom authentication strategies [\#157](https://github.com/feathersjs/authentication/issues/157) - -**Merged pull requests:** - -- Allow manipulation of params before checking credentials [\#186](https://github.com/feathersjs/authentication/pull/186) ([saiichihashimoto](https://github.com/saiichihashimoto)) -- Update feathers to version 2.0.1 🚀 [\#184](https://github.com/feathersjs/authentication/pull/184) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- fix\(oauth2\): Use patch to update user in oauthCallback [\#183](https://github.com/feathersjs/authentication/pull/183) ([beevelop](https://github.com/beevelop)) - -## [v0.7.5](https://github.com/feathersjs/authentication/tree/v0.7.5) (2016-04-23) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.7.4...v0.7.5) - -**Fixed bugs:** - -- restrictToOwner and restrictToRoles have invalid type checking [\#172](https://github.com/feathersjs/authentication/issues/172) - -**Closed issues:** - -- user fails to signup with facebook if there is also local auth [\#168](https://github.com/feathersjs/authentication/issues/168) -- Unable to authenticate requests when using vanilla Socket.IO [\#166](https://github.com/feathersjs/authentication/issues/166) - -## [v0.7.4](https://github.com/feathersjs/authentication/tree/v0.7.4) (2016-04-18) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.7.3...v0.7.4) - -**Fixed bugs:** - -- restrictToOwner and restrictToRoles hooks don't work with nested models [\#163](https://github.com/feathersjs/authentication/issues/163) -- Change restrictToOwner error when a request does not contain ID [\#160](https://github.com/feathersjs/authentication/issues/160) - -**Closed issues:** - -- authenticate\(\) can leak sensetive user data via token service [\#162](https://github.com/feathersjs/authentication/issues/162) -- onBeforeLogin Hook [\#161](https://github.com/feathersjs/authentication/issues/161) - -**Merged pull requests:** - -- Hook fixes [\#164](https://github.com/feathersjs/authentication/pull/164) ([ekryski](https://github.com/ekryski)) - -## [v0.7.3](https://github.com/feathersjs/authentication/tree/v0.7.3) (2016-04-16) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.7.2...v0.7.3) - -## [v0.7.2](https://github.com/feathersjs/authentication/tree/v0.7.2) (2016-04-16) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.7.1...v0.7.2) - -**Closed issues:** - -- Auth doesn't work with non default local.userEndpoint [\#159](https://github.com/feathersjs/authentication/issues/159) -- Automatically add the hashPassword hook to local.userEndpoint [\#158](https://github.com/feathersjs/authentication/issues/158) -- Client authentication\(\) storage option not documented [\#155](https://github.com/feathersjs/authentication/issues/155) -- restrictToRoles availability inconsistency [\#153](https://github.com/feathersjs/authentication/issues/153) -- Does not populate user for other services [\#150](https://github.com/feathersjs/authentication/issues/150) - -**Merged pull requests:** - -- Steal Compatibility [\#156](https://github.com/feathersjs/authentication/pull/156) ([marshallswain](https://github.com/marshallswain)) - -## [v0.7.1](https://github.com/feathersjs/authentication/tree/v0.7.1) (2016-04-08) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.7.0...v0.7.1) - -**Closed issues:** - -- Documentation discrepancies [\#148](https://github.com/feathersjs/authentication/issues/148) -- bcrypt is hardcoded [\#146](https://github.com/feathersjs/authentication/issues/146) -- Update Docs, Guides, Examples for v0.7 [\#129](https://github.com/feathersjs/authentication/issues/129) -- populateUser: allow option to populate without db call. [\#92](https://github.com/feathersjs/authentication/issues/92) - -**Merged pull requests:** - -- Update feathers-memory to version 0.7.0 🚀 [\#149](https://github.com/feathersjs/authentication/pull/149) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- fix a typo [\#147](https://github.com/feathersjs/authentication/pull/147) ([chrjean](https://github.com/chrjean)) -- Fix copy paste typo in queryWithCurrentUser hook. [\#140](https://github.com/feathersjs/authentication/pull/140) ([juodumas](https://github.com/juodumas)) - -## [v0.7.0](https://github.com/feathersjs/authentication/tree/v0.7.0) (2016-03-30) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.6.0...v0.7.0) - -**Fixed bugs:** - -- logout should de-authenticate a socket [\#136](https://github.com/feathersjs/authentication/issues/136) -- \[Security\] JsonWebToken Lifecycle Concerns; Set HttpOnly = true in JWT cookie [\#132](https://github.com/feathersjs/authentication/issues/132) -- restrictToRoles hook needs to throw an error and not scope the query [\#128](https://github.com/feathersjs/authentication/issues/128) -- restrictToOwner hook needs to throw an error and not scope the query [\#127](https://github.com/feathersjs/authentication/issues/127) -- \[security\] Generated tokens are broadcast to all socket clients \(by default\) [\#126](https://github.com/feathersjs/authentication/issues/126) -- \[oAuth\] User profile should be updated every time they are authenticated [\#124](https://github.com/feathersjs/authentication/issues/124) -- Logout should clear the cookie [\#122](https://github.com/feathersjs/authentication/issues/122) -- Want the default success/fail routes, not the sendFile [\#121](https://github.com/feathersjs/authentication/issues/121) - -**Closed issues:** - -- Make all hooks optional if used internally [\#138](https://github.com/feathersjs/authentication/issues/138) -- Throw errors for deprecated hooks and update documentation [\#134](https://github.com/feathersjs/authentication/issues/134) -- v6.0.0: How can I return the user object along with the token ? [\#131](https://github.com/feathersjs/authentication/issues/131) -- user field not getting populated [\#119](https://github.com/feathersjs/authentication/issues/119) -- Move to bcryptjs [\#112](https://github.com/feathersjs/authentication/issues/112) -- Bundled hooks should pull from auth config to avoid having to pass duplicate props. [\#93](https://github.com/feathersjs/authentication/issues/93) -- Customize the JWT payload [\#78](https://github.com/feathersjs/authentication/issues/78) -- Needs a test for verifying that a custom tokenEndpoint works. [\#59](https://github.com/feathersjs/authentication/issues/59) -- Finish test coverage for existing features. [\#9](https://github.com/feathersjs/authentication/issues/9) - -**Merged pull requests:** - -- 0.7 Release [\#139](https://github.com/feathersjs/authentication/pull/139) ([ekryski](https://github.com/ekryski)) - -## [v0.6.0](https://github.com/feathersjs/authentication/tree/v0.6.0) (2016-03-24) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.5.1...v0.6.0) - -**Fixed bugs:** - -- Token encoding is not using the idField option. [\#107](https://github.com/feathersjs/authentication/issues/107) -- Logging out breaks in React Native [\#105](https://github.com/feathersjs/authentication/issues/105) -- Updating User Attached to Params in Client [\#102](https://github.com/feathersjs/authentication/issues/102) -- local auth should not redirect by default [\#89](https://github.com/feathersjs/authentication/issues/89) - -**Closed issues:** - -- Id of user can't be 0 for auth [\#116](https://github.com/feathersjs/authentication/issues/116) -- how to authenticate user in the socket.io? [\#111](https://github.com/feathersjs/authentication/issues/111) -- Wrong Status Error [\#110](https://github.com/feathersjs/authentication/issues/110) -- TypeError: Cannot read property 'service' of undefined \(continued\) [\#108](https://github.com/feathersjs/authentication/issues/108) -- `idField` breaks from `tokenService.create\(\)` to `populateUser\(\)` after hook [\#103](https://github.com/feathersjs/authentication/issues/103) - -**Merged pull requests:** - -- Bcryptjs [\#137](https://github.com/feathersjs/authentication/pull/137) ([ekryski](https://github.com/ekryski)) -- Allow user.id to be 0. Fixes \#116 [\#117](https://github.com/feathersjs/authentication/pull/117) ([marshallswain](https://github.com/marshallswain)) -- client should return a 401 error code when no token is provided [\#115](https://github.com/feathersjs/authentication/pull/115) ([ccummings](https://github.com/ccummings)) -- v0.6 - Bugs fixes, new hooks, and hook tests [\#109](https://github.com/feathersjs/authentication/pull/109) ([ekryski](https://github.com/ekryski)) -- primus client connect event is 'open' [\#106](https://github.com/feathersjs/authentication/pull/106) ([ahdinosaur](https://github.com/ahdinosaur)) - -## [v0.5.1](https://github.com/feathersjs/authentication/tree/v0.5.1) (2016-03-15) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.5.0...v0.5.1) - -## [v0.5.0](https://github.com/feathersjs/authentication/tree/v0.5.0) (2016-03-14) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.4.1...v0.5.0) - -**Fixed bugs:** - -- Client should store token string and not the token object [\#95](https://github.com/feathersjs/authentication/issues/95) - -**Closed issues:** - -- using feathers-rest/client with feathers-authentication/client [\#94](https://github.com/feathersjs/authentication/issues/94) -- populateUser can pull defaults from config, if available. [\#91](https://github.com/feathersjs/authentication/issues/91) -- App level auth routes for multiple sub-routes [\#90](https://github.com/feathersjs/authentication/issues/90) -- POST to /auth/local never gets response [\#88](https://github.com/feathersjs/authentication/issues/88) -- populate-user.js do not get settings [\#86](https://github.com/feathersjs/authentication/issues/86) -- Add rate limiting [\#81](https://github.com/feathersjs/authentication/issues/81) - -**Merged pull requests:** - -- Finalizing client side authentication module [\#101](https://github.com/feathersjs/authentication/pull/101) ([daffl](https://github.com/daffl)) -- Ten hours is only 36 seconds [\#99](https://github.com/feathersjs/authentication/pull/99) ([mileswilson](https://github.com/mileswilson)) -- Fix examples [\#98](https://github.com/feathersjs/authentication/pull/98) ([mastertinner](https://github.com/mastertinner)) -- fix html in templates [\#97](https://github.com/feathersjs/authentication/pull/97) ([mastertinner](https://github.com/mastertinner)) -- update populateUser\(\) hook [\#87](https://github.com/feathersjs/authentication/pull/87) ([kulakowka](https://github.com/kulakowka)) -- Customize the JWT payload [\#80](https://github.com/feathersjs/authentication/pull/80) ([enten](https://github.com/enten)) - -## [v0.4.1](https://github.com/feathersjs/authentication/tree/v0.4.1) (2016-02-28) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.4.0...v0.4.1) - -**Fixed bugs:** - -- app.logout\(\) fails [\#85](https://github.com/feathersjs/authentication/issues/85) - -**Closed issues:** - -- Username response ? [\#84](https://github.com/feathersjs/authentication/issues/84) -- User doesn't get populated after authentication with databases that don't use \_id [\#71](https://github.com/feathersjs/authentication/issues/71) -- Support client usage in NodeJS [\#52](https://github.com/feathersjs/authentication/issues/52) -- Support async storage for React Native [\#51](https://github.com/feathersjs/authentication/issues/51) -- RequireAdmin on userService [\#36](https://github.com/feathersjs/authentication/issues/36) -- Create test for changing the `usernameField` [\#1](https://github.com/feathersjs/authentication/issues/1) - -## [v0.4.0](https://github.com/feathersjs/authentication/tree/v0.4.0) (2016-02-27) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.3.5...v0.4.0) - -**Closed issues:** - -- Authentication not worked with hooks.remove\('password'\) [\#82](https://github.com/feathersjs/authentication/issues/82) - -**Merged pull requests:** - -- Refactoring for storage service [\#76](https://github.com/feathersjs/authentication/pull/76) ([ekryski](https://github.com/ekryski)) - -## [v0.3.5](https://github.com/feathersjs/authentication/tree/v0.3.5) (2016-02-25) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.3.4...v0.3.5) - -**Merged pull requests:** - -- Adding support for OAuth2 token based auth strategies. Closes \#46. [\#77](https://github.com/feathersjs/authentication/pull/77) ([ekryski](https://github.com/ekryski)) - -## [v0.3.4](https://github.com/feathersjs/authentication/tree/v0.3.4) (2016-02-25) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.3.3...v0.3.4) - -## [v0.3.3](https://github.com/feathersjs/authentication/tree/v0.3.3) (2016-02-25) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.3.2...v0.3.3) - -## [v0.3.2](https://github.com/feathersjs/authentication/tree/v0.3.2) (2016-02-24) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.3.1...v0.3.2) - -**Merged pull requests:** - -- bumping feathers-errors version [\#79](https://github.com/feathersjs/authentication/pull/79) ([ekryski](https://github.com/ekryski)) - -## [v0.3.1](https://github.com/feathersjs/authentication/tree/v0.3.1) (2016-02-23) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.3.0...v0.3.1) - -**Closed issues:** - -- Fix toLowerCase hook [\#74](https://github.com/feathersjs/authentication/issues/74) -- REST auth/local not working if socketio\(\) not set [\#72](https://github.com/feathersjs/authentication/issues/72) -- Support mobile authentication via OAuth2 [\#46](https://github.com/feathersjs/authentication/issues/46) - -**Merged pull requests:** - -- Fix toLowerCase hook [\#75](https://github.com/feathersjs/authentication/pull/75) ([enten](https://github.com/enten)) - -## [v0.3.0](https://github.com/feathersjs/authentication/tree/v0.3.0) (2016-02-19) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.2.4...v0.3.0) - -**Fixed bugs:** - -- Don't register successRedirect route if custom one is passed in [\#61](https://github.com/feathersjs/authentication/issues/61) - -**Closed issues:** - -- Specify the secret in one place instead of two [\#69](https://github.com/feathersjs/authentication/issues/69) -- support a failRedirect [\#62](https://github.com/feathersjs/authentication/issues/62) -- Document authentication updates [\#50](https://github.com/feathersjs/authentication/issues/50) - -**Merged pull requests:** - -- Config options [\#70](https://github.com/feathersjs/authentication/pull/70) ([ekryski](https://github.com/ekryski)) - -## [v0.2.4](https://github.com/feathersjs/authentication/tree/v0.2.4) (2016-02-17) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.2.3...v0.2.4) - -**Closed issues:** - -- Find "query" is replaced by token [\#64](https://github.com/feathersjs/authentication/issues/64) - -**Merged pull requests:** - -- Add module exports Babel module and test CommonJS compatibility [\#68](https://github.com/feathersjs/authentication/pull/68) ([daffl](https://github.com/daffl)) - -## [v0.2.3](https://github.com/feathersjs/authentication/tree/v0.2.3) (2016-02-15) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.2.2...v0.2.3) - -**Closed issues:** - -- How to forbid get and find on the userEndpoint? [\#66](https://github.com/feathersjs/authentication/issues/66) -- userEndpoint problem in sub-app [\#63](https://github.com/feathersjs/authentication/issues/63) -- How to modify successRedirect in local authentication? [\#60](https://github.com/feathersjs/authentication/issues/60) - -**Merged pull requests:** - -- Removing assigning token to params.query for sockets. [\#67](https://github.com/feathersjs/authentication/pull/67) ([ekryski](https://github.com/ekryski)) -- Fixing client query [\#65](https://github.com/feathersjs/authentication/pull/65) ([fastlorenzo](https://github.com/fastlorenzo)) - -## [v0.2.2](https://github.com/feathersjs/authentication/tree/v0.2.2) (2016-02-13) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.2.1...v0.2.2) - -**Closed issues:** - -- Custom tokenEndpoint failing [\#57](https://github.com/feathersjs/authentication/issues/57) -- TypeError: Cannot read property 'service' of undefined [\#56](https://github.com/feathersjs/authentication/issues/56) -- Login returns 500: Internal server error [\#54](https://github.com/feathersjs/authentication/issues/54) - -**Merged pull requests:** - -- Fixing token endpoint [\#58](https://github.com/feathersjs/authentication/pull/58) ([marshallswain](https://github.com/marshallswain)) - -## [v0.2.1](https://github.com/feathersjs/authentication/tree/v0.2.1) (2016-02-12) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.2.0...v0.2.1) - -**Closed issues:** - -- Custom local options not being respected. [\#55](https://github.com/feathersjs/authentication/issues/55) -- node can not require\("feathers-authentication"\).default [\#53](https://github.com/feathersjs/authentication/issues/53) - -## [v0.2.0](https://github.com/feathersjs/authentication/tree/v0.2.0) (2016-02-12) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.1.2...v0.2.0) - -**Closed issues:** - -- Support graceful fallback to cookies [\#45](https://github.com/feathersjs/authentication/issues/45) -- Add a client side component for authentication [\#44](https://github.com/feathersjs/authentication/issues/44) -- Support OAuth2 [\#43](https://github.com/feathersjs/authentication/issues/43) -- Support token based authentication [\#41](https://github.com/feathersjs/authentication/issues/41) -- Support local authentication [\#40](https://github.com/feathersjs/authentication/issues/40) -- Only sign the JWT with user id. Not the whole user object [\#38](https://github.com/feathersjs/authentication/issues/38) -- Discussion: Securing token for socket.io auth [\#33](https://github.com/feathersjs/authentication/issues/33) -- Handling expired tokens [\#25](https://github.com/feathersjs/authentication/issues/25) -- Support multiple auth providers [\#6](https://github.com/feathersjs/authentication/issues/6) - -**Merged pull requests:** - -- Decoupling [\#49](https://github.com/feathersjs/authentication/pull/49) ([ekryski](https://github.com/ekryski)) -- Adding an auth client [\#48](https://github.com/feathersjs/authentication/pull/48) ([ekryski](https://github.com/ekryski)) -- Validate if provider [\#39](https://github.com/feathersjs/authentication/pull/39) ([mastertinner](https://github.com/mastertinner)) - -## [v0.1.2](https://github.com/feathersjs/authentication/tree/v0.1.2) (2016-02-04) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.1.1...v0.1.2) - -**Closed issues:** - -- Hooks should support incoming data as arrays of objects. [\#34](https://github.com/feathersjs/authentication/issues/34) -- Support authenticating with Username and Password via sockets [\#32](https://github.com/feathersjs/authentication/issues/32) - -**Merged pull requests:** - -- Check for params.provider in requireAuth hook [\#37](https://github.com/feathersjs/authentication/pull/37) ([marshallswain](https://github.com/marshallswain)) -- safety check for data [\#35](https://github.com/feathersjs/authentication/pull/35) ([deanmcpherson](https://github.com/deanmcpherson)) - -## [v0.1.1](https://github.com/feathersjs/authentication/tree/v0.1.1) (2016-01-30) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.1.0...v0.1.1) - -## [v0.1.0](https://github.com/feathersjs/authentication/tree/v0.1.0) (2016-01-25) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.0.8...v0.1.0) - -**Closed issues:** - -- Get the Travis build to work. [\#27](https://github.com/feathersjs/authentication/issues/27) -- Login not working [\#24](https://github.com/feathersjs/authentication/issues/24) -- Hooks should be configurable \(they should be functions\) [\#11](https://github.com/feathersjs/authentication/issues/11) -- Document the bundled hooks. [\#10](https://github.com/feathersjs/authentication/issues/10) - -**Merged pull requests:** - -- Migrate docs to book [\#31](https://github.com/feathersjs/authentication/pull/31) ([marshallswain](https://github.com/marshallswain)) -- hashPassword: Async bcrypt usage needs a promise [\#30](https://github.com/feathersjs/authentication/pull/30) ([marshallswain](https://github.com/marshallswain)) -- Removing extras from travis.yml [\#29](https://github.com/feathersjs/authentication/pull/29) ([marshallswain](https://github.com/marshallswain)) -- Fixing build [\#28](https://github.com/feathersjs/authentication/pull/28) ([marshallswain](https://github.com/marshallswain)) -- Adding nsp check [\#26](https://github.com/feathersjs/authentication/pull/26) ([marshallswain](https://github.com/marshallswain)) - -## [v0.0.8](https://github.com/feathersjs/authentication/tree/v0.0.8) (2016-01-16) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.0.7...v0.0.8) - -**Merged pull requests:** - -- Support services that use pagination. [\#23](https://github.com/feathersjs/authentication/pull/23) ([marshallswain](https://github.com/marshallswain)) - -## [v0.0.7](https://github.com/feathersjs/authentication/tree/v0.0.7) (2016-01-07) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.0.6...v0.0.7) - -**Closed issues:** - -- Password isn't removed from responses when using a mongoose service for users endpoint [\#19](https://github.com/feathersjs/authentication/issues/19) -- next called twice using socket.io and using an unauthenticated service [\#17](https://github.com/feathersjs/authentication/issues/17) -- Switch to a callback-based field configuration? [\#15](https://github.com/feathersjs/authentication/issues/15) -- Cannot authenticate [\#14](https://github.com/feathersjs/authentication/issues/14) -- Allow require without `.default` [\#13](https://github.com/feathersjs/authentication/issues/13) -- Login validation [\#2](https://github.com/feathersjs/authentication/issues/2) - -**Merged pull requests:** - -- Adding separate route for refreshing a login token. [\#21](https://github.com/feathersjs/authentication/pull/21) ([corymsmith](https://github.com/corymsmith)) -- Converting user model to object when using mongoose service [\#20](https://github.com/feathersjs/authentication/pull/20) ([corymsmith](https://github.com/corymsmith)) -- Fixing issue where next is called twice when hitting an unauthenticated service via socket.io [\#18](https://github.com/feathersjs/authentication/pull/18) ([corymsmith](https://github.com/corymsmith)) -- Fixing usage of mongoose service [\#16](https://github.com/feathersjs/authentication/pull/16) ([corymsmith](https://github.com/corymsmith)) - -## [v0.0.6](https://github.com/feathersjs/authentication/tree/v0.0.6) (2015-11-22) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.0.5...v0.0.6) - -**Closed issues:** - -- Feathers Auth Configuration Error [\#12](https://github.com/feathersjs/authentication/issues/12) -- Make sure we're returning proper error responses. [\#8](https://github.com/feathersjs/authentication/issues/8) - -## [v0.0.5](https://github.com/feathersjs/authentication/tree/v0.0.5) (2015-11-19) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.0.4...v0.0.5) - -## [v0.0.4](https://github.com/feathersjs/authentication/tree/v0.0.4) (2015-11-19) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v0.0.3...v0.0.4) - -## [v0.0.3](https://github.com/feathersjs/authentication/tree/v0.0.3) (2015-11-18) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.0.6...v0.0.3) - -**Merged pull requests:** - -- allow runtime auth via socket.io [\#4](https://github.com/feathersjs/authentication/pull/4) ([randomnerd](https://github.com/randomnerd)) - -## [v1.0.6](https://github.com/feathersjs/authentication/tree/v1.0.6) (2015-11-02) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.0.5...v1.0.6) - -## [v1.0.5](https://github.com/feathersjs/authentication/tree/v1.0.5) (2015-11-02) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.0.4...v1.0.5) - -## [v1.0.4](https://github.com/feathersjs/authentication/tree/v1.0.4) (2015-11-02) - -[Full Changelog](https://github.com/feathersjs/authentication/compare/v1.0.3...v1.0.4) - -## [v1.0.3](https://github.com/feathersjs/authentication/tree/v1.0.3) (2015-10-12) - -\* _This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)_ diff --git a/packages/authentication/LICENSE b/packages/authentication/LICENSE deleted file mode 100644 index 7712f870f3..0000000000 --- a/packages/authentication/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2024 Feathers Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/packages/authentication/README.md b/packages/authentication/README.md deleted file mode 100644 index c669c7c280..0000000000 --- a/packages/authentication/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# @feathersjs/authentication - -[](https://github.com/feathersjs/feathers/actions?query=workflow%3ACI) -[](https://www.npmjs.com/package/@feathersjs/authentication) -[](https://discord.gg/qa8kez8QBx) - -> Add Authentication to your FeathersJS app. - -## Installation - -``` -npm install @feathersjs/authentication --save -``` - -## Documentation - -Refer to the [Feathers authentication API documentation](https://feathersjs.com/api/authentication/) for more details. - -## License - -Copyright (c) 2024 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors) - -Licensed under the [MIT license](LICENSE). diff --git a/packages/authentication/package.json b/packages/authentication/package.json deleted file mode 100644 index 3f10ef4ed8..0000000000 --- a/packages/authentication/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "name": "@feathersjs/authentication", - "description": "Add Authentication to your FeathersJS app.", - "version": "5.0.34", - "homepage": "https://feathersjs.com", - "main": "lib/", - "types": "lib/", - "keywords": [ - "feathers", - "feathers-plugin" - ], - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/daffl" - }, - "repository": { - "type": "git", - "url": "git://github.com/feathersjs/feathers.git", - "directory": "packages/authentication" - }, - "author": { - "name": "Feathers contributors", - "email": "hello@feathersjs.com", - "url": "https://feathersjs.com" - }, - "files": [ - "CHANGELOG.md", - "LICENSE", - "README.md", - "src/**", - "lib/**", - "*.d.ts", - "*.js" - ], - "contributors": [], - "bugs": { - "url": "https://github.com/feathersjs/feathers/issues" - }, - "engines": { - "node": ">= 12" - }, - "scripts": { - "prepublish": "npm run compile", - "pack": "npm pack --pack-destination ../generators/test/build", - "compile": "shx rm -rf lib/ && tsc && npm run pack", - "test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts" - }, - "directories": { - "lib": "lib" - }, - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@feathersjs/commons": "^5.0.34", - "@feathersjs/errors": "^5.0.34", - "@feathersjs/feathers": "^5.0.34", - "@feathersjs/hooks": "^0.9.0", - "@feathersjs/schema": "^5.0.34", - "@feathersjs/transport-commons": "^5.0.34", - "@types/jsonwebtoken": "^9.0.10", - "jsonwebtoken": "^9.0.2", - "lodash": "^4.17.21", - "long-timeout": "^0.1.1", - "uuid": "^11.1.0" - }, - "devDependencies": { - "@feathersjs/memory": "^5.0.34", - "@types/lodash": "^4.17.20", - "@types/mocha": "^10.0.10", - "@types/node": "^24.1.0", - "@types/uuid": "^10.0.0", - "mocha": "^11.7.1", - "shx": "^0.4.0", - "ts-node": "^10.9.2", - "typescript": "^5.9.2" - }, - "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5" -} diff --git a/packages/authentication/src/core.ts b/packages/authentication/src/core.ts deleted file mode 100644 index 623bc56d40..0000000000 --- a/packages/authentication/src/core.ts +++ /dev/null @@ -1,318 +0,0 @@ -import merge from 'lodash/merge' -import jsonwebtoken, { SignOptions, Secret, VerifyOptions, Algorithm } from 'jsonwebtoken' -import { v4 as uuidv4 } from 'uuid' -import { NotAuthenticated } from '@feathersjs/errors' -import { createDebug } from '@feathersjs/commons' -import { Application, Params } from '@feathersjs/feathers' -import { IncomingMessage, ServerResponse } from 'http' -import { AuthenticationConfiguration, defaultOptions } from './options' - -const debug = createDebug('@feathersjs/authentication/base') - -export interface AuthenticationResult { - [key: string]: any -} - -export interface AuthenticationRequest { - strategy?: string - [key: string]: any -} - -export interface AuthenticationParams extends Params { - payload?: { [key: string]: any } - jwtOptions?: SignOptions - authStrategies?: string[] - secret?: string - [key: string]: any -} - -export type ConnectionEvent = 'login' | 'logout' | 'disconnect' - -export interface AuthenticationStrategy { - /** - * Implement this method to get access to the AuthenticationService - * - * @param auth The AuthenticationService - */ - setAuthentication?(auth: AuthenticationBase): void - /** - * Implement this method to get access to the Feathers application - * - * @param app The Feathers application instance - */ - setApplication?(app: Application): void - /** - * Implement this method to get access to the strategy name - * - * @param name The name of the strategy - */ - setName?(name: string): void - /** - * Implement this method to verify the current configuration - * and throw an error if it is invalid. - */ - verifyConfiguration?(): void - /** - * Implement this method to setup this strategy - * @param auth The AuthenticationService - * @param name The name of the strategy - */ - setup?(auth: AuthenticationBase, name: string): Promise - /** - * Authenticate an authentication request with this strategy. - * Should throw an error if the strategy did not succeed. - * - * @param authentication The authentication request - * @param params The service call parameters - */ - authenticate?( - authentication: AuthenticationRequest, - params: AuthenticationParams - ): Promise - /** - * Update a real-time connection according to this strategy. - * - * @param connection The real-time connection - * @param context The hook context - */ - handleConnection?(event: ConnectionEvent, connection: any, authResult?: AuthenticationResult): Promise - /** - * Parse a basic HTTP request and response for authentication request information. - * - * @param req The HTTP request - * @param res The HTTP response - */ - parse?(req: IncomingMessage, res: ServerResponse): Promise -} - -export interface JwtVerifyOptions extends VerifyOptions { - algorithm?: string | string[] -} - -/** - * A base class for managing authentication strategies and creating and verifying JWTs - */ -export class AuthenticationBase { - app: Application - strategies: { [key: string]: AuthenticationStrategy } - configKey: string - isReady: boolean - - /** - * Create a new authentication service. - * - * @param app The Feathers application instance - * @param configKey The configuration key name in `app.get` (default: `authentication`) - * @param options Optional initial options - */ - constructor(app: Application, configKey = 'authentication', options = {}) { - if (!app || typeof app.use !== 'function') { - throw new Error('An application instance has to be passed to the authentication service') - } - - this.app = app - this.strategies = {} - this.configKey = configKey - this.isReady = false - - app.set('defaultAuthentication', app.get('defaultAuthentication') || configKey) - app.set(configKey, merge({}, app.get(configKey), options)) - } - - /** - * Return the current configuration from the application - */ - get configuration(): AuthenticationConfiguration { - // Always returns a copy of the authentication configuration - return Object.assign({}, defaultOptions, this.app.get(this.configKey)) - } - - /** - * A list of all registered strategy names - */ - get strategyNames() { - return Object.keys(this.strategies) - } - - /** - * Register a new authentication strategy under a given name. - * - * @param name The name to register the strategy under - * @param strategy The authentication strategy instance - */ - register(name: string, strategy: AuthenticationStrategy) { - // Call the functions a strategy can implement - if (typeof strategy.setName === 'function') { - strategy.setName(name) - } - - if (typeof strategy.setApplication === 'function') { - strategy.setApplication(this.app) - } - - if (typeof strategy.setAuthentication === 'function') { - strategy.setAuthentication(this) - } - - if (typeof strategy.verifyConfiguration === 'function') { - strategy.verifyConfiguration() - } - - // Register strategy as name - this.strategies[name] = strategy - - if (this.isReady) { - strategy.setup?.(this, name) - } - } - - /** - * Get the registered authentication strategies for a list of names. - * - * @param names The list or strategy names - */ - getStrategies(...names: string[]) { - return names.map((name) => this.strategies[name]).filter((current) => !!current) - } - - /** - * Returns a single strategy by name - * - * @param name The strategy name - * @returns The authentication strategy or undefined - */ - getStrategy(name: string) { - return this.strategies[name] - } - - /** - * Create a new access token with payload and options. - * - * @param payload The JWT payload - * @param optsOverride The options to extend the defaults (`configuration.jwtOptions`) with - * @param secretOverride Use a different secret instead - */ - async createAccessToken( - payload: string | Buffer | object, - optsOverride?: SignOptions, - secretOverride?: Secret - ) { - const { secret, jwtOptions } = this.configuration - // Use configuration by default but allow overriding the secret - const jwtSecret = secretOverride || secret - // Default jwt options merged with additional options - const options = merge({}, jwtOptions, optsOverride) - - if (!options.jwtid) { - // Generate a UUID as JWT ID by default - options.jwtid = uuidv4() - } - - return jsonwebtoken.sign(payload, jwtSecret, options) - } - - /** - * Verifies an access token. - * - * @param accessToken The token to verify - * @param optsOverride The options to extend the defaults (`configuration.jwtOptions`) with - * @param secretOverride Use a different secret instead - */ - async verifyAccessToken(accessToken: string, optsOverride?: JwtVerifyOptions, secretOverride?: Secret) { - const { secret, jwtOptions } = this.configuration - const jwtSecret = secretOverride || secret - const options = merge({}, jwtOptions, optsOverride) - const { algorithm } = options - - // Normalize the `algorithm` setting into the algorithms array - if (algorithm && !options.algorithms) { - options.algorithms = (Array.isArray(algorithm) ? algorithm : [algorithm]) as Algorithm[] - delete options.algorithm - } - - try { - const verified = jsonwebtoken.verify(accessToken, jwtSecret, options) - - return verified as any - } catch (error: any) { - throw new NotAuthenticated(error.message, error) - } - } - - /** - * Authenticate a given authentication request against a list of strategies. - * - * @param authentication The authentication request - * @param params Service call parameters - * @param allowed A list of allowed strategy names - */ - async authenticate( - authentication: AuthenticationRequest, - params: AuthenticationParams, - ...allowed: string[] - ) { - const { strategy } = authentication || {} - const [authStrategy] = this.getStrategies(strategy) - const strategyAllowed = allowed.includes(strategy) - - debug('Running authenticate for strategy', strategy, allowed) - - if (!authentication || !authStrategy || !strategyAllowed) { - const additionalInfo = - (!strategy && ' (no `strategy` set)') || - (!strategyAllowed && ' (strategy not allowed in authStrategies)') || - '' - - // If there are no valid strategies or `authentication` is not an object - throw new NotAuthenticated('Invalid authentication information' + additionalInfo) - } - - return authStrategy.authenticate(authentication, { - ...params, - authenticated: true - }) - } - - async handleConnection(event: ConnectionEvent, connection: any, authResult?: AuthenticationResult) { - const strategies = this.getStrategies(...Object.keys(this.strategies)).filter( - (current) => typeof current.handleConnection === 'function' - ) - - for (const strategy of strategies) { - await strategy.handleConnection(event, connection, authResult) - } - } - - /** - * Parse an HTTP request and response for authentication request information. - * - * @param req The HTTP request - * @param res The HTTP response - * @param names A list of strategies to use - */ - async parse(req: IncomingMessage, res: ServerResponse, ...names: string[]) { - const strategies = this.getStrategies(...names).filter((current) => typeof current.parse === 'function') - - debug('Strategies parsing HTTP header for authentication information', names) - - for (const authStrategy of strategies) { - const value = await authStrategy.parse(req, res) - - if (value !== null) { - return value - } - } - - return null - } - - async setup() { - this.isReady = true - - for (const name of Object.keys(this.strategies)) { - const strategy = this.strategies[name] - - await strategy.setup?.(this, name) - } - } -} diff --git a/packages/authentication/src/hooks/authenticate.ts b/packages/authentication/src/hooks/authenticate.ts deleted file mode 100644 index ad3cdf4c11..0000000000 --- a/packages/authentication/src/hooks/authenticate.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { HookContext, NextFunction } from '@feathersjs/feathers' -import { NotAuthenticated } from '@feathersjs/errors' -import { createDebug } from '@feathersjs/commons' - -const debug = createDebug('@feathersjs/authentication/hooks/authenticate') - -export interface AuthenticateHookSettings { - service?: string - strategies?: string[] -} - -export default (originalSettings: string | AuthenticateHookSettings, ...originalStrategies: string[]) => { - const settings = - typeof originalSettings === 'string' - ? { strategies: [originalSettings, ...originalStrategies] } - : originalSettings - - if (!originalSettings || settings.strategies.length === 0) { - throw new Error('The authenticate hook needs at least one allowed strategy') - } - - return async (context: HookContext, _next?: NextFunction) => { - const next = typeof _next === 'function' ? _next : async () => context - const { app, params, type, path, service } = context - const { strategies } = settings - const { provider, authentication } = params - const authService = app.defaultAuthentication(settings.service) - - debug(`Running authenticate hook on '${path}'`) - - if (type && type !== 'before' && type !== 'around') { - throw new NotAuthenticated('The authenticate hook must be used as a before hook') - } - - if (!authService || typeof authService.authenticate !== 'function') { - throw new NotAuthenticated('Could not find a valid authentication service') - } - - if (service === authService) { - throw new NotAuthenticated( - 'The authenticate hook does not need to be used on the authentication service' - ) - } - - if (params.authenticated === true) { - return next() - } - - if (authentication) { - const { provider, authentication, ...authParams } = params - - debug('Authenticating with', authentication, strategies) - - const authResult = await authService.authenticate(authentication, authParams, ...strategies) - - const { accessToken, ...authResultWithoutToken } = authResult - - context.params = { - ...params, - ...authResultWithoutToken, - authenticated: true - } - } else if (provider) { - throw new NotAuthenticated('Not authenticated') - } - - return next() - } -} diff --git a/packages/authentication/src/hooks/connection.ts b/packages/authentication/src/hooks/connection.ts deleted file mode 100644 index 4cf06c12d6..0000000000 --- a/packages/authentication/src/hooks/connection.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { HookContext, NextFunction } from '@feathersjs/feathers' -import { AuthenticationBase, ConnectionEvent } from '../core' - -export default (event: ConnectionEvent) => async (context: HookContext, next: NextFunction) => { - await next() - - const { - result, - params: { connection } - } = context - - if (connection) { - const service = context.service as unknown as AuthenticationBase - - await service.handleConnection(event, connection, result) - } -} diff --git a/packages/authentication/src/hooks/event.ts b/packages/authentication/src/hooks/event.ts deleted file mode 100644 index 44b6953b91..0000000000 --- a/packages/authentication/src/hooks/event.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { HookContext, NextFunction } from '@feathersjs/feathers' -import { createDebug } from '@feathersjs/commons' -import { ConnectionEvent } from '../core' - -const debug = createDebug('@feathersjs/authentication/hooks/connection') - -export default (event: ConnectionEvent) => async (context: HookContext, next: NextFunction) => { - await next() - - const { app, result, params } = context - - if (params.provider && result) { - debug(`Sending authentication event '${event}'`) - app.emit(event, result, params, context) - } -} diff --git a/packages/authentication/src/hooks/index.ts b/packages/authentication/src/hooks/index.ts deleted file mode 100644 index 4c9a354cfa..0000000000 --- a/packages/authentication/src/hooks/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { default as authenticate } from './authenticate' -export { default as connection } from './connection' -export { default as event } from './event' diff --git a/packages/authentication/src/index.ts b/packages/authentication/src/index.ts deleted file mode 100644 index f7ea82a173..0000000000 --- a/packages/authentication/src/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -export * as hooks from './hooks' -export { authenticate } from './hooks' -export { - AuthenticationBase, - AuthenticationRequest, - AuthenticationResult, - AuthenticationStrategy, - AuthenticationParams, - ConnectionEvent, - JwtVerifyOptions -} from './core' -export { AuthenticationBaseStrategy } from './strategy' -export { AuthenticationService } from './service' -export { JWTStrategy } from './jwt' -export { authenticationSettingsSchema, AuthenticationConfiguration } from './options' diff --git a/packages/authentication/src/jwt.ts b/packages/authentication/src/jwt.ts deleted file mode 100644 index 0724760b12..0000000000 --- a/packages/authentication/src/jwt.ts +++ /dev/null @@ -1,190 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/ban-ts-comment */ -import { IncomingMessage } from 'http' -import { NotAuthenticated } from '@feathersjs/errors' -import { Params } from '@feathersjs/feathers' -import { createDebug } from '@feathersjs/commons' -// @ts-ignore -import lt from 'long-timeout' - -import { AuthenticationBaseStrategy } from './strategy' -import { AuthenticationParams, AuthenticationRequest, AuthenticationResult, ConnectionEvent } from './core' - -const debug = createDebug('@feathersjs/authentication/jwt') -const SPLIT_HEADER = /(\S+)\s+(\S+)/ - -export class JWTStrategy extends AuthenticationBaseStrategy { - expirationTimers = new WeakMap() - - get configuration() { - const authConfig = this.authentication.configuration - const config = super.configuration - - return { - service: authConfig.service, - entity: authConfig.entity, - entityId: authConfig.entityId, - header: 'Authorization', - schemes: ['Bearer', 'JWT'], - ...config - } - } - - async handleConnection( - event: ConnectionEvent, - connection: any, - authResult?: AuthenticationResult - ): Promise { - const isValidLogout = - event === 'logout' && - connection.authentication && - authResult && - connection.authentication.accessToken === authResult.accessToken - - const { accessToken } = authResult || {} - const { entity } = this.configuration - - if (accessToken && event === 'login') { - debug('Adding authentication information to connection') - const { exp } = - authResult?.authentication?.payload || (await this.authentication.verifyAccessToken(accessToken)) - // The time (in ms) until the token expires - const duration = exp * 1000 - Date.now() - const timer = lt.setTimeout(() => this.app.emit('disconnect', connection), duration) - - debug(`Registering connection expiration timer for ${duration}ms`) - lt.clearTimeout(this.expirationTimers.get(connection)) - this.expirationTimers.set(connection, timer) - - debug('Adding authentication information to connection') - connection.authentication = { - strategy: this.name, - accessToken - } - connection[entity] = authResult[entity] - } else if (event === 'disconnect' || isValidLogout) { - debug('Removing authentication information and expiration timer from connection') - - await new Promise((resolve) => - process.nextTick(() => { - delete connection[entity] - delete connection.authentication - resolve(connection) - }) - ) - - lt.clearTimeout(this.expirationTimers.get(connection)) - this.expirationTimers.delete(connection) - } - } - - verifyConfiguration() { - const allowedKeys = ['entity', 'entityId', 'service', 'header', 'schemes'] - - for (const key of Object.keys(this.configuration)) { - if (!allowedKeys.includes(key)) { - throw new Error( - `Invalid JwtStrategy option 'authentication.${this.name}.${key}'. Did you mean to set it in 'authentication.jwtOptions'?` - ) - } - } - - if (typeof this.configuration.header !== 'string') { - throw new Error(`The 'header' option for the ${this.name} strategy must be a string`) - } - } - - async getEntityQuery(_params: Params) { - return {} - } - - /** - * Return the entity for a given id - * - * @param id The id to use - * @param params Service call parameters - */ - async getEntity(id: string, params: Params) { - const entityService = this.entityService - const { entity } = this.configuration - - debug('Getting entity', id) - - if (entityService === null) { - throw new NotAuthenticated('Could not find entity service') - } - - const query = await this.getEntityQuery(params) - const { provider, ...paramsWithoutProvider } = params - const result = await entityService.get(id, { - ...paramsWithoutProvider, - query - }) - - if (!params.provider) { - return result - } - - return entityService.get(id, { ...params, [entity]: result }) - } - - async getEntityId(authResult: AuthenticationResult, _params: Params) { - return authResult.authentication.payload.sub - } - - async authenticate(authentication: AuthenticationRequest, params: AuthenticationParams) { - const { accessToken } = authentication - const { entity } = this.configuration - - if (!accessToken) { - throw new NotAuthenticated('No access token') - } - - const payload = await this.authentication.verifyAccessToken(accessToken, params.jwt) - const result = { - accessToken, - authentication: { - strategy: 'jwt', - accessToken, - payload - } - } - - if (entity === null) { - return result - } - - const entityId = await this.getEntityId(result, params) - const value = await this.getEntity(entityId, params) - - return { - ...result, - [entity]: value - } - } - - async parse(req: IncomingMessage): Promise<{ - strategy: string - accessToken: string - } | null> { - const { header, schemes }: { header: string; schemes: string[] } = this.configuration - const headerValue = req.headers && req.headers[header.toLowerCase()] - - if (!headerValue || typeof headerValue !== 'string') { - return null - } - - debug('Found parsed header value') - - const [, scheme, schemeValue] = headerValue.match(SPLIT_HEADER) || [] - const hasScheme = scheme && schemes.some((current) => new RegExp(current, 'i').test(scheme)) - - if (scheme && !hasScheme) { - return null - } - - return { - strategy: this.name, - accessToken: hasScheme ? schemeValue : headerValue - } - } -} diff --git a/packages/authentication/src/options.ts b/packages/authentication/src/options.ts deleted file mode 100644 index 2176889087..0000000000 --- a/packages/authentication/src/options.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { FromSchema, authenticationSettingsSchema } from '@feathersjs/schema' - -export const defaultOptions = { - authStrategies: [] as string[], - jwtOptions: { - header: { typ: 'access' }, // by default is an access token but can be any type - audience: 'https://yourdomain.com', // The resource server where the token is processed - issuer: 'feathers', // The issuing server, application or resource - algorithm: 'HS256', - expiresIn: '1d' - } -} - -export { authenticationSettingsSchema } - -export type AuthenticationConfiguration = FromSchema diff --git a/packages/authentication/src/service.ts b/packages/authentication/src/service.ts deleted file mode 100644 index cba07330a1..0000000000 --- a/packages/authentication/src/service.ts +++ /dev/null @@ -1,203 +0,0 @@ -import merge from 'lodash/merge' -import { NotAuthenticated } from '@feathersjs/errors' -import '@feathersjs/transport-commons' -import { createDebug } from '@feathersjs/commons' -import { ServiceMethods } from '@feathersjs/feathers' -import { resolveDispatch } from '@feathersjs/schema' -import jsonwebtoken from 'jsonwebtoken' -import { hooks } from '@feathersjs/hooks' - -import { AuthenticationBase, AuthenticationResult, AuthenticationRequest, AuthenticationParams } from './core' -import { connection, event } from './hooks' -import { RealTimeConnection } from '@feathersjs/feathers' - -const debug = createDebug('@feathersjs/authentication/service') - -declare module '@feathersjs/feathers/lib/declarations' { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - interface FeathersApplication { - // eslint-disable-line - /** - * Returns the default authentication service or the - * authentication service for a given path. - * - * @param location The service path to use (optional) - */ - defaultAuthentication?(location?: string): AuthenticationService - } - - interface Params { - authenticated?: boolean - authentication?: AuthenticationRequest - } -} - -export class AuthenticationService - extends AuthenticationBase - implements Partial > -{ - constructor(app: any, configKey = 'authentication', options = {}) { - super(app, configKey, options) - - hooks(this, { - create: [resolveDispatch(), event('login'), connection('login')], - remove: [resolveDispatch(), event('logout'), connection('logout')] - }) - - this.app.on('disconnect', async (connection: RealTimeConnection) => { - await this.handleConnection('disconnect', connection) - }) - - if (typeof app.defaultAuthentication !== 'function') { - app.defaultAuthentication = function (location?: string) { - const configKey = app.get('defaultAuthentication') - const path = - location || - Object.keys(this.services).find((current) => this.service(current).configKey === configKey) - - return path ? this.service(path) : null - } - } - } - /** - * Return the payload for a JWT based on the authentication result. - * Called internally by the `create` method. - * - * @param _authResult The current authentication result - * @param params The service call parameters - */ - async getPayload(_authResult: AuthenticationResult, params: AuthenticationParams) { - // Uses `params.payload` or returns an empty payload - const { payload = {} } = params - - return payload - } - - /** - * Returns the JWT options based on an authentication result. - * By default sets the JWT subject to the entity id. - * - * @param authResult The authentication result - * @param params Service call parameters - */ - async getTokenOptions(authResult: AuthenticationResult, params: AuthenticationParams) { - const { service, entity, entityId } = this.configuration - const jwtOptions = merge({}, params.jwtOptions, params.jwt) - const value = service && entity && authResult[entity] - - // Set the subject to the entity id if it is available - if (value && !jwtOptions.subject) { - const idProperty = entityId || this.app.service(service).id - const subject = value[idProperty] - - if (subject === undefined) { - throw new NotAuthenticated(`Can not set subject from ${entity}.${idProperty}`) - } - - jwtOptions.subject = `${subject}` - } - - return jwtOptions - } - - /** - * Create and return a new JWT for a given authentication request. - * Will trigger the `login` event. - * - * @param data The authentication request (should include `strategy` key) - * @param params Service call parameters - */ - async create(data: AuthenticationRequest, params?: AuthenticationParams) { - const authStrategies = params.authStrategies || this.configuration.authStrategies - - if (!authStrategies.length) { - throw new NotAuthenticated('No authentication strategies allowed for creating a JWT (`authStrategies`)') - } - - const authResult = await this.authenticate(data, params, ...authStrategies) - - debug('Got authentication result', authResult) - - if (authResult.accessToken) { - return authResult - } - - const [payload, jwtOptions] = await Promise.all([ - this.getPayload(authResult, params), - this.getTokenOptions(authResult, params) - ]) - - debug('Creating JWT with', payload, jwtOptions) - - const accessToken = await this.createAccessToken(payload, jwtOptions, params.secret) - - return { - accessToken, - ...authResult, - authentication: { - ...authResult.authentication, - payload: jsonwebtoken.decode(accessToken) - } - } - } - - /** - * Mark a JWT as removed. By default only verifies the JWT and returns the result. - * Triggers the `logout` event. - * - * @param id The JWT to remove or null - * @param params Service call parameters - */ - async remove(id: string | null, params?: AuthenticationParams) { - const { authentication } = params - const { authStrategies } = this.configuration - - // When an id is passed it is expected to be the authentication `accessToken` - if (id !== null && id !== authentication.accessToken) { - throw new NotAuthenticated('Invalid access token') - } - - debug('Verifying authentication strategy in remove') - - return this.authenticate(authentication, params, ...authStrategies) - } - - /** - * Validates the service configuration. - */ - async setup() { - await super.setup() - - // The setup method checks for valid settings and registers the - // connection and event (login, logout) hooks - const { secret, service, entity, entityId } = this.configuration - - if (typeof secret !== 'string') { - throw new Error("A 'secret' must be provided in your authentication configuration") - } - - if (entity !== null) { - if (service === undefined) { - throw new Error("The 'service' option is not set in the authentication configuration") - } - - if (this.app.service(service) === undefined) { - throw new Error( - `The '${service}' entity service does not exist (set to 'null' if it is not required)` - ) - } - - if (this.app.service(service).id === undefined && entityId === undefined) { - throw new Error( - `The '${service}' service does not have an 'id' property and no 'entityId' option is set.` - ) - } - } - - const publishable = this as any - - if (typeof publishable.publish === 'function') { - publishable.publish((): any => null) - } - } -} diff --git a/packages/authentication/src/strategy.ts b/packages/authentication/src/strategy.ts deleted file mode 100644 index 99a1ec9c58..0000000000 --- a/packages/authentication/src/strategy.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { AuthenticationStrategy, AuthenticationBase } from './core' -import { Application, Service } from '@feathersjs/feathers' - -export class AuthenticationBaseStrategy implements AuthenticationStrategy { - authentication?: AuthenticationBase - app?: Application - name?: string - - setAuthentication(auth: AuthenticationBase) { - this.authentication = auth - } - - setApplication(app: Application) { - this.app = app - } - - setName(name: string) { - this.name = name - } - - get configuration(): any { - return this.authentication.configuration[this.name] - } - - get entityService(): Service { - const { service } = this.configuration - - if (!service) { - return null - } - - return this.app.service(service) || null - } -} diff --git a/packages/authentication/test/core.test.ts b/packages/authentication/test/core.test.ts deleted file mode 100644 index 3ffcf97ec3..0000000000 --- a/packages/authentication/test/core.test.ts +++ /dev/null @@ -1,445 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -import assert from 'assert' -import { feathers, Application } from '@feathersjs/feathers' -import jwt from 'jsonwebtoken' -import { Infer, schema } from '@feathersjs/schema' - -import { AuthenticationBase, AuthenticationRequest } from '../src/core' -import { authenticationSettingsSchema } from '../src/options' -import { Strategy1, Strategy2, MockRequest } from './fixtures' -import { ServerResponse } from 'http' - -const UUID = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/ - -describe('authentication/core', () => { - let app: Application - let auth: AuthenticationBase - - beforeEach(() => { - app = feathers() - auth = new AuthenticationBase(app, 'authentication', { - entity: 'user', - service: 'users', - secret: 'supersecret', - first: { hello: 'test' } - }) - - auth.register('first', new Strategy1()) - auth.register('second', new Strategy2()) - auth.register('dummy', { - async authenticate(data: AuthenticationRequest) { - return data - } - }) - }) - - describe('configuration', () => { - it('infers configuration from settings schema', async () => { - const settingsSchema = schema({ - $id: 'AuthSettingsSchema', - ...authenticationSettingsSchema - } as const) - type Settings = Infer - const config: Settings = { - entity: 'user', - secret: 'supersecret', - authStrategies: ['some', 'thing'] - } - - await settingsSchema.validate(config) - }) - - it('throws an error when app is not provided', () => { - try { - // @ts-ignore - const otherAuth = new AuthenticationBase() - assert.fail('Should never get here') - assert.ok(otherAuth) - } catch (error: any) { - assert.strictEqual( - error.message, - 'An application instance has to be passed to the authentication service' - ) - } - }) - - it('sets defaults', () => { - // Getting configuration twice returns a copy - assert.notStrictEqual(auth.configuration, auth.configuration) - assert.strictEqual(auth.configuration.entity, 'user') - }) - - it('allows to override jwtOptions, does not merge', () => { - const { jwtOptions } = auth.configuration - const auth2options = { - jwtOptions: { - expiresIn: '1w' - } - } - - app.set('auth2', auth2options) - - const auth2 = new AuthenticationBase(app, 'auth2') - - assert.ok(jwtOptions) - assert.strictEqual(jwtOptions.expiresIn, '1d') - assert.strictEqual(jwtOptions.issuer, 'feathers') - - assert.deepStrictEqual(auth2.configuration.jwtOptions, auth2options.jwtOptions) - }) - - it('sets configKey and defaultAuthentication', () => { - assert.strictEqual(app.get('defaultAuthentication'), 'authentication') - }) - - it('uses default configKey', () => { - const otherApp = feathers() - const otherAuth = new AuthenticationBase(otherApp) - - assert.ok(otherAuth) - assert.strictEqual(otherApp.get('defaultAuthentication'), 'authentication') - assert.deepStrictEqual(otherApp.get('authentication'), {}) - }) - }) - - describe('strategies', () => { - it('strategyNames', () => { - assert.deepStrictEqual(auth.strategyNames, ['first', 'second', 'dummy']) - }) - - it('getStrategies', () => { - const first = auth.getStrategies('first') - const invalid = auth.getStrategies('first', 'invalid', 'second') - - assert.strictEqual(first.length, 1) - assert.strictEqual(invalid.length, 2, 'Filtered out invalid strategies') - }) - - it('getStrategy', () => { - const first = auth.getStrategy('first') - - assert.ok(first) - }) - - it('calls setName, setApplication and setAuthentication if available', () => { - const [first] = auth.getStrategies('first') as [Strategy1] - - assert.strictEqual(first.name, 'first') - assert.strictEqual(first.app, app) - assert.strictEqual(first.authentication, auth) - }) - - it('strategy configuration getter', () => { - const [first] = auth.getStrategies('first') as [Strategy1] - - assert.deepStrictEqual(first.configuration, { hello: 'test' }) - }) - - it('strategy configuration getter', () => { - const [first] = auth.getStrategies('first') as [Strategy1] - const oldService = auth.configuration.service - - delete auth.configuration.service - - assert.strictEqual(first.entityService, null) - - auth.configuration.service = oldService - }) - }) - - describe('authenticate', () => { - describe('with strategy set in params', () => { - it('returns first success', async () => { - const result = await auth.authenticate( - { - strategy: 'first', - username: 'David' - }, - {}, - 'first', - 'second' - ) - - assert.deepStrictEqual(result, Strategy1.result) - }) - - it('returns error when failed', async () => { - try { - await auth.authenticate( - { - strategy: 'first', - username: 'Steve' - }, - {}, - 'first', - 'second' - ) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual(error.message, 'Invalid Dave') - } - }) - - it('returns second success', async () => { - const authentication = { - strategy: 'second', - v2: true, - password: 'supersecret' - } - - const result = await auth.authenticate(authentication, {}, 'first', 'second') - - assert.deepStrictEqual( - result, - Object.assign({}, Strategy2.result, { - authentication, - params: { authenticated: true } - }) - ) - }) - - it('passes params', async () => { - const params = { - some: 'thing' - } - const authentication = { - strategy: 'second', - v2: true, - password: 'supersecret' - } - - const result = await auth.authenticate(authentication, params, 'first', 'second') - - assert.deepStrictEqual( - result, - Object.assign( - { - params: Object.assign(params, { - authenticated: true - }), - authentication - }, - Strategy2.result - ) - ) - }) - - it('throws error when allowed and passed strategy does not match', async () => { - try { - await auth.authenticate( - { - strategy: 'first', - username: 'Dummy' - }, - {}, - 'second' - ) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual( - error.message, - 'Invalid authentication information (strategy not allowed in authStrategies)' - ) - } - }) - - it('throws error when strategy is not set', async () => { - try { - await auth.authenticate( - { - username: 'Dummy' - }, - {}, - 'second' - ) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.message, 'Invalid authentication information (no `strategy` set)') - } - }) - }) - }) - - describe('parse', () => { - const res = {} as ServerResponse - - it('returns null when no names are given', async () => { - const req = {} as MockRequest - - assert.strictEqual(await auth.parse(req, res), null) - }) - - it('successfully parses a request (first)', async () => { - const req = { isDave: true } as MockRequest - - const result = await auth.parse(req, res, 'first', 'second') - - assert.deepStrictEqual(result, Strategy1.result) - }) - - it('successfully parses a request (second)', async () => { - const req = { isV2: true } as MockRequest - - const result = await auth.parse(req, res, 'first', 'second') - - assert.deepStrictEqual(result, Strategy2.result) - }) - - it('null when no success', async () => { - const req = {} as MockRequest - - const result = await auth.parse(req, res, 'first', 'second') - - assert.strictEqual(result, null) - }) - }) - - describe('jwt', () => { - const message = 'Some payload' - - describe('createAccessToken', () => { - // it('errors with no payload', () => { - // try { - // // @ts-ignore - // await auth.createAccessToken(); - // assert.fail('Should never get here'); - // } catch (error: any) { - // assert.strictEqual(error.message, 'payload is required'); - // } - // }); - - it('with default options', async () => { - const msg = 'Some payload' - - const accessToken = await auth.createAccessToken({ message: msg }) - const decoded = jwt.decode(accessToken) - const settings = auth.configuration.jwtOptions - - if (decoded === null || typeof decoded === 'string') { - throw new Error('Not encoded properly') - } - - assert.ok(typeof accessToken === 'string') - assert.strictEqual(decoded.message, msg, 'Set payload') - assert.ok(UUID.test(decoded.jti), 'Set `jti` to default UUID') - assert.strictEqual(decoded.aud, settings.audience) - assert.strictEqual(decoded.iss, settings.issuer) - }) - - it('with default and overriden options', async () => { - const overrides = { - issuer: 'someoneelse', - audience: 'people', - jwtid: 'something' - } - - const accessToken = await auth.createAccessToken({ message }, overrides) - - assert.ok(typeof accessToken === 'string') - - const decoded = jwt.decode(accessToken) - - if (decoded === null || typeof decoded === 'string') { - throw new Error('Not encoded properly') - } - - assert.strictEqual(decoded.message, message, 'Set payload') - assert.strictEqual(decoded.jti, 'something') - assert.strictEqual(decoded.aud, overrides.audience) - assert.strictEqual(decoded.iss, overrides.issuer) - }) - - it('errors with invalid options', async () => { - const overrides = { - algorithm: 'fdjsklfsndkl' - } - - try { - // @ts-ignore - await auth.createAccessToken({}, overrides) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.message, '"algorithm" must be a valid string enum value') - } - }) - }) - - describe('verifyAccessToken', () => { - let validToken: string - let expiredToken: string - - beforeEach(async () => { - validToken = await auth.createAccessToken({ message }) - expiredToken = await auth.createAccessToken( - {}, - { - expiresIn: '1ms' - } - ) - }) - - it('returns payload when token is valid', async () => { - const payload = await auth.verifyAccessToken(validToken) - - assert.strictEqual(payload.message, message) - }) - - it('errors when custom algorithm property does not match', async () => { - try { - await auth.verifyAccessToken(validToken, { - algorithm: ['HS512'] - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.message, 'invalid algorithm') - } - }) - - it('errors when algorithms property does not match', async () => { - try { - await auth.verifyAccessToken(validToken, { - algorithms: ['HS512'] - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.message, 'invalid algorithm') - } - }) - - it('errors when secret is different', async () => { - try { - await auth.verifyAccessToken(validToken, {}, 'fdjskl') - - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.message, 'invalid signature') - } - }) - - it('errors when other custom options do not match', async () => { - try { - await auth.verifyAccessToken(validToken, { issuer: 'someonelse' }) - - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.ok(/jwt issuer invalid/.test(error.message)) - } - }) - - it('errors when token is expired', async () => { - try { - await auth.verifyAccessToken(expiredToken) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual(error.message, 'jwt expired') - assert.strictEqual(error.data.name, 'TokenExpiredError') - assert.ok(error.data.expiredAt) - } - }) - }) - }) -}) diff --git a/packages/authentication/test/fixtures.ts b/packages/authentication/test/fixtures.ts deleted file mode 100644 index aba18afde3..0000000000 --- a/packages/authentication/test/fixtures.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { NotAuthenticated } from '@feathersjs/errors' -import { Params } from '@feathersjs/feathers' - -import { AuthenticationRequest } from '../src/core' -import { IncomingMessage } from 'http' -import { AuthenticationBaseStrategy } from '../src/strategy' - -export interface MockRequest extends IncomingMessage { - isDave?: boolean - isV2?: boolean -} - -export class Strategy1 extends AuthenticationBaseStrategy { - static result = { - user: { - id: 123, - name: 'Dave' - }, - authenticated: true - } - - async authenticate(authentication: AuthenticationRequest) { - if (authentication.username === 'David' || authentication.both) { - return { ...Strategy1.result } - } - - throw new NotAuthenticated('Invalid Dave') - } - - async parse(req: MockRequest) { - if (req.isDave) { - return { ...Strategy1.result } - } - - return null - } -} - -export class Strategy2 extends AuthenticationBaseStrategy { - static result = { - user: { - name: 'V2', - version: 2 - }, - authenticated: true - } - - authenticate(authentication: AuthenticationRequest, params: Params) { - const isV2 = authentication.v2 === true && authentication.password === 'supersecret' - - if (isV2 || authentication.both) { - return Promise.resolve(Object.assign({ params, authentication }, Strategy2.result)) - } - - return Promise.reject(new NotAuthenticated('Invalid v2 user')) - } - - async parse(req: MockRequest) { - if (req.isV2) { - return Strategy2.result - } - - return null - } -} diff --git a/packages/authentication/test/hooks/authenticate.test.ts b/packages/authentication/test/hooks/authenticate.test.ts deleted file mode 100644 index 89b7bad514..0000000000 --- a/packages/authentication/test/hooks/authenticate.test.ts +++ /dev/null @@ -1,256 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -import assert from 'assert' -import { feathers, Application, Params, ServiceMethods } from '@feathersjs/feathers' - -import { Strategy1, Strategy2 } from '../fixtures' -import { AuthenticationService, hooks } from '../../src' - -const { authenticate } = hooks - -describe('authentication/hooks/authenticate', () => { - let app: Application<{ - authentication: AuthenticationService - 'auth-v2': AuthenticationService - users: Partial & { id: string } - }> - - beforeEach(() => { - app = feathers() - app.use( - 'authentication', - new AuthenticationService(app, 'authentication', { - entity: 'user', - service: 'users', - secret: 'supersecret', - authStrategies: ['first'] - }) - ) - app.use( - 'auth-v2', - new AuthenticationService(app, 'auth-v2', { - entity: 'user', - service: 'users', - secret: 'supersecret', - authStrategies: ['test'] - }) - ) - app.use('users', { - id: 'id', - - async find() { - return [] - }, - - async get(_id: string | number, params: Params) { - return params - } - }) - - const service = app.service('authentication') - - service.register('first', new Strategy1()) - service.register('second', new Strategy2()) - - app.service('auth-v2').register('test', new Strategy1()) - - app.service('users').hooks({ - get: [authenticate('first', 'second')] - }) - - app.service('users').id = 'name' - app.setup() - }) - - it('throws an error when no strategies are passed', () => { - try { - // @ts-ignore - authenticate() - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.message, 'The authenticate hook needs at least one allowed strategy') - } - }) - - it('throws an error when not a before hook', async () => { - const users = app.service('users') - - users.hooks({ - after: { - all: [authenticate('first')] - } - }) - - try { - await users.find() - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual(error.message, 'The authenticate hook must be used as a before hook') - } - }) - - it('throws an error if authentication service is gone', async () => { - delete app.services.authentication - - try { - await app.service('users').get(1, { - authentication: { - some: 'thing' - } - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual(error.message, 'Could not find a valid authentication service') - } - }) - - it('authenticates with first strategy, merges params', async () => { - const params = { - authentication: { - strategy: 'first', - username: 'David' - } - } - - const result = await app.service('users').get(1, params) - - assert.deepStrictEqual(result, Object.assign({}, params, Strategy1.result)) - }) - - it('authenticates with first strategy, keeps references alive (#1629)', async () => { - const connection = {} - const params = { - connection, - authentication: { - strategy: 'first', - username: 'David' - } - } - - app.service('users').hooks({ - after: { - get: (context) => { - context.result.params = context.params - } - } - }) - - const result = await app.service('users').get(1, params) - - assert.ok(result.params.connection === connection) - }) - - it('authenticates with different authentication service', async () => { - const params = { - authentication: { - strategy: 'test', - username: 'David' - } - } - - app.service('users').hooks({ - before: { - find: [ - authenticate({ - service: 'auth-v2', - strategies: ['test'] - }) - ] - } - }) - - const result = await app.service('users').find(params) - - assert.deepStrictEqual(result, []) - }) - - it('authenticates with second strategy', async () => { - const params = { - authentication: { - strategy: 'second', - v2: true, - password: 'supersecret' - } - } - - const result = await app.service('users').get(1, params) - - assert.deepStrictEqual( - result, - Object.assign( - { - authentication: params.authentication, - params: { authenticated: true } - }, - Strategy2.result - ) - ) - }) - - it('passes for internal calls without authentication', async () => { - const result = await app.service('users').get(1) - - assert.deepStrictEqual(result, {}) - }) - - it('fails for invalid params.authentication', async () => { - try { - await app.service('users').get(1, { - authentication: { - strategy: 'first', - some: 'thing' - } - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual(error.message, 'Invalid Dave') - } - }) - - it('fails for external calls without authentication', async () => { - try { - await app.service('users').get(1, { - provider: 'rest' - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual(error.message, 'Not authenticated') - } - }) - - it('passes with authenticated: true but external call', async () => { - const params = { - provider: 'rest', - authenticated: true - } - const result = await app.service('users').get(1, params) - - assert.deepStrictEqual(result, params) - }) - - it('errors when used on the authentication service', async () => { - const auth = app.service('authentication') - - auth.hooks({ - before: { - create: authenticate('first') - } - }) - - try { - await auth.create({ - strategy: 'first', - username: 'David' - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual( - error.message, - 'The authenticate hook does not need to be used on the authentication service' - ) - } - }) -}) diff --git a/packages/authentication/test/hooks/event.test.ts b/packages/authentication/test/hooks/event.test.ts deleted file mode 100644 index e602febdff..0000000000 --- a/packages/authentication/test/hooks/event.test.ts +++ /dev/null @@ -1,83 +0,0 @@ -import assert from 'assert' -import { feathers, HookContext } from '@feathersjs/feathers' - -import hook from '../../src/hooks/event' -import { AuthenticationParams, AuthenticationRequest, AuthenticationResult } from '../../src/core' - -describe('authentication/hooks/events', () => { - const app = feathers().use('authentication', { - async create(data: AuthenticationRequest) { - return data - }, - - async remove(id: string) { - return { id } - } - }) - - const service = app.service('authentication') - - service.hooks({ - create: [hook('login')], - remove: [hook('logout')] - }) - - it('login', (done) => { - const data = { - message: 'test' - } - - app.once('login', (result: AuthenticationResult, params: AuthenticationParams, context: HookContext) => { - try { - assert.deepStrictEqual(result, data) - assert.ok(params.testParam) - assert.ok(context.method, 'create') - done() - } catch (error: any) { - done(error) - } - }) - - service.create(data, { - testParam: true, - provider: 'test' - } as any) - }) - - it('logout', (done) => { - app.once('logout', (result: AuthenticationResult, params: AuthenticationParams, context: HookContext) => { - try { - assert.deepStrictEqual(result, { - id: 'test' - }) - assert.ok(params.testParam) - assert.ok(context.method, 'remove') - done() - } catch (error: any) { - done(error) - } - }) - - service.remove('test', { - testParam: true, - provider: 'test' - } as any) - }) - - it('does nothing when provider is not set', (done) => { - const handler = () => { - done(new Error('Should never get here')) - } - - app.on('logout', handler) - service.once('removed', (result: AuthenticationResult) => { - app.removeListener('logout', handler) - assert.deepStrictEqual(result, { - id: 'test' - }) - done() - }) - - service.remove('test') - }) -}) diff --git a/packages/authentication/test/jwt.test.ts b/packages/authentication/test/jwt.test.ts deleted file mode 100644 index 8120d3cb9f..0000000000 --- a/packages/authentication/test/jwt.test.ts +++ /dev/null @@ -1,492 +0,0 @@ -import assert from 'assert' -import merge from 'lodash/merge' -import { feathers, Application, Service } from '@feathersjs/feathers' -import { memory } from '@feathersjs/memory' -import { getDispatch, resolve, resolveDispatch } from '@feathersjs/schema' - -import { AuthenticationService, JWTStrategy, hooks } from '../src' -import { ServerResponse } from 'http' -import { MockRequest } from './fixtures' - -const { authenticate } = hooks - -describe('authentication/jwt', () => { - let app: Application<{ - authentication: AuthenticationService - users: Partial - protected: Partial - }> - let user: any - let accessToken: string - let payload: any - - const userDispatchResolver = resolve ({ - converter: async () => { - return { - dispatch: true, - message: 'Hello world' - } - }, - properties: {} - }) - - beforeEach(async () => { - app = feathers() - - const authService = new AuthenticationService(app, 'authentication', { - entity: 'user', - service: 'users', - secret: 'supersecret', - authStrategies: ['jwt'] - }) - - authService.register('jwt', new JWTStrategy()) - - app.use('users', memory()) - app.use('protected', { - async get(id, params) { - return { - id, - params - } - } - }) - app.use('authentication', authService) - - const service = app.service('authentication') - - app.service('protected').hooks({ - before: { - all: [authenticate('jwt')] - } - }) - - app.service('users').hooks({ - around: { - all: [resolveDispatch(userDispatchResolver)] - }, - after: { - get: [ - (context) => { - if (context.params.provider) { - context.result.isExternal = true - } - - return context - } - ] - } - }) - - user = await app.service('users').create({ - name: 'David' - }) - - accessToken = await service.createAccessToken( - {}, - { - subject: `${user.id}` - } - ) - - payload = await service.verifyAccessToken(accessToken) - app.setup() - }) - - it('getEntity', async () => { - const [strategy] = app.service('authentication').getStrategies('jwt') as JWTStrategy[] - - let entity = await strategy.getEntity(user.id, { - query: { - name: 'Dave' - } - }) - - assert.deepStrictEqual(entity, user) - - entity = await strategy.getEntity(user.id, { - provider: 'rest' - }) - - assert.deepStrictEqual(entity, { - ...user, - isExternal: true - }) - }) - - describe('handleConnection', () => { - it('adds entity and authentication information on create', async () => { - const connection: any = {} - - await app.service('authentication').create( - { - strategy: 'jwt', - accessToken - }, - { connection } - ) - - assert.deepStrictEqual(connection.user, user) - assert.deepStrictEqual(connection.authentication, { - strategy: 'jwt', - accessToken - }) - }) - - it('login event connection has authentication information (#2908)', async () => { - const connection: any = {} - const onLogin = new Promise((resolve, reject) => - app.once('login', (data, { connection }) => { - try { - assert.deepStrictEqual(connection.user, { - ...user, - isExternal: true - }) - resolve(data) - } catch (error) { - reject(error) - } - }) - ) - - await app.service('authentication').create( - { - strategy: 'jwt', - accessToken - }, - { connection, provider: 'test' } - ) - - await onLogin - }) - - it('resolves safe dispatch data in authentication result', async () => { - const authResult = await app.service('authentication').create({ - strategy: 'jwt', - accessToken - }) - - const dispatch = getDispatch(authResult) - - assert.deepStrictEqual(dispatch.user, { dispatch: true, message: 'Hello world' }) - }) - - it('sends disconnect event when connection token expires and removes all connection information', async () => { - const connection: any = {} - const token: string = await app.service('authentication').createAccessToken( - {}, - { - subject: `${user.id}`, - expiresIn: '1s' - } - ) - - const result = await app.service('authentication').create( - { - strategy: 'jwt', - accessToken: token - }, - { connection } - ) - - assert.ok(connection.authentication) - - assert.strictEqual(result.accessToken, token) - - const disconnection = await new Promise((resolve) => app.once('disconnect', resolve)) - - assert.strictEqual(disconnection, connection) - - assert.ok(!connection.authentication) - assert.ok(!connection.user) - assert.strictEqual(Object.keys(connection).length, 0) - }) - - it('deletes authentication information on remove', async () => { - const connection: any = {} - - await app.service('authentication').create( - { - strategy: 'jwt', - accessToken - }, - { connection } - ) - - assert.ok(connection.authentication) - - await app.service('authentication').remove(null, { - authentication: connection.authentication, - connection - }) - - assert.ok(!connection.authentication) - assert.ok(!connection.user) - }) - - it('deletes authentication information on disconnect but maintains it in event handler', async () => { - const connection: any = {} - - await app.service('authentication').create( - { - strategy: 'jwt', - accessToken - }, - { connection } - ) - - assert.ok(connection.authentication) - assert.ok(connection.user) - - const disconnectPromise = new Promise((resolve, reject) => - app.once('disconnect', (connection) => { - try { - assert.ok(connection.authentication) - assert.ok(connection.user) - resolve(connection) - } catch (error) { - reject(error) - } - }) - ) - app.emit('disconnect', connection) - - await disconnectPromise - await new Promise((resolve) => process.nextTick(resolve)) - - assert.ok(!connection.authentication) - assert.ok(!connection.user) - }) - - it('does not remove if accessToken does not match', async () => { - const connection: any = {} - - await app.service('authentication').create( - { - strategy: 'jwt', - accessToken - }, - { connection } - ) - - assert.ok(connection.authentication) - - await app.service('authentication').remove(null, { - authentication: { - strategy: 'jwt', - accessToken: await app.service('authentication').createAccessToken( - {}, - { - subject: `${user.id}` - } - ) - }, - connection - }) - - assert.ok(connection.authentication) - }) - }) - - describe('with authenticate hook', () => { - it('fails for protected service and external call when not set', async () => { - try { - await app.service('protected').get('test', { - provider: 'rest' - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual(error.message, 'Not authenticated') - } - }) - - it('fails for protected service and external call when not strategy', async () => { - try { - await app.service('protected').get('test', { - provider: 'rest', - authentication: { - username: 'Dave' - } - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual(error.message, 'Invalid authentication information (no `strategy` set)') - } - }) - - it('fails when entity service was not found', async () => { - delete app.services.users - - await assert.rejects( - () => - app.service('protected').get('test', { - provider: 'rest', - authentication: { - strategy: 'jwt', - accessToken - } - }), - { - message: "Can not find service 'users'" - } - ) - }) - - it('fails when accessToken is not set', async () => { - try { - await app.service('protected').get('test', { - provider: 'rest', - authentication: { - strategy: 'jwt' - } - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual(error.message, 'No access token') - } - }) - - it('passes when authentication is set and merges params', async () => { - const params = { - provider: 'rest', - authentication: { - strategy: 'jwt', - accessToken - } - } - - const result = await app.service('protected').get('test', params) - - assert.strictEqual(Object.keys(result.params).length, 4) - assert.ok(!result.params.accessToken, 'Did not merge accessToken') - assert.deepStrictEqual(result, { - id: 'test', - params: merge({}, params, { - user, - authentication: { payload }, - authenticated: true - }) - }) - }) - - it('works with entity set to null', async () => { - const params = { - provider: 'rest', - authentication: { - strategy: 'jwt', - accessToken - } - } - - app.get('authentication').entity = null - - const result = await app.service('protected').get('test', params) - - assert.strictEqual(Object.keys(result.params).length, 3) - assert.ok(!result.params.accessToken, 'Did not merge accessToken') - assert.deepStrictEqual(result, { - id: 'test', - params: merge({}, params, { - authentication: { payload }, - authenticated: true - }) - }) - }) - }) - - describe('on authentication service', () => { - it('authenticates but does not return a new accessToken', async () => { - const authResult = await app.service('authentication').create({ - strategy: 'jwt', - accessToken - }) - - assert.strictEqual(authResult.accessToken, accessToken) - assert.deepStrictEqual(authResult.user, user) - assert.deepStrictEqual(authResult.authentication.payload, payload) - }) - - it('errors when trying to set invalid option', () => { - app.get('authentication').otherJwt = { - expiresIn: 'something' - } - - try { - app.service('authentication').register('otherJwt', new JWTStrategy()) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual( - error.message, - "Invalid JwtStrategy option 'authentication.otherJwt.expiresIn'. Did you mean to set it in 'authentication.jwtOptions'?" - ) - } - }) - - it('errors when `header` option is an object`', () => { - app.get('authentication').otherJwt = { - header: { message: 'This is wrong' } - } - - assert.throws(() => app.service('authentication').register('otherJwt', new JWTStrategy()), { - message: "The 'header' option for the otherJwt strategy must be a string" - }) - }) - }) - - describe('parse', () => { - const res = {} as ServerResponse - - it('returns null when header not set', async () => { - const req = {} as MockRequest - - const result = await app.service('authentication').parse(req, res, 'jwt') - - assert.strictEqual(result, null) - }) - - it('parses plain Authorization header', async () => { - const req = { - headers: { - authorization: accessToken - } - } as MockRequest - - const result = await app.service('authentication').parse(req, res, 'jwt') - - assert.deepStrictEqual(result, { - strategy: 'jwt', - accessToken - }) - }) - - it('parses Authorization header with Bearer scheme', async () => { - const req = { - headers: { - authorization: ` Bearer ${accessToken} ` - } - } as MockRequest - - const result = await app.service('authentication').parse(req, res, 'jwt') - - assert.deepStrictEqual(result, { - strategy: 'jwt', - accessToken - }) - }) - - it('return null when scheme does not match', async () => { - const req = { - headers: { - authorization: ' Basic something' - } - } as MockRequest - - const result = await app.service('authentication').parse(req, res, 'jwt') - - assert.strictEqual(result, null) - }) - }) -}) diff --git a/packages/authentication/test/service.test.ts b/packages/authentication/test/service.test.ts deleted file mode 100644 index 3594822bba..0000000000 --- a/packages/authentication/test/service.test.ts +++ /dev/null @@ -1,322 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -import assert from 'assert' -import omit from 'lodash/omit' -import jwt from 'jsonwebtoken' -import { feathers, Application } from '@feathersjs/feathers' -import { memory, MemoryService } from '@feathersjs/memory' - -import { defaultOptions } from '../src/options' -import { AuthenticationService } from '../src' - -import { Strategy1 } from './fixtures' - -const UUID = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/ - -describe('authentication/service', () => { - const message = 'Some payload' - - let app: Application<{ - authentication: AuthenticationService - users: MemoryService - }> - - beforeEach(() => { - app = feathers() - app.use( - 'authentication', - new AuthenticationService(app, 'authentication', { - entity: 'user', - service: 'users', - secret: 'supersecret', - authStrategies: ['first'] - }) - ) - app.use('users', memory()) - - app.service('authentication').register('first', new Strategy1()) - }) - - it('settings returns authentication options', () => { - assert.deepStrictEqual( - app.service('authentication').configuration, - Object.assign({}, defaultOptions, app.get('authentication')) - ) - }) - - it('app.defaultAuthentication()', () => { - assert.strictEqual(app.defaultAuthentication(), app.service('authentication')) - assert.throws(() => app.defaultAuthentication('dummy'), { - message: "Can not find service 'dummy'" - }) - }) - - describe('create', () => { - it('creates a valid accessToken and includes strategy result', async () => { - const service = app.service('authentication') - const result = await service.create({ - strategy: 'first', - username: 'David' - }) - - const settings = service.configuration.jwtOptions - const decoded = jwt.decode(result.accessToken) - - if (typeof decoded === 'string') { - throw new Error('Unexpected decoded JWT type') - } - - assert.ok(result.accessToken) - assert.deepStrictEqual(omit(result, 'accessToken', 'authentication'), Strategy1.result) - assert.deepStrictEqual(result.authentication.payload, decoded) - assert.ok(UUID.test(decoded.jti), 'Set `jti` to default UUID') - assert.strictEqual(decoded.aud, settings.audience) - assert.strictEqual(decoded.iss, settings.issuer) - }) - - it('fails when strategy fails', async () => { - try { - await app.service('authentication').create({ - strategy: 'first', - username: 'Dave' - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual(error.message, 'Invalid Dave') - } - }) - - it('creates a valid accessToken with strategy and params.payload', async () => { - const result = await app.service('authentication').create( - { - strategy: 'first', - username: 'David' - }, - { - payload: { message } - } - ) - - const decoded = jwt.decode(result.accessToken) - - if (typeof decoded === 'string') { - throw new Error('Unexpected decoded JWT type') - } - - assert.strictEqual(decoded.message, message) - }) - - it('sets the subject authResult[entity][entityService.id]', async () => { - const { accessToken } = await app.service('authentication').create({ - strategy: 'first', - username: 'David' - }) - - const decoded = jwt.decode(accessToken) - - assert.strictEqual(decoded.sub, Strategy1.result.user.id.toString()) - }) - - it('sets the subject authResult[entity][entityId]', async () => { - app.get('authentication').entityId = 'name' - - const { accessToken } = await app.service('authentication').create({ - strategy: 'first', - username: 'David' - }) - - const decoded = jwt.decode(accessToken) - - assert.strictEqual(decoded.sub, Strategy1.result.user.name.toString()) - }) - - it('does not override the subject if already set', async () => { - const subject = 'Davester' - - const { accessToken } = await app.service('authentication').create( - { - strategy: 'first', - username: 'David' - }, - { - jwt: { subject } - } - ) - - const decoded = jwt.decode(accessToken) - - assert.strictEqual(decoded.sub, subject) - }) - - it('errors when subject can not be found', async () => { - // @ts-ignore - app.service('users').options.id = 'somethingElse' - - try { - await app.service('authentication').create({ - strategy: 'first', - username: 'David' - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual(error.message, 'Can not set subject from user.somethingElse') - } - }) - - it('errors when no allowed strategies are set', async () => { - const service = app.service('authentication') - const configuration = service.configuration - - delete configuration.authStrategies - - app.set('authentication', configuration) - - try { - await service.create({ - strategy: 'first', - username: 'Dave' - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.name, 'NotAuthenticated') - assert.strictEqual( - error.message, - 'No authentication strategies allowed for creating a JWT (`authStrategies`)' - ) - } - }) - }) - - describe('remove', () => { - it('can remove with authentication strategy set', async () => { - const authResult = await app.service('authentication').remove(null, { - authentication: { - strategy: 'first', - username: 'David' - } - }) - - assert.deepStrictEqual(authResult, Strategy1.result) - }) - - it('passes when id is set and matches accessToken', async () => { - const authResult = await app.service('authentication').remove('test', { - authentication: { - strategy: 'first', - username: 'David', - accessToken: 'test' - } - }) - - assert.deepStrictEqual(authResult, Strategy1.result) - }) - - it('fails when id is set and does not match accessToken', async () => { - await assert.rejects( - () => - app.service('authentication').remove('test', { - authentication: { - strategy: 'first', - username: 'David', - accessToken: 'testing' - } - }), - { - name: 'NotAuthenticated', - message: 'Invalid access token' - } - ) - }) - - it('errors when trying to remove with nothing', async () => { - try { - await app.service('authentication').remove(null) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.message, 'Invalid authentication information (no `strategy` set)') - } - }) - }) - - describe('setup', () => { - it('errors when there is no secret', async () => { - delete app.get('authentication').secret - - await assert.rejects(() => app.setup(), { - message: "A 'secret' must be provided in your authentication configuration" - }) - }) - - it('throws an error if service name is not set', async () => { - const otherApp = feathers() - - otherApp.use( - '/authentication', - new AuthenticationService(otherApp, 'authentication', { - secret: 'supersecret', - authStrategies: ['first'] - }) - ) - - await assert.rejects(() => otherApp.setup(), { - message: "The 'service' option is not set in the authentication configuration" - }) - }) - - it('throws an error if entity service does not exist', async () => { - const otherApp = feathers() - - otherApp.use( - '/authentication', - new AuthenticationService(otherApp, 'authentication', { - entity: 'user', - service: 'users', - secret: 'supersecret', - authStrategies: ['first'] - }) - ) - - await assert.rejects(() => otherApp.setup(), { - message: "Can not find service 'users'" - }) - }) - - it('throws an error if entity service exists but has no `id`', async () => { - const otherApp = feathers() - - otherApp.use( - '/authentication', - new AuthenticationService(otherApp, 'authentication', { - entity: 'user', - service: 'users', - secret: 'supersecret', - strategies: ['first'] - }) - ) - - otherApp.use('/users', { - async get() { - return {} - } - }) - - await assert.rejects(() => otherApp.setup(), { - message: "The 'users' service does not have an 'id' property and no 'entityId' option is set." - }) - }) - - it('passes when entity service exists and `entityId` property is set', () => { - app.get('authentication').entityId = 'id' - app.use('users', memory()) - - app.setup() - }) - - it('does nothing when `entity` is explicitly `null`', () => { - app.get('authentication').entity = null - - app.setup() - }) - }) -}) diff --git a/packages/authentication/tsconfig.json b/packages/authentication/tsconfig.json deleted file mode 100644 index 316fd41336..0000000000 --- a/packages/authentication/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig", - "include": [ - "src/**/*.ts" - ], - "compilerOptions": { - "outDir": "lib" - } -} diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md deleted file mode 100644 index 47c16929d0..0000000000 --- a/packages/cli/CHANGELOG.md +++ /dev/null @@ -1,300 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [5.0.34](https://github.com/feathersjs/feathers/compare/v5.0.33...v5.0.34) (2025-05-03) - -### Bug Fixes - -- Update dependencies ([#3584](https://github.com/feathersjs/feathers/issues/3584)) ([119fa4e](https://github.com/feathersjs/feathers/commit/119fa4e1ade8b0078aa235083d566e2538b3a084)) - -## [5.0.33](https://github.com/feathersjs/feathers/compare/v5.0.32...v5.0.33) (2025-02-24) - -### Bug Fixes - -- **dependencies:** Update dependencies ([#3571](https://github.com/feathersjs/feathers/issues/3571)) ([ad611cb](https://github.com/feathersjs/feathers/commit/ad611cb6ffb1dc31d603ba5817331318c5a23217)) - -## [5.0.32](https://github.com/feathersjs/feathers/compare/v5.0.31...v5.0.32) (2025-02-01) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.31](https://github.com/feathersjs/feathers/compare/v5.0.30...v5.0.31) (2024-10-31) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3545](https://github.com/feathersjs/feathers/issues/3545)) ([221b92b](https://github.com/feathersjs/feathers/commit/221b92bb0ee5d54fb1036742968797cb02e56da2)) - -## [5.0.30](https://github.com/feathersjs/feathers/compare/v5.0.29...v5.0.30) (2024-09-02) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.29](https://github.com/feathersjs/feathers/compare/v5.0.28...v5.0.29) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.28](https://github.com/feathersjs/feathers/compare/v5.0.27...v5.0.28) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.27](https://github.com/feathersjs/feathers/compare/v5.0.26...v5.0.27) (2024-06-18) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.26](https://github.com/feathersjs/feathers/compare/v5.0.25...v5.0.26) (2024-06-09) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.25](https://github.com/feathersjs/feathers/compare/v5.0.24...v5.0.25) (2024-05-03) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.24](https://github.com/feathersjs/feathers/compare/v5.0.23...v5.0.24) (2024-03-13) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.23](https://github.com/feathersjs/feathers/compare/v5.0.22...v5.0.23) (2024-02-25) - -### Bug Fixes - -- **core:** Update to latest feathersjs/hooks ([#3434](https://github.com/feathersjs/feathers/issues/3434)) ([1499ccc](https://github.com/feathersjs/feathers/commit/1499ccc41fb3ebba97b2c84e0cb19bc48ad3c651)) - -## [5.0.22](https://github.com/feathersjs/feathers/compare/v5.0.21...v5.0.22) (2024-02-15) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.21](https://github.com/feathersjs/feathers/compare/v5.0.20...v5.0.21) (2024-01-25) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.20](https://github.com/feathersjs/feathers/compare/v5.0.19...v5.0.20) (2024-01-24) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.19](https://github.com/feathersjs/feathers/compare/v5.0.18...v5.0.19) (2024-01-23) - -### Bug Fixes - -- **cli:** Add JS extension to binaries ([#3398](https://github.com/feathersjs/feathers/issues/3398)) ([aaf181d](https://github.com/feathersjs/feathers/commit/aaf181d924d0cb67c7792a54197082c59109264d)) - -## [5.0.18](https://github.com/feathersjs/feathers/compare/v5.0.17...v5.0.18) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.17](https://github.com/feathersjs/feathers/compare/v5.0.16...v5.0.17) (2024-01-22) - -### Bug Fixes - -- **cli:** Fix another ES module issue ([#3395](https://github.com/feathersjs/feathers/issues/3395)) ([8e39884](https://github.com/feathersjs/feathers/commit/8e39884a23d0e7868546dce4f7a3ee6e954c2b31)) - -## [5.0.16](https://github.com/feathersjs/feathers/compare/v5.0.15...v5.0.16) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.15](https://github.com/feathersjs/feathers/compare/v5.0.14...v5.0.15) (2024-01-22) - -### Bug Fixes - -- **generators:** Move generators and CLI to featherscloud/pinion ([#3386](https://github.com/feathersjs/feathers/issues/3386)) ([eb87c99](https://github.com/feathersjs/feathers/commit/eb87c9922db56c5610e5b808f3ffe033c830e2b2)) - -## [5.0.14](https://github.com/feathersjs/feathers/compare/v5.0.13...v5.0.14) (2024-01-05) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.13](https://github.com/feathersjs/feathers/compare/v5.0.12...v5.0.13) (2023-12-29) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.12](https://github.com/feathersjs/feathers/compare/v5.0.11...v5.0.12) (2023-11-28) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.11](https://github.com/feathersjs/feathers/compare/v5.0.10...v5.0.11) (2023-10-11) - -### Bug Fixes - -- **knex:** Update all dependencies and Knex peer ([#3308](https://github.com/feathersjs/feathers/issues/3308)) ([d2f9860](https://github.com/feathersjs/feathers/commit/d2f986036c4741cce2339d8abbcc6b2eb037a12a)) - -## [5.0.10](https://github.com/feathersjs/feathers/compare/v5.0.9...v5.0.10) (2023-10-03) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.9](https://github.com/feathersjs/feathers/compare/v5.0.8...v5.0.9) (2023-09-27) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.8](https://github.com/feathersjs/feathers/compare/v5.0.7...v5.0.8) (2023-07-19) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.7](https://github.com/feathersjs/feathers/compare/v5.0.6...v5.0.7) (2023-07-14) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.6](https://github.com/feathersjs/feathers/compare/v5.0.5...v5.0.6) (2023-06-15) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.5](https://github.com/feathersjs/feathers/compare/v5.0.4...v5.0.5) (2023-04-28) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.4](https://github.com/feathersjs/feathers/compare/v5.0.3...v5.0.4) (2023-04-12) - -### Bug Fixes - -- Make sure all Readme files are up to date ([#3154](https://github.com/feathersjs/feathers/issues/3154)) ([a5f0b38](https://github.com/feathersjs/feathers/commit/a5f0b38bbf2a11486415a39533bcc6c67fb51e3e)) - -## [5.0.3](https://github.com/feathersjs/feathers/compare/v5.0.2...v5.0.3) (2023-04-05) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3139](https://github.com/feathersjs/feathers/issues/3139)) ([f24276e](https://github.com/feathersjs/feathers/commit/f24276e9a909e2e58a0730c730258ce1f70f4028)) - -## [5.0.2](https://github.com/feathersjs/feathers/compare/v5.0.1...v5.0.2) (2023-03-23) - -**Note:** Version bump only for package @feathersjs/cli - -## [5.0.1](https://github.com/feathersjs/feathers/compare/v5.0.0...v5.0.1) (2023-03-15) - -**Note:** Version bump only for package @feathersjs/cli - -# [5.0.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.38...v5.0.0) (2023-02-24) - -**Note:** Version bump only for package @feathersjs/cli - -# [5.0.0-pre.38](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.37...v5.0.0-pre.38) (2023-02-17) - -### Features - -- **generators:** Final tweaks to the generators ([#3060](https://github.com/feathersjs/feathers/issues/3060)) ([1bf1544](https://github.com/feathersjs/feathers/commit/1bf1544fa8deeaa44ba354fb539dc3f1fd187767)) - -# [5.0.0-pre.37](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.36...v5.0.0-pre.37) (2023-02-09) - -**Note:** Version bump only for package @feathersjs/cli - -# [5.0.0-pre.36](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.35...v5.0.0-pre.36) (2023-01-29) - -### Bug Fixes - -- Update all dependencies ([#3024](https://github.com/feathersjs/feathers/issues/3024)) ([283dc47](https://github.com/feathersjs/feathers/commit/283dc4798d85584bc031e6e54b83b4ea77d1edd0)) - -# [5.0.0-pre.35](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.34...v5.0.0-pre.35) (2023-01-12) - -### Bug Fixes - -- **cli:** Add unhandledRejection handler to generated index file ([#2932](https://github.com/feathersjs/feathers/issues/2932)) ([e3cedc8](https://github.com/feathersjs/feathers/commit/e3cedc8e00f52d892f21fd6a3eb4ca4fe40a903c)) -- **cli:** Minor generated app improvements ([#2936](https://github.com/feathersjs/feathers/issues/2936)) ([ba1a550](https://github.com/feathersjs/feathers/commit/ba1a5500a8a5ea4ab44da44ac509e48c723d7efd)) -- **cli:** Properly log validation errors in log-error hook ([54c883c](https://github.com/feathersjs/feathers/commit/54c883c2bb5c35c02b1a2081b2f17554550aa1d4)) -- **cli:** Use correct package manager when installing an app ([#2973](https://github.com/feathersjs/feathers/issues/2973)) ([99c2a70](https://github.com/feathersjs/feathers/commit/99c2a70b77f0b68698a66180b69a56cb20c2ca0d)) - -### Features - -- **generators:** Move core code generators to shared generators package ([#2982](https://github.com/feathersjs/feathers/issues/2982)) ([0328d22](https://github.com/feathersjs/feathers/commit/0328d2292153870bc43958f73d2c6f288a8cec17)) - -# [5.0.0-pre.34](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.33...v5.0.0-pre.34) (2022-12-14) - -### Bug Fixes - -- **cli:** mongodb connection string for node 17+ ([#2875](https://github.com/feathersjs/feathers/issues/2875)) ([7fa2012](https://github.com/feathersjs/feathers/commit/7fa2012897d8429b522fbca72211fc9be1c25f7e)) - -### Features - -- **adapter:** Add patch data type to adapters and refactor AdapterBase usage ([#2906](https://github.com/feathersjs/feathers/issues/2906)) ([9ddc2e6](https://github.com/feathersjs/feathers/commit/9ddc2e6b028f026f939d6af68125847e5c6734b4)) -- **cli:** Use separate patch schema and types ([#2916](https://github.com/feathersjs/feathers/issues/2916)) ([7088af6](https://github.com/feathersjs/feathers/commit/7088af64a539dc7f1a016d832b77b98aaaf92603)) -- **docs:** CLI and application structure guide ([#2818](https://github.com/feathersjs/feathers/issues/2818)) ([142914f](https://github.com/feathersjs/feathers/commit/142914fc001a8420056dd56db992c1c4f1bd312c)) -- **schema:** Split resolver options and property resolvers ([#2889](https://github.com/feathersjs/feathers/issues/2889)) ([4822c94](https://github.com/feathersjs/feathers/commit/4822c949812e5a1dceff3c62b2f9de4781b4d601)) -- **schema:** Virtual property resolvers ([#2900](https://github.com/feathersjs/feathers/issues/2900)) ([7d03b57](https://github.com/feathersjs/feathers/commit/7d03b57ae2f633bdd4a368e0d5955011fbd6c329)) - -# [5.0.0-pre.33](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.32...v5.0.0-pre.33) (2022-11-08) - -### Bug Fixes - -- **cli:** Fix MongoDB connection database name parsing ([#2845](https://github.com/feathersjs/feathers/issues/2845)) ([50e7463](https://github.com/feathersjs/feathers/commit/50e7463971ef95cb98358b70a721e67554d92eb5)) -- **cli:** Use proper MSSQL client ([#2853](https://github.com/feathersjs/feathers/issues/2853)) ([bae5176](https://github.com/feathersjs/feathers/commit/bae5176488b46fc377e53719d20e0036e087aa16)) -- **docs:** Add JavaScript web app frontend guide ([#2834](https://github.com/feathersjs/feathers/issues/2834)) ([68cf03f](https://github.com/feathersjs/feathers/commit/68cf03f092da38ccbec5e9fd42b95d00f5a0a9f2)) - -### Features - -- **mongodb:** Add ObjectId resolvers and MongoDB option in the guide ([#2847](https://github.com/feathersjs/feathers/issues/2847)) ([c5c1fba](https://github.com/feathersjs/feathers/commit/c5c1fba5718a63412075cd3838b86b889eb0bd48)) - -# [5.0.0-pre.32](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.31...v5.0.0-pre.32) (2022-10-26) - -### Bug Fixes - -- **cli:** Ensure code injection points are not code style dependent ([#2832](https://github.com/feathersjs/feathers/issues/2832)) ([0776e26](https://github.com/feathersjs/feathers/commit/0776e26bfe4c1df9d2786499941bd3faba1715c0)) -- **cli:** Only generate authentication setup when selected ([#2823](https://github.com/feathersjs/feathers/issues/2823)) ([7d219d9](https://github.com/feathersjs/feathers/commit/7d219d9c5269267b50f3ce99a5653d645f9927c1)) -- **docs:** Review transport API docs and update Express middleware setup ([#2811](https://github.com/feathersjs/feathers/issues/2811)) ([1b97f14](https://github.com/feathersjs/feathers/commit/1b97f14d474f5613482f259eeaa585c24fcfab43)) -- **transports:** Add remaining middleware for generated apps to Koa and Express ([#2796](https://github.com/feathersjs/feathers/issues/2796)) ([0d5781a](https://github.com/feathersjs/feathers/commit/0d5781a5c72a0cbb2ec8211bfa099f0aefe115a2)) - -### Features - -- **cli:** Add authentication client to generated client ([#2801](https://github.com/feathersjs/feathers/issues/2801)) ([bd59f91](https://github.com/feathersjs/feathers/commit/bd59f91b45a01c2eea0c4386e567f4de5aa6ad99)) - -# [5.0.0-pre.31](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.30...v5.0.0-pre.31) (2022-10-12) - -### Features - -- **cli:** Generate full client test suite and improve typed client ([#2788](https://github.com/feathersjs/feathers/issues/2788)) ([57119b6](https://github.com/feathersjs/feathers/commit/57119b6bb2797f7297cf054268a248c093ecd538)) -- **cli:** Improve generated schema definitions ([#2783](https://github.com/feathersjs/feathers/issues/2783)) ([474a9fd](https://github.com/feathersjs/feathers/commit/474a9fda2107e9bcf357746320a8e00cda8182b6)) - -# [5.0.0-pre.30](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.29...v5.0.0-pre.30) (2022-10-07) - -### Bug Fixes - -- **core:** Ensure setup and teardown can be overriden and maintain hook functionality ([#2779](https://github.com/feathersjs/feathers/issues/2779)) ([ab580cb](https://github.com/feathersjs/feathers/commit/ab580cbcaa68d19144d86798c13bf564f9d424a6)) - -### Features - -- **cli:** Add ability to `npm init feathers` ([#2755](https://github.com/feathersjs/feathers/issues/2755)) ([d734931](https://github.com/feathersjs/feathers/commit/d734931ffd4f983a05d9e771ce0e43b696c2bc0e)) -- **cli:** Improve CLI interface ([#2753](https://github.com/feathersjs/feathers/issues/2753)) ([c7e1b7e](https://github.com/feathersjs/feathers/commit/c7e1b7e80aacb84441908c3d73512d9cf7557f7e)) -- **core:** Allow to unregister services at runtime ([#2756](https://github.com/feathersjs/feathers/issues/2756)) ([d16601f](https://github.com/feathersjs/feathers/commit/d16601f2277dca5357866ffdefba2a611f6dc7fa)) -- **schema:** Make schemas validation library independent and add TypeBox support ([#2772](https://github.com/feathersjs/feathers/issues/2772)) ([44172d9](https://github.com/feathersjs/feathers/commit/44172d99b566d11d9ceda04f1d0bf72b6d05ce76)) - -# [5.0.0-pre.29](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.28...v5.0.0-pre.29) (2022-09-16) - -### Features - -- Add CORS support to oAuth, Express, Koa and generated application ([#2744](https://github.com/feathersjs/feathers/issues/2744)) ([fd218f2](https://github.com/feathersjs/feathers/commit/fd218f289f8ca4c101e9938e8683e2efef6e8131)) -- **authentication-oauth:** Koa and transport independent oAuth authentication ([#2737](https://github.com/feathersjs/feathers/issues/2737)) ([9231525](https://github.com/feathersjs/feathers/commit/9231525a24bb790ba9c5d940f2867a9c727691c9)) -- **cli:** Add custom environment variable support to generated application ([#2751](https://github.com/feathersjs/feathers/issues/2751)) ([c7bf80d](https://github.com/feathersjs/feathers/commit/c7bf80d82c28c190e3f0136d51af5b7de1bc4868)) -- **cli:** Adding ClientService to CLI ([#2750](https://github.com/feathersjs/feathers/issues/2750)) ([1d45427](https://github.com/feathersjs/feathers/commit/1d45427988521ac028755cbe128685fcdf34f636)) - -# [5.0.0-pre.28](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.27...v5.0.0-pre.28) (2022-08-03) - -### Bug Fixes - -- **cli:** Improve generated application and client ([#2701](https://github.com/feathersjs/feathers/issues/2701)) ([bd55ffb](https://github.com/feathersjs/feathers/commit/bd55ffb812e89bf215f4515e7f137656ea888c3f)) - -# [5.0.0-pre.27](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.26...v5.0.0-pre.27) (2022-07-13) - -### Bug Fixes - -- **cli:** Fix flaky authentication migration and SQL id schema types ([#2676](https://github.com/feathersjs/feathers/issues/2676)) ([04ce9a5](https://github.com/feathersjs/feathers/commit/04ce9a53f4226cd6283f9dc241876e90ddf48618)) - -### Features - -- **cli:** Add support for Prettier ([#2684](https://github.com/feathersjs/feathers/issues/2684)) ([83aa8f9](https://github.com/feathersjs/feathers/commit/83aa8f9f212cb122d831dca8858852b0ac9b4da8)) -- **cli:** Improve generated application folder structure ([#2678](https://github.com/feathersjs/feathers/issues/2678)) ([d114557](https://github.com/feathersjs/feathers/commit/d114557721e73d6302aa88c11e3726dbcbd5c92b)) - -# [5.0.0-pre.26](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.25...v5.0.0-pre.26) (2022-06-22) - -### Bug Fixes - -- **cli:** Fix compilation folders that got mixed up ([fc4cb74](https://github.com/feathersjs/feathers/commit/fc4cb742f7f9164096d9319b13dfaaa5f54686a6)) - -# [5.0.0-pre.25](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.24...v5.0.0-pre.25) (2022-06-22) - -### Bug Fixes - -- **cli:** Generator fixes to work with the new guide ([#2674](https://github.com/feathersjs/feathers/issues/2674)) ([b773fa5](https://github.com/feathersjs/feathers/commit/b773fa5dbd7ff450cfb2f7b93e64882592262712)) - -# [5.0.0-pre.24](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.23...v5.0.0-pre.24) (2022-06-21) - -### Features - -- **cli:** Add generators for new Knex SQL database adapter ([#2673](https://github.com/feathersjs/feathers/issues/2673)) ([0fb2c0f](https://github.com/feathersjs/feathers/commit/0fb2c0f629116f71184b8698c383af8cfd149688)) -- **cli:** Add hook generator ([#2667](https://github.com/feathersjs/feathers/issues/2667)) ([24e4bc0](https://github.com/feathersjs/feathers/commit/24e4bc04a67fadee0e6a96a8389d788faba5c305)) -- **cli:** Add support for JavaScript to the new CLI ([#2668](https://github.com/feathersjs/feathers/issues/2668)) ([ebac587](https://github.com/feathersjs/feathers/commit/ebac587f7d00dc7607c3f546352d79f79b89a5d4)) -- **cli:** Add typed client to a generated app ([#2669](https://github.com/feathersjs/feathers/issues/2669)) ([5b801b5](https://github.com/feathersjs/feathers/commit/5b801b5017ddc3eaa95622b539f51d605916bc86)) -- **cli:** Initial Feathers v5 CLI and Pinion generator ([#2578](https://github.com/feathersjs/feathers/issues/2578)) ([7f59ae7](https://github.com/feathersjs/feathers/commit/7f59ae7f1471895ba8a82aa4702f1a23f71b7682)) diff --git a/packages/cli/LICENSE b/packages/cli/LICENSE deleted file mode 100644 index 7839c824d7..0000000000 --- a/packages/cli/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2024 Feathers Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/cli/README.md b/packages/cli/README.md deleted file mode 100644 index 3b99960ca6..0000000000 --- a/packages/cli/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# @feathersjs/cli - -[](https://github.com/feathersjs/feathers/actions?query=workflow%3ACI) -[](https://www.npmjs.com/package/@feathersjs/cli) - -> The command line interface for creating Feathers applications - -## Installation - -``` -npm install @feathersjs/cli --save-dev -``` - -## Usage - -``` -$ npx feathers help -``` - -## Documentation - -Refer to the [Feathers CLI guide](https://feathersjs.com/guides/cli/) for more details. - -## License - -Copyright (c) 2024 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors) - -Licensed under the [MIT license](LICENSE). diff --git a/packages/cli/bin/feathers.js b/packages/cli/bin/feathers.js deleted file mode 100755 index 4e3cf79743..0000000000 --- a/packages/cli/bin/feathers.js +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env node -'use strict' - -import { program } from '../lib/index.js' - -program.parse() diff --git a/packages/cli/package.json b/packages/cli/package.json deleted file mode 100644 index 8ae5716532..0000000000 --- a/packages/cli/package.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "name": "@feathersjs/cli", - "description": "The command line interface for creating Feathers applications", - "version": "5.0.34", - "homepage": "https://feathersjs.com", - "main": "lib/index.js", - "type": "module", - "bin": { - "feathers": "./bin/feathers.js" - }, - "keywords": [ - "feathers", - "feathers-plugin" - ], - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/daffl" - }, - "repository": { - "type": "git", - "url": "git://github.com/feathersjs/feathers.git" - }, - "author": { - "name": "Feathers contributors", - "email": "hello@feathersjs.com", - "url": "https://feathersjs.com" - }, - "contributors": [], - "bugs": { - "url": "https://github.com/feathersjs/feathers/issues" - }, - "engines": { - "node": ">= 14" - }, - "files": [ - "CHANGELOG.md", - "LICENSE", - "README.md", - "lib/**", - "lib/app/static/.gitignore", - "bin/**", - "*.d.ts", - "*.js" - ], - "scripts": { - "prepublish": "npm run compile", - "compile": "shx rm -rf lib/ && tsc", - "mocha": "mocha --timeout 60000 --config ../../.mocharc.json --require tsx --recursive test/**.test.ts test/**/*.test.ts", - "test": "npm run compile && npm run mocha && bin/feathers.js --help" - }, - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@feathersjs/generators": "^5.0.34", - "chalk": "^5.4.1", - "commander": "^13.1.0" - }, - "devDependencies": { - "@feathersjs/adapter-commons": "^5.0.34", - "@feathersjs/authentication": "^5.0.34", - "@feathersjs/authentication-client": "^5.0.34", - "@feathersjs/authentication-local": "^5.0.34", - "@feathersjs/authentication-oauth": "^5.0.34", - "@feathersjs/configuration": "^5.0.34", - "@feathersjs/errors": "^5.0.34", - "@feathersjs/express": "^5.0.34", - "@feathersjs/feathers": "^5.0.34", - "@feathersjs/knex": "^5.0.34", - "@feathersjs/koa": "^5.0.34", - "@feathersjs/mongodb": "^5.0.34", - "@feathersjs/rest-client": "^5.0.34", - "@feathersjs/schema": "^5.0.34", - "@feathersjs/socketio": "^5.0.34", - "@feathersjs/transport-commons": "^5.0.34", - "@feathersjs/typebox": "^5.0.34", - "@types/mocha": "^10.0.10", - "@types/node": "^24.1.0", - "@types/prettier": "^2.7.3", - "axios": "^1.11.0", - "mocha": "^11.7.1", - "shx": "^0.4.0", - "ts-node": "^10.9.2", - "type-fest": "^4.41.0", - "typescript": "^5.9.2" - }, - "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5" -} diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts deleted file mode 100644 index 50263fc9f9..0000000000 --- a/packages/cli/src/index.ts +++ /dev/null @@ -1,72 +0,0 @@ -import chalk from 'chalk' -import { Command } from 'commander' -import { dirname } from 'path' -import { runGenerator, getContext, FeathersBaseContext, version } from '@feathersjs/generators' -import { createRequire } from 'node:module' - -export * from 'commander' -export { chalk } - -const require = createRequire(import.meta.url) - -export const commandRunner = (name: string) => async (options: any) => { - const folder = dirname(require.resolve('@feathersjs/generators')) - const ctx = getContext ({ - ...options - }) - - await Promise.resolve(ctx) - .then(runGenerator(folder, name, 'index.js')) - .catch((error) => { - const { logger } = ctx.pinion - - logger.error(`Error: ${chalk.white(error.message)}`) - }) -} - -export const program = new Command() - -program - .name('feathers') - .description('The Feathers command line interface 🕊️') - .version(version) - .showHelpAfterError() - -const generate = program.command('generate').alias('g') - -generate - .command('app') - .description('Generate a new application') - .option('--name ', 'The name of the application') - .action(commandRunner('app')) - -generate - .command('service') - .description('Generate a new service') - .option('--name ', 'The service name') - .option('--path ', 'The path to register the service on') - .option('--type ', 'The service type (knex, mongodb, custom)') - .action(commandRunner('service')) - -generate - .command('hook') - .description('Generate a hook') - .option('--name ', 'The name of the hook') - .option('--type ', 'The hook type (around or regular)') - .action(commandRunner('hook')) - -generate - .command('connection') - .description('Add a new database connection') - .action(commandRunner('connection')) - -generate - .command('authentication') - .description('Add authentication to the application') - .action(commandRunner('authentication')) - -generate.description( - `Run a generator. Currently available: \n ${generate.commands - .map((cmd) => `${chalk.blue(cmd.name())}: ${cmd.description()} `) - .join('\n ')}` -) diff --git a/packages/cli/test/cli.test.ts b/packages/cli/test/cli.test.ts deleted file mode 100644 index afd1a14473..0000000000 --- a/packages/cli/test/cli.test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { strict } from 'assert' -import { program } from '../src' - -describe('cli tests', () => { - it('exports the program', async () => { - strict.ok(program) - }) -}) diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json deleted file mode 100644 index e7a844ccb1..0000000000 --- a/packages/cli/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../tsconfig", - "include": [ - "src/**/*.ts" - ], - "compilerOptions": { - "outDir": "lib", - "module": "ESNext", - "moduleResolution": "Node" - } -} diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md deleted file mode 100644 index 95f2926cab..0000000000 --- a/packages/client/CHANGELOG.md +++ /dev/null @@ -1,1380 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [5.0.34](https://github.com/feathersjs/feathers/compare/v5.0.33...v5.0.34) (2025-05-03) - -### Bug Fixes - -- Update dependencies ([#3584](https://github.com/feathersjs/feathers/issues/3584)) ([119fa4e](https://github.com/feathersjs/feathers/commit/119fa4e1ade8b0078aa235083d566e2538b3a084)) - -## [5.0.33](https://github.com/feathersjs/feathers/compare/v5.0.32...v5.0.33) (2025-02-24) - -### Bug Fixes - -- **dependencies:** Update dependencies ([#3571](https://github.com/feathersjs/feathers/issues/3571)) ([ad611cb](https://github.com/feathersjs/feathers/commit/ad611cb6ffb1dc31d603ba5817331318c5a23217)) - -## [5.0.32](https://github.com/feathersjs/feathers/compare/v5.0.31...v5.0.32) (2025-02-01) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.31](https://github.com/feathersjs/feathers/compare/v5.0.30...v5.0.31) (2024-10-31) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3545](https://github.com/feathersjs/feathers/issues/3545)) ([221b92b](https://github.com/feathersjs/feathers/commit/221b92bb0ee5d54fb1036742968797cb02e56da2)) - -## [5.0.30](https://github.com/feathersjs/feathers/compare/v5.0.29...v5.0.30) (2024-09-02) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.29](https://github.com/feathersjs/feathers/compare/v5.0.28...v5.0.29) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.28](https://github.com/feathersjs/feathers/compare/v5.0.27...v5.0.28) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.27](https://github.com/feathersjs/feathers/compare/v5.0.26...v5.0.27) (2024-06-18) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.26](https://github.com/feathersjs/feathers/compare/v5.0.25...v5.0.26) (2024-06-09) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.25](https://github.com/feathersjs/feathers/compare/v5.0.24...v5.0.25) (2024-05-03) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.24](https://github.com/feathersjs/feathers/compare/v5.0.23...v5.0.24) (2024-03-13) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.23](https://github.com/feathersjs/feathers/compare/v5.0.22...v5.0.23) (2024-02-25) - -### Bug Fixes - -- **core:** Update to latest feathersjs/hooks ([#3434](https://github.com/feathersjs/feathers/issues/3434)) ([1499ccc](https://github.com/feathersjs/feathers/commit/1499ccc41fb3ebba97b2c84e0cb19bc48ad3c651)) - -## [5.0.22](https://github.com/feathersjs/feathers/compare/v5.0.21...v5.0.22) (2024-02-15) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.21](https://github.com/feathersjs/feathers/compare/v5.0.20...v5.0.21) (2024-01-25) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.20](https://github.com/feathersjs/feathers/compare/v5.0.19...v5.0.20) (2024-01-24) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.19](https://github.com/feathersjs/feathers/compare/v5.0.18...v5.0.19) (2024-01-23) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.18](https://github.com/feathersjs/feathers/compare/v5.0.17...v5.0.18) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.17](https://github.com/feathersjs/feathers/compare/v5.0.16...v5.0.17) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.16](https://github.com/feathersjs/feathers/compare/v5.0.15...v5.0.16) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.15](https://github.com/feathersjs/feathers/compare/v5.0.14...v5.0.15) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.14](https://github.com/feathersjs/feathers/compare/v5.0.13...v5.0.14) (2024-01-05) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.13](https://github.com/feathersjs/feathers/compare/v5.0.12...v5.0.13) (2023-12-29) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.12](https://github.com/feathersjs/feathers/compare/v5.0.11...v5.0.12) (2023-11-28) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.11](https://github.com/feathersjs/feathers/compare/v5.0.10...v5.0.11) (2023-10-11) - -### Bug Fixes - -- **knex:** Update all dependencies and Knex peer ([#3308](https://github.com/feathersjs/feathers/issues/3308)) ([d2f9860](https://github.com/feathersjs/feathers/commit/d2f986036c4741cce2339d8abbcc6b2eb037a12a)) - -## [5.0.10](https://github.com/feathersjs/feathers/compare/v5.0.9...v5.0.10) (2023-10-03) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.9](https://github.com/feathersjs/feathers/compare/v5.0.8...v5.0.9) (2023-09-27) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.8](https://github.com/feathersjs/feathers/compare/v5.0.7...v5.0.8) (2023-07-19) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.7](https://github.com/feathersjs/feathers/compare/v5.0.6...v5.0.7) (2023-07-14) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.6](https://github.com/feathersjs/feathers/compare/v5.0.5...v5.0.6) (2023-06-15) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.5](https://github.com/feathersjs/feathers/compare/v5.0.4...v5.0.5) (2023-04-28) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.4](https://github.com/feathersjs/feathers/compare/v5.0.3...v5.0.4) (2023-04-12) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.3](https://github.com/feathersjs/feathers/compare/v5.0.2...v5.0.3) (2023-04-05) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3139](https://github.com/feathersjs/feathers/issues/3139)) ([f24276e](https://github.com/feathersjs/feathers/commit/f24276e9a909e2e58a0730c730258ce1f70f4028)) - -## [5.0.2](https://github.com/feathersjs/feathers/compare/v5.0.1...v5.0.2) (2023-03-23) - -**Note:** Version bump only for package @feathersjs/client - -## [5.0.1](https://github.com/feathersjs/feathers/compare/v5.0.0...v5.0.1) (2023-03-15) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.38...v5.0.0) (2023-02-24) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.38](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.37...v5.0.0-pre.38) (2023-02-17) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.37](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.36...v5.0.0-pre.37) (2023-02-09) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.36](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.35...v5.0.0-pre.36) (2023-01-29) - -### Bug Fixes - -- Update all dependencies ([#3024](https://github.com/feathersjs/feathers/issues/3024)) ([283dc47](https://github.com/feathersjs/feathers/commit/283dc4798d85584bc031e6e54b83b4ea77d1edd0)) - -# [5.0.0-pre.35](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.34...v5.0.0-pre.35) (2023-01-12) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.34](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.33...v5.0.0-pre.34) (2022-12-14) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.33](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.32...v5.0.0-pre.33) (2022-11-08) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.32](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.31...v5.0.0-pre.32) (2022-10-26) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.31](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.30...v5.0.0-pre.31) (2022-10-12) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.30](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.29...v5.0.0-pre.30) (2022-10-07) - -### Features - -- **core:** Allow to unregister services at runtime ([#2756](https://github.com/feathersjs/feathers/issues/2756)) ([d16601f](https://github.com/feathersjs/feathers/commit/d16601f2277dca5357866ffdefba2a611f6dc7fa)) - -# [5.0.0-pre.29](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.28...v5.0.0-pre.29) (2022-09-16) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.28](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.27...v5.0.0-pre.28) (2022-08-03) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.27](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.26...v5.0.0-pre.27) (2022-07-13) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.26](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.25...v5.0.0-pre.26) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.25](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.24...v5.0.0-pre.25) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.24](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.23...v5.0.0-pre.24) (2022-06-21) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.23](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.22...v5.0.0-pre.23) (2022-06-06) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.22](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.21...v5.0.0-pre.22) (2022-05-24) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.21](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.20...v5.0.0-pre.21) (2022-05-23) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.20](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.19...v5.0.0-pre.20) (2022-05-04) - -### Bug Fixes - -- **dependencies:** Lock monorepo package version numbers ([#2623](https://github.com/feathersjs/feathers/issues/2623)) ([5640c10](https://github.com/feathersjs/feathers/commit/5640c1020cc139994e695d658c08bad3494db507)) - -# [5.0.0-pre.19](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.18...v5.0.0-pre.19) (2022-05-01) - -### Bug Fixes - -- **client:** Fix @feathersjs/client types field ([#2596](https://github.com/feathersjs/feathers/issues/2596)) ([d719f54](https://github.com/feathersjs/feathers/commit/d719f54daee63daf9ed5cc762626ca15131086de)) - -### Features - -- **typescript:** Improve adapter typings ([#2605](https://github.com/feathersjs/feathers/issues/2605)) ([3b2ca0a](https://github.com/feathersjs/feathers/commit/3b2ca0a6a8e03e8390272c4d7e930b4bffdaacf5)) - -# [5.0.0-pre.18](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.17...v5.0.0-pre.18) (2022-04-11) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.17](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.16...v5.0.0-pre.17) (2022-02-15) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.16](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.15...v5.0.0-pre.16) (2022-01-12) - -### Features - -- **express, koa:** make transports similar ([#2486](https://github.com/feathersjs/feathers/issues/2486)) ([26aa937](https://github.com/feathersjs/feathers/commit/26aa937c114fb8596dfefc599b1f53cead69c159)) - -# [5.0.0-pre.15](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.14...v5.0.0-pre.15) (2021-11-27) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.14](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.13...v5.0.0-pre.14) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.13](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.12...v5.0.0-pre.13) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.12](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.11...v5.0.0-pre.12) (2021-10-12) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.11](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.10...v5.0.0-pre.11) (2021-10-06) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.10](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.9...v5.0.0-pre.10) (2021-09-19) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.9](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.8...v5.0.0-pre.9) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.8](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.7...v5.0.0-pre.8) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.7](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.6...v5.0.0-pre.7) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.6](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.5...v5.0.0-pre.6) (2021-08-08) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.4...v5.0.0-pre.5) (2021-06-23) - -### Features - -- **adapter-commons:** Add support for params.adapter option and move memory adapter to @feathersjs/memory ([#2367](https://github.com/feathersjs/feathers/issues/2367)) ([a43e7da](https://github.com/feathersjs/feathers/commit/a43e7da22b6b981a96d1321736ea9a0cb924fb4f)) - -# [5.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.3...v5.0.0-pre.4) (2021-05-13) - -### Features - -- **koa:** KoaJS transport adapter ([#2315](https://github.com/feathersjs/feathers/issues/2315)) ([2554b57](https://github.com/feathersjs/feathers/commit/2554b57cf05731df58feeba9c12faab18e442107)) - -# [5.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.2...v5.0.0-pre.3) (2021-04-21) - -### Bug Fixes - -- **typescript:** Improve TypeScript backwards compatibility ([#2310](https://github.com/feathersjs/feathers/issues/2310)) ([f33be73](https://github.com/feathersjs/feathers/commit/f33be73fc46a533efb15df9aab0658e3240d3897)) - -# [5.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.1...v5.0.0-pre.2) (2021-04-06) - -**Note:** Version bump only for package @feathersjs/client - -# [5.0.0-beta.1](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2021-04-03) - -### Bug Fixes - -- **dependencies:** Fix transport-commons dependency and update other dependencies ([#2284](https://github.com/feathersjs/feathers/issues/2284)) ([05b03b2](https://github.com/feathersjs/feathers/commit/05b03b27b40604d956047e3021d8053c3a137616)) - -# [5.0.0-beta.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.1...v5.0.0-beta.0) (2021-03-28) - -### Bug Fixes - -- Update Grant usage and other dependencies ([#2264](https://github.com/feathersjs/feathers/issues/2264)) ([7b0f8fa](https://github.com/feathersjs/feathers/commit/7b0f8fad252419ed0ad0bf259cdf3104d322ab60)) - -### Features - -- Feathers v5 core refactoring and features ([#2255](https://github.com/feathersjs/feathers/issues/2255)) ([2dafb7c](https://github.com/feathersjs/feathers/commit/2dafb7ce14ba57406aeec13d10ca45b1e709bee9)) - -# [5.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.5.11...v5.0.0-pre.1) (2020-12-17) - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -### chore - -- **package:** Remove @feathersjs/primus packages from core ([#1919](https://github.com/feathersjs/feathers/issues/1919)) ([d20b7d5](https://github.com/feathersjs/feathers/commit/d20b7d5a70f4d3306e294696156e8aa0337c35e9)), closes [#1899](https://github.com/feathersjs/feathers/issues/1899) - -### Features - -- **core:** use @feathers/hooks and add async type ([#1929](https://github.com/feathersjs/feathers/issues/1929)) ([a5c4756](https://github.com/feathersjs/feathers/commit/a5c47562eae8410c82fe2f6308f26f8e78b6a3e8)) - -### BREAKING CHANGES - -- **package:** Remove primus packages to be moved into the ecosystem. - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -### chore - -- **package:** Remove @feathersjs/primus packages from core ([#1919](https://github.com/feathersjs/feathers/issues/1919)) ([d20b7d5](https://github.com/feathersjs/feathers/commit/d20b7d5a70f4d3306e294696156e8aa0337c35e9)), closes [#1899](https://github.com/feathersjs/feathers/issues/1899) - -### Features - -- **core:** use @feathers/hooks and add async type ([#1929](https://github.com/feathersjs/feathers/issues/1929)) ([a5c4756](https://github.com/feathersjs/feathers/commit/a5c47562eae8410c82fe2f6308f26f8e78b6a3e8)) - -### BREAKING CHANGES - -- **package:** Remove primus packages to be moved into the ecosystem. - -## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05) - -**Note:** Version bump only for package @feathersjs/client - -## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08) - -### Bug Fixes - -- **package:** Fix clean script in non Unix environments ([#2110](https://github.com/feathersjs/feathers/issues/2110)) ([09b62c0](https://github.com/feathersjs/feathers/commit/09b62c0c7e636caf620904ba87d61f168a020f05)) - -## [4.5.9](https://github.com/feathersjs/feathers/compare/v4.5.8...v4.5.9) (2020-10-09) - -**Note:** Version bump only for package @feathersjs/client - -## [4.5.8](https://github.com/feathersjs/feathers/compare/v4.5.7...v4.5.8) (2020-08-12) - -**Note:** Version bump only for package @feathersjs/client - -## [4.5.7](https://github.com/feathersjs/feathers/compare/v4.5.6...v4.5.7) (2020-07-24) - -**Note:** Version bump only for package @feathersjs/client - -## [4.5.6](https://github.com/feathersjs/feathers/compare/v4.5.5...v4.5.6) (2020-07-12) - -**Note:** Version bump only for package @feathersjs/client - -## [4.5.5](https://github.com/feathersjs/feathers/compare/v4.5.4...v4.5.5) (2020-07-11) - -**Note:** Version bump only for package @feathersjs/client - -## [4.5.4](https://github.com/feathersjs/feathers/compare/v4.5.3...v4.5.4) (2020-04-29) - -**Note:** Version bump only for package @feathersjs/client - -## [4.5.3](https://github.com/feathersjs/feathers/compare/v4.5.2...v4.5.3) (2020-04-17) - -**Note:** Version bump only for package @feathersjs/client - -## [4.5.2](https://github.com/feathersjs/feathers/compare/v4.5.1...v4.5.2) (2020-03-04) - -**Note:** Version bump only for package @feathersjs/client - -## [4.5.1](https://github.com/feathersjs/feathers/compare/v4.5.0...v4.5.1) (2020-01-24) - -**Note:** Version bump only for package @feathersjs/client - -# [4.5.0](https://github.com/feathersjs/feathers/compare/v4.4.3...v4.5.0) (2020-01-18) - -**Note:** Version bump only for package @feathersjs/client - -## [4.4.3](https://github.com/feathersjs/feathers/compare/v4.4.1...v4.4.3) (2019-12-06) - -**Note:** Version bump only for package @feathersjs/client - -## [4.4.1](https://github.com/feathersjs/feathers/compare/v4.4.0...v4.4.1) (2019-11-27) - -**Note:** Version bump only for package @feathersjs/client - -# [4.4.0](https://github.com/feathersjs/feathers/compare/v4.3.11...v4.4.0) (2019-11-27) - -**Note:** Version bump only for package @feathersjs/client - -## [4.3.11](https://github.com/feathersjs/feathers/compare/v4.3.10...v4.3.11) (2019-11-11) - -**Note:** Version bump only for package @feathersjs/client - -## [4.3.10](https://github.com/feathersjs/feathers/compare/v4.3.9...v4.3.10) (2019-10-26) - -**Note:** Version bump only for package @feathersjs/client - -## [4.3.9](https://github.com/feathersjs/feathers/compare/v4.3.8...v4.3.9) (2019-10-26) - -**Note:** Version bump only for package @feathersjs/client - -## [4.3.7](https://github.com/feathersjs/feathers/compare/v4.3.6...v4.3.7) (2019-10-14) - -**Note:** Version bump only for package @feathersjs/client - -## [4.3.5](https://github.com/feathersjs/feathers/compare/v4.3.4...v4.3.5) (2019-10-07) - -**Note:** Version bump only for package @feathersjs/client - -## [4.3.4](https://github.com/feathersjs/feathers/compare/v4.3.3...v4.3.4) (2019-10-03) - -**Note:** Version bump only for package @feathersjs/client - -## [4.3.3](https://github.com/feathersjs/feathers/compare/v4.3.2...v4.3.3) (2019-09-21) - -**Note:** Version bump only for package @feathersjs/client - -## [4.3.2](https://github.com/feathersjs/feathers/compare/v4.3.1...v4.3.2) (2019-09-16) - -**Note:** Version bump only for package @feathersjs/client - -## [4.3.1](https://github.com/feathersjs/feathers/compare/v4.3.0...v4.3.1) (2019-09-09) - -**Note:** Version bump only for package @feathersjs/client - -# [4.3.0](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.4...v4.3.0) (2019-08-27) - -**Note:** Version bump only for package @feathersjs/client - -# [4.3.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.3...v4.3.0-pre.4) (2019-08-22) - -**Note:** Version bump only for package @feathersjs/client - -# [4.3.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.2...v4.3.0-pre.3) (2019-08-19) - -**Note:** Version bump only for package @feathersjs/client - -# [4.3.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.1...v4.3.0-pre.2) (2019-08-02) - -**Note:** Version bump only for package @feathersjs/client - -# [4.3.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.5...v4.3.0-pre.1) (2019-07-11) - -**Note:** Version bump only for package @feathersjs/client - -# [4.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.4...v4.0.0-pre.5) (2019-07-10) - -### Bug Fixes - -- Fix feathers-memory dependency that did not get updated ([9422b13](https://github.com/feathersjs/feathers/commit/9422b13)) - -# [4.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.3...v4.0.0-pre.4) (2019-07-05) - -**Note:** Version bump only for package @feathersjs/client - -# [4.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.2...v4.0.0-pre.3) (2019-06-01) - -### Bug Fixes - -- Update dependencies and fix tests ([#1373](https://github.com/feathersjs/feathers/issues/1373)) ([d743a7f](https://github.com/feathersjs/feathers/commit/d743a7f)) - -# [4.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.1...v4.0.0-pre.2) (2019-05-15) - -### Bug Fixes - -- Use `export =` in TypeScript definitions ([#1285](https://github.com/feathersjs/feathers/issues/1285)) ([12d0f4b](https://github.com/feathersjs/feathers/commit/12d0f4b)) - -# [4.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.0...v4.0.0-pre.1) (2019-05-08) - -### Bug Fixes - -- Improve authentication parameter handling ([#1333](https://github.com/feathersjs/feathers/issues/1333)) ([6e77204](https://github.com/feathersjs/feathers/commit/6e77204)) - -# [4.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v3.2.0-pre.1...v4.0.0-pre.0) (2019-04-21) - -### Bug Fixes - -- Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803)) -- Update adapter common tests ([#1135](https://github.com/feathersjs/feathers/issues/1135)) ([8166dda](https://github.com/feathersjs/feathers/commit/8166dda)) -- Update all dependencies to latest ([#1206](https://github.com/feathersjs/feathers/issues/1206)) ([e51e0f6](https://github.com/feathersjs/feathers/commit/e51e0f6)) -- **chore:** Properly configure and run code linter ([#1092](https://github.com/feathersjs/feathers/issues/1092)) ([fd3fc34](https://github.com/feathersjs/feathers/commit/fd3fc34)) - -### Features - -- Add TypeScript definitions ([#1275](https://github.com/feathersjs/feathers/issues/1275)) ([9dd6713](https://github.com/feathersjs/feathers/commit/9dd6713)) -- Authentication v3 core server implementation ([#1205](https://github.com/feathersjs/feathers/issues/1205)) ([1bd7591](https://github.com/feathersjs/feathers/commit/1bd7591)) - -## [3.7.8](https://github.com/feathersjs/feathers/compare/@feathersjs/client@3.7.7...@feathersjs/client@3.7.8) (2019-01-26) - -**Note:** Version bump only for package @feathersjs/client - -## [3.7.7](https://github.com/feathersjs/feathers/compare/@feathersjs/client@3.7.6...@feathersjs/client@3.7.7) (2019-01-02) - -### Bug Fixes - -- Update adapter common tests ([#1135](https://github.com/feathersjs/feathers/issues/1135)) ([8166dda](https://github.com/feathersjs/feathers/commit/8166dda)) - - - -## [3.7.6](https://github.com/feathersjs/feathers/compare/@feathersjs/client@3.7.5...@feathersjs/client@3.7.6) (2018-12-16) - -### Bug Fixes - -- **chore:** Properly configure and run code linter ([#1092](https://github.com/feathersjs/feathers/issues/1092)) ([fd3fc34](https://github.com/feathersjs/feathers/commit/fd3fc34)) - - - -## [3.7.5](https://github.com/feathersjs/feathers/compare/@feathersjs/client@3.7.4...@feathersjs/client@3.7.5) (2018-10-26) - -**Note:** Version bump only for package @feathersjs/client - - - -## [3.7.4](https://github.com/feathersjs/feathers/compare/@feathersjs/client@3.7.3...@feathersjs/client@3.7.4) (2018-10-25) - -### Bug Fixes - -- Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803)) - - - -## [3.7.3](https://github.com/feathersjs/feathers/compare/@feathersjs/client@3.7.2...@feathersjs/client@3.7.3) (2018-09-24) - -**Note:** Version bump only for package @feathersjs/client - - - -## 3.7.2 (2018-09-21) - -**Note:** Version bump only for package @feathersjs/client - -# Change Log - -## [v3.7.1](https://github.com/feathersjs/client/tree/v3.7.1) (2018-09-21) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.7.0...v3.7.1) - -## [v3.7.0](https://github.com/feathersjs/client/tree/v3.7.0) (2018-09-18) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.6.0...v3.7.0) - -**Closed issues:** - -- Cannot patch multiple items [\#267](https://github.com/feathersjs/client/issues/267) - -**Merged pull requests:** - -- Update all dependencies and build to Babel 8 [\#294](https://github.com/feathersjs/client/pull/294) ([daffl](https://github.com/daffl)) -- Update uglifyjs-webpack-plugin to the latest version 🚀 [\#287](https://github.com/feathersjs/client/pull/287) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.6.0](https://github.com/feathersjs/client/tree/v3.6.0) (2018-09-03) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.5.6...v3.6.0) - -**Merged pull requests:** - -- Update all dependencies [\#285](https://github.com/feathersjs/client/pull/285) ([daffl](https://github.com/daffl)) -- Update all dependencies [\#278](https://github.com/feathersjs/client/pull/278) ([daffl](https://github.com/daffl)) -- Update @feathersjs/errors to the latest version 🚀 [\#272](https://github.com/feathersjs/client/pull/272) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.5.6](https://github.com/feathersjs/client/tree/v3.5.6) (2018-08-13) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.5.5...v3.5.6) - -## [v3.5.5](https://github.com/feathersjs/client/tree/v3.5.5) (2018-08-02) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.5.4...v3.5.5) - -**Closed issues:** - -- IE11: TypeError: Object doesn't support property or method 'from' [\#270](https://github.com/feathersjs/client/issues/270) - -**Merged pull requests:** - -- Update ws to the latest version 🚀 [\#269](https://github.com/feathersjs/client/pull/269) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.5.4](https://github.com/feathersjs/client/tree/v3.5.4) (2018-07-19) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.5.3...v3.5.4) - -**Merged pull requests:** - -- Update all dependencies to latest [\#268](https://github.com/feathersjs/client/pull/268) ([daffl](https://github.com/daffl)) - -## [v3.5.3](https://github.com/feathersjs/client/tree/v3.5.3) (2018-06-28) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.5.2...v3.5.3) - -**Merged pull requests:** - -- Update @feathersjs/rest-client to the latest version 🚀 [\#266](https://github.com/feathersjs/client/pull/266) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.5.2](https://github.com/feathersjs/client/tree/v3.5.2) (2018-06-16) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.5.1...v3.5.2) - -**Closed issues:** - -- service times out when sending any request to the server, not on localhost [\#264](https://github.com/feathersjs/client/issues/264) - -**Merged pull requests:** - -- Update @feathersjs/feathers to the latest version 🚀 [\#265](https://github.com/feathersjs/client/pull/265) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update shx to the latest version 🚀 [\#263](https://github.com/feathersjs/client/pull/263) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.5.1](https://github.com/feathersjs/client/tree/v3.5.1) (2018-06-03) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.5.0...v3.5.1) - -**Closed issues:** - -- 'exports' is undefined [\#261](https://github.com/feathersjs/client/issues/261) -- I got error from NuxtJS when I use FeathersJS client V3 [\#260](https://github.com/feathersjs/client/issues/260) - -**Merged pull requests:** - -- Update @feathersjs/feathers to the latest version 🚀 [\#262](https://github.com/feathersjs/client/pull/262) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.5.0](https://github.com/feathersjs/client/tree/v3.5.0) (2018-05-17) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.4.5...v3.5.0) - -**Merged pull requests:** - -- Update @feathersjs/rest-client to the latest version 🚀 [\#259](https://github.com/feathersjs/client/pull/259) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.4.5](https://github.com/feathersjs/client/tree/v3.4.5) (2018-05-04) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.4.4...v3.4.5) - -**Merged pull requests:** - -- Update @feathersjs/feathers to the latest version 🚀 [\#258](https://github.com/feathersjs/client/pull/258) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.4.4](https://github.com/feathersjs/client/tree/v3.4.4) (2018-03-27) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.4.3...v3.4.4) - -**Merged pull requests:** - -- Update @feathersjs/feathers to the latest version 🚀 [\#257](https://github.com/feathersjs/client/pull/257) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update @feathersjs/rest-client to the latest version 🚀 [\#256](https://github.com/feathersjs/client/pull/256) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.4.3](https://github.com/feathersjs/client/tree/v3.4.3) (2018-03-07) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.4.2...v3.4.3) - -**Closed issues:** - -- Can't capture event on client side [\#253](https://github.com/feathersjs/client/issues/253) - -**Merged pull requests:** - -- Update ws to the latest version 🚀 [\#255](https://github.com/feathersjs/client/pull/255) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update webpack to the latest version 🚀 [\#254](https://github.com/feathersjs/client/pull/254) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.4.2](https://github.com/feathersjs/client/tree/v3.4.2) (2018-02-16) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.4.1...v3.4.2) - -**Closed issues:** - -- Feathers client now working with HTTPS self signed certs [\#250](https://github.com/feathersjs/client/issues/250) - -**Merged pull requests:** - -- Update @feathersjs/feathers to the latest version 🚀 [\#252](https://github.com/feathersjs/client/pull/252) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update @feathersjs/errors to the latest version 🚀 [\#251](https://github.com/feathersjs/client/pull/251) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.4.1](https://github.com/feathersjs/client/tree/v3.4.1) (2018-02-10) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.4.0...v3.4.1) - -**Merged pull requests:** - -- Update @feathersjs/feathers to the latest version 🚀 [\#249](https://github.com/feathersjs/client/pull/249) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.4.0](https://github.com/feathersjs/client/tree/v3.4.0) (2018-02-09) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.3.2...v3.4.0) - -**Merged pull requests:** - -- Update @feathersjs/primus-client to the latest version 🚀 [\#248](https://github.com/feathersjs/client/pull/248) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update @feathersjs/socketio-client to the latest version 🚀 [\#247](https://github.com/feathersjs/client/pull/247) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.3.2](https://github.com/feathersjs/client/tree/v3.3.2) (2018-02-09) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.3.1...v3.3.2) - -**Merged pull requests:** - -- Update @feathersjs/feathers to the latest version 🚀 [\#246](https://github.com/feathersjs/client/pull/246) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- delete slack link [\#245](https://github.com/feathersjs/client/pull/245) ([vodniciarv](https://github.com/vodniciarv)) - -## [v3.3.1](https://github.com/feathersjs/client/tree/v3.3.1) (2018-02-05) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.3.0...v3.3.1) - -**Merged pull requests:** - -- Update @feathersjs/socketio-client to the latest version 🚀 [\#244](https://github.com/feathersjs/client/pull/244) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update @feathersjs/primus-client to the latest version 🚀 [\#243](https://github.com/feathersjs/client/pull/243) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update node-fetch to the latest version 🚀 [\#242](https://github.com/feathersjs/client/pull/242) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.3.0](https://github.com/feathersjs/client/tree/v3.3.0) (2018-01-26) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.2.0...v3.3.0) - -**Merged pull requests:** - -- Update @feathersjs/feathers to the latest version 🚀 [\#241](https://github.com/feathersjs/client/pull/241) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.2.0](https://github.com/feathersjs/client/tree/v3.2.0) (2018-01-24) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.1.2...v3.2.0) - -**Closed issues:** - -- Index.d.ts has a lack of return-type annotation [\#238](https://github.com/feathersjs/client/issues/238) -- feathers rest client call get but server execute find [\#237](https://github.com/feathersjs/client/issues/237) -- EventEmitter memory leak detected [\#236](https://github.com/feathersjs/client/issues/236) - -**Merged pull requests:** - -- Update @feathersjs/errors to the latest version 🚀 [\#240](https://github.com/feathersjs/client/pull/240) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update mocha to the latest version 🚀 [\#239](https://github.com/feathersjs/client/pull/239) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update ws to the latest version 🚀 [\#235](https://github.com/feathersjs/client/pull/235) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update @feathersjs/feathers to the latest version 🚀 [\#234](https://github.com/feathersjs/client/pull/234) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update @feathersjs/rest-client to the latest version 🚀 [\#233](https://github.com/feathersjs/client/pull/233) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update @feathersjs/feathers to the latest version 🚀 [\#232](https://github.com/feathersjs/client/pull/232) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update @feathersjs/authentication-client to the latest version 🚀 [\#231](https://github.com/feathersjs/client/pull/231) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update @feathersjs/socketio-client to the latest version 🚀 [\#230](https://github.com/feathersjs/client/pull/230) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update @feathersjs/primus-client to the latest version 🚀 [\#229](https://github.com/feathersjs/client/pull/229) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update @feathersjs/errors to the latest version 🚀 [\#228](https://github.com/feathersjs/client/pull/228) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.1.2](https://github.com/feathersjs/client/tree/v3.1.2) (2018-01-02) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.1.1...v3.1.2) - -**Closed issues:** - -- Socket.io on iOS and Firefox don't work [\#225](https://github.com/feathersjs/client/issues/225) - -**Merged pull requests:** - -- Update @feathersjs/feathers to the latest version 🚀 [\#227](https://github.com/feathersjs/client/pull/227) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update semistandard to the latest version 🚀 [\#226](https://github.com/feathersjs/client/pull/226) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.1.1](https://github.com/feathersjs/client/tree/v3.1.1) (2017-12-05) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.1.0...v3.1.1) - -**Merged pull requests:** - -- Update @feathersjs/feathers to the latest version 🚀 [\#224](https://github.com/feathersjs/client/pull/224) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers-memory to the latest version 🚀 [\#223](https://github.com/feathersjs/client/pull/223) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update @feathersjs/errors to the latest version 🚀 [\#222](https://github.com/feathersjs/client/pull/222) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update @feathersjs/errors to the latest version 🚀 [\#221](https://github.com/feathersjs/client/pull/221) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v3.1.0](https://github.com/feathersjs/client/tree/v3.1.0) (2017-11-16) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.0.0...v3.1.0) - -**Merged pull requests:** - -- Link client packages directly to builds and update all dependencies [\#219](https://github.com/feathersjs/client/pull/219) ([daffl](https://github.com/daffl)) -- Update @feathersjs/feathers to the latest version 🚀 [\#217](https://github.com/feathersjs/client/pull/217) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update package.json [\#215](https://github.com/feathersjs/client/pull/215) ([frank-dspeed](https://github.com/frank-dspeed)) - -## [v3.0.0](https://github.com/feathersjs/client/tree/v3.0.0) (2017-11-01) - -[Full Changelog](https://github.com/feathersjs/client/compare/v3.0.0-pre.1...v3.0.0) - -**Merged pull requests:** - -- Update dependencies for release [\#214](https://github.com/feathersjs/client/pull/214) ([daffl](https://github.com/daffl)) - -## [v3.0.0-pre.1](https://github.com/feathersjs/client/tree/v3.0.0-pre.1) (2017-10-30) - -[Full Changelog](https://github.com/feathersjs/client/compare/v2.4.0...v3.0.0-pre.1) - -**Closed issues:** - -- help data - angularjs [\#210](https://github.com/feathersjs/client/issues/210) -- npm packages are installed even if they already exist when creating a new sequelize mysql service [\#209](https://github.com/feathersjs/client/issues/209) -- Do you need feathers setup on the server to use feathers on the client? [\#196](https://github.com/feathersjs/client/issues/196) -- Reorganization of client-side repositories [\#137](https://github.com/feathersjs/client/issues/137) - -**Merged pull requests:** - -- Upgrade to Feathers v3 \(Buzzard\) and new builds [\#213](https://github.com/feathersjs/client/pull/213) ([daffl](https://github.com/daffl)) -- Update dependencies to enable Greenkeeper 🌴 [\#212](https://github.com/feathersjs/client/pull/212) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers-hooks to the latest version 🚀 [\#208](https://github.com/feathersjs/client/pull/208) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers to the latest version 🚀 [\#207](https://github.com/feathersjs/client/pull/207) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update mocha to the latest version 🚀 [\#206](https://github.com/feathersjs/client/pull/206) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- update script src deps example [\#205](https://github.com/feathersjs/client/pull/205) ([crobinson42](https://github.com/crobinson42)) -- Update feathers to the latest version 🚀 [\#204](https://github.com/feathersjs/client/pull/204) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers-hooks to the latest version 🚀 [\#203](https://github.com/feathersjs/client/pull/203) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers-hooks to the latest version 🚀 [\#202](https://github.com/feathersjs/client/pull/202) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers to the latest version 🚀 [\#201](https://github.com/feathersjs/client/pull/201) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers-hooks to the latest version 🚀 [\#200](https://github.com/feathersjs/client/pull/200) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update TypeScript definition for service.patch [\#199](https://github.com/feathersjs/client/pull/199) ([kfatehi](https://github.com/kfatehi)) -- Update feathers-errors to the latest version 🚀 [\#197](https://github.com/feathersjs/client/pull/197) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v2.4.0](https://github.com/feathersjs/client/tree/v2.4.0) (2017-09-02) - -[Full Changelog](https://github.com/feathersjs/client/compare/v2.3.0...v2.4.0) - -**Closed issues:** - -- Feathers Authentication returning NotFound: Page not found [\#188](https://github.com/feathersjs/client/issues/188) -- Typescript import build error [\#179](https://github.com/feathersjs/client/issues/179) - -**Merged pull requests:** - -- Update feathers to the latest version 🚀 [\#195](https://github.com/feathersjs/client/pull/195) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Add default export to TypeScript definition [\#194](https://github.com/feathersjs/client/pull/194) ([jonlambert](https://github.com/jonlambert)) -- Update ws to the latest version 🚀 [\#193](https://github.com/feathersjs/client/pull/193) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers-errors to the latest version 🚀 [\#192](https://github.com/feathersjs/client/pull/192) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers-errors to the latest version 🚀 [\#191](https://github.com/feathersjs/client/pull/191) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- fix\(package\): update feathers to version 2.1.7 [\#190](https://github.com/feathersjs/client/pull/190) ([daffl](https://github.com/daffl)) -- Update feathers-hooks to the latest version 🚀 [\#187](https://github.com/feathersjs/client/pull/187) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers-errors to the latest version 🚀 [\#186](https://github.com/feathersjs/client/pull/186) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v2.3.0](https://github.com/feathersjs/client/tree/v2.3.0) (2017-07-04) - -[Full Changelog](https://github.com/feathersjs/client/compare/v2.2.0...v2.3.0) - -**Closed issues:** - -- An in-range update of socket.io-client is breaking the build 🚨 [\#181](https://github.com/feathersjs/client/issues/181) -- Drop socket.io [\#177](https://github.com/feathersjs/client/issues/177) -- Providing client connection metadata for service event filtering purpose [\#172](https://github.com/feathersjs/client/issues/172) -- Support offline mode [\#29](https://github.com/feathersjs/client/issues/29) - -**Merged pull requests:** - -- Update feathers-rest to the latest version 🚀 [\#185](https://github.com/feathersjs/client/pull/185) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers-rest to the latest version 🚀 [\#184](https://github.com/feathersjs/client/pull/184) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Remove IE edge again since it does not seem to be running on Saucelabs [\#183](https://github.com/feathersjs/client/pull/183) ([daffl](https://github.com/daffl)) -- Update feathers to the latest version 🚀 [\#182](https://github.com/feathersjs/client/pull/182) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers-rest to the latest version 🚀 [\#180](https://github.com/feathersjs/client/pull/180) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers-errors to the latest version 🚀 [\#178](https://github.com/feathersjs/client/pull/178) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers to the latest version 🚀 [\#176](https://github.com/feathersjs/client/pull/176) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers-primus to the latest version 🚀 [\#175](https://github.com/feathersjs/client/pull/175) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers-socketio to the latest version 🚀 [\#173](https://github.com/feathersjs/client/pull/173) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers to the latest version 🚀 [\#171](https://github.com/feathersjs/client/pull/171) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update socket.io-client to the latest version 🚀 [\#170](https://github.com/feathersjs/client/pull/170) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers-errors to the latest version 🚀 [\#169](https://github.com/feathersjs/client/pull/169) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers-errors to the latest version 🚀 [\#168](https://github.com/feathersjs/client/pull/168) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update feathers-hooks to the latest version 🚀 [\#167](https://github.com/feathersjs/client/pull/167) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Add IE Edge instead of IE 9 [\#166](https://github.com/feathersjs/client/pull/166) ([daffl](https://github.com/daffl)) - -## [v2.2.0](https://github.com/feathersjs/client/tree/v2.2.0) (2017-04-25) - -[Full Changelog](https://github.com/feathersjs/client/compare/v2.1.0...v2.2.0) - -**Merged pull requests:** - -- Update feathers-errors to the latest version 🚀 [\#165](https://github.com/feathersjs/client/pull/165) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Add feathers-errors test [\#164](https://github.com/feathersjs/client/pull/164) ([christopherjbaker](https://github.com/christopherjbaker)) -- Update semistandard to the latest version 🚀 [\#163](https://github.com/feathersjs/client/pull/163) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) - -## [v2.1.0](https://github.com/feathersjs/client/tree/v2.1.0) (2017-04-18) - -[Full Changelog](https://github.com/feathersjs/client/compare/v2.0.0...v2.1.0) - -**Closed issues:** - -- implementation of feathers client in angular-2 [\#135](https://github.com/feathersjs/client/issues/135) - -**Merged pull requests:** - -- Update feathers-hooks to the latest version 🚀 [\#162](https://github.com/feathersjs/client/pull/162) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Update dependencies to enable Greenkeeper 🌴 [\#161](https://github.com/feathersjs/client/pull/161) ([greenkeeper[bot]](https://github.com/marketplace/greenkeeper)) -- Added generics to typescript definition. [\#158](https://github.com/feathersjs/client/pull/158) ([noah79](https://github.com/noah79)) - -## [v2.0.0](https://github.com/feathersjs/client/tree/v2.0.0) (2017-04-11) - -[Full Changelog](https://github.com/feathersjs/client/compare/v2.0.0-pre.2...v2.0.0) - -**Closed issues:** - -- Bundled feathers.js - Socket Authentication with Local Strategy Always Times Out [\#155](https://github.com/feathersjs/client/issues/155) - -**Merged pull requests:** - -- Update feathers-rest to version 1.7.2 🚀 [\#160](https://github.com/feathersjs/client/pull/160) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v2.0.0-pre.2](https://github.com/feathersjs/client/tree/v2.0.0-pre.2) (2017-03-08) - -[Full Changelog](https://github.com/feathersjs/client/compare/v2.0.0-pre.1...v2.0.0-pre.2) - -**Closed issues:** - -- Authentication should be removed [\#136](https://github.com/feathersjs/client/issues/136) - -**Merged pull requests:** - -- Lock package.json versions [\#153](https://github.com/feathersjs/client/pull/153) ([daffl](https://github.com/daffl)) -- Add feathers-errors to the client export [\#152](https://github.com/feathersjs/client/pull/152) ([daffl](https://github.com/daffl)) -- Update feathers to version 2.1.1 🚀 [\#151](https://github.com/feathersjs/client/pull/151) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-socketio to version 1.5.2 🚀 [\#150](https://github.com/feathersjs/client/pull/150) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-hooks to version 1.8.1 🚀 [\#149](https://github.com/feathersjs/client/pull/149) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-rest to version 1.7.1 🚀 [\#148](https://github.com/feathersjs/client/pull/148) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-socketio to version 1.5.1 🚀 [\#147](https://github.com/feathersjs/client/pull/147) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-socketio to version 1.5.0 🚀 [\#146](https://github.com/feathersjs/client/pull/146) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-rest to version 1.7.0 🚀 [\#145](https://github.com/feathersjs/client/pull/145) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-primus to version 2.1.0 🚀 [\#144](https://github.com/feathersjs/client/pull/144) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-hooks to version 1.8.0 🚀 [\#143](https://github.com/feathersjs/client/pull/143) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers to version 2.1.0 🚀 [\#142](https://github.com/feathersjs/client/pull/142) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-socketio to version 1.4.3 🚀 [\#141](https://github.com/feathersjs/client/pull/141) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update browserify to version 14.1.0 🚀 [\#140](https://github.com/feathersjs/client/pull/140) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update ws to version 2.0.0 🚀 [\#139](https://github.com/feathersjs/client/pull/139) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v2.0.0-pre.1](https://github.com/feathersjs/client/tree/v2.0.0-pre.1) (2017-01-11) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.9.0...v2.0.0-pre.1) - -**Closed issues:** - -- Socket.io timeout does nothing when there is JWT token available [\#129](https://github.com/feathersjs/client/issues/129) - -**Merged pull requests:** - -- Feathers Auth Update [\#131](https://github.com/feathersjs/client/pull/131) ([flyboarder](https://github.com/flyboarder)) - -## [v1.9.0](https://github.com/feathersjs/client/tree/v1.9.0) (2016-12-31) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.8.0...v1.9.0) - -**Closed issues:** - -- Typings don't include configure method [\#130](https://github.com/feathersjs/client/issues/130) - -**Merged pull requests:** - -- Add .configure method to TypeScript definitions [\#134](https://github.com/feathersjs/client/pull/134) ([daffl](https://github.com/daffl)) -- Update feathers-rest to version 1.6.0 🚀 [\#133](https://github.com/feathersjs/client/pull/133) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-rest to version 1.5.3 🚀 [\#132](https://github.com/feathersjs/client/pull/132) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-hooks to version 1.7.1 🚀 [\#128](https://github.com/feathersjs/client/pull/128) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- socket.io-client@1.7.2 breaks build 🚨 [\#126](https://github.com/feathersjs/client/pull/126) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers to version 2.0.3 🚀 [\#125](https://github.com/feathersjs/client/pull/125) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Typings changes. [\#124](https://github.com/feathersjs/client/pull/124) ([ninachaubal](https://github.com/ninachaubal)) -- Update feathers-primus to version 2.0.0 🚀 [\#123](https://github.com/feathersjs/client/pull/123) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- feathers-commons@0.8.7 breaks build 🚨 [\#122](https://github.com/feathersjs/client/pull/122) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- superagent@3.1.0 breaks build 🚨 [\#121](https://github.com/feathersjs/client/pull/121) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v1.8.0](https://github.com/feathersjs/client/tree/v1.8.0) (2016-11-26) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.7.2...v1.8.0) - -**Closed issues:** - -- How to get `hooks` `socketio` etc from `feathers` object [\#118](https://github.com/feathersjs/client/issues/118) -- send back to server additional fields in 'params' besides 'query' [\#115](https://github.com/feathersjs/client/issues/115) - -**Merged pull requests:** - -- Update feathers-hooks to version 1.7.0 🚀 [\#120](https://github.com/feathersjs/client/pull/120) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Remove reference to typings/index.d.ts [\#119](https://github.com/feathersjs/client/pull/119) ([ninachaubal](https://github.com/ninachaubal)) -- Update superagent to version 3.0.0 🚀 [\#116](https://github.com/feathersjs/client/pull/116) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Add TypeScript type definitions. [\#114](https://github.com/feathersjs/client/pull/114) ([ninachaubal](https://github.com/ninachaubal)) -- Update feathers-memory to version 1.0.0 🚀 [\#113](https://github.com/feathersjs/client/pull/113) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-authentication to version 0.7.12 🚀 [\#112](https://github.com/feathersjs/client/pull/112) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-commons to version 0.8.0 🚀 [\#111](https://github.com/feathersjs/client/pull/111) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v1.7.2](https://github.com/feathersjs/client/tree/v1.7.2) (2016-11-08) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.7.1...v1.7.2) - -**Merged pull requests:** - -- Update feathers-rest to version 1.5.2 🚀 [\#110](https://github.com/feathersjs/client/pull/110) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-socketio to version 1.4.2 🚀 [\#109](https://github.com/feathersjs/client/pull/109) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v1.7.1](https://github.com/feathersjs/client/tree/v1.7.1) (2016-11-02) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.7.0...v1.7.1) - -**Closed issues:** - -- Bower: Version mismatch [\#104](https://github.com/feathersjs/client/issues/104) - -**Merged pull requests:** - -- Update feathers-hooks to version 1.6.1 🚀 [\#108](https://github.com/feathersjs/client/pull/108) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Make sure Bower and NPM version are in sync [\#107](https://github.com/feathersjs/client/pull/107) ([daffl](https://github.com/daffl)) - -## [v1.7.0](https://github.com/feathersjs/client/tree/v1.7.0) (2016-11-02) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.6.2...v1.7.0) - -**Closed issues:** - -- How to access feathers-client [\#102](https://github.com/feathersjs/client/issues/102) -- Set up Saucelabs [\#97](https://github.com/feathersjs/client/issues/97) - -**Merged pull requests:** - -- 👻😱 Node.js 0.10 is unmaintained 😱👻 [\#106](https://github.com/feathersjs/client/pull/106) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-hooks to version 1.6.0 🚀 [\#105](https://github.com/feathersjs/client/pull/105) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Change variable naming from "app" to "feathersClient" [\#103](https://github.com/feathersjs/client/pull/103) ([nicoknoll](https://github.com/nicoknoll)) -- jshint —\> semistandard [\#101](https://github.com/feathersjs/client/pull/101) ([corymsmith](https://github.com/corymsmith)) -- Cross browser testing in Saucelabs [\#100](https://github.com/feathersjs/client/pull/100) ([daffl](https://github.com/daffl)) - -## [v1.6.2](https://github.com/feathersjs/client/tree/v1.6.2) (2016-10-22) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.6.1...v1.6.2) - -**Closed issues:** - -- Browser Support [\#96](https://github.com/feathersjs/client/issues/96) -- How to destroy feathers and socketio client? [\#95](https://github.com/feathersjs/client/issues/95) -- Use tests from feathers-commons [\#26](https://github.com/feathersjs/client/issues/26) - -**Merged pull requests:** - -- Update feathers-rest to version 1.5.1 🚀 [\#99](https://github.com/feathersjs/client/pull/99) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Use tests from feathers-commons [\#98](https://github.com/feathersjs/client/pull/98) ([daffl](https://github.com/daffl)) -- Update feathers-authentication to version 0.7.11 🚀 [\#92](https://github.com/feathersjs/client/pull/92) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-hooks to version 1.5.8 🚀 [\#91](https://github.com/feathersjs/client/pull/91) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v1.6.1](https://github.com/feathersjs/client/tree/v1.6.1) (2016-09-15) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.6.0...v1.6.1) - -**Closed issues:** - -- documentation on how to build client [\#87](https://github.com/feathersjs/client/issues/87) - -**Merged pull requests:** - -- Update feathers to version 2.0.2 🚀 [\#90](https://github.com/feathersjs/client/pull/90) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v1.6.0](https://github.com/feathersjs/client/tree/v1.6.0) (2016-09-09) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.5.3...v1.6.0) - -**Closed issues:** - -- How to declare the app in a static way? [\#86](https://github.com/feathersjs/client/issues/86) -- feathers client and requireJS [\#85](https://github.com/feathersjs/client/issues/85) -- SocketIO timeout based on service [\#84](https://github.com/feathersjs/client/issues/84) - -**Merged pull requests:** - -- Update feathers-rest to version 1.5.0 🚀 [\#89](https://github.com/feathersjs/client/pull/89) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-memory to version 0.8.0 🚀 [\#88](https://github.com/feathersjs/client/pull/88) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v1.5.3](https://github.com/feathersjs/client/tree/v1.5.3) (2016-08-31) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.5.2...v1.5.3) - -**Closed issues:** - -- Use of feathers-client with es6 \(JSPM\) [\#78](https://github.com/feathersjs/client/issues/78) - -**Merged pull requests:** - -- Update feathers-authentication to version 0.7.10 🚀 [\#82](https://github.com/feathersjs/client/pull/82) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-hooks to version 1.5.7 🚀 [\#77](https://github.com/feathersjs/client/pull/77) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-rest to version 1.4.4 🚀 [\#76](https://github.com/feathersjs/client/pull/76) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-hooks to version 1.5.6 🚀 [\#75](https://github.com/feathersjs/client/pull/75) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v1.5.2](https://github.com/feathersjs/client/tree/v1.5.2) (2016-08-12) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.5.1...v1.5.2) - -**Closed issues:** - -- \[Question\] Large client-side bundle filesize when requiring feathers client [\#71](https://github.com/feathersjs/client/issues/71) - -**Merged pull requests:** - -- Update feathers-hooks to version 1.5.5 🚀 [\#73](https://github.com/feathersjs/client/pull/73) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update mocha to version 3.0.0 🚀 [\#72](https://github.com/feathersjs/client/pull/72) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v1.5.1](https://github.com/feathersjs/client/tree/v1.5.1) (2016-07-14) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.5.0...v1.5.1) - -**Merged pull requests:** - -- Update feathers-rest to version 1.4.3 🚀 [\#70](https://github.com/feathersjs/client/pull/70) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v1.5.0](https://github.com/feathersjs/client/tree/v1.5.0) (2016-07-05) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.4.1...v1.5.0) - -**Closed issues:** - -- Refresh browser [\#68](https://github.com/feathersjs/client/issues/68) - -## [v1.4.1](https://github.com/feathersjs/client/tree/v1.4.1) (2016-06-27) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.4.0...v1.4.1) - -## [v1.4.0](https://github.com/feathersjs/client/tree/v1.4.0) (2016-06-24) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.3.2...v1.4.0) - -**Closed issues:** - -- feathers.min.js? [\#64](https://github.com/feathersjs/client/issues/64) -- Facebook login [\#62](https://github.com/feathersjs/client/issues/62) - -**Merged pull requests:** - -- Add dist/feathers.min.js [\#65](https://github.com/feathersjs/client/pull/65) ([daffl](https://github.com/daffl)) -- Update feathers-authentication to version 0.7.9 🚀 [\#63](https://github.com/feathersjs/client/pull/63) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v1.3.2](https://github.com/feathersjs/client/tree/v1.3.2) (2016-06-09) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.3.1...v1.3.2) - -**Merged pull requests:** - -- Update feathers-authentication to version 0.7.8 🚀 [\#61](https://github.com/feathersjs/client/pull/61) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v1.3.1](https://github.com/feathersjs/client/tree/v1.3.1) (2016-06-04) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.3.0...v1.3.1) - -**Merged pull requests:** - -- Update feathers-rest to version 1.4.2 🚀 [\#60](https://github.com/feathersjs/client/pull/60) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v1.3.0](https://github.com/feathersjs/client/tree/v1.3.0) (2016-05-30) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.2.1...v1.3.0) - -**Merged pull requests:** - -- Update feathers-rest to version 1.4.1 🚀 [\#59](https://github.com/feathersjs/client/pull/59) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-hooks to version 1.5.4 🚀 [\#57](https://github.com/feathersjs/client/pull/57) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update superagent to version 2.0.0 🚀 [\#56](https://github.com/feathersjs/client/pull/56) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-socketio to version 1.4.1 🚀 [\#53](https://github.com/feathersjs/client/pull/53) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-primus to version 1.4.1 🚀 [\#52](https://github.com/feathersjs/client/pull/52) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v1.2.1](https://github.com/feathersjs/client/tree/v1.2.1) (2016-05-19) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.2.0...v1.2.1) - -**Closed issues:** - -- Feathers-client not return correct error object. [\#44](https://github.com/feathersjs/client/issues/44) - -**Merged pull requests:** - -- Lock versions for Greenkeeper to make a PR for every release [\#50](https://github.com/feathersjs/client/pull/50) ([daffl](https://github.com/daffl)) -- Update babel-plugin-add-module-exports to version 0.2.0 🚀 [\#46](https://github.com/feathersjs/client/pull/46) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v1.2.0](https://github.com/feathersjs/client/tree/v1.2.0) (2016-04-29) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.1.0...v1.2.0) - -**Closed issues:** - -- Socket.io timeouts? [\#42](https://github.com/feathersjs/client/issues/42) -- Add batch support [\#4](https://github.com/feathersjs/client/issues/4) - -**Merged pull requests:** - -- nsp@2.3.2 breaks build 🚨 [\#41](https://github.com/feathersjs/client/pull/41) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Fixing url for link in readme to feathers-authentication [\#39](https://github.com/feathersjs/client/pull/39) ([xiplias](https://github.com/xiplias)) -- feathers-primus@1.3.3 breaks build 🚨 [\#38](https://github.com/feathersjs/client/pull/38) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- ws@1.1.0 breaks build 🚨 [\#36](https://github.com/feathersjs/client/pull/36) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update feathers-memory to version 0.7.0 🚀 [\#33](https://github.com/feathersjs/client/pull/33) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v1.1.0](https://github.com/feathersjs/client/tree/v1.1.0) (2016-04-03) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.0.0...v1.1.0) - -**Merged pull requests:** - -- Update all dependencies 🌴 [\#31](https://github.com/feathersjs/client/pull/31) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v1.0.0](https://github.com/feathersjs/client/tree/v1.0.0) (2016-03-14) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.0.0-pre.3...v1.0.0) - -**Merged pull requests:** - -- Use a gcc version that can build bcrypt [\#30](https://github.com/feathersjs/client/pull/30) ([daffl](https://github.com/daffl)) - -## [v1.0.0-pre.3](https://github.com/feathersjs/client/tree/v1.0.0-pre.3) (2016-03-14) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.0.0-pre.2...v1.0.0-pre.3) - -## [v1.0.0-pre.2](https://github.com/feathersjs/client/tree/v1.0.0-pre.2) (2016-03-04) - -[Full Changelog](https://github.com/feathersjs/client/compare/v0.5.3...v1.0.0-pre.2) - -**Closed issues:** - -- Can't get $regex to work in find function with feathers-nedb in the background [\#28](https://github.com/feathersjs/client/issues/28) -- feathers.fetch is undefined [\#27](https://github.com/feathersjs/client/issues/27) -- Add documentation for using in React Native [\#10](https://github.com/feathersjs/client/issues/10) - -## [v0.5.3](https://github.com/feathersjs/client/tree/v0.5.3) (2016-02-12) - -[Full Changelog](https://github.com/feathersjs/client/compare/v1.0.0-pre.1...v0.5.3) - -## [v1.0.0-pre.1](https://github.com/feathersjs/client/tree/v1.0.0-pre.1) (2016-02-11) - -[Full Changelog](https://github.com/feathersjs/client/compare/v0.5.2...v1.0.0-pre.1) - -## [v0.5.2](https://github.com/feathersjs/client/tree/v0.5.2) (2016-02-09) - -[Full Changelog](https://github.com/feathersjs/client/compare/v0.5.1...v0.5.2) - -**Merged pull requests:** - -- Universal feathers [\#25](https://github.com/feathersjs/client/pull/25) ([daffl](https://github.com/daffl)) -- Adding nsp check [\#24](https://github.com/feathersjs/client/pull/24) ([marshallswain](https://github.com/marshallswain)) - -## [v0.5.1](https://github.com/feathersjs/client/tree/v0.5.1) (2016-01-15) - -[Full Changelog](https://github.com/feathersjs/client/compare/v0.5.0...v0.5.1) - -**Closed issues:** - -- REST base.js missing ${options.base} leads to broken relative url [\#21](https://github.com/feathersjs/client/issues/21) -- Add hook support [\#20](https://github.com/feathersjs/client/issues/20) -- $sort does not work for find\(\) [\#19](https://github.com/feathersjs/client/issues/19) - -**Merged pull requests:** - -- fix issue \#21 [\#22](https://github.com/feathersjs/client/pull/22) ([wuyuanyi135](https://github.com/wuyuanyi135)) - -## [v0.5.0](https://github.com/feathersjs/client/tree/v0.5.0) (2016-01-05) - -[Full Changelog](https://github.com/feathersjs/client/compare/v0.4.0...v0.5.0) - -**Closed issues:** - -- how to use in typescript [\#17](https://github.com/feathersjs/client/issues/17) - -**Merged pull requests:** - -- Added fetch support [\#18](https://github.com/feathersjs/client/pull/18) ([corymsmith](https://github.com/corymsmith)) -- Adding events and querystring dependencies. [\#16](https://github.com/feathersjs/client/pull/16) ([marshallswain](https://github.com/marshallswain)) - -## [v0.4.0](https://github.com/feathersjs/client/tree/v0.4.0) (2015-12-11) - -[Full Changelog](https://github.com/feathersjs/client/compare/v0.3.3...v0.4.0) - -**Fixed bugs:** - -- Importing in ES6 is broken [\#14](https://github.com/feathersjs/client/issues/14) - -**Closed issues:** - -- .babelrc messes with react-native [\#15](https://github.com/feathersjs/client/issues/15) - -## [v0.3.3](https://github.com/feathersjs/client/tree/v0.3.3) (2015-11-27) - -[Full Changelog](https://github.com/feathersjs/client/compare/v0.3.2...v0.3.3) - -**Closed issues:** - -- npm package is broken. [\#12](https://github.com/feathersjs/client/issues/12) - -**Merged pull requests:** - -- Fix es6 build and add Steal compatibility. [\#13](https://github.com/feathersjs/client/pull/13) ([marshallswain](https://github.com/marshallswain)) - -## [v0.3.2](https://github.com/feathersjs/client/tree/v0.3.2) (2015-11-26) - -[Full Changelog](https://github.com/feathersjs/client/compare/v0.3.1...v0.3.2) - -**Closed issues:** - -- Update lodash [\#11](https://github.com/feathersjs/client/issues/11) - -## [v0.3.1](https://github.com/feathersjs/client/tree/v0.3.1) (2015-11-26) - -[Full Changelog](https://github.com/feathersjs/client/compare/v0.3.0...v0.3.1) - -**Closed issues:** - -- Working with can-connect [\#8](https://github.com/feathersjs/client/issues/8) - -## [v0.3.0](https://github.com/feathersjs/client/tree/v0.3.0) (2015-11-15) - -[Full Changelog](https://github.com/feathersjs/client/compare/v0.2.1...v0.3.0) - -**Closed issues:** - -- Use Promises [\#7](https://github.com/feathersjs/client/issues/7) - -**Merged pull requests:** - -- Migration to ES6 and using Promises [\#9](https://github.com/feathersjs/client/pull/9) ([daffl](https://github.com/daffl)) - -## [v0.2.1](https://github.com/feathersjs/client/tree/v0.2.1) (2015-10-06) - -[Full Changelog](https://github.com/feathersjs/client/compare/v0.2.0...v0.2.1) - -**Merged pull requests:** - -- Make client depend on feathers-commons, remove arguments.js [\#6](https://github.com/feathersjs/client/pull/6) ([daffl](https://github.com/daffl)) - -## [v0.2.0](https://github.com/feathersjs/client/tree/v0.2.0) (2015-07-18) - -[Full Changelog](https://github.com/feathersjs/client/compare/v0.1.3...v0.2.0) - -## [v0.1.3](https://github.com/feathersjs/client/tree/v0.1.3) (2015-07-06) - -[Full Changelog](https://github.com/feathersjs/client/compare/v0.1.2...v0.1.3) - -**Merged pull requests:** - -- Fixing requires and missing deps. [\#5](https://github.com/feathersjs/client/pull/5) ([marshallswain](https://github.com/marshallswain)) - -## [v0.1.2](https://github.com/feathersjs/client/tree/v0.1.2) (2015-06-22) - -[Full Changelog](https://github.com/feathersjs/client/compare/v0.1.1...v0.1.2) - -**Closed issues:** - -- Publish to NPM and Bower [\#1](https://github.com/feathersjs/client/issues/1) - -## [v0.1.1](https://github.com/feathersjs/client/tree/v0.1.1) (2015-06-21) - -[Full Changelog](https://github.com/feathersjs/client/compare/v0.0.1...v0.1.1) - -## [v0.0.1](https://github.com/feathersjs/client/tree/v0.0.1) (2015-06-21) - -[Full Changelog](https://github.com/feathersjs/client/compare/v0.1.0...v0.0.1) - -## [v0.1.0](https://github.com/feathersjs/client/tree/v0.1.0) (2015-06-06) - -\* _This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)_ diff --git a/packages/client/LICENSE b/packages/client/LICENSE deleted file mode 100644 index 40b7881afa..0000000000 --- a/packages/client/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Feathers - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/packages/client/README.md b/packages/client/README.md deleted file mode 100644 index 934b1157f1..0000000000 --- a/packages/client/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# @feathersjs/client - -[](https://github.com/feathersjs/feathers/actions?query=workflow%3ACI) -[](https://www.npmjs.com/package/@feathersjs/client) -[](https://discord.gg/qa8kez8QBx) - -> A client build for FeathersJS - -## Installation - -``` -npm install @feathersjs/client --save -``` - -## Documentation - -Refer to the [Feathers client API documentation](https://docs.feathersjs.com/api/client.html) for more details. - -## License - -Copyright (c) 2024 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors) - -Licensed under the [MIT license](LICENSE). diff --git a/packages/client/core.js b/packages/client/core.js deleted file mode 100644 index b55021eddc..0000000000 --- a/packages/client/core.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./dist/core'); diff --git a/packages/client/package.json b/packages/client/package.json deleted file mode 100644 index 9624434f4e..0000000000 --- a/packages/client/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "@feathersjs/client", - "description": "A module that consolidates Feathers client modules for REST (jQuery, Request, Superagent) and Websocket (Socket.io, Primus) connections", - "version": "5.0.34", - "repository": { - "type": "git", - "url": "https://github.com/feathersjs/feathers.git", - "directory": "packages/client" - }, - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/daffl" - }, - "bugs": { - "url": "https://github.com/feathersjs/feathers/issues" - }, - "homepage": "https://github.com/feathersjs/client", - "keywords": [ - "feathers", - "feathers-plugin" - ], - "author": "Feathers contributors", - "engines": { - "node": ">= 12" - }, - "main": "dist/feathers", - "types": "dist/feathers", - "files": [ - "CHANGELOG.md", - "LICENSE", - "README.md", - "src/**", - "dist/**", - "*.d.ts", - "*.js" - ], - "scripts": { - "compile": "tsc", - "version": "npm run build", - "clean": "shx rm -rf dist/ && shx mkdir -p dist", - "build": "npm run clean && npm run compile && npm run webpack", - "mocha": "mocha --config ../../.mocharc.json --recursive test/**/*.test.ts", - "test": "npm run build && npm run mocha", - "webpack": "webpack --config webpack/feathers.js && webpack --config webpack/feathers.min.js && webpack --config webpack/core.js && webpack --config webpack/core.min.js" - }, - "browserslist": [ - "last 2 versions", - "IE 11" - ], - "dependencies": { - "@feathersjs/authentication-client": "^5.0.34", - "@feathersjs/errors": "^5.0.34", - "@feathersjs/feathers": "^5.0.34", - "@feathersjs/rest-client": "^5.0.34", - "@feathersjs/socketio-client": "^5.0.34" - }, - "devDependencies": { - "@babel/core": "^7.28.0", - "@babel/preset-env": "^7.28.0", - "@feathersjs/express": "^5.0.34", - "@feathersjs/memory": "^5.0.34", - "@feathersjs/socketio": "^5.0.34", - "@feathersjs/tests": "^5.0.34", - "babel-loader": "^10.0.0", - "mocha": "^11.7.1", - "node-fetch": "^2.6.1", - "shx": "^0.4.0", - "socket.io-client": "^4.8.1", - "superagent": "^10.2.3", - "ts-loader": "^9.5.2", - "typescript": "^5.9.2", - "webpack": "^5.101.0", - "webpack-cli": "^6.0.1", - "webpack-merge": "^6.0.1" - }, - "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5" -} diff --git a/packages/client/src/core.ts b/packages/client/src/core.ts deleted file mode 100644 index 1138c62281..0000000000 --- a/packages/client/src/core.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@feathersjs/feathers' diff --git a/packages/client/src/feathers.ts b/packages/client/src/feathers.ts deleted file mode 100644 index e3522cb374..0000000000 --- a/packages/client/src/feathers.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { feathers } from '@feathersjs/feathers' -import authentication from '@feathersjs/authentication-client' -import rest from '@feathersjs/rest-client' -import socketio from '@feathersjs/socketio-client' - -export * from '@feathersjs/feathers' -export * as errors from '@feathersjs/errors' -export { authentication, rest, socketio } -export default feathers - -if (typeof module !== 'undefined') { - module.exports = Object.assign(feathers, module.exports) -} diff --git a/packages/client/test/fetch.test.ts b/packages/client/test/fetch.test.ts deleted file mode 100644 index 22f626a4a6..0000000000 --- a/packages/client/test/fetch.test.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -// @ts-ignore -import fetch from 'node-fetch' -import { Server } from 'http' -import { clientTests } from '@feathersjs/tests' - -import * as feathers from '../dist/feathers' -import app from './fixture' - -describe('fetch REST connector', function () { - let server: Server - const rest = feathers.rest('http://localhost:8889') - const client = feathers.default().configure(rest.fetch(fetch)) - - before(async () => { - server = await app().listen(8889) - }) - - after(function (done) { - server.close(done) - }) - - clientTests(client, 'todos') -}) diff --git a/packages/client/test/fixture.ts b/packages/client/test/fixture.ts deleted file mode 100644 index de42f60d65..0000000000 --- a/packages/client/test/fixture.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { feathers, Application, HookContext, Id, Params } from '@feathersjs/feathers' -import * as express from '@feathersjs/express' -import { MemoryService } from '@feathersjs/memory' - -// eslint-disable-next-line no-extend-native -Object.defineProperty(Error.prototype, 'toJSON', { - value() { - const alt: any = {} - - Object.getOwnPropertyNames(this).forEach((key: string) => { - alt[key] = this[key] - }) - - return alt - }, - configurable: true -}) - -// Create an in-memory CRUD service for our Todos -class TodoService extends MemoryService { - async get(id: Id, params: Params) { - if (params.query.error) { - throw new Error('Something went wrong') - } - - return super.get(id).then((data) => Object.assign({ query: params.query }, data)) - } -} - -export default (configurer?: (app: Application) => void) => { - const app = express - .default(feathers()) - // Parse HTTP bodies - .use(express.json()) - .use(express.urlencoded({ extended: true })) - // Host the current directory (for index.html) - .use(express.static(process.cwd())) - .configure(express.rest()) - - if (typeof configurer === 'function') { - configurer.call(app, app) - } - - app - // Host our Todos service on the /todos path - .use( - '/todos', - new TodoService({ - multi: true - }) - ) - .use(express.errorHandler()) - - const testTodo = { - text: 'some todo', - complete: false - } - const service: any = app.service('todos') - - service.create(testTodo) - service.hooks({ - after: { - remove(hook: HookContext ) { - if (hook.id === null) { - service._uId = 0 - return service.create(testTodo).then(() => hook) - } - } - } - }) - - app.on('connection', (connection) => (app as any).channel('general').join(connection)) - - if (service.publish) { - service.publish(() => app.channel('general')) - } - - return app -} diff --git a/packages/client/test/socketio.test.ts b/packages/client/test/socketio.test.ts deleted file mode 100644 index 74a86cd73e..0000000000 --- a/packages/client/test/socketio.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { io } from 'socket.io-client' -import socketio from '@feathersjs/socketio' -import { Server } from 'http' -import { clientTests } from '@feathersjs/tests' - -import * as feathers from '../dist/feathers' -import app from './fixture' - -describe('Socket.io connector', function () { - let server: Server - const socket = io('http://localhost:9988') - const client = feathers.default().configure(feathers.socketio(socket)) - - before(async () => { - server = await app((app) => app.configure(socketio())).listen(9988) - }) - - after(function (done) { - socket.once('disconnect', () => { - server.close() - done() - }) - socket.disconnect() - }) - - clientTests(client, 'todos') -}) diff --git a/packages/client/test/superagent.test.ts b/packages/client/test/superagent.test.ts deleted file mode 100644 index ea158b9747..0000000000 --- a/packages/client/test/superagent.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import superagent from 'superagent' -import { clientTests } from '@feathersjs/tests' -import { Server } from 'http' - -import * as feathers from '../dist/feathers' -import app from './fixture' - -describe('Superagent REST connector', function () { - let server: Server - const rest = feathers.rest('http://localhost:8889') - const client = feathers.default().configure(rest.superagent(superagent)) - - before(async () => { - server = await app().listen(8889) - }) - - after(function (done) { - server.close(done) - }) - - clientTests(client, 'todos') -}) diff --git a/packages/client/tsconfig.json b/packages/client/tsconfig.json deleted file mode 100644 index ea5cc61312..0000000000 --- a/packages/client/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../tsconfig", - "sourceMap": false, - "include": [ - "src/**/*.ts" - ], - "compilerOptions": { - "outDir": "dist/" - } -} diff --git a/packages/client/webpack/core.js b/packages/client/webpack/core.js deleted file mode 100644 index 7b7144dc02..0000000000 --- a/packages/client/webpack/core.js +++ /dev/null @@ -1,3 +0,0 @@ -const createConfig = require('./create-config'); - -module.exports = createConfig('core'); \ No newline at end of file diff --git a/packages/client/webpack/core.min.js b/packages/client/webpack/core.min.js deleted file mode 100644 index 79bd67d793..0000000000 --- a/packages/client/webpack/core.min.js +++ /dev/null @@ -1,3 +0,0 @@ -const createConfig = require('./create-config'); - -module.exports = createConfig('core', true); \ No newline at end of file diff --git a/packages/client/webpack/create-config.js b/packages/client/webpack/create-config.js deleted file mode 100644 index 513d36da26..0000000000 --- a/packages/client/webpack/create-config.js +++ /dev/null @@ -1,54 +0,0 @@ -const path = require('path'); -const webpack = require('webpack'); -const { merge } = require('webpack-merge'); - -module.exports = function createConfig (output, isProduction = false) { - const commons = { - entry: [ - `./src/${output}.ts` - ], - output: { - library: 'feathers', - libraryTarget: 'umd', - globalObject: 'this', - path: path.resolve(__dirname, '..', 'dist'), - filename: `${output}.js` - }, - resolve: { - extensions: [ '.tsx', '.ts', '.js' ] - }, - module: { - rules: [{ - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, { - test: /\.js/, - exclude: /node_modules\/(?!(@feathersjs|debug))/, - loader: 'babel-loader', - options: { - presets: ['@babel/preset-env'] - // plugins: ['@babel/plugin-transform-classes'] - } - }] - } - }; - - const dev = { - mode: 'development', - devtool: 'source-map' - }; - const production = { - mode: 'production', - output: { - filename: `${output}.min.js` - }, - plugins: [ - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify('production') - }) - ] - }; - - return merge(commons, isProduction ? production : dev); -} diff --git a/packages/client/webpack/feathers.js b/packages/client/webpack/feathers.js deleted file mode 100644 index cf576327ba..0000000000 --- a/packages/client/webpack/feathers.js +++ /dev/null @@ -1,3 +0,0 @@ -const createConfig = require('./create-config'); - -module.exports = createConfig('feathers'); \ No newline at end of file diff --git a/packages/client/webpack/feathers.min.js b/packages/client/webpack/feathers.min.js deleted file mode 100644 index 38e64abe7c..0000000000 --- a/packages/client/webpack/feathers.min.js +++ /dev/null @@ -1,3 +0,0 @@ -const createConfig = require('./create-config'); - -module.exports = createConfig('feathers', true); \ No newline at end of file diff --git a/packages/commons/CHANGELOG.md b/packages/commons/CHANGELOG.md deleted file mode 100644 index de7fb44b8c..0000000000 --- a/packages/commons/CHANGELOG.md +++ /dev/null @@ -1,892 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [5.0.34](https://github.com/feathersjs/feathers/compare/v5.0.33...v5.0.34) (2025-05-03) - -### Bug Fixes - -- Update dependencies ([#3584](https://github.com/feathersjs/feathers/issues/3584)) ([119fa4e](https://github.com/feathersjs/feathers/commit/119fa4e1ade8b0078aa235083d566e2538b3a084)) - -## [5.0.33](https://github.com/feathersjs/feathers/compare/v5.0.32...v5.0.33) (2025-02-24) - -### Bug Fixes - -- **dependencies:** Update dependencies ([#3571](https://github.com/feathersjs/feathers/issues/3571)) ([ad611cb](https://github.com/feathersjs/feathers/commit/ad611cb6ffb1dc31d603ba5817331318c5a23217)) - -## [5.0.32](https://github.com/feathersjs/feathers/compare/v5.0.31...v5.0.32) (2025-02-01) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.31](https://github.com/feathersjs/feathers/compare/v5.0.30...v5.0.31) (2024-10-31) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3545](https://github.com/feathersjs/feathers/issues/3545)) ([221b92b](https://github.com/feathersjs/feathers/commit/221b92bb0ee5d54fb1036742968797cb02e56da2)) - -## [5.0.30](https://github.com/feathersjs/feathers/compare/v5.0.29...v5.0.30) (2024-09-02) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.29](https://github.com/feathersjs/feathers/compare/v5.0.28...v5.0.29) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.28](https://github.com/feathersjs/feathers/compare/v5.0.27...v5.0.28) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.27](https://github.com/feathersjs/feathers/compare/v5.0.26...v5.0.27) (2024-06-18) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.26](https://github.com/feathersjs/feathers/compare/v5.0.25...v5.0.26) (2024-06-09) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.25](https://github.com/feathersjs/feathers/compare/v5.0.24...v5.0.25) (2024-05-03) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.24](https://github.com/feathersjs/feathers/compare/v5.0.23...v5.0.24) (2024-03-13) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.23](https://github.com/feathersjs/feathers/compare/v5.0.22...v5.0.23) (2024-02-25) - -### Bug Fixes - -- **core:** Update to latest feathersjs/hooks ([#3434](https://github.com/feathersjs/feathers/issues/3434)) ([1499ccc](https://github.com/feathersjs/feathers/commit/1499ccc41fb3ebba97b2c84e0cb19bc48ad3c651)) - -## [5.0.22](https://github.com/feathersjs/feathers/compare/v5.0.21...v5.0.22) (2024-02-15) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.21](https://github.com/feathersjs/feathers/compare/v5.0.20...v5.0.21) (2024-01-25) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.20](https://github.com/feathersjs/feathers/compare/v5.0.19...v5.0.20) (2024-01-24) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.19](https://github.com/feathersjs/feathers/compare/v5.0.18...v5.0.19) (2024-01-23) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.18](https://github.com/feathersjs/feathers/compare/v5.0.17...v5.0.18) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.17](https://github.com/feathersjs/feathers/compare/v5.0.16...v5.0.17) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.16](https://github.com/feathersjs/feathers/compare/v5.0.15...v5.0.16) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.15](https://github.com/feathersjs/feathers/compare/v5.0.14...v5.0.15) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.14](https://github.com/feathersjs/feathers/compare/v5.0.13...v5.0.14) (2024-01-05) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.13](https://github.com/feathersjs/feathers/compare/v5.0.12...v5.0.13) (2023-12-29) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.12](https://github.com/feathersjs/feathers/compare/v5.0.11...v5.0.12) (2023-11-28) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.11](https://github.com/feathersjs/feathers/compare/v5.0.10...v5.0.11) (2023-10-11) - -### Bug Fixes - -- **knex:** Update all dependencies and Knex peer ([#3308](https://github.com/feathersjs/feathers/issues/3308)) ([d2f9860](https://github.com/feathersjs/feathers/commit/d2f986036c4741cce2339d8abbcc6b2eb037a12a)) - -## [5.0.10](https://github.com/feathersjs/feathers/compare/v5.0.9...v5.0.10) (2023-10-03) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.9](https://github.com/feathersjs/feathers/compare/v5.0.8...v5.0.9) (2023-09-27) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.8](https://github.com/feathersjs/feathers/compare/v5.0.7...v5.0.8) (2023-07-19) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.7](https://github.com/feathersjs/feathers/compare/v5.0.6...v5.0.7) (2023-07-14) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.6](https://github.com/feathersjs/feathers/compare/v5.0.5...v5.0.6) (2023-06-15) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.5](https://github.com/feathersjs/feathers/compare/v5.0.4...v5.0.5) (2023-04-28) - -**Note:** Version bump only for package @feathersjs/commons - -## [5.0.4](https://github.com/feathersjs/feathers/compare/v5.0.3...v5.0.4) (2023-04-12) - -### Bug Fixes - -- Make sure all Readme files are up to date ([#3154](https://github.com/feathersjs/feathers/issues/3154)) ([a5f0b38](https://github.com/feathersjs/feathers/commit/a5f0b38bbf2a11486415a39533bcc6c67fb51e3e)) - -## [5.0.3](https://github.com/feathersjs/feathers/compare/v5.0.2...v5.0.3) (2023-04-05) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3139](https://github.com/feathersjs/feathers/issues/3139)) ([f24276e](https://github.com/feathersjs/feathers/commit/f24276e9a909e2e58a0730c730258ce1f70f4028)) - -## [5.0.1](https://github.com/feathersjs/feathers/compare/v5.0.0...v5.0.1) (2023-03-15) - -### Bug Fixes - -- **core:** Use Symbol.for to instantiate shared symbols ([#3087](https://github.com/feathersjs/feathers/issues/3087)) ([7f3fc21](https://github.com/feathersjs/feathers/commit/7f3fc2167576f228f8183568eb52b077160e8d65)) - -# [5.0.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.38...v5.0.0) (2023-02-24) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.38](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.37...v5.0.0-pre.38) (2023-02-17) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.37](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.36...v5.0.0-pre.37) (2023-02-09) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.36](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.35...v5.0.0-pre.36) (2023-01-29) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.35](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.34...v5.0.0-pre.35) (2023-01-12) - -### Features - -- **generators:** Move core code generators to shared generators package ([#2982](https://github.com/feathersjs/feathers/issues/2982)) ([0328d22](https://github.com/feathersjs/feathers/commit/0328d2292153870bc43958f73d2c6f288a8cec17)) - -# [5.0.0-pre.34](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.33...v5.0.0-pre.34) (2022-12-14) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.33](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.32...v5.0.0-pre.33) (2022-11-08) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.32](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.31...v5.0.0-pre.32) (2022-10-26) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.31](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.30...v5.0.0-pre.31) (2022-10-12) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.30](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.29...v5.0.0-pre.30) (2022-10-07) - -### Features - -- **core:** Allow to unregister services at runtime ([#2756](https://github.com/feathersjs/feathers/issues/2756)) ([d16601f](https://github.com/feathersjs/feathers/commit/d16601f2277dca5357866ffdefba2a611f6dc7fa)) - -# [5.0.0-pre.29](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.28...v5.0.0-pre.29) (2022-09-16) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.28](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.27...v5.0.0-pre.28) (2022-08-03) - -### Bug Fixes - -- **cli:** Improve generated application and client ([#2701](https://github.com/feathersjs/feathers/issues/2701)) ([bd55ffb](https://github.com/feathersjs/feathers/commit/bd55ffb812e89bf215f4515e7f137656ea888c3f)) - -# [5.0.0-pre.27](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.26...v5.0.0-pre.27) (2022-07-13) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.26](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.25...v5.0.0-pre.26) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.25](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.24...v5.0.0-pre.25) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.24](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.23...v5.0.0-pre.24) (2022-06-21) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.23](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.22...v5.0.0-pre.23) (2022-06-06) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.22](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.21...v5.0.0-pre.22) (2022-05-24) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.20](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.19...v5.0.0-pre.20) (2022-05-04) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.19](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.18...v5.0.0-pre.19) (2022-05-01) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.18](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.17...v5.0.0-pre.18) (2022-04-11) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.17](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.16...v5.0.0-pre.17) (2022-02-15) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.16](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.15...v5.0.0-pre.16) (2022-01-12) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.15](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.14...v5.0.0-pre.15) (2021-11-27) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.14](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.13...v5.0.0-pre.14) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.13](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.12...v5.0.0-pre.13) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.12](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.11...v5.0.0-pre.12) (2021-10-12) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.11](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.10...v5.0.0-pre.11) (2021-10-06) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.10](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.9...v5.0.0-pre.10) (2021-09-19) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.9](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.8...v5.0.0-pre.9) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.8](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.7...v5.0.0-pre.8) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.7](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.6...v5.0.0-pre.7) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.6](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.5...v5.0.0-pre.6) (2021-08-08) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.4...v5.0.0-pre.5) (2021-06-23) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.3...v5.0.0-pre.4) (2021-05-13) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.2...v5.0.0-pre.3) (2021-04-21) - -### Bug Fixes - -- **typescript:** Improve TypeScript backwards compatibility ([#2310](https://github.com/feathersjs/feathers/issues/2310)) ([f33be73](https://github.com/feathersjs/feathers/commit/f33be73fc46a533efb15df9aab0658e3240d3897)) - -### Features - -- **dependencies:** Remove direct debug dependency ([#2296](https://github.com/feathersjs/feathers/issues/2296)) ([501d416](https://github.com/feathersjs/feathers/commit/501d4164d30c6a126906dc640cdfdc82207ba34a)) - -# [5.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.1...v5.0.0-pre.2) (2021-04-06) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-beta.1](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2021-04-03) - -**Note:** Version bump only for package @feathersjs/commons - -# [5.0.0-beta.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.1...v5.0.0-beta.0) (2021-03-28) - -### Bug Fixes - -- Update Grant usage and other dependencies ([#2264](https://github.com/feathersjs/feathers/issues/2264)) ([7b0f8fa](https://github.com/feathersjs/feathers/commit/7b0f8fad252419ed0ad0bf259cdf3104d322ab60)) - -# [5.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.5.11...v5.0.0-pre.1) (2020-12-17) - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -### Features - -- **core:** Migrate @feathersjs/feathers to TypeScript ([#1963](https://github.com/feathersjs/feathers/issues/1963)) ([7812529](https://github.com/feathersjs/feathers/commit/7812529ff0f1008e21211f1d01efbc49795dbe55)) -- **core:** use @feathers/hooks and add async type ([#1929](https://github.com/feathersjs/feathers/issues/1929)) ([a5c4756](https://github.com/feathersjs/feathers/commit/a5c47562eae8410c82fe2f6308f26f8e78b6a3e8)) - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -### Features - -- **core:** Migrate @feathersjs/feathers to TypeScript ([#1963](https://github.com/feathersjs/feathers/issues/1963)) ([7812529](https://github.com/feathersjs/feathers/commit/7812529ff0f1008e21211f1d01efbc49795dbe55)) -- **core:** use @feathers/hooks and add async type ([#1929](https://github.com/feathersjs/feathers/issues/1929)) ([a5c4756](https://github.com/feathersjs/feathers/commit/a5c47562eae8410c82fe2f6308f26f8e78b6a3e8)) - -## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05) - -**Note:** Version bump only for package @feathersjs/commons - -## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08) - -**Note:** Version bump only for package @feathersjs/commons - -## [4.5.9](https://github.com/feathersjs/feathers/compare/v4.5.8...v4.5.9) (2020-10-09) - -**Note:** Version bump only for package @feathersjs/commons - -## [4.5.8](https://github.com/feathersjs/feathers/compare/v4.5.7...v4.5.8) (2020-08-12) - -**Note:** Version bump only for package @feathersjs/commons - -## [4.5.7](https://github.com/feathersjs/feathers/compare/v4.5.6...v4.5.7) (2020-07-24) - -**Note:** Version bump only for package @feathersjs/commons - -## [4.5.5](https://github.com/feathersjs/feathers/compare/v4.5.4...v4.5.5) (2020-07-11) - -**Note:** Version bump only for package @feathersjs/commons - -## [4.5.3](https://github.com/feathersjs/feathers/compare/v4.5.2...v4.5.3) (2020-04-17) - -**Note:** Version bump only for package @feathersjs/commons - -## [4.5.2](https://github.com/feathersjs/feathers/compare/v4.5.1...v4.5.2) (2020-03-04) - -**Note:** Version bump only for package @feathersjs/commons - -## [4.5.1](https://github.com/feathersjs/feathers/compare/v4.5.0...v4.5.1) (2020-01-24) - -**Note:** Version bump only for package @feathersjs/commons - -# [4.5.0](https://github.com/feathersjs/feathers/compare/v4.4.3...v4.5.0) (2020-01-18) - -**Note:** Version bump only for package @feathersjs/commons - -## [4.4.3](https://github.com/feathersjs/feathers/compare/v4.4.1...v4.4.3) (2019-12-06) - -**Note:** Version bump only for package @feathersjs/commons - -## [4.4.1](https://github.com/feathersjs/feathers/compare/v4.4.0...v4.4.1) (2019-11-27) - -**Note:** Version bump only for package @feathersjs/commons - -## [4.3.7](https://github.com/feathersjs/feathers/compare/v4.3.6...v4.3.7) (2019-10-14) - -### Bug Fixes - -- make \_\_hooks writable and configurable ([#1520](https://github.com/feathersjs/feathers/issues/1520)) ([1c6c374](https://github.com/feathersjs/feathers/commit/1c6c3742ecf1cb813be56074da89e6736d03ffe8)) - -# [4.3.0](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.4...v4.3.0) (2019-08-27) - -**Note:** Version bump only for package @feathersjs/commons - -# [4.3.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.3...v4.3.0-pre.4) (2019-08-22) - -**Note:** Version bump only for package @feathersjs/commons - -# [4.3.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.2...v4.3.0-pre.3) (2019-08-19) - -### Bug Fixes - -- Update all dependencies ([7d53a00](https://github.com/feathersjs/feathers/commit/7d53a00)) - -# [4.3.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.1...v4.3.0-pre.2) (2019-08-02) - -**Note:** Version bump only for package @feathersjs/commons - -# [4.3.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.5...v4.3.0-pre.1) (2019-07-11) - -**Note:** Version bump only for package @feathersjs/commons - -# [4.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.4...v4.0.0-pre.5) (2019-07-10) - -**Note:** Version bump only for package @feathersjs/commons - -# [4.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.3...v4.0.0-pre.4) (2019-07-05) - -**Note:** Version bump only for package @feathersjs/commons - -# [4.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.2...v4.0.0-pre.3) (2019-06-01) - -### Bug Fixes - -- Update dependencies and fix tests ([#1373](https://github.com/feathersjs/feathers/issues/1373)) ([d743a7f](https://github.com/feathersjs/feathers/commit/d743a7f)) - -# [4.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v3.2.0-pre.1...v4.0.0-pre.0) (2019-04-21) - -### Bug Fixes - -- Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803)) -- Update all dependencies to latest ([#1206](https://github.com/feathersjs/feathers/issues/1206)) ([e51e0f6](https://github.com/feathersjs/feathers/commit/e51e0f6)) -- use minimal RegExp matching for better performance ([#977](https://github.com/feathersjs/feathers/issues/977)) ([3ca7e97](https://github.com/feathersjs/feathers/commit/3ca7e97)) - -### Features - -- Add TypeScript definitions ([#1275](https://github.com/feathersjs/feathers/issues/1275)) ([9dd6713](https://github.com/feathersjs/feathers/commit/9dd6713)) -- Common database adapter utilities and test suite ([#1130](https://github.com/feathersjs/feathers/issues/1130)) ([17b3dc8](https://github.com/feathersjs/feathers/commit/17b3dc8)) -- Remove (hook, next) signature and SKIP support ([#1269](https://github.com/feathersjs/feathers/issues/1269)) ([211c0f8](https://github.com/feathersjs/feathers/commit/211c0f8)) - -### BREAKING CHANGES - -- Move database adapter utilities from @feathersjs/commons into its own module - - - -# [4.0.0](https://github.com/feathersjs/feathers/compare/@feathersjs/commons@3.0.1...@feathersjs/commons@4.0.0) (2018-12-16) - -### Bug Fixes - -- Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803)) - -### Features - -- Common database adapter utilities and test suite ([#1130](https://github.com/feathersjs/feathers/issues/1130)) ([17b3dc8](https://github.com/feathersjs/feathers/commit/17b3dc8)) - -### BREAKING CHANGES - -- Move database adapter utilities from @feathersjs/commons into its own module - - - -## [3.0.1](https://github.com/feathersjs/feathers/compare/@feathersjs/commons@3.0.0...@feathersjs/commons@3.0.1) (2018-09-17) - -### Bug Fixes - -- use minimal RegExp matching for better performance ([#977](https://github.com/feathersjs/feathers/issues/977)) ([3ca7e97](https://github.com/feathersjs/feathers/commit/3ca7e97)) - -# Change Log - -## [v3.0.0-pre.1](https://github.com/feathersjs/commons/tree/v3.0.0-pre.1) (2018-08-13) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v2.0.0...v3.0.0-pre.1) - -**Merged pull requests:** - -- Remove argument verification and add further utilities [\#81](https://github.com/feathersjs/commons/pull/81) ([daffl](https://github.com/daffl)) - -## [v2.0.0](https://github.com/feathersjs/commons/tree/v2.0.0) (2018-08-03) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v1.4.4...v2.0.0) - -**Merged pull requests:** - -- Merge major with latest changes [\#80](https://github.com/feathersjs/commons/pull/80) ([daffl](https://github.com/daffl)) -- Ability to specify custom filters in filterQuery [\#73](https://github.com/feathersjs/commons/pull/73) ([vonagam](https://github.com/vonagam)) - -## [v1.4.4](https://github.com/feathersjs/commons/tree/v1.4.4) (2018-08-01) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v1.4.3...v1.4.4) - -## [v1.4.3](https://github.com/feathersjs/commons/tree/v1.4.3) (2018-07-25) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v1.4.2...v1.4.3) - -**Merged pull requests:** - -- Revert breaking change from 78d780de91ae8333f3843be153beb5deea55c792 [\#78](https://github.com/feathersjs/commons/pull/78) ([daffl](https://github.com/daffl)) - -## [v1.4.2](https://github.com/feathersjs/commons/tree/v1.4.2) (2018-07-25) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v1.4.1...v1.4.2) - -**Closed issues:** - -- Sort error on multiple fields [\#74](https://github.com/feathersjs/commons/issues/74) -- Cannot build with create-react-app \(again\) [\#71](https://github.com/feathersjs/commons/issues/71) - -**Merged pull requests:** - -- Update all dependencies [\#77](https://github.com/feathersjs/commons/pull/77) ([daffl](https://github.com/daffl)) -- Use sorting algorithm from NeDB [\#76](https://github.com/feathersjs/commons/pull/76) ([daffl](https://github.com/daffl)) -- Open hook workflow to custom methods [\#72](https://github.com/feathersjs/commons/pull/72) ([bertho-zero](https://github.com/bertho-zero)) - -## [v1.4.1](https://github.com/feathersjs/commons/tree/v1.4.1) (2018-04-12) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v1.4.0...v1.4.1) - -**Closed issues:** - -- Uncaught ReferenceError: convertGetOrRemove is not defined [\#69](https://github.com/feathersjs/commons/issues/69) -- Cannot build with create-react-app [\#68](https://github.com/feathersjs/commons/issues/68) - -**Merged pull requests:** - -- Make conversion functions more concise [\#70](https://github.com/feathersjs/commons/pull/70) ([daffl](https://github.com/daffl)) -- Update mocha to the latest version 🚀 [\#67](https://github.com/feathersjs/commons/pull/67) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.4.0](https://github.com/feathersjs/commons/tree/v1.4.0) (2018-01-17) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v1.3.1...v1.4.0) - -**Merged pull requests:** - -- Add ability to skip all following hooks [\#65](https://github.com/feathersjs/commons/pull/65) ([sylvainlap](https://github.com/sylvainlap)) - -## [v1.3.1](https://github.com/feathersjs/commons/tree/v1.3.1) (2018-01-12) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v1.3.0...v1.3.1) - -**Merged pull requests:** - -- Allow array for sorting [\#66](https://github.com/feathersjs/commons/pull/66) ([daffl](https://github.com/daffl)) -- Update semistandard to the latest version 🚀 [\#64](https://github.com/feathersjs/commons/pull/64) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.3.0](https://github.com/feathersjs/commons/tree/v1.3.0) (2017-11-20) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v1.2.0...v1.3.0) - -**Merged pull requests:** - -- Add a toJSON method to the hook context [\#63](https://github.com/feathersjs/commons/pull/63) ([daffl](https://github.com/daffl)) -- updating contributing guide and issue template [\#61](https://github.com/feathersjs/commons/pull/61) ([ekryski](https://github.com/ekryski)) - -## [v1.2.0](https://github.com/feathersjs/commons/tree/v1.2.0) (2017-10-25) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v1.1.0...v1.2.0) - -**Merged pull requests:** - -- Bring back makeUrl [\#62](https://github.com/feathersjs/commons/pull/62) ([daffl](https://github.com/daffl)) -- adding codeclimate config [\#60](https://github.com/feathersjs/commons/pull/60) ([ekryski](https://github.com/ekryski)) - -## [v1.1.0](https://github.com/feathersjs/commons/tree/v1.1.0) (2017-10-23) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v1.0.0...v1.1.0) - -**Merged pull requests:** - -- Remove unused utilities and add some inline documentation [\#59](https://github.com/feathersjs/commons/pull/59) ([daffl](https://github.com/daffl)) -- Add feathers-query-filters [\#58](https://github.com/feathersjs/commons/pull/58) ([daffl](https://github.com/daffl)) - -## [v1.0.0](https://github.com/feathersjs/commons/tree/v1.0.0) (2017-10-19) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v1.0.0-pre.3...v1.0.0) - -**Merged pull requests:** - -- Rename repository and add to npm scope [\#57](https://github.com/feathersjs/commons/pull/57) ([daffl](https://github.com/daffl)) -- Updates for Feathers v3 \(Buzzard\) [\#56](https://github.com/feathersjs/commons/pull/56) ([daffl](https://github.com/daffl)) - -## [v1.0.0-pre.3](https://github.com/feathersjs/commons/tree/v1.0.0-pre.3) (2017-10-18) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v1.0.0-pre.2...v1.0.0-pre.3) - -**Merged pull requests:** - -- Update the client test suite [\#55](https://github.com/feathersjs/commons/pull/55) ([daffl](https://github.com/daffl)) -- Update mocha to the latest version 🚀 [\#54](https://github.com/feathersjs/commons/pull/54) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.0.0-pre.2](https://github.com/feathersjs/commons/tree/v1.0.0-pre.2) (2017-07-11) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v1.0.0-pre.1...v1.0.0-pre.2) - -**Merged pull requests:** - -- Update to new plugin infrastructure [\#53](https://github.com/feathersjs/commons/pull/53) ([daffl](https://github.com/daffl)) - -## [v1.0.0-pre.1](https://github.com/feathersjs/commons/tree/v1.0.0-pre.1) (2017-06-28) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.8.7...v1.0.0-pre.1) - -**Merged pull requests:** - -- Commons for Feathers v3 [\#52](https://github.com/feathersjs/commons/pull/52) ([daffl](https://github.com/daffl)) -- Update chai to the latest version 🚀 [\#51](https://github.com/feathersjs/commons/pull/51) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update semistandard to the latest version 🚀 [\#50](https://github.com/feathersjs/commons/pull/50) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update dependencies to enable Greenkeeper 🌴 [\#49](https://github.com/feathersjs/commons/pull/49) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v0.8.7](https://github.com/feathersjs/commons/tree/v0.8.7) (2016-11-30) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.8.6...v0.8.7) - -**Closed issues:** - -- Matcher function blows up with null values [\#46](https://github.com/feathersjs/commons/issues/46) - -**Merged pull requests:** - -- matcher now doesn't blow up with null values. Closes \#46 [\#47](https://github.com/feathersjs/commons/pull/47) ([ekryski](https://github.com/ekryski)) - -## [v0.8.6](https://github.com/feathersjs/commons/tree/v0.8.6) (2016-11-25) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.8.5...v0.8.6) - -**Merged pull requests:** - -- Allow to pass an object to hook object [\#45](https://github.com/feathersjs/commons/pull/45) ([daffl](https://github.com/daffl)) - -## [v0.8.5](https://github.com/feathersjs/commons/tree/v0.8.5) (2016-11-19) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.8.4...v0.8.5) - -**Merged pull requests:** - -- Deep merge and toObject [\#44](https://github.com/feathersjs/commons/pull/44) ([ekryski](https://github.com/ekryski)) -- Expose lodash functions [\#43](https://github.com/feathersjs/commons/pull/43) ([ekryski](https://github.com/ekryski)) -- Make url [\#42](https://github.com/feathersjs/commons/pull/42) ([ekryski](https://github.com/ekryski)) -- Expect syntax [\#41](https://github.com/feathersjs/commons/pull/41) ([ekryski](https://github.com/ekryski)) - -## [v0.8.4](https://github.com/feathersjs/commons/tree/v0.8.4) (2016-11-11) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.8.3...v0.8.4) - -## [v0.8.3](https://github.com/feathersjs/commons/tree/v0.8.3) (2016-11-11) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.8.2...v0.8.3) - -## [v0.8.2](https://github.com/feathersjs/commons/tree/v0.8.2) (2016-11-11) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.8.1...v0.8.2) - -**Merged pull requests:** - -- One more fix for select on arrays [\#40](https://github.com/feathersjs/commons/pull/40) ([daffl](https://github.com/daffl)) - -## [v0.8.1](https://github.com/feathersjs/commons/tree/v0.8.1) (2016-11-11) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.8.0...v0.8.1) - -**Merged pull requests:** - -- Fixing select utility methods to work with query selector [\#39](https://github.com/feathersjs/commons/pull/39) ([daffl](https://github.com/daffl)) - -## [v0.8.0](https://github.com/feathersjs/commons/tree/v0.8.0) (2016-11-09) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.7.8...v0.8.0) - -**Merged pull requests:** - -- Implementing lodash utilities and helpers for selecting [\#38](https://github.com/feathersjs/commons/pull/38) ([daffl](https://github.com/daffl)) -- jshint —\> semistandard [\#37](https://github.com/feathersjs/commons/pull/37) ([corymsmith](https://github.com/corymsmith)) - -## [v0.7.8](https://github.com/feathersjs/commons/tree/v0.7.8) (2016-10-21) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.7.7...v0.7.8) - -**Merged pull requests:** - -- Make getting the service in base test dynamic [\#36](https://github.com/feathersjs/commons/pull/36) ([daffl](https://github.com/daffl)) - -## [v0.7.7](https://github.com/feathersjs/commons/tree/v0.7.7) (2016-10-21) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.7.6...v0.7.7) - -**Merged pull requests:** - -- Allow app in hookObject [\#35](https://github.com/feathersjs/commons/pull/35) ([daffl](https://github.com/daffl)) - -## [v0.7.6](https://github.com/feathersjs/commons/tree/v0.7.6) (2016-10-20) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.7.5...v0.7.6) - -**Merged pull requests:** - -- Add test for matching and increase code coverage [\#34](https://github.com/feathersjs/commons/pull/34) ([daffl](https://github.com/daffl)) -- omit '$select' in matcher [\#33](https://github.com/feathersjs/commons/pull/33) ([beeplin](https://github.com/beeplin)) -- adding code coverage [\#32](https://github.com/feathersjs/commons/pull/32) ([ekryski](https://github.com/ekryski)) - -## [v0.7.5](https://github.com/feathersjs/commons/tree/v0.7.5) (2016-09-05) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.7.4...v0.7.5) - -**Closed issues:** - -- Feathers should accept other type of data beside only the object type. [\#26](https://github.com/feathersjs/commons/issues/26) -- Send better error messages for method normalization [\#12](https://github.com/feathersjs/commons/issues/12) - -**Merged pull requests:** - -- Allow matching nested $or queries [\#29](https://github.com/feathersjs/commons/pull/29) ([daffl](https://github.com/daffl)) -- Add default export to `hooks.js` [\#28](https://github.com/feathersjs/commons/pull/28) ([KenanY](https://github.com/KenanY)) -- Update mocha to version 3.0.0 🚀 [\#27](https://github.com/feathersjs/commons/pull/27) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v0.7.4](https://github.com/feathersjs/commons/tree/v0.7.4) (2016-05-29) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.7.3...v0.7.4) - -**Merged pull requests:** - -- Use forEach instead of ES6 'for of' loop [\#25](https://github.com/feathersjs/commons/pull/25) ([lopezjurip](https://github.com/lopezjurip)) -- mocha@2.5.0 breaks build 🚨 [\#24](https://github.com/feathersjs/commons/pull/24) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update babel-plugin-add-module-exports to version 0.2.0 🚀 [\#23](https://github.com/feathersjs/commons/pull/23) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v0.7.3](https://github.com/feathersjs/commons/tree/v0.7.3) (2016-05-05) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.7.2...v0.7.3) - -**Merged pull requests:** - -- Make sure arguments from hook objects are created properly for known … [\#22](https://github.com/feathersjs/commons/pull/22) ([daffl](https://github.com/daffl)) - -## [v0.7.2](https://github.com/feathersjs/commons/tree/v0.7.2) (2016-04-26) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.7.1...v0.7.2) - -**Merged pull requests:** - -- Update test fixture to use promises and add error cases [\#19](https://github.com/feathersjs/commons/pull/19) ([daffl](https://github.com/daffl)) - -## [v0.7.1](https://github.com/feathersjs/commons/tree/v0.7.1) (2016-04-04) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.6.2...v0.7.1) - -**Merged pull requests:** - -- Adding functionality and tests for shared query and list handling [\#17](https://github.com/feathersjs/commons/pull/17) ([daffl](https://github.com/daffl)) - -## [v0.6.2](https://github.com/feathersjs/commons/tree/v0.6.2) (2016-02-09) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.7.0...v0.6.2) - -## [v0.7.0](https://github.com/feathersjs/commons/tree/v0.7.0) (2016-02-08) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.6.1...v0.7.0) - -## [v0.6.1](https://github.com/feathersjs/commons/tree/v0.6.1) (2016-02-08) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.6.0...v0.6.1) - -**Merged pull requests:** - -- Add NSP check to test script. [\#16](https://github.com/feathersjs/commons/pull/16) ([marshallswain](https://github.com/marshallswain)) - -## [v0.6.0](https://github.com/feathersjs/commons/tree/v0.6.0) (2016-01-21) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.5.0...v0.6.0) - -**Closed issues:** - -- Rename hooks to hookUtils to make room for common hooks. [\#13](https://github.com/feathersjs/commons/issues/13) - -**Merged pull requests:** - -- Remove shared socket functionality [\#15](https://github.com/feathersjs/commons/pull/15) ([daffl](https://github.com/daffl)) -- Support socket routes with apps mounted on a path [\#14](https://github.com/feathersjs/commons/pull/14) ([daffl](https://github.com/daffl)) - -## [v0.5.0](https://github.com/feathersjs/commons/tree/v0.5.0) (2016-01-10) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.4.0...v0.5.0) - -## [v0.4.0](https://github.com/feathersjs/commons/tree/v0.4.0) (2016-01-10) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.3.4...v0.4.0) - -## [v0.3.4](https://github.com/feathersjs/commons/tree/v0.3.4) (2016-01-06) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.3.3...v0.3.4) - -**Merged pull requests:** - -- Fix SocketIO client iteration for all cases [\#11](https://github.com/feathersjs/commons/pull/11) ([daffl](https://github.com/daffl)) - -## [v0.3.3](https://github.com/feathersjs/commons/tree/v0.3.3) (2016-01-06) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.3.2...v0.3.3) - -**Closed issues:** - -- Socket.io 1.4.0 broke feathers [\#10](https://github.com/feathersjs/commons/issues/10) - -## [v0.3.2](https://github.com/feathersjs/commons/tree/v0.3.2) (2016-01-06) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.3.1...v0.3.2) - -## [v0.3.1](https://github.com/feathersjs/commons/tree/v0.3.1) (2016-01-06) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.3.0...v0.3.1) - -## [v0.3.0](https://github.com/feathersjs/commons/tree/v0.3.0) (2015-12-11) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.2.11...v0.3.0) - -**Closed issues:** - -- babel inside package.json breaks react-native [\#9](https://github.com/feathersjs/commons/issues/9) - -## [v0.2.11](https://github.com/feathersjs/commons/tree/v0.2.11) (2015-11-30) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.2.10...v0.2.11) - -**Merged pull requests:** - -- getOrRemove did not check id property type [\#8](https://github.com/feathersjs/commons/pull/8) ([daffl](https://github.com/daffl)) - -## [v0.2.10](https://github.com/feathersjs/commons/tree/v0.2.10) (2015-11-28) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.2.9...v0.2.10) - -**Closed issues:** - -- Remove dependency on lodash [\#6](https://github.com/feathersjs/commons/issues/6) - -**Merged pull requests:** - -- Migrate to Babel 6 and remove Lodash dependency [\#7](https://github.com/feathersjs/commons/pull/7) ([daffl](https://github.com/daffl)) - -## [v0.2.9](https://github.com/feathersjs/commons/tree/v0.2.9) (2015-11-17) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.2.8...v0.2.9) - -**Closed issues:** - -- Event dispatcher context is not being set to the service [\#5](https://github.com/feathersjs/commons/issues/5) -- .create with no callback throws error [\#4](https://github.com/feathersjs/commons/issues/4) - -## [v0.2.8](https://github.com/feathersjs/commons/tree/v0.2.8) (2015-10-06) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.2.7...v0.2.8) - -**Closed issues:** - -- getArguments not exporting correctly [\#1](https://github.com/feathersjs/commons/issues/1) - -**Merged pull requests:** - -- Add hookObject utilities and remove Lodash dependency from arguments.js [\#3](https://github.com/feathersjs/commons/pull/3) ([daffl](https://github.com/daffl)) - -## [v0.2.7](https://github.com/feathersjs/commons/tree/v0.2.7) (2015-03-07) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.2.6...v0.2.7) - -## [v0.2.6](https://github.com/feathersjs/commons/tree/v0.2.6) (2015-03-06) - -[Full Changelog](https://github.com/feathersjs/commons/compare/v0.2.5...v0.2.6) - -## [v0.2.5](https://github.com/feathersjs/commons/tree/v0.2.5) (2015-03-06) - -[Full Changelog](https://github.com/feathersjs/commons/compare/0.2.3...v0.2.5) - -## [0.2.3](https://github.com/feathersjs/commons/tree/0.2.3) (2015-03-06) - -[Full Changelog](https://github.com/feathersjs/commons/compare/0.2.2...0.2.3) - -## [0.2.2](https://github.com/feathersjs/commons/tree/0.2.2) (2015-03-06) - -[Full Changelog](https://github.com/feathersjs/commons/compare/0.2.1...0.2.2) - -## [0.2.1](https://github.com/feathersjs/commons/tree/0.2.1) (2015-03-06) - -[Full Changelog](https://github.com/feathersjs/commons/compare/0.2.0...0.2.1) - -## [0.2.0](https://github.com/feathersjs/commons/tree/0.2.0) (2015-03-06) - -[Full Changelog](https://github.com/feathersjs/commons/compare/0.1.0...0.2.0) - -## [0.1.0](https://github.com/feathersjs/commons/tree/0.1.0) (2015-03-06) - -\* _This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)_ diff --git a/packages/commons/LICENSE b/packages/commons/LICENSE deleted file mode 100644 index 7712f870f3..0000000000 --- a/packages/commons/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2024 Feathers Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/packages/commons/README.md b/packages/commons/README.md deleted file mode 100644 index 2eefb2bb7f..0000000000 --- a/packages/commons/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Feathers Commons - -[](https://github.com/feathersjs/feathers/actions?query=workflow%3ACI) -[](https://www.npmjs.com/package/@feathersjs/commons) -[](https://discord.gg/qa8kez8QBx) - -> Shared Feathers utility functions - -## Installation - -``` -npm install @feathersjs/commons --save -``` - -## Documentation - -Refer to the [Feathers API](https://feathersjs.com/api) for more details. - -## License - -Copyright (c) 2024 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors) - -Licensed under the [MIT license](LICENSE). diff --git a/packages/commons/package.json b/packages/commons/package.json deleted file mode 100644 index b7e826dca4..0000000000 --- a/packages/commons/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "@feathersjs/commons", - "version": "5.0.34", - "description": "Shared Feathers utility functions", - "homepage": "https://feathersjs.com", - "keywords": [ - "feathers" - ], - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/daffl" - }, - "repository": { - "type": "git", - "url": "git://github.com/feathersjs/feathers.git", - "directory": "packages/commons" - }, - "author": { - "name": "Feathers contributor", - "email": "hello@feathersjs.com", - "url": "https://feathersjs.com" - }, - "contributors": [], - "bugs": { - "url": "https://github.com/feathersjs/feathers/issues" - }, - "engines": { - "node": ">= 12" - }, - "main": "lib/", - "types": "lib/", - "files": [ - "CHANGELOG.md", - "LICENSE", - "README.md", - "src/**", - "lib/**", - "*.d.ts", - "*.js" - ], - "scripts": { - "prepublish": "npm run compile", - "pack": "npm pack --pack-destination ../generators/test/build", - "compile": "shx rm -rf lib/ && tsc && npm run pack", - "test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts" - }, - "directories": { - "lib": "lib" - }, - "publishConfig": { - "access": "public" - }, - "devDependencies": { - "@types/mocha": "^10.0.10", - "@types/node": "^24.1.0", - "mocha": "^11.7.1", - "shx": "^0.4.0", - "ts-node": "^10.9.2", - "typescript": "^5.9.2" - }, - "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5" -} diff --git a/packages/commons/test/module.test.ts b/packages/commons/test/module.test.ts deleted file mode 100644 index 06198d039e..0000000000 --- a/packages/commons/test/module.test.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { strict as assert } from 'assert' -import { _ } from '../src' - -describe('module', () => { - it('is commonjs compatible', () => { - // eslint-disable-next-line - const commons = require('../lib') - - assert.equal(typeof commons, 'object') - assert.equal(typeof commons.stripSlashes, 'function') - assert.equal(typeof commons._, 'object') - }) - - it('exposes lodash methods under _', () => { - assert.equal(typeof _.each, 'function') - assert.equal(typeof _.some, 'function') - assert.equal(typeof _.every, 'function') - assert.equal(typeof _.keys, 'function') - assert.equal(typeof _.values, 'function') - assert.equal(typeof _.isMatch, 'function') - assert.equal(typeof _.isEmpty, 'function') - assert.equal(typeof _.isObject, 'function') - assert.equal(typeof _.extend, 'function') - assert.equal(typeof _.omit, 'function') - assert.equal(typeof _.pick, 'function') - assert.equal(typeof _.merge, 'function') - }) -}) diff --git a/packages/commons/tsconfig.json b/packages/commons/tsconfig.json deleted file mode 100644 index 316fd41336..0000000000 --- a/packages/commons/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig", - "include": [ - "src/**/*.ts" - ], - "compilerOptions": { - "outDir": "lib" - } -} diff --git a/packages/configuration/CHANGELOG.md b/packages/configuration/CHANGELOG.md deleted file mode 100644 index e40797dcf3..0000000000 --- a/packages/configuration/CHANGELOG.md +++ /dev/null @@ -1,735 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [5.0.34](https://github.com/feathersjs/feathers/compare/v5.0.33...v5.0.34) (2025-05-03) - -### Bug Fixes - -- Update dependencies ([#3584](https://github.com/feathersjs/feathers/issues/3584)) ([119fa4e](https://github.com/feathersjs/feathers/commit/119fa4e1ade8b0078aa235083d566e2538b3a084)) - -## [5.0.33](https://github.com/feathersjs/feathers/compare/v5.0.32...v5.0.33) (2025-02-24) - -### Bug Fixes - -- **dependencies:** Update dependencies ([#3571](https://github.com/feathersjs/feathers/issues/3571)) ([ad611cb](https://github.com/feathersjs/feathers/commit/ad611cb6ffb1dc31d603ba5817331318c5a23217)) - -## [5.0.32](https://github.com/feathersjs/feathers/compare/v5.0.31...v5.0.32) (2025-02-01) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.31](https://github.com/feathersjs/feathers/compare/v5.0.30...v5.0.31) (2024-10-31) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3545](https://github.com/feathersjs/feathers/issues/3545)) ([221b92b](https://github.com/feathersjs/feathers/commit/221b92bb0ee5d54fb1036742968797cb02e56da2)) - -## [5.0.30](https://github.com/feathersjs/feathers/compare/v5.0.29...v5.0.30) (2024-09-02) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.29](https://github.com/feathersjs/feathers/compare/v5.0.28...v5.0.29) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.28](https://github.com/feathersjs/feathers/compare/v5.0.27...v5.0.28) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.27](https://github.com/feathersjs/feathers/compare/v5.0.26...v5.0.27) (2024-06-18) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.26](https://github.com/feathersjs/feathers/compare/v5.0.25...v5.0.26) (2024-06-09) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.25](https://github.com/feathersjs/feathers/compare/v5.0.24...v5.0.25) (2024-05-03) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.24](https://github.com/feathersjs/feathers/compare/v5.0.23...v5.0.24) (2024-03-13) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.23](https://github.com/feathersjs/feathers/compare/v5.0.22...v5.0.23) (2024-02-25) - -### Bug Fixes - -- **core:** Update to latest feathersjs/hooks ([#3434](https://github.com/feathersjs/feathers/issues/3434)) ([1499ccc](https://github.com/feathersjs/feathers/commit/1499ccc41fb3ebba97b2c84e0cb19bc48ad3c651)) - -## [5.0.22](https://github.com/feathersjs/feathers/compare/v5.0.21...v5.0.22) (2024-02-15) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.21](https://github.com/feathersjs/feathers/compare/v5.0.20...v5.0.21) (2024-01-25) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.20](https://github.com/feathersjs/feathers/compare/v5.0.19...v5.0.20) (2024-01-24) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.19](https://github.com/feathersjs/feathers/compare/v5.0.18...v5.0.19) (2024-01-23) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.18](https://github.com/feathersjs/feathers/compare/v5.0.17...v5.0.18) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.17](https://github.com/feathersjs/feathers/compare/v5.0.16...v5.0.17) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.16](https://github.com/feathersjs/feathers/compare/v5.0.15...v5.0.16) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.15](https://github.com/feathersjs/feathers/compare/v5.0.14...v5.0.15) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.14](https://github.com/feathersjs/feathers/compare/v5.0.13...v5.0.14) (2024-01-05) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.13](https://github.com/feathersjs/feathers/compare/v5.0.12...v5.0.13) (2023-12-29) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.12](https://github.com/feathersjs/feathers/compare/v5.0.11...v5.0.12) (2023-11-28) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.11](https://github.com/feathersjs/feathers/compare/v5.0.10...v5.0.11) (2023-10-11) - -### Bug Fixes - -- **knex:** Update all dependencies and Knex peer ([#3308](https://github.com/feathersjs/feathers/issues/3308)) ([d2f9860](https://github.com/feathersjs/feathers/commit/d2f986036c4741cce2339d8abbcc6b2eb037a12a)) - -## [5.0.10](https://github.com/feathersjs/feathers/compare/v5.0.9...v5.0.10) (2023-10-03) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.9](https://github.com/feathersjs/feathers/compare/v5.0.8...v5.0.9) (2023-09-27) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.8](https://github.com/feathersjs/feathers/compare/v5.0.7...v5.0.8) (2023-07-19) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.7](https://github.com/feathersjs/feathers/compare/v5.0.6...v5.0.7) (2023-07-14) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.6](https://github.com/feathersjs/feathers/compare/v5.0.5...v5.0.6) (2023-06-15) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.5](https://github.com/feathersjs/feathers/compare/v5.0.4...v5.0.5) (2023-04-28) - -**Note:** Version bump only for package @feathersjs/configuration - -## [5.0.4](https://github.com/feathersjs/feathers/compare/v5.0.3...v5.0.4) (2023-04-12) - -### Bug Fixes - -- Make sure all Readme files are up to date ([#3154](https://github.com/feathersjs/feathers/issues/3154)) ([a5f0b38](https://github.com/feathersjs/feathers/commit/a5f0b38bbf2a11486415a39533bcc6c67fb51e3e)) - -## [5.0.3](https://github.com/feathersjs/feathers/compare/v5.0.2...v5.0.3) (2023-04-05) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3139](https://github.com/feathersjs/feathers/issues/3139)) ([f24276e](https://github.com/feathersjs/feathers/commit/f24276e9a909e2e58a0730c730258ce1f70f4028)) - -## [5.0.1](https://github.com/feathersjs/feathers/compare/v5.0.0...v5.0.1) (2023-03-15) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.38...v5.0.0) (2023-02-24) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.38](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.37...v5.0.0-pre.38) (2023-02-17) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.37](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.36...v5.0.0-pre.37) (2023-02-09) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.36](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.35...v5.0.0-pre.36) (2023-01-29) - -### Bug Fixes - -- Update all dependencies ([#3024](https://github.com/feathersjs/feathers/issues/3024)) ([283dc47](https://github.com/feathersjs/feathers/commit/283dc4798d85584bc031e6e54b83b4ea77d1edd0)) - -# [5.0.0-pre.35](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.34...v5.0.0-pre.35) (2023-01-12) - -### Features - -- **generators:** Move core code generators to shared generators package ([#2982](https://github.com/feathersjs/feathers/issues/2982)) ([0328d22](https://github.com/feathersjs/feathers/commit/0328d2292153870bc43958f73d2c6f288a8cec17)) - -# [5.0.0-pre.34](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.33...v5.0.0-pre.34) (2022-12-14) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.33](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.32...v5.0.0-pre.33) (2022-11-08) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.32](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.31...v5.0.0-pre.32) (2022-10-26) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.31](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.30...v5.0.0-pre.31) (2022-10-12) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.30](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.29...v5.0.0-pre.30) (2022-10-07) - -### Features - -- **core:** Allow to unregister services at runtime ([#2756](https://github.com/feathersjs/feathers/issues/2756)) ([d16601f](https://github.com/feathersjs/feathers/commit/d16601f2277dca5357866ffdefba2a611f6dc7fa)) -- **schema:** Make schemas validation library independent and add TypeBox support ([#2772](https://github.com/feathersjs/feathers/issues/2772)) ([44172d9](https://github.com/feathersjs/feathers/commit/44172d99b566d11d9ceda04f1d0bf72b6d05ce76)) - -# [5.0.0-pre.29](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.28...v5.0.0-pre.29) (2022-09-16) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.28](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.27...v5.0.0-pre.28) (2022-08-03) - -### Bug Fixes - -- **cli:** Improve generated application and client ([#2701](https://github.com/feathersjs/feathers/issues/2701)) ([bd55ffb](https://github.com/feathersjs/feathers/commit/bd55ffb812e89bf215f4515e7f137656ea888c3f)) - -# [5.0.0-pre.27](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.26...v5.0.0-pre.27) (2022-07-13) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.26](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.25...v5.0.0-pre.26) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.25](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.24...v5.0.0-pre.25) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.24](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.23...v5.0.0-pre.24) (2022-06-21) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.23](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.22...v5.0.0-pre.23) (2022-06-06) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.22](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.21...v5.0.0-pre.22) (2022-05-24) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.21](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.20...v5.0.0-pre.21) (2022-05-23) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.20](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.19...v5.0.0-pre.20) (2022-05-04) - -### Bug Fixes - -- **configuration:** Only validate the initial configuration against the schema ([#2622](https://github.com/feathersjs/feathers/issues/2622)) ([386c5e2](https://github.com/feathersjs/feathers/commit/386c5e2e67bfad4fb4333f2e3e17f7d7e09ac27e)) -- **dependencies:** Lock monorepo package version numbers ([#2623](https://github.com/feathersjs/feathers/issues/2623)) ([5640c10](https://github.com/feathersjs/feathers/commit/5640c1020cc139994e695d658c08bad3494db507)) - -# [5.0.0-pre.19](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.18...v5.0.0-pre.19) (2022-05-01) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.18](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.17...v5.0.0-pre.18) (2022-04-11) - -### Features - -- **configuration:** Allow app configuration to be validated against a schema ([#2590](https://github.com/feathersjs/feathers/issues/2590)) ([a268f86](https://github.com/feathersjs/feathers/commit/a268f86da92a8ada14ed11ab456aac0a4bba5bb0)) - -# [5.0.0-pre.17](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.16...v5.0.0-pre.17) (2022-02-15) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.16](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.15...v5.0.0-pre.16) (2022-01-12) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.15](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.14...v5.0.0-pre.15) (2021-11-27) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.14](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.13...v5.0.0-pre.14) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.13](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.12...v5.0.0-pre.13) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.12](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.11...v5.0.0-pre.12) (2021-10-12) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.11](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.10...v5.0.0-pre.11) (2021-10-06) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.10](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.9...v5.0.0-pre.10) (2021-09-19) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.9](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.8...v5.0.0-pre.9) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.8](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.7...v5.0.0-pre.8) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.7](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.6...v5.0.0-pre.7) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.6](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.5...v5.0.0-pre.6) (2021-08-08) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.4...v5.0.0-pre.5) (2021-06-23) - -### Bug Fixes - -- **koa:** Use extended query parser for compatibility ([#2397](https://github.com/feathersjs/feathers/issues/2397)) ([b2944ba](https://github.com/feathersjs/feathers/commit/b2944bac3ec6d5ecc80dc518cd4e58093692db74)) - -# [5.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.3...v5.0.0-pre.4) (2021-05-13) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.2...v5.0.0-pre.3) (2021-04-21) - -### Bug Fixes - -- **typescript:** Improve TypeScript backwards compatibility ([#2310](https://github.com/feathersjs/feathers/issues/2310)) ([f33be73](https://github.com/feathersjs/feathers/commit/f33be73fc46a533efb15df9aab0658e3240d3897)) - -### Features - -- **dependencies:** Remove direct debug dependency ([#2296](https://github.com/feathersjs/feathers/issues/2296)) ([501d416](https://github.com/feathersjs/feathers/commit/501d4164d30c6a126906dc640cdfdc82207ba34a)) - -# [5.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.1...v5.0.0-pre.2) (2021-04-06) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-beta.1](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2021-04-03) - -**Note:** Version bump only for package @feathersjs/configuration - -# [5.0.0-beta.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.1...v5.0.0-beta.0) (2021-03-28) - -### Bug Fixes - -- Update Grant usage and other dependencies ([#2264](https://github.com/feathersjs/feathers/issues/2264)) ([7b0f8fa](https://github.com/feathersjs/feathers/commit/7b0f8fad252419ed0ad0bf259cdf3104d322ab60)) - -### Features - -- Feathers v5 core refactoring and features ([#2255](https://github.com/feathersjs/feathers/issues/2255)) ([2dafb7c](https://github.com/feathersjs/feathers/commit/2dafb7ce14ba57406aeec13d10ca45b1e709bee9)) - -# [5.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.5.11...v5.0.0-pre.1) (2020-12-17) - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -### chore - -- **configuration:** Remove environment variable substitution ([#1942](https://github.com/feathersjs/feathers/issues/1942)) ([caaa21f](https://github.com/feathersjs/feathers/commit/caaa21ffdc6a8dcac82fb403c91d9d4b781a6c0a)) - -### BREAKING CHANGES - -- **configuration:** Falls back to node-config instead of adding additional - functionality like path replacements and automatic environment variable insertion. - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -### chore - -- **configuration:** Remove environment variable substitution ([#1942](https://github.com/feathersjs/feathers/issues/1942)) ([caaa21f](https://github.com/feathersjs/feathers/commit/caaa21ffdc6a8dcac82fb403c91d9d4b781a6c0a)) - -### BREAKING CHANGES - -- **configuration:** Falls back to node-config instead of adding additional - functionality like path replacements and automatic environment variable insertion. - -## [4.5.9](https://github.com/feathersjs/feathers/compare/v4.5.8...v4.5.9) (2020-10-09) - -### Bug Fixes - -- **configuration:** Fix handling of config values that start with . or .. but are not actually relative paths; e.g. ".foo" or "..bar" ([#2065](https://github.com/feathersjs/feathers/issues/2065)) ([d07bf59](https://github.com/feathersjs/feathers/commit/d07bf5902e9c8c606f16b9523472972d3d2e9b49)) - -## [4.5.8](https://github.com/feathersjs/feathers/compare/v4.5.7...v4.5.8) (2020-08-12) - -**Note:** Version bump only for package @feathersjs/configuration - -## [4.5.7](https://github.com/feathersjs/feathers/compare/v4.5.6...v4.5.7) (2020-07-24) - -**Note:** Version bump only for package @feathersjs/configuration - -## [4.5.5](https://github.com/feathersjs/feathers/compare/v4.5.4...v4.5.5) (2020-07-11) - -**Note:** Version bump only for package @feathersjs/configuration - -## [4.5.3](https://github.com/feathersjs/feathers/compare/v4.5.2...v4.5.3) (2020-04-17) - -**Note:** Version bump only for package @feathersjs/configuration - -## [4.5.2](https://github.com/feathersjs/feathers/compare/v4.5.1...v4.5.2) (2020-03-04) - -**Note:** Version bump only for package @feathersjs/configuration - -## [4.5.1](https://github.com/feathersjs/feathers/compare/v4.5.0...v4.5.1) (2020-01-24) - -**Note:** Version bump only for package @feathersjs/configuration - -# [4.5.0](https://github.com/feathersjs/feathers/compare/v4.4.3...v4.5.0) (2020-01-18) - -**Note:** Version bump only for package @feathersjs/configuration - -## [4.4.3](https://github.com/feathersjs/feathers/compare/v4.4.1...v4.4.3) (2019-12-06) - -**Note:** Version bump only for package @feathersjs/configuration - -## [4.4.1](https://github.com/feathersjs/feathers/compare/v4.4.0...v4.4.1) (2019-11-27) - -**Note:** Version bump only for package @feathersjs/configuration - -# [4.4.0](https://github.com/feathersjs/feathers/compare/v4.3.11...v4.4.0) (2019-11-27) - -**Note:** Version bump only for package @feathersjs/configuration - -## [4.3.11](https://github.com/feathersjs/feathers/compare/v4.3.10...v4.3.11) (2019-11-11) - -**Note:** Version bump only for package @feathersjs/configuration - -## [4.3.10](https://github.com/feathersjs/feathers/compare/v4.3.9...v4.3.10) (2019-10-26) - -**Note:** Version bump only for package @feathersjs/configuration - -## [4.3.9](https://github.com/feathersjs/feathers/compare/v4.3.8...v4.3.9) (2019-10-26) - -**Note:** Version bump only for package @feathersjs/configuration - -## [4.3.7](https://github.com/feathersjs/feathers/compare/v4.3.6...v4.3.7) (2019-10-14) - -**Note:** Version bump only for package @feathersjs/configuration - -## [4.3.4](https://github.com/feathersjs/feathers/compare/v4.3.3...v4.3.4) (2019-10-03) - -**Note:** Version bump only for package @feathersjs/configuration - -## [4.3.3](https://github.com/feathersjs/feathers/compare/v4.3.2...v4.3.3) (2019-09-21) - -### Bug Fixes - -- Small improvements in dependencies and code sturcture ([#1562](https://github.com/feathersjs/feathers/issues/1562)) ([42c13e2](https://github.com/feathersjs/feathers/commit/42c13e2)) - -## [4.3.2](https://github.com/feathersjs/feathers/compare/v4.3.1...v4.3.2) (2019-09-16) - -**Note:** Version bump only for package @feathersjs/configuration - -## [4.3.1](https://github.com/feathersjs/feathers/compare/v4.3.0...v4.3.1) (2019-09-09) - -**Note:** Version bump only for package @feathersjs/configuration - -# [4.3.0](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.4...v4.3.0) (2019-08-27) - -**Note:** Version bump only for package @feathersjs/configuration - -# [4.3.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.3...v4.3.0-pre.4) (2019-08-22) - -**Note:** Version bump only for package @feathersjs/configuration - -# [4.3.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.2...v4.3.0-pre.3) (2019-08-19) - -### Bug Fixes - -- Update all dependencies ([7d53a00](https://github.com/feathersjs/feathers/commit/7d53a00)) - -# [4.3.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.1...v4.3.0-pre.2) (2019-08-02) - -**Note:** Version bump only for package @feathersjs/configuration - -# [4.3.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.5...v4.3.0-pre.1) (2019-07-11) - -**Note:** Version bump only for package @feathersjs/configuration - -# [4.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.4...v4.0.0-pre.5) (2019-07-10) - -**Note:** Version bump only for package @feathersjs/configuration - -# [4.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.3...v4.0.0-pre.4) (2019-07-05) - -**Note:** Version bump only for package @feathersjs/configuration - -# [4.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.2...v4.0.0-pre.3) (2019-06-01) - -### Bug Fixes - -- Update dependencies and fix tests ([#1373](https://github.com/feathersjs/feathers/issues/1373)) ([d743a7f](https://github.com/feathersjs/feathers/commit/d743a7f)) - -# [4.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.1...v4.0.0-pre.2) (2019-05-15) - -**Note:** Version bump only for package @feathersjs/configuration - -# [4.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.0...v4.0.0-pre.1) (2019-05-08) - -**Note:** Version bump only for package @feathersjs/configuration - -# [4.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v3.2.0-pre.1...v4.0.0-pre.0) (2019-04-21) - -### Bug Fixes - -- Update all dependencies to latest ([#1206](https://github.com/feathersjs/feathers/issues/1206)) ([e51e0f6](https://github.com/feathersjs/feathers/commit/e51e0f6)) -- **package:** update config to version 3.0.0 ([#1100](https://github.com/feathersjs/feathers/issues/1100)) ([c9f4b42](https://github.com/feathersjs/feathers/commit/c9f4b42)) -- Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803)) -- **package:** update debug to version 3.0.0 ([#45](https://github.com/feathersjs/feathers/issues/45)) ([2391434](https://github.com/feathersjs/feathers/commit/2391434)) -- **package:** update debug to version 3.0.1 ([#46](https://github.com/feathersjs/feathers/issues/46)) ([f8ada69](https://github.com/feathersjs/feathers/commit/f8ada69)) - -### Features - -- Add TypeScript definitions ([#1275](https://github.com/feathersjs/feathers/issues/1275)) ([9dd6713](https://github.com/feathersjs/feathers/commit/9dd6713)) - -## [2.0.6](https://github.com/feathersjs/feathers/compare/@feathersjs/configuration@2.0.5...@feathersjs/configuration@2.0.6) (2019-01-02) - -**Note:** Version bump only for package @feathersjs/configuration - - - -## [2.0.5](https://github.com/feathersjs/feathers/compare/@feathersjs/configuration@2.0.4...@feathersjs/configuration@2.0.5) (2018-12-16) - -### Bug Fixes - -- Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803)) -- **package:** update config to version 3.0.0 ([#1100](https://github.com/feathersjs/feathers/issues/1100)) ([c9f4b42](https://github.com/feathersjs/feathers/commit/c9f4b42)) - - - -## [2.0.4](https://github.com/feathersjs/feathers/compare/@feathersjs/configuration@2.0.3...@feathersjs/configuration@2.0.4) (2018-09-21) - -**Note:** Version bump only for package @feathersjs/configuration - - - -## [2.0.3](https://github.com/feathersjs/feathers/compare/@feathersjs/configuration@2.0.2...@feathersjs/configuration@2.0.3) (2018-09-17) - -**Note:** Version bump only for package @feathersjs/configuration - - - -## [2.0.2](https://github.com/feathersjs/feathers/compare/@feathersjs/configuration@2.0.1...@feathersjs/configuration@2.0.2) (2018-09-02) - -**Note:** Version bump only for package @feathersjs/configuration - - - -## 2.0.1 - -- Migrate to Monorepo ([feathers#462](https://github.com/feathersjs/feathers/issues/462)) - -## [v2.0.0](https://github.com/feathersjs/configuration/tree/v2.0.0) (2018-07-30) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v1.0.2...v2.0.0) - -**Closed issues:** - -- Config adding a value of userName in runtime its overwritten to the OS name [\#58](https://github.com/feathersjs/configuration/issues/58) -- Configuration Management [\#26](https://github.com/feathersjs/configuration/issues/26) - -**Merged pull requests:** - -- Update config to the latest version 🚀 [\#59](https://github.com/feathersjs/configuration/pull/59) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- misspelling [\#57](https://github.com/feathersjs/configuration/pull/57) ([chaintng](https://github.com/chaintng)) -- Update mocha to the latest version 🚀 [\#56](https://github.com/feathersjs/configuration/pull/56) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.0.2](https://github.com/feathersjs/configuration/tree/v1.0.2) (2018-01-02) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v1.0.1...v1.0.2) - -**Merged pull requests:** - -- Remove example and update Readme to point directly to the Feathers docs [\#55](https://github.com/feathersjs/configuration/pull/55) ([daffl](https://github.com/daffl)) - -## [v1.0.1](https://github.com/feathersjs/configuration/tree/v1.0.1) (2017-11-16) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v1.0.0...v1.0.1) - -**Merged pull requests:** - -- Add default export for better ES module \(TypeScript\) compatibility [\#53](https://github.com/feathersjs/configuration/pull/53) ([daffl](https://github.com/daffl)) -- Update nsp to the latest version 🚀 [\#52](https://github.com/feathersjs/configuration/pull/52) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.0.0](https://github.com/feathersjs/configuration/tree/v1.0.0) (2017-11-01) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v1.0.0-pre.1...v1.0.0) - -## [v1.0.0-pre.1](https://github.com/feathersjs/configuration/tree/v1.0.0-pre.1) (2017-10-23) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v0.4.2...v1.0.0-pre.1) - -**Closed issues:** - -- Move config options to app.config instead of the Express app object. [\#31](https://github.com/feathersjs/configuration/issues/31) - -**Merged pull requests:** - -- Update to new plugin infrastructure and npm scopes [\#51](https://github.com/feathersjs/configuration/pull/51) ([daffl](https://github.com/daffl)) - -## [v0.4.2](https://github.com/feathersjs/configuration/tree/v0.4.2) (2017-10-15) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v0.4.1...v0.4.2) - -**Closed issues:** - -- Missing TypeScript declaration file [\#48](https://github.com/feathersjs/configuration/issues/48) -- Feathers writing in typescript fails to boot on configuration [\#47](https://github.com/feathersjs/configuration/issues/47) -- Prevent automatic expansion of environment variables [\#42](https://github.com/feathersjs/configuration/issues/42) -- Getting Env name [\#41](https://github.com/feathersjs/configuration/issues/41) -- Nested configuration [\#38](https://github.com/feathersjs/configuration/issues/38) -- Stuck in configuration loophole... [\#37](https://github.com/feathersjs/configuration/issues/37) -- Docs are wrong [\#36](https://github.com/feathersjs/configuration/issues/36) -- Why use "NODE_ENV=development" with default.json? [\#33](https://github.com/feathersjs/configuration/issues/33) - -**Merged pull requests:** - -- Create TypeScript definitions [\#50](https://github.com/feathersjs/configuration/pull/50) ([jhanschoo](https://github.com/jhanschoo)) -- Update mocha to the latest version 🚀 [\#49](https://github.com/feathersjs/configuration/pull/49) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update debug to the latest version 🚀 [\#46](https://github.com/feathersjs/configuration/pull/46) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update debug to the latest version 🚀 [\#45](https://github.com/feathersjs/configuration/pull/45) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Grammatical change [\#44](https://github.com/feathersjs/configuration/pull/44) ([eugeniaguerrero](https://github.com/eugeniaguerrero)) -- More documentation on using and escaping environment variables [\#43](https://github.com/feathersjs/configuration/pull/43) ([daffl](https://github.com/daffl)) -- Update semistandard to the latest version 🚀 [\#40](https://github.com/feathersjs/configuration/pull/40) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update dependencies to enable Greenkeeper 🌴 [\#39](https://github.com/feathersjs/configuration/pull/39) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Fix first example [\#35](https://github.com/feathersjs/configuration/pull/35) ([elfey](https://github.com/elfey)) -- 👻😱 Node.js 0.10 is unmaintained 😱👻 [\#30](https://github.com/feathersjs/configuration/pull/30) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v0.4.1](https://github.com/feathersjs/configuration/tree/v0.4.1) (2016-10-24) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v0.4.0...v0.4.1) - -**Closed issues:** - -- Investigate node-config [\#8](https://github.com/feathersjs/configuration/issues/8) - -**Merged pull requests:** - -- update readme [\#29](https://github.com/feathersjs/configuration/pull/29) ([slajax](https://github.com/slajax)) -- jshint —\> semistandard [\#28](https://github.com/feathersjs/configuration/pull/28) ([corymsmith](https://github.com/corymsmith)) - -## [v0.4.0](https://github.com/feathersjs/configuration/tree/v0.4.0) (2016-10-22) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v0.3.3...v0.4.0) - -**Implemented enhancements:** - -- implement node-config [\#27](https://github.com/feathersjs/configuration/pull/27) ([slajax](https://github.com/slajax)) - -**Closed issues:** - -- Deprecate v1 in favour of node-config [\#25](https://github.com/feathersjs/configuration/issues/25) -- Make this repo more about managing configuration [\#24](https://github.com/feathersjs/configuration/issues/24) - -## [v0.3.3](https://github.com/feathersjs/configuration/tree/v0.3.3) (2016-09-12) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v0.3.2...v0.3.3) - -## [v0.3.2](https://github.com/feathersjs/configuration/tree/v0.3.2) (2016-09-12) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v0.3.1...v0.3.2) - -**Closed issues:** - -- A way to have local override [\#20](https://github.com/feathersjs/configuration/issues/20) - -**Merged pull requests:** - -- Remove check for development mode [\#21](https://github.com/feathersjs/configuration/pull/21) ([daffl](https://github.com/daffl)) - -## [v0.3.1](https://github.com/feathersjs/configuration/tree/v0.3.1) (2016-08-15) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v0.3.0...v0.3.1) - -**Merged pull requests:** - -- Support `null` values [\#19](https://github.com/feathersjs/configuration/pull/19) ([KenanY](https://github.com/KenanY)) -- Update mocha to version 3.0.0 🚀 [\#18](https://github.com/feathersjs/configuration/pull/18) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v0.3.0](https://github.com/feathersjs/configuration/tree/v0.3.0) (2016-05-22) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v0.2.3...v0.3.0) - -**Closed issues:** - -- \ .json config need deep merge options [\#16](https://github.com/feathersjs/configuration/issues/16) - -**Merged pull requests:** - -- Add functionality for deeply extending configuration [\#17](https://github.com/feathersjs/configuration/pull/17) ([daffl](https://github.com/daffl)) - -## [v0.2.3](https://github.com/feathersjs/configuration/tree/v0.2.3) (2016-04-24) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v0.2.2...v0.2.3) - -**Closed issues:** - -- PR: Support modules in config [\#12](https://github.com/feathersjs/configuration/issues/12) - -**Merged pull requests:** - -- Support modules as configuration files. [\#13](https://github.com/feathersjs/configuration/pull/13) ([wkw](https://github.com/wkw)) -- Update all dependencies 🌴 [\#10](https://github.com/feathersjs/configuration/pull/10) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v0.2.2](https://github.com/feathersjs/configuration/tree/v0.2.2) (2016-03-27) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v0.2.1...v0.2.2) - -**Merged pull requests:** - -- Expanding environment variables in \ .json [\#9](https://github.com/feathersjs/configuration/pull/9) ([derek-watson](https://github.com/derek-watson)) - -## [v0.2.1](https://github.com/feathersjs/configuration/tree/v0.2.1) (2016-03-12) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v0.2.0...v0.2.1) - -**Merged pull requests:** - -- Makes sure that arrays get converted properly [\#7](https://github.com/feathersjs/configuration/pull/7) ([daffl](https://github.com/daffl)) - -## [v0.2.0](https://github.com/feathersjs/configuration/tree/v0.2.0) (2016-03-09) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v0.1.1...v0.2.0) - -**Closed issues:** - -- Needs an escape character [\#4](https://github.com/feathersjs/configuration/issues/4) - -**Merged pull requests:** - -- Implement an escape character [\#6](https://github.com/feathersjs/configuration/pull/6) ([daffl](https://github.com/daffl)) - -## [v0.1.1](https://github.com/feathersjs/configuration/tree/v0.1.1) (2016-03-09) - -[Full Changelog](https://github.com/feathersjs/configuration/compare/v0.1.0...v0.1.1) - -**Closed issues:** - -- Configuration should recursively go through the values [\#2](https://github.com/feathersjs/configuration/issues/2) - -**Merged pull requests:** - -- Replace slashes in paths with the separator [\#5](https://github.com/feathersjs/configuration/pull/5) ([daffl](https://github.com/daffl)) -- Allow to convert deeply nested environment variables [\#3](https://github.com/feathersjs/configuration/pull/3) ([daffl](https://github.com/daffl)) -- Adding nsp check [\#1](https://github.com/feathersjs/configuration/pull/1) ([marshallswain](https://github.com/marshallswain)) - -## [v0.1.0](https://github.com/feathersjs/configuration/tree/v0.1.0) (2015-11-14) - -\* _This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)_ diff --git a/packages/configuration/LICENSE b/packages/configuration/LICENSE deleted file mode 100644 index 7712f870f3..0000000000 --- a/packages/configuration/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2024 Feathers Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/packages/configuration/README.md b/packages/configuration/README.md deleted file mode 100644 index 6e81d7cdb5..0000000000 --- a/packages/configuration/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# @feathersjs/configuration - -[](https://github.com/feathersjs/feathers/actions?query=workflow%3ACI) -[](https://www.npmjs.com/package/@feathersjs/configuration) -[](https://discord.gg/qa8kez8QBx) - -> A small configuration module for your Feathers application. - -## Installation - -``` -npm install @feathersjs/configuration --save -``` - -## Documentation - -Refer to the [Feathers configuration API documentation](https://feathersjs.com/api/configuration.html) for more details. - -## License - -Copyright (c) 2024 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors) - -Licensed under the [MIT license](LICENSE). diff --git a/packages/configuration/package.json b/packages/configuration/package.json deleted file mode 100644 index e00b65ff31..0000000000 --- a/packages/configuration/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "@feathersjs/configuration", - "description": "A small configuration module for your Feathers application.", - "version": "5.0.34", - "homepage": "https://feathersjs.com", - "main": "lib/", - "types": "lib/", - "keywords": [ - "feathers", - "feathers-plugin" - ], - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/daffl" - }, - "repository": { - "type": "git", - "url": "git://github.com/feathersjs/feathers.git", - "directory": "packages/configuration" - }, - "author": { - "name": "Feathers contributors", - "email": "hello@feathersjs.com", - "url": "https://feathersjs.com" - }, - "contributors": [], - "bugs": { - "url": "https://github.com/feathersjs/feathers/issues" - }, - "engines": { - "node": ">= 12" - }, - "files": [ - "CHANGELOG.md", - "LICENSE", - "README.md", - "src/**", - "lib/**", - "*.d.ts", - "*.js" - ], - "scripts": { - "prepublish": "npm run compile", - "pack": "npm pack --pack-destination ../generators/test/build", - "compile": "shx rm -rf lib/ && tsc && npm run pack", - "test": "NODE_CONFIG_DIR=./test/config mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts" - }, - "semistandard": { - "env": [ - "mocha" - ] - }, - "directories": { - "lib": "lib" - }, - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@feathersjs/commons": "^5.0.34", - "@feathersjs/feathers": "^5.0.34", - "@feathersjs/schema": "^5.0.34", - "@types/config": "^3.3.5", - "config": "^4.1.0" - }, - "devDependencies": { - "@types/mocha": "^10.0.10", - "@types/node": "^24.1.0", - "mocha": "^11.7.1", - "shx": "^0.4.0", - "ts-node": "^10.9.2", - "typescript": "^5.9.2" - }, - "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5" -} diff --git a/packages/configuration/src/index.ts b/packages/configuration/src/index.ts deleted file mode 100644 index a34606d679..0000000000 --- a/packages/configuration/src/index.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { Application, ApplicationHookContext, NextFunction } from '@feathersjs/feathers' -import { createDebug } from '@feathersjs/commons' -import { Schema, Validator } from '@feathersjs/schema' -import config from 'config' - -const debug = createDebug('@feathersjs/configuration') - -export = function init(schema?: Schema | Validator) { - const validator: Validator = typeof schema === 'function' ? schema : schema?.validate.bind(schema) - - return (app?: Application) => { - if (!app) { - return config - } - - const configuration: { [key: string]: unknown } = { ...config } - - debug(`Initializing configuration for ${config.util.getEnv('NODE_ENV')} environment`) - - Object.keys(configuration).forEach((name) => { - const value = configuration[name] - debug(`Setting ${name} configuration value to`, value) - app.set(name, value) - }) - - if (validator) { - app.hooks({ - setup: [ - async (_context: ApplicationHookContext, next: NextFunction) => { - await validator(configuration) - await next() - } - ] - }) - } - - return config - } -} diff --git a/packages/configuration/test/config/default.json b/packages/configuration/test/config/default.json deleted file mode 100644 index 8e3ede2021..0000000000 --- a/packages/configuration/test/config/default.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "port": 3030, - "array": ["one", "two", "three"], - "deep": { "base": false }, - "nullish": null -} diff --git a/packages/configuration/test/index.test.ts b/packages/configuration/test/index.test.ts deleted file mode 100644 index 65fc1c8d14..0000000000 --- a/packages/configuration/test/index.test.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { strict as assert } from 'assert' -import { feathers, Application } from '@feathersjs/feathers' -import { Ajv, schema } from '@feathersjs/schema' -import configuration from '../src' - -describe('@feathersjs/configuration', () => { - const app: Application = feathers().configure(configuration()) - - it('initialized app with default.json', () => { - assert.equal(app.get('port'), 3030) - assert.deepEqual(app.get('array'), ['one', 'two', 'three']) - assert.deepEqual(app.get('deep'), { base: false }) - assert.deepEqual(app.get('nullish'), null) - }) - - it('works when called directly', () => { - const fn = configuration() - const conf = fn() as any - - assert.strictEqual(conf.port, 3030) - }) - - it('errors on .setup when a schema is passed and the configuration is invalid', async () => { - const configurationSchema = schema( - { - $id: 'ConfigurationSchema', - additionalProperties: false, - type: 'object', - properties: { - port: { type: 'number' }, - deep: { - type: 'object', - properties: { - base: { - type: 'boolean' - } - } - }, - array: { - type: 'array', - items: { type: 'string' } - }, - nullish: { - type: 'string' - } - } - } as const, - new Ajv() - ) - - const schemaApp = feathers().configure(configuration(configurationSchema)) - - await assert.rejects(() => schemaApp.setup(), { - data: [ - { - instancePath: '/nullish', - keyword: 'type', - message: 'must be string', - params: { - type: 'string' - }, - schemaPath: '#/properties/nullish/type' - } - ] - }) - }) -}) diff --git a/packages/configuration/tsconfig.json b/packages/configuration/tsconfig.json deleted file mode 100644 index 316fd41336..0000000000 --- a/packages/configuration/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig", - "include": [ - "src/**/*.ts" - ], - "compilerOptions": { - "outDir": "lib" - } -} diff --git a/packages/create-feathers/CHANGELOG.md b/packages/create-feathers/CHANGELOG.md index 5fc4f4d87b..a5f8a365e3 100644 --- a/packages/create-feathers/CHANGELOG.md +++ b/packages/create-feathers/CHANGELOG.md @@ -3,6 +3,24 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [6.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.2...v6.0.0-pre.3) (2025-10-10) + +**Note:** Version bump only for package create-feathers + +# [6.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.1...v6.0.0-pre.2) (2025-09-04) + +**Note:** Version bump only for package create-feathers + +# [6.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.0...v6.0.0-pre.1) (2025-09-03) + +**Note:** Version bump only for package create-feathers + +# [6.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v5.0.34...v6.0.0-pre.0) (2025-08-30) + +### Features + +- V6 packages refactor ([#3596](https://github.com/feathersjs/feathers/issues/3596)) ([364aab5](https://github.com/feathersjs/feathers/commit/364aab563542fc9d6dd96c1f5f48b146727d7d1e)) + ## [5.0.34](https://github.com/feathersjs/feathers/compare/v5.0.33...v5.0.34) (2025-05-03) **Note:** Version bump only for package create-feathers diff --git a/packages/create-feathers/package.json b/packages/create-feathers/package.json index 5b5600806d..8dd4dfee44 100644 --- a/packages/create-feathers/package.json +++ b/packages/create-feathers/package.json @@ -1,7 +1,7 @@ { "name": "create-feathers", "description": "Create a new Feathers application", - "version": "5.0.34", + "version": "6.0.0-pre.3", "homepage": "https://feathersjs.com", "bin": { "create-feathers": "./bin/create-feathers.js" @@ -50,5 +50,8 @@ "dependencies": { "@feathersjs/cli": "^5.0.34" }, - "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5" + "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5", + "devDependencies": { + "vitest": "^3.2.4" + } } diff --git a/packages/errors/CHANGELOG.md b/packages/errors/CHANGELOG.md deleted file mode 100644 index fcac0bf016..0000000000 --- a/packages/errors/CHANGELOG.md +++ /dev/null @@ -1,1021 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [5.0.34](https://github.com/feathersjs/feathers/compare/v5.0.33...v5.0.34) (2025-05-03) - -### Bug Fixes - -- Update dependencies ([#3584](https://github.com/feathersjs/feathers/issues/3584)) ([119fa4e](https://github.com/feathersjs/feathers/commit/119fa4e1ade8b0078aa235083d566e2538b3a084)) - -## [5.0.33](https://github.com/feathersjs/feathers/compare/v5.0.32...v5.0.33) (2025-02-24) - -### Bug Fixes - -- **dependencies:** Update dependencies ([#3571](https://github.com/feathersjs/feathers/issues/3571)) ([ad611cb](https://github.com/feathersjs/feathers/commit/ad611cb6ffb1dc31d603ba5817331318c5a23217)) - -## [5.0.32](https://github.com/feathersjs/feathers/compare/v5.0.31...v5.0.32) (2025-02-01) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.31](https://github.com/feathersjs/feathers/compare/v5.0.30...v5.0.31) (2024-10-31) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3545](https://github.com/feathersjs/feathers/issues/3545)) ([221b92b](https://github.com/feathersjs/feathers/commit/221b92bb0ee5d54fb1036742968797cb02e56da2)) - -## [5.0.30](https://github.com/feathersjs/feathers/compare/v5.0.29...v5.0.30) (2024-09-02) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.29](https://github.com/feathersjs/feathers/compare/v5.0.28...v5.0.29) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.28](https://github.com/feathersjs/feathers/compare/v5.0.27...v5.0.28) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.27](https://github.com/feathersjs/feathers/compare/v5.0.26...v5.0.27) (2024-06-18) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.26](https://github.com/feathersjs/feathers/compare/v5.0.25...v5.0.26) (2024-06-09) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.25](https://github.com/feathersjs/feathers/compare/v5.0.24...v5.0.25) (2024-05-03) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.24](https://github.com/feathersjs/feathers/compare/v5.0.23...v5.0.24) (2024-03-13) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.23](https://github.com/feathersjs/feathers/compare/v5.0.22...v5.0.23) (2024-02-25) - -### Bug Fixes - -- **core:** Update to latest feathersjs/hooks ([#3434](https://github.com/feathersjs/feathers/issues/3434)) ([1499ccc](https://github.com/feathersjs/feathers/commit/1499ccc41fb3ebba97b2c84e0cb19bc48ad3c651)) - -## [5.0.22](https://github.com/feathersjs/feathers/compare/v5.0.21...v5.0.22) (2024-02-15) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.21](https://github.com/feathersjs/feathers/compare/v5.0.20...v5.0.21) (2024-01-25) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.20](https://github.com/feathersjs/feathers/compare/v5.0.19...v5.0.20) (2024-01-24) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.19](https://github.com/feathersjs/feathers/compare/v5.0.18...v5.0.19) (2024-01-23) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.18](https://github.com/feathersjs/feathers/compare/v5.0.17...v5.0.18) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.17](https://github.com/feathersjs/feathers/compare/v5.0.16...v5.0.17) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.16](https://github.com/feathersjs/feathers/compare/v5.0.15...v5.0.16) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.15](https://github.com/feathersjs/feathers/compare/v5.0.14...v5.0.15) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.14](https://github.com/feathersjs/feathers/compare/v5.0.13...v5.0.14) (2024-01-05) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.13](https://github.com/feathersjs/feathers/compare/v5.0.12...v5.0.13) (2023-12-29) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.12](https://github.com/feathersjs/feathers/compare/v5.0.11...v5.0.12) (2023-11-28) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.11](https://github.com/feathersjs/feathers/compare/v5.0.10...v5.0.11) (2023-10-11) - -### Bug Fixes - -- **knex:** Update all dependencies and Knex peer ([#3308](https://github.com/feathersjs/feathers/issues/3308)) ([d2f9860](https://github.com/feathersjs/feathers/commit/d2f986036c4741cce2339d8abbcc6b2eb037a12a)) - -## [5.0.10](https://github.com/feathersjs/feathers/compare/v5.0.9...v5.0.10) (2023-10-03) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.9](https://github.com/feathersjs/feathers/compare/v5.0.8...v5.0.9) (2023-09-27) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.8](https://github.com/feathersjs/feathers/compare/v5.0.7...v5.0.8) (2023-07-19) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.7](https://github.com/feathersjs/feathers/compare/v5.0.6...v5.0.7) (2023-07-14) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.6](https://github.com/feathersjs/feathers/compare/v5.0.5...v5.0.6) (2023-06-15) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.5](https://github.com/feathersjs/feathers/compare/v5.0.4...v5.0.5) (2023-04-28) - -**Note:** Version bump only for package @feathersjs/errors - -## [5.0.4](https://github.com/feathersjs/feathers/compare/v5.0.3...v5.0.4) (2023-04-12) - -### Bug Fixes - -- Make sure all Readme files are up to date ([#3154](https://github.com/feathersjs/feathers/issues/3154)) ([a5f0b38](https://github.com/feathersjs/feathers/commit/a5f0b38bbf2a11486415a39533bcc6c67fb51e3e)) - -## [5.0.3](https://github.com/feathersjs/feathers/compare/v5.0.2...v5.0.3) (2023-04-05) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3139](https://github.com/feathersjs/feathers/issues/3139)) ([f24276e](https://github.com/feathersjs/feathers/commit/f24276e9a909e2e58a0730c730258ce1f70f4028)) - -## [5.0.1](https://github.com/feathersjs/feathers/compare/v5.0.0...v5.0.1) (2023-03-15) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.38...v5.0.0) (2023-02-24) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.38](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.37...v5.0.0-pre.38) (2023-02-17) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.37](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.36...v5.0.0-pre.37) (2023-02-09) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.36](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.35...v5.0.0-pre.36) (2023-01-29) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.35](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.34...v5.0.0-pre.35) (2023-01-12) - -### Features - -- **generators:** Move core code generators to shared generators package ([#2982](https://github.com/feathersjs/feathers/issues/2982)) ([0328d22](https://github.com/feathersjs/feathers/commit/0328d2292153870bc43958f73d2c6f288a8cec17)) - -# [5.0.0-pre.34](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.33...v5.0.0-pre.34) (2022-12-14) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.33](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.32...v5.0.0-pre.33) (2022-11-08) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.32](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.31...v5.0.0-pre.32) (2022-10-26) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.31](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.30...v5.0.0-pre.31) (2022-10-12) - -### Bug Fixes - -- **errors:** Allows to pass no error message ([#2794](https://github.com/feathersjs/feathers/issues/2794)) ([f3ddab6](https://github.com/feathersjs/feathers/commit/f3ddab637e269e67e852ffce07b060bab2b085c0)) - -# [5.0.0-pre.30](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.29...v5.0.0-pre.30) (2022-10-07) - -### Features - -- **core:** Allow to unregister services at runtime ([#2756](https://github.com/feathersjs/feathers/issues/2756)) ([d16601f](https://github.com/feathersjs/feathers/commit/d16601f2277dca5357866ffdefba2a611f6dc7fa)) - -# [5.0.0-pre.29](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.28...v5.0.0-pre.29) (2022-09-16) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.28](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.27...v5.0.0-pre.28) (2022-08-03) - -### Bug Fixes - -- **cli:** Improve generated application and client ([#2701](https://github.com/feathersjs/feathers/issues/2701)) ([bd55ffb](https://github.com/feathersjs/feathers/commit/bd55ffb812e89bf215f4515e7f137656ea888c3f)) - -# [5.0.0-pre.27](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.26...v5.0.0-pre.27) (2022-07-13) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.26](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.25...v5.0.0-pre.26) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.25](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.24...v5.0.0-pre.25) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.24](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.23...v5.0.0-pre.24) (2022-06-21) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.23](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.22...v5.0.0-pre.23) (2022-06-06) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.22](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.21...v5.0.0-pre.22) (2022-05-24) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.21](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.20...v5.0.0-pre.21) (2022-05-23) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.20](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.19...v5.0.0-pre.20) (2022-05-04) - -### Bug Fixes - -- **dependencies:** Lock monorepo package version numbers ([#2623](https://github.com/feathersjs/feathers/issues/2623)) ([5640c10](https://github.com/feathersjs/feathers/commit/5640c1020cc139994e695d658c08bad3494db507)) - -# [5.0.0-pre.19](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.18...v5.0.0-pre.19) (2022-05-01) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.18](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.17...v5.0.0-pre.18) (2022-04-11) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.17](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.16...v5.0.0-pre.17) (2022-02-15) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.16](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.15...v5.0.0-pre.16) (2022-01-12) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.15](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.14...v5.0.0-pre.15) (2021-11-27) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.14](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.13...v5.0.0-pre.14) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.13](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.12...v5.0.0-pre.13) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.12](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.11...v5.0.0-pre.12) (2021-10-12) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.11](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.10...v5.0.0-pre.11) (2021-10-06) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.10](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.9...v5.0.0-pre.10) (2021-09-19) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.9](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.8...v5.0.0-pre.9) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.8](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.7...v5.0.0-pre.8) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.7](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.6...v5.0.0-pre.7) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.6](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.5...v5.0.0-pre.6) (2021-08-08) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.4...v5.0.0-pre.5) (2021-06-23) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.3...v5.0.0-pre.4) (2021-05-13) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.2...v5.0.0-pre.3) (2021-04-21) - -### Bug Fixes - -- **typescript:** Improve TypeScript backwards compatibility ([#2310](https://github.com/feathersjs/feathers/issues/2310)) ([f33be73](https://github.com/feathersjs/feathers/commit/f33be73fc46a533efb15df9aab0658e3240d3897)) - -# [5.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.1...v5.0.0-pre.2) (2021-04-06) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-beta.1](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2021-04-03) - -**Note:** Version bump only for package @feathersjs/errors - -# [5.0.0-beta.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.1...v5.0.0-beta.0) (2021-03-28) - -### Bug Fixes - -- Update Grant usage and other dependencies ([#2264](https://github.com/feathersjs/feathers/issues/2264)) ([7b0f8fa](https://github.com/feathersjs/feathers/commit/7b0f8fad252419ed0ad0bf259cdf3104d322ab60)) - -# [5.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.5.11...v5.0.0-pre.1) (2020-12-17) - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -### Bug Fixes - -- **errors:** Format package.json with spaces ([cbd31c1](https://github.com/feathersjs/feathers/commit/cbd31c10c2c574de63d6ca5e55dbfb73a5fdd758)) - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -### Bug Fixes - -- **errors:** Format package.json with spaces ([cbd31c1](https://github.com/feathersjs/feathers/commit/cbd31c10c2c574de63d6ca5e55dbfb73a5fdd758)) -- **typescript:** Fix `data` property definition in @feathersjs/errors ([#2018](https://github.com/feathersjs/feathers/issues/2018)) ([ef1398c](https://github.com/feathersjs/feathers/commit/ef1398cd5b19efa50929e8c9511ca5684a18997f)) - -## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05) - -**Note:** Version bump only for package @feathersjs/errors - -## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08) - -**Note:** Version bump only for package @feathersjs/errors - -## [4.5.9](https://github.com/feathersjs/feathers/compare/v4.5.8...v4.5.9) (2020-10-09) - -**Note:** Version bump only for package @feathersjs/errors - -## [4.5.8](https://github.com/feathersjs/feathers/compare/v4.5.7...v4.5.8) (2020-08-12) - -**Note:** Version bump only for package @feathersjs/errors - -## [4.5.7](https://github.com/feathersjs/feathers/compare/v4.5.6...v4.5.7) (2020-07-24) - -**Note:** Version bump only for package @feathersjs/errors - -## [4.5.5](https://github.com/feathersjs/feathers/compare/v4.5.4...v4.5.5) (2020-07-11) - -**Note:** Version bump only for package @feathersjs/errors - -## [4.5.3](https://github.com/feathersjs/feathers/compare/v4.5.2...v4.5.3) (2020-04-17) - -### Bug Fixes - -- **errors:** Add 410 Gone to errors ([#1849](https://github.com/feathersjs/feathers/issues/1849)) ([6801428](https://github.com/feathersjs/feathers/commit/6801428f8fd17dbfebcdb6f1b0cd01433a4033dc)) - -## [4.5.2](https://github.com/feathersjs/feathers/compare/v4.5.1...v4.5.2) (2020-03-04) - -**Note:** Version bump only for package @feathersjs/errors - -## [4.5.1](https://github.com/feathersjs/feathers/compare/v4.5.0...v4.5.1) (2020-01-24) - -**Note:** Version bump only for package @feathersjs/errors - -# [4.5.0](https://github.com/feathersjs/feathers/compare/v4.4.3...v4.5.0) (2020-01-18) - -**Note:** Version bump only for package @feathersjs/errors - -## [4.4.3](https://github.com/feathersjs/feathers/compare/v4.4.1...v4.4.3) (2019-12-06) - -**Note:** Version bump only for package @feathersjs/errors - -## [4.4.1](https://github.com/feathersjs/feathers/compare/v4.4.0...v4.4.1) (2019-11-27) - -**Note:** Version bump only for package @feathersjs/errors - -# [4.4.0](https://github.com/feathersjs/feathers/compare/v4.3.11...v4.4.0) (2019-11-27) - -**Note:** Version bump only for package @feathersjs/errors - -## [4.3.11](https://github.com/feathersjs/feathers/compare/v4.3.10...v4.3.11) (2019-11-11) - -**Note:** Version bump only for package @feathersjs/errors - -## [4.3.10](https://github.com/feathersjs/feathers/compare/v4.3.9...v4.3.10) (2019-10-26) - -**Note:** Version bump only for package @feathersjs/errors - -## [4.3.9](https://github.com/feathersjs/feathers/compare/v4.3.8...v4.3.9) (2019-10-26) - -### Bug Fixes - -- Small type improvements ([#1624](https://github.com/feathersjs/feathers/issues/1624)) ([50162c6](https://github.com/feathersjs/feathers/commit/50162c6e562f0a47c6a280c4f01fff7c3afee293)) - -## [4.3.7](https://github.com/feathersjs/feathers/compare/v4.3.6...v4.3.7) (2019-10-14) - -**Note:** Version bump only for package @feathersjs/errors - -## [4.3.4](https://github.com/feathersjs/feathers/compare/v4.3.3...v4.3.4) (2019-10-03) - -**Note:** Version bump only for package @feathersjs/errors - -## [4.3.3](https://github.com/feathersjs/feathers/compare/v4.3.2...v4.3.3) (2019-09-21) - -**Note:** Version bump only for package @feathersjs/errors - -## [4.3.2](https://github.com/feathersjs/feathers/compare/v4.3.1...v4.3.2) (2019-09-16) - -**Note:** Version bump only for package @feathersjs/errors - -## [4.3.1](https://github.com/feathersjs/feathers/compare/v4.3.0...v4.3.1) (2019-09-09) - -**Note:** Version bump only for package @feathersjs/errors - -# [4.3.0](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.4...v4.3.0) (2019-08-27) - -**Note:** Version bump only for package @feathersjs/errors - -# [4.3.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.3...v4.3.0-pre.4) (2019-08-22) - -**Note:** Version bump only for package @feathersjs/errors - -# [4.3.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.2...v4.3.0-pre.3) (2019-08-19) - -**Note:** Version bump only for package @feathersjs/errors - -# [4.3.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.1...v4.3.0-pre.2) (2019-08-02) - -**Note:** Version bump only for package @feathersjs/errors - -# [4.3.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.5...v4.3.0-pre.1) (2019-07-11) - -**Note:** Version bump only for package @feathersjs/errors - -# [4.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.4...v4.0.0-pre.5) (2019-07-10) - -**Note:** Version bump only for package @feathersjs/errors - -# [4.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.3...v4.0.0-pre.4) (2019-07-05) - -**Note:** Version bump only for package @feathersjs/errors - -# [4.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.2...v4.0.0-pre.3) (2019-06-01) - -### Bug Fixes - -- Update dependencies and fix tests ([#1373](https://github.com/feathersjs/feathers/issues/1373)) ([d743a7f](https://github.com/feathersjs/feathers/commit/d743a7f)) - -# [4.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.1...v4.0.0-pre.2) (2019-05-15) - -### Bug Fixes - -- Use `export =` in TypeScript definitions ([#1285](https://github.com/feathersjs/feathers/issues/1285)) ([12d0f4b](https://github.com/feathersjs/feathers/commit/12d0f4b)) - -# [4.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.0...v4.0.0-pre.1) (2019-05-08) - -### Bug Fixes - -- Do not log as errors below a 500 response ([#1256](https://github.com/feathersjs/feathers/issues/1256)) ([33fd0e4](https://github.com/feathersjs/feathers/commit/33fd0e4)) - -# [4.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v3.2.0-pre.1...v4.0.0-pre.0) (2019-04-21) - -### Bug Fixes - -- Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803)) -- Update 401.html ([#983](https://github.com/feathersjs/feathers/issues/983)) ([cec6bae](https://github.com/feathersjs/feathers/commit/cec6bae)) -- Update 404.html ([#984](https://github.com/feathersjs/feathers/issues/984)) ([72132d1](https://github.com/feathersjs/feathers/commit/72132d1)) -- Update adapter common tests ([#1135](https://github.com/feathersjs/feathers/issues/1135)) ([8166dda](https://github.com/feathersjs/feathers/commit/8166dda)) -- Update all dependencies to latest ([#1206](https://github.com/feathersjs/feathers/issues/1206)) ([e51e0f6](https://github.com/feathersjs/feathers/commit/e51e0f6)) -- **compile-task:** on windows machine ([#60](https://github.com/feathersjs/feathers/issues/60)) ([617e0a4](https://github.com/feathersjs/feathers/commit/617e0a4)) -- **package:** update debug to version 3.0.0 ([#86](https://github.com/feathersjs/feathers/issues/86)) ([fd1bb6b](https://github.com/feathersjs/feathers/commit/fd1bb6b)) - -### Features - -- Add TypeScript definitions ([#1275](https://github.com/feathersjs/feathers/issues/1275)) ([9dd6713](https://github.com/feathersjs/feathers/commit/9dd6713)) -- Authentication v3 core server implementation ([#1205](https://github.com/feathersjs/feathers/issues/1205)) ([1bd7591](https://github.com/feathersjs/feathers/commit/1bd7591)) - -## [3.3.6](https://github.com/feathersjs/feathers/compare/@feathersjs/errors@3.3.5...@feathersjs/errors@3.3.6) (2019-01-02) - -### Bug Fixes - -- Update adapter common tests ([#1135](https://github.com/feathersjs/feathers/issues/1135)) ([8166dda](https://github.com/feathersjs/feathers/commit/8166dda)) - - - -## [3.3.5](https://github.com/feathersjs/feathers/compare/@feathersjs/errors@3.3.4...@feathersjs/errors@3.3.5) (2018-12-16) - -### Bug Fixes - -- Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803)) - - - -## [3.3.4](https://github.com/feathersjs/feathers/compare/@feathersjs/errors@3.3.3...@feathersjs/errors@3.3.4) (2018-09-21) - -**Note:** Version bump only for package @feathersjs/errors - - - -## [3.3.3](https://github.com/feathersjs/feathers/compare/@feathersjs/errors@3.3.2...@feathersjs/errors@3.3.3) (2018-09-17) - -### Bug Fixes - -- Update 401.html ([#983](https://github.com/feathersjs/feathers/issues/983)) ([cec6bae](https://github.com/feathersjs/feathers/commit/cec6bae)) -- Update 404.html ([#984](https://github.com/feathersjs/feathers/issues/984)) ([72132d1](https://github.com/feathersjs/feathers/commit/72132d1)) - - - -## [3.3.2](https://github.com/feathersjs/feathers/compare/@feathersjs/errors@3.3.1...@feathersjs/errors@3.3.2) (2018-09-02) - -**Note:** Version bump only for package @feathersjs/errors - - - -## 3.3.1 - -- Migrate to Monorepo ([feathers#462](https://github.com/feathersjs/feathers/issues/462)) - -## [v3.3.0](https://github.com/feathersjs/errors/tree/v3.3.0) (2018-02-12) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v3.2.2...v3.3.0) - -**Closed issues:** - -- How to handling error from Hook function when I use Aync/Await in Hook function [\#106](https://github.com/feathersjs/errors/issues/106) - -**Merged pull requests:** - -- Add a verbose flag to notFound handler [\#107](https://github.com/feathersjs/errors/pull/107) ([daffl](https://github.com/daffl)) -- Add req.url to notFound handler message [\#105](https://github.com/feathersjs/errors/pull/105) ([FreeLineTM](https://github.com/FreeLineTM)) - -## [v3.2.2](https://github.com/feathersjs/errors/tree/v3.2.2) (2018-01-23) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v3.2.1...v3.2.2) - -**Closed issues:** - -- Handling Status Codes [\#103](https://github.com/feathersjs/errors/issues/103) -- Override default error page [\#102](https://github.com/feathersjs/errors/issues/102) -- wrong npm package in Installation instructions [\#100](https://github.com/feathersjs/errors/issues/100) - -**Merged pull requests:** - -- Fix instanceof and prototypical inheritance [\#104](https://github.com/feathersjs/errors/pull/104) ([nikaspran](https://github.com/nikaspran)) -- Update mocha to the latest version 🚀 [\#101](https://github.com/feathersjs/errors/pull/101) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- fix installation declaration [\#99](https://github.com/feathersjs/errors/pull/99) ([jasonmacgowan](https://github.com/jasonmacgowan)) - -## [v3.2.1](https://github.com/feathersjs/errors/tree/v3.2.1) (2018-01-03) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v3.2.0...v3.2.1) - -**Closed issues:** - -- Error handler usage/setup is mis-documented [\#96](https://github.com/feathersjs/errors/issues/96) - -**Merged pull requests:** - -- Update readme to correspond with latest release [\#98](https://github.com/feathersjs/errors/pull/98) ([daffl](https://github.com/daffl)) -- Update semistandard to the latest version 🚀 [\#97](https://github.com/feathersjs/errors/pull/97) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v3.2.0](https://github.com/feathersjs/errors/tree/v3.2.0) (2017-11-19) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v3.1.0...v3.2.0) - -**Merged pull requests:** - -- Allow ability to log middleware errors [\#95](https://github.com/feathersjs/errors/pull/95) ([daffl](https://github.com/daffl)) - -## [v3.1.0](https://github.com/feathersjs/errors/tree/v3.1.0) (2017-11-18) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v3.0.0...v3.1.0) - -**Closed issues:** - -- feature: allow for mixed files/functions for error-handler options [\#91](https://github.com/feathersjs/errors/issues/91) - -**Merged pull requests:** - -- 91 allow mixed config [\#94](https://github.com/feathersjs/errors/pull/94) ([DesignByOnyx](https://github.com/DesignByOnyx)) - -## [v3.0.0](https://github.com/feathersjs/errors/tree/v3.0.0) (2017-11-01) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v3.0.0-pre.1...v3.0.0) - -**Merged pull requests:** - -- Update to Buzzard infrastructure [\#93](https://github.com/feathersjs/errors/pull/93) ([daffl](https://github.com/daffl)) - -## [v3.0.0-pre.1](https://github.com/feathersjs/errors/tree/v3.0.0-pre.1) (2017-10-21) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.9.2...v3.0.0-pre.1) - -**Closed issues:** - -- \[Proposal\] use verror [\#88](https://github.com/feathersjs/errors/issues/88) - -**Merged pull requests:** - -- Update to new plugin infrastructure and npm scope [\#92](https://github.com/feathersjs/errors/pull/92) ([daffl](https://github.com/daffl)) -- Update mocha to the latest version 🚀 [\#90](https://github.com/feathersjs/errors/pull/90) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update sinon to the latest version 🚀 [\#89](https://github.com/feathersjs/errors/pull/89) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v2.9.2](https://github.com/feathersjs/errors/tree/v2.9.2) (2017-09-05) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.9.1...v2.9.2) - -**Closed issues:** - -- Getting 500 status code when attempting to throw non 500 style errors \(401\) [\#85](https://github.com/feathersjs/errors/issues/85) - -**Merged pull requests:** - -- fix typings [\#87](https://github.com/feathersjs/errors/pull/87) ([j2L4e](https://github.com/j2L4e)) -- Update debug to the latest version 🚀 [\#86](https://github.com/feathersjs/errors/pull/86) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update sinon to the latest version 🚀 [\#84](https://github.com/feathersjs/errors/pull/84) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v2.9.1](https://github.com/feathersjs/errors/tree/v2.9.1) (2017-07-21) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.9.0...v2.9.1) - -**Merged pull requests:** - -- Add back default error message [\#83](https://github.com/feathersjs/errors/pull/83) ([daffl](https://github.com/daffl)) - -## [v2.9.0](https://github.com/feathersjs/errors/tree/v2.9.0) (2017-07-20) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.8.2...v2.9.0) - -**Closed issues:** - -- Wrong stack for errors [\#78](https://github.com/feathersjs/errors/issues/78) - -**Merged pull requests:** - -- Capture proper stack trace and error messages [\#82](https://github.com/feathersjs/errors/pull/82) ([daffl](https://github.com/daffl)) -- Update chai to the latest version 🚀 [\#81](https://github.com/feathersjs/errors/pull/81) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v2.8.2](https://github.com/feathersjs/errors/tree/v2.8.2) (2017-07-05) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.8.1...v2.8.2) - -**Merged pull requests:** - -- Fix wildcard import on ES2015+ [\#80](https://github.com/feathersjs/errors/pull/80) ([coreh](https://github.com/coreh)) -- Add more information to error debug [\#79](https://github.com/feathersjs/errors/pull/79) ([kamzil](https://github.com/kamzil)) - -## [v2.8.1](https://github.com/feathersjs/errors/tree/v2.8.1) (2017-05-30) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.8.0...v2.8.1) - -**Merged pull requests:** - -- Fix errors property being lost when cloning [\#76](https://github.com/feathersjs/errors/pull/76) ([0x6431346e](https://github.com/0x6431346e)) - -## [v2.8.0](https://github.com/feathersjs/errors/tree/v2.8.0) (2017-05-08) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.7.1...v2.8.0) - -**Closed issues:** - -- Support array objects as data [\#64](https://github.com/feathersjs/errors/issues/64) - -**Merged pull requests:** - -- Allow data to be an array [\#75](https://github.com/feathersjs/errors/pull/75) ([0x6431346e](https://github.com/0x6431346e)) - -## [v2.7.1](https://github.com/feathersjs/errors/tree/v2.7.1) (2017-04-28) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.7.0...v2.7.1) - -**Closed issues:** - -- Object.setPrototypeOf in IE 10 [\#70](https://github.com/feathersjs/errors/issues/70) - -**Merged pull requests:** - -- Define property toJSON because just assigning it throws an error in N… [\#74](https://github.com/feathersjs/errors/pull/74) ([daffl](https://github.com/daffl)) - -## [v2.7.0](https://github.com/feathersjs/errors/tree/v2.7.0) (2017-04-25) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.6.3...v2.7.0) - -**Merged pull requests:** - -- Change back to old Error inheritance [\#73](https://github.com/feathersjs/errors/pull/73) ([daffl](https://github.com/daffl)) -- Update semistandard to the latest version 🚀 [\#72](https://github.com/feathersjs/errors/pull/72) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update dependencies to enable Greenkeeper 🌴 [\#71](https://github.com/feathersjs/errors/pull/71) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v2.6.3](https://github.com/feathersjs/errors/tree/v2.6.3) (2017-04-08) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.6.2...v2.6.3) - -**Closed issues:** - -- Make options the same as res.format [\#37](https://github.com/feathersjs/errors/issues/37) - -**Merged pull requests:** - -- fix typescript definitions with noImplicitAny [\#69](https://github.com/feathersjs/errors/pull/69) ([JVirant](https://github.com/JVirant)) - -## [v2.6.2](https://github.com/feathersjs/errors/tree/v2.6.2) (2017-03-16) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.6.1...v2.6.2) - -**Closed issues:** - -- Create a TokenExpired error type [\#53](https://github.com/feathersjs/errors/issues/53) - -**Merged pull requests:** - -- Fix declarations for index.d.ts [\#66](https://github.com/feathersjs/errors/pull/66) ([ghost](https://github.com/ghost)) - -## [v2.6.1](https://github.com/feathersjs/errors/tree/v2.6.1) (2017-03-06) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.6.0...v2.6.1) - -**Merged pull requests:** - -- fix pull request \#62 [\#63](https://github.com/feathersjs/errors/pull/63) ([superbarne](https://github.com/superbarne)) - -## [v2.6.0](https://github.com/feathersjs/errors/tree/v2.6.0) (2017-03-04) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.5.0...v2.6.0) - -**Closed issues:** - -- Full Validation Error Object not passed to client promise [\#61](https://github.com/feathersjs/errors/issues/61) -- More HTTP Statuses [\#48](https://github.com/feathersjs/errors/issues/48) - -**Merged pull requests:** - -- add typescript definitions [\#62](https://github.com/feathersjs/errors/pull/62) ([superbarne](https://github.com/superbarne)) -- Fix compile npm task on Windows [\#60](https://github.com/feathersjs/errors/pull/60) ([AbraaoAlves](https://github.com/AbraaoAlves)) - -## [v2.5.0](https://github.com/feathersjs/errors/tree/v2.5.0) (2016-11-04) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.4.0...v2.5.0) - -**Closed issues:** - -- Possible issue with Node 4 [\#51](https://github.com/feathersjs/errors/issues/51) -- Consider using restify/errors as base [\#31](https://github.com/feathersjs/errors/issues/31) - -**Merged pull requests:** - -- Adding more error types [\#55](https://github.com/feathersjs/errors/pull/55) ([franciscofsales](https://github.com/franciscofsales)) -- 👻😱 Node.js 0.10 is unmaintained 😱👻 [\#54](https://github.com/feathersjs/errors/pull/54) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- jshint —\> semistandard [\#52](https://github.com/feathersjs/errors/pull/52) ([corymsmith](https://github.com/corymsmith)) -- Update mocha to version 3.0.0 🚀 [\#47](https://github.com/feathersjs/errors/pull/47) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v2.4.0](https://github.com/feathersjs/errors/tree/v2.4.0) (2016-07-17) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.3.0...v2.4.0) - -**Merged pull requests:** - -- adding ability to get a feathers error by http status code [\#46](https://github.com/feathersjs/errors/pull/46) ([ekryski](https://github.com/ekryski)) - -## [v2.3.0](https://github.com/feathersjs/errors/tree/v2.3.0) (2016-07-10) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.2.0...v2.3.0) - -**Closed issues:** - -- Heroku error Reflect.construct [\#44](https://github.com/feathersjs/errors/issues/44) - -**Merged pull requests:** - -- Not found [\#45](https://github.com/feathersjs/errors/pull/45) ([ekryski](https://github.com/ekryski)) - -## [v2.2.0](https://github.com/feathersjs/errors/tree/v2.2.0) (2016-05-27) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.1.0...v2.2.0) - -**Closed issues:** - -- Can not format error to json [\#35](https://github.com/feathersjs/errors/issues/35) - -**Merged pull requests:** - -- Add an error conversion method [\#43](https://github.com/feathersjs/errors/pull/43) ([daffl](https://github.com/daffl)) -- mocha@2.5.0 breaks build 🚨 [\#42](https://github.com/feathersjs/errors/pull/42) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) -- Update babel-plugin-add-module-exports to version 0.2.0 🚀 [\#41](https://github.com/feathersjs/errors/pull/41) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v2.1.0](https://github.com/feathersjs/errors/tree/v2.1.0) (2016-04-03) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.0.2...v2.1.0) - -**Closed issues:** - -- Support passing a custom html format function [\#32](https://github.com/feathersjs/errors/issues/32) - -**Merged pull requests:** - -- Custom handlers [\#36](https://github.com/feathersjs/errors/pull/36) ([ekryski](https://github.com/ekryski)) -- Update all dependencies 🌴 [\#34](https://github.com/feathersjs/errors/pull/34) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) - -## [v2.0.2](https://github.com/feathersjs/errors/tree/v2.0.2) (2016-03-23) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.0.1...v2.0.2) - -**Closed issues:** - -- ReferenceError: Reflect is not defined [\#29](https://github.com/feathersjs/errors/issues/29) -- Make error pages opt-in [\#24](https://github.com/feathersjs/errors/issues/24) - -**Merged pull requests:** - -- Update package.json [\#33](https://github.com/feathersjs/errors/pull/33) ([marshallswain](https://github.com/marshallswain)) -- Fixed typo [\#30](https://github.com/feathersjs/errors/pull/30) ([kulakowka](https://github.com/kulakowka)) - -## [v2.0.1](https://github.com/feathersjs/errors/tree/v2.0.1) (2016-02-24) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v2.0.0...v2.0.1) - -**Closed issues:** - -- Error handler is wrapping errors as GeneralErrors [\#27](https://github.com/feathersjs/errors/issues/27) - -**Merged pull requests:** - -- adding an explicit error type [\#28](https://github.com/feathersjs/errors/pull/28) ([ekryski](https://github.com/ekryski)) - -## [v2.0.0](https://github.com/feathersjs/errors/tree/v2.0.0) (2016-02-24) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v1.2.4...v2.0.0) - -**Merged pull requests:** - -- move error handler out of index [\#26](https://github.com/feathersjs/errors/pull/26) ([ekryski](https://github.com/ekryski)) - -## [v1.2.4](https://github.com/feathersjs/errors/tree/v1.2.4) (2016-02-24) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v1.2.3...v1.2.4) - -## [v1.2.3](https://github.com/feathersjs/errors/tree/v1.2.3) (2016-02-21) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v1.2.2...v1.2.3) - -**Merged pull requests:** - -- Adding default error page and make HTML formatting optional [\#25](https://github.com/feathersjs/errors/pull/25) ([daffl](https://github.com/daffl)) - -## [v1.2.2](https://github.com/feathersjs/errors/tree/v1.2.2) (2016-02-18) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v1.2.1...v1.2.2) - -**Closed issues:** - -- Add error handler back [\#21](https://github.com/feathersjs/errors/issues/21) - -**Merged pull requests:** - -- Make fully CommonJS compatible and add error middleware tests [\#23](https://github.com/feathersjs/errors/pull/23) ([daffl](https://github.com/daffl)) - -## [v1.2.1](https://github.com/feathersjs/errors/tree/v1.2.1) (2016-02-16) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v1.2.0...v1.2.1) - -## [v1.2.0](https://github.com/feathersjs/errors/tree/v1.2.0) (2016-02-15) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v1.1.6...v1.2.0) - -**Closed issues:** - -- Check to make sure that errors propagate via web sockets [\#1](https://github.com/feathersjs/errors/issues/1) - -**Merged pull requests:** - -- adding error handler back [\#22](https://github.com/feathersjs/errors/pull/22) ([ekryski](https://github.com/ekryski)) - -## [v1.1.6](https://github.com/feathersjs/errors/tree/v1.1.6) (2016-01-12) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v1.1.5...v1.1.6) - -**Closed issues:** - -- stacktraces are incorrect when used in an ES6 app [\#20](https://github.com/feathersjs/errors/issues/20) -- We shouldn't mutate the error object passed in. [\#19](https://github.com/feathersjs/errors/issues/19) -- only one instance of babel-polyfill is allowed [\#17](https://github.com/feathersjs/errors/issues/17) - -## [v1.1.5](https://github.com/feathersjs/errors/tree/v1.1.5) (2015-12-18) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v1.1.4...v1.1.5) - -## [v1.1.4](https://github.com/feathersjs/errors/tree/v1.1.4) (2015-12-15) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v1.1.3...v1.1.4) - -**Closed issues:** - -- no method 'setPrototypeOf' in Node 0.10 [\#16](https://github.com/feathersjs/errors/issues/16) - -## [v1.1.3](https://github.com/feathersjs/errors/tree/v1.1.3) (2015-12-15) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v1.1.2...v1.1.3) - -## [v1.1.2](https://github.com/feathersjs/errors/tree/v1.1.2) (2015-12-15) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v1.1.1...v1.1.2) - -**Closed issues:** - -- Passing errors as second argument [\#9](https://github.com/feathersjs/errors/issues/9) - -## [v1.1.1](https://github.com/feathersjs/errors/tree/v1.1.1) (2015-12-14) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v1.1.0...v1.1.1) - -**Closed issues:** - -- Subclassing Errors using babel don't behave as expected [\#14](https://github.com/feathersjs/errors/issues/14) - -**Merged pull requests:** - -- Es6 class fix [\#15](https://github.com/feathersjs/errors/pull/15) ([ekryski](https://github.com/ekryski)) - -## [v1.1.0](https://github.com/feathersjs/errors/tree/v1.1.0) (2015-12-12) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v1.0.0...v1.1.0) - -## [v1.0.0](https://github.com/feathersjs/errors/tree/v1.0.0) (2015-12-12) - -[Full Changelog](https://github.com/feathersjs/errors/compare/0.2.5...v1.0.0) - -**Closed issues:** - -- Convert to ES6 [\#12](https://github.com/feathersjs/errors/issues/12) -- Drop the error handlers: Breaking Change [\#11](https://github.com/feathersjs/errors/issues/11) -- Remove Lodash dependency [\#10](https://github.com/feathersjs/errors/issues/10) -- Logging only unhandled errors [\#8](https://github.com/feathersjs/errors/issues/8) - -**Merged pull requests:** - -- complete rewrite. Closes \#11 and \#12. [\#13](https://github.com/feathersjs/errors/pull/13) ([ekryski](https://github.com/ekryski)) - -## [0.2.5](https://github.com/feathersjs/errors/tree/0.2.5) (2015-02-05) - -[Full Changelog](https://github.com/feathersjs/errors/compare/0.2.4...0.2.5) - -## [0.2.4](https://github.com/feathersjs/errors/tree/0.2.4) (2015-02-05) - -[Full Changelog](https://github.com/feathersjs/errors/compare/0.2.3...0.2.4) - -## [0.2.3](https://github.com/feathersjs/errors/tree/0.2.3) (2015-01-29) - -[Full Changelog](https://github.com/feathersjs/errors/compare/0.2.2...0.2.3) - -## [0.2.2](https://github.com/feathersjs/errors/tree/0.2.2) (2015-01-29) - -[Full Changelog](https://github.com/feathersjs/errors/compare/0.2.1...0.2.2) - -## [0.2.1](https://github.com/feathersjs/errors/tree/0.2.1) (2014-09-03) - -[Full Changelog](https://github.com/feathersjs/errors/compare/0.2.0...0.2.1) - -## [0.2.0](https://github.com/feathersjs/errors/tree/0.2.0) (2014-07-17) - -[Full Changelog](https://github.com/feathersjs/errors/compare/0.1.7...0.2.0) - -**Implemented enhancements:** - -- Handle error objects with an 'errors' object [\#5](https://github.com/feathersjs/errors/issues/5) - -## [0.1.7](https://github.com/feathersjs/errors/tree/0.1.7) (2014-07-06) - -[Full Changelog](https://github.com/feathersjs/errors/compare/0.1.6...0.1.7) - -## [0.1.6](https://github.com/feathersjs/errors/tree/0.1.6) (2014-07-05) - -[Full Changelog](https://github.com/feathersjs/errors/compare/0.1.5...0.1.6) - -## [0.1.5](https://github.com/feathersjs/errors/tree/0.1.5) (2014-06-13) - -[Full Changelog](https://github.com/feathersjs/errors/compare/0.1.4...0.1.5) - -## [0.1.4](https://github.com/feathersjs/errors/tree/0.1.4) (2014-06-13) - -[Full Changelog](https://github.com/feathersjs/errors/compare/0.1.3...0.1.4) - -**Closed issues:** - -- Move errors into core [\#2](https://github.com/feathersjs/errors/issues/2) - -**Merged pull requests:** - -- Core compatible [\#4](https://github.com/feathersjs/errors/pull/4) ([ekryski](https://github.com/ekryski)) - -## [0.1.3](https://github.com/feathersjs/errors/tree/0.1.3) (2014-06-09) - -[Full Changelog](https://github.com/feathersjs/errors/compare/0.1.2...0.1.3) - -**Merged pull requests:** - -- Adding a default error page [\#3](https://github.com/feathersjs/errors/pull/3) ([ekryski](https://github.com/ekryski)) - -## [0.1.2](https://github.com/feathersjs/errors/tree/0.1.2) (2014-06-05) - -[Full Changelog](https://github.com/feathersjs/errors/compare/0.1.1...0.1.2) - -## [0.1.1](https://github.com/feathersjs/errors/tree/0.1.1) (2014-06-04) - -[Full Changelog](https://github.com/feathersjs/errors/compare/v0.1.0...0.1.1) - -## [v0.1.0](https://github.com/feathersjs/errors/tree/v0.1.0) (2014-06-04) - -\* _This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)_ diff --git a/packages/errors/LICENSE b/packages/errors/LICENSE deleted file mode 100644 index 7712f870f3..0000000000 --- a/packages/errors/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2024 Feathers Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/packages/errors/README.md b/packages/errors/README.md deleted file mode 100644 index 1b76126634..0000000000 --- a/packages/errors/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# @feathersjs/errors - -[](https://github.com/feathersjs/feathers/actions?query=workflow%3ACI) -[](https://www.npmjs.com/package/@feathersjs/errors) -[](https://discord.gg/qa8kez8QBx) - -> Common error types for feathers apps - -## Installation - -``` -npm install @feathersjs/errors --save -``` - -## Documentation - -Refer to the [Feathers errors API documentation](https://feathersjs.com/api/errors.html) for more details. - -## License - -Copyright (c) 2024 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors) - -Licensed under the [MIT license](LICENSE). diff --git a/packages/errors/package.json b/packages/errors/package.json deleted file mode 100644 index 8f51e60279..0000000000 --- a/packages/errors/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "@feathersjs/errors", - "description": "Common error types for Feathers apps", - "version": "5.0.34", - "homepage": "https://feathersjs.com", - "main": "lib/", - "types": "lib/", - "keywords": [ - "feathers", - "feathers-plugin" - ], - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/feathersjs/feathers.git", - "directory": "packages/errors" - }, - "author": { - "name": "Feathers contributors", - "email": "hello@feathersjs.com", - "url": "https://feathersjs.com" - }, - "contributors": [], - "bugs": { - "url": "https://github.com/feathersjs/feathers/issues" - }, - "engines": { - "node": ">= 12" - }, - "directories": { - "lib": "lib" - }, - "scripts": { - "prepublish": "npm run compile", - "pack": "npm pack --pack-destination ../generators/test/build", - "compile": "shx rm -rf lib/ && tsc && npm run pack", - "test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts" - }, - "publishConfig": { - "access": "public" - }, - "files": [ - "CHANGELOG.md", - "LICENSE", - "README.md", - "src/**", - "lib/**", - "*.d.ts", - "*.js" - ], - "devDependencies": { - "@feathersjs/feathers": "^5.0.34", - "@types/mocha": "^10.0.10", - "@types/node": "^24.1.0", - "mocha": "^11.7.1", - "shx": "^0.4.0", - "ts-node": "^10.9.2", - "typescript": "^5.9.2" - }, - "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5" -} diff --git a/packages/errors/tsconfig.json b/packages/errors/tsconfig.json deleted file mode 100644 index 316fd41336..0000000000 --- a/packages/errors/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig", - "include": [ - "src/**/*.ts" - ], - "compilerOptions": { - "outDir": "lib" - } -} diff --git a/packages/express/CHANGELOG.md b/packages/express/CHANGELOG.md deleted file mode 100644 index ad652d47f4..0000000000 --- a/packages/express/CHANGELOG.md +++ /dev/null @@ -1,761 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [5.0.34](https://github.com/feathersjs/feathers/compare/v5.0.33...v5.0.34) (2025-05-03) - -### Bug Fixes - -- Update dependencies ([#3584](https://github.com/feathersjs/feathers/issues/3584)) ([119fa4e](https://github.com/feathersjs/feathers/commit/119fa4e1ade8b0078aa235083d566e2538b3a084)) - -## [5.0.33](https://github.com/feathersjs/feathers/compare/v5.0.32...v5.0.33) (2025-02-24) - -### Bug Fixes - -- **dependencies:** Update dependencies ([#3571](https://github.com/feathersjs/feathers/issues/3571)) ([ad611cb](https://github.com/feathersjs/feathers/commit/ad611cb6ffb1dc31d603ba5817331318c5a23217)) - -## [5.0.32](https://github.com/feathersjs/feathers/compare/v5.0.31...v5.0.32) (2025-02-01) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.31](https://github.com/feathersjs/feathers/compare/v5.0.30...v5.0.31) (2024-10-31) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3545](https://github.com/feathersjs/feathers/issues/3545)) ([221b92b](https://github.com/feathersjs/feathers/commit/221b92bb0ee5d54fb1036742968797cb02e56da2)) -- **express:** Update express to version 4.21.1 ([#3543](https://github.com/feathersjs/feathers/issues/3543)) ([56d6151](https://github.com/feathersjs/feathers/commit/56d6151624f083d6604e76746cf555ed846b6d40)) - -## [5.0.30](https://github.com/feathersjs/feathers/compare/v5.0.29...v5.0.30) (2024-09-02) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.29](https://github.com/feathersjs/feathers/compare/v5.0.28...v5.0.29) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.28](https://github.com/feathersjs/feathers/compare/v5.0.27...v5.0.28) (2024-07-10) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.27](https://github.com/feathersjs/feathers/compare/v5.0.26...v5.0.27) (2024-06-18) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.26](https://github.com/feathersjs/feathers/compare/v5.0.25...v5.0.26) (2024-06-09) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.25](https://github.com/feathersjs/feathers/compare/v5.0.24...v5.0.25) (2024-05-03) - -### Bug Fixes - -- Reduce usage of lodash ([#3455](https://github.com/feathersjs/feathers/issues/3455)) ([8ce807a](https://github.com/feathersjs/feathers/commit/8ce807a5ca53ff5b8d5107a0656c6329404e6e6c)) - -## [5.0.24](https://github.com/feathersjs/feathers/compare/v5.0.23...v5.0.24) (2024-03-13) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.23](https://github.com/feathersjs/feathers/compare/v5.0.22...v5.0.23) (2024-02-25) - -### Bug Fixes - -- **core:** Update to latest feathersjs/hooks ([#3434](https://github.com/feathersjs/feathers/issues/3434)) ([1499ccc](https://github.com/feathersjs/feathers/commit/1499ccc41fb3ebba97b2c84e0cb19bc48ad3c651)) - -## [5.0.22](https://github.com/feathersjs/feathers/compare/v5.0.21...v5.0.22) (2024-02-15) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.21](https://github.com/feathersjs/feathers/compare/v5.0.20...v5.0.21) (2024-01-25) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.20](https://github.com/feathersjs/feathers/compare/v5.0.19...v5.0.20) (2024-01-24) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.19](https://github.com/feathersjs/feathers/compare/v5.0.18...v5.0.19) (2024-01-23) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.18](https://github.com/feathersjs/feathers/compare/v5.0.17...v5.0.18) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.17](https://github.com/feathersjs/feathers/compare/v5.0.16...v5.0.17) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.16](https://github.com/feathersjs/feathers/compare/v5.0.15...v5.0.16) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.15](https://github.com/feathersjs/feathers/compare/v5.0.14...v5.0.15) (2024-01-22) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.14](https://github.com/feathersjs/feathers/compare/v5.0.13...v5.0.14) (2024-01-05) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.13](https://github.com/feathersjs/feathers/compare/v5.0.12...v5.0.13) (2023-12-29) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.12](https://github.com/feathersjs/feathers/compare/v5.0.11...v5.0.12) (2023-11-28) - -### Bug Fixes - -- **express:** Re-export Router ([#3349](https://github.com/feathersjs/feathers/issues/3349)) ([0cbdb03](https://github.com/feathersjs/feathers/commit/0cbdb03a2d810f4855da9b21602c96e4fed7fce5)) - -## [5.0.11](https://github.com/feathersjs/feathers/compare/v5.0.10...v5.0.11) (2023-10-11) - -### Bug Fixes - -- **knex:** Update all dependencies and Knex peer ([#3308](https://github.com/feathersjs/feathers/issues/3308)) ([d2f9860](https://github.com/feathersjs/feathers/commit/d2f986036c4741cce2339d8abbcc6b2eb037a12a)) - -## [5.0.10](https://github.com/feathersjs/feathers/compare/v5.0.9...v5.0.10) (2023-10-03) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.9](https://github.com/feathersjs/feathers/compare/v5.0.8...v5.0.9) (2023-09-27) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.8](https://github.com/feathersjs/feathers/compare/v5.0.7...v5.0.8) (2023-07-19) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.7](https://github.com/feathersjs/feathers/compare/v5.0.6...v5.0.7) (2023-07-14) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.6](https://github.com/feathersjs/feathers/compare/v5.0.5...v5.0.6) (2023-06-15) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.5](https://github.com/feathersjs/feathers/compare/v5.0.4...v5.0.5) (2023-04-28) - -**Note:** Version bump only for package @feathersjs/express - -## [5.0.4](https://github.com/feathersjs/feathers/compare/v5.0.3...v5.0.4) (2023-04-12) - -### Bug Fixes - -- Make sure all Readme files are up to date ([#3154](https://github.com/feathersjs/feathers/issues/3154)) ([a5f0b38](https://github.com/feathersjs/feathers/commit/a5f0b38bbf2a11486415a39533bcc6c67fb51e3e)) - -## [5.0.3](https://github.com/feathersjs/feathers/compare/v5.0.2...v5.0.3) (2023-04-05) - -### Bug Fixes - -- **dependencies:** Update all dependencies ([#3139](https://github.com/feathersjs/feathers/issues/3139)) ([f24276e](https://github.com/feathersjs/feathers/commit/f24276e9a909e2e58a0730c730258ce1f70f4028)) - -## [5.0.1](https://github.com/feathersjs/feathers/compare/v5.0.0...v5.0.1) (2023-03-15) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.38...v5.0.0) (2023-02-24) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.38](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.37...v5.0.0-pre.38) (2023-02-17) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.37](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.36...v5.0.0-pre.37) (2023-02-09) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.36](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.35...v5.0.0-pre.36) (2023-01-29) - -### Bug Fixes - -- Update all dependencies ([#3024](https://github.com/feathersjs/feathers/issues/3024)) ([283dc47](https://github.com/feathersjs/feathers/commit/283dc4798d85584bc031e6e54b83b4ea77d1edd0)) - -# [5.0.0-pre.35](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.34...v5.0.0-pre.35) (2023-01-12) - -### Features - -- **generators:** Move core code generators to shared generators package ([#2982](https://github.com/feathersjs/feathers/issues/2982)) ([0328d22](https://github.com/feathersjs/feathers/commit/0328d2292153870bc43958f73d2c6f288a8cec17)) - -# [5.0.0-pre.34](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.33...v5.0.0-pre.34) (2022-12-14) - -### Bug Fixes - -- **core:** `context.type` for around hooks ([#2890](https://github.com/feathersjs/feathers/issues/2890)) ([d606ac6](https://github.com/feathersjs/feathers/commit/d606ac660fd5335c95206784fea36530dd2e851a)) - -# [5.0.0-pre.33](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.32...v5.0.0-pre.33) (2022-11-08) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.32](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.31...v5.0.0-pre.32) (2022-10-26) - -### Bug Fixes - -- **docs:** Review transport API docs and update Express middleware setup ([#2811](https://github.com/feathersjs/feathers/issues/2811)) ([1b97f14](https://github.com/feathersjs/feathers/commit/1b97f14d474f5613482f259eeaa585c24fcfab43)) -- **transports:** Add remaining middleware for generated apps to Koa and Express ([#2796](https://github.com/feathersjs/feathers/issues/2796)) ([0d5781a](https://github.com/feathersjs/feathers/commit/0d5781a5c72a0cbb2ec8211bfa099f0aefe115a2)) - -# [5.0.0-pre.31](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.30...v5.0.0-pre.31) (2022-10-12) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.30](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.29...v5.0.0-pre.30) (2022-10-07) - -### Bug Fixes - -- **core:** Ensure setup and teardown can be overriden and maintain hook functionality ([#2779](https://github.com/feathersjs/feathers/issues/2779)) ([ab580cb](https://github.com/feathersjs/feathers/commit/ab580cbcaa68d19144d86798c13bf564f9d424a6)) - -### Features - -- **core:** Allow to unregister services at runtime ([#2756](https://github.com/feathersjs/feathers/issues/2756)) ([d16601f](https://github.com/feathersjs/feathers/commit/d16601f2277dca5357866ffdefba2a611f6dc7fa)) - -# [5.0.0-pre.29](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.28...v5.0.0-pre.29) (2022-09-16) - -### Features - -- Add CORS support to oAuth, Express, Koa and generated application ([#2744](https://github.com/feathersjs/feathers/issues/2744)) ([fd218f2](https://github.com/feathersjs/feathers/commit/fd218f289f8ca4c101e9938e8683e2efef6e8131)) -- **authentication-oauth:** Koa and transport independent oAuth authentication ([#2737](https://github.com/feathersjs/feathers/issues/2737)) ([9231525](https://github.com/feathersjs/feathers/commit/9231525a24bb790ba9c5d940f2867a9c727691c9)) - -# [5.0.0-pre.28](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.27...v5.0.0-pre.28) (2022-08-03) - -### Bug Fixes - -- **cli:** Improve generated application and client ([#2701](https://github.com/feathersjs/feathers/issues/2701)) ([bd55ffb](https://github.com/feathersjs/feathers/commit/bd55ffb812e89bf215f4515e7f137656ea888c3f)) - -# [5.0.0-pre.27](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.26...v5.0.0-pre.27) (2022-07-13) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.26](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.25...v5.0.0-pre.26) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.25](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.24...v5.0.0-pre.25) (2022-06-22) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.24](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.23...v5.0.0-pre.24) (2022-06-21) - -### Bug Fixes - -- **authentication:** Add safe dispatch data for authentication requests ([#2662](https://github.com/feathersjs/feathers/issues/2662)) ([d8104a1](https://github.com/feathersjs/feathers/commit/d8104a19ee9181e6a5ea81014af29ff9a3c28a8a)) - -### Features - -- **cli:** Add support for JavaScript to the new CLI ([#2668](https://github.com/feathersjs/feathers/issues/2668)) ([ebac587](https://github.com/feathersjs/feathers/commit/ebac587f7d00dc7607c3f546352d79f79b89a5d4)) - -# [5.0.0-pre.23](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.22...v5.0.0-pre.23) (2022-06-06) - -### Bug Fixes - -- **express:** Ensure Express options can be set before configuring REST transport ([#2655](https://github.com/feathersjs/feathers/issues/2655)) ([c9b8f74](https://github.com/feathersjs/feathers/commit/c9b8f74a0196acb99be44ac5e0fff3f1128288cd)) - -# [5.0.0-pre.22](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.21...v5.0.0-pre.22) (2022-05-24) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.21](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.20...v5.0.0-pre.21) (2022-05-23) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.20](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.19...v5.0.0-pre.20) (2022-05-04) - -### Bug Fixes - -- **dependencies:** Lock monorepo package version numbers ([#2623](https://github.com/feathersjs/feathers/issues/2623)) ([5640c10](https://github.com/feathersjs/feathers/commit/5640c1020cc139994e695d658c08bad3494db507)) - -# [5.0.0-pre.19](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.18...v5.0.0-pre.19) (2022-05-01) - -### Bug Fixes - -- **express:** Fix typo in types reference in package.json ([#2613](https://github.com/feathersjs/feathers/issues/2613)) ([eacf1b3](https://github.com/feathersjs/feathers/commit/eacf1b3474e6d9da69b8671244c23a75cff87d95)) - -### Features - -- **typescript:** Improve params and query typeability ([#2600](https://github.com/feathersjs/feathers/issues/2600)) ([df28b76](https://github.com/feathersjs/feathers/commit/df28b7619161f1df5e700326f52cca1a92dc5d28)) - -# [5.0.0-pre.18](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.17...v5.0.0-pre.18) (2022-04-11) - -### Features - -- **core:** Add app.teardown functionality ([#2570](https://github.com/feathersjs/feathers/issues/2570)) ([fcdf524](https://github.com/feathersjs/feathers/commit/fcdf524ae1995bb59265d39f12e98b7794bed023)) -- **core:** Finalize app.teardown() functionality ([#2584](https://github.com/feathersjs/feathers/issues/2584)) ([1a166f3](https://github.com/feathersjs/feathers/commit/1a166f3ded811ecacf0ae8cb67880bc9fa2eeafa)) -- **transport-commons:** add `context.http.response` ([#2524](https://github.com/feathersjs/feathers/issues/2524)) ([5bc9d44](https://github.com/feathersjs/feathers/commit/5bc9d447043c2e2b742c73ed28ecf3b3264dd9e5)) - -# [5.0.0-pre.17](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.16...v5.0.0-pre.17) (2022-02-15) - -### Bug Fixes - -- **express:** Fix application typings to work with typed configuration ([#2539](https://github.com/feathersjs/feathers/issues/2539)) ([b9dfaee](https://github.com/feathersjs/feathers/commit/b9dfaee834b13864c1ed4f2f6a244eb5bb70395b)) - -# [5.0.0-pre.16](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.15...v5.0.0-pre.16) (2022-01-12) - -### Features - -- **express, koa:** make transports similar ([#2486](https://github.com/feathersjs/feathers/issues/2486)) ([26aa937](https://github.com/feathersjs/feathers/commit/26aa937c114fb8596dfefc599b1f53cead69c159)) - -# [5.0.0-pre.15](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.14...v5.0.0-pre.15) (2021-11-27) - -### Bug Fixes - -- missing express types for Request, Response ([#2498](https://github.com/feathersjs/feathers/issues/2498)) ([ee67131](https://github.com/feathersjs/feathers/commit/ee67131bbaa24c54d3d781bdf8820015759ac488)) -- **typescript:** Overall typing improvements ([#2478](https://github.com/feathersjs/feathers/issues/2478)) ([b8eb804](https://github.com/feathersjs/feathers/commit/b8eb804158556d9651a8607e3c3fda15e0bfd110)) - -### Features - -- **core:** add `context.http` and move `statusCode` there ([#2496](https://github.com/feathersjs/feathers/issues/2496)) ([b701bf7](https://github.com/feathersjs/feathers/commit/b701bf77fb83048aa1dffa492b3d77dd53f7b72b)) -- **core:** Improve legacy hooks integration ([08c8b40](https://github.com/feathersjs/feathers/commit/08c8b40999bf3889c61a4d4fad97a2c4f78bafc9)) - -# [5.0.0-pre.14](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.13...v5.0.0-pre.14) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.13](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.12...v5.0.0-pre.13) (2021-10-13) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.12](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.11...v5.0.0-pre.12) (2021-10-12) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.11](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.10...v5.0.0-pre.11) (2021-10-06) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.10](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.9...v5.0.0-pre.10) (2021-09-19) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.9](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.8...v5.0.0-pre.9) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.8](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.7...v5.0.0-pre.8) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.7](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.6...v5.0.0-pre.7) (2021-08-09) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.6](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.5...v5.0.0-pre.6) (2021-08-08) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.4...v5.0.0-pre.5) (2021-06-23) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.3...v5.0.0-pre.4) (2021-05-13) - -### Features - -- **koa:** KoaJS transport adapter ([#2315](https://github.com/feathersjs/feathers/issues/2315)) ([2554b57](https://github.com/feathersjs/feathers/commit/2554b57cf05731df58feeba9c12faab18e442107)) - -# [5.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.2...v5.0.0-pre.3) (2021-04-21) - -### Bug Fixes - -- **typescript:** Improve TypeScript backwards compatibility ([#2310](https://github.com/feathersjs/feathers/issues/2310)) ([f33be73](https://github.com/feathersjs/feathers/commit/f33be73fc46a533efb15df9aab0658e3240d3897)) - -### Features - -- **dependencies:** Remove direct debug dependency ([#2296](https://github.com/feathersjs/feathers/issues/2296)) ([501d416](https://github.com/feathersjs/feathers/commit/501d4164d30c6a126906dc640cdfdc82207ba34a)) - -# [5.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.1...v5.0.0-pre.2) (2021-04-06) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-beta.1](https://github.com/feathersjs/feathers/compare/v5.0.0-beta.0...v5.0.0-beta.1) (2021-04-03) - -**Note:** Version bump only for package @feathersjs/express - -# [5.0.0-beta.0](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.1...v5.0.0-beta.0) (2021-03-28) - -### Bug Fixes - -- Resolve some type problems ([#2260](https://github.com/feathersjs/feathers/issues/2260)) ([a3d75fa](https://github.com/feathersjs/feathers/commit/a3d75fa29490e8a19412a12bc993ee7bb573068f)) -- Update Grant usage and other dependencies ([#2264](https://github.com/feathersjs/feathers/issues/2264)) ([7b0f8fa](https://github.com/feathersjs/feathers/commit/7b0f8fad252419ed0ad0bf259cdf3104d322ab60)) - -### Features - -- **core:** Public custom service methods ([#2270](https://github.com/feathersjs/feathers/issues/2270)) ([e65abfb](https://github.com/feathersjs/feathers/commit/e65abfb5388df6c19a11c565cf1076a29f32668d)) -- Application service types default to any ([#1566](https://github.com/feathersjs/feathers/issues/1566)) ([d93ba9a](https://github.com/feathersjs/feathers/commit/d93ba9a17edd20d3397bb00f4f6e82e804e42ed6)) -- Feathers v5 core refactoring and features ([#2255](https://github.com/feathersjs/feathers/issues/2255)) ([2dafb7c](https://github.com/feathersjs/feathers/commit/2dafb7ce14ba57406aeec13d10ca45b1e709bee9)) -- **core:** Remove Uberproto ([#2178](https://github.com/feathersjs/feathers/issues/2178)) ([ddf8821](https://github.com/feathersjs/feathers/commit/ddf8821f53317e6a378657f7d66acb03a037ee47)) - -### BREAKING CHANGES - -- **core:** Services no longer extend Uberproto objects and - `service.mixin()` is no longer available. - -# [5.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.5.11...v5.0.0-pre.1) (2020-12-17) - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -### Features - -- **core:** use @feathers/hooks and add async type ([#1929](https://github.com/feathersjs/feathers/issues/1929)) ([a5c4756](https://github.com/feathersjs/feathers/commit/a5c47562eae8410c82fe2f6308f26f8e78b6a3e8)) - -# [5.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v4.5.4...v5.0.0-pre.0) (2020-05-19) - -### Features - -- **core:** use @feathers/hooks and add async type ([#1929](https://github.com/feathersjs/feathers/issues/1929)) ([a5c4756](https://github.com/feathersjs/feathers/commit/a5c47562eae8410c82fe2f6308f26f8e78b6a3e8)) - -## [4.5.11](https://github.com/feathersjs/feathers/compare/v4.5.10...v4.5.11) (2020-12-05) - -**Note:** Version bump only for package @feathersjs/express - -## [4.5.10](https://github.com/feathersjs/feathers/compare/v4.5.9...v4.5.10) (2020-11-08) - -### Bug Fixes - -- **authentication:** consistent response return between local and jwt strategy ([#2042](https://github.com/feathersjs/feathers/issues/2042)) ([8d25be1](https://github.com/feathersjs/feathers/commit/8d25be101a2593a9e789375c928a07780b9e28cf)) - -## [4.5.9](https://github.com/feathersjs/feathers/compare/v4.5.8...v4.5.9) (2020-10-09) - -**Note:** Version bump only for package @feathersjs/express - -## [4.5.8](https://github.com/feathersjs/feathers/compare/v4.5.7...v4.5.8) (2020-08-12) - -**Note:** Version bump only for package @feathersjs/express - -## [4.5.7](https://github.com/feathersjs/feathers/compare/v4.5.6...v4.5.7) (2020-07-24) - -**Note:** Version bump only for package @feathersjs/express - -## [4.5.6](https://github.com/feathersjs/feathers/compare/v4.5.5...v4.5.6) (2020-07-12) - -**Note:** Version bump only for package @feathersjs/express - -## [4.5.5](https://github.com/feathersjs/feathers/compare/v4.5.4...v4.5.5) (2020-07-11) - -**Note:** Version bump only for package @feathersjs/express - -## [4.5.4](https://github.com/feathersjs/feathers/compare/v4.5.3...v4.5.4) (2020-04-29) - -**Note:** Version bump only for package @feathersjs/express - -## [4.5.3](https://github.com/feathersjs/feathers/compare/v4.5.2...v4.5.3) (2020-04-17) - -**Note:** Version bump only for package @feathersjs/express - -## [4.5.2](https://github.com/feathersjs/feathers/compare/v4.5.1...v4.5.2) (2020-03-04) - -### Bug Fixes - -- Updated typings for express middleware ([#1839](https://github.com/feathersjs/feathers/issues/1839)) ([6b8e897](https://github.com/feathersjs/feathers/commit/6b8e8971a9dbb08913edd1be48826624645d9dc1)) - -## [4.5.1](https://github.com/feathersjs/feathers/compare/v4.5.0...v4.5.1) (2020-01-24) - -**Note:** Version bump only for package @feathersjs/express - -# [4.5.0](https://github.com/feathersjs/feathers/compare/v4.4.3...v4.5.0) (2020-01-18) - -**Note:** Version bump only for package @feathersjs/express - -## [4.4.3](https://github.com/feathersjs/feathers/compare/v4.4.1...v4.4.3) (2019-12-06) - -**Note:** Version bump only for package @feathersjs/express - -## [4.4.1](https://github.com/feathersjs/feathers/compare/v4.4.0...v4.4.1) (2019-11-27) - -**Note:** Version bump only for package @feathersjs/express - -# [4.4.0](https://github.com/feathersjs/feathers/compare/v4.3.11...v4.4.0) (2019-11-27) - -### Features - -- **authentication:** Add parseStrategies to allow separate strategies for creating JWTs and parsing headers ([#1708](https://github.com/feathersjs/feathers/issues/1708)) ([5e65629](https://github.com/feathersjs/feathers/commit/5e65629b924724c3e81d7c81df047e123d1c8bd7)) - -## [4.3.11](https://github.com/feathersjs/feathers/compare/v4.3.10...v4.3.11) (2019-11-11) - -**Note:** Version bump only for package @feathersjs/express - -## [4.3.10](https://github.com/feathersjs/feathers/compare/v4.3.9...v4.3.10) (2019-10-26) - -**Note:** Version bump only for package @feathersjs/express - -## [4.3.9](https://github.com/feathersjs/feathers/compare/v4.3.8...v4.3.9) (2019-10-26) - -### Bug Fixes - -- Small type improvements ([#1624](https://github.com/feathersjs/feathers/issues/1624)) ([50162c6](https://github.com/feathersjs/feathers/commit/50162c6e562f0a47c6a280c4f01fff7c3afee293)) - -## [4.3.7](https://github.com/feathersjs/feathers/compare/v4.3.6...v4.3.7) (2019-10-14) - -### Bug Fixes - -- Typings for express request and response properties ([#1609](https://github.com/feathersjs/feathers/issues/1609)) ([38cf8c9](https://github.com/feathersjs/feathers/commit/38cf8c950c1a4fb4a6d78d68d70e7fdd63b71c3c)) - -## [4.3.5](https://github.com/feathersjs/feathers/compare/v4.3.4...v4.3.5) (2019-10-07) - -**Note:** Version bump only for package @feathersjs/express - -## [4.3.4](https://github.com/feathersjs/feathers/compare/v4.3.3...v4.3.4) (2019-10-03) - -**Note:** Version bump only for package @feathersjs/express - -## [4.3.3](https://github.com/feathersjs/feathers/compare/v4.3.2...v4.3.3) (2019-09-21) - -**Note:** Version bump only for package @feathersjs/express - -## [4.3.2](https://github.com/feathersjs/feathers/compare/v4.3.1...v4.3.2) (2019-09-16) - -### Bug Fixes - -- Add info to express error handler logger type ([#1557](https://github.com/feathersjs/feathers/issues/1557)) ([3e1d26c](https://github.com/feathersjs/feathers/commit/3e1d26c)) - -## [4.3.1](https://github.com/feathersjs/feathers/compare/v4.3.0...v4.3.1) (2019-09-09) - -**Note:** Version bump only for package @feathersjs/express - -# [4.3.0](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.4...v4.3.0) (2019-08-27) - -**Note:** Version bump only for package @feathersjs/express - -# [4.3.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.3...v4.3.0-pre.4) (2019-08-22) - -**Note:** Version bump only for package @feathersjs/express - -# [4.3.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.2...v4.3.0-pre.3) (2019-08-19) - -### Bug Fixes - -- Update all dependencies ([7d53a00](https://github.com/feathersjs/feathers/commit/7d53a00)) - -# [4.3.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.1...v4.3.0-pre.2) (2019-08-02) - -### Bug Fixes - -- Add method to reliably get default authentication service ([#1470](https://github.com/feathersjs/feathers/issues/1470)) ([e542cb3](https://github.com/feathersjs/feathers/commit/e542cb3)) - -# [4.3.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.5...v4.3.0-pre.1) (2019-07-11) - -**Note:** Version bump only for package @feathersjs/express - -# [4.0.0-pre.5](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.4...v4.0.0-pre.5) (2019-07-10) - -### Bug Fixes - -- Remove unnecessary top level export files in @feathersjs/express ([#1442](https://github.com/feathersjs/feathers/issues/1442)) ([73c3fb2](https://github.com/feathersjs/feathers/commit/73c3fb2)) - -### Features - -- @feathersjs/express allow to pass an existing Express application instance ([#1446](https://github.com/feathersjs/feathers/issues/1446)) ([853a6b0](https://github.com/feathersjs/feathers/commit/853a6b0)) - -# [4.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.3...v4.0.0-pre.4) (2019-07-05) - -### Bug Fixes - -- @feathersjs/express: allow middleware arrays ([#1421](https://github.com/feathersjs/feathers/issues/1421)) ([b605ab8](https://github.com/feathersjs/feathers/commit/b605ab8)) -- @feathersjs/express: replace `reduce` with `map` ([#1429](https://github.com/feathersjs/feathers/issues/1429)) ([44542e9](https://github.com/feathersjs/feathers/commit/44542e9)) -- Clean up hooks code ([#1407](https://github.com/feathersjs/feathers/issues/1407)) ([f25c88b](https://github.com/feathersjs/feathers/commit/f25c88b)) - -# [4.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.2...v4.0.0-pre.3) (2019-06-01) - -### Bug Fixes - -- Update dependencies and fix tests ([#1373](https://github.com/feathersjs/feathers/issues/1373)) ([d743a7f](https://github.com/feathersjs/feathers/commit/d743a7f)) - -# [4.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.1...v4.0.0-pre.2) (2019-05-15) - -### Bug Fixes - -- Use `export =` in TypeScript definitions ([#1285](https://github.com/feathersjs/feathers/issues/1285)) ([12d0f4b](https://github.com/feathersjs/feathers/commit/12d0f4b)) - -# [4.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.0...v4.0.0-pre.1) (2019-05-08) - -### Bug Fixes - -- Always require strategy parameter in authentication ([#1327](https://github.com/feathersjs/feathers/issues/1327)) ([d4a8021](https://github.com/feathersjs/feathers/commit/d4a8021)) -- Merge httpStrategies and authStrategies option ([#1308](https://github.com/feathersjs/feathers/issues/1308)) ([afa4d55](https://github.com/feathersjs/feathers/commit/afa4d55)) - -### Features - -- Add params.headers to all transports when available ([#1303](https://github.com/feathersjs/feathers/issues/1303)) ([ebce79b](https://github.com/feathersjs/feathers/commit/ebce79b)) -- express use service.methods ([#945](https://github.com/feathersjs/feathers/issues/945)) ([3f0b1c3](https://github.com/feathersjs/feathers/commit/3f0b1c3)) - -# [4.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v3.2.0-pre.1...v4.0.0-pre.0) (2019-04-21) - -### Bug Fixes - -- Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803)) -- Update adapter common tests ([#1135](https://github.com/feathersjs/feathers/issues/1135)) ([8166dda](https://github.com/feathersjs/feathers/commit/8166dda)) -- Update all dependencies to latest ([#1206](https://github.com/feathersjs/feathers/issues/1206)) ([e51e0f6](https://github.com/feathersjs/feathers/commit/e51e0f6)) -- **chore:** Properly configure and run code linter ([#1092](https://github.com/feathersjs/feathers/issues/1092)) ([fd3fc34](https://github.com/feathersjs/feathers/commit/fd3fc34)) -- **package:** update @feathersjs/commons to version 2.0.0 ([#31](https://github.com/feathersjs/feathers/issues/31)) ([c1ef5b1](https://github.com/feathersjs/feathers/commit/c1ef5b1)) -- **package:** update debug to version 3.0.0 ([#2](https://github.com/feathersjs/feathers/issues/2)) ([7e19603](https://github.com/feathersjs/feathers/commit/7e19603)) - -### Features - -- @feathersjs/authentication-oauth ([#1299](https://github.com/feathersjs/feathers/issues/1299)) ([656bae7](https://github.com/feathersjs/feathers/commit/656bae7)) -- Add AuthenticationBaseStrategy and make authentication option handling more explicit ([#1284](https://github.com/feathersjs/feathers/issues/1284)) ([2667d92](https://github.com/feathersjs/feathers/commit/2667d92)) -- Add TypeScript definitions ([#1275](https://github.com/feathersjs/feathers/issues/1275)) ([9dd6713](https://github.com/feathersjs/feathers/commit/9dd6713)) -- Allow registering a service at the root level ([#1115](https://github.com/feathersjs/feathers/issues/1115)) ([c73d322](https://github.com/feathersjs/feathers/commit/c73d322)) -- Authentication v3 client ([#1240](https://github.com/feathersjs/feathers/issues/1240)) ([65b43bd](https://github.com/feathersjs/feathers/commit/65b43bd)) -- Authentication v3 Express integration ([#1218](https://github.com/feathersjs/feathers/issues/1218)) ([82bcfbe](https://github.com/feathersjs/feathers/commit/82bcfbe)) - -### BREAKING CHANGES - -- Rewrite for authentication v3 - -## [1.3.1](https://github.com/feathersjs/feathers/compare/@feathersjs/express@1.3.0...@feathersjs/express@1.3.1) (2019-01-02) - -### Bug Fixes - -- Update adapter common tests ([#1135](https://github.com/feathersjs/feathers/issues/1135)) ([8166dda](https://github.com/feathersjs/feathers/commit/8166dda)) - - - -# [1.3.0](https://github.com/feathersjs/feathers/compare/@feathersjs/express@1.2.7...@feathersjs/express@1.3.0) (2018-12-16) - -### Bug Fixes - -- Make Mocha a proper devDependency for every repository ([#1053](https://github.com/feathersjs/feathers/issues/1053)) ([9974803](https://github.com/feathersjs/feathers/commit/9974803)) -- **chore:** Properly configure and run code linter ([#1092](https://github.com/feathersjs/feathers/issues/1092)) ([fd3fc34](https://github.com/feathersjs/feathers/commit/fd3fc34)) - -### Features - -- Allow registering a service at the root level ([#1115](https://github.com/feathersjs/feathers/issues/1115)) ([c73d322](https://github.com/feathersjs/feathers/commit/c73d322)) - - - -## [1.2.7](https://github.com/feathersjs/feathers/compare/@feathersjs/express@1.2.6...@feathersjs/express@1.2.7) (2018-09-21) - -**Note:** Version bump only for package @feathersjs/express - - - -## [1.2.6](https://github.com/feathersjs/feathers/compare/@feathersjs/express@1.2.5...@feathersjs/express@1.2.6) (2018-09-17) - -**Note:** Version bump only for package @feathersjs/express - - - -## [1.2.5](https://github.com/feathersjs/feathers/compare/@feathersjs/express@1.2.4...@feathersjs/express@1.2.5) (2018-09-02) - -**Note:** Version bump only for package @feathersjs/express - - - -## 1.2.4 - -- Migrate to Monorepo ([feathers#462](https://github.com/feathersjs/feathers/issues/462)) - -## [v1.2.3](https://github.com/feathersjs/express/tree/v1.2.3) (2018-06-03) - -[Full Changelog](https://github.com/feathersjs/express/compare/v1.2.2...v1.2.3) - -**Closed issues:** - -- Question: How to handle JSON:API [\#26](https://github.com/feathersjs/express/issues/26) -- \[Proposal\] Allow multiple express middleware functions to be passed into `app.use` [\#24](https://github.com/feathersjs/express/issues/24) - -**Merged pull requests:** - -- Update uberproto to the latest version [\#28](https://github.com/feathersjs/express/pull/28) ([bertho-zero](https://github.com/bertho-zero)) - -## [v1.2.2](https://github.com/feathersjs/express/tree/v1.2.2) (2018-04-16) - -[Full Changelog](https://github.com/feathersjs/express/compare/v1.2.1...v1.2.2) - -**Merged pull requests:** - -- Allow multiple express middleware functions to be passed into `app.use` [\#25](https://github.com/feathersjs/express/pull/25) ([eXigentCoder](https://github.com/eXigentCoder)) - -## [v1.2.1](https://github.com/feathersjs/express/tree/v1.2.1) (2018-03-29) - -[Full Changelog](https://github.com/feathersjs/express/compare/v1.2.0...v1.2.1) - -**Closed issues:** - -- Error in error hook results in unhandled rejection [\#21](https://github.com/feathersjs/express/issues/21) -- Error handler in wrapper hides breaks and hides real error [\#13](https://github.com/feathersjs/express/issues/13) - -**Merged pull requests:** - -- Allow to set HTTP status code in a hook [\#23](https://github.com/feathersjs/express/pull/23) ([daffl](https://github.com/daffl)) -- Update axios to the latest version 🚀 [\#22](https://github.com/feathersjs/express/pull/22) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.2.0](https://github.com/feathersjs/express/tree/v1.2.0) (2018-02-09) - -[Full Changelog](https://github.com/feathersjs/express/compare/v1.1.2...v1.2.0) - -**Closed issues:** - -- Error in `create` method results in unhandled rejection [\#19](https://github.com/feathersjs/express/issues/19) -- @feathersjs/express call without paramaters could returns an instance of express [\#18](https://github.com/feathersjs/express/issues/18) -- Feathers-express blows up the feathers application version property and the example doesn't work [\#16](https://github.com/feathersjs/express/issues/16) - -**Merged pull requests:** - -- Return an instance of the original Express application when nothing i… [\#20](https://github.com/feathersjs/express/pull/20) ([daffl](https://github.com/daffl)) -- Fix README example [\#17](https://github.com/feathersjs/express/pull/17) ([bertho-zero](https://github.com/bertho-zero)) -- Update mocha to the latest version 🚀 [\#15](https://github.com/feathersjs/express/pull/15) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update semistandard to the latest version 🚀 [\#14](https://github.com/feathersjs/express/pull/14) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.1.2](https://github.com/feathersjs/express/tree/v1.1.2) (2017-11-16) - -[Full Changelog](https://github.com/feathersjs/express/compare/v1.1.1...v1.1.2) - -**Merged pull requests:** - -- Export default and original Express object [\#12](https://github.com/feathersjs/express/pull/12) ([daffl](https://github.com/daffl)) - -## [v1.1.1](https://github.com/feathersjs/express/tree/v1.1.1) (2017-11-06) - -[Full Changelog](https://github.com/feathersjs/express/compare/v1.1.0...v1.1.1) - -**Merged pull requests:** - -- Also add notFound to export [\#11](https://github.com/feathersjs/express/pull/11) ([daffl](https://github.com/daffl)) - -## [v1.1.0](https://github.com/feathersjs/express/tree/v1.1.0) (2017-11-05) - -[Full Changelog](https://github.com/feathersjs/express/compare/v1.0.0...v1.1.0) - -**Merged pull requests:** - -- Re-export Express error handler [\#10](https://github.com/feathersjs/express/pull/10) ([daffl](https://github.com/daffl)) - -## [v1.0.0](https://github.com/feathersjs/express/tree/v1.0.0) (2017-11-01) - -[Full Changelog](https://github.com/feathersjs/express/compare/v1.0.0-pre.4...v1.0.0) - -## [v1.0.0-pre.4](https://github.com/feathersjs/express/tree/v1.0.0-pre.4) (2017-10-25) - -[Full Changelog](https://github.com/feathersjs/express/compare/v1.0.0-pre.3...v1.0.0-pre.4) - -**Merged pull requests:** - -- Update to better returnHook handling [\#9](https://github.com/feathersjs/express/pull/9) ([daffl](https://github.com/daffl)) - -## [v1.0.0-pre.3](https://github.com/feathersjs/express/tree/v1.0.0-pre.3) (2017-10-21) - -[Full Changelog](https://github.com/feathersjs/express/compare/v1.0.0-pre.2...v1.0.0-pre.3) - -**Merged pull requests:** - -- Add REST provider to Express framework bindings [\#8](https://github.com/feathersjs/express/pull/8) ([daffl](https://github.com/daffl)) -- Update repository name and move to npm scope [\#7](https://github.com/feathersjs/express/pull/7) ([daffl](https://github.com/daffl)) -- Update axios to the latest version 🚀 [\#6](https://github.com/feathersjs/express/pull/6) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.0.0-pre.2](https://github.com/feathersjs/express/tree/v1.0.0-pre.2) (2017-10-18) - -[Full Changelog](https://github.com/feathersjs/express/compare/v1.0.0-pre.1...v1.0.0-pre.2) - -**Merged pull requests:** - -- Also export Express top level functionality [\#5](https://github.com/feathersjs/express/pull/5) ([daffl](https://github.com/daffl)) -- Update mocha to the latest version 🚀 [\#4](https://github.com/feathersjs/express/pull/4) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) -- Update debug to the latest version 🚀 [\#2](https://github.com/feathersjs/express/pull/2) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -## [v1.0.0-pre.1](https://github.com/feathersjs/express/tree/v1.0.0-pre.1) (2017-07-19) - -**Merged pull requests:** - -- Update dependencies to enable Greenkeeper 🌴 [\#1](https://github.com/feathersjs/express/pull/1) ([greenkeeper[bot]](https://github.com/apps/greenkeeper)) - -\* _This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)_ diff --git a/packages/express/LICENSE b/packages/express/LICENSE deleted file mode 100644 index 7839c824d7..0000000000 --- a/packages/express/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2024 Feathers Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/express/README.md b/packages/express/README.md deleted file mode 100644 index 9c6a221843..0000000000 --- a/packages/express/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# @feathersjs/express - -[](https://github.com/feathersjs/feathers/actions?query=workflow%3ACI) -[](https://www.npmjs.com/package/@feathersjs/express) -[](https://discord.gg/qa8kez8QBx) - -> Feathers Express framework bindings and REST provider - -## Installation - -``` -npm install @feathersjs/client --save -``` - -## Documentation - -Refer to the [Feathers Express API documentation](https://feathersjs.com/api/express.html) for more details. - -## License - -Copyright (c) 2024 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors) - -Licensed under the [MIT license](LICENSE). diff --git a/packages/express/package.json b/packages/express/package.json deleted file mode 100644 index 656e9119fe..0000000000 --- a/packages/express/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "name": "@feathersjs/express", - "description": "Feathers Express framework bindings and REST provider", - "version": "5.0.34", - "homepage": "https://feathersjs.com", - "main": "lib/", - "types": "lib/", - "keywords": [ - "feathers", - "feathers-plugin" - ], - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/daffl" - }, - "repository": { - "type": "git", - "url": "git://github.com/feathersjs/feathers.git", - "directory": "packages/express" - }, - "author": { - "name": "Feathers contributors", - "email": "hello@feathersjs.com", - "url": "https://feathersjs.com" - }, - "contributors": [], - "bugs": { - "url": "https://github.com/feathersjs/feathers/issues" - }, - "engines": { - "node": ">= 12" - }, - "files": [ - "CHANGELOG.md", - "LICENSE", - "README.md", - "src/**", - "lib/**", - "public/**" - ], - "scripts": { - "prepublish": "npm run compile", - "pack": "npm pack --pack-destination ../generators/test/build", - "compile": "shx rm -rf lib/ && tsc && npm run pack", - "test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts" - }, - "directories": { - "lib": "lib" - }, - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@feathersjs/authentication": "^5.0.34", - "@feathersjs/commons": "^5.0.34", - "@feathersjs/errors": "^5.0.34", - "@feathersjs/feathers": "^5.0.34", - "@feathersjs/transport-commons": "^5.0.34", - "@types/compression": "^1.8.1", - "@types/cors": "^2.8.19", - "@types/express": "^4.17.21", - "@types/express-serve-static-core": "^4.19.5", - "compression": "^1.8.1", - "cors": "^2.8.5", - "express": "^4.21.2" - }, - "devDependencies": { - "@feathersjs/authentication-local": "^5.0.34", - "@feathersjs/tests": "^5.0.34", - "@types/lodash": "^4.17.20", - "@types/mocha": "^10.0.10", - "@types/node": "^24.1.0", - "axios": "^1.11.0", - "lodash": "^4.17.21", - "mocha": "^11.7.1", - "shx": "^0.4.0", - "ts-node": "^10.9.2", - "typescript": "^5.9.2" - }, - "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5" -} diff --git a/packages/express/public/401.html b/packages/express/public/401.html deleted file mode 100644 index aee84d738a..0000000000 --- a/packages/express/public/401.html +++ /dev/null @@ -1,67 +0,0 @@ - - - Not Authorized - - - -- - - diff --git a/packages/express/public/404.html b/packages/express/public/404.html deleted file mode 100644 index c781afec05..0000000000 --- a/packages/express/public/404.html +++ /dev/null @@ -1,66 +0,0 @@ - - -401
-Not Authorized
- - -Page Not Found - - - -- - - diff --git a/packages/express/public/default.html b/packages/express/public/default.html deleted file mode 100644 index 175122a006..0000000000 --- a/packages/express/public/default.html +++ /dev/null @@ -1,66 +0,0 @@ - - -404
-Page Not Found
- -Internal Server Error - - - -- - - diff --git a/packages/express/src/authentication.ts b/packages/express/src/authentication.ts deleted file mode 100644 index 519e7e32e2..0000000000 --- a/packages/express/src/authentication.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { RequestHandler, Request, Response } from 'express' -import { HookContext } from '@feathersjs/feathers' -import { createDebug } from '@feathersjs/commons' -import { authenticate as AuthenticateHook } from '@feathersjs/authentication' - -import { Application } from './declarations' - -const debug = createDebug('@feathersjs/express/authentication') - -const toHandler = ( - func: (req: Request, res: Response, next: () => void) => PromiseOh no!
-Something went wrong
- --): RequestHandler => { - return (req, res, next) => func(req, res, next).catch((error) => next(error)) -} - -export type AuthenticationSettings = { - service?: string - strategies?: string[] -} - -export function parseAuthentication(settings: AuthenticationSettings = {}): RequestHandler { - return toHandler(async (req, res, next) => { - const app = req.app as any as Application - const service = app.defaultAuthentication?.(settings.service) - - if (!service) { - return next() - } - - const config = service.configuration - const authStrategies = settings.strategies || config.parseStrategies || config.authStrategies || [] - - if (authStrategies.length === 0) { - debug('No `authStrategies` or `parseStrategies` found in authentication configuration') - return next() - } - - const authentication = await service.parse(req, res, ...authStrategies) - - if (authentication) { - debug('Parsed authentication from HTTP header', authentication) - req.feathers = { ...req.feathers, authentication } - } - - return next() - }) -} - -export function authenticate( - settings: string | AuthenticationSettings, - ...strategies: string[] -): RequestHandler { - const hook = AuthenticateHook(settings, ...strategies) - - return toHandler(async (req, _res, next) => { - const app = req.app as any as Application - const params = req.feathers - const context = { app, params } as any as HookContext - - await hook(context) - - req.feathers = context.params - - return next() - }) -} diff --git a/packages/express/src/declarations.ts b/packages/express/src/declarations.ts deleted file mode 100644 index d4f7a34afd..0000000000 --- a/packages/express/src/declarations.ts +++ /dev/null @@ -1,68 +0,0 @@ -import http from 'http' -import express, { Express } from 'express' -import { - Application as FeathersApplication, - Params as FeathersParams, - HookContext, - ServiceMethods, - ServiceInterface, - RouteLookup -} from '@feathersjs/feathers' - -interface ExpressUseHandler { - ( - path: L, - ...middlewareOrService: ( - | Express - | express.RequestHandler - | express.RequestHandler[] - | (keyof any extends keyof Services ? ServiceInterface : Services[L]) - )[] - ): T - (path: string | RegExp, ...expressHandlers: express.RequestHandler[]): T - (...expressHandlers: express.RequestHandler[]): T - (handler: Express | express.ErrorRequestHandler): T -} - -export interface ExpressOverrides { - listen(port: number, hostname: string, backlog: number, callback?: () => void): Promise - listen(port: number, hostname: string, callback?: () => void): Promise - listen(port: number | string | any, callback?: () => void): Promise - listen(callback?: () => void): Promise - use: ExpressUseHandler - server?: http.Server -} - -export type Application = Omit & - FeathersApplication & - ExpressOverrides - -declare module '@feathersjs/feathers/lib/declarations' { - interface ServiceOptions { - express?: { - before?: express.RequestHandler[] - after?: express.RequestHandler[] - composed?: express.RequestHandler - } - } -} - -declare module 'express-serve-static-core' { - interface Request { - feathers: Partial & { [key: string]: any } - lookup?: RouteLookup - } - - interface Response { - data?: any - hook?: HookContext - } - - interface IRouterMatcher { - // eslint-disable-next-line - ( - path: PathParams, - ...handlers: (RequestHandler
| Partial
| Application)[] - ): T - } -} diff --git a/packages/express/src/handlers.ts b/packages/express/src/handlers.ts deleted file mode 100644 index 73c162759c..0000000000 --- a/packages/express/src/handlers.ts +++ /dev/null @@ -1,132 +0,0 @@ -import path from 'path' -import { NotFound, GeneralError } from '@feathersjs/errors' -import { Request, Response, NextFunction, ErrorRequestHandler, RequestHandler } from 'express' - -const defaults = { - public: path.resolve(__dirname, '..', 'public'), - logger: console -} -const defaultHtmlError = path.resolve(defaults.public, 'default.html') - -export function notFound({ verbose = false } = {}): RequestHandler { - return function (req: Request, _res: Response, next: NextFunction) { - const url = `${req.url}` - const message = `Page not found${verbose ? ': ' + url : ''}` - - next(new NotFound(message, { url })) - } -} - -export type ErrorHandlerOptions = { - public?: string - logger?: boolean | { error?: (msg: any) => void; info?: (msg: any) => void } - html?: any - json?: any -} - -export function errorHandler(_options: ErrorHandlerOptions = {}): ErrorRequestHandler { - const options = Object.assign({}, defaults, _options) - - if (typeof options.html === 'undefined') { - options.html = { - 401: path.resolve(options.public, '401.html'), - 404: path.resolve(options.public, '404.html'), - default: defaultHtmlError - } - } - - if (typeof options.json === 'undefined') { - options.json = {} - } - - return function (error: any, req: Request, res: Response, next: NextFunction) { - // Set the error code for HTTP processing semantics - error.code = !isNaN(parseInt(error.code, 10)) ? parseInt(error.code, 10) : 500 - - // Log the error if it didn't come from a service method call - if (options.logger && typeof options.logger.error === 'function' && !res.hook) { - if (error.code >= 500) { - options.logger.error(error) - } else { - options.logger.info(error) - } - } - - if (error.type !== 'FeathersError') { - const oldError = error - - error = oldError.errors - ? new GeneralError(oldError.message, { - errors: oldError.errors - }) - : new GeneralError(oldError.message) - - if (oldError.stack) { - error.stack = oldError.stack - } - } - - const formatter: { [key: string]: any } = {} - - // If the developer passed a custom function for ALL html errors - if (typeof options.html === 'function') { - formatter['text/html'] = options.html - } else { - let file = options.html[error.code] - if (!file) { - file = options.html.default || defaultHtmlError - } - // If the developer passed a custom function for individual html errors - if (typeof file === 'function') { - formatter['text/html'] = file - } else { - formatter['text/html'] = function () { - res.set('Content-Type', 'text/html') - res.sendFile(file) - } - } - } - - // If the developer passed a custom function for ALL json errors - if (typeof options.json === 'function') { - formatter['application/json'] = options.json - } else { - const handler = options.json[error.code] || options.json.default - // If the developer passed a custom function for individual json errors - if (typeof handler === 'function') { - formatter['application/json'] = handler - } else { - // Don't show stack trace if it is a 404 error - if (error.code === 404) { - error.stack = null - } - - formatter['application/json'] = function () { - const output = Object.assign({}, error.toJSON()) - - if (process.env.NODE_ENV === 'production') { - delete output.stack - } - - res.set('Content-Type', 'application/json') - res.json(output) - } - } - } - - res.status(error.code) - - const contentType = req.headers['content-type'] || '' - const accepts = req.headers.accept || '' - - // by default just send back json - if (contentType.indexOf('json') !== -1 || accepts.indexOf('json') !== -1) { - formatter['application/json'](error, req, res, next) - } else if (options.html && (contentType.indexOf('html') !== -1 || accepts.indexOf('html') !== -1)) { - formatter['text/html'](error, req, res, next) - } else { - // TODO (EK): Maybe just return plain text - formatter['application/json'](error, req, res, next) - } - } -} diff --git a/packages/express/src/index.ts b/packages/express/src/index.ts deleted file mode 100644 index 675ae253d3..0000000000 --- a/packages/express/src/index.ts +++ /dev/null @@ -1,166 +0,0 @@ -import express, { Express } from 'express' -import { Application as FeathersApplication, defaultServiceMethods } from '@feathersjs/feathers' -import { routing } from '@feathersjs/transport-commons' -import { createDebug } from '@feathersjs/commons' -import cors from 'cors' -import compression from 'compression' - -import { rest, RestOptions, formatter } from './rest' -import { errorHandler, notFound, ErrorHandlerOptions } from './handlers' -import { Application, ExpressOverrides } from './declarations' -import { AuthenticationSettings, authenticate, parseAuthentication } from './authentication' -import { - default as original, - static as serveStatic, - json, - raw, - text, - urlencoded, - query, - Router -} from 'express' - -export { - original, - serveStatic, - serveStatic as static, - json, - raw, - text, - urlencoded, - query, - rest, - Router, - RestOptions, - formatter, - errorHandler, - notFound, - Application, - ErrorHandlerOptions, - ExpressOverrides, - AuthenticationSettings, - parseAuthentication, - authenticate, - cors, - compression -} - -const debug = createDebug('@feathersjs/express') - -export default function feathersExpress ( - feathersApp?: FeathersApplication, - expressApp: Express = express() -): Application{ - if (!feathersApp) { - return expressApp as any - } - - if (typeof feathersApp.setup !== 'function') { - throw new Error('@feathersjs/express requires a valid Feathers application instance') - } - - const app = expressApp as any as Application- const { use: expressUse, listen: expressListen } = expressApp as any - const { use: feathersUse, teardown: feathersTeardown } = feathersApp - - Object.assign(app, { - use(location: string & keyof S, ...rest: any[]) { - let service: any - let options = {} - - const middleware = rest.reduce( - function (middleware, arg) { - if (typeof arg === 'function' || Array.isArray(arg)) { - middleware[service ? 'after' : 'before'].push(arg) - } else if (!service) { - service = arg - } else if (arg.methods || arg.events || arg.express || arg.koa) { - options = arg - } else { - throw new Error('Invalid options passed to app.use') - } - return middleware - }, - { - before: [], - after: [] - } - ) - - const hasMethod = (methods: string[]) => - methods.some((name) => service && typeof service[name] === 'function') - - // Check for service (any object with at least one service method) - if (hasMethod(['handle', 'set']) || !hasMethod(defaultServiceMethods)) { - debug('Passing app.use call to Express app') - return expressUse.call(this, location, ...rest) - } - - debug('Registering service with middleware', middleware) - // Since this is a service, call Feathers `.use` - feathersUse.call(this, location, service, { - express: middleware, - ...options - }) - - return this - }, - - async listen(...args: any[]) { - const server = expressListen.call(this, ...args) - - this.server = server - await this.setup(server) - debug('Feathers application listening') - - return server - } - } as Application) - - const appDescriptors = { - ...Object.getOwnPropertyDescriptors(Object.getPrototypeOf(app)), - ...Object.getOwnPropertyDescriptors(app) - } - const newDescriptors = { - ...Object.getOwnPropertyDescriptors(Object.getPrototypeOf(feathersApp)), - ...Object.getOwnPropertyDescriptors(feathersApp) - } - - // Copy all non-existing properties (including non-enumerables) - // that don't already exist on the Express app - Object.keys(newDescriptors).forEach((prop) => { - const appProp = appDescriptors[prop] - const newProp = newDescriptors[prop] - - if (appProp === undefined && newProp !== undefined) { - Object.defineProperty(expressApp, prop, newProp) - } - }) - - // Assign teardown and setup which will also make sure that hooks are initialized - app.setup = feathersApp.setup as any - app.teardown = async function teardown(server?: any) { - return feathersTeardown.call(this, server).then( - () => - new Promise((resolve, reject) => { - if (this.server) { - this.server.close((e) => (e ? reject(e) : resolve(this))) - } else { - resolve(this) - } - }) - ) - } - - app.configure(routing() as any) - app.use((req, _res, next) => { - req.feathers = { ...req.feathers, provider: 'rest' } - return next() - }) - - return app -} - -if (typeof module !== 'undefined') { - module.exports = Object.assign(feathersExpress, module.exports) -} diff --git a/packages/express/src/rest.ts b/packages/express/src/rest.ts deleted file mode 100644 index 6b4cc1c9d9..0000000000 --- a/packages/express/src/rest.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { Request, Response, RequestHandler, Router } from 'express' -import { MethodNotAllowed } from '@feathersjs/errors' -import { createDebug } from '@feathersjs/commons' -import { http } from '@feathersjs/transport-commons' -import { createContext, defaultServiceMethods, getServiceOptions } from '@feathersjs/feathers' - -import { AuthenticationSettings, parseAuthentication } from './authentication' -import { Application } from './declarations' - -const debug = createDebug('@feathersjs/express/rest') - -const toHandler = ( - func: (req: Request, res: Response, next: () => void) => Promise-): RequestHandler => { - return (req, res, next) => func(req, res, next).catch((error) => next(error)) -} - -const serviceMiddleware = (): RequestHandler => { - return toHandler(async (req, res, next) => { - const { query, headers, path, body: data, method: httpMethod } = req - const methodOverride = req.headers[http.METHOD_HEADER] as string | undefined - - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const { service, params: { __id: id = null, ...route } = {} } = req.lookup! - const method = http.getServiceMethod(httpMethod, id, methodOverride) - const { methods } = getServiceOptions(service) - - debug(`Found service for path ${path}, attempting to run '${method}' service method`) - - if (!methods.includes(method) || defaultServiceMethods.includes(methodOverride)) { - const error = new MethodNotAllowed(`Method \`${method}\` is not supported by this endpoint.`) - res.statusCode = error.code - throw error - } - - const createArguments = http.argumentsFor[method as 'get'] || http.argumentsFor.default - const params = { query, headers, route, ...req.feathers } - const args = createArguments({ id, data, params }) - const contextBase = createContext(service, method, { http: {} }) - res.hook = contextBase - - const context = await (service as any)[method](...args, contextBase) - res.hook = context - - const response = http.getResponse(context) - res.statusCode = response.status - res.set(response.headers) - res.data = response.body - - return next() - }) -} - -const servicesMiddleware = (): RequestHandler => { - return toHandler(async (req, res, next) => { - const app = req.app as any as Application - const lookup = app.lookup(req.path) - - if (!lookup) { - return next() - } - - req.lookup = lookup - - const options = getServiceOptions(lookup.service) - const middleware = options.express.composed - - return middleware(req, res, next) - }) -} - -export const formatter: RequestHandler = (_req, res, next) => { - if (res.data === undefined) { - return next() - } - - res.format({ - 'application/json'() { - res.json(res.data) - } - }) -} - -export type RestOptions = { - formatter?: RequestHandler - authentication?: AuthenticationSettings -} - -export const rest = (options?: RestOptions | RequestHandler) => { - options = typeof options === 'function' ? { formatter: options } : options || {} - - const formatterMiddleware = options.formatter || formatter - const authenticationOptions = options.authentication - - return (app: Application) => { - if (typeof app.route !== 'function') { - throw new Error('@feathersjs/express/rest needs an Express compatible app.') - } - - app.use(parseAuthentication(authenticationOptions)) - app.use(servicesMiddleware()) - - app.mixins.push((_service, _path, options) => { - const { express: { before = [], after = [] } = {} } = options - - const middlewares = [].concat(before, serviceMiddleware(), after, formatterMiddleware) - const middleware = Router().use(middlewares) - - options.express ||= {} - options.express.composed = middleware - }) - } -} diff --git a/packages/express/test/authentication.test.ts b/packages/express/test/authentication.test.ts deleted file mode 100644 index a821c1517a..0000000000 --- a/packages/express/test/authentication.test.ts +++ /dev/null @@ -1,210 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -import omit from 'lodash/omit' -import { strict as assert } from 'assert' -import { default as _axios } from 'axios' -import { feathers } from '@feathersjs/feathers' -import { createApplication } from '@feathersjs/authentication-local/test/fixture' -import { authenticate, AuthenticationResult } from '@feathersjs/authentication' -import * as express from '../src' - -const expressify = express.default -const axios = _axios.create({ - baseURL: 'http://localhost:9876/' -}) - -describe('@feathersjs/express/authentication', () => { - const email = 'expresstest@authentication.com' - const password = 'superexpress' - - let app: express.Application - let user: any - let authResult: AuthenticationResult - - before(async () => { - const expressApp = expressify(feathers()).use(express.json()).configure(express.rest()) - - app = createApplication(expressApp as any) as unknown as express.Application - - await app.listen(9876) - - app.use('/dummy', { - get(id, params) { - return Promise.resolve({ id, params }) - } - }) - - // @ts-ignore - app.use('/protected', express.authenticate('jwt'), (req, res) => { - res.json(req.feathers.user) - }) - - app.use( - express.errorHandler({ - logger: false - }) - ) - - app.service('dummy').hooks({ - before: [authenticate('jwt')] - }) - - const result = await app.service('users').create({ email, password }) - - user = result - - const res = await axios.post ('/authentication', { - strategy: 'local', - password, - email - }) - - authResult = res.data - }) - - after(() => app.teardown()) - - describe('service authentication', () => { - it('successful local authentication', () => { - assert.ok(authResult.accessToken) - assert.deepStrictEqual(omit(authResult.authentication, 'payload'), { - strategy: 'local' - }) - assert.strictEqual(authResult.user.email, email) - assert.strictEqual(authResult.user.password, undefined) - }) - - it('local authentication with wrong password fails', async () => { - try { - await axios.post ('/authentication', { - strategy: 'local', - password: 'wrong', - email - }) - assert.fail('Should never get here') - } catch (error: any) { - const { data } = error.response - assert.strictEqual(data.name, 'NotAuthenticated') - assert.strictEqual(data.message, 'Invalid login') - } - }) - - it('authenticating with JWT works but returns same accessToken', async () => { - const { accessToken } = authResult - const { data } = await axios.post ('/authentication', { - strategy: 'jwt', - accessToken - }) - - assert.strictEqual(data.accessToken, accessToken) - assert.strictEqual(data.authentication.strategy, 'jwt') - assert.strictEqual(data.authentication.payload.sub, user.id.toString()) - assert.strictEqual(data.user.email, email) - }) - - it('can make a protected request with Authorization header', async () => { - const { accessToken } = authResult - - const { - data, - data: { params } - } = await axios.get ('/dummy/dave', { - headers: { - Authorization: accessToken - } - }) - - assert.strictEqual(data.id, 'dave') - assert.deepStrictEqual(params.user, user) - assert.strictEqual(params.authentication.accessToken, accessToken) - }) - - it('errors when there are no authStrategies and parseStrategies', async () => { - const { accessToken } = authResult - app.get('authentication').authStrategies = [] - delete app.get('authentication').parseStrategies - - try { - await axios.get ('/dummy/dave', { - headers: { - Authorization: accessToken - } - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.response.data.name, 'NotAuthenticated') - app.get('authentication').authStrategies = ['jwt', 'local'] - } - }) - - it('can make a protected request with Authorization header and bearer scheme', async () => { - const { accessToken } = authResult - - const { - data, - data: { params } - } = await axios.get ('/dummy/dave', { - headers: { - Authorization: ` Bearer: ${accessToken}` - } - }) - - assert.strictEqual(data.id, 'dave') - assert.deepStrictEqual(params.user, user) - assert.strictEqual(params.authentication.accessToken, accessToken) - }) - }) - - describe('authenticate middleware', () => { - it('errors without valid strategies', () => { - try { - // @ts-ignore - authenticate() - assert.fail('Should never get here') - } catch (error: any) { - assert.strictEqual(error.message, 'The authenticate hook needs at least one allowed strategy') - } - }) - - it('protected endpoint fails when JWT is not present', () => { - return axios - .get ('/protected') - .then(() => { - assert.fail('Should never get here') - }) - .catch((error) => { - const { data } = error.response - - assert.strictEqual(data.name, 'NotAuthenticated') - assert.strictEqual(data.message, 'Not authenticated') - }) - }) - - it.skip('protected endpoint fails with invalid Authorization header', async () => { - try { - await axios.get ('/protected', { - headers: { - Authorization: 'Bearer: something wrong' - } - }) - assert.fail('Should never get here') - } catch (error: any) { - const { data } = error.response - - assert.strictEqual(data.name, 'NotAuthenticated') - assert.strictEqual(data.message, 'Not authenticated') - } - }) - - it('can request protected endpoint with JWT present', async () => { - const { data } = await axios.get ('/protected', { - headers: { - Authorization: `Bearer ${authResult.accessToken}` - } - }) - - assert.strictEqual(data.email, user.email) - assert.strictEqual(data.id, user.id) - assert.strictEqual(data.password, user.password) - }) - }) -}) diff --git a/packages/express/test/error-handler.test.ts b/packages/express/test/error-handler.test.ts deleted file mode 100644 index e12b653d88..0000000000 --- a/packages/express/test/error-handler.test.ts +++ /dev/null @@ -1,399 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function */ -import { strict as assert } from 'assert' -import express, { Request, Response, NextFunction } from 'express' -import axios from 'axios' -import fs from 'fs' -import { join } from 'path' -import { BadRequest, NotAcceptable, NotAuthenticated, NotFound, PaymentError } from '@feathersjs/errors' - -import { errorHandler } from '../src' - -const content = 'Error' - -const htmlHandler = function (_error: Error, _req: Request, res: Response, _next: NextFunction) { - res.send(content) -} - -const jsonHandler = function (error: Error, _req: Request, res: Response, _next: NextFunction) { - res.json(error) -} - -describe('error-handler', () => { - describe('supports catch-all custom handlers', function () { - before(function () { - this.app = express() - .get('/error', function (_req: Request, _res: Response, next: NextFunction) { - next(new Error('Something went wrong')) - }) - .use( - errorHandler({ - html: htmlHandler, - json: jsonHandler - }) - ) - - this.server = this.app.listen(5050) - }) - - after(function (done) { - this.server.close(done) - }) - - describe('JSON handler', () => { - const options = { - url: 'http://localhost:5050/error', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json' - } - } - - it('can send a custom response', async () => { - try { - await axios(options) - assert.fail('Should never get here') - } catch (error: any) { - assert.deepEqual(error.response.data, { - name: 'GeneralError', - message: 'Something went wrong', - code: 500, - className: 'general-error' - }) - } - }) - }) - }) - - describe('supports error-code specific custom handlers', () => { - describe('HTML handler', () => { - const req = { - headers: { 'content-type': 'text/html' } - } - const makeRes = (errCode: number, props?: any) => { - return Object.assign( - { - set() {}, - status(code: number) { - assert.equal(code, errCode) - } - }, - props - ) - } - - it('if the value is a string, calls res.sendFile', (done) => { - const err = new NotAuthenticated() - const middleware = errorHandler({ - logger: null, - html: { 401: 'path/to/401.html' } - }) - const res = makeRes(401, { - sendFile(f: any) { - assert.equal(f, 'path/to/401.html') - done() - } - }) - ;(middleware as any)(err, req, res) - }) - - it('if the value is a function, calls as middleware ', (done) => { - const err = new PaymentError() - const res = makeRes(402) - const middleware = errorHandler({ - logger: null, - html: { - 402: (_err: any, _req: any, _res: any) => { - assert.equal(_err, err) - assert.equal(_req, req) - assert.equal(_res, res) - done() - } - } - }) - ;(middleware as any)(err, req, res) - }) - - it('falls back to default if error code config is available', (done) => { - const err = new NotAcceptable() - const res = makeRes(406) - const middleware = errorHandler({ - logger: null, - html: { - default: (_err: any, _req: any, _res: any) => { - assert.equal(_err, err) - assert.equal(_req, req) - assert.equal(_res, res) - done() - } - } - }) - ;(middleware as any)(err, req, res) - }) - }) - - describe('JSON handler', () => { - const req = { - headers: { 'content-type': 'application/json' } - } - const makeRes = (errCode: number, props?: any) => { - return Object.assign( - { - set() {}, - status(code: number) { - assert.equal(code, errCode) - } - }, - props - ) - } - - it('calls res.json by default', (done) => { - const err = new NotAuthenticated() - const middleware = errorHandler({ - logger: null, - json: {} - }) - const res = makeRes(401, { - json(obj: any) { - assert.deepEqual(obj, err.toJSON()) - done() - } - }) - ;(middleware as any)(err, req, res) - }) - - it('if the value is a function, calls as middleware ', (done) => { - const err = new PaymentError() - const res = makeRes(402) - const middleware = errorHandler({ - logger: null, - json: { - 402: (_err: any, _req: any, _res: any) => { - assert.equal(_err, err) - assert.equal(_req, req) - assert.equal(_res, res) - done() - } - } - }) - ;(middleware as any)(err, req, res) - }) - - it('falls back to default if error code config is available', (done) => { - const err = new NotAcceptable() - const res = makeRes(406) - const middleware = errorHandler({ - logger: null, - json: { - default: (_err: any, _req: any, _res: any) => { - assert.equal(_err, err) - assert.equal(_req, req) - assert.equal(_res, res) - done() - } - } - }) - ;(middleware as any)(err, req, res) - }) - }) - }) - - describe('use as app error handler', function () { - before(function () { - this.app = express() - .get('/error', function (_req: Request, _res: Response, next: NextFunction) { - next(new Error('Something went wrong')) - }) - .get('/string-error', function (_req: Request, _res: Response, next: NextFunction) { - const e: any = new Error('Something was not found') - e.code = '404' - - next(e) - }) - .get('/bad-request', function (_req: Request, _res: Response, next: NextFunction) { - next( - new BadRequest({ - message: 'Invalid Password', - errors: [ - { - path: 'password', - value: null, - message: "'password' cannot be 'null'" - } - ] - }) - ) - }) - .use(function (_req: Request, _res: Response, next: NextFunction) { - next(new NotFound('File not found')) - }) - .use( - errorHandler({ - logger: null - }) - ) - - this.server = this.app.listen(5050) - }) - - after(function (done) { - this.server.close(done) - }) - - describe('converts an non-feathers error', () => { - it('is an instance of GeneralError', async () => { - try { - await axios({ - url: 'http://localhost:5050/error', - responseType: 'json' - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.equal(error.response.status, 500) - assert.deepEqual(error.response.data, { - name: 'GeneralError', - message: 'Something went wrong', - code: 500, - className: 'general-error' - }) - } - }) - }) - - describe('text/html format', () => { - it('serves a 404.html', (done) => { - fs.readFile(join(__dirname, '..', 'public', '404.html'), async function (_err, html) { - try { - await axios({ - url: 'http://localhost:5050/path/to/nowhere', - headers: { - 'Content-Type': 'text/html', - Accept: 'text/html' - } - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.equal(error.response.status, 404) - assert.equal(error.response.data, html.toString()) - done() - } - }) - }) - - it('serves a 500.html', (done) => { - fs.readFile(join(__dirname, '..', 'public', 'default.html'), async function (_err, html) { - try { - await axios({ - url: 'http://localhost:5050/error', - headers: { - 'Content-Type': 'text/html', - Accept: 'text/html' - } - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.equal(error.response.status, 500) - assert.equal(error.response.data, html.toString()) - done() - } - }) - }) - }) - - describe('application/json format', () => { - it('500', async () => { - try { - await axios({ - url: 'http://localhost:5050/error', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json' - } - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.equal(error.response.status, 500) - assert.deepEqual(error.response.data, { - name: 'GeneralError', - message: 'Something went wrong', - code: 500, - className: 'general-error' - }) - } - }) - - it('404', async () => { - try { - await axios({ - url: 'http://localhost:5050/path/to/nowhere', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json' - } - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.equal(error.response.status, 404) - assert.deepEqual(error.response.data, { - name: 'NotFound', - message: 'File not found', - code: 404, - className: 'not-found' - }) - } - }) - - it('400', async () => { - try { - await axios({ - url: 'http://localhost:5050/bad-request', - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json' - } - }) - assert.fail('Should never get here') - } catch (error: any) { - assert.equal(error.response.status, 400) - assert.deepEqual(error.response.data, { - name: 'BadRequest', - message: 'Invalid Password', - code: 400, - className: 'bad-request', - data: {}, - errors: [ - { - path: 'password', - value: null, - message: "'password' cannot be 'null'" - } - ] - }) - } - }) - }) - - it('returns JSON by default', async () => { - try { - await axios('http://localhost:5050/bad-request') - assert.fail('Should never get here') - } catch (error: any) { - assert.equal(error.response.status, 400) - assert.deepEqual(error.response.data, { - name: 'BadRequest', - message: 'Invalid Password', - code: 400, - className: 'bad-request', - data: {}, - errors: [ - { - path: 'password', - value: null, - message: "'password' cannot be 'null'" - } - ] - }) - } - }) - }) -}) diff --git a/packages/express/test/index.test.ts b/packages/express/test/index.test.ts deleted file mode 100644 index b22566f22d..0000000000 --- a/packages/express/test/index.test.ts +++ /dev/null @@ -1,291 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -import { strict as assert } from 'assert' -import express, { Request, Response, NextFunction } from 'express' -import axios from 'axios' -import fs from 'fs' -import path from 'path' -import https from 'https' -import { feathers, HookContext, Id } from '@feathersjs/feathers' - -import { default as feathersExpress, rest, notFound, errorHandler, original, serveStatic } from '../src' -import { RequestListener } from 'http' - -describe('@feathersjs/express', () => { - const service = { - async get(id: Id) { - return { id } - } - } - - it('exports .default, .original .rest, .notFound and .errorHandler', () => { - assert.strictEqual(original, express) - assert.strictEqual(typeof rest, 'function') - assert.ok(notFound) - assert.ok(errorHandler) - }) - - it('returns an Express application, keeps Feathers service and configuration typings typings', () => { - type Config = { - hostname: string - port: number - } - - const app = feathersExpress , Config>(feathers()) - - app.set('hostname', 'test.com') - - const hostname = app.get('hostname') - - assert.strictEqual(hostname, 'test.com') - assert.strictEqual(typeof app, 'function') - }) - - it('allows to use an existing Express instance', () => { - const expressApp = express() - const app = feathersExpress(feathers(), expressApp) - - assert.strictEqual(app, expressApp) - }) - - it('exports `express.rest`', () => { - assert.ok(typeof rest === 'function') - }) - - it('returns a plain express app when no app is provided', () => { - const app = feathersExpress() - - assert.strictEqual(typeof app.use, 'function') - assert.strictEqual(typeof app.service, 'undefined') - assert.strictEqual(typeof app.services, 'undefined') - }) - - it('errors when app with wrong version is provided', () => { - try { - // @ts-ignore - feathersExpress({}) - } catch (e: any) { - assert.strictEqual(e.message, '@feathersjs/express requires a valid Feathers application instance') - } - - try { - const app = feathers() - app.version = '2.9.9' - - feathersExpress(app) - } catch (e: any) { - assert.strictEqual( - e.message, - '@feathersjs/express requires an instance of a Feathers application version 3.x or later (got 2.9.9)' - ) - } - - try { - const app = feathers() - delete app.version - - feathersExpress(app) - } catch (e: any) { - assert.strictEqual( - e.message, - '@feathersjs/express requires an instance of a Feathers application version 3.x or later (got unknown)' - ) - } - }) - - it('Can use Express sub-apps', () => { - const typedApp = feathers >() - const app = feathersExpress(typedApp) - const child = express() - - app.use('/path', child) - assert.strictEqual((child as any).parent, app) - }) - - it('Can use express.static', () => { - const app = feathersExpress(feathers()) - - app.use('/path', serveStatic(__dirname)) - }) - - it('has Feathers functionality', async () => { - const app = feathersExpress(feathers()) - - app.use('/myservice', service) - - app.hooks({ - after: { - get(hook: HookContext) { - hook.result.fromAppHook = true - } - } - }) - - app.service('myservice').hooks({ - after: { - get(hook: HookContext) { - hook.result.fromHook = true - } - } - }) - - const data = await app.service('myservice').get(10) - - assert.deepStrictEqual(data, { - id: 10, - fromHook: true, - fromAppHook: true - }) - }) - - it('can register a service and start an Express server', async () => { - const app = feathersExpress(feathers()) - const response = { - message: 'Hello world' - } - - app.use('/myservice', service) - app.use((_req: Request, res: Response) => res.json(response)) - - const server = await app.listen(8787) - const data = await app.service('myservice').get(10) - - assert.deepStrictEqual(data, { id: 10 }) - - const res = await axios.get ('http://localhost:8787') - assert.deepStrictEqual(res.data, response) - - await new Promise((resolve) => server.close(() => resolve(server))) - }) - - it('.listen calls .setup', async () => { - const app = feathersExpress(feathers()) - let called = false - - app.use('/myservice', { - async get(id: Id) { - return { id } - }, - - async setup(appParam, path) { - assert.strictEqual(appParam, app) - assert.strictEqual(path, 'myservice') - called = true - } - }) - - const server = await app.listen(8787) - - assert.ok(called) - await new Promise((resolve) => server.close(() => resolve(server))) - }) - - it('.teardown closes http server', async () => { - const app = feathersExpress(feathers()) - let called = false - - const server = await app.listen(8787) - server.on('close', () => { - called = true - }) - - await app.teardown() - assert.ok(called) - }) - - it('passes middleware as options', () => { - const feathersApp = feathers() - const app = feathersExpress(feathersApp) - const oldUse = feathersApp.use - const a = (_req: Request, _res: Response, next: NextFunction) => next() - const b = (_req: Request, _res: Response, next: NextFunction) => next() - const c = (_req: Request, _res: Response, next: NextFunction) => next() - const service = { - async get(id: Id) { - return { id } - } - } - - feathersApp.use = function (path, serviceArg, options) { - assert.strictEqual(path, '/myservice') - assert.strictEqual(serviceArg, service) - assert.deepStrictEqual(options.express, { - before: [a, b], - after: [c] - }) - // eslint-disable-next-line prefer-rest-params - return (oldUse as any).apply(this, arguments) - } - - app.use('/myservice', a, b, service, c) - }) - - it('Express wrapped and context.app are the same', async () => { - const app = feathersExpress(feathers()) - - app.use('/test', { - async get(id: Id) { - return { id } - } - }) - - app.service('test').hooks({ - before: { - get: [ - (context) => { - assert.ok(context.app === app) - } - ] - } - }) - - assert.deepStrictEqual(await app.service('test').get('testing'), { - id: 'testing' - }) - }) - - it('Works with HTTPS', (done) => { - const todoService = { - async get(name: Id) { - return { - id: name, - description: `You have to do ${name}!` - } - } - } - - const app = feathersExpress(feathers()).configure(rest()) - - app.use('/secureTodos', todoService) - - const httpsServer = https - .createServer( - { - key: fs.readFileSync(path.join(__dirname, '..', '..', 'tests', 'resources', 'privatekey.pem')), - cert: fs.readFileSync(path.join(__dirname, '..', '..', 'tests', 'resources', 'certificate.pem')), - rejectUnauthorized: false, - requestCert: false - }, - app as unknown as RequestListener - ) - .listen(7889) - - app.setup(httpsServer) - - httpsServer.on('listening', function () { - const instance = axios.create({ - httpsAgent: new https.Agent({ - rejectUnauthorized: false - }) - }) - - instance - .get ('https://localhost:7889/secureTodos/dishes') - .then((response) => { - assert.ok(response.status === 200, 'Got OK status code') - assert.strictEqual(response.data.description, 'You have to do dishes!') - httpsServer.close(() => done()) - }) - .catch(done) - }) - }) -}) diff --git a/packages/express/test/not-found-handler.test.ts b/packages/express/test/not-found-handler.test.ts deleted file mode 100644 index 89db3cf1bd..0000000000 --- a/packages/express/test/not-found-handler.test.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { strict as assert } from 'assert' -import { NotFound } from '@feathersjs/errors' - -import { notFound } from '../src' - -const handler = notFound as any - -describe('not-found-handler', () => { - it('returns NotFound error', (done) => { - handler()( - { - url: 'some/where', - headers: {} - }, - {}, - function (error: any) { - assert.ok(error instanceof NotFound) - assert.equal(error.message, 'Page not found') - assert.deepEqual(error.data, { - url: 'some/where' - }) - done() - } - ) - }) - - it('returns NotFound error with URL when verbose', (done) => { - handler({ verbose: true })( - { - url: 'some/where', - headers: {} - }, - {}, - function (error: any) { - assert.ok(error instanceof NotFound) - assert.equal(error.message, 'Page not found: some/where') - assert.deepEqual(error.data, { - url: 'some/where' - }) - done() - } - ) - }) -}) diff --git a/packages/express/test/rest.test.ts b/packages/express/test/rest.test.ts deleted file mode 100644 index ddc9ff8574..0000000000 --- a/packages/express/test/rest.test.ts +++ /dev/null @@ -1,715 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import { strict as assert } from 'assert' -import axios, { AxiosRequestConfig } from 'axios' - -import { Server } from 'http' -import { Request, Response, NextFunction } from 'express' -import { ApplicationHookMap, feathers, HookContext, Id, Params } from '@feathersjs/feathers' -import { Service, restTests } from '@feathersjs/tests' -import { BadRequest } from '@feathersjs/errors' - -import * as express from '../src' - -const expressify = express.default -const { rest } = express -const errorHandler = express.errorHandler({ - logger: false -}) - -describe('@feathersjs/express/rest provider', () => { - describe('base functionality', () => { - it('throws an error if you did not expressify', () => { - const app = feathers() - - try { - app.configure(rest() as any) - assert.ok(false, 'Should never get here') - } catch (e: any) { - assert.strictEqual(e.message, '@feathersjs/express/rest needs an Express compatible app.') - } - }) - - it('lets you set the handler manually', async () => { - const app = expressify(feathers()) - - app - .configure( - rest(function (_req, res) { - res.format({ - 'text/plain'() { - res.end(`The todo is: ${res.data.description}`) - } - }) - }) - ) - .use('/todo', { - async get(id: Id) { - return { - description: `You have to do ${id}` - } - } - }) - - const server = await app.listen(4776) - - const res = await axios.get ('http://localhost:4776/todo/dishes') - - assert.strictEqual(res.data, 'The todo is: You have to do dishes') - server.close() - }) - - it('lets you set no handler', async () => { - const app = expressify(feathers()) - const data = { fromHandler: true } - - app - .configure(rest(null)) - .use('/todo', { - async get(id: Id) { - return { - description: `You have to do ${id}` - } - } - }) - .use((_req: Request, res: Response) => res.json(data)) - - const server = await app.listen(5775) - const res = await axios.get ('http://localhost:5775/todo-handler/dishes') - - assert.deepStrictEqual(res.data, data) - - server.close() - }) - }) - - describe('CRUD', () => { - let app: express.Application - - before(async () => { - app = expressify(feathers()) - .use(express.cors()) - .use(express.json()) - .configure(rest(express.formatter)) - .use('codes', { - async get(id: Id) { - return { id } - }, - - async create(data: any) { - return data - } - }) - .use('/', new Service()) - .use('todo', new Service()) - - app.hooks({ - setup: [ - async (context, next) => { - assert.ok(context.app) - await next() - } - ], - teardown: [ - async (context, next) => { - assert.ok(context.app) - await next() - } - ] - } as ApplicationHookMap ) - - await app.listen(4777, () => app.use('tasks', new Service())) - }) - - after(() => app.teardown()) - - restTests('Services', 'todo', 4777) - restTests('Root Service', '/', 4777) - restTests('Dynamic Services', 'tasks', 4777) - - describe('res.hook', () => { - const convertHook = (hook: HookContext) => { - const result: any = Object.assign({}, hook.toJSON()) - - delete result.self - delete result.service - delete result.app - delete result.error - - return result - } - - it('sets the actual hook object in res.hook', async () => { - const params = { - route: {}, - query: { test: 'param' }, - provider: 'rest' - } - - app.use( - '/hook', - { - async get(id) { - return { - description: `You have to do ${id}` - } - } - }, - function (_req: Request, res: Response, next: NextFunction) { - res.data = convertHook(res.hook) - - next() - } - ) - - app.service('hook').hooks({ - after(hook: HookContext) { - hook.addedProperty = true - } - }) - - const res = await axios.get ('http://localhost:4777/hook/dishes?test=param') - const paramsWithHeaders = { - ...params, - headers: res.data.params.headers - } - - assert.deepStrictEqual(res.data, { - id: 'dishes', - params: paramsWithHeaders, - arguments: ['dishes', paramsWithHeaders], - type: 'around', - method: 'get', - path: 'hook', - http: {}, - event: null, - result: { description: 'You have to do dishes' }, - addedProperty: true - }) - }) - - it('can use hook.dispatch', async () => { - app.use('/hook-dispatch', { - async get() { - return {} - } - }) - - app.service('hook-dispatch').hooks({ - after(hook: HookContext) { - hook.dispatch = { - id: hook.id, - fromDispatch: true - } - } - }) - - const res = await axios.get ('http://localhost:4777/hook-dispatch/dishes') - assert.deepStrictEqual(res.data, { - id: 'dishes', - fromDispatch: true - }) - }) - - it('allows to set statusCode in a hook', async () => { - app.use('/hook-status', { - async get() { - return {} - } - }) - - app.service('hook-status').hooks({ - after(hook: HookContext) { - hook.http.status = 206 - } - }) - - const res = await axios.get ('http://localhost:4777/hook-status/dishes') - - assert.strictEqual(res.status, 206) - }) - - it('allows to set response headers in a hook', async () => { - app.use('/hook-headers', { - async get() { - return {} - } - }) - - app.service('hook-headers').hooks({ - after(hook: HookContext) { - hook.http.headers = { foo: 'first', bar: ['second', 'third'] } - } - }) - - const res = await axios.get ('http://localhost:4777/hook-headers/dishes') - - assert.strictEqual(res.headers.foo, 'first') - assert.strictEqual(res.headers.bar, 'second, third') - }) - - it('sets the hook object in res.hook on error', async () => { - const params = { - route: {}, - query: {}, - provider: 'rest' - } - - app.use('/hook-error', { - async get() { - throw new Error('I blew up') - } - }) - app.use(function (error: Error, _req: Request, res: Response, _next: NextFunction) { - res.status(500) - res.json({ - hook: convertHook(res.hook), - error: { - message: error.message - } - }) - }) - - try { - await axios('http://localhost:4777/hook-error/dishes') - assert.fail('Should never get here') - } catch (error: any) { - const { data } = error.response - const paramsWithHeaders = { - ...params, - headers: data.hook.params.headers - } - assert.deepStrictEqual(error.response.data, { - hook: { - id: 'dishes', - params: paramsWithHeaders, - arguments: ['dishes', paramsWithHeaders], - type: 'around', - event: null, - method: 'get', - path: 'hook-error', - http: {} - }, - error: { message: 'I blew up' } - }) - } - }) - }) - }) - - describe('middleware', () => { - it('sets service parameters and provider type', async () => { - const service = { - async get(_id: Id, params: Params) { - return params - } - } - - const app = expressify(feathers()) - .use(function (req: Request, _res: Response, next: NextFunction) { - req.feathers.test = 'Happy' - next() - }) - .configure(rest(express.formatter)) - .use('service', service) - const server = await app.listen(4778) - - const res = await axios.get ('http://localhost:4778/service/bla?some=param&another=thing') - const expected = { - headers: res.data.headers, - test: 'Happy', - provider: 'rest', - route: {}, - query: { - some: 'param', - another: 'thing' - } - } - - assert.ok(res.status === 200, 'Got OK status code') - assert.deepStrictEqual(res.data, expected, 'Got params object back') - server.close() - }) - - it('Lets you configure your own middleware before the handler (#40)', async () => { - const data = { - description: 'Do dishes!', - id: 'dishes' - } - const app = expressify(feathers()) - - app - .use(function defaultContentTypeMiddleware(req, _res, next) { - req.headers['content-type'] = req.headers['content-type'] || 'application/json' - next() - }) - .use(express.json()) - .configure(rest(express.formatter)) - .use('/todo', { - async create(data: any) { - return data - } - }) - - const server = await app.listen(4775) - const res = await axios({ - url: 'http://localhost:4775/todo', - method: 'post', - data, - headers: { - 'content-type': '' - } - }) - - assert.deepStrictEqual(res.data, data) - server.close() - }) - - it('allows middleware before and after a service', async () => { - const app = expressify(feathers()) - - app - .use(express.json()) - .configure(rest()) - .use( - '/todo', - function (req, _res, next) { - req.body.before = ['before first'] - next() - }, - function (req, _res, next) { - req.body.before.push('before second') - next() - }, - { - async create(data: any) { - return data - } - }, - function (_req, res, next) { - res.data.after = ['after first'] - next() - }, - function (_req, res, next) { - res.data.after.push('after second') - next() - } - ) - - const server = await app.listen(4776) - const res = await axios.post ('http://localhost:4776/todo', { - text: 'Do dishes' - }) - - assert.deepStrictEqual(res.data, { - text: 'Do dishes', - before: ['before first', 'before second'], - after: ['after first', 'after second'] - }) - - server.close() - }) - - it('allows middleware arrays before and after a service', async () => { - const app = expressify(feathers()) - - app.use(express.json()) - app.configure(rest()) - app.use( - '/todo', - [ - function (req: Request, _res: Response, next: NextFunction) { - req.body.before = ['before first'] - next() - }, - function (req: Request, _res: Response, next: NextFunction) { - req.body.before.push('before second') - next() - } - ], - { - async create(data) { - return data - } - }, - [ - function (_req: Request, res: Response, next: NextFunction) { - res.data.after = ['after first'] - next() - } - ], - function (_req: Request, res: Response, next: NextFunction) { - res.data.after.push('after second') - next() - } - ) - - const server = await app.listen(4776) - const res = await axios.post ('http://localhost:4776/todo', { - text: 'Do dishes' - }) - - assert.deepStrictEqual(res.data, { - text: 'Do dishes', - before: ['before first', 'before second'], - after: ['after first', 'after second'] - }) - server.close() - }) - - it('allows an array of middleware without a service', async () => { - const app = expressify(feathers()) - const middlewareArray = [ - function (_req: Request, res: Response, next: NextFunction) { - res.data = ['first'] - next() - }, - function (_req: Request, res: Response, next: NextFunction) { - res.data.push('second') - next() - }, - function (req: Request, res: Response) { - res.data.push(req.body.text) - res.status(200).json(res.data) - } - ] - app.use(express.json()).configure(rest()).use('/array-middleware', middlewareArray) - - const server = await app.listen(4776) - const res = await axios.post ('http://localhost:4776/array-middleware', { - text: 'Do dishes' - }) - - assert.deepStrictEqual(res.data, ['first', 'second', 'Do dishes']) - server.close() - }) - - it('formatter does nothing when there is no res.data', async () => { - const data = { message: 'It worked' } - const app = expressify(feathers()).use('/test', express.formatter, (_req: Request, res: Response) => - res.json(data) - ) - - const server = await app.listen(7988) - const res = await axios.get ('http://localhost:7988/test') - - assert.deepStrictEqual(res.data, data) - server.close() - }) - }) - - describe('HTTP status codes', () => { - let app: express.Application - let server: Server - - before(async () => { - app = expressify(feathers()) - .configure(rest(express.formatter)) - .use('todo', { - async get(id: Id) { - return { - description: `You have to do ${id}` - } - }, - - async patch() { - throw new Error('Not implemented') - }, - - async find() { - return null - } - }) - - app.use(function (_req, res, next) { - if (typeof res.data !== 'undefined') { - next(new Error('Should never get here')) - } else { - next() - } - }) - - // Error handler - app.use(function (error: Error, _req: Request, res: Response, _next: NextFunction) { - if (res.statusCode < 400) { - res.status(500) - } - - res.json({ message: error.message }) - }) - - server = await app.listen(4780) - }) - - after((done) => server.close(done)) - - it('throws a 405 for undefined service methods (#99)', async () => { - const res = await axios.get ('http://localhost:4780/todo/dishes') - - assert.ok(res.status === 200, 'Got OK status code for .get') - assert.deepStrictEqual( - res.data, - { - description: 'You have to do dishes' - }, - 'Got expected object' - ) - - try { - await axios.post ('http://localhost:4780/todo') - assert.fail('Should never get here') - } catch (error: any) { - assert.ok(error.response.status === 405, 'Got 405 for .create') - assert.deepStrictEqual( - error.response.data, - { - message: 'Method `create` is not supported by this endpoint.' - }, - 'Error serialized as expected' - ) - } - }) - - it('throws a 404 for undefined route', async () => { - try { - await axios.get ('http://localhost:4780/todo/foo/bar') - assert.fail('Should never get here') - } catch (error: any) { - assert.ok(error.response.status === 404, 'Got Not Found code') - } - }) - - it('empty response sets 204 status codes, does not run other middleware (#391)', async () => { - const res = await axios.get ('http://localhost:4780/todo') - - assert.ok(res.status === 204, 'Got empty status code') - }) - }) - - describe('route parameters', () => { - let server: Server - let app: express.Application - - before(async () => { - app = expressify(feathers()) - .configure(rest()) - .use('/:appId/:id/todo', { - async get(id: Id, params: Params) { - if (params.query.error) { - throw new BadRequest('Not good') - } - - return { - id, - route: params.route - } - } - }) - .use(errorHandler) - - server = await app.listen(6880) - }) - - after((done) => server.close(done)) - - it('adds route params as `params.route` and allows id property (#76, #407)', async () => { - const expected = { - id: 'dishes', - route: { - appId: 'theApp', - id: 'myId' - } - } - - const res = await axios.get (`http://localhost:6880/theApp/myId/todo/${expected.id}`) - - assert.ok(res.status === 200, 'Got OK status code') - assert.deepStrictEqual(expected, res.data) - }) - - it('properly serializes error for nested routes (#1096)', async () => { - try { - await axios.get ('http://localhost:6880/theApp/myId/todo/test?error=true') - assert.fail('Should never het here') - } catch (error: any) { - const { response } = error - - assert.strictEqual(response.status, 400) - assert.deepStrictEqual(response.data, { - name: 'BadRequest', - message: 'Not good', - code: 400, - className: 'bad-request' - }) - } - }) - }) - - describe('Custom methods', () => { - let server: Server - let app: express.Application - - before(async () => { - app = expressify(feathers()) - .use(express.json()) - .configure(rest()) - .use('/todo', new Service(), { - methods: ['find', 'customMethod'] - }) - .use(errorHandler) - - server = await app.listen(4781) - }) - - after((done) => server.close(done)) - - it('calls .customMethod with X-Service-Method header', async () => { - const payload = { text: 'Do dishes' } - const res = await axios.post ('http://localhost:4781/todo', payload, { - headers: { - 'X-Service-Method': 'customMethod' - } - }) - - assert.deepEqual(res.data, { - data: payload, - method: 'customMethod', - provider: 'rest' - }) - }) - - it('throws MethodNotImplement for .setup, non option and default methods', async () => { - const options: AxiosRequestConfig = { - method: 'POST', - url: 'http://localhost:4781/todo', - data: { text: 'Do dishes' } - } - const testMethod = (name: string) => { - return assert.rejects( - () => - axios({ - ...options, - headers: { - 'X-Service-Method': name - } - }), - (error: any) => { - assert.deepEqual(error.response.data, { - name: 'MethodNotAllowed', - message: `Method \`${name}\` is not supported by this endpoint.`, - code: 405, - className: 'method-not-allowed' - }) - - return true - } - ) - } - - await testMethod('setup') - await testMethod('internalMethod') - await testMethod('nonExisting') - await testMethod('create') - await testMethod('find') - }) - }) -}) diff --git a/packages/express/tsconfig.json b/packages/express/tsconfig.json deleted file mode 100644 index 316fd41336..0000000000 --- a/packages/express/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig", - "include": [ - "src/**/*.ts" - ], - "compilerOptions": { - "outDir": "lib" - } -} diff --git a/packages/feathers/CHANGELOG.md b/packages/feathers/CHANGELOG.md index b0dbdfbf32..4d3da51d28 100644 --- a/packages/feathers/CHANGELOG.md +++ b/packages/feathers/CHANGELOG.md @@ -3,6 +3,36 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [6.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.2...v6.0.0-pre.3) (2025-10-10) + +### Bug Fixes + +- Fix redirect URI encoding ([#3621](https://github.com/feathersjs/feathers/issues/3621)) ([4dbcce5](https://github.com/feathersjs/feathers/commit/4dbcce598d894846899417cd51820a70b00f22e0)) + +# [6.0.0-pre.2](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.1...v6.0.0-pre.2) (2025-09-04) + +### Bug Fixes + +- Add typesVersions for TypeScript compatibility ([87c181c](https://github.com/feathersjs/feathers/commit/87c181cf8d3bcd4f86d0caad41de83d220077ad8)) + +# [6.0.0-pre.1](https://github.com/feathersjs/feathers/compare/v6.0.0-pre.0...v6.0.0-pre.1) (2025-09-03) + +### Bug Fixes + +- Add compatibility exports ([#3605](https://github.com/feathersjs/feathers/issues/3605)) ([3aed869](https://github.com/feathersjs/feathers/commit/3aed8696ca95fe4a4351c2d7e7f274ab66b50c09)) +- Add registerPublisher method to protected method list ([2c0664a](https://github.com/feathersjs/feathers/commit/2c0664acf97dca3bf7a2efaf3564f04c3de5842e)) + +# [6.0.0-pre.0](https://github.com/feathersjs/feathers/compare/v5.0.34...v6.0.0-pre.0) (2025-08-30) + +### Bug Fixes + +- Make handling of async iterables consistent ([#3602](https://github.com/feathersjs/feathers/issues/3602)) ([a29ea3c](https://github.com/feathersjs/feathers/commit/a29ea3c89bf0fe07f0aec823ef3f3e33941f1aa3)) + +### Features + +- SSE real-time events ([#3601](https://github.com/feathersjs/feathers/issues/3601)) ([fbfb75c](https://github.com/feathersjs/feathers/commit/fbfb75c5a2fde7ff785a71e787e746952b7a47b3)) +- V6 packages refactor ([#3596](https://github.com/feathersjs/feathers/issues/3596)) ([364aab5](https://github.com/feathersjs/feathers/commit/364aab563542fc9d6dd96c1f5f48b146727d7d1e)) + ## [5.0.34](https://github.com/feathersjs/feathers/compare/v5.0.33...v5.0.34) (2025-05-03) ### Bug Fixes diff --git a/packages/feathers/LICENSE b/packages/feathers/LICENSE index 7712f870f3..f9b502c69f 100644 --- a/packages/feathers/LICENSE +++ b/packages/feathers/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2024 Feathers Contributors +Copyright (c) 2025 Feathers Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/packages/feathers/README.md b/packages/feathers/README.md index ecc774770b..0202868535 100644 --- a/packages/feathers/README.md +++ b/packages/feathers/README.md @@ -1,4 +1,4 @@ - +
## The API and real-time application framework @@ -6,9 +6,9 @@ [](https://www.npmjs.com/package/@feathersjs/feathers) [](https://discord.gg/qa8kez8QBx) -Feathers is a lightweight web-framework for creating APIs and real-time applications using TypeScript or JavaScript. +Feathers is a full-stack framework for creating web APIs and real-time applications with TypeScript or JavaScript. -Feathers can interact with any backend technology, supports many databases out of the box and works with any frontend technology like React, VueJS, Angular, React Native, Android or iOS. +Feathers works with Node.js, Deno, Bun, Cloudflare Workers and standalone in the browser and can interact with any backend technology, supports many databases out of the box and works with any frontend like React, VueJS, Angular, React Native, Android or iOS. ## Getting started @@ -26,6 +26,6 @@ To learn more about Feathers visit the website at [feathersjs.com](http://feathe ## License -Copyright (c) 2024 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors) +Copyright (c) 2025 [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors) Licensed under the [MIT license](LICENSE). diff --git a/packages/feathers/fixtures/client.ts b/packages/feathers/fixtures/client.ts new file mode 100644 index 0000000000..daa108184c --- /dev/null +++ b/packages/feathers/fixtures/client.ts @@ -0,0 +1,110 @@ +import { describe, it } from 'vitest' +import { strict as assert } from 'assert' +import { verify } from './fixture' + +export interface Todo { + text: string + complete?: boolean + id?: number +} + +export function clientTests(app: any, name: string) { + const getService = () => (name && typeof app.service === 'function' ? app.service(name) : app) + + describe('Service base tests', () => { + it('.find', async () => { + const todos = await getService().find() + + verify.find(todos) + }) + + it('.get and params passing', async () => { + const query = { + returnquery: 'true', + some: 'thing', + other: ['one', 'two'], + nested: { a: { b: 'object' } } + } + + const todo = await getService().get('0', { query }) + + verify.get('0', todo) + assert.deepStrictEqual(todo.query, query) + }) + + it('.create', async () => { + const data = { + text: 'created todo', + complete: true + } + const todo = await getService().create(data) + + verify.create(data, todo) + }) + + it('.create and created event', async () => { + const data = { text: 'created todo', complete: true } + const createPromise = new Promise((resolve) => { + getService().once('created', (current: Todo) => { + verify.create(data, current) + resolve(data) + }) + }) + + await getService().create(data) + await createPromise + }) + + it('.update and updated event', async () => { + const updateData = { + text: 'updated todo', + complete: true + } + const updatePromise = new Promise((resolve) => { + getService().once('updated', (current: Todo) => { + verify.update('42', updateData, current) + resolve(updateData) + }) + }) + + const todo = await getService().create({ text: 'todo to update', complete: false }) + await getService().update(todo.id, updateData) + await updatePromise + }) + + it('.patch and patched event', async () => { + const patchData = { complete: true, text: 'patched to do' } + const patchPromise = new Promise((resolve) => { + getService().once('patched', (current: Todo) => { + verify.patch('42', patchData, current) + resolve(current) + }) + }) + + const todo = await getService().create({ text: 'todo to patch', complete: false }) + await getService().patch(todo.id, patchData) + await patchPromise + }) + + it('.remove and removed event', async () => { + const todo = await getService().create({ text: 'todo to remove', complete: false }) + const removePromise = new Promise((resolve) => { + getService().once('removed', (current: Todo) => { + verify.remove('42', current) + resolve(current) + }) + }) + + await getService().remove(todo.id) + await removePromise + }) + + it('.get with error', async () => { + const query = { error: true } + + await assert.rejects(() => getService().get(0, { query }), { + message: 'Something for 0 went wrong' + }) + }) + }) +} diff --git a/packages/tests/src/fixture.ts b/packages/feathers/fixtures/fixture.ts similarity index 80% rename from packages/tests/src/fixture.ts rename to packages/feathers/fixtures/fixture.ts index 2e7bbb3fbf..329eb6933c 100644 --- a/packages/tests/src/fixture.ts +++ b/packages/feathers/fixtures/fixture.ts @@ -1,4 +1,5 @@ -import assert from 'assert' +import assert from 'node:assert' +import { NotAcceptable, NotFound } from '../src/errors' const clone = (data: any) => JSON.parse(JSON.stringify(data)) @@ -13,7 +14,7 @@ const findAllData = [ } ] -export class Service { +export class TestService { events = ['log'] async find() { @@ -21,19 +22,37 @@ export class Service { } async get(name: string, params: any) { - if (params.query.error) { + const { query = {}, headers } = params + + if (query.error) { throw new Error(`Something for ${name} went wrong`) } - if (params.query.runtimeError) { + if (query.runtimeError) { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore thingThatDoesNotExist() // eslint-disable-line } + if (name === 'nocontent') { + return null + } + + if (name === 'notfound') { + throw new NotFound('Not found') + } + + if (name === 'notacceptable') { + throw new NotAcceptable('This is a Feathers error', { + testData: true + }) + } + return Promise.resolve({ id: name, - description: `You have to do ${name}!` + description: `You have to do ${name}!`, + ...(query.returnquery ? { query } : {}), + ...(query.returnheaders ? { headers } : {}) }) } diff --git a/packages/feathers/fixtures/index.ts b/packages/feathers/fixtures/index.ts new file mode 100644 index 0000000000..23e06851c0 --- /dev/null +++ b/packages/feathers/fixtures/index.ts @@ -0,0 +1,78 @@ +import { createServerAdapter } from '@whatwg-node/server' +import { createServer } from 'node:http' +import { TestService } from './fixture.js' + +import { feathers, Application, Params } from '../src/index.js' +import { createHandler, SseService } from '../src/http/index.js' + +export * from './client.js' +export * from './rest.js' +export * from './fixture.js' + +export class ResponseTestService { + async find() { + return new Response('Plain text', { + headers: { + 'Content-Type': 'text/plain', + 'X-Custom-Header': 'test' + } + }) + } + + async get(id: string) { + const generator = async function* () { + for (let i = 1; i <= 5; i++) { + yield { message: `Hello ${id} ${i}` } + await new Promise((resolve) => setTimeout(resolve, 50)) + } + } + + return generator() + } + + async options(_params: Params) { + return new Response(null, { + status: 200, + headers: { + 'X-Feathers': 'true', + 'Access-Control-Allow-Origin': 'https://example.com', + 'Access-Control-Allow-Headers': 'Authorization, X-Service-Method' + } + }) + } +} + +export type TestServiceTypes = { + todos: TestService + test: ResponseTestService + sse: SseService +} + +export type TestApplication = Application
+ +export function getApp(): TestApplication { + const app: TestApplication = feathers() + + app.use('todos', new TestService(), { + methods: ['find', 'get', 'create', 'update', 'patch', 'remove', 'customMethod'] + }) + app.use('test', new ResponseTestService()) + app.use('sse', new SseService()) + + return app +} + +export async function createTestServer(port: number, app: TestApplication) { + const handler = createHandler(app) + // You can create your Node server instance by using our adapter + const nodeServer = createServer(createServerAdapter(handler)) + + await new Promise ((resolve) => { + // Then start listening on some port + nodeServer.listen(port, () => resolve()) + }) + + await app.setup(nodeServer) + + return nodeServer +} diff --git a/packages/feathers/fixtures/rest.ts b/packages/feathers/fixtures/rest.ts new file mode 100644 index 0000000000..9e65221bf8 --- /dev/null +++ b/packages/feathers/fixtures/rest.ts @@ -0,0 +1,136 @@ +import { describe, it } from 'vitest' +import assert from 'assert' + +import { verify } from './fixture' + +export function restTests(description: string, name: string, port: number) { + describe(description, () => { + it('GET .find', async () => { + const response = await fetch(`http://localhost:${port}/${name}`) + const data = await response.json() + + assert.ok(response.status === 200, 'Got OK status code') + verify.find(data) + }) + + it('GET .get', async () => { + const response = await fetch(`http://localhost:${port}/${name}/dishes`) + const data = await response.json() + + assert.ok(response.status === 200, 'Got OK status code') + verify.get('dishes', data) + }) + + it('POST .create', async () => { + const original = { + description: 'POST .create' + } + + const response = await fetch(`http://localhost:${port}/${name}`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(original) + }) + const data = await response.json() + + assert.ok(response.status === 201, 'Got CREATED status code') + verify.create(original, data) + }) + + it('PUT .update', async () => { + const original = { + description: 'PUT .update' + } + + const response = await fetch(`http://localhost:${port}/${name}/544`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(original) + }) + const data = await response.json() + + assert.ok(response.status === 200, 'Got OK status code') + verify.update('544', original, data) + }) + + it('PUT .update many', async () => { + const original = { + description: 'PUT .update', + many: true + } + + const response = await fetch(`http://localhost:${port}/${name}`, { + method: 'PUT', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(original) + }) + const data = await response.json() + + assert.ok(response.status === 200, 'Got OK status code') + verify.update(null, original, data) + }) + + it('PATCH .patch', async () => { + const original = { + description: 'PATCH .patch' + } + + const response = await fetch(`http://localhost:${port}/${name}/544`, { + method: 'PATCH', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(original) + }) + const data = await response.json() + + assert.ok(response.status === 200, 'Got OK status code') + verify.patch('544', original, data) + }) + + it('PATCH .patch many', async () => { + const original = { + description: 'PATCH .patch', + many: true + } + + const response = await fetch(`http://localhost:${port}/${name}`, { + method: 'PATCH', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(original) + }) + const data = await response.json() + + assert.ok(response.status === 200, 'Got OK status code') + verify.patch(null, original, data) + }) + + it('DELETE .remove', async () => { + const response = await fetch(`http://localhost:${port}/${name}/233`, { + method: 'DELETE' + }) + const data = await response.json() + + assert.ok(response.status === 200, 'Got OK status code') + verify.remove('233', data) + }) + + it('DELETE .remove many', async () => { + const response = await fetch(`http://localhost:${port}/${name}`, { + method: 'DELETE' + }) + const data = await response.json() + + assert.ok(response.status === 200, 'Got OK status code') + verify.remove(null, data) + }) + }) +} diff --git a/packages/feathers/package.json b/packages/feathers/package.json index 370a290a76..a7995b5c37 100644 --- a/packages/feathers/package.json +++ b/packages/feathers/package.json @@ -1,8 +1,8 @@ { - "name": "@feathersjs/feathers", - "description": "A framework for real-time applications and REST API with JavaScript and TypeScript", - "version": "5.0.34", - "homepage": "http://feathersjs.com", + "name": "feathers", + "description": "The API and real-time application framework", + "version": "6.0.0-pre.3", + "homepage": "https://feathersjs.com", "repository": { "type": "git", "url": "git://github.com/feathersjs/feathers.git", @@ -11,11 +11,40 @@ "keywords": [ "feathers", "REST", - "socket.io", - "realtime" + "realtime", + "framework", + "API" ], - "main": "lib/", - "types": "lib/", + "type": "module", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "exports": { + ".": "./lib/index.js", + "./hooks": "./lib/hooks/index.js", + "./commons": "./lib/commons.js", + "./errors": "./lib/errors.js", + "./client": "./lib/client/index.js", + "./http": "./lib/http/index.js" + }, + "typesVersions": { + "*": { + "errors": [ + "./lib/errors.d.ts" + ], + "hooks": [ + "./lib/hooks/index.d.ts" + ], + "commons": [ + "./lib/commons.d.ts" + ], + "client": [ + "./lib/client/index.d.ts" + ], + "http": [ + "./lib/http/index.d.ts" + ] + } + }, "author": { "name": "Feathers contributors", "email": "hello@feathersjs.com", @@ -37,9 +66,7 @@ "LICENSE", "README.md", "src/**", - "lib/**", - "*.d.ts", - "*.js" + "lib/**" ], "scripts": { "write-version": "node -e \"console.log('export default \\'' + require('./package.json').version + '\\'')\" > src/version.ts", @@ -47,28 +74,28 @@ "prepublish": "npm run compile", "version": "npm run write-version", "publish": "npm run reset-version", - "pack": "npm pack --pack-destination ../generators/test/build", - "compile": "shx rm -rf lib/ && tsc && npm run pack", - "test": "mocha --config ../../.mocharc.json --recursive test/" + "compile": "shx rm -rf lib/ && tsc", + "dev": "vitest", + "test": "vitest run --coverage" }, "engines": { - "node": ">= 12" + "node": ">= 20" }, "publishConfig": { "access": "public" }, "dependencies": { - "@feathersjs/commons": "^5.0.34", - "@feathersjs/hooks": "^0.9.0", - "events": "^3.3.0" + "@types/qs": "^6.14.0", + "events": "^3.3.0", + "qs": "^6.14.0" }, "devDependencies": { - "@types/mocha": "^10.0.10", "@types/node": "^24.1.0", - "mocha": "^11.7.1", + "@vitest/coverage-v8": "^3.2.4", + "@whatwg-node/server": "^0.10.12", "shx": "^0.4.0", - "ts-node": "^10.9.2", - "typescript": "^5.9.2" + "typescript": "^5.8.0", + "vitest": "^3.2.4" }, "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5" } diff --git a/packages/feathers/test/application.test.ts b/packages/feathers/src/application.test.ts similarity index 86% rename from packages/feathers/test/application.test.ts rename to packages/feathers/src/application.test.ts index ea5a937741..337508552c 100644 --- a/packages/feathers/test/application.test.ts +++ b/packages/feathers/src/application.test.ts @@ -1,6 +1,7 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment, @typescript-eslint/no-empty-function */ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import { describe, it } from 'vitest' import assert from 'assert' -import { feathers, Feathers, getServiceOptions, Id, version } from '../src' +import { feathers, Feathers, getServiceOptions, Id, version } from '../src/index.js' describe('Feathers application', () => { it('initializes', () => { @@ -16,16 +17,19 @@ describe('Feathers application', () => { assert.ok(app.version > '5.0.0') }) - it('is an event emitter', (done) => { + it('is an event emitter', async () => { const app = feathers() const original = { hello: 'world' } - app.on('test', (data: any) => { - assert.deepStrictEqual(original, data) - done() + const promise = new Promise ((resolve) => { + app.on('test', (data: any) => { + assert.deepStrictEqual(original, data) + resolve() + }) }) app.emit('test', original) + await promise }) it('uses .defaultService if available', async () => { @@ -55,10 +59,12 @@ describe('Feathers application', () => { }) }) - it('additionally passes `app` as .configure parameter (#558)', (done) => { - feathers().configure(function (app) { - assert.strictEqual(this, app) - done() + it('additionally passes `app` as .configure parameter (#558)', async () => { + await new Promise ((resolve) => { + feathers().configure(function (app) { + assert.strictEqual(this, app) + resolve() + }) }) }) @@ -164,6 +170,15 @@ describe('Feathers application', () => { message: "'teardown' on service 'dummy' is not allowed as a custom method name" } ) + assert.throws( + () => + feathers().use('/dummy', dummyService, { + methods: ['create', 'registerPublisher'] + }), + { + message: "'registerPublisher' on service 'dummy' is not allowed as a custom method name" + } + ) }) it('can register service with no external methods', async () => { @@ -190,7 +205,7 @@ describe('Feathers application', () => { assert.deepStrictEqual(result, { id: 'test' }) }) - it('services can be re-used (#566)', (done) => { + it('services can be re-used (#566)', async () => { const service = { async create(data: any) { return data @@ -199,35 +214,28 @@ describe('Feathers application', () => { const app1 = feathers<{ dummy: typeof service; testing: any }>() const app2 = feathers<{ dummy: typeof service; testing: any }>() - app2.use('dummy', { - async create(data: any) { - return data - } - }) + app1.use('dummy', service) + app2.use('dummy', service) const dummy = app2.service('dummy') dummy.hooks({ before: { create: [ - (hook) => { - hook.data.fromHook = true + async (context: any) => { + context.data.fromHook = true + return context } ] } }) - dummy.on('created', (data: any) => { - assert.deepStrictEqual(data, { - message: 'Hi', - fromHook: true - }) - done() - }) - - app1.use('testing', app2.service('dummy')) + const result = await dummy.create({ message: 'Hello' }) - app1.service('testing').create({ message: 'Hi' }) + assert.deepStrictEqual(result, { + message: 'Hello', + fromHook: true + }) }) it('async hooks run before regular hooks', async () => { @@ -406,7 +414,7 @@ describe('Feathers application', () => { assert.strictEqual(teardownCount, 2) }) - it('registering app.setup but while still pending will be set up', (done) => { + it('registering app.setup but while still pending will be set up', async () => { const app = feathers() app.setup() @@ -416,7 +424,6 @@ describe('Feathers application', () => { assert.ok((app as any)._isSetup) assert.strictEqual(appRef, app) assert.strictEqual(path, 'dummy') - done() } }) }) @@ -507,7 +514,7 @@ describe('Feathers application', () => { }) describe('sub apps', () => { - it('re-registers sub-app services with prefix', (done) => { + it('re-registers sub-app services with prefix', async () => { const app = feathers() const subApp = feathers() @@ -535,34 +542,25 @@ describe('Feathers application', () => { app.use('/api/', subApp) - app.service('/api/service2').once('created', (data: any) => { - assert.deepStrictEqual(data, { - message: 'This is a test' - }) - - subApp.service('service2').once('created', (data: any) => { - assert.deepStrictEqual(data, { - message: 'This is another test' - }) + const result1 = await app.service('/api/service1').get(10) + assert.strictEqual(result1.name, 'service1') - done() - }) + const result2 = await app.service('/api/service2').get(1) + assert.strictEqual(result2.name, 'service2') - app.service('api/service2').create({ - message: 'This is another test' - }) + const result3 = await subApp.service('service2').create({ + message: 'This is a test' + }) + assert.deepStrictEqual(result3, { + message: 'This is a test' }) - ;(async () => { - let data = await app.service('/api/service1').get(10) - assert.strictEqual(data.name, 'service1') - - data = await app.service('/api/service2').get(1) - assert.strictEqual(data.name, 'service2') - await subApp.service('service2').create({ - message: 'This is a test' - }) - })() + const result4 = await app.service('/api/service2').create({ + message: 'This is another test' + }) + assert.deepStrictEqual(result4, { + message: 'This is another test' + }) }) }) }) diff --git a/packages/feathers/src/application.ts b/packages/feathers/src/application.ts index 6abf661b1e..1033284c84 100644 --- a/packages/feathers/src/application.ts +++ b/packages/feathers/src/application.ts @@ -1,11 +1,14 @@ -import version from './version' import { EventEmitter } from 'events' -import { stripSlashes, createDebug } from '@feathersjs/commons' -import { HOOKS, hooks, middleware } from '@feathersjs/hooks' -import { eventHook, eventMixin } from './events' -import { hookMixin } from './hooks' -import { wrapService, getServiceOptions, protectedMethods } from './service' -import { +import { HOOKS, hooks, middleware } from './hooks/index.js' + +import { stripSlashes } from './commons.js' +import { createDebug } from './debug.js' + +import version from './version.js' +import { eventHook, eventMixin } from './events.js' +import { hookMixin } from './hooks.js' +import { wrapService, getServiceOptions, protectedMethods, defaultServiceEvents } from './service.js' +import type { FeathersApplication, ServiceMixin, Service, @@ -14,10 +17,15 @@ import { Application, FeathersService, ApplicationHookOptions -} from './declarations' -import { enableHooks } from './hooks' +} from './declarations.js' +import { enableHooks } from './hooks.js' +import { Router } from './router.js' +import { Channel } from './channel/base.js' +import { CombinedChannel } from './channel/combined.js' +import { channelServiceMixin, Event, Publisher, PUBLISHERS, ALL_EVENTS, CHANNELS } from './channel/mixin.js' const debug = createDebug('@feathersjs/feathers') +const channelDebug = createDebug('@feathersjs/transport-commons/channels') export class Feathers extends EventEmitter @@ -27,10 +35,15 @@ export class Feathers settings: Settings = {} as Settings mixins: ServiceMixin >[] = [hookMixin, eventMixin] version: string = version + routes: Router = new Router() _isSetup = false protected registerHooks: (this: any, allHooks: any) => any + // Channel-related properties + public [CHANNELS]: { [key: string]: Channel } = {} + public [PUBLISHERS]: { [ALL_EVENTS]?: Publisher; [key: string]: Publisher } = {} + constructor() { super() this.registerHooks = enableHooks(this) @@ -39,6 +52,67 @@ export class Feathers }) } + get channels(): string[] { + return Object.keys(this[CHANNELS]) + } + + channel(...names: string[]): Channel { + channelDebug('Returning channels', names) + + if (names.length === 0) { + throw new Error('app.channel needs at least one channel name') + } + + if (names.length === 1) { + const [name] = names + + if (Array.isArray(name)) { + return this.channel(...name) + } + + if (!this[CHANNELS][name]) { + const channel = new Channel() + + channel.once('empty', () => { + channel.removeAllListeners() + delete this[CHANNELS][name] + }) + + this[CHANNELS][name] = channel + } + + return this[CHANNELS][name] + } + + const channels = names.map((name) => this.channel(name)) + + return new CombinedChannel(channels) + } + + publish(event: Event | Publisher, publisher?: Publisher): this { + return this.registerPublisher(event, publisher) + } + + registerPublisher(event: Event | Publisher, publisher?: Publisher): this { + channelDebug('Registering publisher', event) + + if (!publisher && typeof event === 'function') { + publisher = event + event = ALL_EVENTS + } + + const { serviceEvents = defaultServiceEvents } = getServiceOptions(this) || {} + + if (event !== ALL_EVENTS && !serviceEvents.includes(event as string)) { + throw new Error(`'${event.toString()}' is not a valid service event`) + } + + const publishers = this[PUBLISHERS] + publishers[event as string] = publisher! + + return this + } + get (name: L): Settings[L] { return this.settings[name] } @@ -72,6 +146,23 @@ export class Feathers return current as any } + lookup(path: string) { + const result = this.routes.lookup(path) + + if (result === null) { + return null + } + + const { + params: colonParams, + data: { service, params: dataParams } + } = result + + const params = dataParams ? { ...dataParams, ...colonParams } : colonParams + + return { service, params } + } + protected _setup() { this._isSetup = true @@ -165,6 +256,10 @@ export class Feathers const protoService = wrapService(location, service, options as ServiceOptions) const serviceOptions = getServiceOptions(protoService) + const routerParams = { + service: protoService, + params: serviceOptions.routeParams || {} + } for (const name of protectedMethods) { if (serviceOptions.methods.includes(name)) { @@ -177,6 +272,11 @@ export class Feathers // Add all the mixins this.mixins.forEach((fn) => fn.call(this, protoService, location, serviceOptions)) + // Add channel publishing functionality to the service + channelServiceMixin(this as any)(protoService, location, serviceOptions) + + this.routes.insert(path, routerParams) + this.routes.insert(`${path}/:__id`, routerParams) this.services[location] = protoService // If we ran setup already, set this service up explicitly, this will not `await` @@ -200,6 +300,9 @@ export class Feathers delete this.services[path] + this.routes.remove(path) + this.routes.remove(`${path}/:__id`) + return service as any } diff --git a/packages/transport-commons/src/channels/channel/base.ts b/packages/feathers/src/channel/base.ts similarity index 95% rename from packages/transport-commons/src/channels/channel/base.ts rename to packages/feathers/src/channel/base.ts index 4717393880..1c2f2fb4e2 100644 --- a/packages/transport-commons/src/channels/channel/base.ts +++ b/packages/feathers/src/channel/base.ts @@ -1,5 +1,5 @@ import { EventEmitter } from 'events' -import { RealTimeConnection } from '@feathersjs/feathers' +import { RealTimeConnection } from '../declarations.js' export class Channel extends EventEmitter { connections: RealTimeConnection[] diff --git a/packages/transport-commons/test/channels/channel.test.ts b/packages/feathers/src/channel/channel.test.ts similarity index 93% rename from packages/transport-commons/test/channels/channel.test.ts rename to packages/feathers/src/channel/channel.test.ts index 2e9502d9db..4e95d450d6 100644 --- a/packages/transport-commons/test/channels/channel.test.ts +++ b/packages/feathers/src/channel/channel.test.ts @@ -1,17 +1,15 @@ -/* eslint-disable @typescript-eslint/no-empty-function */ +import { describe, it, beforeEach } from 'vitest' import assert from 'assert' -import { feathers, Application, RealTimeConnection } from '@feathersjs/feathers' -import { channels, keys } from '../../src/channels' -import { Channel } from '../../src/channels/channel/base' -import { CombinedChannel } from '../../src/channels/channel/combined' - -const { CHANNELS } = keys +import { feathers, Application, RealTimeConnection } from '../index.js' +import { Channel } from './base.js' +import { CombinedChannel } from './combined.js' +import { CHANNELS } from './mixin.js' describe('app.channel', () => { let app: Application beforeEach(() => { - app = feathers().configure(channels()) + app = feathers() }) describe('base channels', () => { @@ -115,16 +113,20 @@ describe('app.channel', () => { }) }) - it('empty', (done) => { + it('empty', async () => { const channel = app.channel('test') const c1 = { id: 1 } const c2 = { id: 2 } - channel.once('empty', done) + const promise = new Promise ((resolve) => { + channel.once('empty', resolve) + }) channel.join(c1, c2) channel.leave(c1) channel.leave(c2) + + await promise }) it('removes an empty channel', () => { diff --git a/packages/transport-commons/src/channels/channel/combined.ts b/packages/feathers/src/channel/combined.ts similarity index 93% rename from packages/transport-commons/src/channels/channel/combined.ts rename to packages/feathers/src/channel/combined.ts index c6723f61d9..2b6bf0f178 100644 --- a/packages/transport-commons/src/channels/channel/combined.ts +++ b/packages/feathers/src/channel/combined.ts @@ -1,5 +1,5 @@ -import { RealTimeConnection } from '@feathersjs/feathers' -import { Channel } from './base' +import { RealTimeConnection } from '../declarations.js' +import { Channel } from './base.js' function collectConnections(children: Channel[]) { const mappings = new WeakMap () diff --git a/packages/feathers/src/channel/dispatch.test.ts b/packages/feathers/src/channel/dispatch.test.ts new file mode 100644 index 0000000000..ad3b3832a7 --- /dev/null +++ b/packages/feathers/src/channel/dispatch.test.ts @@ -0,0 +1,264 @@ +import { describe, it, beforeEach } from 'vitest' +import assert from 'assert' +import { feathers, Application, HookContext } from '../index.js' +import { Channel } from './base.js' +import { CombinedChannel } from './combined.js' + +class TestService { + events = ['foo'] + + async create(payload: any) { + return payload + } +} + +describe('app.publish', () => { + let app: Application + + beforeEach(() => { + app = feathers() + }) + + it('throws an error if service does not send the event', () => { + try { + app.use('/test', { + create(data: any) { + return Promise.resolve(data) + } + }) + + app.service('test').registerPublisher('created', function () {}) + app.service('test').registerPublisher('bla', function () {}) + assert.ok(false, 'Should never get here') + } catch (e: any) { + assert.strictEqual(e.message, "'bla' is not a valid service event") + } + }) + + describe('registration and `dispatch` event', () => { + const c1 = { id: 1, test: true } + const c2 = { id: 2, test: true } + const data = { message: 'This is a test' } + + beforeEach(() => { + app.use('/test', new TestService()) + }) + + it('error in publisher is handled gracefully (#1707)', async () => { + app.service('test').publish('created', () => { + throw new Error('Something went wrong') + }) + + try { + await app.service('test').create({ message: 'something' }) + } catch (_error: any) { + assert.fail('Should never get here') + } + }) + + it('simple event registration and dispatching', async () => { + app.channel('testing').join(c1) + + app.service('test').registerPublisher('created', () => app.channel('testing')) + + const publishPromise = new Promise ((resolve, reject) => { + app.once('publish', (event: string, channel: Channel, hook: HookContext) => { + try { + assert.strictEqual(event, 'created') + assert.strictEqual(hook.path, 'test') + assert.deepStrictEqual(hook.result, data) + assert.deepStrictEqual(channel.connections, [c1]) + resolve() + } catch (error: any) { + reject(error) + } + }) + }) + + await app.service('test').create(data) + await publishPromise + }) + + it('app and global level dispatching and precedence', async () => { + app.channel('testing').join(c1) + app.channel('other').join(c2) + + app.registerPublisher('created', () => app.channel('testing')) + app.registerPublisher(() => app.channel('other')) + + const publishPromise = new Promise ((resolve) => { + app.once('publish', (_event: string, channel: Channel) => { + assert.ok(channel.connections.indexOf(c1) !== -1) + resolve() + }) + }) + + await app.service('test').create(data) + await publishPromise + }) + + it('promise event dispatching', async () => { + app.channel('testing').join(c1) + app.channel('othertest').join(c2) + + app + .service('test') + .registerPublisher( + 'created', + () => new Promise((resolve) => setTimeout(() => resolve(app.channel('testing')), 50)) + ) + app + .service('test') + .registerPublisher( + 'created', + () => new Promise((resolve) => setTimeout(() => resolve(app.channel('testing', 'othertest')), 100)) + ) + + const publishPromise = new Promise ((resolve) => { + app.once('publish', (_event: string, channel: Channel, hook: HookContext) => { + assert.deepStrictEqual(hook.result, data) + assert.deepStrictEqual(channel.connections, [c1, c2]) + resolve() + }) + }) + + await app.service('test').create(data) + await publishPromise + }) + + it('custom event dispatching', async () => { + const eventData = { testing: true } + + app.channel('testing').join(c1) + app.channel('othertest').join(c2) + + app.service('test').registerPublisher('foo', () => app.channel('testing')) + + const publishPromise = new Promise ((resolve) => { + app.once('publish', (event: string, channel: Channel, hook: HookContext) => { + assert.strictEqual(event, 'foo') + assert.deepStrictEqual(hook, { + app, + path: 'test', + service: app.service('test'), + result: eventData + }) + assert.deepStrictEqual(channel.connections, [c1]) + resolve() + }) + }) + + app.service('test').emit('foo', eventData) + await publishPromise + }) + + it('does not sent `dispatch` event if there are no dispatchers', async () => { + const publishPromise = new Promise ((resolve, reject) => { + app.once('publish', () => reject(new Error('Should never get here'))) + + // Set a timeout to resolve the promise if no publish event occurs + setTimeout(resolve, 100) + }) + + await app.service('test').create(data) + await publishPromise + }) + + it('does not send `dispatch` event if there are no connections', async () => { + app.service('test').registerPublisher('created', () => app.channel('dummy')) + + const publishPromise = new Promise ((resolve, reject) => { + app.once('publish', () => reject(new Error('Should never get here'))) + + // Set a timeout to resolve the promise if no publish event occurs + setTimeout(resolve, 100) + }) + + await app.service('test').create(data) + await publishPromise + }) + + it('dispatcher returning an array of channels', async () => { + app.channel('testing').join(c1) + app.channel('othertest').join(c2) + + app + .service('test') + .registerPublisher('created', () => [app.channel('testing'), app.channel('othertest')]) + + const publishPromise = new Promise ((resolve) => { + app.once('publish', (_event: string, channel: Channel, hook: HookContext) => { + assert.deepStrictEqual(hook.result, data) + assert.deepStrictEqual(channel.connections, [c1, c2]) + resolve() + }) + }) + + await app.service('test').create(data) + await publishPromise + }) + + it('dispatcher can send data', async () => { + const c1data = { channel: 'testing' } + + app.channel('testing').join(c1) + app.channel('othertest').join(c2) + + app + .service('test') + .registerPublisher('created', () => [app.channel('testing').send(c1data), app.channel('othertest')]) + + const publishPromise = new Promise ((resolve) => { + app.once('publish', (_event: string, channel: CombinedChannel, hook: HookContext) => { + assert.deepStrictEqual(hook.result, data) + assert.deepStrictEqual(channel.dataFor(c1), c1data) + assert.ok(channel.dataFor(c2) === null) + assert.deepStrictEqual(channel.connections, [c1, c2]) + resolve() + }) + }) + + await app.service('test').create(data) + await publishPromise + }) + + it('publisher precedence and preventing publishing', async () => { + app.channel('test').join(c1) + + app.registerPublisher(() => app.channel('test')) + app.service('test').registerPublisher('created', (): null => null) + + const publishPromise = new Promise ((resolve, reject) => { + app.once('publish', () => reject(new Error('Should never get here'))) + + // Set a timeout to resolve the promise if no publish event occurs + setTimeout(resolve, 100) + }) + + await app.service('test').create(data) + await publishPromise + }) + + it('data of first channel has precedence', async () => { + const sendData = { test: true } + + app.channel('testing').join(c1) + app.channel('othertest').join(c1) + + app.service('test').registerPublisher('created', () => { + return [app.channel('testing'), app.channel('othertest').send(sendData)] + }) + + const publishPromise = new Promise ((resolve) => { + app.once('publish', (_event: string, channel: CombinedChannel) => { + assert.strictEqual(channel.dataFor(c1), null) + assert.deepStrictEqual(channel.connections, [c1]) + resolve() + }) + }) + + await app.service('test').create(data) + await publishPromise + }) + }) +}) diff --git a/packages/feathers/src/channel/mixin.ts b/packages/feathers/src/channel/mixin.ts new file mode 100644 index 0000000000..24fa383275 --- /dev/null +++ b/packages/feathers/src/channel/mixin.ts @@ -0,0 +1,102 @@ +import { createDebug } from '../debug.js' +import type { ServiceOptions, HookContext, Application } from '../declarations.js' +import { Channel } from './base.js' +import { CombinedChannel } from './combined.js' + +const debug = createDebug('@feathersjs/transport-commons/channels') + +const CHANNELS = Symbol.for('@feathersjs/transport-commons/channels') +const PUBLISHERS = Symbol.for('@feathersjs/transport-commons/publishers') +const ALL_EVENTS = Symbol.for('@feathersjs/transport-commons/all-events') + +function flattenDeep (arr: Array ): T[] { + return arr.reduce((flat: T[], toFlatten: T | T[]) => { + return flat.concat(Array.isArray(toFlatten) ? flattenDeep(toFlatten) : toFlatten) + }, []) +} + +export type Event = string | typeof ALL_EVENTS + +export type Publisher = ( + data: T, + context: HookContext +) => Channel | Channel[] | void | Promise + +export function channelServiceMixin(app: Application) { + return (service: any, path: string, serviceOptions: ServiceOptions) => { + const { serviceEvents } = serviceOptions + + if (typeof service.publish === 'function') { + return + } + + // Add publish methods to service + service[PUBLISHERS] = {} + service.publish = function (event: Event | Publisher, publisher?: Publisher) { + return (service as any).registerPublisher(event, publisher) + } + service.registerPublisher = function (event: Event | Publisher, publisher?: Publisher) { + debug('Registering service publisher', event) + + if (!publisher && typeof event === 'function') { + publisher = event + event = ALL_EVENTS + } + + if (event !== ALL_EVENTS && !serviceEvents!.includes(event as string)) { + throw new Error(`'${event.toString()}' is not a valid service event`) + } + + const publishers = (service as any)[PUBLISHERS] + publishers[event as string] = publisher! + + return service + } + + serviceEvents!.forEach((event: string) => { + service.on(event, (data: unknown, hook: HookContext) => { + if (!hook) { + hook = { path, service, app, result: data } as HookContext + } + + debug('Publishing event', event, hook.path) + + const logError = (error: any) => debug(`Error in '${hook.path} ${event}' publisher`, error) + const servicePublishers = (service as any)[PUBLISHERS] + const appPublishers = (app as any)[PUBLISHERS] + + const publisher = + servicePublishers[event] || + servicePublishers[ALL_EVENTS] || + appPublishers[event] || + appPublishers[ALL_EVENTS] || + (() => {}) + + try { + Promise.resolve(publisher(data, hook)) + .then((result: any) => { + if (!result) { + return + } + + const results = Array.isArray(result) + ? flattenDeep(result).filter(Boolean) + : ([result] as Channel[]) + const channel = new CombinedChannel(results) + + if (channel && channel.length > 0) { + app.emit('publish', event, channel, hook, data) + } else { + debug('No connections to publish to') + } + }) + .catch(logError) + } catch (error: any) { + logError(error) + } + }) + }) + } +} + +export { PUBLISHERS, ALL_EVENTS, CHANNELS } diff --git a/packages/feathers/src/client/fetch.test.ts b/packages/feathers/src/client/fetch.test.ts new file mode 100644 index 0000000000..25008f1363 --- /dev/null +++ b/packages/feathers/src/client/fetch.test.ts @@ -0,0 +1,135 @@ +import { beforeAll, describe, it, expect } from 'vitest' +import { feathers } from '../index.js' +import { clientTests } from '../../fixtures/client.js' +import { NotAcceptable, NotFound, MethodNotAllowed } from '../errors.js' + +import { getApp, createTestServer, TestServiceTypes, verify } from '../../fixtures/index.js' +import { fetchClient } from './index.js' + +describe('fetch REST connector', function () { + const port = 8888 + const baseUrl = `http://localhost:${port}` + const connection = fetchClient(fetch, { baseUrl }) + const app = feathers ().configure(connection) + const service = app.service('todos') + + beforeAll(async () => { + const testApp = getApp() + await createTestServer(port, testApp) + }) + + it('supports custom headers', async () => { + const headers = { + Authorization: 'let-me-in' + } + const todo = await service.get('taxes', { + headers, + query: { returnheaders: true } + }) + + expect(todo.headers?.authorization).toBe('let-me-in') + }) + + it('supports params.connection', async () => { + const connection = { + headers: { + Authorization: 'let-me-in' + } + } + const todo = await service.get('taxes', { + connection, + query: { returnheaders: true } + }) + + expect(todo.headers?.authorization).toBe('let-me-in') + }) + + it('handles errors properly', async () => { + await expect(() => service.get('notfound', {})).rejects.toMatchObject({ + code: 404, + name: 'NotFound', + message: 'Not found' + }) + + await expect(() => service.get('notfound', {})).rejects.toBeInstanceOf(NotFound) + }) + + it('supports nested arrays in queries', async () => { + const query = { test: { $in: ['0', '1', '2'] }, returnquery: 'true' } + const data = await service.get('dishes', { query }) + + expect(data.query).toEqual(query) + }) + + it('can initialize a client instance', async () => { + const init = fetchClient(fetch, { + baseUrl: baseUrl + }) + const todoService = init.service('todos') + + expect(todoService).toBeInstanceOf(init.Service) + + const todos = await todoService.find({}) + + verify.find(todos) + }) + + it('remove many', async () => { + const todo = await service.remove(null) + + expect(todo).toEqual({ id: null }) + }) + + it('converts feathers errors (#50)', async () => { + await expect(() => service.get('notacceptable', {})).rejects.toMatchObject({ + code: 406, + name: 'NotAcceptable', + message: 'This is a Feathers error', + data: { + testData: true + } + }) + + await expect(() => service.get('notacceptable', {})).rejects.toBeInstanceOf(NotAcceptable) + }) + + it('returns null for 204 responses', async () => { + const response = await service.get('nocontent', {}) + expect(response).toBeNull() + }) + + it('works with custom method .customMethod', async () => { + const result = await service.customMethod({ message: 'hi' }, {}) + + expect(result).toEqual({ + data: { message: 'hi' }, + provider: 'rest', + method: 'customMethod' + }) + }) + + it('errors for non existing custom and existing internal method', async () => { + //@ts-expect-error Testing non existent method + await expect(() => service.wrongCustomMethod({})).rejects.toThrow(MethodNotAllowed) + //@ts-expect-error Testing method with parameters + await expect(() => service.internalMethod({})).rejects.toThrow(MethodNotAllowed) + }) + + it('supports async iterable streams', async () => { + const messages: any[] = [] + const stream = await app.service('test').get('test') + + for await (const data of stream) { + messages.push(data) + } + + expect(messages).toHaveLength(5) + expect(messages[0]).toEqual({ message: 'Hello test 1' }) + expect(messages[1]).toEqual({ message: 'Hello test 2' }) + expect(messages[2]).toEqual({ message: 'Hello test 3' }) + expect(messages[3]).toEqual({ message: 'Hello test 4' }) + expect(messages[4]).toEqual({ message: 'Hello test 5' }) + }) + + clientTests(app, 'todos') +}) diff --git a/packages/feathers/src/client/fetch.ts b/packages/feathers/src/client/fetch.ts new file mode 100644 index 0000000000..742ce90810 --- /dev/null +++ b/packages/feathers/src/client/fetch.ts @@ -0,0 +1,301 @@ +import { Params, Id, Query, NullableId } from '../declarations.js' +import { Unavailable, convert, errors } from '../errors.js' +import { _, stripSlashes } from '../commons.js' +import { protectedProperties } from '../service.js' + +function toError(error: Error & { code: string }, status?: number) { + if (error.code === 'ECONNREFUSED') { + return new Unavailable(error.message, _.pick(error, 'address', 'port', 'config')) + } + + return convert(error, status) +} + +export interface FetchClientParams extends Params { + connection?: any +} + +interface FetchClientSettings { + name: string + baseUrl: string + connection: typeof fetch + stringify: (query: Query) => string + events?: string[] +} + +export type RequestOptions = Omit & { url: string; body?: unknown } + +export class FetchClient , P extends Params = FetchClientParams> { + name: string + base: string + connection: typeof fetch + stringify: (query: Query) => string + events?: string[] + + constructor(settings: FetchClientSettings) { + this.name = stripSlashes(settings.name) + this.connection = settings.connection + this.base = `${settings.baseUrl}/${this.name}` + this.stringify = settings.stringify + this.events = settings.events + } + + makeUrl(query: Query, id?: string | number | null, route?: { [key: string]: string }) { + let url = this.base + + if (route) { + Object.keys(route).forEach((key) => { + url = url.replace(`:${key}`, route[key]) + }) + } + + if (typeof id !== 'undefined' && id !== null) { + url += `/${encodeURIComponent(id)}` + } + + return url + this.getQuery(query || {}) + } + + getQuery(query: Query) { + const queryString = this.stringify(query) + + return queryString ? `?${queryString}` : '' + } + + async request(options: RequestOptions, params: FetchClientParams = {}) { + const { url, ...requestInit } = options + const fetchOptions: RequestInit = { + ...requestInit, + ...params.connection + } + + fetchOptions.headers = { + Accept: 'application/json', + ...fetchOptions.headers, + ...params.headers + } + + if (options.body) { + fetchOptions.body = JSON.stringify(options.body) + fetchOptions.headers = { + 'Content-Type': 'application/json', + ...fetchOptions.headers + } + } + + const response = await this.connection(url, fetchOptions) + + await this.checkStatus(response) + + if (response.status === 204) { + return null + } + + if (response.headers.get('content-type') === 'text/event-stream') { + return this.handleEventStream(response) + } + + return response.json() + } + + callCustomMethod(method: string, body: unknown, params: FetchClientParams) { + return this.request( + { + url: this.makeUrl(params?.query, null, params?.route), + method: 'POST', + headers: { + 'X-Service-Method': method + }, + body + }, + params + ) + } + + async *handleEventStream(res: Response) { + const reader = res.body.getReader() + const decoder = new TextDecoder() + + while (true) { + const { value, done } = await reader.read() + + if (done) { + break + } + + if (value) { + const text = decoder.decode(value) + const eventChunks = text.split('\n\n').filter(Boolean) + + for (const chunk of eventChunks) { + const lines = chunk.split('\n') + const dataLine = lines.find((line) => line.startsWith('data: ')) + + if (dataLine) { + yield JSON.parse(dataLine.substring('data: '.length)) + } + } + } + } + } + + async checkStatus(response: Response) { + if (response.ok) { + return response + } + + const ErrorClass = (errors as any)[response.status] || Error + + let error: Error & { response: Response } = new ErrorClass('JSON parsing error') + + try { + const data = await response.json() + + error = await toError(data, response.status) + } catch (_error) {} + + error.response = response + + throw error + } + + _find(params?: P) { + return this.request( + { + url: this.makeUrl(params.query, null, params.route), + method: 'GET', + headers: Object.assign({}, params.headers) + }, + params + ) + } + + find(params?: P) { + return this._find(params) + } + + async _get(id: Id, params?: P) { + if (typeof id === 'undefined') { + throw new Error("id for 'get' can not be undefined") + } + + return this.request( + { + url: this.makeUrl(params.query, id, params.route), + method: 'GET' + }, + params + ) + } + + get(id: Id, params?: P) { + return this._get(id, params) + } + + _create(data: D, params?: P) { + return this.request( + { + url: this.makeUrl(params.query, null, params.route), + body: data, + method: 'POST' + }, + params + ) + } + + create(data: D, params?: P) { + return this._create(data, params) + } + + async _update(id: NullableId, data: D, params?: P) { + if (typeof id === 'undefined') { + throw new Error("id for 'update' can not be undefined, only 'null' when updating multiple entries") + } + + return this.request( + { + url: this.makeUrl(params.query, id, params.route), + body: data, + method: 'PUT' + }, + params + ) + } + + update(id: NullableId, data: D, params?: P) { + return this._update(id, data, params) + } + + async _patch(id: NullableId, data: D, params?: P) { + if (typeof id === 'undefined') { + throw new Error("id for 'patch' can not be undefined, only 'null' when updating multiple entries") + } + + return this.request( + { + url: this.makeUrl(params.query, id, params.route), + body: data, + method: 'PATCH' + }, + params + ) + } + + patch(id: NullableId, data: D, params?: P) { + return this._patch(id, data, params) + } + + async _remove(id: NullableId, params?: P) { + if (typeof id === 'undefined') { + throw new Error("id for 'remove' can not be undefined, only 'null' when removing multiple entries") + } + + return this.request( + { + url: this.makeUrl(params.query, id, params.route), + method: 'DELETE' + }, + params + ) + } + + remove(id: NullableId, params?: P) { + return this._remove(id, params) + } +} + +export class ProxiedFetchClient< + T = any, + D = Partial , + P extends Params = FetchClientParams +> extends FetchClient { + constructor(settings: FetchClientSettings) { + super(settings) + + // Create and return a proxy after construction is complete + const proxy = new Proxy(this, { + get(target, prop, receiver) { + const value = Reflect.get(target, prop, receiver) + if (value !== undefined) { + return value + } + + // Proxy other custom methods + if ( + typeof prop === 'string' && + !prop.startsWith('_') && + !prop.startsWith('Symbol(') && + !protectedProperties.includes(prop) + ) { + return function (data: any, params?: P) { + return target.callCustomMethod(prop, data, params) + } + } + + return undefined + } + }) + + return proxy + } +} diff --git a/packages/feathers/src/client/index.ts b/packages/feathers/src/client/index.ts new file mode 100644 index 0000000000..9f0420cd64 --- /dev/null +++ b/packages/feathers/src/client/index.ts @@ -0,0 +1,44 @@ +import qs from 'qs' +import type { Application, Query } from '../declarations.js' +import { FetchClient, ProxiedFetchClient } from './fetch.js' +import { sseClient, SseClientOptions } from './sse.js' +import { defaultServiceEvents } from '../service.js' + +export * from './fetch.js' +export * from './types.js' +export * from './sse.js' + +export type ClientOptions = { + baseUrl?: string + Service?: typeof FetchClient + stringify?: (query: Query) => string + sse?: string | SseClientOptions +} + +export function fetchClient(connection: typeof fetch, options: ClientOptions = {}) { + const { stringify = qs.stringify, baseUrl = '', Service = ProxiedFetchClient } = options + const events = options.sse ? defaultServiceEvents : undefined + const sseOptions = typeof options.sse === 'string' ? { path: options.sse } : options.sse + const defaultService = function (name: string) { + return new Service({ baseUrl, name, connection, stringify, events }) + } + const initialize = (_app: Application) => { + const app = _app as Application & { rest: typeof fetch } + + if (app.rest !== undefined) { + throw new Error('Only one default client provider can be configured') + } + + app.rest = connection + app.defaultService = defaultService + + if (sseOptions) { + app.configure(sseClient(sseOptions)) + } + } + + initialize.Service = Service + initialize.service = defaultService + + return initialize +} diff --git a/packages/feathers/src/client/sse.test.ts b/packages/feathers/src/client/sse.test.ts new file mode 100644 index 0000000000..db1b3195e4 --- /dev/null +++ b/packages/feathers/src/client/sse.test.ts @@ -0,0 +1,188 @@ +import { beforeAll, afterAll, describe, it, expect } from 'vitest' +import { Application, feathers, Params } from '../index.js' +import { getApp, createTestServer, TestServiceTypes, Todo } from '../../fixtures/index.js' +import { fetchClient, ReconnectingEvent } from './index.js' + +describe('SSE client', function () { + const port = 8890 + const url = `http://localhost:${port}` + + let server: any + let app: Application + let client1: Application + let client2: Application + + beforeAll(async () => { + app = getApp() + app.on('connection', (connection: Params) => { + app.channel('general').join(connection) + + const { channel } = connection.query + + if (channel) { + app.channel(channel).join(connection) + } + }) + app.publish((data: any) => { + if (typeof data.channel !== 'string') { + return app.channel('general') + } else { + return app.channel(data.channel) + } + }) + + server = await createTestServer(port, app) + + client1 = feathers ().configure( + fetchClient(fetch, { + baseUrl: url, + sse: 'sse' + }) + ) + client2 = feathers ().configure( + fetchClient(fetch, { + baseUrl: url, + sse: 'sse' + }) + ) + }) + + afterAll(async () => { + server.close() + }) + + it('should stream basic SSE between clients, can abort sse', async () => { + const events: Todo[] = [] + + client1.service('sse').emit('start') + + const controller = await new Promise ((resolve) => { + client1.service('sse').once('connected', (data: AbortController) => resolve(data)) + }) + + client1.service('todos').on('created', (data: Todo) => { + events.push(data) + }) + + await client2.service('todos').create({ text: 'todo 1', complete: true }) + await Promise.all([ + client2.service('todos').create({ text: 'todo 2', complete: false }), + client2.service('todos').create({ text: 'todo 3', complete: true }), + app.service('todos').create({ text: 'server todo', complete: false }) + ]) + + await new Promise ((resolve) => setTimeout(() => resolve(), 50)) + + controller.abort() + + await client2.service('todos').create({ text: 'todo x', complete: true }) + await new Promise ((resolve) => setTimeout(() => resolve(), 50)) + + expect(events.length).toBe(4) + }) + + it('emits AbortController on successful connection', async () => { + const params = { + query: { message: 'testing' } + } + + client1.service('sse').emit('start', params) + + const controller = await new Promise ((resolve) => { + client1.service('sse').once('connected', (data: AbortController) => resolve(data)) + }) + + controller.abort() + expect(controller.signal.aborted).toBe(true) + }) + + it('only receive events for their channels', async () => { + const events: Todo[] = [] + + client1.service('sse').emit('start', { query: { channel: 'client' } }) + client2.service('sse').emit('start', { query: { channel: 'client' } }) + + await Promise.all([ + new Promise((resolve) => client1.service('sse').once('connected', resolve)), + new Promise((resolve) => client2.service('sse').once('connected', resolve)) + ]) + + client1.service('todos').on('created', (todo: Todo) => events.push(todo)) + client2.service('todos').on('created', (todo: Todo) => events.push(todo)) + + await client2.service('todos').create({ + text: 'todo x', + complete: true, + channel: 'client' + }) + + await new Promise ((resolve) => setTimeout(() => resolve(), 50)) + + expect(events.length).toBe(2) + + await client2.service('todos').create({ + text: 'todo x', + complete: true, + channel: 'notclient' + }) + + await new Promise ((resolve) => setTimeout(() => resolve(), 50)) + + expect(events.length).toBe(2) + }) + + it('initiates reconnection when server is unavailable', async () => { + const reconnectPort = 8946 + let server = await createTestServer(reconnectPort, app) + const reconnectClient = feathers ().configure( + fetchClient(fetch, { + baseUrl: `http://localhost:${reconnectPort}`, + sse: { + path: 'sse', + reconnectionDelay: 50, + reconnectionDelayMax: 500 + } + }) + ) + reconnectClient.service('sse').emit('start') + + await new Promise ((resolve) => { + reconnectClient.service('sse').once('connected', (data: AbortController) => resolve(data)) + }) + + const disconnectEvent = new Promise ((resolve) => { + reconnectClient.service('sse').once('disconnected', (error: Error) => resolve(error)) + }) + const reconnectingEvents = new Promise ((resolve) => { + const retries: ReconnectingEvent[] = [] + + reconnectClient.service('sse').on('reconnecting', (info: ReconnectingEvent) => { + retries.push(info) + if (retries.length === 2) { + resolve(retries) + } + }) + }) + + server.closeAllConnections() + server.close() + + const reconnections = await reconnectingEvents + + expect(reconnections).toHaveLength(2) + expect(reconnections[0]).toHaveProperty('delay') + expect(reconnections[0].attempt).toEqual(1) + expect(reconnections[1].attempt).toEqual(2) + + expect(await disconnectEvent).toBeInstanceOf(Error) + + server = await createTestServer(reconnectPort, app) + + await new Promise ((resolve) => { + reconnectClient.service('sse').once('connected', (data: AbortController) => resolve(data)) + }) + + server.closeAllConnections() + server.close() + }) +}) diff --git a/packages/feathers/src/client/sse.ts b/packages/feathers/src/client/sse.ts new file mode 100644 index 0000000000..d166cd134b --- /dev/null +++ b/packages/feathers/src/client/sse.ts @@ -0,0 +1,101 @@ +import { Application, Params } from '../declarations.js' + +export interface SseClientOptions { + path: string + reconnectionDelay?: number + reconnectionDelayMax?: number +} + +export interface ReconnectingEvent { + delay: number + attempt: number + timeout: number | null +} + +function getDelay(attempt: number, reconnectionDelay: number, reconnectionDelayMax: number, jitter = 0.3) { + const baseDelay = Math.min(reconnectionDelay * Math.pow(2, attempt - 1), reconnectionDelayMax) + const jit = (Math.random() - 0.5) * (jitter * 2) + + return Math.round(baseDelay * (1 + jit)) +} + +export function sseClient(options: SseClientOptions) { + return (client: Application) => { + const { path, reconnectionDelay = 1000, reconnectionDelayMax = 5000 } = options + const sseService = client.service(path) + + let attempt = 0 + let timeout: number | null = null + + const reconnect = (params: Params) => { + if (timeout !== null) { + return + } + + const delay = getDelay(++attempt, reconnectionDelay, reconnectionDelayMax) + + timeout = setTimeout(() => { + timeout = null + connect(params) + }, delay) as unknown as number + sseService.emit('reconnecting', { + delay, + attempt, + timeout: timeout + }) + } + + const connect = (params: Params) => { + const abortController = new AbortController() + const sseParams = { + ...params, + connection: { + ...params.connection, + signal: abortController.signal + } + } + + // Do not await the request since the promise won't resolve until an event happens + sseService + .find(sseParams) + .then(async (stream) => { + try { + attempt = 0 + + for await (const payload of stream) { + if (abortController.signal.aborted) { + break + } + + try { + if (payload.path === options.path && payload.event === 'connected') { + sseService.emit('connected', abortController) + } else { + client.service(payload.path).emit(payload.event, payload.data) + } + } catch (error) { + sseService.emit('error', error) + } + } + } catch (error: unknown) { + if ((error as Error).name !== 'AbortError') { + throw error + } + } + }) + .catch((error) => { + abortController.abort() + sseService.emit('disconnected', error) + + if ((error as Error).name !== 'AbortError') { + timeout = null + reconnect(params) + } + }) + } + + sseService.on('start', (params: Params = {}) => { + connect(params) + }) + } +} diff --git a/packages/feathers/src/client/types.ts b/packages/feathers/src/client/types.ts new file mode 100644 index 0000000000..3e1602a4f0 --- /dev/null +++ b/packages/feathers/src/client/types.ts @@ -0,0 +1,39 @@ +// Utility type to pick only the `query` property from Params if it exists +type QueryParams = T extends { query?: infer Q } ? { query?: Q } : never + +// Infer the types of `id`, `data`, and `params` for a given method signature +type MethodParams = T extends (...args: any[]) => any + ? Parameters extends [infer I, infer D, infer P] + ? [I, D, Omit & QueryParams ] | [I, D] + : Parameters
extends [infer I, infer P] + ? [I, Omit & QueryParams ] | [I] + : Parameters
extends [infer P] + ? [Omit & QueryParams ] | [] + : never + : never + +// Infer the return type of a given method +type MethodReturnType
= T extends (...args: any[]) => infer R ? R : any + +// Define a type that represents the methods and their inferred types +export type PublicServiceMethods = { + [K in keyof S]: S[K] extends (...args: any[]) => Promise+ ? (...args: MethodParams ) => MethodReturnType+ : never +} + +type ConditionalPick= { + [Key in keyof Base]: Key extends Condition ? Base[Key] : never +} + +type NonNeverKeys = { + [Key in keyof T]: T[Key] extends never ? never : Key +}[keyof T] + +type ConditionalPublicMethods = Pick >> + +type DefaultMethodNames = 'create' | 'find' | 'get' | 'update' | 'remove' | 'patch' + +export type ClientServices = { + [K in keyof ST]: ConditionalPublicMethods , DefaultMethodNames> +} diff --git a/packages/commons/test/utils.test.ts b/packages/feathers/src/commons.test.ts similarity index 98% rename from packages/commons/test/utils.test.ts rename to packages/feathers/src/commons.test.ts index 53d51978ab..424d82f08b 100644 --- a/packages/commons/test/utils.test.ts +++ b/packages/feathers/src/commons.test.ts @@ -1,8 +1,9 @@ /* tslint:disable:no-unused-expression */ +import { describe, it } from 'vitest' import { strict as assert } from 'assert' -import { _, stripSlashes, isPromise, createSymbol } from '../src' +import { _, stripSlashes, isPromise, createSymbol } from '../src/commons.js' -describe('@feathersjs/commons utils', () => { +describe('feathers/commons utils', () => { it('stripSlashes', () => { assert.equal(stripSlashes('some/thing'), 'some/thing') assert.equal(stripSlashes('/some/thing'), 'some/thing') diff --git a/packages/commons/src/index.ts b/packages/feathers/src/commons.ts similarity index 98% rename from packages/commons/src/index.ts rename to packages/feathers/src/commons.ts index 9455252384..a6d06cbdaf 100644 --- a/packages/commons/src/index.ts +++ b/packages/feathers/src/commons.ts @@ -99,4 +99,4 @@ export function createSymbol(name: string) { return typeof Symbol !== 'undefined' ? Symbol.for(name) : name } -export * from './debug' +export * from './debug.js' diff --git a/packages/commons/test/debug.test.ts b/packages/feathers/src/debug.test.ts similarity index 87% rename from packages/commons/test/debug.test.ts rename to packages/feathers/src/debug.test.ts index 2089af9b0c..8e0da19a52 100644 --- a/packages/commons/test/debug.test.ts +++ b/packages/feathers/src/debug.test.ts @@ -1,5 +1,6 @@ +import { describe, it } from 'vitest' import { strict as assert } from 'assert' -import { createDebug, setDebug, noopDebug } from '../src' +import { createDebug, setDebug, noopDebug } from '../src/debug.js' const myDebug = createDebug('hello test') diff --git a/packages/commons/src/debug.ts b/packages/feathers/src/debug.ts similarity index 91% rename from packages/commons/src/debug.ts rename to packages/feathers/src/debug.ts index 5c15e62cf7..1922c03ee4 100644 --- a/packages/commons/src/debug.ts +++ b/packages/feathers/src/debug.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-empty-function */ export type DebugFunction = (...args: any[]) => void export type DebugInitializer = (name: string) => DebugFunction diff --git a/packages/feathers/test/declarations.test.ts b/packages/feathers/src/declarations.test.ts similarity index 94% rename from packages/feathers/test/declarations.test.ts rename to packages/feathers/src/declarations.test.ts index 1ee2389dc7..e917249847 100644 --- a/packages/feathers/test/declarations.test.ts +++ b/packages/feathers/src/declarations.test.ts @@ -1,6 +1,7 @@ +import { describe, it } from 'vitest' import assert from 'assert' -import { hooks } from '@feathersjs/hooks' -import { feathers, ServiceInterface, Application, HookContext, NextFunction } from '../src' +import { hooks } from '../src/hooks/index.js' +import { feathers, ServiceInterface, Application, HookContext, NextFunction } from '../src/index.js' interface Todo { id: number diff --git a/packages/feathers/src/declarations.ts b/packages/feathers/src/declarations.ts index aece46eebd..1d09404a45 100644 --- a/packages/feathers/src/declarations.ts +++ b/packages/feathers/src/declarations.ts @@ -1,5 +1,6 @@ import { EventEmitter } from 'events' -import { NextFunction, HookContext as BaseHookContext } from '@feathersjs/hooks' +import type { Router } from './router.js' +import { NextFunction, HookContext as BaseHookContext } from './hooks/index.js' type SelfOrArray = S | S[] type OptionalPick= Pick > @@ -138,6 +139,12 @@ export type ServiceInterface< export interface ServiceAddons extends EventEmitter { id?: string hooks(options: HookOptions): this + + publish(publisher: Publisher , A, this>): this + publish(event: Event, publisher: Publisher , A, this>): this + + registerPublisher(publisher: Publisher , A, this>): this + registerPublisher(event: Event, publisher: Publisher , A, this>): this } export interface ServiceHookOverloads