@paddle/paddle-node-sdk 2.7.3 → 2.8.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 (197) hide show
  1. package/dist/cjs/entities/discount/discount.js +1 -0
  2. package/dist/cjs/entities/discount-group/discount-group-collection.js +11 -0
  3. package/dist/cjs/entities/discount-group/discount-group.js +15 -0
  4. package/dist/cjs/entities/discount-group/index.js +18 -0
  5. package/dist/cjs/entities/index.js +1 -0
  6. package/dist/cjs/entities/payment-method/payment-method.js +3 -0
  7. package/dist/cjs/entities/shared/index.js +2 -0
  8. package/dist/cjs/entities/shared/korean-market-underlying-details.js +9 -0
  9. package/dist/cjs/entities/shared/payment-method-details.js +4 -0
  10. package/dist/cjs/entities/shared/payment-method-underlying-details.js +12 -0
  11. package/dist/cjs/enums/api-key/api-key-permission.js +2 -0
  12. package/dist/cjs/enums/api-key/api-key-status.js +2 -0
  13. package/dist/cjs/enums/api-key/index.js +18 -0
  14. package/dist/cjs/enums/discount/discount-mode.js +2 -0
  15. package/dist/cjs/enums/discount/index.js +1 -0
  16. package/dist/cjs/enums/index.js +1 -0
  17. package/dist/cjs/enums/shared/index.js +1 -0
  18. package/dist/cjs/enums/shared/korean-market-underlying-payment-method-type.js +2 -0
  19. package/dist/cjs/notifications/entities/api-key/api-key-notification.js +19 -0
  20. package/dist/cjs/notifications/entities/api-key/index.js +17 -0
  21. package/dist/cjs/notifications/entities/discount/discount-notification.js +1 -0
  22. package/dist/cjs/notifications/entities/discount-group/discount-group-notification.js +17 -0
  23. package/dist/cjs/notifications/entities/discount-group/index.js +17 -0
  24. package/dist/cjs/notifications/entities/index.js +2 -0
  25. package/dist/cjs/notifications/entities/shared/index.js +2 -0
  26. package/dist/cjs/notifications/entities/shared/korean-market-underlying-details-notification.js +9 -0
  27. package/dist/cjs/notifications/entities/shared/payment-method-details-notification.js +4 -0
  28. package/dist/cjs/notifications/entities/shared/payment-method-underlying-details-notification.js +12 -0
  29. package/dist/cjs/notifications/events/api-key/api-key-created-event.js +14 -0
  30. package/dist/cjs/notifications/events/api-key/api-key-expired-event.js +14 -0
  31. package/dist/cjs/notifications/events/api-key/api-key-expiring-event.js +14 -0
  32. package/dist/cjs/notifications/events/api-key/api-key-revoked-event.js +14 -0
  33. package/dist/cjs/notifications/events/api-key/api-key-updated-event.js +14 -0
  34. package/dist/cjs/notifications/events/api-key/index.js +21 -0
  35. package/dist/cjs/notifications/events/discount-group/discount-group-created-event.js +14 -0
  36. package/dist/cjs/notifications/events/discount-group/index.js +17 -0
  37. package/dist/cjs/notifications/events/index.js +2 -0
  38. package/dist/cjs/notifications/helpers/types.js +6 -0
  39. package/dist/cjs/notifications/helpers/webhooks.js +12 -0
  40. package/dist/cjs/notifications/types/api-key/api-key-notification-response.js +2 -0
  41. package/dist/cjs/notifications/types/api-key/index.js +17 -0
  42. package/dist/cjs/notifications/types/discount-group/discount-group-notification-response.js +2 -0
  43. package/dist/cjs/notifications/types/discount-group/index.js +17 -0
  44. package/dist/cjs/notifications/types/index.js +2 -0
  45. package/dist/cjs/notifications/types/shared/index.js +2 -0
  46. package/dist/cjs/notifications/types/shared/korean-market-underlying-details-notification.js +2 -0
  47. package/dist/cjs/notifications/types/shared/payment-method-underlying-details-notification.js +2 -0
  48. package/dist/cjs/paddle.js +1 -0
  49. package/dist/cjs/resources/discount-groups/index.js +47 -0
  50. package/dist/cjs/resources/discount-groups/operations/create-discount-group-request-body.js +2 -0
  51. package/dist/cjs/resources/discount-groups/operations/index.js +18 -0
  52. package/dist/cjs/resources/discount-groups/operations/list-discount-group-query-parameters.js +2 -0
  53. package/dist/cjs/resources/index.js +1 -0
  54. package/dist/cjs/types/discount-group/discount-group-response.js +2 -0
  55. package/dist/cjs/types/discount-group/index.js +17 -0
  56. package/dist/cjs/types/index.js +1 -0
  57. package/dist/cjs/types/shared/index.js +2 -0
  58. package/dist/cjs/types/shared/korean-market-underlying-details.js +2 -0
  59. package/dist/cjs/types/shared/payment-method-underlying-details.js +2 -0
  60. package/dist/cjs/version.js +1 -1
  61. package/dist/esm/entities/discount/discount.js +1 -0
  62. package/dist/esm/entities/discount-group/discount-group-collection.js +7 -0
  63. package/dist/esm/entities/discount-group/discount-group.js +11 -0
  64. package/dist/esm/entities/discount-group/index.js +2 -0
  65. package/dist/esm/entities/index.js +1 -0
  66. package/dist/esm/entities/payment-method/payment-method.js +4 -1
  67. package/dist/esm/entities/shared/index.js +2 -0
  68. package/dist/esm/entities/shared/korean-market-underlying-details.js +5 -0
  69. package/dist/esm/entities/shared/payment-method-details.js +4 -0
  70. package/dist/esm/entities/shared/payment-method-underlying-details.js +8 -0
  71. package/dist/esm/enums/api-key/api-key-permission.js +1 -0
  72. package/dist/esm/enums/api-key/api-key-status.js +1 -0
  73. package/dist/esm/enums/api-key/index.js +2 -0
  74. package/dist/esm/enums/discount/discount-mode.js +1 -0
  75. package/dist/esm/enums/discount/index.js +1 -0
  76. package/dist/esm/enums/index.js +1 -0
  77. package/dist/esm/enums/shared/index.js +1 -0
  78. package/dist/esm/enums/shared/korean-market-underlying-payment-method-type.js +1 -0
  79. package/dist/esm/notifications/entities/api-key/api-key-notification.js +15 -0
  80. package/dist/esm/notifications/entities/api-key/index.js +1 -0
  81. package/dist/esm/notifications/entities/discount/discount-notification.js +1 -0
  82. package/dist/esm/notifications/entities/discount-group/discount-group-notification.js +13 -0
  83. package/dist/esm/notifications/entities/discount-group/index.js +1 -0
  84. package/dist/esm/notifications/entities/index.js +2 -0
  85. package/dist/esm/notifications/entities/shared/index.js +2 -0
  86. package/dist/esm/notifications/entities/shared/korean-market-underlying-details-notification.js +5 -0
  87. package/dist/esm/notifications/entities/shared/payment-method-details-notification.js +4 -0
  88. package/dist/esm/notifications/entities/shared/payment-method-underlying-details-notification.js +8 -0
  89. package/dist/esm/notifications/events/api-key/api-key-created-event.js +10 -0
  90. package/dist/esm/notifications/events/api-key/api-key-expired-event.js +10 -0
  91. package/dist/esm/notifications/events/api-key/api-key-expiring-event.js +10 -0
  92. package/dist/esm/notifications/events/api-key/api-key-revoked-event.js +10 -0
  93. package/dist/esm/notifications/events/api-key/api-key-updated-event.js +10 -0
  94. package/dist/esm/notifications/events/api-key/index.js +5 -0
  95. package/dist/esm/notifications/events/discount-group/discount-group-created-event.js +10 -0
  96. package/dist/esm/notifications/events/discount-group/index.js +1 -0
  97. package/dist/esm/notifications/events/index.js +2 -0
  98. package/dist/esm/notifications/helpers/types.js +6 -0
  99. package/dist/esm/notifications/helpers/webhooks.js +13 -1
  100. package/dist/esm/notifications/types/api-key/api-key-notification-response.js +1 -0
  101. package/dist/esm/notifications/types/api-key/index.js +1 -0
  102. package/dist/esm/notifications/types/discount-group/discount-group-notification-response.js +1 -0
  103. package/dist/esm/notifications/types/discount-group/index.js +1 -0
  104. package/dist/esm/notifications/types/index.js +2 -0
  105. package/dist/esm/notifications/types/shared/index.js +2 -0
  106. package/dist/esm/notifications/types/shared/korean-market-underlying-details-notification.js +1 -0
  107. package/dist/esm/notifications/types/shared/payment-method-underlying-details-notification.js +1 -0
  108. package/dist/esm/paddle.js +2 -1
  109. package/dist/esm/resources/discount-groups/index.js +29 -0
  110. package/dist/esm/resources/discount-groups/operations/create-discount-group-request-body.js +1 -0
  111. package/dist/esm/resources/discount-groups/operations/index.js +2 -0
  112. package/dist/esm/resources/discount-groups/operations/list-discount-group-query-parameters.js +1 -0
  113. package/dist/esm/resources/index.js +1 -0
  114. package/dist/esm/types/discount-group/discount-group-response.js +1 -0
  115. package/dist/esm/types/discount-group/index.js +1 -0
  116. package/dist/esm/types/index.js +1 -0
  117. package/dist/esm/types/shared/index.js +2 -0
  118. package/dist/esm/types/shared/korean-market-underlying-details.js +1 -0
  119. package/dist/esm/types/shared/payment-method-underlying-details.js +1 -0
  120. package/dist/esm/version.js +1 -1
  121. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  122. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  123. package/dist/tsconfig.types.tsbuildinfo +1 -1
  124. package/dist/types/entities/discount/discount.d.ts +2 -1
  125. package/dist/types/entities/discount-group/discount-group-collection.d.ts +6 -0
  126. package/dist/types/entities/discount-group/discount-group.d.ts +12 -0
  127. package/dist/types/entities/discount-group/index.d.ts +2 -0
  128. package/dist/types/entities/index.d.ts +1 -0
  129. package/dist/types/entities/payment-method/payment-method.d.ts +2 -1
  130. package/dist/types/entities/shared/index.d.ts +2 -0
  131. package/dist/types/entities/shared/korean-market-underlying-details.d.ts +6 -0
  132. package/dist/types/entities/shared/payment-method-details.d.ts +2 -0
  133. package/dist/types/entities/shared/payment-method-underlying-details.d.ts +6 -0
  134. package/dist/types/enums/adjustment/adjustment-action.d.ts +1 -1
  135. package/dist/types/enums/api-key/api-key-permission.d.ts +1 -0
  136. package/dist/types/enums/api-key/api-key-status.d.ts +1 -0
  137. package/dist/types/enums/api-key/index.d.ts +2 -0
  138. package/dist/types/enums/discount/discount-mode.d.ts +1 -0
  139. package/dist/types/enums/discount/index.d.ts +1 -0
  140. package/dist/types/enums/index.d.ts +1 -0
  141. package/dist/types/enums/report/report-type.d.ts +1 -1
  142. package/dist/types/enums/shared/available-payment-methods.d.ts +1 -1
  143. package/dist/types/enums/shared/index.d.ts +1 -0
  144. package/dist/types/enums/shared/korean-market-underlying-payment-method-type.d.ts +1 -0
  145. package/dist/types/enums/shared/payment-type.d.ts +1 -1
  146. package/dist/types/notifications/entities/api-key/api-key-notification.d.ts +15 -0
  147. package/dist/types/notifications/entities/api-key/index.d.ts +1 -0
  148. package/dist/types/notifications/entities/discount/discount-notification.d.ts +2 -1
  149. package/dist/types/notifications/entities/discount-group/discount-group-notification.d.ts +12 -0
  150. package/dist/types/notifications/entities/discount-group/index.d.ts +1 -0
  151. package/dist/types/notifications/entities/index.d.ts +2 -0
  152. package/dist/types/notifications/entities/payment-method/payment-method-deleted-notification.d.ts +1 -1
  153. package/dist/types/notifications/entities/shared/index.d.ts +2 -0
  154. package/dist/types/notifications/entities/shared/korean-market-underlying-details-notification.d.ts +6 -0
  155. package/dist/types/notifications/entities/shared/payment-method-details-notification.d.ts +2 -0
  156. package/dist/types/notifications/entities/shared/payment-method-underlying-details-notification.d.ts +6 -0
  157. package/dist/types/notifications/events/api-key/api-key-created-event.d.ts +10 -0
  158. package/dist/types/notifications/events/api-key/api-key-expired-event.d.ts +10 -0
  159. package/dist/types/notifications/events/api-key/api-key-expiring-event.d.ts +10 -0
  160. package/dist/types/notifications/events/api-key/api-key-revoked-event.d.ts +10 -0
  161. package/dist/types/notifications/events/api-key/api-key-updated-event.d.ts +10 -0
  162. package/dist/types/notifications/events/api-key/index.d.ts +5 -0
  163. package/dist/types/notifications/events/discount-group/discount-group-created-event.d.ts +10 -0
  164. package/dist/types/notifications/events/discount-group/index.d.ts +1 -0
  165. package/dist/types/notifications/events/index.d.ts +2 -0
  166. package/dist/types/notifications/helpers/types.d.ts +9 -3
  167. package/dist/types/notifications/types/api-key/api-key-notification-response.d.ts +13 -0
  168. package/dist/types/notifications/types/api-key/index.d.ts +1 -0
  169. package/dist/types/notifications/types/discount/discount-notification-response.d.ts +2 -1
  170. package/dist/types/notifications/types/discount-group/discount-group-notification-response.d.ts +10 -0
  171. package/dist/types/notifications/types/discount-group/index.d.ts +1 -0
  172. package/dist/types/notifications/types/index.d.ts +2 -0
  173. package/dist/types/notifications/types/shared/index.d.ts +2 -0
  174. package/dist/types/notifications/types/shared/korean-market-underlying-details-notification.d.ts +4 -0
  175. package/dist/types/notifications/types/shared/payment-method-details.d.ts +3 -1
  176. package/dist/types/notifications/types/shared/payment-method-underlying-details-notification.d.ts +4 -0
  177. package/dist/types/paddle.d.ts +2 -1
  178. package/dist/types/resources/discount-groups/index.d.ts +8 -0
  179. package/dist/types/resources/discount-groups/operations/create-discount-group-request-body.d.ts +3 -0
  180. package/dist/types/resources/discount-groups/operations/index.d.ts +2 -0
  181. package/dist/types/resources/discount-groups/operations/list-discount-group-query-parameters.d.ts +6 -0
  182. package/dist/types/resources/discounts/operations/create-discount-request-body.d.ts +2 -1
  183. package/dist/types/resources/discounts/operations/list-discount-query-parameters.d.ts +2 -1
  184. package/dist/types/resources/discounts/operations/update-discount-request-body.d.ts +2 -1
  185. package/dist/types/resources/index.d.ts +1 -0
  186. package/dist/types/types/discount/discount-response.d.ts +2 -1
  187. package/dist/types/types/discount-group/discount-group-response.d.ts +10 -0
  188. package/dist/types/types/discount-group/index.d.ts +1 -0
  189. package/dist/types/types/events/events-response.d.ts +20 -2
  190. package/dist/types/types/index.d.ts +1 -0
  191. package/dist/types/types/payment-method/payment-method.d.ts +4 -2
  192. package/dist/types/types/shared/index.d.ts +2 -0
  193. package/dist/types/types/shared/korean-market-underlying-details.d.ts +4 -0
  194. package/dist/types/types/shared/payment-method-details.d.ts +3 -1
  195. package/dist/types/types/shared/payment-method-underlying-details.d.ts +4 -0
  196. package/dist/types/version.d.ts +1 -1
  197. package/package.json +5 -5
