diff --git a/docs/Developers/types.js b/docs/Developers/types.js index 432126adaf..b1cd6fcfe7 100644 --- a/docs/Developers/types.js +++ b/docs/Developers/types.js @@ -10,17 +10,17 @@ export let types = { UUID - ) + ), }, month: { name: 'month', type: 'string', - description: YYYY-MM + description: YYYY-MM, }, date: { name: 'date', type: 'string', - description: YYYY-MM-DD + description: YYYY-MM-DD, }, amount: { name: 'amount', @@ -32,15 +32,15 @@ export let types = { depends on your currency. For example, a USD amount of{' '} $120.30 would be 12030. - ) - } + ), + }, }; export let objects = { transaction: [ { name: 'id', - type: types.id + type: types.id, }, { name: 'account', type: types.id, required: true }, { name: 'date', type: 'date', required: true }, @@ -53,7 +53,7 @@ export let objects = { In a create request, this overrides{' '} payee_name. - ) + ), }, { name: 'payee_name', @@ -66,13 +66,13 @@ export let objects = { * Only available in a create request - ) + ), }, { name: 'imported_payee', type: 'string', description: - 'This can be anything. Meant to represent the raw description when importing, allowing the user to see the original value.' + 'This can be anything. Meant to represent the raw description when importing, allowing the user to see the original value.', }, { name: 'category', type: types.id }, { name: 'notes', type: 'string' }, @@ -80,7 +80,7 @@ export let objects = { name: 'imported_id', type: 'string', description: - 'A unique id usually given by the bank, if importing. Use this is avoid duplicate transactions.' + 'A unique id usually given by the bank, if importing. Use this is avoid duplicate transactions.', }, { name: 'transfer_id', @@ -90,14 +90,14 @@ export let objects = { If a transfer, the id of the transaction in the other account for the transfer. See transfers. - ) + ), }, { name: 'cleared', type: 'boolean', description: ( A flag indicating if the transaction has cleared or not. - ) + ), }, { name: 'subtransactions', @@ -111,8 +111,8 @@ export let objects = { * Only available in a get or{' '} create request - ) - } + ), + }, ], account: [ @@ -122,7 +122,7 @@ export let objects = { name: 'type', type: 'string', required: true, - description: 'Must be a valid type. See notes below.' + description: 'Must be a valid type. See notes below.', }, { name: 'offbudget', @@ -131,7 +131,7 @@ export let objects = { Defaults to false - ) + ), }, { name: 'closed', @@ -140,8 +140,8 @@ export let objects = { Defaults to false - ) - } + ), + }, ], category: [ @@ -155,8 +155,8 @@ export let objects = { Defaults to false - ) - } + ), + }, ], categoryGroup: [ @@ -169,7 +169,7 @@ export let objects = { Defaults to false - ) + ), }, { name: 'categories', @@ -182,8 +182,8 @@ export let objects = { Only available in a get. - ) - } + ), + }, ], payee: [ @@ -198,8 +198,8 @@ export let objects = { The id of the account this payee transfers to/from, if this is a transfer payee. - ) - } + ), + }, ], payeeRule: [ @@ -213,14 +213,14 @@ export let objects = { Must be one of equals or contains - ) + ), }, { name: 'value', type: 'string', - description: 'Value to match imported payee names on' - } - ] + description: 'Value to match imported payee names on', + }, + ], }; function Table({ style, headers, className, children }) { @@ -228,7 +228,7 @@ function Table({ style, headers, className, children }) { - {headers.map(header => ( + {headers.map((header) => ( ))} @@ -241,7 +241,7 @@ function Table({ style, headers, className, children }) { export function PrimitiveTypeList() { return (
{header}
- {Object.keys(types).map(name => { + {Object.keys(types).map((name) => { return ( - {fields.map(field => { + {fields.map((field) => { return (
@@ -300,11 +300,23 @@ export function StructType({ name, fields }) { } function Argument({ arg }) { + if (arg.properties) { + return ( + + {arg.name} + {': { '} + {arg.properties + .map((prop) => ) + .map(insertCommas)} + {' }'} + + ); + } return ( - + {arg.type} @@ -325,26 +337,8 @@ export function Method({ name, args, returns = 'Promise', children }) {

- {name}( - {args.map((arg, idx) => { - if (arg.properties) { - return arg.properties.map(prop => { - if (prop.properties) { - return [ - prop.name, - ': { ', - prop.properties.map(p => { - return ; - }), - ' }' - ]; - } - return ; - }).map(insertCommas) - } - return ; - }).map(insertCommas)} - ) → {returns} + {name}({args.map((arg) => ).map(insertCommas)}){' '} + → {returns}
{children && React.cloneElement(children, {})} diff --git a/docs/Developers/using-the-API.md b/docs/Developers/using-the-API.md index a532e1331a..25c098d22a 100644 --- a/docs/Developers/using-the-API.md +++ b/docs/Developers/using-the-API.md @@ -94,7 +94,7 @@ These are the public methods that you can use. The API also exports low-level fu #### `init` - + After connecting to the budget `budgetId`, run the function. This function can assume all API methods are ready to use.