Skip to content

Commit

Permalink
Merge pull request #1260 from Adyen/automation/release
Browse files Browse the repository at this point in the history
Release v14.3.0
  • Loading branch information
AdyenAutomationBot committed Oct 2, 2023
2 parents 4f32b86 + 9241a2d commit 80fe8f9
Show file tree
Hide file tree
Showing 28 changed files with 817 additions and 151 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ exports.detectChanges = (changeset) => {
break;
case 'breaking-change':
increment = 'major';
break;
return increment;
}
}
}
Expand Down
211 changes: 209 additions & 2 deletions .github/scripts/release.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,195 @@ const comparisonFixture = {
}
};

const associatedPullRequestsMajor = {
"repository": {
"name": "adyen-node-api-library",
"ref": {
"compare": {
"aheadBy": 8,
"commits": {
"edges": [
{
"node": {
"message": "Another commit in the same PR non squashed",
"associatedPullRequests": {
"edges": [
{
"node": {
"number": 20,
"labels": {
"nodes": [
{
"name": "Breaking change"
}
]
}
}
}
]
}
}
},
{
"node": {
"message": "Fixing the constructor",
"associatedPullRequests": {
"edges": [
{
"node": {
"number": 10,
"labels": {
"nodes": [
{
"name": "Fix"
}
]
}
}
}
]
}
}
},
{
"node": {
"message": "Upgrade some service",
"associatedPullRequests": {
"edges": [
{
"node": {
"number": 20,
"labels": {
"nodes": [
{
"name": "Feature"
}
]
}
}
}
]
}
}
},
{
"node": {
"message": "Update CODEOWNERS (#965)",
"associatedPullRequests": {
"edges": [
{
"node": {
"number": 30,
"labels": {
"nodes": []
}
}
}
]
}
}
}
]
}
}
}
}
};

