1.0.0 • Published 2 years ago

@rugo-vn/common v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Rugo Common

Shareable constants, functions, classes, etc between Rugo packages.

Note: Cannot be used in Rugo Pipeline.

Constants

  • DEFAULT_LIMIT

Functions

  • generateId
  • wrapComposer
const composer = {
  argsParser => (...validateArgs) => (...targetArgs) => { return finalArgs; },
  returnParser => result => (...targetArgs) => { return finalResult; }
}

Objects

EmptyCollection

const EmptyCollection = {
  id(){ },
  create(){ },
  get(){ },
  count(){ },
  list(){ },
  patch(){ },
  remove(){ }
}

BaseCollection

const BaseCollection = {
  id(){ },
  create(data){ },
  get(data, id){ },
  count(data, query),,
  list(data, query, controls){ },
  patch(data, query, controls){ }i,
  remove(data, query){ }
}

BasePlugin

const BasePlugin = {
  name: 'name-of-plugin',
  depends: ['register-1', 'register-2', 'register-3'],
  priority: 1,
  async start(context){ },
  async close(context){ }
}

Composers

  • BaseComposer
  • KoaComposer

API

Visit API documentation.

License

MIT