@paddle/paddle-node-sdk 2.8.0 → 3.0.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 (514) hide show
  1. package/dist/cjs/entities/address/address.js +14 -0
  2. package/dist/cjs/entities/adjustment/adjustment-credit-note-pdf.js +1 -0
  3. package/dist/cjs/entities/adjustment/adjustment-item-totals.js +3 -0
  4. package/dist/cjs/entities/adjustment/adjustment-item.js +6 -0
  5. package/dist/cjs/entities/adjustment/adjustment-proration.js +2 -0
  6. package/dist/cjs/entities/adjustment/adjustment-time-period.js +2 -0
  7. package/dist/cjs/entities/adjustment/adjustment.js +15 -0
  8. package/dist/cjs/entities/business/business.js +11 -0
  9. package/dist/cjs/entities/business/contacts.js +2 -0
  10. package/dist/cjs/entities/customer/auth-token.js +2 -0
  11. package/dist/cjs/entities/customer/credit-balance.js +3 -0
  12. package/dist/cjs/entities/customer/customer-balance.js +3 -0
  13. package/dist/cjs/entities/customer/customer.js +10 -0
  14. package/dist/cjs/entities/customer-portal-session/customer-portal-session.js +4 -0
  15. package/dist/cjs/entities/customer-portal-session/customer-portal-subscription-url.js +3 -0
  16. package/dist/cjs/entities/customer-portal-session/general.js +1 -0
  17. package/dist/cjs/entities/customer-portal-session/urls.js +3 -2
  18. package/dist/cjs/entities/discount/discount.js +20 -2
  19. package/dist/cjs/entities/discount-group/discount-group.js +6 -0
  20. package/dist/cjs/entities/event-types/event-type.js +4 -0
  21. package/dist/cjs/entities/events/event.js +6 -2
  22. package/dist/cjs/entities/notification-settings/notification-settings.js +10 -0
  23. package/dist/cjs/entities/notifications/notification-log.js +6 -2
  24. package/dist/cjs/entities/notifications/notification.js +16 -5
  25. package/dist/cjs/entities/notifications/replay-notification.js +1 -0
  26. package/dist/cjs/entities/payment-method/payment-method.js +10 -0
  27. package/dist/cjs/entities/payout/payout.js +4 -0
  28. package/dist/cjs/entities/price/price-quantity.js +2 -0
  29. package/dist/cjs/entities/price/price.js +18 -2
  30. package/dist/cjs/entities/pricing-preview/pricing-preview-details.js +1 -0
  31. package/dist/cjs/entities/pricing-preview/pricing-preview-discounts.js +3 -0
  32. package/dist/cjs/entities/pricing-preview/pricing-preview-line-item.js +9 -0
  33. package/dist/cjs/entities/pricing-preview/pricing-preview.js +15 -7
  34. package/dist/cjs/entities/product/product.js +13 -2
  35. package/dist/cjs/entities/report/report-csv.js +1 -0
  36. package/dist/cjs/entities/report/report-filters.js +4 -2
  37. package/dist/cjs/entities/report/report.js +10 -4
  38. package/dist/cjs/entities/shared/adjustment-original-amount.js +2 -0
  39. package/dist/cjs/entities/shared/billing-details.js +5 -2
  40. package/dist/cjs/entities/shared/chargeback-fee.js +2 -0
  41. package/dist/cjs/entities/shared/import-meta.js +2 -0
  42. package/dist/cjs/entities/shared/korean-market-underlying-details.js +1 -0
  43. package/dist/cjs/entities/shared/money.js +2 -0
  44. package/dist/cjs/entities/shared/payment-card.js +5 -0
  45. package/dist/cjs/entities/shared/payment-method-details.js +3 -0
  46. package/dist/cjs/entities/shared/payment-method-underlying-details.js +1 -0
  47. package/dist/cjs/entities/shared/payout-totals-adjustment.js +7 -0
  48. package/dist/cjs/entities/shared/paypal.js +2 -0
  49. package/dist/cjs/entities/shared/simulation-event-request.js +1 -0
  50. package/dist/cjs/entities/shared/simulation-event-response.js +2 -0
  51. package/dist/cjs/entities/shared/tax-rates-used.js +2 -0
  52. package/dist/cjs/entities/shared/time-period.js +2 -0
  53. package/dist/cjs/entities/shared/total-adjustments.js +6 -0
  54. package/dist/cjs/entities/shared/totals.js +4 -0
  55. package/dist/cjs/entities/shared/transaction-checkout.js +1 -0
  56. package/dist/cjs/entities/shared/transaction-payment-attempt.js +10 -2
  57. package/dist/cjs/entities/shared/transaction-payout-totals-adjusted.js +7 -0
  58. package/dist/cjs/entities/shared/transaction-payout-totals.js +11 -0
  59. package/dist/cjs/entities/shared/transaction-totals-adjusted.js +7 -0
  60. package/dist/cjs/entities/shared/transaction-totals.js +11 -0
  61. package/dist/cjs/entities/shared/unit-price-override.js +2 -0
  62. package/dist/cjs/entities/shared/unit-totals.js +4 -0
  63. package/dist/cjs/entities/simulation/simulation-scenario-config/simulation-scenario-config.js +5 -0
  64. package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-cancellation-details.js +2 -0
  65. package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-cancellation-entities.js +2 -2
  66. package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-cancellation-options.js +4 -3
  67. package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-creation-details.js +2 -0
  68. package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-creation-entities.js +14 -8
  69. package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-creation-item.js +2 -0
  70. package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-creation-options.js +6 -4
  71. package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-pause-details.js +2 -0
  72. package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-pause-entities.js +2 -2
  73. package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-pause-options.js +4 -3
  74. package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-renewal-details.js +2 -0
  75. package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-renewal-entities.js +2 -2
  76. package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-renewal-options.js +4 -3
  77. package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-resume-details.js +2 -0
  78. package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-resume-entities.js +2 -2
  79. package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-resume-options.js +4 -3
  80. package/dist/cjs/entities/simulation/simulation.js +12 -3
  81. package/dist/cjs/entities/simulation-run/simulation-run.js +7 -2
  82. package/dist/cjs/entities/simulation-run-event/simulation-run-event.js +8 -0
  83. package/dist/cjs/entities/simulation-types/simulation-type.js +6 -0
  84. package/dist/cjs/entities/subscription/next-transaction-adjustment-item.js +5 -0
  85. package/dist/cjs/entities/subscription/next-transaction-adjustment-preview.js +3 -0
  86. package/dist/cjs/entities/subscription/next-transaction.js +3 -0
  87. package/dist/cjs/entities/subscription/subscription-discount.js +5 -3
  88. package/dist/cjs/entities/subscription/subscription-item.js +10 -0
  89. package/dist/cjs/entities/subscription/subscription-management.js +2 -0
  90. package/dist/cjs/entities/subscription/subscription-preview-summary-result.js +3 -0
  91. package/dist/cjs/entities/subscription/subscription-preview-update-summary.js +3 -0
  92. package/dist/cjs/entities/subscription/subscription-preview.js +26 -0
  93. package/dist/cjs/entities/subscription/subscription-scheduled-change.js +3 -0
  94. package/dist/cjs/entities/subscription/subscription-time-period.js +2 -0
  95. package/dist/cjs/entities/subscription/subscription.js +25 -0
  96. package/dist/cjs/entities/subscription/transaction-details-preview.js +3 -0
  97. package/dist/cjs/entities/subscription/transaction-line-item-preview.js +7 -0
  98. package/dist/cjs/entities/transaction/address-preview.js +2 -0
  99. package/dist/cjs/entities/transaction/adjustment-totals-breakdown.js +3 -0
  100. package/dist/cjs/entities/transaction/adjustment-totals.js +7 -0
  101. package/dist/cjs/entities/transaction/proration.js +2 -0
  102. package/dist/cjs/entities/transaction/transaction-adjustment-item.js +6 -0
  103. package/dist/cjs/entities/transaction/transaction-adjustment.js +14 -0
  104. package/dist/cjs/entities/transaction/transaction-details.js +6 -0
  105. package/dist/cjs/entities/transaction/transaction-invoice-pdf.js +1 -0
  106. package/dist/cjs/entities/transaction/transaction-item-preview.js +5 -2
  107. package/dist/cjs/entities/transaction/transaction-item.js +3 -0
  108. package/dist/cjs/entities/transaction/transaction-line-item.js +8 -0
  109. package/dist/cjs/entities/transaction/transaction-preview.js +12 -2
  110. package/dist/cjs/entities/transaction/transaction-proration.js +2 -0
  111. package/dist/cjs/entities/transaction/transaction.js +31 -2
  112. package/dist/cjs/entities/transaction/transactions-time-period.js +2 -0
  113. package/dist/cjs/internal/api/case-helpers.js +2 -13
  114. package/dist/cjs/internal/api/client.js +54 -64
  115. package/dist/cjs/internal/base/base-resource.js +1 -0
  116. package/dist/cjs/internal/base/collection.js +20 -45
  117. package/dist/cjs/internal/base/logger.js +1 -0
  118. package/dist/cjs/internal/base/path-parameters.js +2 -0
  119. package/dist/cjs/internal/base/query-parameters.js +1 -0
  120. package/dist/cjs/internal/errors/generic.js +5 -0
  121. package/dist/cjs/internal/providers/crypto/crypto-provider.js +2 -13
  122. package/dist/cjs/internal/providers/crypto/edge-crypto.js +14 -25
  123. package/dist/cjs/internal/providers/crypto/node-crypto.js +5 -16
  124. package/dist/cjs/internal/providers/runtime-provider.js +1 -0
  125. package/dist/cjs/notifications/entities/address/address-notification.js +15 -2
  126. package/dist/cjs/notifications/entities/adjustment/adjustment-item-notification.js +6 -0
  127. package/dist/cjs/notifications/entities/adjustment/adjustment-item-totals-notification.js +3 -0
  128. package/dist/cjs/notifications/entities/adjustment/adjustment-notification.js +15 -0
  129. package/dist/cjs/notifications/entities/adjustment/adjustment-proration-notification.js +2 -0
  130. package/dist/cjs/notifications/entities/adjustment/adjustment-time-period-notification.js +2 -0
  131. package/dist/cjs/notifications/entities/api-key/api-key-notification.js +13 -4
  132. package/dist/cjs/notifications/entities/business/business-notification.js +12 -2
  133. package/dist/cjs/notifications/entities/business/contacts-notification.js +2 -0
  134. package/dist/cjs/notifications/entities/customer/customer-notification.js +10 -0
  135. package/dist/cjs/notifications/entities/discount/discount-notification.js +20 -2
  136. package/dist/cjs/notifications/entities/discount-group/discount-group-notification.js +6 -0
  137. package/dist/cjs/notifications/entities/payment-method/payment-method-deleted-notification.js +8 -0
  138. package/dist/cjs/notifications/entities/payment-method/payment-method-notification.js +7 -0
  139. package/dist/cjs/notifications/entities/payout/payout-notification.js +4 -0
  140. package/dist/cjs/notifications/entities/price/price-notification.js +19 -4
  141. package/dist/cjs/notifications/entities/price/price-quantity-notification.js +2 -0
  142. package/dist/cjs/notifications/entities/product/product-notification.js +13 -3
  143. package/dist/cjs/notifications/entities/report/report-filters-notification.js +4 -2
  144. package/dist/cjs/notifications/entities/report/report-notification.js +10 -4
  145. package/dist/cjs/notifications/entities/shared/adjustment-original-amount-notification.js +2 -0
  146. package/dist/cjs/notifications/entities/shared/billing-details-notification.js +5 -2
  147. package/dist/cjs/notifications/entities/shared/chargeback-fee-notification.js +2 -0
  148. package/dist/cjs/notifications/entities/shared/import-meta-notification.js +2 -0
  149. package/dist/cjs/notifications/entities/shared/korean-market-underlying-details-notification.js +1 -0
  150. package/dist/cjs/notifications/entities/shared/money-notification.js +2 -0
  151. package/dist/cjs/notifications/entities/shared/payment-card-notification.js +5 -0
  152. package/dist/cjs/notifications/entities/shared/payment-method-details-notification.js +3 -0
  153. package/dist/cjs/notifications/entities/shared/payment-method-underlying-details-notification.js +1 -0
  154. package/dist/cjs/notifications/entities/shared/payout-totals-adjustment-notification.js +7 -0
  155. package/dist/cjs/notifications/entities/shared/tax-rates-used-notification.js +2 -0
  156. package/dist/cjs/notifications/entities/shared/time-period-notification.js +2 -0
  157. package/dist/cjs/notifications/entities/shared/total-adjustments-notification.js +6 -0
  158. package/dist/cjs/notifications/entities/shared/totals-notification.js +4 -0
  159. package/dist/cjs/notifications/entities/shared/transaction-checkout-notification.js +1 -0
  160. package/dist/cjs/notifications/entities/shared/transaction-payment-attempt-notification.js +10 -2
  161. package/dist/cjs/notifications/entities/shared/transaction-payout-totals-adjusted-notification.js +7 -0
  162. package/dist/cjs/notifications/entities/shared/transaction-payout-totals-notification.js +13 -0
  163. package/dist/cjs/notifications/entities/shared/transaction-totals-adjusted-notification.js +7 -0
  164. package/dist/cjs/notifications/entities/shared/transaction-totals-notification.js +11 -0
  165. package/dist/cjs/notifications/entities/shared/unit-price-override-notification.js +2 -0
  166. package/dist/cjs/notifications/entities/shared/unit-totals-notification.js +4 -0
  167. package/dist/cjs/notifications/entities/subscription/subscription-created-notification.js +23 -0
  168. package/dist/cjs/notifications/entities/subscription/subscription-discount-notification.js +4 -2
  169. package/dist/cjs/notifications/entities/subscription/subscription-item-notification.js +10 -0
  170. package/dist/cjs/notifications/entities/subscription/subscription-notification.js +22 -0
  171. package/dist/cjs/notifications/entities/subscription/subscription-price-notification.js +16 -3
  172. package/dist/cjs/notifications/entities/subscription/subscription-scheduled-change-notification.js +3 -0
  173. package/dist/cjs/notifications/entities/subscription/subscription-time-period-notification.js +2 -0
  174. package/dist/cjs/notifications/entities/transaction/transaction-details-notification.js +6 -0
  175. package/dist/cjs/notifications/entities/transaction/transaction-item-notification.js +3 -0
  176. package/dist/cjs/notifications/entities/transaction/transaction-line-item-notification.js +8 -0
  177. package/dist/cjs/notifications/entities/transaction/transaction-notification.js +23 -0
  178. package/dist/cjs/notifications/entities/transaction/transaction-proration-notification.js +2 -0
  179. package/dist/cjs/notifications/entities/transaction/transactions-time-period-notification.js +2 -0
  180. package/dist/cjs/notifications/events/address/address-created-event.js +2 -1
  181. package/dist/cjs/notifications/events/address/address-imported-event.js +2 -1
  182. package/dist/cjs/notifications/events/address/address-updated-event.js +2 -1
  183. package/dist/cjs/notifications/events/adjustment/adjustment-created-event.js +2 -1
  184. package/dist/cjs/notifications/events/adjustment/adjustment-updated-event.js +2 -1
  185. package/dist/cjs/notifications/events/api-key/api-key-created-event.js +2 -1
  186. package/dist/cjs/notifications/events/api-key/api-key-expired-event.js +2 -1
  187. package/dist/cjs/notifications/events/api-key/api-key-expiring-event.js +2 -1
  188. package/dist/cjs/notifications/events/api-key/api-key-revoked-event.js +2 -1
  189. package/dist/cjs/notifications/events/api-key/api-key-updated-event.js +2 -1
  190. package/dist/cjs/notifications/events/business/business-created-event.js +2 -1
  191. package/dist/cjs/notifications/events/business/business-imported-event.js +2 -1
  192. package/dist/cjs/notifications/events/business/business-updated-event.js +2 -1
  193. package/dist/cjs/notifications/events/customer/customer-created-event.js +2 -1
  194. package/dist/cjs/notifications/events/customer/customer-imported-event.js +2 -1
  195. package/dist/cjs/notifications/events/customer/customer-updated-event.js +2 -1
  196. package/dist/cjs/notifications/events/discount/discount-created-event.js +2 -1
  197. package/dist/cjs/notifications/events/discount/discount-imported-event.js +2 -1
  198. package/dist/cjs/notifications/events/discount/discount-updated-event.js +2 -1
  199. package/dist/cjs/notifications/events/discount-group/discount-group-created-event.js +2 -1
  200. package/dist/cjs/notifications/events/generic/generic-event.js +1 -0
  201. package/dist/cjs/notifications/events/payment-method/payment-method-deleted-event.js +2 -1
  202. package/dist/cjs/notifications/events/payment-method/payment-method-saved-event.js +2 -1
  203. package/dist/cjs/notifications/events/payout/payout-created-event.js +2 -1
  204. package/dist/cjs/notifications/events/payout/payout-paid-event.js +2 -1
  205. package/dist/cjs/notifications/events/price/price-created-event.js +2 -1
  206. package/dist/cjs/notifications/events/price/price-imported-event.js +2 -1
  207. package/dist/cjs/notifications/events/price/price-updated-event.js +2 -1
  208. package/dist/cjs/notifications/events/product/product-created-event.js +2 -1
  209. package/dist/cjs/notifications/events/product/product-imported-event.js +2 -1
  210. package/dist/cjs/notifications/events/product/product-updated-event.js +2 -1
  211. package/dist/cjs/notifications/events/report/report-created-event.js +2 -1
  212. package/dist/cjs/notifications/events/report/report-updated-event.js +2 -1
  213. package/dist/cjs/notifications/events/subscription/subscription-activated-event.js +2 -1
  214. package/dist/cjs/notifications/events/subscription/subscription-canceled-event.js +2 -1
  215. package/dist/cjs/notifications/events/subscription/subscription-created-event.js +2 -1
  216. package/dist/cjs/notifications/events/subscription/subscription-imported-event.js +2 -1
  217. package/dist/cjs/notifications/events/subscription/subscription-past-due-event.js +2 -1
  218. package/dist/cjs/notifications/events/subscription/subscription-paused-event.js +2 -1
  219. package/dist/cjs/notifications/events/subscription/subscription-resumed-event.js +2 -1
  220. package/dist/cjs/notifications/events/subscription/subscription-trialing-event.js +2 -1
  221. package/dist/cjs/notifications/events/subscription/subscription-updated-event.js +2 -1
  222. package/dist/cjs/notifications/events/transaction/transaction-billed-event.js +2 -1
  223. package/dist/cjs/notifications/events/transaction/transaction-canceled-event.js +2 -1
  224. package/dist/cjs/notifications/events/transaction/transaction-completed-event.js +2 -1
  225. package/dist/cjs/notifications/events/transaction/transaction-created-event.js +2 -1
  226. package/dist/cjs/notifications/events/transaction/transaction-paid-event.js +2 -1
  227. package/dist/cjs/notifications/events/transaction/transaction-past-due-event.js +2 -1
  228. package/dist/cjs/notifications/events/transaction/transaction-payment-failed-event.js +2 -1
  229. package/dist/cjs/notifications/events/transaction/transaction-ready-event.js +2 -1
  230. package/dist/cjs/notifications/events/transaction/transaction-revised-event.js +2 -1
  231. package/dist/cjs/notifications/events/transaction/transaction-updated-event.js +2 -1
  232. package/dist/cjs/notifications/helpers/webhooks-validator.js +14 -26
  233. package/dist/cjs/notifications/helpers/webhooks.js +11 -24
  234. package/dist/cjs/paddle.js +29 -5
  235. package/dist/cjs/resources/addresses/index.js +25 -42
  236. package/dist/cjs/resources/adjustments/index.js +12 -25
  237. package/dist/cjs/resources/businesses/index.js +25 -42
  238. package/dist/cjs/resources/customer-portal-sessions/index.js +8 -19
  239. package/dist/cjs/resources/customers/index.js +35 -56
  240. package/dist/cjs/resources/discount-groups/index.js +4 -15
  241. package/dist/cjs/resources/discounts/index.js +20 -37
  242. package/dist/cjs/resources/event-types/index.js +4 -15
  243. package/dist/cjs/resources/notification-settings/index.js +31 -50
  244. package/dist/cjs/resources/notifications/index.js +14 -27
  245. package/dist/cjs/resources/payment-methods/index.js +17 -30
  246. package/dist/cjs/resources/prices/index.js +21 -38
  247. package/dist/cjs/resources/pricing-preview/index.js +4 -15
  248. package/dist/cjs/resources/products/index.js +21 -38
  249. package/dist/cjs/resources/reports/index.js +18 -33
  250. package/dist/cjs/resources/simulation-run-events/index.js +18 -31
  251. package/dist/cjs/resources/simulation-runs/index.js +16 -29
  252. package/dist/cjs/resources/simulation-types/index.js +4 -15
  253. package/dist/cjs/resources/simulations/index.js +18 -33
  254. package/dist/cjs/resources/subscriptions/index.js +71 -100
  255. package/dist/cjs/resources/transactions/index.js +40 -61
  256. package/dist/cjs/version.js +1 -1
  257. package/dist/esm/entities/address/address.js +14 -0
  258. package/dist/esm/entities/adjustment/adjustment-credit-note-pdf.js +1 -0
  259. package/dist/esm/entities/adjustment/adjustment-item-totals.js +3 -0
  260. package/dist/esm/entities/adjustment/adjustment-item.js +6 -0
  261. package/dist/esm/entities/adjustment/adjustment-proration.js +2 -0
  262. package/dist/esm/entities/adjustment/adjustment-time-period.js +2 -0
  263. package/dist/esm/entities/adjustment/adjustment.js +15 -0
  264. package/dist/esm/entities/business/business.js +11 -0
  265. package/dist/esm/entities/business/contacts.js +2 -0
  266. package/dist/esm/entities/customer/auth-token.js +2 -0
  267. package/dist/esm/entities/customer/credit-balance.js +3 -0
  268. package/dist/esm/entities/customer/customer-balance.js +3 -0
  269. package/dist/esm/entities/customer/customer.js +10 -0
  270. package/dist/esm/entities/customer-portal-session/customer-portal-session.js +4 -0
  271. package/dist/esm/entities/customer-portal-session/customer-portal-subscription-url.js +3 -0
  272. package/dist/esm/entities/customer-portal-session/general.js +1 -0
  273. package/dist/esm/entities/customer-portal-session/urls.js +3 -2
  274. package/dist/esm/entities/discount/discount.js +20 -2
  275. package/dist/esm/entities/discount-group/discount-group.js +6 -0
  276. package/dist/esm/entities/event-types/event-type.js +4 -0
  277. package/dist/esm/entities/events/event.js +6 -2
  278. package/dist/esm/entities/notification-settings/notification-settings.js +10 -0
  279. package/dist/esm/entities/notifications/notification-log.js +6 -2
  280. package/dist/esm/entities/notifications/notification.js +16 -5
  281. package/dist/esm/entities/notifications/replay-notification.js +1 -0
  282. package/dist/esm/entities/payment-method/payment-method.js +10 -0
  283. package/dist/esm/entities/payout/payout.js +4 -0
  284. package/dist/esm/entities/price/price-quantity.js +2 -0
  285. package/dist/esm/entities/price/price.js +18 -2
  286. package/dist/esm/entities/pricing-preview/pricing-preview-details.js +1 -0
  287. package/dist/esm/entities/pricing-preview/pricing-preview-discounts.js +3 -0
  288. package/dist/esm/entities/pricing-preview/pricing-preview-line-item.js +9 -0
  289. package/dist/esm/entities/pricing-preview/pricing-preview.js +15 -7
  290. package/dist/esm/entities/product/product.js +13 -2
  291. package/dist/esm/entities/report/report-csv.js +1 -0
  292. package/dist/esm/entities/report/report-filters.js +4 -2
  293. package/dist/esm/entities/report/report.js +10 -4
  294. package/dist/esm/entities/shared/adjustment-original-amount.js +2 -0
  295. package/dist/esm/entities/shared/billing-details.js +5 -2
  296. package/dist/esm/entities/shared/chargeback-fee.js +2 -0
  297. package/dist/esm/entities/shared/import-meta.js +2 -0
  298. package/dist/esm/entities/shared/korean-market-underlying-details.js +1 -0
  299. package/dist/esm/entities/shared/money.js +2 -0
  300. package/dist/esm/entities/shared/payment-card.js +5 -0
  301. package/dist/esm/entities/shared/payment-method-details.js +3 -0
  302. package/dist/esm/entities/shared/payment-method-underlying-details.js +1 -0
  303. package/dist/esm/entities/shared/payout-totals-adjustment.js +7 -0
  304. package/dist/esm/entities/shared/paypal.js +2 -0
  305. package/dist/esm/entities/shared/simulation-event-request.js +1 -0
  306. package/dist/esm/entities/shared/simulation-event-response.js +2 -0
  307. package/dist/esm/entities/shared/tax-rates-used.js +2 -0
  308. package/dist/esm/entities/shared/time-period.js +2 -0
  309. package/dist/esm/entities/shared/total-adjustments.js +6 -0
  310. package/dist/esm/entities/shared/totals.js +4 -0
  311. package/dist/esm/entities/shared/transaction-checkout.js +1 -0
  312. package/dist/esm/entities/shared/transaction-payment-attempt.js +10 -2
  313. package/dist/esm/entities/shared/transaction-payout-totals-adjusted.js +7 -0
  314. package/dist/esm/entities/shared/transaction-payout-totals.js +11 -0
  315. package/dist/esm/entities/shared/transaction-totals-adjusted.js +7 -0
  316. package/dist/esm/entities/shared/transaction-totals.js +11 -0
  317. package/dist/esm/entities/shared/unit-price-override.js +2 -0
  318. package/dist/esm/entities/shared/unit-totals.js +4 -0
  319. package/dist/esm/entities/simulation/simulation-scenario-config/simulation-scenario-config.js +5 -0
  320. package/dist/esm/entities/simulation/simulation-scenario-config/subscription-cancellation-details.js +2 -0
  321. package/dist/esm/entities/simulation/simulation-scenario-config/subscription-cancellation-entities.js +2 -2
  322. package/dist/esm/entities/simulation/simulation-scenario-config/subscription-cancellation-options.js +4 -3
  323. package/dist/esm/entities/simulation/simulation-scenario-config/subscription-creation-details.js +2 -0
  324. package/dist/esm/entities/simulation/simulation-scenario-config/subscription-creation-entities.js +14 -8
  325. package/dist/esm/entities/simulation/simulation-scenario-config/subscription-creation-item.js +2 -0
  326. package/dist/esm/entities/simulation/simulation-scenario-config/subscription-creation-options.js +6 -4
  327. package/dist/esm/entities/simulation/simulation-scenario-config/subscription-pause-details.js +2 -0
  328. package/dist/esm/entities/simulation/simulation-scenario-config/subscription-pause-entities.js +2 -2
  329. package/dist/esm/entities/simulation/simulation-scenario-config/subscription-pause-options.js +4 -3
  330. package/dist/esm/entities/simulation/simulation-scenario-config/subscription-renewal-details.js +2 -0
  331. package/dist/esm/entities/simulation/simulation-scenario-config/subscription-renewal-entities.js +2 -2
  332. package/dist/esm/entities/simulation/simulation-scenario-config/subscription-renewal-options.js +4 -3
  333. package/dist/esm/entities/simulation/simulation-scenario-config/subscription-resume-details.js +2 -0
  334. package/dist/esm/entities/simulation/simulation-scenario-config/subscription-resume-entities.js +2 -2
  335. package/dist/esm/entities/simulation/simulation-scenario-config/subscription-resume-options.js +4 -3
  336. package/dist/esm/entities/simulation/simulation.js +12 -3
  337. package/dist/esm/entities/simulation-run/simulation-run.js +7 -2
  338. package/dist/esm/entities/simulation-run-event/simulation-run-event.js +8 -0
  339. package/dist/esm/entities/simulation-types/simulation-type.js +6 -0
  340. package/dist/esm/entities/subscription/next-transaction-adjustment-item.js +5 -0
  341. package/dist/esm/entities/subscription/next-transaction-adjustment-preview.js +3 -0
  342. package/dist/esm/entities/subscription/next-transaction.js +3 -0
  343. package/dist/esm/entities/subscription/subscription-discount.js +5 -3
  344. package/dist/esm/entities/subscription/subscription-item.js +10 -0
  345. package/dist/esm/entities/subscription/subscription-management.js +2 -0
  346. package/dist/esm/entities/subscription/subscription-preview-summary-result.js +3 -0
  347. package/dist/esm/entities/subscription/subscription-preview-update-summary.js +3 -0
  348. package/dist/esm/entities/subscription/subscription-preview.js +26 -0
  349. package/dist/esm/entities/subscription/subscription-scheduled-change.js +3 -0
  350. package/dist/esm/entities/subscription/subscription-time-period.js +2 -0
  351. package/dist/esm/entities/subscription/subscription.js +25 -0
  352. package/dist/esm/entities/subscription/transaction-details-preview.js +3 -0
  353. package/dist/esm/entities/subscription/transaction-line-item-preview.js +7 -0
  354. package/dist/esm/entities/transaction/address-preview.js +2 -0
  355. package/dist/esm/entities/transaction/adjustment-totals-breakdown.js +3 -0
  356. package/dist/esm/entities/transaction/adjustment-totals.js +7 -0
  357. package/dist/esm/entities/transaction/proration.js +2 -0
  358. package/dist/esm/entities/transaction/transaction-adjustment-item.js +6 -0
  359. package/dist/esm/entities/transaction/transaction-adjustment.js +14 -0
  360. package/dist/esm/entities/transaction/transaction-details.js +6 -0
  361. package/dist/esm/entities/transaction/transaction-invoice-pdf.js +1 -0
  362. package/dist/esm/entities/transaction/transaction-item-preview.js +5 -2
  363. package/dist/esm/entities/transaction/transaction-item.js +3 -0
  364. package/dist/esm/entities/transaction/transaction-line-item.js +8 -0
  365. package/dist/esm/entities/transaction/transaction-preview.js +12 -2
  366. package/dist/esm/entities/transaction/transaction-proration.js +2 -0
  367. package/dist/esm/entities/transaction/transaction.js +31 -2
  368. package/dist/esm/entities/transaction/transactions-time-period.js +2 -0
  369. package/dist/esm/internal/api/case-helpers.js +2 -13
  370. package/dist/esm/internal/api/client.js +54 -64
  371. package/dist/esm/internal/base/base-resource.js +1 -0
  372. package/dist/esm/internal/base/collection.js +20 -45
  373. package/dist/esm/internal/base/logger.js +1 -0
  374. package/dist/esm/internal/base/path-parameters.js +2 -0
  375. package/dist/esm/internal/base/query-parameters.js +1 -0
  376. package/dist/esm/internal/errors/generic.js +5 -0
  377. package/dist/esm/internal/providers/crypto/crypto-provider.js +2 -13
  378. package/dist/esm/internal/providers/crypto/edge-crypto.js +14 -25
  379. package/dist/esm/internal/providers/crypto/node-crypto.js +5 -16
  380. package/dist/esm/internal/providers/runtime-provider.js +1 -0
  381. package/dist/esm/notifications/entities/address/address-notification.js +15 -2
  382. package/dist/esm/notifications/entities/adjustment/adjustment-item-notification.js +6 -0
  383. package/dist/esm/notifications/entities/adjustment/adjustment-item-totals-notification.js +3 -0
  384. package/dist/esm/notifications/entities/adjustment/adjustment-notification.js +15 -0
  385. package/dist/esm/notifications/entities/adjustment/adjustment-proration-notification.js +2 -0
  386. package/dist/esm/notifications/entities/adjustment/adjustment-time-period-notification.js +2 -0
  387. package/dist/esm/notifications/entities/api-key/api-key-notification.js +13 -4
  388. package/dist/esm/notifications/entities/business/business-notification.js +12 -2
  389. package/dist/esm/notifications/entities/business/contacts-notification.js +2 -0
  390. package/dist/esm/notifications/entities/customer/customer-notification.js +10 -0
  391. package/dist/esm/notifications/entities/discount/discount-notification.js +20 -2
  392. package/dist/esm/notifications/entities/discount-group/discount-group-notification.js +6 -0
  393. package/dist/esm/notifications/entities/payment-method/payment-method-deleted-notification.js +8 -0
  394. package/dist/esm/notifications/entities/payment-method/payment-method-notification.js +7 -0
  395. package/dist/esm/notifications/entities/payout/payout-notification.js +4 -0
  396. package/dist/esm/notifications/entities/price/price-notification.js +19 -4
  397. package/dist/esm/notifications/entities/price/price-quantity-notification.js +2 -0
  398. package/dist/esm/notifications/entities/product/product-notification.js +13 -3
  399. package/dist/esm/notifications/entities/report/report-filters-notification.js +4 -2
  400. package/dist/esm/notifications/entities/report/report-notification.js +10 -4
  401. package/dist/esm/notifications/entities/shared/adjustment-original-amount-notification.js +2 -0
  402. package/dist/esm/notifications/entities/shared/billing-details-notification.js +5 -2
  403. package/dist/esm/notifications/entities/shared/chargeback-fee-notification.js +2 -0
  404. package/dist/esm/notifications/entities/shared/import-meta-notification.js +2 -0
  405. package/dist/esm/notifications/entities/shared/korean-market-underlying-details-notification.js +1 -0
  406. package/dist/esm/notifications/entities/shared/money-notification.js +2 -0
  407. package/dist/esm/notifications/entities/shared/payment-card-notification.js +5 -0
  408. package/dist/esm/notifications/entities/shared/payment-method-details-notification.js +3 -0
  409. package/dist/esm/notifications/entities/shared/payment-method-underlying-details-notification.js +1 -0
  410. package/dist/esm/notifications/entities/shared/payout-totals-adjustment-notification.js +7 -0
  411. package/dist/esm/notifications/entities/shared/tax-rates-used-notification.js +2 -0
  412. package/dist/esm/notifications/entities/shared/time-period-notification.js +2 -0
  413. package/dist/esm/notifications/entities/shared/total-adjustments-notification.js +6 -0
  414. package/dist/esm/notifications/entities/shared/totals-notification.js +4 -0
  415. package/dist/esm/notifications/entities/shared/transaction-checkout-notification.js +1 -0
  416. package/dist/esm/notifications/entities/shared/transaction-payment-attempt-notification.js +10 -2
  417. package/dist/esm/notifications/entities/shared/transaction-payout-totals-adjusted-notification.js +7 -0
  418. package/dist/esm/notifications/entities/shared/transaction-payout-totals-notification.js +13 -0
  419. package/dist/esm/notifications/entities/shared/transaction-totals-adjusted-notification.js +7 -0
  420. package/dist/esm/notifications/entities/shared/transaction-totals-notification.js +11 -0
  421. package/dist/esm/notifications/entities/shared/unit-price-override-notification.js +2 -0
  422. package/dist/esm/notifications/entities/shared/unit-totals-notification.js +4 -0
  423. package/dist/esm/notifications/entities/subscription/subscription-created-notification.js +23 -0
  424. package/dist/esm/notifications/entities/subscription/subscription-discount-notification.js +4 -2
  425. package/dist/esm/notifications/entities/subscription/subscription-item-notification.js +10 -0
  426. package/dist/esm/notifications/entities/subscription/subscription-notification.js +22 -0
  427. package/dist/esm/notifications/entities/subscription/subscription-price-notification.js +16 -3
  428. package/dist/esm/notifications/entities/subscription/subscription-scheduled-change-notification.js +3 -0
  429. package/dist/esm/notifications/entities/subscription/subscription-time-period-notification.js +2 -0
  430. package/dist/esm/notifications/entities/transaction/transaction-details-notification.js +6 -0
  431. package/dist/esm/notifications/entities/transaction/transaction-item-notification.js +3 -0
  432. package/dist/esm/notifications/entities/transaction/transaction-line-item-notification.js +8 -0
  433. package/dist/esm/notifications/entities/transaction/transaction-notification.js +23 -0
  434. package/dist/esm/notifications/entities/transaction/transaction-proration-notification.js +2 -0
  435. package/dist/esm/notifications/entities/transaction/transactions-time-period-notification.js +2 -0
  436. package/dist/esm/notifications/events/address/address-created-event.js +2 -1
  437. package/dist/esm/notifications/events/address/address-imported-event.js +2 -1
  438. package/dist/esm/notifications/events/address/address-updated-event.js +2 -1
  439. package/dist/esm/notifications/events/adjustment/adjustment-created-event.js +2 -1
  440. package/dist/esm/notifications/events/adjustment/adjustment-updated-event.js +2 -1
  441. package/dist/esm/notifications/events/api-key/api-key-created-event.js +2 -1
  442. package/dist/esm/notifications/events/api-key/api-key-expired-event.js +2 -1
  443. package/dist/esm/notifications/events/api-key/api-key-expiring-event.js +2 -1
  444. package/dist/esm/notifications/events/api-key/api-key-revoked-event.js +2 -1
  445. package/dist/esm/notifications/events/api-key/api-key-updated-event.js +2 -1
  446. package/dist/esm/notifications/events/business/business-created-event.js +2 -1
  447. package/dist/esm/notifications/events/business/business-imported-event.js +2 -1
  448. package/dist/esm/notifications/events/business/business-updated-event.js +2 -1
  449. package/dist/esm/notifications/events/customer/customer-created-event.js +2 -1
  450. package/dist/esm/notifications/events/customer/customer-imported-event.js +2 -1
  451. package/dist/esm/notifications/events/customer/customer-updated-event.js +2 -1
  452. package/dist/esm/notifications/events/discount/discount-created-event.js +2 -1
  453. package/dist/esm/notifications/events/discount/discount-imported-event.js +2 -1
  454. package/dist/esm/notifications/events/discount/discount-updated-event.js +2 -1
  455. package/dist/esm/notifications/events/discount-group/discount-group-created-event.js +2 -1
  456. package/dist/esm/notifications/events/generic/generic-event.js +1 -0
  457. package/dist/esm/notifications/events/payment-method/payment-method-deleted-event.js +2 -1
  458. package/dist/esm/notifications/events/payment-method/payment-method-saved-event.js +2 -1
  459. package/dist/esm/notifications/events/payout/payout-created-event.js +2 -1
  460. package/dist/esm/notifications/events/payout/payout-paid-event.js +2 -1
  461. package/dist/esm/notifications/events/price/price-created-event.js +2 -1
  462. package/dist/esm/notifications/events/price/price-imported-event.js +2 -1
  463. package/dist/esm/notifications/events/price/price-updated-event.js +2 -1
  464. package/dist/esm/notifications/events/product/product-created-event.js +2 -1
  465. package/dist/esm/notifications/events/product/product-imported-event.js +2 -1
  466. package/dist/esm/notifications/events/product/product-updated-event.js +2 -1
  467. package/dist/esm/notifications/events/report/report-created-event.js +2 -1
  468. package/dist/esm/notifications/events/report/report-updated-event.js +2 -1
  469. package/dist/esm/notifications/events/subscription/subscription-activated-event.js +2 -1
  470. package/dist/esm/notifications/events/subscription/subscription-canceled-event.js +2 -1
  471. package/dist/esm/notifications/events/subscription/subscription-created-event.js +2 -1
  472. package/dist/esm/notifications/events/subscription/subscription-imported-event.js +2 -1
  473. package/dist/esm/notifications/events/subscription/subscription-past-due-event.js +2 -1
  474. package/dist/esm/notifications/events/subscription/subscription-paused-event.js +2 -1
  475. package/dist/esm/notifications/events/subscription/subscription-resumed-event.js +2 -1
  476. package/dist/esm/notifications/events/subscription/subscription-trialing-event.js +2 -1
  477. package/dist/esm/notifications/events/subscription/subscription-updated-event.js +2 -1
  478. package/dist/esm/notifications/events/transaction/transaction-billed-event.js +2 -1
  479. package/dist/esm/notifications/events/transaction/transaction-canceled-event.js +2 -1
  480. package/dist/esm/notifications/events/transaction/transaction-completed-event.js +2 -1
  481. package/dist/esm/notifications/events/transaction/transaction-created-event.js +2 -1
  482. package/dist/esm/notifications/events/transaction/transaction-paid-event.js +2 -1
  483. package/dist/esm/notifications/events/transaction/transaction-past-due-event.js +2 -1
  484. package/dist/esm/notifications/events/transaction/transaction-payment-failed-event.js +2 -1
  485. package/dist/esm/notifications/events/transaction/transaction-ready-event.js +2 -1
  486. package/dist/esm/notifications/events/transaction/transaction-revised-event.js +2 -1
  487. package/dist/esm/notifications/events/transaction/transaction-updated-event.js +2 -1
  488. package/dist/esm/notifications/helpers/webhooks-validator.js +14 -26
  489. package/dist/esm/notifications/helpers/webhooks.js +11 -24
  490. package/dist/esm/paddle.js +29 -5
  491. package/dist/esm/resources/addresses/index.js +25 -42
  492. package/dist/esm/resources/adjustments/index.js +12 -25
  493. package/dist/esm/resources/businesses/index.js +25 -42
  494. package/dist/esm/resources/customer-portal-sessions/index.js +8 -19
  495. package/dist/esm/resources/customers/index.js +35 -56
  496. package/dist/esm/resources/discount-groups/index.js +4 -15
  497. package/dist/esm/resources/discounts/index.js +20 -37
  498. package/dist/esm/resources/event-types/index.js +4 -15
  499. package/dist/esm/resources/notification-settings/index.js +31 -50
  500. package/dist/esm/resources/notifications/index.js +14 -27
  501. package/dist/esm/resources/payment-methods/index.js +17 -30
  502. package/dist/esm/resources/prices/index.js +21 -38
  503. package/dist/esm/resources/pricing-preview/index.js +4 -15
  504. package/dist/esm/resources/products/index.js +21 -38
  505. package/dist/esm/resources/reports/index.js +18 -33
  506. package/dist/esm/resources/simulation-run-events/index.js +18 -31
  507. package/dist/esm/resources/simulation-runs/index.js +16 -29
  508. package/dist/esm/resources/simulation-types/index.js +4 -15
  509. package/dist/esm/resources/simulations/index.js +18 -33
  510. package/dist/esm/resources/subscriptions/index.js +71 -100
  511. package/dist/esm/resources/transactions/index.js +40 -61
  512. package/dist/esm/version.js +1 -1
  513. package/dist/types/version.d.ts +1 -1
  514. package/package.json +4 -4