const associatedPullRequestsMinor = {
"repository": {
"name": "adyen-node-api-library",
"ref": {
"compare": {
"aheadBy": 8,
"commits": {
"edges": [
{
"node": {
"message": "Another commit in the same PR non squashed",
"associatedPullRequests": {
"edges": [
{
"node": {
"number": 20,
"labels": {
"nodes": [
{
"name": ""
}
]
}
}
}
]
}
}
},
{
"node": {
"message": "Fixing the constructor",
"associatedPullRequests": {
"edges": [
{
"node": {
"number": 10,
"labels": {
"nodes": [
{
"name": "Feature"
}
]
}
}
}
]
}
}
},
{
"node": {
"message": "Upgrade some service",
"associatedPullRequests": {
"edges": [
{
"node": {
"number": 20,
"labels": {
"nodes": [
{
"name": "Fix"
}
]
}
}
}
]
}
}
},
{
"node": {
"message": "Update CODEOWNERS (#965)",
"associatedPullRequests": {
"edges": [
{
"node": {
"number": 30,
"labels": {
"nodes": []
}
}
}
]
}
}
}
]
}
}
}
}
};
beforeEach(() => {
// Reset env variables
delete process.env.CURRENT_VERSION;
Expand All @@ -134,7 +323,7 @@ test('Detect changes', async t => {

assert.strictEqual(ver, 'major');
});

await t.test('Zero changes', t => {
let sync = structuredClone(comparisonFixture);
sync.repository.ref.compare.aheadBy = 0;
Expand All @@ -158,6 +347,7 @@ test('Detect changes', async t => {
});
});


test('Get next version', async t => {
await t.test('Major', async t => {
const ver = release.nextVersion('13.1.2', 'major');
Expand Down Expand Up @@ -229,4 +419,21 @@ test('Bump', async t => {
await release.bump(options);

assert.strictEqual(core.setOutput.mock.calls.length, 3);
});
});


test('Calculate version major', async t => {
await t.test('Major', t => {
const ver = release.detectChanges(associatedPullRequestsMajor);

assert.strictEqual(ver, 'major');
})
});

test('Calculate version minor', async t => {
await t.test('Minor', t => {
const ver = release.detectChanges(associatedPullRequestsMinor);

assert.strictEqual(ver, 'minor');
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adyen/api-library",
"version": "14.2.0",
"version": "14.3.0",
"description": "The Adyen API Library for NodeJS enables you to work with Adyen APIs.",
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ class Client {
} else {
this.config = new Config();
}
this.liveEndpointUrlPrefix = options.liveEndpointUrlPrefix || '';
this.liveEndpointUrlPrefix = options.liveEndpointUrlPrefix ?? '';

const environment = options.environment || this.config.environment;
const environment = options.environment ?? this.config.environment;
if (environment) {
this.setEnvironment(environment, options.liveEndpointUrlPrefix);
if (options.username && options.password) {
Expand All @@ -80,7 +80,7 @@ class Client {
public setEnvironment(environment: Environment, liveEndpointUrlPrefix?: string): void {
// ensure environment and liveUrlPrefix is set in config
this.config.environment = environment;
this.liveEndpointUrlPrefix = liveEndpointUrlPrefix || "";
this.liveEndpointUrlPrefix = liveEndpointUrlPrefix ?? "";

if (environment === "TEST") {
this.config.marketPayEndpoint = Client.MARKETPAY_ENDPOINT_TEST;
Expand Down
8 changes: 4 additions & 4 deletions src/services/transfers/transactionsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export class TransactionsApi extends Service {
* @summary Get all transactions
* @param createdSince {@link Date } Only include transactions that have been created on or after this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**.
* @param createdUntil {@link Date } Only include transactions that have been created on or before this point in time. The value must be in ISO 8601 format. For example, **2021-05-30T15:07:40Z**.
* @param balancePlatform {@link string } Unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id).
* @param paymentInstrumentId {@link string } Unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/paymentInstruments/_id_).
* @param accountHolderId {@link string } Unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/accountHolders/{id}__queryParam_id).
* @param balanceAccountId {@link string } Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__queryParam_id).
* @param balancePlatform {@link string } The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id). Required if you don\'t provide a `balanceAccountId` or `accountHolderId`.
* @param paymentInstrumentId {@link string } The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/paymentInstruments/_id_). To use this parameter, you must also provide a `balanceAccountId`, `accountHolderId`, or `balancePlatform`. The `paymentInstrumentId` must be related to the `balanceAccountId` or `accountHolderId` that you provide.
* @param accountHolderId {@link string } The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/accountHolders/{id}__queryParam_id). Required if you don\'t provide a `balanceAccountId` or `balancePlatform`. If you provide a `balanceAccountId`, the `accountHolderId` must be related to the `balanceAccountId`.
* @param balanceAccountId {@link string } The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__queryParam_id). Required if you don\'t provide an `accountHolderId` or `balancePlatform`. If you provide an `accountHolderId`, the `balanceAccountId` must be related to the `accountHolderId`.
* @param cursor {@link string } The `cursor` returned in the links of the previous response.
* @param limit {@link number } The number of items returned per page, maximum of 100 items. By default, the response returns 10 items per page.
* @param requestOptions {@link IRequest.Options}
Expand Down
1 change: 1 addition & 0 deletions src/services/transfers/transfersApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class TransfersApi extends Service {

/**
* @summary Transfer funds
* @param wWWAuthenticate {@link string } Header for authenticating through SCA
* @param transferInfo {@link TransferInfo }
* @param requestOptions {@link IRequest.Options}
* @return {@link Transfer }
Expand Down
3 changes: 2 additions & 1 deletion src/typings/checkout/afterpayDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export namespace AfterpayDetails {
export enum TypeEnum {
AfterpayDefault = 'afterpay_default',
Afterpaytouch = 'afterpaytouch',
AfterpayB2b = 'afterpay_b2b'
AfterpayB2b = 'afterpay_b2b',
Clearpay = 'clearpay'
}
}
2 changes: 1 addition & 1 deletion src/typings/checkout/balanceCheckRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class BalanceCheckRequest {
'fraudOffset'?: number;
'installments'?: Installments;
/**
* This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions.
* The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters.
*/
'localizedShopperStatement'?: { [key: string]: string; };
/**
Expand Down
2 changes: 1 addition & 1 deletion src/typings/checkout/donationPaymentRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class DonationPaymentRequest {
*/
'lineItems'?: Array<LineItem>;
/**
* This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned.
* The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters.
*/
'localizedShopperStatement'?: { [key: string]: string; };
'mandate'?: Mandate;
Expand Down
1 change: 0 additions & 1 deletion src/typings/checkout/paymentDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export namespace PaymentDetails {
Knet = 'knet',
Omannet = 'omannet',
GopayWallet = 'gopay_wallet',
Poli = 'poli',
KcpNaverpay = 'kcp_naverpay',
OnlinebankingIn = 'onlinebanking_IN',
Fawry = 'fawry',
Expand Down
2 changes: 1 addition & 1 deletion src/typings/checkout/paymentRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class PaymentRequest {
*/
'lineItems'?: Array<LineItem>;
/**
* This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants should send the Katakana shopperStatement in full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned.
* The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters.
*/
'localizedShopperStatement'?: { [key: string]: string; };
'mandate'?: Mandate;
Expand Down
2 changes: 1 addition & 1 deletion src/typings/checkout/paymentSetupRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class PaymentSetupRequest {
*/
'lineItems'?: Array<LineItem>;
/**
* This field allows merchants to use dynamic shopper statement in local character sets. The local shopper statement field can be supplied in markets where localized merchant descriptors are used. Currently, Adyen only supports this in the Japanese market .The available character sets at the moment are: * Processing in Japan: **ja-Kana** The character set **ja-Kana** supports UTF-8 based Katakana and alphanumeric and special characters. Merchants can use half-width or full-width characters. An example request would be: > { \"shopperStatement\" : \"ADYEN - SELLER-A\", \"localizedShopperStatement\" : { \"ja-Kana\" : \"ADYEN - セラーA\" } } We recommend merchants to always supply the field localizedShopperStatement in addition to the field shopperStatement.It is issuer dependent whether the localized shopper statement field is supported. In the case of non-domestic transactions (e.g. US-issued cards processed in JP) the field `shopperStatement` is used to modify the statement of the shopper. Adyen handles the complexity of ensuring the correct descriptors are assigned. Please note, this field can be used for only Visa and Mastercard transactions.
* The `localizedShopperStatement` field lets you use dynamic values for your shopper statement in a local character set. If not supplied, left empty, or for cross-border transactions, **shopperStatement** is used. Adyen currently supports the ja-Kana character set for Visa and Mastercard payments in Japan using Japanese cards. This character set supports: * UTF-8 based Katakana, capital letters, numbers and special characters. * Half-width or full-width characters.
*/
'localizedShopperStatement'?: { [key: string]: string; };
'mandate'?: Mandate;
Expand Down
4 changes: 2 additions & 2 deletions src/typings/checkout/threeDSRequestData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export namespace ThreeDSRequestData {
Preferred = 'preferred'
}
export enum ThreeDSVersionEnum {
_10 = 'V_2_1_0',
_20 = 'V_2_2_0'
_10 = '2.1.0',
_20 = '2.2.0'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class AcceptTermsOfServiceResponse {
*/
'ipAddress'?: string;
/**
* The language used for the Terms of Service document, specified by the two letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. For example, **nl** for Dutch.
* The language used for the Terms of Service document, specified by the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible value: **en** for English.
*/
'language'?: string;
/**
Expand Down
Loading

0 comments on commit 80fe8f9

Please sign in to comment.