Global

Type Definitions

afterHook(execInfo, cbopt) → {Promise.<(Array|undefined)>}

After hooks are available for all rpc.clientRequests and are executed after Chat Service standard handlers, but before returning results to the command issuer. Note that after hooks will run unconditionally after a Chat Service handler, both when a normal result is return and an error occurred. Use execInfo to get errors or results.

Parameters:
Name Type Attributes Description
execInfo chat-service.ExecInfo

Command execution details.

cb callback <optional>

Optional callback.

Returns:

Resolves without a data to return unchanged command results to the command issuer. Rejections or a resolved array will override command results.

Type
Promise.<(Array|undefined)>

beforeHook(execInfo, cbopt) → {Promise.<(Array|undefined)>}

Before hooks are available for all rpc.clientRequests and are executed after a command arguments validation, but before Chat Service standard handler.

Parameters:
Name Type Attributes Description
execInfo chat-service.ExecInfo

Command execution details.

cb callback <optional>

Optional callback.

Returns:

Resolves without a data to continue a command execution. Rejections or a resolved array will stop further execution, and return results to the command issuer.

Type
Promise.<(Array|undefined)>

callback(error, …results)

Node style callback. All callbacks are optional, promises may be used instead. But only one API must be used per invocation.

Parameters:
Name Type Attributes Description
error Error
results * <repeatable>