@@ -1,13 +1,4 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.Webhooks = void 0;
13
4
  const webhooks_validator_js_1 = require("./webhooks-validator.js");
@@ -15,22 +6,18 @@ const types_js_1 = require("./types.js");
15
6
  const index_js_1 = require("../events/index.js");
16
7
  const logger_js_1 = require("../../internal/base/logger.js");
17
8
  class Webhooks {
18
- unmarshal(requestBody, secretKey, signature) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- const isSignatureValid = yield new webhooks_validator_js_1.WebhooksValidator().isValidSignature(requestBody, secretKey, signature);
21
- if (isSignatureValid) {
22
- const parsedRequest = JSON.parse(requestBody);
23
- return Webhooks.fromJson(parsedRequest);
24
- }
25
- else {
26
- throw new Error('[Paddle] Webhook signature verification failed');
27
- }
28
- });
9
+ async unmarshal(requestBody, secretKey, signature) {
10
+ const isSignatureValid = await new webhooks_validator_js_1.WebhooksValidator().isValidSignature(requestBody, secretKey, signature);
11
+ if (isSignatureValid) {
12
+ const parsedRequest = JSON.parse(requestBody);
13
+ return Webhooks.fromJson(parsedRequest);
14
+ }
15
+ else {
16
+ throw new Error('[Paddle] Webhook signature verification failed');
17
+ }
29
18
  }
