@paddle/paddle-node-sdk 0.1.8 → 0.2.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 (413) hide show
  1. package/CHANGELOG.md +28 -2
  2. package/dist/entities/address/address-collection.d.ts +3 -3
  3. package/dist/entities/address/address.d.ts +12 -13
  4. package/dist/entities/address/address.js +10 -26
  5. package/dist/entities/adjustment/adjustment-collection.d.ts +3 -3
  6. package/dist/entities/adjustment/adjustment-item-totals.d.ts +0 -1
  7. package/dist/entities/adjustment/adjustment-item-totals.js +0 -7
  8. package/dist/entities/adjustment/adjustment-item.d.ts +6 -7
  9. package/dist/entities/adjustment/adjustment-item.js +4 -14
  10. package/dist/entities/adjustment/adjustment-proration.d.ts +3 -4
  11. package/dist/entities/adjustment/adjustment-proration.js +2 -8
  12. package/dist/entities/adjustment/adjustment-time-period.d.ts +4 -5
  13. package/dist/entities/adjustment/adjustment-time-period.js +2 -8
  14. package/dist/entities/adjustment/adjustment.d.ts +10 -11
  15. package/dist/entities/adjustment/adjustment.js +8 -26
  16. package/dist/entities/business/business-collection.d.ts +3 -3
  17. package/dist/entities/business/business.d.ts +8 -9
  18. package/dist/entities/business/business.js +6 -19
  19. package/dist/entities/business/contacts.d.ts +1 -2
  20. package/dist/entities/business/contacts.js +1 -7
  21. package/dist/entities/customer/credit-balance.d.ts +5 -6
  22. package/dist/entities/customer/credit-balance.js +2 -9
  23. package/dist/entities/customer/customer-balance.d.ts +1 -2
  24. package/dist/entities/customer/customer-balance.js +4 -11
  25. package/dist/entities/customer/customer-collection.d.ts +3 -3
  26. package/dist/entities/customer/customer.d.ts +7 -8
  27. package/dist/entities/customer/customer.js +5 -18
  28. package/dist/entities/discount/discount-collection.d.ts +3 -3
  29. package/dist/entities/discount/discount.d.ts +14 -13
  30. package/dist/entities/discount/discount.js +11 -30
  31. package/dist/entities/index.d.ts +1 -2
  32. package/dist/entities/price/price-collection.d.ts +3 -3
  33. package/dist/entities/price/price-quantity.d.ts +0 -1
  34. package/dist/entities/price/price-quantity.js +0 -6
  35. package/dist/entities/price/price-with-includes.d.ts +13 -12
  36. package/dist/entities/price/price-with-includes.js +10 -24
  37. package/dist/entities/price/price.d.ts +13 -12
  38. package/dist/entities/price/price.js +10 -23
  39. package/dist/entities/product/product-collection.d.ts +3 -3
  40. package/dist/entities/product/product-with-includes.d.ts +10 -10
  41. package/dist/entities/product/product-with-includes.js +7 -20
  42. package/dist/entities/product/product.d.ts +9 -9
  43. package/dist/entities/product/product.js +7 -17
  44. package/dist/entities/shared/adjustment-original-amount.d.ts +3 -4
  45. package/dist/entities/shared/adjustment-original-amount.js +1 -7
  46. package/dist/entities/shared/billing-details.d.ts +6 -7
  47. package/dist/entities/shared/billing-details.js +5 -12
  48. package/dist/entities/shared/chargeback-fee.d.ts +1 -2
  49. package/dist/entities/shared/chargeback-fee.js +1 -7
  50. package/dist/entities/shared/import-meta.d.ts +6 -0
  51. package/dist/entities/shared/import-meta.js +10 -0
  52. package/dist/entities/shared/index.d.ts +1 -0
  53. package/dist/entities/shared/index.js +1 -0
  54. package/dist/entities/shared/money.d.ts +3 -4
  55. package/dist/entities/shared/money.js +1 -7
  56. package/dist/entities/shared/payment-card.d.ts +5 -6
  57. package/dist/entities/shared/payment-card.js +3 -12
  58. package/dist/entities/shared/payment-method-details.d.ts +1 -2
  59. package/dist/entities/shared/payment-method-details.js +1 -7
  60. package/dist/entities/shared/payout-totals-adjustment.d.ts +4 -5
  61. package/dist/entities/shared/payout-totals-adjustment.js +3 -14
  62. package/dist/entities/shared/tax-rates-used.d.ts +4 -5
  63. package/dist/entities/shared/tax-rates-used.js +2 -8
  64. package/dist/entities/shared/time-period.d.ts +0 -1
  65. package/dist/entities/shared/time-period.js +0 -6
  66. package/dist/entities/shared/total-adjustments.d.ts +3 -4
  67. package/dist/entities/shared/total-adjustments.js +1 -11
  68. package/dist/entities/shared/totals.d.ts +0 -1
  69. package/dist/entities/shared/totals.js +0 -8
  70. package/dist/entities/shared/transaction-checkout.d.ts +1 -2
  71. package/dist/entities/shared/transaction-checkout.js +1 -6
  72. package/dist/entities/shared/transaction-payment-attempt.d.ts +8 -9
  73. package/dist/entities/shared/transaction-payment-attempt.js +7 -19
  74. package/dist/entities/shared/transaction-payout-totals-adjusted.d.ts +4 -5
  75. package/dist/entities/shared/transaction-payout-totals-adjusted.js +3 -14
  76. package/dist/entities/shared/transaction-payout-totals.d.ts +4 -5
  77. package/dist/entities/shared/transaction-payout-totals.js +2 -16
  78. package/dist/entities/shared/transaction-totals-adjusted.d.ts +6 -7
  79. package/dist/entities/shared/transaction-totals-adjusted.js +4 -15
  80. package/dist/entities/shared/transaction-totals.d.ts +6 -7
  81. package/dist/entities/shared/transaction-totals.js +4 -18
  82. package/dist/entities/shared/unit-price-override.d.ts +4 -5
  83. package/dist/entities/shared/unit-price-override.js +2 -8
  84. package/dist/entities/shared/unit-totals.d.ts +0 -1
  85. package/dist/entities/shared/unit-totals.js +0 -8
  86. package/dist/entities/subscription/index.d.ts +2 -0
  87. package/dist/entities/subscription/index.js +2 -0
  88. package/dist/entities/subscription/next-transaction-adjustment-item.d.ts +11 -0
  89. package/dist/entities/subscription/next-transaction-adjustment-item.js +14 -0
  90. package/dist/entities/subscription/next-transaction-adjustment-preview.d.ts +9 -0
  91. package/dist/entities/subscription/next-transaction-adjustment-preview.js +13 -0
  92. package/dist/entities/subscription/next-transaction.d.ts +5 -6
  93. package/dist/entities/subscription/next-transaction.js +2 -9
  94. package/dist/entities/subscription/subscription-collection.d.ts +3 -3
  95. package/dist/entities/subscription/subscription-discount.d.ts +4 -5
  96. package/dist/entities/subscription/subscription-discount.js +2 -9
  97. package/dist/entities/subscription/subscription-includes.d.ts +23 -24
  98. package/dist/entities/subscription/subscription-includes.js +20 -48
  99. package/dist/entities/subscription/subscription-item.d.ts +8 -9
  100. package/dist/entities/subscription/subscription-item.js +6 -21
  101. package/dist/entities/subscription/subscription-management.d.ts +3 -4
  102. package/dist/entities/subscription/subscription-management.js +3 -7
  103. package/dist/entities/subscription/subscription-preview-summary-result.d.ts +3 -4
  104. package/dist/entities/subscription/subscription-preview-summary-result.js +1 -8
  105. package/dist/entities/subscription/subscription-preview-update-summary.d.ts +0 -1
  106. package/dist/entities/subscription/subscription-preview-update-summary.js +0 -7
  107. package/dist/entities/subscription/subscription-preview.d.ts +25 -26
  108. package/dist/entities/subscription/subscription-preview.js +22 -51
  109. package/dist/entities/subscription/subscription-price.d.ts +7 -8
  110. package/dist/entities/subscription/subscription-price.js +5 -16
  111. package/dist/entities/subscription/subscription-scheduled-change.d.ts +4 -5
  112. package/dist/entities/subscription/subscription-scheduled-change.js +2 -9
  113. package/dist/entities/subscription/subscription-time-period.d.ts +4 -5
  114. package/dist/entities/subscription/subscription-time-period.js +2 -8
  115. package/dist/entities/subscription/subscription.d.ts +21 -22
  116. package/dist/entities/subscription/subscription.js +22 -48
  117. package/dist/entities/subscription/transaction-details-preview.d.ts +4 -5
  118. package/dist/entities/subscription/transaction-details-preview.js +2 -9
  119. package/dist/entities/subscription/transaction-line-item-preview.d.ts +5 -6
  120. package/dist/entities/subscription/transaction-line-item-preview.js +3 -13
  121. package/dist/entities/transaction/address-preview.d.ts +4 -5
  122. package/dist/entities/transaction/address-preview.js +2 -8
  123. package/dist/entities/transaction/adjustment-totals.d.ts +4 -5
  124. package/dist/entities/transaction/adjustment-totals.js +2 -13
  125. package/dist/entities/transaction/proration.d.ts +3 -4
  126. package/dist/entities/transaction/proration.js +1 -7
  127. package/dist/entities/transaction/transaction-adjustment-item.d.ts +7 -8
  128. package/dist/entities/transaction/transaction-adjustment-item.js +5 -17
  129. package/dist/entities/transaction/transaction-adjustment.d.ts +11 -12
  130. package/dist/entities/transaction/transaction-adjustment.js +9 -27
  131. package/dist/entities/transaction/transaction-collection.d.ts +3 -3
  132. package/dist/entities/transaction/transaction-details.d.ts +8 -9
  133. package/dist/entities/transaction/transaction-details.js +9 -19
  134. package/dist/entities/transaction/transaction-includes.d.ts +25 -26
  135. package/dist/entities/transaction/transaction-includes.js +26 -58
  136. package/dist/entities/transaction/transaction-invoice-pdf.d.ts +0 -1
  137. package/dist/entities/transaction/transaction-invoice-pdf.js +0 -5
  138. package/dist/entities/transaction/transaction-item-preview.d.ts +3 -4
  139. package/dist/entities/transaction/transaction-item-preview.js +2 -9
  140. package/dist/entities/transaction/transaction-item.d.ts +4 -6
  141. package/dist/entities/transaction/transaction-item.js +2 -11
  142. package/dist/entities/transaction/transaction-line-item.d.ts +8 -9
  143. package/dist/entities/transaction/transaction-line-item.js +6 -20
  144. package/dist/entities/transaction/transaction-preview.d.ts +10 -11
  145. package/dist/entities/transaction/transaction-preview.js +7 -21
  146. package/dist/entities/transaction/transaction-proration.d.ts +3 -4
  147. package/dist/entities/transaction/transaction-proration.js +2 -8
  148. package/dist/entities/transaction/transaction.d.ts +19 -20
  149. package/dist/entities/transaction/transaction.js +17 -45
  150. package/dist/entities/transaction/transactions-time-period.d.ts +4 -5
  151. package/dist/entities/transaction/transactions-time-period.js +2 -8
  152. package/dist/internal/api/case-helpers.d.ts +1 -0
  153. package/dist/internal/api/case-helpers.js +55 -0
  154. package/dist/internal/api/client.js +3 -2
  155. package/dist/internal/api/index.d.ts +2 -0
  156. package/dist/internal/api/index.js +7 -0
  157. package/dist/internal/base/path-parameters.d.ts +2 -2
  158. package/dist/internal/base/query-parameters.js +5 -1
  159. package/dist/internal/errors/generic.d.ts +6 -7
  160. package/dist/internal/errors/generic.js +1 -10
  161. package/dist/internal/index.d.ts +1 -1
  162. package/dist/internal/index.js +15 -3
  163. package/dist/resources/addresses/operations/create-address-request-body.d.ts +8 -8
  164. package/dist/resources/addresses/operations/index.d.ts +0 -4
  165. package/dist/resources/addresses/operations/index.js +0 -4
  166. package/dist/resources/addresses/operations/list-address-query-parameters.d.ts +2 -2
  167. package/dist/resources/addresses/operations/update-address-request-body.d.ts +8 -8
  168. package/dist/resources/adjustments/operations/create-adjustment-request-body.d.ts +3 -3
  169. package/dist/resources/adjustments/operations/list-adjustment-query-parameters.d.ts +5 -5
  170. package/dist/resources/businesses/operations/create-business-request-body.d.ts +4 -4
  171. package/dist/resources/businesses/operations/index.d.ts +0 -4
  172. package/dist/resources/businesses/operations/index.js +0 -4
  173. package/dist/resources/businesses/operations/list-business-query-parameters.d.ts +2 -2
  174. package/dist/resources/businesses/operations/update-business-request-body.d.ts +4 -4
  175. package/dist/resources/customers/index.d.ts +2 -2
  176. package/dist/resources/customers/index.js +1 -1
  177. package/dist/resources/customers/operations/create-customer-request-body.d.ts +2 -2
  178. package/dist/resources/customers/operations/get-credit-balance-query-parameters.d.ts +1 -1
  179. package/dist/resources/customers/operations/index.d.ts +0 -3
  180. package/dist/resources/customers/operations/index.js +0 -3
  181. package/dist/resources/customers/operations/list-customer-query-parameters.d.ts +2 -2
  182. package/dist/resources/customers/operations/update-customer-request-body.d.ts +2 -2
  183. package/dist/resources/discounts/index.d.ts +1 -1
  184. package/dist/resources/discounts/operations/create-discount-request-body.d.ts +9 -7
  185. package/dist/resources/discounts/operations/index.d.ts +0 -2
  186. package/dist/resources/discounts/operations/index.js +0 -2
  187. package/dist/resources/discounts/operations/list-discount-query-parameters.d.ts +2 -2
  188. package/dist/resources/discounts/operations/update-discount-request-body.d.ts +11 -9
  189. package/dist/resources/prices/index.d.ts +1 -1
  190. package/dist/resources/prices/operations/create-price-request-body.d.ts +10 -9
  191. package/dist/resources/prices/operations/index.d.ts +0 -2
  192. package/dist/resources/prices/operations/index.js +0 -2
  193. package/dist/resources/prices/operations/list-price-query-parameters.d.ts +3 -3
  194. package/dist/resources/prices/operations/update-price-request-body.d.ts +9 -8
  195. package/dist/resources/products/operations/create-product-request-body.d.ts +4 -4
  196. package/dist/resources/products/operations/index.d.ts +0 -2
  197. package/dist/resources/products/operations/index.js +0 -2
  198. package/dist/resources/products/operations/list-product-query-parameters.d.ts +3 -3
  199. package/dist/resources/products/operations/update-product-request-body.d.ts +4 -4
  200. package/dist/resources/subscriptions/index.d.ts +1 -1
  201. package/dist/resources/subscriptions/operations/cancel-subscription-request-object.d.ts +1 -1
  202. package/dist/resources/subscriptions/operations/create-subscription-charge-request-object.d.ts +3 -6
  203. package/dist/resources/subscriptions/operations/index.d.ts +0 -2
  204. package/dist/resources/subscriptions/operations/index.js +0 -2
  205. package/dist/resources/subscriptions/operations/list-subscription-query-parameters.d.ts +7 -7
  206. package/dist/resources/subscriptions/operations/pause-subscription-request-object.d.ts +2 -2
  207. package/dist/resources/subscriptions/operations/resume-subscription-request-object.d.ts +1 -1
  208. package/dist/resources/subscriptions/operations/update-subscription-request-body.d.ts +17 -12
  209. package/dist/resources/transactions/operations/create-transaction-request-body.d.ts +13 -18
  210. package/dist/resources/transactions/operations/index.d.ts +0 -2
  211. package/dist/resources/transactions/operations/index.js +0 -2
  212. package/dist/resources/transactions/operations/list-transaction-query-parameters.d.ts +21 -21
  213. package/dist/resources/transactions/operations/transaction-preview-request-body.d.ts +14 -10
  214. package/dist/resources/transactions/operations/update-transaction-request-body.d.ts +12 -17
  215. package/dist/types/address/address-response.d.ts +16 -0
  216. package/dist/types/address/index.d.ts +1 -1
  217. package/dist/types/address/index.js +1 -1
  218. package/dist/types/adjustment/adjustment-item-response.d.ts +10 -0
  219. package/dist/types/adjustment/{adjustment.d.ts → adjustment-response.d.ts} +6 -6
  220. package/dist/types/adjustment/adjustments-proration-response.d.ts +5 -0
  221. package/dist/types/adjustment/adjustments-time-period-response.d.ts +4 -0
  222. package/dist/types/adjustment/index.d.ts +4 -4
  223. package/dist/types/adjustment/index.js +4 -4
  224. package/dist/types/business/{business.d.ts → business-response.d.ts} +5 -5
  225. package/dist/types/business/businesses-contacts.d.ts +1 -1
  226. package/dist/types/business/index.d.ts +1 -1
  227. package/dist/types/business/index.js +1 -1
  228. package/dist/types/customer/credit-balance-response.d.ts +7 -0
  229. package/dist/types/customer/{customer.d.ts → customer-response.d.ts} +3 -3
  230. package/dist/types/customer/index.d.ts +2 -2
  231. package/dist/types/customer/index.js +2 -2
  232. package/dist/types/discount/discount-response.d.ts +21 -0
  233. package/dist/types/discount/index.d.ts +1 -1
  234. package/dist/types/discount/index.js +1 -1
  235. package/dist/types/price/index.d.ts +1 -1
  236. package/dist/types/price/index.js +1 -1
  237. package/dist/types/price/price-response.d.ts +18 -0
  238. package/dist/types/product/index.d.ts +1 -1
  239. package/dist/types/product/index.js +1 -1
  240. package/dist/types/product/product-response.d.ts +14 -0
  241. package/dist/types/shared/{adjustment-original-amount.d.ts → adjustment-original-amount-response.d.ts} +1 -1
  242. package/dist/types/shared/billing-details-create.d.ts +7 -0
  243. package/dist/types/shared/billing-details-response.d.ts +7 -0
  244. package/dist/types/shared/billing-details-update.d.ts +4 -4
  245. package/dist/types/shared/chargeback-fee.d.ts +2 -2
  246. package/dist/types/shared/custom-data.d.ts +1 -1
  247. package/dist/types/shared/import-meta-response.d.ts +4 -0
  248. package/dist/types/shared/index.d.ts +19 -15
  249. package/dist/types/shared/index.js +19 -15
  250. package/dist/types/shared/money-response.d.ts +5 -0
  251. package/dist/types/shared/money.d.ts +1 -1
  252. package/dist/types/shared/{payment-card.d.ts → payment-card-response.d.ts} +3 -3
  253. package/dist/types/shared/payment-method-details.d.ts +2 -2
  254. package/dist/types/shared/{payout-totals-adjustment.d.ts → payout-totals-adjustment-response.d.ts} +2 -2
  255. package/dist/types/shared/shared-price-response.d.ts +17 -0
  256. package/dist/types/shared/shared-product-response.d.ts +13 -0
  257. package/dist/types/shared/tax-rates-used-response.d.ts +5 -0
  258. package/dist/types/shared/{total-adjustments.d.ts → total-adjustments-response.d.ts} +1 -1
  259. package/dist/types/shared/transaction-checkout.d.ts +1 -1
  260. package/dist/types/shared/transaction-details-preview-response.d.ts +6 -0
  261. package/dist/types/shared/transaction-line-item-preview-response.d.ts +9 -0
  262. package/dist/types/shared/{transaction-payment-attempt.d.ts → transaction-payment-attempt-response.d.ts} +4 -4
  263. package/dist/types/shared/{transaction-payout-totals-adjusted.d.ts → transaction-payout-totals-adjusted-response.d.ts} +2 -2
  264. package/dist/types/shared/{transaction-payout-totals.d.ts → transaction-payout-totals-response.d.ts} +1 -1
  265. package/dist/types/shared/{transaction-totals-adjusted.d.ts → transaction-totals-adjusted-response.d.ts} +3 -3
  266. package/dist/types/shared/{transaction-totals.d.ts → transaction-totals-response.d.ts} +3 -3
  267. package/dist/types/shared/unit-price-override-response.d.ts +6 -0
  268. package/dist/types/shared/unit-price-override.d.ts +2 -2
  269. package/dist/types/subscription/index.d.ts +10 -10
  270. package/dist/types/subscription/index.js +10 -10
  271. package/dist/types/subscription/next-transaction-response.d.ts +11 -0
  272. package/dist/types/subscription/{subscription-discount.d.ts → subscription-discount-response.d.ts} +1 -1
  273. package/dist/types/subscription/subscription-item-response.d.ts +13 -0
  274. package/dist/types/subscription/subscription-management-response.d.ts +4 -0
  275. package/dist/types/subscription/subscription-preview-response.d.ts +29 -0
  276. package/dist/types/subscription/subscription-preview-update-summary.d.ts +4 -4
  277. package/dist/types/subscription/subscription-price-response.d.ts +11 -0
  278. package/dist/types/subscription/subscription-response.d.ts +17 -17
  279. package/dist/types/subscription/subscription-result-response.d.ts +4 -0
  280. package/dist/types/subscription/{subscription-scheduled-change.d.ts → subscription-scheduled-change-response.d.ts} +2 -2
  281. package/dist/types/subscription/subscription-time-period-response.d.ts +4 -0
  282. package/dist/types/subscription/subscription-update-item.d.ts +2 -2
  283. package/dist/types/transaction/{adjustment-totals.d.ts → adjustment-totals-response.d.ts} +2 -2
  284. package/dist/types/transaction/index.d.ts +10 -8
  285. package/dist/types/transaction/index.js +10 -8
  286. package/dist/types/transaction/transaction-adjustment-item-response.d.ts +10 -0
  287. package/dist/types/transaction/transaction-adjustment-response.d.ts +18 -0
  288. package/dist/types/transaction/transaction-details-response.d.ts +9 -0
  289. package/dist/types/transaction/transaction-item-response.d.ts +7 -0
  290. package/dist/types/transaction/transaction-item.d.ts +1 -4
  291. package/dist/types/transaction/transaction-line-item-response.d.ts +11 -0
  292. package/dist/types/transaction/transaction-preview-item.d.ts +2 -2
  293. package/dist/types/transaction/transaction-preview-response.d.ts +27 -0
  294. package/dist/types/transaction/transaction-proration-response.d.ts +5 -0
  295. package/dist/types/transaction/transaction-response.d.ts +32 -0
  296. package/dist/types/transaction/transactions-time-period-response.d.ts +4 -0
  297. package/dist/types/transaction/transactions-time-period.d.ts +2 -2
  298. package/dist/version.d.ts +1 -1
  299. package/dist/version.js +1 -1
  300. package/package.json +3 -1
  301. package/dist/resources/addresses/operations/create-address-path-parameters.d.ts +0 -3
  302. package/dist/resources/addresses/operations/get-address-path-parameters.d.ts +0 -4
  303. package/dist/resources/addresses/operations/list-address-path-parameters.d.ts +0 -3
  304. package/dist/resources/addresses/operations/update-address-path-parameters.d.ts +0 -4
  305. package/dist/resources/businesses/operations/create-business-path-parameters.d.ts +0 -3
  306. package/dist/resources/businesses/operations/get-business-path-parameters.d.ts +0 -4
  307. package/dist/resources/businesses/operations/list-business-path-parameters.d.ts +0 -3
  308. package/dist/resources/businesses/operations/update-business-path-parameters.d.ts +0 -4
  309. package/dist/resources/customers/operations/get-credit-balance-path-parameters.d.ts +0 -3
  310. package/dist/resources/customers/operations/get-customer-path-parameters.d.ts +0 -3
  311. package/dist/resources/customers/operations/update-customer-path-parameters.d.ts +0 -3
  312. package/dist/resources/discounts/operations/get-discount-path-parameters.d.ts +0 -3
  313. package/dist/resources/discounts/operations/update-discount-path-parameters.d.ts +0 -3
  314. package/dist/resources/prices/operations/get-price-path-parameters.d.ts +0 -3
  315. package/dist/resources/prices/operations/update-price-path-parameters.d.ts +0 -3
  316. package/dist/resources/products/operations/get-product-path-parameters.d.ts +0 -3
  317. package/dist/resources/products/operations/update-product-path-parameters.d.ts +0 -3
  318. package/dist/resources/subscriptions/operations/get-subscription-path-parameters.d.ts +0 -3
  319. package/dist/resources/subscriptions/operations/update-subscription-path-parameters.d.ts +0 -3
  320. package/dist/resources/transactions/operations/get-transaction-path-parameters.d.ts +0 -3
  321. package/dist/resources/transactions/operations/update-transaction-path-parameters.d.ts +0 -3
  322. package/dist/types/address/address.d.ts +0 -16
  323. package/dist/types/adjustment/adjustment-item.d.ts +0 -10
  324. package/dist/types/adjustment/adjustments-proration.d.ts +0 -5
  325. package/dist/types/adjustment/adjustments-time-period.d.ts +0 -4
  326. package/dist/types/customer/credit-balance.d.ts +0 -7
  327. package/dist/types/discount/discount.d.ts +0 -19
  328. package/dist/types/price/price.d.ts +0 -16
  329. package/dist/types/product/product.d.ts +0 -13
  330. package/dist/types/shared/billing-details.d.ts +0 -7
  331. package/dist/types/shared/shared-price.d.ts +0 -15
  332. package/dist/types/shared/shared-product.d.ts +0 -12
  333. package/dist/types/shared/tax-rates-used.d.ts +0 -5
  334. package/dist/types/shared/transaction-details-preview.d.ts +0 -6
  335. package/dist/types/shared/transaction-line-item-preview.d.ts +0 -9
  336. package/dist/types/subscription/next-transaction.d.ts +0 -6
  337. package/dist/types/subscription/subscription-item.d.ts +0 -13
  338. package/dist/types/subscription/subscription-item.js +0 -2
  339. package/dist/types/subscription/subscription-management.d.ts +0 -4
  340. package/dist/types/subscription/subscription-management.js +0 -2
  341. package/dist/types/subscription/subscription-preview.d.ts +0 -29
  342. package/dist/types/subscription/subscription-preview.js +0 -2
  343. package/dist/types/subscription/subscription-price.d.ts +0 -11
  344. package/dist/types/subscription/subscription-price.js +0 -2
  345. package/dist/types/subscription/subscription-result.d.ts +0 -4
  346. package/dist/types/subscription/subscription-result.js +0 -2
  347. package/dist/types/subscription/subscription-scheduled-change.js +0 -2
  348. package/dist/types/subscription/subscription-time-period.d.ts +0 -4
  349. package/dist/types/subscription/subscription-time-period.js +0 -2
  350. package/dist/types/transaction/adjustment-totals.js +0 -2
  351. package/dist/types/transaction/transaction-adjustment-item.d.ts +0 -10
  352. package/dist/types/transaction/transaction-adjustment-item.js +0 -2
  353. package/dist/types/transaction/transaction-adjustment.d.ts +0 -18
  354. package/dist/types/transaction/transaction-adjustment.js +0 -2
  355. package/dist/types/transaction/transaction-details.d.ts +0 -9
  356. package/dist/types/transaction/transaction-details.js +0 -2
  357. package/dist/types/transaction/transaction-line-item.d.ts +0 -11
  358. package/dist/types/transaction/transaction-line-item.js +0 -2
  359. package/dist/types/transaction/transaction-preview.d.ts +0 -27
  360. package/dist/types/transaction/transaction-preview.js +0 -2
  361. package/dist/types/transaction/transaction-proration.d.ts +0 -5
  362. package/dist/types/transaction/transaction-proration.js +0 -2
  363. package/dist/types/transaction/transaction.d.ts +0 -32
  364. package/dist/types/transaction/transaction.js +0 -2
  365. /package/dist/{resources/addresses/operations/create-address-path-parameters.js → types/address/address-response.js} +0 -0
  366. /package/dist/{resources/addresses/operations/get-address-path-parameters.js → types/adjustment/adjustment-item-response.js} +0 -0
  367. /package/dist/{resources/addresses/operations/list-address-path-parameters.js → types/adjustment/adjustment-response.js} +0 -0
  368. /package/dist/{resources/addresses/operations/update-address-path-parameters.js → types/adjustment/adjustments-proration-response.js} +0 -0
  369. /package/dist/{resources/businesses/operations/create-business-path-parameters.js → types/adjustment/adjustments-time-period-response.js} +0 -0
  370. /package/dist/{resources/businesses/operations/get-business-path-parameters.js → types/business/business-response.js} +0 -0
  371. /package/dist/{resources/businesses/operations/list-business-path-parameters.js → types/customer/credit-balance-response.js} +0 -0
  372. /package/dist/{resources/businesses/operations/update-business-path-parameters.js → types/customer/customer-response.js} +0 -0
  373. /package/dist/{resources/customers/operations/get-credit-balance-path-parameters.js → types/discount/discount-response.js} +0 -0
  374. /package/dist/{resources/customers/operations/get-customer-path-parameters.js → types/price/price-response.js} +0 -0
  375. /package/dist/{resources/customers/operations/update-customer-path-parameters.js → types/product/product-response.js} +0 -0
  376. /package/dist/{resources/discounts/operations/get-discount-path-parameters.js → types/shared/adjustment-original-amount-response.js} +0 -0
  377. /package/dist/{resources/discounts/operations/update-discount-path-parameters.js → types/shared/billing-details-create.js} +0 -0
  378. /package/dist/{resources/prices/operations/get-price-path-parameters.js → types/shared/billing-details-response.js} +0 -0
  379. /package/dist/{resources/prices/operations/update-price-path-parameters.js → types/shared/import-meta-response.js} +0 -0
  380. /package/dist/{resources/products/operations/get-product-path-parameters.js → types/shared/money-response.js} +0 -0
  381. /package/dist/{resources/products/operations/update-product-path-parameters.js → types/shared/payment-card-response.js} +0 -0
  382. /package/dist/{resources/subscriptions/operations/get-subscription-path-parameters.js → types/shared/payout-totals-adjustment-response.js} +0 -0
  383. /package/dist/{resources/subscriptions/operations/update-subscription-path-parameters.js → types/shared/shared-price-response.js} +0 -0
  384. /package/dist/{resources/transactions/operations/get-transaction-path-parameters.js → types/shared/shared-product-response.js} +0 -0
  385. /package/dist/{resources/transactions/operations/update-transaction-path-parameters.js → types/shared/tax-rates-used-response.js} +0 -0
  386. /package/dist/types/{address/address.js → shared/total-adjustments-response.js} +0 -0
  387. /package/dist/types/{adjustment/adjustment-item.js → shared/transaction-details-preview-response.js} +0 -0
  388. /package/dist/types/{adjustment/adjustment.js → shared/transaction-line-item-preview-response.js} +0 -0
  389. /package/dist/types/{adjustment/adjustments-proration.js → shared/transaction-payment-attempt-response.js} +0 -0
  390. /package/dist/types/{adjustment/adjustments-time-period.js → shared/transaction-payout-totals-adjusted-response.js} +0 -0
  391. /package/dist/types/{business/business.js → shared/transaction-payout-totals-response.js} +0 -0
  392. /package/dist/types/{customer/credit-balance.js → shared/transaction-totals-adjusted-response.js} +0 -0
  393. /package/dist/types/{customer/customer.js → shared/transaction-totals-response.js} +0 -0
  394. /package/dist/types/{discount/discount.js → shared/unit-price-override-response.js} +0 -0
  395. /package/dist/types/{price/price.js → subscription/next-transaction-response.js} +0 -0
  396. /package/dist/types/{product/product.js → subscription/subscription-discount-response.js} +0 -0
  397. /package/dist/types/{shared/adjustment-original-amount.js → subscription/subscription-item-response.js} +0 -0
  398. /package/dist/types/{shared/billing-details.js → subscription/subscription-management-response.js} +0 -0
  399. /package/dist/types/{shared/payment-card.js → subscription/subscription-preview-response.js} +0 -0
  400. /package/dist/types/{shared/payout-totals-adjustment.js → subscription/subscription-price-response.js} +0 -0
  401. /package/dist/types/{shared/shared-price.js → subscription/subscription-result-response.js} +0 -0
  402. /package/dist/types/{shared/shared-product.js → subscription/subscription-scheduled-change-response.js} +0 -0
  403. /package/dist/types/{shared/tax-rates-used.js → subscription/subscription-time-period-response.js} +0 -0
  404. /package/dist/types/{shared/total-adjustments.js → transaction/adjustment-totals-response.js} +0 -0
  405. /package/dist/types/{shared/transaction-details-preview.js → transaction/transaction-adjustment-item-response.js} +0 -0
  406. /package/dist/types/{shared/transaction-line-item-preview.js → transaction/transaction-adjustment-response.js} +0 -0
  407. /package/dist/types/{shared/transaction-payment-attempt.js → transaction/transaction-details-response.js} +0 -0
  408. /package/dist/types/{shared/transaction-payout-totals-adjusted.js → transaction/transaction-item-response.js} +0 -0
  409. /package/dist/types/{shared/transaction-payout-totals.js → transaction/transaction-line-item-response.js} +0 -0
  410. /package/dist/types/{shared/transaction-totals-adjusted.js → transaction/transaction-preview-response.js} +0 -0
  411. /package/dist/types/{shared/transaction-totals.js → transaction/transaction-proration-response.js} +0 -0
  412. /package/dist/types/{subscription/next-transaction.js → transaction/transaction-response.js} +0 -0
  413. /package/dist/types/{subscription/subscription-discount.js → transaction/transactions-time-period-response.js} +0 -0
