Mixin: HandlerExtension

x2node-ws-resources. HandlerExtension

Resource handler extension.

Methods


afterCreate(txCtx, record)

Parameters:
Name Type Description
txCtx module:x2node-ws-resources.CreateTransactionContext
record Object
Returns:
Type
Promise

afterDelete(txCtx)

Parameters:
Name Type Description
txCtx module:x2node-ws-resources.DeleteTransactionContext
Returns:
Type
Promise

afterRead(txCtx, record)

Parameters:
Name Type Description
txCtx module:x2node-ws-resources.ReadTransactionContext
record Object
Returns:
Type
Promise

afterSearch(txCtx, result)

Parameters:
Name Type Description
txCtx module:x2node-ws-resources.SearchTransactionContext
result module:x2node-dbos~FetchDBO~Result
Returns:
Type
Promise

afterUpdate(txCtx, record)

Parameters:
Name Type Description
txCtx module:x2node-ws-resources.UpdateTransactionContext
record Object
Returns:
Type
Promise

beforeCreate(txCtx)

Parameters:
Name Type Description
txCtx module:x2node-ws-resources.CreateTransactionContext
Returns:
Type
Promise

beforeDelete(txCtx)

Parameters:
Name Type Description
txCtx module:x2node-ws-resources.DeleteTransactionContext
Returns:
Type
Promise

beforeRead(txCtx)

Parameters:
Name Type Description
txCtx module:x2node-ws-resources.ReadTransactionContext
Returns:
Type
Promise

beforeSearch(txCtx)

Parameters:
Name Type Description
txCtx module:x2node-ws-resources.SearchTransactionContext
Returns:
Type
Promise

beforeUpdate(txCtx, record)

Parameters:
Name Type Description
txCtx module:x2node-ws-resources.UpdateTransactionContext
record Object
Returns:
Type
Promise

beforeUpdateSave(txCtx, record)

Parameters:
Name Type Description
txCtx module:x2node-ws-resources.UpdateTransactionContext
record Object
Returns:
Type
Promise

completeCreate( [err], txCtx [, record])

Parameters:
Name Type Argument Description
err external:Error | module:x2node-ws~ServiceResponse <optional>
txCtx module:x2node-ws-resources.CreateTransactionContext
record Object <optional>
Returns:
Type
Promise

completeDelete( [err], txCtx)

Parameters:
Name Type Argument Description
err external:Error | module:x2node-ws~ServiceResponse <optional>
txCtx module:x2node-ws-resources.DeleteTransactionContext
Returns:
Type
Promise

completeRead( [err], txCtx [, record])

Parameters:
Name Type Argument Description
err external:Error | module:x2node-ws~ServiceResponse <optional>
txCtx module:x2node-ws-resources.ReadTransactionContext
record Object <optional>
Returns:
Type
Promise

completeSearch( [err], txCtx [, result])

Parameters:
Name Type Argument Description
err external:Error | module:x2node-ws~ServiceResponse <optional>
txCtx module:x2node-ws-resources.SearchTransactionContext
result module:x2node-dbos~FetchDBO~Result <optional>
Returns:
Type
Promise

completeUpdate( [err], txCtx [, record])

Parameters:
Name Type Argument Description
err external:Error | module:x2node-ws~ServiceResponse <optional>
txCtx module:x2node-ws-resources.UpdateTransactionContext
record Object <optional>
Returns:
Type
Promise

prepareCreate(txCtx, recordTmpl)

After the record template is validated.
Parameters:
Name Type Description
txCtx module:x2node-ws-resources.CreateTransactionContext
recordTmpl Object
Returns:
Nothing, or a promise, which can be rejected to abort the action and return the rejection object as the handler response.
Type
* | Promise

prepareCreateSpec(txCtx, recordTmpl)

Before the record template is validated.
Parameters:
Name Type Description
txCtx module:x2node-ws-resources.CreateTransactionContext
recordTmpl Object
Returns:
Nothing, or a promise, which can be rejected to abort the action and return the rejection object as the handler response.
Type
* | Promise

prepareDelete(txCtx)

Parameters:
Name Type Description
txCtx module:x2node-ws-resources.DeleteTransactionContext
Returns:
Nothing, or a promise, which can be rejected to abort the action and return the rejection object as the handler response.
Type
* | Promise

prepareRead(txCtx)

Before read DBO is created.
Parameters:
Name Type Description
txCtx module:x2node-ws-resources.ReadTransactionContext
Returns:
Nothing, or a promise, which can be rejected to abort the action and return the rejection object as the handler response.
Type
* | Promise

prepareSearch(txCtx)

Before search DBO is created.
Parameters:
Name Type Description
txCtx module:x2node-ws-resources.SearchTransactionContext
Returns:
Nothing, or a promise, which can be rejected to abort the action and return the rejection object as the handler response.
Type
* | Promise

prepareUpdate(txCtx)

Parameters:
Name Type Description
txCtx module:x2node-ws-resources.UpdateTransactionContext
Returns:
Nothing, or a promise, which can be rejected to abort the action and return the rejection object as the handler response.
Type
* | Promise

prepareUpdateSpec(txCtx, patchSpec)

Parameters:
Name Type Description
txCtx module:x2node-ws-resources.UpdateTransactionContext
patchSpec Object
Returns:
Nothing, or a promise, which can be rejected to abort the action and return the rejection object as the handler response.
Type
* | Promise