Skip to content
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ adding additional type guards.

## Unreleased

### Added

- Added `rotatable` to API key notifications to indicate whether an API key can be rotated.

---

## 3.8.0 - 2026-04-20
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": "3.8.0",
"version": "3.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.cjs.node.js",
"module": "dist/esm/index.esm.node.js",
Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/mocks/notifications/api-key-created.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const ApiKeyCreatedMock: IEventsResponse<IApiKeyNotificationResponse> = {
key: 'pdl_live_apikey_01jkdpbhaz****',
permissions: ['address.read', 'business.read', 'customer.read', 'subscription.read', 'transaction.read'],
expires_at: '2025-06-26T06:58:38.517522Z',
rotatable: true,
last_used_at: null,
created_at: '2025-03-26T06:58:38.517522Z',
updated_at: '2025-03-26T06:58:38.517522Z',
Expand All @@ -39,6 +40,7 @@ export const ApiKeyCreatedMockExpectation = {
key: 'pdl_live_apikey_01jkdpbhaz****',
permissions: ['address.read', 'business.read', 'customer.read', 'subscription.read', 'transaction.read'],
expiresAt: '2025-06-26T06:58:38.517522Z',
rotatable: true,
lastUsedAt: null,
createdAt: '2025-03-26T06:58:38.517522Z',
updatedAt: '2025-03-26T06:58:38.517522Z',
Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/mocks/notifications/api-key-expired.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const ApiKeyExpiredMock: IEventsResponse<IApiKeyNotificationResponse> = {
key: 'pdl_live_apikey_01jkdpbhaz****',
permissions: ['address.read', 'business.read', 'customer.read', 'subscription.read', 'transaction.read'],
expires_at: '2025-06-26T06:58:38.517522Z',
rotatable: false,
last_used_at: '2025-06-26T05:54:22.738201Z',
created_at: '2025-03-26T06:58:38.517522Z',
updated_at: '2025-03-26T06:58:38.517522Z',
Expand All @@ -39,6 +40,7 @@ export const ApiKeyExpiredMockExpectation = {
key: 'pdl_live_apikey_01jkdpbhaz****',
permissions: ['address.read', 'business.read', 'customer.read', 'subscription.read', 'transaction.read'],
expiresAt: '2025-06-26T06:58:38.517522Z',
rotatable: false,
lastUsedAt: '2025-06-26T05:54:22.738201Z',
createdAt: '2025-03-26T06:58:38.517522Z',
updatedAt: '2025-03-26T06:58:38.517522Z',
Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/mocks/notifications/api-key-expiring.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const ApiKeyExpiringMock: IEventsResponse<IApiKeyNotificationResponse> =
key: 'pdl_live_apikey_01jkdpbhaz****',
permissions: ['address.read', 'business.read', 'customer.read', 'subscription.read', 'transaction.read'],
expires_at: '2025-06-26T06:58:38.517522Z',
rotatable: true,
last_used_at: '2025-06-21T05:46:53.238201Z',
created_at: '2025-03-26T06:58:38.517522Z',
updated_at: '2025-03-26T06:58:38.517522Z',
Expand All @@ -39,6 +40,7 @@ export const ApiKeyExpiringMockExpectation = {
key: 'pdl_live_apikey_01jkdpbhaz****',
permissions: ['address.read', 'business.read', 'customer.read', 'subscription.read', 'transaction.read'],
expiresAt: '2025-06-26T06:58:38.517522Z',
rotatable: true,
lastUsedAt: '2025-06-21T05:46:53.238201Z',
createdAt: '2025-03-26T06:58:38.517522Z',
updatedAt: '2025-03-26T06:58:38.517522Z',
Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/mocks/notifications/api-key-revoked.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const ApiKeyRevokedMock: IEventsResponse<IApiKeyNotificationResponse> = {
key: 'pdl_live_apikey_01jkdpbhaz****',
permissions: ['address.read', 'business.read', 'customer.read', 'subscription.read', 'transaction.read'],
expires_at: '2025-06-26T06:58:38.517522Z',
rotatable: false,
last_used_at: '2025-06-24T05:54:22.738201Z',
created_at: '2025-03-26T06:58:38.517522Z',
updated_at: '2025-06-24T12:58:38.746382Z',
Expand All @@ -39,6 +40,7 @@ export const ApiKeyRevokedMockExpectation = {
key: 'pdl_live_apikey_01jkdpbhaz****',
permissions: ['address.read', 'business.read', 'customer.read', 'subscription.read', 'transaction.read'],
expiresAt: '2025-06-26T06:58:38.517522Z',
rotatable: false,
lastUsedAt: '2025-06-24T05:54:22.738201Z',
createdAt: '2025-03-26T06:58:38.517522Z',
updatedAt: '2025-06-24T12:58:38.746382Z',
Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/mocks/notifications/api-key-updated.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const ApiKeyUpdatedMock: IEventsResponse<IApiKeyNotificationResponse> = {
key: 'pdl_live_apikey_01jkdpbhaz****',
permissions: ['address.read', 'business.read', 'customer.read', 'subscription.read'],
expires_at: '2025-06-26T06:58:38.517522Z',
rotatable: true,
last_used_at: '2025-04-21T11:35:42.428390Z',
created_at: '2025-03-26T06:58:38.517522Z',
updated_at: '2025-04-21T12:37:12.892738Z',
Expand All @@ -39,6 +40,7 @@ export const ApiKeyUpdatedMockExpectation = {
key: 'pdl_live_apikey_01jkdpbhaz****',
permissions: ['address.read', 'business.read', 'customer.read', 'subscription.read'],
expiresAt: '2025-06-26T06:58:38.517522Z',
rotatable: true,
lastUsedAt: '2025-04-21T11:35:42.428390Z',
createdAt: '2025-03-26T06:58:38.517522Z',
updatedAt: '2025-04-21T12:37:12.892738Z',
Expand Down
2 changes: 2 additions & 0 deletions src/notifications/entities/api-key/api-key-notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export class ApiKeyNotification {
public readonly status: ApiKeyStatus;
public readonly permissions: ApiKeyPermission[];
public readonly expiresAt: string | null;
public readonly rotatable: boolean | null;
public readonly lastUsedAt: string | null;
public readonly createdAt: string;
public readonly updatedAt: string;
Expand All @@ -26,6 +27,7 @@ export class ApiKeyNotification {
this.status = apiKey.status;
this.permissions = apiKey.permissions;
this.expiresAt = apiKey.expires_at ?? null;
this.rotatable = apiKey.rotatable ?? null;
this.lastUsedAt = apiKey.last_used_at ?? null;
this.createdAt = apiKey.created_at;
this.updatedAt = apiKey.updated_at;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface IApiKeyNotificationResponse {
status: ApiKeyStatus;
permissions: ApiKeyPermission[];
expires_at: string | null;
rotatable: boolean | null;
last_used_at: string | null;
created_at: string;
updated_at: string;
Expand Down
Loading