@paddle/paddle-node-sdk 0.1.8 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (455) hide show
  1. package/CHANGELOG.md +39 -2
  2. package/README.md +47 -7
  3. package/dist/entities/address/address-collection.d.ts +3 -3
  4. package/dist/entities/address/address.d.ts +12 -13
  5. package/dist/entities/address/address.js +10 -26
  6. package/dist/entities/adjustment/adjustment-collection.d.ts +3 -3
  7. package/dist/entities/adjustment/adjustment-item-totals.d.ts +0 -1
  8. package/dist/entities/adjustment/adjustment-item-totals.js +0 -7
  9. package/dist/entities/adjustment/adjustment-item.d.ts +6 -7
  10. package/dist/entities/adjustment/adjustment-item.js +4 -14
  11. package/dist/entities/adjustment/adjustment-proration.d.ts +3 -4
  12. package/dist/entities/adjustment/adjustment-proration.js +2 -8
  13. package/dist/entities/adjustment/adjustment-time-period.d.ts +4 -5
  14. package/dist/entities/adjustment/adjustment-time-period.js +2 -8
  15. package/dist/entities/adjustment/adjustment.d.ts +10 -11
  16. package/dist/entities/adjustment/adjustment.js +8 -26
  17. package/dist/entities/business/business-collection.d.ts +3 -3
  18. package/dist/entities/business/business.d.ts +8 -9
  19. package/dist/entities/business/business.js +6 -19
  20. package/dist/entities/business/contacts.d.ts +1 -2
  21. package/dist/entities/business/contacts.js +1 -7
  22. package/dist/entities/customer/credit-balance.d.ts +5 -6
  23. package/dist/entities/customer/credit-balance.js +2 -9
  24. package/dist/entities/customer/customer-balance.d.ts +1 -2
  25. package/dist/entities/customer/customer-balance.js +4 -11
  26. package/dist/entities/customer/customer-collection.d.ts +3 -3
  27. package/dist/entities/customer/customer.d.ts +7 -8
  28. package/dist/entities/customer/customer.js +5 -18
  29. package/dist/entities/discount/discount-collection.d.ts +3 -3
  30. package/dist/entities/discount/discount.d.ts +14 -13
  31. package/dist/entities/discount/discount.js +11 -30
  32. package/dist/entities/index.d.ts +1 -2
  33. package/dist/entities/price/price-collection.d.ts +3 -3
  34. package/dist/entities/price/price-quantity.d.ts +0 -1
  35. package/dist/entities/price/price-quantity.js +0 -6
  36. package/dist/entities/price/price-with-includes.d.ts +13 -12
  37. package/dist/entities/price/price-with-includes.js +10 -24
  38. package/dist/entities/price/price.d.ts +13 -12
  39. package/dist/entities/price/price.js +10 -23
  40. package/dist/entities/pricing-preview/index.d.ts +4 -0
  41. package/dist/entities/pricing-preview/index.js +20 -0
  42. package/dist/entities/pricing-preview/pricing-preview-details.d.ts +6 -0
  43. package/dist/entities/pricing-preview/pricing-preview-details.js +10 -0
  44. package/dist/entities/pricing-preview/pricing-preview-discounts.d.ts +8 -0
  45. package/dist/entities/pricing-preview/pricing-preview-discounts.js +12 -0
  46. package/dist/entities/pricing-preview/pricing-preview-line-item.d.ts +17 -0
  47. package/dist/entities/pricing-preview/pricing-preview-line-item.js +21 -0
  48. package/dist/entities/pricing-preview/pricing-preview.d.ts +15 -0
  49. package/dist/entities/pricing-preview/pricing-preview.js +19 -0
  50. package/dist/entities/product/product-collection.d.ts +3 -3
  51. package/dist/entities/product/product-with-includes.d.ts +10 -10
  52. package/dist/entities/product/product-with-includes.js +7 -20
  53. package/dist/entities/product/product.d.ts +9 -9
  54. package/dist/entities/product/product.js +7 -17
  55. package/dist/entities/shared/adjustment-original-amount.d.ts +3 -4
  56. package/dist/entities/shared/adjustment-original-amount.js +1 -7
  57. package/dist/entities/shared/billing-details.d.ts +6 -7
  58. package/dist/entities/shared/billing-details.js +5 -12
  59. package/dist/entities/shared/chargeback-fee.d.ts +1 -2
  60. package/dist/entities/shared/chargeback-fee.js +1 -7
  61. package/dist/entities/shared/import-meta.d.ts +6 -0
  62. package/dist/entities/shared/import-meta.js +10 -0
  63. package/dist/entities/shared/index.d.ts +1 -0
  64. package/dist/entities/shared/index.js +1 -0
  65. package/dist/entities/shared/money.d.ts +3 -4
  66. package/dist/entities/shared/money.js +1 -7
  67. package/dist/entities/shared/payment-card.d.ts +5 -6
  68. package/dist/entities/shared/payment-card.js +3 -12
  69. package/dist/entities/shared/payment-method-details.d.ts +1 -2
  70. package/dist/entities/shared/payment-method-details.js +1 -7
  71. package/dist/entities/shared/payout-totals-adjustment.d.ts +4 -5
  72. package/dist/entities/shared/payout-totals-adjustment.js +3 -14
  73. package/dist/entities/shared/tax-rates-used.d.ts +4 -5
  74. package/dist/entities/shared/tax-rates-used.js +2 -8
  75. package/dist/entities/shared/time-period.d.ts +0 -1
  76. package/dist/entities/shared/time-period.js +0 -6
  77. package/dist/entities/shared/total-adjustments.d.ts +3 -4
  78. package/dist/entities/shared/total-adjustments.js +1 -11
  79. package/dist/entities/shared/totals.d.ts +0 -1
  80. package/dist/entities/shared/totals.js +0 -8
  81. package/dist/entities/shared/transaction-checkout.d.ts +1 -2
  82. package/dist/entities/shared/transaction-checkout.js +1 -6
  83. package/dist/entities/shared/transaction-payment-attempt.d.ts +8 -9
  84. package/dist/entities/shared/transaction-payment-attempt.js +7 -19
  85. package/dist/entities/shared/transaction-payout-totals-adjusted.d.ts +4 -5
  86. package/dist/entities/shared/transaction-payout-totals-adjusted.js +3 -14
  87. package/dist/entities/shared/transaction-payout-totals.d.ts +4 -5
  88. package/dist/entities/shared/transaction-payout-totals.js +2 -16
  89. package/dist/entities/shared/transaction-totals-adjusted.d.ts +6 -7
  90. package/dist/entities/shared/transaction-totals-adjusted.js +4 -15
  91. package/dist/entities/shared/transaction-totals.d.ts +6 -7
  92. package/dist/entities/shared/transaction-totals.js +4 -18
  93. package/dist/entities/shared/unit-price-override.d.ts +4 -5
  94. package/dist/entities/shared/unit-price-override.js +2 -8
  95. package/dist/entities/shared/unit-totals.d.ts +0 -1
  96. package/dist/entities/shared/unit-totals.js +0 -8
  97. package/dist/entities/subscription/index.d.ts +2 -0
  98. package/dist/entities/subscription/index.js +2 -0
  99. package/dist/entities/subscription/next-transaction-adjustment-item.d.ts +11 -0
  100. package/dist/entities/subscription/next-transaction-adjustment-item.js +14 -0
  101. package/dist/entities/subscription/next-transaction-adjustment-preview.d.ts +9 -0
  102. package/dist/entities/subscription/next-transaction-adjustment-preview.js +13 -0
  103. package/dist/entities/subscription/next-transaction.d.ts +5 -6
  104. package/dist/entities/subscription/next-transaction.js +2 -9
  105. package/dist/entities/subscription/subscription-collection.d.ts +3 -3
  106. package/dist/entities/subscription/subscription-discount.d.ts +4 -5
  107. package/dist/entities/subscription/subscription-discount.js +2 -9
  108. package/dist/entities/subscription/subscription-includes.d.ts +23 -24
  109. package/dist/entities/subscription/subscription-includes.js +20 -48
  110. package/dist/entities/subscription/subscription-item.d.ts +8 -9
  111. package/dist/entities/subscription/subscription-item.js +6 -21
  112. package/dist/entities/subscription/subscription-management.d.ts +3 -4
  113. package/dist/entities/subscription/subscription-management.js +3 -7
  114. package/dist/entities/subscription/subscription-preview-summary-result.d.ts +3 -4
  115. package/dist/entities/subscription/subscription-preview-summary-result.js +1 -8
  116. package/dist/entities/subscription/subscription-preview-update-summary.d.ts +0 -1
  117. package/dist/entities/subscription/subscription-preview-update-summary.js +0 -7
  118. package/dist/entities/subscription/subscription-preview.d.ts +25 -26
  119. package/dist/entities/subscription/subscription-preview.js +22 -51
  120. package/dist/entities/subscription/subscription-price.d.ts +7 -8
  121. package/dist/entities/subscription/subscription-price.js +5 -16
  122. package/dist/entities/subscription/subscription-scheduled-change.d.ts +4 -5
  123. package/dist/entities/subscription/subscription-scheduled-change.js +2 -9
  124. package/dist/entities/subscription/subscription-time-period.d.ts +4 -5
  125. package/dist/entities/subscription/subscription-time-period.js +2 -8
  126. package/dist/entities/subscription/subscription.d.ts +21 -22
  127. package/dist/entities/subscription/subscription.js +22 -48
  128. package/dist/entities/subscription/transaction-details-preview.d.ts +4 -5
  129. package/dist/entities/subscription/transaction-details-preview.js +2 -9
  130. package/dist/entities/subscription/transaction-line-item-preview.d.ts +5 -6
  131. package/dist/entities/subscription/transaction-line-item-preview.js +3 -13
  132. package/dist/entities/transaction/address-preview.d.ts +4 -5
  133. package/dist/entities/transaction/address-preview.js +2 -8
  134. package/dist/entities/transaction/adjustment-totals.d.ts +4 -5
  135. package/dist/entities/transaction/adjustment-totals.js +2 -13
  136. package/dist/entities/transaction/proration.d.ts +3 -4
  137. package/dist/entities/transaction/proration.js +1 -7
  138. package/dist/entities/transaction/transaction-adjustment-item.d.ts +7 -8
  139. package/dist/entities/transaction/transaction-adjustment-item.js +5 -17
  140. package/dist/entities/transaction/transaction-adjustment.d.ts +11 -12
  141. package/dist/entities/transaction/transaction-adjustment.js +9 -27
  142. package/dist/entities/transaction/transaction-collection.d.ts +3 -3
  143. package/dist/entities/transaction/transaction-details.d.ts +8 -9
  144. package/dist/entities/transaction/transaction-details.js +9 -19
  145. package/dist/entities/transaction/transaction-includes.d.ts +25 -26
  146. package/dist/entities/transaction/transaction-includes.js +26 -58
  147. package/dist/entities/transaction/transaction-invoice-pdf.d.ts +0 -1
  148. package/dist/entities/transaction/transaction-invoice-pdf.js +0 -5
  149. package/dist/entities/transaction/transaction-item-preview.d.ts +3 -4
  150. package/dist/entities/transaction/transaction-item-preview.js +2 -9
  151. package/dist/entities/transaction/transaction-item.d.ts +4 -6
  152. package/dist/entities/transaction/transaction-item.js +2 -11
  153. package/dist/entities/transaction/transaction-line-item.d.ts +8 -9
  154. package/dist/entities/transaction/transaction-line-item.js +6 -20
  155. package/dist/entities/transaction/transaction-preview.d.ts +10 -11
  156. package/dist/entities/transaction/transaction-preview.js +7 -21
  157. package/dist/entities/transaction/transaction-proration.d.ts +3 -4
  158. package/dist/entities/transaction/transaction-proration.js +2 -8
  159. package/dist/entities/transaction/transaction.d.ts +19 -20
  160. package/dist/entities/transaction/transaction.js +17 -45
  161. package/dist/entities/transaction/transactions-time-period.d.ts +4 -5
  162. package/dist/entities/transaction/transactions-time-period.js +2 -8
  163. package/dist/internal/api/case-helpers.d.ts +1 -0
  164. package/dist/internal/api/case-helpers.js +55 -0
  165. package/dist/internal/api/client.js +3 -2
  166. package/dist/internal/api/index.d.ts +2 -0
  167. package/dist/internal/api/index.js +7 -0
  168. package/dist/internal/base/path-parameters.d.ts +2 -2
  169. package/dist/internal/base/query-parameters.js +5 -1
  170. package/dist/internal/errors/generic.d.ts +6 -7
  171. package/dist/internal/errors/generic.js +1 -10
  172. package/dist/internal/index.d.ts +1 -1
  173. package/dist/internal/index.js +15 -3
  174. package/dist/paddle.d.ts +2 -1
  175. package/dist/paddle.js +1 -0
  176. package/dist/resources/addresses/index.d.ts +2 -1
  177. package/dist/resources/addresses/index.js +10 -7
  178. package/dist/resources/addresses/operations/create-address-request-body.d.ts +8 -8
  179. package/dist/resources/addresses/operations/index.d.ts +0 -4
  180. package/dist/resources/addresses/operations/index.js +0 -4
  181. package/dist/resources/addresses/operations/list-address-query-parameters.d.ts +2 -2
  182. package/dist/resources/addresses/operations/update-address-request-body.d.ts +8 -8
  183. package/dist/resources/adjustments/index.d.ts +1 -1
  184. package/dist/resources/adjustments/index.js +2 -4
  185. package/dist/resources/adjustments/operations/create-adjustment-request-body.d.ts +3 -3
  186. package/dist/resources/adjustments/operations/list-adjustment-query-parameters.d.ts +5 -5
  187. package/dist/resources/businesses/index.d.ts +2 -1
  188. package/dist/resources/businesses/index.js +10 -7
  189. package/dist/resources/businesses/operations/create-business-request-body.d.ts +4 -4
  190. package/dist/resources/businesses/operations/index.d.ts +0 -4
  191. package/dist/resources/businesses/operations/index.js +0 -4
  192. package/dist/resources/businesses/operations/list-business-query-parameters.d.ts +2 -2
  193. package/dist/resources/businesses/operations/update-business-request-body.d.ts +4 -4
  194. package/dist/resources/customers/index.d.ts +4 -3
  195. package/dist/resources/customers/index.js +8 -5
  196. package/dist/resources/customers/operations/create-customer-request-body.d.ts +2 -2
  197. package/dist/resources/customers/operations/get-credit-balance-query-parameters.d.ts +1 -1
  198. package/dist/resources/customers/operations/index.d.ts +0 -3
  199. package/dist/resources/customers/operations/index.js +0 -3
  200. package/dist/resources/customers/operations/list-customer-query-parameters.d.ts +2 -2
  201. package/dist/resources/customers/operations/update-customer-request-body.d.ts +2 -2
  202. package/dist/resources/discounts/index.d.ts +3 -2
  203. package/dist/resources/discounts/index.js +7 -4
  204. package/dist/resources/discounts/operations/create-discount-request-body.d.ts +9 -7
  205. package/dist/resources/discounts/operations/index.d.ts +0 -2
  206. package/dist/resources/discounts/operations/index.js +0 -2
  207. package/dist/resources/discounts/operations/list-discount-query-parameters.d.ts +2 -2
  208. package/dist/resources/discounts/operations/update-discount-request-body.d.ts +11 -9
  209. package/dist/resources/index.d.ts +1 -0
  210. package/dist/resources/index.js +1 -0
  211. package/dist/resources/prices/index.d.ts +3 -2
  212. package/dist/resources/prices/index.js +7 -4
  213. package/dist/resources/prices/operations/create-price-request-body.d.ts +10 -9
  214. package/dist/resources/prices/operations/index.d.ts +0 -2
  215. package/dist/resources/prices/operations/index.js +0 -2
  216. package/dist/resources/prices/operations/list-price-query-parameters.d.ts +3 -3
  217. package/dist/resources/prices/operations/update-price-request-body.d.ts +9 -8
  218. package/dist/resources/pricing-preview/index.d.ts +7 -0
  219. package/dist/resources/pricing-preview/index.js +42 -0
  220. package/dist/resources/pricing-preview/operations/index.d.ts +1 -0
  221. package/dist/resources/pricing-preview/operations/index.js +17 -0
  222. package/dist/resources/pricing-preview/operations/pricing-preview-request-body.d.ts +17 -0
  223. package/dist/resources/products/index.d.ts +2 -1
  224. package/dist/resources/products/index.js +7 -4
  225. package/dist/resources/products/operations/create-product-request-body.d.ts +4 -4
  226. package/dist/resources/products/operations/index.d.ts +0 -2
  227. package/dist/resources/products/operations/index.js +0 -2
  228. package/dist/resources/products/operations/list-product-query-parameters.d.ts +3 -3
  229. package/dist/resources/products/operations/update-product-request-body.d.ts +4 -4
  230. package/dist/resources/subscriptions/index.d.ts +2 -2
  231. package/dist/resources/subscriptions/index.js +2 -4
  232. package/dist/resources/subscriptions/operations/cancel-subscription-request-object.d.ts +1 -1
  233. package/dist/resources/subscriptions/operations/create-subscription-charge-request-object.d.ts +3 -6
  234. package/dist/resources/subscriptions/operations/index.d.ts +0 -2
  235. package/dist/resources/subscriptions/operations/index.js +0 -2
  236. package/dist/resources/subscriptions/operations/list-subscription-query-parameters.d.ts +7 -7
  237. package/dist/resources/subscriptions/operations/pause-subscription-request-object.d.ts +2 -2
  238. package/dist/resources/subscriptions/operations/resume-subscription-request-object.d.ts +1 -1
  239. package/dist/resources/subscriptions/operations/update-subscription-request-body.d.ts +17 -12
  240. package/dist/resources/transactions/index.d.ts +1 -1
  241. package/dist/resources/transactions/index.js +2 -4
  242. package/dist/resources/transactions/operations/create-transaction-request-body.d.ts +13 -18
  243. package/dist/resources/transactions/operations/index.d.ts +0 -2
  244. package/dist/resources/transactions/operations/index.js +0 -2
  245. package/dist/resources/transactions/operations/list-transaction-query-parameters.d.ts +21 -21
  246. package/dist/resources/transactions/operations/transaction-preview-request-body.d.ts +14 -10
  247. package/dist/resources/transactions/operations/update-transaction-request-body.d.ts +12 -17
  248. package/dist/types/address/address-response.d.ts +16 -0
  249. package/dist/types/address/index.d.ts +1 -1
  250. package/dist/types/address/index.js +1 -1
  251. package/dist/types/adjustment/adjustment-item-response.d.ts +10 -0
  252. package/dist/types/adjustment/{adjustment.d.ts → adjustment-response.d.ts} +6 -6
  253. package/dist/types/adjustment/adjustments-proration-response.d.ts +5 -0
  254. package/dist/types/adjustment/adjustments-time-period-response.d.ts +4 -0
  255. package/dist/types/adjustment/index.d.ts +4 -4
  256. package/dist/types/adjustment/index.js +4 -4
  257. package/dist/types/business/{business.d.ts → business-response.d.ts} +5 -5
  258. package/dist/types/business/businesses-contacts.d.ts +1 -1
  259. package/dist/types/business/index.d.ts +1 -1
  260. package/dist/types/business/index.js +1 -1
  261. package/dist/types/customer/credit-balance-response.d.ts +7 -0
  262. package/dist/types/customer/{customer.d.ts → customer-response.d.ts} +3 -3
  263. package/dist/types/customer/index.d.ts +2 -2
  264. package/dist/types/customer/index.js +2 -2
  265. package/dist/types/discount/discount-response.d.ts +21 -0
  266. package/dist/types/discount/index.d.ts +1 -1
  267. package/dist/types/discount/index.js +1 -1
  268. package/dist/types/index.d.ts +1 -0
  269. package/dist/types/index.js +1 -0
  270. package/dist/types/price/index.d.ts +1 -1
  271. package/dist/types/price/index.js +1 -1
  272. package/dist/types/price/price-response.d.ts +18 -0
  273. package/dist/types/pricing-preview/index.d.ts +5 -0
  274. package/dist/types/pricing-preview/index.js +21 -0
  275. package/dist/types/pricing-preview/pricing-preview-details-response.d.ts +4 -0
  276. package/dist/types/pricing-preview/pricing-preview-discounts-response.d.ts +6 -0
  277. package/dist/types/pricing-preview/pricing-preview-item-response.d.ts +4 -0
  278. package/dist/types/pricing-preview/pricing-preview-line-item-response.d.ts +15 -0
  279. package/dist/types/pricing-preview/pricing-preview-response.d.ts +15 -0
  280. package/dist/types/product/index.d.ts +1 -1
  281. package/dist/types/product/index.js +1 -1
  282. package/dist/types/product/product-response.d.ts +14 -0
  283. package/dist/types/shared/{adjustment-original-amount.d.ts → adjustment-original-amount-response.d.ts} +1 -1
  284. package/dist/types/shared/billing-details-create.d.ts +7 -0
  285. package/dist/types/shared/billing-details-response.d.ts +7 -0
  286. package/dist/types/shared/billing-details-update.d.ts +4 -4
  287. package/dist/types/shared/chargeback-fee.d.ts +2 -2
  288. package/dist/types/shared/custom-data.d.ts +1 -1
  289. package/dist/types/shared/import-meta-response.d.ts +4 -0
  290. package/dist/types/shared/index.d.ts +19 -15
  291. package/dist/types/shared/index.js +19 -15
  292. package/dist/types/shared/money-response.d.ts +5 -0
  293. package/dist/types/shared/money.d.ts +1 -1
  294. package/dist/types/shared/{payment-card.d.ts → payment-card-response.d.ts} +3 -3
  295. package/dist/types/shared/payment-method-details.d.ts +2 -2
  296. package/dist/types/shared/{payout-totals-adjustment.d.ts → payout-totals-adjustment-response.d.ts} +2 -2
  297. package/dist/types/shared/shared-price-response.d.ts +17 -0
  298. package/dist/types/shared/shared-product-response.d.ts +13 -0
  299. package/dist/types/shared/tax-rates-used-response.d.ts +5 -0
  300. package/dist/types/shared/{total-adjustments.d.ts → total-adjustments-response.d.ts} +1 -1
  301. package/dist/types/shared/transaction-checkout.d.ts +1 -1
  302. package/dist/types/shared/transaction-details-preview-response.d.ts +6 -0
  303. package/dist/types/shared/transaction-line-item-preview-response.d.ts +9 -0
  304. package/dist/types/shared/{transaction-payment-attempt.d.ts → transaction-payment-attempt-response.d.ts} +4 -4
  305. package/dist/types/shared/{transaction-payout-totals-adjusted.d.ts → transaction-payout-totals-adjusted-response.d.ts} +2 -2
  306. package/dist/types/shared/{transaction-payout-totals.d.ts → transaction-payout-totals-response.d.ts} +1 -1
  307. package/dist/types/shared/{transaction-totals-adjusted.d.ts → transaction-totals-adjusted-response.d.ts} +3 -3
  308. package/dist/types/shared/{transaction-totals.d.ts → transaction-totals-response.d.ts} +3 -3
  309. package/dist/types/shared/unit-price-override-response.d.ts +6 -0
  310. package/dist/types/shared/unit-price-override.d.ts +2 -2
  311. package/dist/types/subscription/index.d.ts +10 -10
  312. package/dist/types/subscription/index.js +10 -10
  313. package/dist/types/subscription/next-transaction-response.d.ts +11 -0
  314. package/dist/types/subscription/{subscription-discount.d.ts → subscription-discount-response.d.ts} +1 -1
  315. package/dist/types/subscription/subscription-item-response.d.ts +13 -0
  316. package/dist/types/subscription/subscription-management-response.d.ts +4 -0
  317. package/dist/types/subscription/subscription-preview-response.d.ts +29 -0
  318. package/dist/types/subscription/subscription-preview-update-summary.d.ts +4 -4
  319. package/dist/types/subscription/subscription-price-response.d.ts +11 -0
  320. package/dist/types/subscription/subscription-response.d.ts +17 -17
  321. package/dist/types/subscription/subscription-result-response.d.ts +4 -0
  322. package/dist/types/subscription/{subscription-scheduled-change.d.ts → subscription-scheduled-change-response.d.ts} +2 -2
  323. package/dist/types/subscription/subscription-time-period-response.d.ts +4 -0
  324. package/dist/types/subscription/subscription-update-item.d.ts +2 -2
  325. package/dist/types/transaction/{adjustment-totals.d.ts → adjustment-totals-response.d.ts} +2 -2
  326. package/dist/types/transaction/index.d.ts +10 -8
  327. package/dist/types/transaction/index.js +10 -8
  328. package/dist/types/transaction/transaction-adjustment-item-response.d.ts +10 -0
  329. package/dist/types/transaction/transaction-adjustment-response.d.ts +18 -0
  330. package/dist/types/transaction/transaction-details-response.d.ts +9 -0
  331. package/dist/types/transaction/transaction-item-response.d.ts +7 -0
  332. package/dist/types/transaction/transaction-item.d.ts +1 -4
  333. package/dist/types/transaction/transaction-line-item-response.d.ts +11 -0
  334. package/dist/types/transaction/transaction-preview-item.d.ts +2 -2
  335. package/dist/types/transaction/transaction-preview-response.d.ts +27 -0
  336. package/dist/types/transaction/transaction-proration-response.d.ts +5 -0
  337. package/dist/types/transaction/transaction-response.d.ts +32 -0
  338. package/dist/types/transaction/transactions-time-period-response.d.ts +4 -0
  339. package/dist/types/transaction/transactions-time-period.d.ts +2 -2
  340. package/dist/version.d.ts +1 -1
  341. package/dist/version.js +1 -1
  342. package/package.json +3 -1
  343. package/dist/resources/addresses/operations/create-address-path-parameters.d.ts +0 -3
  344. package/dist/resources/addresses/operations/get-address-path-parameters.d.ts +0 -4
  345. package/dist/resources/addresses/operations/list-address-path-parameters.d.ts +0 -3
  346. package/dist/resources/addresses/operations/update-address-path-parameters.d.ts +0 -4
  347. package/dist/resources/businesses/operations/create-business-path-parameters.d.ts +0 -3
  348. package/dist/resources/businesses/operations/get-business-path-parameters.d.ts +0 -4
  349. package/dist/resources/businesses/operations/list-business-path-parameters.d.ts +0 -3
  350. package/dist/resources/businesses/operations/update-business-path-parameters.d.ts +0 -4
  351. package/dist/resources/customers/operations/get-credit-balance-path-parameters.d.ts +0 -3
  352. package/dist/resources/customers/operations/get-customer-path-parameters.d.ts +0 -3
  353. package/dist/resources/customers/operations/update-customer-path-parameters.d.ts +0 -3
  354. package/dist/resources/discounts/operations/get-discount-path-parameters.d.ts +0 -3
  355. package/dist/resources/discounts/operations/update-discount-path-parameters.d.ts +0 -3
  356. package/dist/resources/prices/operations/get-price-path-parameters.d.ts +0 -3
  357. package/dist/resources/prices/operations/update-price-path-parameters.d.ts +0 -3
  358. package/dist/resources/products/operations/get-product-path-parameters.d.ts +0 -3
  359. package/dist/resources/products/operations/update-product-path-parameters.d.ts +0 -3
  360. package/dist/resources/subscriptions/operations/get-subscription-path-parameters.d.ts +0 -3
  361. package/dist/resources/subscriptions/operations/update-subscription-path-parameters.d.ts +0 -3
  362. package/dist/resources/transactions/operations/get-transaction-path-parameters.d.ts +0 -3
  363. package/dist/resources/transactions/operations/update-transaction-path-parameters.d.ts +0 -3
  364. package/dist/types/address/address.d.ts +0 -16
  365. package/dist/types/adjustment/adjustment-item.d.ts +0 -10
  366. package/dist/types/adjustment/adjustments-proration.d.ts +0 -5
  367. package/dist/types/adjustment/adjustments-time-period.d.ts +0 -4
  368. package/dist/types/customer/credit-balance.d.ts +0 -7
  369. package/dist/types/discount/discount.d.ts +0 -19
  370. package/dist/types/price/price.d.ts +0 -16
  371. package/dist/types/product/product.d.ts +0 -13
  372. package/dist/types/shared/billing-details.d.ts +0 -7
  373. package/dist/types/shared/shared-price.d.ts +0 -15
  374. package/dist/types/shared/shared-product.d.ts +0 -12
  375. package/dist/types/shared/tax-rates-used.d.ts +0 -5
  376. package/dist/types/shared/transaction-details-preview.d.ts +0 -6
  377. package/dist/types/shared/transaction-line-item-preview.d.ts +0 -9
  378. package/dist/types/subscription/next-transaction.d.ts +0 -6
  379. package/dist/types/subscription/subscription-item.d.ts +0 -13
  380. package/dist/types/subscription/subscription-management.d.ts +0 -4
  381. package/dist/types/subscription/subscription-preview.d.ts +0 -29
  382. package/dist/types/subscription/subscription-price.d.ts +0 -11
  383. package/dist/types/subscription/subscription-result.d.ts +0 -4
  384. package/dist/types/subscription/subscription-time-period.d.ts +0 -4
  385. package/dist/types/subscription/subscription-time-period.js +0 -2
  386. package/dist/types/transaction/adjustment-totals.js +0 -2
  387. package/dist/types/transaction/transaction-adjustment-item.d.ts +0 -10
  388. package/dist/types/transaction/transaction-adjustment-item.js +0 -2
  389. package/dist/types/transaction/transaction-adjustment.d.ts +0 -18
  390. package/dist/types/transaction/transaction-adjustment.js +0 -2
  391. package/dist/types/transaction/transaction-details.d.ts +0 -9
  392. package/dist/types/transaction/transaction-details.js +0 -2
  393. package/dist/types/transaction/transaction-line-item.d.ts +0 -11
  394. package/dist/types/transaction/transaction-line-item.js +0 -2
  395. package/dist/types/transaction/transaction-preview.d.ts +0 -27
  396. package/dist/types/transaction/transaction-preview.js +0 -2
  397. package/dist/types/transaction/transaction-proration.d.ts +0 -5
  398. package/dist/types/transaction/transaction-proration.js +0 -2
  399. package/dist/types/transaction/transaction.d.ts +0 -32
  400. package/dist/types/transaction/transaction.js +0 -2
  401. /package/dist/resources/{addresses/operations/create-address-path-parameters.js → pricing-preview/operations/pricing-preview-request-body.js} +0 -0
  402. /package/dist/{resources/addresses/operations/get-address-path-parameters.js → types/address/address-response.js} +0 -0
  403. /package/dist/{resources/addresses/operations/list-address-path-parameters.js → types/adjustment/adjustment-item-response.js} +0 -0
  404. /package/dist/{resources/addresses/operations/update-address-path-parameters.js → types/adjustment/adjustment-response.js} +0 -0
  405. /package/dist/{resources/businesses/operations/create-business-path-parameters.js → types/adjustment/adjustments-proration-response.js} +0 -0
  406. /package/dist/{resources/businesses/operations/get-business-path-parameters.js → types/adjustment/adjustments-time-period-response.js} +0 -0
  407. /package/dist/{resources/businesses/operations/list-business-path-parameters.js → types/business/business-response.js} +0 -0
  408. /package/dist/{resources/businesses/operations/update-business-path-parameters.js → types/customer/credit-balance-response.js} +0 -0
  409. /package/dist/{resources/customers/operations/get-credit-balance-path-parameters.js → types/customer/customer-response.js} +0 -0
  410. /package/dist/{resources/customers/operations/get-customer-path-parameters.js → types/discount/discount-response.js} +0 -0
  411. /package/dist/{resources/customers/operations/update-customer-path-parameters.js → types/price/price-response.js} +0 -0
  412. /package/dist/{resources/discounts/operations/get-discount-path-parameters.js → types/pricing-preview/pricing-preview-details-response.js} +0 -0
  413. /package/dist/{resources/discounts/operations/update-discount-path-parameters.js → types/pricing-preview/pricing-preview-discounts-response.js} +0 -0
  414. /package/dist/{resources/prices/operations/get-price-path-parameters.js → types/pricing-preview/pricing-preview-item-response.js} +0 -0
  415. /package/dist/{resources/prices/operations/update-price-path-parameters.js → types/pricing-preview/pricing-preview-line-item-response.js} +0 -0
  416. /package/dist/{resources/products/operations/get-product-path-parameters.js → types/pricing-preview/pricing-preview-response.js} +0 -0
  417. /package/dist/{resources/products/operations/update-product-path-parameters.js → types/product/product-response.js} +0 -0
  418. /package/dist/{resources/subscriptions/operations/get-subscription-path-parameters.js → types/shared/adjustment-original-amount-response.js} +0 -0
  419. /package/dist/{resources/subscriptions/operations/update-subscription-path-parameters.js → types/shared/billing-details-create.js} +0 -0
  420. /package/dist/{resources/transactions/operations/get-transaction-path-parameters.js → types/shared/billing-details-response.js} +0 -0
  421. /package/dist/{resources/transactions/operations/update-transaction-path-parameters.js → types/shared/import-meta-response.js} +0 -0
  422. /package/dist/types/{address/address.js → shared/money-response.js} +0 -0
  423. /package/dist/types/{adjustment/adjustment-item.js → shared/payment-card-response.js} +0 -0
  424. /package/dist/types/{adjustment/adjustment.js → shared/payout-totals-adjustment-response.js} +0 -0
  425. /package/dist/types/{adjustment/adjustments-proration.js → shared/shared-price-response.js} +0 -0
  426. /package/dist/types/{adjustment/adjustments-time-period.js → shared/shared-product-response.js} +0 -0
  427. /package/dist/types/{business/business.js → shared/tax-rates-used-response.js} +0 -0
  428. /package/dist/types/{customer/credit-balance.js → shared/total-adjustments-response.js} +0 -0
  429. /package/dist/types/{customer/customer.js → shared/transaction-details-preview-response.js} +0 -0
  430. /package/dist/types/{discount/discount.js → shared/transaction-line-item-preview-response.js} +0 -0
  431. /package/dist/types/{price/price.js → shared/transaction-payment-attempt-response.js} +0 -0
  432. /package/dist/types/{product/product.js → shared/transaction-payout-totals-adjusted-response.js} +0 -0
  433. /package/dist/types/shared/{adjustment-original-amount.js → transaction-payout-totals-response.js} +0 -0
  434. /package/dist/types/shared/{billing-details.js → transaction-totals-adjusted-response.js} +0 -0
  435. /package/dist/types/shared/{payment-card.js → transaction-totals-response.js} +0 -0
  436. /package/dist/types/shared/{payout-totals-adjustment.js → unit-price-override-response.js} +0 -0
  437. /package/dist/types/{shared/shared-price.js → subscription/next-transaction-response.js} +0 -0
  438. /package/dist/types/{shared/shared-product.js → subscription/subscription-discount-response.js} +0 -0
  439. /package/dist/types/{shared/tax-rates-used.js → subscription/subscription-item-response.js} +0 -0
  440. /package/dist/types/{shared/total-adjustments.js → subscription/subscription-management-response.js} +0 -0
  441. /package/dist/types/{shared/transaction-details-preview.js → subscription/subscription-preview-response.js} +0 -0
  442. /package/dist/types/{shared/transaction-line-item-preview.js → subscription/subscription-price-response.js} +0 -0
  443. /package/dist/types/{shared/transaction-payment-attempt.js → subscription/subscription-result-response.js} +0 -0
  444. /package/dist/types/{shared/transaction-payout-totals-adjusted.js → subscription/subscription-scheduled-change-response.js} +0 -0
  445. /package/dist/types/{shared/transaction-payout-totals.js → subscription/subscription-time-period-response.js} +0 -0
  446. /package/dist/types/{shared/transaction-totals-adjusted.js → transaction/adjustment-totals-response.js} +0 -0
  447. /package/dist/types/{shared/transaction-totals.js → transaction/transaction-adjustment-item-response.js} +0 -0
  448. /package/dist/types/{subscription/next-transaction.js → transaction/transaction-adjustment-response.js} +0 -0
  449. /package/dist/types/{subscription/subscription-discount.js → transaction/transaction-details-response.js} +0 -0
  450. /package/dist/types/{subscription/subscription-item.js → transaction/transaction-item-response.js} +0 -0
  451. /package/dist/types/{subscription/subscription-management.js → transaction/transaction-line-item-response.js} +0 -0
  452. /package/dist/types/{subscription/subscription-preview.js → transaction/transaction-preview-response.js} +0 -0
  453. /package/dist/types/{subscription/subscription-price.js → transaction/transaction-proration-response.js} +0 -0
  454. /package/dist/types/{subscription/subscription-result.js → transaction/transaction-response.js} +0 -0
  455. /package/dist/types/{subscription/subscription-scheduled-change.js → transaction/transactions-time-period-response.js} +0 -0
