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: D54566098

fbshipit-source-id: 3caeef760935188a6f8baf4fe43aad42ce9cb555
  • Loading branch information
generatedunixname89002005295453 authored and facebook-github-bot committed Mar 6, 2024
1 parent 6a59270 commit 3221b62
Show file tree
Hide file tree
Showing 52 changed files with 649 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ let fields, params;
fields = [
];
params = {
'hotel_catalog_settings' : {'pull_config_id':'<pullConfigID>'},
};
const sample_code = (new ProductCatalog(id)).update(
fields,
Expand Down
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": "19.0.0",
"version": "19.0.1",
"description": "SDK for the Facebook Marketing API in Javascript and Node.js",
"author": "Facebook",
"maintainers": [
Expand Down
2 changes: 1 addition & 1 deletion src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class FacebookAdsApi {
return 'v19.0';
}
static get SDK_VERSION(): string {
return '19.0.0';
return '19.0.1';
}
static get GRAPH(): string {
return 'https://graph.facebook.com';
Expand Down
15 changes: 14 additions & 1 deletion src/bundle.es6
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ export { default as AdAccountTargetingUnified } from './../src/objects/ad-accoun
export { default as AdAccountTrackingData } from './../src/objects/ad-account-tracking-data';
export { default as AdAccountUser } from './../src/objects/ad-account-user';
export { default as AdActivity } from './../src/objects/ad-activity';
export { default as AdAssetBody } from './../src/objects/ad-asset-body';
export { default as AdAssetCallToActionType } from './../src/objects/ad-asset-call-to-action-type';
export { default as AdAssetCustomizationRuleCustomizationSpec } from './../src/objects/ad-asset-customization-rule-customization-spec';
export { default as AdAssetDescription } from './../src/objects/ad-asset-description';
export { default as AdAssetFeedAdditionalData } from './../src/objects/ad-asset-feed-additional-data';
export { default as AdAssetFeedSpec } from './../src/objects/ad-asset-feed-spec';
export { default as AdAssetFeedSpecAssetCustomizationRule } from './../src/objects/ad-asset-feed-spec-asset-customization-rule';
Expand All @@ -69,9 +72,13 @@ export { default as AdAssetFeedSpecImage } from './../src/objects/ad-asset-feed-
export { default as AdAssetFeedSpecLinkURL } from './../src/objects/ad-asset-feed-spec-link-url';
export { default as AdAssetFeedSpecTitle } from './../src/objects/ad-asset-feed-spec-title';
export { default as AdAssetFeedSpecVideo } from './../src/objects/ad-asset-feed-spec-video';
export { default as AdAssetImage } from './../src/objects/ad-asset-image';
export { default as AdAssetLinkURL } from './../src/objects/ad-asset-link-url';
export { default as AdAssetMessageExtensions } from './../src/objects/ad-asset-message-extensions';
export { default as AdAssetOnsiteDestinations } from './../src/objects/ad-asset-onsite-destinations';
export { default as AdAssetTargetRuleTargeting } from './../src/objects/ad-asset-target-rule-targeting';
export { default as AdAssetTitle } from './../src/objects/ad-asset-title';
export { default as AdAssetVideo } from './../src/objects/ad-asset-video';
export { default as AdAsyncRequest } from './../src/objects/ad-async-request';
export { default as AdAsyncRequestSet } from './../src/objects/ad-async-request-set';
export { default as AdAsyncRequestSetNotificationResult } from './../src/objects/ad-async-request-set-notification-result';
Expand Down Expand Up @@ -113,7 +120,9 @@ export { default as AdCreativePlaceData } from './../src/objects/ad-creative-pla
export { default as AdCreativePlatformCustomization } from './../src/objects/ad-creative-platform-customization';
export { default as AdCreativePortraitCustomizations } from './../src/objects/ad-creative-portrait-customizations';
export { default as AdCreativePostClickConfiguration } from './../src/objects/ad-creative-post-click-configuration';
export { default as AdCreativePromotionMetadataSpec } from './../src/objects/ad-creative-promotion-metadata-spec';
export { default as AdCreativeRecommenderSettings } from './../src/objects/ad-creative-recommender-settings';
export { default as AdCreativeSiteLinksSpec } from './../src/objects/ad-creative-site-links-spec';
export { default as AdCreativeSourcingSpec } from './../src/objects/ad-creative-sourcing-spec';
export { default as AdCreativeStaticFallbackSpec } from './../src/objects/ad-creative-static-fallback-spec';
export { default as AdCreativeTemplateURLSpec } from './../src/objects/ad-creative-template-url-spec';
Expand Down Expand Up @@ -169,6 +178,7 @@ export { default as AdsPixelStatsResult } from './../src/objects/ads-pixel-stats
export { default as AgeRange } from './../src/objects/age-range';
export { default as AgencyClientDeclaration } from './../src/objects/agency-client-declaration';
export { default as Album } from './../src/objects/album';
export { default as AnalyticsSegment } from './../src/objects/analytics-segment';
export { default as AndroidAppLink } from './../src/objects/android-app-link';
export { default as AppRequest } from './../src/objects/app-request';
export { default as AppRequestFormerRecipient } from './../src/objects/app-request-former-recipient';
Expand All @@ -184,6 +194,8 @@ export { default as Avatar } from './../src/objects/avatar';
export { default as AvatarProfilePicture } from './../src/objects/avatar-profile-picture';
export { default as BrandRequest } from './../src/objects/brand-request';
export { default as BrandSafetyBlockListUsage } from './../src/objects/brand-safety-block-list-usage';
export { default as BrandedContentShadowIGMediaID } from './../src/objects/branded-content-shadow-ig-media-id';
export { default as BrandedContentShadowIGUserID } from './../src/objects/branded-content-shadow-ig-user-id';
export { default as BroadTargetingCategories } from './../src/objects/broad-targeting-categories';
export { default as Business } from './../src/objects/business';
export { default as BusinessAdAccountRequest } from './../src/objects/business-ad-account-request';
Expand Down Expand Up @@ -366,7 +378,6 @@ export { default as OpenBridgeConfiguration } from './../src/objects/open-bridge
export { default as OpenGraphContext } from './../src/objects/open-graph-context';
export { default as OutcomePredictionPoint } from './../src/objects/outcome-prediction-point';
export { default as Page } from './../src/objects/page';
export { default as PageAboutStory } from './../src/objects/page-about-story';
export { default as PageAboutStoryComposedBlock } from './../src/objects/page-about-story-composed-block';
export { default as PageAboutStoryComposedBlockEntityRanges } from './../src/objects/page-about-story-composed-block-entity-ranges';
export { default as PageAboutStoryComposedBlockInlineStyle } from './../src/objects/page-about-story-composed-block-inline-style';
Expand Down Expand Up @@ -463,6 +474,7 @@ export { default as Stories } from './../src/objects/stories';
export { default as SystemUser } from './../src/objects/system-user';
export { default as Tab } from './../src/objects/tab';
export { default as Targeting } from './../src/objects/targeting';
export { default as TargetingAutomation } from './../src/objects/targeting-automation';
export { default as TargetingDynamicRule } from './../src/objects/targeting-dynamic-rule';
export { default as TargetingGeoLocation } from './../src/objects/targeting-geo-location';
export { default as TargetingGeoLocationCity } from './../src/objects/targeting-geo-location-city';
Expand Down Expand Up @@ -518,6 +530,7 @@ export { default as WebAppLink } from './../src/objects/web-app-link';
export { default as WhatsAppBusinessAccount } from './../src/objects/whats-app-business-account';
export { default as WhatsAppBusinessHealthStatus } from './../src/objects/whats-app-business-health-status';
export { default as WhatsAppBusinessHealthStatusForMessageSend } from './../src/objects/whats-app-business-health-status-for-message-send';
export { default as WhatsAppBusinessPartnerClientVerificationSubmission } from './../src/objects/whats-app-business-partner-client-verification-submission';
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 WindowsAppLink } from './../src/objects/windows-app-link';
Expand Down
8 changes: 5 additions & 3 deletions src/cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class Cursor extends Array<Object> {
}
this._api = sourceObject.getApi();
this._targetClass = targetClass;
this.paging = {next: next, params: params};
this.paging = {next: next};

this.clear = () => {
this.length = 0;
Expand Down Expand Up @@ -84,7 +84,7 @@ export default class Cursor extends Array<Object> {
this._loadPage = path => {
const promise = new Promise((resolve, reject) => {
this._api
.call('GET', path, this.paging.params)
.call('GET', path, params)
.then((response: Object) => {
const objects = this._buildObjectsFromResponse(response);
this.set(objects);
Expand All @@ -95,7 +95,9 @@ export default class Cursor extends Array<Object> {
})
.catch(reject);
});

if (params) {
params = undefined;
}
return promise;
};

Expand Down
15 changes: 14 additions & 1 deletion src/globals.es6
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ import './../src/objects/ad-account-targeting-unified';
import './../src/objects/ad-account-tracking-data';
import './../src/objects/ad-account-user';
import './../src/objects/ad-activity';
import './../src/objects/ad-asset-body';
import './../src/objects/ad-asset-call-to-action-type';
import './../src/objects/ad-asset-customization-rule-customization-spec';
import './../src/objects/ad-asset-description';
import './../src/objects/ad-asset-feed-additional-data';
import './../src/objects/ad-asset-feed-spec';
import './../src/objects/ad-asset-feed-spec-asset-customization-rule';
Expand All @@ -45,9 +48,13 @@ import './../src/objects/ad-asset-feed-spec-image';
import './../src/objects/ad-asset-feed-spec-link-url';
import './../src/objects/ad-asset-feed-spec-title';
import './../src/objects/ad-asset-feed-spec-video';
import './../src/objects/ad-asset-image';
import './../src/objects/ad-asset-link-url';
import './../src/objects/ad-asset-message-extensions';
import './../src/objects/ad-asset-onsite-destinations';
import './../src/objects/ad-asset-target-rule-targeting';
import './../src/objects/ad-asset-title';
import './../src/objects/ad-asset-video';
import './../src/objects/ad-async-request';
import './../src/objects/ad-async-request-set';
import './../src/objects/ad-async-request-set-notification-result';
Expand Down Expand Up @@ -89,7 +96,9 @@ import './../src/objects/ad-creative-place-data';
import './../src/objects/ad-creative-platform-customization';
import './../src/objects/ad-creative-portrait-customizations';
import './../src/objects/ad-creative-post-click-configuration';
import './../src/objects/ad-creative-promotion-metadata-spec';
import './../src/objects/ad-creative-recommender-settings';
import './../src/objects/ad-creative-site-links-spec';
import './../src/objects/ad-creative-sourcing-spec';
import './../src/objects/ad-creative-static-fallback-spec';
import './../src/objects/ad-creative-template-url-spec';
Expand Down Expand Up @@ -145,6 +154,7 @@ import './../src/objects/ads-pixel-stats-result';
import './../src/objects/age-range';
import './../src/objects/agency-client-declaration';
import './../src/objects/album';
import './../src/objects/analytics-segment';
import './../src/objects/android-app-link';
import './../src/objects/app-request';
import './../src/objects/app-request-former-recipient';
Expand All @@ -160,6 +170,8 @@ import './../src/objects/avatar';
import './../src/objects/avatar-profile-picture';
import './../src/objects/brand-request';
import './../src/objects/brand-safety-block-list-usage';
import './../src/objects/branded-content-shadow-ig-media-id';
import './../src/objects/branded-content-shadow-ig-user-id';
import './../src/objects/broad-targeting-categories';
import './../src/objects/business';
import './../src/objects/business-ad-account-request';
Expand Down Expand Up @@ -342,7 +354,6 @@ import './../src/objects/open-bridge-configuration';
import './../src/objects/open-graph-context';
import './../src/objects/outcome-prediction-point';
import './../src/objects/page';
import './../src/objects/page-about-story';
import './../src/objects/page-about-story-composed-block';
import './../src/objects/page-about-story-composed-block-entity-ranges';
import './../src/objects/page-about-story-composed-block-inline-style';
Expand Down Expand Up @@ -439,6 +450,7 @@ import './../src/objects/stories';
import './../src/objects/system-user';
import './../src/objects/tab';
import './../src/objects/targeting';
import './../src/objects/targeting-automation';
import './../src/objects/targeting-dynamic-rule';
import './../src/objects/targeting-geo-location';
import './../src/objects/targeting-geo-location-city';
Expand Down Expand Up @@ -494,6 +506,7 @@ import './../src/objects/web-app-link';
import './../src/objects/whats-app-business-account';
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-partner-client-verification-submission';
import './../src/objects/whats-app-business-pre-verified-phone-number';
import './../src/objects/whats-app-business-profile';
import './../src/objects/windows-app-link';
Expand Down
1 change: 1 addition & 0 deletions src/objects/ad-account-ad-rules-history.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export default class AdAccountAdRulesHistory extends AbstractCrudObject {
enable_advantage_plus_creative: 'ENABLE_ADVANTAGE_PLUS_CREATIVE',
enable_advantage_plus_placements: 'ENABLE_ADVANTAGE_PLUS_PLACEMENTS',
enable_autoflow: 'ENABLE_AUTOFLOW',
enable_gen_uncrop: 'ENABLE_GEN_UNCROP',
enable_semantic_based_audience_expansion: 'ENABLE_SEMANTIC_BASED_AUDIENCE_EXPANSION',
endpoint_pinged: 'ENDPOINT_PINGED',
error: 'ERROR',
Expand Down
6 changes: 6 additions & 0 deletions src/objects/ad-account-ad-volume.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ export default class AdAccountAdVolume extends AbstractCrudObject {
autoflow_opt_in_fallback_duplication_flow: 'AUTOFLOW_OPT_IN_FALLBACK_DUPLICATION_FLOW',
automatic_placements: 'AUTOMATIC_PLACEMENTS',
auto_bid: 'AUTO_BID',
blended_ads: 'BLENDED_ADS',
broad_targeting: 'BROAD_TARGETING',
capi: 'CAPI',
capi_performance_match_key: 'CAPI_PERFORMANCE_MATCH_KEY',
capi_performance_match_key_v2: 'CAPI_PERFORMANCE_MATCH_KEY_V2',
cash_rewards_opt_in: 'CASH_REWARDS_OPT_IN',
connect_facebook_page_to_instagram: 'CONNECT_FACEBOOK_PAGE_TO_INSTAGRAM',
connect_facebook_page_to_whatsapp: 'CONNECT_FACEBOOK_PAGE_TO_WHATSAPP',
Expand All @@ -92,10 +94,13 @@ export default class AdAccountAdVolume extends AbstractCrudObject {
creative_limited_hourly: 'CREATIVE_LIMITED_HOURLY',
creator_ads_pa_conversion: 'CREATOR_ADS_PA_CONVERSION',
cta: 'CTA',
ctx_budget_optimization: 'CTX_BUDGET_OPTIMIZATION',
da_advantage_plus_creative_info_labels: 'DA_ADVANTAGE_PLUS_CREATIVE_INFO_LABELS',
dead_link: 'DEAD_LINK',
dynamic_advantage_campaign_budget: 'DYNAMIC_ADVANTAGE_CAMPAIGN_BUDGET',
ecosystem_bid_reduce_l1_cardinality: 'ECOSYSTEM_BID_REDUCE_L1_CARDINALITY',
evc_app_duplication_upgrade: 'EVC_APP_DUPLICATION_UPGRADE',
evc_web_duplication_upgrade: 'EVC_WEB_DUPLICATION_UPGRADE',
fragmentation: 'FRAGMENTATION',
ges_test: 'GES_TEST',
guidance_center_code_gen: 'GUIDANCE_CENTER_CODE_GEN',
Expand Down Expand Up @@ -130,6 +135,7 @@ export default class AdAccountAdVolume extends AbstractCrudObject {
shops_ads: 'SHOPS_ADS',
signals_growth_capi: 'SIGNALS_GROWTH_CAPI',
signals_growth_capi_table: 'SIGNALS_GROWTH_CAPI_TABLE',
signals_growth_capi_v2: 'SIGNALS_GROWTH_CAPI_V2',
six_plus_manual_placements: 'SIX_PLUS_MANUAL_PLACEMENTS',
spend_limit: 'SPEND_LIMIT',
syd_test_mode: 'SYD_TEST_MODE',
Expand Down
1 change: 1 addition & 0 deletions src/objects/ad-account-delivery-estimate.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default class AdAccountDeliveryEstimate extends AbstractCrudObject {
landing_page_views: 'LANDING_PAGE_VIEWS',
lead_generation: 'LEAD_GENERATION',
link_clicks: 'LINK_CLICKS',
meaningful_call_attempt: 'MEANINGFUL_CALL_ATTEMPT',
messaging_appointment_conversion: 'MESSAGING_APPOINTMENT_CONVERSION',
messaging_purchase_conversion: 'MESSAGING_PURCHASE_CONVERSION',
none: 'NONE',
Expand Down
22 changes: 21 additions & 1 deletion src/objects/ad-account.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import AsyncRequest from './async-request';
import AdAsyncRequestSet from './ad-async-request-set';
import BroadTargetingCategories from './broad-targeting-categories';
import IGUser from './ig-user';
import InstagramUser from './instagram-user';
import CustomAudience from './custom-audience';
import CustomAudiencesTOS from './custom-audiences-tos';
import CustomConversion from './custom-conversion';
Expand All @@ -43,7 +44,6 @@ import AdAccountDsaRecommendations from './ad-account-dsa-recommendations';
import AdPreview from './ad-preview';
import AdsInsights from './ads-insights';
import AdReportRun from './ad-report-run';
import InstagramUser from './instagram-user';
import AdAccountIosFourteenCampaignLimits from './ad-account-ios-fourteen-campaign-limits';
import AdAccountMatchedSearchApplicationsEdgeData from './ad-account-matched-search-applications-edge-data';
import AdAccountMaxBid from './ad-account-max-bid';
Expand Down Expand Up @@ -832,6 +832,16 @@ export default class AdAccount extends AbstractCrudObject {
);
}

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

getConversionGoals (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
AbstractObject,
Expand Down Expand Up @@ -1246,6 +1256,16 @@ export default class AdAccount extends AbstractCrudObject {
);
}

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

getValueAdjustmentRules (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
AbstractObject,
Expand Down
27 changes: 27 additions & 0 deletions src/objects/ad-asset-body.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/

import {AbstractCrudObject} from './../abstract-crud-object';

/**
* AdAssetBody
* @extends AbstractCrudObject
* @see {@link https://developers.facebook.com/docs/marketing-api/}
*/
export default class AdAssetBody extends AbstractCrudObject {
static get Fields (): Object {
return Object.freeze({
id: 'id',
text: 'text',
url_tags: 'url_tags',
});
}

}
26 changes: 26 additions & 0 deletions src/objects/ad-asset-call-to-action-type.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/

import {AbstractCrudObject} from './../abstract-crud-object';

/**
* AdAssetCallToActionType
* @extends AbstractCrudObject
* @see {@link https://developers.facebook.com/docs/marketing-api/}
*/
export default class AdAssetCallToActionType extends AbstractCrudObject {
static get Fields (): Object {
return Object.freeze({
id: 'id',
name: 'name',
});
}

}
27 changes: 27 additions & 0 deletions src/objects/ad-asset-description.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/

import {AbstractCrudObject} from './../abstract-crud-object';

/**
* AdAssetDescription
* @extends AbstractCrudObject
* @see {@link https://developers.facebook.com/docs/marketing-api/}
*/
export default class AdAssetDescription extends AbstractCrudObject {
static get Fields (): Object {
return Object.freeze({
id: 'id',
text: 'text',
url_tags: 'url_tags',
});
}

}
1 change: 1 addition & 0 deletions src/objects/ad-asset-feed-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export default class AdAssetFeedSpec extends AbstractCrudObject {
inquire_now: 'INQUIRE_NOW',
install_app: 'INSTALL_APP',
install_mobile_app: 'INSTALL_MOBILE_APP',
join_channel: 'JOIN_CHANNEL',
learn_more: 'LEARN_MORE',
like_page: 'LIKE_PAGE',
listen_music: 'LISTEN_MUSIC',
Expand Down
Loading

0 comments on commit 3221b62

Please sign in to comment.