Skip to content

Commit

Permalink
feat(Subscription): Updated subscription item model to include `produ…
Browse files Browse the repository at this point in the history
…ct` (#38)
  • Loading branch information
vijayasingam-paddle authored Aug 16, 2024
1 parent 6f85c77 commit f7c657a
Show file tree
Hide file tree
Showing 16 changed files with 544 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ 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.5.0 - 2024-08-16

### Added

- Updated subscription items model to include `product`. See [related changelog](https://developer.paddle.com/changelog/2024/subscription-items-product?utm_source=dx&utm_medium=paddle-node-sdk).

---

## 1.4.1 - 2024-06-21

### Fixed
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.4.1",
"version": "1.5.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
52 changes: 52 additions & 0 deletions src/__tests__/mocks/notifications/subscription-activated.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ export const SubscriptionActivatedMock: IEventsResponse<ISubscriptionNotificatio
trial_period: null,
billing_cycle: { interval: 'month', frequency: 1 },
},
product: {
id: 'pro_01gsz4t5hdjse780zja8vvr7jg',
name: 'ChatApp Pro',
status: 'active',
image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png',
description:
"Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.",
tax_category: 'standard',
type: 'standard',
custom_data: null,
created_at: '2023-08-22T07:59:39.771451Z',
},
status: 'active',
quantity: 10,
recurring: true,
Expand All @@ -45,6 +57,18 @@ export const SubscriptionActivatedMock: IEventsResponse<ISubscriptionNotificatio
trial_period: null,
billing_cycle: { interval: 'month', frequency: 1 },
},
product: {
id: 'pro_01h1vjes1y163xfj1rh1tkfb65',
name: 'Voice rooms addon',
status: 'active',
image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png',
description:
'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.',
tax_category: 'standard',
type: 'standard',
custom_data: null,
created_at: '2023-08-22T07:59:39.771451Z',
},
status: 'active',
quantity: 1,
recurring: true,
Expand Down Expand Up @@ -127,6 +151,20 @@ export const SubscriptionActivatedMockExpectation = {
},
unitPriceOverrides: [],
},
product: {
id: 'pro_01gsz4t5hdjse780zja8vvr7jg',
name: 'ChatApp Pro',
status: 'active',
imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png',
description:
"Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.",
taxCategory: 'standard',
type: 'standard',
customData: null,
importMeta: null,
createdAt: '2023-08-22T07:59:39.771451Z',
updatedAt: null,
},
quantity: 10,
recurring: true,
status: 'active',
Expand Down Expand Up @@ -159,6 +197,20 @@ export const SubscriptionActivatedMockExpectation = {
},
unitPriceOverrides: [],
},
product: {
id: 'pro_01h1vjes1y163xfj1rh1tkfb65',
name: 'Voice rooms addon',
status: 'active',
imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png',
description:
'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.',
taxCategory: 'standard',
type: 'standard',
customData: null,
importMeta: null,
createdAt: '2023-08-22T07:59:39.771451Z',
updatedAt: null,
},
quantity: 1,
recurring: true,
status: 'active',
Expand Down
78 changes: 78 additions & 0 deletions src/__tests__/mocks/notifications/subscription-canceled.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ export const SubscriptionCanceledMock: IEventsResponse<ISubscriptionNotification
trial_period: null,
billing_cycle: { interval: 'month', frequency: 1 },
},
product: {
id: 'pro_01gsz4t5hdjse780zja8vvr7jg',
name: 'ChatApp Pro',
status: 'active',
image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png',
description:
"Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.",
tax_category: 'standard',
type: 'standard',
custom_data: null,
created_at: '2023-08-22T07:59:39.771451Z',
},
status: 'active',
quantity: 10,
recurring: true,
Expand All @@ -44,6 +56,18 @@ export const SubscriptionCanceledMock: IEventsResponse<ISubscriptionNotification
trial_period: null,
billing_cycle: { interval: 'month', frequency: 1 },
},
product: {
id: 'pro_01h1vjes1y163xfj1rh1tkfb65',
name: 'Voice rooms addon',
status: 'active',
image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png',
description:
'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.',
tax_category: 'standard',
type: 'standard',
custom_data: null,
created_at: '2023-08-22T07:59:39.771451Z',
},
status: 'active',
quantity: 1,
recurring: true,
Expand All @@ -63,6 +87,18 @@ export const SubscriptionCanceledMock: IEventsResponse<ISubscriptionNotification
trial_period: null,
billing_cycle: { interval: 'month', frequency: 1 },
},
product: {
id: 'pro_01gsz92krfzy3hcx5h5rtgnfwz',
name: 'VIP support',
status: 'active',
image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png',
description:
'Get exclusive access to our expert team of product specialists, available to help you make the most of your ChatApp subscription.',
tax_category: 'standard',
type: 'standard',
custom_data: null,
created_at: '2023-08-22T07:59:39.771451Z',
},
status: 'active',
quantity: 1,
recurring: true,
Expand Down Expand Up @@ -142,6 +178,20 @@ export const SubscriptionCanceledMockExpectation = {
},
unitPriceOverrides: [],
},
product: {
id: 'pro_01gsz4t5hdjse780zja8vvr7jg',
name: 'ChatApp Pro',
status: 'active',
imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png',
description:
"Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.",
taxCategory: 'standard',
type: 'standard',
customData: null,
importMeta: null,
createdAt: '2023-08-22T07:59:39.771451Z',
updatedAt: null,
},
quantity: 10,
recurring: true,
status: 'active',
Expand Down Expand Up @@ -174,6 +224,20 @@ export const SubscriptionCanceledMockExpectation = {
},
unitPriceOverrides: [],
},
product: {
id: 'pro_01h1vjes1y163xfj1rh1tkfb65',
name: 'Voice rooms addon',
status: 'active',
imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png',
description:
'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.',
taxCategory: 'standard',
type: 'standard',
customData: null,
importMeta: null,
createdAt: '2023-08-22T07:59:39.771451Z',
updatedAt: null,
},
quantity: 1,
recurring: true,
status: 'active',
Expand Down Expand Up @@ -206,6 +270,20 @@ export const SubscriptionCanceledMockExpectation = {
},
unitPriceOverrides: [],
},
product: {
createdAt: '2023-08-22T07:59:39.771451Z',
customData: null,
description:
'Get exclusive access to our expert team of product specialists, available to help you make the most of your ChatApp subscription.',
id: 'pro_01gsz92krfzy3hcx5h5rtgnfwz',
imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/SW3OevDQ92dUHSkN5a2x_icon3.png',
importMeta: null,
name: 'VIP support',
status: 'active',
taxCategory: 'standard',
type: 'standard',
updatedAt: null,
},
quantity: 1,
recurring: true,
status: 'active',
Expand Down
52 changes: 52 additions & 0 deletions src/__tests__/mocks/notifications/subscription-created.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ export const SubscriptionCreatedMock: IEventsResponse<ISubscriptionNotificationR
trial_period: null,
billing_cycle: { interval: 'month', frequency: 1 },
},
product: {
id: 'pro_01gsz4t5hdjse780zja8vvr7jg',
name: 'ChatApp Pro',
status: 'active',
image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png',
description:
"Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.",
tax_category: 'standard',
type: 'standard',
custom_data: null,
created_at: '2023-08-22T07:59:39.771451Z',
},
status: 'active',
quantity: 10,
recurring: true,
Expand All @@ -44,6 +56,18 @@ export const SubscriptionCreatedMock: IEventsResponse<ISubscriptionNotificationR
trial_period: null,
billing_cycle: { interval: 'month', frequency: 1 },
},
product: {
id: 'pro_01h1vjes1y163xfj1rh1tkfb65',
name: 'Voice rooms addon',
status: 'active',
image_url: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png',
description:
'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.',
tax_category: 'standard',
type: 'standard',
custom_data: null,
created_at: '2023-08-22T07:59:39.771451Z',
},
status: 'active',
quantity: 1,
recurring: true,
Expand Down Expand Up @@ -127,6 +151,20 @@ export const SubscriptionCreatedMockExpectation = {
},
unitPriceOverrides: [],
},
product: {
id: 'pro_01gsz4t5hdjse780zja8vvr7jg',
name: 'ChatApp Pro',
status: 'active',
imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png',
description:
"Everything in basic, plus access to a suite of powerful tools and features designed to take your team's productivity to the next level.",
taxCategory: 'standard',
type: 'standard',
customData: null,
importMeta: null,
createdAt: '2023-08-22T07:59:39.771451Z',
updatedAt: null,
},
quantity: 10,
recurring: true,
status: 'active',
Expand Down Expand Up @@ -159,6 +197,20 @@ export const SubscriptionCreatedMockExpectation = {
},
unitPriceOverrides: [],
},
product: {
id: 'pro_01h1vjes1y163xfj1rh1tkfb65',
name: 'Voice rooms addon',
status: 'active',
imageUrl: 'https://paddle-sandbox.s3.amazonaws.com/user/10889/GcZzBjXRfiraensppgtQ_icon2.png',
description:
'Create voice rooms in your chats to work in real time alongside your colleagues. Includes unlimited voice rooms and recording backup for compliance.',
taxCategory: 'standard',
type: 'standard',
customData: null,
importMeta: null,
createdAt: '2023-08-22T07:59:39.771451Z',
updatedAt: null,
},
quantity: 1,
recurring: true,
status: 'active',
Expand Down
Loading

0 comments on commit f7c657a

Please sign in to comment.