Options
All
  • Public
  • Public/Protected
  • All
Menu
     

Class QueryAU

A request-method configurator for RouteAU requests-paths.

Hierarchy

Implements

Index

Constructors

Properties

Constructors

constructor

  • Creates a new QueryGN method for a RouteAU request.

    Parameters

    • __namedParameters: Method
      • Scheme: String
      • Merge: false | true | "GET" | "POST" | "PUT" | "DELETE" | "MIDDLEWARE"
      • Limits: String[]
      • Doc: Doc
      • Proc: CLProcs
      • Private: boolean

    Returns QueryAU

Properties

Scheme

Scheme: String

A RegexP, string-representation of the Route Path.

Merge

Merge: boolean | TPRouteMerge<CBRouteAU>

A flag the specifies whether or not, and if so, how to prepend the path-parameters of the last parent-Endpoint referenced in Sub (along with the merge of its own parent; if applicable) to the path-name/parameters of this Endpoint:

  • If true, the Scheme from the parent-Endpoint will be prepended to this Scheme of this Endpoint.
  • If set as an HMETHOD, then the system will use the Scheme defined in the parent-Endpoint's CBRouteAU/CBRouteDB definition of the same HMETHOD. Otherwise, it choose the first Scheme found within each parent.
  • Defined in a method (see: Uses below), and set to true, then the system will look for that method deinition within the parent and choose that Scheme. Otherwise, the first Scheme found is chosen.

Example:

({
  User: {
    Actions: {
      Password: new RouteDB({
        Merge: true,
        Subs: ['settings','privacy'], // Child of "Settings"
        GET: () => ({ ... }), // Merge to "Privacy.GET"
        // ^ Resolves to "/user/:uid/settings/privacy/:prv_id/password"
      }),
      Email: new RouteDB({
        Merge: 'POST', // Merge to "Privacy.POST"
        Subs: ['settings','privacy'], // Child of "Settings"
        GET: () => ({ ... }),
        // ^ Resolves to "/user/:uid/settings/privacy/email"
      }),
      Privacy: new RouteDB({
        Scheme: '/:prv_id/', // Defult for any Method defined within
        Subs: ['settings'], // Child of "Settings".
        Merge: true,
        GET: () => ({ ... }),
        // ^ Merge to "Settings.GET",
        // ^ Resolves to "/user/:uid/settings/privacy/:prv_id"
        POST: () => ({ Scheme: '/' })
        // ^ Merge to "Settings.GET", Scheme redefined to "/"
        // ^ Resolves to "/user/:uid/settings/privacy"
      }),
      Settings: new RouteDB({
        Merge: true,
        GET: () => ({ ... }),
        // ^ Sub not defined, is child of "/"
        // ^ Resolves to "/user/:uid/settings"
      }),
      "/": new RouteDB({
        Scheme: '/:uid/',
        GET: () => ({ ... }),
        // ^ Resolves to "/user/:uid"
      }),
    }
  }
});

Uses:

Limits

Limits: String[]

A list of Limits to subscribe to.

Doc

Doc: Doc

The documentation for Methods in this Route.

Private

Private: boolean

true, if this Endpoint is restricted to Admins.

Proc

Proc: CLProcs

The collection of handlers for an Auth.Method.