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"; import { LinkTagSchema, LinkTagSchema$Outbound } from "./linktagschema.js"; export declare const Three: { readonly LinkDeleted: "link.deleted"; }; export type Three = ClosedEnum; export declare const Two: { readonly LinkUpdated: "link.updated"; }; export type Two = ClosedEnum; export declare const One: { readonly LinkCreated: "link.created"; }; export type One = ClosedEnum; export type Event = One | Two | Three; export type LinkWebhookEventTestVariants = { url: string; percentage: number; }; export type Data = { /** * 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; url: string; trackConversion: boolean; /** * 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; /** * 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; /** * The ID of the program the short link is associated with. */ programId: string | null; /** * The ID of the partner the short link is associated with. */ partnerId: string | null; archived: boolean; expiresAt: string; expiredUrl: string | null; disabledAt: string; /** * The password required to access the destination URL of the short link. */ password: string | null; proxy: boolean; /** * The title of the short link. Will be used for Custom Link Previews if `proxy` is true. */ title: string | null; /** * The description of the short link. Will be used for Custom Link Previews if `proxy` is true. */ description: string | null; /** * The image of the short link. Will be used for Custom Link Previews if `proxy` is true. */ image: string | null; /** * 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; rewrite: boolean; doIndex: boolean; /** * The iOS destination URL for the short link for iOS device targeting. */ ios: string | null; /** * The Android destination URL for the short link for Android device targeting. */ android: string | null; /** * Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information. */ geo: { [k: string]: string; } | null; publicStats: boolean; /** * The tags assigned to the short link. */ tags: Array | null; /** * The unique ID of the folder assigned to the short link. */ folderId: string | null; /** * The IDs of the webhooks that the short link is associated with. */ webhookIds: Array; /** * The comments for the short link. */ comments: string | null; /** * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). */ shortLink: string; /** * The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`). */ qrCode: string; /** * The UTM source of the short link. */ utmSource: string | null; /** * The UTM medium of the short link. */ utmMedium: string | null; /** * The UTM campaign of the short link. */ utmCampaign: string | null; /** * The UTM term of the short link. */ utmTerm: string | null; /** * The UTM content of the short link. */ utmContent: string | null; /** * An array of A/B test URLs and the percentage of traffic to send to each URL. */ testVariants?: Array | null | undefined; testStartedAt: string; testCompletedAt: string; userId: string | null; /** * The workspace ID of the short link. */ workspaceId: string; /** * The number of clicks on the short link. */ clicks?: number | undefined; /** * The number of leads the short link has generated. */ leads?: number | undefined; /** * The number of leads that converted to paying customers. */ conversions?: number | undefined; /** * The total number of sales (includes recurring sales) generated by the short link. */ sales?: number | undefined; /** * The total dollar value of sales (in cents) generated by the short link. */ saleAmount?: number | undefined; lastClicked: string; createdAt: string; updatedAt: string; /** * Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ tagId: string | null; /** * Deprecated: Use `workspaceId` instead. The project ID of the short link. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ projectId: string; }; /** * Triggered when a link is created, updated, or deleted. */ export type LinkWebhookEvent = { id: string; event: One | Two | Three; createdAt: string; data: Data; }; /** @internal */ export declare const Three$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const Three$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const Two$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const Two$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const One$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const One$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const Event$inboundSchema: z.ZodType; /** @internal */ export type Event$Outbound = string | string | string; /** @internal */ export declare const Event$outboundSchema: z.ZodType; export declare function eventToJSON(event: Event): string; export declare function eventFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const LinkWebhookEventTestVariants$inboundSchema: z.ZodType; /** @internal */ export type LinkWebhookEventTestVariants$Outbound = { url: string; percentage: number; }; /** @internal */ export declare const LinkWebhookEventTestVariants$outboundSchema: z.ZodType; export declare function linkWebhookEventTestVariantsToJSON(linkWebhookEventTestVariants: LinkWebhookEventTestVariants): string; export declare function linkWebhookEventTestVariantsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Data$inboundSchema: z.ZodType; /** @internal */ export type Data$Outbound = { id: string; domain: string; key: string; url: string; trackConversion: boolean; externalId: string | null; tenantId: string | null; programId: string | null; partnerId: string | null; archived: boolean; expiresAt: string; expiredUrl: string | null; disabledAt: string; password: string | null; proxy: boolean; title: string | null; description: string | null; image: string | null; video: string | null; rewrite: boolean; doIndex: boolean; ios: string | null; android: string | null; geo: { [k: string]: string; } | null; publicStats: boolean; tags: Array | null; folderId: string | null; webhookIds: Array; comments: string | null; shortLink: string; qrCode: string; utm_source: string | null; utm_medium: string | null; utm_campaign: string | null; utm_term: string | null; utm_content: string | null; testVariants?: Array | null | undefined; testStartedAt: string; testCompletedAt: string; userId: string | null; workspaceId: string; clicks: number; leads: number; conversions: number; sales: number; saleAmount: number; lastClicked: string; createdAt: string; updatedAt: string; tagId: string | null; projectId: string; }; /** @internal */ export declare const Data$outboundSchema: z.ZodType; export declare function dataToJSON(data: Data): string; export declare function dataFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const LinkWebhookEvent$inboundSchema: z.ZodType; /** @internal */ export type LinkWebhookEvent$Outbound = { id: string; event: string | string | string; createdAt: string; data: Data$Outbound; }; /** @internal */ export declare const LinkWebhookEvent$outboundSchema: z.ZodType; export declare function linkWebhookEventToJSON(linkWebhookEvent: LinkWebhookEvent): string; export declare function linkWebhookEventFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=linkwebhookevent.d.ts.map