@@ -36,10 +36,8 @@ const CustomerPaths = {
36
36
  __exportStar(require("./operations"), exports);
37
37
  class CustomersResource extends base_1.BaseResource {
38
38
  list(queryParams) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- const queryParameters = new base_1.QueryParameters(queryParams);
41
- return new entities_1.CustomerCollection(this.client, CustomerPaths.list + queryParameters.toQueryString());
42
- });
39
+ const queryParameters = new base_1.QueryParameters(queryParams);
40
+ return new entities_1.CustomerCollection(this.client, CustomerPaths.list + queryParameters.toQueryString());
43
41
  }
44
42
  create(createCustomerParameters) {
45
43
  return __awaiter(this, void 0, void 0, function* () {
@@ -76,7 +74,12 @@ class CustomersResource extends base_1.BaseResource {
76
74
  const queryParameters = new base_1.QueryParameters(queryParams);
77
75
  const response = yield this.client.get(urlWithPathParams, queryParameters);
78
76
  const data = this.handleResponse(response);
79
- return new entities_1.CreditBalance(data);
77
+ return data.map((balance) => new entities_1.CreditBalance(balance));
78
+ });
79
+ }
80
+ archive(customerId) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ return yield this.update(customerId, { status: 'archived' });
80
83
  });
81
84
  }
