@paid-ai/paid-node 1.2.1 → 1.5.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/Client.d.ts +9 -0
- package/dist/cjs/Client.js +33 -18
- package/dist/cjs/api/errors/ConflictError.d.ts +6 -0
- package/dist/cjs/api/errors/ConflictError.js +50 -0
- package/dist/cjs/api/errors/index.d.ts +1 -0
- package/dist/cjs/api/errors/index.js +1 -0
- package/dist/cjs/api/resources/checkouts/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/cost/client/Client.d.ts +38 -0
- package/dist/cjs/api/resources/cost/client/Client.js +139 -0
- package/dist/cjs/api/resources/cost/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/cost/client/index.js +17 -0
- package/dist/cjs/api/resources/cost/client/requests/CostIngestRequest.d.ts +17 -0
- package/dist/cjs/api/resources/cost/client/requests/CostIngestRequest.js +3 -0
- package/dist/cjs/api/resources/cost/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/cost/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/cost/index.d.ts +1 -0
- package/dist/cjs/api/resources/cost/index.js +17 -0
- package/dist/cjs/api/resources/customers/client/Client.d.ts +19 -0
- package/dist/cjs/api/resources/customers/client/Client.js +86 -0
- package/dist/cjs/api/resources/customers/client/requests/UpsertCustomerUserRequest.d.ts +16 -0
- package/dist/cjs/api/resources/customers/client/requests/UpsertCustomerUserRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/index.d.ts +9 -0
- package/dist/cjs/api/resources/index.js +10 -1
- package/dist/cjs/api/resources/orders/client/Client.d.ts +60 -0
- package/dist/cjs/api/resources/orders/client/Client.js +242 -0
- package/dist/cjs/api/resources/orders/client/requests/BatchSeatAssignmentsRequest.d.ts +22 -0
- package/dist/cjs/api/resources/orders/client/requests/BatchSeatAssignmentsRequest.js +3 -0
- package/dist/cjs/api/resources/orders/client/requests/CreateOrderRequest.d.ts +1 -0
- package/dist/cjs/api/resources/orders/client/requests/ListOrderSeatsRequest.d.ts +14 -0
- package/dist/cjs/api/resources/orders/client/requests/ListOrderSeatsRequest.js +3 -0
- package/dist/cjs/api/resources/orders/client/requests/UpdateSeatAssignmentRequest.d.ts +12 -0
- package/dist/cjs/api/resources/orders/client/requests/UpdateSeatAssignmentRequest.js +3 -0
- package/dist/cjs/api/resources/orders/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/orders/index.d.ts +1 -0
- package/dist/cjs/api/resources/orders/index.js +1 -0
- package/dist/cjs/api/resources/orders/types/ListOrderSeatsRequestStatus.d.ts +5 -0
- package/dist/cjs/api/resources/orders/types/ListOrderSeatsRequestStatus.js +8 -0
- package/dist/cjs/api/resources/orders/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/orders/types/index.js +17 -0
- package/dist/cjs/api/resources/pricing/client/Client.d.ts +71 -0
- package/dist/cjs/api/resources/pricing/client/Client.js +284 -0
- package/dist/cjs/api/resources/pricing/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/pricing/client/index.js +17 -0
- package/dist/cjs/api/resources/pricing/client/requests/GetPricingRequest.d.ts +9 -0
- package/dist/cjs/api/resources/pricing/client/requests/GetPricingRequest.js +3 -0
- package/dist/cjs/api/resources/pricing/client/requests/ListPricingRequest.d.ts +10 -0
- package/dist/cjs/api/resources/pricing/client/requests/ListPricingRequest.js +3 -0
- package/dist/cjs/api/resources/pricing/client/requests/UpdatePricingRequest.d.ts +20 -0
- package/dist/cjs/api/resources/pricing/client/requests/UpdatePricingRequest.js +3 -0
- package/dist/cjs/api/resources/pricing/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/pricing/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/pricing/index.d.ts +1 -0
- package/dist/cjs/api/resources/pricing/index.js +17 -0
- package/dist/cjs/api/resources/valueReceipts/client/Client.d.ts +85 -0
- package/dist/cjs/api/resources/valueReceipts/client/Client.js +362 -1
- package/dist/cjs/api/resources/valueReceipts/client/requests/ArchiveValueReceiptRequest.d.ts +9 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/ArchiveValueReceiptRequest.js +3 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/ListValueReceiptsRequest.d.ts +7 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/RefreshValueReceiptRequest.d.ts +9 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/RefreshValueReceiptRequest.js +3 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/SealValueReceiptRequest.d.ts +9 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/SealValueReceiptRequest.js +3 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/SyncValueReceiptRequest.d.ts +28 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/SyncValueReceiptRequest.js +3 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/UnarchiveValueReceiptRequest.d.ts +9 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/UnarchiveValueReceiptRequest.js +3 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/resources/valueReceipts/index.d.ts +1 -0
- package/dist/cjs/api/resources/valueReceipts/index.js +1 -0
- package/dist/cjs/api/resources/valueReceipts/types/ListValueReceiptsRequestArchived.d.ts +5 -0
- package/dist/cjs/api/resources/valueReceipts/types/ListValueReceiptsRequestArchived.js +8 -0
- package/dist/cjs/api/resources/valueReceipts/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/valueReceipts/types/index.js +17 -0
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +63 -0
- package/dist/cjs/api/resources/webhooks/client/Client.js +282 -0
- package/dist/cjs/api/resources/webhooks/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/webhooks/client/index.js +17 -0
- package/dist/cjs/api/resources/webhooks/client/requests/TestWebhookRequest.d.ts +10 -0
- package/dist/cjs/api/resources/webhooks/client/requests/TestWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/UpdateWebhookRequest.d.ts +14 -0
- package/dist/cjs/api/resources/webhooks/client/requests/UpdateWebhookRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/webhooks/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/webhooks/index.d.ts +2 -0
- package/dist/cjs/api/resources/webhooks/index.js +18 -0
- package/dist/cjs/api/resources/webhooks/types/TestWebhookRequestWebhookName.d.ts +12 -0
- package/dist/cjs/api/resources/webhooks/types/TestWebhookRequestWebhookName.js +15 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookRequestWebhookName.d.ts +12 -0
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookRequestWebhookName.js +15 -0
- package/dist/cjs/api/resources/webhooks/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/webhooks/types/index.js +18 -0
- package/dist/cjs/api/types/BatchSeatAssignmentsResponse.d.ts +4 -0
- package/dist/cjs/api/types/BatchSeatAssignmentsResponse.js +3 -0
- package/dist/cjs/api/types/CheckoutDetails.d.ts +21 -0
- package/dist/cjs/api/types/CheckoutDetails.js +3 -0
- package/dist/cjs/api/types/Cost.d.ts +10 -0
- package/dist/cjs/api/types/Cost.js +3 -0
- package/dist/cjs/api/types/CostIngestResponse.d.ts +6 -0
- package/dist/cjs/api/types/CostIngestResponse.js +3 -0
- package/dist/cjs/api/types/CostOverride.d.ts +8 -0
- package/dist/cjs/api/types/CostOverride.js +3 -0
- package/dist/cjs/api/types/CreateOrderLineAttributeRequest.d.ts +1 -0
- package/dist/cjs/api/types/CreditBalance.d.ts +6 -0
- package/dist/cjs/api/types/CreditBenefitInput.d.ts +30 -0
- package/dist/cjs/api/types/CreditBenefitInput.js +20 -0
- package/dist/cjs/api/types/CreditBenefitOutput.d.ts +13 -0
- package/dist/cjs/api/types/CreditBenefitOutput.js +3 -0
- package/dist/cjs/api/types/CreditGrant.d.ts +11 -0
- package/dist/cjs/api/types/CreditGrant.js +3 -0
- package/dist/cjs/api/types/CustomerUser.d.ts +13 -0
- package/dist/cjs/api/types/CustomerUser.js +3 -0
- package/dist/cjs/api/types/CustomerUserStatus.d.ts +5 -0
- package/dist/cjs/api/types/CustomerUserStatus.js +8 -0
- package/dist/cjs/api/types/OneTimePerUnitInput.d.ts +21 -0
- package/dist/cjs/api/types/OneTimePerUnitInput.js +18 -0
- package/dist/cjs/api/types/Order.d.ts +2 -0
- package/dist/cjs/api/types/OrderBillingFrequencyOverride.d.ts +14 -0
- package/dist/cjs/api/types/OrderBillingFrequencyOverride.js +14 -0
- package/dist/cjs/api/types/OrderSeat.d.ts +10 -0
- package/dist/cjs/api/types/OrderSeat.js +3 -0
- package/dist/cjs/api/types/OrderSeatListResponse.d.ts +5 -0
- package/dist/cjs/api/types/OrderSeatListResponse.js +3 -0
- package/dist/cjs/api/types/PrecomputedCost.d.ts +17 -0
- package/dist/cjs/api/types/PrecomputedCost.js +3 -0
- package/dist/cjs/api/types/PricingInput.d.ts +46 -0
- package/dist/cjs/api/types/PricingInput.js +3 -0
- package/dist/cjs/api/types/PricingListResponse.d.ts +4 -0
- package/dist/cjs/api/types/PricingListResponse.js +3 -0
- package/dist/cjs/api/types/PricingOutput.d.ts +36 -0
- package/dist/cjs/api/types/PricingOutput.js +23 -0
- package/dist/cjs/api/types/PricingPricePointOutput.d.ts +29 -0
- package/dist/cjs/api/types/PricingPricePointOutput.js +17 -0
- package/dist/cjs/api/types/PricingResponse.d.ts +7 -0
- package/dist/cjs/api/types/PricingResponse.js +3 -0
- package/dist/cjs/api/types/ProductAttribution.d.ts +2 -0
- package/dist/cjs/api/types/ProductAttribution.js +3 -0
- package/dist/cjs/api/types/RecurringGraduatedInput.d.ts +22 -0
- package/dist/cjs/api/types/RecurringGraduatedInput.js +18 -0
- package/dist/cjs/api/types/RecurringPerUnitInput.d.ts +22 -0
- package/dist/cjs/api/types/RecurringPerUnitInput.js +18 -0
- package/dist/cjs/api/types/RecurringPercentOfTotalInput.d.ts +23 -0
- package/dist/cjs/api/types/RecurringPercentOfTotalInput.js +18 -0
- package/dist/cjs/api/types/RecurringVolumeInput.d.ts +22 -0
- package/dist/cjs/api/types/RecurringVolumeInput.js +18 -0
- package/dist/cjs/api/types/SeatAssignee.d.ts +5 -0
- package/dist/cjs/api/types/SeatAssignee.js +3 -0
- package/dist/cjs/api/types/SeatAssignmentStatus.d.ts +5 -0
- package/dist/cjs/api/types/SeatAssignmentStatus.js +8 -0
- package/dist/cjs/api/types/SeatBasedGraduatedInput.d.ts +22 -0
- package/dist/cjs/api/types/SeatBasedGraduatedInput.js +18 -0
- package/dist/cjs/api/types/SeatBasedPerUnitInput.d.ts +22 -0
- package/dist/cjs/api/types/SeatBasedPerUnitInput.js +18 -0
- package/dist/cjs/api/types/SeatBasedPrepaidCreditsInput.d.ts +25 -0
- package/dist/cjs/api/types/SeatBasedPrepaidCreditsInput.js +18 -0
- package/dist/cjs/api/types/SeatBasedVolumeInput.d.ts +22 -0
- package/dist/cjs/api/types/SeatBasedVolumeInput.js +18 -0
- package/dist/cjs/api/types/SimplePricePoint.d.ts +29 -0
- package/dist/cjs/api/types/SimplePricePoint.js +17 -0
- package/dist/cjs/api/types/SuccessResponse.d.ts +3 -0
- package/dist/cjs/api/types/SuccessResponse.js +3 -0
- package/dist/cjs/api/types/TieredPricePoint.d.ts +29 -0
- package/dist/cjs/api/types/TieredPricePoint.js +17 -0
- package/dist/cjs/api/types/TokenUsage.d.ts +12 -0
- package/dist/cjs/api/types/TokenUsage.js +3 -0
- package/dist/cjs/api/types/UsageCost.d.ts +15 -0
- package/dist/cjs/api/types/UsageCost.js +3 -0
- package/dist/cjs/api/types/UsageCostPlusInput.d.ts +23 -0
- package/dist/cjs/api/types/UsageCostPlusInput.js +18 -0
- package/dist/cjs/api/types/UsageGraduatedInput.d.ts +23 -0
- package/dist/cjs/api/types/UsageGraduatedInput.js +18 -0
- package/dist/cjs/api/types/UsagePerUnitInput.d.ts +23 -0
- package/dist/cjs/api/types/UsagePerUnitInput.js +18 -0
- package/dist/cjs/api/types/UsagePrepaidCreditsInput.d.ts +26 -0
- package/dist/cjs/api/types/UsagePrepaidCreditsInput.js +18 -0
- package/dist/cjs/api/types/UsageVolumeInput.d.ts +23 -0
- package/dist/cjs/api/types/UsageVolumeInput.js +18 -0
- package/dist/cjs/api/types/ValueReceiptDetail.d.ts +2 -0
- package/dist/cjs/api/types/ValueReceiptSummary.d.ts +2 -0
- package/dist/cjs/api/types/ValueReceiptSyncResponse.d.ts +6 -0
- package/dist/cjs/api/types/ValueReceiptSyncResponse.js +3 -0
- package/dist/cjs/api/types/Webhook.d.ts +24 -0
- package/dist/cjs/api/types/Webhook.js +18 -0
- package/dist/cjs/api/types/WebhookDeliveryStatus.d.ts +5 -0
- package/dist/cjs/api/types/WebhookDeliveryStatus.js +8 -0
- package/dist/cjs/api/types/WebhookListResponse.d.ts +4 -0
- package/dist/cjs/api/types/WebhookListResponse.js +3 -0
- package/dist/cjs/api/types/WebhookTestResponse.d.ts +3 -0
- package/dist/cjs/api/types/WebhookTestResponse.js +3 -0
- package/dist/cjs/api/types/index.d.ts +46 -0
- package/dist/cjs/api/types/index.js +46 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +9 -0
- package/dist/esm/Client.mjs +17 -2
- package/dist/esm/api/errors/ConflictError.d.mts +6 -0
- package/dist/esm/api/errors/ConflictError.mjs +13 -0
- package/dist/esm/api/errors/index.d.mts +1 -0
- package/dist/esm/api/errors/index.mjs +1 -0
- package/dist/esm/api/resources/checkouts/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/cost/client/Client.d.mts +38 -0
- package/dist/esm/api/resources/cost/client/Client.mjs +102 -0
- package/dist/esm/api/resources/cost/client/index.d.mts +1 -0
- package/dist/esm/api/resources/cost/client/index.mjs +1 -0
- package/dist/esm/api/resources/cost/client/requests/CostIngestRequest.d.mts +17 -0
- package/dist/esm/api/resources/cost/client/requests/CostIngestRequest.mjs +2 -0
- package/dist/esm/api/resources/cost/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/cost/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/cost/index.d.mts +1 -0
- package/dist/esm/api/resources/cost/index.mjs +1 -0
- package/dist/esm/api/resources/customers/client/Client.d.mts +19 -0
- package/dist/esm/api/resources/customers/client/Client.mjs +86 -0
- package/dist/esm/api/resources/customers/client/requests/UpsertCustomerUserRequest.d.mts +16 -0
- package/dist/esm/api/resources/customers/client/requests/UpsertCustomerUserRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/index.d.mts +9 -0
- package/dist/esm/api/resources/index.mjs +9 -0
- package/dist/esm/api/resources/orders/client/Client.d.mts +60 -0
- package/dist/esm/api/resources/orders/client/Client.mjs +242 -0
- package/dist/esm/api/resources/orders/client/requests/BatchSeatAssignmentsRequest.d.mts +22 -0
- package/dist/esm/api/resources/orders/client/requests/BatchSeatAssignmentsRequest.mjs +2 -0
- package/dist/esm/api/resources/orders/client/requests/CreateOrderRequest.d.mts +1 -0
- package/dist/esm/api/resources/orders/client/requests/ListOrderSeatsRequest.d.mts +14 -0
- package/dist/esm/api/resources/orders/client/requests/ListOrderSeatsRequest.mjs +2 -0
- package/dist/esm/api/resources/orders/client/requests/UpdateSeatAssignmentRequest.d.mts +12 -0
- package/dist/esm/api/resources/orders/client/requests/UpdateSeatAssignmentRequest.mjs +2 -0
- package/dist/esm/api/resources/orders/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/orders/index.d.mts +1 -0
- package/dist/esm/api/resources/orders/index.mjs +1 -0
- package/dist/esm/api/resources/orders/types/ListOrderSeatsRequestStatus.d.mts +5 -0
- package/dist/esm/api/resources/orders/types/ListOrderSeatsRequestStatus.mjs +5 -0
- package/dist/esm/api/resources/orders/types/index.d.mts +1 -0
- package/dist/esm/api/resources/orders/types/index.mjs +1 -0
- package/dist/esm/api/resources/pricing/client/Client.d.mts +71 -0
- package/dist/esm/api/resources/pricing/client/Client.mjs +247 -0
- package/dist/esm/api/resources/pricing/client/index.d.mts +1 -0
- package/dist/esm/api/resources/pricing/client/index.mjs +1 -0
- package/dist/esm/api/resources/pricing/client/requests/GetPricingRequest.d.mts +9 -0
- package/dist/esm/api/resources/pricing/client/requests/GetPricingRequest.mjs +2 -0
- package/dist/esm/api/resources/pricing/client/requests/ListPricingRequest.d.mts +10 -0
- package/dist/esm/api/resources/pricing/client/requests/ListPricingRequest.mjs +2 -0
- package/dist/esm/api/resources/pricing/client/requests/UpdatePricingRequest.d.mts +20 -0
- package/dist/esm/api/resources/pricing/client/requests/UpdatePricingRequest.mjs +2 -0
- package/dist/esm/api/resources/pricing/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/pricing/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/pricing/index.d.mts +1 -0
- package/dist/esm/api/resources/pricing/index.mjs +1 -0
- package/dist/esm/api/resources/valueReceipts/client/Client.d.mts +85 -0
- package/dist/esm/api/resources/valueReceipts/client/Client.mjs +362 -1
- package/dist/esm/api/resources/valueReceipts/client/requests/ArchiveValueReceiptRequest.d.mts +9 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/ArchiveValueReceiptRequest.mjs +2 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/ListValueReceiptsRequest.d.mts +7 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/RefreshValueReceiptRequest.d.mts +9 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/RefreshValueReceiptRequest.mjs +2 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/SealValueReceiptRequest.d.mts +9 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/SealValueReceiptRequest.mjs +2 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/SyncValueReceiptRequest.d.mts +28 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/SyncValueReceiptRequest.mjs +2 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/UnarchiveValueReceiptRequest.d.mts +9 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/UnarchiveValueReceiptRequest.mjs +2 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/index.d.mts +5 -0
- package/dist/esm/api/resources/valueReceipts/index.d.mts +1 -0
- package/dist/esm/api/resources/valueReceipts/index.mjs +1 -0
- package/dist/esm/api/resources/valueReceipts/types/ListValueReceiptsRequestArchived.d.mts +5 -0
- package/dist/esm/api/resources/valueReceipts/types/ListValueReceiptsRequestArchived.mjs +5 -0
- package/dist/esm/api/resources/valueReceipts/types/index.d.mts +1 -0
- package/dist/esm/api/resources/valueReceipts/types/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +63 -0
- package/dist/esm/api/resources/webhooks/client/Client.mjs +245 -0
- package/dist/esm/api/resources/webhooks/client/index.d.mts +1 -0
- package/dist/esm/api/resources/webhooks/client/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/client/requests/TestWebhookRequest.d.mts +10 -0
- package/dist/esm/api/resources/webhooks/client/requests/TestWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/UpdateWebhookRequest.d.mts +14 -0
- package/dist/esm/api/resources/webhooks/client/requests/UpdateWebhookRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/webhooks/index.d.mts +2 -0
- package/dist/esm/api/resources/webhooks/index.mjs +2 -0
- package/dist/esm/api/resources/webhooks/types/TestWebhookRequestWebhookName.d.mts +12 -0
- package/dist/esm/api/resources/webhooks/types/TestWebhookRequestWebhookName.mjs +12 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookRequestWebhookName.d.mts +12 -0
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookRequestWebhookName.mjs +12 -0
- package/dist/esm/api/resources/webhooks/types/index.d.mts +2 -0
- package/dist/esm/api/resources/webhooks/types/index.mjs +2 -0
- package/dist/esm/api/types/BatchSeatAssignmentsResponse.d.mts +4 -0
- package/dist/esm/api/types/BatchSeatAssignmentsResponse.mjs +2 -0
- package/dist/esm/api/types/CheckoutDetails.d.mts +21 -0
- package/dist/esm/api/types/CheckoutDetails.mjs +2 -0
- package/dist/esm/api/types/Cost.d.mts +10 -0
- package/dist/esm/api/types/Cost.mjs +2 -0
- package/dist/esm/api/types/CostIngestResponse.d.mts +6 -0
- package/dist/esm/api/types/CostIngestResponse.mjs +2 -0
- package/dist/esm/api/types/CostOverride.d.mts +8 -0
- package/dist/esm/api/types/CostOverride.mjs +2 -0
- package/dist/esm/api/types/CreateOrderLineAttributeRequest.d.mts +1 -0
- package/dist/esm/api/types/CreditBalance.d.mts +6 -0
- package/dist/esm/api/types/CreditBenefitInput.d.mts +30 -0
- package/dist/esm/api/types/CreditBenefitInput.mjs +17 -0
- package/dist/esm/api/types/CreditBenefitOutput.d.mts +13 -0
- package/dist/esm/api/types/CreditBenefitOutput.mjs +2 -0
- package/dist/esm/api/types/CreditGrant.d.mts +11 -0
- package/dist/esm/api/types/CreditGrant.mjs +2 -0
- package/dist/esm/api/types/CustomerUser.d.mts +13 -0
- package/dist/esm/api/types/CustomerUser.mjs +2 -0
- package/dist/esm/api/types/CustomerUserStatus.d.mts +5 -0
- package/dist/esm/api/types/CustomerUserStatus.mjs +5 -0
- package/dist/esm/api/types/OneTimePerUnitInput.d.mts +21 -0
- package/dist/esm/api/types/OneTimePerUnitInput.mjs +15 -0
- package/dist/esm/api/types/Order.d.mts +2 -0
- package/dist/esm/api/types/OrderBillingFrequencyOverride.d.mts +14 -0
- package/dist/esm/api/types/OrderBillingFrequencyOverride.mjs +11 -0
- package/dist/esm/api/types/OrderSeat.d.mts +10 -0
- package/dist/esm/api/types/OrderSeat.mjs +2 -0
- package/dist/esm/api/types/OrderSeatListResponse.d.mts +5 -0
- package/dist/esm/api/types/OrderSeatListResponse.mjs +2 -0
- package/dist/esm/api/types/PrecomputedCost.d.mts +17 -0
- package/dist/esm/api/types/PrecomputedCost.mjs +2 -0
- package/dist/esm/api/types/PricingInput.d.mts +46 -0
- package/dist/esm/api/types/PricingInput.mjs +2 -0
- package/dist/esm/api/types/PricingListResponse.d.mts +4 -0
- package/dist/esm/api/types/PricingListResponse.mjs +2 -0
- package/dist/esm/api/types/PricingOutput.d.mts +36 -0
- package/dist/esm/api/types/PricingOutput.mjs +20 -0
- package/dist/esm/api/types/PricingPricePointOutput.d.mts +29 -0
- package/dist/esm/api/types/PricingPricePointOutput.mjs +14 -0
- package/dist/esm/api/types/PricingResponse.d.mts +7 -0
- package/dist/esm/api/types/PricingResponse.mjs +2 -0
- package/dist/esm/api/types/ProductAttribution.d.mts +2 -0
- package/dist/esm/api/types/ProductAttribution.mjs +2 -0
- package/dist/esm/api/types/RecurringGraduatedInput.d.mts +22 -0
- package/dist/esm/api/types/RecurringGraduatedInput.mjs +15 -0
- package/dist/esm/api/types/RecurringPerUnitInput.d.mts +22 -0
- package/dist/esm/api/types/RecurringPerUnitInput.mjs +15 -0
- package/dist/esm/api/types/RecurringPercentOfTotalInput.d.mts +23 -0
- package/dist/esm/api/types/RecurringPercentOfTotalInput.mjs +15 -0
- package/dist/esm/api/types/RecurringVolumeInput.d.mts +22 -0
- package/dist/esm/api/types/RecurringVolumeInput.mjs +15 -0
- package/dist/esm/api/types/SeatAssignee.d.mts +5 -0
- package/dist/esm/api/types/SeatAssignee.mjs +2 -0
- package/dist/esm/api/types/SeatAssignmentStatus.d.mts +5 -0
- package/dist/esm/api/types/SeatAssignmentStatus.mjs +5 -0
- package/dist/esm/api/types/SeatBasedGraduatedInput.d.mts +22 -0
- package/dist/esm/api/types/SeatBasedGraduatedInput.mjs +15 -0
- package/dist/esm/api/types/SeatBasedPerUnitInput.d.mts +22 -0
- package/dist/esm/api/types/SeatBasedPerUnitInput.mjs +15 -0
- package/dist/esm/api/types/SeatBasedPrepaidCreditsInput.d.mts +25 -0
- package/dist/esm/api/types/SeatBasedPrepaidCreditsInput.mjs +15 -0
- package/dist/esm/api/types/SeatBasedVolumeInput.d.mts +22 -0
- package/dist/esm/api/types/SeatBasedVolumeInput.mjs +15 -0
- package/dist/esm/api/types/SimplePricePoint.d.mts +29 -0
- package/dist/esm/api/types/SimplePricePoint.mjs +14 -0
- package/dist/esm/api/types/SuccessResponse.d.mts +3 -0
- package/dist/esm/api/types/SuccessResponse.mjs +2 -0
- package/dist/esm/api/types/TieredPricePoint.d.mts +29 -0
- package/dist/esm/api/types/TieredPricePoint.mjs +14 -0
- package/dist/esm/api/types/TokenUsage.d.mts +12 -0
- package/dist/esm/api/types/TokenUsage.mjs +2 -0
- package/dist/esm/api/types/UsageCost.d.mts +15 -0
- package/dist/esm/api/types/UsageCost.mjs +2 -0
- package/dist/esm/api/types/UsageCostPlusInput.d.mts +23 -0
- package/dist/esm/api/types/UsageCostPlusInput.mjs +15 -0
- package/dist/esm/api/types/UsageGraduatedInput.d.mts +23 -0
- package/dist/esm/api/types/UsageGraduatedInput.mjs +15 -0
- package/dist/esm/api/types/UsagePerUnitInput.d.mts +23 -0
- package/dist/esm/api/types/UsagePerUnitInput.mjs +15 -0
- package/dist/esm/api/types/UsagePrepaidCreditsInput.d.mts +26 -0
- package/dist/esm/api/types/UsagePrepaidCreditsInput.mjs +15 -0
- package/dist/esm/api/types/UsageVolumeInput.d.mts +23 -0
- package/dist/esm/api/types/UsageVolumeInput.mjs +15 -0
- package/dist/esm/api/types/ValueReceiptDetail.d.mts +2 -0
- package/dist/esm/api/types/ValueReceiptSummary.d.mts +2 -0
- package/dist/esm/api/types/ValueReceiptSyncResponse.d.mts +6 -0
- package/dist/esm/api/types/ValueReceiptSyncResponse.mjs +2 -0
- package/dist/esm/api/types/Webhook.d.mts +24 -0
- package/dist/esm/api/types/Webhook.mjs +15 -0
- package/dist/esm/api/types/WebhookDeliveryStatus.d.mts +5 -0
- package/dist/esm/api/types/WebhookDeliveryStatus.mjs +5 -0
- package/dist/esm/api/types/WebhookListResponse.d.mts +4 -0
- package/dist/esm/api/types/WebhookListResponse.mjs +2 -0
- package/dist/esm/api/types/WebhookTestResponse.d.mts +3 -0
- package/dist/esm/api/types/WebhookTestResponse.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +46 -0
- package/dist/esm/api/types/index.mjs +46 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +1159 -105
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
23
|
+
import * as core from "../../../../core/index.mjs";
|
|
24
|
+
import * as environments from "../../../../environments.mjs";
|
|
25
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
26
|
+
import * as Paid from "../../../index.mjs";
|
|
27
|
+
export class Webhooks {
|
|
28
|
+
constructor(_options) {
|
|
29
|
+
this._options = _options;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* List customer-facing billing webhooks for the authenticated organization.
|
|
33
|
+
*
|
|
34
|
+
* @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
|
+
*
|
|
36
|
+
* @throws {@link Paid.ForbiddenError}
|
|
37
|
+
* @throws {@link Paid.InternalServerError}
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* await client.webhooks.listWebhooks()
|
|
41
|
+
*/
|
|
42
|
+
listWebhooks(requestOptions) {
|
|
43
|
+
return core.HttpResponsePromise.fromPromise(this.__listWebhooks(requestOptions));
|
|
44
|
+
}
|
|
45
|
+
__listWebhooks(requestOptions) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
48
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
49
|
+
const _response = yield core.fetcher({
|
|
50
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, "webhooks/"),
|
|
51
|
+
method: "GET",
|
|
52
|
+
headers: _headers,
|
|
53
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
54
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
55
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
56
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
57
|
+
});
|
|
58
|
+
if (_response.ok) {
|
|
59
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
60
|
+
}
|
|
61
|
+
if (_response.error.reason === "status-code") {
|
|
62
|
+
switch (_response.error.statusCode) {
|
|
63
|
+
case 403:
|
|
64
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
65
|
+
case 500:
|
|
66
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
67
|
+
default:
|
|
68
|
+
throw new errors.PaidError({
|
|
69
|
+
statusCode: _response.error.statusCode,
|
|
70
|
+
body: _response.error.body,
|
|
71
|
+
rawResponse: _response.rawResponse,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
switch (_response.error.reason) {
|
|
76
|
+
case "non-json":
|
|
77
|
+
throw new errors.PaidError({
|
|
78
|
+
statusCode: _response.error.statusCode,
|
|
79
|
+
body: _response.error.rawBody,
|
|
80
|
+
rawResponse: _response.rawResponse,
|
|
81
|
+
});
|
|
82
|
+
case "timeout":
|
|
83
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /webhooks/.");
|
|
84
|
+
case "unknown":
|
|
85
|
+
throw new errors.PaidError({
|
|
86
|
+
message: _response.error.errorMessage,
|
|
87
|
+
rawResponse: _response.rawResponse,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Enable or disable a webhook and configure the destination URL for the authenticated organization.
|
|
94
|
+
*
|
|
95
|
+
* @param {Paid.UpdateWebhookRequest} request
|
|
96
|
+
* @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
|
|
97
|
+
*
|
|
98
|
+
* @throws {@link Paid.BadRequestError}
|
|
99
|
+
* @throws {@link Paid.ForbiddenError}
|
|
100
|
+
* @throws {@link Paid.NotFoundError}
|
|
101
|
+
* @throws {@link Paid.InternalServerError}
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* await client.webhooks.updateWebhook({
|
|
105
|
+
* webhookName: "billing-invoice-created"
|
|
106
|
+
* })
|
|
107
|
+
*/
|
|
108
|
+
updateWebhook(request, requestOptions) {
|
|
109
|
+
return core.HttpResponsePromise.fromPromise(this.__updateWebhook(request, requestOptions));
|
|
110
|
+
}
|
|
111
|
+
__updateWebhook(request, requestOptions) {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
114
|
+
const { webhookName } = request, _body = __rest(request, ["webhookName"]);
|
|
115
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
116
|
+
const _response = yield core.fetcher({
|
|
117
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `webhooks/${core.url.encodePathParam(webhookName)}`),
|
|
118
|
+
method: "PATCH",
|
|
119
|
+
headers: _headers,
|
|
120
|
+
contentType: "application/json",
|
|
121
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
122
|
+
requestType: "json",
|
|
123
|
+
body: _body,
|
|
124
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
125
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
126
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
127
|
+
});
|
|
128
|
+
if (_response.ok) {
|
|
129
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
130
|
+
}
|
|
131
|
+
if (_response.error.reason === "status-code") {
|
|
132
|
+
switch (_response.error.statusCode) {
|
|
133
|
+
case 400:
|
|
134
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
135
|
+
case 403:
|
|
136
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
137
|
+
case 404:
|
|
138
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
139
|
+
case 500:
|
|
140
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
141
|
+
default:
|
|
142
|
+
throw new errors.PaidError({
|
|
143
|
+
statusCode: _response.error.statusCode,
|
|
144
|
+
body: _response.error.body,
|
|
145
|
+
rawResponse: _response.rawResponse,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
switch (_response.error.reason) {
|
|
150
|
+
case "non-json":
|
|
151
|
+
throw new errors.PaidError({
|
|
152
|
+
statusCode: _response.error.statusCode,
|
|
153
|
+
body: _response.error.rawBody,
|
|
154
|
+
rawResponse: _response.rawResponse,
|
|
155
|
+
});
|
|
156
|
+
case "timeout":
|
|
157
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling PATCH /webhooks/{webhookName}.");
|
|
158
|
+
case "unknown":
|
|
159
|
+
throw new errors.PaidError({
|
|
160
|
+
message: _response.error.errorMessage,
|
|
161
|
+
rawResponse: _response.rawResponse,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Send a synthetic webhook delivery to the configured destination for this webhook.
|
|
168
|
+
*
|
|
169
|
+
* @param {Paid.TestWebhookRequest} request
|
|
170
|
+
* @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration.
|
|
171
|
+
*
|
|
172
|
+
* @throws {@link Paid.BadRequestError}
|
|
173
|
+
* @throws {@link Paid.ForbiddenError}
|
|
174
|
+
* @throws {@link Paid.NotFoundError}
|
|
175
|
+
* @throws {@link Paid.InternalServerError}
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* await client.webhooks.testWebhook({
|
|
179
|
+
* webhookName: "billing-invoice-created"
|
|
180
|
+
* })
|
|
181
|
+
*/
|
|
182
|
+
testWebhook(request, requestOptions) {
|
|
183
|
+
return core.HttpResponsePromise.fromPromise(this.__testWebhook(request, requestOptions));
|
|
184
|
+
}
|
|
185
|
+
__testWebhook(request, requestOptions) {
|
|
186
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
188
|
+
const { webhookName } = request, _body = __rest(request, ["webhookName"]);
|
|
189
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
190
|
+
const _response = yield core.fetcher({
|
|
191
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `webhooks/${core.url.encodePathParam(webhookName)}/test`),
|
|
192
|
+
method: "POST",
|
|
193
|
+
headers: _headers,
|
|
194
|
+
contentType: "application/json",
|
|
195
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
196
|
+
requestType: "json",
|
|
197
|
+
body: _body,
|
|
198
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
199
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
200
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
201
|
+
});
|
|
202
|
+
if (_response.ok) {
|
|
203
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
204
|
+
}
|
|
205
|
+
if (_response.error.reason === "status-code") {
|
|
206
|
+
switch (_response.error.statusCode) {
|
|
207
|
+
case 400:
|
|
208
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
209
|
+
case 403:
|
|
210
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
211
|
+
case 404:
|
|
212
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
213
|
+
case 500:
|
|
214
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
215
|
+
default:
|
|
216
|
+
throw new errors.PaidError({
|
|
217
|
+
statusCode: _response.error.statusCode,
|
|
218
|
+
body: _response.error.body,
|
|
219
|
+
rawResponse: _response.rawResponse,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
switch (_response.error.reason) {
|
|
224
|
+
case "non-json":
|
|
225
|
+
throw new errors.PaidError({
|
|
226
|
+
statusCode: _response.error.statusCode,
|
|
227
|
+
body: _response.error.rawBody,
|
|
228
|
+
rawResponse: _response.rawResponse,
|
|
229
|
+
});
|
|
230
|
+
case "timeout":
|
|
231
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /webhooks/{webhookName}/test.");
|
|
232
|
+
case "unknown":
|
|
233
|
+
throw new errors.PaidError({
|
|
234
|
+
message: _response.error.errorMessage,
|
|
235
|
+
rawResponse: _response.rawResponse,
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
_getAuthorizationHeader() {
|
|
241
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
242
|
+
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as Paid from "../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* webhookName: "billing-invoice-created"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface UpdateWebhookRequest {
|
|
9
|
+
webhookName: Paid.UpdateWebhookRequestWebhookName;
|
|
10
|
+
/** Whether the webhook is enabled for delivery. */
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
/** The HTTPS endpoint Paid should deliver this webhook to. Set to null to clear it while disabled. */
|
|
13
|
+
url?: string | null;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const TestWebhookRequestWebhookName: {
|
|
2
|
+
readonly BillingInvoiceCreated: "billing-invoice-created";
|
|
3
|
+
readonly BillingInvoicePaid: "billing-invoice-paid";
|
|
4
|
+
readonly BillingCheckoutCreated: "billing-checkout-created";
|
|
5
|
+
readonly BillingCheckoutCompleted: "billing-checkout-completed";
|
|
6
|
+
readonly BillingCheckoutExpired: "billing-checkout-expired";
|
|
7
|
+
readonly BillingPaymentSucceeded: "billing-payment-succeeded";
|
|
8
|
+
readonly BillingPaymentFailed: "billing-payment-failed";
|
|
9
|
+
readonly BillingCreditsDepleted: "billing-credits-depleted";
|
|
10
|
+
readonly BillingOverageIncurred: "billing-overage-incurred";
|
|
11
|
+
};
|
|
12
|
+
export type TestWebhookRequestWebhookName = (typeof TestWebhookRequestWebhookName)[keyof typeof TestWebhookRequestWebhookName];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export const TestWebhookRequestWebhookName = {
|
|
3
|
+
BillingInvoiceCreated: "billing-invoice-created",
|
|
4
|
+
BillingInvoicePaid: "billing-invoice-paid",
|
|
5
|
+
BillingCheckoutCreated: "billing-checkout-created",
|
|
6
|
+
BillingCheckoutCompleted: "billing-checkout-completed",
|
|
7
|
+
BillingCheckoutExpired: "billing-checkout-expired",
|
|
8
|
+
BillingPaymentSucceeded: "billing-payment-succeeded",
|
|
9
|
+
BillingPaymentFailed: "billing-payment-failed",
|
|
10
|
+
BillingCreditsDepleted: "billing-credits-depleted",
|
|
11
|
+
BillingOverageIncurred: "billing-overage-incurred",
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const UpdateWebhookRequestWebhookName: {
|
|
2
|
+
readonly BillingInvoiceCreated: "billing-invoice-created";
|
|
3
|
+
readonly BillingInvoicePaid: "billing-invoice-paid";
|
|
4
|
+
readonly BillingCheckoutCreated: "billing-checkout-created";
|
|
5
|
+
readonly BillingCheckoutCompleted: "billing-checkout-completed";
|
|
6
|
+
readonly BillingCheckoutExpired: "billing-checkout-expired";
|
|
7
|
+
readonly BillingPaymentSucceeded: "billing-payment-succeeded";
|
|
8
|
+
readonly BillingPaymentFailed: "billing-payment-failed";
|
|
9
|
+
readonly BillingCreditsDepleted: "billing-credits-depleted";
|
|
10
|
+
readonly BillingOverageIncurred: "billing-overage-incurred";
|
|
11
|
+
};
|
|
12
|
+
export type UpdateWebhookRequestWebhookName = (typeof UpdateWebhookRequestWebhookName)[keyof typeof UpdateWebhookRequestWebhookName];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export const UpdateWebhookRequestWebhookName = {
|
|
3
|
+
BillingInvoiceCreated: "billing-invoice-created",
|
|
4
|
+
BillingInvoicePaid: "billing-invoice-paid",
|
|
5
|
+
BillingCheckoutCreated: "billing-checkout-created",
|
|
6
|
+
BillingCheckoutCompleted: "billing-checkout-completed",
|
|
7
|
+
BillingCheckoutExpired: "billing-checkout-expired",
|
|
8
|
+
BillingPaymentSucceeded: "billing-payment-succeeded",
|
|
9
|
+
BillingPaymentFailed: "billing-payment-failed",
|
|
10
|
+
BillingCreditsDepleted: "billing-credits-depleted",
|
|
11
|
+
BillingOverageIncurred: "billing-overage-incurred",
|
|
12
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type * as Paid from "../index.mjs";
|
|
2
|
+
export interface CheckoutDetails {
|
|
3
|
+
id: string;
|
|
4
|
+
url: string;
|
|
5
|
+
status: Paid.CheckoutStatus;
|
|
6
|
+
products: Paid.CheckoutProduct[];
|
|
7
|
+
customerId: string | null;
|
|
8
|
+
externalCustomerId: string | null;
|
|
9
|
+
successUrl: string;
|
|
10
|
+
cancelUrl: string | null;
|
|
11
|
+
expiresAt: string | null;
|
|
12
|
+
metadata: Record<string, unknown> | null;
|
|
13
|
+
collectAddress: boolean;
|
|
14
|
+
collectPhone: boolean;
|
|
15
|
+
singleUse: boolean;
|
|
16
|
+
allowedCurrencies: string[];
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
/** The resulting order ID once checkout has completed. Null until an order is created. */
|
|
20
|
+
orderId: string | null;
|
|
21
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Paid from "../index.mjs";
|
|
2
|
+
export type Cost = Paid.Cost.Cost | Paid.Cost.Usage;
|
|
3
|
+
export declare namespace Cost {
|
|
4
|
+
interface Cost extends Paid.PrecomputedCost {
|
|
5
|
+
type: "cost";
|
|
6
|
+
}
|
|
7
|
+
interface Usage extends Paid.UsageCost {
|
|
8
|
+
type: "usage";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
+
import type * as Paid from "../index.mjs";
|
|
1
2
|
export interface CreditBalance {
|
|
2
3
|
creditsCurrencyId: string;
|
|
3
4
|
currencyName: string;
|
|
4
5
|
currencyKey: string;
|
|
6
|
+
/** Effective spendable balance across all grants in this pool, rollover-capped during rollover windows. Equals sum(grants[].available). */
|
|
5
7
|
available: number;
|
|
6
8
|
used: number;
|
|
7
9
|
total: number;
|
|
10
|
+
/** Aggregate min(periodStart) across grants in this pool. Does not correspond to any real billing period when grants overlap. Use grants[].periodStart instead. Will be removed in a future API version. */
|
|
8
11
|
periodStart: string | null;
|
|
12
|
+
/** Aggregate max(periodEnd) across grants in this pool. Does not correspond to any real billing period when grants overlap. Use grants[].periodEnd or grants[].expiresAt instead. Will be removed in a future API version. */
|
|
9
13
|
periodEnd: string | null;
|
|
14
|
+
/** Aggregate max(rolloverEndDate) across grants in this pool. Use grants[].rolloverEndDate or grants[].expiresAt instead. Will be removed in a future API version. */
|
|
10
15
|
rolloverEndDate: string | null;
|
|
11
16
|
recipient: CreditBalance.Recipient;
|
|
17
|
+
grants: Paid.CreditGrant[];
|
|
12
18
|
}
|
|
13
19
|
export declare namespace CreditBalance {
|
|
14
20
|
const Recipient: {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface CreditBenefitInput {
|
|
2
|
+
creditsCurrencyId: string;
|
|
3
|
+
amount: number;
|
|
4
|
+
recipient?: CreditBenefitInput.Recipient;
|
|
5
|
+
isInfiniteTotal?: boolean;
|
|
6
|
+
allocationCadence?: CreditBenefitInput.AllocationCadence;
|
|
7
|
+
creditGrantTiming?: CreditBenefitInput.CreditGrantTiming;
|
|
8
|
+
overageUnitPrice?: number;
|
|
9
|
+
rolloverAmount?: number;
|
|
10
|
+
rolloverDuration?: number;
|
|
11
|
+
rolloverDurationUnit?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare namespace CreditBenefitInput {
|
|
14
|
+
const Recipient: {
|
|
15
|
+
readonly Organization: "organization";
|
|
16
|
+
readonly Seat: "seat";
|
|
17
|
+
};
|
|
18
|
+
type Recipient = (typeof Recipient)[keyof typeof Recipient];
|
|
19
|
+
const AllocationCadence: {
|
|
20
|
+
readonly Upfront: "upfront";
|
|
21
|
+
readonly Monthly: "monthly";
|
|
22
|
+
};
|
|
23
|
+
type AllocationCadence = (typeof AllocationCadence)[keyof typeof AllocationCadence];
|
|
24
|
+
const CreditGrantTiming: {
|
|
25
|
+
readonly OnOrderActivation: "on_order_activation";
|
|
26
|
+
readonly OnPayment: "on_payment";
|
|
27
|
+
readonly OnInvoicePosted: "on_invoice_posted";
|
|
28
|
+
};
|
|
29
|
+
type CreditGrantTiming = (typeof CreditGrantTiming)[keyof typeof CreditGrantTiming];
|
|
30
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var CreditBenefitInput;
|
|
3
|
+
(function (CreditBenefitInput) {
|
|
4
|
+
CreditBenefitInput.Recipient = {
|
|
5
|
+
Organization: "organization",
|
|
6
|
+
Seat: "seat",
|
|
7
|
+
};
|
|
8
|
+
CreditBenefitInput.AllocationCadence = {
|
|
9
|
+
Upfront: "upfront",
|
|
10
|
+
Monthly: "monthly",
|
|
11
|
+
};
|
|
12
|
+
CreditBenefitInput.CreditGrantTiming = {
|
|
13
|
+
OnOrderActivation: "on_order_activation",
|
|
14
|
+
OnPayment: "on_payment",
|
|
15
|
+
OnInvoicePosted: "on_invoice_posted",
|
|
16
|
+
};
|
|
17
|
+
})(CreditBenefitInput || (CreditBenefitInput = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface CreditBenefitOutput {
|
|
2
|
+
id: string;
|
|
3
|
+
creditsCurrencyId: string;
|
|
4
|
+
amount: number;
|
|
5
|
+
recipient: string;
|
|
6
|
+
isInfiniteTotal: boolean;
|
|
7
|
+
allocationCadence: string;
|
|
8
|
+
creditGrantTiming?: string;
|
|
9
|
+
overageUnitPrice?: number;
|
|
10
|
+
rolloverAmount?: number;
|
|
11
|
+
rolloverDuration?: number;
|
|
12
|
+
rolloverDurationUnit?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface CreditGrant {
|
|
2
|
+
available: number;
|
|
3
|
+
used: number;
|
|
4
|
+
total: number;
|
|
5
|
+
rolloverAmount: number | null;
|
|
6
|
+
periodStart: string;
|
|
7
|
+
periodEnd: string | null;
|
|
8
|
+
rolloverEndDate: string | null;
|
|
9
|
+
expiresAt: string | null;
|
|
10
|
+
isInRolloverWindow: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as Paid from "../index.mjs";
|
|
2
|
+
export interface CustomerUser {
|
|
3
|
+
id: string;
|
|
4
|
+
externalId: string;
|
|
5
|
+
customerExternalId: string;
|
|
6
|
+
name: string | null;
|
|
7
|
+
email: string | null;
|
|
8
|
+
metadata: Record<string, unknown> | null;
|
|
9
|
+
status: Paid.CustomerUserStatus;
|
|
10
|
+
created: boolean;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type * as Paid from "../index.mjs";
|
|
2
|
+
export interface OneTimePerUnitInput {
|
|
3
|
+
feeType?: OneTimePerUnitInput.FeeType;
|
|
4
|
+
billingType?: OneTimePerUnitInput.BillingType;
|
|
5
|
+
pricePoints: Paid.SimplePricePoint[];
|
|
6
|
+
}
|
|
7
|
+
export declare namespace OneTimePerUnitInput {
|
|
8
|
+
const FeeType: {
|
|
9
|
+
readonly Setup: "setup";
|
|
10
|
+
readonly Onboarding: "onboarding";
|
|
11
|
+
readonly Implementation: "implementation";
|
|
12
|
+
readonly Migration: "migration";
|
|
13
|
+
readonly Custom: "custom";
|
|
14
|
+
};
|
|
15
|
+
type FeeType = (typeof FeeType)[keyof typeof FeeType];
|
|
16
|
+
const BillingType: {
|
|
17
|
+
readonly Advance: "Advance";
|
|
18
|
+
readonly Arrears: "Arrears";
|
|
19
|
+
};
|
|
20
|
+
type BillingType = (typeof BillingType)[keyof typeof BillingType];
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var OneTimePerUnitInput;
|
|
3
|
+
(function (OneTimePerUnitInput) {
|
|
4
|
+
OneTimePerUnitInput.FeeType = {
|
|
5
|
+
Setup: "setup",
|
|
6
|
+
Onboarding: "onboarding",
|
|
7
|
+
Implementation: "implementation",
|
|
8
|
+
Migration: "migration",
|
|
9
|
+
Custom: "custom",
|
|
10
|
+
};
|
|
11
|
+
OneTimePerUnitInput.BillingType = {
|
|
12
|
+
Advance: "Advance",
|
|
13
|
+
Arrears: "Arrears",
|
|
14
|
+
};
|
|
15
|
+
})(OneTimePerUnitInput || (OneTimePerUnitInput = {}));
|