Options
All
  • Public
  • Public/Protected
  • All
Menu
     

Module __global

Gloabl configuration interfaces for the dffrnt.confs module of the dffrnt.api framework.

Index

#Misc Type aliases

HMETHOD

HMETHOD: "GET" | "POST" | "PUT" | "DELETE" | "MIDDLEWARE"

A valid HTTP-Method.

HMETHODs

HMETHODs: Array<HMETHOD>

An array of valid HTTP-Methods.

PTo

PTo: "header" | "path" | "query"

Denotes whether a GNParam is a path, header, or query/body parameter.

Param PTo Example
Path path curl https://rest.com/<PATH>
Header header curl -H "Token:345j_hk234 https://rest.com/user
Query query curl https://rest.com/search?q=<QUERY>
Body body curl -X PUT -d name=daniel https://rest.com/edit

TPDocPrims

TPDocPrims: "integer" | "number" | "string" | "boolean" | "array" | "object"

Valid primitive-types for defining a PType OpenAP 3.x document.

TPQryPrims

TPQryPrims: string | boolean | number | object

Valid primitive-types for QYRequest params.

TPQryIters

TPQryIters: TPQryPrims[]

Valid Iterables containing primitive-types for QYRequest params.

TPQryPathParams

TPQryPathParams: object

A plain-object representing the path-params of an request.

Type declaration

  • [paramName: string]: string | boolean | number

TPQryObject

TPQryObject: object

A plain-object representing the query/body of an request.

Type declaration

Callback Type aliases

PropGet

PropGet: function

A callback that acquires a Getter Property. A callback that acquires a Getter Property.

returns

The value to get.

returns

Type declaration

    • (): any
    • Returns any

PropSet

PropSet: function

A callback that assign a Setter Property. A callback that assign a Setter Property.

param

The value to set.

param

The value to set

Type declaration

    • (val: any): void
    • Parameters

      • val: any

      Returns void

CBFormat

CBFormat: function

A callback that handles a GNParam's formatting.

param

The clause value object.

returns

The formatted clause value.

Type declaration

CBQYHandle

CBQYHandle: function

A callback that retrieves/updates data in the backend.

param

The Params sent from the Request.

returns

The payload return from a Request.

Type declaration

CBQuery

CBQuery: CBQYHandle | Array<String>

Either an Array of Strings that form a SQL query, or A callback that retrieves/updates data in the backend.

CBRouteAU

CBRouteAU: function

A callback that returns RouteAU-specific configs for a QueryGN.

returns

Config properties for the QueryGN object.

Type declaration

CBRouteDB

CBRouteDB: function

A callback that returns RouteDB-specific configs for a QueryGN.

returns

Config properties for the QueryGN object.

Type declaration

CBProc

CBProc: function

A callback that handles a AuthRequest.

param

An HTTP/S request.

returns

Type declaration

CBParse

CBParse: function

A callback that Parses the GNParam Results.

param

An GNRequest response.

returns

Type declaration

Other Type aliases

ExMethod

ExMethod: "get" | "post" | "put" | "delete" | "all"

Valid request-methods for use with ExpressJS.

TPReqKind

TPReqKind: "AURequest" | "DBRequest"

The kind of request configurator to use when adding a Route.

CBExHandler

CBExHandler: function

A hanlder for ExpressJS requests & middleware.

param

The client request object.

param

The client response object.

param

The next handler; if there is one.

Type declaration

    • (req: ExRequest, res: ExResponse, next: ExNext): void
    • Parameters

      • req: ExRequest
      • res: ExResponse
      • next: ExNext

      Returns void

CBReqPattern

CBReqPattern: function

Constructs the full-path & scheme of a Route.

param

The name of the Route.

param

The RouteGN object configuring this Route.

param

The method this Route responds to.

param

If true, only return the full-path; do not include the scheme.

Type declaration

CBReqRocket

CBReqRocket: function

A function that configures a socket-session with it's appropriate handlers and a response object.

param

A client's socket-session object.

returns

The key that triggers this Socket request.

Type declaration

    • (socket: SocketIO.Socket): string
    • Parameters

      • socket: SocketIO.Socket

      Returns string

PropDescrs

PropDescrs: object

A collection of Property Descriptors. The key indicates the property name, and the value is the PropertyDescription.

Type declaration

  • [propName: string]: PropDesc

PTKinds

PTKinds: "String" | "Number" | "Boolean" | "Object"

Valid PTOpts.types.

HTTP_ERRORS

HTTP_ERRORS: "REQUEST" | "HELP" | "RESTORED" | "ENDED" | "EXPIRED" | "LOADED" | "UPDATED" | "PROFILE" | "ADDED" | "VALID" | "BAD_REQ" | "ERROR" | "INVALID" | "TOKEN" | "LOGIN" | "EXISTS" | "NO_GET" | "NO_POST" | "NO_PUT" | "NO_DELETE" | "RATELIMIT"

The possible HTTP_MSG types that can be used.

DCTKey

DCTKey: PropertyKey | RegExp

Valid types for a DCT key.

TPSanitizers

TPSanitizers: CBSanitizer | CBSanitizer[]

Either a single-sanitzer callback, or an array of many callbacks.

TPBasePoints

TPBasePoints: Base | Base

An alias representing the valid styles of BaseEndpoint configurations.

TPRouteMethods

TPRouteMethods: "Auth" | "Data"

...

TPRouteMethod

TPRouteMethod<R>: R extends "Auth" ? Method : any

...

Type parameters

TPRouteMerge

TPRouteMerge<M>: Exclude<HMETHOD, "" | "MIDDLEWARE">

...

Type parameters

  • M: function | function

PadDir

PadDir: "-" | "" | "+"

CBSpaceStruct

CBSpaceStruct: function

The default structure of any data that it to be recieved from a CFG.SPCE.SpaceHandler.Call request, and subsequently passed to the CFG.SPCE.SpaceHandler.Build. This can be used to account for default-values in a response when certain values are null or undefined.

param

The originalUrl of the curretn page-request.

param

The current page-request.

Type declaration

CBSanitizer

CBSanitizer: function

A callback that sanitzes a values according to it's PType.

param

A value to sanitze.

returns

The value, if valid; otherwise, null.

Type declaration

QYNext

QYNext: []

QYDataResult

QYDataResult: [any, TPQryObject | TPQryObject[], Options]

...

Returnable Type aliases

QYError

QYError: Error

An Error that can occur within a CBQYHandle.

QYResult

The payload returned within a QueryGN query handler.

Variables

Const GET

GET: HMETHOD = "GET"

The HTTP-Method, GET.

Const POST

POST: HMETHOD = "POST"

The HTTP-Method, POST.

Const PUT

PUT: HMETHOD = "PUT"

The HTTP-Method, PUT.

Const DELETE

DELETE: HMETHOD = "DELETE"

The HTTP-Method, DELETE.

Const MID

MID: HMETHOD = "MIDDLEWARE"

The HTTP-Method, MIDDLEWARE.