@@ -2,5 +2,4 @@ import { type ITransactionInvoicePDF } from '../../types';
2
2
  export declare class TransactionInvoicePDF {
3
3
  readonly url: string;
4
4
  constructor(transaction: ITransactionInvoicePDF);
5
- toJson(): ITransactionInvoicePDF;
6
5
  }
@@ -5,10 +5,5 @@ class TransactionInvoicePDF {
5
5
  constructor(transaction) {
6
6
  this.url = transaction.url;
7
7
  }
8
- toJson() {
9
- return {
10
- url: this.url,
11
- };
12
- }
13
8
  }
14
9
  exports.TransactionInvoicePDF = TransactionInvoicePDF;
@@ -1,10 +1,9 @@
1
1
  import { PriceWithIncludes, Proration } from '../index';
2
2
  import { type ITransactionItemPreviewResponse } from '../../types';
3
3
  export declare class TransactionItemPreview {
4
- readonly price?: PriceWithIncludes | null | undefined;
4
+ readonly price: PriceWithIncludes | null;
5
5
  readonly quantity: number;
6
- readonly include_in_totals?: boolean | null | undefined;
7
- readonly proration?: Proration | null | undefined;
6
+ readonly includeInTotals: boolean | null;
7
+ readonly proration: Proration | null;
8
8
  constructor(transactionItem: ITransactionItemPreviewResponse);
9
- toJson(): ITransactionItemPreviewResponse;
10
9
  }
