Skip to content

Commit

Permalink
Auto-generated nodejs SDK code update
Browse files Browse the repository at this point in the history
Summary: ignore-conflict-markers

Reviewed By: stcheng

Differential Revision: D53019999

fbshipit-source-id: 6f3f07fcbfde3c9a8c2dbf4771fdf86b1968a29a
  • Loading branch information
generatedunixname89002005295453 authored and facebook-github-bot committed Jan 23, 2024
1 parent fdc7248 commit 22ddab4
Show file tree
Hide file tree
Showing 35 changed files with 255 additions and 139 deletions.
4 changes: 2 additions & 2 deletions examples/page_posts_edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ fields = [
];
params = {
};
const posts = (new Page(id)).getPosts(
const postss = (new Page(id)).getPosts(
fields,
params
);
logApiCallResult('posts api call complete.', posts);
logApiCallResult('postss api call complete.', postss);
4 changes: 2 additions & 2 deletions examples/page_posts_edge_page_post_create_carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ params = {
'caption' : 'WWW.EXAMPLE.COM',
'link' : 'http://www.example.com/products',
};
const posts = (new Page(id)).getPosts(
const postss = (new Page(id)).getPosts(
fields,
params
);
logApiCallResult('posts api call complete.', posts);
logApiCallResult('postss api call complete.', postss);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "facebook-nodejs-business-sdk",
"version": "18.0.4",
"version": "19.0.0",
"description": "SDK for the Facebook Marketing API in Javascript and Node.js",
"author": "Facebook",
"maintainers": [
Expand Down
4 changes: 2 additions & 2 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export default class FacebookAdsApi {
locale: string;
static _defaultApi: FacebookAdsApi;
static get VERSION(): string {
return 'v18.0';
return 'v19.0';
}
static get SDK_VERSION(): string {
return '18.0.4';
return '19.0.0';
}
static get GRAPH(): string {
return 'https://graph.facebook.com';
Expand Down
12 changes: 8 additions & 4 deletions src/bundle.es6
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ export { default as CanvasAdSettings } from './../src/objects/canvas-ad-settings
export { default as CanvasBodyElement } from './../src/objects/canvas-body-element';
export { default as CanvasCollectionThumbnail } from './../src/objects/canvas-collection-thumbnail';
export { default as CanvasDynamicSetting } from './../src/objects/canvas-dynamic-setting';
export { default as CanvasPreview } from './../src/objects/canvas-preview';
export { default as CatalogBasedTargeting } from './../src/objects/catalog-based-targeting';
export { default as CatalogItemAppLinks } from './../src/objects/catalog-item-app-links';
export { default as CatalogItemAppealStatus } from './../src/objects/catalog-item-appeal-status';
Expand Down Expand Up @@ -247,6 +248,7 @@ export { default as CustomAudience } from './../src/objects/custom-audience';
export { default as CustomAudienceAdAccount } from './../src/objects/custom-audience-ad-account';
export { default as CustomAudienceDataSource } from './../src/objects/custom-audience-data-source';
export { default as CustomAudienceGroup } from './../src/objects/custom-audience-group';
export { default as CustomAudienceSalts } from './../src/objects/custom-audience-salts';
export { default as CustomAudienceSession } from './../src/objects/custom-audience-session';
export { default as CustomAudienceSharingStatus } from './../src/objects/custom-audience-sharing-status';
export { default as CustomAudienceStatus } from './../src/objects/custom-audience-status';
Expand All @@ -262,7 +264,6 @@ export { default as DeliveryCheck } from './../src/objects/delivery-check';
export { default as DeliveryCheckExtraInfo } from './../src/objects/delivery-check-extra-info';
export { default as DeliveryWindow } from './../src/objects/delivery-window';
export { default as Destination } from './../src/objects/destination';
export { default as DestinationCatalogSettings } from './../src/objects/destination-catalog-settings';
export { default as DynamicPostChildAttachment } from './../src/objects/dynamic-post-child-attachment';
export { default as DynamicPriceConfigByDate } from './../src/objects/dynamic-price-config-by-date';
export { default as DynamicVideoMetadata } from './../src/objects/dynamic-video-metadata';
Expand All @@ -281,7 +282,6 @@ export { default as Flight } from './../src/objects/flight';
export { default as FundingSourceDetails } from './../src/objects/funding-source-details';
export { default as FundingSourceDetailsCoupon } from './../src/objects/funding-source-details-coupon';
export { default as FundraiserPersonToCharity } from './../src/objects/fundraiser-person-to-charity';
export { default as GameItem } from './../src/objects/game-item';
export { default as Group } from './../src/objects/group';
export { default as HasLeadAccess } from './../src/objects/has-lead-access';
export { default as HighDemandPeriod } from './../src/objects/high-demand-period';
Expand Down Expand Up @@ -311,7 +311,6 @@ export { default as InstagramMedia } from './../src/objects/instagram-media';
export { default as InstagramShoppingMerchantReviewMessage } from './../src/objects/instagram-shopping-merchant-review-message';
export { default as InstagramUser } from './../src/objects/instagram-user';
export { default as InstagramVideoMetadata } from './../src/objects/instagram-video-metadata';
export { default as InstantArticlesStats } from './../src/objects/instant-articles-stats';
export { default as IosAppLink } from './../src/objects/ios-app-link';
export { default as JobOpening } from './../src/objects/job-opening';
export { default as KeyValue } from './../src/objects/key-value';
Expand Down Expand Up @@ -500,12 +499,18 @@ export { default as ValueBasedEligibleSource } from './../src/objects/value-base
export { default as Vehicle } from './../src/objects/vehicle';
export { default as VehicleOffer } from './../src/objects/vehicle-offer';
export { default as VideoCopyright } from './../src/objects/video-copyright';
export { default as VideoCopyrightCheckStatus } from './../src/objects/video-copyright-check-status';
export { default as VideoCopyrightConditionGroup } from './../src/objects/video-copyright-condition-group';
export { default as VideoCopyrightGeoGate } from './../src/objects/video-copyright-geo-gate';
export { default as VideoCopyrightRule } from './../src/objects/video-copyright-rule';
export { default as VideoCopyrightSegment } from './../src/objects/video-copyright-segment';
export { default as VideoList } from './../src/objects/video-list';
export { default as VideoPoll } from './../src/objects/video-poll';
export { default as VideoStatus } from './../src/objects/video-status';
export { default as VideoStatusError } from './../src/objects/video-status-error';
export { default as VideoStatusProcessingPhase } from './../src/objects/video-status-processing-phase';
export { default as VideoStatusPublishingPhase } from './../src/objects/video-status-publishing-phase';
export { default as VideoStatusUploadingPhase } from './../src/objects/video-status-uploading-phase';
export { default as VideoThumbnail } from './../src/objects/video-thumbnail';
export { default as VideoUploadLimits } from './../src/objects/video-upload-limits';
export { default as VoipInfo } from './../src/objects/voip-info';
Expand All @@ -515,7 +520,6 @@ export { default as WhatsAppBusinessHealthStatus } from './../src/objects/whats-
export { default as WhatsAppBusinessHealthStatusForMessageSend } from './../src/objects/whats-app-business-health-status-for-message-send';
export { default as WhatsAppBusinessPreVerifiedPhoneNumber } from './../src/objects/whats-app-business-pre-verified-phone-number';
export { default as WhatsAppBusinessProfile } from './../src/objects/whats-app-business-profile';
export { default as WhitehatFBDLRun } from './../src/objects/whitehat-fbdl-run';
export { default as WindowsAppLink } from './../src/objects/windows-app-link';
export { default as WindowsPhoneAppLink } from './../src/objects/windows-phone-app-link';
export { default as WoodhengePurchasedPAYGReceipt } from './../src/objects/woodhenge-purchased-payg-receipt';
Expand Down
12 changes: 8 additions & 4 deletions src/globals.es6
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ import './../src/objects/canvas-ad-settings';
import './../src/objects/canvas-body-element';
import './../src/objects/canvas-collection-thumbnail';
import './../src/objects/canvas-dynamic-setting';
import './../src/objects/canvas-preview';
import './../src/objects/catalog-based-targeting';
import './../src/objects/catalog-item-app-links';
import './../src/objects/catalog-item-appeal-status';
Expand Down Expand Up @@ -223,6 +224,7 @@ import './../src/objects/custom-audience';
import './../src/objects/custom-audience-ad-account';
import './../src/objects/custom-audience-data-source';
import './../src/objects/custom-audience-group';
import './../src/objects/custom-audience-salts';
import './../src/objects/custom-audience-session';
import './../src/objects/custom-audience-sharing-status';
import './../src/objects/custom-audience-status';
Expand All @@ -238,7 +240,6 @@ import './../src/objects/delivery-check';
import './../src/objects/delivery-check-extra-info';
import './../src/objects/delivery-window';
import './../src/objects/destination';
import './../src/objects/destination-catalog-settings';
import './../src/objects/dynamic-post-child-attachment';
import './../src/objects/dynamic-price-config-by-date';
import './../src/objects/dynamic-video-metadata';
Expand All @@ -257,7 +258,6 @@ import './../src/objects/flight';
import './../src/objects/funding-source-details';
import './../src/objects/funding-source-details-coupon';
import './../src/objects/fundraiser-person-to-charity';
import './../src/objects/game-item';
import './../src/objects/group';
import './../src/objects/has-lead-access';
import './../src/objects/high-demand-period';
Expand Down Expand Up @@ -287,7 +287,6 @@ import './../src/objects/instagram-media';
import './../src/objects/instagram-shopping-merchant-review-message';
import './../src/objects/instagram-user';
import './../src/objects/instagram-video-metadata';
import './../src/objects/instant-articles-stats';
import './../src/objects/ios-app-link';
import './../src/objects/job-opening';
import './../src/objects/key-value';
Expand Down Expand Up @@ -476,12 +475,18 @@ import './../src/objects/value-based-eligible-source';
import './../src/objects/vehicle';
import './../src/objects/vehicle-offer';
import './../src/objects/video-copyright';
import './../src/objects/video-copyright-check-status';
import './../src/objects/video-copyright-condition-group';
import './../src/objects/video-copyright-geo-gate';
import './../src/objects/video-copyright-rule';
import './../src/objects/video-copyright-segment';
import './../src/objects/video-list';
import './../src/objects/video-poll';
import './../src/objects/video-status';
import './../src/objects/video-status-error';
import './../src/objects/video-status-processing-phase';
import './../src/objects/video-status-publishing-phase';
import './../src/objects/video-status-uploading-phase';
import './../src/objects/video-thumbnail';
import './../src/objects/video-upload-limits';
import './../src/objects/voip-info';
Expand All @@ -491,7 +496,6 @@ import './../src/objects/whats-app-business-health-status';
import './../src/objects/whats-app-business-health-status-for-message-send';
import './../src/objects/whats-app-business-pre-verified-phone-number';
import './../src/objects/whats-app-business-profile';
import './../src/objects/whitehat-fbdl-run';
import './../src/objects/windows-app-link';
import './../src/objects/windows-phone-app-link';
import './../src/objects/woodhenge-purchased-payg-receipt';
Expand Down
2 changes: 2 additions & 0 deletions src/objects/ad-account-ad-rules-history.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export default class AdAccountAdRulesHistory extends AbstractCrudObject {
changed_budget: 'CHANGED_BUDGET',
email: 'EMAIL',
enable_advantage_plus_creative: 'ENABLE_ADVANTAGE_PLUS_CREATIVE',
enable_advantage_plus_placements: 'ENABLE_ADVANTAGE_PLUS_PLACEMENTS',
enable_autoflow: 'ENABLE_AUTOFLOW',
enable_semantic_based_audience_expansion: 'ENABLE_SEMANTIC_BASED_AUDIENCE_EXPANSION',
endpoint_pinged: 'ENDPOINT_PINGED',
error: 'ERROR',
facebook_notification_sent: 'FACEBOOK_NOTIFICATION_SENT',
Expand Down
7 changes: 7 additions & 0 deletions src/objects/ad-account-ad-volume.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,17 @@ export default class AdAccountAdVolume extends AbstractCrudObject {
aco_toggle: 'ACO_TOGGLE',
ads_reporting: 'ADS_REPORTING',
advanced_campaign_budget: 'ADVANCED_CAMPAIGN_BUDGET',
advantage_app_campaign: 'ADVANTAGE_APP_CAMPAIGN',
advantage_custom_audience: 'ADVANTAGE_CUSTOM_AUDIENCE',
advantage_custom_audience_upsell: 'ADVANTAGE_CUSTOM_AUDIENCE_UPSELL',
advantage_detailed_targeting: 'ADVANTAGE_DETAILED_TARGETING',
advantage_lookalike_audience: 'ADVANTAGE_LOOKALIKE_AUDIENCE',
advantage_plus_audience: 'ADVANTAGE_PLUS_AUDIENCE',
advantage_plus_audience_friction: 'ADVANTAGE_PLUS_AUDIENCE_FRICTION',
advantage_plus_audience_toggle: 'ADVANTAGE_PLUS_AUDIENCE_TOGGLE',
advantage_plus_creative: 'ADVANTAGE_PLUS_CREATIVE',
advantage_plus_creative_catalog: 'ADVANTAGE_PLUS_CREATIVE_CATALOG',
advantage_plus_placements_friction: 'ADVANTAGE_PLUS_PLACEMENTS_FRICTION',
advantage_shopping_campaign: 'ADVANTAGE_SHOPPING_CAMPAIGN',
advantage_shopping_campaign_fragmentation: 'ADVANTAGE_SHOPPING_CAMPAIGN_FRAGMENTATION',
ad_objective: 'AD_OBJECTIVE',
Expand Down Expand Up @@ -96,6 +101,7 @@ export default class AdAccountAdVolume extends AbstractCrudObject {
guidance_center_code_gen: 'GUIDANCE_CENTER_CODE_GEN',
high_cost: 'HIGH_COST',
historical_benchmark: 'HISTORICAL_BENCHMARK',
ig_multi_ads: 'IG_MULTI_ADS',
learning_limited: 'LEARNING_LIMITED',
learning_pause_friction: 'LEARNING_PAUSE_FRICTION',
learning_phase_budget_edits: 'LEARNING_PHASE_BUDGET_EDITS',
Expand Down Expand Up @@ -127,6 +133,7 @@ export default class AdAccountAdVolume extends AbstractCrudObject {
six_plus_manual_placements: 'SIX_PLUS_MANUAL_PLACEMENTS',
spend_limit: 'SPEND_LIMIT',
syd_test_mode: 'SYD_TEST_MODE',
tailored_lead_ad_campaign: 'TAILORED_LEAD_AD_CAMPAIGN',
top_adsets_with_ads_under_cap: 'TOP_ADSETS_WITH_ADS_UNDER_CAP',
top_campaigns_with_ads_under_cap: 'TOP_CAMPAIGNS_WITH_ADS_UNDER_CAP',
two_p_guidance_card_aaa: 'TWO_P_GUIDANCE_CARD_AAA',
Expand Down
2 changes: 2 additions & 0 deletions src/objects/ad-account-business-constraints.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export default class AdAccountBusinessConstraints extends AbstractCrudObject {
static get Fields (): Object {
return Object.freeze({
audience_controls: 'audience_controls',
campaigns_with_error: 'campaigns_with_error',
placement_controls: 'placement_controls',
status: 'status',
});
}

Expand Down
19 changes: 19 additions & 0 deletions src/objects/ad-account.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,15 @@ export default class AdAccount extends AbstractCrudObject {
zar: 'ZAR',
});
}
static get PermittedTasks (): Object {
return Object.freeze({
aa_analyze: 'AA_ANALYZE',
advertise: 'ADVERTISE',
analyze: 'ANALYZE',
draft: 'DRAFT',
manage: 'MANAGE',
});
}
static get Tasks (): Object {
return Object.freeze({
aa_analyze: 'AA_ANALYZE',
Expand Down Expand Up @@ -659,6 +668,16 @@ export default class AdAccount extends AbstractCrudObject {
);
}

createAgency (fields: Array<string>, params: Object = {}, pathOverride?: ?string = null): Promise<AdAccount> {
return this.createEdge(
'/agencies',
fields,
params,
AdAccount,
pathOverride,
);
}

getApplications (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
Application,
Expand Down
1 change: 1 addition & 0 deletions src/objects/ad-creative-branded-content-ads.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default class AdCreativeBrandedContentAds extends AbstractCrudObject {
instagram_boost_post_access_token: 'instagram_boost_post_access_token',
is_mca_internal: 'is_mca_internal',
partners: 'partners',
promoted_page_id: 'promoted_page_id',
ui_version: 'ui_version',
});
}
Expand Down
1 change: 1 addition & 0 deletions src/objects/ad-creative.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ export default class AdCreative extends AbstractCrudObject {
return Object.freeze({
none: 'NONE',
political: 'POLITICAL',
political_with_digitally_created_media: 'POLITICAL_WITH_DIGITALLY_CREATED_MEDIA',
});
}
static get CategorizationCriteria (): Object {
Expand Down
2 changes: 2 additions & 0 deletions src/objects/ad-promoted-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ export default class AdPromotedObject extends AbstractCrudObject {
place_page_set_id: 'place_page_set_id',
product_catalog_id: 'product_catalog_id',
product_item_id: 'product_item_id',
product_set: 'product_set',
product_set_id: 'product_set_id',
retention_days: 'retention_days',
whatsapp_phone_number: 'whatsapp_phone_number',
});
}

Expand Down
1 change: 1 addition & 0 deletions src/objects/ad-rule-execution-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default class AdRuleExecutionSpec extends AbstractCrudObject {
change_bid: 'CHANGE_BID',
change_budget: 'CHANGE_BUDGET',
change_campaign_budget: 'CHANGE_CAMPAIGN_BUDGET',
dco: 'DCO',
increase_radius: 'INCREASE_RADIUS',
notification: 'NOTIFICATION',
pause: 'PAUSE',
Expand Down
2 changes: 2 additions & 0 deletions src/objects/ad-rule-history.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ export default class AdRuleHistory extends AbstractCrudObject {
changed_budget: 'CHANGED_BUDGET',
email: 'EMAIL',
enable_advantage_plus_creative: 'ENABLE_ADVANTAGE_PLUS_CREATIVE',
enable_advantage_plus_placements: 'ENABLE_ADVANTAGE_PLUS_PLACEMENTS',
enable_autoflow: 'ENABLE_AUTOFLOW',
enable_semantic_based_audience_expansion: 'ENABLE_SEMANTIC_BASED_AUDIENCE_EXPANSION',
endpoint_pinged: 'ENDPOINT_PINGED',
error: 'ERROR',
facebook_notification_sent: 'FACEBOOK_NOTIFICATION_SENT',
Expand Down
4 changes: 4 additions & 0 deletions src/objects/ads-action-stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ export default class AdsActionStats extends AbstractCrudObject {
interactive_component_sticker_id: 'interactive_component_sticker_id',
interactive_component_sticker_response: 'interactive_component_sticker_response',
skan_click: 'skan_click',
skan_click_second_postback: 'skan_click_second_postback',
skan_click_third_postback: 'skan_click_third_postback',
skan_view: 'skan_view',
skan_view_second_postback: 'skan_view_second_postback',
skan_view_third_postback: 'skan_view_third_postback',
value: 'value',
});
}
Expand Down
4 changes: 4 additions & 0 deletions src/objects/ads-histogram-stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ export default class AdsHistogramStats extends AbstractCrudObject {
interactive_component_sticker_id: 'interactive_component_sticker_id',
interactive_component_sticker_response: 'interactive_component_sticker_response',
skan_click: 'skan_click',
skan_click_second_postback: 'skan_click_second_postback',
skan_click_third_postback: 'skan_click_third_postback',
skan_view: 'skan_view',
skan_view_second_postback: 'skan_view_second_postback',
skan_view_third_postback: 'skan_view_third_postback',
value: 'value',
});
}
Expand Down
1 change: 1 addition & 0 deletions src/objects/ads-insights.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ export default class AdsInsights extends AbstractCrudObject {
image_asset: 'image_asset',
impression_device: 'impression_device',
is_conversion_id_modeled: 'is_conversion_id_modeled',
landing_destination: 'landing_destination',
link_url_asset: 'link_url_asset',
marketing_messages_btn_name: 'marketing_messages_btn_name',
mdsa_landing_destination: 'mdsa_landing_destination',
Expand Down
1 change: 1 addition & 0 deletions src/objects/business.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export default class Business extends AbstractCrudObject {
luxury: 'LUXURY',
marketing: 'MARKETING',
non_profit: 'NON_PROFIT',
not_set: 'NOT_SET',
organizations_and_associations: 'ORGANIZATIONS_AND_ASSOCIATIONS',
other: 'OTHER',
professional_services: 'PROFESSIONAL_SERVICES',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,14 @@
import {AbstractCrudObject} from './../abstract-crud-object';

/**
* InstantArticlesStats
* CanvasPreview
* @extends AbstractCrudObject
* @see {@link https://developers.facebook.com/docs/marketing-api/}
*/
export default class InstantArticlesStats extends AbstractCrudObject {
export default class CanvasPreview extends AbstractCrudObject {
static get Fields (): Object {
return Object.freeze({
error: 'error',
metadata: 'metadata',
metric: 'metric',
totals: 'totals',
x_axis_breakdown: 'x_axis_breakdown',
body: 'body',
});
}

Expand Down
11 changes: 11 additions & 0 deletions src/objects/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import {AbstractCrudObject} from './../abstract-crud-object';
import Cursor from './../cursor';
import CanvasPreview from './canvas-preview';
import TextWithEntities from './text-with-entities';

/**
Expand Down Expand Up @@ -51,6 +52,16 @@ export default class Canvas extends AbstractCrudObject {
}


getPreview (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
CanvasPreview,
fields,
params,
fetchFirstPage,
'/preview'
);
}

getPreviews (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
TextWithEntities,
Expand Down
Loading

0 comments on commit 22ddab4

Please sign in to comment.