@paddle/paddle-node-sdk 2.0.0-rc.0 → 2.0.0-rc.1

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 (166) hide show
  1. package/CHANGELOG.md +18 -7
  2. package/dist/cjs/entities/index.js +4 -0
  3. package/dist/cjs/entities/shared/index.js +2 -0
  4. package/dist/cjs/entities/shared/simulation-event-request.js +9 -0
  5. package/dist/cjs/entities/shared/simulation-event-response.js +10 -0
  6. package/dist/cjs/entities/simulation/index.js +18 -0
  7. package/dist/cjs/entities/simulation/simulation-collection.js +11 -0
  8. package/dist/cjs/entities/simulation/simulation.js +18 -0
  9. package/dist/cjs/entities/simulation-run/index.js +18 -0
  10. package/dist/cjs/entities/simulation-run/simulation-run-collection.js +11 -0
  11. package/dist/cjs/entities/simulation-run/simulation-run.js +16 -0
  12. package/dist/cjs/entities/simulation-run-event/index.js +18 -0
  13. package/dist/cjs/entities/simulation-run-event/simulation-run-event-collection.js +11 -0
  14. package/dist/cjs/entities/simulation-run-event/simulation-run-event.js +21 -0
  15. package/dist/cjs/entities/simulation-types/index.js +17 -0
  16. package/dist/cjs/entities/simulation-types/simulation-type.js +14 -0
  17. package/dist/cjs/enums/index.js +4 -0
  18. package/dist/cjs/enums/simulation/index.js +17 -0
  19. package/dist/cjs/enums/simulation/simulation-scenario-type.js +2 -0
  20. package/dist/cjs/enums/simulation-run/index.js +17 -0
  21. package/dist/cjs/enums/simulation-run/simulation-run-status.js +2 -0
  22. package/dist/cjs/enums/simulation-run-event/index.js +17 -0
  23. package/dist/cjs/enums/simulation-run-event/simulation-run-event-status.js +2 -0
  24. package/dist/cjs/enums/simulation-type/index.js +17 -0
  25. package/dist/cjs/enums/simulation-type/simulation-kind.js +2 -0
  26. package/dist/cjs/paddle.js +4 -0
  27. package/dist/cjs/resources/index.js +4 -0
  28. package/dist/cjs/resources/simulation-run-events/index.js +69 -0
  29. package/dist/cjs/resources/simulation-run-events/operations/index.js +17 -0
  30. package/dist/cjs/resources/simulation-run-events/operations/list-simulation-run-events-query-parameters.js +2 -0
  31. package/dist/cjs/resources/simulation-runs/index.js +66 -0
  32. package/dist/cjs/resources/simulation-runs/operations/get-simulation-run-query-parameters.js +2 -0
  33. package/dist/cjs/resources/simulation-runs/operations/index.js +18 -0
  34. package/dist/cjs/resources/simulation-runs/operations/list-simulation-run-query-parameters.js +2 -0
  35. package/dist/cjs/resources/simulation-types/index.js +27 -0
  36. package/dist/cjs/resources/simulations/index.js +69 -0
  37. package/dist/cjs/resources/simulations/operations/create-simulation-request-body.js +2 -0
  38. package/dist/cjs/resources/simulations/operations/index.js +19 -0
  39. package/dist/cjs/resources/simulations/operations/list-simulation-query-parameters.js +2 -0
  40. package/dist/cjs/resources/simulations/operations/update-simulation-request-body.js +2 -0
  41. package/dist/cjs/types/index.js +4 -0
  42. package/dist/cjs/types/shared/index.js +3 -0
  43. package/dist/cjs/types/shared/simulation-event-request.js +2 -0
  44. package/dist/cjs/types/shared/simulation-event-response.js +2 -0
  45. package/dist/cjs/types/shared/simulation-payload.js +2 -0
  46. package/dist/cjs/types/simulation/index.js +17 -0
  47. package/dist/cjs/types/simulation/simulation-response.js +2 -0
  48. package/dist/cjs/types/simulation-run/index.js +17 -0
  49. package/dist/cjs/types/simulation-run/simulation-run-event.js +2 -0
  50. package/dist/cjs/types/simulation-run/simulation-run-response.js +2 -0
  51. package/dist/cjs/types/simulation-run-event/index.js +17 -0
  52. package/dist/cjs/types/simulation-run-event/simulation-run-event-response.js +2 -0
  53. package/dist/cjs/types/simulation-type/index.js +17 -0
  54. package/dist/cjs/types/simulation-type/simulation-type.js +2 -0
  55. package/dist/cjs/version.js +1 -1
  56. package/dist/esm/entities/index.js +4 -0
  57. package/dist/esm/entities/shared/index.js +2 -0
  58. package/dist/esm/entities/shared/simulation-event-request.js +5 -0
  59. package/dist/esm/entities/shared/simulation-event-response.js +6 -0
  60. package/dist/esm/entities/simulation/index.js +2 -0
  61. package/dist/esm/entities/simulation/simulation-collection.js +7 -0
  62. package/dist/esm/entities/simulation/simulation.js +14 -0
  63. package/dist/esm/entities/simulation-run/index.js +2 -0
  64. package/dist/esm/entities/simulation-run/simulation-run-collection.js +7 -0
  65. package/dist/esm/entities/simulation-run/simulation-run.js +12 -0
  66. package/dist/esm/entities/simulation-run-event/index.js +2 -0
  67. package/dist/esm/entities/simulation-run-event/simulation-run-event-collection.js +7 -0
  68. package/dist/esm/entities/simulation-run-event/simulation-run-event.js +17 -0
  69. package/dist/esm/entities/simulation-types/index.js +1 -0
  70. package/dist/esm/entities/simulation-types/simulation-type.js +10 -0
  71. package/dist/esm/enums/index.js +4 -0
  72. package/dist/esm/enums/simulation/index.js +1 -0
  73. package/dist/esm/enums/simulation/simulation-scenario-type.js +1 -0
  74. package/dist/esm/enums/simulation-run/index.js +1 -0
  75. package/dist/esm/enums/simulation-run/simulation-run-status.js +1 -0
  76. package/dist/esm/enums/simulation-run-event/index.js +1 -0
  77. package/dist/esm/enums/simulation-run-event/simulation-run-event-status.js +1 -0
  78. package/dist/esm/enums/simulation-type/index.js +1 -0
  79. package/dist/esm/enums/simulation-type/simulation-kind.js +1 -0
  80. package/dist/esm/paddle.js +5 -1
  81. package/dist/esm/resources/index.js +4 -0
  82. package/dist/esm/resources/simulation-run-events/index.js +51 -0
  83. package/dist/esm/resources/simulation-run-events/operations/index.js +1 -0
  84. package/dist/esm/resources/simulation-run-events/operations/list-simulation-run-events-query-parameters.js +1 -0
  85. package/dist/esm/resources/simulation-runs/index.js +48 -0
  86. package/dist/esm/resources/simulation-runs/operations/get-simulation-run-query-parameters.js +1 -0
  87. package/dist/esm/resources/simulation-runs/operations/index.js +2 -0
  88. package/dist/esm/resources/simulation-runs/operations/list-simulation-run-query-parameters.js +1 -0
  89. package/dist/esm/resources/simulation-types/index.js +23 -0
  90. package/dist/esm/resources/simulations/index.js +51 -0
  91. package/dist/esm/resources/simulations/operations/create-simulation-request-body.js +1 -0
  92. package/dist/esm/resources/simulations/operations/index.js +3 -0
  93. package/dist/esm/resources/simulations/operations/list-simulation-query-parameters.js +1 -0
  94. package/dist/esm/resources/simulations/operations/update-simulation-request-body.js +1 -0
  95. package/dist/esm/types/index.js +4 -0
  96. package/dist/esm/types/shared/index.js +3 -0
  97. package/dist/esm/types/shared/simulation-event-request.js +1 -0
  98. package/dist/esm/types/shared/simulation-event-response.js +1 -0
  99. package/dist/esm/types/shared/simulation-payload.js +1 -0
  100. package/dist/esm/types/simulation/index.js +1 -0
  101. package/dist/esm/types/simulation/simulation-response.js +1 -0
  102. package/dist/esm/types/simulation-run/index.js +1 -0
  103. package/dist/esm/types/simulation-run/simulation-run-event.js +1 -0
  104. package/dist/esm/types/simulation-run/simulation-run-response.js +1 -0
  105. package/dist/esm/types/simulation-run-event/index.js +1 -0
  106. package/dist/esm/types/simulation-run-event/simulation-run-event-response.js +1 -0
  107. package/dist/esm/types/simulation-type/index.js +1 -0
  108. package/dist/esm/types/simulation-type/simulation-type.js +1 -0
  109. package/dist/esm/version.js +1 -1
  110. package/dist/types/entities/index.d.ts +4 -0
  111. package/dist/types/entities/shared/index.d.ts +2 -0
  112. package/dist/types/entities/shared/simulation-event-request.d.ts +5 -0
  113. package/dist/types/entities/shared/simulation-event-response.d.ts +6 -0
  114. package/dist/types/entities/simulation/index.d.ts +2 -0
  115. package/dist/types/entities/simulation/simulation-collection.d.ts +6 -0
  116. package/dist/types/entities/simulation/simulation.d.ts +15 -0
  117. package/dist/types/entities/simulation-run/index.d.ts +2 -0
  118. package/dist/types/entities/simulation-run/simulation-run-collection.d.ts +6 -0
  119. package/dist/types/entities/simulation-run/simulation-run.d.ts +13 -0
  120. package/dist/types/entities/simulation-run-event/index.d.ts +2 -0
  121. package/dist/types/entities/simulation-run-event/simulation-run-event-collection.d.ts +6 -0
  122. package/dist/types/entities/simulation-run-event/simulation-run-event.d.ts +15 -0
  123. package/dist/types/entities/simulation-types/index.d.ts +1 -0
  124. package/dist/types/entities/simulation-types/simulation-type.d.ts +12 -0
  125. package/dist/types/enums/index.d.ts +4 -0
  126. package/dist/types/enums/simulation/index.d.ts +1 -0
  127. package/dist/types/enums/simulation/simulation-scenario-type.d.ts +1 -0
  128. package/dist/types/enums/simulation-run/index.d.ts +1 -0
  129. package/dist/types/enums/simulation-run/simulation-run-status.d.ts +1 -0
  130. package/dist/types/enums/simulation-run-event/index.d.ts +1 -0
  131. package/dist/types/enums/simulation-run-event/simulation-run-event-status.d.ts +1 -0
  132. package/dist/types/enums/simulation-type/index.d.ts +1 -0
  133. package/dist/types/enums/simulation-type/simulation-kind.d.ts +1 -0
  134. package/dist/types/notifications/helpers/types.d.ts +1 -1
  135. package/dist/types/paddle.d.ts +5 -1
  136. package/dist/types/resources/index.d.ts +4 -0
  137. package/dist/types/resources/simulation-run-events/index.d.ts +9 -0
  138. package/dist/types/resources/simulation-run-events/operations/index.d.ts +1 -0
  139. package/dist/types/resources/simulation-run-events/operations/list-simulation-run-events-query-parameters.d.ts +6 -0
  140. package/dist/types/resources/simulation-runs/index.d.ts +9 -0
  141. package/dist/types/resources/simulation-runs/operations/get-simulation-run-query-parameters.d.ts +3 -0
  142. package/dist/types/resources/simulation-runs/operations/index.d.ts +2 -0
  143. package/dist/types/resources/simulation-runs/operations/list-simulation-run-query-parameters.d.ts +7 -0
  144. package/dist/types/resources/simulation-types/index.d.ts +5 -0
  145. package/dist/types/resources/simulations/index.d.ts +10 -0
  146. package/dist/types/resources/simulations/operations/create-simulation-request-body.d.ts +10 -0
  147. package/dist/types/resources/simulations/operations/index.d.ts +3 -0
  148. package/dist/types/resources/simulations/operations/list-simulation-query-parameters.d.ts +9 -0
  149. package/dist/types/resources/simulations/operations/update-simulation-request-body.d.ts +12 -0
  150. package/dist/types/types/index.d.ts +4 -0
  151. package/dist/types/types/shared/index.d.ts +3 -0
  152. package/dist/types/types/shared/simulation-event-request.d.ts +3 -0
  153. package/dist/types/types/shared/simulation-event-response.d.ts +4 -0
  154. package/dist/types/types/shared/simulation-payload.d.ts +58 -0
  155. package/dist/types/types/simulation/index.d.ts +1 -0
  156. package/dist/types/types/simulation/simulation-response.d.ts +13 -0
  157. package/dist/types/types/simulation-run/index.d.ts +1 -0
  158. package/dist/types/types/simulation-run/simulation-run-event.d.ts +17 -0
  159. package/dist/types/types/simulation-run/simulation-run-response.d.ts +11 -0
  160. package/dist/types/types/simulation-run-event/index.d.ts +1 -0
  161. package/dist/types/types/simulation-run-event/simulation-run-event-response.d.ts +13 -0
  162. package/dist/types/types/simulation-type/index.d.ts +1 -0
  163. package/dist/types/types/simulation-type/simulation-type.d.ts +10 -0
  164. package/dist/types/types/subscription/subscription-update-item.d.ts +1 -1
  165. package/dist/types/version.d.ts +1 -1
  166. package/package.json +1 -1
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SimulationTypesResource = void 0;
13
+ const index_js_1 = require("../../internal/base/index.js");
14
+ const index_js_2 = require("../../entities/index.js");
15
+ const SimulationTypesPaths = {
16
+ list: '/simulation-types',
17
+ };
18
+ class SimulationTypesResource extends index_js_1.BaseResource {
19
+ list() {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const response = yield this.client.get(SimulationTypesPaths.list);
22
+ const data = this.handleResponse(response);
23
+ return data.map((simulationType) => new index_js_2.SimulationType(simulationType));
24
+ });
25
+ }
26
+ }
27
+ exports.SimulationTypesResource = SimulationTypesResource;
@@ -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.SimulationsResource = void 0;
27
+ const index_js_1 = require("../../entities/index.js");
28
+ const index_js_2 = require("../../internal/base/index.js");
29
+ __exportStar(require("./operations/index.js"), exports);
30
+ const SimulationPaths = {
31
+ list: '/simulations',
32
+ create: '/simulations',
33
+ get: '/simulations/{simulation_id}',
34
+ update: '/simulations/{simulation_id}',
35
+ };
36
+ class SimulationsResource extends index_js_2.BaseResource {
37
+ list(queryParams) {
38
+ const queryParameters = new index_js_2.QueryParameters(queryParams);
39
+ return new index_js_1.SimulationCollection(this.client, SimulationPaths.list + queryParameters.toQueryString());
40
+ }
41
+ create(createSimulationParameters) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ const response = yield this.client.post(SimulationPaths.create, createSimulationParameters);
44
+ const data = this.handleResponse(response);
45
+ return new index_js_1.Simulation(data);
46
+ });
47
+ }
48
+ get(simulationId) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ const urlWithPathParams = new index_js_2.PathParameters(SimulationPaths.get, {
51
+ simulation_id: simulationId,
52
+ }).deriveUrl();
53
+ const response = yield this.client.get(urlWithPathParams);
54
+ const data = this.handleResponse(response);
55
+ return new index_js_1.Simulation(data);
56
+ });
57
+ }
58
+ update(simulationId, updateSimulation) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ const urlWithPathParams = new index_js_2.PathParameters(SimulationPaths.update, {
61
+ simulation_id: simulationId,
62
+ }).deriveUrl();
63
+ const response = yield this.client.patch(urlWithPathParams, updateSimulation);
64
+ const data = this.handleResponse(response);
65
+ return new index_js_1.Simulation(data);
66
+ });
67
+ }
68
+ }
69
+ exports.SimulationsResource = SimulationsResource;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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("./create-simulation-request-body.js"), exports);
18
+ __exportStar(require("./list-simulation-query-parameters.js"), exports);
19
+ __exportStar(require("./update-simulation-request-body.js"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -31,3 +31,7 @@ __exportStar(require("./event-types/index.js"), exports);
31
31
  __exportStar(require("./notification-settings/index.js"), exports);
32
32
  __exportStar(require("./notifications/index.js"), exports);
33
33
  __exportStar(require("./report/index.js"), exports);
34
+ __exportStar(require("./simulation-type/index.js"), exports);
35
+ __exportStar(require("./simulation/index.js"), exports);
36
+ __exportStar(require("./simulation-run/index.js"), exports);
37
+ __exportStar(require("./simulation-run-event/index.js"), exports);
@@ -43,3 +43,6 @@ __exportStar(require("./billing-details-create.js"), exports);
43
43
  __exportStar(require("./billing-details-update.js"), exports);
44
44
  __exportStar(require("./custom-data.js"), exports);
45
45
  __exportStar(require("./import-meta-response.js"), exports);
46
+ __exportStar(require("./simulation-event-request.js"), exports);
47
+ __exportStar(require("./simulation-event-response.js"), exports);
48
+ __exportStar(require("./simulation-payload.js"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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-response.js"), 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-response.js"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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-response.js"), 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-type.js"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = '2.0.0-rc.0';
4
+ exports.SDK_VERSION = '2.0.0-rc.1';
@@ -14,3 +14,7 @@ export * from './event-types/index.js';
14
14
  export * from './notification-settings/index.js';
15
15
  export * from './notifications/index.js';
16
16
  export * from './report/index.js';
17
+ export * from './simulation-types/index.js';
18
+ export * from './simulation/index.js';
19
+ export * from './simulation-run/index.js';
20
+ export * from './simulation-run-event/index.js';
@@ -18,3 +18,5 @@ export * from './transaction-checkout.js';
18
18
  export * from './total-adjustments.js';
19
19
  export * from './payout-totals-adjustment.js';
20
20
  export * from './import-meta.js';
21
+ export * from './simulation-event-request.js';
22
+ export * from './simulation-event-response.js';
@@ -0,0 +1,5 @@
1
+ export class SimulationEventRequest {
2
+ constructor(simulationEventRequestResponse) {
3
+ this.body = simulationEventRequestResponse.body;
4
+ }
5
+ }
@@ -0,0 +1,6 @@
1
+ export class SimulationEventResponse {
2
+ constructor(simulationEventResponse) {
3
+ this.body = simulationEventResponse.body;
4
+ this.statusCode = simulationEventResponse.status_code;
5
+ }
6
+ }
@@ -0,0 +1,2 @@
1
+ export * from './simulation.js';
2
+ export * from './simulation-collection.js';
@@ -0,0 +1,7 @@
1
+ import { Simulation } from '../../entities/index.js';
2
+ import { Collection } from '../../internal/base/index.js';
3
+ export class SimulationCollection extends Collection {
4
+ fromJson(data) {
5
+ return new Simulation(data);
6
+ }
7
+ }
@@ -0,0 +1,14 @@
1
+ export class Simulation {
2
+ constructor(simulationResponse) {
3
+ var _a, _b;
4
+ this.id = simulationResponse.id;
5
+ this.status = simulationResponse.status;
6
+ this.notificationSettingId = simulationResponse.notification_setting_id;
7
+ this.name = simulationResponse.name;
8
+ this.type = simulationResponse.type;
9
+ this.payload = (_a = simulationResponse.payload) !== null && _a !== void 0 ? _a : null;
10
+ this.lastRunAt = (_b = simulationResponse.last_run_at) !== null && _b !== void 0 ? _b : null;
11
+ this.createdAt = simulationResponse.created_at;
12
+ this.updatedAt = simulationResponse.updated_at;
13
+ }
14
+ }
@@ -0,0 +1,2 @@
1
+ export * from './simulation-run.js';
2
+ export * from './simulation-run-collection.js';
@@ -0,0 +1,7 @@
1
+ import { SimulationRun } from '../../entities/index.js';
2
+ import { Collection } from '../../internal/base/index.js';
3
+ export class SimulationRunCollection extends Collection {
4
+ fromJson(data) {
5
+ return new SimulationRun(data);
6
+ }
7
+ }
@@ -0,0 +1,12 @@
1
+ import { SimulationRunEvent } from '../index.js';
2
+ export class SimulationRun {
3
+ constructor(simulationRunResponse) {
4
+ var _a, _b;
5
+ this.id = simulationRunResponse.id;
6
+ this.status = simulationRunResponse.status;
7
+ this.createdAt = simulationRunResponse.created_at;
8
+ this.updatedAt = simulationRunResponse.updated_at;
9
+ this.type = simulationRunResponse.type;
10
+ this.events = (_b = (_a = simulationRunResponse.events) === null || _a === void 0 ? void 0 : _a.map((event) => new SimulationRunEvent(event))) !== null && _b !== void 0 ? _b : [];
11
+ }
12
+ }
@@ -0,0 +1,2 @@
1
+ export * from './simulation-run-event.js';
2
+ export * from './simulation-run-event-collection.js';
@@ -0,0 +1,7 @@
1
+ import { SimulationRunEvent } from '../../entities/index.js';
2
+ import { Collection } from '../../internal/base/index.js';
3
+ export class SimulationRunEventCollection extends Collection {
4
+ fromJson(data) {
5
+ return new SimulationRunEvent(data);
6
+ }
7
+ }
@@ -0,0 +1,17 @@
1
+ import { SimulationEventRequest, SimulationEventResponse } from '../shared/index.js';
2
+ export class SimulationRunEvent {
3
+ constructor(simulationRunEventResponse) {
4
+ this.id = simulationRunEventResponse.id;
5
+ this.status = simulationRunEventResponse.status;
6
+ this.eventType = simulationRunEventResponse.event_type;
7
+ this.payload = simulationRunEventResponse.payload;
8
+ this.request = simulationRunEventResponse.request
9
+ ? new SimulationEventRequest(simulationRunEventResponse.request)
10
+ : null;
11
+ this.response = simulationRunEventResponse.response
12
+ ? new SimulationEventResponse(simulationRunEventResponse.response)
13
+ : null;
14
+ this.createdAt = simulationRunEventResponse.created_at;
15
+ this.updatedAt = simulationRunEventResponse.updated_at;
16
+ }
17
+ }
@@ -0,0 +1 @@
1
+ export * from './simulation-type.js';
@@ -0,0 +1,10 @@
1
+ export class SimulationType {
2
+ constructor(simulationTypeResponse) {
3
+ this.name = simulationTypeResponse.name;
4
+ this.label = simulationTypeResponse.label;
5
+ this.description = simulationTypeResponse.description;
6
+ this.group = simulationTypeResponse.group;
7
+ this.type = simulationTypeResponse.type;
8
+ this.events = simulationTypeResponse.events;
9
+ }
10
+ }
@@ -7,3 +7,7 @@ export * from './payout/index.js';
7
7
  export * from './notification-settings/index.js';
8
8
  export * from './notification/index.js';
9
9
  export * from './report/index.js';
10
+ export * from './simulation-type/index.js';
11
+ export * from './simulation/index.js';
12
+ export * from './simulation-run/index.js';
13
+ export * from './simulation-run-event/index.js';
@@ -0,0 +1 @@
1
+ export * from './simulation-scenario-type.js';
@@ -0,0 +1 @@
1
+ export * from './simulation-run-status.js';
@@ -0,0 +1 @@
1
+ export * from './simulation-run-event-status.js';
@@ -0,0 +1 @@
1
+ export * from './simulation-kind.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { Client } from './internal/api/client.js';
2
2
  import { Environment, LogLevel } from './internal/index.js';
3
- import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomersResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PricesResource, PricingPreviewResource, ProductsResource, ReportsResource, SubscriptionsResource, TransactionsResource, } from './resources/index.js';
3
+ import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomersResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PricesResource, PricingPreviewResource, ProductsResource, ReportsResource, SimulationTypesResource, SimulationsResource, SimulationRunsResource, SimulationRunEventsResource, SubscriptionsResource, TransactionsResource, } from './resources/index.js';
4
4
  import { EventsResource } from './resources/events/index.js';
5
5
  import { Webhooks } from './notifications/index.js';
6
6
  export class Paddle {
@@ -26,5 +26,9 @@ export class Paddle {
26
26
  this.notificationSettings = new NotificationSettingsResource(this.client);
27
27
  this.notifications = new NotificationsResource(this.client);
28
28
  this.reports = new ReportsResource(this.client);
29
+ this.simulationTypes = new SimulationTypesResource(this.client);
30
+ this.simulations = new SimulationsResource(this.client);
31
+ this.simulationRuns = new SimulationRunsResource(this.client);
32
+ this.simulationRunEvents = new SimulationRunEventsResource(this.client);
29
33
  }
30
34
  }
@@ -12,3 +12,7 @@ export * from './event-types/index.js';
12
12
  export * from './notification-settings/index.js';
13
13
  export * from './notifications/index.js';
14
14
  export * from './reports/index.js';
15
+ export * from './simulation-types/index.js';
16
+ export * from './simulations/index.js';
17
+ export * from './simulation-runs/index.js';
18
+ export * from './simulation-run-events/index.js';
@@ -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 { SimulationRunEvent, SimulationRunEventCollection } from '../../entities/index.js';
11
+ import { BaseResource, PathParameters, QueryParameters } from '../../internal/base/index.js';
12
+ export * from './operations/index.js';
13
+ const SimulationRunEventPaths = {
14
+ list: '/simulations/{simulation_id}/runs/{simulation_run_id}/events',
15
+ get: '/simulations/{simulation_id}/runs/{simulation_run_id}/events/{simulation_event_id}',
16
+ replay: '/simulations/{simulation_id}/runs/{simulation_run_id}/events/{simulation_event_id}/replay',
17
+ };
18
+ export class SimulationRunEventsResource extends BaseResource {
19
+ list(simulationId, simulationRunId, queryParams) {
20
+ const queryParameters = new QueryParameters(queryParams);
21
+ const urlWithPathParams = new PathParameters(SimulationRunEventPaths.list, {
22
+ simulation_id: simulationId,
23
+ simulation_run_id: simulationRunId,
24
+ }).deriveUrl();
25
+ return new SimulationRunEventCollection(this.client, urlWithPathParams + queryParameters.toQueryString());
26
+ }
27
+ get(simulationId, simulationRunId, simulationEventId) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ const urlWithPathParams = new PathParameters(SimulationRunEventPaths.get, {
30
+ simulation_id: simulationId,
31
+ simulation_run_id: simulationRunId,
32
+ simulation_event_id: simulationEventId,
33
+ }).deriveUrl();
34
+ const response = yield this.client.get(urlWithPathParams);
35
+ const data = this.handleResponse(response);
36
+ return new SimulationRunEvent(data);
37
+ });
38
+ }
39
+ replay(simulationId, simulationRunId, simulationEventId) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ const urlWithPathParams = new PathParameters(SimulationRunEventPaths.replay, {
42
+ simulation_id: simulationId,
43
+ simulation_run_id: simulationRunId,
44
+ simulation_event_id: simulationEventId,
45
+ }).deriveUrl();
46
+ const response = yield this.client.post(urlWithPathParams, undefined);
47
+ const data = this.handleResponse(response);
48
+ return new SimulationRunEvent(data);
49
+ });
50
+ }
51
+ }
@@ -0,0 +1 @@
1
+ export * from './list-simulation-run-events-query-parameters.js';
@@ -0,0 +1,48 @@
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 { SimulationRun, SimulationRunCollection } from '../../entities/index.js';
11
+ import { BaseResource, PathParameters, QueryParameters } from '../../internal/base/index.js';
12
+ export * from './operations/index.js';
13
+ const SimulationRunPaths = {
14
+ list: '/simulations/{simulation_id}/runs',
15
+ create: '/simulations/{simulation_id}/runs',
16
+ get: '/simulations/{simulation_id}/runs/{simulation_run_id}',
17
+ };
18
+ export class SimulationRunsResource extends BaseResource {
19
+ list(simulationId, queryParams) {
20
+ const queryParameters = new QueryParameters(queryParams);
21
+ const urlWithPathParams = new PathParameters(SimulationRunPaths.list, {
22
+ simulation_id: simulationId,
23
+ }).deriveUrl();
24
+ return new SimulationRunCollection(this.client, urlWithPathParams + queryParameters.toQueryString());
25
+ }
26
+ create(simulationId) {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ const urlWithPathParams = new PathParameters(SimulationRunPaths.create, {
29
+ simulation_id: simulationId,
30
+ }).deriveUrl();
31
+ const response = yield this.client.post(urlWithPathParams, undefined);
32
+ const data = this.handleResponse(response);
33
+ return new SimulationRun(data);
34
+ });
35
+ }
36
+ get(simulationId, simulationRunId, queryParams) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ const queryParameters = new QueryParameters(queryParams);
39
+ const urlWithPathParams = new PathParameters(SimulationRunPaths.get, {
40
+ simulation_id: simulationId,
41
+ simulation_run_id: simulationRunId,
42
+ }).deriveUrl();
43
+ const response = yield this.client.get(urlWithPathParams, queryParameters);
44
+ const data = this.handleResponse(response);
45
+ return new SimulationRun(data);
46
+ });
47
+ }
48
+ }
@@ -0,0 +1,2 @@
1
+ export * from './get-simulation-run-query-parameters.js';
2
+ export * from './list-simulation-run-query-parameters.js';
@@ -0,0 +1,23 @@
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 { BaseResource } from '../../internal/base/index.js';
11
+ import { SimulationType } from '../../entities/index.js';
12
+ const SimulationTypesPaths = {
13
+ list: '/simulation-types',
14
+ };
15
+ export class SimulationTypesResource extends BaseResource {
16
+ list() {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ const response = yield this.client.get(SimulationTypesPaths.list);
19
+ const data = this.handleResponse(response);
20
+ return data.map((simulationType) => new SimulationType(simulationType));
21
+ });
22
+ }
23
+ }