82
85
  }
@@ -1,7 +1,7 @@
1
1
  import { type ICustomData } from '../../../types';
2
2
  export interface CreateCustomerRequestBody {
3
3
  email: string;
4
- name?: string | undefined | null;
5
- custom_data?: ICustomData | undefined | null;
4
+ name?: string | null;
5
+ customData?: ICustomData | null;
6
6
  locale?: string;
7
7
  }
@@ -1,4 +1,4 @@
1
1
  import { type CurrencyCode } from '../../../enums';
2
2
  export interface GetCreditBalanceQueryParameters {
3
- currency_code?: CurrencyCode[];
3
+ currencyCode?: CurrencyCode[];
4
4
  }
@@ -1,7 +1,4 @@
1
1
  export * from './list-customer-query-parameters';
2
2
  export * from './create-customer-request-body';
3
- export * from './get-customer-path-parameters';
4
- export * from './update-customer-path-parameters';
5
3
  export * from './update-customer-request-body';
6
- export * from './get-credit-balance-path-parameters';
7
4
  export * from './get-credit-balance-query-parameters';
@@ -16,8 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./list-customer-query-parameters"), exports);
18
18
  __exportStar(require("./create-customer-request-body"), exports);
19
- __exportStar(require("./get-customer-path-parameters"), exports);
20
- __exportStar(require("./update-customer-path-parameters"), exports);
21
19
  __exportStar(require("./update-customer-request-body"), exports);
