@openfn/language-flutterwave 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 CHANGED
@@ -28,6 +28,18 @@
28
28
  },
29
29
  "name": "customerData"
30
30
  },
31
+ {
32
+ "title": "param",
33
+ "description": "Optional request options",
34
+ "type": {
35
+ "type": "OptionalType",
36
+ "expression": {
37
+ "type": "NameExpression",
38
+ "name": "RequestOptions"
39
+ }
40
+ },
41
+ "name": "options"
42
+ },
31
43
  {
32
44
  "title": "returns",
33
45
  "description": null,
@@ -38,7 +50,7 @@
38
50
  }
39
51
  ]
40
52
  },
41
- "valid": false
53
+ "valid": true
42
54
  },
43
55
  {
44
56
  "name": "initiatePayment",
@@ -68,6 +80,18 @@
68
80
  },
69
81
  "name": "paymentData"
70
82
  },
83
+ {
84
+ "title": "param",
85
+ "description": "Optional request options",
86
+ "type": {
87
+ "type": "OptionalType",
88
+ "expression": {
89
+ "type": "NameExpression",
90
+ "name": "RequestOptions"
91
+ }
92
+ },
93
+ "name": "options"
94
+ },
71
95
  {
72
96
  "title": "returns",
73
97
  "description": "A function that takes the state and performs the operation.",
@@ -78,7 +102,7 @@
78
102
  }
79
103
  ]
80
104
  },
81
- "valid": false
105
+ "valid": true
82
106
  },
83
107
  {
84
108
  "name": "createPaymentMethod",
@@ -108,6 +132,18 @@
108
132
  },
109
133
  "name": "paymentMethodData"
110
134
  },
135
+ {
136
+ "title": "param",
137
+ "description": "Optional request options",
138
+ "type": {
139
+ "type": "OptionalType",
140
+ "expression": {
141
+ "type": "NameExpression",
142
+ "name": "RequestOptions"
143
+ }
144
+ },
145
+ "name": "options"
146
+ },
111
147
  {
112
148
  "title": "returns",
113
149
  "description": "A function that takes the state and performs the operation.",
@@ -118,7 +154,7 @@
118
154
  }
119
155
  ]
120
156
  },
121
- "valid": false
157
+ "valid": true
122
158
  }
123
159
  ],
124
160
  "exports": [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfn/language-flutterwave",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "OpenFn flutterwave 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": "3.2.2"
23
+ "@openfn/language-common": "3.2.3"
24
24
  },
25
25
  "devDependencies": {
26
26
  "assertion-error": "2.0.0",
@@ -30,7 +30,7 @@
30
30
  "nock": "^14.0.10",
31
31
  "rimraf": "3.0.2",
32
32
  "sinon": "^21.0.1",
33
- "undici": "^7.15.0"
33
+ "undici": "^7.19.2"
34
34
  },
35
35
  "repository": {
36
36
  "type": "git",
@@ -1,57 +1,58 @@
1
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
2
+ * State object returned by flutterwave API
3
+ * @typedef {Object} FlutterwaveState
4
+ * @property data - the parsed response body from flutterwave
5
+ * @property response - the full response from the flutterwave server, including headers, statusCode, body, etc
6
6
  * @property references - an array of all previous data objects used in the Job
7
7
  **/
8
8
  /**
9
- * Options provided to the HTTP request
9
+ * Options provided to the Flutterwave requests
10
10
  * @typedef {Object} RequestOptions
11
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
12
  * @property {object} errors - Map of errorCodes -> error messages, ie, `{ 404: 'Resource not found;' }`. Pass `false` to suppress errors for this code.
14
13
  * @property {object} form - Pass a JSON object to be serialised into a multipart HTML form (as FormData) in the body.
15
14
  * @property {object} query - An object of query parameters to be encoded into the URL.
16
15
  * @property {object} headers - An object of headers to append to the request.
17
16
  * @property {string} parseAs - Parse the response body as json, text or stream. By default will use the response headers.
18
17
  * @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
18
  */
21
19
  /**
22
20
  * Create a new customer in Flutterwave.
23
21
  * @function
24
22
  * @public
25
23
  * @param {Object} customerData
24
+ * @param {RequestOptions} [options] - Optional request options
26
25
  * @returns {Function}
27
26
  */
28
- export function createCustomer(customerData: any, options?: {}): Function;
27
+ export function createCustomer(customerData: any, options?: RequestOptions): Function;
29
28
  /**
30
29
  * Initiate a payment request to the Flutterwave API.
31
30
  * @function
32
31
  * @public
33
32
  * @param {Object} paymentData - The payment details to send to Flutterwave.
33
+ * @param {RequestOptions} [options] - Optional request options
34
34
  * @returns {Function} - A function that takes the state and performs the operation.
35
35
  */
36
- export function initiatePayment(paymentData: any, options?: {}): Function;
36
+ export function initiatePayment(paymentData: any, options?: RequestOptions): Function;
37
37
  /**
38
38
  * Create a new payment method in Flutterwave.
39
39
  * @function
40
40
  * @public
41
41
  * @param {Object} paymentMethodData - The payment method details to send to Flutterwave.
42
+ * @param {RequestOptions} [options] - Optional request options
42
43
  * @returns {Function} - A function that takes the state and performs the operation.
43
44
  */
44
- export function createPaymentMethod(paymentMethodData: any, options?: {}): Function;
45
+ export function createPaymentMethod(paymentMethodData: any, options?: RequestOptions): Function;
45
46
  /**
46
- * State object
47
+ * State object returned by flutterwave API
47
48
  */
48
- export type HttpState = {
49
+ export type FlutterwaveState = {
49
50
  /**
50
- * - the parsed response body
51
+ * - the parsed response body from flutterwave
51
52
  */
52
53
  data: any;
53
54
  /**
54
- * - the response from the HTTP server, including headers, statusCode, body, etc
55
+ * - the full response from the flutterwave server, including headers, statusCode, body, etc
55
56
  */
56
57
  response: any;
57
58
  /**
@@ -60,6 +61,6 @@ export type HttpState = {
60
61
  references: any;
61
62
  };
62
63
  /**
63
- * Options provided to the HTTP request
64
+ * Options provided to the Flutterwave requests
64
65
  */
65
66
  export type RequestOptions = any;