chargebee
Version:
A library for integrating with Chargebee.
509 lines (508 loc) • 18.7 kB
JavaScript
"use strict";
// Generated Zod schemas: WebhookEndpoint
// Actions: create, update, list
// Do not edit manually – regenerate via sdk-generator
Object.defineProperty(exports, "__esModule", { value: true });
exports.ListWebhookEndpointBodySchema = exports.UpdateWebhookEndpointBodySchema = exports.CreateWebhookEndpointBodySchema = void 0;
const zod_1 = require("zod");
//WebhookEndpoint.create
const CreateWebhookEndpointBodySchema = zod_1.z.looseObject({
name: zod_1.z.string().max(50),
api_version: zod_1.z.enum(['v1', 'v2']).optional(),
url: zod_1.z.string().max(512),
primary_url: zod_1.z.boolean().default(false).optional(),
disabled: zod_1.z.boolean().default(false).optional(),
basic_auth_password: zod_1.z.string().max(250).optional(),
basic_auth_username: zod_1.z.string().max(250).optional(),
send_card_resource: zod_1.z.boolean().default(false).optional(),
chargebee_response_schema_type: zod_1.z
.enum(['plans_addons', 'items', 'compat'])
.optional(),
enabled_events: zod_1.z
.array(zod_1.z
.enum([
'coupon_created',
'coupon_updated',
'coupon_deleted',
'coupon_set_created',
'coupon_set_updated',
'coupon_set_deleted',
'coupon_codes_added',
'coupon_codes_deleted',
'coupon_codes_updated',
'customer_created',
'customer_changed',
'customer_deleted',
'customer_moved_out',
'customer_moved_in',
'promotional_credits_added',
'promotional_credits_deducted',
'subscription_created',
'subscription_created_with_backdating',
'subscription_started',
'subscription_trial_end_reminder',
'subscription_activated',
'subscription_activated_with_backdating',
'subscription_changed',
'subscription_trial_extended',
'mrr_updated',
'subscription_changed_with_backdating',
'subscription_cancellation_scheduled',
'subscription_cancellation_reminder',
'subscription_cancelled',
'subscription_canceled_with_backdating',
'subscription_reactivated',
'subscription_reactivated_with_backdating',
'subscription_renewed',
'subscription_items_renewed',
'subscription_scheduled_cancellation_removed',
'subscription_changes_scheduled',
'subscription_scheduled_changes_removed',
'subscription_shipping_address_updated',
'subscription_deleted',
'subscription_paused',
'subscription_pause_scheduled',
'subscription_scheduled_pause_removed',
'subscription_resumed',
'subscription_resumption_scheduled',
'subscription_scheduled_resumption_removed',
'subscription_advance_invoice_schedule_added',
'subscription_advance_invoice_schedule_updated',
'subscription_advance_invoice_schedule_removed',
'pending_invoice_created',
'pending_invoice_updated',
'invoice_generated',
'invoice_generated_with_backdating',
'invoice_updated',
'invoice_deleted',
'credit_note_created',
'credit_note_created_with_backdating',
'credit_note_updated',
'credit_note_deleted',
'payment_schedules_created',
'payment_schedules_updated',
'payment_schedule_scheme_created',
'payment_schedule_scheme_deleted',
'subscription_renewal_reminder',
'add_usages_reminder',
'payment_due_reminder',
'transaction_created',
'transaction_updated',
'transaction_deleted',
'payment_succeeded',
'payment_failed',
'dunning_updated',
'payment_refunded',
'payment_initiated',
'refund_initiated',
'netd_payment_due_reminder',
'authorization_succeeded',
'authorization_voided',
'card_added',
'card_updated',
'card_expiry_reminder',
'card_expired',
'card_deleted',
'payment_source_added',
'payment_source_updated',
'payment_source_deleted',
'payment_source_expiring',
'payment_source_expired',
'payment_source_locally_deleted',
'virtual_bank_account_added',
'virtual_bank_account_updated',
'virtual_bank_account_deleted',
'token_created',
'token_consumed',
'token_expired',
'unbilled_charges_created',
'unbilled_charges_voided',
'unbilled_charges_deleted',
'unbilled_charges_invoiced',
'order_created',
'order_updated',
'order_cancelled',
'order_delivered',
'order_returned',
'order_ready_to_process',
'order_ready_to_ship',
'order_deleted',
'order_resent',
'quote_created',
'quote_updated',
'quote_deleted',
'tax_withheld_recorded',
'tax_withheld_deleted',
'tax_withheld_refunded',
'gift_scheduled',
'gift_unclaimed',
'gift_claimed',
'gift_expired',
'gift_cancelled',
'gift_updated',
'hierarchy_created',
'hierarchy_deleted',
'payment_intent_created',
'payment_intent_updated',
'contract_term_created',
'contract_term_renewed',
'contract_term_terminated',
'contract_term_completed',
'contract_term_cancelled',
'item_family_created',
'item_family_updated',
'item_family_deleted',
'item_created',
'item_updated',
'item_deleted',
'item_price_created',
'item_price_updated',
'item_price_deleted',
'attached_item_created',
'attached_item_updated',
'attached_item_deleted',
'differential_price_created',
'differential_price_updated',
'differential_price_deleted',
'feature_created',
'feature_updated',
'feature_deleted',
'feature_activated',
'feature_reactivated',
'feature_archived',
'item_entitlements_updated',
'entitlement_overrides_updated',
'entitlement_overrides_removed',
'item_entitlements_removed',
'entitlement_overrides_auto_removed',
'subscription_entitlements_created',
'subscription_entitlements_updated',
'business_entity_created',
'business_entity_updated',
'business_entity_deleted',
'customer_business_entity_changed',
'subscription_business_entity_changed',
'purchase_created',
'voucher_created',
'voucher_expired',
'voucher_create_failed',
'product_created',
'product_updated',
'product_deleted',
'variant_created',
'variant_updated',
'variant_deleted',
'item_price_entitlements_updated',
'item_price_entitlements_removed',
'subscription_ramp_created',
'subscription_ramp_deleted',
'subscription_ramp_applied',
'subscription_ramp_drafted',
'subscription_ramp_updated',
'price_variant_created',
'price_variant_updated',
'price_variant_deleted',
'customer_entitlements_updated',
'subscription_moved_in',
'subscription_moved_out',
'subscription_movement_failed',
'omnichannel_subscription_created',
'omnichannel_subscription_item_renewed',
'omnichannel_subscription_item_downgrade_scheduled',
'omnichannel_subscription_item_scheduled_downgrade_removed',
'omnichannel_subscription_item_downgraded',
'omnichannel_subscription_item_expired',
'omnichannel_subscription_item_cancellation_scheduled',
'omnichannel_subscription_item_scheduled_cancellation_removed',
'omnichannel_subscription_item_resubscribed',
'omnichannel_subscription_item_upgraded',
'omnichannel_subscription_item_cancelled',
'omnichannel_subscription_imported',
'omnichannel_subscription_item_grace_period_started',
'omnichannel_subscription_item_grace_period_expired',
'omnichannel_subscription_item_dunning_started',
'omnichannel_subscription_item_dunning_expired',
'rule_created',
'rule_updated',
'rule_deleted',
'record_purchase_failed',
'omnichannel_subscription_item_change_scheduled',
'omnichannel_subscription_item_scheduled_change_removed',
'omnichannel_subscription_item_reactivated',
'sales_order_created',
'sales_order_updated',
'omnichannel_subscription_item_changed',
'omnichannel_subscription_item_paused',
'omnichannel_subscription_item_resumed',
'omnichannel_one_time_order_created',
'omnichannel_one_time_order_item_cancelled',
'usage_file_ingested',
'omnichannel_subscription_item_pause_scheduled',
'omnichannel_subscription_moved_in',
'omnichannel_transaction_created',
'alert_status_changed',
'omnichannel_subscription_item_updated',
'omnichannel_subscription_item_recovered',
'plan_created',
'plan_updated',
'plan_deleted',
'addon_created',
'addon_updated',
'addon_deleted',
])
.optional())
.optional(),
});
exports.CreateWebhookEndpointBodySchema = CreateWebhookEndpointBodySchema;
//WebhookEndpoint.update
const UpdateWebhookEndpointBodySchema = zod_1.z.looseObject({
name: zod_1.z.string().max(50).optional(),
api_version: zod_1.z.enum(['v1', 'v2']).optional(),
url: zod_1.z.string().max(512).optional(),
primary_url: zod_1.z.boolean().default(false).optional(),
send_card_resource: zod_1.z.boolean().default(false).optional(),
basic_auth_password: zod_1.z.string().max(250).optional(),
basic_auth_username: zod_1.z.string().max(250).optional(),
disabled: zod_1.z.boolean().default(false).optional(),
enabled_events: zod_1.z
.array(zod_1.z
.enum([
'coupon_created',
'coupon_updated',
'coupon_deleted',
'coupon_set_created',
'coupon_set_updated',
'coupon_set_deleted',
'coupon_codes_added',
'coupon_codes_deleted',
'coupon_codes_updated',
'customer_created',
'customer_changed',
'customer_deleted',
'customer_moved_out',
'customer_moved_in',
'promotional_credits_added',
'promotional_credits_deducted',
'subscription_created',
'subscription_created_with_backdating',
'subscription_started',
'subscription_trial_end_reminder',
'subscription_activated',
'subscription_activated_with_backdating',
'subscription_changed',
'subscription_trial_extended',
'mrr_updated',
'subscription_changed_with_backdating',
'subscription_cancellation_scheduled',
'subscription_cancellation_reminder',
'subscription_cancelled',
'subscription_canceled_with_backdating',
'subscription_reactivated',
'subscription_reactivated_with_backdating',
'subscription_renewed',
'subscription_items_renewed',
'subscription_scheduled_cancellation_removed',
'subscription_changes_scheduled',
'subscription_scheduled_changes_removed',
'subscription_shipping_address_updated',
'subscription_deleted',
'subscription_paused',
'subscription_pause_scheduled',
'subscription_scheduled_pause_removed',
'subscription_resumed',
'subscription_resumption_scheduled',
'subscription_scheduled_resumption_removed',
'subscription_advance_invoice_schedule_added',
'subscription_advance_invoice_schedule_updated',
'subscription_advance_invoice_schedule_removed',
'pending_invoice_created',
'pending_invoice_updated',
'invoice_generated',
'invoice_generated_with_backdating',
'invoice_updated',
'invoice_deleted',
'credit_note_created',
'credit_note_created_with_backdating',
'credit_note_updated',
'credit_note_deleted',
'payment_schedules_created',
'payment_schedules_updated',
'payment_schedule_scheme_created',
'payment_schedule_scheme_deleted',
'subscription_renewal_reminder',
'add_usages_reminder',
'payment_due_reminder',
'transaction_created',
'transaction_updated',
'transaction_deleted',
'payment_succeeded',
'payment_failed',
'dunning_updated',
'payment_refunded',
'payment_initiated',
'refund_initiated',
'netd_payment_due_reminder',
'authorization_succeeded',
'authorization_voided',
'card_added',
'card_updated',
'card_expiry_reminder',
'card_expired',
'card_deleted',
'payment_source_added',
'payment_source_updated',
'payment_source_deleted',
'payment_source_expiring',
'payment_source_expired',
'payment_source_locally_deleted',
'virtual_bank_account_added',
'virtual_bank_account_updated',
'virtual_bank_account_deleted',
'token_created',
'token_consumed',
'token_expired',
'unbilled_charges_created',
'unbilled_charges_voided',
'unbilled_charges_deleted',
'unbilled_charges_invoiced',
'order_created',
'order_updated',
'order_cancelled',
'order_delivered',
'order_returned',
'order_ready_to_process',
'order_ready_to_ship',
'order_deleted',
'order_resent',
'quote_created',
'quote_updated',
'quote_deleted',
'tax_withheld_recorded',
'tax_withheld_deleted',
'tax_withheld_refunded',
'gift_scheduled',
'gift_unclaimed',
'gift_claimed',
'gift_expired',
'gift_cancelled',
'gift_updated',
'hierarchy_created',
'hierarchy_deleted',
'payment_intent_created',
'payment_intent_updated',
'contract_term_created',
'contract_term_renewed',
'contract_term_terminated',
'contract_term_completed',
'contract_term_cancelled',
'item_family_created',
'item_family_updated',
'item_family_deleted',
'item_created',
'item_updated',
'item_deleted',
'item_price_created',
'item_price_updated',
'item_price_deleted',
'attached_item_created',
'attached_item_updated',
'attached_item_deleted',
'differential_price_created',
'differential_price_updated',
'differential_price_deleted',
'feature_created',
'feature_updated',
'feature_deleted',
'feature_activated',
'feature_reactivated',
'feature_archived',
'item_entitlements_updated',
'entitlement_overrides_updated',
'entitlement_overrides_removed',
'item_entitlements_removed',
'entitlement_overrides_auto_removed',
'subscription_entitlements_created',
'subscription_entitlements_updated',
'business_entity_created',
'business_entity_updated',
'business_entity_deleted',
'customer_business_entity_changed',
'subscription_business_entity_changed',
'purchase_created',
'voucher_created',
'voucher_expired',
'voucher_create_failed',
'product_created',
'product_updated',
'product_deleted',
'variant_created',
'variant_updated',
'variant_deleted',
'item_price_entitlements_updated',
'item_price_entitlements_removed',
'subscription_ramp_created',
'subscription_ramp_deleted',
'subscription_ramp_applied',
'subscription_ramp_drafted',
'subscription_ramp_updated',
'price_variant_created',
'price_variant_updated',
'price_variant_deleted',
'customer_entitlements_updated',
'subscription_moved_in',
'subscription_moved_out',
'subscription_movement_failed',
'omnichannel_subscription_created',
'omnichannel_subscription_item_renewed',
'omnichannel_subscription_item_downgrade_scheduled',
'omnichannel_subscription_item_scheduled_downgrade_removed',
'omnichannel_subscription_item_downgraded',
'omnichannel_subscription_item_expired',
'omnichannel_subscription_item_cancellation_scheduled',
'omnichannel_subscription_item_scheduled_cancellation_removed',
'omnichannel_subscription_item_resubscribed',
'omnichannel_subscription_item_upgraded',
'omnichannel_subscription_item_cancelled',
'omnichannel_subscription_imported',
'omnichannel_subscription_item_grace_period_started',
'omnichannel_subscription_item_grace_period_expired',
'omnichannel_subscription_item_dunning_started',
'omnichannel_subscription_item_dunning_expired',
'rule_created',
'rule_updated',
'rule_deleted',
'record_purchase_failed',
'omnichannel_subscription_item_change_scheduled',
'omnichannel_subscription_item_scheduled_change_removed',
'omnichannel_subscription_item_reactivated',
'sales_order_created',
'sales_order_updated',
'omnichannel_subscription_item_changed',
'omnichannel_subscription_item_paused',
'omnichannel_subscription_item_resumed',
'omnichannel_one_time_order_created',
'omnichannel_one_time_order_item_cancelled',
'usage_file_ingested',
'omnichannel_subscription_item_pause_scheduled',
'omnichannel_subscription_moved_in',
'omnichannel_transaction_created',
'alert_status_changed',
'omnichannel_subscription_item_updated',
'omnichannel_subscription_item_recovered',
'plan_created',
'plan_updated',
'plan_deleted',
'addon_created',
'addon_updated',
'addon_deleted',
])
.optional())
.optional(),
});
exports.UpdateWebhookEndpointBodySchema = UpdateWebhookEndpointBodySchema;
//WebhookEndpoint.list
const ListWebhookEndpointBodySchema = zod_1.z.looseObject({
limit: zod_1.z.number().int().min(1).max(100).optional(),
offset: zod_1.z.string().max(1000).optional(),
});
exports.ListWebhookEndpointBodySchema = ListWebhookEndpointBodySchema;