22
- __exportStar(require("./get-credit-balance-path-parameters"), exports);
23
20
  __exportStar(require("./get-credit-balance-query-parameters"), exports);
@@ -2,8 +2,8 @@ import { type Status } from '../../../enums';
2
2
  export interface ListCustomerQueryParameters {
3
3
  after?: string;
4
4
  id?: string[];
5
- order_by?: string;
6
- per_page?: number;
5
+ orderBy?: string;
6
+ perPage?: number;
7
7
  search?: string;
8
8
  status?: Status[];
9
9
  }
@@ -1,9 +1,9 @@
1
1
  import { type ICustomData } from '../../../types';
2
2
  import { type Status } from '../../../enums';
3
3
  export interface UpdateCustomerRequestBody {
4
- name?: string | undefined | null;
4
+ name?: string | null;
5
5
  email?: string;
6
6
  status?: Status;
7
- custom_data?: ICustomData | undefined | null;
7
+ customData?: ICustomData | null;
8
8
  locale?: string;
9
9
  }
@@ -1,10 +1,11 @@
1
1
  import { Discount, DiscountCollection } from '../../entities';
2
2
  import { BaseResource } from '../../internal/base';
3
- import { type ListDiscountQueryParameters, type CreateDiscountRequestBody, type UpdateDiscountRequestBody } from './operations';
3
+ import { type CreateDiscountRequestBody, type ListDiscountQueryParameters, type UpdateDiscountRequestBody } from './operations';
4
4
  export * from './operations';
