How to use the @loopback/core.extensions function in @loopback/core

To help you get started, we’ve selected a few @loopback/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github strongloop / loopback-next / packages / boot / src / booters / model-api.booter.ts View on Github external
constructor(
    @inject(CoreBindings.APPLICATION_INSTANCE)
    public app: ApplicationWithRepositories,
    @inject(BootBindings.PROJECT_ROOT) projectRoot: string,
    @extensions()
    public getModelApiBuilders: Getter,
    @config()
    public booterConfig: ArtifactOptions = {},
  ) {
    // TODO assert that `app` has RepositoryMixin members

    super(
      projectRoot,
      // Set booter options if passed in via bootConfig
      Object.assign({}, RestDefaults, booterConfig),
    );
  }
github strongloop / loopback-next / examples / greeter-extension / src / greeting-service.ts View on Github external
constructor(
    /**
     * Inject a getter function to fetch greeters (bindings tagged with
     * `{[CoreTags.EXTENSION_POINT]: GREETER_EXTENSION_POINT_NAME}`)
     */
    @extensions()
    private getGreeters: Getter,
    /**
     * An extension point should be able to receive its options via dependency
     * injection.
     */
    @config() // Sugar for @inject('services.GreetingService.options', {optional: true})
    public readonly options?: GreetingServiceOptions,
  ) {}
github strongloop / loopback-next / extensions / logging / src / winston.ts View on Github external
constructor(
    /**
     * Getter for transports
     */
    @extensions(WINSTON_TRANSPORT)
    private transports: Getter,
    /**
     * Getter for formats
     */
    @extensions(WINSTON_FORMAT)
    private formats: Getter,
    /**
     * Configuration for the logger
     */
    @config() private options: LoggerOptions = {},
  ) {}
github strongloop / loopback-next / packages / authentication / src / providers / auth-strategy.provider.ts View on Github external
constructor(
    @extensions()
    protected authenticationStrategies: Getter,
    @inject(AuthenticationBindings.METADATA)
    protected metadata?: AuthenticationMetadata,
  ) {}
  async value(): Promise {
github strongloop / loopback-next / extensions / logging / src / winston.ts View on Github external
constructor(
    /**
     * Getter for transports
     */
    @extensions(WINSTON_TRANSPORT)
    private transports: Getter,
    /**
     * Getter for formats
     */
    @extensions(WINSTON_FORMAT)
    private formats: Getter,
    /**
     * Configuration for the logger
     */
    @config() private options: LoggerOptions = {},
  ) {}