Skip to content

Commit d6d0937

Browse files
committed
fix other constructor types
1 parent 1a5113e commit d6d0937

7 files changed

Lines changed: 12 additions & 12 deletions

File tree

types/facebook-nodejs-business-sdk/facebook-nodejs-business-sdk-tests.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,18 @@ async function checkType() {
104104
}
105105

106106
async function testConversionEvent(): Promise<TEventRequest> {
107-
const userData = (new UserData('[email protected]','','','','','','','','','','','','','','','','','','','','','','','','',''))
107+
const userData = (new UserData())
108108
.setEmails(['[email protected]'])
109109
.setPhones(['12345678901', '14251234567']);
110110

111-
const content = new Content('product123',5,2,'','','','','');
111+
const content = new Content();
112112

113-
const customData = (new CustomData(2,'','','',[],[],'','',0,0,'','','','',{}))
113+
const customData = (new CustomData())
114114
.setContents([content]);
115-
const extendedDeviceInfo = new ExtendedDeviceInfo('','','','','','','','','',0,0,'',0,0,0,'');
116-
const appData = new AppData(false, false, '',false, extendedDeviceInfo, false, false, '', '', '', '', '');
115+
const extendedDeviceInfo = new ExtendedDeviceInfo();
116+
const appData = new AppData();
117117

118-
const serverEvent = (new ServerEvent('',0,'',userData,customData,appData,'',false,'',[],0,0,'',false,''))
118+
const serverEvent = (new ServerEvent())
119119
.setEventName('Purchase')
120120
.setEventTime(123)
121121
.setUserData(userData)

types/facebook-nodejs-business-sdk/src/objects/serverside/app-data.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default class AppData {
1212
_receipt_data: string;
1313
_url_schemes: string;
1414
_windows_attribution_id: string;
15-
constructor(application_tracking_enabled: boolean, advertiser_tracking_enabled: boolean, campaign_ids: string, consider_views: boolean, extinfo: ExtendedDeviceInfo, include_dwell_data: boolean, include_video_data: boolean, install_referrer: string, installer_package: string, receipt_data: string, url_schemes: string, windows_attribution_id: string);
15+
constructor(application_tracking_enabled?: boolean, advertiser_tracking_enabled?: boolean, campaign_ids?: string, consider_views?: boolean, extinfo?: ExtendedDeviceInfo, include_dwell_data?: boolean, include_video_data?: boolean, install_referrer?: string, installer_package?: string, receipt_data?: string, url_schemes?: string, windows_attribution_id?: string);
1616
get application_tracking_enabled(): boolean;
1717
set application_tracking_enabled(application_tracking_enabled: boolean);
1818
setApplicationTrackingEnabled(application_tracking_enabled: boolean): AppData;

types/facebook-nodejs-business-sdk/src/objects/serverside/content.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default class Content {
1717
* @param {String} category Category of the Item.
1818
* @param {String} delivery_category The type of delivery for a purchase event
1919
*/
20-
constructor(id: string, quantity: number, item_price: number, title: string, description: string, brand: string, category: string, delivery_category: string);
20+
constructor(id?: string, quantity?: number, item_price?: number, title?: string, description?: string, brand?: string, category?: string, delivery_category?: string);
2121
/**
2222
* Gets the Product Id of the Item.
2323
* A string representing the unique Id for the product.

types/facebook-nodejs-business-sdk/src/objects/serverside/custom-data.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default class CustomData {
3636
* @param {String} delivery_category The type of delivery for a purchase event
3737
* @param {Object} custom_properties Custom Properties to be added to the Custom Data
3838
*/
39-
constructor(value: number, currency: string, content_name: string, content_category: string, content_ids: string[], contents: Content[], content_type: string, order_id: string, predicted_ltv: number, num_items: number, search_string: string, status: string, item_number: string, delivery_category: string, custom_properties: Record<string, any>);
39+
constructor(value?: number, currency?: string, content_name?: string, content_category?: string, content_ids?: string[], contents?: Content[], content_type?: string, order_id?: string, predicted_ltv?: number, num_items?: number, search_string?: string, status?: string, item_number?: string, delivery_category?: string, custom_properties?: Record<string, any>);
4040
/**
4141
* Gets the value of the custom data.
4242
* A numeric value associated with this event. This could be a monetary value or a value in some other metric.

types/facebook-nodejs-business-sdk/src/objects/serverside/extended-device-info.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class ExtendedDeviceInfo {
1515
_total_disk_space_gb: number;
1616
_free_disk_space_gb: number;
1717
_device_time_zone: string;
18-
constructor(ext_info_version: string, app_package_name: string, short_version: string, long_version: string, os_version: string, device_model_name: string, locale: string, timezone_abbreviation: string, carrier: string, screen_width: number, screen_height: number, screen_density: string, cpu_core_count: number, total_disk_space_gb: number, free_disk_space_gb: number, device_time_zone: string);
18+
constructor(ext_info_version?: string, app_package_name?: string, short_version?: string, long_version?: string, os_version?: string, device_model_name?: string, locale?: string, timezone_abbreviation?: string, carrier?: string, screen_width?: number, screen_height?: number, screen_density?: string, cpu_core_count?: number, total_disk_space_gb?: number, free_disk_space_gb?: number, device_time_zone?: string);
1919
get ext_info_version(): string;
2020
set ext_info_version(ext_info_version: string);
2121
setExtInfoVersion(ext_info_version: string): ExtendedDeviceInfo;

types/facebook-nodejs-business-sdk/src/objects/serverside/server-event.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default class ServerEvent {
3737
* @param {Boolean} advertiser_tracking_enabled A boolean that indicates whether the user has opted into/out of advertiser tracker on apps.
3838
* @param {String} messaging_channel Indicates which channel was used to send the message.
3939
*/
40-
constructor(event_name: string, event_time: number, event_source_url: string, user_data: UserData, custom_data: CustomData, app_data: AppData, event_id: string, opt_out: boolean, action_source: string, data_processing_options: string[], data_processing_options_country: number, data_processing_options_state: number, advanced_measurement_table: string, advertiser_tracking_enabled: boolean, messaging_channel: string);
40+
constructor(event_name?: string, event_time?: number, event_source_url?: string, user_data?: UserData, custom_data?: CustomData, app_data?: AppData, event_id?: string, opt_out?: boolean, action_source?: string, data_processing_options?: string[], data_processing_options_country?: number, data_processing_options_state?: number, advanced_measurement_table?: string, advertiser_tracking_enabled?: boolean, messaging_channel?: string);
4141
/**
4242
* Gets the Event Name for the current Event.
4343
*/

types/facebook-nodejs-business-sdk/src/objects/serverside/user-data.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default class UserData {
6161
* @param {String} ctwa_clid ID of a conversation that was started on WhatsApp
6262
* @param {String} page_id ID of the page that the ad is associated with
6363
*/
64-
constructor(email: string, phone: string, gender: string, first_name: string, last_name: string, date_of_birth: string, city: string, state: string, zip: string, country: string, external_id: 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, madid: string, anon_id: string, app_user_id: string, ctwa_clid: string, page_id: string);
64+
constructor(email?: string, phone?: string, gender?: string, first_name?: string, last_name?: string, date_of_birth?: string, city?: string, state?: string, zip?: string, country?: string, external_id?: 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, madid?: string, anon_id?: string, app_user_id?: string, ctwa_clid?: string, page_id?: string);
6565
static get Gender(): Record<string, any>;
6666
/**
6767
* Gets the email address for the user data field.

0 commit comments

Comments
 (0)