@openfn/language-ghana-bdr 0.1.2 → 0.1.3
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 +1 -1
- package/dist/index.cjs +4 -2
- package/dist/index.js +4 -2
- package/package.json +1 -1
- package/types/Adaptor.d.ts +1 -2
package/ast.json
CHANGED
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"tags": [
|
|
68
68
|
{
|
|
69
69
|
"title": "example",
|
|
70
|
-
"description": "sendBirthNotification({\n
|
|
70
|
+
"description": "sendBirthNotification({\n registry_code: 'abc123',\n child: {},\n mother: {},\n father: {},\n})"
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
"title": "function",
|
package/dist/index.cjs
CHANGED
|
@@ -147,7 +147,7 @@ var request = (path, options) => {
|
|
|
147
147
|
};
|
|
148
148
|
if (data.username || data.password) {
|
|
149
149
|
(0, import_util.throwError)(
|
|
150
|
-
"Please don't supply `username` and `password` in your request body."
|
|
150
|
+
"Please don't supply `username` and `password` in your request body. The adaptor will append it automatically."
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
153
|
if (data) {
|
|
@@ -158,6 +158,7 @@ var request = (path, options) => {
|
|
|
158
158
|
password
|
|
159
159
|
})
|
|
160
160
|
);
|
|
161
|
+
args.data = { ...data, username, password };
|
|
161
162
|
}
|
|
162
163
|
const response = await client.request(args);
|
|
163
164
|
if (response.statusCode >= 400) {
|
|
@@ -247,7 +248,8 @@ function createServer(url = "http://tracker.chimgh.org") {
|
|
|
247
248
|
agent.disableNetConnect();
|
|
248
249
|
const mockPool = agent.get(url);
|
|
249
250
|
const sendBirthNotification2 = (req) => {
|
|
250
|
-
|
|
251
|
+
const body = JSON.parse(req.body);
|
|
252
|
+
if (validateRequestBody(body, sampleRequestBody)) {
|
|
251
253
|
return {
|
|
252
254
|
statusCode: 200,
|
|
253
255
|
responseOptions: {
|
package/dist/index.js
CHANGED
|
@@ -110,7 +110,7 @@ var request = (path, options) => {
|
|
|
110
110
|
};
|
|
111
111
|
if (data.username || data.password) {
|
|
112
112
|
throwError(
|
|
113
|
-
"Please don't supply `username` and `password` in your request body."
|
|
113
|
+
"Please don't supply `username` and `password` in your request body. The adaptor will append it automatically."
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
116
|
if (data) {
|
|
@@ -121,6 +121,7 @@ var request = (path, options) => {
|
|
|
121
121
|
password
|
|
122
122
|
})
|
|
123
123
|
);
|
|
124
|
+
args.data = { ...data, username, password };
|
|
124
125
|
}
|
|
125
126
|
const response = await client.request(args);
|
|
126
127
|
if (response.statusCode >= 400) {
|
|
@@ -210,7 +211,8 @@ function createServer(url = "http://tracker.chimgh.org") {
|
|
|
210
211
|
agent.disableNetConnect();
|
|
211
212
|
const mockPool = agent.get(url);
|
|
212
213
|
const sendBirthNotification2 = (req) => {
|
|
213
|
-
|
|
214
|
+
const body = JSON.parse(req.body);
|
|
215
|
+
if (validateRequestBody(body, sampleRequestBody)) {
|
|
214
216
|
return {
|
|
215
217
|
statusCode: 200,
|
|
216
218
|
responseOptions: {
|
package/package.json
CHANGED
package/types/Adaptor.d.ts
CHANGED
|
@@ -42,11 +42,10 @@ export function post(path: string, data: object): Operation;
|
|
|
42
42
|
* Generate a birth certificate
|
|
43
43
|
* @example
|
|
44
44
|
* sendBirthNotification({
|
|
45
|
+
* registry_code: 'abc123',
|
|
45
46
|
* child: {},
|
|
46
47
|
* mother: {},
|
|
47
48
|
* father: {},
|
|
48
|
-
* health_facility: {},
|
|
49
|
-
* birth_informant: {}
|
|
50
49
|
* })
|
|
51
50
|
* @function
|
|
52
51
|
* @public
|