5
5
  export declare class DiscountsResource extends BaseResource {
6
- list(queryParams?: ListDiscountQueryParameters): Promise<DiscountCollection>;
6
+ list(queryParams?: ListDiscountQueryParameters): DiscountCollection;
7
7
  create(createDiscountParameters: CreateDiscountRequestBody): Promise<Discount>;
8
8
  get(discountId: string): Promise<Discount>;
9
9
  update(discountId: string, updateDiscount: UpdateDiscountRequestBody): Promise<Discount>;
10
+ archive(discountId: string): Promise<Discount>;
10
11
  }
@@ -35,10 +35,8 @@ const DiscountPaths = {
35
35
  __exportStar(require("./operations"), exports);
36
36
  class DiscountsResource extends base_1.BaseResource {
37
37
  list(queryParams) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- const queryParameters = new base_1.QueryParameters(queryParams);
40
- return new entities_1.DiscountCollection(this.client, DiscountPaths.list + queryParameters.toQueryString());
41
- });
38
+ const queryParameters = new base_1.QueryParameters(queryParams);
39
+ return new entities_1.DiscountCollection(this.client, DiscountPaths.list + queryParameters.toQueryString());
42
40
  }
43
41
  create(createDiscountParameters) {
44
42
  return __awaiter(this, void 0, void 0, function* () {
@@ -67,5 +65,10 @@ class DiscountsResource extends base_1.BaseResource {
67
65
  return new entities_1.Discount(data);
68
66
  });
69
67
  }
68
+ archive(discountId) {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ return yield this.update(discountId, { status: 'archived' });
71
+ });
72
+ }
70
73
  }
