Module: core/base-service/base

Classes

BaseService

Type Definitions

Auth

Type:
  • object
Properties:
Name Type Description
userKey string

(Optional) The key from privateConfig to use as the username.

passKey string

(Optional) The key from privateConfig to use as the password. If auth is configured, either userKey or passKey is required.

isRequired string

(Optional) If true, the service will return NotFound unless the configured credentials are present.

Source:

Badge

Badge Object, validated against serviceDataSchema

Type:
  • object
Properties:
Name Type Description
isError boolean

(Optional)

label string

(Optional)

message string | number
color string

(Optional)

link Array.<string>

(Optional)

Source:

DefaultBadgeData

Default badge properties, validated against defaultBadgeDataSchema

Type:
  • object
Properties:
Name Type Description
label string

(Optional)

color string

(Optional)

labelColor string

(Optional)

namedLogo string

(Optional)

Source:

Route

Type:
  • object
Properties:
Name Type Description
base string

(Optional) The base path of the routes for this service. This is used as a prefix.

pattern string

A path-to-regexp pattern defining the route pattern and param names See https://www.npmjs.com/package/path-to-regexp

format RegExp

Deprecated: Regular expression to use for routes for this service's badges Use pattern instead

capture Array.<string>

Deprecated: Array of names for the capture groups in the regular expression. The handler will be passed an object containing the matches. Use pattern instead

queryParamSchema Joi.object

(Optional) A Joi schema (Joi.object({ ... }).required()) for the query param object. If you know a parameter will never receive a numeric string, you can use Joi.string(). Because of quirks in Scoutcamp and Joi, alphanumeric strings should be declared using Joi.alternatives().try(Joi.string(), Joi.number()), otherwise a value like ?success_color=999 will fail. A parameter requiring a numeric string can use Joi.number(). A parameter that receives only non-numeric strings can use Joi.string(). A parameter that never receives numeric can use Joi.string(). A boolean parameter should use Joi.equal('') and will receive an empty string on e.g. ?compact_message and undefined when the parameter is absent. In the OpenApi definitions, this type of param should be documented as queryParam({ name: 'compact_message', schema: { type: 'boolean' }, example: null })

Source: