@openfn/language-ghana-bdr 0.1.0

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.
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Executes an operation.
3
+ * @function
4
+ * @private
5
+ * @param {Operation} operations - Operations
6
+ * @returns {State}
7
+ */
8
+ export function execute(...operations: Operation): State;
9
+ /**
10
+ /**
11
+ * State object
12
+ * @typedef {Object} HttpState
13
+ * @property data - the parsed response body
14
+ * @property response - the response from the HTTP server, including headers, statusCode, body, etc
15
+ * @property references - an array of all previous data objects used in the Job
16
+ **/
17
+ /**
18
+ * Make a GET request
19
+ * @example
20
+ * get("patient");
21
+ * @function
22
+ * @public
23
+ * @param {string} path - Path to resource
24
+ * @param {object} query - An object of query parameters to be encoded into the URL.
25
+ * @returns {Operation}
26
+ * @state {HttpState}
27
+ */
28
+ export function get(path: string, query: object): Operation;
29
+ /**
30
+ * Make a POST request
31
+ * @example
32
+ * post("patient", { "name":"Bukayo" });
33
+ * @function
34
+ * @public
35
+ * @param {string} path - Path to resource
36
+ * @param {object} data - 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).
37
+ * @returns {Operation}
38
+ * @state {HttpState}
39
+ */
40
+ export function post(path: string, data: object): Operation;
41
+ /**
42
+ * Generate a birth certificate
43
+ * @example
44
+ * sendBirthNotification({
45
+ * babyData: {
46
+ * dateOfBirth: "string",
47
+ * fatherName: "string",
48
+ * forenames: "string",
49
+ * gender: "string",
50
+ * lightwaveETrackerID: "string",
51
+ * motherName: "string",
52
+ * noSiblingsInDelivery: "string",
53
+ * placeOfBirth: "string",
54
+ * surname: "string",
55
+ * timeOfbirth: "string",
56
+ * weightAtBirth: "string",
57
+ * babyPicture: "string"
58
+ * },
59
+ * personVouching: {
60
+ * etrackerLightwaveID: "string",
61
+ * ghanaCardPIN: "string",
62
+ * relationToBaby: "string",
63
+ * relativePhone: "string",
64
+ * relativePicture: "string"
65
+ * },
66
+ * merchantKey: "XXXXXXXXXXXXXXXXXXXXXX"
67
+ * })
68
+ * @function
69
+ * @public
70
+ * @param {object} data - 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).
71
+ * @returns {Operation}
72
+ * @state {HttpState}
73
+ */
74
+ export function sendBirthNotification(data: object): Operation;
75
+ /**
76
+ * /**
77
+ * State object
78
+ */
79
+ export type HttpState = {
80
+ /**
81
+ * - the parsed response body
82
+ */
83
+ data: any;
84
+ /**
85
+ * - the response from the HTTP server, including headers, statusCode, body, etc
86
+ */
87
+ response: any;
88
+ /**
89
+ * - an array of all previous data objects used in the Job
90
+ */
91
+ references: any;
92
+ };
93
+ export { fn, fnIf, each, merge, field, fields, cursor, dateFns, dataPath, dataValue, sourceValue, lastReferenceValue } from "@openfn/language-common";
@@ -0,0 +1,3 @@
1
+ export default Adaptor;
2
+ export * from "./Adaptor";
3
+ import * as Adaptor from "./Adaptor";
@@ -0,0 +1,10 @@
1
+ export function createServer(url?: string): {
2
+ agent: MockAgent<MockAgent.Options>;
3
+ request: ({ method, path, data, ...rest }: {
4
+ [x: string]: any;
5
+ method: any;
6
+ path: any;
7
+ data: any;
8
+ }) => Promise<import("undici/types/dispatcher").default.ResponseData>;
9
+ };
10
+ import { MockAgent } from "undici/types";
@@ -0,0 +1,3 @@
1
+ export function setMockClient(mockClient: any): void;
2
+ export function prepareNextState(state: any, response: any): Promise<any>;
3
+ export function request(path: any, options: any): (state: any) => Promise<any>;