71
74
  exports.DiscountsResource = DiscountsResource;
@@ -1,14 +1,16 @@
1
1
  import { type CurrencyCode, type DiscountType } from '../../../enums';
2
+ import { type ICustomData } from '../../../types';
2
3
  export interface CreateDiscountRequestBody {
3
4
  amount: string;
4
5
  description: string;
5
6
  type: DiscountType;
6
- enabled_for_checkout?: boolean | undefined | null;
7
- code?: string | undefined | null;
8
- currency_code?: CurrencyCode | undefined | null;
7
+ enabledForCheckout?: boolean;
8
+ code?: string | null;
9
+ currencyCode?: CurrencyCode | null;
9
10
  recur?: boolean;
10
- maximum_recurring_intervals?: number | undefined | null;
11
- usage_limit?: number | undefined | null;
12
- restrict_to?: string[] | undefined | null;
13
- expires_at?: string | undefined | null;
11
+ maximumRecurringIntervals?: number | null;
12
+ usageLimit?: number | null;
13
+ restrictTo?: string[] | null;
14
+ expiresAt?: string | null;
15
+ customData?: ICustomData | null;
14
16
  }
@@ -1,5 +1,3 @@
1
1
  export * from './list-discount-query-parameters';
2
2
  export * from './create-discount-request-body';
3
- export * from './get-discount-path-parameters';
4
- export * from './update-discount-path-parameters';
5
3
  export * from './update-discount-request-body';
@@ -16,6 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./list-discount-query-parameters"), exports);
18
18
  __exportStar(require("./create-discount-request-body"), exports);
19
- __exportStar(require("./get-discount-path-parameters"), exports);
20
- __exportStar(require("./update-discount-path-parameters"), exports);
21
19
  __exportStar(require("./update-discount-request-body"), exports);
@@ -3,7 +3,7 @@ export interface ListDiscountQueryParameters {
3
3
  after?: string;
4
4
  code?: string[];
5
5
  id?: string[];
6
- order_by?: string;
7
- per_page?: number;
6
+ orderBy?: string;
7
+ perPage?: number;
8
8
  status?: DiscountStatus[];
9
9
  }
@@ -1,15 +1,17 @@
1
- import { type Status, type PaymentType, type CurrencyCode } from '../../../enums';
1
+ import { type CurrencyCode, type DiscountType, type Status } from '../../../enums';
2
+ import { type ICustomData } from '../../../types';
2
3
  export interface UpdateDiscountRequestBody {
3
4
  status?: Status;
4
5
  description?: string;
5
- enabled_for_checkout?: boolean;
6
- code?: string | undefined | null;
7
- type?: PaymentType;
6
+ enabledForCheckout?: boolean;
7
+ code?: string | null;
8
+ type?: DiscountType;
8
9
  amount?: string;
9
- currency_code?: CurrencyCode | undefined | null;
10
+ currencyCode?: CurrencyCode | null;
10
11
  recur?: boolean;
11
- maximum_recurring_intervals?: number | undefined | null;
12
- usage_limit?: number | undefined | null;
13
- restrict_to?: any[] | undefined | null;
14
- expires_at?: string | undefined | null;
12
+ maximumRecurringIntervals?: number | null;
13
+ usageLimit?: number | null;
14
+ restrictTo?: string[] | null;
15
+ expiresAt?: string | null;
16
+ customData?: ICustomData | null;
15
17
  }
@@ -7,3 +7,4 @@ export * from './prices';
7
7
  export * from './products';
8
8
  export * from './subscriptions';
9
9
  export * from './transactions';
10
+ export * from './pricing-preview';
@@ -23,3 +23,4 @@ __exportStar(require("./prices"), exports);
23
23
  __exportStar(require("./products"), exports);
24
24
  __exportStar(require("./subscriptions"), exports);
25
25
  __exportStar(require("./transactions"), exports);
26
+ __exportStar(require("./pricing-preview"), exports);
@@ -1,10 +1,11 @@
1
1
  import { Price, PriceCollection, PriceWithIncludes } from '../../entities';
2
2
  import { BaseResource } from '../../internal/base';
3
- import { type ListPriceQueryParameters, type GetPriceQueryParameters, type CreatePriceRequestBody, type UpdatePriceRequestBody } from './operations';
3
+ import { type CreatePriceRequestBody, type GetPriceQueryParameters, type ListPriceQueryParameters, type UpdatePriceRequestBody } from './operations';
4
4
  export * from './operations';
5
5
  export declare class PricesResource extends BaseResource {
6
- list(queryParams?: ListPriceQueryParameters): Promise<PriceCollection>;
6
+ list(queryParams?: ListPriceQueryParameters): PriceCollection;
7
7
  create(createPriceParameters: CreatePriceRequestBody): Promise<Price>;
8
8
  get(priceId: string, queryParams?: GetPriceQueryParameters): Promise<PriceWithIncludes>;
9
9
  update(priceId: string, updatePrice: UpdatePriceRequestBody): Promise<Price>;
10
+ archive(priceId: string): Promise<Price>;
10
11
  }
