@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
@@ -0,0 +1,51 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { Simulation, SimulationCollection } from '../../entities';
11
+ import { BaseResource, PathParameters, QueryParameters } from '../../internal/base';
12
+ export * from './operations';
13
+ const SimulationPaths = {
14
+ list: '/simulations',
15
+ create: '/simulations',
16
+ get: '/simulations/{simulation_id}',
17
+ update: '/simulations/{simulation_id}',
18
+ };
19
+ export class SimulationsResource extends BaseResource {
20
+ list(queryParams) {
21
+ const queryParameters = new QueryParameters(queryParams);
22
+ return new SimulationCollection(this.client, SimulationPaths.list + queryParameters.toQueryString());
23
+ }
24
+ create(createSimulationParameters) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ const response = yield this.client.post(SimulationPaths.create, createSimulationParameters);
27
+ const data = this.handleResponse(response);
28
+ return new Simulation(data);
29
+ });
30
+ }
31
+ get(simulationId) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ const urlWithPathParams = new PathParameters(SimulationPaths.get, {
34
+ simulation_id: simulationId,
35
+ }).deriveUrl();
36
+ const response = yield this.client.get(urlWithPathParams);
37
+ const data = this.handleResponse(response);
38
+ return new Simulation(data);
39
+ });
40
+ }
41
+ update(simulationId, updateSimulation) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ const urlWithPathParams = new PathParameters(SimulationPaths.update, {
44
+ simulation_id: simulationId,
45
+ }).deriveUrl();
46
+ const response = yield this.client.patch(urlWithPathParams, updateSimulation);
47
+ const data = this.handleResponse(response);
48
+ return new Simulation(data);
49
+ });
50
+ }
51
+ }
@@ -0,0 +1,3 @@
1
+ export * from './create-simulation-request-body';
2
+ export * from './list-simulation-query-parameters';
3
+ export * from './update-simulation-request-body';
@@ -15,3 +15,7 @@ export * from './event-types';
15
15
  export * from './notification-settings';
16
16
  export * from './notifications';
17
17
  export * from './report';
18
+ export * from './simulation-type';
19
+ export * from './simulation';
20
+ export * from './simulation-run';
21
+ export * from './simulation-run-event';
@@ -27,3 +27,6 @@ export * from './billing-details-create';
27
27
  export * from './billing-details-update';
28
28
  export * from './custom-data';
29
29
  export * from './import-meta-response';
30
+ export * from './simulation-event-request';
31
+ export * from './simulation-event-response';
32
+ export * from './simulation-payload';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './simulation-response';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './simulation-run-response';
@@ -0,0 +1 @@
1
+ export * from './simulation-run-event-response';
@@ -0,0 +1 @@
1
+ export * from './simulation-type';
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1 @@
1
- export const SDK_VERSION = '1.7.0';
1
+ export const SDK_VERSION = '1.9.0';
@@ -14,4 +14,8 @@ export * from './event-types';
14
14
  export * from './notification-settings';
15
15
  export * from './notifications';
16
16
  export * from './report';
17
+ export * from './simulation-types';
18
+ export * from './simulation';
19
+ export * from './simulation-run';
20
+ export * from './simulation-run-event';
17
21
  export type CustomData = object;
@@ -1,4 +1,4 @@
1
- import { type NotificationSettingsType } from '../../enums';
1
+ import { type TrafficSource, type NotificationSettingsType } from '../../enums';
2
2
  import { EventType } from '../event-types';
3
3
  import { type INotificationSettingsResponse } from '../../types/notification-settings';
