@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,191 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { TirdadCore } from "../core.js";
|
|
7
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
9
|
+
import * as M from "../lib/matchers.js";
|
|
10
|
+
import { compactMap } from "../lib/primitives.js";
|
|
11
|
+
import { safeParse } from "../lib/schemas.js";
|
|
12
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
14
|
+
import { pathToFunc } from "../lib/url.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../sdk/models/http-client-errors.js";
|
|
22
|
+
import * as models from "../sdk/models/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../sdk/models/response-validation-error.js";
|
|
24
|
+
import { SDKValidationError } from "../sdk/models/sdk-validation-error.js";
|
|
25
|
+
import { TirdadError } from "../sdk/models/tirdad-error.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* List instalments
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Lists the instalments of the commitment in billing order. Without a status filter every instalment is listed, cancelled ones included.
|
|
34
|
+
*/
|
|
35
|
+
export function commitmentsListCommitmentInstalments(
|
|
36
|
+
client: TirdadCore,
|
|
37
|
+
id: string,
|
|
38
|
+
status?: Array<string> | undefined,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
models.ListInstalmentsResponse,
|
|
43
|
+
| models.ErrorsErrorResponse
|
|
44
|
+
| TirdadError
|
|
45
|
+
| ResponseValidationError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
| RequestAbortedError
|
|
48
|
+
| RequestTimeoutError
|
|
49
|
+
| InvalidRequestError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| SDKValidationError
|
|
52
|
+
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
id,
|
|
57
|
+
status,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: TirdadCore,
|
|
64
|
+
id: string,
|
|
65
|
+
status?: Array<string> | undefined,
|
|
66
|
+
options?: RequestOptions,
|
|
67
|
+
): Promise<
|
|
68
|
+
[
|
|
69
|
+
Result<
|
|
70
|
+
models.ListInstalmentsResponse,
|
|
71
|
+
| models.ErrorsErrorResponse
|
|
72
|
+
| TirdadError
|
|
73
|
+
| ResponseValidationError
|
|
74
|
+
| ConnectionError
|
|
75
|
+
| RequestAbortedError
|
|
76
|
+
| RequestTimeoutError
|
|
77
|
+
| InvalidRequestError
|
|
78
|
+
| UnexpectedClientError
|
|
79
|
+
| SDKValidationError
|
|
80
|
+
>,
|
|
81
|
+
APICall,
|
|
82
|
+
]
|
|
83
|
+
> {
|
|
84
|
+
const input: models.ListCommitmentInstalmentsRequest = {
|
|
85
|
+
id: id,
|
|
86
|
+
status: status,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const parsed = safeParse(
|
|
90
|
+
input,
|
|
91
|
+
(value) =>
|
|
92
|
+
z.parse(models.ListCommitmentInstalmentsRequest$outboundSchema, value),
|
|
93
|
+
"Input validation failed",
|
|
94
|
+
);
|
|
95
|
+
if (!parsed.ok) {
|
|
96
|
+
return [parsed, { status: "invalid" }];
|
|
97
|
+
}
|
|
98
|
+
const payload = parsed.value;
|
|
99
|
+
const body = null;
|
|
100
|
+
|
|
101
|
+
const pathParams = {
|
|
102
|
+
id: encodeSimple("id", payload.id, {
|
|
103
|
+
explode: false,
|
|
104
|
+
charEncoding: "percent",
|
|
105
|
+
}),
|
|
106
|
+
};
|
|
107
|
+
const path = pathToFunc("/commitments/{id}/instalments")(pathParams);
|
|
108
|
+
|
|
109
|
+
const query = encodeFormQuery({
|
|
110
|
+
"status": payload.status,
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
const headers = new Headers(compactMap({
|
|
114
|
+
Accept: "application/json",
|
|
115
|
+
}));
|
|
116
|
+
|
|
117
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
118
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
119
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
120
|
+
|
|
121
|
+
const context = {
|
|
122
|
+
options: client._options,
|
|
123
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
124
|
+
operationID: "listCommitmentInstalments",
|
|
125
|
+
oAuth2Scopes: null,
|
|
126
|
+
|
|
127
|
+
resolvedSecurity: requestSecurity,
|
|
128
|
+
|
|
129
|
+
securitySource: client._options.apiKeyAuth,
|
|
130
|
+
retryConfig: options?.retries
|
|
131
|
+
|| client._options.retryConfig
|
|
132
|
+
|| { strategy: "none" },
|
|
133
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const requestRes = client._createRequest(context, {
|
|
137
|
+
security: requestSecurity,
|
|
138
|
+
method: "GET",
|
|
139
|
+
baseURL: options?.serverURL,
|
|
140
|
+
path: path,
|
|
141
|
+
headers: headers,
|
|
142
|
+
query: query,
|
|
143
|
+
body: body,
|
|
144
|
+
userAgent: client._options.userAgent,
|
|
145
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
146
|
+
}, options);
|
|
147
|
+
if (!requestRes.ok) {
|
|
148
|
+
return [requestRes, { status: "invalid" }];
|
|
149
|
+
}
|
|
150
|
+
const req = requestRes.value;
|
|
151
|
+
|
|
152
|
+
const doResult = await client._do(req, {
|
|
153
|
+
context,
|
|
154
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
155
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
156
|
+
retryConfig: context.retryConfig,
|
|
157
|
+
retryCodes: context.retryCodes,
|
|
158
|
+
});
|
|
159
|
+
if (!doResult.ok) {
|
|
160
|
+
return [doResult, { status: "request-error", request: req }];
|
|
161
|
+
}
|
|
162
|
+
const response = doResult.value;
|
|
163
|
+
|
|
164
|
+
const responseFields = {
|
|
165
|
+
HttpMeta: { Response: response, Request: req },
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const [result] = await M.match<
|
|
169
|
+
models.ListInstalmentsResponse,
|
|
170
|
+
| models.ErrorsErrorResponse
|
|
171
|
+
| TirdadError
|
|
172
|
+
| ResponseValidationError
|
|
173
|
+
| ConnectionError
|
|
174
|
+
| RequestAbortedError
|
|
175
|
+
| RequestTimeoutError
|
|
176
|
+
| InvalidRequestError
|
|
177
|
+
| UnexpectedClientError
|
|
178
|
+
| SDKValidationError
|
|
179
|
+
>(
|
|
180
|
+
M.json(200, models.ListInstalmentsResponse$inboundSchema),
|
|
181
|
+
M.jsonErr([400, 404], models.ErrorsErrorResponse$inboundSchema),
|
|
182
|
+
M.jsonErr(500, models.ErrorsErrorResponse$inboundSchema),
|
|
183
|
+
M.fail("4XX"),
|
|
184
|
+
M.fail("5XX"),
|
|
185
|
+
)(response, req, { extraFields: responseFields });
|
|
186
|
+
if (!result.ok) {
|
|
187
|
+
return [result, { status: "complete", request: req, response }];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return [result, { status: "complete", request: req, response }];
|
|
191
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { TirdadCore } from "../core.js";
|
|
7
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
9
|
+
import * as M from "../lib/matchers.js";
|
|
10
|
+
import { compactMap } from "../lib/primitives.js";
|
|
11
|
+
import { safeParse } from "../lib/schemas.js";
|
|
12
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
14
|
+
import { pathToFunc } from "../lib/url.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../sdk/models/http-client-errors.js";
|
|
22
|
+
import * as models from "../sdk/models/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../sdk/models/response-validation-error.js";
|
|
24
|
+
import { SDKValidationError } from "../sdk/models/sdk-validation-error.js";
|
|
25
|
+
import { TirdadError } from "../sdk/models/tirdad-error.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Preview billing terms edit
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Returns what editing the billing terms would produce, without saving anything: the new terms with the invoiced and new instalments in billing order.
|
|
34
|
+
*/
|
|
35
|
+
export function commitmentsPreviewCommitmentBillingTerms(
|
|
36
|
+
client: TirdadCore,
|
|
37
|
+
id: string,
|
|
38
|
+
body: models.ReplaceBillingTermsRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
models.BillingTermsResponse,
|
|
43
|
+
| models.ErrorsErrorResponse
|
|
44
|
+
| TirdadError
|
|
45
|
+
| ResponseValidationError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
| RequestAbortedError
|
|
48
|
+
| RequestTimeoutError
|
|
49
|
+
| InvalidRequestError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| SDKValidationError
|
|
52
|
+
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
id,
|
|
57
|
+
body,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: TirdadCore,
|
|
64
|
+
id: string,
|
|
65
|
+
body: models.ReplaceBillingTermsRequest,
|
|
66
|
+
options?: RequestOptions,
|
|
67
|
+
): Promise<
|
|
68
|
+
[
|
|
69
|
+
Result<
|
|
70
|
+
models.BillingTermsResponse,
|
|
71
|
+
| models.ErrorsErrorResponse
|
|
72
|
+
| TirdadError
|
|
73
|
+
| ResponseValidationError
|
|
74
|
+
| ConnectionError
|
|
75
|
+
| RequestAbortedError
|
|
76
|
+
| RequestTimeoutError
|
|
77
|
+
| InvalidRequestError
|
|
78
|
+
| UnexpectedClientError
|
|
79
|
+
| SDKValidationError
|
|
80
|
+
>,
|
|
81
|
+
APICall,
|
|
82
|
+
]
|
|
83
|
+
> {
|
|
84
|
+
const input: models.PreviewCommitmentBillingTermsRequest = {
|
|
85
|
+
id: id,
|
|
86
|
+
body: body,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const parsed = safeParse(
|
|
90
|
+
input,
|
|
91
|
+
(value) =>
|
|
92
|
+
z.parse(
|
|
93
|
+
models.PreviewCommitmentBillingTermsRequest$outboundSchema,
|
|
94
|
+
value,
|
|
95
|
+
),
|
|
96
|
+
"Input validation failed",
|
|
97
|
+
);
|
|
98
|
+
if (!parsed.ok) {
|
|
99
|
+
return [parsed, { status: "invalid" }];
|
|
100
|
+
}
|
|
101
|
+
const payload = parsed.value;
|
|
102
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
103
|
+
|
|
104
|
+
const pathParams = {
|
|
105
|
+
id: encodeSimple("id", payload.id, {
|
|
106
|
+
explode: false,
|
|
107
|
+
charEncoding: "percent",
|
|
108
|
+
}),
|
|
109
|
+
};
|
|
110
|
+
const path = pathToFunc("/commitments/{id}/billing-terms/preview")(
|
|
111
|
+
pathParams,
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
const headers = new Headers(compactMap({
|
|
115
|
+
"Content-Type": "application/json",
|
|
116
|
+
Accept: "application/json",
|
|
117
|
+
}));
|
|
118
|
+
|
|
119
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
120
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
121
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
122
|
+
|
|
123
|
+
const context = {
|
|
124
|
+
options: client._options,
|
|
125
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
126
|
+
operationID: "previewCommitmentBillingTerms",
|
|
127
|
+
oAuth2Scopes: null,
|
|
128
|
+
|
|
129
|
+
resolvedSecurity: requestSecurity,
|
|
130
|
+
|
|
131
|
+
securitySource: client._options.apiKeyAuth,
|
|
132
|
+
retryConfig: options?.retries
|
|
133
|
+
|| client._options.retryConfig
|
|
134
|
+
|| { strategy: "none" },
|
|
135
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const requestRes = client._createRequest(context, {
|
|
139
|
+
security: requestSecurity,
|
|
140
|
+
method: "POST",
|
|
141
|
+
baseURL: options?.serverURL,
|
|
142
|
+
path: path,
|
|
143
|
+
headers: headers,
|
|
144
|
+
body: body$,
|
|
145
|
+
userAgent: client._options.userAgent,
|
|
146
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
147
|
+
}, options);
|
|
148
|
+
if (!requestRes.ok) {
|
|
149
|
+
return [requestRes, { status: "invalid" }];
|
|
150
|
+
}
|
|
151
|
+
const req = requestRes.value;
|
|
152
|
+
|
|
153
|
+
const doResult = await client._do(req, {
|
|
154
|
+
context,
|
|
155
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
156
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
157
|
+
retryConfig: context.retryConfig,
|
|
158
|
+
retryCodes: context.retryCodes,
|
|
159
|
+
});
|
|
160
|
+
if (!doResult.ok) {
|
|
161
|
+
return [doResult, { status: "request-error", request: req }];
|
|
162
|
+
}
|
|
163
|
+
const response = doResult.value;
|
|
164
|
+
|
|
165
|
+
const responseFields = {
|
|
166
|
+
HttpMeta: { Response: response, Request: req },
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const [result] = await M.match<
|
|
170
|
+
models.BillingTermsResponse,
|
|
171
|
+
| models.ErrorsErrorResponse
|
|
172
|
+
| TirdadError
|
|
173
|
+
| ResponseValidationError
|
|
174
|
+
| ConnectionError
|
|
175
|
+
| RequestAbortedError
|
|
176
|
+
| RequestTimeoutError
|
|
177
|
+
| InvalidRequestError
|
|
178
|
+
| UnexpectedClientError
|
|
179
|
+
| SDKValidationError
|
|
180
|
+
>(
|
|
181
|
+
M.json(200, models.BillingTermsResponse$inboundSchema),
|
|
182
|
+
M.jsonErr([400, 404], models.ErrorsErrorResponse$inboundSchema),
|
|
183
|
+
M.jsonErr(500, models.ErrorsErrorResponse$inboundSchema),
|
|
184
|
+
M.fail("4XX"),
|
|
185
|
+
M.fail("5XX"),
|
|
186
|
+
)(response, req, { extraFields: responseFields });
|
|
187
|
+
if (!result.ok) {
|
|
188
|
+
return [result, { status: "complete", request: req, response }];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return [result, { status: "complete", request: req, response }];
|
|
192
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { TirdadCore } from "../core.js";
|
|
7
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
9
|
+
import * as M from "../lib/matchers.js";
|
|
10
|
+
import { compactMap } from "../lib/primitives.js";
|
|
11
|
+
import { safeParse } from "../lib/schemas.js";
|
|
12
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
14
|
+
import { pathToFunc } from "../lib/url.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../sdk/models/http-client-errors.js";
|
|
22
|
+
import * as models from "../sdk/models/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../sdk/models/response-validation-error.js";
|
|
24
|
+
import { SDKValidationError } from "../sdk/models/sdk-validation-error.js";
|
|
25
|
+
import { TirdadError } from "../sdk/models/tirdad-error.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Edit billing terms
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Replaces the whole set of billing terms of an active commitment. Its scheduled instalments are cancelled and the new terms generate instalments for what the invoiced ones leave of the commitment total; invoiced instalments and their invoices are kept. A term without bill_on or start_date starts at the billing period holding now, or at the commitment start once its term has ended. Returns the new terms with the scheduled and invoiced instalments in billing order.
|
|
34
|
+
*/
|
|
35
|
+
export function commitmentsReplaceCommitmentBillingTerms(
|
|
36
|
+
client: TirdadCore,
|
|
37
|
+
id: string,
|
|
38
|
+
body: models.ReplaceBillingTermsRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
models.BillingTermsResponse,
|
|
43
|
+
| models.ErrorsErrorResponse
|
|
44
|
+
| TirdadError
|
|
45
|
+
| ResponseValidationError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
| RequestAbortedError
|
|
48
|
+
| RequestTimeoutError
|
|
49
|
+
| InvalidRequestError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| SDKValidationError
|
|
52
|
+
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
id,
|
|
57
|
+
body,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: TirdadCore,
|
|
64
|
+
id: string,
|
|
65
|
+
body: models.ReplaceBillingTermsRequest,
|
|
66
|
+
options?: RequestOptions,
|
|
67
|
+
): Promise<
|
|
68
|
+
[
|
|
69
|
+
Result<
|
|
70
|
+
models.BillingTermsResponse,
|
|
71
|
+
| models.ErrorsErrorResponse
|
|
72
|
+
| TirdadError
|
|
73
|
+
| ResponseValidationError
|
|
74
|
+
| ConnectionError
|
|
75
|
+
| RequestAbortedError
|
|
76
|
+
| RequestTimeoutError
|
|
77
|
+
| InvalidRequestError
|
|
78
|
+
| UnexpectedClientError
|
|
79
|
+
| SDKValidationError
|
|
80
|
+
>,
|
|
81
|
+
APICall,
|
|
82
|
+
]
|
|
83
|
+
> {
|
|
84
|
+
const input: models.ReplaceCommitmentBillingTermsRequest = {
|
|
85
|
+
id: id,
|
|
86
|
+
body: body,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const parsed = safeParse(
|
|
90
|
+
input,
|
|
91
|
+
(value) =>
|
|
92
|
+
z.parse(
|
|
93
|
+
models.ReplaceCommitmentBillingTermsRequest$outboundSchema,
|
|
94
|
+
value,
|
|
95
|
+
),
|
|
96
|
+
"Input validation failed",
|
|
97
|
+
);
|
|
98
|
+
if (!parsed.ok) {
|
|
99
|
+
return [parsed, { status: "invalid" }];
|
|
100
|
+
}
|
|
101
|
+
const payload = parsed.value;
|
|
102
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
103
|
+
|
|
104
|
+
const pathParams = {
|
|
105
|
+
id: encodeSimple("id", payload.id, {
|
|
106
|
+
explode: false,
|
|
107
|
+
charEncoding: "percent",
|
|
108
|
+
}),
|
|
109
|
+
};
|
|
110
|
+
const path = pathToFunc("/commitments/{id}/billing-terms")(pathParams);
|
|
111
|
+
|
|
112
|
+
const headers = new Headers(compactMap({
|
|
113
|
+
"Content-Type": "application/json",
|
|
114
|
+
Accept: "application/json",
|
|
115
|
+
}));
|
|
116
|
+
|
|
117
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
118
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
119
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
120
|
+
|
|
121
|
+
const context = {
|
|
122
|
+
options: client._options,
|
|
123
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
124
|
+
operationID: "replaceCommitmentBillingTerms",
|
|
125
|
+
oAuth2Scopes: null,
|
|
126
|
+
|
|
127
|
+
resolvedSecurity: requestSecurity,
|
|
128
|
+
|
|
129
|
+
securitySource: client._options.apiKeyAuth,
|
|
130
|
+
retryConfig: options?.retries
|
|
131
|
+
|| client._options.retryConfig
|
|
132
|
+
|| { strategy: "none" },
|
|
133
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const requestRes = client._createRequest(context, {
|
|
137
|
+
security: requestSecurity,
|
|
138
|
+
method: "PUT",
|
|
139
|
+
baseURL: options?.serverURL,
|
|
140
|
+
path: path,
|
|
141
|
+
headers: headers,
|
|
142
|
+
body: body$,
|
|
143
|
+
userAgent: client._options.userAgent,
|
|
144
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
145
|
+
}, options);
|
|
146
|
+
if (!requestRes.ok) {
|
|
147
|
+
return [requestRes, { status: "invalid" }];
|
|
148
|
+
}
|
|
149
|
+
const req = requestRes.value;
|
|
150
|
+
|
|
151
|
+
const doResult = await client._do(req, {
|
|
152
|
+
context,
|
|
153
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
154
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
155
|
+
retryConfig: context.retryConfig,
|
|
156
|
+
retryCodes: context.retryCodes,
|
|
157
|
+
});
|
|
158
|
+
if (!doResult.ok) {
|
|
159
|
+
return [doResult, { status: "request-error", request: req }];
|
|
160
|
+
}
|
|
161
|
+
const response = doResult.value;
|
|
162
|
+
|
|
163
|
+
const responseFields = {
|
|
164
|
+
HttpMeta: { Response: response, Request: req },
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const [result] = await M.match<
|
|
168
|
+
models.BillingTermsResponse,
|
|
169
|
+
| models.ErrorsErrorResponse
|
|
170
|
+
| TirdadError
|
|
171
|
+
| ResponseValidationError
|
|
172
|
+
| ConnectionError
|
|
173
|
+
| RequestAbortedError
|
|
174
|
+
| RequestTimeoutError
|
|
175
|
+
| InvalidRequestError
|
|
176
|
+
| UnexpectedClientError
|
|
177
|
+
| SDKValidationError
|
|
178
|
+
>(
|
|
179
|
+
M.json(200, models.BillingTermsResponse$inboundSchema),
|
|
180
|
+
M.jsonErr([400, 404], models.ErrorsErrorResponse$inboundSchema),
|
|
181
|
+
M.jsonErr(500, models.ErrorsErrorResponse$inboundSchema),
|
|
182
|
+
M.fail("4XX"),
|
|
183
|
+
M.fail("5XX"),
|
|
184
|
+
)(response, req, { extraFields: responseFields });
|
|
185
|
+
if (!result.ok) {
|
|
186
|
+
return [result, { status: "complete", request: req, response }];
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return [result, { status: "complete", request: req, response }];
|
|
190
|
+
}
|
|
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
30
30
|
* Terminate commitment
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
|
-
* Ends a commitment
|
|
33
|
+
* Ends a commitment immediately. effective_at defaults to now and cannot be in the future. Under billing terms, its scheduled instalments are cancelled, and those already due by effective_at are billed together as one settlement; later instalments are not billed and nothing is refunded. The settlement and a fixed cancellation fee, when given, are billed together on one one-off invoice.
|
|
34
34
|
*/
|
|
35
35
|
export function commitmentsTerminateCommitment(
|
|
36
36
|
client: TirdadCore,
|