import * as z from "zod/v3"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export declare const CommissionCreatedEventEvent: { readonly CommissionCreated: "commission.created"; }; export type CommissionCreatedEventEvent = ClosedEnum; export declare const CommissionCreatedEventType: { readonly Click: "click"; readonly Lead: "lead"; readonly Sale: "sale"; readonly Custom: "custom"; }; export type CommissionCreatedEventType = ClosedEnum; export declare const CommissionCreatedEventStatus: { readonly Pending: "pending"; readonly Processed: "processed"; readonly Paid: "paid"; readonly Refunded: "refunded"; readonly Duplicate: "duplicate"; readonly Fraud: "fraud"; readonly Canceled: "canceled"; }; export type CommissionCreatedEventStatus = ClosedEnum; export type CommissionCreatedEventPartner = { /** * The partner's unique ID on Dub. */ id: string; /** * The partner's full legal name. */ name: string; /** * The partner's email address. Should be a unique value across Dub. */ email: string | null; /** * The partner's avatar image. */ image: string | null; /** * The date when the partner enabled payouts. */ payoutsEnabledAt: string | null; /** * The partner's country (required for tax purposes). */ country: string | null; groupId?: string | null | undefined; totalClicks: number; totalLeads: number; totalConversions: number; totalSales: number; totalSaleAmount: number; totalCommissions: number; }; export type CommissionCreatedEventCustomer = { /** * The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). */ id: string; /** * Name of the customer. */ name: string; /** * Email of the customer. */ email?: string | null | undefined; /** * Avatar URL of the customer. */ avatar?: string | null | undefined; /** * Unique identifier for the customer in the client's app. */ externalId: string; /** * The customer's Stripe customer ID. This is useful for attributing recurring sale events to the partner who referred the customer. */ stripeCustomerId?: string | null | undefined; /** * Country of the customer. */ country?: string | null | undefined; /** * Total number of sales for the customer. */ sales?: number | null | undefined; /** * Total amount of sales for the customer. */ saleAmount?: number | null | undefined; /** * The date the customer was created (usually the signup date or trial start date). */ createdAt: string; /** * The date the customer made their first sale. Useful for calculating the time to first sale and LTV. */ firstSaleAt?: string | null | undefined; /** * The date the customer canceled their subscription. Useful for calculating LTV and churn rate. */ subscriptionCanceledAt?: string | null | undefined; }; export type CommissionCreatedEventLink = { /** * The unique ID of the short link. */ id: string; /** * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). */ shortLink: string; /** * The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains). */ domain: string; /** * The short link slug. If not provided, a random 7-character slug will be generated. */ key: string; }; export type CommissionCreatedEventData = { /** * The commission's unique ID on Dub. */ id: string; type?: CommissionCreatedEventType | undefined; amount: number; earnings: number; currency: string; status: CommissionCreatedEventStatus; invoiceId: string | null; description: string | null; quantity: number; /** * The user who created the manual commission. */ userId?: string | null | undefined; createdAt: string; updatedAt: string; partner: CommissionCreatedEventPartner; customer?: CommissionCreatedEventCustomer | null | undefined; link: CommissionCreatedEventLink | null; }; /** * Triggered when a commission is created for a partner. */ export type CommissionCreatedEvent = { id: string; event: CommissionCreatedEventEvent; createdAt: string; data: CommissionCreatedEventData; }; /** @internal */ export declare const CommissionCreatedEventEvent$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const CommissionCreatedEventEvent$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const CommissionCreatedEventType$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const CommissionCreatedEventType$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const CommissionCreatedEventStatus$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const CommissionCreatedEventStatus$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const CommissionCreatedEventPartner$inboundSchema: z.ZodType; /** @internal */ export type CommissionCreatedEventPartner$Outbound = { id: string; name: string; email: string | null; image: string | null; payoutsEnabledAt: string | null; country: string | null; groupId?: string | null | undefined; totalClicks: number; totalLeads: number; totalConversions: number; totalSales: number; totalSaleAmount: number; totalCommissions: number; }; /** @internal */ export declare const CommissionCreatedEventPartner$outboundSchema: z.ZodType; export declare function commissionCreatedEventPartnerToJSON(commissionCreatedEventPartner: CommissionCreatedEventPartner): string; export declare function commissionCreatedEventPartnerFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CommissionCreatedEventCustomer$inboundSchema: z.ZodType; /** @internal */ export type CommissionCreatedEventCustomer$Outbound = { id: string; name: string; email?: string | null | undefined; avatar?: string | null | undefined; externalId: string; stripeCustomerId?: string | null | undefined; country?: string | null | undefined; sales?: number | null | undefined; saleAmount?: number | null | undefined; createdAt: string; firstSaleAt?: string | null | undefined; subscriptionCanceledAt?: string | null | undefined; }; /** @internal */ export declare const CommissionCreatedEventCustomer$outboundSchema: z.ZodType; export declare function commissionCreatedEventCustomerToJSON(commissionCreatedEventCustomer: CommissionCreatedEventCustomer): string; export declare function commissionCreatedEventCustomerFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CommissionCreatedEventLink$inboundSchema: z.ZodType; /** @internal */ export type CommissionCreatedEventLink$Outbound = { id: string; shortLink: string; domain: string; key: string; }; /** @internal */ export declare const CommissionCreatedEventLink$outboundSchema: z.ZodType; export declare function commissionCreatedEventLinkToJSON(commissionCreatedEventLink: CommissionCreatedEventLink): string; export declare function commissionCreatedEventLinkFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CommissionCreatedEventData$inboundSchema: z.ZodType; /** @internal */ export type CommissionCreatedEventData$Outbound = { id: string; type?: string | undefined; amount: number; earnings: number; currency: string; status: string; invoiceId: string | null; description: string | null; quantity: number; userId?: string | null | undefined; createdAt: string; updatedAt: string; partner: CommissionCreatedEventPartner$Outbound; customer?: CommissionCreatedEventCustomer$Outbound | null | undefined; link: CommissionCreatedEventLink$Outbound | null; }; /** @internal */ export declare const CommissionCreatedEventData$outboundSchema: z.ZodType; export declare function commissionCreatedEventDataToJSON(commissionCreatedEventData: CommissionCreatedEventData): string; export declare function commissionCreatedEventDataFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CommissionCreatedEvent$inboundSchema: z.ZodType; /** @internal */ export type CommissionCreatedEvent$Outbound = { id: string; event: string; createdAt: string; data: CommissionCreatedEventData$Outbound; }; /** @internal */ export declare const CommissionCreatedEvent$outboundSchema: z.ZodType; export declare function commissionCreatedEventToJSON(commissionCreatedEvent: CommissionCreatedEvent): string; export declare function commissionCreatedEventFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=commissioncreatedevent.d.ts.map