-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from noradomi/feature/add-tokenization-api
Feature : add tokenization api
- Loading branch information
Showing
73 changed files
with
4,167 additions
and
480 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/src/zalopay/typings/**/*.ts | ||
/examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
parser: "@typescript-eslint/parser", | ||
plugins: ["@typescript-eslint"], | ||
env: { | ||
es6: true, | ||
node: true | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 6, | ||
sourceType: "module", | ||
ecmaFeatures: { | ||
modules: true | ||
}, | ||
project: path.resolve(__dirname, "./tsconfig.json"), | ||
tsconfigRootDir: __dirname | ||
}, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
rules: { | ||
quotes: ["error", "double"], | ||
semi: ["error", "always"], | ||
"@typescript-eslint/no-non-null-assertion": 0, | ||
"@typescript-eslint/ban-types": [ | ||
"error", | ||
{ | ||
"extendDefaults": true, | ||
"types": { | ||
"{}": false | ||
} | ||
} | ||
] | ||
}, | ||
overrides: [ | ||
{ | ||
files: ["*.ts"], | ||
rules: { | ||
"no-dupe-class-members": "off" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
|
||
.idea | ||
# dependencies | ||
/node_modules | ||
package-lock.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## Contribution guidelines | ||
|
||
### Add new API | ||
To adding a new api, for example TokenizationAPI | ||
- Update Open API specification in `specs` folder to latest. | ||
- Generate request, response models by run the script in `scripts/generate.sh` | ||
- Add new service and related resources in `services` folder. | ||
- Update `services/index.ts` to expose new service API to client. | ||
- Add unit tests for new service in `__tests__` folder and verify by run `npm run test`. | ||
- Check coding style by `npm run lint` and fix issues if having by `npm run lint:fix`. | ||
|
||
### How to contribute step-by-step | ||
1. Fork the [zalopay-oss/zalopay-nodejs](https://github.com/zalopay-oss/zalopay-nodejs) repository. | ||
2. Create a new branch from main in your fork. This makes it easier for you to keep track of your changes. | ||
3. Make the desired changes to the code. | ||
- If you are adding new functionality or fixing a bug, we recommend you add unit tests that cover it. | ||
4. Push the changes to your fork. | ||
5. Create a pull request to the [zalopay-oss/zalopay-nodejs](https://github.com/zalopay-oss/zalopay-nodejs) repository. | ||
6. In your pull request, please describe in detail: | ||
- What problem you’re solving | ||
- Your approach to fixing the problem | ||
- Any tests you wrote | ||
7. Check Allow edits from maintainers. | ||
8. Create the pull request. | ||
9. Ensure that all checks have passed. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
module.exports = { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
testMatch: [ | ||
"**/src/zalopay/__tests__/**/*.test.ts" | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", | ||
"spaces": 2, | ||
"generator-cli": { | ||
"version": "6.5.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
# Generate models from specification | ||
# Make sure Open API specification in specs folder is latest | ||
openapi-generator-cli generate \ | ||
-i specs/* \ | ||
-g typescript-node \ | ||
-t templates/typescript \ | ||
-o build \ | ||
--global-property models,supportingFiles \ | ||
--additional-properties=serviceName=Tokenization \ | ||
--additional-properties=modelPropertyNaming=original \ | ||
--additional-properties=helperFunctions=./templates/helpers/camelCase.ts | ||
|
||
rm src/zalopay/models/* | ||
cp build/model/* src/zalopay/models | ||
rm -r build |
Oops, something went wrong.