Skip to content

Commit

Permalink
format and remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
taylordowns2000 committed Jan 27, 2025
1 parent 795951f commit 1723b08
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 53 deletions.
20 changes: 5 additions & 15 deletions packages/ghana-bdr/configuration-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,23 @@
"description": "The base URL (http://www.example.com)",
"format": "uri",
"minLength": 1,
"examples": [
"https://example.com"
]
"examples": ["https://example.com"]
},
"username": {
"title": "Username",
"type": "string",
"description": "Username",
"examples": [
"[email protected]"
]
"examples": ["[email protected]"]
},
"password": {
"title": "Password",
"type": "string",
"description": "Password",
"writeOnly": true,
"examples": [
"@some(!)Str0ngp4ss0w0rd"
]
"examples": ["@some(!)Str0ngp4ss0w0rd"]
}
},
"type": "object",
"additionalProperties": true,
"required": [
"password",
"username",
"baseUrl"
]
}
"required": ["password", "username", "baseUrl"]
}
44 changes: 22 additions & 22 deletions packages/ghana-bdr/src/Adaptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,28 +67,28 @@ export function post(path, data) {
/**
* Generate a birth certificate
* @example
* sendBirthNotification({
* babyData: {
* dateOfBirth: "string",
* fatherName: "string",
* forenames: "string",
* gender: "string",
* lightwaveETrackerID: "string",
* motherName: "string",
* noSiblingsInDelivery: "string",
* placeOfBirth: "string",
* surname: "string",
* timeOfbirth: "string",
* weightAtBirth: "string",
* babyPicture: "string"
* },
* personVouching: {
* etrackerLightwaveID: "string",
* ghanaCardPIN: "string",
* relationToBaby: "string",
* relativePhone: "string",
* relativePicture: "string"
* },
* sendBirthNotification({
* babyData: {
* dateOfBirth: "string",
* fatherName: "string",
* forenames: "string",
* gender: "string",
* lightwaveETrackerID: "string",
* motherName: "string",
* noSiblingsInDelivery: "string",
* placeOfBirth: "string",
* surname: "string",
* timeOfbirth: "string",
* weightAtBirth: "string",
* babyPicture: "string"
* },
* personVouching: {
* etrackerLightwaveID: "string",
* ghanaCardPIN: "string",
* relationToBaby: "string",
* relativePhone: "string",
* relativePicture: "string"
* },
* merchantKey: "XXXXXXXXXXXXXXXXXXXXXX"
* })
* @function
Expand Down
2 changes: 1 addition & 1 deletion packages/ghana-bdr/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const request = (path, options) => {
if (data) {
args.body = JSON.stringify(data);
}

const response = await client.request(args);
if (response.statusCode >= 400) {
throwError('BDR_ERROR', {
Expand Down
15 changes: 4 additions & 11 deletions packages/ghana-nia/configuration-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,16 @@
"description": "The base URL (http://www.example.com)",
"format": "uri",
"minLength": 1,
"examples": [
"https://example.com"
]
"examples": ["https://example.com"]
},
"niaMerchantKey": {
"title": "NIA Merchant Key",
"type": "string",
"description": "NI Merchant Key",
"examples": [
"abc-123-def"
]
"examples": ["abc-123-def"]
}
},
"type": "object",
"additionalProperties": true,
"required": [
"baseUrl",
"niaMerchantKey"
]
}
"required": ["baseUrl", "niaMerchantKey"]
}
9 changes: 5 additions & 4 deletions packages/ghana-nia/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
throwError,
logResponse,
expandReferences,
makeBasicAuthHeader,
} from '@openfn/language-common/util';
import { composeNextState } from '@openfn/language-common';

Expand Down Expand Up @@ -52,13 +51,15 @@ export const request = (path, options) => {

const {
data,
headers = { 'content-type': 'application/json', 'NIa_merchantKey': niaMerchantKey },
headers = {
'content-type': 'application/json',
NIa_merchantKey: niaMerchantKey,
},
method = 'POST',
query,
...otherOptions
} = resolvedoptions;


const safePath = resolvedPath
? nodepath.join(basePath, resolvedPath)
: basePath;
Expand Down Expand Up @@ -90,4 +91,4 @@ export const request = (path, options) => {
logResponse(response);
return prepareNextState(state, response);
};
};
};

0 comments on commit 1723b08

Please sign in to comment.