Options
All
  • Public
  • Public/Protected
  • All
Menu
     

Class Helper

Converts API configurations into a JSON Documentation

Hierarchy

  • Helper

Index

Constructors

constructor

  • new Helper(__namedParameters?: CNFDefaults): Helper
  • Creates an instance of Helper.

    Parameters

    Returns Helper

Accessors

Document

  • get Document(): __type
  • The JSON-formatted API Documentation.

    Returns __type

Defaults

  • get Defaults(): CNFDefaults
  • set Defaults(val: CNFDefaults): void
  • Access or Subscribe default DocKindMaps, CLHeaders, and GNParams

    Returns CNFDefaults

  • Access or Subscribe default DocKindMaps, CLHeaders, and GNParams

    Parameters

    • val: CNFDefaults

    Returns void

Methods

Error

  • Error(Property: string, Name: string): ERHelp
  • Formats an JSON object for Error Messages

    Parameters

    • Property: string

      The erroring Property

    • Name: string

      The erroring Object

    Returns ERHelp

    The error message object

Get

  • Get(Name: string, Route: string): any
  • Accesses a Help Document for responses

    Parameters

    • Name: string

      The namespace the Route belongs to

    • Route: string

      The name of the Route

    Returns any

Create

  • Create(Name: string): void
  • Initializes the creation of a Route Documentation

    Parameters

    • Name: string

      The namespace the Route belongs to

    Returns void

Append

  • Formats and subscribes a Route Documentation

    Parameters

    • Name: string

      The namespace the Route belongs to

    • Routes: string[]

      The parent-Routes of this Route

    • Point: string

      The name of this Route

    • Method: HMETHODs

      The Method of the Route being documented

    • RQ: RouteAU | RouteDB

      The Route to be documented

    Returns void

Finalize

  • Finalize(Name?: string): void
  • Finalizes the Documentation by adding the API-Doc route.

    Parameters

    • Default value Name: string = "apidoc"

      The name of the documentation route.

    Returns void

Static GetSchemes

  • GetSchemes(path: string): string[]
  • Splits a path pattern to an Array of separate paths

    Parameters

    • path: string

      The RegexP path to parse

    Returns string[]

Static GetPathParams

  • GetPathParams(schemes: string[]): Array<string[]>
  • Generates an Array of path-parameter Arrays, based on the provider schemes

    Parameters

    • schemes: string[]

      An Array of path schemes

    Returns Array<string[]>

Static MkeRefKey

  • MkeRefKey(name: string, ref: RFParam): string | false | true
  • Formats a Param-Reference Key based on the Specfied name & ref

    Parameters

    • name: string

      The Name of the Param

    • ref: RFParam

      The Param Reference

    Returns string | false | true

    A formatted Reference Key; or false, if invalid

Static ChkRefKey

  • ChkRefKey(refKey: string, refs: Immutable.OrderedMap): boolean
  • Checks if a Reference-Key matches any defined Param-References

    Parameters

    • refKey: string

      The Param-Reference Key

    • refs: Immutable.OrderedMap

      An option Param-Reference collection (for speed)

    Returns boolean

Static GetRefAlias

  • GetRefAlias(refKey: string): string
  • Get an aliased Reference-Key

    Parameters

    • refKey: string

      The Param-Reference Key

    Returns string

    The real Param-Reference Key

Static GetRefKey

  • GetRefKey(refKey: string, refs: Immutable.OrderedMap): string
  • Get a Reference-Key

    Parameters

    • refKey: string

      The Param-Reference Key

    • refs: Immutable.OrderedMap

      An option Param-Reference collection (for speed)

    Returns string

    The real Param-Reference Key

Static GetInVals

  • Returns an appropriate Object of in-values, given the specified method.

    Parameters

    • method: HMETHODs

      A value specifiying a Request Method

    Returns object

    • [s: string]: string

Static GetParamFactory

  • Generates an appropriate Function to designate parameters, given the specified method.

    Parameters

    • method: HMETHODs

      A value specifiying a Request Method

    Returns CBGetParams

    A param retrieval function