@@ -35,10 +35,8 @@ const PricePaths = {
35
35
  __exportStar(require("./operations"), exports);
36
36
  class PricesResource extends base_1.BaseResource {
37
37
  list(queryParams) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- const queryParameters = new base_1.QueryParameters(queryParams);
40
- return new entities_1.PriceCollection(this.client, PricePaths.list + queryParameters.toQueryString());
41
- });
38
+ const queryParameters = new base_1.QueryParameters(queryParams);
39
+ return new entities_1.PriceCollection(this.client, PricePaths.list + queryParameters.toQueryString());
42
40
  }
43
41
  create(createPriceParameters) {
44
42
  return __awaiter(this, void 0, void 0, function* () {
@@ -68,5 +66,10 @@ class PricesResource extends base_1.BaseResource {
68
66
  return new entities_1.Price(data);
69
67
  });
70
68
  }
69
+ archive(priceId) {
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ return yield this.update(priceId, { status: 'archived' });
72
+ });
73
+ }
71
74
  }
72
75
  exports.PricesResource = PricesResource;
@@ -1,13 +1,14 @@
1
- import { type IMoney, type ITimePeriod, type IUnitPriceOverride, type IPriceQuantity, type ICustomData } from '../../../types';
1
+ import { type ICustomData, type IMoney, type IPriceQuantity, type ITimePeriod, type IUnitPriceOverride } from '../../../types';
2
2
  import { type TaxMode } from '../../../enums';
3
3
  export interface CreatePriceRequestBody {
4
+ name?: string | null;
4
5
  description: string;
5
- product_id: string;
6
- unit_price: IMoney;
7
- billing_cycle?: ITimePeriod | undefined | null;
8
- trial_period?: ITimePeriod | undefined | null;
9
- tax_mode?: TaxMode | undefined | null;
10
- unit_price_overrides?: IUnitPriceOverride[] | undefined;
11
- quantity?: IPriceQuantity | undefined;
12
- custom_data?: ICustomData | undefined | null;
6
+ productId: string;
7
+ unitPrice: IMoney;
8
+ billingCycle?: ITimePeriod | null;
9
+ trialPeriod?: ITimePeriod | null;
10
+ taxMode?: TaxMode;
11
+ unitPriceOverrides?: IUnitPriceOverride[];
12
+ quantity?: IPriceQuantity;
13
+ customData?: ICustomData | null;
13
14
  }
@@ -1,6 +1,4 @@
1
1
  export * from './list-price-query-parameters';
2
2
  export * from './create-price-request-body';
3
3
  export * from './get-price-query-parameters';
4
- export * from './get-price-path-parameters';
5
- export * from './update-price-path-parameters';
6
4
  export * from './update-price-request-body';
@@ -17,6 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./list-price-query-parameters"), exports);
18
18
  __exportStar(require("./create-price-request-body"), exports);
19
19
  __exportStar(require("./get-price-query-parameters"), exports);
20
- __exportStar(require("./get-price-path-parameters"), exports);
21
- __exportStar(require("./update-price-path-parameters"), exports);
22
20
  __exportStar(require("./update-price-request-body"), exports);
@@ -3,9 +3,9 @@ export interface ListPriceQueryParameters {
3
3
  after?: string;
4
4
  id?: string[];
5
5
  include?: string[];
6
- order_by?: string;
7
- per_page?: number;
8
- product_id?: string[];
6
+ orderBy?: string;
7
+ perPage?: number;
8
+ productId?: string[];
9
9
  status?: Status[];
10
10
  recurring?: boolean;
11
11
  }
@@ -1,13 +1,14 @@
1
- import { type ITimePeriod, type IMoney, type IUnitPriceOverride, type IPriceQuantity, type ICustomData } from '../../../types';
2
- import { type TaxMode, type Status } from '../../../enums';
1
+ import { type ICustomData, type IMoney, type IPriceQuantity, type ITimePeriod, type IUnitPriceOverride } from '../../../types';
2
+ import { type Status, type TaxMode } from '../../../enums';
3
3
  export interface UpdatePriceRequestBody {
4
4
  description?: string;
5
- billing_cycle?: ITimePeriod | null;
6
- trial_period?: ITimePeriod | null;
7
- tax_mode?: TaxMode;
8
- unit_price?: IMoney;
9
- unit_price_overrides?: IUnitPriceOverride[];
5
+ name?: string | null;
6
+ billingCycle?: ITimePeriod | null;
7
+ trialPeriod?: ITimePeriod | null;
8
+ taxMode?: TaxMode;
9
+ unitPrice?: IMoney;
10
+ unitPriceOverrides?: IUnitPriceOverride[];
10
11
  quantity?: IPriceQuantity;
11
12
  status?: Status;
12
- custom_data?: ICustomData | null;
13
+ customData?: ICustomData | null;
13
14
  }
@@ -0,0 +1,7 @@
1
+ import { BaseResource } from '../../internal/base';
2
+ import { type PricingPreviewRequestBody } from './operations';
3
+ import { PricingPreview } from '../../entities/pricing-preview';
4
+ export * from './operations';
5
+ export declare class PricingPreviewResource extends BaseResource {
6
+ preview(pricePreviewParameter: PricingPreviewRequestBody): Promise<PricingPreview>;
7
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.PricingPreviewResource = void 0;
27
+ const base_1 = require("../../internal/base");
28
+ const pricing_preview_1 = require("../../entities/pricing-preview");
29
+ const PricingPreviewPaths = {
30
+ preview: '/pricing-preview',
31
+ };
32
+ __exportStar(require("./operations"), exports);
33
+ class PricingPreviewResource extends base_1.BaseResource {
34
+ preview(pricePreviewParameter) {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ const response = yield this.client.post(PricingPreviewPaths.preview, pricePreviewParameter);
37
+ const data = this.handleResponse(response);
38
+ return new pricing_preview_1.PricingPreview(data);
39
+ });
40
+ }
41
+ }
42
+ exports.PricingPreviewResource = PricingPreviewResource;
@@ -0,0 +1 @@
1
+ export * from './pricing-preview-request-body';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./pricing-preview-request-body"), exports);
@@ -0,0 +1,17 @@
1
+ import { type CurrencyCode } from '../../../enums';
2
+ import { type IAddressPreview } from '../../transactions';
3
+ interface IPricePreviewItem {
4
+ priceId: string;
5
+ quantity: number;
6
+ }
7
+ export interface PricingPreviewRequestBody {
8
+ items: IPricePreviewItem[];
9
+ customerId?: string | null;
10
+ addressId?: string | null;
11
+ businessId?: string | null;
12
+ currencyCode?: CurrencyCode;
13
+ discountId?: string | null;
14
+ address?: IAddressPreview | null;
15
+ customerIpAddress?: string | null;
16
+ }
17
+ export {};
@@ -3,8 +3,9 @@ import { BaseResource } from '../../internal/base';
3
3
  import { type CreateProductRequestBody, type GetProductQueryParameters, type ListProductQueryParameters, type UpdateProductRequestBody } from './operations';
4
4
  export * from './operations';
5
5
  export declare class ProductsResource extends BaseResource {
6
- list(queryParams?: ListProductQueryParameters): Promise<ProductCollection>;
6
+ list(queryParams?: ListProductQueryParameters): ProductCollection;
7
7
  create(createProductParameters: CreateProductRequestBody): Promise<Product>;
8
8
  get(productId: string, queryParams?: GetProductQueryParameters): Promise<ProductWithIncludes>;
9
9
  update(productId: string, updateProduct: UpdateProductRequestBody): Promise<Product>;
10
+ archive(productId: string): Promise<Product>;
10
11
  }
