Skip to content

Commit c5cd863

Browse files
authored
Simulations 2.0 (#54)
* feat(SimulationTypes): Add simulation types resource * chore: remove payment_method events * feat(Simulations): Add simulation resource * chore(Simulations): update request body types * chore: remove unused import * feat(Simulations): Add simulation runs resources * feat(Simulations): Add simulation run events resources * chore: clean up unused vars * feat(Simulations): narrow down simulation payload types (#52) * feat(Simulations): narrow down simulation payload types * refactor(Simulations): rename event map * fix(Simulations): Include scenarios in union * refactor(Simulations): rename DiscriminatedEventResponse * chore: bump version * fix(Simulations): update imports * chore: update import
1 parent efd9e66 commit c5cd863

File tree

65 files changed

+1810
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1810
-9
lines changed

CHANGELOG.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ When we make [non-breaking changes](https://developer.paddle.com/api-reference/a
1212

1313
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.
1414

15+
## 2.0.0-rc.1 - 2024-10-08
16+
17+
### Added
18+
19+
- Added `simulationTypes` resources
20+
- Added `simulations` resources
21+
- Added `simulationRuns` resources
22+
- Added `simulationRunEvents` resources
23+
24+
---
25+
1526
## 2.0.0-rc.0 - 2024-09-26
1627

1728
> **Breaking changes:** This version includes major improvements that introduce breaking changes. These are called out below.
@@ -40,7 +51,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
4051
## 1.6.0 - 2024-09-16
4152

4253
### Added
43-
54+
4455
- 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)
4556
- 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).
4657
- 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).
@@ -170,7 +181,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
170181
### Removed
171182

172183
- **Breaking change:** Removed `*Includes` entity in favour of standard entities.
173-
184+
174185
- Use `Price` instead of `PriceWithIncludes`
175186
- Use `Product` instead of `ProductWithIncludes`
176187
- Use `Subscription` instead of `SubscriptionIncludes`
@@ -230,7 +241,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
230241

231242
### Fixed
232243

233-
- Marked `unitPriceOverrides` as optional in Price entity.
244+
- Marked `unitPriceOverrides` as optional in Price entity.
234245

235246
---
236247

@@ -290,7 +301,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
290301
- 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)
291302
- 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)
292303
- 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)
293-
- Added `notifications.list()` to [list all notifications](https://developer.paddle.com/api-reference/notifications/list-notifications?utm_source=dx&utm_medium=paddle-node-sdk)
304+
- Added `notifications.list()` to [list all notifications](https://developer.paddle.com/api-reference/notifications/list-notifications?utm_source=dx&utm_medium=paddle-node-sdk)
294305
- Added `notifications.get()` to [get a notification](https://developer.paddle.com/api-reference/notifications/get-notification?utm_source=dx&utm_medium=paddle-node-sdk)
295306
- Added `notifications.replay()` to [replay a notification](https://developer.paddle.com/api-reference/notifications/replay-notification?utm_source=dx&utm_medium=paddle-node-sdk)
296307
- 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)
@@ -315,7 +326,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
315326
### Added
316327

317328
- Added helper function to archive supported entities
318-
- 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)
329+
- 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)
319330

320331
### Changed
321332

@@ -363,15 +374,15 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
363374

364375
- Added changelog.
365376

366-
---
377+
---
367378

368379
## 0.1.6 - 2023-11-22
369380

370381
### Fixed
371382

372383
- Fixed optional management URL object in subscription entities.
373384

374-
---
385+
---
375386

376387
## 0.1.5 - 2023-11-14
377388

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@paddle/paddle-node-sdk",
3-
"version": "2.0.0-rc.0",
3+
"version": "2.0.0-rc.1",
44
"description": "A Node.js SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript.",
55
"main": "dist/cjs/index.cjs.node.js",
66
"module": "dist/esm/index.esm.node.js",
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* ! Autogenerated code !
3+
* Do not make changes to this file.
4+
* Changes may be overwritten as part of auto-generation.
5+
*/
6+
7+
import { ISimulationRunEventResponse } from '../../../types/index.js';
8+
import { Response, ResponsePaginated } from '../../../internal/index.js';
9+
10+
export const SimulationRunEventMock: ISimulationRunEventResponse = {
11+
id: 'ntfsimevt_123',
12+
status: 'success',
13+
event_type: 'subscription.created',
14+
payload: {},
15+
request: null,
16+
response: null,
17+
created_at: '2024-09-18T12:24:47.960617Z',
18+
updated_at: '2024-09-18T12:24:48.309530Z',
19+
};
20+
21+
export const SimulationRunEventMockResponse: Response<ISimulationRunEventResponse> = {
22+
data: SimulationRunEventMock,
23+
meta: {
24+
request_id: '',
25+
},
26+
};
27+
28+
export const ListSimulationRunEventMockResponse: ResponsePaginated<ISimulationRunEventResponse> = {
29+
data: [SimulationRunEventMock],
30+
meta: {
31+
request_id: '',
32+
pagination: {
33+
estimated_total: 10,
34+
has_more: true,
35+
next: '/simulations/ntfsim_123/runs/ntfsimrun_123/events?after=1',
36+
per_page: 10,
37+
},
38+
},
39+
};
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* ! Autogenerated code !
3+
* Do not make changes to this file.
4+
* Changes may be overwritten as part of auto-generation.
5+
*/
6+
7+
import { ISimulationRunResponse } from '../../../types/index.js';
8+
import { Response, ResponsePaginated } from '../../../internal/index.js';
9+
10+
export const SimulationRunMock: ISimulationRunResponse = {
11+
id: 'ntfsimrun_01j82gvz2cgw08p7mak3gcd3a3',
12+
status: 'completed',
13+
type: 'subscription_creation',
14+
created_at: '2024-09-18T12:14:15.628606Z',
15+
updated_at: '2024-09-18T12:14:27.244695Z',
16+
};
17+
18+
export const SimulationRunMockResponse: Response<ISimulationRunResponse> = {
19+
data: SimulationRunMock,
20+
meta: {
21+
request_id: '',
22+
},
23+
};
24+
25+
export const ListSimulationRunMockResponse: ResponsePaginated<ISimulationRunResponse> = {
26+
data: [SimulationRunMock],
27+
meta: {
28+
request_id: '',
29+
pagination: {
30+
estimated_total: 10,
31+
has_more: true,
32+
next: '/simulations/ntfsim_123/runs?after=1',
33+
per_page: 10,
34+
},
35+
},
36+
};

0 commit comments

Comments
 (0)