@paddle/paddle-node-sdk 0.1.7 → 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.
- package/CHANGELOG.md +35 -2
- package/README.md +90 -106
- package/dist/entities/address/address-collection.d.ts +3 -3
- package/dist/entities/address/address.d.ts +12 -13
- package/dist/entities/address/address.js +10 -26
- package/dist/entities/adjustment/adjustment-collection.d.ts +3 -3
- package/dist/entities/adjustment/adjustment-item-totals.d.ts +0 -1
- package/dist/entities/adjustment/adjustment-item-totals.js +0 -7
- package/dist/entities/adjustment/adjustment-item.d.ts +6 -7
- package/dist/entities/adjustment/adjustment-item.js +4 -14
- package/dist/entities/adjustment/adjustment-proration.d.ts +3 -4
- package/dist/entities/adjustment/adjustment-proration.js +2 -8
- package/dist/entities/adjustment/adjustment-time-period.d.ts +4 -5
- package/dist/entities/adjustment/adjustment-time-period.js +2 -8
- package/dist/entities/adjustment/adjustment.d.ts +10 -11
- package/dist/entities/adjustment/adjustment.js +8 -26
- package/dist/entities/business/business-collection.d.ts +3 -3
- package/dist/entities/business/business.d.ts +8 -9
- package/dist/entities/business/business.js +6 -19
- package/dist/entities/business/contacts.d.ts +1 -2
- package/dist/entities/business/contacts.js +1 -7
- package/dist/entities/customer/credit-balance.d.ts +5 -6
- package/dist/entities/customer/credit-balance.js +2 -9
- package/dist/entities/customer/customer-balance.d.ts +1 -2
- package/dist/entities/customer/customer-balance.js +4 -11
- package/dist/entities/customer/customer-collection.d.ts +3 -3
- package/dist/entities/customer/customer.d.ts +7 -8
- package/dist/entities/customer/customer.js +5 -18
- package/dist/entities/discount/discount-collection.d.ts +3 -3
- package/dist/entities/discount/discount.d.ts +14 -13
- package/dist/entities/discount/discount.js +11 -30
- package/dist/entities/index.d.ts +1 -2
- package/dist/entities/price/price-collection.d.ts +3 -3
- package/dist/entities/price/price-quantity.d.ts +0 -1
- package/dist/entities/price/price-quantity.js +0 -6
- package/dist/entities/price/price-with-includes.d.ts +13 -12
- package/dist/entities/price/price-with-includes.js +10 -24
- package/dist/entities/price/price.d.ts +13 -12
- package/dist/entities/price/price.js +10 -23
- package/dist/entities/product/product-collection.d.ts +3 -3
- package/dist/entities/product/product-with-includes.d.ts +10 -10
- package/dist/entities/product/product-with-includes.js +7 -20
- package/dist/entities/product/product.d.ts +9 -9
- package/dist/entities/product/product.js +7 -17
- package/dist/entities/shared/adjustment-original-amount.d.ts +3 -4
- package/dist/entities/shared/adjustment-original-amount.js +1 -7
- package/dist/entities/shared/billing-details.d.ts +6 -7
- package/dist/entities/shared/billing-details.js +5 -12
- package/dist/entities/shared/chargeback-fee.d.ts +1 -2
- package/dist/entities/shared/chargeback-fee.js +1 -7
- package/dist/entities/shared/import-meta.d.ts +6 -0
- package/dist/entities/shared/import-meta.js +10 -0
- package/dist/entities/shared/index.d.ts +1 -0
- package/dist/entities/shared/index.js +1 -0
- package/dist/entities/shared/money.d.ts +3 -4
- package/dist/entities/shared/money.js +1 -7
- package/dist/entities/shared/payment-card.d.ts +5 -6
- package/dist/entities/shared/payment-card.js +3 -12
- package/dist/entities/shared/payment-method-details.d.ts +1 -2
- package/dist/entities/shared/payment-method-details.js +1 -7
- package/dist/entities/shared/payout-totals-adjustment.d.ts +4 -5
- package/dist/entities/shared/payout-totals-adjustment.js +3 -14
- package/dist/entities/shared/tax-rates-used.d.ts +4 -5
- package/dist/entities/shared/tax-rates-used.js +2 -8
- package/dist/entities/shared/time-period.d.ts +0 -1
- package/dist/entities/shared/time-period.js +0 -6
- package/dist/entities/shared/total-adjustments.d.ts +3 -4
- package/dist/entities/shared/total-adjustments.js +1 -11
- package/dist/entities/shared/totals.d.ts +0 -1
- package/dist/entities/shared/totals.js +0 -8
- package/dist/entities/shared/transaction-checkout.d.ts +1 -2
- package/dist/entities/shared/transaction-checkout.js +1 -6
- package/dist/entities/shared/transaction-payment-attempt.d.ts +8 -9
- package/dist/entities/shared/transaction-payment-attempt.js +7 -19
- package/dist/entities/shared/transaction-payout-totals-adjusted.d.ts +4 -5
- package/dist/entities/shared/transaction-payout-totals-adjusted.js +3 -14
- package/dist/entities/shared/transaction-payout-totals.d.ts +4 -5
- package/dist/entities/shared/transaction-payout-totals.js +2 -16
- package/dist/entities/shared/transaction-totals-adjusted.d.ts +6 -7
- package/dist/entities/shared/transaction-totals-adjusted.js +4 -15
- package/dist/entities/shared/transaction-totals.d.ts +6 -7
- package/dist/entities/shared/transaction-totals.js +4 -18
- package/dist/entities/shared/unit-price-override.d.ts +4 -5
- package/dist/entities/shared/unit-price-override.js +2 -8
- package/dist/entities/shared/unit-totals.d.ts +0 -1
- package/dist/entities/shared/unit-totals.js +0 -8
- package/dist/entities/subscription/index.d.ts +2 -0
- package/dist/entities/subscription/index.js +2 -0
- package/dist/entities/subscription/next-transaction-adjustment-item.d.ts +11 -0
- package/dist/entities/subscription/next-transaction-adjustment-item.js +14 -0
- package/dist/entities/subscription/next-transaction-adjustment-preview.d.ts +9 -0
- package/dist/entities/subscription/next-transaction-adjustment-preview.js +13 -0
- package/dist/entities/subscription/next-transaction.d.ts +5 -6
- package/dist/entities/subscription/next-transaction.js +2 -9
- package/dist/entities/subscription/subscription-collection.d.ts +3 -3
- package/dist/entities/subscription/subscription-discount.d.ts +4 -5
- package/dist/entities/subscription/subscription-discount.js +2 -9
- package/dist/entities/subscription/subscription-includes.d.ts +23 -24
- package/dist/entities/subscription/subscription-includes.js +20 -48
- package/dist/entities/subscription/subscription-item.d.ts +8 -9
- package/dist/entities/subscription/subscription-item.js +6 -21
- package/dist/entities/subscription/subscription-management.d.ts +3 -4
- package/dist/entities/subscription/subscription-management.js +3 -7
- package/dist/entities/subscription/subscription-preview-summary-result.d.ts +3 -4
- package/dist/entities/subscription/subscription-preview-summary-result.js +1 -8
- package/dist/entities/subscription/subscription-preview-update-summary.d.ts +0 -1
- package/dist/entities/subscription/subscription-preview-update-summary.js +0 -7
- package/dist/entities/subscription/subscription-preview.d.ts +25 -26
- package/dist/entities/subscription/subscription-preview.js +22 -51
- package/dist/entities/subscription/subscription-price.d.ts +7 -8
- package/dist/entities/subscription/subscription-price.js +5 -16
- package/dist/entities/subscription/subscription-scheduled-change.d.ts +4 -5
- package/dist/entities/subscription/subscription-scheduled-change.js +2 -9
- package/dist/entities/subscription/subscription-time-period.d.ts +4 -5
- package/dist/entities/subscription/subscription-time-period.js +2 -8
- package/dist/entities/subscription/subscription.d.ts +21 -22
- package/dist/entities/subscription/subscription.js +22 -48
- package/dist/entities/subscription/transaction-details-preview.d.ts +4 -5
- package/dist/entities/subscription/transaction-details-preview.js +2 -9
- package/dist/entities/subscription/transaction-line-item-preview.d.ts +6 -7
- package/dist/entities/subscription/transaction-line-item-preview.js +3 -13
- package/dist/entities/transaction/address-preview.d.ts +7 -0
- package/dist/entities/transaction/address-preview.js +10 -0
- package/dist/entities/transaction/adjustment-totals.d.ts +4 -5
- package/dist/entities/transaction/adjustment-totals.js +2 -13
- package/dist/entities/transaction/index.d.ts +4 -0
- package/dist/entities/transaction/index.js +4 -0
- package/dist/entities/transaction/proration.d.ts +7 -0
- package/dist/entities/transaction/proration.js +11 -0
- package/dist/entities/transaction/transaction-adjustment-item.d.ts +7 -8
- package/dist/entities/transaction/transaction-adjustment-item.js +5 -17
- package/dist/entities/transaction/transaction-adjustment.d.ts +11 -12
- package/dist/entities/transaction/transaction-adjustment.js +9 -27
- package/dist/entities/transaction/transaction-collection.d.ts +3 -3
- package/dist/entities/transaction/transaction-details.d.ts +8 -9
- package/dist/entities/transaction/transaction-details.js +9 -19
- package/dist/entities/transaction/transaction-includes.d.ts +25 -26
- package/dist/entities/transaction/transaction-includes.js +26 -58
- package/dist/entities/transaction/transaction-invoice-pdf.d.ts +0 -1
- package/dist/entities/transaction/transaction-invoice-pdf.js +0 -5
- package/dist/entities/transaction/transaction-item-preview.d.ts +9 -0
- package/dist/entities/transaction/transaction-item-preview.js +14 -0
- package/dist/entities/transaction/transaction-item.d.ts +4 -6
- package/dist/entities/transaction/transaction-item.js +2 -11
- package/dist/entities/transaction/transaction-line-item.d.ts +8 -9
- package/dist/entities/transaction/transaction-line-item.js +6 -20
- package/dist/entities/transaction/transaction-preview.d.ts +16 -0
- package/dist/entities/transaction/transaction-preview.js +19 -0
- package/dist/entities/transaction/transaction-proration.d.ts +3 -4
- package/dist/entities/transaction/transaction-proration.js +2 -8
- package/dist/entities/transaction/transaction.d.ts +19 -20
- package/dist/entities/transaction/transaction.js +17 -45
- package/dist/entities/transaction/transactions-time-period.d.ts +4 -5
- package/dist/entities/transaction/transactions-time-period.js +2 -8
- package/dist/internal/api/case-helpers.d.ts +1 -0
- package/dist/internal/api/case-helpers.js +55 -0
- package/dist/internal/api/client.js +3 -2
- package/dist/internal/api/index.d.ts +2 -0
- package/dist/internal/api/index.js +7 -0
- package/dist/internal/base/path-parameters.d.ts +2 -2
- package/dist/internal/base/query-parameters.js +5 -1
- package/dist/internal/errors/generic.d.ts +6 -7
- package/dist/internal/errors/generic.js +1 -10
- package/dist/internal/index.d.ts +1 -1
- package/dist/internal/index.js +15 -3
- package/dist/resources/addresses/operations/create-address-request-body.d.ts +8 -8
- package/dist/resources/addresses/operations/index.d.ts +0 -4
- package/dist/resources/addresses/operations/index.js +0 -4
- package/dist/resources/addresses/operations/list-address-query-parameters.d.ts +2 -2
- package/dist/resources/addresses/operations/update-address-request-body.d.ts +8 -8
- package/dist/resources/adjustments/operations/create-adjustment-request-body.d.ts +3 -3
- package/dist/resources/adjustments/operations/list-adjustment-query-parameters.d.ts +5 -5
- package/dist/resources/businesses/operations/create-business-request-body.d.ts +4 -4
- package/dist/resources/businesses/operations/index.d.ts +0 -4
- package/dist/resources/businesses/operations/index.js +0 -4
- package/dist/resources/businesses/operations/list-business-query-parameters.d.ts +2 -2
- package/dist/resources/businesses/operations/update-business-request-body.d.ts +4 -4
- package/dist/resources/customers/index.d.ts +2 -2
- package/dist/resources/customers/index.js +1 -1
- package/dist/resources/customers/operations/create-customer-request-body.d.ts +2 -2
- package/dist/resources/customers/operations/get-credit-balance-query-parameters.d.ts +1 -1
- package/dist/resources/customers/operations/index.d.ts +0 -3
- package/dist/resources/customers/operations/index.js +0 -3
- package/dist/resources/customers/operations/list-customer-query-parameters.d.ts +2 -2
- package/dist/resources/customers/operations/update-customer-request-body.d.ts +2 -2
- package/dist/resources/discounts/index.d.ts +1 -1
- package/dist/resources/discounts/operations/create-discount-request-body.d.ts +9 -7
- package/dist/resources/discounts/operations/index.d.ts +0 -2
- package/dist/resources/discounts/operations/index.js +0 -2
- package/dist/resources/discounts/operations/list-discount-query-parameters.d.ts +2 -2
- package/dist/resources/discounts/operations/update-discount-request-body.d.ts +11 -9
- package/dist/resources/prices/index.d.ts +1 -1
- package/dist/resources/prices/operations/create-price-request-body.d.ts +10 -9
- package/dist/resources/prices/operations/index.d.ts +0 -2
- package/dist/resources/prices/operations/index.js +0 -2
- package/dist/resources/prices/operations/list-price-query-parameters.d.ts +3 -3
- package/dist/resources/prices/operations/update-price-request-body.d.ts +9 -8
- package/dist/resources/products/operations/create-product-request-body.d.ts +4 -4
- package/dist/resources/products/operations/index.d.ts +0 -2
- package/dist/resources/products/operations/index.js +0 -2
- package/dist/resources/products/operations/list-product-query-parameters.d.ts +3 -3
- package/dist/resources/products/operations/update-product-request-body.d.ts +4 -4
- package/dist/resources/subscriptions/index.d.ts +1 -1
- package/dist/resources/subscriptions/operations/cancel-subscription-request-object.d.ts +1 -1
- package/dist/resources/subscriptions/operations/create-subscription-charge-request-object.d.ts +3 -6
- package/dist/resources/subscriptions/operations/index.d.ts +0 -2
- package/dist/resources/subscriptions/operations/index.js +0 -2
- package/dist/resources/subscriptions/operations/list-subscription-query-parameters.d.ts +7 -7
- package/dist/resources/subscriptions/operations/pause-subscription-request-object.d.ts +2 -2
- package/dist/resources/subscriptions/operations/resume-subscription-request-object.d.ts +1 -1
- package/dist/resources/subscriptions/operations/update-subscription-request-body.d.ts +17 -12
- package/dist/resources/transactions/index.d.ts +3 -2
- package/dist/resources/transactions/index.js +8 -0
- package/dist/resources/transactions/operations/create-transaction-request-body.d.ts +13 -18
- package/dist/resources/transactions/operations/index.d.ts +1 -2
- package/dist/resources/transactions/operations/index.js +1 -2
- package/dist/resources/transactions/operations/list-transaction-query-parameters.d.ts +21 -21
- package/dist/resources/transactions/operations/transaction-preview-request-body.d.ts +21 -0
- package/dist/resources/transactions/operations/update-transaction-request-body.d.ts +12 -17
- package/dist/types/address/address-response.d.ts +16 -0
- package/dist/types/address/index.d.ts +1 -1
- package/dist/types/address/index.js +1 -1
- package/dist/types/adjustment/adjustment-item-response.d.ts +10 -0
- package/dist/types/adjustment/{adjustment.d.ts → adjustment-response.d.ts} +6 -6
- package/dist/types/adjustment/adjustments-proration-response.d.ts +5 -0
- package/dist/types/adjustment/adjustments-time-period-response.d.ts +4 -0
- package/dist/types/adjustment/index.d.ts +4 -4
- package/dist/types/adjustment/index.js +4 -4
- package/dist/types/business/{business.d.ts → business-response.d.ts} +5 -5
- package/dist/types/business/businesses-contacts.d.ts +1 -1
- package/dist/types/business/index.d.ts +1 -1
- package/dist/types/business/index.js +1 -1
- package/dist/types/customer/credit-balance-response.d.ts +7 -0
- package/dist/types/customer/{customer.d.ts → customer-response.d.ts} +3 -3
- package/dist/types/customer/index.d.ts +2 -2
- package/dist/types/customer/index.js +2 -2
- package/dist/types/discount/discount-response.d.ts +21 -0
- package/dist/types/discount/index.d.ts +1 -1
- package/dist/types/discount/index.js +1 -1
- package/dist/types/price/index.d.ts +1 -1
- package/dist/types/price/index.js +1 -1
- package/dist/types/price/price-response.d.ts +18 -0
- package/dist/types/product/index.d.ts +1 -1
- package/dist/types/product/index.js +1 -1
- package/dist/types/product/product-response.d.ts +14 -0
- package/dist/types/shared/{adjustment-original-amount.d.ts → adjustment-original-amount-response.d.ts} +1 -1
- package/dist/types/shared/billing-details-create.d.ts +7 -0
- package/dist/types/shared/billing-details-response.d.ts +7 -0
- package/dist/types/shared/billing-details-update.d.ts +4 -4
- package/dist/types/shared/chargeback-fee.d.ts +2 -2
- package/dist/types/shared/custom-data.d.ts +1 -1
- package/dist/types/shared/import-meta-response.d.ts +4 -0
- package/dist/types/shared/index.d.ts +19 -15
- package/dist/types/shared/index.js +19 -15
- package/dist/types/shared/money-response.d.ts +5 -0
- package/dist/types/shared/money.d.ts +1 -1
- package/dist/types/shared/{payment-card.d.ts → payment-card-response.d.ts} +3 -3
- package/dist/types/shared/payment-method-details.d.ts +2 -2
- package/dist/types/shared/{payout-totals-adjustment.d.ts → payout-totals-adjustment-response.d.ts} +2 -2
- package/dist/types/shared/shared-price-response.d.ts +17 -0
- package/dist/types/shared/shared-product-response.d.ts +13 -0
- package/dist/types/shared/tax-rates-used-response.d.ts +5 -0
- package/dist/types/shared/{total-adjustments.d.ts → total-adjustments-response.d.ts} +1 -1
- package/dist/types/shared/transaction-checkout.d.ts +1 -1
- package/dist/types/shared/transaction-details-preview-response.d.ts +6 -0
- package/dist/types/shared/transaction-line-item-preview-response.d.ts +9 -0
- package/dist/types/shared/{transaction-payment-attempt.d.ts → transaction-payment-attempt-response.d.ts} +4 -4
- package/dist/types/shared/{transaction-payout-totals-adjusted.d.ts → transaction-payout-totals-adjusted-response.d.ts} +2 -2
- package/dist/types/shared/{transaction-payout-totals.d.ts → transaction-payout-totals-response.d.ts} +1 -1
- package/dist/types/shared/{transaction-totals-adjusted.d.ts → transaction-totals-adjusted-response.d.ts} +3 -3
- package/dist/types/shared/{transaction-totals.d.ts → transaction-totals-response.d.ts} +3 -3
- package/dist/types/shared/unit-price-override-response.d.ts +6 -0
- package/dist/types/shared/unit-price-override.d.ts +2 -2
- package/dist/types/subscription/index.d.ts +10 -10
- package/dist/types/subscription/index.js +10 -10
- package/dist/types/subscription/next-transaction-response.d.ts +11 -0
- package/dist/types/subscription/{subscription-discount.d.ts → subscription-discount-response.d.ts} +1 -1
- package/dist/types/subscription/subscription-item-response.d.ts +13 -0
- package/dist/types/subscription/subscription-management-response.d.ts +4 -0
- package/dist/types/subscription/subscription-preview-response.d.ts +29 -0
- package/dist/types/subscription/subscription-preview-update-summary.d.ts +4 -4
- package/dist/types/subscription/subscription-price-response.d.ts +11 -0
- package/dist/types/subscription/subscription-response.d.ts +17 -17
- package/dist/types/subscription/subscription-result-response.d.ts +4 -0
- package/dist/types/subscription/{subscription-scheduled-change.d.ts → subscription-scheduled-change-response.d.ts} +2 -2
- package/dist/types/subscription/subscription-time-period-response.d.ts +4 -0
- package/dist/types/subscription/subscription-update-item.d.ts +2 -2
- package/dist/types/transaction/{adjustment-totals.d.ts → adjustment-totals-response.d.ts} +2 -2
- package/dist/types/transaction/index.d.ts +11 -7
- package/dist/types/transaction/index.js +11 -7
- package/dist/types/transaction/transaction-adjustment-item-response.d.ts +10 -0
- package/dist/types/transaction/transaction-adjustment-response.d.ts +18 -0
- package/dist/types/transaction/transaction-details-response.d.ts +9 -0
- package/dist/types/transaction/transaction-item-response.d.ts +7 -0
- package/dist/types/transaction/transaction-item.d.ts +1 -4
- package/dist/types/transaction/transaction-line-item-response.d.ts +11 -0
- package/dist/types/transaction/transaction-preview-item.d.ts +5 -0
- package/dist/types/transaction/transaction-preview-response.d.ts +27 -0
- package/dist/types/transaction/transaction-proration-response.d.ts +5 -0
- package/dist/types/transaction/transaction-response.d.ts +32 -0
- package/dist/types/transaction/transactions-time-period-response.d.ts +4 -0
- package/dist/types/transaction/transactions-time-period.d.ts +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -1
- package/dist/resources/addresses/operations/create-address-path-parameters.d.ts +0 -3
- package/dist/resources/addresses/operations/get-address-path-parameters.d.ts +0 -4
- package/dist/resources/addresses/operations/list-address-path-parameters.d.ts +0 -3
- package/dist/resources/addresses/operations/update-address-path-parameters.d.ts +0 -4
- package/dist/resources/businesses/operations/create-business-path-parameters.d.ts +0 -3
- package/dist/resources/businesses/operations/get-business-path-parameters.d.ts +0 -4
- package/dist/resources/businesses/operations/list-business-path-parameters.d.ts +0 -3
- package/dist/resources/businesses/operations/update-business-path-parameters.d.ts +0 -4
- package/dist/resources/customers/operations/get-credit-balance-path-parameters.d.ts +0 -3
- package/dist/resources/customers/operations/get-customer-path-parameters.d.ts +0 -3
- package/dist/resources/customers/operations/update-customer-path-parameters.d.ts +0 -3
- package/dist/resources/discounts/operations/get-discount-path-parameters.d.ts +0 -3
- package/dist/resources/discounts/operations/update-discount-path-parameters.d.ts +0 -3
- package/dist/resources/prices/operations/get-price-path-parameters.d.ts +0 -3
- package/dist/resources/prices/operations/update-price-path-parameters.d.ts +0 -3
- package/dist/resources/products/operations/get-product-path-parameters.d.ts +0 -3
- package/dist/resources/products/operations/update-product-path-parameters.d.ts +0 -3
- package/dist/resources/subscriptions/operations/get-subscription-path-parameters.d.ts +0 -3
- package/dist/resources/subscriptions/operations/update-subscription-path-parameters.d.ts +0 -3
- package/dist/resources/transactions/operations/get-transaction-path-parameters.d.ts +0 -3
- package/dist/resources/transactions/operations/update-transaction-path-parameters.d.ts +0 -3
- package/dist/types/address/address.d.ts +0 -16
- package/dist/types/adjustment/adjustment-item.d.ts +0 -10
- package/dist/types/adjustment/adjustments-proration.d.ts +0 -5
- package/dist/types/adjustment/adjustments-time-period.d.ts +0 -4
- package/dist/types/customer/credit-balance.d.ts +0 -7
- package/dist/types/discount/discount.d.ts +0 -19
- package/dist/types/price/price.d.ts +0 -16
- package/dist/types/product/product.d.ts +0 -13
- package/dist/types/shared/billing-details.d.ts +0 -7
- package/dist/types/shared/shared-price.d.ts +0 -15
- package/dist/types/shared/shared-product.d.ts +0 -12
- package/dist/types/shared/tax-rates-used.d.ts +0 -5
- package/dist/types/shared/transaction-details-preview.d.ts +0 -6
- package/dist/types/shared/transaction-line-item-preview.d.ts +0 -9
- package/dist/types/subscription/next-transaction.d.ts +0 -6
- package/dist/types/subscription/subscription-item.d.ts +0 -13
- package/dist/types/subscription/subscription-management.d.ts +0 -4
- package/dist/types/subscription/subscription-preview.d.ts +0 -29
- package/dist/types/subscription/subscription-preview.js +0 -2
- package/dist/types/subscription/subscription-price.d.ts +0 -11
- package/dist/types/subscription/subscription-price.js +0 -2
- package/dist/types/subscription/subscription-result.d.ts +0 -4
- package/dist/types/subscription/subscription-result.js +0 -2
- package/dist/types/subscription/subscription-scheduled-change.js +0 -2
- package/dist/types/subscription/subscription-time-period.d.ts +0 -4
- package/dist/types/subscription/subscription-time-period.js +0 -2
- package/dist/types/transaction/adjustment-totals.js +0 -2
- package/dist/types/transaction/transaction-adjustment-item.d.ts +0 -10
- package/dist/types/transaction/transaction-adjustment-item.js +0 -2
- package/dist/types/transaction/transaction-adjustment.d.ts +0 -18
- package/dist/types/transaction/transaction-adjustment.js +0 -2
- package/dist/types/transaction/transaction-details.d.ts +0 -9
- package/dist/types/transaction/transaction-details.js +0 -2
- package/dist/types/transaction/transaction-line-item.d.ts +0 -11
- package/dist/types/transaction/transaction-line-item.js +0 -2
- package/dist/types/transaction/transaction-proration.d.ts +0 -5
- package/dist/types/transaction/transaction-proration.js +0 -2
- package/dist/types/transaction/transaction.d.ts +0 -32
- package/dist/types/transaction/transaction.js +0 -2
- /package/dist/resources/{addresses/operations/create-address-path-parameters.js → transactions/operations/transaction-preview-request-body.js} +0 -0
- /package/dist/{resources/addresses/operations/get-address-path-parameters.js → types/address/address-response.js} +0 -0
- /package/dist/{resources/addresses/operations/list-address-path-parameters.js → types/adjustment/adjustment-item-response.js} +0 -0
- /package/dist/{resources/addresses/operations/update-address-path-parameters.js → types/adjustment/adjustment-response.js} +0 -0
- /package/dist/{resources/businesses/operations/create-business-path-parameters.js → types/adjustment/adjustments-proration-response.js} +0 -0
- /package/dist/{resources/businesses/operations/get-business-path-parameters.js → types/adjustment/adjustments-time-period-response.js} +0 -0
- /package/dist/{resources/businesses/operations/list-business-path-parameters.js → types/business/business-response.js} +0 -0
- /package/dist/{resources/businesses/operations/update-business-path-parameters.js → types/customer/credit-balance-response.js} +0 -0
- /package/dist/{resources/customers/operations/get-credit-balance-path-parameters.js → types/customer/customer-response.js} +0 -0
- /package/dist/{resources/customers/operations/get-customer-path-parameters.js → types/discount/discount-response.js} +0 -0
- /package/dist/{resources/customers/operations/update-customer-path-parameters.js → types/price/price-response.js} +0 -0
- /package/dist/{resources/discounts/operations/get-discount-path-parameters.js → types/product/product-response.js} +0 -0
- /package/dist/{resources/discounts/operations/update-discount-path-parameters.js → types/shared/adjustment-original-amount-response.js} +0 -0
- /package/dist/{resources/prices/operations/get-price-path-parameters.js → types/shared/billing-details-create.js} +0 -0
- /package/dist/{resources/prices/operations/update-price-path-parameters.js → types/shared/billing-details-response.js} +0 -0
- /package/dist/{resources/products/operations/get-product-path-parameters.js → types/shared/import-meta-response.js} +0 -0
- /package/dist/{resources/products/operations/update-product-path-parameters.js → types/shared/money-response.js} +0 -0
- /package/dist/{resources/subscriptions/operations/get-subscription-path-parameters.js → types/shared/payment-card-response.js} +0 -0
- /package/dist/{resources/subscriptions/operations/update-subscription-path-parameters.js → types/shared/payout-totals-adjustment-response.js} +0 -0
- /package/dist/{resources/transactions/operations/get-transaction-path-parameters.js → types/shared/shared-price-response.js} +0 -0
- /package/dist/{resources/transactions/operations/update-transaction-path-parameters.js → types/shared/shared-product-response.js} +0 -0
- /package/dist/types/{address/address.js → shared/tax-rates-used-response.js} +0 -0
- /package/dist/types/{adjustment/adjustment-item.js → shared/total-adjustments-response.js} +0 -0
- /package/dist/types/{adjustment/adjustment.js → shared/transaction-details-preview-response.js} +0 -0
- /package/dist/types/{adjustment/adjustments-proration.js → shared/transaction-line-item-preview-response.js} +0 -0
- /package/dist/types/{adjustment/adjustments-time-period.js → shared/transaction-payment-attempt-response.js} +0 -0
- /package/dist/types/{business/business.js → shared/transaction-payout-totals-adjusted-response.js} +0 -0
- /package/dist/types/{customer/credit-balance.js → shared/transaction-payout-totals-response.js} +0 -0
- /package/dist/types/{customer/customer.js → shared/transaction-totals-adjusted-response.js} +0 -0
- /package/dist/types/{discount/discount.js → shared/transaction-totals-response.js} +0 -0
- /package/dist/types/{price/price.js → shared/unit-price-override-response.js} +0 -0
- /package/dist/types/{product/product.js → subscription/next-transaction-response.js} +0 -0
- /package/dist/types/{shared/adjustment-original-amount.js → subscription/subscription-discount-response.js} +0 -0
- /package/dist/types/{shared/billing-details.js → subscription/subscription-item-response.js} +0 -0
- /package/dist/types/{shared/payment-card.js → subscription/subscription-management-response.js} +0 -0
- /package/dist/types/{shared/payout-totals-adjustment.js → subscription/subscription-preview-response.js} +0 -0
- /package/dist/types/{shared/shared-price.js → subscription/subscription-price-response.js} +0 -0
- /package/dist/types/{shared/shared-product.js → subscription/subscription-result-response.js} +0 -0
- /package/dist/types/{shared/tax-rates-used.js → subscription/subscription-scheduled-change-response.js} +0 -0
- /package/dist/types/{shared/total-adjustments.js → subscription/subscription-time-period-response.js} +0 -0
- /package/dist/types/{shared/transaction-details-preview.js → transaction/adjustment-totals-response.js} +0 -0
- /package/dist/types/{shared/transaction-line-item-preview.js → transaction/transaction-adjustment-item-response.js} +0 -0
- /package/dist/types/{shared/transaction-payment-attempt.js → transaction/transaction-adjustment-response.js} +0 -0
- /package/dist/types/{shared/transaction-payout-totals-adjusted.js → transaction/transaction-details-response.js} +0 -0
- /package/dist/types/{shared/transaction-payout-totals.js → transaction/transaction-item-response.js} +0 -0
- /package/dist/types/{shared/transaction-totals-adjusted.js → transaction/transaction-line-item-response.js} +0 -0
- /package/dist/types/{shared/transaction-totals.js → transaction/transaction-preview-item.js} +0 -0
- /package/dist/types/{subscription/next-transaction.js → transaction/transaction-preview-response.js} +0 -0
- /package/dist/types/{subscription/subscription-discount.js → transaction/transaction-proration-response.js} +0 -0
- /package/dist/types/{subscription/subscription-item.js → transaction/transaction-response.js} +0 -0
- /package/dist/types/{subscription/subscription-management.js → transaction/transactions-time-period-response.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
-
> **Important:** While in early access(version 0.X.Y) we may introduce breaking changes. Where we can, we'll tag breaking changes in this changelog and communicate ahead of time.
|
|
7
|
+
> **Important:** While in early access (version 0.X.Y) we may introduce breaking changes. Where we can, we'll tag breaking changes in this changelog and communicate ahead of time.
|
|
8
8
|
|
|
9
9
|
Check our main [developer changelog](https://developer.paddle.com/?utm_source=dx&utm_medium=paddle-node-sdk) for information about changes to the Paddle Billing platform, the Paddle API, and other developer tools.
|
|
10
10
|
|
|
11
|
+
## 0.2.0 - 2023-11-28
|
|
12
|
+
|
|
13
|
+
> **Breaking changes:** This version includes major improvements that introduce breaking changes. These are called out below.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- Added `lodash` as a dependency.
|
|
18
|
+
- Added `customData` to discount entity, see: [related changelog](https://developer.paddle.com/changelog/2023/custom-data-discounts?utm_source=dx&utm_medium=paddle-node-sdk).
|
|
19
|
+
- Added `name` to price entity, see [related changelog](https://developer.paddle.com/changelog/2023/price-name-description?utm_source=dx&utm_medium=paddle-node-sdk).
|
|
20
|
+
- Added `importMeta` to product and price entities.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Fixed [list credit balances for a customer](https://developer.paddle.com/api-reference/customers/list-credit-balances?utm_source=dx&utm_medium=paddle-node-sdk) response entity.
|
|
25
|
+
- Fixed `adjustments` array in `next_transaction` object in subscription entity.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- **Breaking change:** Converted all properties from `snake_case` to `camelCase`. This matches JavaScript conventions for field names.
|
|
30
|
+
|
|
31
|
+
### Removed
|
|
32
|
+
|
|
33
|
+
- **Breaking change:** Removed `toJson` function from all entities.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 0.1.8 - 2023-11-24
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
- Added `transactions.preview()` to [preview a transaction](https://developer.paddle.com/api-reference/transactions/preview-transaction?utm_source=dx&utm_medium=paddle-node-sdk) operation.
|
|
42
|
+
|
|
43
|
+
---
|
|
11
44
|
|
|
12
45
|
## 0.1.7 - 2023-11-23
|
|
13
46
|
|
package/README.md
CHANGED
|
@@ -44,29 +44,16 @@ To authenticate, you'll need an API key. You can create and manage API keys in *
|
|
|
44
44
|
Pass your API key while initializing a new Paddle client.
|
|
45
45
|
|
|
46
46
|
``` typescript
|
|
47
|
-
import { Environment, Paddle } from '@paddle/paddle-node-sdk'
|
|
47
|
+
import { Environment, Paddle } from '@paddle/paddle-node-sdk'
|
|
48
48
|
|
|
49
|
-
...
|
|
50
49
|
const paddle = new Paddle('API_KEY')
|
|
51
|
-
...
|
|
52
|
-
|
|
53
|
-
async function getProducts() {
|
|
54
|
-
try {
|
|
55
|
-
const productCollection = await paddle.products.list()
|
|
56
|
-
return productCollection.next()
|
|
57
|
-
} catch (e) {
|
|
58
|
-
// Handle Network/API errors
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const products = await getProducts()
|
|
63
50
|
```
|
|
64
51
|
|
|
65
52
|
You can also pass an environment to work with the sandbox:
|
|
66
53
|
|
|
67
54
|
```typescript
|
|
68
55
|
const paddle = new Paddle('API_KEY', {
|
|
69
|
-
environment:
|
|
56
|
+
environment: Environment.production, // or Environment.sandbox for accessing sandbox API
|
|
70
57
|
})
|
|
71
58
|
```
|
|
72
59
|
|
|
@@ -83,28 +70,28 @@ This SDK comes with TypeScript definitions for the Paddle API. We recommend that
|
|
|
83
70
|
You can list supported entities with the `list` function in the resource. It returns an iterator to help when working with multiple pages.
|
|
84
71
|
|
|
85
72
|
``` typescript
|
|
86
|
-
import {
|
|
73
|
+
import { Paddle } from '@paddle/paddle-node-sdk'
|
|
87
74
|
|
|
88
|
-
...
|
|
89
75
|
const paddle = new Paddle('API_KEY')
|
|
90
|
-
...
|
|
91
76
|
|
|
92
77
|
async function getProducts() {
|
|
93
78
|
// creates an iterator instance
|
|
94
|
-
const productCollection = await paddle.products.list()
|
|
95
|
-
return productCollection
|
|
79
|
+
const productCollection = await paddle.products.list()
|
|
80
|
+
return productCollection
|
|
96
81
|
}
|
|
97
82
|
|
|
98
83
|
try {
|
|
99
84
|
// Creates an iterator to loop through paginated data.
|
|
100
85
|
// At this point, It does not hold any data.
|
|
101
|
-
const productCollection = await getProducts()
|
|
86
|
+
const productCollection = await getProducts()
|
|
102
87
|
|
|
103
88
|
// Call `next()` to retrieve first page of the dataset
|
|
104
89
|
const firstPage = await productCollection.next()
|
|
90
|
+
console.log("First page data", firstPage)
|
|
105
91
|
|
|
106
92
|
// Calling `next()` again will retrieve subsequent pages.
|
|
107
93
|
const secondPage = await productCollection.next()
|
|
94
|
+
console.log("Second page data", secondPage)
|
|
108
95
|
} catch (e) {
|
|
109
96
|
// Handle Network/API errors
|
|
110
97
|
}
|
|
@@ -115,11 +102,9 @@ try {
|
|
|
115
102
|
You can create a supported entity with the `create` function in the resource. It accepts the body to be created. The created entity is returned.
|
|
116
103
|
|
|
117
104
|
``` typescript
|
|
118
|
-
import {
|
|
105
|
+
import { Paddle, CreateProductRequestBody } from '@paddle/paddle-node-sdk'
|
|
119
106
|
|
|
120
|
-
...
|
|
121
107
|
const paddle = new Paddle('API_KEY')
|
|
122
|
-
...
|
|
123
108
|
|
|
124
109
|
async function createProduct(requestBody: CreateProductRequestBody) {
|
|
125
110
|
try {
|
|
@@ -132,7 +117,8 @@ async function createProduct(requestBody: CreateProductRequestBody) {
|
|
|
132
117
|
}
|
|
133
118
|
}
|
|
134
119
|
|
|
135
|
-
const product = await createProduct({
|
|
120
|
+
const product = await createProduct({ name: 'ChatApp Education', tax_category: 'standard' })
|
|
121
|
+
console.log("Product", product)
|
|
136
122
|
```
|
|
137
123
|
|
|
138
124
|
### Update an entity
|
|
@@ -140,11 +126,9 @@ const product = await createProduct({... object with required attributes})
|
|
|
140
126
|
You can update a supported entity with the `update` function in the resource. It accepts the `id` of the entity to update and an object with the attributes to be updated. The updated entity is returned.
|
|
141
127
|
|
|
142
128
|
``` typescript
|
|
143
|
-
import {
|
|
129
|
+
import { Paddle, UpdateProductRequestBody } from '@paddle/paddle-node-sdk'
|
|
144
130
|
|
|
145
|
-
...
|
|
146
131
|
const paddle = new Paddle('API_KEY')
|
|
147
|
-
...
|
|
148
132
|
|
|
149
133
|
async function updateProduct(productId: string, requestBody: UpdateProductRequestBody) {
|
|
150
134
|
try {
|
|
@@ -157,7 +141,8 @@ async function updateProduct(productId: string, requestBody: UpdateProductReques
|
|
|
157
141
|
}
|
|
158
142
|
}
|
|
159
143
|
|
|
160
|
-
const product = await updateProduct('id', {
|
|
144
|
+
const product = await updateProduct('id', { name: 'ChatApp for Schools' })
|
|
145
|
+
console.log('Updated product', product)
|
|
161
146
|
```
|
|
162
147
|
|
|
163
148
|
Where operations require more than one `id`, the `update` function accepts multiple arguments. For example, to update an address for a customer, pass the `customerId` and the `addressId`:
|
|
@@ -171,11 +156,9 @@ const address = await paddle.addresses.update(customerId, addressId, requestBody
|
|
|
171
156
|
You can get an entity with the `get` function in the resource. It accepts the `id` of the entity to get. The entity is returned.
|
|
172
157
|
|
|
173
158
|
``` typescript
|
|
174
|
-
import {
|
|
159
|
+
import { Paddle } from '@paddle/paddle-node-sdk'
|
|
175
160
|
|
|
176
|
-
...
|
|
177
161
|
const paddle = new Paddle('API_KEY')
|
|
178
|
-
...
|
|
179
162
|
|
|
180
163
|
async function getProduct(productId: string) {
|
|
181
164
|
try {
|
|
@@ -189,6 +172,7 @@ async function getProduct(productId: string) {
|
|
|
189
172
|
}
|
|
190
173
|
|
|
191
174
|
const product = await getProduct('id')
|
|
175
|
+
console.log('Product', product)
|
|
192
176
|
```
|
|
193
177
|
|
|
194
178
|
## Resources
|
|
@@ -198,7 +182,7 @@ const product = await getProduct('id')
|
|
|
198
182
|
The SDK includes a helper function to verify webhook signatures sent by Notifications from Paddle.
|
|
199
183
|
|
|
200
184
|
```typescript
|
|
201
|
-
import { NotificationsValidator } from '@paddle/paddle-node-sdk'
|
|
185
|
+
import { NotificationsValidator } from '@paddle/paddle-node-sdk'
|
|
202
186
|
|
|
203
187
|
|
|
204
188
|
const isValid = new NotificationsValidator().isValidSignature('RAW_UNFORMATTED_REQUEST_BODY', 'PRIVATE_KEY_FROM_DASHBOARD', 'SIGNATURE_FROM_RESPONSE_HEADER')
|
|
@@ -210,79 +194,79 @@ While in early access, not all operations in the Paddle API are available in our
|
|
|
210
194
|
|
|
211
195
|
This table shows which operations are available as of the latest release.
|
|
212
196
|
|
|
213
|
-
| Paddle API operation |
|
|
214
|
-
|
|
215
|
-
| **Products** |
|
|
216
|
-
| List products |
|
|
217
|
-
| Create a product |
|
|
218
|
-
| Get a product |
|
|
219
|
-
| Update a product |
|
|
220
|
-
| **Prices** |
|
|
221
|
-
| List prices |
|
|
222
|
-
| Create a price |
|
|
223
|
-
| Get a price |
|
|
224
|
-
| Update a price |
|
|
225
|
-
| **Discounts** |
|
|
226
|
-
| List discounts |
|
|
227
|
-
| Create a discount |
|
|
228
|
-
| Get a discount |
|
|
229
|
-
| Update a discount |
|
|
230
|
-
| **Customers** |
|
|
231
|
-
| List customers |
|
|
232
|
-
| Create a customer |
|
|
233
|
-
| Get a customer |
|
|
234
|
-
| Update a customer |
|
|
235
|
-
| List credit balances for a customer |
|
|
236
|
-
| **Addresses** |
|
|
237
|
-
| List addresses for a customer |
|
|
238
|
-
| Create an addresses for a customer |
|
|
239
|
-
| Get an address for a customer |
|
|
240
|
-
| Update an address for a customer |
|
|
241
|
-
| **Businesses** |
|
|
242
|
-
| List businesses for a customer |
|
|
243
|
-
| Create a business for a customer |
|
|
244
|
-
| Get a business for a customer |
|
|
245
|
-
| Update a business for a customer |
|
|
246
|
-
| **Transactions** | **
|
|
247
|
-
| List transactions |
|
|
248
|
-
| Create a transaction |
|
|
249
|
-
| Get a transaction |
|
|
250
|
-
| Update a transaction |
|
|
251
|
-
| Preview a transaction |
|
|
252
|
-
| Get a PDF invoice for a transaction |
|
|
253
|
-
| **Subscriptions** |
|
|
254
|
-
| List subscriptions |
|
|
255
|
-
| Get a subscription |
|
|
256
|
-
| Preview an update to a subscription |
|
|
257
|
-
| Update a subscription |
|
|
258
|
-
| Get a transaction to update payment method |
|
|
259
|
-
| Preview a one-time charge for a subscription |
|
|
260
|
-
| Create a one-time charge for a subscription |
|
|
261
|
-
| Activate a trialing subscription |
|
|
262
|
-
| Pause a subscription |
|
|
263
|
-
| Resume a paused subscription |
|
|
264
|
-
| Cancel a subscription |
|
|
265
|
-
| **Adjustments** |
|
|
266
|
-
| List adjustments |
|
|
267
|
-
| Create an adjustment |
|
|
268
|
-
| **Pricing preview** |
|
|
269
|
-
| Preview prices |
|
|
270
|
-
| **Event types** |
|
|
271
|
-
| List event types |
|
|
272
|
-
| **Events** |
|
|
273
|
-
| List events |
|
|
274
|
-
| **Notification settings** |
|
|
275
|
-
| List notification settings |
|
|
276
|
-
| Create a notification setting |
|
|
277
|
-
| Get a notification setting |
|
|
278
|
-
| Update a notification setting |
|
|
279
|
-
| Delete a notification setting |
|
|
280
|
-
| **Notifications** |
|
|
281
|
-
| List notifications |
|
|
282
|
-
| Get a notification |
|
|
283
|
-
| Replay a notification |
|
|
284
|
-
| **Notification logs** |
|
|
285
|
-
| List logs for a notification |
|
|
197
|
+
| Paddle API operation | Support |
|
|
198
|
+
|----------------------------------------------|:--------:|
|
|
199
|
+
| **Products** | **Full** |
|
|
200
|
+
| List products | ✅ |
|
|
201
|
+
| Create a product | ✅ |
|
|
202
|
+
| Get a product | ✅ |
|
|
203
|
+
| Update a product | ✅ |
|
|
204
|
+
| **Prices** | **Full** |
|
|
205
|
+
| List prices | ✅ |
|
|
206
|
+
| Create a price | ✅ |
|
|
207
|
+
| Get a price | ✅ |
|
|
208
|
+
| Update a price | ✅ |
|
|
209
|
+
| **Discounts** | **Full** |
|
|
210
|
+
| List discounts | ✅ |
|
|
211
|
+
| Create a discount | ✅ |
|
|
212
|
+
| Get a discount | ✅ |
|
|
213
|
+
| Update a discount | ✅ |
|
|
214
|
+
| **Customers** | **Full** |
|
|
215
|
+
| List customers | ✅ |
|
|
216
|
+
| Create a customer | ✅ |
|
|
217
|
+
| Get a customer | ✅ |
|
|
218
|
+
| Update a customer | ✅ |
|
|
219
|
+
| List credit balances for a customer | ✅ |
|
|
220
|
+
| **Addresses** | **Full** |
|
|
221
|
+
| List addresses for a customer | ✅ |
|
|
222
|
+
| Create an addresses for a customer | ✅ |
|
|
223
|
+
| Get an address for a customer | ✅ |
|
|
224
|
+
| Update an address for a customer | ✅ |
|
|
225
|
+
| **Businesses** | ✅ |
|
|
226
|
+
| List businesses for a customer | ✅ |
|
|
227
|
+
| Create a business for a customer | ✅ |
|
|
228
|
+
| Get a business for a customer | ✅ |
|
|
229
|
+
| Update a business for a customer | ✅ |
|
|
230
|
+
| **Transactions** | **Full** |
|
|
231
|
+
| List transactions | ✅ |
|
|
232
|
+
| Create a transaction | ✅ |
|
|
233
|
+
| Get a transaction | ✅ |
|
|
234
|
+
| Update a transaction | ✅ |
|
|
235
|
+
| Preview a transaction | ✅ |
|
|
236
|
+
| Get a PDF invoice for a transaction | ✅ |
|
|
237
|
+
| **Subscriptions** | **Full** |
|
|
238
|
+
| List subscriptions | ✅ |
|
|
239
|
+
| Get a subscription | ✅ |
|
|
240
|
+
| Preview an update to a subscription | ✅ |
|
|
241
|
+
| Update a subscription | ✅ |
|
|
242
|
+
| Get a transaction to update payment method | ✅ |
|
|
243
|
+
| Preview a one-time charge for a subscription | ✅ |
|
|
244
|
+
| Create a one-time charge for a subscription | ✅ |
|
|
245
|
+
| Activate a trialing subscription | ✅ |
|
|
246
|
+
| Pause a subscription | ✅ |
|
|
247
|
+
| Resume a paused subscription | ✅ |
|
|
248
|
+
| Cancel a subscription | ✅ |
|
|
249
|
+
| **Adjustments** | **Full** |
|
|
250
|
+
| List adjustments | ✅ |
|
|
251
|
+
| Create an adjustment | ✅ |
|
|
252
|
+
| **Pricing preview** | **None** |
|
|
253
|
+
| Preview prices | ❌ |
|
|
254
|
+
| **Event types** | **None** |
|
|
255
|
+
| List event types | ❌ |
|
|
256
|
+
| **Events** | **None** |
|
|
257
|
+
| List events | ❌ |
|
|
258
|
+
| **Notification settings** | **None** |
|
|
259
|
+
| List notification settings | ❌ |
|
|
260
|
+
| Create a notification setting | ❌ |
|
|
261
|
+
| Get a notification setting | ❌ |
|
|
262
|
+
| Update a notification setting | ❌ |
|
|
263
|
+
| Delete a notification setting | ❌ |
|
|
264
|
+
| **Notifications** | **None** |
|
|
265
|
+
| List notifications | ❌ |
|
|
266
|
+
| Get a notification | ❌ |
|
|
267
|
+
| Replay a notification | ❌ |
|
|
268
|
+
| **Notification logs** | **None** |
|
|
269
|
+
| List logs for a notification | ❌ |
|
|
286
270
|
|
|
287
271
|
## Learn more
|
|
288
272
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Address } from './address';
|
|
2
|
-
import { type
|
|
2
|
+
import { type IAddressResponse } from '../../types';
|
|
3
3
|
import { Collection } from '../../internal/base';
|
|
4
|
-
export declare class AddressCollection extends Collection<
|
|
5
|
-
fromJson(data:
|
|
4
|
+
export declare class AddressCollection extends Collection<IAddressResponse, Address> {
|
|
5
|
+
fromJson(data: IAddressResponse): Address;
|
|
6
6
|
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { type CustomData } from '../index';
|
|
2
2
|
import { type CountryCode, type Status } from '../../enums';
|
|
3
|
-
import { type
|
|
3
|
+
import { type IAddressResponse } from '../../types';
|
|
4
4
|
export declare class Address {
|
|
5
5
|
readonly id: string;
|
|
6
|
-
readonly description
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
9
|
-
readonly city
|
|
10
|
-
readonly
|
|
11
|
-
readonly region
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
6
|
+
readonly description: string | null;
|
|
7
|
+
readonly firstLine: string | null;
|
|
8
|
+
readonly secondLine: string | null;
|
|
9
|
+
readonly city: string | null;
|
|
10
|
+
readonly postalCode: string | null;
|
|
11
|
+
readonly region: string | null;
|
|
12
|
+
readonly countryCode: CountryCode;
|
|
13
|
+
readonly customData: CustomData | null;
|
|
14
14
|
readonly status: Status;
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
constructor(address:
|
|
18
|
-
toJson(): IAddress;
|
|
15
|
+
readonly createdAt: string;
|
|
16
|
+
readonly updatedAt: string;
|
|
17
|
+
constructor(address: IAddressResponse);
|
|
19
18
|
}
|
|
@@ -4,33 +4,17 @@ exports.Address = void 0;
|
|
|
4
4
|
class Address {
|
|
5
5
|
constructor(address) {
|
|
6
6
|
this.id = address.id;
|
|
7
|
-
this.description = address.description;
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
10
|
-
this.city = address.city;
|
|
11
|
-
this.
|
|
12
|
-
this.region = address.region;
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
7
|
+
this.description = address.description ? address.description : null;
|
|
8
|
+
this.firstLine = address.first_line ? address.first_line : null;
|
|
9
|
+
this.secondLine = address.second_line ? address.second_line : null;
|
|
10
|
+
this.city = address.city ? address.city : null;
|
|
11
|
+
this.postalCode = address.postal_code ? address.postal_code : null;
|
|
12
|
+
this.region = address.region ? address.region : null;
|
|
13
|
+
this.countryCode = address.country_code;
|
|
14
|
+
this.customData = address.custom_data ? address.custom_data : null;
|
|
15
15
|
this.status = address.status;
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
}
|
|
19
|
-
toJson() {
|
|
20
|
-
return {
|
|
21
|
-
id: this.id,
|
|
22
|
-
description: this.description,
|
|
23
|
-
first_line: this.first_line,
|
|
24
|
-
second_line: this.second_line,
|
|
25
|
-
city: this.city,
|
|
26
|
-
postal_code: this.postal_code,
|
|
27
|
-
region: this.region,
|
|
28
|
-
country_code: this.country_code,
|
|
29
|
-
custom_data: this.custom_data,
|
|
30
|
-
status: this.status,
|
|
31
|
-
created_at: this.created_at,
|
|
32
|
-
updated_at: this.updated_at,
|
|
33
|
-
};
|
|
16
|
+
this.createdAt = address.created_at;
|
|
17
|
+
this.updatedAt = address.updated_at;
|
|
34
18
|
}
|
|
35
19
|
}
|
|
36
20
|
exports.Address = Address;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Adjustment } from './adjustment';
|
|
2
|
-
import { type
|
|
2
|
+
import { type IAdjustmentResponse } from '../../types';
|
|
3
3
|
import { Collection } from '../../internal/base';
|
|
4
|
-
export declare class AdjustmentCollection extends Collection<
|
|
5
|
-
fromJson(data:
|
|
4
|
+
export declare class AdjustmentCollection extends Collection<IAdjustmentResponse, Adjustment> {
|
|
5
|
+
fromJson(data: IAdjustmentResponse): Adjustment;
|
|
6
6
|
}
|
|
@@ -7,12 +7,5 @@ class AdjustmentItemTotals {
|
|
|
7
7
|
this.tax = adjustmentItemTotals.tax;
|
|
8
8
|
this.total = adjustmentItemTotals.total;
|
|
9
9
|
}
|
|
10
|
-
toJson() {
|
|
11
|
-
return {
|
|
12
|
-
subtotal: this.subtotal,
|
|
13
|
-
tax: this.tax,
|
|
14
|
-
total: this.total,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
10
|
}
|
|
18
11
|
exports.AdjustmentItemTotals = AdjustmentItemTotals;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IAdjustmentItemResponse } from '../../types';
|
|
2
2
|
import { AdjustmentItemTotals, AdjustmentProration } from '../index';
|
|
3
3
|
import { type AdjustmentType } from '../../enums';
|
|
4
4
|
export declare class AdjustmentItem {
|
|
5
5
|
readonly id: string;
|
|
6
|
-
readonly
|
|
6
|
+
readonly itemId: string;
|
|
7
7
|
readonly type: AdjustmentType;
|
|
8
|
-
readonly amount
|
|
9
|
-
readonly proration
|
|
10
|
-
readonly totals
|
|
11
|
-
constructor(adjustmentItem:
|
|
12
|
-
toJson(): IAdjustmentItem;
|
|
8
|
+
readonly amount: string | null;
|
|
9
|
+
readonly proration: AdjustmentProration | null;
|
|
10
|
+
readonly totals: AdjustmentItemTotals | null;
|
|
11
|
+
constructor(adjustmentItem: IAdjustmentItemResponse);
|
|
13
12
|
}
|
|
@@ -5,21 +5,11 @@ const index_1 = require("../index");
|
|
|
5
5
|
class AdjustmentItem {
|
|
6
6
|
constructor(adjustmentItem) {
|
|
7
7
|
this.id = adjustmentItem.id;
|
|
8
|
-
this.
|
|
8
|
+
this.itemId = adjustmentItem.item_id;
|
|
9
9
|
this.type = adjustmentItem.type;
|
|
10
|
-
this.amount = adjustmentItem.amount;
|
|
11
|
-
this.proration = adjustmentItem.proration ? new index_1.AdjustmentProration(adjustmentItem.proration) :
|
|
12
|
-
this.totals = adjustmentItem.totals ? new index_1.AdjustmentItemTotals(adjustmentItem.totals) :
|
|
13
|
-
}
|
|
14
|
-
toJson() {
|
|
15
|
-
return {
|
|
16
|
-
id: this.id,
|
|
17
|
-
item_id: this.item_id,
|
|
18
|
-
type: this.type,
|
|
19
|
-
amount: this.amount,
|
|
20
|
-
proration: this.proration,
|
|
21
|
-
totals: this.totals,
|
|
22
|
-
};
|
|
10
|
+
this.amount = adjustmentItem.amount ? adjustmentItem.amount : null;
|
|
11
|
+
this.proration = adjustmentItem.proration ? new index_1.AdjustmentProration(adjustmentItem.proration) : null;
|
|
12
|
+
this.totals = adjustmentItem.totals ? new index_1.AdjustmentItemTotals(adjustmentItem.totals) : null;
|
|
23
13
|
}
|
|
24
14
|
}
|
|
25
15
|
exports.AdjustmentItem = AdjustmentItem;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IAdjustmentsProrationResponse } from '../../types';
|
|
2
2
|
import { AdjustmentTimePeriod } from '../index';
|
|
3
3
|
export declare class AdjustmentProration {
|
|
4
4
|
readonly rate: string;
|
|
5
|
-
readonly
|
|
6
|
-
constructor(adjustmentsProration:
|
|
7
|
-
toJson(): IAdjustmentsProration;
|
|
5
|
+
readonly billingPeriod: AdjustmentTimePeriod | null;
|
|
6
|
+
constructor(adjustmentsProration: IAdjustmentsProrationResponse);
|
|
8
7
|
}
|
|
@@ -5,15 +5,9 @@ const index_1 = require("../index");
|
|
|
5
5
|
class AdjustmentProration {
|
|
6
6
|
constructor(adjustmentsProration) {
|
|
7
7
|
this.rate = adjustmentsProration.rate;
|
|
8
|
-
this.
|
|
8
|
+
this.billingPeriod = adjustmentsProration.billing_period
|
|
9
9
|
? new index_1.AdjustmentTimePeriod(adjustmentsProration.billing_period)
|
|
10
|
-
:
|
|
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.AdjustmentProration = AdjustmentProration;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IAdjustmentsTimePeriodResponse } from '../../types';
|
|
2
2
|
export declare class AdjustmentTimePeriod {
|
|
3
|
-
readonly
|
|
4
|
-
readonly
|
|
5
|
-
constructor(adjustmentsTimePeriod:
|
|
6
|
-
toJson(): IAdjustmentsTimePeriod;
|
|
3
|
+
readonly startsAt: string;
|
|
4
|
+
readonly endsAt: string;
|
|
5
|
+
constructor(adjustmentsTimePeriod: IAdjustmentsTimePeriodResponse);
|
|
7
6
|
}
|
|
@@ -3,14 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AdjustmentTimePeriod = void 0;
|
|
4
4
|
class AdjustmentTimePeriod {
|
|
5
5
|
constructor(adjustmentsTimePeriod) {
|
|
6
|
-
this.
|
|
7
|
-
this.
|
|
8
|
-
}
|
|
9
|
-
toJson() {
|
|
10
|
-
return {
|
|
11
|
-
starts_at: this.starts_at,
|
|
12
|
-
ends_at: this.ends_at,
|
|
13
|
-
};
|
|
6
|
+
this.startsAt = adjustmentsTimePeriod.starts_at;
|
|
7
|
+
this.endsAt = adjustmentsTimePeriod.ends_at;
|
|
14
8
|
}
|
|
15
9
|
}
|
|
16
10
|
exports.AdjustmentTimePeriod = AdjustmentTimePeriod;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { AdjustmentItem, PayoutTotalsAdjustment, TotalAdjustments } from '../index';
|
|
2
2
|
import { type AdjustmentAction, type AdjustmentStatus, type CurrencyCode } from '../../enums';
|
|
3
|
-
import { type
|
|
3
|
+
import { type IAdjustmentResponse } from '../../types';
|
|
4
4
|
export declare class Adjustment {
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly action: AdjustmentAction;
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
9
|
-
readonly
|
|
7
|
+
readonly transactionId: string;
|
|
8
|
+
readonly subscriptionId: string | null;
|
|
9
|
+
readonly customerId: string;
|
|
10
10
|
readonly reason: string;
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
11
|
+
readonly creditAppliedToBalance: boolean;
|
|
12
|
+
readonly currencyCode: CurrencyCode;
|
|
13
13
|
readonly status: AdjustmentStatus;
|
|
14
14
|
readonly items: AdjustmentItem[];
|
|
15
15
|
readonly totals: TotalAdjustments;
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
19
|
-
constructor(adjustment:
|
|
20
|
-
toJson(): IAdjustment;
|
|
16
|
+
readonly payoutTotals: PayoutTotalsAdjustment | null;
|
|
17
|
+
readonly createdAt: string;
|
|
18
|
+
readonly updatedAt: string;
|
|
19
|
+
constructor(adjustment: IAdjustmentResponse);
|
|
21
20
|
}
|