@@ -4,18 +4,11 @@ exports.TransactionItemPreview = void 0;
4
4
  const index_1 = require("../index");
5
5
  class TransactionItemPreview {
6
6
  constructor(transactionItem) {
7
+ var _a;
7
8
  this.price = transactionItem.price ? new index_1.PriceWithIncludes(transactionItem.price) : null;
8
9
  this.quantity = transactionItem.quantity;
9
- this.include_in_totals = transactionItem.include_in_totals;
10
+ this.includeInTotals = (_a = transactionItem.include_in_totals) !== null && _a !== void 0 ? _a : null;
10
11
  this.proration = transactionItem.proration ? new index_1.Proration(transactionItem.proration) : null;
11
12
  }
12
- toJson() {
13
- return {
14
- price: this.price,
15
- quantity: this.quantity,
16
- include_in_totals: this.include_in_totals,
17
- proration: this.proration,
18
- };
19
- }
20
13
  }
21
14
  exports.TransactionItemPreview = TransactionItemPreview;
@@ -1,10 +1,8 @@
1
- import { type ITransactionItem } from '../../types';
1
+ import { type ITransactionItemResponse } from '../../types';
2
2
  import { Price, TransactionProration } from '../index';
3
3
  export declare class TransactionItem {
4
- readonly price_id?: string | undefined | null;
5
- readonly price?: Price | undefined | null;
4
+ readonly price: Price | null;
6
5
  readonly quantity: number;
7
- readonly proration?: TransactionProration | undefined | null;
8
- constructor(transactionItem: ITransactionItem);
9
- toJson(): ITransactionItem;
6
+ readonly proration: TransactionProration | null;
7
+ constructor(transactionItem: ITransactionItemResponse);
10
8
  }