@@ -0,0 +1,47 @@
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.DiscountGroupsResource = void 0;
27
+ const index_js_1 = require("../../entities/index.js");
28
+ const index_js_2 = require("../../internal/base/index.js");
29
+ const DiscountGroupPaths = {
30
+ list: '/discount-groups',
31
+ create: '/discount-groups',
32
+ };
33
+ __exportStar(require("./operations/index.js"), exports);
34
+ class DiscountGroupsResource extends index_js_2.BaseResource {
35
+ list(queryParams) {
36
+ const queryParameters = new index_js_2.QueryParameters(queryParams);
37
+ return new index_js_1.DiscountGroupCollection(this.client, DiscountGroupPaths.list + queryParameters.toQueryString());
38
+ }
39
+ create(createDiscountGroupRequestBody) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ const response = yield this.client.post(DiscountGroupPaths.create, createDiscountGroupRequestBody);
42
+ const data = this.handleResponse(response);
43
+ return new index_js_1.DiscountGroup(data);
44
+ });
45
+ }
46
+ }
47
+ exports.DiscountGroupsResource = DiscountGroupsResource;
@@ -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("./list-discount-group-query-parameters.js"), exports);
18
+ __exportStar(require("./create-discount-group-request-body.js"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -20,6 +20,7 @@ __exportStar(require("./businesses/index.js"), exports);
20
20
  __exportStar(require("./customers/index.js"), exports);
21
21
  __exportStar(require("./customer-portal-sessions/index.js"), exports);
22
22
  __exportStar(require("./discounts/index.js"), exports);
23
+ __exportStar(require("./discount-groups/index.js"), exports);
23
24
  __exportStar(require("./prices/index.js"), exports);
24
25
  __exportStar(require("./products/index.js"), exports);
25
26
  __exportStar(require("./subscriptions/index.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("./discount-group-response.js"), exports);
@@ -25,6 +25,7 @@ __exportStar(require("./business/index.js"), exports);
25
25
  __exportStar(require("./subscription/index.js"), exports);
26
26
  __exportStar(require("./address/index.js"), exports);
27
27
  __exportStar(require("./discount/index.js"), exports);
28
+ __exportStar(require("./discount-group/index.js"), exports);
28
29
  __exportStar(require("./payment-method/index.js"), exports);
29
30
  __exportStar(require("./pricing-preview/index.js"), exports);
30
31
  __exportStar(require("./events/index.js"), exports);
@@ -47,3 +47,5 @@ __exportStar(require("./import-meta-response.js"), exports);
47
47
  __exportStar(require("./simulation-event-request.js"), exports);
48
48
  __exportStar(require("./simulation-event-response.js"), exports);
49
49
  __exportStar(require("./simulation-payload.js"), exports);
50
+ __exportStar(require("./payment-method-underlying-details.js"), exports);
51
+ __exportStar(require("./korean-market-underlying-details.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 });
@@ -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.7.3';
4
+ exports.SDK_VERSION = '2.8.0';
@@ -7,6 +7,7 @@ export class Discount {
7
7
  this.description = discount.description;
8
8
  this.enabledForCheckout = discount.enabled_for_checkout;
9
9
  this.code = discount.code ? discount.code : null;
10
+ this.mode = discount.mode;
10
11
  this.type = discount.type;
11
12
  this.amount = discount.amount;
12
13
  this.currencyCode = discount.currency_code ? discount.currency_code : null;
@@ -0,0 +1,7 @@
1
+ import { Collection } from '../../internal/base/index.js';
2
+ import { DiscountGroup } from './discount-group.js';
3
+ export class DiscountGroupCollection extends Collection {
4
+ fromJson(data) {
5
+ return new DiscountGroup(data);
6
+ }
7
+ }
@@ -0,0 +1,11 @@
1
+ import { ImportMeta } from '../index.js';
2
+ export class DiscountGroup {
3
+ constructor(discountGroupResponse) {
4
+ this.id = discountGroupResponse.id;
5
+ this.name = discountGroupResponse.name;
6
+ this.status = discountGroupResponse.status;
7
+ this.createdAt = discountGroupResponse.created_at;
8
+ this.updatedAt = discountGroupResponse.updated_at;
9
+ this.importMeta = discountGroupResponse.import_meta ? new ImportMeta(discountGroupResponse.import_meta) : null;
10
+ }
11
+ }
@@ -0,0 +1,2 @@
1
+ export * from './discount-group.js';
2
+ export * from './discount-group-collection.js';
@@ -9,6 +9,7 @@ export * from './business/index.js';
9
9
  export * from './subscription/index.js';
10
10
  export * from './address/index.js';
11
11
  export * from './discount/index.js';
12
+ export * from './discount-group/index.js';
12
13
  export * from './events/index.js';
13
14
  export * from './payment-method/index.js';
14
15
  export * from './payout/index.js';
@@ -1,4 +1,4 @@
1
- import { PaymentCard, PayPal } from '../shared/index.js';
1
+ import { PaymentCard, PaymentMethodUnderlyingDetails, PayPal } from '../shared/index.js';
2
2
  export class PaymentMethod {
3
3
  constructor(paymentMethodResponse) {
4
4
  this.id = paymentMethodResponse.id;
@@ -7,6 +7,9 @@ export class PaymentMethod {
7
7
  this.type = paymentMethodResponse.type;
8
8
  this.card = paymentMethodResponse.card ? new PaymentCard(paymentMethodResponse.card) : null;
9
9
  this.paypal = paymentMethodResponse.paypal ? new PayPal(paymentMethodResponse.paypal) : null;
10
+ this.underlyingDetails = paymentMethodResponse.underlying_details
11
+ ? new PaymentMethodUnderlyingDetails(paymentMethodResponse.underlying_details)
12
+ : null;
10
13
  this.origin = paymentMethodResponse.origin;
11
14
  this.savedAt = paymentMethodResponse.saved_at;
12
15
  this.updatedAt = paymentMethodResponse.updated_at;
@@ -21,3 +21,5 @@ export * from './payout-totals-adjustment.js';
21
21
  export * from './import-meta.js';
22
22
  export * from './simulation-event-request.js';
23
23
  export * from './simulation-event-response.js';
24
+ export * from './payment-method-underlying-details.js';
25
+ export * from './korean-market-underlying-details.js';
@@ -0,0 +1,5 @@
1
+ export class KoreanMarketUnderlyingDetails {
2
+ constructor(koreanMarketUnderlyingDetails) {
3
+ this.type = koreanMarketUnderlyingDetails.type;
4
+ }
5
+ }
@@ -1,7 +1,11 @@
1
1
  import { PaymentCard } from './payment-card.js';
2
+ import { PaymentMethodUnderlyingDetails } from './payment-method-underlying-details.js';
2
3
  export class PaymentMethodDetails {
3
4
  constructor(paymentMethodDetails) {
4
5
  this.type = paymentMethodDetails.type;
5
6
  this.card = paymentMethodDetails.card ? new PaymentCard(paymentMethodDetails.card) : null;
7
+ this.underlyingDetails = paymentMethodDetails.underlying_details
8
+ ? new PaymentMethodUnderlyingDetails(paymentMethodDetails.underlying_details)
9
+ : null;
6
10
  }
7
11
  }
@@ -0,0 +1,8 @@
1
+ import { KoreanMarketUnderlyingDetails } from './korean-market-underlying-details.js';
2
+ export class PaymentMethodUnderlyingDetails {
3
+ constructor(paymentMethodUnderlyingDetails) {
4
+ this.koreaLocal = paymentMethodUnderlyingDetails.korea_local
5
+ ? new KoreanMarketUnderlyingDetails(paymentMethodUnderlyingDetails.korea_local)
6
+ : null;
7
+ }
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './api-key-status.js';
2
+ export * from './api-key-permission.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,3 @@
1
1
  export * from './discount-status.js';
2
2
  export * from './discount-type.js';
3
+ export * from './discount-mode.js';
@@ -12,3 +12,4 @@ export * from './simulation-type/index.js';
12
12
  export * from './simulation/index.js';
13
13
  export * from './simulation-run/index.js';
14
14
  export * from './simulation-run-event/index.js';
15
+ export * from './api-key/index.js';
@@ -14,3 +14,4 @@ export * from './payment-type.js';
14
14
  export * from './catalog-type.js';
15
15
  export * from './available-payment-methods.js';
16
16
  export * from './disposition.js';
17
+ export * from './korean-market-underlying-payment-method-type.js';
@@ -0,0 +1,15 @@
1
+ export class ApiKeyNotification {
2
+ constructor(apiKey) {
3
+ var _a, _b, _c;
4
+ this.id = apiKey.id;
5
+ this.name = apiKey.name;
6
+ this.description = (_a = apiKey.description) !== null && _a !== void 0 ? _a : null;
7
+ this.key = apiKey.key;
8
+ this.status = apiKey.status;
9
+ this.permissions = apiKey.permissions;
10
+ this.expiresAt = (_b = apiKey.expires_at) !== null && _b !== void 0 ? _b : null;
11
+ this.lastUsedAt = (_c = apiKey.last_used_at) !== null && _c !== void 0 ? _c : null;
12
+ this.createdAt = apiKey.created_at;
13
+ this.updatedAt = apiKey.updated_at;
14
+ }
15
+ }
@@ -0,0 +1 @@
1
+ export * from './api-key-notification.js';
@@ -7,6 +7,7 @@ export class DiscountNotification {
7
7
  this.description = discount.description;
8
8
  this.enabledForCheckout = discount.enabled_for_checkout;
9
9
  this.code = discount.code ? discount.code : null;
10
+ this.mode = discount.mode ? discount.mode : null;
10
11
  this.type = discount.type;
11
12
  this.amount = discount.amount;
12
13
  this.currencyCode = discount.currency_code ? discount.currency_code : null;
@@ -0,0 +1,13 @@
1
+ import { ImportMetaNotification } from '../shared/index.js';
2
+ export class DiscountGroupNotification {
3
+ constructor(discountGroupResponse) {
4
+ this.id = discountGroupResponse.id;
5
+ this.name = discountGroupResponse.name;
6
+ this.status = discountGroupResponse.status;
7
+ this.createdAt = discountGroupResponse.created_at;
8
+ this.updatedAt = discountGroupResponse.updated_at;
9
+ this.importMeta = discountGroupResponse.import_meta
10
+ ? new ImportMetaNotification(discountGroupResponse.import_meta)
11
+ : null;
12
+ }
13
+ }
@@ -0,0 +1 @@
1
+ export * from './discount-group-notification.js';
@@ -7,7 +7,9 @@ export * from './business/index.js';
7
7
  export * from './subscription/index.js';
8
8
  export * from './address/index.js';
9
9
  export * from './discount/index.js';
10
+ export * from './discount-group/index.js';
10
11
  export * from './payment-method/index.js';
11
12
  export * from './payout/index.js';
12
13
  export * from './report/index.js';
13
14
  export * from './shared/index.js';
15
+ export * from './api-key/index.js';
@@ -18,3 +18,5 @@ export * from './transaction-checkout-notification.js';
18
18
  export * from './total-adjustments-notification.js';
19
19
  export * from './payout-totals-adjustment-notification.js';
20
20
  export * from './import-meta-notification.js';
21
+ export * from './korean-market-underlying-details-notification.js';
22
+ export * from './payment-method-underlying-details-notification.js';
@@ -0,0 +1,5 @@
1
+ export class KoreanMarketUnderlyingDetailsNotification {
2
+ constructor(koreanMarketUnderlyingDetails) {
3
+ this.type = koreanMarketUnderlyingDetails.type;
4
+ }
5
+ }
@@ -1,7 +1,11 @@
1
1
  import { PaymentCardNotification } from './payment-card-notification.js';
2
+ import { PaymentMethodUnderlyingDetailsNotification } from './payment-method-underlying-details-notification.js';
2
3
  export class PaymentMethodDetailsNotification {
3
4
  constructor(paymentMethodDetails) {
4
5
  this.type = paymentMethodDetails.type;
5
6
  this.card = paymentMethodDetails.card ? new PaymentCardNotification(paymentMethodDetails.card) : null;
7
+ this.underlyingDetails = paymentMethodDetails.underlying_details
8
+ ? new PaymentMethodUnderlyingDetailsNotification(paymentMethodDetails.underlying_details)
9
+ : null;
6
10
  }
7
11
  }
@@ -0,0 +1,8 @@
1
+ import { KoreanMarketUnderlyingDetailsNotification } from './korean-market-underlying-details-notification.js';
2
+ export class PaymentMethodUnderlyingDetailsNotification {
3
+ constructor(paymentMethodUnderlyingDetails) {
4
+ this.koreaLocal = paymentMethodUnderlyingDetails.korea_local
5
+ ? new KoreanMarketUnderlyingDetailsNotification(paymentMethodUnderlyingDetails.korea_local)
6
+ : null;
7
+ }
8
+ }
@@ -0,0 +1,10 @@
1
+ import { Event } from '../../../entities/events/event.js';
2
+ import { EventName } from '../../helpers/index.js';
3
+ import { ApiKeyNotification } from '../../entities/index.js';
4
+ export class ApiKeyCreatedEvent extends Event {
5
+ constructor(response) {
6
+ super(response);
7
+ this.eventType = EventName.ApiKeyCreated;
8
+ this.data = new ApiKeyNotification(response.data);
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ import { Event } from '../../../entities/events/event.js';
2
+ import { EventName } from '../../helpers/index.js';
3
+ import { ApiKeyNotification } from '../../entities/index.js';
4
+ export class ApiKeyExpiredEvent extends Event {
5
+ constructor(response) {
6
+ super(response);
7
+ this.eventType = EventName.ApiKeyExpired;
8
+ this.data = new ApiKeyNotification(response.data);
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ import { Event } from '../../../entities/events/event.js';
2
+ import { EventName } from '../../helpers/index.js';
3
+ import { ApiKeyNotification } from '../../entities/index.js';
4
+ export class ApiKeyExpiringEvent extends Event {
5
+ constructor(response) {
6
+ super(response);
7
+ this.eventType = EventName.ApiKeyExpiring;
8
+ this.data = new ApiKeyNotification(response.data);
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ import { Event } from '../../../entities/events/event.js';
2
+ import { EventName } from '../../helpers/index.js';
3
+ import { ApiKeyNotification } from '../../entities/index.js';
4
+ export class ApiKeyRevokedEvent extends Event {
5
+ constructor(response) {
6
+ super(response);
7
+ this.eventType = EventName.ApiKeyRevoked;
8
+ this.data = new ApiKeyNotification(response.data);
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ import { Event } from '../../../entities/events/event.js';
2
+ import { EventName } from '../../helpers/index.js';
3
+ import { ApiKeyNotification } from '../../entities/index.js';
4
+ export class ApiKeyUpdatedEvent extends Event {
5
+ constructor(response) {
6
+ super(response);
7
+ this.eventType = EventName.ApiKeyUpdated;
8
+ this.data = new ApiKeyNotification(response.data);
9
+ }
10
+ }
@@ -0,0 +1,5 @@
1
+ export * from './api-key-created-event.js';
2
+ export * from './api-key-expired-event.js';
3
+ export * from './api-key-expiring-event.js';
4
+ export * from './api-key-revoked-event.js';
5
+ export * from './api-key-updated-event.js';
@@ -0,0 +1,10 @@
1
+ import { Event } from '../../../entities/events/event.js';
2
+ import { EventName } from '../../helpers/index.js';
3
+ import { DiscountGroupNotification } from '../../entities/index.js';
4
+ export class DiscountGroupCreatedEvent extends Event {
5
+ constructor(response) {
6
+ super(response);
7
+ this.eventType = EventName.DiscountGroupCreated;
8
+ this.data = new DiscountGroupNotification(response.data);
9
+ }
10
+ }
@@ -0,0 +1 @@
1
+ export * from './discount-group-created-event.js';
@@ -3,6 +3,7 @@ export * from './adjustment/index.js';
3
3
  export * from './business/index.js';
4
4
  export * from './customer/index.js';
5
5
  export * from './discount/index.js';
6
+ export * from './discount-group/index.js';
6
7
  export * from './generic/index.js';
7
8
  export * from './payment-method/index.js';
8
9
  export * from './payout/index.js';
@@ -11,3 +12,4 @@ export * from './product/index.js';
11
12
  export * from './subscription/index.js';
12
13
  export * from './transaction/index.js';
13
14
  export * from './report/index.js';
15
+ export * from './api-key/index.js';
@@ -5,6 +5,11 @@ export var EventName;
5
5
  EventName["AddressImported"] = "address.imported";
6
6
  EventName["AdjustmentCreated"] = "adjustment.created";
7
7
  EventName["AdjustmentUpdated"] = "adjustment.updated";
8
+ EventName["ApiKeyCreated"] = "api_key.created";
9
+ EventName["ApiKeyUpdated"] = "api_key.updated";
10
+ EventName["ApiKeyExpiring"] = "api_key.expiring";
11
+ EventName["ApiKeyExpired"] = "api_key.expired";
12
+ EventName["ApiKeyRevoked"] = "api_key.revoked";
8
13
  EventName["BusinessCreated"] = "business.created";
9
14
  EventName["BusinessImported"] = "business.imported";
10
15
  EventName["BusinessUpdated"] = "business.updated";
@@ -14,6 +19,7 @@ export var EventName;
14
19
  EventName["DiscountCreated"] = "discount.created";
15
20
  EventName["DiscountUpdated"] = "discount.updated";
16
21
  EventName["DiscountImported"] = "discount.imported";
22
+ EventName["DiscountGroupCreated"] = "discount_group.created";
17
23
  EventName["PaymentMethodDeleted"] = "payment_method.deleted";
18
24
  EventName["PaymentMethodSaved"] = "payment_method.saved";
19
25
  EventName["PayoutCreated"] = "payout.created";
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { WebhooksValidator } from './webhooks-validator.js';
11
11
  import { EventName } from './types.js';
12
- import { AddressCreatedEvent, AddressImportedEvent, AddressUpdatedEvent, AdjustmentCreatedEvent, AdjustmentUpdatedEvent, BusinessCreatedEvent, BusinessImportedEvent, BusinessUpdatedEvent, CustomerCreatedEvent, CustomerImportedEvent, CustomerUpdatedEvent, DiscountCreatedEvent, DiscountImportedEvent, DiscountUpdatedEvent, GenericEvent, PaymentMethodDeletedEvent, PaymentMethodSavedEvent, PayoutCreatedEvent, PayoutPaidEvent, PriceCreatedEvent, PriceImportedEvent, PriceUpdatedEvent, ProductCreatedEvent, ProductImportedEvent, ProductUpdatedEvent, ReportCreatedEvent, ReportUpdatedEvent, SubscriptionActivatedEvent, SubscriptionCanceledEvent, SubscriptionCreatedEvent, SubscriptionImportedEvent, SubscriptionPastDueEvent, SubscriptionPausedEvent, SubscriptionResumedEvent, SubscriptionTrialingEvent, SubscriptionUpdatedEvent, TransactionBilledEvent, TransactionCanceledEvent, TransactionCompletedEvent, TransactionCreatedEvent, TransactionPaidEvent, TransactionPastDueEvent, TransactionPaymentFailedEvent, TransactionReadyEvent, TransactionUpdatedEvent, TransactionRevisedEvent, } from '../events/index.js';
12
+ import { AddressCreatedEvent, AddressImportedEvent, AddressUpdatedEvent, AdjustmentCreatedEvent, AdjustmentUpdatedEvent, ApiKeyCreatedEvent, ApiKeyExpiredEvent, ApiKeyExpiringEvent, ApiKeyRevokedEvent, ApiKeyUpdatedEvent, BusinessCreatedEvent, BusinessImportedEvent, BusinessUpdatedEvent, CustomerCreatedEvent, CustomerImportedEvent, CustomerUpdatedEvent, DiscountCreatedEvent, DiscountGroupCreatedEvent, DiscountImportedEvent, DiscountUpdatedEvent, GenericEvent, PaymentMethodDeletedEvent, PaymentMethodSavedEvent, PayoutCreatedEvent, PayoutPaidEvent, PriceCreatedEvent, PriceImportedEvent, PriceUpdatedEvent, ProductCreatedEvent, ProductImportedEvent, ProductUpdatedEvent, ReportCreatedEvent, ReportUpdatedEvent, SubscriptionActivatedEvent, SubscriptionCanceledEvent, SubscriptionCreatedEvent, SubscriptionImportedEvent, SubscriptionPastDueEvent, SubscriptionPausedEvent, SubscriptionResumedEvent, SubscriptionTrialingEvent, SubscriptionUpdatedEvent, TransactionBilledEvent, TransactionCanceledEvent, TransactionCompletedEvent, TransactionCreatedEvent, TransactionPaidEvent, TransactionPastDueEvent, TransactionPaymentFailedEvent, TransactionReadyEvent, TransactionRevisedEvent, TransactionUpdatedEvent, } from '../events/index.js';
13
13
  import { Logger } from '../../internal/base/logger.js';
14
14
  export class Webhooks {
15
15
  unmarshal(requestBody, secretKey, signature) {
@@ -41,6 +41,16 @@ export class Webhooks {
41
41
  return new AdjustmentCreatedEvent(data);
42
42
  case EventName.AdjustmentUpdated:
43
43
  return new AdjustmentUpdatedEvent(data);
44
+ case EventName.ApiKeyCreated:
45
+ return new ApiKeyCreatedEvent(data);
46
+ case EventName.ApiKeyExpired:
47
+ return new ApiKeyExpiredEvent(data);
48
+ case EventName.ApiKeyExpiring:
49
+ return new ApiKeyExpiringEvent(data);
50
+ case EventName.ApiKeyRevoked:
51
+ return new ApiKeyRevokedEvent(data);
52
+ case EventName.ApiKeyUpdated:
53
+ return new ApiKeyUpdatedEvent(data);
44
54
  case EventName.BusinessCreated:
45
55
  return new BusinessCreatedEvent(data);
46
56
  case EventName.BusinessUpdated:
@@ -59,6 +69,8 @@ export class Webhooks {
59
69
  return new DiscountImportedEvent(data);
60
70
  case EventName.DiscountUpdated:
61
71
  return new DiscountUpdatedEvent(data);
72
+ case EventName.DiscountGroupCreated:
73
+ return new DiscountGroupCreatedEvent(data);
62
74
  case EventName.PaymentMethodDeleted:
63
75
  return new PaymentMethodDeletedEvent(data);
64
76
  case EventName.PaymentMethodSaved:
@@ -0,0 +1 @@
1
+ export * from './api-key-notification-response.js';
@@ -0,0 +1 @@
1
+ export * from './discount-group-notification-response.js';
@@ -7,7 +7,9 @@ export * from './business/index.js';
7
7
  export * from './subscription/index.js';
8
8
  export * from './address/index.js';
9
9
  export * from './discount/index.js';
10
+ export * from './discount-group/index.js';
10
11
  export * from './payment-method/index.js';
11
12
  export * from './payout/index.js';
12
13
  export * from './report/index.js';
13
14
  export * from './shared/index.js';
15
+ export * from './api-key/index.js';
@@ -20,3 +20,5 @@ export * from './transaction-checkout-notification.js';
20
20
  export * from './total-adjustments-notification-response.js';
21
21
  export * from './payout-totals-adjustment-notification-response.js';
22
22
  export * from './import-meta-notification-response.js';
23
+ export * from './korean-market-underlying-details-notification.js';
24
+ export * from './payment-method-underlying-details-notification.js';
@@ -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, CustomerPortalSessionsResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PaymentMethodsResource, PricesResource, PricingPreviewResource, ProductsResource, ReportsResource, SimulationTypesResource, SimulationsResource, SimulationRunsResource, SimulationRunEventsResource, SubscriptionsResource, TransactionsResource, } from './resources/index.js';
3
+ import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomerPortalSessionsResource, CustomersResource, DiscountGroupsResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PaymentMethodsResource, PricesResource, PricingPreviewResource, ProductsResource, ReportsResource, SimulationRunEventsResource, SimulationRunsResource, SimulationsResource, SimulationTypesResource, 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 {
@@ -19,6 +19,7 @@ export class Paddle {
19
19
  this.addresses = new AddressesResource(this.client);
20
20
  this.businesses = new BusinessesResource(this.client);
21
21
  this.discounts = new DiscountsResource(this.client);
22
+ this.discountGroups = new DiscountGroupsResource(this.client);
22
23
  this.subscriptions = new SubscriptionsResource(this.client);
23
24
  this.paymentMethods = new PaymentMethodsResource(this.client);
24
25
  this.pricingPreview = new PricingPreviewResource(this.client);
@@ -0,0 +1,29 @@
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 { DiscountGroup, DiscountGroupCollection } from '../../entities/index.js';
11
+ import { BaseResource, QueryParameters } from '../../internal/base/index.js';
12
+ const DiscountGroupPaths = {
13
+ list: '/discount-groups',
14
+ create: '/discount-groups',
15
+ };
16
+ export * from './operations/index.js';
17
+ export class DiscountGroupsResource extends BaseResource {
18
+ list(queryParams) {
19
+ const queryParameters = new QueryParameters(queryParams);
20
+ return new DiscountGroupCollection(this.client, DiscountGroupPaths.list + queryParameters.toQueryString());
21
+ }
22
+ create(createDiscountGroupRequestBody) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const response = yield this.client.post(DiscountGroupPaths.create, createDiscountGroupRequestBody);
25
+ const data = this.handleResponse(response);
26
+ return new DiscountGroup(data);
27
+ });
28
+ }
29
+ }