AConnector
Base class for any connector. A connector is always paired with an Application that owns its credentials.
import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
Inheritance #
ANode -> AConnector
Methods you implement #
| Method | Returns | Purpose |
|---|---|---|
getName() | string | Stable internal node identifier. |
processAction(dto) | Promise<ProcessDto> | Build the request via the Application, send it, write the response. |
Methods provided #
| Method | Returns | Purpose |
|---|---|---|
getApplication() | AApplication | The Application this connector is registered against. |
getApplicationInstallFromProcess(dto) | Promise<ApplicationInstall> | Load the install for the current process. |
getSender() | CurlSender | HTTP transport with built-in retry and metric reporting. |
Send pattern #
const dto2 = await this.getSender().send(requestDto, [200, 201]);
The second argument is the list of HTTP status codes that count as success; everything else triggers retry / failure handling.
See also #
- ACommonNode
- ABatchNode
- RequestDto
- PHP equivalent:
ConnectorAbstract