Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DE-1092] Release 6.0.1, fix serialization of nested query parameters #95

Merged
merged 5 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ License:
The MIT License (MIT)
http://opensource.org/licenses/MIT

Copyright (c) 2014 - 2024 APIMATIC Limited
Copyright (c) 2014 - 2025 APIMATIC Limited

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
78 changes: 39 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ curl -u <api_key>:x -H Accept:application/json -H Content-Type:application/json
Run the following command from your project directory to install the package from npm:

```bash
npm install @maxio-com/[email protected].0
npm install @maxio-com/[email protected].1
```

For additional package details, see the [Npm page for the @maxio-com/[email protected].0 npm](https://www.npmjs.com/package/@maxio-com/advanced-billing-sdk/v/6.0.0).
For additional package details, see the [Npm page for the @maxio-com/[email protected].1 npm](https://www.npmjs.com/package/@maxio-com/advanced-billing-sdk/v/6.0.1).

## Initialize the API Client

**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/client.md)
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/client.md)

The following parameters are configurable for the API Client:

Expand All @@ -48,7 +48,7 @@ The following parameters are configurable for the API Client:
| `timeout` | `number` | Timeout for API calls.<br>*Default*: `120000` |
| `httpClientOptions` | `Partial<HttpClientOptions>` | Stable configurable http client options. |
| `unstableHttpClientOptions` | `any` | Unstable configurable http client options. |
| `basicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/auth/basic-authentication.md) | The credential object for basicAuth |
| `basicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/auth/basic-authentication.md) | The credential object for basicAuth |

### HttpClientOptions

Expand Down Expand Up @@ -100,45 +100,45 @@ The SDK can be configured to use a different environment for making API calls. A

This API uses the following authentication schemes.

* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/auth/basic-authentication.md)
* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/auth/basic-authentication.md)

## List of APIs

* [API Exports](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/api-exports.md)
* [Advance Invoice](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/advance-invoice.md)
* [Billing Portal](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/billing-portal.md)
* [Component Price Points](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/component-price-points.md)
* [Custom Fields](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/custom-fields.md)
* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/events-based-billing-segments.md)
* [Payment Profiles](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/payment-profiles.md)
* [Product Families](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/product-families.md)
* [Product Price Points](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/product-price-points.md)
* [Proforma Invoices](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/proforma-invoices.md)
* [Reason Codes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/reason-codes.md)
* [Referral Codes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/referral-codes.md)
* [Sales Commissions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/sales-commissions.md)
* [Subscription Components](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscription-components.md)
* [Subscription Groups](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscription-groups.md)
* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscription-group-invoice-account.md)
* [Subscription Group Status](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscription-group-status.md)
* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscription-invoice-account.md)
* [Subscription Notes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscription-notes.md)
* [Subscription Products](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscription-products.md)
* [Subscription Status](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscription-status.md)
* [Coupons](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/coupons.md)
* [Components](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/components.md)
* [Customers](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/customers.md)
* [Events](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/events.md)
* [Insights](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/insights.md)
* [Invoices](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/invoices.md)
* [Offers](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/offers.md)
* [Products](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/products.md)
* [Sites](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/sites.md)
* [Subscriptions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/subscriptions.md)
* [Webhooks](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/controllers/webhooks.md)
* [API Exports](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/api-exports.md)
* [Advance Invoice](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/advance-invoice.md)
* [Billing Portal](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/billing-portal.md)
* [Component Price Points](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/component-price-points.md)
* [Custom Fields](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/custom-fields.md)
* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/events-based-billing-segments.md)
* [Payment Profiles](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/payment-profiles.md)
* [Product Families](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/product-families.md)
* [Product Price Points](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/product-price-points.md)
* [Proforma Invoices](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/proforma-invoices.md)
* [Reason Codes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/reason-codes.md)
* [Referral Codes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/referral-codes.md)
* [Sales Commissions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/sales-commissions.md)
* [Subscription Components](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/subscription-components.md)
* [Subscription Groups](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/subscription-groups.md)
* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/subscription-group-invoice-account.md)
* [Subscription Group Status](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/subscription-group-status.md)
* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/subscription-invoice-account.md)
* [Subscription Notes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/subscription-notes.md)
* [Subscription Products](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/subscription-products.md)
* [Subscription Status](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/subscription-status.md)
* [Coupons](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/coupons.md)
* [Components](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/components.md)
* [Customers](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/customers.md)
* [Events](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/events.md)
* [Insights](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/insights.md)
* [Invoices](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/invoices.md)
* [Offers](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/offers.md)
* [Products](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/products.md)
* [Sites](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/sites.md)
* [Subscriptions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/subscriptions.md)
* [Webhooks](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/controllers/webhooks.md)

