Skip to content

Releases: flex-development/mango

v5.1.0

28 May 03:25
Compare
Choose a tag to compare

✨ Features

  • interfaces: IAbstractMangoFinderBase (073401f)
  • interfaces: IAbstractMangoRepositoryBase (9b976a6)

v5.0.0

28 May 01:18
Compare
Choose a tag to compare

⚠ BREAKING CHANGES

  • dtos: integrate DTOFilter

✨ Features

♻️ Code Improvements

  • dtos: integrate DTOFilter (ec86961)

🔨 Build

  • use @flex-development/tutils@3.1.0 (fde654a)

v4.0.1

27 May 18:36
Compare
Choose a tag to compare

🐛 Fixes

  • interfaces: IMangoRepositoryAsync#delete (06c4a50)

♻️ Code Improvements

  • repo: allow optional dto arguments (2819d1d)

📖 Documentation

  • repo: update description in README (a46200c)

v4.0.0

27 May 05:26
Compare
Choose a tag to compare

⚠ BREAKING CHANGES

  • repo: MangoRepository extends AbstractMangoRepository
  • mango: rename *.resetCache methods to *.setCache

🐛 Fixes

  • type instantiation is excessively deep and possibly infinite (b3f4ea6)

💅 Formatting & Structure

  • mango: rename *.resetCache methods to *.setCache (68bb0fb)
  • repo: use F in generics to represent field paths of dto (ea6708a)

📖 Documentation

  • mango: fix use of @throws {Exception} (6bcab30)
  • mango: sorting rules (de2707c)
  • validator: update code sample in README (04de572)

♻️ Code Improvements

  • repo: MangoRepository extends AbstractMangoRepository (2367918)
  • validator: use ObjectUnknown as default E in generic (92f5c57)

✨ Features

  • abstracts: add AbstractMangoFinder (fbb8c4b)
  • abstracts: add AbstractMangoRepository (7ac2164)
  • finder: add AbstractMangoFinder#uid (e0d9dc1)
  • interfaces: add IAbstractMangoRepository (48a6111)
  • interfaces: add IMangoRepositoryAsync (8df94de)
  • plugins: add MangoFinderAsync (b2c51df)
  • repositories: MangoRepositoryAsync (e4def6a)

v3.1.1

25 May 06:28
Compare
Choose a tag to compare

🐛 Fixes

  • dtos: EntityDTO definition (30b379d)

v3.1.0

25 May 05:35
Compare
Choose a tag to compare

🔨 Build

v3.0.0

24 May 01:08
Compare
Choose a tag to compare

⚠ BREAKING CHANGES

  • plugins: MangoFinder - rename MangoFinderPlugin* definitions to MangoFinder*

✨ Features

  • mango: allow async extensions (e74cfbb)
  • mango: synchronous validator api (6731ef8)

💅 Formatting & Structure

  • plugins: MangoFinder - rename MangoFinderPlugin* definitions to MangoFinder* (0e99498)

✏️ Housekeeping

  • update github release script logic (bd57029)
  • use github release script from ts-pkg template (5623d5f)

📖 Documentation

  • mango: update code samples (af9d632)
  • release: getting started, mango finder, mango repo (10c98dd)

v2.0.0

23 May 08:00
Compare
Choose a tag to compare

⚠ BREAKING CHANGES

  • repo: add MangoRepository
  • repo: dtos, interfaces, types

🔨 Build

  • deps: install repo api dependencies (0c73e11)

✨ Features

  • decorators: custom decorators (32c3d47)
  • mixins: add MangoValidator (25a5df1)
  • repo: add MangoRepository (00bf295)
  • repo: dtos, interfaces, types (1d0c286)

v1.0.0 (🎂 First Release)

22 May 04:59
Compare
Choose a tag to compare

Overview

Plugin for mingo and qs-to-mongo.

The Mango plugin allows users to run aggregation pipelines and execute searches against in-memory object collections. Query documents using a URL query, or search for them using a query criteria and options object.

Plugin documentation can be viewed here.

/**
 * `Mango` plugin interface.
 *
 * - https://github.com/kofrasa/mingo
 * - https://github.com/fox1t/qs-to-mongo
 *
 * @template D - Document (collection object)
 * @template U - Name of document uid field
 * @template P - Search parameters (query criteria and options)
 * @template Q - Parsed URL query object
 */
export interface IMango<
  D extends PlainObject = PlainObject,
  U extends keyof D = '_id',
  P extends MangoSearchParams<D> = MangoSearchParams<D>,
  Q extends MangoParsedUrlQuery<D> = MangoParsedUrlQuery<D>
> {
  readonly cache: Readonly<MangoCache<D>>
  readonly logger: Debugger
  readonly mingo: typeof mingo
  readonly mparser: IMangoParser<D>
  readonly options: MangoOptions<D, U>

  aggregate(
    pipeline?: OneOrMany<AggregationStages<D>>
  ): AggregationPipelineResult<D>
  find(params?: P): DocumentPartial<D, U>[]
  findByIds(uids?: NumberString[], params?: P): DocumentPartial<D, U>[]
  findOne(uid: NumberString, params?: P): DocumentPartial<D, U> | null
  findOneOrFail(uid: NumberString, params?: P): DocumentPartial<D, U>
  query(query?: Q | string): DocumentPartial<D, U>[]
  queryByIds(uids?: NumberString[], query?: Q | string): DocumentPartial<D, U>[]
  queryOne(uid: NumberString, query?: Q | string): DocumentPartial<D, U> | null
  queryOneOrFail(uid: NumberString, query?: Q | string): DocumentPartial<D, U>
  resetCache(collection?: D[]): MangoCache<D>
}

What's changed?

Everything! It's the first version.

Features

  • Run aggregation pipelines
  • Perform searches (with query criteria and URL queries)
  • Parse and convert URL query objects and strings