Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@loopback/model-api-builder

Package Overview
Dependencies
Maintainers
11
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loopback/model-api-builder

Types and helpers for packages contributing Model API builders.

  • 3.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21K
increased by77.87%
Maintainers
11
Weekly downloads
 
Created
Source

@loopback/model-api-builder

Types and helpers for packages contributing Model API builders.

Overview

The @loopback/model-api-builder package provides a contract for extensions that contribute builders for repositories and controllers. Users provide both the model class and an extension. The extension is then used to build their repository and controller based on the model class.

Installation

npm install --save @loopback/model-api-builder

Basic use

An extension that contributes the repository and controller builders can be made by implementing ModelApiBuilder:

import {
  asModelApiBuilder,
  ModelApiBuilder,
  ModelApiConfig,
} from '@loopback/model-api-builder';

@injectable(asModelApiBuilder)
export class SampleApiBuilder implements ModelApiBuilder {
  readonly pattern: string = 'Sample';

  build(
    application: ApplicationWithRepositories,
    modelClass: typeof Model & {prototype: Model},
    config: ModelApiConfig,
  ): Promise<void> {
    // define repository setup here
    // ...
    // define controller setup here
    // ...
  }
}

Contributions

  • Guidelines
  • Join the team

Contributors

See all contributors.

License

MIT

FAQs

Package last updated on 29 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc