@paddle/paddle-node-sdk 1.7.0 → 1.9.0

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 (175) hide show
  1. package/CHANGELOG.md +22 -7
  2. package/dist/cjs/entities/index.js +4 -0
  3. package/dist/cjs/entities/notification-settings/notification-settings.js +1 -0
  4. package/dist/cjs/entities/shared/index.js +2 -0
  5. package/dist/cjs/entities/shared/simulation-event-request.js +9 -0
  6. package/dist/cjs/entities/shared/simulation-event-response.js +10 -0
  7. package/dist/cjs/entities/simulation/index.js +18 -0
  8. package/dist/cjs/entities/simulation/simulation-collection.js +11 -0
  9. package/dist/cjs/entities/simulation/simulation.js +18 -0
  10. package/dist/cjs/entities/simulation-run/index.js +18 -0
  11. package/dist/cjs/entities/simulation-run/simulation-run-collection.js +11 -0
  12. package/dist/cjs/entities/simulation-run/simulation-run.js +16 -0
  13. package/dist/cjs/entities/simulation-run-event/index.js +18 -0
  14. package/dist/cjs/entities/simulation-run-event/simulation-run-event-collection.js +11 -0
  15. package/dist/cjs/entities/simulation-run-event/simulation-run-event.js +21 -0
  16. package/dist/cjs/entities/simulation-types/index.js +17 -0
  17. package/dist/cjs/entities/simulation-types/simulation-type.js +14 -0
  18. package/dist/cjs/enums/index.js +4 -0
  19. package/dist/cjs/enums/notification-settings/index.js +1 -0
  20. package/dist/cjs/enums/notification-settings/traffic-source.js +2 -0
  21. package/dist/cjs/enums/simulation/index.js +17 -0
  22. package/dist/cjs/enums/simulation/simulation-scenario-type.js +2 -0
  23. package/dist/cjs/enums/simulation-run/index.js +17 -0
  24. package/dist/cjs/enums/simulation-run/simulation-run-status.js +2 -0
  25. package/dist/cjs/enums/simulation-run-event/index.js +17 -0
  26. package/dist/cjs/enums/simulation-run-event/simulation-run-event-status.js +2 -0
  27. package/dist/cjs/enums/simulation-type/index.js +17 -0
  28. package/dist/cjs/enums/simulation-type/simulation-kind.js +2 -0
  29. package/dist/cjs/paddle.js +4 -0
  30. package/dist/cjs/resources/index.js +4 -0
  31. package/dist/cjs/resources/simulation-run-events/index.js +69 -0
  32. package/dist/cjs/resources/simulation-run-events/operations/index.js +17 -0
  33. package/dist/cjs/resources/simulation-run-events/operations/list-simulation-run-events-query-parameters.js +2 -0
  34. package/dist/cjs/resources/simulation-runs/index.js +66 -0
  35. package/dist/cjs/resources/simulation-runs/operations/get-simulation-run-query-parameters.js +2 -0
  36. package/dist/cjs/resources/simulation-runs/operations/index.js +18 -0
  37. package/dist/cjs/resources/simulation-runs/operations/list-simulation-run-query-parameters.js +2 -0
  38. package/dist/cjs/resources/simulation-types/index.js +27 -0
  39. package/dist/cjs/resources/simulations/index.js +69 -0
  40. package/dist/cjs/resources/simulations/operations/create-simulation-request-body.js +2 -0
  41. package/dist/cjs/resources/simulations/operations/index.js +19 -0
  42. package/dist/cjs/resources/simulations/operations/list-simulation-query-parameters.js +2 -0
  43. package/dist/cjs/resources/simulations/operations/update-simulation-request-body.js +2 -0
  44. package/dist/cjs/types/index.js +4 -0
  45. package/dist/cjs/types/shared/index.js +3 -0
  46. package/dist/cjs/types/shared/simulation-event-request.js +2 -0
  47. package/dist/cjs/types/shared/simulation-event-response.js +2 -0
  48. package/dist/cjs/types/shared/simulation-payload.js +2 -0
  49. package/dist/cjs/types/simulation/index.js +17 -0
  50. package/dist/cjs/types/simulation/simulation-response.js +2 -0
  51. package/dist/cjs/types/simulation-run/index.js +17 -0
  52. package/dist/cjs/types/simulation-run/simulation-run-response.js +2 -0
  53. package/dist/cjs/types/simulation-run-event/index.js +17 -0
  54. package/dist/cjs/types/simulation-run-event/simulation-run-event-response.js +2 -0
  55. package/dist/cjs/types/simulation-type/index.js +17 -0
  56. package/dist/cjs/types/simulation-type/simulation-type.js +2 -0
  57. package/dist/cjs/version.js +1 -1
  58. package/dist/esm/entities/index.js +4 -0
  59. package/dist/esm/entities/notification-settings/notification-settings.js +1 -0
  60. package/dist/esm/entities/shared/index.js +2 -0
  61. package/dist/esm/entities/shared/simulation-event-request.js +5 -0
  62. package/dist/esm/entities/shared/simulation-event-response.js +6 -0
  63. package/dist/esm/entities/simulation/index.js +2 -0
  64. package/dist/esm/entities/simulation/simulation-collection.js +7 -0
  65. package/dist/esm/entities/simulation/simulation.js +14 -0
  66. package/dist/esm/entities/simulation-run/index.js +2 -0
  67. package/dist/esm/entities/simulation-run/simulation-run-collection.js +7 -0
  68. package/dist/esm/entities/simulation-run/simulation-run.js +12 -0
  69. package/dist/esm/entities/simulation-run-event/index.js +2 -0
  70. package/dist/esm/entities/simulation-run-event/simulation-run-event-collection.js +7 -0
  71. package/dist/esm/entities/simulation-run-event/simulation-run-event.js +17 -0
  72. package/dist/esm/entities/simulation-types/index.js +1 -0
  73. package/dist/esm/entities/simulation-types/simulation-type.js +10 -0
  74. package/dist/esm/enums/index.js +4 -0
  75. package/dist/esm/enums/notification-settings/index.js +1 -0
  76. package/dist/esm/enums/notification-settings/traffic-source.js +1 -0
  77. package/dist/esm/enums/simulation/index.js +1 -0
  78. package/dist/esm/enums/simulation/simulation-scenario-type.js +1 -0
  79. package/dist/esm/enums/simulation-run/index.js +1 -0
  80. package/dist/esm/enums/simulation-run/simulation-run-status.js +1 -0
  81. package/dist/esm/enums/simulation-run-event/index.js +1 -0
  82. package/dist/esm/enums/simulation-run-event/simulation-run-event-status.js +1 -0
  83. package/dist/esm/enums/simulation-type/index.js +1 -0
  84. package/dist/esm/enums/simulation-type/simulation-kind.js +1 -0
  85. package/dist/esm/paddle.js +5 -1
  86. package/dist/esm/resources/index.js +4 -0
  87. package/dist/esm/resources/simulation-run-events/index.js +51 -0
  88. package/dist/esm/resources/simulation-run-events/operations/index.js +1 -0
  89. package/dist/esm/resources/simulation-run-events/operations/list-simulation-run-events-query-parameters.js +1 -0
  90. package/dist/esm/resources/simulation-runs/index.js +48 -0
  91. package/dist/esm/resources/simulation-runs/operations/get-simulation-run-query-parameters.js +1 -0
  92. package/dist/esm/resources/simulation-runs/operations/index.js +2 -0
  93. package/dist/esm/resources/simulation-runs/operations/list-simulation-run-query-parameters.js +1 -0
  94. package/dist/esm/resources/simulation-types/index.js +23 -0
  95. package/dist/esm/resources/simulations/index.js +51 -0
  96. package/dist/esm/resources/simulations/operations/create-simulation-request-body.js +1 -0
  97. package/dist/esm/resources/simulations/operations/index.js +3 -0
  98. package/dist/esm/resources/simulations/operations/list-simulation-query-parameters.js +1 -0
  99. package/dist/esm/resources/simulations/operations/update-simulation-request-body.js +1 -0
  100. package/dist/esm/types/index.js +4 -0
  101. package/dist/esm/types/shared/index.js +3 -0
  102. package/dist/esm/types/shared/simulation-event-request.js +1 -0
  103. package/dist/esm/types/shared/simulation-event-response.js +1 -0
  104. package/dist/esm/types/shared/simulation-payload.js +1 -0
  105. package/dist/esm/types/simulation/index.js +1 -0
  106. package/dist/esm/types/simulation/simulation-response.js +1 -0
  107. package/dist/esm/types/simulation-run/index.js +1 -0
  108. package/dist/esm/types/simulation-run/simulation-run-response.js +1 -0
  109. package/dist/esm/types/simulation-run-event/index.js +1 -0
  110. package/dist/esm/types/simulation-run-event/simulation-run-event-response.js +1 -0
  111. package/dist/esm/types/simulation-type/index.js +1 -0
  112. package/dist/esm/types/simulation-type/simulation-type.js +1 -0
  113. package/dist/esm/version.js +1 -1
  114. package/dist/types/entities/index.d.ts +4 -0
  115. package/dist/types/entities/notification-settings/notification-settings.d.ts +2 -1
  116. package/dist/types/entities/shared/index.d.ts +2 -0
  117. package/dist/types/entities/shared/simulation-event-request.d.ts +5 -0
  118. package/dist/types/entities/shared/simulation-event-response.d.ts +6 -0
  119. package/dist/types/entities/simulation/index.d.ts +2 -0
  120. package/dist/types/entities/simulation/simulation-collection.d.ts +6 -0
  121. package/dist/types/entities/simulation/simulation.d.ts +15 -0
  122. package/dist/types/entities/simulation-run/index.d.ts +2 -0
  123. package/dist/types/entities/simulation-run/simulation-run-collection.d.ts +6 -0
  124. package/dist/types/entities/simulation-run/simulation-run.d.ts +13 -0
  125. package/dist/types/entities/simulation-run-event/index.d.ts +2 -0
  126. package/dist/types/entities/simulation-run-event/simulation-run-event-collection.d.ts +6 -0
  127. package/dist/types/entities/simulation-run-event/simulation-run-event.d.ts +15 -0
  128. package/dist/types/entities/simulation-types/index.d.ts +1 -0
  129. package/dist/types/entities/simulation-types/simulation-type.d.ts +12 -0
  130. package/dist/types/enums/index.d.ts +4 -0
  131. package/dist/types/enums/notification-settings/index.d.ts +1 -0
  132. package/dist/types/enums/notification-settings/traffic-source.d.ts +1 -0
  133. package/dist/types/enums/simulation/index.d.ts +1 -0
  134. package/dist/types/enums/simulation/simulation-scenario-type.d.ts +1 -0
  135. package/dist/types/enums/simulation-run/index.d.ts +1 -0
  136. package/dist/types/enums/simulation-run/simulation-run-status.d.ts +1 -0
  137. package/dist/types/enums/simulation-run-event/index.d.ts +1 -0
  138. package/dist/types/enums/simulation-run-event/simulation-run-event-status.d.ts +1 -0
  139. package/dist/types/enums/simulation-type/index.d.ts +1 -0
  140. package/dist/types/enums/simulation-type/simulation-kind.d.ts +1 -0
  141. package/dist/types/notifications/helpers/types.d.ts +1 -1
  142. package/dist/types/paddle.d.ts +5 -1
  143. package/dist/types/resources/index.d.ts +4 -0
  144. package/dist/types/resources/notification-settings/operations/create-notification-settings-request-body.d.ts +2 -1
  145. package/dist/types/resources/notification-settings/operations/list-notification-settings-query-parameters.d.ts +2 -0
  146. package/dist/types/resources/notification-settings/operations/update-notification-settings-request-body.d.ts +2 -0
  147. package/dist/types/resources/simulation-run-events/index.d.ts +9 -0
  148. package/dist/types/resources/simulation-run-events/operations/index.d.ts +1 -0
  149. package/dist/types/resources/simulation-run-events/operations/list-simulation-run-events-query-parameters.d.ts +6 -0
  150. package/dist/types/resources/simulation-runs/index.d.ts +9 -0
  151. package/dist/types/resources/simulation-runs/operations/get-simulation-run-query-parameters.d.ts +3 -0
  152. package/dist/types/resources/simulation-runs/operations/index.d.ts +2 -0
  153. package/dist/types/resources/simulation-runs/operations/list-simulation-run-query-parameters.d.ts +7 -0
  154. package/dist/types/resources/simulation-types/index.d.ts +5 -0
  155. package/dist/types/resources/simulations/index.d.ts +10 -0
  156. package/dist/types/resources/simulations/operations/create-simulation-request-body.d.ts +10 -0
  157. package/dist/types/resources/simulations/operations/index.d.ts +3 -0
  158. package/dist/types/resources/simulations/operations/list-simulation-query-parameters.d.ts +9 -0
  159. package/dist/types/resources/simulations/operations/update-simulation-request-body.d.ts +12 -0
  160. package/dist/types/types/index.d.ts +4 -0
  161. package/dist/types/types/notification-settings/notification-settings-response.d.ts +2 -1
  162. package/dist/types/types/shared/index.d.ts +3 -0
  163. package/dist/types/types/shared/simulation-event-request.d.ts +3 -0
  164. package/dist/types/types/shared/simulation-event-response.d.ts +4 -0
  165. package/dist/types/types/shared/simulation-payload.d.ts +58 -0
  166. package/dist/types/types/simulation/index.d.ts +1 -0
  167. package/dist/types/types/simulation/simulation-response.d.ts +13 -0
  168. package/dist/types/types/simulation-run/index.d.ts +1 -0
  169. package/dist/types/types/simulation-run/simulation-run-response.d.ts +11 -0
  170. package/dist/types/types/simulation-run-event/index.d.ts +1 -0
  171. package/dist/types/types/simulation-run-event/simulation-run-event-response.d.ts +13 -0
  172. package/dist/types/types/simulation-type/index.d.ts +1 -0
  173. package/dist/types/types/simulation-type/simulation-type.d.ts +10 -0
  174. package/dist/types/version.d.ts +1 -1
  175. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -12,6 +12,21 @@ When we make [non-breaking changes](https://developer.paddle.com/api-reference/a
12
12
 
13
13
  This means when upgrading minor versions of the SDK, you may notice type errors. You can safely ignore these or fix by adding additional type guards.
14
14
 
15
+ ## 1.9.0 - 2024-10-15
16
+
17
+ ### Added
18
+
19
+ - Added the `trafficSource` filter on notification settings
20
+
21
+ ## 1.8.0 - 2024-10-08
22
+
23
+ ### Added
24
+
25
+ - Added `simulationTypes` resources
26
+ - Added `simulations` resources
27
+ - Added `simulationRuns` resources
28
+ - Added `simulationRunEvents` resources
29
+
15
30
  ## 1.7.0 - 2024-09-18
16
31
 
17
32
  ### Fixed
@@ -23,7 +38,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
23
38
  ## 1.6.0 - 2024-09-16
24
39
 
25
40
  ### Added
26
-
41
+
27
42
  - Added `adjustments.getCreditNotePDF()` to [get a credit note for an adjustment](https://developer.paddle.com/api-reference/adjustments/get-credit-note-pdf?utm_source=dx&utm_medium=paddle-node-sdk)
28
43
  - Added `disposition` query parameter to `adjustments.getCreditNotePDF()` and `transactions.getInvoicePDF()` operations, see [related changelog](https://developer.paddle.com/changelog/2024/invoice-pdf-open-in-browser?utm_source=dx&utm_medium=paddle-node-sdk).
29
44
  - Added pagination support to `notificationSettings.list()` operation, see [related changelog](https://developer.paddle.com/changelog/2024/notification-settings-pagination?utm_source=dx&utm_medium=paddle-node-sdk).
@@ -153,7 +168,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
153
168
  ### Removed
154
169
 
155
170
  - **Breaking change:** Removed `*Includes` entity in favour of standard entities.
156
-
171
+
157
172
  - Use `Price` instead of `PriceWithIncludes`
158
173
  - Use `Product` instead of `ProductWithIncludes`
159
174
  - Use `Subscription` instead of `SubscriptionIncludes`
@@ -213,7 +228,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
213
228
 
214
229
  ### Fixed
215
230
 
216
- - Marked `unitPriceOverrides` as optional in Price entity.
231
+ - Marked `unitPriceOverrides` as optional in Price entity.
217
232
 
218
233
  ---
219
234
 
@@ -273,7 +288,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
273
288
  - 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)
274
289
  - 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)
275
290
  - 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)
276
- - Added `notifications.list()` to [list all notifications](https://developer.paddle.com/api-reference/notifications/list-notifications?utm_source=dx&utm_medium=paddle-node-sdk)
291
+ - Added `notifications.list()` to [list all notifications](https://developer.paddle.com/api-reference/notifications/list-notifications?utm_source=dx&utm_medium=paddle-node-sdk)
277
292
  - Added `notifications.get()` to [get a notification](https://developer.paddle.com/api-reference/notifications/get-notification?utm_source=dx&utm_medium=paddle-node-sdk)
278
293
  - Added `notifications.replay()` to [replay a notification](https://developer.paddle.com/api-reference/notifications/replay-notification?utm_source=dx&utm_medium=paddle-node-sdk)
279
294
  - 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)
@@ -298,7 +313,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
298
313
  ### Added
299
314
 
300
315
  - Added helper function to archive supported entities
301
- - Added `pricingPreview.preview()` to [preview calculations for one or more prices](https://developer.paddle.com/api-reference/pricing-preview/preview-prices?utm_source=dx&utm_medium=paddle-node-sdk)
316
+ - Added `pricingPreview.preview()` to [preview calculations for one or more prices](https://developer.paddle.com/api-reference/pricing-preview/preview-prices?utm_source=dx&utm_medium=paddle-node-sdk)
302
317
 
303
318
  ### Changed
304
319
 
@@ -346,7 +361,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
346
361
 
347
362
  - Added changelog.
348
363
 
349
- ---
364
+ ---
350
365
 
351
366
  ## 0.1.6 - 2023-11-22
352
367
 
@@ -354,7 +369,7 @@ This means when upgrading minor versions of the SDK, you may notice type errors.
354
369
 
355
370
  - Fixed optional management URL object in subscription entities.
356
371
 
357
- ---
372
+ ---
358
373
 
359
374
  ## 0.1.5 - 2023-11-14
360
375
 
@@ -30,3 +30,7 @@ __exportStar(require("./event-types"), exports);
30
30
  __exportStar(require("./notification-settings"), exports);
31
31
  __exportStar(require("./notifications"), exports);
32
32
  __exportStar(require("./report"), exports);
33
+ __exportStar(require("./simulation-types"), exports);
34
+ __exportStar(require("./simulation"), exports);
35
+ __exportStar(require("./simulation-run"), exports);
36
+ __exportStar(require("./simulation-run-event"), exports);
@@ -11,6 +11,7 @@ class NotificationSettings {
11
11
  this.active = notificationSettings.active;
12
12
  this.apiVersion = notificationSettings.api_version;
13
13
  this.includeSensitiveFields = notificationSettings.include_sensitive_fields;
14
+ this.trafficSource = notificationSettings.traffic_source;
14
15
  this.subscribedEvents = notificationSettings.subscribed_events.map((subscribed_event) => new event_types_1.EventType(subscribed_event));
15
16
  this.endpointSecretKey = notificationSettings.endpoint_secret_key;
16
17
  }
@@ -34,3 +34,5 @@ __exportStar(require("./transaction-checkout"), exports);
34
34
  __exportStar(require("./total-adjustments"), exports);
35
35
  __exportStar(require("./payout-totals-adjustment"), exports);
36
36
  __exportStar(require("./import-meta"), exports);
37
+ __exportStar(require("./simulation-event-request"), exports);
38
+ __exportStar(require("./simulation-event-response"), exports);
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimulationEventRequest = void 0;
4
+ class SimulationEventRequest {
5
+ constructor(simulationEventRequestResponse) {
6
+ this.body = simulationEventRequestResponse.body;
7
+ }
8
+ }
9
+ exports.SimulationEventRequest = SimulationEventRequest;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimulationEventResponse = void 0;
4
+ class SimulationEventResponse {
5
+ constructor(simulationEventResponse) {
6
+ this.body = simulationEventResponse.body;
7
+ this.statusCode = simulationEventResponse.status_code;
8
+ }
9
+ }
10
+ exports.SimulationEventResponse = SimulationEventResponse;
@@ -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("./simulation"), exports);
18
+ __exportStar(require("./simulation-collection"), exports);
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimulationCollection = void 0;
4
+ const entities_1 = require("../../entities");
5
+ const base_1 = require("../../internal/base");
6
+ class SimulationCollection extends base_1.Collection {
7
+ fromJson(data) {
8
+ return new entities_1.Simulation(data);
9
+ }
10
+ }
11
+ exports.SimulationCollection = SimulationCollection;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Simulation = void 0;
4
+ class Simulation {
5
+ constructor(simulationResponse) {
6
+ var _a, _b;
7
+ this.id = simulationResponse.id;
8
+ this.status = simulationResponse.status;
9
+ this.notificationSettingId = simulationResponse.notification_setting_id;
10
+ this.name = simulationResponse.name;
11
+ this.type = simulationResponse.type;
12
+ this.payload = (_a = simulationResponse.payload) !== null && _a !== void 0 ? _a : null;
13
+ this.lastRunAt = (_b = simulationResponse.last_run_at) !== null && _b !== void 0 ? _b : null;
14
+ this.createdAt = simulationResponse.created_at;
15
+ this.updatedAt = simulationResponse.updated_at;
16
+ }
17
+ }
18
+ exports.Simulation = Simulation;
@@ -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("./simulation-run"), exports);
18
+ __exportStar(require("./simulation-run-collection"), exports);
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimulationRunCollection = void 0;
4
+ const entities_1 = require("../../entities");
5
+ const base_1 = require("../../internal/base");
6
+ class SimulationRunCollection extends base_1.Collection {
7
+ fromJson(data) {
8
+ return new entities_1.SimulationRun(data);
9
+ }
10
+ }
11
+ exports.SimulationRunCollection = SimulationRunCollection;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimulationRun = void 0;
4
+ const __1 = require("..");
5
+ class SimulationRun {
6
+ constructor(simulationRunResponse) {
7
+ var _a, _b;
8
+ this.id = simulationRunResponse.id;
9
+ this.status = simulationRunResponse.status;
10
+ this.createdAt = simulationRunResponse.created_at;
11
+ this.updatedAt = simulationRunResponse.updated_at;
12
+ this.type = simulationRunResponse.type;
13
+ this.events = (_b = (_a = simulationRunResponse.events) === null || _a === void 0 ? void 0 : _a.map((event) => new __1.SimulationRunEvent(event))) !== null && _b !== void 0 ? _b : [];
14
+ }
15
+ }
16
+ exports.SimulationRun = SimulationRun;
@@ -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("./simulation-run-event"), exports);
18
+ __exportStar(require("./simulation-run-event-collection"), exports);
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimulationRunEventCollection = void 0;
4
+ const entities_1 = require("../../entities");
5
+ const base_1 = require("../../internal/base");
6
+ class SimulationRunEventCollection extends base_1.Collection {
7
+ fromJson(data) {
8
+ return new entities_1.SimulationRunEvent(data);
9
+ }
10
+ }
11
+ exports.SimulationRunEventCollection = SimulationRunEventCollection;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimulationRunEvent = void 0;
4
+ const shared_1 = require("../shared");
5
+ class SimulationRunEvent {
6
+ constructor(simulationRunEventResponse) {
7
+ this.id = simulationRunEventResponse.id;
8
+ this.status = simulationRunEventResponse.status;
9
+ this.eventType = simulationRunEventResponse.event_type;
10
+ this.payload = simulationRunEventResponse.payload;
11
+ this.request = simulationRunEventResponse.request
12
+ ? new shared_1.SimulationEventRequest(simulationRunEventResponse.request)
13
+ : null;
14
+ this.response = simulationRunEventResponse.response
15
+ ? new shared_1.SimulationEventResponse(simulationRunEventResponse.response)
16
+ : null;
17
+ this.createdAt = simulationRunEventResponse.created_at;
18
+ this.updatedAt = simulationRunEventResponse.updated_at;
19
+ }
20
+ }
21
+ exports.SimulationRunEvent = SimulationRunEvent;
@@ -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("./simulation-type"), exports);
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimulationType = void 0;
4
+ class SimulationType {
5
+ constructor(simulationTypeResponse) {
6
+ this.name = simulationTypeResponse.name;
7
+ this.label = simulationTypeResponse.label;
8
+ this.description = simulationTypeResponse.description;
9
+ this.group = simulationTypeResponse.group;
10
+ this.type = simulationTypeResponse.type;
11
+ this.events = simulationTypeResponse.events;
12
+ }
13
+ }
14
+ exports.SimulationType = SimulationType;
@@ -23,3 +23,7 @@ __exportStar(require("./payout"), exports);
23
23
  __exportStar(require("./notification-settings"), exports);
24
24
  __exportStar(require("./notification"), exports);
25
25
  __exportStar(require("./report"), exports);
26
+ __exportStar(require("./simulation-type"), exports);
27
+ __exportStar(require("./simulation"), exports);
28
+ __exportStar(require("./simulation-run"), exports);
29
+ __exportStar(require("./simulation-run-event"), exports);
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./notification-settings-type"), exports);
18
+ __exportStar(require("./traffic-source"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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("./simulation-scenario-type"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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("./simulation-run-status"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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("./simulation-run-event-status"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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("./simulation-kind"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -29,6 +29,10 @@ class Paddle {
29
29
  this.notificationSettings = new resources_1.NotificationSettingsResource(this.client);
30
30
  this.notifications = new resources_1.NotificationsResource(this.client);
31
31
  this.reports = new resources_1.ReportsResource(this.client);
32
+ this.simulationTypes = new resources_1.SimulationTypesResource(this.client);
33
+ this.simulations = new resources_1.SimulationsResource(this.client);
34
+ this.simulationRuns = new resources_1.SimulationRunsResource(this.client);
35
+ this.simulationRunEvents = new resources_1.SimulationRunEventsResource(this.client);
32
36
  }
33
37
  }
34
38
  exports.Paddle = Paddle;
@@ -28,3 +28,7 @@ __exportStar(require("./event-types"), exports);
28
28
  __exportStar(require("./notification-settings"), exports);
29
29
  __exportStar(require("./notifications"), exports);
30
30
  __exportStar(require("./reports"), exports);
31
+ __exportStar(require("./simulation-types"), exports);
32
+ __exportStar(require("./simulations"), exports);
33
+ __exportStar(require("./simulation-runs"), exports);
34
+ __exportStar(require("./simulation-run-events"), exports);
@@ -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.SimulationRunEventsResource = void 0;
27
+ const entities_1 = require("../../entities");
28
+ const base_1 = require("../../internal/base");
29
+ __exportStar(require("./operations"), exports);
30
+ const SimulationRunEventPaths = {
31
+ list: '/simulations/{simulation_id}/runs/{simulation_run_id}/events',
32
+ get: '/simulations/{simulation_id}/runs/{simulation_run_id}/events/{simulation_event_id}',
33
+ replay: '/simulations/{simulation_id}/runs/{simulation_run_id}/events/{simulation_event_id}/replay',
34
+ };
35
+ class SimulationRunEventsResource extends base_1.BaseResource {
36
+ list(simulationId, simulationRunId, queryParams) {
37
+ const queryParameters = new base_1.QueryParameters(queryParams);
38
+ const urlWithPathParams = new base_1.PathParameters(SimulationRunEventPaths.list, {
39
+ simulation_id: simulationId,
40
+ simulation_run_id: simulationRunId,
41
+ }).deriveUrl();
42
+ return new entities_1.SimulationRunEventCollection(this.client, urlWithPathParams + queryParameters.toQueryString());
43
+ }
44
+ get(simulationId, simulationRunId, simulationEventId) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ const urlWithPathParams = new base_1.PathParameters(SimulationRunEventPaths.get, {
47
+ simulation_id: simulationId,
48
+ simulation_run_id: simulationRunId,
49
+ simulation_event_id: simulationEventId,
50
+ }).deriveUrl();
51
+ const response = yield this.client.get(urlWithPathParams);
52
+ const data = this.handleResponse(response);
53
+ return new entities_1.SimulationRunEvent(data);
54
+ });
55
+ }
56
+ replay(simulationId, simulationRunId, simulationEventId) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ const urlWithPathParams = new base_1.PathParameters(SimulationRunEventPaths.replay, {
59
+ simulation_id: simulationId,
60
+ simulation_run_id: simulationRunId,
61
+ simulation_event_id: simulationEventId,
62
+ }).deriveUrl();
63
+ const response = yield this.client.post(urlWithPathParams, undefined);
64
+ const data = this.handleResponse(response);
65
+ return new entities_1.SimulationRunEvent(data);
66
+ });
67
+ }
68
+ }
69
+ exports.SimulationRunEventsResource = SimulationRunEventsResource;
@@ -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("./list-simulation-run-events-query-parameters"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,66 @@
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.SimulationRunsResource = void 0;
27
+ const entities_1 = require("../../entities");
28
+ const base_1 = require("../../internal/base");
29
+ __exportStar(require("./operations"), exports);
30
+ const SimulationRunPaths = {
31
+ list: '/simulations/{simulation_id}/runs',
32
+ create: '/simulations/{simulation_id}/runs',
33
+ get: '/simulations/{simulation_id}/runs/{simulation_run_id}',
34
+ };
35
+ class SimulationRunsResource extends base_1.BaseResource {
36
+ list(simulationId, queryParams) {
37
+ const queryParameters = new base_1.QueryParameters(queryParams);
38
+ const urlWithPathParams = new base_1.PathParameters(SimulationRunPaths.list, {
39
+ simulation_id: simulationId,
40
+ }).deriveUrl();
41
+ return new entities_1.SimulationRunCollection(this.client, urlWithPathParams + queryParameters.toQueryString());
42
+ }
43
+ create(simulationId) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ const urlWithPathParams = new base_1.PathParameters(SimulationRunPaths.create, {
46
+ simulation_id: simulationId,
47
+ }).deriveUrl();
48
+ const response = yield this.client.post(urlWithPathParams, undefined);
49
+ const data = this.handleResponse(response);
50
+ return new entities_1.SimulationRun(data);
51
+ });
52
+ }
53
+ get(simulationId, simulationRunId, queryParams) {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ const queryParameters = new base_1.QueryParameters(queryParams);
56
+ const urlWithPathParams = new base_1.PathParameters(SimulationRunPaths.get, {
57
+ simulation_id: simulationId,
58
+ simulation_run_id: simulationRunId,
59
+ }).deriveUrl();
60
+ const response = yield this.client.get(urlWithPathParams, queryParameters);
61
+ const data = this.handleResponse(response);
62
+ return new entities_1.SimulationRun(data);
63
+ });
64
+ }
65
+ }
66
+ exports.SimulationRunsResource = SimulationRunsResource;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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("./get-simulation-run-query-parameters"), exports);
18
+ __exportStar(require("./list-simulation-run-query-parameters"), exports);