@paddle/paddle-node-sdk 0.1.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/LICENSE +201 -0
- package/README.md +270 -0
- package/dist/entities/address/address-collection.d.ts +6 -0
- package/dist/entities/address/address-collection.js +11 -0
- package/dist/entities/address/address.d.ts +19 -0
- package/dist/entities/address/address.js +36 -0
- package/dist/entities/address/index.d.ts +2 -0
- package/dist/entities/address/index.js +18 -0
- package/dist/entities/adjustment/adjustment-collection.d.ts +6 -0
- package/dist/entities/adjustment/adjustment-collection.js +11 -0
- package/dist/entities/adjustment/adjustment-item-totals.d.ts +8 -0
- package/dist/entities/adjustment/adjustment-item-totals.js +18 -0
- package/dist/entities/adjustment/adjustment-item.d.ts +13 -0
- package/dist/entities/adjustment/adjustment-item.js +25 -0
- package/dist/entities/adjustment/adjustment-proration.d.ts +8 -0
- package/dist/entities/adjustment/adjustment-proration.js +19 -0
- package/dist/entities/adjustment/adjustment-time-period.d.ts +7 -0
- package/dist/entities/adjustment/adjustment-time-period.js +16 -0
- package/dist/entities/adjustment/adjustment.d.ts +21 -0
- package/dist/entities/adjustment/adjustment.js +41 -0
- package/dist/entities/adjustment/index.d.ts +6 -0
- package/dist/entities/adjustment/index.js +22 -0
- package/dist/entities/business/business-collection.d.ts +6 -0
- package/dist/entities/business/business-collection.js +11 -0
- package/dist/entities/business/business.d.ts +16 -0
- package/dist/entities/business/business.js +31 -0
- package/dist/entities/business/contacts.d.ts +7 -0
- package/dist/entities/business/contacts.js +16 -0
- package/dist/entities/business/index.d.ts +3 -0
- package/dist/entities/business/index.js +19 -0
- package/dist/entities/customer/customer-collection.d.ts +6 -0
- package/dist/entities/customer/customer-collection.js +11 -0
- package/dist/entities/customer/customer.d.ts +16 -0
- package/dist/entities/customer/customer.js +30 -0
- package/dist/entities/customer/index.d.ts +2 -0
- package/dist/entities/customer/index.js +18 -0
- package/dist/entities/discount/discount-collection.d.ts +6 -0
- package/dist/entities/discount/discount-collection.js +11 -0
- package/dist/entities/discount/discount.d.ts +22 -0
- package/dist/entities/discount/discount.js +44 -0
- package/dist/entities/discount/index.d.ts +2 -0
- package/dist/entities/discount/index.js +18 -0
- package/dist/entities/index.d.ts +12 -0
- package/dist/entities/index.js +26 -0
- package/dist/entities/price/index.d.ts +4 -0
- package/dist/entities/price/index.js +20 -0
- package/dist/entities/price/price-collection.d.ts +6 -0
- package/dist/entities/price/price-collection.js +11 -0
- package/dist/entities/price/price-quantity.d.ts +7 -0
- package/dist/entities/price/price-quantity.js +16 -0
- package/dist/entities/price/price-with-includes.d.ts +19 -0
- package/dist/entities/price/price-with-includes.js +37 -0
- package/dist/entities/price/price.d.ts +18 -0
- package/dist/entities/price/price.js +35 -0
- package/dist/entities/product/index.d.ts +3 -0
- package/dist/entities/product/index.js +19 -0
- package/dist/entities/product/product-collection.d.ts +6 -0
- package/dist/entities/product/product-collection.js +11 -0
- package/dist/entities/product/product-with-includes.d.ts +16 -0
- package/dist/entities/product/product-with-includes.js +32 -0
- package/dist/entities/product/product.d.ts +15 -0
- package/dist/entities/product/product.js +28 -0
- package/dist/entities/shared/adjustment-original-amount.d.ts +8 -0
- package/dist/entities/shared/adjustment-original-amount.js +16 -0
- package/dist/entities/shared/billing-details.d.ts +10 -0
- package/dist/entities/shared/billing-details.js +21 -0
- package/dist/entities/shared/chargeback-fee.d.ts +8 -0
- package/dist/entities/shared/chargeback-fee.js +17 -0
- package/dist/entities/shared/index.d.ts +19 -0
- package/dist/entities/shared/index.js +35 -0
- package/dist/entities/shared/money.d.ts +8 -0
- package/dist/entities/shared/money.js +16 -0
- package/dist/entities/shared/payment-card.d.ts +11 -0
- package/dist/entities/shared/payment-card.js +22 -0
- package/dist/entities/shared/payment-method-details.d.ts +9 -0
- package/dist/entities/shared/payment-method-details.js +17 -0
- package/dist/entities/shared/payout-totals-adjustment.d.ts +14 -0
- package/dist/entities/shared/payout-totals-adjustment.js +29 -0
- package/dist/entities/shared/tax-rates-used.d.ts +8 -0
- package/dist/entities/shared/tax-rates-used.js +17 -0
- package/dist/entities/shared/time-period.d.ts +8 -0
- package/dist/entities/shared/time-period.js +16 -0
- package/dist/entities/shared/total-adjustments.d.ts +12 -0
- package/dist/entities/shared/total-adjustments.js +24 -0
- package/dist/entities/shared/totals.d.ts +9 -0
- package/dist/entities/shared/totals.js +20 -0
- package/dist/entities/shared/transaction-checkout.d.ts +6 -0
- package/dist/entities/shared/transaction-checkout.js +14 -0
- package/dist/entities/shared/transaction-payment-attempt.d.ts +15 -0
- package/dist/entities/shared/transaction-payment-attempt.js +31 -0
- package/dist/entities/shared/transaction-payout-totals-adjusted.d.ts +14 -0
- package/dist/entities/shared/transaction-payout-totals-adjusted.js +29 -0
- package/dist/entities/shared/transaction-payout-totals.d.ts +16 -0
- package/dist/entities/shared/transaction-payout-totals.js +32 -0
- package/dist/entities/shared/transaction-totals-adjusted.d.ts +13 -0
- package/dist/entities/shared/transaction-totals-adjusted.js +26 -0
- package/dist/entities/shared/transaction-totals.d.ts +16 -0
- package/dist/entities/shared/transaction-totals.js +32 -0
- package/dist/entities/shared/unit-price-override.d.ts +9 -0
- package/dist/entities/shared/unit-price-override.js +17 -0
- package/dist/entities/shared/unit-totals.d.ts +9 -0
- package/dist/entities/shared/unit-totals.js +20 -0
- package/dist/entities/subscription/index.d.ts +12 -0
- package/dist/entities/subscription/index.js +28 -0
- package/dist/entities/subscription/next-transaction.d.ts +9 -0
- package/dist/entities/subscription/next-transaction.js +19 -0
- package/dist/entities/subscription/subscription-collection.d.ts +6 -0
- package/dist/entities/subscription/subscription-collection.js +11 -0
- package/dist/entities/subscription/subscription-discount.d.ts +8 -0
- package/dist/entities/subscription/subscription-discount.js +18 -0
- package/dist/entities/subscription/subscription-includes.d.ts +31 -0
- package/dist/entities/subscription/subscription-includes.js +67 -0
- package/dist/entities/subscription/subscription-item.d.ts +16 -0
- package/dist/entities/subscription/subscription-item.js +33 -0
- package/dist/entities/subscription/subscription-management.d.ts +7 -0
- package/dist/entities/subscription/subscription-management.js +16 -0
- package/dist/entities/subscription/subscription-price.d.ts +14 -0
- package/dist/entities/subscription/subscription-price.js +27 -0
- package/dist/entities/subscription/subscription-scheduled-change.d.ts +9 -0
- package/dist/entities/subscription/subscription-scheduled-change.js +18 -0
- package/dist/entities/subscription/subscription-time-period.d.ts +7 -0
- package/dist/entities/subscription/subscription-time-period.js +16 -0
- package/dist/entities/subscription/subscription.d.ts +29 -0
- package/dist/entities/subscription/subscription.js +61 -0
- package/dist/entities/subscription/transaction-details-preview.d.ts +9 -0
- package/dist/entities/subscription/transaction-details-preview.js +19 -0
- package/dist/entities/subscription/transaction-line-item-preview.d.ts +12 -0
- package/dist/entities/subscription/transaction-line-item-preview.js +25 -0
- package/dist/entities/transaction/adjustment-totals-breakdown.d.ts +8 -0
- package/dist/entities/transaction/adjustment-totals-breakdown.js +18 -0
- package/dist/entities/transaction/adjustment-totals.d.ts +14 -0
- package/dist/entities/transaction/adjustment-totals.js +27 -0
- package/dist/entities/transaction/index.d.ts +12 -0
- package/dist/entities/transaction/index.js +28 -0
- package/dist/entities/transaction/transaction-adjustment-item.d.ts +13 -0
- package/dist/entities/transaction/transaction-adjustment-item.js +29 -0
- package/dist/entities/transaction/transaction-adjustment.d.ts +21 -0
- package/dist/entities/transaction/transaction-adjustment.js +41 -0
- package/dist/entities/transaction/transaction-collection.d.ts +6 -0
- package/dist/entities/transaction/transaction-collection.js +11 -0
- package/dist/entities/transaction/transaction-details.d.ts +12 -0
- package/dist/entities/transaction/transaction-details.js +31 -0
- package/dist/entities/transaction/transaction-includes.d.ts +35 -0
- package/dist/entities/transaction/transaction-includes.js +74 -0
- package/dist/entities/transaction/transaction-item.d.ts +10 -0
- package/dist/entities/transaction/transaction-item.js +21 -0
- package/dist/entities/transaction/transaction-line-item.d.ts +14 -0
- package/dist/entities/transaction/transaction-line-item.js +31 -0
- package/dist/entities/transaction/transaction-proration.d.ts +8 -0
- package/dist/entities/transaction/transaction-proration.js +19 -0
- package/dist/entities/transaction/transaction.d.ts +29 -0
- package/dist/entities/transaction/transaction.js +59 -0
- package/dist/entities/transaction/transactions-time-period.d.ts +7 -0
- package/dist/entities/transaction/transactions-time-period.js +16 -0
- package/dist/enums/adjustment/adjustment-action.d.ts +1 -0
- package/dist/enums/adjustment/adjustment-action.js +2 -0
- package/dist/enums/adjustment/adjustment-currency-code.d.ts +1 -0
- package/dist/enums/adjustment/adjustment-currency-code.js +2 -0
- package/dist/enums/adjustment/adjustment-status.d.ts +1 -0
- package/dist/enums/adjustment/adjustment-status.js +2 -0
- package/dist/enums/adjustment/adjustment-type.d.ts +1 -0
- package/dist/enums/adjustment/adjustment-type.js +2 -0
- package/dist/enums/adjustment/index.d.ts +4 -0
- package/dist/enums/adjustment/index.js +20 -0
- package/dist/enums/discount/discount-status.d.ts +1 -0
- package/dist/enums/discount/discount-status.js +2 -0
- package/dist/enums/discount/discount-type.d.ts +1 -0
- package/dist/enums/discount/discount-type.js +2 -0
- package/dist/enums/discount/index.d.ts +2 -0
- package/dist/enums/discount/index.js +18 -0
- package/dist/enums/index.d.ts +5 -0
- package/dist/enums/index.js +21 -0
- package/dist/enums/shared/collection-mode.d.ts +1 -0
- package/dist/enums/shared/collection-mode.js +2 -0
- package/dist/enums/shared/country-code.d.ts +1 -0
- package/dist/enums/shared/country-code.js +2 -0
- package/dist/enums/shared/currency-code.d.ts +1 -0
- package/dist/enums/shared/currency-code.js +2 -0
- package/dist/enums/shared/error-code.d.ts +1 -0
- package/dist/enums/shared/error-code.js +2 -0
- package/dist/enums/shared/index.d.ts +13 -0
- package/dist/enums/shared/index.js +29 -0
- package/dist/enums/shared/interval.d.ts +1 -0
- package/dist/enums/shared/interval.js +2 -0
- package/dist/enums/shared/payment-attempt-status.d.ts +1 -0
- package/dist/enums/shared/payment-attempt-status.js +2 -0
- package/dist/enums/shared/payment-type.d.ts +1 -0
- package/dist/enums/shared/payment-type.js +2 -0
- package/dist/enums/shared/payout-currency-code.d.ts +1 -0
- package/dist/enums/shared/payout-currency-code.js +2 -0
- package/dist/enums/shared/status.d.ts +1 -0
- package/dist/enums/shared/status.js +2 -0
- package/dist/enums/shared/tax-category.d.ts +1 -0
- package/dist/enums/shared/tax-category.js +2 -0
- package/dist/enums/shared/tax-mode.d.ts +1 -0
- package/dist/enums/shared/tax-mode.js +2 -0
- package/dist/enums/shared/transaction-origin.d.ts +1 -0
- package/dist/enums/shared/transaction-origin.js +2 -0
- package/dist/enums/shared/transaction-status.d.ts +1 -0
- package/dist/enums/shared/transaction-status.js +2 -0
- package/dist/enums/subscription/index.d.ts +5 -0
- package/dist/enums/subscription/index.js +21 -0
- package/dist/enums/subscription/proration-billing-mode.d.ts +1 -0
- package/dist/enums/subscription/proration-billing-mode.js +2 -0
- package/dist/enums/subscription/scheduled-change-action.d.ts +1 -0
- package/dist/enums/subscription/scheduled-change-action.js +2 -0
- package/dist/enums/subscription/subscription-effective-from.d.ts +1 -0
- package/dist/enums/subscription/subscription-effective-from.js +2 -0
- package/dist/enums/subscription/subscription-item-status.d.ts +1 -0
- package/dist/enums/subscription/subscription-item-status.js +2 -0
- package/dist/enums/subscription/subscription-status.d.ts +1 -0
- package/dist/enums/subscription/subscription-status.js +2 -0
- package/dist/enums/transaction/index.d.ts +1 -0
- package/dist/enums/transaction/index.js +17 -0
- package/dist/enums/transaction/payment-card-type.d.ts +1 -0
- package/dist/enums/transaction/payment-card-type.js +2 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +28 -0
- package/dist/internal/api/client.d.ts +13 -0
- package/dist/internal/api/client.js +69 -0
- package/dist/internal/api/constants.d.ts +2 -0
- package/dist/internal/api/constants.js +8 -0
- package/dist/internal/api/environment.d.ts +4 -0
- package/dist/internal/api/environment.js +8 -0
- package/dist/internal/base/base-resource.d.ts +8 -0
- package/dist/internal/base/base-resource.js +21 -0
- package/dist/internal/base/collection.d.ts +13 -0
- package/dist/internal/base/collection.js +65 -0
- package/dist/internal/base/index.d.ts +4 -0
- package/dist/internal/base/index.js +20 -0
- package/dist/internal/base/path-parameters.d.ts +6 -0
- package/dist/internal/base/path-parameters.js +20 -0
- package/dist/internal/base/query-parameters.d.ts +5 -0
- package/dist/internal/base/query-parameters.js +19 -0
- package/dist/internal/errors/generic.d.ts +12 -0
- package/dist/internal/errors/generic.js +25 -0
- package/dist/internal/index.d.ts +3 -0
- package/dist/internal/index.js +5 -0
- package/dist/internal/types/config.d.ts +4 -0
- package/dist/internal/types/config.js +2 -0
- package/dist/internal/types/response.d.ts +31 -0
- package/dist/internal/types/response.js +2 -0
- package/dist/notifications/index.d.ts +1 -0
- package/dist/notifications/index.js +17 -0
- package/dist/notifications/validator/notifications-validator.d.ts +5 -0
- package/dist/notifications/validator/notifications-validator.js +41 -0
- package/dist/paddle.d.ts +16 -0
- package/dist/paddle.js +24 -0
- package/dist/resources/addresses/index.d.ts +10 -0
- package/dist/resources/addresses/index.js +79 -0
- package/dist/resources/addresses/operations/create-address-path-parameters.d.ts +3 -0
- package/dist/resources/addresses/operations/create-address-path-parameters.js +2 -0
- package/dist/resources/addresses/operations/create-address-request-body.d.ts +12 -0
- package/dist/resources/addresses/operations/create-address-request-body.js +2 -0
- package/dist/resources/addresses/operations/get-address-path-parameters.d.ts +4 -0
- package/dist/resources/addresses/operations/get-address-path-parameters.js +2 -0
- package/dist/resources/addresses/operations/index.d.ts +7 -0
- package/dist/resources/addresses/operations/index.js +23 -0
- package/dist/resources/addresses/operations/list-address-path-parameters.d.ts +3 -0
- package/dist/resources/addresses/operations/list-address-path-parameters.js +2 -0
- package/dist/resources/addresses/operations/list-address-query-parameters.d.ts +9 -0
- package/dist/resources/addresses/operations/list-address-query-parameters.js +2 -0
- package/dist/resources/addresses/operations/update-address-path-parameters.d.ts +4 -0
- package/dist/resources/addresses/operations/update-address-path-parameters.js +2 -0
- package/dist/resources/addresses/operations/update-address-request-body.d.ts +13 -0
- package/dist/resources/addresses/operations/update-address-request-body.js +2 -0
- package/dist/resources/adjustments/index.d.ts +8 -0
- package/dist/resources/adjustments/index.js +49 -0
- package/dist/resources/adjustments/operations/create-adjustment-request-body.d.ts +12 -0
- package/dist/resources/adjustments/operations/create-adjustment-request-body.js +2 -0
- package/dist/resources/adjustments/operations/index.d.ts +2 -0
- package/dist/resources/adjustments/operations/index.js +18 -0
- package/dist/resources/adjustments/operations/list-adjustment-query-parameters.d.ts +12 -0
- package/dist/resources/adjustments/operations/list-adjustment-query-parameters.js +2 -0
- package/dist/resources/businesses/index.d.ts +10 -0
- package/dist/resources/businesses/index.js +79 -0
- package/dist/resources/businesses/operations/create-business-path-parameters.d.ts +3 -0
- package/dist/resources/businesses/operations/create-business-path-parameters.js +2 -0
- package/dist/resources/businesses/operations/create-business-request-body.d.ts +8 -0
- package/dist/resources/businesses/operations/create-business-request-body.js +2 -0
- package/dist/resources/businesses/operations/get-business-path-parameters.d.ts +4 -0
- package/dist/resources/businesses/operations/get-business-path-parameters.js +2 -0
- package/dist/resources/businesses/operations/index.d.ts +7 -0
- package/dist/resources/businesses/operations/index.js +23 -0
- package/dist/resources/businesses/operations/list-business-path-parameters.d.ts +3 -0
- package/dist/resources/businesses/operations/list-business-path-parameters.js +2 -0
- package/dist/resources/businesses/operations/list-business-query-parameters.d.ts +9 -0
- package/dist/resources/businesses/operations/list-business-query-parameters.js +2 -0
- package/dist/resources/businesses/operations/update-business-path-parameters.d.ts +4 -0
- package/dist/resources/businesses/operations/update-business-path-parameters.js +2 -0
- package/dist/resources/businesses/operations/update-business-request-body.d.ts +10 -0
- package/dist/resources/businesses/operations/update-business-request-body.js +2 -0
- package/dist/resources/customers/index.d.ts +10 -0
- package/dist/resources/customers/index.js +71 -0
- package/dist/resources/customers/operations/create-customer-request-body.d.ts +7 -0
- package/dist/resources/customers/operations/create-customer-request-body.js +2 -0
- package/dist/resources/customers/operations/get-customer-path-parameters.d.ts +3 -0
- package/dist/resources/customers/operations/get-customer-path-parameters.js +2 -0
- package/dist/resources/customers/operations/index.d.ts +5 -0
- package/dist/resources/customers/operations/index.js +21 -0
- package/dist/resources/customers/operations/list-customer-query-parameters.d.ts +9 -0
- package/dist/resources/customers/operations/list-customer-query-parameters.js +2 -0
- package/dist/resources/customers/operations/update-customer-path-parameters.d.ts +3 -0
- package/dist/resources/customers/operations/update-customer-path-parameters.js +2 -0
- package/dist/resources/customers/operations/update-customer-request-body.d.ts +9 -0
- package/dist/resources/customers/operations/update-customer-request-body.js +2 -0
- package/dist/resources/discounts/index.d.ts +10 -0
- package/dist/resources/discounts/index.js +71 -0
- package/dist/resources/discounts/operations/create-discount-request-body.d.ts +14 -0
- package/dist/resources/discounts/operations/create-discount-request-body.js +2 -0
- package/dist/resources/discounts/operations/get-discount-path-parameters.d.ts +3 -0
- package/dist/resources/discounts/operations/get-discount-path-parameters.js +2 -0
- package/dist/resources/discounts/operations/index.d.ts +5 -0
- package/dist/resources/discounts/operations/index.js +21 -0
- package/dist/resources/discounts/operations/list-discount-query-parameters.d.ts +9 -0
- package/dist/resources/discounts/operations/list-discount-query-parameters.js +2 -0
- package/dist/resources/discounts/operations/update-discount-path-parameters.d.ts +3 -0
- package/dist/resources/discounts/operations/update-discount-path-parameters.js +2 -0
- package/dist/resources/discounts/operations/update-discount-request-body.d.ts +15 -0
- package/dist/resources/discounts/operations/update-discount-request-body.js +2 -0
- package/dist/resources/index.d.ts +9 -0
- package/dist/resources/index.js +25 -0
- package/dist/resources/prices/index.d.ts +10 -0
- package/dist/resources/prices/index.js +72 -0
- package/dist/resources/prices/operations/create-price-request-body.d.ts +13 -0
- package/dist/resources/prices/operations/create-price-request-body.js +2 -0
- package/dist/resources/prices/operations/get-price-path-parameters.d.ts +3 -0
- package/dist/resources/prices/operations/get-price-path-parameters.js +2 -0
- package/dist/resources/prices/operations/get-price-query-parameters.d.ts +3 -0
- package/dist/resources/prices/operations/get-price-query-parameters.js +2 -0
- package/dist/resources/prices/operations/index.d.ts +6 -0
- package/dist/resources/prices/operations/index.js +22 -0
- package/dist/resources/prices/operations/list-price-query-parameters.d.ts +11 -0
- package/dist/resources/prices/operations/list-price-query-parameters.js +2 -0
- package/dist/resources/prices/operations/update-price-path-parameters.d.ts +3 -0
- package/dist/resources/prices/operations/update-price-path-parameters.js +2 -0
- package/dist/resources/prices/operations/update-price-request-body.d.ts +13 -0
- package/dist/resources/prices/operations/update-price-request-body.js +2 -0
- package/dist/resources/products/index.d.ts +10 -0
- package/dist/resources/products/index.js +72 -0
- package/dist/resources/products/operations/create-product-request-body.d.ts +9 -0
- package/dist/resources/products/operations/create-product-request-body.js +2 -0
- package/dist/resources/products/operations/get-product-path-parameters.d.ts +3 -0
- package/dist/resources/products/operations/get-product-path-parameters.js +2 -0
- package/dist/resources/products/operations/get-product-query-parameters.d.ts +3 -0
- package/dist/resources/products/operations/get-product-query-parameters.js +2 -0
- package/dist/resources/products/operations/index.d.ts +6 -0
- package/dist/resources/products/operations/index.js +22 -0
- package/dist/resources/products/operations/list-product-query-parameters.d.ts +10 -0
- package/dist/resources/products/operations/list-product-query-parameters.js +2 -0
- package/dist/resources/products/operations/update-product-path-parameters.d.ts +3 -0
- package/dist/resources/products/operations/update-product-path-parameters.js +2 -0
- package/dist/resources/products/operations/update-product-request-body.d.ts +10 -0
- package/dist/resources/products/operations/update-product-request-body.js +2 -0
- package/dist/resources/subscriptions/index.d.ts +9 -0
- package/dist/resources/subscriptions/index.js +64 -0
- package/dist/resources/subscriptions/operations/get-subscription-path-parameters.d.ts +3 -0
- package/dist/resources/subscriptions/operations/get-subscription-path-parameters.js +2 -0
- package/dist/resources/subscriptions/operations/get-subscription-query-parameters.d.ts +3 -0
- package/dist/resources/subscriptions/operations/get-subscription-query-parameters.js +2 -0
- package/dist/resources/subscriptions/operations/index.d.ts +5 -0
- package/dist/resources/subscriptions/operations/index.js +21 -0
- package/dist/resources/subscriptions/operations/list-subscription-query-parameters.d.ts +13 -0
- package/dist/resources/subscriptions/operations/list-subscription-query-parameters.js +2 -0
- package/dist/resources/subscriptions/operations/update-subscription-path-parameters.d.ts +3 -0
- package/dist/resources/subscriptions/operations/update-subscription-path-parameters.js +2 -0
- package/dist/resources/subscriptions/operations/update-subscription-request-body.d.ts +16 -0
- package/dist/resources/subscriptions/operations/update-subscription-request-body.js +2 -0
- package/dist/resources/transactions/index.d.ts +10 -0
- package/dist/resources/transactions/index.js +73 -0
- package/dist/resources/transactions/operations/create-transaction-query-parameters.d.ts +3 -0
- package/dist/resources/transactions/operations/create-transaction-query-parameters.js +2 -0
- package/dist/resources/transactions/operations/create-transaction-request-body.d.ts +21 -0
- package/dist/resources/transactions/operations/create-transaction-request-body.js +2 -0
- package/dist/resources/transactions/operations/get-transaction-path-parameters.d.ts +3 -0
- package/dist/resources/transactions/operations/get-transaction-path-parameters.js +2 -0
- package/dist/resources/transactions/operations/get-transaction-query-parameters.d.ts +3 -0
- package/dist/resources/transactions/operations/get-transaction-query-parameters.js +2 -0
- package/dist/resources/transactions/operations/index.d.ts +7 -0
- package/dist/resources/transactions/operations/index.js +23 -0
- package/dist/resources/transactions/operations/list-transaction-query-parameters.d.ts +16 -0
- package/dist/resources/transactions/operations/list-transaction-query-parameters.js +2 -0
- package/dist/resources/transactions/operations/update-transaction-path-parameters.d.ts +3 -0
- package/dist/resources/transactions/operations/update-transaction-path-parameters.js +2 -0
- package/dist/resources/transactions/operations/update-transaction-request-body.d.ts +21 -0
- package/dist/resources/transactions/operations/update-transaction-request-body.js +2 -0
- package/dist/types/address/address.d.ts +16 -0
- package/dist/types/address/address.js +2 -0
- package/dist/types/address/index.d.ts +1 -0
- package/dist/types/address/index.js +17 -0
- package/dist/types/adjustment/adjustment-item.d.ts +10 -0
- package/dist/types/adjustment/adjustment-item.js +2 -0
- package/dist/types/adjustment/adjustment.d.ts +18 -0
- package/dist/types/adjustment/adjustment.js +2 -0
- package/dist/types/adjustment/adjustments-proration.d.ts +5 -0
- package/dist/types/adjustment/adjustments-proration.js +2 -0
- package/dist/types/adjustment/adjustments-time-period.d.ts +4 -0
- package/dist/types/adjustment/adjustments-time-period.js +2 -0
- package/dist/types/adjustment/index.d.ts +4 -0
- package/dist/types/adjustment/index.js +20 -0
- package/dist/types/business/business.d.ts +13 -0
- package/dist/types/business/business.js +2 -0
- package/dist/types/business/businesses-contacts.d.ts +4 -0
- package/dist/types/business/businesses-contacts.js +2 -0
- package/dist/types/business/index.d.ts +2 -0
- package/dist/types/business/index.js +18 -0
- package/dist/types/customer/customer.d.ts +13 -0
- package/dist/types/customer/customer.js +2 -0
- package/dist/types/customer/index.d.ts +1 -0
- package/dist/types/customer/index.js +17 -0
- package/dist/types/discount/discount.d.ts +19 -0
- package/dist/types/discount/discount.js +2 -0
- package/dist/types/discount/index.d.ts +1 -0
- package/dist/types/discount/index.js +17 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.js +26 -0
- package/dist/types/price/index.d.ts +1 -0
- package/dist/types/price/index.js +17 -0
- package/dist/types/price/price.d.ts +16 -0
- package/dist/types/price/price.js +2 -0
- package/dist/types/product/index.d.ts +1 -0
- package/dist/types/product/index.js +17 -0
- package/dist/types/product/product.d.ts +13 -0
- package/dist/types/product/product.js +2 -0
- package/dist/types/shared/adjustment-item-totals.d.ts +5 -0
- package/dist/types/shared/adjustment-item-totals.js +2 -0
- package/dist/types/shared/adjustment-original-amount.d.ts +5 -0
- package/dist/types/shared/adjustment-original-amount.js +2 -0
- package/dist/types/shared/billing-details-update.d.ts +7 -0
- package/dist/types/shared/billing-details-update.js +2 -0
- package/dist/types/shared/billing-details.d.ts +7 -0
- package/dist/types/shared/billing-details.js +2 -0
- package/dist/types/shared/chargeback-fee.d.ts +5 -0
- package/dist/types/shared/chargeback-fee.js +2 -0
- package/dist/types/shared/custom-data.d.ts +1 -0
- package/dist/types/shared/custom-data.js +2 -0
- package/dist/types/shared/index.d.ts +27 -0
- package/dist/types/shared/index.js +43 -0
- package/dist/types/shared/money.d.ts +5 -0
- package/dist/types/shared/money.js +2 -0
- package/dist/types/shared/payment-card.d.ts +8 -0
- package/dist/types/shared/payment-card.js +2 -0
- package/dist/types/shared/payment-method-details.d.ts +6 -0
- package/dist/types/shared/payment-method-details.js +2 -0
- package/dist/types/shared/payout-totals-adjustment.d.ts +11 -0
- package/dist/types/shared/payout-totals-adjustment.js +2 -0
- package/dist/types/shared/price-quantity.d.ts +4 -0
- package/dist/types/shared/price-quantity.js +2 -0
- package/dist/types/shared/shared-price.d.ts +15 -0
- package/dist/types/shared/shared-price.js +2 -0
- package/dist/types/shared/shared-product.d.ts +12 -0
- package/dist/types/shared/shared-product.js +2 -0
- package/dist/types/shared/tax-rates-used.d.ts +5 -0
- package/dist/types/shared/tax-rates-used.js +2 -0
- package/dist/types/shared/time-period.d.ts +5 -0
- package/dist/types/shared/time-period.js +2 -0
- package/dist/types/shared/total-adjustments.d.ts +9 -0
- package/dist/types/shared/total-adjustments.js +2 -0
- package/dist/types/shared/totals.d.ts +6 -0
- package/dist/types/shared/totals.js +2 -0
- package/dist/types/shared/transaction-checkout.d.ts +3 -0
- package/dist/types/shared/transaction-checkout.js +2 -0
- package/dist/types/shared/transaction-details-preview.d.ts +6 -0
- package/dist/types/shared/transaction-details-preview.js +2 -0
- package/dist/types/shared/transaction-line-item-preview.d.ts +9 -0
- package/dist/types/shared/transaction-line-item-preview.js +2 -0
- package/dist/types/shared/transaction-payment-attempt.d.ts +12 -0
- package/dist/types/shared/transaction-payment-attempt.js +2 -0
- package/dist/types/shared/transaction-payout-totals-adjusted.d.ts +11 -0
- package/dist/types/shared/transaction-payout-totals-adjusted.js +2 -0
- package/dist/types/shared/transaction-payout-totals.d.ts +13 -0
- package/dist/types/shared/transaction-payout-totals.js +2 -0
- package/dist/types/shared/transaction-totals-adjusted.d.ts +10 -0
- package/dist/types/shared/transaction-totals-adjusted.js +2 -0
- package/dist/types/shared/transaction-totals.d.ts +13 -0
- package/dist/types/shared/transaction-totals.js +2 -0
- package/dist/types/shared/unit-price-override.d.ts +6 -0
- package/dist/types/shared/unit-price-override.js +2 -0
- package/dist/types/shared/unit-totals.d.ts +6 -0
- package/dist/types/shared/unit-totals.js +2 -0
- package/dist/types/subscription/index.d.ts +10 -0
- package/dist/types/subscription/index.js +26 -0
- package/dist/types/subscription/next-transaction.d.ts +6 -0
- package/dist/types/subscription/next-transaction.js +2 -0
- package/dist/types/subscription/subscription-discount.d.ts +5 -0
- package/dist/types/subscription/subscription-discount.js +2 -0
- package/dist/types/subscription/subscription-item.d.ts +13 -0
- package/dist/types/subscription/subscription-item.js +2 -0
- package/dist/types/subscription/subscription-management.d.ts +4 -0
- package/dist/types/subscription/subscription-management.js +2 -0
- package/dist/types/subscription/subscription-price.d.ts +11 -0
- package/dist/types/subscription/subscription-price.js +2 -0
- package/dist/types/subscription/subscription-response.d.ts +28 -0
- package/dist/types/subscription/subscription-response.js +2 -0
- package/dist/types/subscription/subscription-scheduled-change.d.ts +6 -0
- package/dist/types/subscription/subscription-scheduled-change.js +2 -0
- package/dist/types/subscription/subscription-time-period.d.ts +4 -0
- package/dist/types/subscription/subscription-time-period.js +2 -0
- package/dist/types/subscription/subscription-update-item.d.ts +4 -0
- package/dist/types/subscription/subscription-update-item.js +2 -0
- package/dist/types/transaction/adjustment-totals-breakdown.d.ts +5 -0
- package/dist/types/transaction/adjustment-totals-breakdown.js +2 -0
- package/dist/types/transaction/adjustment-totals.d.ts +11 -0
- package/dist/types/transaction/adjustment-totals.js +2 -0
- package/dist/types/transaction/index.d.ts +10 -0
- package/dist/types/transaction/index.js +26 -0
- package/dist/types/transaction/transaction-adjustment-item.d.ts +10 -0
- package/dist/types/transaction/transaction-adjustment-item.js +2 -0
- package/dist/types/transaction/transaction-adjustment.d.ts +18 -0
- package/dist/types/transaction/transaction-adjustment.js +2 -0
- package/dist/types/transaction/transaction-details.d.ts +9 -0
- package/dist/types/transaction/transaction-details.js +2 -0
- package/dist/types/transaction/transaction-item.d.ts +7 -0
- package/dist/types/transaction/transaction-item.js +2 -0
- package/dist/types/transaction/transaction-line-item.d.ts +11 -0
- package/dist/types/transaction/transaction-line-item.js +2 -0
- package/dist/types/transaction/transaction-proration.d.ts +5 -0
- package/dist/types/transaction/transaction-proration.js +2 -0
- package/dist/types/transaction/transaction.d.ts +32 -0
- package/dist/types/transaction/transaction.js +2 -0
- package/dist/types/transaction/transactions-time-period.d.ts +4 -0
- package/dist/types/transaction/transactions-time-period.js +2 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +4 -0
- package/package.json +58 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.DiscountsResource = void 0;
|
|
27
|
+
const entities_1 = require("../../entities");
|
|
28
|
+
const base_1 = require("../../internal/base");
|
|
29
|
+
const DiscountPaths = {
|
|
30
|
+
list: '/discounts',
|
|
31
|
+
create: '/discounts',
|
|
32
|
+
get: '/discounts/{discount_id}',
|
|
33
|
+
update: '/discounts/{discount_id}',
|
|
34
|
+
};
|
|
35
|
+
__exportStar(require("./operations"), exports);
|
|
36
|
+
class DiscountsResource extends base_1.BaseResource {
|
|
37
|
+
list(queryParams) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const queryParameters = new base_1.QueryParameters(queryParams);
|
|
40
|
+
return new entities_1.DiscountCollection(this.client, DiscountPaths.list + queryParameters.toQueryString());
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
create(createDiscountParameters) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const response = yield this.client.post(DiscountPaths.create, createDiscountParameters);
|
|
46
|
+
const data = this.handleResponse(response);
|
|
47
|
+
return new entities_1.Discount(data);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
get(discountId) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const urlWithPathParams = new base_1.PathParameters(DiscountPaths.get, {
|
|
53
|
+
discount_id: discountId,
|
|
54
|
+
}).deriveUrl();
|
|
55
|
+
const response = yield this.client.get(urlWithPathParams);
|
|
56
|
+
const data = this.handleResponse(response);
|
|
57
|
+
return new entities_1.Discount(data);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
update(discountId, updateProduct) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
const urlWithPathParams = new base_1.PathParameters(DiscountPaths.update, {
|
|
63
|
+
discount_id: discountId,
|
|
64
|
+
}).deriveUrl();
|
|
65
|
+
const response = yield this.client.patch(urlWithPathParams, updateProduct);
|
|
66
|
+
const data = this.handleResponse(response);
|
|
67
|
+
return new entities_1.Discount(data);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.DiscountsResource = DiscountsResource;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type CurrencyCode, type DiscountType } from '../../../enums';
|
|
2
|
+
export interface CreateDiscountRequestBody {
|
|
3
|
+
amount: string;
|
|
4
|
+
description: string;
|
|
5
|
+
type: DiscountType;
|
|
6
|
+
enabled_for_checkout?: boolean | undefined | null;
|
|
7
|
+
code?: string | undefined | null;
|
|
8
|
+
currency_code?: CurrencyCode | undefined | null;
|
|
9
|
+
recur?: boolean;
|
|
10
|
+
maximum_recurring_intervals?: number | undefined | null;
|
|
11
|
+
usage_limit?: number | undefined | null;
|
|
12
|
+
restrict_to?: string[] | undefined | null;
|
|
13
|
+
expires_at?: string | undefined | null;
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./list-discount-query-parameters"), exports);
|
|
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
|
+
__exportStar(require("./update-discount-request-body"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Status, type PaymentType, type CurrencyCode } from '../../../enums';
|
|
2
|
+
export interface UpdateDiscountRequestBody {
|
|
3
|
+
status?: Status;
|
|
4
|
+
description?: string;
|
|
5
|
+
enabled_for_checkout?: boolean;
|
|
6
|
+
code?: string | undefined | null;
|
|
7
|
+
type?: PaymentType;
|
|
8
|
+
amount?: string;
|
|
9
|
+
currency_code?: CurrencyCode | undefined | null;
|
|
10
|
+
recur?: boolean;
|
|
11
|
+
maximum_recurring_intervals?: number | undefined | null;
|
|
12
|
+
usage_limit?: number | undefined | null;
|
|
13
|
+
restrict_to?: any[] | undefined | null;
|
|
14
|
+
expires_at?: string | undefined | null;
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './addresses';
|
|
2
|
+
export * from './adjustments';
|
|
3
|
+
export * from './businesses';
|
|
4
|
+
export * from './customers';
|
|
5
|
+
export * from './discounts';
|
|
6
|
+
export * from './prices';
|
|
7
|
+
export * from './products';
|
|
8
|
+
export * from './subscriptions';
|
|
9
|
+
export * from './transactions';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./addresses"), exports);
|
|
18
|
+
__exportStar(require("./adjustments"), exports);
|
|
19
|
+
__exportStar(require("./businesses"), exports);
|
|
20
|
+
__exportStar(require("./customers"), exports);
|
|
21
|
+
__exportStar(require("./discounts"), exports);
|
|
22
|
+
__exportStar(require("./prices"), exports);
|
|
23
|
+
__exportStar(require("./products"), exports);
|
|
24
|
+
__exportStar(require("./subscriptions"), exports);
|
|
25
|
+
__exportStar(require("./transactions"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Price, PriceCollection, PriceWithIncludes } from '../../entities';
|
|
2
|
+
import { BaseResource } from '../../internal/base';
|
|
3
|
+
import { type ListPriceQueryParameters, type GetPriceQueryParameters, type CreatePriceRequestBody, type UpdatePriceRequestBody } from './operations';
|
|
4
|
+
export * from './operations';
|
|
5
|
+
export declare class PricesResource extends BaseResource {
|
|
6
|
+
list(queryParams?: ListPriceQueryParameters): Promise<PriceCollection>;
|
|
7
|
+
create(createPriceParameters: CreatePriceRequestBody): Promise<Price>;
|
|
8
|
+
get(priceId: string, queryParams?: GetPriceQueryParameters): Promise<PriceWithIncludes>;
|
|
9
|
+
update(priceId: string, updateProduct: UpdatePriceRequestBody): Promise<Price>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.PricesResource = void 0;
|
|
27
|
+
const entities_1 = require("../../entities");
|
|
28
|
+
const base_1 = require("../../internal/base");
|
|
29
|
+
const PricePaths = {
|
|
30
|
+
list: '/prices',
|
|
31
|
+
create: '/prices',
|
|
32
|
+
get: '/prices/{price_id}',
|
|
33
|
+
update: '/prices/{price_id}',
|
|
34
|
+
};
|
|
35
|
+
__exportStar(require("./operations"), exports);
|
|
36
|
+
class PricesResource extends base_1.BaseResource {
|
|
37
|
+
list(queryParams) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const queryParameters = new base_1.QueryParameters(queryParams);
|
|
40
|
+
return new entities_1.PriceCollection(this.client, PricePaths.list + queryParameters.toQueryString());
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
create(createPriceParameters) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const response = yield this.client.post(PricePaths.create, createPriceParameters);
|
|
46
|
+
const data = this.handleResponse(response);
|
|
47
|
+
return new entities_1.Price(data);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
get(priceId, queryParams) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const queryParameters = new base_1.QueryParameters(queryParams);
|
|
53
|
+
const urlWithPathParams = new base_1.PathParameters(PricePaths.get, {
|
|
54
|
+
price_id: priceId,
|
|
55
|
+
}).deriveUrl();
|
|
56
|
+
const response = yield this.client.get(urlWithPathParams, queryParameters);
|
|
57
|
+
const data = this.handleResponse(response);
|
|
58
|
+
return new entities_1.PriceWithIncludes(data);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
update(priceId, updateProduct) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
const urlWithPathParams = new base_1.PathParameters(PricePaths.update, {
|
|
64
|
+
price_id: priceId,
|
|
65
|
+
}).deriveUrl();
|
|
66
|
+
const response = yield this.client.patch(urlWithPathParams, updateProduct);
|
|
67
|
+
const data = this.handleResponse(response);
|
|
68
|
+
return new entities_1.Price(data);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.PricesResource = PricesResource;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type IMoney, type ITimePeriod, type IUnitPriceOverride, type IPriceQuantity, type ICustomData } from '../../../types';
|
|
2
|
+
import { type TaxMode } from '../../../enums';
|
|
3
|
+
export interface CreatePriceRequestBody {
|
|
4
|
+
description: string;
|
|
5
|
+
product_id: string;
|
|
6
|
+
unit_price: IMoney;
|
|
7
|
+
billing_cycle?: ITimePeriod | undefined | null;
|
|
8
|
+
trial_period?: ITimePeriod | undefined | null;
|
|
9
|
+
tax_mode?: TaxMode | undefined | null;
|
|
10
|
+
unit_price_overrides?: IUnitPriceOverride[] | undefined;
|
|
11
|
+
quantity?: IPriceQuantity | undefined;
|
|
12
|
+
custom_data?: ICustomData | undefined | null;
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './list-price-query-parameters';
|
|
2
|
+
export * from './create-price-request-body';
|
|
3
|
+
export * from './get-price-query-parameters';
|
|
4
|
+
export * from './get-price-path-parameters';
|
|
5
|
+
export * from './update-price-path-parameters';
|
|
6
|
+
export * from './update-price-request-body';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./list-price-query-parameters"), exports);
|
|
18
|
+
__exportStar(require("./create-price-request-body"), exports);
|
|
19
|
+
__exportStar(require("./get-price-query-parameters"), exports);
|
|
20
|
+
__exportStar(require("./get-price-path-parameters"), exports);
|
|
21
|
+
__exportStar(require("./update-price-path-parameters"), exports);
|
|
22
|
+
__exportStar(require("./update-price-request-body"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Status } from '../../../enums';
|
|
2
|
+
export interface ListPriceQueryParameters {
|
|
3
|
+
after?: string;
|
|
4
|
+
id?: string[];
|
|
5
|
+
include?: string[];
|
|
6
|
+
order_by?: string;
|
|
7
|
+
per_page?: number;
|
|
8
|
+
product_id?: string[];
|
|
9
|
+
status?: Status[];
|
|
10
|
+
recurring?: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ITimePeriod, type IMoney, type IUnitPriceOverride, type IPriceQuantity, type ICustomData } from '../../../types';
|
|
2
|
+
import { type TaxMode, type Status } from '../../../enums';
|
|
3
|
+
export interface UpdatePriceRequestBody {
|
|
4
|
+
description?: string;
|
|
5
|
+
billing_cycle?: ITimePeriod | null;
|
|
6
|
+
trial_period?: ITimePeriod | null;
|
|
7
|
+
tax_mode?: TaxMode;
|
|
8
|
+
unit_price?: IMoney;
|
|
9
|
+
unit_price_overrides?: IUnitPriceOverride[];
|
|
10
|
+
quantity?: IPriceQuantity;
|
|
11
|
+
status?: Status;
|
|
12
|
+
custom_data?: ICustomData | null;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Product, ProductCollection, ProductWithIncludes } from '../../entities';
|
|
2
|
+
import { BaseResource } from '../../internal/base';
|
|
3
|
+
import { type CreateProductRequestBody, type GetProductQueryParameters, type ListProductQueryParameters, type UpdateProductRequestBody } from './operations';
|
|
4
|
+
export * from './operations';
|
|
5
|
+
export declare class ProductsResource extends BaseResource {
|
|
6
|
+
list(queryParams?: ListProductQueryParameters): Promise<ProductCollection>;
|
|
7
|
+
create(createProductParameters: CreateProductRequestBody): Promise<Product>;
|
|
8
|
+
get(productId: string, queryParams?: GetProductQueryParameters): Promise<ProductWithIncludes>;
|
|
9
|
+
update(productId: string, updateProduct: UpdateProductRequestBody): Promise<Product>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ProductsResource = void 0;
|
|
27
|
+
const entities_1 = require("../../entities");
|
|
28
|
+
const base_1 = require("../../internal/base");
|
|
29
|
+
const ProductPaths = {
|
|
30
|
+
list: '/products',
|
|
31
|
+
create: '/products',
|
|
32
|
+
get: '/products/{product_id}',
|
|
33
|
+
update: '/products/{product_id}',
|
|
34
|
+
};
|
|
35
|
+
__exportStar(require("./operations"), exports);
|
|
36
|
+
class ProductsResource extends base_1.BaseResource {
|
|
37
|
+
list(queryParams) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const queryParameters = new base_1.QueryParameters(queryParams);
|
|
40
|
+
return new entities_1.ProductCollection(this.client, ProductPaths.list + queryParameters.toQueryString());
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
create(createProductParameters) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const response = yield this.client.post(ProductPaths.create, createProductParameters);
|
|
46
|
+
const data = this.handleResponse(response);
|
|
47
|
+
return new entities_1.Product(data);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
get(productId, queryParams) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const queryParameters = new base_1.QueryParameters(queryParams);
|
|
53
|
+
const urlWithPathParams = new base_1.PathParameters(ProductPaths.get, {
|
|
54
|
+
product_id: productId,
|
|
55
|
+
}).deriveUrl();
|
|
56
|
+
const response = yield this.client.get(urlWithPathParams, queryParameters);
|
|
57
|
+
const data = this.handleResponse(response);
|
|
58
|
+
return new entities_1.ProductWithIncludes(data);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
update(productId, updateProduct) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
const urlWithPathParams = new base_1.PathParameters(ProductPaths.update, {
|
|
64
|
+
product_id: productId,
|
|
65
|
+
}).deriveUrl();
|
|
66
|
+
const response = yield this.client.patch(urlWithPathParams, updateProduct);
|
|
67
|
+
const data = this.handleResponse(response);
|
|
68
|
+
return new entities_1.Product(data);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.ProductsResource = ProductsResource;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ICustomData } from '../../../types';
|
|
2
|
+
import { type TaxCategory } from '../../../enums';
|
|
3
|
+
export interface CreateProductRequestBody {
|
|
4
|
+
name: string;
|
|
5
|
+
tax_category: TaxCategory;
|
|
6
|
+
description?: string | undefined | null;
|
|
7
|
+
image_url?: undefined | string | null;
|
|
8
|
+
custom_data?: ICustomData | undefined | null;
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './list-product-query-parameters';
|
|
2
|
+
export * from './create-product-request-body';
|
|
3
|
+
export * from './get-product-query-parameters';
|
|
4
|
+
export * from './get-product-path-parameters';
|
|
5
|
+
export * from './update-product-path-parameters';
|
|
6
|
+
export * from './update-product-request-body';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./list-product-query-parameters"), exports);
|
|
18
|
+
__exportStar(require("./create-product-request-body"), exports);
|
|
19
|
+
__exportStar(require("./get-product-query-parameters"), exports);
|
|
20
|
+
__exportStar(require("./get-product-path-parameters"), exports);
|
|
21
|
+
__exportStar(require("./update-product-path-parameters"), exports);
|
|
22
|
+
__exportStar(require("./update-product-request-body"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Status, type TaxCategory } from '../../../enums';
|
|
2
|
+
export interface ListProductQueryParameters {
|
|
3
|
+
after?: string;
|
|
4
|
+
id?: string[];
|
|
5
|
+
include?: string[];
|
|
6
|
+
order_by?: string;
|
|
7
|
+
per_page?: number;
|
|
8
|
+
status?: Status[];
|
|
9
|
+
tax_category?: TaxCategory[];
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ICustomData } from '../../../types';
|
|
2
|
+
import { type TaxCategory, type Status } from '../../../enums';
|
|
3
|
+
export interface UpdateProductRequestBody {
|
|
4
|
+
name?: string;
|
|
5
|
+
description?: string | undefined | null;
|
|
6
|
+
tax_category?: TaxCategory;
|
|
7
|
+
image_url?: undefined | string | null;
|
|
8
|
+
custom_data?: ICustomData | undefined | null;
|
|
9
|
+
status?: Status;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Subscription, SubscriptionCollection, SubscriptionIncludes } from '../../entities';
|
|
2
|
+
import { BaseResource } from '../../internal/base';
|
|
3
|
+
import { type GetSubscriptionQueryParameters, type ListSubscriptionQueryParameters, type UpdateSubscriptionRequestBody } from './operations';
|
|
4
|
+
export * from './operations';
|
|
5
|
+
export declare class SubscriptionsResource extends BaseResource {
|
|
6
|
+
update(subscriptionId: string, updateProduct: UpdateSubscriptionRequestBody): Promise<Subscription>;
|
|
7
|
+
list(queryParams?: ListSubscriptionQueryParameters): Promise<SubscriptionCollection>;
|
|
8
|
+
get(subscriptionId: string, queryParams?: GetSubscriptionQueryParameters): Promise<SubscriptionIncludes>;
|
|
9
|
+
}
|