4
4
  export declare class NotificationSettings {
@@ -9,6 +9,7 @@ export declare class NotificationSettings {
9
9
  readonly active: boolean;
10
10
  readonly apiVersion: number;
11
11
  readonly includeSensitiveFields: boolean;
12
+ readonly trafficSource: TrafficSource;
12
13
  readonly subscribedEvents: EventType[];
13
14
  readonly endpointSecretKey: string;
14
15
  constructor(notificationSettings: INotificationSettingsResponse);
@@ -18,3 +18,5 @@ export * from './transaction-checkout';
18
18
  export * from './total-adjustments';
19
19
  export * from './payout-totals-adjustment';
20
20
  export * from './import-meta';
21
+ export * from './simulation-event-request';
22
+ export * from './simulation-event-response';
@@ -0,0 +1,5 @@
1
+ import { type ISimulationEventRequest } from '../../types';
2
+ export declare class SimulationEventRequest {
3
+ readonly body: string;
4
+ constructor(simulationEventRequestResponse: ISimulationEventRequest);
5
+ }
@@ -0,0 +1,6 @@
1
+ import { type ISimulationEventResponse } from '../../types';
2
+ export declare class SimulationEventResponse {
3
+ readonly body: string;
4
+ readonly statusCode: number;
5
+ constructor(simulationEventResponse: ISimulationEventResponse);
6
+ }
@@ -0,0 +1,2 @@
1
+ export * from './simulation';
2
+ export * from './simulation-collection';
@@ -0,0 +1,6 @@
1
+ import { Simulation } from '../../entities';
2
+ import { type ISimulationResponse } from '../../types';
3
+ import { Collection } from '../../internal/base';
4
+ export declare class SimulationCollection extends Collection<ISimulationResponse, Simulation> {
5
+ fromJson(data: ISimulationResponse): Simulation;
6
+ }
@@ -0,0 +1,15 @@
1
+ import { type ISimulationResponse } from '../../types';
2
+ import type { SimulationScenarioType, Status } from '../../enums';
3
+ import type { IEventName } from '../../notifications';
4
+ export declare class Simulation {
5
+ readonly id: string;
6
+ readonly status: Status;
7
+ readonly notificationSettingId: string;
8
+ readonly name: string;
9
+ readonly type: IEventName | SimulationScenarioType;
10
+ readonly payload: any;
11
+ readonly lastRunAt: string | null;
12
+ readonly createdAt: string;
13
+ readonly updatedAt: string;
14
+ constructor(simulationResponse: ISimulationResponse);
15
+ }
@@ -0,0 +1,2 @@
1
+ export * from './simulation-run';
2
+ export * from './simulation-run-collection';
@@ -0,0 +1,6 @@
1
+ import { SimulationRun } from '../../entities';
2
+ import { type ISimulationRunResponse } from '../../types';
3
+ import { Collection } from '../../internal/base';
4
+ export declare class SimulationRunCollection extends Collection<ISimulationRunResponse, SimulationRun> {
5
+ fromJson(data: ISimulationRunResponse): SimulationRun;
6
+ }
@@ -0,0 +1,13 @@
1
+ import type { SimulationRunStatus, SimulationScenarioType } from '../../enums';
2
+ import type { IEventName } from '../../notifications';
3
+ import type { ISimulationRunResponse } from '../../types';
4
+ import { SimulationRunEvent } from '..';
5
+ export declare class SimulationRun {
6
+ readonly id: string;
7
+ readonly status: SimulationRunStatus;
8
+ readonly createdAt: string;
9
+ readonly updatedAt: string;
10
+ readonly type: IEventName | SimulationScenarioType;
11
+ readonly events: SimulationRunEvent[] | null;
12
+ constructor(simulationRunResponse: ISimulationRunResponse);
13
+ }
@@ -0,0 +1,2 @@
1
+ export * from './simulation-run-event';
2
+ export * from './simulation-run-event-collection';
@@ -0,0 +1,6 @@
1
+ import { SimulationRunEvent } from '../../entities';
2
+ import { type ISimulationRunEventResponse } from '../../types';
3
+ import { Collection } from '../../internal/base';
4
+ export declare class SimulationRunEventCollection extends Collection<ISimulationRunEventResponse, SimulationRunEvent> {
5
+ fromJson(data: ISimulationRunEventResponse): SimulationRunEvent;
6
+ }
@@ -0,0 +1,15 @@
1
+ import type { SimulationRunEventStatus, SimulationScenarioType } from '../../enums';
2
+ import type { IEventName } from '../../notifications';
3
+ import type { ISimulationRunEventResponse } from '../../types';
4
+ import { SimulationEventRequest, SimulationEventResponse } from '../shared';
5
+ export declare class SimulationRunEvent {
6
+ readonly id: string;
7
+ readonly status: SimulationRunEventStatus;
8
+ readonly eventType: IEventName | SimulationScenarioType;
9
+ readonly payload: any;
10
+ readonly request: SimulationEventRequest | null;
11
+ readonly response: SimulationEventResponse | null;
12
+ readonly createdAt: string;
13
+ readonly updatedAt: string;
14
+ constructor(simulationRunEventResponse: ISimulationRunEventResponse);
15
+ }
@@ -0,0 +1 @@
1
+ export * from './simulation-type';
@@ -0,0 +1,12 @@
1
+ import { type SimulationKind } from '../../enums';
2
+ import { type IEventName } from '../../notifications';
3
+ import { type ISimulationTypeResponse } from '../../types';
4
+ export declare class SimulationType {
5
+ readonly name: string;
6
+ readonly label: string;
7
+ readonly description: string;
8
+ readonly group: string;
9
+ readonly type: SimulationKind;
10
+ readonly events: IEventName[];
11
+ constructor(simulationTypeResponse: ISimulationTypeResponse);
12
+ }
@@ -7,3 +7,7 @@ export * from './payout';
7
7
  export * from './notification-settings';
8
8
  export * from './notification';
9
9
  export * from './report';
10
+ export * from './simulation-type';
11
+ export * from './simulation';
12
+ export * from './simulation-run';
13
+ export * from './simulation-run-event';
@@ -1 +1,2 @@
1
1
  export * from './notification-settings-type';
2
+ export * from './traffic-source';
@@ -0,0 +1 @@
1
+ export type TrafficSource = 'platform' | 'simulation' | 'all';
@@ -0,0 +1 @@
1
+ export * from './simulation-scenario-type';
@@ -0,0 +1 @@
1
+ export type SimulationScenarioType = 'subscription_creation' | 'subscription_renewal' | 'subscription_pause' | 'subscription_resume' | 'subscription_cancellation';
@@ -0,0 +1 @@
1
+ export * from './simulation-run-status';
@@ -0,0 +1 @@
1
+ export type SimulationRunStatus = 'pending' | 'completed' | 'canceled';
@@ -0,0 +1 @@
1
+ export * from './simulation-run-event-status';
@@ -0,0 +1 @@
1
+ export type SimulationRunEventStatus = 'pending' | 'success' | 'failed' | 'aborted';
@@ -0,0 +1 @@
1
+ export * from './simulation-kind';
@@ -0,0 +1 @@
1
+ export type SimulationKind = 'single_event' | 'scenario';
@@ -44,4 +44,4 @@ export declare enum EventName {
44
44
  ReportCreated = "report.created",
45
45
  ReportUpdated = "report.updated"
46
46
  }
47
- export type IEventName = 'address.created' | 'address.updated' | 'address.imported' | 'adjustment.created' | 'adjustment.updated' | 'business.created' | 'business.updated' | 'business.imported' | 'customer.created' | 'customer.updated' | 'discount.created' | 'discount.updated' | 'discount.imported' | 'payout.updated' | 'payout.paid' | 'price.updated' | 'price.created' | 'price.imported' | 'product.updated' | 'product.created' | 'product.imported' | 'subscription.activated' | 'subscription.canceled' | 'subscription.imported' | 'subscription.created' | 'subscription.past_due' | 'subscription.paused' | 'subscription.resumed' | 'subscription.trialing' | 'subscription.updated' | 'transaction.billed' | 'transaction.canceled' | 'transaction.completed' | 'transaction.paid' | 'transaction.created' | 'transaction.past_due' | 'transaction.payment_failed' | 'transaction.ready' | 'transaction.updated' | 'report.created' | 'report.updated';
47
+ export type IEventName = 'address.created' | 'address.updated' | 'address.imported' | 'adjustment.created' | 'adjustment.updated' | 'business.created' | 'business.updated' | 'business.imported' | 'customer.created' | 'customer.imported' | 'customer.updated' | 'discount.created' | 'discount.updated' | 'discount.imported' | 'payout.created' | 'payout.updated' | 'payout.paid' | 'price.updated' | 'price.created' | 'price.imported' | 'product.updated' | 'product.created' | 'product.imported' | 'subscription.activated' | 'subscription.canceled' | 'subscription.imported' | 'subscription.created' | 'subscription.past_due' | 'subscription.paused' | 'subscription.resumed' | 'subscription.trialing' | 'subscription.updated' | 'transaction.billed' | 'transaction.canceled' | 'transaction.completed' | 'transaction.paid' | 'transaction.created' | 'transaction.past_due' | 'transaction.payment_failed' | 'transaction.ready' | 'transaction.updated' | 'report.created' | 'report.updated';
@@ -1,4 +1,4 @@
1
- import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomersResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PricesResource, PricingPreviewResource, ProductsResource, ReportsResource, SubscriptionsResource, TransactionsResource } from './resources';
1
+ import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomersResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PricesResource, PricingPreviewResource, ProductsResource, ReportsResource, SimulationTypesResource, SimulationsResource, SimulationRunsResource, SimulationRunEventsResource, SubscriptionsResource, TransactionsResource } from './resources';
2
2
  import { type PaddleOptions } from './internal';
