@unifygtm/intent-client
Version:
JavaScript client for interacting with the Unify Intent API in the browser.
311 lines (302 loc) • 12.3 kB
text/typescript
/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
*/
export interface paths {
"/identify": {
/** @description Send an "identify" event. */
post: operations["Identify_sendIdentify"];
};
"/page": {
/** @description Send a "page" event. */
post: operations["Page_sendPage"];
};
}
export type webhooks = Record<string, never>;
export interface components {
schemas: {
/** @description Contextual information about the user who "produced" the event. */
ActivityContext: {
/** @description Name and version of the library used to send the activity. */
library?: {
name?: string;
version?: string;
};
/** @description IP address for the user who performed the activity. */
ip?: components["schemas"]["ipv4"] | components["schemas"]["ipv6"];
/** @description Locale string for the user who performed the activity. */
locale?: string;
/** @description User agent string for the device. */
userAgent?: string;
/** @description User agent data for the device. */
userAgentData?: {
brands?: {
brand?: string;
version?: string;
}[];
mobile?: boolean;
platform?: string;
};
/** @description Marketing campaign information. */
utm?: components["schemas"]["CampaignParams"];
};
/** @description Properties that all analytics events share. */
AnalyticsEventBase: {
/** @description Type of analytics event being sent. */
type: components["schemas"]["AnalyticsEventType"];
/** @description Persistent identifier (e.g., database ID) for the user. */
userId?: string;
/** @description Identifier for the user when a persistent ID is not available. */
anonymousUserId: string;
/** @description Unique identifier for the user session. */
sessionId: string;
/**
* Format: date-time
* @description Event timestamp of the activity.
*/
timestamp: string;
/**
* Format: date-time
* @description Timestamp at which the request is sent.
*
* Typically, this value is nearly identical to `timestamp`. However in some
* situations there is latency between when the activity occurs and when it
* is sent to Unify.
*/
sentAt?: string;
/** @description Contextual information about the user behind the activity. */
context: components["schemas"]["ActivityContext"];
/**
* @deprecated
* @description Fingerprint information attached to the request.
*/
fingerprint?: {
visitorId?: string;
requestId?: string;
};
};
/**
* @description Event type supported by the analytics API.
* @enum {string}
*/
AnalyticsEventType: "page" | "track" | "identify";
/** @description UTM parameters for tracking marketing campaigns. */
CampaignParams: {
/** @description Source of the campaign. */
source?: string;
/** @description Medium of the campaign. */
medium?: string;
/** @description Name of the campaign. */
campaign?: string;
/** @description Term of the campaign. */
term?: string;
/** @description Content of the campaign. */
content?: string;
};
/** @description Identify event. */
IdentifyEvent: {
/**
* @description Type of analytics event being sent.
* @enum {string}
*/
type: "identify";
/** @description Persistent identifier (e.g., database ID) for the user. */
userId?: string;
/** @description Identifier for the user when a persistent ID is not available. */
anonymousUserId: string;
/** @description Unique identifier for the user session. */
sessionId: string;
/**
* Format: date-time
* @description Event timestamp of the activity.
*/
timestamp: string;
/**
* Format: date-time
* @description Timestamp at which the request is sent.
*
* Typically, this value is nearly identical to `timestamp`. However in some
* situations there is latency between when the activity occurs and when it
* is sent to Unify.
*/
sentAt?: string;
/** @description Contextual information about the user behind the activity. */
context: components["schemas"]["ActivityContext"];
/**
* @deprecated
* @description Fingerprint information attached to the request.
*/
fingerprint?: {
visitorId?: string;
requestId?: string;
};
/** @deprecated */
traits: components["schemas"]["Traits"];
/** @description Information about the company associated with the visitor. */
company?: {
/** @description Name of the company. */
name?: string;
/** @description Website domain of the company. */
domain: string;
/** @description Physical address of the company. */
address?: components["schemas"]["UTypes.UAddress"];
};
/** @description Information about the person associated with the visitor. */
person?: {
/** @description Email address of the person. */
email: string;
/** @description Physical address of the person. */
address?: components["schemas"]["UTypes.UAddress"];
/** @description First name of the person. */
firstName?: string;
/** @description Last name of the person. */
lastName?: string;
};
};
/** @description Page view event. */
PageEvent: {
/**
* @description Type of analytics event being sent.
* @enum {string}
*/
type: "page";
/** @description Persistent identifier (e.g., database ID) for the user. */
userId?: string;
/** @description Identifier for the user when a persistent ID is not available. */
anonymousUserId: string;
/** @description Unique identifier for the user session. */
sessionId: string;
/**
* Format: date-time
* @description Event timestamp of the activity.
*/
timestamp: string;
/**
* Format: date-time
* @description Timestamp at which the request is sent.
*
* Typically, this value is nearly identical to `timestamp`. However in some
* situations there is latency between when the activity occurs and when it
* is sent to Unify.
*/
sentAt?: string;
/** @description Contextual information about the user behind the activity. */
context: components["schemas"]["ActivityContext"];
/**
* @deprecated
* @description Fingerprint information attached to the request.
*/
fingerprint?: {
visitorId?: string;
requestId?: string;
};
/** @description Name of the page that was viewed. */
name?: string;
/** @description Details about the page that was viewed. */
properties?: components["schemas"]["PageProperties"];
};
/** @description Details about a page included in a `/page` request. */
PageProperties: {
/** @description Path of the page (equivalent to `location.pathname`). */
path?: string;
/** @description Query string parameters (equivalent to `location.search`). */
query?: {
[key: string]: string;
};
/** @description Referrer page's full URL (equivalent to `document.referrer`). */
referrer?: string;
/** @description Page title (equivalent to `document.title`). */
title?: string;
/** @description URL of the page (equivalent to `location.href`). */
url?: string;
};
/** @description Traits for the identify request payload. */
Traits: {
/** @description Email address of the visitor. */
email: string;
};
/**
* @description ISO 3166-1 alpha-2 country code.
* @enum {string}
*/
UCountryCode: "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "XK" | "YE" | "YT" | "ZA" | "ZM" | "ZW";
/** @description Composite object representing a physical address. */
"UTypes.UAddress": {
/** @description Country code in ISO 3166-1 alpha-2 format. */
country?: components["schemas"]["UCountryCode"];
/** @description State, province, region, or territory. */
administrativeArea?: string;
/** @description County or other secondary governmental division of an administrative area. */
subAdministrativeArea?: string;
/** @description City, town, or village. */
locality?: string;
/** @description Neighborhood, borough, district, or city sector. */
dependentLocality?: string;
/** @description Postal code or ZIP code. */
postalCode?: string;
/** @description Street name with elements such as street type or direction. */
thoroughfare?: string;
/** @description Street number or building name. */
premise?: string;
/** @description Apartment, suite, office number, or other secondary unit designator. */
subPremise?: string;
};
/** Format: ipv4 */
ipv4: string;
/** Format: ipv6 */
ipv6: string;
};
responses: never;
parameters: never;
requestBodies: never;
headers: never;
pathItems: never;
}
export type $defs = Record<string, never>;
export type external = Record<string, never>;
export interface operations {
/** @description Send an "identify" event. */
Identify_sendIdentify: {
requestBody: {
content: {
"application/json": components["schemas"]["IdentifyEvent"];
};
};
responses: {
/** @description The request has succeeded. */
200: {
content: never;
};
/** @description The request has been accepted for processing, but processing has not yet completed. */
202: {
content: never;
};
/** @description Access is unauthorized. */
401: {
content: never;
};
};
};
/** @description Send a "page" event. */
Page_sendPage: {
requestBody: {
content: {
"application/json": components["schemas"]["PageEvent"];
};
};
responses: {
/** @description The request has succeeded. */
200: {
content: never;
};
/** @description The request has been accepted for processing, but processing has not yet completed. */
202: {
content: never;
};
/** @description Access is unauthorized. */
401: {
content: never;
};
};
};
}