Skip to content

Commit 721ff48

Browse files
committed
use openapi-generator for NodeJS client
1 parent ed32cfe commit 721ff48

76 files changed

Lines changed: 8962 additions & 7353 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

rest_client_js/.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["env", "stage-0"]
3+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4.0.2

rest_client_js/.swagger-codegen/VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

rest_client_js/.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: node_js
2+
cache: npm
3+
node_js:
4+
- "6"
5+
- "6.1"

rest_client_js/README.md

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
# mdes_for_merchants
2+
3+
MdesForMerchants - JavaScript client for mdes_for_merchants
4+
The MDES APIs are designed as RPC style stateless web services where each API endpoint represents an operation to be performed. All request and response payloads are sent in the JSON (JavaScript Object Notation) data-interchange format. Each endpoint in the API specifies the HTTP Method used to access it. All strings in request and response objects are to be UTF-8 encoded. Each API URI includes the major and minor version of API that it conforms to. This will allow multiple concurrent versions of the API to be deployed simultaneously.
5+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
6+
7+
- API version: 1.2.7
8+
- Package version: 1.2.7
9+
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
10+
11+
## Installation
12+
13+
### For [Node.js](https://nodejs.org/)
14+
15+
#### npm
16+
17+
To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).
18+
19+
Then install it via:
20+
21+
```shell
22+
npm install mdes_for_merchants --save
23+
```
24+
25+
Finaly, you need to build the module:
26+
27+
```shell
28+
npm run build
29+
```
30+
31+
##### Local development
32+
33+
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:
34+
35+
```shell
36+
npm install
37+
```
38+
39+
Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:
40+
41+
```shell
42+
npm link
43+
```
44+
45+
To use the link you just defined in your project, switch to the directory you want to use your mdes_for_merchants from, and run:
46+
47+
```shell
48+
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
49+
```
50+
51+
Finaly, you need to build the module:
52+
53+
```shell
54+
npm run build
55+
```
56+
57+
#### git
58+
59+
If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID
60+
then install it via:
61+
62+
```shell
63+
npm install GIT_USER_ID/GIT_REPO_ID --save
64+
```
65+
66+
### For browser
67+
68+
The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
69+
the above steps with Node.js and installing browserify with `npm install -g browserify`,
70+
perform the following (assuming *main.js* is your entry file):
71+
72+
```shell
73+
browserify main.js > bundle.js
74+
```
75+
76+
Then include *bundle.js* in the HTML pages.
77+
78+
### Webpack Configuration
79+
80+
Using Webpack you may encounter the following error: "Module not found: Error:
81+
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
82+
the following section to your webpack config:
83+
84+
```javascript
85+
module: {
86+
rules: [
87+
{
88+
parser: {
89+
amd: false
90+
}
91+
}
92+
]
93+
}
94+
```
95+
96+
## Getting Started
97+
98+
Please follow the [installation](#installation) instruction and execute the following JS code:
99+
100+
```javascript
101+
var MdesForMerchants = require('mdes_for_merchants');
102+
103+
104+
var api = new MdesForMerchants.DeleteApi()
105+
var opts = {
106+
'deleteRequestSchema': new MdesForMerchants.DeleteRequestSchema() // {DeleteRequestSchema} Contains the details of the request message.
107+
};
108+
var callback = function(error, data, response) {
109+
if (error) {
110+
console.error(error);
111+
} else {
112+
console.log('API called successfully. Returned data: ' + data);
113+
}
114+
};
115+
api.deleteDigitization(opts, callback);
116+
117+
```
118+
119+
## Documentation for API Endpoints
120+
121+
All URIs are relative to *https://api.mastercard.com/mdes*
122+
123+
Class | Method | HTTP request | Description
124+
------------ | ------------- | ------------- | -------------
125+
*MdesForMerchants.DeleteApi* | [**deleteDigitization**](docs/DeleteApi.md#deleteDigitization) | **POST** /digitization/static/1/0/delete | Used to delete one or more Tokens. The API is limited to 10 Tokens per request.
126+
*MdesForMerchants.GetAssetApi* | [**getAsset**](docs/GetAssetApi.md#getAsset) | **GET** /assets/static/1/0/asset/{AssetId} | Used to retrieve static Assets from MDES�s repository, such as Card art, MasterCard brand logos, Issuer logos, and Terms and Conditions.
127+
*MdesForMerchants.GetTaskStatusApi* | [**getTaskStatus**](docs/GetTaskStatusApi.md#getTaskStatus) | **POST** /digitization/static/1/0/getTaskStatus | Used to check the status of any asynchronous task that was previously requested.
128+
*MdesForMerchants.GetTokenApi* | [**getToken**](docs/GetTokenApi.md#getToken) | **POST** /digitization/static/1/0/getToken | Used to get the status and details of a single given Token.
129+
*MdesForMerchants.NotifyTokenUpdatedApi* | [**notifyTokenUpdateForTokenStateChange**](docs/NotifyTokenUpdatedApi.md#notifyTokenUpdateForTokenStateChange) | **POST** /digitization/static/1/0/notifyTokenUpdated | Outbound API used by MDES to notify the Token Requestor of significant Token updates, such as when the Token is activated, suspended, unsuspended or deleted; or when information about the Token or its product configuration has changed.
130+
*MdesForMerchants.SearchTokensApi* | [**searchTokens**](docs/SearchTokensApi.md#searchTokens) | **POST** /digitization/static/1/0/searchTokens | Used to get basic token information for all tokens on a specified device, or all tokens mapped to the given Account PAN.
131+
*MdesForMerchants.SuspendApi* | [**createSuspend**](docs/SuspendApi.md#createSuspend) | **POST** /digitization/static/1/0/suspend | Used to temporarily suspend one or more Tokens (for example, suspending all Tokens on a device in response to the device being lost). The API is limited to 10 Tokens per request.
132+
*MdesForMerchants.TokenizeApi* | [**createTokenize**](docs/TokenizeApi.md#createTokenize) | **POST** /digitization/static/1/0/tokenize | Used to digitize a card to create a server-based Token.
133+
*MdesForMerchants.TransactApi* | [**createTransact**](docs/TransactApi.md#createTransact) | **POST** /remotetransaction/static/1/0/transact | Used by the Token Requestor to create a Digital Secure Remote Payment (\&quot;DSRP\&quot;) transaction cryptogram using the credentials stored within MDES in order to perform a DSRP transaction.
134+
*MdesForMerchants.UnsuspendApi* | [**createUnsuspend**](docs/UnsuspendApi.md#createUnsuspend) | **POST** /digitization/static/1/0/unsuspend | Used to unsuspend one or more previously suspended Tokens. The API is limited to 10 Tokens per request.
135+
136+
137+
## Documentation for Models
138+
139+
- [MdesForMerchants.AssetResponseSchema](docs/AssetResponseSchema.md)
140+
- [MdesForMerchants.AuthenticationMethods](docs/AuthenticationMethods.md)
141+
- [MdesForMerchants.BillingAddress](docs/BillingAddress.md)
142+
- [MdesForMerchants.CardInfo](docs/CardInfo.md)
143+
- [MdesForMerchants.CardInfoData](docs/CardInfoData.md)
144+
- [MdesForMerchants.DecisioningData](docs/DecisioningData.md)
145+
- [MdesForMerchants.DeleteRequestSchema](docs/DeleteRequestSchema.md)
146+
- [MdesForMerchants.DeleteResponseSchema](docs/DeleteResponseSchema.md)
147+
- [MdesForMerchants.EncryptedPayload](docs/EncryptedPayload.md)
148+
- [MdesForMerchants.EncryptedPayloadTransact](docs/EncryptedPayloadTransact.md)
149+
- [MdesForMerchants.Error](docs/Error.md)
150+
- [MdesForMerchants.ErrorsResponse](docs/ErrorsResponse.md)
151+
- [MdesForMerchants.GetTaskStatusRequestSchema](docs/GetTaskStatusRequestSchema.md)
152+
- [MdesForMerchants.GetTaskStatusResponseSchema](docs/GetTaskStatusResponseSchema.md)
153+
- [MdesForMerchants.GetTokenRequestSchema](docs/GetTokenRequestSchema.md)
154+
- [MdesForMerchants.GetTokenResponseSchema](docs/GetTokenResponseSchema.md)
155+
- [MdesForMerchants.MediaContent](docs/MediaContent.md)
156+
- [MdesForMerchants.NotifyTokenEncryptedPayload](docs/NotifyTokenEncryptedPayload.md)
157+
- [MdesForMerchants.NotifyTokenUpdatedRequestSchema](docs/NotifyTokenUpdatedRequestSchema.md)
158+
- [MdesForMerchants.NotifyTokenUpdatedResponseSchema](docs/NotifyTokenUpdatedResponseSchema.md)
159+
- [MdesForMerchants.ProductConfig](docs/ProductConfig.md)
160+
- [MdesForMerchants.SearchTokensRequestSchema](docs/SearchTokensRequestSchema.md)
161+
- [MdesForMerchants.SearchTokensResponseSchema](docs/SearchTokensResponseSchema.md)
162+
- [MdesForMerchants.SuspendRequestSchema](docs/SuspendRequestSchema.md)
163+
- [MdesForMerchants.SuspendResponseSchema](docs/SuspendResponseSchema.md)
164+
- [MdesForMerchants.Token](docs/Token.md)
165+
- [MdesForMerchants.TokenDetail](docs/TokenDetail.md)
166+
- [MdesForMerchants.TokenDetailData](docs/TokenDetailData.md)
167+
- [MdesForMerchants.TokenDetailDataPAR](docs/TokenDetailDataPAR.md)
168+
- [MdesForMerchants.TokenDetailTokenizeResponse](docs/TokenDetailTokenizeResponse.md)
169+
- [MdesForMerchants.TokenForLCM](docs/TokenForLCM.md)
170+
- [MdesForMerchants.TokenInfo](docs/TokenInfo.md)
171+
- [MdesForMerchants.TokenizeRequestSchema](docs/TokenizeRequestSchema.md)
172+
- [MdesForMerchants.TokenizeResponseSchema](docs/TokenizeResponseSchema.md)
173+
- [MdesForMerchants.TransactEncryptedData](docs/TransactEncryptedData.md)
174+
- [MdesForMerchants.TransactError](docs/TransactError.md)
175+
- [MdesForMerchants.TransactRequestSchema](docs/TransactRequestSchema.md)
176+
- [MdesForMerchants.TransactResponseSchema](docs/TransactResponseSchema.md)
177+
- [MdesForMerchants.UnSuspendRequestSchema](docs/UnSuspendRequestSchema.md)
178+
- [MdesForMerchants.UnSuspendResponseSchema](docs/UnSuspendResponseSchema.md)
179+
180+
181+
## Documentation for Authorization
182+
183+
All endpoints do not require authorization.

rest_client_js/git_push.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/sh
2+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
3+
#
4+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
5+
6+
git_user_id=$1
7+
git_repo_id=$2
8+
release_note=$3
9+
10+
if [ "$git_user_id" = "" ]; then
11+
git_user_id="GIT_USER_ID"
12+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
13+
fi
14+
15+
if [ "$git_repo_id" = "" ]; then
16+
git_repo_id="GIT_REPO_ID"
17+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
18+
fi
19+
20+
if [ "$release_note" = "" ]; then
21+
release_note="Minor update"
22+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
23+
fi
24+
25+
# Initialize the local directory as a Git repository
26+
git init
27+
28+
# Adds the files in the local repository and stages them for commit.
29+
git add .
30+
31+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
32+
git commit -m "$release_note"
33+
34+
# Sets the new remote
35+
git_remote=`git remote`
36+
if [ "$git_remote" = "" ]; then # git remote not defined
37+
38+
if [ "$GIT_TOKEN" = "" ]; then
39+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the Git credential in your environment."
40+
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
41+
else
42+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
43+
fi
44+
45+
fi
46+
47+
git pull origin master
48+
49+
# Pushes (Forces) the changes in the local repository up to the remote repository
50+
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
51+
git push origin master 2>&1 | grep -v 'To https'
52+

0 commit comments

Comments
 (0)