30
- isSignatureValid(requestBody, secretKey, signature) {
31
- return __awaiter(this, void 0, void 0, function* () {
32
- return yield new webhooks_validator_js_1.WebhooksValidator().isValidSignature(requestBody, secretKey, signature);
33
- });
19
+ async isSignatureValid(requestBody, secretKey, signature) {
20
+ return await new webhooks_validator_js_1.WebhooksValidator().isValidSignature(requestBody, secretKey, signature);
34
21
  }
35
22
  static fromJson(data) {
36
23
  switch (data.event_type) {
@@ -7,12 +7,36 @@ const index_js_2 = require("./resources/index.js");
7
7
  const index_js_3 = require("./resources/events/index.js");
8
8
  const index_js_4 = require("./notifications/index.js");
9
9
  class Paddle {
10
+ client;
11
+ defaultPaddleOptions = {
12
+ environment: index_js_1.Environment.production,
13
+ logLevel: index_js_1.LogLevel.error,
14
+ };
15
+ products;
16
+ prices;
17
+ transactions;
18
+ adjustments;
19
+ customers;
20
+ customerPortalSessions;
21
+ addresses;
22
+ businesses;
23
+ discounts;
24
+ discountGroups;
25
+ subscriptions;
26
+ paymentMethods;
27
+ pricingPreview;
28
+ events;
29
+ webhooks;
30
+ eventTypes;
31
+ notificationSettings;
32
+ notifications;
33
+ reports;
34
+ simulationTypes;
35
+ simulations;
36
+ simulationRuns;
37
+ simulationRunEvents;
10
38
  constructor(apiKey, options) {
11
- this.defaultPaddleOptions = {
12
- environment: index_js_1.Environment.production,
13
- logLevel: index_js_1.LogLevel.verbose,
14
- };
15
- this.client = new client_js_1.Client(apiKey, options ? Object.assign(Object.assign({}, this.defaultPaddleOptions), options) : Object.assign({}, this.defaultPaddleOptions));
39
+ this.client = new client_js_1.Client(apiKey, options ? { ...this.defaultPaddleOptions, ...options } : { ...this.defaultPaddleOptions });
16
40
  this.products = new index_js_2.ProductsResource(this.client);
17
41
  this.prices = new index_js_2.PricesResource(this.client);
18
42
  this.transactions = new index_js_2.TransactionsResource(this.client);
@@ -13,15 +13,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
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
16
  Object.defineProperty(exports, "__esModule", { value: true });
26
17
  exports.AddressesResource = void 0;
27
18
  const index_js_1 = require("../../internal/base/index.js");
@@ -41,42 +32,34 @@ class AddressesResource extends index_js_1.BaseResource {
41
32
  }).deriveUrl();
42
33
  return new index_js_2.AddressCollection(this.client, urlWithPathParams + queryParameters.toQueryString());
43
34
  }
44
- create(customerId, createAddressParameters) {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- const urlWithPathParams = new index_js_1.PathParameters(AddressPaths.create, {
47
- customer_id: customerId,
48
- }).deriveUrl();
49
- const response = yield this.client.post(urlWithPathParams, createAddressParameters);
50
- const data = this.handleResponse(response);
51
- return new index_js_2.Address(data);
52
- });
35
+ async create(customerId, createAddressParameters) {
36
+ const urlWithPathParams = new index_js_1.PathParameters(AddressPaths.create, {
37
+ customer_id: customerId,
38
+ }).deriveUrl();
39
+ const response = await this.client.post(urlWithPathParams, createAddressParameters);
40
+ const data = this.handleResponse(response);
41
+ return new index_js_2.Address(data);
53
42
  }
54
- get(customerId, addressId) {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- const urlWithPathParams = new index_js_1.PathParameters(AddressPaths.get, {
57
- customer_id: customerId,
58
- address_id: addressId,
59
- }).deriveUrl();
60
- const response = yield this.client.get(urlWithPathParams);
61
- const data = this.handleResponse(response);
62
- return new index_js_2.Address(data);
63
- });
43
+ async get(customerId, addressId) {
44
+ const urlWithPathParams = new index_js_1.PathParameters(AddressPaths.get, {
45
+ customer_id: customerId,
46
+ address_id: addressId,
47
+ }).deriveUrl();
48
+ const response = await this.client.get(urlWithPathParams);
49
+ const data = this.handleResponse(response);
50
+ return new index_js_2.Address(data);
64
51
  }
65
- update(customerId, addressId, updateAddress) {
66
- return __awaiter(this, void 0, void 0, function* () {
67
- const urlWithPathParams = new index_js_1.PathParameters(AddressPaths.update, {
68
- customer_id: customerId,
69
- address_id: addressId,
70
- }).deriveUrl();
71
- const response = yield this.client.patch(urlWithPathParams, updateAddress);
72
- const data = this.handleResponse(response);
73
- return new index_js_2.Address(data);
74
- });
52
+ async update(customerId, addressId, updateAddress) {
53
+ const urlWithPathParams = new index_js_1.PathParameters(AddressPaths.update, {
54
+ customer_id: customerId,
55
+ address_id: addressId,
56
+ }).deriveUrl();
57
+ const response = await this.client.patch(urlWithPathParams, updateAddress);
58
+ const data = this.handleResponse(response);
59
+ return new index_js_2.Address(data);
75
60
  }
76
- archive(customerId, addressId) {
77
- return __awaiter(this, void 0, void 0, function* () {
78
- return yield this.update(customerId, addressId, { status: 'archived' });
79
- });
61
+ async archive(customerId, addressId) {
62
+ return await this.update(customerId, addressId, { status: 'archived' });
80
63
  }
81
64
  }
82
65
  exports.AddressesResource = AddressesResource;
@@ -13,15 +13,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
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
16
  Object.defineProperty(exports, "__esModule", { value: true });
26
17
  exports.AdjustmentsResource = void 0;
27
18
  const index_js_1 = require("../../internal/base/index.js");
@@ -37,23 +28,19 @@ class AdjustmentsResource extends index_js_1.BaseResource {
37
28
  const queryParameters = new index_js_1.QueryParameters(queryParams);
38
29
  return new index_js_2.AdjustmentCollection(this.client, AdjustmentPaths.list + queryParameters.toQueryString());
39
30
  }
40
- create(createAdjustmentParameters) {
41
- return __awaiter(this, void 0, void 0, function* () {
42
- const response = yield this.client.post(AdjustmentPaths.create, createAdjustmentParameters);
43
- const data = this.handleResponse(response);
44
- return new index_js_2.Adjustment(data);
45
- });
31
+ async create(createAdjustmentParameters) {
32
+ const response = await this.client.post(AdjustmentPaths.create, createAdjustmentParameters);
33
+ const data = this.handleResponse(response);
34
+ return new index_js_2.Adjustment(data);
46
35
  }
47
- getCreditNotePDF(adjustmentId, queryParams) {
48
- return __awaiter(this, void 0, void 0, function* () {
49
- const urlWithPathParams = new index_js_1.PathParameters(AdjustmentPaths.getCreditNotePDF, {
50
- adjustment_id: adjustmentId,
51
- }).deriveUrl();
52
- const queryParameters = new index_js_1.QueryParameters(queryParams);
53
- const response = yield this.client.get(urlWithPathParams + queryParameters.toQueryString());
54
- const data = this.handleResponse(response);
55
- return new index_js_2.AdjustmentCreditNotePDF(data);
56
- });
36
+ async getCreditNotePDF(adjustmentId, queryParams) {
37
+ const urlWithPathParams = new index_js_1.PathParameters(AdjustmentPaths.getCreditNotePDF, {
38
+ adjustment_id: adjustmentId,
39
+ }).deriveUrl();
40
+ const queryParameters = new index_js_1.QueryParameters(queryParams);
41
+ const response = await this.client.get(urlWithPathParams + queryParameters.toQueryString());
42
+ const data = this.handleResponse(response);
43
+ return new index_js_2.AdjustmentCreditNotePDF(data);
57
44
  }
58
45
  }
59
46
  exports.AdjustmentsResource = AdjustmentsResource;
@@ -13,15 +13,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
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
16
  Object.defineProperty(exports, "__esModule", { value: true });
26
17
  exports.BusinessesResource = void 0;
27
18
  const index_js_1 = require("../../internal/base/index.js");
@@ -41,42 +32,34 @@ class BusinessesResource extends index_js_1.BaseResource {
41
32
  }).deriveUrl();
42
33
  return new index_js_2.BusinessCollection(this.client, urlWithPathParams + queryParameters.toQueryString());
43
34
  }
44
- create(customerId, createBusinessParameters) {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- const urlWithPathParams = new index_js_1.PathParameters(BusinessPaths.create, {
47
- customer_id: customerId,
48
- }).deriveUrl();
49
- const response = yield this.client.post(urlWithPathParams, createBusinessParameters);
50
- const data = this.handleResponse(response);
51
- return new index_js_2.Business(data);
52
- });
35
+ async create(customerId, createBusinessParameters) {
36
+ const urlWithPathParams = new index_js_1.PathParameters(BusinessPaths.create, {
37
+ customer_id: customerId,
38
+ }).deriveUrl();
39
+ const response = await this.client.post(urlWithPathParams, createBusinessParameters);
40
+ const data = this.handleResponse(response);
41
+ return new index_js_2.Business(data);
53
42
  }
