Skip to content

Commit 75fdffc

Browse files
Merge pull request #13 from mxenabled/bm/readme_and_openapi_updates
README and OpenAPI updates
2 parents 500cfcd + c137454 commit 75fdffc

File tree

5 files changed

+121
-30
lines changed

5 files changed

+121
-30
lines changed

README.md

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
1-
*This project is currently in **Beta**. Please open up an issue [here](https://github.com/mxenabled/mx-platform-node/issues) to report issues using the MX Platform API Node Library.*
1+
*This project is currently in **Beta**. Please open up an issue [here](https://github.com/mxenabled/mx-platform-node/issues) to report issues using the MX Platform Node.js library.*
22

3-
## MX Platform Node
3+
# MX Platform Node.js
44

5-
A Node.js library for the [MX Platform API](https://www.mx.com/products/platform-api).
5+
The [MX Platform API](https://www.mx.com/products/platform-api) is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions.
66

7-
### Documentation
7+
## Documentation
88

9-
See the [documentation](https://docs.mx.com/api).
9+
Examples for the API endpoints can be found [here.](https://docs.mx.com/api)
1010

11-
### Install
11+
## Requirements
1212

13-
To build and compile the typescript sources to javascript use:
14-
15-
```shell
16-
$ npm install mx-platform-node
17-
```
18-
19-
### Getting Started
20-
21-
The [openapi-generator](https://github.com/OpenAPITools/openapi-generator) creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
13+
The generated Node module can be used in the following environments:
2214

2315
Environment
2416
* Node.js
@@ -33,15 +25,31 @@ Module system
3325
* CommonJS
3426
* ES6 module system
3527

28+
## Installation
29+
30+
To build and compile the TypeScript sources to JavaScript use:
31+
32+
```shell
33+
npm install mx-platform-node
34+
```
35+
36+
## Getting Started
37+
3638
In order to make requests, you will need to [sign up](https://dashboard.mx.com/sign_up) for the MX Platform API and get a `Client ID` and `API Key`.
3739

40+
Please follow the [installation](#installation) procedure and then run the following code to create your first User:
41+
3842
```javascript
3943
import { Configuration, MxPlatformApi } from 'mx-platform-node';
4044

4145
const configuration = new Configuration({
46+
// Configure with your Client ID/API Key from https://dashboard.mx.com
47+
username: 'Your Client ID',
48+
password: 'Your API Key',
49+
50+
// Configure environment. https://int-api.mx.com for development, https://api.mx.com for production
4251
basePath: 'https://int-api.mx.com',
43-
username: 'Client ID',
44-
password: 'API Key',
52+
4553
baseOptions: {
4654
headers: {
4755
Accept: 'application/vnd.mx.api.v1+json'
@@ -51,13 +59,30 @@ const configuration = new Configuration({
5159

5260
const client = new MxPlatformApi(configuration);
5361

54-
const userGuid = 'USR-123';
62+
const requestBody = {
63+
user: {
64+
metadata: 'Creating a user!'
65+
}
66+
};
5567

56-
const response = await client.readUser(userGuid);
68+
const response = await client.createUser(requestBody);
5769

5870
console.log(response.data);
5971
```
6072

73+
## Development
74+
75+
This project was generated by the [OpenAPI Generator](https://openapi-generator.tech). To generate this library, verify you have the latest version of the `openapi-generator-cli` found [here.](https://github.com/OpenAPITools/openapi-generator#17---npm)
76+
77+
Running the following command in this repo's directory will generate this library using the [MX Platform API OpenAPI spec](https://github.com/mxenabled/openapi/blob/master/openapi/mx_platform_api_beta.yml) with our [configuration and templates.](https://github.com/mxenabled/mx-platform-ruby/tree/master/openapi)
78+
```shell
79+
openapi-generator-cli generate \
80+
-i https://raw.githubusercontent.com/mxenabled/openapi/master/openapi/mx_platform_api_beta.yml \
81+
-g typescript-axios \
82+
-c ./openapi/config.yml \
83+
-t ./openapi/templates
84+
```
85+
6186
## Contributing
6287

63-
Bug reports and pull requests are welcome on [GitHub](https://github.com/mxenabled/mx-platform-node).
88+
Please [open an issue](https://github.com/mxenabled/mx-platform-node/issues) or [submit a pull request.](https://github.com/mxenabled/mx-platform-node/pulls)

api.ts

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,18 +970,42 @@ export interface EnhanceTransactionResponse {
970970
* @memberof EnhanceTransactionResponse
971971
*/
972972
'amount'?: number | null;
973+
/**
974+
*
975+
* @type {number}
976+
* @memberof EnhanceTransactionResponse
977+
*/
978+
'categorized_by'?: number | null;
973979
/**
974980
*
975981
* @type {string}
976982
* @memberof EnhanceTransactionResponse
977983
*/
978984
'category'?: string | null;
985+
/**
986+
*
987+
* @type {string}
988+
* @memberof EnhanceTransactionResponse
989+
*/
990+
'category_guid'?: string | null;
991+
/**
992+
*
993+
* @type {number}
994+
* @memberof EnhanceTransactionResponse
995+
*/
996+
'described_by'?: number | null;
979997
/**
980998
*
981999
* @type {string}
9821000
* @memberof EnhanceTransactionResponse
9831001
*/
9841002
'description'?: string | null;
1003+
/**
1004+
*
1005+
* @type {string}
1006+
* @memberof EnhanceTransactionResponse
1007+
*/
1008+
'extended_transaction_type'?: string | null;
9851009
/**
9861010
*
9871011
* @type {string}
@@ -1036,6 +1060,18 @@ export interface EnhanceTransactionResponse {
10361060
* @memberof EnhanceTransactionResponse
10371061
*/
10381062
'is_payroll_advance'?: boolean | null;
1063+
/**
1064+
*
1065+
* @type {boolean}
1066+
* @memberof EnhanceTransactionResponse
1067+
*/
1068+
'is_subscription'?: boolean | null;
1069+
/**
1070+
*
1071+
* @type {string}
1072+
* @memberof EnhanceTransactionResponse
1073+
*/
1074+
'memo'?: string | null;
10391075
/**
10401076
*
10411077
* @type {number}
@@ -1048,6 +1084,12 @@ export interface EnhanceTransactionResponse {
10481084
* @memberof EnhanceTransactionResponse
10491085
*/
10501086
'merchant_guid'?: string;
1087+
/**
1088+
*
1089+
* @type {string}
1090+
* @memberof EnhanceTransactionResponse
1091+
*/
1092+
'merchant_location_guid'?: string | null;
10511093
/**
10521094
*
10531095
* @type {string}
@@ -1079,12 +1121,24 @@ export interface EnhanceTransactionsRequest {
10791121
* @memberof EnhanceTransactionsRequest
10801122
*/
10811123
'description': string;
1124+
/**
1125+
*
1126+
* @type {string}
1127+
* @memberof EnhanceTransactionsRequest
1128+
*/
1129+
'extended_transaction_type'?: string;
10821130
/**
10831131
*
10841132
* @type {string}
10851133
* @memberof EnhanceTransactionsRequest
10861134
*/
10871135
'id': string;
1136+
/**
1137+
*
1138+
* @type {string}
1139+
* @memberof EnhanceTransactionsRequest
1140+
*/
1141+
'memo'?: string;
10881142
/**
10891143
*
10901144
* @type {number}
@@ -3118,6 +3172,12 @@ export interface TransactionResponse {
31183172
* @memberof TransactionResponse
31193173
*/
31203174
'category'?: string | null;
3175+
/**
3176+
*
3177+
* @type {string}
3178+
* @memberof TransactionResponse
3179+
*/
3180+
'category_guid'?: string | null;
31213181
/**
31223182
*
31233183
* @type {string}
@@ -3148,6 +3208,12 @@ export interface TransactionResponse {
31483208
* @memberof TransactionResponse
31493209
*/
31503210
'description'?: string | null;
3211+
/**
3212+
*
3213+
* @type {string}
3214+
* @memberof TransactionResponse
3215+
*/
3216+
'extended_transaction_type'?: string | null;
31513217
/**
31523218
*
31533219
* @type {string}

openapi/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
npmName: "mx-platform-node"
2-
npmVersion: 0.4.1
2+
npmVersion: 0.4.2
33
supportsES6: true

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mx-platform-node",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"description": "A Node library for the MX Platform API.",
55
"author": "MX",
66
"keywords": [

0 commit comments

Comments
 (0)