Namespace ApiUtils

This module is a collection of types and utilities representing a highly experimental API definition system. This can potentially be very powerful, as the goal of it is to allow you to define your entire API - from endpoints to authorization to validation to response - in a single place. This is a work in progress, and is probably not ready for production yet, but feel free to play around with it and see what you think. (It should be safe-enough - I'm just not sure the opinions expressed in this module are optimal yet.)

IMPORTANT: It makes the following assumptions:

  1. You've used some system to authenticate the request and attach Auth.ReqInfo to the request object. You can stub this out in development, but you'd typically do this by attaching a bearer token to the request with this information encoded in it and then authenticating and decoding the token. (See https://github.com/wymp/ts-auth-gateway and https://github.com/wymp/ts-auth-gateway-header-decoder)
  2. You're happy with my standardized API response formats and pagination ideas (see https://wymp.github.io/ts-types/modules/Api.html)

See ApiSpec for more information.

Index

Type Aliases

Functions

Generated using TypeDoc