Aller au contenu principal

log-right > Result

Result class​

A class used to handle the result of a function call or sub-process. Functions/process should return back this object so that the calling function can evaluate it's success.

Signature:
export declare class Result<TReturned = any | undefined> extends ResultBase implements IResult<TReturned> 
Extends: ResultBaseImplements: IResult<TReturned>

Constructors​

ConstructorModifiersDescription
(constructor)(params)Constructs a new instance of the Result class

Properties​

PropertyModifiersTypeDescription
callback?CallbackFunction(Optional) A field containing any values returned from the function call
context?unknown(Optional) A free-format field that will be added to all IEvent objects (to be used in custom logic added by the user).
createstatic<TReturned_1 = any>(params: string | Error | Partial<ResultBaseParams<TReturned_1>>) => Result<TReturned_1>A helper function to create a result object
data?TReturned(Optional) A field containing any values returned from the function call
details?string | null(Optional) A string that includes additional information about the event
idstringA unique string that can be used to identify the event
isValidated?boolean | null(Optional) An indicator specifying the last results of isValidated. If it has not been validated yet, return null
severitySeverityDetermines the severity level of the event (a number 0 through 10). This field is used to determine how the system should respond to an event
source?string | null(Optional) A string representing the source that initiated the event
successstatic<TReturned_1 = any>(data?: TReturned_1 | undefined, type?: EventType | undefined) => Result<TReturned_1>A helper function to return back a success result
typeEventTypeThe type of the event (values can be defined by the user)
userId?string(Optional) A string that can be used to represent the current user performing actions in the application/triggering processes
validate() => booleanA function call to validate if the result is a success or failure
warningstatic<TReturned_1 = any>(message?: any, data?: TReturned_1 | undefined, type?: EventType | undefined) => Result<TReturned_1>A helper function to return back an warning result

Methods​

MethodModifiersDescription
error(error, type)staticA helper function to return back an error result