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"; /** * The unique IDs of the tags assigned to the short link. */ export type CreatePartnerTagIds = string | Array; /** * The unique name of the tags assigned to the short link (case insensitive). */ export type CreatePartnerTagNames = string | Array; export type CreatePartnerTestVariants = { url: string; percentage: number; }; /** * Additional properties that you can pass to the partner's short link. Will be used to override the default link properties for this partner. */ export type LinkProps = { /** * The ID of the link in your database. If set, it can be used to identify the link in future API requests (must be prefixed with 'ext_' when passed as a query parameter). This key is unique across your workspace. */ externalId?: string | null | undefined; /** * The ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant. */ tenantId?: string | null | undefined; /** * Path prefix for each default referral link slug (e.g. `/c/` → `https://{domain}/c/{identity}`). If the group has multiple default links, a short random suffix is appended to the identity segment for uniqueness (e.g. `c/jane-a7f2`). */ prefix?: string | undefined; /** * Whether the short link is archived. Defaults to `false` if not provided. */ archived?: boolean | undefined; /** * The unique IDs of the tags assigned to the short link. */ tagIds?: string | Array | undefined; /** * The unique name of the tags assigned to the short link (case insensitive). */ tagNames?: string | Array | undefined; /** * The comments for the short link. */ comments?: string | null | undefined; /** * The date and time when the short link will expire at. */ expiresAt?: string | null | undefined; /** * The URL to redirect to when the short link has expired. */ expiredUrl?: string | null | undefined; /** * The password required to access the destination URL of the short link. */ password?: string | null | undefined; /** * Whether the short link uses Custom Link Previews feature. Defaults to `false` if not provided. */ proxy?: boolean | undefined; /** * The custom link preview title (og:title). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og */ title?: string | null | undefined; /** * The custom link preview description (og:description). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og */ description?: string | null | undefined; /** * The custom link preview image (og:image). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og */ image?: string | null | undefined; /** * The custom link preview video (og:video). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og */ video?: string | null | undefined; /** * Whether the short link uses link cloaking. Defaults to `false` if not provided. */ rewrite?: boolean | undefined; /** * The iOS destination URL for the short link for iOS device targeting. */ ios?: string | null | undefined; /** * The Android destination URL for the short link for Android device targeting. */ android?: string | null | undefined; /** * Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex */ doIndex?: boolean | undefined; /** * An array of A/B test URLs and the percentage of traffic to send to each URL. */ testVariants?: Array | null | undefined; /** * The date and time when the tests started. */ testStartedAt?: string | null | undefined; /** * The date and time when the tests were or will be completed. */ testCompletedAt?: string | null | undefined; }; export type CreatePartnerRequestBody = { /** * The partner's full name. If undefined, the partner's email will be used in lieu of their name (e.g. `john@acme.com`) */ name?: string | null | undefined; /** * The partner's email address. Partners will be able to claim their profile by signing up at `partners.dub.co` with this email. */ email: string; /** * The partner's unique username in your system (max 100 characters). This will be used to create a short link for the partner using your program's default domain. If not provided, Dub will try to generate a username from the partner's name or email. */ username?: string | null | undefined; /** * The partner's avatar image. If not provided, a default avatar will be used. */ image?: string | null | undefined; /** * The partner's unique ID in your system. Useful for retrieving the partner's links and stats later on. If not provided, the partner will be created as a standalone partner. */ tenantId?: string | undefined; /** * The group ID to add the partner to. If not provided, the partner will be added to the default group. */ groupId?: string | undefined; /** * The partner's country of residence. Must be passed as a 2-letter ISO 3166-1 country code. See https://d.to/geo for more information. */ country?: string | null | undefined; /** * A brief description of the partner and their background. Max 5,000 characters. */ description?: string | null | undefined; /** * Additional properties that you can pass to the partner's short link. Will be used to override the default link properties for this partner. */ linkProps?: LinkProps | undefined; }; /** * The partner's default payout method. Connect: Bank account payouts via Stripe Connect; Stablecoin: USDC payouts directly to a crypto wallet; PayPal: Payouts via PayPal */ export declare const CreatePartnerDefaultPayoutMethod: { readonly Connect: "connect"; readonly Stablecoin: "stablecoin"; readonly Paypal: "paypal"; }; /** * The partner's default payout method. Connect: Bank account payouts via Stripe Connect; Stablecoin: USDC payouts directly to a crypto wallet; PayPal: Payouts via PayPal */ export type CreatePartnerDefaultPayoutMethod = ClosedEnum; /** * The status of the partner's enrollment in the program. */ export declare const CreatePartnerStatus: { readonly Pending: "pending"; readonly Approved: "approved"; readonly Rejected: "rejected"; readonly Invited: "invited"; readonly Declined: "declined"; readonly Deactivated: "deactivated"; readonly Banned: "banned"; readonly Archived: "archived"; }; /** * The status of the partner's enrollment in the program. */ export type CreatePartnerStatus = ClosedEnum; export type CreatePartnerLinks = { /** * The unique ID of the short link. */ id: 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; /** * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). */ shortLink: string; /** * The destination URL of the short link. */ url: string; /** * The number of clicks on the short link. */ clicks: number; /** * The number of leads the short link has generated. */ leads: number; /** * The number of leads that converted to paying customers. */ conversions: number; /** * The total number of sales (includes recurring sales) generated by the short link. */ sales: number; /** * The total dollar value of sales (in cents) generated by the short link. */ saleAmount: number; }; /** * If the partner was banned from the program, this is the reason for the ban. */ export declare const CreatePartnerBannedReason: { readonly TosViolation: "tos_violation"; readonly InappropriateContent: "inappropriate_content"; readonly FakeTraffic: "fake_traffic"; readonly Fraud: "fraud"; readonly Spam: "spam"; readonly BrandAbuse: "brand_abuse"; }; /** * If the partner was banned from the program, this is the reason for the ban. */ export type CreatePartnerBannedReason = ClosedEnum; export type Fields8 = { key: string; label: string; required: boolean; locked: boolean; position: number; type: "phone"; }; export type Fields7 = { key: string; label: string; required: boolean; locked: boolean; position: number; type: "number"; }; export type CreatePartnerFieldsPartnersOptions = { label: string; value: string; }; export type Fields6 = { key: string; label: string; required: boolean; locked: boolean; position: number; type: "multiSelect"; options: Array; }; export type Fields5 = { key: string; label: string; required: boolean; locked: boolean; position: number; type: "date"; }; export type CreatePartnerFields4 = { key: string; label: string; required: boolean; locked: boolean; position: number; type: "country"; }; export type CreatePartnerFieldsOptions = { label: string; value: string; }; export type CreatePartnerFields3 = { key: string; label: string; required: boolean; locked: boolean; position: number; type: "select"; options: Array; }; export type CreatePartnerFieldsPartnersConstraints = { maxLength?: number | undefined; }; export type CreatePartnerFields2 = { key: string; label: string; required: boolean; locked: boolean; position: number; type: "textarea"; constraints?: CreatePartnerFieldsPartnersConstraints | undefined; }; export type CreatePartnerFieldsConstraints = { maxLength?: number | undefined; pattern?: string | undefined; }; export type CreatePartnerFields1 = { key: string; label: string; required: boolean; locked: boolean; position: number; type: "text"; constraints?: CreatePartnerFieldsConstraints | undefined; }; export type CreatePartnerFields = CreatePartnerFields1 | CreatePartnerFields2 | CreatePartnerFields3 | CreatePartnerFields4 | Fields5 | Fields6 | Fields7 | Fields8; export type CreatePartnerReferralFormData = { fields: Array; }; /** * Preset reason when the application was rejected. */ export declare const CreatePartnerRejectionReason: { readonly NeedsMoreDetail: "needsMoreDetail"; readonly DoesNotMeetRequirements: "doesNotMeetRequirements"; readonly NotTheRightFit: "notTheRightFit"; readonly Other: "other"; }; /** * Preset reason when the application was rejected. */ export type CreatePartnerRejectionReason = ClosedEnum; /** * Linked program application, including review outcome when applicable. */ export type CreatePartnerApplication = { /** * Preset reason when the application was rejected. */ rejectionReason: CreatePartnerRejectionReason | null; /** * Free-form note when the application was rejected. */ rejectionNote: string | null; /** * When the application was approved or rejected. */ reviewedAt: string | null; }; /** * The created or updated partner */ export type CreatePartnerResponseBody = { /** * The partner's unique ID on Dub. */ id: string; /** * The partner's full legal name. */ name: string; /** * If the partner profile type is a company, this is the partner's legal company name. */ companyName: string | null; /** * The partner's email address. Should be a unique value across Dub. */ email: string | null; /** * The partner's avatar image. */ image: string | null; /** * A brief description of the partner and their background. */ description?: string | null | undefined; /** * The partner's country (required for tax purposes). */ country: string | null; /** * The partner's default payout method. Connect: Bank account payouts via Stripe Connect; Stablecoin: USDC payouts directly to a crypto wallet; PayPal: Payouts via PayPal */ defaultPayoutMethod: CreatePartnerDefaultPayoutMethod | null; /** * The partner's PayPal email (for receiving payouts via PayPal). */ paypalEmail: string | null; /** * The partner's Stripe Connect ID (for receiving payouts via Stripe). */ stripeConnectId: string | null; /** * The date when the partner enabled payouts. */ payoutsEnabledAt: string | null; /** * The date when the partner received the trusted badge in the partner network. */ trustedAt: string | null; /** * The program's unique ID on Dub. */ programId: string; /** * The partner's group ID on Dub. */ groupId?: string | null | undefined; /** * The partner's unique ID on Dub. */ partnerId: string; /** * The partner's unique ID within your database. Can be useful for associating the partner with a user in your database and retrieving/update their data in the future. */ tenantId: string | null; createdAt: string; /** * The status of the partner's enrollment in the program. */ status: CreatePartnerStatus; /** * The partner's referral links in this program. */ links: Array | null; /** * The total commissions paid to the partner for their referrals */ totalCommissions: number; clickRewardId?: string | null | undefined; leadRewardId?: string | null | undefined; saleRewardId?: string | null | undefined; discountId?: string | null | undefined; /** * If the partner submitted an application to join the program, this is the ID of the application. */ applicationId?: string | null | undefined; /** * If the partner was banned from the program, this is the date of the ban. */ bannedAt?: string | null | undefined; /** * If the partner was banned from the program, this is the reason for the ban. */ bannedReason?: CreatePartnerBannedReason | null | undefined; referralFormData?: CreatePartnerReferralFormData | null | undefined; /** * Linked program application, including review outcome when applicable. */ application?: CreatePartnerApplication | null | undefined; /** * The total number of clicks on the partner's links */ totalClicks: number; /** * The total number of leads generated by the partner's links */ totalLeads: number; /** * The total number of leads that converted to paying customers */ totalConversions: number; /** * The total number of sales generated by the partner's links (includes recurring sales) */ totalSales: number; /** * Total revenue generated by the partner's links */ totalSaleAmount: number; /** * Net revenue after commissions (`Total Revenue - Total Commissions`) */ netRevenue: number; /** * Earnings Per Click (EPC) (`Total Revenue ÷ Total Clicks`) */ earningsPerClick?: number | null | undefined; /** * Average lifetime value for each paying customer (`Total Revenue ÷ Total Conversions`) */ averageLifetimeValue?: number | null | undefined; /** * Percentage of clicks that become leads (`Total Leads ÷ Total Clicks`) */ clickToLeadRate?: number | null | undefined; /** * Percentage of clicks that convert to paying customers (`Total Conversions ÷ Total Clicks`) */ clickToConversionRate?: number | null | undefined; /** * Percentage of leads that convert to paying customers (`Total Conversions ÷ Total Leads`) */ leadToConversionRate?: number | null | undefined; /** * Return On Ad Spend (ROAS) (`Total Revenue ÷ Total Commissions`) */ returnOnAdSpend?: number | null | undefined; /** * The partner's website URL (including the https protocol). */ website?: string | null | undefined; /** * The partner's YouTube channel username (e.g. `johndoe`). */ youtube?: string | null | undefined; /** * The partner's Twitter username (e.g. `johndoe`). */ twitter?: string | null | undefined; /** * The partner's LinkedIn username (e.g. `johndoe`). */ linkedin?: string | null | undefined; /** * The partner's Instagram username (e.g. `johndoe`). */ instagram?: string | null | undefined; /** * The partner's TikTok username (e.g. `johndoe`). */ tiktok?: string | null | undefined; }; /** @internal */ export type CreatePartnerTagIds$Outbound = string | Array; /** @internal */ export declare const CreatePartnerTagIds$outboundSchema: z.ZodType; export declare function createPartnerTagIdsToJSON(createPartnerTagIds: CreatePartnerTagIds): string; /** @internal */ export type CreatePartnerTagNames$Outbound = string | Array; /** @internal */ export declare const CreatePartnerTagNames$outboundSchema: z.ZodType; export declare function createPartnerTagNamesToJSON(createPartnerTagNames: CreatePartnerTagNames): string; /** @internal */ export type CreatePartnerTestVariants$Outbound = { url: string; percentage: number; }; /** @internal */ export declare const CreatePartnerTestVariants$outboundSchema: z.ZodType; export declare function createPartnerTestVariantsToJSON(createPartnerTestVariants: CreatePartnerTestVariants): string; /** @internal */ export type LinkProps$Outbound = { externalId?: string | null | undefined; tenantId?: string | null | undefined; prefix?: string | undefined; archived?: boolean | undefined; tagIds?: string | Array | undefined; tagNames?: string | Array | undefined; comments?: string | null | undefined; expiresAt?: string | null | undefined; expiredUrl?: string | null | undefined; password?: string | null | undefined; proxy?: boolean | undefined; title?: string | null | undefined; description?: string | null | undefined; image?: string | null | undefined; video?: string | null | undefined; rewrite?: boolean | undefined; ios?: string | null | undefined; android?: string | null | undefined; doIndex?: boolean | undefined; testVariants?: Array | null | undefined; testStartedAt?: string | null | undefined; testCompletedAt?: string | null | undefined; }; /** @internal */ export declare const LinkProps$outboundSchema: z.ZodType; export declare function linkPropsToJSON(linkProps: LinkProps): string; /** @internal */ export type CreatePartnerRequestBody$Outbound = { name?: string | null | undefined; email: string; username?: string | null | undefined; image?: string | null | undefined; tenantId?: string | undefined; groupId?: string | undefined; country?: string | null | undefined; description?: string | null | undefined; linkProps?: LinkProps$Outbound | undefined; }; /** @internal */ export declare const CreatePartnerRequestBody$outboundSchema: z.ZodType; export declare function createPartnerRequestBodyToJSON(createPartnerRequestBody: CreatePartnerRequestBody): string; /** @internal */ export declare const CreatePartnerDefaultPayoutMethod$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const CreatePartnerStatus$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const CreatePartnerLinks$inboundSchema: z.ZodType; export declare function createPartnerLinksFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreatePartnerBannedReason$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const Fields8$inboundSchema: z.ZodType; export declare function fields8FromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Fields7$inboundSchema: z.ZodType; export declare function fields7FromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreatePartnerFieldsPartnersOptions$inboundSchema: z.ZodType; export declare function createPartnerFieldsPartnersOptionsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Fields6$inboundSchema: z.ZodType; export declare function fields6FromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Fields5$inboundSchema: z.ZodType; export declare function fields5FromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreatePartnerFields4$inboundSchema: z.ZodType; export declare function createPartnerFields4FromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreatePartnerFieldsOptions$inboundSchema: z.ZodType; export declare function createPartnerFieldsOptionsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreatePartnerFields3$inboundSchema: z.ZodType; export declare function createPartnerFields3FromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreatePartnerFieldsPartnersConstraints$inboundSchema: z.ZodType; export declare function createPartnerFieldsPartnersConstraintsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreatePartnerFields2$inboundSchema: z.ZodType; export declare function createPartnerFields2FromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreatePartnerFieldsConstraints$inboundSchema: z.ZodType; export declare function createPartnerFieldsConstraintsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreatePartnerFields1$inboundSchema: z.ZodType; export declare function createPartnerFields1FromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreatePartnerFields$inboundSchema: z.ZodType; export declare function createPartnerFieldsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreatePartnerReferralFormData$inboundSchema: z.ZodType; export declare function createPartnerReferralFormDataFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreatePartnerRejectionReason$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const CreatePartnerApplication$inboundSchema: z.ZodType; export declare function createPartnerApplicationFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const CreatePartnerResponseBody$inboundSchema: z.ZodType; export declare function createPartnerResponseBodyFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=createpartner.d.ts.map