## Classes Documentation

* [ApiResponse](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/api-response.md)
* [ApiError](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.0/doc/api-error.md)
* [ApiResponse](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/api-response.md)
* [ApiError](https://www.github.com/maxio-com/ab-typescript-sdk/tree/6.0.1/doc/api-error.md)

20 changes: 20 additions & 0 deletions e2e/src/couponsController.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,26 @@ describe('Coupons Controller', () => {
expect(listResponse.result.length >= 1).toBeTruthy();
});

test('should list coupons filtering by code for product family', async () => {
const listResponse = await couponsController.listCouponsForProductFamily({
productFamilyId: productFamily?.id || 0,
filter: {
codes: ['CREATE001']
}
});
expect(listResponse.statusCode).toBe(200);
expect(listResponse.result.length >= 1).toBeTruthy();

const listResponse2 = await couponsController.listCouponsForProductFamily({
productFamilyId: productFamily?.id || 0,
filter: {
codes: ['abc']
}
});
expect(listResponse2.statusCode).toBe(200);
expect(listResponse2.result.length == 0).toBeTruthy();
});

test('should throw and 404 error when user sends incorrect family id ', async () => {
const promise = couponsController.listCouponsForProductFamily({
productFamilyId: 2001,
Expand Down
2 changes: 1 addition & 1 deletion e2e/src/mocks/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const creditCardAttributes = {
lastName: 'Smith',
firstName: 'Joe',
fullNumber: '4111111111111111',
expirationYear: 2024,
expirationYear: new Date().getFullYear(),
expirationMonth: 12,
cardType: CardType.Visa,
billingZip: '02120',
Expand Down
8 changes: 4 additions & 4 deletions e2e/src/subscriptionsController.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('Subscriptions Controller', () => {
lastName: 'Smith',
firstName: 'Joe',
fullNumber: '4111111111111111',
expirationYear: 2024,
expirationYear: new Date().getFullYear(),
expirationMonth: 12,
cardType: CardType.Visa,
billingZip: '02120',
Expand Down Expand Up @@ -284,15 +284,15 @@ describe('Subscriptions Controller', () => {
subscription: {
creditCardAttributes: {
fullNumber: '374245455400126',
expirationYear: '2025',
expirationYear: (new Date().getFullYear() + 1).toString(),
expirationMonth: '11',
},
},
}
);
const updatedCreditCard = updateResponse.result.subscription?.creditCard;
expect(updatedCreditCard?.expirationMonth).toBe(11);
expect(updatedCreditCard?.expirationYear).toBe(2025);
expect(updatedCreditCard?.expirationYear).toBe(new Date().getFullYear() + 1);
});

test('should throw an error 422 error when user sends invalid data', async () => {
Expand All @@ -308,7 +308,7 @@ describe('Subscriptions Controller', () => {
subscription: {
creditCardAttributes: {
fullNumber: '000',
expirationYear: '2025',
expirationYear: (new Date().getFullYear() + 1).toString(),
expirationMonth: '11',
},
},
Expand Down
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "6.0.0",
"version": "6.0.1",
"license": "MIT",
"sideEffects": false,
"main": "dist/cjs/index.js",
Expand All @@ -18,6 +18,7 @@
"lint": "eslint **/*.ts --ignore-path .eslintignore",
"lint:fix": "eslint **/*.ts --ignore-path .eslintignore --fix"
},
"peerDependencies": {},
"prettier": {
"printWidth": 80,
"semi": true,
Expand All @@ -32,20 +33,20 @@
"email": "[email protected]"
},
"devDependencies": {
"@types/jest": "^29.5.14",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.57.1",
"jest": "^29.7.0",
"ts-jest": "^29.2.5",
"tslib": "^2.8.1",
"@types/jest": "^29.4.0",
"@typescript-eslint/eslint-plugin": "^5.52.0",
"@typescript-eslint/parser": "^5.52.0",
"eslint": "^8.34.0",
"jest": "^29.4.3",
"ts-jest": "^29.0.5",
"tslib": "^2.5.0",
"typescript": "^4.9.5"
},
"dependencies": {
"@apimatic/authentication-adapters": "^0.5.6",
"@apimatic/axios-client-adapter": "^0.3.8",
"@apimatic/core": "^0.10.17",
"@apimatic/schema": "^0.7.15"
"@apimatic/authentication-adapters": "^0.5.4",
"@apimatic/axios-client-adapter": "^0.3.7",
"@apimatic/core": "^0.10.16",
"@apimatic/schema": "^0.7.14"
},
"repository": {
"type": "git",
Expand Down
Loading
Loading