@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
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { TransactionProration } from './transaction-proration.js';
|
|
2
2
|
import { AdjustmentItemTotals } from '../adjustment/index.js';
|
|
3
3
|
export class TransactionAdjustmentItem {
|
|
4
|
+
id;
|
|
5
|
+
itemId;
|
|
6
|
+
type;
|
|
7
|
+
amount;
|
|
8
|
+
proration;
|
|
9
|
+
totals;
|
|
4
10
|
constructor(transactionAdjustmentItem) {
|
|
5
11
|
this.id = transactionAdjustmentItem.id ? transactionAdjustmentItem.id : null;
|
|
6
12
|
this.itemId = transactionAdjustmentItem.item_id;
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { TransactionAdjustmentItem } from './transaction-adjustment-item.js';
|
|
2
2
|
import { PayoutTotalsAdjustment, TotalAdjustments } from '../shared/index.js';
|
|
3
3
|
export class TransactionAdjustment {
|
|
4
|
+
id;
|
|
5
|
+
action;
|
|
6
|
+
transactionId;
|
|
7
|
+
subscriptionId;
|
|
8
|
+
customerId;
|
|
9
|
+
reason;
|
|
10
|
+
creditAppliedToBalance;
|
|
11
|
+
currencyCode;
|
|
12
|
+
status;
|
|
13
|
+
items;
|
|
14
|
+
totals;
|
|
15
|
+
payoutTotals;
|
|
16
|
+
createdAt;
|
|
17
|
+
updatedAt;
|
|
4
18
|
constructor(adjustment) {
|
|
5
19
|
this.id = adjustment.id;
|
|
6
20
|
this.action = adjustment.action;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { TaxRatesUsed, TransactionPayoutTotals, TransactionPayoutTotalsAdjusted, TransactionTotals, TransactionTotalsAdjusted, } from '../shared/index.js';
|
|
2
2
|
import { TransactionLineItem } from './transaction-line-item.js';
|
|
3
3
|
export class TransactionDetails {
|
|
4
|
+
taxRatesUsed;
|
|
5
|
+
totals;
|
|
6
|
+
adjustedTotals;
|
|
7
|
+
payoutTotals;
|
|
8
|
+
adjustedPayoutTotals;
|
|
9
|
+
lineItems;
|
|
4
10
|
constructor(transactionDetails) {
|
|
5
11
|
this.taxRatesUsed = transactionDetails.tax_rates_used.map((tax_rates_used) => new TaxRatesUsed(tax_rates_used));
|
|
6
12
|
this.totals = transactionDetails.totals ? new TransactionTotals(transactionDetails.totals) : null;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { Price } from '../price/index.js';
|
|
2
2
|
import { Proration } from './proration.js';
|
|
3
3
|
export class TransactionItemPreview {
|
|
4
|
+
price;
|
|
5
|
+
quantity;
|
|
6
|
+
includeInTotals;
|
|
7
|
+
proration;
|
|
4
8
|
constructor(transactionItem) {
|
|
5
|
-
var _a;
|
|
6
9
|
this.price = transactionItem.price ? new Price(transactionItem.price) : null;
|
|
7
10
|
this.quantity = transactionItem.quantity;
|
|
8
|
-
this.includeInTotals =
|
|
11
|
+
this.includeInTotals = transactionItem.include_in_totals ?? null;
|
|
9
12
|
this.proration = transactionItem.proration ? new Proration(transactionItem.proration) : null;
|
|
10
13
|
}
|
|
11
14
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Price } from '../price/index.js';
|
|
2
2
|
import { TransactionProration } from './transaction-proration.js';
|
|
3
3
|
export class TransactionItem {
|
|
4
|
+
price;
|
|
5
|
+
quantity;
|
|
6
|
+
proration;
|
|
4
7
|
constructor(transactionItem) {
|
|
5
8
|
this.price = transactionItem.price ? new Price(transactionItem.price) : null;
|
|
6
9
|
this.quantity = transactionItem.quantity;
|
|
@@ -2,6 +2,14 @@ import { TransactionProration } from './transaction-proration.js';
|
|
|
2
2
|
import { Totals, UnitTotals } from '../shared/index.js';
|
|
3
3
|
import { Product } from '../product/index.js';
|
|
4
4
|
export class TransactionLineItem {
|
|
5
|
+
id;
|
|
6
|
+
priceId;
|
|
7
|
+
quantity;
|
|
8
|
+
proration;
|
|
9
|
+
taxRate;
|
|
10
|
+
unitTotals;
|
|
11
|
+
totals;
|
|
12
|
+
product;
|
|
5
13
|
constructor(transactionLineItem) {
|
|
6
14
|
this.id = transactionLineItem.id;
|
|
7
15
|
this.priceId = transactionLineItem.price_id;
|
|
@@ -2,8 +2,18 @@ import { AddressPreview } from './address-preview.js';
|
|
|
2
2
|
import { TransactionItemPreview } from './transaction-item-preview.js';
|
|
3
3
|
import { TransactionDetailsPreview } from '../subscription/index.js';
|
|
4
4
|
export class TransactionPreview {
|
|
5
|
+
customerId;
|
|
6
|
+
addressId;
|
|
7
|
+
businessId;
|
|
8
|
+
currencyCode;
|
|
9
|
+
discountId;
|
|
10
|
+
customerIpAddress;
|
|
11
|
+
address;
|
|
12
|
+
ignoreTrials;
|
|
13
|
+
items;
|
|
14
|
+
details;
|
|
15
|
+
availablePaymentMethods;
|
|
5
16
|
constructor(transactionPreview) {
|
|
6
|
-
var _a;
|
|
7
17
|
this.customerId = transactionPreview.customer_id ? transactionPreview.customer_id : null;
|
|
8
18
|
this.addressId = transactionPreview.address_id ? transactionPreview.address_id : null;
|
|
9
19
|
this.businessId = transactionPreview.business_id ? transactionPreview.business_id : null;
|
|
@@ -14,6 +24,6 @@ export class TransactionPreview {
|
|
|
14
24
|
this.ignoreTrials = transactionPreview.ignore_trials ? transactionPreview.ignore_trials : null;
|
|
15
25
|
this.items = transactionPreview.items.map((item) => new TransactionItemPreview(item));
|
|
16
26
|
this.details = new TransactionDetailsPreview(transactionPreview.details);
|
|
17
|
-
this.availablePaymentMethods =
|
|
27
|
+
this.availablePaymentMethods = transactionPreview.available_payment_method ?? null;
|
|
18
28
|
}
|
|
19
29
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { TransactionsTimePeriod } from './transactions-time-period.js';
|
|
2
2
|
export class TransactionProration {
|
|
3
|
+
rate;
|
|
4
|
+
billingPeriod;
|
|
3
5
|
constructor(transactionProration) {
|
|
4
6
|
this.rate = transactionProration.rate;
|
|
5
7
|
this.billingPeriod = transactionProration.billing_period
|
|
@@ -1,7 +1,36 @@
|
|
|
1
1
|
import { Address, AdjustmentTotals, BillingDetails, Business, Customer, Discount, TransactionAdjustment, TransactionCheckout, TransactionDetails, TransactionItem, TransactionPaymentAttempt, TransactionsTimePeriod, } from '../index.js';
|
|
2
2
|
export class Transaction {
|
|
3
|
+
id;
|
|
4
|
+
status;
|
|
5
|
+
customerId;
|
|
6
|
+
addressId;
|
|
7
|
+
businessId;
|
|
8
|
+
customData;
|
|
9
|
+
currencyCode;
|
|
10
|
+
origin;
|
|
11
|
+
subscriptionId;
|
|
12
|
+
invoiceId;
|
|
13
|
+
invoiceNumber;
|
|
14
|
+
collectionMode;
|
|
15
|
+
discountId;
|
|
16
|
+
billingDetails;
|
|
17
|
+
billingPeriod;
|
|
18
|
+
items;
|
|
19
|
+
details;
|
|
20
|
+
payments;
|
|
21
|
+
checkout;
|
|
22
|
+
createdAt;
|
|
23
|
+
updatedAt;
|
|
24
|
+
billedAt;
|
|
25
|
+
revisedAt;
|
|
26
|
+
address;
|
|
27
|
+
adjustments;
|
|
28
|
+
adjustmentsTotals;
|
|
29
|
+
business;
|
|
30
|
+
customer;
|
|
31
|
+
discount;
|
|
32
|
+
availablePaymentMethods;
|
|
3
33
|
constructor(transaction) {
|
|
4
|
-
var _a;
|
|
5
34
|
this.id = transaction.id;
|
|
6
35
|
this.status = transaction.status;
|
|
7
36
|
this.customerId = transaction.customer_id ? transaction.customer_id : null;
|
|
@@ -27,7 +56,7 @@ export class Transaction {
|
|
|
27
56
|
this.revisedAt = transaction.revised_at ? transaction.revised_at : null;
|
|
28
57
|
this.address = transaction.address ? new Address(transaction.address) : null;
|
|
29
58
|
this.adjustments = transaction.adjustments
|
|
30
|
-
?
|
|
59
|
+
? transaction.adjustments?.map((adjustment) => new TransactionAdjustment(adjustment))
|
|
31
60
|
: null;
|
|
32
61
|
this.adjustmentsTotals = transaction.adjustments_totals
|
|
33
62
|
? new AdjustmentTotals(transaction.adjustments_totals)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/enums/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
function isTopLevelCustomDataCamel(input) {
|
|
13
2
|
return 'customData' in input;
|
|
14
3
|
}
|
|
@@ -55,9 +44,9 @@ export function convertToSnakeCase(input) {
|
|
|
55
44
|
return input;
|
|
56
45
|
}
|
|
57
46
|
if (isTopLevelCustomDataCamel(input)) {
|
|
58
|
-
const { customData
|
|
47
|
+
const { customData, ...rest } = input;
|
|
59
48
|
const result = decamelizeKeys(rest);
|
|
60
|
-
return
|
|
49
|
+
return { ...result, custom_data: customData };
|
|
61
50
|
}
|
|
62
51
|
else {
|
|
63
52
|
return decamelizeKeys(input);
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import { Environment } from './environment.js';
|
|
11
2
|
import { API_ENVIRONMENT_TO_BASE_URL_MAP } from './constants.js';
|
|
12
3
|
import { Logger } from '../base/logger.js';
|
|
@@ -15,84 +6,83 @@ import { RuntimeProvider } from '../providers/runtime-provider.js';
|
|
|
15
6
|
import { SDK_VERSION } from '../../version.js';
|
|
16
7
|
import { convertToSnakeCase } from './case-helpers.js';
|
|
17
8
|
export class Client {
|
|
9
|
+
apiKey;
|
|
10
|
+
options;
|
|
11
|
+
baseUrl;
|
|
18
12
|
constructor(apiKey, options) {
|
|
19
|
-
var _a;
|
|
20
13
|
this.apiKey = apiKey;
|
|
21
14
|
this.options = options;
|
|
22
15
|
this.baseUrl = this.getBaseUrl(this.options.environment);
|
|
23
|
-
Logger.logLevel =
|
|
16
|
+
Logger.logLevel = this.options.logLevel ?? LogLevel.error;
|
|
24
17
|
}
|
|
25
18
|
getBaseUrl(environment) {
|
|
26
|
-
const urlBasedOnEnv = API_ENVIRONMENT_TO_BASE_URL_MAP[environment
|
|
19
|
+
const urlBasedOnEnv = API_ENVIRONMENT_TO_BASE_URL_MAP[environment ?? Environment.production];
|
|
27
20
|
return urlBasedOnEnv || environment;
|
|
28
21
|
}
|
|
29
22
|
getHeaders() {
|
|
30
|
-
var _a;
|
|
31
23
|
let uuid;
|
|
32
|
-
const cryptoProvider =
|
|
24
|
+
const cryptoProvider = RuntimeProvider.getProvider()?.crypto;
|
|
33
25
|
if (cryptoProvider) {
|
|
34
26
|
uuid = cryptoProvider.randomUUID();
|
|
35
27
|
}
|
|
36
28
|
else {
|
|
37
29
|
Logger.error('Unknown runtime. Cannot generate uuid');
|
|
38
30
|
}
|
|
39
|
-
return
|
|
31
|
+
return {
|
|
32
|
+
Authorization: `bearer ${this.apiKey}`,
|
|
33
|
+
'Content-Type': 'application/json',
|
|
34
|
+
'user-agent': `PaddleSDK/node ${SDK_VERSION}`,
|
|
35
|
+
'X-Transaction-ID': uuid ?? '',
|
|
36
|
+
...this.options.customHeaders,
|
|
37
|
+
};
|
|
40
38
|
}
|
|
41
|
-
get(url, queryParams) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
headers,
|
|
52
|
-
});
|
|
53
|
-
Logger.logResponse('GET', logUrl, headers, rawResponse);
|
|
54
|
-
return rawResponse.json();
|
|
39
|
+
async get(url, queryParams) {
|
|
40
|
+
let finalUrl = url.includes(this.baseUrl) ? url : `${this.baseUrl}${url}`;
|
|
41
|
+
if (!finalUrl.includes('?') && queryParams) {
|
|
42
|
+
finalUrl += queryParams.toQueryString();
|
|
43
|
+
}
|
|
44
|
+
const logUrl = finalUrl.split('?')[0];
|
|
45
|
+
const headers = this.getHeaders();
|
|
46
|
+
Logger.logRequest('GET', logUrl, headers);
|
|
47
|
+
const rawResponse = await fetch(finalUrl, {
|
|
48
|
+
headers,
|
|
55
49
|
});
|
|
50
|
+
Logger.logResponse('GET', logUrl, headers, rawResponse);
|
|
51
|
+
return rawResponse.json();
|
|
56
52
|
}
|
|
57
|
-
post(url, requestBody) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
headers,
|
|
66
|
-
});
|
|
67
|
-
Logger.logResponse('POST', logUrl, headers, rawResponse);
|
|
68
|
-
return rawResponse.json();
|
|
53
|
+
async post(url, requestBody) {
|
|
54
|
+
const logUrl = url.split('?')[0];
|
|
55
|
+
const headers = this.getHeaders();
|
|
56
|
+
Logger.logRequest('POST', logUrl, headers);
|
|
57
|
+
const rawResponse = await fetch(`${this.baseUrl}${url}`, {
|
|
58
|
+
method: 'POST',
|
|
59
|
+
body: JSON.stringify(convertToSnakeCase(requestBody)),
|
|
60
|
+
headers,
|
|
69
61
|
});
|
|
62
|
+
Logger.logResponse('POST', logUrl, headers, rawResponse);
|
|
63
|
+
return rawResponse.json();
|
|
70
64
|
}
|
|
71
|
-
patch(url, requestBody) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
headers,
|
|
80
|
-
});
|
|
81
|
-
Logger.logResponse('PATCH', logUrl, headers, rawResponse);
|
|
82
|
-
return rawResponse.json();
|
|
65
|
+
async patch(url, requestBody) {
|
|
66
|
+
const logUrl = url.split('?')[0];
|
|
67
|
+
const headers = this.getHeaders();
|
|
68
|
+
Logger.logRequest('PATCH', logUrl, headers);
|
|
69
|
+
const rawResponse = await fetch(`${this.baseUrl}${url}`, {
|
|
70
|
+
method: 'PATCH',
|
|
71
|
+
body: JSON.stringify(convertToSnakeCase(requestBody)),
|
|
72
|
+
headers,
|
|
83
73
|
});
|
|
74
|
+
Logger.logResponse('PATCH', logUrl, headers, rawResponse);
|
|
75
|
+
return rawResponse.json();
|
|
84
76
|
}
|
|
85
|
-
delete(url) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
headers,
|
|
93
|
-
});
|
|
94
|
-
Logger.logResponse('DELETE', logUrl, headers, rawResponse);
|
|
95
|
-
return rawResponse;
|
|
77
|
+
async delete(url) {
|
|
78
|
+
const logUrl = url.split('?')[0];
|
|
79
|
+
const headers = this.getHeaders();
|
|
80
|
+
Logger.logRequest('DELETE', logUrl, headers);
|
|
81
|
+
const rawResponse = await fetch(`${this.baseUrl}${url}`, {
|
|
82
|
+
method: 'DELETE',
|
|
83
|
+
headers,
|
|
96
84
|
});
|
|
85
|
+
Logger.logResponse('DELETE', logUrl, headers, rawResponse);
|
|
86
|
+
return rawResponse;
|
|
97
87
|
}
|
|
98
88
|
}
|
|
@@ -1,45 +1,22 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
11
|
-
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
12
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
13
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
14
|
-
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
15
|
-
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
16
|
-
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
17
|
-
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
18
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
19
|
-
function fulfill(value) { resume("next", value); }
|
|
20
|
-
function reject(value) { resume("throw", value); }
|
|
21
|
-
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
22
|
-
};
|
|
23
1
|
import { ApiError } from '../errors/generic.js';
|
|
24
2
|
export class Collection {
|
|
3
|
+
client;
|
|
4
|
+
hasMore = true;
|
|
5
|
+
estimatedTotal = 0;
|
|
6
|
+
nextLink;
|
|
7
|
+
data = [];
|
|
25
8
|
constructor(client, initialUri) {
|
|
26
9
|
this.client = client;
|
|
27
|
-
this.hasMore = true;
|
|
28
|
-
this.estimatedTotal = 0;
|
|
29
|
-
this.data = [];
|
|
30
10
|
this.nextLink = initialUri;
|
|
31
11
|
}
|
|
32
|
-
next() {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
this.data = handledResponse.data.map((data) => this.fromJson(data));
|
|
41
|
-
return this.data.length > 0 ? this.data : [];
|
|
42
|
-
});
|
|
12
|
+
async next() {
|
|
13
|
+
const response = await this.client.get(this.nextLink);
|
|
14
|
+
const handledResponse = this.handlePaginatedResponse(response);
|
|
15
|
+
this.hasMore = handledResponse.meta.pagination.has_more ?? false;
|
|
16
|
+
this.nextLink = handledResponse.meta.pagination.next;
|
|
17
|
+
this.estimatedTotal = handledResponse.meta.pagination.estimated_total ?? 0;
|
|
18
|
+
this.data = handledResponse.data.map((data) => this.fromJson(data));
|
|
19
|
+
return this.data.length > 0 ? this.data : [];
|
|
43
20
|
}
|
|
44
21
|
handlePaginatedResponse(response) {
|
|
45
22
|
const entityResponse = response;
|
|
@@ -49,16 +26,14 @@ export class Collection {
|
|
|
49
26
|
}
|
|
50
27
|
return entityResponse;
|
|
51
28
|
}
|
|
52
|
-
[Symbol.asyncIterator]() {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
yield yield __await(this.data[index]);
|
|
59
|
-
}
|
|
29
|
+
async *[Symbol.asyncIterator]() {
|
|
30
|
+
while (this.hasMore) {
|
|
31
|
+
await this.next();
|
|
32
|
+
for (let index = 0; index < this.data.length; index++) {
|
|
33
|
+
if (this.data[index]) {
|
|
34
|
+
yield this.data[index];
|
|
60
35
|
}
|
|
61
36
|
}
|
|
62
|
-
}
|
|
37
|
+
}
|
|
63
38
|
}
|
|
64
39
|
}
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
export class CryptoProvider {
|
|
11
2
|
randomUUID() {
|
|
12
3
|
throw new Error('randomUUID not implemented.');
|
|
13
4
|
}
|
|
14
|
-
computeHmac(payload, secret) {
|
|
15
|
-
|
|
16
|
-
throw new Error('computeHmac not implemented.');
|
|
17
|
-
});
|
|
5
|
+
async computeHmac(payload, secret) {
|
|
6
|
+
throw new Error('computeHmac not implemented.');
|
|
18
7
|
}
|
|
19
8
|
}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
const byteHexMapping = new Array(256);
|
|
11
2
|
for (let i = 0; i < byteHexMapping.length; i++) {
|
|
12
3
|
byteHexMapping[i] = i.toString(16).padStart(2, '0');
|
|
@@ -15,22 +6,20 @@ export class EdgeCrypto {
|
|
|
15
6
|
randomUUID() {
|
|
16
7
|
return crypto.randomUUID();
|
|
17
8
|
}
|
|
18
|
-
computeHmac(payload, secret) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
signatureHexCodes[i] = byteHexMapping[signatureBytes[i]];
|
|
31
|
-
}
|
|
9
|
+
async computeHmac(payload, secret) {
|
|
10
|
+
const encoder = new TextEncoder();
|
|
11
|
+
const key = await crypto.subtle.importKey('raw', encoder.encode(secret), {
|
|
12
|
+
name: 'HMAC',
|
|
13
|
+
hash: { name: 'SHA-256' },
|
|
14
|
+
}, false, ['sign']);
|
|
15
|
+
const signatureBuffer = await crypto.subtle.sign('hmac', key, encoder.encode(payload));
|
|
16
|
+
const signatureBytes = new Uint8Array(signatureBuffer);
|
|
17
|
+
const signatureHexCodes = new Array(signatureBytes.length);
|
|
18
|
+
for (let i = 0; i < signatureBytes.length; i++) {
|
|
19
|
+
if (signatureBytes[i] !== undefined && signatureBytes[i] !== null) {
|
|
20
|
+
signatureHexCodes[i] = byteHexMapping[signatureBytes[i]];
|
|
32
21
|
}
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
}
|
|
23
|
+
return signatureHexCodes.join('');
|
|
35
24
|
}
|
|
36
25
|
}
|
|
@@ -1,24 +1,13 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import { createHmac, randomUUID } from 'node:crypto';
|
|
11
2
|
export class NodeCrypto {
|
|
12
3
|
randomUUID() {
|
|
13
4
|
return randomUUID();
|
|
14
5
|
}
|
|
15
|
-
computeHmac(payload, secret) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
resolve(hmac.digest('hex'));
|
|
21
|
-
});
|
|
6
|
+
async computeHmac(payload, secret) {
|
|
7
|
+
const hmac = createHmac('sha256', secret);
|
|
8
|
+
hmac.update(payload);
|
|
9
|
+
return await new Promise((resolve) => {
|
|
10
|
+
resolve(hmac.digest('hex'));
|
|
22
11
|
});
|
|
23
12
|
}
|
|
24
13
|
}
|