@@ -35,10 +35,8 @@ const ProductPaths = {
35
35
  __exportStar(require("./operations"), exports);
36
36
  class ProductsResource extends base_1.BaseResource {
37
37
  list(queryParams) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- const queryParameters = new base_1.QueryParameters(queryParams);
40
- return new entities_1.ProductCollection(this.client, ProductPaths.list + queryParameters.toQueryString());
41
- });
38
+ const queryParameters = new base_1.QueryParameters(queryParams);
39
+ return new entities_1.ProductCollection(this.client, ProductPaths.list + queryParameters.toQueryString());
42
40
  }
43
41
  create(createProductParameters) {
44
42
  return __awaiter(this, void 0, void 0, function* () {
@@ -68,5 +66,10 @@ class ProductsResource extends base_1.BaseResource {
68
66
  return new entities_1.Product(data);
69
67
  });
70
68
  }
69
+ archive(productId) {
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ return yield this.update(productId, { status: 'archived' });
72
+ });
73
+ }
71
74
  }
72
75
  exports.ProductsResource = ProductsResource;
@@ -2,8 +2,8 @@ import { type ICustomData } from '../../../types';
2
2
  import { type TaxCategory } from '../../../enums';
3
3
  export interface CreateProductRequestBody {
4
4
  name: string;
5
- tax_category: TaxCategory;
6
- description?: string | undefined | null;
7
- image_url?: undefined | string | null;
8
- custom_data?: ICustomData | undefined | null;
5
+ taxCategory: TaxCategory;
6
+ description?: string | null;
7
+ imageUrl?: string | null;
8
+ customData?: ICustomData | null;
9
9
  }
@@ -1,6 +1,4 @@
1
1
  export * from './list-product-query-parameters';
2
2
  export * from './create-product-request-body';
3
3
  export * from './get-product-query-parameters';
4
- export * from './get-product-path-parameters';
5
- export * from './update-product-path-parameters';
6
4
  export * from './update-product-request-body';
@@ -17,6 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./list-product-query-parameters"), exports);
18
18
  __exportStar(require("./create-product-request-body"), exports);
19
19
  __exportStar(require("./get-product-query-parameters"), exports);
20
- __exportStar(require("./get-product-path-parameters"), exports);
21
- __exportStar(require("./update-product-path-parameters"), exports);
22
20
  __exportStar(require("./update-product-request-body"), exports);
@@ -3,8 +3,8 @@ export interface ListProductQueryParameters {
3
3
  after?: string;
4
4
  id?: string[];
5
5
  include?: string[];
6
- order_by?: string;
7
- per_page?: number;
6
+ orderBy?: string;
7
+ perPage?: number;
8
8
  status?: Status[];
9
- tax_category?: TaxCategory[];
9
+ taxCategory?: TaxCategory[];
10
10
  }
@@ -2,9 +2,9 @@ import { type ICustomData } from '../../../types';
2
2
  import { type TaxCategory, type Status } from '../../../enums';
3
3
  export interface UpdateProductRequestBody {
4
4
  name?: string;
5
- description?: string | undefined | null;
6
- tax_category?: TaxCategory;
7
- image_url?: undefined | string | null;
8
- custom_data?: ICustomData | undefined | null;
5
+ description?: string | null;
6
+ taxCategory?: TaxCategory;
7
+ imageUrl?: string | null;
8
+ customData?: ICustomData | null;
9
9
  status?: Status;
10
10
  }
@@ -1,11 +1,11 @@
1
1
  import { Subscription, SubscriptionCollection, SubscriptionIncludes, SubscriptionPreview, TransactionIncludes } from '../../entities';
2
2
  import { BaseResource } from '../../internal/base';
3
- import { type GetSubscriptionQueryParameters, type ListSubscriptionQueryParameters, type UpdateSubscriptionRequestBody, type PauseSubscription, type ResumeSubscription, type CancelSubscription, type CreateSubscriptionCharge } from './operations';
3
+ import { type CancelSubscription, type CreateSubscriptionCharge, type GetSubscriptionQueryParameters, type ListSubscriptionQueryParameters, type PauseSubscription, type ResumeSubscription, type UpdateSubscriptionRequestBody } from './operations';
4
4
  export * from './operations';
5
5
  export declare class SubscriptionsResource extends BaseResource {
6
6
  previewUpdate(subscriptionId: string, updateSubscription: UpdateSubscriptionRequestBody): Promise<SubscriptionPreview>;
7
7
  update(subscriptionId: string, updateSubscription: UpdateSubscriptionRequestBody): Promise<Subscription>;
8
- list(queryParams?: ListSubscriptionQueryParameters): Promise<SubscriptionCollection>;
8
+ list(queryParams?: ListSubscriptionQueryParameters): SubscriptionCollection;
9
9
  get(subscriptionId: string, queryParams?: GetSubscriptionQueryParameters): Promise<SubscriptionIncludes>;
10
10
  activate(subscriptionId: string): Promise<Subscription>;
11
11
  pause(subscriptionId: string, requestBody: PauseSubscription): Promise<Subscription>;
@@ -62,10 +62,8 @@ class SubscriptionsResource extends base_1.BaseResource {
62
62
  });
63
63
  }
64
64
  list(queryParams) {
65
- return __awaiter(this, void 0, void 0, function* () {
66
- const queryParameters = new base_1.QueryParameters(queryParams);
67
- return new entities_1.SubscriptionCollection(this.client, SubscriptionPaths.list + queryParameters.toQueryString());
68
- });
65
+ const queryParameters = new base_1.QueryParameters(queryParams);
66
+ return new entities_1.SubscriptionCollection(this.client, SubscriptionPaths.list + queryParameters.toQueryString());
69
67
  }
70
68
  get(subscriptionId, queryParams) {
71
69
  return __awaiter(this, void 0, void 0, function* () {
@@ -1,4 +1,4 @@
1
1
  import { type SubscriptionEffectiveFrom } from '../../../enums';
2
2
  export interface CancelSubscription {
3
- effective_from?: SubscriptionEffectiveFrom | null;
3
+ effectiveFrom?: SubscriptionEffectiveFrom | null;
4
4
  }
@@ -1,9 +1,6 @@
1
1
  import { type SubscriptionEffectiveFrom } from '../../../enums';
2
- export interface CreateSubscriptionChargeItem {
3
- price_id: string;
4
- quantity: number;
5
- }
2
+ import { type ITransactionItem } from '../../../types';
6
3
  export interface CreateSubscriptionCharge {
7
- effective_from: SubscriptionEffectiveFrom;
8
- items: CreateSubscriptionChargeItem[];
4
+ effectiveFrom: SubscriptionEffectiveFrom;
5
+ items: ITransactionItem[];
9
6
  }
@@ -1,6 +1,4 @@
1
1
  export * from './get-subscription-query-parameters';
2
- export * from './get-subscription-path-parameters';
3
- export * from './update-subscription-path-parameters';
4
2
  export * from './update-subscription-request-body';
5
3
  export * from './list-subscription-query-parameters';
6
4
  export * from './pause-subscription-request-object';
@@ -15,8 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./get-subscription-query-parameters"), exports);
18
- __exportStar(require("./get-subscription-path-parameters"), exports);
19
- __exportStar(require("./update-subscription-path-parameters"), exports);
20
18
  __exportStar(require("./update-subscription-request-body"), exports);
21
19
  __exportStar(require("./list-subscription-query-parameters"), exports);
22
20
  __exportStar(require("./pause-subscription-request-object"), exports);
@@ -1,13 +1,13 @@
1
1
  import { type CollectionMode, type ScheduledChangeAction, type SubscriptionStatus } from '../../../enums';
2
2
  export interface ListSubscriptionQueryParameters {
3
- address_id?: string[];
3
+ addressId?: string[];
4
4
  after?: string;
5
- collection_mode?: CollectionMode;
6
- customer_id?: string[];
5
+ collectionMode?: CollectionMode;
6
+ customerId?: string[];
7
7
  id?: string[];
8
- order_by?: string;
9
- per_page?: number;
10
- price_id?: string[];
11
- scheduled_change_action?: ScheduledChangeAction[];
8
+ orderBy?: string;
9
+ perPage?: number;
10
+ priceId?: string[];
11
+ scheduledChangeAction?: ScheduledChangeAction[];
12
12
  status?: SubscriptionStatus[];
13
13
  }