@paddle/paddle-node-sdk 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +14 -14
  3. package/dist/entities/event-types/event-type.d.ts +9 -0
  4. package/dist/entities/event-types/event-type.js +12 -0
  5. package/dist/entities/event-types/index.d.ts +1 -0
  6. package/dist/entities/event-types/index.js +17 -0
  7. package/dist/entities/events/event-collection.d.ts +2 -2
  8. package/dist/entities/index.d.ts +3 -0
  9. package/dist/entities/index.js +3 -0
  10. package/dist/entities/notification-settings/index.d.ts +1 -0
  11. package/dist/entities/notification-settings/index.js +17 -0
  12. package/dist/entities/notification-settings/notification-settings.d.ts +15 -0
  13. package/dist/entities/notification-settings/notification-settings.js +18 -0
  14. package/dist/entities/notifications/index.d.ts +5 -0
  15. package/dist/entities/notifications/index.js +21 -0
  16. package/dist/entities/notifications/notification-collection.d.ts +6 -0
  17. package/dist/entities/notifications/notification-collection.js +11 -0
  18. package/dist/entities/notifications/notification-log-collection.d.ts +6 -0
  19. package/dist/entities/notifications/notification-log-collection.js +11 -0
  20. package/dist/entities/notifications/notification-log.d.ts +8 -0
  21. package/dist/entities/notifications/notification-log.js +14 -0
  22. package/dist/entities/notifications/notification.d.ts +18 -0
  23. package/dist/entities/notifications/notification.js +22 -0
  24. package/dist/entities/notifications/replay-notification.d.ts +5 -0
  25. package/dist/entities/notifications/replay-notification.js +9 -0
  26. package/dist/entities/subscription/subscription-scheduled-change.d.ts +2 -2
  27. package/dist/enums/index.d.ts +2 -0
  28. package/dist/enums/index.js +2 -0
  29. package/dist/enums/notification/index.d.ts +2 -0
  30. package/dist/enums/notification/index.js +18 -0
  31. package/dist/enums/notification/notification-status.d.ts +1 -0
  32. package/dist/enums/notification/notification-status.js +2 -0
  33. package/dist/enums/notification/origin.d.ts +1 -0
  34. package/dist/enums/notification/origin.js +2 -0
  35. package/dist/enums/notification-settings/index.d.ts +1 -0
  36. package/dist/enums/notification-settings/index.js +17 -0
  37. package/dist/enums/notification-settings/notification-settings-type.d.ts +1 -0
  38. package/dist/enums/notification-settings/notification-settings-type.js +2 -0
  39. package/dist/internal/api/client.d.ts +2 -0
  40. package/dist/internal/api/client.js +14 -0
  41. package/dist/notifications/helpers/webhooks.d.ts +2 -2
  42. package/dist/notifications/helpers/webhooks.js +3 -1
  43. package/dist/paddle.d.ts +4 -1
  44. package/dist/paddle.js +3 -0
  45. package/dist/resources/event-types/index.d.ts +5 -0
  46. package/dist/resources/event-types/index.js +27 -0
  47. package/dist/resources/index.d.ts +3 -0
  48. package/dist/resources/index.js +3 -0
  49. package/dist/resources/notification-settings/index.d.ts +11 -0
  50. package/dist/resources/notification-settings/index.js +84 -0
  51. package/dist/resources/notification-settings/operations/create-notification-settings-request-body.d.ts +10 -0
  52. package/dist/resources/notification-settings/operations/create-notification-settings-request-body.js +2 -0
  53. package/dist/resources/notification-settings/operations/index.d.ts +2 -0
  54. package/dist/resources/notification-settings/operations/index.js +18 -0
  55. package/dist/resources/notification-settings/operations/update-notification-settings-request-body.d.ts +9 -0
  56. package/dist/resources/notification-settings/operations/update-notification-settings-request-body.js +2 -0
  57. package/dist/resources/notifications/index.d.ts +10 -0
  58. package/dist/resources/notifications/index.js +69 -0
  59. package/dist/resources/notifications/operations/index.d.ts +2 -0
  60. package/dist/resources/notifications/operations/index.js +18 -0
  61. package/dist/resources/notifications/operations/list-notification-log-query-parameters.d.ts +4 -0
  62. package/dist/resources/notifications/operations/list-notification-log-query-parameters.js +2 -0
  63. package/dist/resources/notifications/operations/list-notification-query-parameters.d.ts +12 -0
  64. package/dist/resources/notifications/operations/list-notification-query-parameters.js +2 -0
  65. package/dist/types/event-types/event-type-response.d.ts +7 -0
  66. package/dist/types/event-types/event-type-response.js +2 -0
  67. package/dist/types/event-types/index.d.ts +1 -0
  68. package/dist/types/event-types/index.js +17 -0
  69. package/dist/types/index.d.ts +3 -0
  70. package/dist/types/index.js +3 -0
  71. package/dist/types/notification-settings/index.d.ts +1 -0
  72. package/dist/types/notification-settings/index.js +17 -0
  73. package/dist/types/notification-settings/notification-settings-response.d.ts +13 -0
  74. package/dist/types/notification-settings/notification-settings-response.js +2 -0
  75. package/dist/types/notifications/index.d.ts +3 -0
  76. package/dist/types/notifications/index.js +19 -0
  77. package/dist/types/notifications/notification-log.d.ts +7 -0
  78. package/dist/types/notifications/notification-log.js +2 -0
  79. package/dist/types/notifications/notification.d.ts +17 -0
  80. package/dist/types/notifications/notification.js +2 -0
  81. package/dist/types/notifications/replay-notification.d.ts +3 -0
  82. package/dist/types/notifications/replay-notification.js +2 -0
  83. package/dist/types/subscription/subscription-scheduled-change-response.d.ts +2 -2
  84. package/dist/version.d.ts +1 -1
  85. package/dist/version.js +1 -1
  86. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -8,6 +8,28 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8