@@ -4,18 +4,9 @@ exports.TransactionItem = void 0;
4
4
  const index_1 = require("../index");
5
5
  class TransactionItem {
6
6
  constructor(transactionItem) {
7
- this.price_id = transactionItem.price_id;
8
- this.price = transactionItem.price ? new index_1.Price(transactionItem.price) : undefined;
7
+ this.price = transactionItem.price ? new index_1.Price(transactionItem.price) : null;
9
8
  this.quantity = transactionItem.quantity;
10
- this.proration = transactionItem.proration ? new index_1.TransactionProration(transactionItem.proration) : undefined;
11
- }
12
- toJson() {
13
- return {
14
- price_id: this.price_id,
15
- price: this.price,
16
- quantity: this.quantity,
17
- proration: this.proration,
18
- };
9
+ this.proration = transactionItem.proration ? new index_1.TransactionProration(transactionItem.proration) : null;
19
10
  }
20
11
  }
21
12
  exports.TransactionItem = TransactionItem;
@@ -1,14 +1,13 @@
1
- import { type ITransactionLineItem } from '../../types';
1
+ import { type ITransactionLineItemResponse } from '../../types';
2
2
  import { TransactionProration, UnitTotals, Totals, Product } from '../index';
3
3
  export declare class TransactionLineItem {
4
4
  readonly id: string;
5
- readonly price_id: string;
5
+ readonly priceId: string;
6
6
  readonly quantity: number;
7
- readonly proration?: TransactionProration | undefined | null;
8
- readonly tax_rate: string;
9
- readonly unit_totals?: UnitTotals | undefined | null;
10
- readonly totals?: Totals | undefined | null;
11
- readonly product?: Product | undefined | null;
12
- constructor(transactionLineItem: ITransactionLineItem);
13
- toJson(): ITransactionLineItem;
7
+ readonly proration: TransactionProration | null;
8
+ readonly taxRate: string;
9
+ readonly unitTotals: UnitTotals | null;
10
+ readonly totals: Totals | null;
11
+ readonly product: Product | null;
12
+ constructor(transactionLineItem: ITransactionLineItemResponse);
14
13
  }
