Constructor
new OAuth2Node(config)
Create an OAuth2Node.
Parameters:
| Name | Type | Description |
|---|---|---|
config |
Object | Node configuration object. |
Methods
cleanForm(form) → {Object}
Cleans form data by removing undefined or empty values.
Parameters:
| Name | Type | Description |
|---|---|---|
form |
Object | The form data. |
Returns:
- The cleaned form data.
- Type
- Object
configureProxy()
Configures proxy settings.
generateOptions(msg) → {Object}
Generates options for the HTTP request.
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
Object | Input message object. |
Returns:
- The request options.
- Type
- Object
handleError(error, msg, send)
Handles errors from the POST request.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
Object | The error object. |
msg |
Object | Input message object. |
send |
function | Function to send messages. |
handleResponse(response, msg, send)
Handles the response from the POST request.
Parameters:
| Name | Type | Description |
|---|---|---|
response |
Object | The response object. |
msg |
Object | Input message object. |
send |
function | Function to send messages. |
(async) makePostRequest(options) → {Promise.<Object>}
Makes a POST request.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
Object | The request options. |
Returns:
- The response from the request.
- Type
- Promise.<Object>
(async) onInput(msg, send, done)
Handles input messages.
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
Object | Input message object. |
send |
function | Function to send messages. |
done |
function | Function to indicate processing is complete. |
setStatus(color, text)
Sets the status of the node.
Parameters:
| Name | Type | Description |
|---|---|---|
color |
string | The color of the status indicator. |
text |
string | The status text. |