@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
|
@@ -6,54 +6,26 @@ class Transaction {
|
|
|
6
6
|
constructor(transaction) {
|
|
7
7
|
this.id = transaction.id;
|
|
8
8
|
this.status = transaction.status;
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
9
|
+
this.customerId = transaction.customer_id ? transaction.customer_id : null;
|
|
10
|
+
this.addressId = transaction.address_id ? transaction.address_id : null;
|
|
11
|
+
this.businessId = transaction.business_id ? transaction.business_id : null;
|
|
12
|
+
this.customData = transaction.custom_data ? transaction.custom_data : null;
|
|
13
|
+
this.currencyCode = transaction.currency_code;
|
|
14
14
|
this.origin = transaction.origin;
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
? new index_1.TransactionsTimePeriod(transaction.billing_period)
|
|
23
|
-
: undefined;
|
|
15
|
+
this.subscriptionId = transaction.subscription_id ? transaction.subscription_id : null;
|
|
16
|
+
this.invoiceId = transaction.invoice_id ? transaction.invoice_id : null;
|
|
17
|
+
this.invoiceNumber = transaction.invoice_number ? transaction.invoice_number : null;
|
|
18
|
+
this.collectionMode = transaction.collection_mode;
|
|
19
|
+
this.discountId = transaction.discount_id ? transaction.discount_id : null;
|
|
20
|
+
this.billingDetails = transaction.billing_details ? new index_1.BillingDetails(transaction.billing_details) : null;
|
|
21
|
+
this.billingPeriod = transaction.billing_period ? new index_1.TransactionsTimePeriod(transaction.billing_period) : null;
|
|
24
22
|
this.items = transaction.items.map((item) => new index_1.TransactionItem(item));
|
|
25
|
-
this.details = transaction.details ? new index_1.TransactionDetails(transaction.details) :
|
|
23
|
+
this.details = transaction.details ? new index_1.TransactionDetails(transaction.details) : null;
|
|
26
24
|
this.payments = transaction.payments.map((payment) => new index_1.TransactionPaymentAttempt(payment));
|
|
27
|
-
this.checkout = transaction.checkout ? new index_1.TransactionCheckout(transaction.checkout) :
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
}
|
|
32
|
-
toJson() {
|
|
33
|
-
return {
|
|
34
|
-
id: this.id,
|
|
35
|
-
status: this.status,
|
|
36
|
-
customer_id: this.customer_id,
|
|
37
|
-
address_id: this.address_id,
|
|
38
|
-
business_id: this.business_id,
|
|
39
|
-
custom_data: this.custom_data,
|
|
40
|
-
currency_code: this.currency_code,
|
|
41
|
-
origin: this.origin,
|
|
42
|
-
subscription_id: this.subscription_id,
|
|
43
|
-
invoice_id: this.invoice_id,
|
|
44
|
-
invoice_number: this.invoice_number,
|
|
45
|
-
collection_mode: this.collection_mode,
|
|
46
|
-
discount_id: this.discount_id,
|
|
47
|
-
billing_details: this.billing_details,
|
|
48
|
-
billing_period: this.billing_period,
|
|
49
|
-
items: this.items,
|
|
50
|
-
details: this.details,
|
|
51
|
-
payments: this.payments,
|
|
52
|
-
checkout: this.checkout,
|
|
53
|
-
created_at: this.created_at,
|
|
54
|
-
updated_at: this.updated_at,
|
|
55
|
-
billed_at: this.billed_at,
|
|
56
|
-
};
|
|
25
|
+
this.checkout = transaction.checkout ? new index_1.TransactionCheckout(transaction.checkout) : null;
|
|
26
|
+
this.createdAt = transaction.created_at;
|
|
27
|
+
this.updatedAt = transaction.updated_at;
|
|
28
|
+
this.billedAt = transaction.billed_at ? transaction.billed_at : null;
|
|
57
29
|
}
|
|
58
30
|
}
|
|
59
31
|
exports.Transaction = Transaction;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ITransactionsTimePeriodResponse } from '../../types';
|
|
2
2
|
export declare class TransactionsTimePeriod {
|
|
3
|
-
readonly
|
|
4
|
-
readonly
|
|
5
|
-
constructor(transactionsTimePeriod:
|
|
6
|
-
toJson(): ITransactionsTimePeriod;
|
|
3
|
+
readonly startsAt: string;
|
|
4
|
+
readonly endsAt: string;
|
|
5
|
+
constructor(transactionsTimePeriod: ITransactionsTimePeriodResponse);
|
|
7
6
|
}
|
|
@@ -3,14 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TransactionsTimePeriod = void 0;
|
|
4
4
|
class TransactionsTimePeriod {
|
|
5
5
|
constructor(transactionsTimePeriod) {
|
|
6
|
-
this.
|
|
7
|
-
this.
|
|
8
|
-
}
|
|
9
|
-
toJson() {
|
|
10
|
-
return {
|
|
11
|
-
starts_at: this.starts_at,
|
|
12
|
-
ends_at: this.ends_at,
|
|
13
|
-
};
|
|
6
|
+
this.startsAt = transactionsTimePeriod.starts_at;
|
|
7
|
+
this.endsAt = transactionsTimePeriod.ends_at;
|
|
14
8
|
}
|
|
15
9
|
}
|
|
16
10
|
exports.TransactionsTimePeriod = TransactionsTimePeriod;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function convertToSnakeCase(input: unknown): unknown;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.convertToSnakeCase = void 0;
|
|
15
|
+
const lodash_1 = require("lodash");
|
|
16
|
+
function isTopLevelCustomDataCamel(input) {
|
|
17
|
+
return 'customData' in input;
|
|
18
|
+
}
|
|
19
|
+
function decamelizeKeys(obj) {
|
|
20
|
+
if (!(0, lodash_1.isObject)(obj) || (0, lodash_1.isDate)(obj) || (0, lodash_1.isRegExp)(obj) || (0, lodash_1.isBoolean)(obj) || (0, lodash_1.isFunction)(obj)) {
|
|
21
|
+
return obj;
|
|
22
|
+
}
|
|
23
|
+
let output;
|
|
24
|
+
let i = 0;
|
|
25
|
+
let l = 0;
|
|
26
|
+
if ((0, lodash_1.isArray)(obj)) {
|
|
27
|
+
output = [];
|
|
28
|
+
for (l = obj.length; i < l; i++) {
|
|
29
|
+
output.push(decamelizeKeys(obj[i]));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
output = {};
|
|
34
|
+
for (const key in obj) {
|
|
35
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
36
|
+
output[(0, lodash_1.snakeCase)(key)] = decamelizeKeys(obj[key]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return output;
|
|
41
|
+
}
|
|
42
|
+
function convertToSnakeCase(input) {
|
|
43
|
+
if (!input || !(0, lodash_1.isObject)(input)) {
|
|
44
|
+
return input;
|
|
45
|
+
}
|
|
46
|
+
if (isTopLevelCustomDataCamel(input)) {
|
|
47
|
+
const { customData } = input, rest = __rest(input, ["customData"]);
|
|
48
|
+
const result = decamelizeKeys(rest);
|
|
49
|
+
return Object.assign(Object.assign({}, result), { custom_data: customData });
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
return decamelizeKeys(input);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.convertToSnakeCase = convertToSnakeCase;
|
|
@@ -19,6 +19,7 @@ const version_1 = require("../../version");
|
|
|
19
19
|
const environment_1 = require("./environment");
|
|
20
20
|
const crypto_1 = require("crypto");
|
|
21
21
|
const logger_1 = require("../base/logger");
|
|
22
|
+
const case_helpers_1 = require("./case-helpers");
|
|
22
23
|
class Client {
|
|
23
24
|
constructor(apiKey, options) {
|
|
24
25
|
this.apiKey = apiKey;
|
|
@@ -60,7 +61,7 @@ class Client {
|
|
|
60
61
|
logger_1.Logger.logRequest('POST', logUrl, headers);
|
|
61
62
|
const rawResponse = yield (0, node_fetch_1.default)(`${this.baseUrl}${url}`, {
|
|
62
63
|
method: 'POST',
|
|
63
|
-
body: JSON.stringify(requestBody),
|
|
64
|
+
body: JSON.stringify((0, case_helpers_1.convertToSnakeCase)(requestBody)),
|
|
64
65
|
headers,
|
|
65
66
|
});
|
|
66
67
|
logger_1.Logger.logResponse('POST', logUrl, headers, rawResponse);
|
|
@@ -74,7 +75,7 @@ class Client {
|
|
|
74
75
|
logger_1.Logger.logRequest('PATCH', logUrl, headers);
|
|
75
76
|
const rawResponse = yield (0, node_fetch_1.default)(`${this.baseUrl}${url}`, {
|
|
76
77
|
method: 'PATCH',
|
|
77
|
-
body: JSON.stringify(requestBody),
|
|
78
|
+
body: JSON.stringify((0, case_helpers_1.convertToSnakeCase)(requestBody)),
|
|
78
79
|
headers,
|
|
79
80
|
});
|
|
80
81
|
logger_1.Logger.logResponse('PATCH', logUrl, headers, rawResponse);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertToSnakeCase = exports.Environment = void 0;
|
|
4
|
+
var environment_1 = require("./environment");
|
|
5
|
+
Object.defineProperty(exports, "Environment", { enumerable: true, get: function () { return environment_1.Environment; } });
|
|
6
|
+
var case_helpers_1 = require("./case-helpers");
|
|
7
|
+
Object.defineProperty(exports, "convertToSnakeCase", { enumerable: true, get: function () { return case_helpers_1.convertToSnakeCase; } });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare class PathParameters
|
|
1
|
+
export declare class PathParameters {
|
|
2
2
|
private readonly url;
|
|
3
3
|
private readonly pathParameters;
|
|
4
|
-
constructor(url: string, pathParameters:
|
|
4
|
+
constructor(url: string, pathParameters: Record<string, string>);
|
|
5
5
|
deriveUrl(): string;
|
|
6
6
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.QueryParameters = void 0;
|
|
7
|
+
const snakeCase_1 = __importDefault(require("lodash/snakeCase"));
|
|
4
8
|
class QueryParameters {
|
|
5
9
|
constructor(queryParameters) {
|
|
6
10
|
this.queryParameters = queryParameters;
|
|
@@ -10,7 +14,7 @@ class QueryParameters {
|
|
|
10
14
|
for (const key in this.queryParameters) {
|
|
11
15
|
const value = this.queryParameters[key];
|
|
12
16
|
if (key && value) {
|
|
13
|
-
urlSearchParam.append(key, `${value}`);
|
|
17
|
+
urlSearchParam.append((0, snakeCase_1.default)(key), `${value}`);
|
|
14
18
|
}
|
|
15
19
|
}
|
|
16
20
|
return '?' + urlSearchParam.toString();
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { type ErrorDetail } from '../../internal';
|
|
1
|
+
import { type ErrorDetail, type ErrorField } from '../../internal';
|
|
2
2
|
export declare class ApiError extends Error {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
readonly type: string;
|
|
4
|
+
readonly code: string;
|
|
5
|
+
readonly detail: string;
|
|
6
|
+
readonly documentationUrl: string;
|
|
7
|
+
readonly errors: ErrorField[] | null;
|
|
8
8
|
constructor(errorDetail: ErrorDetail);
|
|
9
|
-
toJson(): ErrorDetail;
|
|
10
9
|
}
|
|
@@ -8,16 +8,7 @@ class ApiError extends Error {
|
|
|
8
8
|
this.code = errorDetail.code;
|
|
9
9
|
this.detail = errorDetail.detail;
|
|
10
10
|
this.documentationUrl = errorDetail.documentation_url;
|
|
11
|
-
this.errors = errorDetail.errors;
|
|
12
|
-
}
|
|
13
|
-
toJson() {
|
|
14
|
-
return {
|
|
15
|
-
type: this.type,
|
|
16
|
-
code: this.code,
|
|
17
|
-
detail: this.detail,
|
|
18
|
-
documentation_url: this.documentationUrl,
|
|
19
|
-
errors: this.errors,
|
|
20
|
-
};
|
|
11
|
+
this.errors = errorDetail.errors ? errorDetail.errors : null;
|
|
21
12
|
}
|
|
22
13
|
}
|
|
23
14
|
exports.ApiError = ApiError;
|
package/dist/internal/index.d.ts
CHANGED
package/dist/internal/index.js
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports
|
|
4
|
-
var environment_1 = require("./api/environment");
|
|
5
|
-
Object.defineProperty(exports, "Environment", { enumerable: true, get: function () { return environment_1.Environment; } });
|
|
17
|
+
__exportStar(require("./api"), exports);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type ICustomData } from '../../../types';
|
|
2
2
|
import { type CountryCode } from '../../../enums';
|
|
3
3
|
export interface CreateAddressRequestBody {
|
|
4
|
-
|
|
5
|
-
description?: string |
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
city?: string |
|
|
9
|
-
|
|
10
|
-
region?: string |
|
|
11
|
-
|
|
4
|
+
countryCode: CountryCode;
|
|
5
|
+
description?: string | null;
|
|
6
|
+
firstLine?: string | null;
|
|
7
|
+
secondLine?: string | null;
|
|
8
|
+
city?: string | null;
|
|
9
|
+
postalCode?: string | null;
|
|
10
|
+
region?: string | null;
|
|
11
|
+
customData?: ICustomData | null;
|
|
12
12
|
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
export * from './list-address-path-parameters';
|
|
2
1
|
export * from './list-address-query-parameters';
|
|
3
|
-
export * from './create-address-path-parameters';
|
|
4
2
|
export * from './create-address-request-body';
|
|
5
|
-
export * from './get-address-path-parameters';
|
|
6
|
-
export * from './update-address-path-parameters';
|
|
7
3
|
export * from './update-address-request-body';
|
|
@@ -14,10 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./list-address-path-parameters"), exports);
|
|
18
17
|
__exportStar(require("./list-address-query-parameters"), exports);
|
|
19
|
-
__exportStar(require("./create-address-path-parameters"), exports);
|
|
20
18
|
__exportStar(require("./create-address-request-body"), exports);
|
|
21
|
-
__exportStar(require("./get-address-path-parameters"), exports);
|
|
22
|
-
__exportStar(require("./update-address-path-parameters"), exports);
|
|
23
19
|
__exportStar(require("./update-address-request-body"), exports);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type ICustomData } from '../../../types';
|
|
2
2
|
import { type CountryCode, type Status } from '../../../enums';
|
|
3
3
|
export interface UpdateAddressRequestBody {
|
|
4
|
-
description?: string |
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
city?: string |
|
|
8
|
-
|
|
9
|
-
region?: string |
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
description?: string | null;
|
|
5
|
+
firstLine?: string | null;
|
|
6
|
+
secondLine?: string | null;
|
|
7
|
+
city?: string | null;
|
|
8
|
+
postalCode?: string | null;
|
|
9
|
+
region?: string | null;
|
|
10
|
+
countryCode?: CountryCode;
|
|
11
|
+
customData?: ICustomData | null;
|
|
12
12
|
status?: Status;
|
|
13
13
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type AdjustmentAction, type AdjustmentType } from '../../../enums';
|
|
2
2
|
export interface CreateAdjustmentLineItem {
|
|
3
|
-
amount: string |
|
|
4
|
-
|
|
3
|
+
amount: string | null;
|
|
4
|
+
itemId: string;
|
|
5
5
|
type: AdjustmentType;
|
|
6
6
|
}
|
|
7
7
|
export interface CreateAdjustmentRequestBody {
|
|
8
8
|
action: AdjustmentAction;
|
|
9
9
|
items: CreateAdjustmentLineItem[];
|
|
10
10
|
reason: string;
|
|
11
|
-
|
|
11
|
+
transactionId: string;
|
|
12
12
|
}
|
|
@@ -2,11 +2,11 @@ import { type AdjustmentAction, type AdjustmentStatus } from '../../../enums';
|
|
|
2
2
|
export interface ListAdjustmentQueryParameters {
|
|
3
3
|
action?: AdjustmentAction;
|
|
4
4
|
after?: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
customerId?: string[];
|
|
6
|
+
orderBy?: string;
|
|
7
|
+
perPage?: number;
|
|
8
8
|
status?: AdjustmentStatus[];
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
subscriptionId?: string[];
|
|
10
|
+
transactionId?: string[];
|
|
11
11
|
id?: string[];
|
|
12
12
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type IBusinessContacts, type ICustomData } from '../../../types';
|
|
2
2
|
export interface CreateBusinessRequestBody {
|
|
3
3
|
name: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
contacts?: IBusinessContacts[] |
|
|
7
|
-
|
|
4
|
+
companyNumber?: string | null;
|
|
5
|
+
taxIdentifier?: string | null;
|
|
6
|
+
contacts?: IBusinessContacts[] | null;
|
|
7
|
+
customData?: ICustomData | null;
|
|
8
8
|
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
export * from './list-business-path-parameters';
|
|
2
1
|
export * from './list-business-query-parameters';
|
|
3
|
-
export * from './create-business-path-parameters';
|
|
4
2
|
export * from './create-business-request-body';
|
|
5
|
-
export * from './get-business-path-parameters';
|
|
6
|
-
export * from './update-business-path-parameters';
|
|
7
3
|
export * from './update-business-request-body';
|
|
@@ -14,10 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./list-business-path-parameters"), exports);
|
|
18
17
|
__exportStar(require("./list-business-query-parameters"), exports);
|
|
19
|
-
__exportStar(require("./create-business-path-parameters"), exports);
|
|
20
18
|
__exportStar(require("./create-business-request-body"), exports);
|
|
21
|
-
__exportStar(require("./get-business-path-parameters"), exports);
|
|
22
|
-
__exportStar(require("./update-business-path-parameters"), exports);
|
|
23
19
|
__exportStar(require("./update-business-request-body"), exports);
|
|
@@ -2,9 +2,9 @@ import { type IBusinessContacts, type ICustomData } from '../../../types';
|
|
|
2
2
|
import { type Status } from '../../../enums';
|
|
3
3
|
export interface UpdateBusinessRequestBody {
|
|
4
4
|
name?: string;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
companyNumber?: string | null;
|
|
6
|
+
taxIdentifier?: string | null;
|
|
7
7
|
status?: Status;
|
|
8
|
-
contacts?: IBusinessContacts[] |
|
|
9
|
-
|
|
8
|
+
contacts?: IBusinessContacts[] | null;
|
|
9
|
+
customData?: ICustomData | null;
|
|
10
10
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CreditBalance, Customer, CustomerCollection } from '../../entities';
|
|
2
2
|
import { BaseResource } from '../../internal/base';
|
|
3
|
-
import { type
|
|
3
|
+
import { type CreateCustomerRequestBody, type GetCreditBalanceQueryParameters, type ListCustomerQueryParameters, type UpdateCustomerRequestBody } from './operations';
|
|
4
4
|
export * from './operations';
|
|
5
5
|
export declare class CustomersResource extends BaseResource {
|
|
6
6
|
list(queryParams?: ListCustomerQueryParameters): Promise<CustomerCollection>;
|
|
7
7
|
create(createCustomerParameters: CreateCustomerRequestBody): Promise<Customer>;
|
|
8
8
|
get(customerId: string): Promise<Customer>;
|
|
9
9
|
update(customerId: string, updateCustomer: UpdateCustomerRequestBody): Promise<Customer>;
|
|
10
|
-
getCreditBalance(customerId: string, queryParams?: GetCreditBalanceQueryParameters): Promise<CreditBalance>;
|
|
10
|
+
getCreditBalance(customerId: string, queryParams?: GetCreditBalanceQueryParameters): Promise<CreditBalance[]>;
|
|
11
11
|
}
|
|
@@ -76,7 +76,7 @@ class CustomersResource extends base_1.BaseResource {
|
|
|
76
76
|
const queryParameters = new base_1.QueryParameters(queryParams);
|
|
77
77
|
const response = yield this.client.get(urlWithPathParams, queryParameters);
|
|
78
78
|
const data = this.handleResponse(response);
|
|
79
|
-
return new entities_1.CreditBalance(
|
|
79
|
+
return data.map((balance) => new entities_1.CreditBalance(balance));
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ICustomData } from '../../../types';
|
|
2
2
|
export interface CreateCustomerRequestBody {
|
|
3
3
|
email: string;
|
|
4
|
-
name?: string |
|
|
5
|
-
|
|
4
|
+
name?: string | null;
|
|
5
|
+
customData?: ICustomData | null;
|
|
6
6
|
locale?: string;
|
|
7
7
|
}
|
|
@@ -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);
|
|
@@ -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 |
|
|
4
|
+
name?: string | null;
|
|
5
5
|
email?: string;
|
|
6
6
|
status?: Status;
|
|
7
|
-
|
|
7
|
+
customData?: ICustomData | null;
|
|
8
8
|
locale?: string;
|
|
9
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Discount, DiscountCollection } from '../../entities';
|
|
2
2
|
import { BaseResource } from '../../internal/base';
|
|
3
|
-
import { type
|
|
3
|
+
import { type CreateDiscountRequestBody, type ListDiscountQueryParameters, type UpdateDiscountRequestBody } from './operations';
|
|
4
4
|
export * from './operations';
|
|
5
5
|
export declare class DiscountsResource extends BaseResource {
|
|
6
6
|
list(queryParams?: ListDiscountQueryParameters): Promise<DiscountCollection>;
|
|
@@ -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
|
-
|
|
7
|
-
code?: string |
|
|
8
|
-
|
|
7
|
+
enabledForCheckout?: boolean;
|
|
8
|
+
code?: string | null;
|
|
9
|
+
currencyCode?: CurrencyCode | null;
|
|
9
10
|
recur?: boolean;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
maximumRecurringIntervals?: number | null;
|
|
12
|
+
usageLimit?: number | null;
|
|
13
|
+
restrictTo?: string[] | null;
|
|
14
|
+
expiresAt?: string | null;
|
|
15
|
+
customData?: ICustomData | null;
|
|
14
16
|
}
|
|
@@ -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);
|