@@ -5,27 +5,13 @@ const index_1 = require("../index");
5
5
  class TransactionLineItem {
6
6
  constructor(transactionLineItem) {
7
7
  this.id = transactionLineItem.id;
8
- this.price_id = transactionLineItem.price_id;
8
+ this.priceId = transactionLineItem.price_id;
9
9
  this.quantity = transactionLineItem.quantity;
10
- this.proration = transactionLineItem.proration
11
- ? new index_1.TransactionProration(transactionLineItem.proration)
12
- : undefined;
13
- this.tax_rate = transactionLineItem.tax_rate;
14
- this.unit_totals = transactionLineItem.unit_totals ? new index_1.UnitTotals(transactionLineItem.unit_totals) : undefined;
15
- this.totals = transactionLineItem.totals ? new index_1.Totals(transactionLineItem.totals) : undefined;
16
- this.product = transactionLineItem.product ? new index_1.Product(transactionLineItem.product) : undefined;
17
- }
18
- toJson() {
19
- return {
20
- id: this.id,
21
- price_id: this.price_id,
22
- quantity: this.quantity,
23
- proration: this.proration,
24
- tax_rate: this.tax_rate,
25
- unit_totals: this.unit_totals,
26
- totals: this.totals,
27
- product: this.product,
28
- };
10
+ this.proration = transactionLineItem.proration ? new index_1.TransactionProration(transactionLineItem.proration) : null;
11
+ this.taxRate = transactionLineItem.tax_rate;
12
+ this.unitTotals = transactionLineItem.unit_totals ? new index_1.UnitTotals(transactionLineItem.unit_totals) : null;
13
+ this.totals = transactionLineItem.totals ? new index_1.Totals(transactionLineItem.totals) : null;
14
+ this.product = transactionLineItem.product ? new index_1.Product(transactionLineItem.product) : null;
29
15
  }
30
16
  }