3
3
  import { EventsResource } from './resources/events';
4
4
  import { Webhooks } from './notifications';
@@ -21,5 +21,9 @@ export declare class Paddle {
21
21
  notificationSettings: NotificationSettingsResource;
22
22
  notifications: NotificationsResource;
23
23
  reports: ReportsResource;
24
+ simulationTypes: SimulationTypesResource;
25
+ simulations: SimulationsResource;
26
+ simulationRuns: SimulationRunsResource;
27
+ simulationRunEvents: SimulationRunEventsResource;
24
28
  constructor(apiKey: string, options?: PaddleOptions);
25
29
  }
@@ -12,3 +12,7 @@ export * from './event-types';
12
12
  export * from './notification-settings';
13
13
  export * from './notifications';
14
14
  export * from './reports';
15
+ export * from './simulation-types';
16
+ export * from './simulations';
17
+ export * from './simulation-runs';
18
+ export * from './simulation-run-events';
@@ -1,4 +1,4 @@
1
- import { type NotificationSettingsType } from '../../../enums';
1
+ import { type TrafficSource, type NotificationSettingsType } from '../../../enums';
2
2
  import { type IEventName } from '../../../notifications';
3
3
  export interface CreateNotificationSettingsRequestBody {
4
4
  description: string;
@@ -7,4 +7,5 @@ export interface CreateNotificationSettingsRequestBody {
7
7
  type: NotificationSettingsType;
8
8
  apiVersion?: number | null;
9
9
  includeSensitiveFields?: boolean | null;
10
+ trafficSource?: TrafficSource | null;
10
11
  }
@@ -1,6 +1,8 @@
1
+ import { type TrafficSource } from '../../../enums';
1
2
  export interface ListNotificationSettingsQueryParameters {
2
3
  after?: string;
3
4
  perPage?: number;
4
5
  orderBy?: string;
5
6
  active?: boolean;
7
+ trafficSource?: TrafficSource;
6
8
  }
@@ -1,3 +1,4 @@
1
+ import { type TrafficSource } from '../../../enums';
1
2
  import { type IEventName } from '../../../notifications';
2
3
  export interface UpdateNotificationSettingsRequestBody {
3
4
  description?: string;
@@ -6,4 +7,5 @@ export interface UpdateNotificationSettingsRequestBody {
6
7
  apiVersion?: number;
7
8
  includeSensitiveFields?: boolean;
8
9
  subscribedEvents?: IEventName[];
10
+ trafficSource?: TrafficSource;
9
11
  }
@@ -0,0 +1,9 @@
1
+ import { SimulationRunEvent, SimulationRunEventCollection } from '../../entities';
2
+ import { BaseResource } from '../../internal/base';
3
+ import type { ListSimulationRunEventsQueryParameters } from './operations';
4
+ export * from './operations';
5
+ export declare class SimulationRunEventsResource extends BaseResource {
6
+ list(simulationId: string, simulationRunId: string, queryParams?: ListSimulationRunEventsQueryParameters): SimulationRunEventCollection;
7
+ get(simulationId: string, simulationRunId: string, simulationEventId: string): Promise<SimulationRunEvent>;
8
+ replay(simulationId: string, simulationRunId: string, simulationEventId: string): Promise<SimulationRunEvent>;
9
+ }
@@ -0,0 +1 @@
1
+ export * from './list-simulation-run-events-query-parameters';
@@ -0,0 +1,6 @@
1
+ export interface ListSimulationRunEventsQueryParameters {
2
+ after?: string;
3
+ orderBy?: string;
4
+ perPage?: number;
5
+ id?: string[];
6
+ }
@@ -0,0 +1,9 @@
1
+ import { SimulationRun, SimulationRunCollection } from '../../entities';
2
+ import { BaseResource } from '../../internal/base';
3
+ import { type GetSimulationRunQueryParameters, type ListSimulationRunQueryParameters } from './operations';
4
+ export * from './operations';
5
+ export declare class SimulationRunsResource extends BaseResource {
6
+ list(simulationId: string, queryParams?: ListSimulationRunQueryParameters): SimulationRunCollection;
7
+ create(simulationId: string): Promise<SimulationRun>;
8
+ get(simulationId: string, simulationRunId: string, queryParams?: GetSimulationRunQueryParameters): Promise<SimulationRun>;
9
+ }
@@ -0,0 +1,3 @@
1
+ export interface GetSimulationRunQueryParameters {
2
+ include: any[];
3
+ }
@@ -0,0 +1,2 @@
1
+ export * from './get-simulation-run-query-parameters';
2
+ export * from './list-simulation-run-query-parameters';
@@ -0,0 +1,7 @@
1
+ export interface ListSimulationRunQueryParameters {
2
+ after?: string;
3
+ include?: any[];
4
+ orderBy?: string;
5
+ perPage?: number;
6
+ id?: string[];
7
+ }
@@ -0,0 +1,5 @@
1
+ import { BaseResource } from '../../internal/base';
2
+ import { SimulationType } from '../../entities';
3
+ export declare class SimulationTypesResource extends BaseResource {
4
+ list(): Promise<SimulationType[]>;
5
+ }
@@ -0,0 +1,10 @@
1
+ import { Simulation, SimulationCollection } from '../../entities';
2
+ import { BaseResource } from '../../internal/base';
3
+ import { type CreateSimulationRequestBody, type ListSimulationQueryParameters, type UpdateSimulationRequestBody } from './operations';
4
+ export * from './operations';
5
+ export declare class SimulationsResource extends BaseResource {
6
+ list(queryParams?: ListSimulationQueryParameters): SimulationCollection;
7
+ create(createSimulationParameters: CreateSimulationRequestBody): Promise<Simulation>;
8
+ get(simulationId: string): Promise<Simulation>;
9
+ update(simulationId: string, updateSimulation: UpdateSimulationRequestBody): Promise<Simulation>;
10
+ }
@@ -0,0 +1,10 @@
1
+ import type { SimulationScenarioType } from '../../../enums';
2
+ import type { IEventName } from '../../../notifications';
3
+ import type { DiscriminatedSimulationEventResponse } from '../../../types';
4
+ interface BaseCreateSimulationRequestBody {
5
+ notificationSettingId: string;
6
+ name: string;
7
+ type: IEventName | SimulationScenarioType;
8
+ }
9
+ export type CreateSimulationRequestBody = DiscriminatedSimulationEventResponse<BaseCreateSimulationRequestBody>;
10
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './create-simulation-request-body';
2
+ export * from './list-simulation-query-parameters';
3
+ export * from './update-simulation-request-body';
@@ -0,0 +1,9 @@
1
+ import { type Status } from '../../../enums';
2
+ export interface ListSimulationQueryParameters {
3
+ after?: string;
4
+ notificationSettingId?: string[];
5
+ orderBy?: string;
6
+ perPage?: number;
7
+ id?: string[];
8
+ status?: Status[];
9
+ }
@@ -0,0 +1,12 @@
1
+ import type { Status } from '../../../enums';
2
+ import type { DiscriminatedSimulationEventResponse } from '../../../types';
3
+ interface BaseUpdateSimulationRequestBody {
4
+ notificationSettingId?: string;
5
+ name?: string;
6
+ status?: Status;
7
+ }
8
+ type RawUpdateSimulationRequestBody = DiscriminatedSimulationEventResponse<BaseUpdateSimulationRequestBody>;
9
+ export type UpdateSimulationRequestBody = {
10
+ [Key in keyof RawUpdateSimulationRequestBody]?: RawUpdateSimulationRequestBody[Key];
11
+ };
12
+ export {};
@@ -15,3 +15,7 @@ export * from './event-types';
15
15
  export * from './notification-settings';
16
16
  export * from './notifications';
17
17
  export * from './report';
18
+ export * from './simulation-type';
19
+ export * from './simulation';
20
+ export * from './simulation-run';
21
+ export * from './simulation-run-event';
@@ -1,4 +1,4 @@
1
- import { type NotificationSettingsType } from '../../enums';
1
+ import { type TrafficSource, type NotificationSettingsType } from '../../enums';
2
2
  import { type IEventTypeResponse } from '../event-types';
3
3
  export interface INotificationSettingsResponse {
4
4
  id: string;
@@ -8,6 +8,7 @@ export interface INotificationSettingsResponse {
8
8
  active: boolean;
9
9
  api_version: number;
10
10
  include_sensitive_fields: boolean;
11
+ traffic_source: TrafficSource;
11
12
  subscribed_events: IEventTypeResponse[];
12
13
  endpoint_secret_key: string;
13
14
  }
@@ -27,3 +27,6 @@ export * from './billing-details-create';
27
27
  export * from './billing-details-update';
28
28
  export * from './custom-data';
29
29
  export * from './import-meta-response';
30
+ export * from './simulation-event-request';
31
+ export * from './simulation-event-response';
32
+ export * from './simulation-payload';
@@ -0,0 +1,3 @@
1
+ export interface ISimulationEventRequest {
2
+ body: string;
3
+ }
@@ -0,0 +1,4 @@
1
+ export interface ISimulationEventResponse {
2
+ body: string;
3
+ status_code: number;
4
+ }
@@ -0,0 +1,58 @@
1
+ import type { IEventName } from '../../notifications';
2
+ import { type AddressCreatedEvent, type AddressImportedEvent, type AddressUpdatedEvent, type AdjustmentCreatedEvent, type AdjustmentUpdatedEvent, type BusinessCreatedEvent, type BusinessImportedEvent, type BusinessUpdatedEvent, type CustomerCreatedEvent, type CustomerImportedEvent, type CustomerUpdatedEvent, type DiscountCreatedEvent, type DiscountImportedEvent, type DiscountUpdatedEvent, type PayoutCreatedEvent, type PayoutPaidEvent, type PriceCreatedEvent, type PriceImportedEvent, type PriceUpdatedEvent, type ProductCreatedEvent, type ProductImportedEvent, type ProductUpdatedEvent, type ReportCreatedEvent, type ReportUpdatedEvent, type SubscriptionActivatedEvent, type SubscriptionCanceledEvent, type SubscriptionCreatedEvent, type SubscriptionImportedEvent, type SubscriptionPastDueEvent, type SubscriptionPausedEvent, type SubscriptionResumedEvent, type SubscriptionTrialingEvent, type SubscriptionUpdatedEvent, type TransactionBilledEvent, type TransactionCanceledEvent, type TransactionCompletedEvent, type TransactionCreatedEvent, type TransactionPaidEvent, type TransactionPastDueEvent, type TransactionPaymentFailedEvent, type TransactionReadyEvent, type TransactionUpdatedEvent } from '../../notifications/events';
3
+ interface SimulationEventPayloadMap {
4
+ 'address.created': AddressCreatedEvent;
5
+ 'address.updated': AddressUpdatedEvent;
6
+ 'address.imported': AddressImportedEvent;
7
+ 'adjustment.created': AdjustmentCreatedEvent;
8
+ 'adjustment.updated': AdjustmentUpdatedEvent;
9
+ 'business.created': BusinessCreatedEvent;
10
+ 'business.updated': BusinessUpdatedEvent;
11
+ 'business.imported': BusinessImportedEvent;
12
+ 'customer.created': CustomerCreatedEvent;
13
+ 'customer.updated': CustomerUpdatedEvent;
14
+ 'customer.imported': CustomerImportedEvent;
15
+ 'discount.created': DiscountCreatedEvent;
16
+ 'discount.updated': DiscountUpdatedEvent;
17
+ 'discount.imported': DiscountImportedEvent;
18
+ 'payout.created': PayoutCreatedEvent;
19
+ 'payout.paid': PayoutPaidEvent;
20
+ 'price.created': PriceCreatedEvent;
21
+ 'price.updated': PriceUpdatedEvent;
22
+ 'price.imported': PriceImportedEvent;
23
+ 'product.created': ProductCreatedEvent;
24
+ 'product.updated': ProductUpdatedEvent;
25
+ 'product.imported': ProductImportedEvent;
26
+ 'subscription.created': SubscriptionCreatedEvent;
27
+ 'subscription.past_due': SubscriptionPastDueEvent;
28
+ 'subscription.activated': SubscriptionActivatedEvent;
29
+ 'subscription.canceled': SubscriptionCanceledEvent;
30
+ 'subscription.imported': SubscriptionImportedEvent;
31
+ 'subscription.paused': SubscriptionPausedEvent;
32
+ 'subscription.resumed': SubscriptionResumedEvent;
33
+ 'subscription.trialing': SubscriptionTrialingEvent;
34
+ 'subscription.updated': SubscriptionUpdatedEvent;
35
+ 'transaction.billed': TransactionBilledEvent;
36
+ 'transaction.canceled': TransactionCanceledEvent;
37
+ 'transaction.completed': TransactionCompletedEvent;
38
+ 'transaction.created': TransactionCreatedEvent;
39
+ 'transaction.paid': TransactionPaidEvent;
40
+ 'transaction.past_due': TransactionPastDueEvent;
41
+ 'transaction.payment_failed': TransactionPaymentFailedEvent;
42
+ 'transaction.ready': TransactionReadyEvent;
43
+ 'transaction.updated': TransactionUpdatedEvent;
44
+ 'report.created': ReportCreatedEvent;
45
+ 'report.updated': ReportUpdatedEvent;
46
+ subscription_creation: never;
47
+ subscription_renewal: never;
48
+ subscription_pause: never;
49
+ subscription_resume: never;
50
+ subscription_cancellation: never;
51
+ }
52
+ export type DiscriminatedSimulationEventResponse<Base> = {
53
+ [K in keyof SimulationEventPayloadMap]: Base & {
54
+ type: K;
55
+ payload?: K extends IEventName ? Partial<SimulationEventPayloadMap[K]['data']> | null : null;
56
+ };
57
+ }[keyof SimulationEventPayloadMap];
58
+ export {};
@@ -0,0 +1 @@
1
+ export * from './simulation-response';