@paddle/paddle-node-sdk 2.7.3 → 3.0.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/dist/cjs/entities/address/address.js +14 -0
- package/dist/cjs/entities/adjustment/adjustment-credit-note-pdf.js +1 -0
- package/dist/cjs/entities/adjustment/adjustment-item-totals.js +3 -0
- package/dist/cjs/entities/adjustment/adjustment-item.js +6 -0
- package/dist/cjs/entities/adjustment/adjustment-proration.js +2 -0
- package/dist/cjs/entities/adjustment/adjustment-time-period.js +2 -0
- package/dist/cjs/entities/adjustment/adjustment.js +15 -0
- package/dist/cjs/entities/business/business.js +11 -0
- package/dist/cjs/entities/business/contacts.js +2 -0
- package/dist/cjs/entities/customer/auth-token.js +2 -0
- package/dist/cjs/entities/customer/credit-balance.js +3 -0
- package/dist/cjs/entities/customer/customer-balance.js +3 -0
- package/dist/cjs/entities/customer/customer.js +10 -0
- package/dist/cjs/entities/customer-portal-session/customer-portal-session.js +4 -0
- package/dist/cjs/entities/customer-portal-session/customer-portal-subscription-url.js +3 -0
- package/dist/cjs/entities/customer-portal-session/general.js +1 -0
- package/dist/cjs/entities/customer-portal-session/urls.js +3 -2
- package/dist/cjs/entities/discount/discount.js +21 -2
- package/dist/cjs/entities/discount-group/discount-group-collection.js +11 -0
- package/dist/cjs/entities/discount-group/discount-group.js +21 -0
- package/dist/cjs/entities/discount-group/index.js +18 -0
- package/dist/cjs/entities/event-types/event-type.js +4 -0
- package/dist/cjs/entities/events/event.js +6 -2
- package/dist/cjs/entities/index.js +1 -0
- package/dist/cjs/entities/notification-settings/notification-settings.js +10 -0
- package/dist/cjs/entities/notifications/notification-log.js +6 -2
- package/dist/cjs/entities/notifications/notification.js +16 -5
- package/dist/cjs/entities/notifications/replay-notification.js +1 -0
- package/dist/cjs/entities/payment-method/payment-method.js +13 -0
- package/dist/cjs/entities/payout/payout.js +4 -0
- package/dist/cjs/entities/price/price-quantity.js +2 -0
- package/dist/cjs/entities/price/price.js +18 -2
- package/dist/cjs/entities/pricing-preview/pricing-preview-details.js +1 -0
- package/dist/cjs/entities/pricing-preview/pricing-preview-discounts.js +3 -0
- package/dist/cjs/entities/pricing-preview/pricing-preview-line-item.js +9 -0
- package/dist/cjs/entities/pricing-preview/pricing-preview.js +15 -7
- package/dist/cjs/entities/product/product.js +13 -2
- package/dist/cjs/entities/report/report-csv.js +1 -0
- package/dist/cjs/entities/report/report-filters.js +4 -2
- package/dist/cjs/entities/report/report.js +10 -4
- package/dist/cjs/entities/shared/adjustment-original-amount.js +2 -0
- package/dist/cjs/entities/shared/billing-details.js +5 -2
- package/dist/cjs/entities/shared/chargeback-fee.js +2 -0
- package/dist/cjs/entities/shared/import-meta.js +2 -0
- package/dist/cjs/entities/shared/index.js +2 -0
- package/dist/cjs/entities/shared/korean-market-underlying-details.js +10 -0
- package/dist/cjs/entities/shared/money.js +2 -0
- package/dist/cjs/entities/shared/payment-card.js +5 -0
- package/dist/cjs/entities/shared/payment-method-details.js +7 -0
- package/dist/cjs/entities/shared/payment-method-underlying-details.js +13 -0
- package/dist/cjs/entities/shared/payout-totals-adjustment.js +7 -0
- package/dist/cjs/entities/shared/paypal.js +2 -0
- package/dist/cjs/entities/shared/simulation-event-request.js +1 -0
- package/dist/cjs/entities/shared/simulation-event-response.js +2 -0
- package/dist/cjs/entities/shared/tax-rates-used.js +2 -0
- package/dist/cjs/entities/shared/time-period.js +2 -0
- package/dist/cjs/entities/shared/total-adjustments.js +6 -0
- package/dist/cjs/entities/shared/totals.js +4 -0
- package/dist/cjs/entities/shared/transaction-checkout.js +1 -0
- package/dist/cjs/entities/shared/transaction-payment-attempt.js +10 -2
- package/dist/cjs/entities/shared/transaction-payout-totals-adjusted.js +7 -0
- package/dist/cjs/entities/shared/transaction-payout-totals.js +11 -0
- package/dist/cjs/entities/shared/transaction-totals-adjusted.js +7 -0
- package/dist/cjs/entities/shared/transaction-totals.js +11 -0
- package/dist/cjs/entities/shared/unit-price-override.js +2 -0
- package/dist/cjs/entities/shared/unit-totals.js +4 -0
- package/dist/cjs/entities/simulation/simulation-scenario-config/simulation-scenario-config.js +5 -0
- package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-cancellation-details.js +2 -0
- package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-cancellation-entities.js +2 -2
- package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-cancellation-options.js +4 -3
- package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-creation-details.js +2 -0
- package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-creation-entities.js +14 -8
- package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-creation-item.js +2 -0
- package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-creation-options.js +6 -4
- package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-pause-details.js +2 -0
- package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-pause-entities.js +2 -2
- package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-pause-options.js +4 -3
- package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-renewal-details.js +2 -0
- package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-renewal-entities.js +2 -2
- package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-renewal-options.js +4 -3
- package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-resume-details.js +2 -0
- package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-resume-entities.js +2 -2
- package/dist/cjs/entities/simulation/simulation-scenario-config/subscription-resume-options.js +4 -3
- package/dist/cjs/entities/simulation/simulation.js +12 -3
- package/dist/cjs/entities/simulation-run/simulation-run.js +7 -2
- package/dist/cjs/entities/simulation-run-event/simulation-run-event.js +8 -0
- package/dist/cjs/entities/simulation-types/simulation-type.js +6 -0
- package/dist/cjs/entities/subscription/next-transaction-adjustment-item.js +5 -0
- package/dist/cjs/entities/subscription/next-transaction-adjustment-preview.js +3 -0
- package/dist/cjs/entities/subscription/next-transaction.js +3 -0
- package/dist/cjs/entities/subscription/subscription-discount.js +5 -3
- package/dist/cjs/entities/subscription/subscription-item.js +10 -0
- package/dist/cjs/entities/subscription/subscription-management.js +2 -0
- package/dist/cjs/entities/subscription/subscription-preview-summary-result.js +3 -0
- package/dist/cjs/entities/subscription/subscription-preview-update-summary.js +3 -0
- package/dist/cjs/entities/subscription/subscription-preview.js +26 -0
- package/dist/cjs/entities/subscription/subscription-scheduled-change.js +3 -0
- package/dist/cjs/entities/subscription/subscription-time-period.js +2 -0
- package/dist/cjs/entities/subscription/subscription.js +25 -0
- package/dist/cjs/entities/subscription/transaction-details-preview.js +3 -0
- package/dist/cjs/entities/subscription/transaction-line-item-preview.js +7 -0
- package/dist/cjs/entities/transaction/address-preview.js +2 -0
- package/dist/cjs/entities/transaction/adjustment-totals-breakdown.js +3 -0
- package/dist/cjs/entities/transaction/adjustment-totals.js +7 -0
- package/dist/cjs/entities/transaction/proration.js +2 -0
- package/dist/cjs/entities/transaction/transaction-adjustment-item.js +6 -0
- package/dist/cjs/entities/transaction/transaction-adjustment.js +14 -0
- package/dist/cjs/entities/transaction/transaction-details.js +6 -0
- package/dist/cjs/entities/transaction/transaction-invoice-pdf.js +1 -0
- package/dist/cjs/entities/transaction/transaction-item-preview.js +5 -2
- package/dist/cjs/entities/transaction/transaction-item.js +3 -0
- package/dist/cjs/entities/transaction/transaction-line-item.js +8 -0
- package/dist/cjs/entities/transaction/transaction-preview.js +12 -2
- package/dist/cjs/entities/transaction/transaction-proration.js +2 -0
- package/dist/cjs/entities/transaction/transaction.js +31 -2
- package/dist/cjs/entities/transaction/transactions-time-period.js +2 -0
- package/dist/cjs/enums/api-key/api-key-permission.js +2 -0
- package/dist/cjs/enums/api-key/api-key-status.js +2 -0
- package/dist/cjs/enums/api-key/index.js +18 -0
- package/dist/cjs/enums/discount/discount-mode.js +2 -0
- package/dist/cjs/enums/discount/index.js +1 -0
- package/dist/cjs/enums/index.js +1 -0
- package/dist/cjs/enums/shared/index.js +1 -0
- package/dist/cjs/enums/shared/korean-market-underlying-payment-method-type.js +2 -0
- package/dist/cjs/internal/api/case-helpers.js +2 -13
- package/dist/cjs/internal/api/client.js +54 -64
- package/dist/cjs/internal/base/base-resource.js +1 -0
- package/dist/cjs/internal/base/collection.js +20 -45
- package/dist/cjs/internal/base/logger.js +1 -0
- package/dist/cjs/internal/base/path-parameters.js +2 -0
- package/dist/cjs/internal/base/query-parameters.js +1 -0
- package/dist/cjs/internal/errors/generic.js +5 -0
- package/dist/cjs/internal/providers/crypto/crypto-provider.js +2 -13
- package/dist/cjs/internal/providers/crypto/edge-crypto.js +14 -25
- package/dist/cjs/internal/providers/crypto/node-crypto.js +5 -16
- package/dist/cjs/internal/providers/runtime-provider.js +1 -0
- package/dist/cjs/notifications/entities/address/address-notification.js +15 -2
- package/dist/cjs/notifications/entities/adjustment/adjustment-item-notification.js +6 -0
- package/dist/cjs/notifications/entities/adjustment/adjustment-item-totals-notification.js +3 -0
- package/dist/cjs/notifications/entities/adjustment/adjustment-notification.js +15 -0
- package/dist/cjs/notifications/entities/adjustment/adjustment-proration-notification.js +2 -0
- package/dist/cjs/notifications/entities/adjustment/adjustment-time-period-notification.js +2 -0
- package/dist/cjs/notifications/entities/api-key/api-key-notification.js +28 -0
- package/dist/cjs/notifications/entities/api-key/index.js +17 -0
- package/dist/cjs/notifications/entities/business/business-notification.js +12 -2
- package/dist/cjs/notifications/entities/business/contacts-notification.js +2 -0
- package/dist/cjs/notifications/entities/customer/customer-notification.js +10 -0
- package/dist/cjs/notifications/entities/discount/discount-notification.js +21 -2
- package/dist/cjs/notifications/entities/discount-group/discount-group-notification.js +23 -0
- package/dist/cjs/notifications/entities/discount-group/index.js +17 -0
- package/dist/cjs/notifications/entities/index.js +2 -0
- package/dist/cjs/notifications/entities/payment-method/payment-method-deleted-notification.js +8 -0
- package/dist/cjs/notifications/entities/payment-method/payment-method-notification.js +7 -0
- package/dist/cjs/notifications/entities/payout/payout-notification.js +4 -0
- package/dist/cjs/notifications/entities/price/price-notification.js +19 -4
- package/dist/cjs/notifications/entities/price/price-quantity-notification.js +2 -0
- package/dist/cjs/notifications/entities/product/product-notification.js +13 -3
- package/dist/cjs/notifications/entities/report/report-filters-notification.js +4 -2
- package/dist/cjs/notifications/entities/report/report-notification.js +10 -4
- package/dist/cjs/notifications/entities/shared/adjustment-original-amount-notification.js +2 -0
- package/dist/cjs/notifications/entities/shared/billing-details-notification.js +5 -2
- package/dist/cjs/notifications/entities/shared/chargeback-fee-notification.js +2 -0
- package/dist/cjs/notifications/entities/shared/import-meta-notification.js +2 -0
- package/dist/cjs/notifications/entities/shared/index.js +2 -0
- package/dist/cjs/notifications/entities/shared/korean-market-underlying-details-notification.js +10 -0
- package/dist/cjs/notifications/entities/shared/money-notification.js +2 -0
- package/dist/cjs/notifications/entities/shared/payment-card-notification.js +5 -0
- package/dist/cjs/notifications/entities/shared/payment-method-details-notification.js +7 -0
- package/dist/cjs/notifications/entities/shared/payment-method-underlying-details-notification.js +13 -0
- package/dist/cjs/notifications/entities/shared/payout-totals-adjustment-notification.js +7 -0
- package/dist/cjs/notifications/entities/shared/tax-rates-used-notification.js +2 -0
- package/dist/cjs/notifications/entities/shared/time-period-notification.js +2 -0
- package/dist/cjs/notifications/entities/shared/total-adjustments-notification.js +6 -0
- package/dist/cjs/notifications/entities/shared/totals-notification.js +4 -0
- package/dist/cjs/notifications/entities/shared/transaction-checkout-notification.js +1 -0
- package/dist/cjs/notifications/entities/shared/transaction-payment-attempt-notification.js +10 -2
- package/dist/cjs/notifications/entities/shared/transaction-payout-totals-adjusted-notification.js +7 -0
- package/dist/cjs/notifications/entities/shared/transaction-payout-totals-notification.js +13 -0
- package/dist/cjs/notifications/entities/shared/transaction-totals-adjusted-notification.js +7 -0
- package/dist/cjs/notifications/entities/shared/transaction-totals-notification.js +11 -0
- package/dist/cjs/notifications/entities/shared/unit-price-override-notification.js +2 -0
- package/dist/cjs/notifications/entities/shared/unit-totals-notification.js +4 -0
- package/dist/cjs/notifications/entities/subscription/subscription-created-notification.js +23 -0
- package/dist/cjs/notifications/entities/subscription/subscription-discount-notification.js +4 -2
- package/dist/cjs/notifications/entities/subscription/subscription-item-notification.js +10 -0
- package/dist/cjs/notifications/entities/subscription/subscription-notification.js +22 -0
- package/dist/cjs/notifications/entities/subscription/subscription-price-notification.js +16 -3
- package/dist/cjs/notifications/entities/subscription/subscription-scheduled-change-notification.js +3 -0
- package/dist/cjs/notifications/entities/subscription/subscription-time-period-notification.js +2 -0
- package/dist/cjs/notifications/entities/transaction/transaction-details-notification.js +6 -0
- package/dist/cjs/notifications/entities/transaction/transaction-item-notification.js +3 -0
- package/dist/cjs/notifications/entities/transaction/transaction-line-item-notification.js +8 -0
- package/dist/cjs/notifications/entities/transaction/transaction-notification.js +23 -0
- package/dist/cjs/notifications/entities/transaction/transaction-proration-notification.js +2 -0
- package/dist/cjs/notifications/entities/transaction/transactions-time-period-notification.js +2 -0
- package/dist/cjs/notifications/events/address/address-created-event.js +2 -1
- package/dist/cjs/notifications/events/address/address-imported-event.js +2 -1
- package/dist/cjs/notifications/events/address/address-updated-event.js +2 -1
- package/dist/cjs/notifications/events/adjustment/adjustment-created-event.js +2 -1
- package/dist/cjs/notifications/events/adjustment/adjustment-updated-event.js +2 -1
- package/dist/cjs/notifications/events/api-key/api-key-created-event.js +15 -0
- package/dist/cjs/notifications/events/api-key/api-key-expired-event.js +15 -0
- package/dist/cjs/notifications/events/api-key/api-key-expiring-event.js +15 -0
- package/dist/cjs/notifications/events/api-key/api-key-revoked-event.js +15 -0
- package/dist/cjs/notifications/events/api-key/api-key-updated-event.js +15 -0
- package/dist/cjs/notifications/events/api-key/index.js +21 -0
- package/dist/cjs/notifications/events/business/business-created-event.js +2 -1
- package/dist/cjs/notifications/events/business/business-imported-event.js +2 -1
- package/dist/cjs/notifications/events/business/business-updated-event.js +2 -1
- package/dist/cjs/notifications/events/customer/customer-created-event.js +2 -1
- package/dist/cjs/notifications/events/customer/customer-imported-event.js +2 -1
- package/dist/cjs/notifications/events/customer/customer-updated-event.js +2 -1
- package/dist/cjs/notifications/events/discount/discount-created-event.js +2 -1
- package/dist/cjs/notifications/events/discount/discount-imported-event.js +2 -1
- package/dist/cjs/notifications/events/discount/discount-updated-event.js +2 -1
- package/dist/cjs/notifications/events/discount-group/discount-group-created-event.js +15 -0
- package/dist/cjs/notifications/events/discount-group/index.js +17 -0
- package/dist/cjs/notifications/events/generic/generic-event.js +1 -0
- package/dist/cjs/notifications/events/index.js +2 -0
- package/dist/cjs/notifications/events/payment-method/payment-method-deleted-event.js +2 -1
- package/dist/cjs/notifications/events/payment-method/payment-method-saved-event.js +2 -1
- package/dist/cjs/notifications/events/payout/payout-created-event.js +2 -1
- package/dist/cjs/notifications/events/payout/payout-paid-event.js +2 -1
- package/dist/cjs/notifications/events/price/price-created-event.js +2 -1
- package/dist/cjs/notifications/events/price/price-imported-event.js +2 -1
- package/dist/cjs/notifications/events/price/price-updated-event.js +2 -1
- package/dist/cjs/notifications/events/product/product-created-event.js +2 -1
- package/dist/cjs/notifications/events/product/product-imported-event.js +2 -1
- package/dist/cjs/notifications/events/product/product-updated-event.js +2 -1
- package/dist/cjs/notifications/events/report/report-created-event.js +2 -1
- package/dist/cjs/notifications/events/report/report-updated-event.js +2 -1
- package/dist/cjs/notifications/events/subscription/subscription-activated-event.js +2 -1
- package/dist/cjs/notifications/events/subscription/subscription-canceled-event.js +2 -1
- package/dist/cjs/notifications/events/subscription/subscription-created-event.js +2 -1
- package/dist/cjs/notifications/events/subscription/subscription-imported-event.js +2 -1
- package/dist/cjs/notifications/events/subscription/subscription-past-due-event.js +2 -1
- package/dist/cjs/notifications/events/subscription/subscription-paused-event.js +2 -1
- package/dist/cjs/notifications/events/subscription/subscription-resumed-event.js +2 -1
- package/dist/cjs/notifications/events/subscription/subscription-trialing-event.js +2 -1
- package/dist/cjs/notifications/events/subscription/subscription-updated-event.js +2 -1
- package/dist/cjs/notifications/events/transaction/transaction-billed-event.js +2 -1
- package/dist/cjs/notifications/events/transaction/transaction-canceled-event.js +2 -1
- package/dist/cjs/notifications/events/transaction/transaction-completed-event.js +2 -1
- package/dist/cjs/notifications/events/transaction/transaction-created-event.js +2 -1
- package/dist/cjs/notifications/events/transaction/transaction-paid-event.js +2 -1
- package/dist/cjs/notifications/events/transaction/transaction-past-due-event.js +2 -1
- package/dist/cjs/notifications/events/transaction/transaction-payment-failed-event.js +2 -1
- package/dist/cjs/notifications/events/transaction/transaction-ready-event.js +2 -1
- package/dist/cjs/notifications/events/transaction/transaction-revised-event.js +2 -1
- package/dist/cjs/notifications/events/transaction/transaction-updated-event.js +2 -1
- package/dist/cjs/notifications/helpers/types.js +6 -0
- package/dist/cjs/notifications/helpers/webhooks-validator.js +14 -26
- package/dist/cjs/notifications/helpers/webhooks.js +23 -24
- package/dist/cjs/notifications/types/api-key/api-key-notification-response.js +2 -0
- package/dist/cjs/notifications/types/api-key/index.js +17 -0
- package/dist/cjs/notifications/types/discount-group/discount-group-notification-response.js +2 -0
- package/dist/cjs/notifications/types/discount-group/index.js +17 -0
- package/dist/cjs/notifications/types/index.js +2 -0
- package/dist/cjs/notifications/types/shared/index.js +2 -0
- package/dist/cjs/notifications/types/shared/korean-market-underlying-details-notification.js +2 -0
- package/dist/cjs/notifications/types/shared/payment-method-underlying-details-notification.js +2 -0
- package/dist/cjs/paddle.js +30 -5
- package/dist/cjs/resources/addresses/index.js +25 -42
- package/dist/cjs/resources/adjustments/index.js +12 -25
- package/dist/cjs/resources/businesses/index.js +25 -42
- package/dist/cjs/resources/customer-portal-sessions/index.js +8 -19
- package/dist/cjs/resources/customers/index.js +35 -56
- package/dist/cjs/resources/discount-groups/index.js +36 -0
- package/dist/cjs/resources/discount-groups/operations/create-discount-group-request-body.js +2 -0
- package/dist/cjs/resources/discount-groups/operations/index.js +18 -0
- package/dist/cjs/resources/discount-groups/operations/list-discount-group-query-parameters.js +2 -0
- package/dist/cjs/resources/discounts/index.js +20 -37
- package/dist/cjs/resources/event-types/index.js +4 -15
- package/dist/cjs/resources/index.js +1 -0
- package/dist/cjs/resources/notification-settings/index.js +31 -50
- package/dist/cjs/resources/notifications/index.js +14 -27
- package/dist/cjs/resources/payment-methods/index.js +17 -30
- package/dist/cjs/resources/prices/index.js +21 -38
- package/dist/cjs/resources/pricing-preview/index.js +4 -15
- package/dist/cjs/resources/products/index.js +21 -38
- package/dist/cjs/resources/reports/index.js +18 -33
- package/dist/cjs/resources/simulation-run-events/index.js +18 -31
- package/dist/cjs/resources/simulation-runs/index.js +16 -29
- package/dist/cjs/resources/simulation-types/index.js +4 -15
- package/dist/cjs/resources/simulations/index.js +18 -33
- package/dist/cjs/resources/subscriptions/index.js +71 -100
- package/dist/cjs/resources/transactions/index.js +40 -61
- package/dist/cjs/types/discount-group/discount-group-response.js +2 -0
- package/dist/cjs/types/discount-group/index.js +17 -0
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/shared/index.js +2 -0
- package/dist/cjs/types/shared/korean-market-underlying-details.js +2 -0
- package/dist/cjs/types/shared/payment-method-underlying-details.js +2 -0
- package/dist/cjs/version.js +1 -1
- package/dist/esm/entities/address/address.js +14 -0
- package/dist/esm/entities/adjustment/adjustment-credit-note-pdf.js +1 -0
- package/dist/esm/entities/adjustment/adjustment-item-totals.js +3 -0
- package/dist/esm/entities/adjustment/adjustment-item.js +6 -0
- package/dist/esm/entities/adjustment/adjustment-proration.js +2 -0
- package/dist/esm/entities/adjustment/adjustment-time-period.js +2 -0
- package/dist/esm/entities/adjustment/adjustment.js +15 -0
- package/dist/esm/entities/business/business.js +11 -0
- package/dist/esm/entities/business/contacts.js +2 -0
- package/dist/esm/entities/customer/auth-token.js +2 -0
- package/dist/esm/entities/customer/credit-balance.js +3 -0
- package/dist/esm/entities/customer/customer-balance.js +3 -0
- package/dist/esm/entities/customer/customer.js +10 -0
- package/dist/esm/entities/customer-portal-session/customer-portal-session.js +4 -0
- package/dist/esm/entities/customer-portal-session/customer-portal-subscription-url.js +3 -0
- package/dist/esm/entities/customer-portal-session/general.js +1 -0
- package/dist/esm/entities/customer-portal-session/urls.js +3 -2
- package/dist/esm/entities/discount/discount.js +21 -2
- package/dist/esm/entities/discount-group/discount-group-collection.js +7 -0
- package/dist/esm/entities/discount-group/discount-group.js +17 -0
- package/dist/esm/entities/discount-group/index.js +2 -0
- package/dist/esm/entities/event-types/event-type.js +4 -0
- package/dist/esm/entities/events/event.js +6 -2
- package/dist/esm/entities/index.js +1 -0
- package/dist/esm/entities/notification-settings/notification-settings.js +10 -0
- package/dist/esm/entities/notifications/notification-log.js +6 -2
- package/dist/esm/entities/notifications/notification.js +16 -5
- package/dist/esm/entities/notifications/replay-notification.js +1 -0
- package/dist/esm/entities/payment-method/payment-method.js +14 -1
- package/dist/esm/entities/payout/payout.js +4 -0
- package/dist/esm/entities/price/price-quantity.js +2 -0
- package/dist/esm/entities/price/price.js +18 -2
- package/dist/esm/entities/pricing-preview/pricing-preview-details.js +1 -0
- package/dist/esm/entities/pricing-preview/pricing-preview-discounts.js +3 -0
- package/dist/esm/entities/pricing-preview/pricing-preview-line-item.js +9 -0
- package/dist/esm/entities/pricing-preview/pricing-preview.js +15 -7
- package/dist/esm/entities/product/product.js +13 -2
- package/dist/esm/entities/report/report-csv.js +1 -0
- package/dist/esm/entities/report/report-filters.js +4 -2
- package/dist/esm/entities/report/report.js +10 -4
- package/dist/esm/entities/shared/adjustment-original-amount.js +2 -0
- package/dist/esm/entities/shared/billing-details.js +5 -2
- package/dist/esm/entities/shared/chargeback-fee.js +2 -0
- package/dist/esm/entities/shared/import-meta.js +2 -0
- package/dist/esm/entities/shared/index.js +2 -0
- package/dist/esm/entities/shared/korean-market-underlying-details.js +6 -0
- package/dist/esm/entities/shared/money.js +2 -0
- package/dist/esm/entities/shared/payment-card.js +5 -0
- package/dist/esm/entities/shared/payment-method-details.js +7 -0
- package/dist/esm/entities/shared/payment-method-underlying-details.js +9 -0
- package/dist/esm/entities/shared/payout-totals-adjustment.js +7 -0
- package/dist/esm/entities/shared/paypal.js +2 -0
- package/dist/esm/entities/shared/simulation-event-request.js +1 -0
- package/dist/esm/entities/shared/simulation-event-response.js +2 -0
- package/dist/esm/entities/shared/tax-rates-used.js +2 -0
- package/dist/esm/entities/shared/time-period.js +2 -0
- package/dist/esm/entities/shared/total-adjustments.js +6 -0
- package/dist/esm/entities/shared/totals.js +4 -0
- package/dist/esm/entities/shared/transaction-checkout.js +1 -0
- package/dist/esm/entities/shared/transaction-payment-attempt.js +10 -2
- package/dist/esm/entities/shared/transaction-payout-totals-adjusted.js +7 -0
- package/dist/esm/entities/shared/transaction-payout-totals.js +11 -0
- package/dist/esm/entities/shared/transaction-totals-adjusted.js +7 -0
- package/dist/esm/entities/shared/transaction-totals.js +11 -0
- package/dist/esm/entities/shared/unit-price-override.js +2 -0
- package/dist/esm/entities/shared/unit-totals.js +4 -0
- package/dist/esm/entities/simulation/simulation-scenario-config/simulation-scenario-config.js +5 -0
- package/dist/esm/entities/simulation/simulation-scenario-config/subscription-cancellation-details.js +2 -0
- package/dist/esm/entities/simulation/simulation-scenario-config/subscription-cancellation-entities.js +2 -2
- package/dist/esm/entities/simulation/simulation-scenario-config/subscription-cancellation-options.js +4 -3
- package/dist/esm/entities/simulation/simulation-scenario-config/subscription-creation-details.js +2 -0
- package/dist/esm/entities/simulation/simulation-scenario-config/subscription-creation-entities.js +14 -8
- package/dist/esm/entities/simulation/simulation-scenario-config/subscription-creation-item.js +2 -0
- package/dist/esm/entities/simulation/simulation-scenario-config/subscription-creation-options.js +6 -4
- package/dist/esm/entities/simulation/simulation-scenario-config/subscription-pause-details.js +2 -0
- package/dist/esm/entities/simulation/simulation-scenario-config/subscription-pause-entities.js +2 -2
- package/dist/esm/entities/simulation/simulation-scenario-config/subscription-pause-options.js +4 -3
- package/dist/esm/entities/simulation/simulation-scenario-config/subscription-renewal-details.js +2 -0
- package/dist/esm/entities/simulation/simulation-scenario-config/subscription-renewal-entities.js +2 -2
- package/dist/esm/entities/simulation/simulation-scenario-config/subscription-renewal-options.js +4 -3
- package/dist/esm/entities/simulation/simulation-scenario-config/subscription-resume-details.js +2 -0
- package/dist/esm/entities/simulation/simulation-scenario-config/subscription-resume-entities.js +2 -2
- package/dist/esm/entities/simulation/simulation-scenario-config/subscription-resume-options.js +4 -3
- package/dist/esm/entities/simulation/simulation.js +12 -3
- package/dist/esm/entities/simulation-run/simulation-run.js +7 -2
- package/dist/esm/entities/simulation-run-event/simulation-run-event.js +8 -0
- package/dist/esm/entities/simulation-types/simulation-type.js +6 -0
- package/dist/esm/entities/subscription/next-transaction-adjustment-item.js +5 -0
- package/dist/esm/entities/subscription/next-transaction-adjustment-preview.js +3 -0
- package/dist/esm/entities/subscription/next-transaction.js +3 -0
- package/dist/esm/entities/subscription/subscription-discount.js +5 -3
- package/dist/esm/entities/subscription/subscription-item.js +10 -0
- package/dist/esm/entities/subscription/subscription-management.js +2 -0
- package/dist/esm/entities/subscription/subscription-preview-summary-result.js +3 -0
- package/dist/esm/entities/subscription/subscription-preview-update-summary.js +3 -0
- package/dist/esm/entities/subscription/subscription-preview.js +26 -0
- package/dist/esm/entities/subscription/subscription-scheduled-change.js +3 -0
- package/dist/esm/entities/subscription/subscription-time-period.js +2 -0
- package/dist/esm/entities/subscription/subscription.js +25 -0
- package/dist/esm/entities/subscription/transaction-details-preview.js +3 -0
- package/dist/esm/entities/subscription/transaction-line-item-preview.js +7 -0
- package/dist/esm/entities/transaction/address-preview.js +2 -0
- package/dist/esm/entities/transaction/adjustment-totals-breakdown.js +3 -0
- package/dist/esm/entities/transaction/adjustment-totals.js +7 -0
- package/dist/esm/entities/transaction/proration.js +2 -0
- package/dist/esm/entities/transaction/transaction-adjustment-item.js +6 -0
- package/dist/esm/entities/transaction/transaction-adjustment.js +14 -0
- package/dist/esm/entities/transaction/transaction-details.js +6 -0
- package/dist/esm/entities/transaction/transaction-invoice-pdf.js +1 -0
- package/dist/esm/entities/transaction/transaction-item-preview.js +5 -2
- package/dist/esm/entities/transaction/transaction-item.js +3 -0
- package/dist/esm/entities/transaction/transaction-line-item.js +8 -0
- package/dist/esm/entities/transaction/transaction-preview.js +12 -2
- package/dist/esm/entities/transaction/transaction-proration.js +2 -0
- package/dist/esm/entities/transaction/transaction.js +31 -2
- package/dist/esm/entities/transaction/transactions-time-period.js +2 -0
- package/dist/esm/enums/api-key/api-key-permission.js +1 -0
- package/dist/esm/enums/api-key/api-key-status.js +1 -0
- package/dist/esm/enums/api-key/index.js +2 -0
- package/dist/esm/enums/discount/discount-mode.js +1 -0
- package/dist/esm/enums/discount/index.js +1 -0
- package/dist/esm/enums/index.js +1 -0
- package/dist/esm/enums/shared/index.js +1 -0
- package/dist/esm/enums/shared/korean-market-underlying-payment-method-type.js +1 -0
- package/dist/esm/internal/api/case-helpers.js +2 -13
- package/dist/esm/internal/api/client.js +54 -64
- package/dist/esm/internal/base/base-resource.js +1 -0
- package/dist/esm/internal/base/collection.js +20 -45
- package/dist/esm/internal/base/logger.js +1 -0
- package/dist/esm/internal/base/path-parameters.js +2 -0
- package/dist/esm/internal/base/query-parameters.js +1 -0
- package/dist/esm/internal/errors/generic.js +5 -0
- package/dist/esm/internal/providers/crypto/crypto-provider.js +2 -13
- package/dist/esm/internal/providers/crypto/edge-crypto.js +14 -25
- package/dist/esm/internal/providers/crypto/node-crypto.js +5 -16
- package/dist/esm/internal/providers/runtime-provider.js +1 -0
- package/dist/esm/notifications/entities/address/address-notification.js +15 -2
- package/dist/esm/notifications/entities/adjustment/adjustment-item-notification.js +6 -0
- package/dist/esm/notifications/entities/adjustment/adjustment-item-totals-notification.js +3 -0
- package/dist/esm/notifications/entities/adjustment/adjustment-notification.js +15 -0
- package/dist/esm/notifications/entities/adjustment/adjustment-proration-notification.js +2 -0
- package/dist/esm/notifications/entities/adjustment/adjustment-time-period-notification.js +2 -0
- package/dist/esm/notifications/entities/api-key/api-key-notification.js +24 -0
- package/dist/esm/notifications/entities/api-key/index.js +1 -0
- package/dist/esm/notifications/entities/business/business-notification.js +12 -2
- package/dist/esm/notifications/entities/business/contacts-notification.js +2 -0
- package/dist/esm/notifications/entities/customer/customer-notification.js +10 -0
- package/dist/esm/notifications/entities/discount/discount-notification.js +21 -2
- package/dist/esm/notifications/entities/discount-group/discount-group-notification.js +19 -0
- package/dist/esm/notifications/entities/discount-group/index.js +1 -0
- package/dist/esm/notifications/entities/index.js +2 -0
- package/dist/esm/notifications/entities/payment-method/payment-method-deleted-notification.js +8 -0
- package/dist/esm/notifications/entities/payment-method/payment-method-notification.js +7 -0
- package/dist/esm/notifications/entities/payout/payout-notification.js +4 -0
- package/dist/esm/notifications/entities/price/price-notification.js +19 -4
- package/dist/esm/notifications/entities/price/price-quantity-notification.js +2 -0
- package/dist/esm/notifications/entities/product/product-notification.js +13 -3
- package/dist/esm/notifications/entities/report/report-filters-notification.js +4 -2
- package/dist/esm/notifications/entities/report/report-notification.js +10 -4
- package/dist/esm/notifications/entities/shared/adjustment-original-amount-notification.js +2 -0
- package/dist/esm/notifications/entities/shared/billing-details-notification.js +5 -2
- package/dist/esm/notifications/entities/shared/chargeback-fee-notification.js +2 -0
- package/dist/esm/notifications/entities/shared/import-meta-notification.js +2 -0
- package/dist/esm/notifications/entities/shared/index.js +2 -0
- package/dist/esm/notifications/entities/shared/korean-market-underlying-details-notification.js +6 -0
- package/dist/esm/notifications/entities/shared/money-notification.js +2 -0
- package/dist/esm/notifications/entities/shared/payment-card-notification.js +5 -0
- package/dist/esm/notifications/entities/shared/payment-method-details-notification.js +7 -0
- package/dist/esm/notifications/entities/shared/payment-method-underlying-details-notification.js +9 -0
- package/dist/esm/notifications/entities/shared/payout-totals-adjustment-notification.js +7 -0
- package/dist/esm/notifications/entities/shared/tax-rates-used-notification.js +2 -0
- package/dist/esm/notifications/entities/shared/time-period-notification.js +2 -0
- package/dist/esm/notifications/entities/shared/total-adjustments-notification.js +6 -0
- package/dist/esm/notifications/entities/shared/totals-notification.js +4 -0
- package/dist/esm/notifications/entities/shared/transaction-checkout-notification.js +1 -0
- package/dist/esm/notifications/entities/shared/transaction-payment-attempt-notification.js +10 -2
- package/dist/esm/notifications/entities/shared/transaction-payout-totals-adjusted-notification.js +7 -0
- package/dist/esm/notifications/entities/shared/transaction-payout-totals-notification.js +13 -0
- package/dist/esm/notifications/entities/shared/transaction-totals-adjusted-notification.js +7 -0
- package/dist/esm/notifications/entities/shared/transaction-totals-notification.js +11 -0
- package/dist/esm/notifications/entities/shared/unit-price-override-notification.js +2 -0
- package/dist/esm/notifications/entities/shared/unit-totals-notification.js +4 -0
- package/dist/esm/notifications/entities/subscription/subscription-created-notification.js +23 -0
- package/dist/esm/notifications/entities/subscription/subscription-discount-notification.js +4 -2
- package/dist/esm/notifications/entities/subscription/subscription-item-notification.js +10 -0
- package/dist/esm/notifications/entities/subscription/subscription-notification.js +22 -0
- package/dist/esm/notifications/entities/subscription/subscription-price-notification.js +16 -3
- package/dist/esm/notifications/entities/subscription/subscription-scheduled-change-notification.js +3 -0
- package/dist/esm/notifications/entities/subscription/subscription-time-period-notification.js +2 -0
- package/dist/esm/notifications/entities/transaction/transaction-details-notification.js +6 -0
- package/dist/esm/notifications/entities/transaction/transaction-item-notification.js +3 -0
- package/dist/esm/notifications/entities/transaction/transaction-line-item-notification.js +8 -0
- package/dist/esm/notifications/entities/transaction/transaction-notification.js +23 -0
- package/dist/esm/notifications/entities/transaction/transaction-proration-notification.js +2 -0
- package/dist/esm/notifications/entities/transaction/transactions-time-period-notification.js +2 -0
- package/dist/esm/notifications/events/address/address-created-event.js +2 -1
- package/dist/esm/notifications/events/address/address-imported-event.js +2 -1
- package/dist/esm/notifications/events/address/address-updated-event.js +2 -1
- package/dist/esm/notifications/events/adjustment/adjustment-created-event.js +2 -1
- package/dist/esm/notifications/events/adjustment/adjustment-updated-event.js +2 -1
- package/dist/esm/notifications/events/api-key/api-key-created-event.js +11 -0
- package/dist/esm/notifications/events/api-key/api-key-expired-event.js +11 -0
- package/dist/esm/notifications/events/api-key/api-key-expiring-event.js +11 -0
- package/dist/esm/notifications/events/api-key/api-key-revoked-event.js +11 -0
- package/dist/esm/notifications/events/api-key/api-key-updated-event.js +11 -0
- package/dist/esm/notifications/events/api-key/index.js +5 -0
- package/dist/esm/notifications/events/business/business-created-event.js +2 -1
- package/dist/esm/notifications/events/business/business-imported-event.js +2 -1
- package/dist/esm/notifications/events/business/business-updated-event.js +2 -1
- package/dist/esm/notifications/events/customer/customer-created-event.js +2 -1
- package/dist/esm/notifications/events/customer/customer-imported-event.js +2 -1
- package/dist/esm/notifications/events/customer/customer-updated-event.js +2 -1
- package/dist/esm/notifications/events/discount/discount-created-event.js +2 -1
- package/dist/esm/notifications/events/discount/discount-imported-event.js +2 -1
- package/dist/esm/notifications/events/discount/discount-updated-event.js +2 -1
- package/dist/esm/notifications/events/discount-group/discount-group-created-event.js +11 -0
- package/dist/esm/notifications/events/discount-group/index.js +1 -0
- package/dist/esm/notifications/events/generic/generic-event.js +1 -0
- package/dist/esm/notifications/events/index.js +2 -0
- package/dist/esm/notifications/events/payment-method/payment-method-deleted-event.js +2 -1
- package/dist/esm/notifications/events/payment-method/payment-method-saved-event.js +2 -1
- package/dist/esm/notifications/events/payout/payout-created-event.js +2 -1
- package/dist/esm/notifications/events/payout/payout-paid-event.js +2 -1
- package/dist/esm/notifications/events/price/price-created-event.js +2 -1
- package/dist/esm/notifications/events/price/price-imported-event.js +2 -1
- package/dist/esm/notifications/events/price/price-updated-event.js +2 -1
- package/dist/esm/notifications/events/product/product-created-event.js +2 -1
- package/dist/esm/notifications/events/product/product-imported-event.js +2 -1
- package/dist/esm/notifications/events/product/product-updated-event.js +2 -1
- package/dist/esm/notifications/events/report/report-created-event.js +2 -1
- package/dist/esm/notifications/events/report/report-updated-event.js +2 -1
- package/dist/esm/notifications/events/subscription/subscription-activated-event.js +2 -1
- package/dist/esm/notifications/events/subscription/subscription-canceled-event.js +2 -1
- package/dist/esm/notifications/events/subscription/subscription-created-event.js +2 -1
- package/dist/esm/notifications/events/subscription/subscription-imported-event.js +2 -1
- package/dist/esm/notifications/events/subscription/subscription-past-due-event.js +2 -1
- package/dist/esm/notifications/events/subscription/subscription-paused-event.js +2 -1
- package/dist/esm/notifications/events/subscription/subscription-resumed-event.js +2 -1
- package/dist/esm/notifications/events/subscription/subscription-trialing-event.js +2 -1
- package/dist/esm/notifications/events/subscription/subscription-updated-event.js +2 -1
- package/dist/esm/notifications/events/transaction/transaction-billed-event.js +2 -1
- package/dist/esm/notifications/events/transaction/transaction-canceled-event.js +2 -1
- package/dist/esm/notifications/events/transaction/transaction-completed-event.js +2 -1
- package/dist/esm/notifications/events/transaction/transaction-created-event.js +2 -1
- package/dist/esm/notifications/events/transaction/transaction-paid-event.js +2 -1
- package/dist/esm/notifications/events/transaction/transaction-past-due-event.js +2 -1
- package/dist/esm/notifications/events/transaction/transaction-payment-failed-event.js +2 -1
- package/dist/esm/notifications/events/transaction/transaction-ready-event.js +2 -1
- package/dist/esm/notifications/events/transaction/transaction-revised-event.js +2 -1
- package/dist/esm/notifications/events/transaction/transaction-updated-event.js +2 -1
- package/dist/esm/notifications/helpers/types.js +6 -0
- package/dist/esm/notifications/helpers/webhooks-validator.js +14 -26
- package/dist/esm/notifications/helpers/webhooks.js +24 -25
- package/dist/esm/notifications/types/api-key/api-key-notification-response.js +1 -0
- package/dist/esm/notifications/types/api-key/index.js +1 -0
- package/dist/esm/notifications/types/discount-group/discount-group-notification-response.js +1 -0
- package/dist/esm/notifications/types/discount-group/index.js +1 -0
- package/dist/esm/notifications/types/index.js +2 -0
- package/dist/esm/notifications/types/shared/index.js +2 -0
- package/dist/esm/notifications/types/shared/korean-market-underlying-details-notification.js +1 -0
- package/dist/esm/notifications/types/shared/payment-method-underlying-details-notification.js +1 -0
- package/dist/esm/paddle.js +31 -6
- package/dist/esm/resources/addresses/index.js +25 -42
- package/dist/esm/resources/adjustments/index.js +12 -25
- package/dist/esm/resources/businesses/index.js +25 -42
- package/dist/esm/resources/customer-portal-sessions/index.js +8 -19
- package/dist/esm/resources/customers/index.js +35 -56
- package/dist/esm/resources/discount-groups/index.js +18 -0
- package/dist/esm/resources/discount-groups/operations/create-discount-group-request-body.js +1 -0
- package/dist/esm/resources/discount-groups/operations/index.js +2 -0
- package/dist/esm/resources/discount-groups/operations/list-discount-group-query-parameters.js +1 -0
- package/dist/esm/resources/discounts/index.js +20 -37
- package/dist/esm/resources/event-types/index.js +4 -15
- package/dist/esm/resources/index.js +1 -0
- package/dist/esm/resources/notification-settings/index.js +31 -50
- package/dist/esm/resources/notifications/index.js +14 -27
- package/dist/esm/resources/payment-methods/index.js +17 -30
- package/dist/esm/resources/prices/index.js +21 -38
- package/dist/esm/resources/pricing-preview/index.js +4 -15
- package/dist/esm/resources/products/index.js +21 -38
- package/dist/esm/resources/reports/index.js +18 -33
- package/dist/esm/resources/simulation-run-events/index.js +18 -31
- package/dist/esm/resources/simulation-runs/index.js +16 -29
- package/dist/esm/resources/simulation-types/index.js +4 -15
- package/dist/esm/resources/simulations/index.js +18 -33
- package/dist/esm/resources/subscriptions/index.js +71 -100
- package/dist/esm/resources/transactions/index.js +40 -61
- package/dist/esm/types/discount-group/discount-group-response.js +1 -0
- package/dist/esm/types/discount-group/index.js +1 -0
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/shared/index.js +2 -0
- package/dist/esm/types/shared/korean-market-underlying-details.js +1 -0
- package/dist/esm/types/shared/payment-method-underlying-details.js +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/entities/discount/discount.d.ts +2 -1
- package/dist/types/entities/discount-group/discount-group-collection.d.ts +6 -0
- package/dist/types/entities/discount-group/discount-group.d.ts +12 -0
- package/dist/types/entities/discount-group/index.d.ts +2 -0
- package/dist/types/entities/index.d.ts +1 -0
- package/dist/types/entities/payment-method/payment-method.d.ts +2 -1
- package/dist/types/entities/shared/index.d.ts +2 -0
- package/dist/types/entities/shared/korean-market-underlying-details.d.ts +6 -0
- package/dist/types/entities/shared/payment-method-details.d.ts +2 -0
- package/dist/types/entities/shared/payment-method-underlying-details.d.ts +6 -0
- package/dist/types/enums/adjustment/adjustment-action.d.ts +1 -1
- package/dist/types/enums/api-key/api-key-permission.d.ts +1 -0
- package/dist/types/enums/api-key/api-key-status.d.ts +1 -0
- package/dist/types/enums/api-key/index.d.ts +2 -0
- package/dist/types/enums/discount/discount-mode.d.ts +1 -0
- package/dist/types/enums/discount/index.d.ts +1 -0
- package/dist/types/enums/index.d.ts +1 -0
- package/dist/types/enums/report/report-type.d.ts +1 -1
- package/dist/types/enums/shared/available-payment-methods.d.ts +1 -1
- package/dist/types/enums/shared/index.d.ts +1 -0
- package/dist/types/enums/shared/korean-market-underlying-payment-method-type.d.ts +1 -0
- package/dist/types/enums/shared/payment-type.d.ts +1 -1
- package/dist/types/notifications/entities/api-key/api-key-notification.d.ts +15 -0
- package/dist/types/notifications/entities/api-key/index.d.ts +1 -0
- package/dist/types/notifications/entities/discount/discount-notification.d.ts +2 -1
- package/dist/types/notifications/entities/discount-group/discount-group-notification.d.ts +12 -0
- package/dist/types/notifications/entities/discount-group/index.d.ts +1 -0
- package/dist/types/notifications/entities/index.d.ts +2 -0
- package/dist/types/notifications/entities/payment-method/payment-method-deleted-notification.d.ts +1 -1
- package/dist/types/notifications/entities/shared/index.d.ts +2 -0
- package/dist/types/notifications/entities/shared/korean-market-underlying-details-notification.d.ts +6 -0
- package/dist/types/notifications/entities/shared/payment-method-details-notification.d.ts +2 -0
- package/dist/types/notifications/entities/shared/payment-method-underlying-details-notification.d.ts +6 -0
- package/dist/types/notifications/events/api-key/api-key-created-event.d.ts +10 -0
- package/dist/types/notifications/events/api-key/api-key-expired-event.d.ts +10 -0
- package/dist/types/notifications/events/api-key/api-key-expiring-event.d.ts +10 -0
- package/dist/types/notifications/events/api-key/api-key-revoked-event.d.ts +10 -0
- package/dist/types/notifications/events/api-key/api-key-updated-event.d.ts +10 -0
- package/dist/types/notifications/events/api-key/index.d.ts +5 -0
- package/dist/types/notifications/events/discount-group/discount-group-created-event.d.ts +10 -0
- package/dist/types/notifications/events/discount-group/index.d.ts +1 -0
- package/dist/types/notifications/events/index.d.ts +2 -0
- package/dist/types/notifications/helpers/types.d.ts +9 -3
- package/dist/types/notifications/types/api-key/api-key-notification-response.d.ts +13 -0
- package/dist/types/notifications/types/api-key/index.d.ts +1 -0
- package/dist/types/notifications/types/discount/discount-notification-response.d.ts +2 -1
- package/dist/types/notifications/types/discount-group/discount-group-notification-response.d.ts +10 -0
- package/dist/types/notifications/types/discount-group/index.d.ts +1 -0
- package/dist/types/notifications/types/index.d.ts +2 -0
- package/dist/types/notifications/types/shared/index.d.ts +2 -0
- package/dist/types/notifications/types/shared/korean-market-underlying-details-notification.d.ts +4 -0
- package/dist/types/notifications/types/shared/payment-method-details.d.ts +3 -1
- package/dist/types/notifications/types/shared/payment-method-underlying-details-notification.d.ts +4 -0
- package/dist/types/paddle.d.ts +2 -1
- package/dist/types/resources/discount-groups/index.d.ts +8 -0
- package/dist/types/resources/discount-groups/operations/create-discount-group-request-body.d.ts +3 -0
- package/dist/types/resources/discount-groups/operations/index.d.ts +2 -0
- package/dist/types/resources/discount-groups/operations/list-discount-group-query-parameters.d.ts +6 -0
- package/dist/types/resources/discounts/operations/create-discount-request-body.d.ts +2 -1
- package/dist/types/resources/discounts/operations/list-discount-query-parameters.d.ts +2 -1
- package/dist/types/resources/discounts/operations/update-discount-request-body.d.ts +2 -1
- package/dist/types/resources/index.d.ts +1 -0
- package/dist/types/types/discount/discount-response.d.ts +2 -1
- package/dist/types/types/discount-group/discount-group-response.d.ts +10 -0
- package/dist/types/types/discount-group/index.d.ts +1 -0
- package/dist/types/types/events/events-response.d.ts +20 -2
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/payment-method/payment-method.d.ts +4 -2
- package/dist/types/types/shared/index.d.ts +2 -0
- package/dist/types/types/shared/korean-market-underlying-details.d.ts +4 -0
- package/dist/types/types/shared/payment-method-details.d.ts +3 -1
- package/dist/types/types/shared/payment-method-underlying-details.d.ts +4 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +8 -8
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class ProductImportedEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.ProductImported;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.ProductImported;
|
|
11
12
|
this.data = new index_js_2.ProductNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class ProductUpdatedEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.ProductUpdated;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.ProductUpdated;
|
|
11
12
|
this.data = new index_js_2.ProductNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class ReportCreatedEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.ReportCreated;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.ReportCreated;
|
|
11
12
|
this.data = new index_js_2.ReportNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class ReportUpdatedEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.ReportUpdated;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.ReportUpdated;
|
|
11
12
|
this.data = new index_js_2.ReportNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class SubscriptionActivatedEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.SubscriptionActivated;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.SubscriptionActivated;
|
|
11
12
|
this.data = new index_js_2.SubscriptionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class SubscriptionCanceledEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.SubscriptionCanceled;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.SubscriptionCanceled;
|
|
11
12
|
this.data = new index_js_2.SubscriptionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class SubscriptionCreatedEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.SubscriptionCreated;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.SubscriptionCreated;
|
|
11
12
|
this.data = new index_js_2.SubscriptionCreatedNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class SubscriptionImportedEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.SubscriptionImported;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.SubscriptionImported;
|
|
11
12
|
this.data = new index_js_2.SubscriptionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class SubscriptionPastDueEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.SubscriptionPastDue;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.SubscriptionPastDue;
|
|
11
12
|
this.data = new index_js_2.SubscriptionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class SubscriptionPausedEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.SubscriptionPaused;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.SubscriptionPaused;
|
|
11
12
|
this.data = new index_js_2.SubscriptionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class SubscriptionResumedEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.SubscriptionResumed;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.SubscriptionResumed;
|
|
11
12
|
this.data = new index_js_2.SubscriptionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class SubscriptionTrialingEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.SubscriptionTrialing;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.SubscriptionTrialing;
|
|
11
12
|
this.data = new index_js_2.SubscriptionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class SubscriptionUpdatedEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.SubscriptionUpdated;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.SubscriptionUpdated;
|
|
11
12
|
this.data = new index_js_2.SubscriptionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class TransactionBilledEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.TransactionBilled;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.TransactionBilled;
|
|
11
12
|
this.data = new index_js_2.TransactionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class TransactionCanceledEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.TransactionCanceled;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.TransactionCanceled;
|
|
11
12
|
this.data = new index_js_2.TransactionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class TransactionCompletedEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.TransactionCompleted;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.TransactionCompleted;
|
|
11
12
|
this.data = new index_js_2.TransactionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class TransactionCreatedEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.TransactionCreated;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.TransactionCreated;
|
|
11
12
|
this.data = new index_js_2.TransactionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class TransactionPaidEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.TransactionPaid;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.TransactionPaid;
|
|
11
12
|
this.data = new index_js_2.TransactionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class TransactionPastDueEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.TransactionPastDue;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.TransactionPastDue;
|
|
11
12
|
this.data = new index_js_2.TransactionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class TransactionPaymentFailedEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.TransactionPaymentFailed;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.TransactionPaymentFailed;
|
|
11
12
|
this.data = new index_js_2.TransactionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class TransactionReadyEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.TransactionReady;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.TransactionReady;
|
|
11
12
|
this.data = new index_js_2.TransactionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class TransactionRevisedEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.TransactionRevised;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.TransactionRevised;
|
|
11
12
|
this.data = new index_js_2.TransactionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,9 +5,10 @@ const event_js_1 = require("../../../entities/events/event.js");
|
|
|
5
5
|
const index_js_1 = require("../../helpers/index.js");
|
|
6
6
|
const index_js_2 = require("../../entities/index.js");
|
|
7
7
|
class TransactionUpdatedEvent extends event_js_1.Event {
|
|
8
|
+
eventType = index_js_1.EventName.TransactionUpdated;
|
|
9
|
+
data;
|
|
8
10
|
constructor(response) {
|
|
9
11
|
super(response);
|
|
10
|
-
this.eventType = index_js_1.EventName.TransactionUpdated;
|
|
11
12
|
this.data = new index_js_2.TransactionNotification(response.data);
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -8,6 +8,11 @@ var EventName;
|
|
|
8
8
|
EventName["AddressImported"] = "address.imported";
|
|
9
9
|
EventName["AdjustmentCreated"] = "adjustment.created";
|
|
10
10
|
EventName["AdjustmentUpdated"] = "adjustment.updated";
|
|
11
|
+
EventName["ApiKeyCreated"] = "api_key.created";
|
|
12
|
+
EventName["ApiKeyUpdated"] = "api_key.updated";
|
|
13
|
+
EventName["ApiKeyExpiring"] = "api_key.expiring";
|
|
14
|
+
EventName["ApiKeyExpired"] = "api_key.expired";
|
|
15
|
+
EventName["ApiKeyRevoked"] = "api_key.revoked";
|
|
11
16
|
EventName["BusinessCreated"] = "business.created";
|
|
12
17
|
EventName["BusinessImported"] = "business.imported";
|
|
13
18
|
EventName["BusinessUpdated"] = "business.updated";
|
|
@@ -17,6 +22,7 @@ var EventName;
|
|
|
17
22
|
EventName["DiscountCreated"] = "discount.created";
|
|
18
23
|
EventName["DiscountUpdated"] = "discount.updated";
|
|
19
24
|
EventName["DiscountImported"] = "discount.imported";
|
|
25
|
+
EventName["DiscountGroupCreated"] = "discount_group.created";
|
|
20
26
|
EventName["PaymentMethodDeleted"] = "payment_method.deleted";
|
|
21
27
|
EventName["PaymentMethodSaved"] = "payment_method.saved";
|
|
22
28
|
EventName["PayoutCreated"] = "payout.created";
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.WebhooksValidator = void 0;
|
|
13
4
|
const runtime_provider_js_1 = require("../../internal/providers/runtime-provider.js");
|
|
14
5
|
const logger_js_1 = require("../../internal/base/logger.js");
|
|
15
6
|
class WebhooksValidator {
|
|
7
|
+
static MAX_VALID_TIME_DIFFERENCE = 5;
|
|
16
8
|
extractHeader(header) {
|
|
17
9
|
const parts = header.split(';');
|
|
18
10
|
let ts = '';
|
|
@@ -35,23 +27,19 @@ class WebhooksValidator {
|
|
|
35
27
|
throw new Error('[Paddle] Invalid webhook signature');
|
|
36
28
|
}
|
|
37
29
|
}
|
|
38
|
-
isValidSignature(requestBody, secretKey, signature) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const computedHash = yield cryptoProvider.computeHmac(payloadWithTime, secretKey);
|
|
52
|
-
return computedHash === headers.h1;
|
|
53
|
-
});
|
|
30
|
+
async isValidSignature(requestBody, secretKey, signature) {
|
|
31
|
+
const cryptoProvider = runtime_provider_js_1.RuntimeProvider.getProvider()?.crypto;
|
|
32
|
+
if (!cryptoProvider) {
|
|
33
|
+
logger_js_1.Logger.error('Unknown runtime. Cannot validate webhook signature');
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
const headers = this.extractHeader(signature);
|
|
37
|
+
const payloadWithTime = `${headers.ts}:${requestBody}`;
|
|
38
|
+
if (new Date().getTime() > new Date((headers.ts + WebhooksValidator.MAX_VALID_TIME_DIFFERENCE) * 1000).getTime()) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
const computedHash = await cryptoProvider.computeHmac(payloadWithTime, secretKey);
|
|
42
|
+
return computedHash === headers.h1;
|
|
54
43
|
}
|
|
55
44
|
}
|
|
56
45
|
exports.WebhooksValidator = WebhooksValidator;
|
|
57
|
-
WebhooksValidator.MAX_VALID_TIME_DIFFERENCE = 5;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.Webhooks = void 0;
|
|
13
4
|
const webhooks_validator_js_1 = require("./webhooks-validator.js");
|
|
@@ -15,22 +6,18 @@ const types_js_1 = require("./types.js");
|
|
|
15
6
|
const index_js_1 = require("../events/index.js");
|
|
16
7
|
const logger_js_1 = require("../../internal/base/logger.js");
|
|
17
8
|
class Webhooks {
|
|
18
|
-
unmarshal(requestBody, secretKey, signature) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
});
|
|
9
|
+
async unmarshal(requestBody, secretKey, signature) {
|
|
10
|
+
const isSignatureValid = await new webhooks_validator_js_1.WebhooksValidator().isValidSignature(requestBody, secretKey, signature);
|
|
11
|
+
if (isSignatureValid) {
|
|
12
|
+
const parsedRequest = JSON.parse(requestBody);
|
|
13
|
+
return Webhooks.fromJson(parsedRequest);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
throw new Error('[Paddle] Webhook signature verification failed');
|
|
17
|
+
}
|
|
29
18
|
}
|
|
30
|
-
isSignatureValid(requestBody, secretKey, signature) {
|
|
31
|
-
return
|
|
32
|
-
return yield new webhooks_validator_js_1.WebhooksValidator().isValidSignature(requestBody, secretKey, signature);
|
|
33
|
-
});
|
|
19
|
+
async isSignatureValid(requestBody, secretKey, signature) {
|
|
20
|
+
return await new webhooks_validator_js_1.WebhooksValidator().isValidSignature(requestBody, secretKey, signature);
|
|
34
21
|
}
|
|
35
22
|
static fromJson(data) {
|
|
36
23
|
switch (data.event_type) {
|
|
@@ -44,6 +31,16 @@ class Webhooks {
|
|
|
44
31
|
return new index_js_1.AdjustmentCreatedEvent(data);
|
|
45
32
|
case types_js_1.EventName.AdjustmentUpdated:
|
|
46
33
|
return new index_js_1.AdjustmentUpdatedEvent(data);
|
|
34
|
+
case types_js_1.EventName.ApiKeyCreated:
|
|
35
|
+
return new index_js_1.ApiKeyCreatedEvent(data);
|
|
36
|
+
case types_js_1.EventName.ApiKeyExpired:
|
|
37
|
+
return new index_js_1.ApiKeyExpiredEvent(data);
|
|
38
|
+
case types_js_1.EventName.ApiKeyExpiring:
|
|
39
|
+
return new index_js_1.ApiKeyExpiringEvent(data);
|
|
40
|
+
case types_js_1.EventName.ApiKeyRevoked:
|
|
41
|
+
return new index_js_1.ApiKeyRevokedEvent(data);
|
|
42
|
+
case types_js_1.EventName.ApiKeyUpdated:
|
|
43
|
+
return new index_js_1.ApiKeyUpdatedEvent(data);
|
|
47
44
|
case types_js_1.EventName.BusinessCreated:
|
|
48
45
|
return new index_js_1.BusinessCreatedEvent(data);
|
|
49
46
|
case types_js_1.EventName.BusinessUpdated:
|
|
@@ -62,6 +59,8 @@ class Webhooks {
|
|
|
62
59
|
return new index_js_1.DiscountImportedEvent(data);
|
|
63
60
|
case types_js_1.EventName.DiscountUpdated:
|
|
64
61
|
return new index_js_1.DiscountUpdatedEvent(data);
|
|
62
|
+
case types_js_1.EventName.DiscountGroupCreated:
|
|
63
|
+
return new index_js_1.DiscountGroupCreatedEvent(data);
|
|
65
64
|
case types_js_1.EventName.PaymentMethodDeleted:
|
|
66
65
|
return new index_js_1.PaymentMethodDeletedEvent(data);
|
|
67
66
|
case types_js_1.EventName.PaymentMethodSaved:
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./api-key-notification-response.js"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./discount-group-notification-response.js"), exports);
|
|
@@ -23,7 +23,9 @@ __exportStar(require("./business/index.js"), exports);
|
|
|
23
23
|
__exportStar(require("./subscription/index.js"), exports);
|
|
24
24
|
__exportStar(require("./address/index.js"), exports);
|
|
25
25
|
__exportStar(require("./discount/index.js"), exports);
|
|
26
|
+
__exportStar(require("./discount-group/index.js"), exports);
|
|
26
27
|
__exportStar(require("./payment-method/index.js"), exports);
|
|
27
28
|
__exportStar(require("./payout/index.js"), exports);
|
|
28
29
|
__exportStar(require("./report/index.js"), exports);
|
|
29
30
|
__exportStar(require("./shared/index.js"), exports);
|
|
31
|
+
__exportStar(require("./api-key/index.js"), exports);
|
|
@@ -36,3 +36,5 @@ __exportStar(require("./transaction-checkout-notification.js"), exports);
|
|
|
36
36
|
__exportStar(require("./total-adjustments-notification-response.js"), exports);
|
|
37
37
|
__exportStar(require("./payout-totals-adjustment-notification-response.js"), exports);
|
|
38
38
|
__exportStar(require("./import-meta-notification-response.js"), exports);
|
|
39
|
+
__exportStar(require("./korean-market-underlying-details-notification.js"), exports);
|
|
40
|
+
__exportStar(require("./payment-method-underlying-details-notification.js"), exports);
|
package/dist/cjs/paddle.js
CHANGED
|
@@ -7,12 +7,36 @@ const index_js_2 = require("./resources/index.js");
|
|
|
7
7
|
const index_js_3 = require("./resources/events/index.js");
|
|
8
8
|
const index_js_4 = require("./notifications/index.js");
|
|
9
9
|
class Paddle {
|
|
10
|
+
client;
|
|
11
|
+
defaultPaddleOptions = {
|
|
12
|
+
environment: index_js_1.Environment.production,
|
|
13
|
+
logLevel: index_js_1.LogLevel.error,
|
|
14
|
+
};
|
|
15
|
+
products;
|
|
16
|
+
prices;
|
|
17
|
+
transactions;
|
|
18
|
+
adjustments;
|
|
19
|
+
customers;
|
|
20
|
+
customerPortalSessions;
|
|
21
|
+
addresses;
|
|
22
|
+
businesses;
|
|
23
|
+
discounts;
|
|
24
|
+
discountGroups;
|
|
25
|
+
subscriptions;
|
|
26
|
+
paymentMethods;
|
|
27
|
+
pricingPreview;
|
|
28
|
+
events;
|
|
29
|
+
webhooks;
|
|
30
|
+
eventTypes;
|
|
31
|
+
notificationSettings;
|
|
32
|
+
notifications;
|
|
33
|
+
reports;
|
|
34
|
+
simulationTypes;
|
|
35
|
+
simulations;
|
|
36
|
+
simulationRuns;
|
|
37
|
+
simulationRunEvents;
|
|
10
38
|
constructor(apiKey, options) {
|
|
11
|
-
this.
|
|
12
|
-
environment: index_js_1.Environment.production,
|
|
13
|
-
logLevel: index_js_1.LogLevel.verbose,
|
|
14
|
-
};
|
|
15
|
-
this.client = new client_js_1.Client(apiKey, options ? Object.assign(Object.assign({}, this.defaultPaddleOptions), options) : Object.assign({}, this.defaultPaddleOptions));
|
|
39
|
+
this.client = new client_js_1.Client(apiKey, options ? { ...this.defaultPaddleOptions, ...options } : { ...this.defaultPaddleOptions });
|
|
16
40
|
this.products = new index_js_2.ProductsResource(this.client);
|
|
17
41
|
this.prices = new index_js_2.PricesResource(this.client);
|
|
18
42
|
this.transactions = new index_js_2.TransactionsResource(this.client);
|
|
@@ -22,6 +46,7 @@ class Paddle {
|
|
|
22
46
|
this.addresses = new index_js_2.AddressesResource(this.client);
|
|
23
47
|
this.businesses = new index_js_2.BusinessesResource(this.client);
|
|
24
48
|
this.discounts = new index_js_2.DiscountsResource(this.client);
|
|
49
|
+
this.discountGroups = new index_js_2.DiscountGroupsResource(this.client);
|
|
25
50
|
this.subscriptions = new index_js_2.SubscriptionsResource(this.client);
|
|
26
51
|
this.paymentMethods = new index_js_2.PaymentMethodsResource(this.client);
|
|
27
52
|
this.pricingPreview = new index_js_2.PricingPreviewResource(this.client);
|