31
17
  exports.TransactionLineItem = TransactionLineItem;
@@ -1,17 +1,16 @@
1
- import { type ITransactionPreview } from '../../types';
1
+ import { type ITransactionPreviewResponse } from '../../types';
2
2
  import { AddressPreview, TransactionDetailsPreview, TransactionItemPreview } from '../index';
3
3
  import { type CurrencyCode } from '../../enums';
4
4
  export declare class TransactionPreview {
5
- readonly customer_id?: string | null | undefined;
6
- readonly address_id?: string | null | undefined;
7
- readonly business_id?: string | null | undefined;
8
- readonly currency_code: CurrencyCode;
9
- readonly discount_id?: string | null | undefined;
10
- readonly customer_ip_address?: string | null | undefined;
11
- readonly address?: AddressPreview | null | undefined;
12
- readonly ignore_trials?: boolean | null | undefined;
5
+ readonly customerId: string | null;
6
+ readonly addressId: string | null;
7
+ readonly businessId: string | null;
8
+ readonly currencyCode: CurrencyCode;
9
+ readonly discountId: string | null;
10
+ readonly customerIpAddress: string | null;
11
+ readonly address: AddressPreview | null;
12
+ readonly ignoreTrials: boolean | null;
13
13
  readonly items: TransactionItemPreview[];
14
14
  readonly details: TransactionDetailsPreview;
15
- constructor(transactionPreview: ITransactionPreview);
16
- toJson(): ITransactionPreview;
15
+ constructor(transactionPreview: ITransactionPreviewResponse);
17
16
  }
@@ -4,30 +4,16 @@ exports.TransactionPreview = void 0;
4
4
  const index_1 = require("../index");
5
5
  class TransactionPreview {
6
6
  constructor(transactionPreview) {
7
- this.customer_id = transactionPreview.customer_id;
8
- this.address_id = transactionPreview.address_id;
9
- this.business_id = transactionPreview.business_id;
10
- this.currency_code = transactionPreview.currency_code;
11
- this.discount_id = transactionPreview.discount_id;
12
- this.customer_ip_address = transactionPreview.customer_ip_address;
7
+ this.customerId = transactionPreview.customer_id ? transactionPreview.customer_id : null;
8
+ this.addressId = transactionPreview.address_id ? transactionPreview.address_id : null;
9
+ this.businessId = transactionPreview.business_id ? transactionPreview.business_id : null;
10
+ this.currencyCode = transactionPreview.currency_code;
11
+ this.discountId = transactionPreview.discount_id ? transactionPreview.discount_id : null;
12
+ this.customerIpAddress = transactionPreview.customer_ip_address ? transactionPreview.customer_ip_address : null;
13
13
  this.address = transactionPreview.address ? new index_1.AddressPreview(transactionPreview.address) : null;
14
- this.ignore_trials = transactionPreview.ignore_trials;
14
+ this.ignoreTrials = transactionPreview.ignore_trials ? transactionPreview.ignore_trials : null;
15
15
  this.items = transactionPreview.items.map((item) => new index_1.TransactionItemPreview(item));
16
16
  this.details = new index_1.TransactionDetailsPreview(transactionPreview.details);
17
17
  }
18
- toJson() {
19
- return {
20
- customer_id: this.customer_id,
21
- address_id: this.address_id,
22
- business_id: this.business_id,
23
- currency_code: this.currency_code,
24
- discount_id: this.discount_id,
25
- customer_ip_address: this.customer_ip_address,
26
- address: this.address,
27
- ignore_trials: this.ignore_trials,
28
- items: this.items,
29
- details: this.details,
30
- };
31
- }
32
18
  }
33
19
  exports.TransactionPreview = TransactionPreview;
@@ -1,8 +1,7 @@
1
- import { type ITransactionProration } from '../../types';
1
+ import { type ITransactionProrationResponse } from '../../types';
2
2
  import { TransactionsTimePeriod } from '../index';
3
3
  export declare class TransactionProration {
4
4
  readonly rate: string;
5
- readonly billing_period?: TransactionsTimePeriod | undefined;
6
- constructor(transactionProration: ITransactionProration);
7
- toJson(): ITransactionProration;
5
+ readonly billingPeriod: TransactionsTimePeriod | null;
6
+ constructor(transactionProration: ITransactionProrationResponse);
8
7
  }
@@ -5,15 +5,9 @@ const index_1 = require("../index");
5
5
  class TransactionProration {
6
6
  constructor(transactionProration) {
7
7
  this.rate = transactionProration.rate;
8
- this.billing_period = transactionProration.billing_period
8
+ this.billingPeriod = transactionProration.billing_period
9
9
  ? new index_1.TransactionsTimePeriod(transactionProration.billing_period)
10
- : undefined;
11
- }
12
- toJson() {
13
- return {
14
- rate: this.rate,
15
- billing_period: this.billing_period,
16
- };
10
+ : null;
17
11
  }
18
12
  }
19
13
  exports.TransactionProration = TransactionProration;
@@ -1,29 +1,28 @@
1
1
  import { type CustomData, BillingDetails, TransactionsTimePeriod, TransactionItem, TransactionDetails, TransactionPaymentAttempt, TransactionCheckout } from '../index';
2
2
  import { type TransactionStatus, type CurrencyCode, type TransactionOrigin, type CollectionMode } from '../../enums';
