New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@logion/rest-api-core

Package Overview
Dependencies
Maintainers
0
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@logion/rest-api-core

latest
Source
npmnpm
Version
0.6.0
Version published
Weekly downloads
3
-89.29%
Maintainers
0
Weekly downloads
 
Created
Source

logion-rest-api-core

This library provides the core functionlities that all logion REST-based off-chain services have in common:

  • The Authentication controller exposing the REST resources for authentication
  • A service maintaining a singleton connection to a logion node
  • OpenAPI helpers
  • TypeORM helpers
  • Dinoloop helpers
  • Inversify helpers
  • Test helpers
  • Various utilities

Usage

Configuring OpenAPI

Below call adds the authentication-related elements to an OpenAPI V3 document.

const spec: OpenAPIV3.Document = ...;
configureOpenApi(spec);

Configure Dinoloop

Below call registers the authentication controller as well as the default application error controller and a JSON response middleware.

const dino: Dino = ...;
configureDinoloop(dino);

Configure Inversify

Below call binds all provided services in the container.

const container: Container = ...;
configureContainer(container);

TypeORM

Simply import the app's data source:

import { appDataSource } from "@logion/rest-api-core";

The returned data source is configured using ormconfig.json file and TYPEORM_* environment variables. This is essentially a re-implementation of the way TypeORM used to be configured before the introduction of the multiple data source feature.

The returned data source is ready to be used with a transaction context. DefaultTransactional method decorator can be used to set a transaction context with default settings. typeorm-transactional's Transactional decorator may also be used safely.

Keywords

logion

FAQs

Package last updated on 08 Jul 2024

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