@paddle/paddle-node-sdk 0.2.1 → 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 (223) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +57 -18
  3. package/dist/entities/discount/discount.d.ts +1 -1
  4. package/dist/entities/discount/discount.js +2 -1
  5. package/dist/entities/event-types/event-type.d.ts +9 -0
  6. package/dist/entities/event-types/event-type.js +12 -0
  7. package/dist/entities/event-types/index.d.ts +1 -0
  8. package/dist/entities/event-types/index.js +17 -0
  9. package/dist/entities/events/event-collection.d.ts +6 -0
  10. package/dist/entities/events/event-collection.js +11 -0
  11. package/dist/entities/events/event.d.ts +9 -0
  12. package/dist/entities/events/event.js +14 -0
  13. package/dist/entities/events/index.d.ts +1 -0
  14. package/dist/entities/events/index.js +17 -0
  15. package/dist/entities/index.d.ts +5 -0
  16. package/dist/entities/index.js +5 -0
  17. package/dist/entities/notification-settings/index.d.ts +1 -0
  18. package/dist/entities/notification-settings/index.js +17 -0
  19. package/dist/entities/notification-settings/notification-settings.d.ts +15 -0
  20. package/dist/entities/notification-settings/notification-settings.js +18 -0
  21. package/dist/entities/notifications/index.d.ts +5 -0
  22. package/dist/entities/notifications/index.js +21 -0
  23. package/dist/entities/notifications/notification-collection.d.ts +6 -0
  24. package/dist/entities/notifications/notification-collection.js +11 -0
  25. package/dist/entities/notifications/notification-log-collection.d.ts +6 -0
  26. package/dist/entities/notifications/notification-log-collection.js +11 -0
  27. package/dist/entities/notifications/notification-log.d.ts +8 -0
  28. package/dist/entities/notifications/notification-log.js +14 -0
  29. package/dist/entities/notifications/notification.d.ts +18 -0
  30. package/dist/entities/notifications/notification.js +22 -0
  31. package/dist/entities/notifications/replay-notification.d.ts +5 -0
  32. package/dist/entities/notifications/replay-notification.js +9 -0
  33. package/dist/entities/payout/index.d.ts +1 -0
  34. package/dist/entities/payout/index.js +17 -0
  35. package/dist/entities/payout/payout.d.ts +9 -0
  36. package/dist/entities/payout/payout.js +12 -0
  37. package/dist/entities/subscription/index.d.ts +1 -0
  38. package/dist/entities/subscription/index.js +1 -0
  39. package/dist/entities/subscription/subscription-notification.d.ts +28 -0
  40. package/dist/entities/subscription/subscription-notification.js +35 -0
  41. package/dist/entities/subscription/subscription-scheduled-change.d.ts +2 -2
  42. package/dist/enums/index.d.ts +3 -0
  43. package/dist/enums/index.js +3 -0
  44. package/dist/enums/notification/index.d.ts +2 -0
  45. package/dist/enums/notification/index.js +18 -0
  46. package/dist/enums/notification/notification-status.d.ts +1 -0
  47. package/dist/enums/notification/notification-status.js +2 -0
  48. package/dist/enums/notification/origin.d.ts +1 -0
  49. package/dist/enums/notification/origin.js +2 -0
  50. package/dist/enums/notification-settings/index.d.ts +1 -0
  51. package/dist/enums/notification-settings/index.js +17 -0
  52. package/dist/enums/notification-settings/notification-settings-type.d.ts +1 -0
  53. package/dist/enums/notification-settings/notification-settings-type.js +2 -0
  54. package/dist/enums/payout/index.d.ts +1 -0
  55. package/dist/enums/payout/index.js +17 -0
  56. package/dist/enums/payout/payout-status.d.ts +1 -0
  57. package/dist/enums/payout/payout-status.js +2 -0
  58. package/dist/internal/api/client.d.ts +2 -0
  59. package/dist/internal/api/client.js +14 -0
  60. package/dist/notifications/events/address/address-created-event.d.ts +9 -0
  61. package/dist/notifications/events/address/address-created-event.js +14 -0
  62. package/dist/notifications/events/address/address-updated-event.d.ts +9 -0
  63. package/dist/notifications/events/address/address-updated-event.js +14 -0
  64. package/dist/notifications/events/address/index.d.ts +2 -0
  65. package/dist/notifications/events/address/index.js +18 -0
  66. package/dist/notifications/events/adjustment/adjustment-created-event.d.ts +9 -0
  67. package/dist/notifications/events/adjustment/adjustment-created-event.js +14 -0
  68. package/dist/notifications/events/adjustment/adjustment-updated-event.d.ts +9 -0
  69. package/dist/notifications/events/adjustment/adjustment-updated-event.js +14 -0
  70. package/dist/notifications/events/adjustment/index.d.ts +2 -0
  71. package/dist/notifications/events/adjustment/index.js +18 -0
  72. package/dist/notifications/events/business/business-created-event.d.ts +9 -0
  73. package/dist/notifications/events/business/business-created-event.js +14 -0
  74. package/dist/notifications/events/business/business-updated-event.d.ts +9 -0
  75. package/dist/notifications/events/business/business-updated-event.js +14 -0
  76. package/dist/notifications/events/business/index.d.ts +2 -0
  77. package/dist/notifications/events/business/index.js +18 -0
  78. package/dist/notifications/events/customer/customer-created-event.d.ts +9 -0
  79. package/dist/notifications/events/customer/customer-created-event.js +14 -0
  80. package/dist/notifications/events/customer/customer-updated-event.d.ts +9 -0
  81. package/dist/notifications/events/customer/customer-updated-event.js +14 -0
  82. package/dist/notifications/events/customer/index.d.ts +2 -0
  83. package/dist/notifications/events/customer/index.js +18 -0
  84. package/dist/notifications/events/discount/discount-created-event.d.ts +9 -0
  85. package/dist/notifications/events/discount/discount-created-event.js +14 -0
  86. package/dist/notifications/events/discount/discount-imported-event.d.ts +9 -0
  87. package/dist/notifications/events/discount/discount-imported-event.js +14 -0
  88. package/dist/notifications/events/discount/discount-updated-event.d.ts +9 -0
  89. package/dist/notifications/events/discount/discount-updated-event.js +14 -0
  90. package/dist/notifications/events/discount/index.d.ts +3 -0
  91. package/dist/notifications/events/discount/index.js +19 -0
  92. package/dist/notifications/events/index.d.ts +10 -0
  93. package/dist/notifications/events/index.js +26 -0
  94. package/dist/notifications/events/payout/index.d.ts +2 -0
  95. package/dist/notifications/events/payout/index.js +18 -0
  96. package/dist/notifications/events/payout/payout-created-event.d.ts +9 -0
  97. package/dist/notifications/events/payout/payout-created-event.js +14 -0
  98. package/dist/notifications/events/payout/payout-paid-event.d.ts +9 -0
  99. package/dist/notifications/events/payout/payout-paid-event.js +14 -0
  100. package/dist/notifications/events/price/index.d.ts +2 -0
  101. package/dist/notifications/events/price/index.js +18 -0
  102. package/dist/notifications/events/price/price-created-event.d.ts +9 -0
  103. package/dist/notifications/events/price/price-created-event.js +14 -0
  104. package/dist/notifications/events/price/price-updated-event.d.ts +9 -0
  105. package/dist/notifications/events/price/price-updated-event.js +14 -0
  106. package/dist/notifications/events/product/index.d.ts +2 -0
  107. package/dist/notifications/events/product/index.js +18 -0
  108. package/dist/notifications/events/product/product-created-event.d.ts +9 -0
  109. package/dist/notifications/events/product/product-created-event.js +14 -0
  110. package/dist/notifications/events/product/product-updated-event.d.ts +9 -0
  111. package/dist/notifications/events/product/product-updated-event.js +14 -0
  112. package/dist/notifications/events/subscription/index.d.ts +9 -0
  113. package/dist/notifications/events/subscription/index.js +25 -0
  114. package/dist/notifications/events/subscription/subscription-activated-event.d.ts +9 -0
  115. package/dist/notifications/events/subscription/subscription-activated-event.js +14 -0
  116. package/dist/notifications/events/subscription/subscription-canceled-event.d.ts +9 -0
  117. package/dist/notifications/events/subscription/subscription-canceled-event.js +14 -0
  118. package/dist/notifications/events/subscription/subscription-created-event.d.ts +9 -0
  119. package/dist/notifications/events/subscription/subscription-created-event.js +14 -0
  120. package/dist/notifications/events/subscription/subscription-imported-event.d.ts +9 -0
  121. package/dist/notifications/events/subscription/subscription-imported-event.js +14 -0
  122. package/dist/notifications/events/subscription/subscription-past-due-event.d.ts +9 -0
  123. package/dist/notifications/events/subscription/subscription-past-due-event.js +14 -0
  124. package/dist/notifications/events/subscription/subscription-paused-event.d.ts +9 -0
  125. package/dist/notifications/events/subscription/subscription-paused-event.js +14 -0
  126. package/dist/notifications/events/subscription/subscription-resumed-event.d.ts +9 -0
  127. package/dist/notifications/events/subscription/subscription-resumed-event.js +14 -0
  128. package/dist/notifications/events/subscription/subscription-trialing-event.d.ts +9 -0
  129. package/dist/notifications/events/subscription/subscription-trialing-event.js +14 -0
  130. package/dist/notifications/events/subscription/subscription-updated-event.d.ts +9 -0
  131. package/dist/notifications/events/subscription/subscription-updated-event.js +14 -0
  132. package/dist/notifications/events/transaction/index.d.ts +9 -0
  133. package/dist/notifications/events/transaction/index.js +25 -0
  134. package/dist/notifications/events/transaction/transaction-billed-event.d.ts +9 -0
  135. package/dist/notifications/events/transaction/transaction-billed-event.js +14 -0
  136. package/dist/notifications/events/transaction/transaction-canceled-event.d.ts +9 -0
  137. package/dist/notifications/events/transaction/transaction-canceled-event.js +14 -0
  138. package/dist/notifications/events/transaction/transaction-completed-event.d.ts +9 -0
  139. package/dist/notifications/events/transaction/transaction-completed-event.js +14 -0
  140. package/dist/notifications/events/transaction/transaction-created-event.d.ts +9 -0
  141. package/dist/notifications/events/transaction/transaction-created-event.js +14 -0
  142. package/dist/notifications/events/transaction/transaction-paid-event.d.ts +9 -0
  143. package/dist/notifications/events/transaction/transaction-paid-event.js +14 -0
  144. package/dist/notifications/events/transaction/transaction-past-due-event.d.ts +9 -0
  145. package/dist/notifications/events/transaction/transaction-past-due-event.js +14 -0
  146. package/dist/notifications/events/transaction/transaction-payment-failed-event.d.ts +9 -0
  147. package/dist/notifications/events/transaction/transaction-payment-failed-event.js +14 -0
  148. package/dist/notifications/events/transaction/transaction-ready-event.d.ts +9 -0
  149. package/dist/notifications/events/transaction/transaction-ready-event.js +14 -0
  150. package/dist/notifications/events/transaction/transaction-updated-event.d.ts +9 -0
  151. package/dist/notifications/events/transaction/transaction-updated-event.js +14 -0
  152. package/dist/notifications/helpers/index.d.ts +3 -0
  153. package/dist/notifications/helpers/index.js +19 -0
  154. package/dist/notifications/helpers/types.d.ts +40 -0
  155. package/dist/notifications/helpers/types.js +41 -0
  156. package/dist/notifications/{validator/notifications-validator.d.ts → helpers/webhooks-validator.d.ts} +1 -1
  157. package/dist/notifications/{validator/notifications-validator.js → helpers/webhooks-validator.js} +6 -6
  158. package/dist/notifications/helpers/webhooks.d.ts +7 -0
  159. package/dist/notifications/helpers/webhooks.js +100 -0
  160. package/dist/notifications/index.d.ts +2 -1
  161. package/dist/notifications/index.js +2 -1
  162. package/dist/paddle.d.ts +9 -2
  163. package/dist/paddle.js +8 -1
  164. package/dist/resources/event-types/index.d.ts +5 -0
  165. package/dist/resources/event-types/index.js +27 -0
  166. package/dist/resources/events/index.d.ts +7 -0
  167. package/dist/resources/events/index.js +30 -0
  168. package/dist/resources/events/operations/index.d.ts +1 -0
  169. package/dist/resources/events/operations/index.js +17 -0
  170. package/dist/resources/events/operations/list-events-query-parameters.d.ts +5 -0
  171. package/dist/resources/events/operations/list-events-query-parameters.js +2 -0
  172. package/dist/resources/index.d.ts +3 -0
  173. package/dist/resources/index.js +3 -0
  174. package/dist/resources/notification-settings/index.d.ts +11 -0
  175. package/dist/resources/notification-settings/index.js +84 -0
  176. package/dist/resources/notification-settings/operations/create-notification-settings-request-body.d.ts +10 -0
  177. package/dist/resources/notification-settings/operations/create-notification-settings-request-body.js +2 -0
  178. package/dist/resources/notification-settings/operations/index.d.ts +2 -0
  179. package/dist/resources/notification-settings/operations/index.js +18 -0
  180. package/dist/resources/notification-settings/operations/update-notification-settings-request-body.d.ts +9 -0
  181. package/dist/resources/notification-settings/operations/update-notification-settings-request-body.js +2 -0
  182. package/dist/resources/notifications/index.d.ts +10 -0
  183. package/dist/resources/notifications/index.js +69 -0
  184. package/dist/resources/notifications/operations/index.d.ts +2 -0
  185. package/dist/resources/notifications/operations/index.js +18 -0
  186. package/dist/resources/notifications/operations/list-notification-log-query-parameters.d.ts +4 -0
  187. package/dist/resources/notifications/operations/list-notification-log-query-parameters.js +2 -0
  188. package/dist/resources/notifications/operations/list-notification-query-parameters.d.ts +12 -0
  189. package/dist/resources/notifications/operations/list-notification-query-parameters.js +2 -0
  190. package/dist/types/event-types/event-type-response.d.ts +7 -0
  191. package/dist/types/event-types/event-type-response.js +2 -0
  192. package/dist/types/event-types/index.d.ts +1 -0
  193. package/dist/types/event-types/index.js +17 -0
  194. package/dist/types/events/events-response.d.ts +125 -0
  195. package/dist/types/events/events-response.js +2 -0
  196. package/dist/types/events/index.d.ts +1 -0
  197. package/dist/types/events/index.js +17 -0
  198. package/dist/types/index.d.ts +5 -0
  199. package/dist/types/index.js +5 -0
  200. package/dist/types/notification-settings/index.d.ts +1 -0
  201. package/dist/types/notification-settings/index.js +17 -0
  202. package/dist/types/notification-settings/notification-settings-response.d.ts +13 -0
  203. package/dist/types/notification-settings/notification-settings-response.js +2 -0
  204. package/dist/types/notifications/index.d.ts +3 -0
  205. package/dist/types/notifications/index.js +19 -0
  206. package/dist/types/notifications/notification-log.d.ts +7 -0
  207. package/dist/types/notifications/notification-log.js +2 -0
  208. package/dist/types/notifications/notification.d.ts +17 -0
  209. package/dist/types/notifications/notification.js +2 -0
  210. package/dist/types/notifications/replay-notification.d.ts +3 -0
  211. package/dist/types/notifications/replay-notification.js +2 -0
  212. package/dist/types/payout/index.d.ts +1 -0
  213. package/dist/types/payout/index.js +17 -0
  214. package/dist/types/payout/payout-response.d.ts +7 -0
  215. package/dist/types/payout/payout-response.js +2 -0
  216. package/dist/types/subscription/index.d.ts +1 -0
  217. package/dist/types/subscription/index.js +1 -0
  218. package/dist/types/subscription/subscription-notification-response.d.ts +28 -0
  219. package/dist/types/subscription/subscription-notification-response.js +2 -0
  220. package/dist/types/subscription/subscription-scheduled-change-response.d.ts +2 -2
  221. package/dist/version.d.ts +1 -1
  222. package/dist/version.js +1 -1
  223. package/package.json +1 -1
