@types/facebook-nodejs-business-sdk
Version:
TypeScript definitions for facebook-nodejs-business-sdk
464 lines (463 loc) • 18.4 kB
TypeScript
import BusinessDataUserData from "../businessdataapi/user-data";
import ServerUserData from "../serverside/user-data";
/**
* UserData represents the User Data Parameters(user_data) of Business Data API and Conversion API Request.
*/
export default class UserData {
_business_data_user_data: BusinessDataUserData;
_server_user_data: ServerUserData;
/**
* @param {String} email An email address, in lowercase.
* @param {String} phone A phone number. Include only digits with country code, area code, and number.
* @param {String} first_name A first name in lowercase.
* @param {String} last_name A last name in lowercase.
* @param {String} date_of_birth A date of birth given as year, month, and day in YYYYMMDD format.
* @param {String} city A city in lower-case without spaces or punctuation.
* @param {String} state A two-letter state code in lowercase.
* @param {String} country A two-letter country code in lowercase.
* @param {String} zip Postal code of the city in your country standard
* @param {String} external_id Any unique ID from the advertiser,
* @param {String} gender Gender, in lowercase. Either f or m.
* @param {String} client_ip_address The IP address of the browser corresponding to the event.
* @param {String} client_user_agent The user agent for the browser corresponding to the event.
* @param {String} fbp The Facebook browser ID value stored in the _fbp browser cookie under your domain.
* @param {String} fbc The Facebook click ID value stored in the _fbc browser cookie under your domain.
* @param {String} subscription_id The subscription ID for the user in this transaction.
* @param {String} fb_login_id The FB login ID for the user.
* @param {String} lead_id The Id associated with a lead generated by Facebook's Lead Ads.
* @param {String} dobd The date of birth day in DD format.
* @param {String} dobm The date of birth month in MM format.
* @param {String} doby The date of birth year in YYYY format.
* @param {String} f5first The first 5 characters of the first name.
* @param {String} f5last The first 5 characters of the last name.
* @param {String} fi The first Name Initial
* @param {String} address An physical address.
*/
constructor(email?: string, phone?: string, first_name?: string, last_name?: string, date_of_birth?: string, city?: string, state?: string, zip?: string, country?: string, external_id?: string, gender?: string, client_ip_address?: string, client_user_agent?: string, fbp?: string, fbc?: string, subscription_id?: string, fb_login_id?: string, lead_id?: string, dobd?: string, dobm?: string, doby?: string, f5first?: string, f5last?: string, fi?: string, address?: string);
/**
* Gets the email address for the user data field.
* An email address, in lowercase.
* Example: joe@eg.com
*/
get email(): string;
/**
* Sets the email address for the user data field.
* @param email An email address, in lowercase.
* Example: joe@eg.com
*/
set email(email: string);
/**
* Sets the email address for the user data field.
* @param {String} email An email address, in lowercase.
* Example: joe@eg.com
*/
setEmail(email: string): UserData;
/**
* Gets the phone number for the user data.
* A phone number. Include only digits with country code, area code, and number.
* Example: 16505551212
*/
get phone(): string;
/**
* Sets the phone number for the user data.
* @param phone A phone number. Include only digits with country code, area code, and number.
* Example: 16505551212
*/
set phone(phone: string);
/**
* Sets the phone number for the user data.
* @param {String} phone A phone number. Include only digits with country code, area code, and number.
* Example: 16505551212
*/
setPhone(phone: string): UserData;
/**
* Gets the date of birth for the user data.
* A date of birth given as year, month, and day in the Format YYYYMMDD
* Example: 19971226 for December 26, 1997.
*/
get date_of_birth(): string;
/**
* Sets the date of birth for the user data.
* @param date_of_birth A date of birth given as year, month, and day in the Format YYYYMMDD
* Example: 19971226 for December 26, 1997.
*/
set date_of_birth(date_of_birth: string);
/**
* Sets the date of birth for the user data.
* @param {String} date_of_birth A date of birth given as year, month, and day in the Format YYYYMMDD
* Example: 19971226 for December 26, 1997.
*/
setDateOfBirth(date_of_birth: string): UserData;
/**
* Gets the last name for the user data.
* last_name is the last name in lowercase.
* Example: smith
*/
get last_name(): string;
/**
* Sets the last name for the user data.
* @param last_name is last name in lowercase.
* Example: smith
*/
set last_name(last_name: string);
/**
* Sets the last name for the user data.
* @param {String} last_name is last name in lowercase.
* Example: smith
*/
setLastName(last_name: string): UserData;
/**
* Gets the first name for the user data.
* first_name is first name in lowercase.
* Example: joe
*/
get first_name(): string;
/**
* Sets the first name for the user data.
* @param first_name is first name in lowercase.
* Example: joe
*/
set first_name(first_name: string);
/**
* Sets the first name for the user data.
* @param {String} first_name is first name in lowercase.
* Example: joe
*/
setFirstName(first_name: string): UserData;
/**
* Gets the city for the user data.
* city is city in lower-case without spaces or punctuation.
* Example: menlopark
*/
get city(): string;
/**
* Sets the city for the user data.
* @param city is city in lower-case without spaces or punctuation.
* Example: menlopark
*/
set city(city: string);
/**
* Sets the city for the user data.
* @param {String} city is city in lower-case without spaces or punctuation.
* Example: menlopark
*/
setCity(city: string): UserData;
/**
* Gets the zip/postal code for the user data.
* zip is a five-digit zip code for United States.For other locations, follow each country's standards.
* Example: 98121 (for United States zip code)
*/
get zip(): string;
/**
* Sets the zip/postal code for the user data.
* @param zip is a five-digit zip code for United States.For other locations, follow each country's standards.
* Example: 98121 (for United States zip code)
*/
set zip(zip: string);
/**
* Sets the zip/postal code for the user data.
* @param {String} zip is a five-digit zip code for United States.For other locations, follow each country's standards.
* Example: 98121 (for United States zip code)
*/
setZip(zip: string): UserData;
/**
* Gets the state for the user data.
* state is state in lower-case without spaces or punctuation.
* Example: ca
*/
get state(): string;
/**
* Sets the state for the user data.
* @param state is state in lower-case without spaces or punctuation.
* Example: ca
*/
set state(state: string);
/**
* Sets the state for the user data.
* @param {String} state is state in lower-case without spaces or punctuation.
* Example: ca
*/
setState(state: string): UserData;
/**
* Gets the country for the user data.
* country is A two-letter country code in lowercase.
* Example: usa
*/
get country(): string;
/**
* Sets the country for the user data.
* @param country is A two-letter country code in lowercase.
* Example: usa
*/
set country(country: string);
/**
* Sets the country for the user data.
* @param {String} country is A two-letter country code in lowercase.
* Example: usa
*/
setCountry(country: string): UserData;
/**
* Gets the external id for the user data.
* external_id is a unique ID from the advertiser, such as loyalty membership IDs, user IDs, and external cookie IDs.
* In the Offline Conversions API this is known as extern_id. For more information, see Offline Conversions.
* If External ID is being sent via other channels, then it should be sent in the same format via the server-side API
* @see {@link https://www.facebook.com/business/help/104039186799009}
*/
get external_id(): string;
/**
* Sets the external id for the user data.
* @param external_id is a unique ID from the advertiser, such as loyalty membership IDs, user IDs, and external cookie IDs.
* In the Offline Conversions API this is known as extern_id. For more information, see Offline Conversions.
* If External ID is being sent via other channels, then it should be sent in the same format via the server-side API
* @see {@link https://www.facebook.com/business/help/104039186799009}
*/
set external_id(external_id: string);
/**
* Sets the external id for the user data.
* @param {String} external_id is a unique ID from the advertiser, such as loyalty membership IDs, user IDs, and external cookie IDs.
* In the Offline Conversions API this is known as extern_id. For more information, see Offline Conversions.
* If External ID is being sent via other channels, then it should be sent in the same format via the server-side API
* @see {@link https://www.facebook.com/business/help/104039186799009}
*/
setExternalId(external_id: string): UserData;
/**
* Gets the gender value for the user data.
* Gender in lowercase. Either f for FEMALE or m for MALE.
* Example: f
*/
get gender(): string;
/**
* Sets the gender value for the user data.
* @param gender Gender in lowercase. Either f for FEMALE or m for MALE.
* Example: f
*/
set gender(gender: string);
/**
* Sets the gender value for the user data.
* @param {String} gender Gender in lowercase. Either f for FEMALE or m for MALE.
* Example: f
*/
setGender(gender: string): UserData;
/**
* Gets the client ip address for the user data.
* client_ip_address is the IP address of the browser corresponding to the event.
*/
get client_ip_address(): string;
/**
* Sets the client ip address for the user data.
* @param client_ip_address is the IP address of the browser corresponding to the event.
*/
set client_ip_address(client_ip_address: string);
/**
* Sets the client ip address for the user data.
* @param {String} client_ip_address is the IP address of the browser corresponding to the event.
*/
setClientIpAddress(client_ip_address: string): UserData;
/**
* Gets the client user agent for the user data.
* client_user_agent is the user agent for the browser corresponding to the event.
*/
get client_user_agent(): string;
/**
* Sets the client user agent for the user data.
* @param client_user_agent is the user agent for the browser corresponding to the event.
*/
set client_user_agent(client_user_agent: string);
/**
* Sets the client user agent for the user data.
* @param {String} client_user_agent is the user agent for the browser corresponding to the event.
*/
setClientUserAgent(client_user_agent: string): UserData;
/**
* Gets the fbc for the user data.
* fbc is the Facebook click ID value stored in the _fbc browser cookie under your domain.
* See Managing fbc and fbp Parameters for how to get this value @see {@link https://developers.facebook.com/docs/marketing-api/facebook-pixel/server-side-api/parameters#fbc},
* You can also generate this value from a fbclid query parameter.
*/
get fbc(): string;
/**
* Sets the fbc for the user data.
* @param fbc is the Facebook click ID value stored in the _fbc browser cookie under your domain.
* See Managing fbc and fbp Parameters for how to get this value @see {@link https://developers.facebook.com/docs/marketing-api/facebook-pixel/server-side-api/parameters#fbc},
* You can also generate this value from a fbclid query parameter.
*/
set fbc(fbc: string);
/**
* Sets the fbc for the user data.
* @param {String} fbc is the Facebook click ID value stored in the _fbc browser cookie under your domain.
* See Managing fbc and fbp Parameters for how to get this value @see {@link https://developers.facebook.com/docs/marketing-api/facebook-pixel/server-side-api/parameters#fbc},
* You can also generate this value from a fbclid query parameter.
*/
setFbc(fbc: string): UserData;
/**
* Gets the fbp for the user data.
* fbp is Facebook browser ID value stored in the _fbp browser cookie under your domain.
* See Managing fbc and fbp Parameters for how to get this value @see {@link https://developers.facebook.com/docs/marketing-api/facebook-pixel/server-side-api/parameters#fbp},
*/
get fbp(): string;
/**
* Sets the fbp for the user data.
* @param fbp is Facebook browser ID value stored in the _fbp browser cookie under your domain.
* See Managing fbc and fbp Parameters for how to get this value @see {@link https://developers.facebook.com/docs/marketing-api/facebook-pixel/server-side-api/parameters#fbp},
*/
set fbp(fbp: string);
/**
* Sets the fbp for the user data.
* @param {String} fbp is Facebook browser ID value stored in the _fbp browser cookie under your domain.
* See Managing fbc and fbp Parameters for how to get this value @see {@link https://developers.facebook.com/docs/marketing-api/facebook-pixel/server-side-api/parameters#fbp},
*/
setFbp(fbp: string): UserData;
/**
* Gets the subscription id for the user data.
* @return subscription_id is the subscription ID for the user in this transaction. This is similar to the order ID for an individual product.
* Example: anid1234.
*/
get subscription_id(): string;
/**
* Sets the subscription id for the user data.
* @param {String} subscription_id is the subscription ID for the user in this transaction. This is similar to the order ID for an individual product.
* Example: anid1234.
*/
set subscription_id(subscription_id: string);
/**
* Sets the subscription id for the user data.
* @param {String} subscription_id is the subscription ID for the user in this transaction. This is similar to the order ID for an individual product.
* Example: anid1234.
*/
setSubscriptionId(subscription_id: string): UserData;
/**
* Gets the fb_login_id for the user data.
*/
get fb_login_id(): string;
/**
* Sets the fb_login_id for the user data.
* @param fb_login_id
*/
set fb_login_id(fb_login_id: string);
/**
* Sets the fb_login_id for the user data.
* @param {String} fb_login_id
*/
setFbLoginId(fb_login_id: string): UserData;
/**
* Gets the lead_id for the user data. Lead ID is associated with a lead generated by Facebook's Lead Ads.
*/
get lead_id(): string;
/**
* Sets the lead_id for the user data. Lead ID is associated with a lead generated by Facebook's Lead Ads.
* @param lead_id
*/
set lead_id(lead_id: string);
/**
* Sets the lead_id for the user data. Lead ID is associated with a lead generated by Facebook's Lead Ads.
* @param {String} lead_id
*/
setLeadId(lead_id: string): UserData;
/**
* Gets the first 5 characters of the FirstName.
*/
get f5first(): string;
/**
* Sets the Gets the first 5 characters of the FirstName.
* @param f5first
*/
set f5first(f5first: string);
/**
* Sets the first 5 characters of the FirstName.
* @param {String} f5first
*/
setF5First(f5first: string): UserData;
/**
* Gets the first 5 characters of the LastName.
*/
get f5last(): string;
/**
* Sets the first 5 characters of the LastName.
* @param f5last
*/
set f5last(f5last: string);
/**
* Sets the first 5 characters of the LastName.
* @param {String} f5last
*/
setF5Last(f5last: string): UserData;
/**
* Gets the first Name Initial.
*/
get fi(): string;
/**
* Sets the first Name Initial.
* @param fi
*/
set fi(fi: string);
/**
* Sets the first Name Initial.
* @param {String} fi
*/
setFi(fi: string): UserData;
/**
* Gets the date of birth day.
*/
get dobd(): string;
/**
* Sets the date of birth day.
* @param dobd
*/
set dobd(dobd: string);
/**
* Sets the date of birth day.
* @param {String} dobd
*/
setDobd(dobd: string): UserData;
/**
* Gets the date of birth month.
*/
get dobm(): string;
/**
* Sets the date of birth month.
* @param dobm
*/
set dobm(dobm: string);
/**
* Sets the date of birth month.
* @param {String} dobm
*/
setDobm(dobm: string): UserData;
/**
* Gets the date of birth year.
*/
get doby(): string;
/**
* Sets the date of birth year.
* @param {String} doby
*/
set doby(doby: string);
/**
* Sets the date of birth year.
* @param {String} doby
*/
setDoby(doby: string): UserData;
/**
* Gets the address for the user data.
* address is a physical address
*/
get address(): string;
/**
* Sets the address for the user data.
* @param address is a physical address
*/
set address(address: string);
/**
* Sets the date of birth year.
* @param {String} address
*/
setAddress(address: string): UserData;
/**
* Gets the user_data for the Business Data API.
*/
get business_data_user_data(): BusinessDataUserData;
/**
* Gets the user_data for the Conversion API.
*/
get server_user_data(): ServerUserData;
}