@openfn/language-hubtel 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ast.json +59 -2
- package/configuration-schema.json +4 -4
- package/package.json +2 -2
- package/types/Adaptor.d.ts +2 -22
package/ast.json
CHANGED
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"operations": [
|
|
3
|
+
{
|
|
4
|
+
"name": "sendSMS",
|
|
5
|
+
"params": [
|
|
6
|
+
"data",
|
|
7
|
+
"options"
|
|
8
|
+
],
|
|
9
|
+
"docs": {
|
|
10
|
+
"description": "Send an SMS",
|
|
11
|
+
"tags": [
|
|
12
|
+
{
|
|
13
|
+
"title": "example",
|
|
14
|
+
"description": "sendSMS({\n from: 'OpenFn-Test-01',\n to: '233538675309',\n content: 'hi there, this is OpenFn using the new Hubtel adaptor',\n});"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"title": "function",
|
|
18
|
+
"description": null,
|
|
19
|
+
"name": null
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"title": "public",
|
|
23
|
+
"description": null,
|
|
24
|
+
"type": null
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"title": "param",
|
|
28
|
+
"description": "An object with `from`, `to`, and `content` attributes",
|
|
29
|
+
"type": {
|
|
30
|
+
"type": "NameExpression",
|
|
31
|
+
"name": "object"
|
|
32
|
+
},
|
|
33
|
+
"name": "data"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"title": "param",
|
|
37
|
+
"description": "Optional hubtel options",
|
|
38
|
+
"type": {
|
|
39
|
+
"type": "NameExpression",
|
|
40
|
+
"name": "RequestOptions"
|
|
41
|
+
},
|
|
42
|
+
"name": "options"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"title": "returns",
|
|
46
|
+
"description": null,
|
|
47
|
+
"type": {
|
|
48
|
+
"type": "NameExpression",
|
|
49
|
+
"name": "Operation"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"title": "state",
|
|
54
|
+
"description": "{HttpState}"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"valid": true
|
|
59
|
+
},
|
|
3
60
|
{
|
|
4
61
|
"name": "request",
|
|
5
62
|
"params": [
|
|
@@ -50,7 +107,7 @@
|
|
|
50
107
|
"type": "NameExpression",
|
|
51
108
|
"name": "object"
|
|
52
109
|
},
|
|
53
|
-
"name": "
|
|
110
|
+
"name": "body"
|
|
54
111
|
},
|
|
55
112
|
{
|
|
56
113
|
"title": "param",
|
|
@@ -75,7 +132,7 @@
|
|
|
75
132
|
}
|
|
76
133
|
]
|
|
77
134
|
},
|
|
78
|
-
"valid":
|
|
135
|
+
"valid": true
|
|
79
136
|
}
|
|
80
137
|
],
|
|
81
138
|
"exports": [],
|
|
@@ -16,21 +16,21 @@
|
|
|
16
16
|
"minLength": 1,
|
|
17
17
|
"examples": ["https://example.com"]
|
|
18
18
|
},
|
|
19
|
-
"
|
|
19
|
+
"clientId": {
|
|
20
20
|
"title": "Client ID",
|
|
21
21
|
"type": "string",
|
|
22
22
|
"description": "Client ID",
|
|
23
|
-
"examples": ["
|
|
23
|
+
"examples": ["abc123def"]
|
|
24
24
|
},
|
|
25
25
|
"clientSecret": {
|
|
26
26
|
"title": "Client Secret",
|
|
27
27
|
"type": "string",
|
|
28
28
|
"description": "Client Secret",
|
|
29
29
|
"writeOnly": true,
|
|
30
|
-
"examples": ["
|
|
30
|
+
"examples": ["ghi456jkl"]
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"type": "object",
|
|
34
34
|
"additionalProperties": true,
|
|
35
|
-
"required": ["baseUrl", "
|
|
35
|
+
"required": ["baseUrl", "clientId", "clientSecret"]
|
|
36
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/language-hubtel",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "OpenFn hubtel adaptor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"configuration-schema.json"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@openfn/language-common": "2.3.
|
|
23
|
+
"@openfn/language-common": "2.3.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"assertion-error": "2.0.0",
|
package/types/Adaptor.d.ts
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* State object
|
|
3
|
-
* @typedef {Object} HttpState
|
|
4
|
-
* @property data - the parsed response body
|
|
5
|
-
* @property response - the response from the HTTP server, including headers, statusCode, body, etc
|
|
6
|
-
* @property references - an array of all previous data objects used in the Job
|
|
7
|
-
**/
|
|
8
|
-
/**
|
|
9
|
-
* Options provided to the HTTP request
|
|
10
|
-
* @typedef {Object} RequestOptions
|
|
11
|
-
* @public
|
|
12
|
-
* @property {object|string} body - 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).
|
|
13
|
-
* @property {object} errors - Map of errorCodes -> error messages, ie, `{ 404: 'Resource not found;' }`. Pass `false` to suppress errors for this code.
|
|
14
|
-
* @property {object} form - Pass a JSON object to be serialised into a multipart HTML form (as FormData) in the body.
|
|
15
|
-
* @property {object} query - An object of query parameters to be encoded into the URL.
|
|
16
|
-
* @property {object} headers - An object of headers to append to the request.
|
|
17
|
-
* @property {string} parseAs - Parse the response body as json, text or stream. By default will use the response headers.
|
|
18
|
-
* @property {number} timeout - Request timeout in ms. Default: 300 seconds.
|
|
19
|
-
* @property {object} tls - TLS/SSL authentication options. See https://nodejs.org/api/tls.html#tlscreatesecurecontextoptions
|
|
20
|
-
*/
|
|
21
1
|
/**
|
|
22
2
|
* Send an SMS
|
|
23
3
|
* @example
|
|
@@ -42,12 +22,12 @@ export function sendSMS(data: object, options: RequestOptions): Operation;
|
|
|
42
22
|
* @public
|
|
43
23
|
* @param {string} method - HTTP method to use
|
|
44
24
|
* @param {string} path - Path to resource
|
|
45
|
-
* @param {object}
|
|
25
|
+
* @param {object} body - Object which will be attached to the POST body
|
|
46
26
|
* @param {RequestOptions} options - Optional request options
|
|
47
27
|
* @returns {Operation}
|
|
48
28
|
* @state {HttpState}
|
|
49
29
|
*/
|
|
50
|
-
export function request(method: string, path: string, body:
|
|
30
|
+
export function request(method: string, path: string, body: object, options?: RequestOptions): Operation;
|
|
51
31
|
/**
|
|
52
32
|
* State object
|
|
53
33
|
*/
|