@@ -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);
@@ -0,0 +1,125 @@
1
+ import { type IAddressResponse } from '../address';
2
+ import { type IBusinessResponse } from '../business';
3
+ import { type EventName } from '../../notifications';
4
+ import { type IAdjustmentResponse } from '../adjustment';
5
+ import { type ICustomerResponse } from '../customer';
6
+ import { type IDiscountResponse } from '../discount';
7
+ import { type IPriceResponse } from '../price';
8
+ import { type IProductResponse } from '../product';
9
+ import { type ISubscriptionNotificationResponse } from '../subscription';
10
+ import { type ITransactionResponse } from '../transaction';
11
+ import { type IPayoutResponse } from '../payout';
12
+ export interface IEventsResponse<T = object> {
13
+ event_id: string;
14
+ notification_id: string;
15
+ event_type: string;
16
+ occurred_at: string;
17
+ data: T;
18
+ }
19
+ interface IAddressCreated extends IEventsResponse<IAddressResponse> {
20
+ event_type: EventName.AddressCreated;
21
+ }
22
+ interface IAddressUpdated extends IEventsResponse<IAddressResponse> {
23
+ event_type: EventName.AddressUpdated;
24
+ }
25
+ interface IAdjustmentCreated extends IEventsResponse<IAdjustmentResponse> {
26
+ event_type: EventName.AdjustmentCreated;
27
+ }
28
+ interface IAdjustmentUpdated extends IEventsResponse<IAdjustmentResponse> {
29
+ event_type: EventName.AdjustmentUpdated;
30
+ }
31
+ interface IBusinessCreated extends IEventsResponse<IBusinessResponse> {
32
+ event_type: EventName.BusinessCreated;
33
+ }
34
+ interface IBusinessUpdated extends IEventsResponse<IBusinessResponse> {
35
+ event_type: EventName.BusinessUpdated;
36
+ }
37
+ interface ICustomerCreated extends IEventsResponse<ICustomerResponse> {
38
+ event_type: EventName.CustomerCreated;
39
+ }
40
+ interface ICustomerUpdated extends IEventsResponse<ICustomerResponse> {
41
+ event_type: EventName.CustomerUpdated;
42
+ }
43
+ interface IDiscountCreated extends IEventsResponse<IDiscountResponse> {
44
+ event_type: EventName.DiscountCreated;
45
+ }
46
+ interface IDiscountUpdated extends IEventsResponse<IDiscountResponse> {
47
+ event_type: EventName.DiscountUpdated;
48
+ }
49
+ interface IDiscountImported extends IEventsResponse<IDiscountResponse> {
50
+ event_type: EventName.DiscountImported;
51
+ }
52
+ interface IPayoutCreated extends IEventsResponse<IPayoutResponse> {
53
+ event_type: EventName.PayoutCreated;
54
+ }
55
+ interface IPayoutPaid extends IEventsResponse<IPayoutResponse> {
56
+ event_type: EventName.PayoutPaid;
57
+ }
58
+ interface IPriceCreated extends IEventsResponse<IPriceResponse> {
59
+ event_type: EventName.PriceCreated;
60
+ }
61
+ interface IPriceUpdated extends IEventsResponse<IPriceResponse> {
62
+ event_type: EventName.PriceUpdated;
63
+ }
64
+ interface IProductCreated extends IEventsResponse<IProductResponse> {
65
+ event_type: EventName.ProductCreated;
66
+ }
67
+ interface IProductUpdated extends IEventsResponse<IProductResponse> {
68
+ event_type: EventName.ProductUpdated;
69
+ }
70
+ interface ISubscriptionActivated extends IEventsResponse<ISubscriptionNotificationResponse> {
71
+ event_type: EventName.SubscriptionActivated;
72
+ }
73
+ interface ISubscriptionCanceled extends IEventsResponse<ISubscriptionNotificationResponse> {
74
+ event_type: EventName.SubscriptionCanceled;
75
+ }
76
+ interface ISubscriptionCreated extends IEventsResponse<ISubscriptionNotificationResponse> {
77
+ event_type: EventName.SubscriptionCreated;
78
+ }
79
+ interface ISubscriptionImported extends IEventsResponse<ISubscriptionNotificationResponse> {
80
+ event_type: EventName.SubscriptionImported;
81
+ }
82
+ interface ISubscriptionPastDue extends IEventsResponse<ISubscriptionNotificationResponse> {
83
+ event_type: EventName.SubscriptionPastDue;
84
+ }
85
+ interface ISubscriptionPaused extends IEventsResponse<ISubscriptionNotificationResponse> {
86
+ event_type: EventName.SubscriptionPaused;
87
+ }
88
+ interface ISubscriptionResumed extends IEventsResponse<ISubscriptionNotificationResponse> {
89
+ event_type: EventName.SubscriptionResumed;
90
+ }
91
+ interface ISubscriptionTrialing extends IEventsResponse<ISubscriptionNotificationResponse> {
92
+ event_type: EventName.SubscriptionTrialing;
93
+ }
94
+ interface ISubscriptionUpdated extends IEventsResponse<ISubscriptionNotificationResponse> {
95
+ event_type: EventName.SubscriptionUpdated;
96
+ }
97
+ interface ITransactionBilled extends IEventsResponse<ITransactionResponse> {
98
+ event_type: EventName.TransactionBilled;
99
+ }
100
+ interface ITransactionCanceled extends IEventsResponse<ITransactionResponse> {
101
+ event_type: EventName.TransactionCanceled;
102
+ }
103
+ interface ITransactionCompleted extends IEventsResponse<ITransactionResponse> {
104
+ event_type: EventName.TransactionCompleted;
105
+ }
106
+ interface ITransactionCreated extends IEventsResponse<ITransactionResponse> {
107
+ event_type: EventName.TransactionCreated;
108
+ }
109
+ interface ITransactionPaid extends IEventsResponse<ITransactionResponse> {
110
+ event_type: EventName.TransactionPaid;
111
+ }
112
+ interface ITransactionPastDue extends IEventsResponse<ITransactionResponse> {
113
+ event_type: EventName.TransactionPastDue;
114
+ }
115
+ interface ITransactionPaymentFailed extends IEventsResponse<ITransactionResponse> {
116
+ event_type: EventName.TransactionPaymentFailed;
117
+ }
118
+ interface ITransactionReady extends IEventsResponse<ITransactionResponse> {
119
+ event_type: EventName.TransactionReady;
120
+ }
121
+ interface ITransactionUpdated extends IEventsResponse<ITransactionResponse> {
122
+ event_type: EventName.TransactionUpdated;
123
+ }
124
+ export type IEvents = IAddressCreated | IAddressUpdated | IAdjustmentCreated | IAdjustmentUpdated | IBusinessCreated | IBusinessUpdated | ICustomerCreated | ICustomerUpdated | IDiscountCreated | IDiscountUpdated | IDiscountImported | IPayoutCreated | IPayoutPaid | IPriceCreated | IPriceUpdated | IProductCreated | IProductUpdated | ISubscriptionActivated | ISubscriptionCanceled | ISubscriptionCreated | ISubscriptionImported | ISubscriptionPastDue | ISubscriptionPaused | ISubscriptionResumed | ISubscriptionTrialing | ISubscriptionUpdated | ITransactionBilled | ITransactionCanceled | ITransactionCompleted | ITransactionCreated | ITransactionPaid | ITransactionPastDue | ITransactionPaymentFailed | ITransactionReady | ITransactionUpdated;
125
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './events-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("./events-response"), exports);
@@ -9,3 +9,8 @@ export * from './subscription';
9
9
  export * from './address';
10
10
  export * from './discount';
11
11
  export * from './pricing-preview';
12
+ export * from './events';
13
+ export * from './payout';
14
+ export * from './event-types';
15
+ export * from './notification-settings';
16
+ export * from './notifications';
@@ -25,3 +25,8 @@ __exportStar(require("./subscription"), exports);
25
25
  __exportStar(require("./address"), exports);
26
26
  __exportStar(require("./discount"), exports);
27
27
  __exportStar(require("./pricing-preview"), exports);
28
+ __exportStar(require("./events"), exports);
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 });
@@ -0,0 +1 @@
1
+ export * from './payout-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("./payout-response"), exports);
@@ -0,0 +1,7 @@
1
+ import { type CurrencyCode, type PayoutStatus } from '../../enums';
2
+ export interface IPayoutResponse {
3
+ id: string;
4
+ status: PayoutStatus;
5
+ amount: string;
6
+ currency_code: CurrencyCode;
7
+ }