Skip to content

Commit

Permalink
feat(NotificationSetting): Add trafficSource field
Browse files Browse the repository at this point in the history
  • Loading branch information
danbillson committed Oct 15, 2024
1 parent 662553d commit 50f64c2
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ 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.9.0 - 2024-10-15

### Added

- Added the `trafficSource` filter on notification settings

## 1.8.0 - 2024-10-08

### Added
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.8.0",
"version": "1.9.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
2 changes: 2 additions & 0 deletions src/__tests__/mocks/resources/notification-settings.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const UpdateNotificationSettingsMock: UpdateNotificationSettingsRequestBo
apiVersion: 10,
includeSensitiveFields: true,
subscribedEvents: ['address.updated'],
trafficSource: 'platform',
};

export const CreateNotificationSettingsExpectation = {
Expand All @@ -38,6 +39,7 @@ export const UpdateNotificationSettingsExpectation = {
api_version: 10,
include_sensitive_fields: true,
subscribed_events: ['address.updated'],
traffic_source: 'platform',
};

export const NotificationSettingsMock: INotificationSettingsResponse = {
Expand Down
1 change: 1 addition & 0 deletions src/enums/notification-settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*/

export * from './notification-settings-type';
export * from './traffic-source';
7 changes: 7 additions & 0 deletions src/enums/notification-settings/traffic-source.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* ! Autogenerated code !
* Do not make changes to this file.
* Changes may be overwritten as part of auto-generation.
*/

export type TrafficSource = 'platform' | 'simulation' | 'all';
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Do not make changes to this file.
* Changes may be overwritten as part of auto-generation.
*/
import { type NotificationSettingsType } from '../../../enums';
import { type TrafficSource, type NotificationSettingsType } from '../../../enums';
import { type IEventName } from '../../../notifications';

export interface CreateNotificationSettingsRequestBody {
Expand All @@ -13,4 +13,5 @@ export interface CreateNotificationSettingsRequestBody {
type: NotificationSettingsType;
apiVersion?: number | null;
includeSensitiveFields?: boolean | null;
trafficSource?: TrafficSource | null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
* Changes may be overwritten as part of auto-generation.
*/

import { type TrafficSource } from '../../../enums';

export interface ListNotificationSettingsQueryParameters {
after?: string;
perPage?: number;
orderBy?: string;
active?: boolean;
trafficSource?: TrafficSource;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Do not make changes to this file.
* Changes may be overwritten as part of auto-generation.
*/
import { type TrafficSource } from '../../../enums';
import { type IEventName } from '../../../notifications';

export interface UpdateNotificationSettingsRequestBody {
Expand All @@ -12,4 +13,5 @@ export interface UpdateNotificationSettingsRequestBody {
apiVersion?: number;
includeSensitiveFields?: boolean;
subscribedEvents?: IEventName[];
trafficSource?: TrafficSource;
}

0 comments on commit 50f64c2

Please sign in to comment.