Classes
Methods
# async bulkAction(request, response) → {Promise.<BulkActionResponse>}
To call it use ApiClient#bulkAction method.
Handler function responsible for a .../api/resources/{resourceId}/bulk/{action}?recordIds={recordIds}
Parameters:
Name | Type | Description |
---|---|---|
request |
ActionRequest
|
|
response |
any
|
NotFoundError when recordIds are missing in query or they don't exists in the database
ConfigurationError when action handler doesn't return Promise<BulkActionResponse>
action response
Promise.<BulkActionResponse>
# async dashboard(request, response) → {Promise.<any>}
To call it use ApiClient#getDashboard method.
Handler function responsible for a .../api/dashboard
Parameters:
Name | Type | Description |
---|---|---|
request |
ActionRequest
|
|
response |
any
|
action response
Promise.<any>
# async page(request, response) → {Promise.<any>}
To call it use ApiClient#getPage method.
Handler function responsible for a .../api/pages/{pageName}
Parameters:
Name | Type | Description |
---|---|---|
request |
ActionRequest
|
|
response |
any
|
action response
Promise.<any>
# async recordAction(originalRequest, response) → {Promise.<RecordActionResponse>}
To call it use ApiClient#recordAction method.
Handler function responsible for a .../api/resources/{resourceId}/records/{recordId}/{action}
Parameters:
Name | Type | Description |
---|---|---|
originalRequest |
ActionRequest
|
|
response |
any
|
ConfigurationError When given record action doesn't return RecordJSON
ConfigurationError when action handler doesn't return Promise<RecordActionResponse>
action response
Promise.<RecordActionResponse>
# async resourceAction(originalRequest, response) → {Promise.<ActionResponse>}
To call it use ApiClient#resourceAction method.
Handler function responsible for a .../api/resources/{resourceId}/actions/{action}
Parameters:
Name | Type | Description |
---|---|---|
originalRequest |
ActionRequest
|
|
response |
any
|
object from the plugin (i.e. adminjs-expressjs) |
action response
Promise.<ActionResponse>
# async search(request, response) → {Promise.<SearchActionResponse>}
Handler function responsible for a .../api/resources/{resourceId}/search/{query} route
Parameters:
Name | Type | Description |
---|---|---|
request |
ActionRequest
|
with params.query set |
response |
any
|
found records
Promise.<SearchActionResponse>