54
- get(customerId, businessId) {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- const urlWithPathParams = new index_js_1.PathParameters(BusinessPaths.get, {
57
- customer_id: customerId,
58
- business_id: businessId,
59
- }).deriveUrl();
60
- const response = yield this.client.get(urlWithPathParams);
61
- const data = this.handleResponse(response);
62
- return new index_js_2.Business(data);
63
- });
43
+ async get(customerId, businessId) {
44
+ const urlWithPathParams = new index_js_1.PathParameters(BusinessPaths.get, {
45
+ customer_id: customerId,
46
+ business_id: businessId,
47
+ }).deriveUrl();
48
+ const response = await this.client.get(urlWithPathParams);
49
+ const data = this.handleResponse(response);
50
+ return new index_js_2.Business(data);
64
51
  }
65
- update(customerId, businessId, updateBusiness) {
66
- return __awaiter(this, void 0, void 0, function* () {
67
- const urlWithPathParams = new index_js_1.PathParameters(BusinessPaths.update, {
68
- customer_id: customerId,
69
- business_id: businessId,
70
- }).deriveUrl();
71
- const response = yield this.client.patch(urlWithPathParams, updateBusiness);
72
- const data = this.handleResponse(response);
73
- return new index_js_2.Business(data);
74
- });
52
+ async update(customerId, businessId, updateBusiness) {
53
+ const urlWithPathParams = new index_js_1.PathParameters(BusinessPaths.update, {
54
+ customer_id: customerId,
55
+ business_id: businessId,
56
+ }).deriveUrl();
57
+ const response = await this.client.patch(urlWithPathParams, updateBusiness);
58
+ const data = this.handleResponse(response);
59
+ return new index_js_2.Business(data);
75
60
  }
76
- archive(customerId, businessId) {
77
- return __awaiter(this, void 0, void 0, function* () {
78
- return yield this.update(customerId, businessId, { status: 'archived' });
79
- });
61
+ async archive(customerId, businessId) {
62
+ return await this.update(customerId, businessId, { status: 'archived' });
80
63
  }
81
64
  }
82
65
  exports.BusinessesResource = BusinessesResource;
@@ -1,13 +1,4 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.CustomerPortalSessionsResource = void 0;
13
4
  const index_js_1 = require("../../entities/index.js");
@@ -16,17 +7,15 @@ const CustomerPortalSessionPaths = {
16
7
  create: '/customers/{customer_id}/portal-sessions',
17
8
  };
18
9
  class CustomerPortalSessionsResource extends index_js_2.BaseResource {
19
- create(customerId, subscriptionIds) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const urlWithPathParams = new index_js_2.PathParameters(CustomerPortalSessionPaths.create, {
22
- customer_id: customerId,
23
- }).deriveUrl();
24
- const response = yield this.client.post(urlWithPathParams, {
25
- subscriptionIds,
26
- });
27
- const data = this.handleResponse(response);
28
- return new index_js_1.CustomerPortalSession(data);
10
+ async create(customerId, subscriptionIds) {
11
+ const urlWithPathParams = new index_js_2.PathParameters(CustomerPortalSessionPaths.create, {
12
+ customer_id: customerId,
13
+ }).deriveUrl();
14
+ const response = await this.client.post(urlWithPathParams, {
15
+ subscriptionIds,
29
16
  });
17
+ const data = this.handleResponse(response);
18
+ return new index_js_1.CustomerPortalSession(data);
30
19
  }
31
20
  }
32
21
  exports.CustomerPortalSessionsResource = CustomerPortalSessionsResource;
@@ -13,15 +13,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
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
16
  Object.defineProperty(exports, "__esModule", { value: true });
26
17
  exports.CustomersResource = void 0;
27
18
  const index_js_1 = require("../../internal/base/index.js");
@@ -40,58 +31,46 @@ class CustomersResource extends index_js_1.BaseResource {
40
31
  const queryParameters = new index_js_1.QueryParameters(queryParams);
41
32
  return new index_js_2.CustomerCollection(this.client, CustomerPaths.list + queryParameters.toQueryString());
42
33
  }
43
- create(createCustomerParameters) {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- const response = yield this.client.post(CustomerPaths.create, createCustomerParameters);
46
- const data = this.handleResponse(response);
47
- return new index_js_2.Customer(data);
48
- });
34
+ async create(createCustomerParameters) {
35
+ const response = await this.client.post(CustomerPaths.create, createCustomerParameters);
36
+ const data = this.handleResponse(response);
37
+ return new index_js_2.Customer(data);
49
38
  }
