@tirdad/sdk 2.1.46 → 2.1.48
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/esm/funcs/commitments-get-commitment-billing-terms.d.ts +17 -0
- package/esm/funcs/commitments-get-commitment-billing-terms.d.ts.map +1 -0
- package/esm/funcs/commitments-get-commitment-billing-terms.js +91 -0
- package/esm/funcs/commitments-get-commitment-billing-terms.js.map +1 -0
- package/esm/funcs/commitments-list-commitment-instalments.d.ts +17 -0
- package/esm/funcs/commitments-list-commitment-instalments.d.ts.map +1 -0
- package/esm/funcs/commitments-list-commitment-instalments.js +96 -0
- package/esm/funcs/commitments-list-commitment-instalments.js.map +1 -0
- package/esm/funcs/commitments-preview-commitment-billing-terms.d.ts +17 -0
- package/esm/funcs/commitments-preview-commitment-billing-terms.d.ts.map +1 -0
- package/esm/funcs/commitments-preview-commitment-billing-terms.js +93 -0
- package/esm/funcs/commitments-preview-commitment-billing-terms.js.map +1 -0
- package/esm/funcs/commitments-replace-commitment-billing-terms.d.ts +17 -0
- package/esm/funcs/commitments-replace-commitment-billing-terms.d.ts.map +1 -0
- package/esm/funcs/commitments-replace-commitment-billing-terms.js +93 -0
- package/esm/funcs/commitments-replace-commitment-billing-terms.js.map +1 -0
- package/esm/funcs/commitments-terminate-commitment.d.ts +1 -1
- package/esm/funcs/commitments-terminate-commitment.js +1 -1
- package/esm/funcs/commitments-trigger-commitment-instalment.d.ts +17 -0
- package/esm/funcs/commitments-trigger-commitment-instalment.d.ts.map +1 -0
- package/esm/funcs/commitments-trigger-commitment-instalment.js +98 -0
- package/esm/funcs/commitments-trigger-commitment-instalment.js.map +1 -0
- package/esm/funcs/events-get-usage-analytics.d.ts +5 -0
- package/esm/funcs/events-get-usage-analytics.d.ts.map +1 -1
- package/esm/funcs/events-get-usage-analytics.js +5 -0
- package/esm/funcs/events-get-usage-analytics.js.map +1 -1
- package/esm/funcs/prices-get-price-history.d.ts +17 -0
- package/esm/funcs/prices-get-price-history.d.ts.map +1 -0
- package/esm/funcs/prices-get-price-history.js +91 -0
- package/esm/funcs/prices-get-price-history.js.map +1 -0
- package/esm/funcs/subscriptions-get-subscription-line-item-history.d.ts +17 -0
- package/esm/funcs/subscriptions-get-subscription-line-item-history.d.ts.map +1 -0
- package/esm/funcs/subscriptions-get-subscription-line-item-history.js +91 -0
- package/esm/funcs/subscriptions-get-subscription-line-item-history.js.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-cancelled.d.ts +17 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-cancelled.d.ts.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-cancelled.js +69 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-cancelled.js.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-created.d.ts +17 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-created.d.ts.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-created.js +69 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-created.js.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-invoiced.d.ts +17 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-invoiced.d.ts.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-invoiced.js +69 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-invoiced.js.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-updated.d.ts +17 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-updated.d.ts.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-updated.js +69 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-instalment-updated.js.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-terms-created.d.ts +17 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-terms-created.d.ts.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-terms-created.js +69 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-terms-created.js.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-terms-updated.d.ts +17 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-terms-updated.d.ts.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-terms-updated.js +69 -0
- package/esm/funcs/webhook-events-post-webhook-events-billing-terms-updated.js.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-payment-attempt-failed.d.ts +17 -0
- package/esm/funcs/webhook-events-post-webhook-events-payment-attempt-failed.d.ts.map +1 -0
- package/esm/funcs/webhook-events-post-webhook-events-payment-attempt-failed.js +69 -0
- package/esm/funcs/webhook-events-post-webhook-events-payment-attempt-failed.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.d.ts.map +1 -1
- package/esm/lib/config.js +10 -2
- package/esm/lib/config.js.map +1 -1
- package/esm/sdk/commitments.d.ts +36 -1
- package/esm/sdk/commitments.d.ts.map +1 -1
- package/esm/sdk/commitments.js +51 -1
- package/esm/sdk/commitments.js.map +1 -1
- package/esm/sdk/events.d.ts +5 -0
- package/esm/sdk/events.d.ts.map +1 -1
- package/esm/sdk/events.js +5 -0
- package/esm/sdk/events.js.map +1 -1
- package/esm/sdk/models/billing-term-input.d.ts +67 -0
- package/esm/sdk/models/billing-term-input.d.ts.map +1 -0
- package/esm/sdk/models/billing-term-input.js +43 -0
- package/esm/sdk/models/billing-term-input.js.map +1 -0
- package/esm/sdk/models/billing-term-kind.d.ts +12 -0
- package/esm/sdk/models/billing-term-kind.d.ts.map +1 -0
- package/esm/sdk/models/billing-term-kind.js +13 -0
- package/esm/sdk/models/billing-term-kind.js.map +1 -0
- package/esm/sdk/models/billing-term-owner-type.d.ts +9 -0
- package/esm/sdk/models/billing-term-owner-type.d.ts.map +1 -0
- package/esm/sdk/models/billing-term-owner-type.js +10 -0
- package/esm/sdk/models/billing-term-owner-type.js.map +1 -0
- package/esm/sdk/models/billing-term-split.d.ts +12 -0
- package/esm/sdk/models/billing-term-split.d.ts.map +1 -0
- package/esm/sdk/models/billing-term-split.js +13 -0
- package/esm/sdk/models/billing-term-split.js.map +1 -0
- package/esm/sdk/models/billing-term-value-type.d.ts +19 -0
- package/esm/sdk/models/billing-term-value-type.d.ts.map +1 -0
- package/esm/sdk/models/billing-term-value-type.js +17 -0
- package/esm/sdk/models/billing-term-value-type.js.map +1 -0
- package/esm/sdk/models/billing-terms-response.d.ts +13 -0
- package/esm/sdk/models/billing-terms-response.d.ts.map +1 -0
- package/esm/sdk/models/billing-terms-response.js +22 -0
- package/esm/sdk/models/billing-terms-response.js.map +1 -0
- package/esm/sdk/models/billingterm-instalment.d.ts +43 -0
- package/esm/sdk/models/billingterm-instalment.d.ts.map +1 -0
- package/esm/sdk/models/billingterm-instalment.js +68 -0
- package/esm/sdk/models/billingterm-instalment.js.map +1 -0
- package/esm/sdk/models/billingterm-term.d.ts +57 -0
- package/esm/sdk/models/billingterm-term.d.ts.map +1 -0
- package/esm/sdk/models/billingterm-term.js +65 -0
- package/esm/sdk/models/billingterm-term.js.map +1 -0
- package/esm/sdk/models/cancellation-fee-input.d.ts +18 -0
- package/esm/sdk/models/cancellation-fee-input.d.ts.map +1 -0
- package/esm/sdk/models/cancellation-fee-input.js +14 -0
- package/esm/sdk/models/cancellation-fee-input.js.map +1 -0
- package/esm/sdk/models/cancellation-fee-type.d.ts +16 -0
- package/esm/sdk/models/cancellation-fee-type.d.ts.map +1 -0
- package/esm/sdk/models/cancellation-fee-type.js +14 -0
- package/esm/sdk/models/cancellation-fee-type.js.map +1 -0
- package/esm/sdk/models/commitment-response.d.ts +9 -1
- package/esm/sdk/models/commitment-response.d.ts.map +1 -1
- package/esm/sdk/models/commitment-response.js +7 -1
- package/esm/sdk/models/commitment-response.js.map +1 -1
- package/esm/sdk/models/create-commitment-request.d.ts +12 -0
- package/esm/sdk/models/create-commitment-request.d.ts.map +1 -1
- package/esm/sdk/models/create-commitment-request.js +6 -0
- package/esm/sdk/models/create-commitment-request.js.map +1 -1
- package/esm/sdk/models/get-commitment-billing-terms-op.d.ts +15 -0
- package/esm/sdk/models/get-commitment-billing-terms-op.d.ts.map +1 -0
- package/esm/sdk/models/get-commitment-billing-terms-op.js +12 -0
- package/esm/sdk/models/get-commitment-billing-terms-op.js.map +1 -0
- package/esm/sdk/models/get-price-history-op.d.ts +15 -0
- package/esm/sdk/models/get-price-history-op.d.ts.map +1 -0
- package/esm/sdk/models/get-price-history-op.js +12 -0
- package/esm/sdk/models/get-price-history-op.js.map +1 -0
- package/esm/sdk/models/get-subscription-line-item-history-op.d.ts +15 -0
- package/esm/sdk/models/get-subscription-line-item-history-op.d.ts.map +1 -0
- package/esm/sdk/models/get-subscription-line-item-history-op.js +12 -0
- package/esm/sdk/models/get-subscription-line-item-history-op.js.map +1 -0
- package/esm/sdk/models/get-subscription-v2-op.d.ts +1 -1
- package/esm/sdk/models/grouped-invoicing-child-request.d.ts +3 -0
- package/esm/sdk/models/grouped-invoicing-child-request.d.ts.map +1 -1
- package/esm/sdk/models/grouped-invoicing-child-request.js +3 -0
- package/esm/sdk/models/grouped-invoicing-child-request.js.map +1 -1
- package/esm/sdk/models/index.d.ts +28 -0
- package/esm/sdk/models/index.d.ts.map +1 -1
- package/esm/sdk/models/index.js +28 -0
- package/esm/sdk/models/index.js.map +1 -1
- package/esm/sdk/models/instalment-bill-trigger.d.ts +12 -0
- package/esm/sdk/models/instalment-bill-trigger.d.ts.map +1 -0
- package/esm/sdk/models/instalment-bill-trigger.js +13 -0
- package/esm/sdk/models/instalment-bill-trigger.js.map +1 -0
- package/esm/sdk/models/instalment-delivery.d.ts +12 -0
- package/esm/sdk/models/instalment-delivery.d.ts.map +1 -0
- package/esm/sdk/models/instalment-delivery.js +13 -0
- package/esm/sdk/models/instalment-delivery.js.map +1 -0
- package/esm/sdk/models/instalment-kind.d.ts +10 -0
- package/esm/sdk/models/instalment-kind.d.ts.map +1 -0
- package/esm/sdk/models/instalment-kind.js +11 -0
- package/esm/sdk/models/instalment-kind.js.map +1 -0
- package/esm/sdk/models/instalment-status.d.ts +11 -0
- package/esm/sdk/models/instalment-status.d.ts.map +1 -0
- package/esm/sdk/models/instalment-status.js +12 -0
- package/esm/sdk/models/instalment-status.js.map +1 -0
- package/esm/sdk/models/invoice-billing-reason.d.ts +2 -0
- package/esm/sdk/models/invoice-billing-reason.d.ts.map +1 -1
- package/esm/sdk/models/invoice-billing-reason.js +2 -0
- package/esm/sdk/models/invoice-billing-reason.js.map +1 -1
- package/esm/sdk/models/invoice-line-item-response.d.ts +4 -0
- package/esm/sdk/models/invoice-line-item-response.d.ts.map +1 -1
- package/esm/sdk/models/invoice-line-item-response.js +2 -0
- package/esm/sdk/models/invoice-line-item-response.js.map +1 -1
- package/esm/sdk/models/list-commitment-instalments-op.d.ts +20 -0
- package/esm/sdk/models/list-commitment-instalments-op.d.ts.map +1 -0
- package/esm/sdk/models/list-commitment-instalments-op.js +13 -0
- package/esm/sdk/models/list-commitment-instalments-op.js.map +1 -0
- package/esm/sdk/models/list-instalments-response.d.ts +11 -0
- package/esm/sdk/models/list-instalments-response.d.ts.map +1 -0
- package/esm/sdk/models/list-instalments-response.js +15 -0
- package/esm/sdk/models/list-instalments-response.js.map +1 -0
- package/esm/sdk/models/payment-attempt-response.d.ts +1 -0
- package/esm/sdk/models/payment-attempt-response.d.ts.map +1 -1
- package/esm/sdk/models/payment-attempt-response.js +2 -0
- package/esm/sdk/models/payment-attempt-response.js.map +1 -1
- package/esm/sdk/models/preview-commitment-billing-terms-op.d.ts +21 -0
- package/esm/sdk/models/preview-commitment-billing-terms-op.d.ts.map +1 -0
- package/esm/sdk/models/preview-commitment-billing-terms-op.js +14 -0
- package/esm/sdk/models/preview-commitment-billing-terms-op.js.map +1 -0
- package/esm/sdk/models/replace-billing-terms-request.d.ts +13 -0
- package/esm/sdk/models/replace-billing-terms-request.d.ts.map +1 -0
- package/esm/sdk/models/replace-billing-terms-request.js +18 -0
- package/esm/sdk/models/replace-billing-terms-request.js.map +1 -0
- package/esm/sdk/models/replace-commitment-billing-terms-op.d.ts +21 -0
- package/esm/sdk/models/replace-commitment-billing-terms-op.d.ts.map +1 -0
- package/esm/sdk/models/replace-commitment-billing-terms-op.js +14 -0
- package/esm/sdk/models/replace-commitment-billing-terms-op.js.map +1 -0
- package/esm/sdk/models/subscription-response-v2.d.ts +5 -0
- package/esm/sdk/models/subscription-response-v2.d.ts.map +1 -1
- package/esm/sdk/models/subscription-response-v2.js +2 -0
- package/esm/sdk/models/subscription-response-v2.js.map +1 -1
- package/esm/sdk/models/subscription-response.d.ts +5 -0
- package/esm/sdk/models/subscription-response.d.ts.map +1 -1
- package/esm/sdk/models/subscription-response.js +2 -0
- package/esm/sdk/models/subscription-response.js.map +1 -1
- package/esm/sdk/models/terminate-commitment-request.d.ts +6 -2
- package/esm/sdk/models/terminate-commitment-request.d.ts.map +1 -1
- package/esm/sdk/models/terminate-commitment-request.js +2 -1
- package/esm/sdk/models/terminate-commitment-request.js.map +1 -1
- package/esm/sdk/models/trigger-commitment-instalment-op.d.ts +26 -0
- package/esm/sdk/models/trigger-commitment-instalment-op.d.ts.map +1 -0
- package/esm/sdk/models/trigger-commitment-instalment-op.js +20 -0
- package/esm/sdk/models/trigger-commitment-instalment-op.js.map +1 -0
- package/esm/sdk/models/trigger-instalment-request.d.ts +15 -0
- package/esm/sdk/models/trigger-instalment-request.d.ts.map +1 -0
- package/esm/sdk/models/trigger-instalment-request.js +17 -0
- package/esm/sdk/models/trigger-instalment-request.js.map +1 -0
- package/esm/sdk/models/update-commitment-request.d.ts +5 -0
- package/esm/sdk/models/update-commitment-request.d.ts.map +1 -1
- package/esm/sdk/models/update-commitment-request.js +2 -0
- package/esm/sdk/models/update-commitment-request.js.map +1 -1
- package/esm/sdk/models/update-subscription-request.d.ts +3 -0
- package/esm/sdk/models/update-subscription-request.d.ts.map +1 -1
- package/esm/sdk/models/update-subscription-request.js +3 -0
- package/esm/sdk/models/update-subscription-request.js.map +1 -1
- package/esm/sdk/models/webhook-dto-billing-instalment-webhook-payload.d.ts +13 -0
- package/esm/sdk/models/webhook-dto-billing-instalment-webhook-payload.d.ts.map +1 -0
- package/esm/sdk/models/webhook-dto-billing-instalment-webhook-payload.js +22 -0
- package/esm/sdk/models/webhook-dto-billing-instalment-webhook-payload.js.map +1 -0
- package/esm/sdk/models/webhook-dto-billing-terms-webhook-payload.d.ts +16 -0
- package/esm/sdk/models/webhook-dto-billing-terms-webhook-payload.d.ts.map +1 -0
- package/esm/sdk/models/webhook-dto-billing-terms-webhook-payload.js +28 -0
- package/esm/sdk/models/webhook-dto-billing-terms-webhook-payload.js.map +1 -0
- package/esm/sdk/models/webhook-dto-invoice-line-item.d.ts +1 -0
- package/esm/sdk/models/webhook-dto-invoice-line-item.d.ts.map +1 -1
- package/esm/sdk/models/webhook-dto-invoice-line-item.js +2 -0
- package/esm/sdk/models/webhook-dto-invoice-line-item.js.map +1 -1
- package/esm/sdk/models/webhook-dto-payment-attempt-webhook-payload.d.ts +17 -0
- package/esm/sdk/models/webhook-dto-payment-attempt-webhook-payload.d.ts.map +1 -0
- package/esm/sdk/models/webhook-dto-payment-attempt-webhook-payload.js +27 -0
- package/esm/sdk/models/webhook-dto-payment-attempt-webhook-payload.js.map +1 -0
- package/esm/sdk/models/webhook-dto-payment-attempt.d.ts +17 -0
- package/esm/sdk/models/webhook-dto-payment-attempt.d.ts.map +1 -0
- package/esm/sdk/models/webhook-dto-payment-attempt.js +27 -0
- package/esm/sdk/models/webhook-dto-payment-attempt.js.map +1 -0
- package/esm/sdk/models/webhook-event-name.d.ts +7 -0
- package/esm/sdk/models/webhook-event-name.d.ts.map +1 -1
- package/esm/sdk/models/webhook-event-name.js +7 -0
- package/esm/sdk/models/webhook-event-name.js.map +1 -1
- package/esm/sdk/prices.d.ts +7 -0
- package/esm/sdk/prices.d.ts.map +1 -1
- package/esm/sdk/prices.js +10 -0
- package/esm/sdk/prices.js.map +1 -1
- package/esm/sdk/subscriptions.d.ts +7 -0
- package/esm/sdk/subscriptions.d.ts.map +1 -1
- package/esm/sdk/subscriptions.js +10 -0
- package/esm/sdk/subscriptions.js.map +1 -1
- package/esm/sdk/webhook-events.d.ts +49 -0
- package/esm/sdk/webhook-events.d.ts.map +1 -1
- package/esm/sdk/webhook-events.js +70 -0
- package/esm/sdk/webhook-events.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/commitments-get-commitment-billing-terms.ts +182 -0
- package/src/funcs/commitments-list-commitment-instalments.ts +191 -0
- package/src/funcs/commitments-preview-commitment-billing-terms.ts +192 -0
- package/src/funcs/commitments-replace-commitment-billing-terms.ts +190 -0
- package/src/funcs/commitments-terminate-commitment.ts +1 -1
- package/src/funcs/commitments-trigger-commitment-instalment.ts +197 -0
- package/src/funcs/events-get-usage-analytics.ts +5 -0
- package/src/funcs/prices-get-price-history.ts +181 -0
- package/src/funcs/subscriptions-get-subscription-line-item-history.ts +185 -0
- package/src/funcs/webhook-events-post-webhook-events-billing-instalment-cancelled.ts +144 -0
- package/src/funcs/webhook-events-post-webhook-events-billing-instalment-created.ts +144 -0
- package/src/funcs/webhook-events-post-webhook-events-billing-instalment-invoiced.ts +144 -0
- package/src/funcs/webhook-events-post-webhook-events-billing-instalment-updated.ts +144 -0
- package/src/funcs/webhook-events-post-webhook-events-billing-terms-created.ts +144 -0
- package/src/funcs/webhook-events-post-webhook-events-billing-terms-updated.ts +144 -0
- package/src/funcs/webhook-events-post-webhook-events-payment-attempt-failed.ts +144 -0
- package/src/lib/config.ts +10 -2
- package/src/sdk/commitments.ts +101 -1
- package/src/sdk/events.ts +5 -0
- package/src/sdk/models/billing-term-input.ts +127 -0
- package/src/sdk/models/billing-term-kind.ts +24 -0
- package/src/sdk/models/billing-term-owner-type.ts +16 -0
- package/src/sdk/models/billing-term-split.ts +24 -0
- package/src/sdk/models/billing-term-value-type.ts +31 -0
- package/src/sdk/models/billing-terms-response.ts +49 -0
- package/src/sdk/models/billingterm-instalment.ts +128 -0
- package/src/sdk/models/billingterm-term.ts +143 -0
- package/src/sdk/models/cancellation-fee-input.ts +40 -0
- package/src/sdk/models/cancellation-fee-type.ts +23 -0
- package/src/sdk/models/commitment-response.ts +22 -2
- package/src/sdk/models/create-commitment-request.ts +23 -0
- package/src/sdk/models/get-commitment-billing-terms-op.ts +35 -0
- package/src/sdk/models/get-price-history-op.ts +33 -0
- package/src/sdk/models/get-subscription-line-item-history-op.ts +36 -0
- package/src/sdk/models/get-subscription-v2-op.ts +1 -1
- package/src/sdk/models/grouped-invoicing-child-request.ts +8 -0
- package/src/sdk/models/index.ts +28 -0
- package/src/sdk/models/instalment-bill-trigger.ts +24 -0
- package/src/sdk/models/instalment-delivery.ts +24 -0
- package/src/sdk/models/instalment-kind.ts +19 -0
- package/src/sdk/models/instalment-status.ts +20 -0
- package/src/sdk/models/invoice-billing-reason.ts +2 -0
- package/src/sdk/models/invoice-line-item-response.ts +6 -0
- package/src/sdk/models/list-commitment-instalments-op.ts +41 -0
- package/src/sdk/models/list-instalments-response.ts +35 -0
- package/src/sdk/models/payment-attempt-response.ts +3 -0
- package/src/sdk/models/preview-commitment-billing-terms-op.ts +46 -0
- package/src/sdk/models/replace-billing-terms-request.ts +43 -0
- package/src/sdk/models/replace-commitment-billing-terms-op.ts +46 -0
- package/src/sdk/models/subscription-response-v2.ts +9 -0
- package/src/sdk/models/subscription-response.ts +9 -0
- package/src/sdk/models/terminate-commitment-request.ts +11 -3
- package/src/sdk/models/trigger-commitment-instalment-op.ts +60 -0
- package/src/sdk/models/trigger-instalment-request.ts +41 -0
- package/src/sdk/models/update-commitment-request.ts +7 -0
- package/src/sdk/models/update-subscription-request.ts +8 -0
- package/src/sdk/models/webhook-dto-billing-instalment-webhook-payload.ts +53 -0
- package/src/sdk/models/webhook-dto-billing-terms-webhook-payload.ts +61 -0
- package/src/sdk/models/webhook-dto-invoice-line-item.ts +3 -0
- package/src/sdk/models/webhook-dto-payment-attempt-webhook-payload.ts +61 -0
- package/src/sdk/models/webhook-dto-payment-attempt.ts +52 -0
- package/src/sdk/models/webhook-event-name.ts +7 -0
- package/src/sdk/prices.ts +18 -0
- package/src/sdk/subscriptions.ts +18 -0
- package/src/sdk/webhook-events.ts +112 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import {
|
|
8
|
+
BillingTermKind,
|
|
9
|
+
BillingTermKind$outboundSchema,
|
|
10
|
+
} from "./billing-term-kind.js";
|
|
11
|
+
import {
|
|
12
|
+
BillingTermSplit,
|
|
13
|
+
BillingTermSplit$outboundSchema,
|
|
14
|
+
} from "./billing-term-split.js";
|
|
15
|
+
import {
|
|
16
|
+
BillingTermValueType,
|
|
17
|
+
BillingTermValueType$outboundSchema,
|
|
18
|
+
} from "./billing-term-value-type.js";
|
|
19
|
+
import {
|
|
20
|
+
InstalmentBillTrigger,
|
|
21
|
+
InstalmentBillTrigger$outboundSchema,
|
|
22
|
+
} from "./instalment-bill-trigger.js";
|
|
23
|
+
import {
|
|
24
|
+
InstalmentDelivery,
|
|
25
|
+
InstalmentDelivery$outboundSchema,
|
|
26
|
+
} from "./instalment-delivery.js";
|
|
27
|
+
import {
|
|
28
|
+
InvoiceCadence,
|
|
29
|
+
InvoiceCadence$outboundSchema,
|
|
30
|
+
} from "./invoice-cadence.js";
|
|
31
|
+
|
|
32
|
+
export type BillingTermInput = {
|
|
33
|
+
/**
|
|
34
|
+
* BillOn defaults to the commitment start, or on an edit to the start of the billing period holding now (the
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* commitment start once its term has ended). A manual term omits it and waits at the commitment end.
|
|
38
|
+
*/
|
|
39
|
+
billOn?: string | undefined;
|
|
40
|
+
billTrigger?: InstalmentBillTrigger | undefined;
|
|
41
|
+
endDate?: Date | undefined;
|
|
42
|
+
instalmentInvoicing?: InstalmentDelivery | undefined;
|
|
43
|
+
invoiceCadence?: InvoiceCadence | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* InvoiceLabel names the term's instalments, "Instalment {n} of {of}" by default. {n} and {of} count only the
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* commitment's instalments whose labels use them.
|
|
49
|
+
*/
|
|
50
|
+
invoiceLabel?: string | undefined;
|
|
51
|
+
kind: BillingTermKind;
|
|
52
|
+
metadata?: { [k: string]: string } | undefined;
|
|
53
|
+
periodCount?: number | undefined;
|
|
54
|
+
split?: BillingTermSplit | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* StartDate and EndDate are edges of the periods the term steps on: billing periods, or anniversary ones when it is
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* invoiced separately; by default, the period holding the commitment start (now, on an edit) to the commitment end.
|
|
60
|
+
*/
|
|
61
|
+
startDate?: Date | undefined;
|
|
62
|
+
value?: string | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* fixed or remainder; percentage is reserved and rejected as not supported yet
|
|
65
|
+
*/
|
|
66
|
+
valueType: BillingTermValueType;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/** @internal */
|
|
70
|
+
export type BillingTermInput$Outbound = {
|
|
71
|
+
bill_on?: string | undefined;
|
|
72
|
+
bill_trigger?: string | undefined;
|
|
73
|
+
end_date?: string | undefined;
|
|
74
|
+
instalment_invoicing?: string | undefined;
|
|
75
|
+
invoice_cadence?: string | undefined;
|
|
76
|
+
invoice_label?: string | undefined;
|
|
77
|
+
kind: string;
|
|
78
|
+
metadata?: { [k: string]: string } | undefined;
|
|
79
|
+
period_count?: number | undefined;
|
|
80
|
+
split?: string | undefined;
|
|
81
|
+
start_date?: string | undefined;
|
|
82
|
+
value?: string | undefined;
|
|
83
|
+
value_type: string;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** @internal */
|
|
87
|
+
export const BillingTermInput$outboundSchema: z.ZodMiniType<
|
|
88
|
+
BillingTermInput$Outbound,
|
|
89
|
+
BillingTermInput
|
|
90
|
+
> = z.pipe(
|
|
91
|
+
z.object({
|
|
92
|
+
billOn: z.optional(z.string()),
|
|
93
|
+
billTrigger: z.optional(InstalmentBillTrigger$outboundSchema),
|
|
94
|
+
endDate: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
|
|
95
|
+
instalmentInvoicing: z.optional(InstalmentDelivery$outboundSchema),
|
|
96
|
+
invoiceCadence: z.optional(InvoiceCadence$outboundSchema),
|
|
97
|
+
invoiceLabel: z.optional(z.string()),
|
|
98
|
+
kind: BillingTermKind$outboundSchema,
|
|
99
|
+
metadata: z.optional(z.record(z.string(), z.string())),
|
|
100
|
+
periodCount: z.optional(z.int()),
|
|
101
|
+
split: z.optional(BillingTermSplit$outboundSchema),
|
|
102
|
+
startDate: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
|
|
103
|
+
value: z.optional(z.string()),
|
|
104
|
+
valueType: BillingTermValueType$outboundSchema,
|
|
105
|
+
}),
|
|
106
|
+
z.transform((v) => {
|
|
107
|
+
return remap$(v, {
|
|
108
|
+
billOn: "bill_on",
|
|
109
|
+
billTrigger: "bill_trigger",
|
|
110
|
+
endDate: "end_date",
|
|
111
|
+
instalmentInvoicing: "instalment_invoicing",
|
|
112
|
+
invoiceCadence: "invoice_cadence",
|
|
113
|
+
invoiceLabel: "invoice_label",
|
|
114
|
+
periodCount: "period_count",
|
|
115
|
+
startDate: "start_date",
|
|
116
|
+
valueType: "value_type",
|
|
117
|
+
});
|
|
118
|
+
}),
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
export function billingTermInputToJSON(
|
|
122
|
+
billingTermInput: BillingTermInput,
|
|
123
|
+
): string {
|
|
124
|
+
return JSON.stringify(
|
|
125
|
+
BillingTermInput$outboundSchema.parse(billingTermInput),
|
|
126
|
+
);
|
|
127
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import * as openEnums from "../../types/enums.js";
|
|
7
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const BillingTermKind = {
|
|
10
|
+
Once: "once",
|
|
11
|
+
Recurring: "recurring",
|
|
12
|
+
} as const;
|
|
13
|
+
export type BillingTermKind = OpenEnum<typeof BillingTermKind>;
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const BillingTermKind$inboundSchema: z.ZodMiniType<
|
|
17
|
+
BillingTermKind,
|
|
18
|
+
unknown
|
|
19
|
+
> = openEnums.inboundSchema(BillingTermKind);
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const BillingTermKind$outboundSchema: z.ZodMiniType<
|
|
22
|
+
string,
|
|
23
|
+
BillingTermKind
|
|
24
|
+
> = openEnums.outboundSchema(BillingTermKind);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const BillingTermOwnerType = {
|
|
9
|
+
Commitment: "commitment",
|
|
10
|
+
} as const;
|
|
11
|
+
export type BillingTermOwnerType = ClosedEnum<typeof BillingTermOwnerType>;
|
|
12
|
+
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const BillingTermOwnerType$inboundSchema: z.ZodMiniEnum<
|
|
15
|
+
typeof BillingTermOwnerType
|
|
16
|
+
> = z.enum(BillingTermOwnerType);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import * as openEnums from "../../types/enums.js";
|
|
7
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const BillingTermSplit = {
|
|
10
|
+
Even: "even",
|
|
11
|
+
Proportional: "proportional",
|
|
12
|
+
} as const;
|
|
13
|
+
export type BillingTermSplit = OpenEnum<typeof BillingTermSplit>;
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const BillingTermSplit$inboundSchema: z.ZodMiniType<
|
|
17
|
+
BillingTermSplit,
|
|
18
|
+
unknown
|
|
19
|
+
> = openEnums.inboundSchema(BillingTermSplit);
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const BillingTermSplit$outboundSchema: z.ZodMiniType<
|
|
22
|
+
string,
|
|
23
|
+
BillingTermSplit
|
|
24
|
+
> = openEnums.outboundSchema(BillingTermSplit);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import * as openEnums from "../../types/enums.js";
|
|
7
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* fixed or remainder; percentage is reserved and rejected as not supported yet
|
|
11
|
+
*/
|
|
12
|
+
export const BillingTermValueType = {
|
|
13
|
+
Fixed: "fixed",
|
|
14
|
+
Percentage: "percentage",
|
|
15
|
+
Remainder: "remainder",
|
|
16
|
+
} as const;
|
|
17
|
+
/**
|
|
18
|
+
* fixed or remainder; percentage is reserved and rejected as not supported yet
|
|
19
|
+
*/
|
|
20
|
+
export type BillingTermValueType = OpenEnum<typeof BillingTermValueType>;
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const BillingTermValueType$inboundSchema: z.ZodMiniType<
|
|
24
|
+
BillingTermValueType,
|
|
25
|
+
unknown
|
|
26
|
+
> = openEnums.inboundSchema(BillingTermValueType);
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const BillingTermValueType$outboundSchema: z.ZodMiniType<
|
|
29
|
+
string,
|
|
30
|
+
BillingTermValueType
|
|
31
|
+
> = openEnums.outboundSchema(BillingTermValueType);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import {
|
|
11
|
+
BillingtermInstalment,
|
|
12
|
+
BillingtermInstalment$inboundSchema,
|
|
13
|
+
} from "./billingterm-instalment.js";
|
|
14
|
+
import {
|
|
15
|
+
BillingtermTerm,
|
|
16
|
+
BillingtermTerm$inboundSchema,
|
|
17
|
+
} from "./billingterm-term.js";
|
|
18
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
19
|
+
|
|
20
|
+
export type BillingTermsResponse = {
|
|
21
|
+
billingTerms?: Array<BillingtermTerm> | undefined;
|
|
22
|
+
instalments?: Array<BillingtermInstalment> | undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const BillingTermsResponse$inboundSchema: z.ZodMiniType<
|
|
27
|
+
BillingTermsResponse,
|
|
28
|
+
unknown
|
|
29
|
+
> = z.pipe(
|
|
30
|
+
z.object({
|
|
31
|
+
billing_terms: types.optional(z.array(BillingtermTerm$inboundSchema)),
|
|
32
|
+
instalments: types.optional(z.array(BillingtermInstalment$inboundSchema)),
|
|
33
|
+
}),
|
|
34
|
+
z.transform((v) => {
|
|
35
|
+
return remap$(v, {
|
|
36
|
+
"billing_terms": "billingTerms",
|
|
37
|
+
});
|
|
38
|
+
}),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export function billingTermsResponseFromJSON(
|
|
42
|
+
jsonString: string,
|
|
43
|
+
): SafeParseResult<BillingTermsResponse, SDKValidationError> {
|
|
44
|
+
return safeParse(
|
|
45
|
+
jsonString,
|
|
46
|
+
(x) => BillingTermsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
47
|
+
`Failed to parse 'BillingTermsResponse' from JSON`,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import {
|
|
11
|
+
BillingTermOwnerType,
|
|
12
|
+
BillingTermOwnerType$inboundSchema,
|
|
13
|
+
} from "./billing-term-owner-type.js";
|
|
14
|
+
import {
|
|
15
|
+
InstalmentBillTrigger,
|
|
16
|
+
InstalmentBillTrigger$inboundSchema,
|
|
17
|
+
} from "./instalment-bill-trigger.js";
|
|
18
|
+
import {
|
|
19
|
+
InstalmentDelivery,
|
|
20
|
+
InstalmentDelivery$inboundSchema,
|
|
21
|
+
} from "./instalment-delivery.js";
|
|
22
|
+
import {
|
|
23
|
+
InstalmentKind,
|
|
24
|
+
InstalmentKind$inboundSchema,
|
|
25
|
+
} from "./instalment-kind.js";
|
|
26
|
+
import {
|
|
27
|
+
InstalmentStatus,
|
|
28
|
+
InstalmentStatus$inboundSchema,
|
|
29
|
+
} from "./instalment-status.js";
|
|
30
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
31
|
+
import { Status, Status$inboundSchema } from "./status.js";
|
|
32
|
+
|
|
33
|
+
export type BillingtermInstalment = {
|
|
34
|
+
amount?: string | undefined;
|
|
35
|
+
billOn?: string | undefined;
|
|
36
|
+
billTrigger?: InstalmentBillTrigger | undefined;
|
|
37
|
+
billingTermId?: string | undefined;
|
|
38
|
+
createdAt?: Date | undefined;
|
|
39
|
+
createdBy?: string | undefined;
|
|
40
|
+
currency?: string | undefined;
|
|
41
|
+
customerId?: string | undefined;
|
|
42
|
+
delivery?: InstalmentDelivery | undefined;
|
|
43
|
+
environmentId?: string | undefined;
|
|
44
|
+
id?: string | undefined;
|
|
45
|
+
instalmentStatus?: InstalmentStatus | undefined;
|
|
46
|
+
invoiceId?: string | undefined;
|
|
47
|
+
invoiceLabel?: string | undefined;
|
|
48
|
+
kind?: InstalmentKind | undefined;
|
|
49
|
+
metadata?: { [k: string]: string } | undefined;
|
|
50
|
+
ownerId?: string | undefined;
|
|
51
|
+
ownerType?: BillingTermOwnerType | undefined;
|
|
52
|
+
servicePeriodEnd?: Date | undefined;
|
|
53
|
+
servicePeriodStart?: Date | undefined;
|
|
54
|
+
status?: Status | undefined;
|
|
55
|
+
subscriptionId?: string | undefined;
|
|
56
|
+
tenantId?: string | undefined;
|
|
57
|
+
triggeredAt?: Date | undefined;
|
|
58
|
+
updatedAt?: Date | undefined;
|
|
59
|
+
updatedBy?: string | undefined;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** @internal */
|
|
63
|
+
export const BillingtermInstalment$inboundSchema: z.ZodMiniType<
|
|
64
|
+
BillingtermInstalment,
|
|
65
|
+
unknown
|
|
66
|
+
> = z.pipe(
|
|
67
|
+
z.object({
|
|
68
|
+
amount: types.optional(types.string()),
|
|
69
|
+
bill_on: types.optional(types.string()),
|
|
70
|
+
bill_trigger: types.optional(InstalmentBillTrigger$inboundSchema),
|
|
71
|
+
billing_term_id: types.optional(types.string()),
|
|
72
|
+
created_at: types.optional(types.date()),
|
|
73
|
+
created_by: types.optional(types.string()),
|
|
74
|
+
currency: types.optional(types.string()),
|
|
75
|
+
customer_id: types.optional(types.string()),
|
|
76
|
+
delivery: types.optional(InstalmentDelivery$inboundSchema),
|
|
77
|
+
environment_id: types.optional(types.string()),
|
|
78
|
+
id: types.optional(types.string()),
|
|
79
|
+
instalment_status: types.optional(InstalmentStatus$inboundSchema),
|
|
80
|
+
invoice_id: types.optional(types.string()),
|
|
81
|
+
invoice_label: types.optional(types.string()),
|
|
82
|
+
kind: types.optional(InstalmentKind$inboundSchema),
|
|
83
|
+
metadata: types.optional(z.record(z.string(), types.string())),
|
|
84
|
+
owner_id: types.optional(types.string()),
|
|
85
|
+
owner_type: types.optional(BillingTermOwnerType$inboundSchema),
|
|
86
|
+
service_period_end: types.optional(types.date()),
|
|
87
|
+
service_period_start: types.optional(types.date()),
|
|
88
|
+
status: types.optional(Status$inboundSchema),
|
|
89
|
+
subscription_id: types.optional(types.string()),
|
|
90
|
+
tenant_id: types.optional(types.string()),
|
|
91
|
+
triggered_at: types.optional(types.date()),
|
|
92
|
+
updated_at: types.optional(types.date()),
|
|
93
|
+
updated_by: types.optional(types.string()),
|
|
94
|
+
}),
|
|
95
|
+
z.transform((v) => {
|
|
96
|
+
return remap$(v, {
|
|
97
|
+
"bill_on": "billOn",
|
|
98
|
+
"bill_trigger": "billTrigger",
|
|
99
|
+
"billing_term_id": "billingTermId",
|
|
100
|
+
"created_at": "createdAt",
|
|
101
|
+
"created_by": "createdBy",
|
|
102
|
+
"customer_id": "customerId",
|
|
103
|
+
"environment_id": "environmentId",
|
|
104
|
+
"instalment_status": "instalmentStatus",
|
|
105
|
+
"invoice_id": "invoiceId",
|
|
106
|
+
"invoice_label": "invoiceLabel",
|
|
107
|
+
"owner_id": "ownerId",
|
|
108
|
+
"owner_type": "ownerType",
|
|
109
|
+
"service_period_end": "servicePeriodEnd",
|
|
110
|
+
"service_period_start": "servicePeriodStart",
|
|
111
|
+
"subscription_id": "subscriptionId",
|
|
112
|
+
"tenant_id": "tenantId",
|
|
113
|
+
"triggered_at": "triggeredAt",
|
|
114
|
+
"updated_at": "updatedAt",
|
|
115
|
+
"updated_by": "updatedBy",
|
|
116
|
+
});
|
|
117
|
+
}),
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
export function billingtermInstalmentFromJSON(
|
|
121
|
+
jsonString: string,
|
|
122
|
+
): SafeParseResult<BillingtermInstalment, SDKValidationError> {
|
|
123
|
+
return safeParse(
|
|
124
|
+
jsonString,
|
|
125
|
+
(x) => BillingtermInstalment$inboundSchema.parse(JSON.parse(x)),
|
|
126
|
+
`Failed to parse 'BillingtermInstalment' from JSON`,
|
|
127
|
+
);
|
|
128
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import {
|
|
11
|
+
BillingTermKind,
|
|
12
|
+
BillingTermKind$inboundSchema,
|
|
13
|
+
} from "./billing-term-kind.js";
|
|
14
|
+
import {
|
|
15
|
+
BillingTermOwnerType,
|
|
16
|
+
BillingTermOwnerType$inboundSchema,
|
|
17
|
+
} from "./billing-term-owner-type.js";
|
|
18
|
+
import {
|
|
19
|
+
BillingTermSplit,
|
|
20
|
+
BillingTermSplit$inboundSchema,
|
|
21
|
+
} from "./billing-term-split.js";
|
|
22
|
+
import {
|
|
23
|
+
BillingTermValueType,
|
|
24
|
+
BillingTermValueType$inboundSchema,
|
|
25
|
+
} from "./billing-term-value-type.js";
|
|
26
|
+
import {
|
|
27
|
+
InstalmentBillTrigger,
|
|
28
|
+
InstalmentBillTrigger$inboundSchema,
|
|
29
|
+
} from "./instalment-bill-trigger.js";
|
|
30
|
+
import {
|
|
31
|
+
InstalmentDelivery,
|
|
32
|
+
InstalmentDelivery$inboundSchema,
|
|
33
|
+
} from "./instalment-delivery.js";
|
|
34
|
+
import {
|
|
35
|
+
InvoiceCadence,
|
|
36
|
+
InvoiceCadence$inboundSchema,
|
|
37
|
+
} from "./invoice-cadence.js";
|
|
38
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
39
|
+
import { Status, Status$inboundSchema } from "./status.js";
|
|
40
|
+
|
|
41
|
+
export type BillingtermTerm = {
|
|
42
|
+
billOn?: string | undefined;
|
|
43
|
+
billTrigger?: InstalmentBillTrigger | undefined;
|
|
44
|
+
createdAt?: Date | undefined;
|
|
45
|
+
createdBy?: string | undefined;
|
|
46
|
+
endDate?: Date | undefined;
|
|
47
|
+
environmentId?: string | undefined;
|
|
48
|
+
id?: string | undefined;
|
|
49
|
+
instalmentInvoicing?: InstalmentDelivery | undefined;
|
|
50
|
+
invoiceCadence?: InvoiceCadence | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* InvoiceLabel names its instalments on the invoice, after the owner's label. It may use {n} and {of}, which number
|
|
53
|
+
*
|
|
54
|
+
* @remarks
|
|
55
|
+
* the owner's instalments whose labels use them.
|
|
56
|
+
*/
|
|
57
|
+
invoiceLabel?: string | undefined;
|
|
58
|
+
kind?: BillingTermKind | undefined;
|
|
59
|
+
metadata?: { [k: string]: string } | undefined;
|
|
60
|
+
ownerId?: string | undefined;
|
|
61
|
+
ownerType?: BillingTermOwnerType | undefined;
|
|
62
|
+
periodCount?: number | undefined;
|
|
63
|
+
split?: BillingTermSplit | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Recurring terms.
|
|
66
|
+
*/
|
|
67
|
+
startDate?: Date | undefined;
|
|
68
|
+
status?: Status | undefined;
|
|
69
|
+
tenantId?: string | undefined;
|
|
70
|
+
updatedAt?: Date | undefined;
|
|
71
|
+
updatedBy?: string | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Value is the amount of a fixed term, per instalment on a recurring one; it is nil for a remainder term.
|
|
74
|
+
*/
|
|
75
|
+
value?: string | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* fixed or remainder; percentage is reserved and rejected as not supported yet
|
|
78
|
+
*/
|
|
79
|
+
valueType?: BillingTermValueType | undefined;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/** @internal */
|
|
83
|
+
export const BillingtermTerm$inboundSchema: z.ZodMiniType<
|
|
84
|
+
BillingtermTerm,
|
|
85
|
+
unknown
|
|
86
|
+
> = z.pipe(
|
|
87
|
+
z.object({
|
|
88
|
+
bill_on: types.optional(types.string()),
|
|
89
|
+
bill_trigger: types.optional(InstalmentBillTrigger$inboundSchema),
|
|
90
|
+
created_at: types.optional(types.date()),
|
|
91
|
+
created_by: types.optional(types.string()),
|
|
92
|
+
end_date: types.optional(types.date()),
|
|
93
|
+
environment_id: types.optional(types.string()),
|
|
94
|
+
id: types.optional(types.string()),
|
|
95
|
+
instalment_invoicing: types.optional(InstalmentDelivery$inboundSchema),
|
|
96
|
+
invoice_cadence: types.optional(InvoiceCadence$inboundSchema),
|
|
97
|
+
invoice_label: types.optional(types.string()),
|
|
98
|
+
kind: types.optional(BillingTermKind$inboundSchema),
|
|
99
|
+
metadata: types.optional(z.record(z.string(), types.string())),
|
|
100
|
+
owner_id: types.optional(types.string()),
|
|
101
|
+
owner_type: types.optional(BillingTermOwnerType$inboundSchema),
|
|
102
|
+
period_count: types.optional(types.number()),
|
|
103
|
+
split: types.optional(BillingTermSplit$inboundSchema),
|
|
104
|
+
start_date: types.optional(types.date()),
|
|
105
|
+
status: types.optional(Status$inboundSchema),
|
|
106
|
+
tenant_id: types.optional(types.string()),
|
|
107
|
+
updated_at: types.optional(types.date()),
|
|
108
|
+
updated_by: types.optional(types.string()),
|
|
109
|
+
value: types.optional(types.string()),
|
|
110
|
+
value_type: types.optional(BillingTermValueType$inboundSchema),
|
|
111
|
+
}),
|
|
112
|
+
z.transform((v) => {
|
|
113
|
+
return remap$(v, {
|
|
114
|
+
"bill_on": "billOn",
|
|
115
|
+
"bill_trigger": "billTrigger",
|
|
116
|
+
"created_at": "createdAt",
|
|
117
|
+
"created_by": "createdBy",
|
|
118
|
+
"end_date": "endDate",
|
|
119
|
+
"environment_id": "environmentId",
|
|
120
|
+
"instalment_invoicing": "instalmentInvoicing",
|
|
121
|
+
"invoice_cadence": "invoiceCadence",
|
|
122
|
+
"invoice_label": "invoiceLabel",
|
|
123
|
+
"owner_id": "ownerId",
|
|
124
|
+
"owner_type": "ownerType",
|
|
125
|
+
"period_count": "periodCount",
|
|
126
|
+
"start_date": "startDate",
|
|
127
|
+
"tenant_id": "tenantId",
|
|
128
|
+
"updated_at": "updatedAt",
|
|
129
|
+
"updated_by": "updatedBy",
|
|
130
|
+
"value_type": "valueType",
|
|
131
|
+
});
|
|
132
|
+
}),
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
export function billingtermTermFromJSON(
|
|
136
|
+
jsonString: string,
|
|
137
|
+
): SafeParseResult<BillingtermTerm, SDKValidationError> {
|
|
138
|
+
return safeParse(
|
|
139
|
+
jsonString,
|
|
140
|
+
(x) => BillingtermTerm$inboundSchema.parse(JSON.parse(x)),
|
|
141
|
+
`Failed to parse 'BillingtermTerm' from JSON`,
|
|
142
|
+
);
|
|
143
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import {
|
|
7
|
+
CancellationFeeType,
|
|
8
|
+
CancellationFeeType$outboundSchema,
|
|
9
|
+
} from "./cancellation-fee-type.js";
|
|
10
|
+
|
|
11
|
+
export type CancellationFeeInput = {
|
|
12
|
+
/**
|
|
13
|
+
* fixed; percentage is reserved and rejected as not supported yet
|
|
14
|
+
*/
|
|
15
|
+
type: CancellationFeeType;
|
|
16
|
+
value: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export type CancellationFeeInput$Outbound = {
|
|
21
|
+
type: string;
|
|
22
|
+
value: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const CancellationFeeInput$outboundSchema: z.ZodMiniType<
|
|
27
|
+
CancellationFeeInput$Outbound,
|
|
28
|
+
CancellationFeeInput
|
|
29
|
+
> = z.object({
|
|
30
|
+
type: CancellationFeeType$outboundSchema,
|
|
31
|
+
value: z.string(),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export function cancellationFeeInputToJSON(
|
|
35
|
+
cancellationFeeInput: CancellationFeeInput,
|
|
36
|
+
): string {
|
|
37
|
+
return JSON.stringify(
|
|
38
|
+
CancellationFeeInput$outboundSchema.parse(cancellationFeeInput),
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* fixed; percentage is reserved and rejected as not supported yet
|
|
10
|
+
*/
|
|
11
|
+
export const CancellationFeeType = {
|
|
12
|
+
Fixed: "fixed",
|
|
13
|
+
Percentage: "percentage",
|
|
14
|
+
} as const;
|
|
15
|
+
/**
|
|
16
|
+
* fixed; percentage is reserved and rejected as not supported yet
|
|
17
|
+
*/
|
|
18
|
+
export type CancellationFeeType = ClosedEnum<typeof CancellationFeeType>;
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const CancellationFeeType$outboundSchema: z.ZodMiniEnum<
|
|
22
|
+
typeof CancellationFeeType
|
|
23
|
+
> = z.enum(CancellationFeeType);
|
|
@@ -8,6 +8,14 @@ import { safeParse } from "../../lib/schemas.js";
|
|
|
8
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
9
|
import * as types from "../../types/primitives.js";
|
|
10
10
|
import { ActiveWindow, ActiveWindow$inboundSchema } from "./active-window.js";
|
|
11
|
+
import {
|
|
12
|
+
BillingtermInstalment,
|
|
13
|
+
BillingtermInstalment$inboundSchema,
|
|
14
|
+
} from "./billingterm-instalment.js";
|
|
15
|
+
import {
|
|
16
|
+
BillingtermTerm,
|
|
17
|
+
BillingtermTerm$inboundSchema,
|
|
18
|
+
} from "./billingterm-term.js";
|
|
11
19
|
import {
|
|
12
20
|
CommitmentCollectionMethod,
|
|
13
21
|
CommitmentCollectionMethod$inboundSchema,
|
|
@@ -32,11 +40,19 @@ import {
|
|
|
32
40
|
CommitmentType,
|
|
33
41
|
CommitmentType$inboundSchema,
|
|
34
42
|
} from "./commitment-type.js";
|
|
43
|
+
import {
|
|
44
|
+
InstalmentDelivery,
|
|
45
|
+
InstalmentDelivery$inboundSchema,
|
|
46
|
+
} from "./instalment-delivery.js";
|
|
35
47
|
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
36
48
|
import { Status, Status$inboundSchema } from "./status.js";
|
|
37
49
|
|
|
38
50
|
export type CommitmentResponse = {
|
|
39
51
|
activeWindows?: Array<ActiveWindow> | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* BillingTerms and Instalments are set by create and preview.
|
|
54
|
+
*/
|
|
55
|
+
billingTerms?: Array<BillingtermTerm> | undefined;
|
|
40
56
|
binding?: boolean | undefined;
|
|
41
57
|
collectionMethod?: CommitmentCollectionMethod | undefined;
|
|
42
58
|
commitmentStatus?: CommitmentStatus | undefined;
|
|
@@ -53,7 +69,8 @@ export type CommitmentResponse = {
|
|
|
53
69
|
environmentId?: string | undefined;
|
|
54
70
|
id?: string | undefined;
|
|
55
71
|
idempotencyKey?: string | undefined;
|
|
56
|
-
instalmentInvoicing?:
|
|
72
|
+
instalmentInvoicing?: InstalmentDelivery | undefined;
|
|
73
|
+
instalments?: Array<BillingtermInstalment> | undefined;
|
|
57
74
|
invoiceDescription?: string | undefined;
|
|
58
75
|
invoiceLabel?: string | undefined;
|
|
59
76
|
measurement?: CommitmentMeasurement | undefined;
|
|
@@ -85,6 +102,7 @@ export const CommitmentResponse$inboundSchema: z.ZodMiniType<
|
|
|
85
102
|
> = z.pipe(
|
|
86
103
|
z.object({
|
|
87
104
|
active_windows: types.optional(z.array(ActiveWindow$inboundSchema)),
|
|
105
|
+
billing_terms: types.optional(z.array(BillingtermTerm$inboundSchema)),
|
|
88
106
|
binding: types.optional(types.boolean()),
|
|
89
107
|
collection_method: types.optional(CommitmentCollectionMethod$inboundSchema),
|
|
90
108
|
commitment_status: types.optional(CommitmentStatus$inboundSchema),
|
|
@@ -98,7 +116,8 @@ export const CommitmentResponse$inboundSchema: z.ZodMiniType<
|
|
|
98
116
|
environment_id: types.optional(types.string()),
|
|
99
117
|
id: types.optional(types.string()),
|
|
100
118
|
idempotency_key: types.optional(types.string()),
|
|
101
|
-
instalment_invoicing: types.optional(
|
|
119
|
+
instalment_invoicing: types.optional(InstalmentDelivery$inboundSchema),
|
|
120
|
+
instalments: types.optional(z.array(BillingtermInstalment$inboundSchema)),
|
|
102
121
|
invoice_description: types.optional(types.string()),
|
|
103
122
|
invoice_label: types.optional(types.string()),
|
|
104
123
|
measurement: types.optional(CommitmentMeasurement$inboundSchema),
|
|
@@ -127,6 +146,7 @@ export const CommitmentResponse$inboundSchema: z.ZodMiniType<
|
|
|
127
146
|
z.transform((v) => {
|
|
128
147
|
return remap$(v, {
|
|
129
148
|
"active_windows": "activeWindows",
|
|
149
|
+
"billing_terms": "billingTerms",
|
|
130
150
|
"collection_method": "collectionMethod",
|
|
131
151
|
"commitment_status": "commitmentStatus",
|
|
132
152
|
"commitment_value": "commitmentValue",
|