Skip to content

Commit

Permalink
Merge pull request #7 from PAYONE-GmbH/release/0.0.3
Browse files Browse the repository at this point in the history
Release/0.0.3
  • Loading branch information
Blackfaded authored Aug 13, 2024
2 parents 486faa8 + 04b8d42 commit dcff53a
Show file tree
Hide file tree
Showing 11 changed files with 152 additions and 20 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
# But include these files and directories
!package.json
!README.md
!LICENSE
!dist/
!dist/**
30 changes: 29 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,35 @@
## 0.0.1 (2024-08-09)
## [0.0.3](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/compare/v0.0.2...v0.0.3) (2024-08-13)

### Documentation

* docs: remove dev note ([affd97ce41f4a0a6d335f003d15d513e09480f92](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/affd97ce41f4a0a6d335f003d15d513e09480f92))

## [0.0.2](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/compare/e9a92f3001fe33df9bdad537b68f999b9e93e805...v0.0.2) (2024-08-12)

### Bug Fixes

* fix: use plain glob export, as otherwise enums cannot be imported ([663cbaa7789878b0db1c7936bf88d1627d4dddad](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/663cbaa7789878b0db1c7936bf88d1627d4dddad))

### Documentation

* docs: add badges, note and formatting to readme ([df6461a8902c8aa6592d77203ad5a844d84d44e1](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/df6461a8902c8aa6592d77203ad5a844d84d44e1))
* docs: add contributing guidelines ([3816787fbee8c7e8d686c8b37587e4c75f93b782](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/3816787fbee8c7e8d686c8b37587e4c75f93b782))
* docs: adjust naming ([ff8d0bd2c53e86ea20799d1d871aeaae1d61ca9d](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/ff8d0bd2c53e86ea20799d1d871aeaae1d61ca9d))
* docs: update readme ([487c39f4b99a7426a52c7e45471f87503986925a](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/487c39f4b99a7426a52c7e45471f87503986925a))
* docs: update readme ([baa39d1afa94d9ab807324d9466921d1bcf56538](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/baa39d1afa94d9ab807324d9466921d1bcf56538))
* docs: update readme ([f3adc58a9b39a4170f4c686dde07bfc1c5dcb6b0](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/f3adc58a9b39a4170f4c686dde07bfc1c5dcb6b0))
* docs: update readme ([4d596a66f3007e3d96e0ef39cacd3f278f507fdc](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/4d596a66f3007e3d96e0ef39cacd3f278f507fdc))
* docs: update readme and add sonar and npm badges ([0526b28226d87c19a9b0ea34a2778aba2ace829a](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/0526b28226d87c19a9b0ea34a2778aba2ace829a))
* docs: update readme with build, test, and release instructions ([62a5c25619d74e43145f6c09424afb8b339980d5](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/62a5c25619d74e43145f6c09424afb8b339980d5))

### Features

* feature(api-calls): discriminate between actual api error responses and retrieval errors ([26fa674bc6376351a778e400d01beb936bd719e2](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/26fa674bc6376351a778e400d01beb936bd719e2))
* feat(api-clients): add client for payment execution, payment information and order management ([4434b586c90c90b5acd39e3f96f8532d38a93e8f](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/4434b586c90c90b5acd39e3f96f8532d38a93e8f))
* feat(apple-pay-transformer): add return type to applePayPaymentToMobilePaymentMethodSpecificInput ([de8674f9fa9873e361a97cad5e1a1d83ed6202e3](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/de8674f9fa9873e361a97cad5e1a1d83ed6202e3))
* feature(apple-pay): add models for payloads received from client communication with apple pay ([cd0e7538150c2a7d6bfc5086fff68137c0e085a9](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/cd0e7538150c2a7d6bfc5086fff68137c0e085a9))
* feat(CheckoutsResponse): all fields are required ([adc1fb4908a6efeb48d466a755ca39cd023d2c69](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/adc1fb4908a6efeb48d466a755ca39cd023d2c69))
* feat(commerce-case-client): use TypeError for missing arguments, handle void responses ([d815f275533559718e3add72a008af350c929290](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/d815f275533559718e3add72a008af350c929290))
* feature(models): convert models to be only types ([ec7fecfad118a413b1aba8d1ba2ae953c9d818cd](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/ec7fecfad118a413b1aba8d1ba2ae953c9d818cd))
* feat(order-model): references could be empty when send as response ([1dd2d51f398e528f65944faed04a1e98a8de16b2](https://github.com/PAYONE-GmbH/PCP-server-nodeJS-SDK/commit/1dd2d51f398e528f65944faed04a1e98a8de16b2))

11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
[![npm](https://img.shields.io/npm/v/pcp-server-nodejs-sdk)](https://www.npmjs.com/package/pcp-server-nodejs-sdk)
[![npm downloads](https://img.shields.io/npm/dw/pcp-server-nodejs-sdk)](https://www.npmjs.com/package/pcp-server-nodejs-sdk)

**NOTE:** This SDK is still under development. Some things may be broken, features may change in non-compatible ways or will be removed completely.

Welcome to the Node SDK for the PAYONE Commerce Platform! This repository contains a powerful, easy-to-use software development kit (SDK) designed to simplify the integration of online payment processing into your applications.

## Table of Contents
Expand Down Expand Up @@ -134,7 +132,7 @@ npm version major|minor|patch

#### Changelog Generation with Conventional Changelog

After versioning, it is recommended to manually trigger the changelog generation script (which uses [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog)).
The changelog gets generated automatically when the npm version gets bumped via `npm version major|minor|patch` within the `version.sh` script.

1. **Conventional Commit Messages**:

Expand All @@ -146,13 +144,6 @@ After versioning, it is recommended to manually trigger the changelog generation
- We enforce conventional commit messages using [Lefthook](https://github.com/evilmartians/lefthook) with [commitlint](https://github.com/conventional-changelog/commitlint).
- This setup ensures that all commit messages are validated before they are committed.

3. **Generate Changelog**:
- Run the changelog generation script to update the `CHANGELOG.md` file:
```sh
npm run changelog
```
- Review and commit the updated changelog before proceeding with the release.

#### Merging the Release Branch

- Create PR on develop branch
Expand Down
95 changes: 95 additions & 0 deletions example-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion example-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
},
"author": "",
"license": "MIT",
"dependencies": {
"pcp-server-nodejs-sdk": "0.0.3"
},
"devDependencies": {
"pcp-server-nodejs-sdk": "0.0.1",
"tsx": "4.17.0",
"typescript": "5.5.4"
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pcp-server-nodejs-sdk",
"version": "0.0.2",
"version": "0.0.3",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ sonar.typescript.tsconfigPath=./tsconfig.json
sonar.javascript.lcov.reportPaths=./coverage/lcov.info

sonar.coverage.exclusions=src/**/*.js,src/models/**,**/*index.ts,src/testutils/**,src/**/*.test.ts
sonar.exclusions=**/node_modules/**,**/*.spec.ts,src/models/**,src/testutils/**
sonar.exclusions=**/node_modules/**,**/*.spec.ts,**/*.test.ts,src/models/**,src/testutils/**
2 changes: 1 addition & 1 deletion src/utils/ServerMetaInfo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('ServerMetaInfo', () => {
test('initializes with correct values', () => {
const serverMetaInfo = new ServerMetaInfo();
expect(serverMetaInfo.platformIdentifier).toBe(`${os.platform()}, node version is: ${process.version}`);
expect(serverMetaInfo.sdkIdentifier).toBe('NodeServerSDK/v0.0.2');
expect(serverMetaInfo.sdkIdentifier).toBe('NodeServerSDK/v0.0.3');
expect(serverMetaInfo.sdkCreator).toBe('PAYONE GmbH');
});
});
2 changes: 1 addition & 1 deletion src/utils/ServerMetaInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class ServerMetaInfo {

constructor(integrator?: string) {
this.platformIdentifier = `${os.platform()}, node version is: ${process.version}`;
this.sdkIdentifier = 'NodeServerSDK/v0.0.2'; // version gets updated with the prepare-release.sh script
this.sdkIdentifier = 'NodeServerSDK/v0.0.3'; // version gets updated with the prepare-release.sh script
this.sdkCreator = 'PAYONE GmbH';
this.integrator = integrator || '';
}
Expand Down
19 changes: 17 additions & 2 deletions version.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
SERVER_META_INFO_PATH='./src/utils/ServerMetaInfo.ts'
SERVER_META_INFO_TEST_PATH='./src/utils/ServerMetaInfo.test.ts'
EXAMPLE_APP_PACKAGE_JSON_PATH='./example-app/package.json'
EXAMPLE_APP_PACKAGE_JSON_LOCK_PATH='./example-app/package-lock.json'
NEW_VERSION=$npm_package_version

if [ -n "$NEW_VERSION" ]; then
if [ -f $SERVER_META_INFO_PATH ]; then
if [[ -f $SERVER_META_INFO_PATH && -f $SERVER_META_INFO_TEST_PATH && -f $EXAMPLE_APP_PACKAGE_JSON_PATH && $EXAMPLE_APP_PACKAGE_JSON_LOCK_PATH ]]; then
sed -i '' "s/NodeServerSDK\/v[0-9]*\.[0-9]*\.[0-9]*/NodeServerSDK\/v$NEW_VERSION/g" ${SERVER_META_INFO_PATH}
sed -i '' "s/NodeServerSDK\/v[0-9]*\.[0-9]*\.[0-9]*/NodeServerSDK\/v$NEW_VERSION/g" ${SERVER_META_INFO_TEST_PATH}
sed -i '' "s/\"pcp-server-nodejs-sdk\": \"[0-9]*\.[0-9]*\.[0-9]*\"/\"pcp-server-nodejs-sdk\": \"$NEW_VERSION\"/g" ${EXAMPLE_APP_PACKAGE_JSON_PATH}
sed -i '' "s/\"pcp-server-nodejs-sdk\": \"[0-9]*\.[0-9]*\.[0-9]*\"/\"pcp-server-nodejs-sdk\": \"$NEW_VERSION\"/g" ${EXAMPLE_APP_PACKAGE_JSON_LOCK_PATH}

git add $SERVER_META_INFO_PATH
git add $SERVER_META_INFO_TEST_PATH
git add $EXAMPLE_APP_PACKAGE_JSON_PATH
git add $EXAMPLE_APP_PACKAGE_JSON_LOCK_PATH
echo "Updated $SERVER_META_INFO_PATH with version $NEW_VERSION"
echo "Updated $SERVER_META_INFO_TEST_PATH with version $NEW_VERSION"
echo "Updated $EXAMPLE_APP_PACKAGE_JSON_PATH with version $NEW_VERSION"
echo "Updated $EXAMPLE_APP_PACKAGE_JSON_LOCK_PATH with version $NEW_VERSION"

else
echo "Could not find $SERVER_META_INFO_PATH"
echo "Could not find some files to update"
exit 1
fi
npm run changelog
git add CHANGELOG.md
echo "Updated CHANGELOG.md"

else
echo "Script can only be run as npm version hook"
Expand Down

0 comments on commit dcff53a

Please sign in to comment.