50
- get(customerId) {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- const urlWithPathParams = new index_js_1.PathParameters(CustomerPaths.get, {
53
- customer_id: customerId,
54
- }).deriveUrl();
55
- const response = yield this.client.get(urlWithPathParams);
56
- const data = this.handleResponse(response);
57
- return new index_js_2.Customer(data);
58
- });
39
+ async get(customerId) {
40
+ const urlWithPathParams = new index_js_1.PathParameters(CustomerPaths.get, {
41
+ customer_id: customerId,
42
+ }).deriveUrl();
43
+ const response = await this.client.get(urlWithPathParams);
44
+ const data = this.handleResponse(response);
45
+ return new index_js_2.Customer(data);
59
46
  }
60
- update(customerId, updateCustomer) {
61
- return __awaiter(this, void 0, void 0, function* () {
62
- const urlWithPathParams = new index_js_1.PathParameters(CustomerPaths.update, {
63
- customer_id: customerId,
64
- }).deriveUrl();
65
- const response = yield this.client.patch(urlWithPathParams, updateCustomer);
66
- const data = this.handleResponse(response);
67
- return new index_js_2.Customer(data);
68
- });
47
+ async update(customerId, updateCustomer) {
48
+ const urlWithPathParams = new index_js_1.PathParameters(CustomerPaths.update, {
49
+ customer_id: customerId,
50
+ }).deriveUrl();
51
+ const response = await this.client.patch(urlWithPathParams, updateCustomer);
52
+ const data = this.handleResponse(response);
53
+ return new index_js_2.Customer(data);
69
54
  }
70
- getCreditBalance(customerId, queryParams) {
71
- return __awaiter(this, void 0, void 0, function* () {
72
- const urlWithPathParams = new index_js_1.PathParameters(CustomerPaths.getCustomerBalance, {
73
- customer_id: customerId,
74
- }).deriveUrl();
75
- const queryParameters = new index_js_1.QueryParameters(queryParams);
76
- const response = yield this.client.get(urlWithPathParams, queryParameters);
77
- const data = this.handleResponse(response);
78
- return data.map((balance) => new index_js_2.CreditBalance(balance));
79
- });
55
+ async getCreditBalance(customerId, queryParams) {
56
+ const urlWithPathParams = new index_js_1.PathParameters(CustomerPaths.getCustomerBalance, {
57
+ customer_id: customerId,
58
+ }).deriveUrl();
59
+ const queryParameters = new index_js_1.QueryParameters(queryParams);
60
+ const response = await this.client.get(urlWithPathParams, queryParameters);
61
+ const data = this.handleResponse(response);
62
+ return data.map((balance) => new index_js_2.CreditBalance(balance));
80
63
  }
81
- archive(customerId) {
82
- return __awaiter(this, void 0, void 0, function* () {
83
- return yield this.update(customerId, { status: 'archived' });
84
- });
64
+ async archive(customerId) {
65
+ return await this.update(customerId, { status: 'archived' });
85
66
  }
86
- generateAuthToken(customerId) {
87
- return __awaiter(this, void 0, void 0, function* () {
88
- const urlWithPathParams = new index_js_1.PathParameters(CustomerPaths.generate, {
89
- customer_id: customerId,
90
- }).deriveUrl();
91
- const response = yield this.client.post(urlWithPathParams, undefined);
92
- const data = this.handleResponse(response);
93
- return new index_js_2.AuthToken(data);
94
- });
67
+ async generateAuthToken(customerId) {
68
+ const urlWithPathParams = new index_js_1.PathParameters(CustomerPaths.generate, {
69
+ customer_id: customerId,
70
+ }).deriveUrl();
71
+ const response = await this.client.post(urlWithPathParams, undefined);
72
+ const data = this.handleResponse(response);
73
+ return new index_js_2.AuthToken(data);
95
74
  }
96
75
  }
97
76
  exports.CustomersResource = CustomersResource;
@@ -13,15 +13,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
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
16
  Object.defineProperty(exports, "__esModule", { value: true });
26
17
  exports.DiscountGroupsResource = void 0;
27
18
  const index_js_1 = require("../../entities/index.js");
@@ -36,12 +27,10 @@ class DiscountGroupsResource extends index_js_2.BaseResource {
36
27
  const queryParameters = new index_js_2.QueryParameters(queryParams);
37
28
  return new index_js_1.DiscountGroupCollection(this.client, DiscountGroupPaths.list + queryParameters.toQueryString());
38
29
  }
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
- });
30
+ async create(createDiscountGroupRequestBody) {
31
+ const response = await this.client.post(DiscountGroupPaths.create, createDiscountGroupRequestBody);
32
+ const data = this.handleResponse(response);
33
+ return new index_js_1.DiscountGroup(data);
45
34
  }
46
35
  }
