import * as z from "zod/v3"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The type of event to retrieve analytics for. Defaults to `clicks`. */ export declare const Event: { readonly Clicks: "clicks"; readonly Leads: "leads"; readonly Sales: "sales"; readonly Composite: "composite"; }; /** * The type of event to retrieve analytics for. Defaults to `clicks`. */ export type Event = ClosedEnum; /** * The parameter to group the analytics data points by. Defaults to `count` if undefined. */ export declare const QueryParamGroupBy: { readonly Count: "count"; readonly Timeseries: "timeseries"; readonly Continents: "continents"; readonly Regions: "regions"; readonly Countries: "countries"; readonly Cities: "cities"; readonly Devices: "devices"; readonly Browsers: "browsers"; readonly Os: "os"; readonly Trigger: "trigger"; readonly Triggers: "triggers"; readonly Referers: "referers"; readonly RefererUrls: "referer_urls"; readonly TopFolders: "top_folders"; readonly TopLinkTags: "top_link_tags"; readonly TopDomains: "top_domains"; readonly TopLinks: "top_links"; readonly TopUrls: "top_urls"; readonly TopBaseUrls: "top_base_urls"; readonly TopPartners: "top_partners"; readonly TopGroups: "top_groups"; readonly UtmSources: "utm_sources"; readonly UtmMediums: "utm_mediums"; readonly UtmCampaigns: "utm_campaigns"; readonly UtmTerms: "utm_terms"; readonly UtmContents: "utm_contents"; }; /** * The parameter to group the analytics data points by. Defaults to `count` if undefined. */ export type QueryParamGroupBy = ClosedEnum; /** * The interval to retrieve analytics for. If undefined, defaults to 24h. */ export declare const Interval: { readonly TwentyFourh: "24h"; readonly Sevend: "7d"; readonly Thirtyd: "30d"; readonly Ninetyd: "90d"; readonly Oney: "1y"; readonly Mtd: "mtd"; readonly Qtd: "qtd"; readonly Ytd: "ytd"; readonly All: "all"; }; /** * The interval to retrieve analytics for. If undefined, defaults to 24h. */ export type Interval = ClosedEnum; /** * Filter sales by type: 'new' for first-time purchases, 'recurring' for repeat purchases. If undefined, returns both. */ export declare const SaleType: { readonly New: "new"; readonly Recurring: "recurring"; }; /** * Filter sales by type: 'new' for first-time purchases, 'recurring' for repeat purchases. If undefined, returns both. */ export type SaleType = ClosedEnum; export type RetrieveAnalyticsRequest = { /** * The type of event to retrieve analytics for. Defaults to `clicks`. */ event?: Event | undefined; /** * The parameter to group the analytics data points by. Defaults to `count` if undefined. */ groupBy?: QueryParamGroupBy | undefined; /** * The domain to filter analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `dub.co`, `dub.co,google.com`, `-spam.com`. */ domain?: string | undefined; /** * The slug of the short link to retrieve analytics for. Must be used along with the corresponding `domain` of the short link to fetch analytics for a specific short link. */ key?: string | undefined; /** * The unique ID of the link to retrieve analytics for.Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `link_123`, `link_123,link_456`, `-link_789`. */ linkId?: string | undefined; /** * The ID of the link in the your database. Must be prefixed with 'ext_' when passed as a query parameter. */ externalId?: string | undefined; /** * The ID of the tenant that created the link inside your system. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `tenant_123`, `tenant_123,tenant_456`, `-tenant_789`. */ tenantId?: string | undefined; /** * The tag ID to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `tag_123`, `tag_123,tag_456`, `-tag_789`. */ tagId?: string | undefined; /** * The folder ID to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `folder_123`, `folder_123,folder_456`, `-folder_789`. If not provided, return analytics for all links. */ folderId?: string | undefined; /** * The group ID to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `grp_123`, `grp_123,grp_456`, `-grp_789`. */ groupId?: string | undefined; /** * The ID of the partner to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `pn_123`, `pn_123,pn_456`, `-pn_789`. */ partnerId?: string | undefined; /** * The ID of the customer to retrieve analytics for. */ customerId?: string | undefined; /** * The interval to retrieve analytics for. If undefined, defaults to 24h. */ interval?: Interval | undefined; /** * The start date and time when to retrieve analytics from. If set, takes precedence over `interval`. */ start?: string | undefined; /** * The end date and time when to retrieve analytics from. If not provided, defaults to the current date. If set along with `start`, takes precedence over `interval`. */ end?: string | undefined; /** * The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC. */ timezone?: string | undefined; /** * The country to retrieve analytics for. Must be passed as a 2-letter ISO 3166-1 country code (see https://d.to/geo). Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `US`, `US,BR,FR`, `-US`. */ country?: string | undefined; /** * The city to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `New York`, `New York,London`, `-New York`. */ city?: string | undefined; /** * The ISO 3166-2 region code to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `NY`, `NY,CA`, `-NY`. */ region?: string | undefined; /** * The continent to retrieve analytics for. Valid values: AF, AN, AS, EU, NA, OC, SA. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `NA`, `NA,EU`, `-AS`. */ continent?: string | undefined; /** * The device to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Desktop`, `Mobile,Tablet`, `-Mobile`. */ device?: string | undefined; /** * The browser to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Chrome`, `Chrome,Firefox,Safari`, `-IE`. */ browser?: string | undefined; /** * The OS to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `Windows`, `Mac,Windows,Linux`, `-Windows`. */ os?: string | undefined; /** * The trigger to retrieve analytics for. Valid values: qr, link, pageview. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `qr`, `qr,link`, `-qr`. If undefined, returns all trigger types. */ trigger?: string | undefined; /** * The referer hostname to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `google.com`, `google.com,twitter.com`, `-facebook.com`. */ referer?: string | undefined; /** * The full referer URL to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `https://google.com`, `https://google.com,https://twitter.com`, `-https://spam.com`. */ refererUrl?: string | undefined; /** * The destination URL to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `https://example.com`, `https://example.com,https://other.com`, `-https://spam.com`. */ url?: string | undefined; /** * The UTM source to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `google`, `google,twitter`, `-spam`. */ utmSource?: string | undefined; /** * The UTM medium to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `cpc`, `cpc,social`, `-email`. */ utmMedium?: string | undefined; /** * The UTM campaign to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). Examples: `summer_sale`, `summer_sale,winter_sale`, `-old_campaign`. */ utmCampaign?: string | undefined; /** * The UTM term to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). */ utmTerm?: string | undefined; /** * The UTM content to retrieve analytics for. Supports advanced filtering: single value, multiple values (comma-separated), or exclusion (prefix with `-`). */ utmContent?: string | undefined; /** * Filter for root domains. If true, filter for domains only. If false, filter for links only. If undefined, return both. */ root?: boolean | undefined; /** * Filter sales by type: 'new' for first-time purchases, 'recurring' for repeat purchases. If undefined, returns both. */ saleType?: SaleType | undefined; /** * Search the events by a custom metadata value. Only available for lead and sale events. Examples: `metadata['key']:'value'` */ query?: string | undefined; /** * Deprecated: This is automatically inferred from your workspace's defaultProgramId. The ID of the program to retrieve analytics for. */ programId?: string | undefined; /** * Deprecated: Use `tagId` instead. The tag IDs to retrieve analytics for. */ tagIds?: string | undefined; /** * Deprecated: Use the `trigger` field instead. Filter for QR code scans. If true, filter for QR codes only. If false, filter for links only. If undefined, return both. */ qr?: boolean | undefined; }; /** * Analytics data */ export type RetrieveAnalyticsResponseBody = components.AnalyticsCount | Array | Array | Array | Array | Array | Array | Array | Array | Array | Array | Array | Array | Array; /** @internal */ export declare const Event$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const QueryParamGroupBy$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const Interval$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const SaleType$outboundSchema: z.ZodNativeEnum; /** @internal */ export type RetrieveAnalyticsRequest$Outbound = { event: string; groupBy: string; domain?: string | undefined; key?: string | undefined; linkId?: string | undefined; externalId?: string | undefined; tenantId?: string | undefined; tagId?: string | undefined; folderId?: string | undefined; groupId?: string | undefined; partnerId?: string | undefined; customerId?: string | undefined; interval?: string | undefined; start?: string | undefined; end?: string | undefined; timezone: string; country?: string | undefined; city?: string | undefined; region?: string | undefined; continent?: string | undefined; device?: string | undefined; browser?: string | undefined; os?: string | undefined; trigger?: string | undefined; referer?: string | undefined; refererUrl?: string | undefined; url?: string | undefined; utm_source?: string | undefined; utm_medium?: string | undefined; utm_campaign?: string | undefined; utm_term?: string | undefined; utm_content?: string | undefined; root?: boolean | undefined; saleType?: string | undefined; query?: string | undefined; programId?: string | undefined; tagIds?: string | undefined; qr?: boolean | undefined; }; /** @internal */ export declare const RetrieveAnalyticsRequest$outboundSchema: z.ZodType; export declare function retrieveAnalyticsRequestToJSON(retrieveAnalyticsRequest: RetrieveAnalyticsRequest): string; /** @internal */ export declare const RetrieveAnalyticsResponseBody$inboundSchema: z.ZodType; export declare function retrieveAnalyticsResponseBodyFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=retrieveanalytics.d.ts.map