3
- import { type ITransaction } from '../../types';
3
+ import { type ITransactionResponse } from '../../types';
4
4
  export declare class Transaction {
5
5
  readonly id: string;
6
6
  readonly status: TransactionStatus;
7
- readonly customer_id?: string | undefined | null;
8
- readonly address_id?: string | undefined | null;
9
- readonly business_id?: string | undefined | null;
10
- readonly custom_data?: CustomData | undefined | null;
11
- readonly currency_code: CurrencyCode;
7
+ readonly customerId: string | null;
8
+ readonly addressId: string | null;
9
+ readonly businessId: string | null;
10
+ readonly customData: CustomData | null;
11
+ readonly currencyCode: CurrencyCode;
12
12
  readonly origin: TransactionOrigin;
13
- readonly subscription_id?: string | undefined | null;
14
- readonly invoice_id?: string | undefined | null;
15
- readonly invoice_number?: string | undefined | null;
16
- readonly collection_mode: CollectionMode;
17
- readonly discount_id?: string | undefined | null;
18
- readonly billing_details?: BillingDetails | undefined | null;
19
- readonly billing_period?: TransactionsTimePeriod | undefined | null;
13
+ readonly subscriptionId: string | null;
14
+ readonly invoiceId: string | null;
15
+ readonly invoiceNumber: string | null;
16
+ readonly collectionMode: CollectionMode;
17
+ readonly discountId: string | null;
18
+ readonly billingDetails: BillingDetails | null;
19
+ readonly billingPeriod: TransactionsTimePeriod | null;
20
20
  readonly items: TransactionItem[];
21
- readonly details?: TransactionDetails | undefined | null;
21
+ readonly details: TransactionDetails | null;
22
22
  readonly payments: TransactionPaymentAttempt[];
23
- readonly checkout?: TransactionCheckout | undefined | null;
24
- readonly created_at: string;
25
- readonly updated_at: string;
26
- readonly billed_at?: string | undefined | null;
27
- constructor(transaction: ITransaction);
28
- toJson(): ITransaction;
23
+ readonly checkout: TransactionCheckout | null;
24
+ readonly createdAt: string;
25
+ readonly updatedAt: string;
26
+ readonly billedAt: string | null;
27
+ constructor(transaction: ITransactionResponse);
29
28
  }
@@ -6,54 +6,26 @@ class Transaction {
6
6
  constructor(transaction) {
7
7
  this.id = transaction.id;
8
8
  this.status = transaction.status;
9
- this.customer_id = transaction.customer_id;
10
- this.address_id = transaction.address_id;
11
- this.business_id = transaction.business_id;
12
- this.custom_data = transaction.custom_data;
13
- this.currency_code = transaction.currency_code;
9
+ this.customerId = transaction.customer_id ? transaction.customer_id : null;
10
+ this.addressId = transaction.address_id ? transaction.address_id : null;
11
+ this.businessId = transaction.business_id ? transaction.business_id : null;
12
+ this.customData = transaction.custom_data ? transaction.custom_data : null;
13
+ this.currencyCode = transaction.currency_code;
14
14
  this.origin = transaction.origin;
15
- this.subscription_id = transaction.subscription_id;
16
- this.invoice_id = transaction.invoice_id;
17
- this.invoice_number = transaction.invoice_number;
18
- this.collection_mode = transaction.collection_mode;
19
- this.discount_id = transaction.discount_id;
20
- this.billing_details = transaction.billing_details ? new index_1.BillingDetails(transaction.billing_details) : undefined;
21
- this.billing_period = transaction.billing_period
22
- ? new index_1.TransactionsTimePeriod(transaction.billing_period)
23
- : undefined;
15
+ this.subscriptionId = transaction.subscription_id ? transaction.subscription_id : null;
16
+ this.invoiceId = transaction.invoice_id ? transaction.invoice_id : null;
17
+ this.invoiceNumber = transaction.invoice_number ? transaction.invoice_number : null;
18
+ this.collectionMode = transaction.collection_mode;
19
+ this.discountId = transaction.discount_id ? transaction.discount_id : null;
20
+ this.billingDetails = transaction.billing_details ? new index_1.BillingDetails(transaction.billing_details) : null;
21
+ this.billingPeriod = transaction.billing_period ? new index_1.TransactionsTimePeriod(transaction.billing_period) : null;
24
22
  this.items = transaction.items.map((item) => new index_1.TransactionItem(item));
25
- this.details = transaction.details ? new index_1.TransactionDetails(transaction.details) : undefined;
23
+ this.details = transaction.details ? new index_1.TransactionDetails(transaction.details) : null;
26
24
  this.payments = transaction.payments.map((payment) => new index_1.TransactionPaymentAttempt(payment));
27
- this.checkout = transaction.checkout ? new index_1.TransactionCheckout(transaction.checkout) : undefined;
28
- this.created_at = transaction.created_at;
29
- this.updated_at = transaction.updated_at;
30
- this.billed_at = transaction.billed_at;
31
- }
32
- toJson() {
33
- return {
34
- id: this.id,
35
- status: this.status,
36
- customer_id: this.customer_id,
37
- address_id: this.address_id,
38
- business_id: this.business_id,
39
- custom_data: this.custom_data,
40
- currency_code: this.currency_code,
41
- origin: this.origin,
42
- subscription_id: this.subscription_id,
43
- invoice_id: this.invoice_id,
44
- invoice_number: this.invoice_number,
45
- collection_mode: this.collection_mode,
46
- discount_id: this.discount_id,
47
- billing_details: this.billing_details,
48
- billing_period: this.billing_period,
49
- items: this.items,
50
- details: this.details,
51
- payments: this.payments,
52
- checkout: this.checkout,
53
- created_at: this.created_at,
54
- updated_at: this.updated_at,
55
- billed_at: this.billed_at,
56
- };
25
+ this.checkout = transaction.checkout ? new index_1.TransactionCheckout(transaction.checkout) : null;
26
+ this.createdAt = transaction.created_at;
27
+ this.updatedAt = transaction.updated_at;
28
+ this.billedAt = transaction.billed_at ? transaction.billed_at : null;
57
29
  }
58
30
  }
59
31
  exports.Transaction = Transaction;
@@ -1,7 +1,6 @@
1
- import { type ITransactionsTimePeriod } from '../../types';
1
+ import { type ITransactionsTimePeriodResponse } from '../../types';
2
2
  export declare class TransactionsTimePeriod {
3
- readonly starts_at: string;
4
- readonly ends_at: string;
5
- constructor(transactionsTimePeriod: ITransactionsTimePeriod);
6
- toJson(): ITransactionsTimePeriod;
3
+ readonly startsAt: string;
4
+ readonly endsAt: string;
5
+ constructor(transactionsTimePeriod: ITransactionsTimePeriodResponse);
7
6
  }
@@ -3,14 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TransactionsTimePeriod = void 0;
4
4
  class TransactionsTimePeriod {
5
5
  constructor(transactionsTimePeriod) {
6
- this.starts_at = transactionsTimePeriod.starts_at;
7
- this.ends_at = transactionsTimePeriod.ends_at;
8
- }
9
- toJson() {
10
- return {
11
- starts_at: this.starts_at,
12
- ends_at: this.ends_at,
13
- };
6
+ this.startsAt = transactionsTimePeriod.starts_at;
7
+ this.endsAt = transactionsTimePeriod.ends_at;
14
8
  }
15
9
  }
16
10
  exports.TransactionsTimePeriod = TransactionsTimePeriod;