47
36
  exports.DiscountGroupsResource = DiscountGroupsResource;
@@ -13,15 +13,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
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
16
  Object.defineProperty(exports, "__esModule", { value: true });
26
17
  exports.DiscountsResource = void 0;
27
18
  const index_js_1 = require("../../internal/base/index.js");
@@ -38,37 +29,29 @@ class DiscountsResource extends index_js_1.BaseResource {
38
29
  const queryParameters = new index_js_1.QueryParameters(queryParams);
39
30
  return new index_js_2.DiscountCollection(this.client, DiscountPaths.list + queryParameters.toQueryString());
40
31
  }
41
- create(createDiscountParameters) {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- const response = yield this.client.post(DiscountPaths.create, createDiscountParameters);
44
- const data = this.handleResponse(response);
45
- return new index_js_2.Discount(data);
46
- });
32
+ async create(createDiscountParameters) {
33
+ const response = await this.client.post(DiscountPaths.create, createDiscountParameters);
34
+ const data = this.handleResponse(response);
35
+ return new index_js_2.Discount(data);
47
36
  }
48
- get(discountId) {
49
- return __awaiter(this, void 0, void 0, function* () {
50
- const urlWithPathParams = new index_js_1.PathParameters(DiscountPaths.get, {
51
- discount_id: discountId,
52
- }).deriveUrl();
53
- const response = yield this.client.get(urlWithPathParams);
54
- const data = this.handleResponse(response);
55
- return new index_js_2.Discount(data);
56
- });
37
+ async get(discountId) {
38
+ const urlWithPathParams = new index_js_1.PathParameters(DiscountPaths.get, {
39
+ discount_id: discountId,
40
+ }).deriveUrl();
41
+ const response = await this.client.get(urlWithPathParams);
42
+ const data = this.handleResponse(response);
43
+ return new index_js_2.Discount(data);
57
44
  }
58
- update(discountId, updateDiscount) {
59
- return __awaiter(this, void 0, void 0, function* () {
60
- const urlWithPathParams = new index_js_1.PathParameters(DiscountPaths.update, {
61
- discount_id: discountId,
62
- }).deriveUrl();
63
- const response = yield this.client.patch(urlWithPathParams, updateDiscount);
64
- const data = this.handleResponse(response);
65
- return new index_js_2.Discount(data);
66
- });
45
+ async update(discountId, updateDiscount) {
46
+ const urlWithPathParams = new index_js_1.PathParameters(DiscountPaths.update, {
47
+ discount_id: discountId,
48
+ }).deriveUrl();
49
+ const response = await this.client.patch(urlWithPathParams, updateDiscount);
50
+ const data = this.handleResponse(response);
51
+ return new index_js_2.Discount(data);
67
52
  }
68
- archive(discountId) {
69
- return __awaiter(this, void 0, void 0, function* () {
70
- return yield this.update(discountId, { status: 'archived' });
71
- });
53
+ async archive(discountId) {
54
+ return await this.update(discountId, { status: 'archived' });
72
55
  }
73
56
  }
74
57
  exports.DiscountsResource = DiscountsResource;
@@ -1,13 +1,4 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.EventTypesResource = void 0;
13
4
  const index_js_1 = require("../../internal/base/index.js");
@@ -16,12 +7,10 @@ const EventTypesPaths = {
16
7
  list: '/event-types',
17
8
  };
18
9
  class EventTypesResource extends index_js_1.BaseResource {
19
- list() {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const response = yield this.client.get(EventTypesPaths.list);
22
- const data = this.handleResponse(response);
23
- return data.map((eventType) => new index_js_2.EventType(eventType));
24
- });
10
+ async list() {
11
+ const response = await this.client.get(EventTypesPaths.list);
12
+ const data = this.handleResponse(response);
13
+ return data.map((eventType) => new index_js_2.EventType(eventType));
25
14
  }
26
15
  }
27
16
  exports.EventTypesResource = EventTypesResource;