Skip to content

Commit 754503a

Browse files
Merge pull request #21 from mxenabled/bm/update_files
Update generate
2 parents 5f45e10 + 60bef29 commit 754503a

File tree

7 files changed

+105
-31
lines changed

7 files changed

+105
-31
lines changed

.openapi-generator-ignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
git_push.sh
2-
tsconfig.json
3-
README.md

.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
.gitignore
22
.npmignore
3+
README.md
34
api.ts
45
base.ts
56
common.ts
67
configuration.ts
78
index.ts
89
package.json
10+
tsconfig.json

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const configuration = new Configuration({
6060
const client = new MxPlatformApi(configuration);
6161

6262
const requestBody = {
63-
user: {
63+
user: {
6464
metadata: 'Creating a user!'
6565
}
6666
};

openapi/templates/README.mustache

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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.*
2+
3+
# MX Platform Node.js
4+
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.
6+
7+
## Documentation
8+
9+
Examples for the API endpoints can be found [here.](https://docs.mx.com/api)
10+
11+
## Requirements
12+
13+
The generated Node module can be used in the following environments:
14+
15+
Environment
16+
* Node.js
17+
* Webpack
18+
* Browserify
19+
20+
Language level
21+
* ES5 - you must have a Promises/A+ library installed
22+
* ES6
23+
24+
Module system
25+
* CommonJS
26+
* ES6 module system
27+
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+
38+
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`.
39+
40+
Please follow the [installation](#installation) procedure and then run the following code to create your first User:
41+
42+
```javascript
43+
import { Configuration, MxPlatformApi } from 'mx-platform-node';
44+
45+
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
51+
basePath: 'https://int-api.mx.com',
52+
53+
baseOptions: {
54+
headers: {
55+
Accept: 'application/vnd.mx.api.v1+json'
56+
}
57+
}
58+
});
59+
60+
const client = new MxPlatformApi(configuration);
61+
62+
const requestBody = {
63+
user: {
64+
metadata: 'Creating a user!'
65+
}
66+
};
67+
68+
const response = await client.createUser(requestBody);
69+
70+
console.log(response.data);
71+
```
72+
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+
86+
## Contributing
87+
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)

openapitools.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
3+
"spaces": 2,
4+
"generator-cli": {
5+
"version": "5.3.1"
6+
}
7+
}

package-lock.json

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

tsconfig.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
{
22
"compilerOptions": {
3-
"allowJs": true,
43
"declaration": true,
5-
"esModuleInterop": true,
6-
"inlineSourceMap": true,
7-
"inlineSources": true,
84
"target": "es6",
95
"module": "commonjs",
10-
"noFallthroughCasesInSwitch": true,
116
"noImplicitAny": true,
12-
"noImplicitReturns": true,
13-
"noUnusedLocals": true,
147
"outDir": "dist",
15-
"resolveJsonModule": true,
16-
"strict": true,
17-
"suppressImplicitAnyIndexErrors": true,
8+
"rootDir": ".",
189
"typeRoots": [
1910
"node_modules/@types"
2011
]

0 commit comments

Comments
 (0)