@@ -0,0 +1 @@
1
+ export declare function convertToSnakeCase(input: unknown): unknown;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.convertToSnakeCase = void 0;
15
+ const lodash_1 = require("lodash");
16
+ function isTopLevelCustomDataCamel(input) {
17
+ return 'customData' in input;
18
+ }
19
+ function decamelizeKeys(obj) {
20
+ if (!(0, lodash_1.isObject)(obj) || (0, lodash_1.isDate)(obj) || (0, lodash_1.isRegExp)(obj) || (0, lodash_1.isBoolean)(obj) || (0, lodash_1.isFunction)(obj)) {
21
+ return obj;
22
+ }
23
+ let output;
24
+ let i = 0;
25
+ let l = 0;
26
+ if ((0, lodash_1.isArray)(obj)) {
27
+ output = [];
28
+ for (l = obj.length; i < l; i++) {
29
+ output.push(decamelizeKeys(obj[i]));
30
+ }
31
+ }
32
+ else {
33
+ output = {};
34
+ for (const key in obj) {
35
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
36
+ output[(0, lodash_1.snakeCase)(key)] = decamelizeKeys(obj[key]);
37
+ }
38
+ }
39
+ }
40
+ return output;
41
+ }
42
+ function convertToSnakeCase(input) {
43
+ if (!input || !(0, lodash_1.isObject)(input)) {
44
+ return input;
45
+ }
46
+ if (isTopLevelCustomDataCamel(input)) {
47
+ const { customData } = input, rest = __rest(input, ["customData"]);
48
+ const result = decamelizeKeys(rest);
49
+ return Object.assign(Object.assign({}, result), { custom_data: customData });
50
+ }
51
+ else {
52
+ return decamelizeKeys(input);
53
+ }
54
+ }
55
+ exports.convertToSnakeCase = convertToSnakeCase;
@@ -19,6 +19,7 @@ const version_1 = require("../../version");
19
19
  const environment_1 = require("./environment");
20
20
  const crypto_1 = require("crypto");
21
21
  const logger_1 = require("../base/logger");
22
+ const case_helpers_1 = require("./case-helpers");
22
23
  class Client {
23
24
  constructor(apiKey, options) {
24
25
  this.apiKey = apiKey;
@@ -60,7 +61,7 @@ class Client {
60
61
  logger_1.Logger.logRequest('POST', logUrl, headers);
61
62
  const rawResponse = yield (0, node_fetch_1.default)(`${this.baseUrl}${url}`, {
62
63
  method: 'POST',
63
- body: JSON.stringify(requestBody),
64
+ body: JSON.stringify((0, case_helpers_1.convertToSnakeCase)(requestBody)),
64
65
  headers,
65
66
  });
66
67
  logger_1.Logger.logResponse('POST', logUrl, headers, rawResponse);
@@ -74,7 +75,7 @@ class Client {
74
75
  logger_1.Logger.logRequest('PATCH', logUrl, headers);
75
76
  const rawResponse = yield (0, node_fetch_1.default)(`${this.baseUrl}${url}`, {
76
77
  method: 'PATCH',
77
- body: JSON.stringify(requestBody),
78
+ body: JSON.stringify((0, case_helpers_1.convertToSnakeCase)(requestBody)),
78
79
  headers,
79
80
  });
80
81
  logger_1.Logger.logResponse('PATCH', logUrl, headers, rawResponse);
@@ -0,0 +1,2 @@
1
+ export { Environment } from './environment';
2
+ export { convertToSnakeCase } from './case-helpers';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertToSnakeCase = exports.Environment = void 0;
4
+ var environment_1 = require("./environment");
5
+ Object.defineProperty(exports, "Environment", { enumerable: true, get: function () { return environment_1.Environment; } });
6
+ var case_helpers_1 = require("./case-helpers");
7
+ Object.defineProperty(exports, "convertToSnakeCase", { enumerable: true, get: function () { return case_helpers_1.convertToSnakeCase; } });
@@ -1,6 +1,6 @@
1
- export declare class PathParameters<T> {
1
+ export declare class PathParameters {
2
2
  private readonly url;
3
3
  private readonly pathParameters;
4
- constructor(url: string, pathParameters: T);
4
+ constructor(url: string, pathParameters: Record<string, string>);
5
5
  deriveUrl(): string;
6
6
  }
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.QueryParameters = void 0;
7
+ const snakeCase_1 = __importDefault(require("lodash/snakeCase"));
4
8
  class QueryParameters {
5
9
  constructor(queryParameters) {
6
10
  this.queryParameters = queryParameters;
@@ -10,7 +14,7 @@ class QueryParameters {
10
14
  for (const key in this.queryParameters) {
11
15
  const value = this.queryParameters[key];
12
16
  if (key && value) {
13
- urlSearchParam.append(key, `${value}`);
17
+ urlSearchParam.append((0, snakeCase_1.default)(key), `${value}`);
14
18
  }
15
19
  }
16
20
  return '?' + urlSearchParam.toString();
@@ -1,10 +1,9 @@
1
- import { type ErrorDetail } from '../../internal';
1
+ import { type ErrorDetail, type ErrorField } from '../../internal';
2
2
  export declare class ApiError extends Error {
3
- private readonly type;
4
- private readonly code;
5
- private readonly detail;
6
- private readonly documentationUrl;
7
- private readonly errors?;
3
+ readonly type: string;
4
+ readonly code: string;
5
+ readonly detail: string;
6
+ readonly documentationUrl: string;
7
+ readonly errors: ErrorField[] | null;
8
8
  constructor(errorDetail: ErrorDetail);
9
- toJson(): ErrorDetail;
10
9
  }
@@ -8,16 +8,7 @@ class ApiError extends Error {
8
8
  this.code = errorDetail.code;
9
9
  this.detail = errorDetail.detail;
10
10
  this.documentationUrl = errorDetail.documentation_url;
11
- this.errors = errorDetail.errors;
12
- }
13
- toJson() {
14
- return {
15
- type: this.type,
16
- code: this.code,
17
- detail: this.detail,
18
- documentation_url: this.documentationUrl,
19
- errors: this.errors,
20
- };
11
+ this.errors = errorDetail.errors ? errorDetail.errors : null;
21
12
  }
22
13
  }
23
14
  exports.ApiError = ApiError;
@@ -1,3 +1,3 @@
1
1
  export type { ErrorResponse, ResponsePaginated, Response, ErrorDetail, ErrorField } from './types/response';
2
2
  export type { PaddleOptions } from './types/config';
3
- export { Environment } from './api/environment';
3
+ export * from './api';
@@ -1,5 +1,17 @@
1
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
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Environment = void 0;
4
- var environment_1 = require("./api/environment");
5
- Object.defineProperty(exports, "Environment", { enumerable: true, get: function () { return environment_1.Environment; } });
17
+ __exportStar(require("./api"), exports);
@@ -1,12 +1,12 @@
1
1
  import { type ICustomData } from '../../../types';
2
2
  import { type CountryCode } from '../../../enums';
3
3
  export interface CreateAddressRequestBody {
4
- country_code: CountryCode;
5
- description?: string | undefined | null;
6
- first_line?: string | undefined | null;
7
- second_line?: string | undefined | null;
8
- city?: string | undefined | null;
9
- postal_code?: string | undefined | null;
10
- region?: string | undefined | null;
11
- custom_data?: ICustomData | undefined | null;
4
+ countryCode: CountryCode;
5
+ description?: string | null;
6
+ firstLine?: string | null;
7
+ secondLine?: string | null;
8
+ city?: string | null;
9
+ postalCode?: string | null;
10
+ region?: string | null;
11
+ customData?: ICustomData | null;
12
12
  }
@@ -1,7 +1,3 @@
1
- export * from './list-address-path-parameters';
2
1
  export * from './list-address-query-parameters';
3
- export * from './create-address-path-parameters';
4
2
  export * from './create-address-request-body';
5
- export * from './get-address-path-parameters';
6
- export * from './update-address-path-parameters';
7
3
  export * from './update-address-request-body';