mojatax@1.0.2
This adaptor exports the following from common:
- cursor()
- dataPath()
- dataValue()
- dateFns
- each()
- field()
- fields()
- fn()
- lastReferenceValue()
- merge()
- sourceValue()
Functions
post
post(path, data, options, [callback]) ⇒ Operation
Make a POST request to any Mojatax endpoint.
Param | Type | Description |
---|---|---|
path | string | Path to resource |
data | object | Object which will be attached to the request body |
options | MojataxRequestOptions | Optional request options |
[callback] | function | Optional callback to handle the response |
This operation writes the following keys to state:
State Key | Description |
---|---|
data | The response body (as JSON) |
response | The HTTP response from the Mojatax server (excluding the body) |
references | An array of all previous data objects used in the Job |
Example: Make a POST request to create an invoice
post("CreateInvoice", {
invoice_id: 'PID092',
customerId: '102',
items: [],
});
request
request(method, path, data, options, [callback]) ⇒ Operation
Make a general HTTP request against the Mojatax server.
Param | Type | Description |
---|---|---|
method | string | HTTP method to use |
path | string | Path to resource |
data | object | Object which will be attached to the POST body |
options | MojataxRequestOptions | Optional request options |
[callback] | function | Optional callback to handle the response |
This operation writes the following keys to state:
State Key | Description |
---|---|
data | The response body (as JSON) |
response | The HTTP response from the Mojatax server (excluding the body) |
references | An array of all previous data objects used in the Job |
Example: Make a POST request to create an invoice
request("POST", "/client/CreateInvoice", {
invoice_id: 'PID092',
customerId: '102',
items: [],
});
Interfaces
MojataxRequestOptions
Options provided to Mojatax HTTP request
Properties
Name | Type | Description |
---|---|---|
body | object | string | body data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request). |
errors | object | Map of errorCodes -> error messages, ie, { 404: 'Resource not found;' } . Pass false to suppress errors for this code. |
query | object | An object of query parameters to be encoded into the URL. |
headers | object | An object of headers to append to the request. |
parseAs | string | Parse the response body as json, text or stream. By default will use the response headers. |
timeout | number | Request timeout in ms. Default: 300 seconds. |
tls | object | TLS/SSL authentication options. See https://nodejs.org/api/tls.html#tlscreatesecurecontextoptions |