8
 
9
9
  Check our main [developer changelog](https://developer.paddle.com/?utm_source=dx&utm_medium=paddle-node-sdk) for information about changes to the Paddle Billing platform, the Paddle API, and other developer tools.
10
10
 
11
+ ## 0.2.3 - 2023-12-12
12
+
13
+ ### Added
14
+
15
+ - Added `eventTypes.list()` to [list all event types](https://developer.paddle.com/api-reference/event-types/list-event-types?utm_source=dx&utm_medium=paddle-node-sdk)
16
+ - Added `notificationSettings.list()` to [list all notification settings](https://developer.paddle.com/api-reference/notification-settings/list-notification-settings?utm_source=dx&utm_medium=paddle-node-sdk)
17
+ - Added `notificationSettings.create()` to [create a notification settings](https://developer.paddle.com/api-reference/notification-settings/create-notification-setting?utm_source=dx&utm_medium=paddle-node-sdk)
18
+ - 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)
19
+ - 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)
20
+ - 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)
21
+ - Added `notifications.list()` to [list all notifications](https://developer.paddle.com/api-reference/notifications/list-notifications?utm_source=dx&utm_medium=paddle-node-sdk)
22
+ - Added `notifications.get()` to [get a notification](https://developer.paddle.com/api-reference/notifications/get-notification?utm_source=dx&utm_medium=paddle-node-sdk)
23
+ - Added `notifications.replay()` to [replay a notification](https://developer.paddle.com/api-reference/notifications/replay-notification?utm_source=dx&utm_medium=paddle-node-sdk)
24
+ - 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)
25
+
26
+
27
+ ### Fixed
28
+
29
+ - Fixed incorrect type of `action` in `subscriptions.scheduled_change`
30
+
31
+ ---
32
+
11
33
  ## 0.2.2 - 2023-12-01
12
34
 
13
35
  ### Added
package/README.md CHANGED
@@ -330,22 +330,22 @@ This table shows which operations are available as of the latest release.
330
330
  | Create an adjustment | ✅ |
331
331
  | **Pricing preview** | **Full** |
332
332
  | Preview prices | ✅ |
333
- | **Event types** | **None** |
334
- | List event types | ❌ |
333
+ | **Event types** | **Full** |
334
+ | List event types | ✅ |
335
335
  | **Events** | **Full** |
336
336
  | List events | ✅ |
337
- | **Notification settings** | **None** |
338
- | List notification settings | ❌ |
339
- | Create a notification setting | ❌ |
340
- | Get a notification setting | ❌ |
341
- | Update a notification setting | ❌ |
342
- | Delete a notification setting | ❌ |
343
- | **Notifications** | **None** |
344
- | List notifications | ❌ |
345
- | Get a notification | ❌ |
346
- | Replay a notification | ❌ |
347
- | **Notification logs** | **None** |
348
- | List logs for a notification | ❌ |
337
+ | **Notification settings** | **Full** |
338
+ | List notification settings | ✅ |
339
+ | Create a notification setting | ✅ |
340
+ | Get a notification setting | ✅ |
341
+ | Update a notification setting | ✅ |
342
+ | Delete a notification setting | ✅ |
343
+ | **Notifications** | **Full** |
344
+ | List notifications | ✅ |
345
+ | Get a notification | ✅ |
346
+ | Replay a notification | ✅ |
347
+ | **Notification logs** | **Full** |
348
+ | List logs for a notification | ✅ |
349
349
 
350
350
  ## Learn more
351
351
 
@@ -0,0 +1,9 @@
1
+ import { type IEventTypeResponse } from '../../types';
2
+ import { type IEventName } from '../../notifications';
3
+ export declare class EventType {
4
+ readonly name: IEventName;
5
+ readonly description: string;
6
+ readonly group: string;
7
+ readonly availableVersions: number[];
8
+ constructor(eventType: IEventTypeResponse);
9
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventType = void 0;
4
+ class EventType {
5
+ constructor(eventType) {
6
+ this.name = eventType.name;
7
+ this.description = eventType.description;
8
+ this.group = eventType.group;
9
+ this.availableVersions = eventType.available_versions;
10
+ }
11
+ }
12
+ exports.EventType = EventType;
@@ -0,0 +1 @@
1
+ export * from './event-type';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./event-type"), exports);
@@ -1,6 +1,6 @@
1
1
  import { Collection } from '../../internal/base';
2
2
  import { type IEvents, type IEventsResponse } from '../../types';
3
3
  import { type EventEntity } from '../../notifications';
4
- export declare class EventCollection extends Collection<IEventsResponse, EventEntity> {
5
- fromJson(data: IEvents): EventEntity;
4
+ export declare class EventCollection extends Collection<IEventsResponse, EventEntity | null> {
5
+ fromJson(data: IEvents): EventEntity | null;
6
6
  }
@@ -10,4 +10,7 @@ export * from './address';
10
10
  export * from './discount';
11
11
  export * from './events';
12
12
  export * from './payout';
13
+ export * from './event-types';
14
+ export * from './notification-settings';
15
+ export * from './notifications';
13
16
  export type CustomData = object;
@@ -26,3 +26,6 @@ __exportStar(require("./address"), exports);
26
26
  __exportStar(require("./discount"), exports);
27
27
  __exportStar(require("./events"), exports);
28
28
  __exportStar(require("./payout"), exports);
29
+ __exportStar(require("./event-types"), exports);
30
+ __exportStar(require("./notification-settings"), exports);
31
+ __exportStar(require("./notifications"), exports);
@@ -0,0 +1 @@
1
+ export * from './notification-settings';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./notification-settings"), exports);
@@ -0,0 +1,15 @@
1
+ import { type NotificationSettingsType } from '../../enums';
2
+ import { EventType } from '../event-types';
3
+ import { type INotificationSettingsResponse } from '../../types/notification-settings';
4
+ export declare class NotificationSettings {
5
+ readonly id: string;
6
+ readonly description: string;
7
+ readonly type: NotificationSettingsType;
8
+ readonly destination: string;
9
+ readonly active: boolean;
10
+ readonly apiVersion: number;
11
+ readonly includeSensitiveFields: boolean;
12
+ readonly subscribedEvents: EventType[];
13
+ readonly endpointSecretKey: string;
14
+ constructor(notificationSettings: INotificationSettingsResponse);
15
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationSettings = void 0;
4
+ const event_types_1 = require("../event-types");
5
+ class NotificationSettings {
6
+ constructor(notificationSettings) {
7
+ this.id = notificationSettings.id;
8
+ this.description = notificationSettings.description;
9
+ this.type = notificationSettings.type;
10
+ this.destination = notificationSettings.destination;
11
+ this.active = notificationSettings.active;
12
+ this.apiVersion = notificationSettings.api_version;
13
+ this.includeSensitiveFields = notificationSettings.include_sensitive_fields;
14
+ this.subscribedEvents = notificationSettings.subscribed_events.map((subscribed_event) => new event_types_1.EventType(subscribed_event));
15
+ this.endpointSecretKey = notificationSettings.endpoint_secret_key;
16
+ }
17
+ }
18
+ exports.NotificationSettings = NotificationSettings;
@@ -0,0 +1,5 @@
1
+ export * from './notification';
2
+ export * from './notification-log';
3
+ export * from './notification-collection';
4
+ export * from './replay-notification';
5
+ export * from './notification-log-collection';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./notification"), exports);
18
+ __exportStar(require("./notification-log"), exports);
19
+ __exportStar(require("./notification-collection"), exports);
20
+ __exportStar(require("./replay-notification"), exports);
21
+ __exportStar(require("./notification-log-collection"), exports);
@@ -0,0 +1,6 @@
1
+ import { Collection } from '../../internal/base';
2
+ import { Notification } from './notification';
3
+ import { type INotificationResponse } from '../../types/notifications';
4
+ export declare class NotificationCollection extends Collection<INotificationResponse, Notification> {
5
+ fromJson(data: INotificationResponse): Notification;
6
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationCollection = void 0;
4
+ const base_1 = require("../../internal/base");
5
+ const notification_1 = require("./notification");
6
+ class NotificationCollection extends base_1.Collection {
7
+ fromJson(data) {
8
+ return new notification_1.Notification(data);
9
+ }
10
+ }
11
+ exports.NotificationCollection = NotificationCollection;
@@ -0,0 +1,6 @@
1
+ import { Collection } from '../../internal/base';
2
+ import { type INotificationLogResponse } from '../../types';
3
+ import { NotificationLog } from './notification-log';
4
+ export declare class NotificationLogCollection extends Collection<INotificationLogResponse, NotificationLog> {
5
+ fromJson(data: INotificationLogResponse): NotificationLog;
6
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationLogCollection = void 0;
4
+ const base_1 = require("../../internal/base");
5
+ const notification_log_1 = require("./notification-log");
6
+ class NotificationLogCollection extends base_1.Collection {
7
+ fromJson(data) {
8
+ return new notification_log_1.NotificationLog(data);
9
+ }
10
+ }
11
+ exports.NotificationLogCollection = NotificationLogCollection;
@@ -0,0 +1,8 @@
1
+ export declare class NotificationLog {
2
+ readonly id: string;
3
+ readonly responseCode: number;
4
+ readonly responseContentType: string | null;
5
+ readonly responseBody: string;
6
+ readonly attemptedAt: string;
7
+ constructor(notificationLogResponse: any);
8
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationLog = void 0;
4
+ class NotificationLog {
5
+ constructor(notificationLogResponse) {
6
+ var _a;
7
+ this.id = notificationLogResponse.id;
8
+ this.responseCode = notificationLogResponse.response_code;
9
+ this.responseContentType = (_a = notificationLogResponse.response_content_type) !== null && _a !== void 0 ? _a : null;
10
+ this.responseBody = notificationLogResponse.response_body;
11
+ this.attemptedAt = notificationLogResponse.attempted_at;
12
+ }
13
+ }
14
+ exports.NotificationLog = NotificationLog;
@@ -0,0 +1,18 @@
1
+ import { type NotificationStatus, type Origin } from '../../enums';
2
+ import { type EventEntity, type IEventName } from '../../notifications';
3
+ import { type INotificationResponse } from '../../types';
4
+ export declare class Notification {
5
+ readonly id: string;
6
+ readonly type: IEventName;
7
+ readonly status: NotificationStatus;
8
+ readonly payload: EventEntity | null;
9
+ readonly occurredAt: string;
10
+ readonly deliveredAt: null | string;
11
+ readonly replayedAt: null | string;
12
+ readonly origin: Origin;
13
+ readonly lastAttemptAt: null | string;
14
+ readonly retryAt: null | string;
15
+ readonly timesAttempted: number;
16
+ readonly notificationSettingId: string;
17
+ constructor(notificationResponse: INotificationResponse);
18
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Notification = void 0;
4
+ const notifications_1 = require("../../notifications");
5
+ class Notification {
6
+ constructor(notificationResponse) {
7
+ var _a, _b, _c, _d;
8
+ this.id = notificationResponse.id;
9
+ this.type = notificationResponse.type;
10
+ this.status = notificationResponse.status;
11
+ this.payload = notifications_1.Webhooks.fromJson(notificationResponse.payload);
12
+ this.occurredAt = notificationResponse.occurred_at;
13
+ this.deliveredAt = (_a = notificationResponse.delivered_at) !== null && _a !== void 0 ? _a : null;
14
+ this.replayedAt = (_b = notificationResponse.replayed_at) !== null && _b !== void 0 ? _b : null;
15
+ this.origin = notificationResponse.origin;
16
+ this.lastAttemptAt = (_c = notificationResponse.last_attempt_at) !== null && _c !== void 0 ? _c : null;
17
+ this.retryAt = (_d = notificationResponse.retry_at) !== null && _d !== void 0 ? _d : null;
18
+ this.timesAttempted = notificationResponse.times_attempted;
19
+ this.notificationSettingId = notificationResponse.notification_setting_id;
20
+ }
21
+ }
22
+ exports.Notification = Notification;
@@ -0,0 +1,5 @@
1
+ import { type IReplayNotificationResponse } from '../../types/notifications';
2
+ export declare class ReplayNotification {
3
+ readonly notificationId: string;
4
+ constructor(notificationResponse: IReplayNotificationResponse);
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReplayNotification = void 0;
4
+ class ReplayNotification {
5
+ constructor(notificationResponse) {
6
+ this.notificationId = notificationResponse.notification_id;
7
+ }
8
+ }
9
+ exports.ReplayNotification = ReplayNotification;
@@ -1,7 +1,7 @@
1
1
  import { type ISubscriptionScheduledChangeResponse } from '../../types';
2
- import { type AdjustmentAction } from '../../enums';
2
+ import { type ScheduledChangeAction } from '../../enums';
3
3
  export declare class SubscriptionScheduledChange {
4
- readonly action: AdjustmentAction;
4
+ readonly action: ScheduledChangeAction;
5
5
  readonly effectiveAt: string;
6
6
  readonly resumeAt: string | null;
7
7
  constructor(subscriptionScheduledChange: ISubscriptionScheduledChangeResponse);
@@ -4,3 +4,5 @@ export * from './discount';
4
4
  export * from './adjustment';
5
5
  export * from './transaction';
6
6
  export * from './payout';
7
+ export * from './notification-settings';
8
+ export * from './notification';
@@ -20,3 +20,5 @@ __exportStar(require("./discount"), exports);
20
20
  __exportStar(require("./adjustment"), exports);
21
21
  __exportStar(require("./transaction"), exports);
22
22
  __exportStar(require("./payout"), exports);
23
+ __exportStar(require("./notification-settings"), exports);
24
+ __exportStar(require("./notification"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './notification-status';
2
+ export * from './origin';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./notification-status"), exports);
18
+ __exportStar(require("./origin"), exports);
@@ -0,0 +1 @@
1
+ export type NotificationStatus = 'not_attempted' | 'needs_retry' | 'delivered' | 'failed';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type Origin = 'event' | 'replay';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './notification-settings-type';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./notification-settings-type"), exports);
@@ -0,0 +1 @@
1
+ export type NotificationSettingsType = 'email' | 'url';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,6 @@
1
1
  import { type QueryParameters } from '../base';
2
2
  import { type PaddleOptions } from '../types/config';
3
+ import { type ErrorResponse } from '../types/response';
3
4
  export declare class Client {
4
5
  private readonly apiKey;
5
6
  private readonly options;
@@ -10,4 +11,5 @@ export declare class Client {
10
11
  get<Q, R>(url: string, queryParams?: QueryParameters<Q>): Promise<R>;
11
12
  post<B, R>(url: string, requestBody: B): Promise<R>;
12
13
  patch<B, R>(url: string, requestBody: B): Promise<R>;
14
+ delete(url: string): Promise<ErrorResponse | undefined>;
13
15
  }
@@ -34,6 +34,7 @@ class Client {
34
34
  const uuid = (0, crypto_1.randomUUID)();
35
35
  return {
36
36
  Authorization: `bearer ${this.apiKey}`,
37
+ 'Content-Type': 'application/json',
37
38
  'user-agent': `PaddleSDK/node ${version_1.SDK_VERSION}`,
38
39
  'X-Transaction-ID': uuid,
39
40
  };
@@ -82,5 +83,18 @@ class Client {
82
83
  return rawResponse.json();
83
84
  });
84
85
  }
86
+ delete(url) {
87
+ return __awaiter(this, void 0, void 0, function* () {
88
+ const logUrl = url.split('?')[0];
89
+ const headers = this.getHeaders();
90
+ logger_1.Logger.logRequest('DELETE', logUrl, headers);
91
+ const rawResponse = yield (0, node_fetch_1.default)(`${this.baseUrl}${url}`, {
92
+ method: 'DELETE',
93
+ headers,
94
+ });
95
+ logger_1.Logger.logResponse('DELETE', logUrl, headers, rawResponse);
96
+ return rawResponse;
97
+ });
98
+ }
85
99
  }
86
100
  exports.Client = Client;
@@ -1,7 +1,7 @@
1
1
  import { type IEvents } from '../../types';
2
2
  import { type EventEntity } from './types';
3
3
  export declare class Webhooks {
4
- unmarshal(requestBody: string, secretKey: string, signature: string): EventEntity;
4
+ unmarshal(requestBody: string, secretKey: string, signature: string): EventEntity | null;
5
5
  isSignatureValid(requestBody: string, secretKey: string, signature: string): boolean;
6
- static fromJson(data: IEvents): EventEntity;
6
+ static fromJson(data: IEvents): EventEntity | null;
7
7
  }
@@ -4,6 +4,7 @@ exports.Webhooks = void 0;
4
4
  const events_1 = require("../events");
5
5
  const types_1 = require("./types");
6
6
  const webhooks_validator_1 = require("./webhooks-validator");
7
+ const logger_1 = require("../../internal/base/logger");
7
8
  class Webhooks {
8
9
  unmarshal(requestBody, secretKey, signature) {
9
10
  const isSignatureValid = new webhooks_validator_1.WebhooksValidator().isValidSignature(requestBody, secretKey, signature);
@@ -91,7 +92,8 @@ class Webhooks {
91
92
  case types_1.EventName.TransactionUpdated:
92
93
  return new events_1.TransactionUpdatedEvent(data);
93
94
  default:
94
- throw new Error('[Paddle] Unknown event_type');
95
+ logger_1.Logger.log('Unknown event_type');
96
+ return null;
95
97
  }
96
98
  }
97
99
  }
package/dist/paddle.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomersResource, DiscountsResource, PricesResource, PricingPreviewResource, ProductsResource, SubscriptionsResource, TransactionsResource } from './resources';
1
+ import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomersResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PricesResource, PricingPreviewResource, ProductsResource, SubscriptionsResource, TransactionsResource } from './resources';
2
2
  import { type PaddleOptions } from './internal';
3
3
  import { EventsResource } from './resources/events';
4
4
  import { Webhooks } from './notifications';
@@ -17,5 +17,8 @@ export declare class Paddle {
17
17
  pricingPreview: PricingPreviewResource;
18
18
  events: EventsResource;
19
19
  webhooks: Webhooks;
20
+ eventTypes: EventTypesResource;
21
+ notificationSettings: NotificationSettingsResource;
22
+ notifications: NotificationsResource;
20
23
  constructor(apiKey: string, options?: PaddleOptions);
21
24
  }
package/dist/paddle.js CHANGED
@@ -24,6 +24,9 @@ class Paddle {
24
24
  this.pricingPreview = new resources_1.PricingPreviewResource(this.client);
25
25
  this.events = new events_1.EventsResource(this.client);
26
26
  this.webhooks = new notifications_1.Webhooks();
27
+ this.eventTypes = new resources_1.EventTypesResource(this.client);
28
+ this.notificationSettings = new resources_1.NotificationSettingsResource(this.client);
29
+ this.notifications = new resources_1.NotificationsResource(this.client);
27
30
  }
28
31
  }
29
32
  exports.Paddle = Paddle;
@@ -0,0 +1,5 @@
1
+ import { BaseResource } from '../../internal/base';
2
+ import { EventType } from '../../entities';
3
+ export declare class EventTypesResource extends BaseResource {
4
+ list(): Promise<EventType[]>;
5
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.EventTypesResource = void 0;
13
+ const base_1 = require("../../internal/base");
14
+ const entities_1 = require("../../entities");
15
+ const EventTypesPaths = {
16
+ list: '/event-types',
17
+ };
18
+ class EventTypesResource extends base_1.BaseResource {
19
+ list() {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const response = yield this.client.get(EventTypesPaths.list);
22
+ const data = this.handleResponse(response);
23
+ return data.map((eventType) => new entities_1.EventType(eventType));
24
+ });
25
+ }
26
+ }
27
+ exports.EventTypesResource = EventTypesResource;
@@ -8,3 +8,6 @@ export * from './products';
8
8
  export * from './subscriptions';
9
9
  export * from './transactions';
10
10
  export * from './pricing-preview';
11
+ export * from './event-types';
12
+ export * from './notification-settings';
13
+ export * from './notifications';
@@ -24,3 +24,6 @@ __exportStar(require("./products"), exports);
24
24
  __exportStar(require("./subscriptions"), exports);
25
25
  __exportStar(require("./transactions"), exports);
26
26
  __exportStar(require("./pricing-preview"), exports);
27
+ __exportStar(require("./event-types"), exports);
28
+ __exportStar(require("./notification-settings"), exports);
29
+ __exportStar(require("./notifications"), exports);
@@ -0,0 +1,11 @@
1
+ import { BaseResource } from '../../internal/base';
2
+ import { NotificationSettings } from '../../entities';
3
+ import { type CreateNotificationSettingsRequestBody, type UpdateNotificationSettingsRequestBody } from './operations';
4
+ export * from './operations';
5
+ export declare class NotificationSettingsResource extends BaseResource {
6
+ list(): Promise<NotificationSettings[]>;
7
+ create(createNotificationSettings: CreateNotificationSettingsRequestBody): Promise<NotificationSettings>;
8
+ get(notificationId: string): Promise<NotificationSettings>;
9
+ update(notificationId: string, updateNotificationSettings: UpdateNotificationSettingsRequestBody): Promise<NotificationSettings>;
10
+ delete(notificationId: string): Promise<undefined>;
11
+ }
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.NotificationSettingsResource = void 0;
27
+ const base_1 = require("../../internal/base");
28
+ const entities_1 = require("../../entities");
29
+ const NotificationSettingsPaths = {
30
+ list: '/notification-settings',
31
+ create: '/notification-settings',
32
+ get: '/notification-settings/{notification_setting_id}',
33
+ update: '/notification-settings/{notification_setting_id}',
34
+ delete: '/notification-settings/{notification_setting_id}',
35
+ };
36
+ __exportStar(require("./operations"), exports);
37
+ class NotificationSettingsResource extends base_1.BaseResource {
38
+ list() {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ const response = yield this.client.get(NotificationSettingsPaths.list);
41
+ const data = this.handleResponse(response);
42
+ return data.map((notificationSetting) => new entities_1.NotificationSettings(notificationSetting));
43
+ });
44
+ }
45
+ create(createNotificationSettings) {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ const response = yield this.client.post(NotificationSettingsPaths.create, createNotificationSettings);
48
+ const data = this.handleResponse(response);
49
+ return new entities_1.NotificationSettings(data);
50
+ });
51
+ }
52
+ get(notificationId) {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ const urlWithPathParams = new base_1.PathParameters(NotificationSettingsPaths.get, {
55
+ notification_setting_id: notificationId,
56
+ }).deriveUrl();
57
+ const response = yield this.client.get(urlWithPathParams);
58
+ const data = this.handleResponse(response);
59
+ return new entities_1.NotificationSettings(data);
60
+ });
61
+ }
62
+ update(notificationId, updateNotificationSettings) {
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ const urlWithPathParams = new base_1.PathParameters(NotificationSettingsPaths.update, {
65
+ notification_setting_id: notificationId,
66
+ }).deriveUrl();
67
+ const response = yield this.client.patch(urlWithPathParams, updateNotificationSettings);
68
+ const data = this.handleResponse(response);
69
+ return new entities_1.NotificationSettings(data);
70
+ });
71
+ }
72
+ delete(notificationId) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ const urlWithPathParams = new base_1.PathParameters(NotificationSettingsPaths.update, {
75
+ notification_setting_id: notificationId,
76
+ }).deriveUrl();
77
+ const response = yield this.client.delete(urlWithPathParams);
78
+ if (response) {
79
+ this.handleResponse(response);
80
+ }
81
+ });
82
+ }
83
+ }
84
+ exports.NotificationSettingsResource = NotificationSettingsResource;
@@ -0,0 +1,10 @@
1
+ import { type NotificationSettingsType } from '../../../enums';
2
+ import { type IEventName } from '../../../notifications';
3
+ export interface CreateNotificationSettingsRequestBody {
4
+ description: string;
5
+ destination: string;
6
+ subscribedEvents: IEventName[];
7
+ type: NotificationSettingsType;
8
+ apiVersion?: number | null;
9
+ includeSensitiveFields?: boolean | null;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './create-notification-settings-request-body';
2
+ export * from './update-notification-settings-request-body';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./create-notification-settings-request-body"), exports);
18
+ __exportStar(require("./update-notification-settings-request-body"), exports);
@@ -0,0 +1,9 @@
1
+ import { type IEventName } from '../../../notifications';
2
+ export interface UpdateNotificationSettingsRequestBody {
3
+ description?: string;
4
+ destination?: string;
5
+ active?: boolean;
6
+ apiVersion?: number;
7
+ includeSensitiveFields?: boolean;
8
+ subscribedEvents?: IEventName[];
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ import { BaseResource } from '../../internal/base';
2
+ import { Notification, NotificationCollection, NotificationLogCollection, ReplayNotification } from '../../entities';
3
+ import { type ListNotificationLogQueryParameters, type ListNotificationQueryParameters } from './operations';
4
+ export * from './operations';
5
+ export declare class NotificationsResource extends BaseResource {
6
+ list(queryParams?: ListNotificationQueryParameters): NotificationCollection;
7
+ get(notificationId: string): Promise<Notification>;
8
+ replay(notificationId: string): Promise<ReplayNotification>;
9
+ getLogs(notificationId: string, queryParams?: ListNotificationLogQueryParameters): NotificationLogCollection;
10
+ }
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.NotificationsResource = void 0;
27
+ const base_1 = require("../../internal/base");
28
+ const entities_1 = require("../../entities");
29
+ const NotificationPaths = {
30
+ list: '/notifications',
31
+ get: '/notifications/{notification_id}',
32
+ getLogs: '/notifications/{notification_id}/logs',
33
+ replay: '/notifications/{notification_id}/replay',
34
+ };
35
+ __exportStar(require("./operations"), exports);
36
+ class NotificationsResource extends base_1.BaseResource {
37
+ list(queryParams) {
38
+ const queryParameters = new base_1.QueryParameters(queryParams);
39
+ return new entities_1.NotificationCollection(this.client, NotificationPaths.list + '?' + queryParameters.toQueryString());
40
+ }
41
+ get(notificationId) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ const urlWithPathParams = new base_1.PathParameters(NotificationPaths.get, {
44
+ notification_id: notificationId,
45
+ }).deriveUrl();
46
+ const response = yield this.client.get(urlWithPathParams);
47
+ const data = this.handleResponse(response);
48
+ return new entities_1.Notification(data);
49
+ });
50
+ }
51
+ replay(notificationId) {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ const urlWithPathParams = new base_1.PathParameters(NotificationPaths.replay, {
54
+ notification_id: notificationId,
55
+ }).deriveUrl();
56
+ const response = yield this.client.post(urlWithPathParams, undefined);
57
+ const data = this.handleResponse(response);
58
+ return new entities_1.ReplayNotification(data);
59
+ });
60
+ }
61
+ getLogs(notificationId, queryParams) {
62
+ const queryParameters = new base_1.QueryParameters(queryParams);
63
+ const urlWithPathParams = new base_1.PathParameters(NotificationPaths.getLogs, {
64
+ notification_id: notificationId,
65
+ }).deriveUrl();
66
+ return new entities_1.NotificationLogCollection(this.client, urlWithPathParams + '?' + queryParameters.toQueryString());
67
+ }
68
+ }
69
+ exports.NotificationsResource = NotificationsResource;
@@ -0,0 +1,2 @@
1
+ export * from './list-notification-query-parameters';
2
+ export * from './list-notification-log-query-parameters';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./list-notification-query-parameters"), exports);
18
+ __exportStar(require("./list-notification-log-query-parameters"), exports);
@@ -0,0 +1,4 @@
1
+ export interface ListNotificationLogQueryParameters {
2
+ after: string;
3
+ perPage: number;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ import { type NotificationStatus } from '../../../enums';
2
+ export interface ListNotificationQueryParameters {
3
+ after: string;
4
+ notificationSettingId: string[];
5
+ orderBy: string;
6
+ perPage: number;
7
+ search: string;
8
+ status: NotificationStatus[];
9
+ filter: string;
10
+ to: string;
11
+ from: string;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import { type IEventName } from '../../notifications';
2
+ export interface IEventTypeResponse {
3
+ name: IEventName;
4
+ description: string;
5
+ group: string;
6
+ available_versions: number[];
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './event-type-response';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./event-type-response"), exports);
@@ -11,3 +11,6 @@ export * from './discount';
11
11
  export * from './pricing-preview';
12
12
  export * from './events';
13
13
  export * from './payout';
14
+ export * from './event-types';
15
+ export * from './notification-settings';
16
+ export * from './notifications';
@@ -27,3 +27,6 @@ __exportStar(require("./discount"), exports);
27
27
  __exportStar(require("./pricing-preview"), exports);
28
28
  __exportStar(require("./events"), exports);
29
29
  __exportStar(require("./payout"), exports);
30
+ __exportStar(require("./event-types"), exports);
31
+ __exportStar(require("./notification-settings"), exports);
32
+ __exportStar(require("./notifications"), exports);
@@ -0,0 +1 @@
1
+ export * from './notification-settings-response';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./notification-settings-response"), exports);
@@ -0,0 +1,13 @@
1
+ import { type NotificationSettingsType } from '../../enums';
2
+ import { type IEventTypeResponse } from '../event-types';
3
+ export interface INotificationSettingsResponse {
4
+ id: string;
5
+ description: string;
6
+ type: NotificationSettingsType;
7
+ destination: string;
8
+ active: boolean;
9
+ api_version: number;
10
+ include_sensitive_fields: boolean;
11
+ subscribed_events: IEventTypeResponse[];
12
+ endpoint_secret_key: string;
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export * from './notification';
2
+ export * from './notification-log';
3
+ export * from './replay-notification';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./notification"), exports);
18
+ __exportStar(require("./notification-log"), exports);
19
+ __exportStar(require("./replay-notification"), exports);
@@ -0,0 +1,7 @@
1
+ export interface INotificationLogResponse {
2
+ id: string;
3
+ response_code: number;
4
+ response_content_type?: string | null;
5
+ response_body: string;
6
+ attempted_at: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ import { type NotificationStatus, type Origin } from '../../enums';
2
+ import type { IEvents } from '../events';
3
+ import { type IEventName } from '../../notifications';
4
+ export interface INotificationResponse {
5
+ id: string;
6
+ type: IEventName;
7
+ status: NotificationStatus;
8
+ payload: IEvents;
9
+ occurred_at: string;
10
+ delivered_at?: null | string;
11
+ replayed_at?: null | string;
12
+ origin: Origin;
13
+ last_attempt_at?: null | string;
14
+ retry_at?: null | string;
15
+ times_attempted: number;
16
+ notification_setting_id: string;
17
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export interface IReplayNotificationResponse {
2
+ notification_id: string;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,6 @@
1
- import { type AdjustmentAction } from '../../enums';
1
+ import { type ScheduledChangeAction } from '../../enums';
2
2
  export interface ISubscriptionScheduledChangeResponse {
3
- action: AdjustmentAction;
3
+ action: ScheduledChangeAction;
4
4
  effective_at: string;
5
5
  resume_at?: string | null;
6
6
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.2.2";
1
+ export declare const SDK_VERSION = "0.2.3";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = '0.2.2';
4
+ exports.SDK_VERSION = '0.2.3';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paddle/paddle-node-sdk",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "A NodeJS SDK for Paddle Billing API",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",