Skip to content

Commit

Permalink
Add Webhook Simulation resources (#49)
Browse files Browse the repository at this point in the history
- Added `simulationTypes` resources
- Added `simulations` resources
- Added `simulationRuns` resources
- Added `simulationRunEvents` resources
  • Loading branch information
danbillson authored Oct 14, 2024
1 parent 2b65e10 commit 662553d
Show file tree
Hide file tree
Showing 66 changed files with 1,783 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
push:
branches:
- main
- v1.X
- v1.x
- release/beta
pull_request:
branches:
- main
- v1.X
- v1.x
- release/beta

concurrency:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
push:
branches:
- main
- v1.X
- v1.x
- release/beta
pull_request:
branches:
- main
- v1.X
- v1.x
- release/beta

concurrency:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- v1.x

jobs:
run-publish:
Expand Down
23 changes: 16 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ When we make [non-breaking changes](https://developer.paddle.com/api-reference/a

This means when upgrading minor versions of the SDK, you may notice type errors. You can safely ignore these or fix by adding additional type guards.

## 1.8.0 - 2024-10-08

### Added

- Added `simulationTypes` resources
- Added `simulations` resources
- Added `simulationRuns` resources
- Added `simulationRunEvents` resources

## 1.7.0 - 2024-09-18

### Fixed
Expand All @@ -23,7 +32,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
## 1.6.0 - 2024-09-16

### Added

- Added `adjustments.getCreditNotePDF()` to [get a credit note for an adjustment](https://developer.paddle.com/api-reference/adjustments/get-credit-note-pdf?utm_source=dx&utm_medium=paddle-node-sdk)
- Added `disposition` query parameter to `adjustments.getCreditNotePDF()` and `transactions.getInvoicePDF()` operations, see [related changelog](https://developer.paddle.com/changelog/2024/invoice-pdf-open-in-browser?utm_source=dx&utm_medium=paddle-node-sdk).
- Added pagination support to `notificationSettings.list()` operation, see [related changelog](https://developer.paddle.com/changelog/2024/notification-settings-pagination?utm_source=dx&utm_medium=paddle-node-sdk).
Expand Down Expand Up @@ -153,7 +162,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
### Removed

- **Breaking change:** Removed `*Includes` entity in favour of standard entities.

- Use `Price` instead of `PriceWithIncludes`
- Use `Product` instead of `ProductWithIncludes`
- Use `Subscription` instead of `SubscriptionIncludes`
Expand Down Expand Up @@ -213,7 +222,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.

### Fixed

- Marked `unitPriceOverrides` as optional in Price entity.
- Marked `unitPriceOverrides` as optional in Price entity.

---

Expand Down Expand Up @@ -273,7 +282,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
- Added `notificationSettings.get()` to [get a notification settings](https://developer.paddle.com/api-reference/notification-settings/get-notification-setting?utm_source=dx&utm_medium=paddle-node-sdk)
- Added `notificationSettings.update()` to [update a notification settings](https://developer.paddle.com/api-reference/notification-settings/update-notification-setting?utm_source=dx&utm_medium=paddle-node-sdk)
- Added `notificationSettings.delete()` to [delete a notification settings](https://developer.paddle.com/api-reference/notification-settings/delete-notification-setting?utm_source=dx&utm_medium=paddle-node-sdk)
- Added `notifications.list()` to [list all notifications](https://developer.paddle.com/api-reference/notifications/list-notifications?utm_source=dx&utm_medium=paddle-node-sdk)
- Added `notifications.list()` to [list all notifications](https://developer.paddle.com/api-reference/notifications/list-notifications?utm_source=dx&utm_medium=paddle-node-sdk)
- Added `notifications.get()` to [get a notification](https://developer.paddle.com/api-reference/notifications/get-notification?utm_source=dx&utm_medium=paddle-node-sdk)
- Added `notifications.replay()` to [replay a notification](https://developer.paddle.com/api-reference/notifications/replay-notification?utm_source=dx&utm_medium=paddle-node-sdk)
- Added `notifications.getLogs()` to [get all logs for a notification](https://developer.paddle.com/api-reference/notification-logs/list-notification-logs?utm_source=dx&utm_medium=paddle-node-sdk)
Expand All @@ -298,7 +307,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
### Added

- Added helper function to archive supported entities
- Added `pricingPreview.preview()` to [preview calculations for one or more prices](https://developer.paddle.com/api-reference/pricing-preview/preview-prices?utm_source=dx&utm_medium=paddle-node-sdk)
- Added `pricingPreview.preview()` to [preview calculations for one or more prices](https://developer.paddle.com/api-reference/pricing-preview/preview-prices?utm_source=dx&utm_medium=paddle-node-sdk)

### Changed

Expand Down Expand Up @@ -346,15 +355,15 @@ This means when upgrading minor versions of the SDK, you may notice type errors.

- Added changelog.

---
---

## 0.1.6 - 2023-11-22

### Fixed

- Fixed optional management URL object in subscription entities.

---
---

## 0.1.5 - 2023-11-14

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@paddle/paddle-node-sdk",
"version": "1.7.0",
"version": "1.8.0",
"description": "A Node.js SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript.",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
Expand Down
39 changes: 39 additions & 0 deletions src/__tests__/mocks/resources/simulation-run-events.mock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* ! Autogenerated code !
* Do not make changes to this file.
* Changes may be overwritten as part of auto-generation.
*/

import { ISimulationRunEventResponse } from '../../../types';
import { Response, ResponsePaginated } from '../../../internal';

export const SimulationRunEventMock: ISimulationRunEventResponse = {
id: 'ntfsimevt_123',
status: 'success',
event_type: 'subscription.created',
payload: {},
request: null,
response: null,
created_at: '2024-09-18T12:24:47.960617Z',
updated_at: '2024-09-18T12:24:48.309530Z',
};

export const SimulationRunEventMockResponse: Response<ISimulationRunEventResponse> = {
data: SimulationRunEventMock,
meta: {
request_id: '',
},
};

export const ListSimulationRunEventMockResponse: ResponsePaginated<ISimulationRunEventResponse> = {
data: [SimulationRunEventMock],
meta: {
request_id: '',
pagination: {
estimated_total: 10,
has_more: true,
next: '/simulations/ntfsim_123/runs/ntfsimrun_123/events?after=1',
per_page: 10,
},
},
};
36 changes: 36 additions & 0 deletions src/__tests__/mocks/resources/simulation-runs.mock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* ! Autogenerated code !
* Do not make changes to this file.
* Changes may be overwritten as part of auto-generation.
*/

import { ISimulationRunResponse } from '../../../types';
import { Response, ResponsePaginated } from '../../../internal';

export const SimulationRunMock: ISimulationRunResponse = {
id: 'ntfsimrun_01j82gvz2cgw08p7mak3gcd3a3',
status: 'completed',
type: 'subscription_creation',
created_at: '2024-09-18T12:14:15.628606Z',
updated_at: '2024-09-18T12:14:27.244695Z',
};

export const SimulationRunMockResponse: Response<ISimulationRunResponse> = {
data: SimulationRunMock,
meta: {
request_id: '',
},
};

export const ListSimulationRunMockResponse: ResponsePaginated<ISimulationRunResponse> = {
data: [SimulationRunMock],
meta: {
request_id: '',
pagination: {
estimated_total: 10,
has_more: true,
next: '/simulations/ntfsim_123/runs?after=1',
per_page: 10,
},
},
};
Loading

0 comments on commit 662553d

Please sign in to comment.