diff --git a/examples/product_catalog_hotels_post_update_hotels_catalog_settings.js b/examples/product_catalog_hotels_post_update_hotels_catalog_settings.js index 006caa3e..3444adb8 100644 --- a/examples/product_catalog_hotels_post_update_hotels_catalog_settings.js +++ b/examples/product_catalog_hotels_post_update_hotels_catalog_settings.js @@ -32,7 +32,6 @@ let fields, params; fields = [ ]; params = { - 'hotel_catalog_settings' : {'pull_config_id':''}, }; const sample_code = (new ProductCatalog(id)).update( fields, diff --git a/package.json b/package.json index 1f4daf68..e893c842 100644 --- a/package.json +++ b/package.json @@ -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": [ diff --git a/src/api.js b/src/api.js index b039c02c..d9260d11 100644 --- a/src/api.js +++ b/src/api.js @@ -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'; diff --git a/src/bundle.es6 b/src/bundle.es6 index 508952e6..8f3a6242 100644 --- a/src/bundle.es6 +++ b/src/bundle.es6 @@ -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'; @@ -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'; @@ -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'; @@ -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'; @@ -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'; @@ -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'; @@ -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'; @@ -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'; diff --git a/src/cursor.js b/src/cursor.js index 5476cac0..df58f77f 100644 --- a/src/cursor.js +++ b/src/cursor.js @@ -48,7 +48,7 @@ export default class Cursor extends Array { } this._api = sourceObject.getApi(); this._targetClass = targetClass; - this.paging = {next: next, params: params}; + this.paging = {next: next}; this.clear = () => { this.length = 0; @@ -84,7 +84,7 @@ export default class Cursor extends Array { 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); @@ -95,7 +95,9 @@ export default class Cursor extends Array { }) .catch(reject); }); - + if (params) { + params = undefined; + } return promise; }; diff --git a/src/globals.es6 b/src/globals.es6 index 4a2f6e09..82e54660 100644 --- a/src/globals.es6 +++ b/src/globals.es6 @@ -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'; @@ -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'; @@ -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'; @@ -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'; @@ -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'; @@ -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'; @@ -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'; @@ -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'; diff --git a/src/objects/ad-account-ad-rules-history.js b/src/objects/ad-account-ad-rules-history.js index b8da85af..27f77efd 100644 --- a/src/objects/ad-account-ad-rules-history.js +++ b/src/objects/ad-account-ad-rules-history.js @@ -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', diff --git a/src/objects/ad-account-ad-volume.js b/src/objects/ad-account-ad-volume.js index 8cdfa2df..1faaf34a 100644 --- a/src/objects/ad-account-ad-volume.js +++ b/src/objects/ad-account-ad-volume.js @@ -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', @@ -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', @@ -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', diff --git a/src/objects/ad-account-delivery-estimate.js b/src/objects/ad-account-delivery-estimate.js index 1262abc0..bd39b3e3 100644 --- a/src/objects/ad-account-delivery-estimate.js +++ b/src/objects/ad-account-delivery-estimate.js @@ -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', diff --git a/src/objects/ad-account.js b/src/objects/ad-account.js index c2be1e94..81556d65 100644 --- a/src/objects/ad-account.js +++ b/src/objects/ad-account.js @@ -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'; @@ -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'; @@ -832,6 +832,16 @@ export default class AdAccount extends AbstractCrudObject { ); } + getConnectedInstagramAccountsWithIabp (fields: Array, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> { + return this.getEdge( + InstagramUser, + fields, + params, + fetchFirstPage, + '/connected_instagram_accounts_with_iabp' + ); + } + getConversionGoals (fields: Array, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> { return this.getEdge( AbstractObject, @@ -1246,6 +1256,16 @@ export default class AdAccount extends AbstractCrudObject { ); } + getValueAdjustmentRulePersonaGroups (fields: Array, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> { + return this.getEdge( + AbstractObject, + fields, + params, + fetchFirstPage, + '/value_adjustment_rule_persona_groups' + ); + } + getValueAdjustmentRules (fields: Array, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> { return this.getEdge( AbstractObject, diff --git a/src/objects/ad-asset-body.js b/src/objects/ad-asset-body.js new file mode 100644 index 00000000..0595eaf9 --- /dev/null +++ b/src/objects/ad-asset-body.js @@ -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', + }); + } + +} diff --git a/src/objects/ad-asset-call-to-action-type.js b/src/objects/ad-asset-call-to-action-type.js new file mode 100644 index 00000000..e5e7adeb --- /dev/null +++ b/src/objects/ad-asset-call-to-action-type.js @@ -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', + }); + } + +} diff --git a/src/objects/ad-asset-description.js b/src/objects/ad-asset-description.js new file mode 100644 index 00000000..378f6d83 --- /dev/null +++ b/src/objects/ad-asset-description.js @@ -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', + }); + } + +} diff --git a/src/objects/ad-asset-feed-spec.js b/src/objects/ad-asset-feed-spec.js index 5c616467..06b9aa2b 100644 --- a/src/objects/ad-asset-feed-spec.js +++ b/src/objects/ad-asset-feed-spec.js @@ -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', diff --git a/src/objects/ad-asset-image.js b/src/objects/ad-asset-image.js new file mode 100644 index 00000000..0aa4a9b7 --- /dev/null +++ b/src/objects/ad-asset-image.js @@ -0,0 +1,31 @@ + /* + * 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'; + +/** + * AdAssetImage + * @extends AbstractCrudObject + * @see {@link https://developers.facebook.com/docs/marketing-api/} + */ +export default class AdAssetImage extends AbstractCrudObject { + static get Fields (): Object { + return Object.freeze({ + hash: 'hash', + id: 'id', + image_crops: 'image_crops', + name: 'name', + tag: 'tag', + url: 'url', + url_tags: 'url_tags', + }); + } + +} diff --git a/src/objects/page-about-story.js b/src/objects/ad-asset-link-url.js similarity index 52% rename from src/objects/page-about-story.js rename to src/objects/ad-asset-link-url.js index e9390149..6e37809a 100644 --- a/src/objects/page-about-story.js +++ b/src/objects/ad-asset-link-url.js @@ -11,30 +11,23 @@ import {AbstractCrudObject} from './../abstract-crud-object'; /** - * PageAboutStory + * AdAssetLinkURL * @extends AbstractCrudObject * @see {@link https://developers.facebook.com/docs/marketing-api/} */ -export default class PageAboutStory extends AbstractCrudObject { +export default class AdAssetLinkURL extends AbstractCrudObject { static get Fields (): Object { return Object.freeze({ - composed_text: 'composed_text', - cover_photo: 'cover_photo', - entity_map: 'entity_map', + android_deeplink_url: 'android_deeplink_url', + carousel_see_more_url: 'carousel_see_more_url', + deeplink_url: 'deeplink_url', + display_url: 'display_url', id: 'id', - is_published: 'is_published', - page_id: 'page_id', - title: 'title', + ipad_deeplink_url: 'ipad_deeplink_url', + iphone_deeplink_url: 'iphone_deeplink_url', + url_tags: 'url_tags', + website_url: 'website_url', }); } - - - get (fields: Array, params: Object = {}): PageAboutStory { - // $FlowFixMe : Support Generic Types - return this.read( - fields, - params - ); - } } diff --git a/src/objects/ad-asset-title.js b/src/objects/ad-asset-title.js new file mode 100644 index 00000000..42614e90 --- /dev/null +++ b/src/objects/ad-asset-title.js @@ -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'; + +/** + * AdAssetTitle + * @extends AbstractCrudObject + * @see {@link https://developers.facebook.com/docs/marketing-api/} + */ +export default class AdAssetTitle extends AbstractCrudObject { + static get Fields (): Object { + return Object.freeze({ + id: 'id', + text: 'text', + url_tags: 'url_tags', + }); + } + +} diff --git a/src/objects/ad-asset-video.js b/src/objects/ad-asset-video.js new file mode 100644 index 00000000..6671833b --- /dev/null +++ b/src/objects/ad-asset-video.js @@ -0,0 +1,35 @@ + /* + * 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'; + +/** + * AdAssetVideo + * @extends AbstractCrudObject + * @see {@link https://developers.facebook.com/docs/marketing-api/} + */ +export default class AdAssetVideo extends AbstractCrudObject { + static get Fields (): Object { + return Object.freeze({ + caption_ids: 'caption_ids', + id: 'id', + source_image_url: 'source_image_url', + tag: 'tag', + thumbnail_hash: 'thumbnail_hash', + thumbnail_source: 'thumbnail_source', + thumbnail_url: 'thumbnail_url', + url: 'url', + url_tags: 'url_tags', + video_id: 'video_id', + video_name: 'video_name', + }); + } + +} diff --git a/src/objects/ad-campaign-delivery-estimate.js b/src/objects/ad-campaign-delivery-estimate.js index 08a5adfe..a62d88c9 100644 --- a/src/objects/ad-campaign-delivery-estimate.js +++ b/src/objects/ad-campaign-delivery-estimate.js @@ -41,6 +41,7 @@ export default class AdCampaignDeliveryEstimate 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', diff --git a/src/objects/ad-creative-link-data-call-to-action.js b/src/objects/ad-creative-link-data-call-to-action.js index 7121a7d1..cc9c0ffe 100644 --- a/src/objects/ad-creative-link-data-call-to-action.js +++ b/src/objects/ad-creative-link-data-call-to-action.js @@ -58,6 +58,7 @@ export default class AdCreativeLinkDataCallToAction 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', diff --git a/src/objects/ad-creative-promotion-metadata-spec.js b/src/objects/ad-creative-promotion-metadata-spec.js new file mode 100644 index 00000000..cc5b9e5d --- /dev/null +++ b/src/objects/ad-creative-promotion-metadata-spec.js @@ -0,0 +1,31 @@ + /* + * 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'; + +/** + * AdCreativePromotionMetadataSpec + * @extends AbstractCrudObject + * @see {@link https://developers.facebook.com/docs/marketing-api/} + */ +export default class AdCreativePromotionMetadataSpec extends AbstractCrudObject { + static get Fields (): Object { + return Object.freeze({ + end_date: 'end_date', + id: 'id', + promotion_source: 'promotion_source', + promotion_type: 'promotion_type', + promotion_value: 'promotion_value', + required_code: 'required_code', + start_date: 'start_date', + }); + } + +} diff --git a/src/objects/ad-creative-site-links-spec.js b/src/objects/ad-creative-site-links-spec.js new file mode 100644 index 00000000..2988a5fc --- /dev/null +++ b/src/objects/ad-creative-site-links-spec.js @@ -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'; + +/** + * AdCreativeSiteLinksSpec + * @extends AbstractCrudObject + * @see {@link https://developers.facebook.com/docs/marketing-api/} + */ +export default class AdCreativeSiteLinksSpec extends AbstractCrudObject { + static get Fields (): Object { + return Object.freeze({ + site_link_title: 'site_link_title', + site_link_url: 'site_link_url', + }); + } + +} diff --git a/src/objects/ad-creative-sourcing-spec.js b/src/objects/ad-creative-sourcing-spec.js index 86d3f950..6d85e68f 100644 --- a/src/objects/ad-creative-sourcing-spec.js +++ b/src/objects/ad-creative-sourcing-spec.js @@ -19,6 +19,8 @@ export default class AdCreativeSourcingSpec extends AbstractCrudObject { static get Fields (): Object { return Object.freeze({ associated_product_set_id: 'associated_product_set_id', + promotion_metadata_spec: 'promotion_metadata_spec', + site_links_spec: 'site_links_spec', }); } diff --git a/src/objects/ad-creative.js b/src/objects/ad-creative.js index b3bd4846..9affd373 100644 --- a/src/objects/ad-creative.js +++ b/src/objects/ad-creative.js @@ -126,6 +126,7 @@ export default class AdCreative 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', diff --git a/src/objects/ad-preview.js b/src/objects/ad-preview.js index 9bc8ae14..a41528c2 100644 --- a/src/objects/ad-preview.js +++ b/src/objects/ad-preview.js @@ -45,6 +45,7 @@ export default class AdPreview extends AbstractCrudObject { instagram_explore_immersive: 'INSTAGRAM_EXPLORE_IMMERSIVE', instagram_feed_web: 'INSTAGRAM_FEED_WEB', instagram_feed_web_m_site: 'INSTAGRAM_FEED_WEB_M_SITE', + instagram_lead_gen_multi_submit_ads: 'INSTAGRAM_LEAD_GEN_MULTI_SUBMIT_ADS', instagram_profile_feed: 'INSTAGRAM_PROFILE_FEED', instagram_profile_reels: 'INSTAGRAM_PROFILE_REELS', instagram_reels: 'INSTAGRAM_REELS', @@ -59,9 +60,11 @@ export default class AdPreview extends AbstractCrudObject { instant_article_recirculation_ad: 'INSTANT_ARTICLE_RECIRCULATION_AD', instant_article_standard: 'INSTANT_ARTICLE_STANDARD', instream_banner_desktop: 'INSTREAM_BANNER_DESKTOP', + instream_banner_immersive_mobile: 'INSTREAM_BANNER_IMMERSIVE_MOBILE', instream_banner_mobile: 'INSTREAM_BANNER_MOBILE', instream_video_desktop: 'INSTREAM_VIDEO_DESKTOP', instream_video_image: 'INSTREAM_VIDEO_IMAGE', + instream_video_immersive_mobile: 'INSTREAM_VIDEO_IMMERSIVE_MOBILE', instream_video_mobile: 'INSTREAM_VIDEO_MOBILE', job_browser_desktop: 'JOB_BROWSER_DESKTOP', job_browser_mobile: 'JOB_BROWSER_MOBILE', @@ -77,6 +80,7 @@ export default class AdPreview extends AbstractCrudObject { mobile_native: 'MOBILE_NATIVE', right_column_standard: 'RIGHT_COLUMN_STANDARD', suggested_video_desktop: 'SUGGESTED_VIDEO_DESKTOP', + suggested_video_immersive_mobile: 'SUGGESTED_VIDEO_IMMERSIVE_MOBILE', suggested_video_mobile: 'SUGGESTED_VIDEO_MOBILE', watch_feed_home: 'WATCH_FEED_HOME', watch_feed_mobile: 'WATCH_FEED_MOBILE', diff --git a/src/objects/ad-rule-history.js b/src/objects/ad-rule-history.js index 43d39bf2..53168a08 100644 --- a/src/objects/ad-rule-history.js +++ b/src/objects/ad-rule-history.js @@ -38,6 +38,7 @@ export default class AdRuleHistory 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', diff --git a/src/objects/ad-set.js b/src/objects/ad-set.js index 508f46e0..0597da3a 100644 --- a/src/objects/ad-set.js +++ b/src/objects/ad-set.js @@ -99,6 +99,7 @@ export default class AdSet extends AbstractCrudObject { cost_cap: 'COST_CAP', lowest_cost_without_cap: 'LOWEST_COST_WITHOUT_CAP', lowest_cost_with_bid_cap: 'LOWEST_COST_WITH_BID_CAP', + lowest_cost_with_min_roas: 'LOWEST_COST_WITH_MIN_ROAS', }); } static get BillingEvent (): Object { @@ -149,6 +150,7 @@ export default class AdSet 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', @@ -175,26 +177,26 @@ export default class AdSet extends AbstractCrudObject { } static get DatePreset (): Object { return Object.freeze({ - data_maximum: 'data_maximum', - last_14d: 'last_14d', - last_28d: 'last_28d', - last_30d: 'last_30d', - last_3d: 'last_3d', - last_7d: 'last_7d', - last_90d: 'last_90d', - last_month: 'last_month', - last_quarter: 'last_quarter', - last_week_mon_sun: 'last_week_mon_sun', - last_week_sun_sat: 'last_week_sun_sat', - last_year: 'last_year', - maximum: 'maximum', - this_month: 'this_month', - this_quarter: 'this_quarter', - this_week_mon_today: 'this_week_mon_today', - this_week_sun_today: 'this_week_sun_today', - this_year: 'this_year', - today: 'today', - yesterday: 'yesterday', + data_maximum: 'DATA_MAXIMUM', + last_14d: 'LAST_14D', + last_28d: 'LAST_28D', + last_30d: 'LAST_30D', + last_3d: 'LAST_3D', + last_7d: 'LAST_7D', + last_90d: 'LAST_90D', + last_month: 'LAST_MONTH', + last_quarter: 'LAST_QUARTER', + last_week_mon_sun: 'LAST_WEEK_MON_SUN', + last_week_sun_sat: 'LAST_WEEK_SUN_SAT', + last_year: 'LAST_YEAR', + lifetime: 'LIFETIME', + this_month: 'THIS_MONTH', + this_quarter: 'THIS_QUARTER', + this_week_mon_today: 'THIS_WEEK_MON_TODAY', + this_week_sun_today: 'THIS_WEEK_SUN_TODAY', + this_year: 'THIS_YEAR', + today: 'TODAY', + yesterday: 'YESTERDAY', }); } static get DestinationType (): Object { diff --git a/src/objects/ad.js b/src/objects/ad.js index 298c2851..189a902f 100644 --- a/src/objects/ad.js +++ b/src/objects/ad.js @@ -122,7 +122,7 @@ export default class Ad extends AbstractCrudObject { last_week_mon_sun: 'last_week_mon_sun', last_week_sun_sat: 'last_week_sun_sat', last_year: 'last_year', - maximum: 'maximum', + lifetime: 'lifetime', this_month: 'this_month', this_quarter: 'this_quarter', this_week_mon_today: 'this_week_mon_today', diff --git a/src/objects/ads-insights.js b/src/objects/ads-insights.js index d3d04db0..7f960df4 100644 --- a/src/objects/ads-insights.js +++ b/src/objects/ads-insights.js @@ -182,6 +182,8 @@ export default class AdsInsights extends AbstractCrudObject { action_type: 'action_type', action_video_sound: 'action_video_sound', action_video_type: 'action_video_type', + conversion_destination: 'conversion_destination', + signal_source_bucket: 'signal_source_bucket', standard_event_content_type: 'standard_event_content_type', }); } @@ -200,6 +202,7 @@ export default class AdsInsights extends AbstractCrudObject { body_asset: 'body_asset', call_to_action_asset: 'call_to_action_asset', coarse_conversion_value: 'coarse_conversion_value', + conversion_destination: 'conversion_destination', country: 'country', description_asset: 'description_asset', device_platform: 'device_platform', @@ -253,7 +256,7 @@ export default class AdsInsights extends AbstractCrudObject { last_week_mon_sun: 'last_week_mon_sun', last_week_sun_sat: 'last_week_sun_sat', last_year: 'last_year', - maximum: 'maximum', + lifetime: 'lifetime', this_month: 'this_month', this_quarter: 'this_quarter', this_week_mon_today: 'this_week_mon_today', @@ -283,6 +286,8 @@ export default class AdsInsights extends AbstractCrudObject { action_type: 'action_type', action_video_sound: 'action_video_sound', action_video_type: 'action_video_type', + conversion_destination: 'conversion_destination', + signal_source_bucket: 'signal_source_bucket', standard_event_content_type: 'standard_event_content_type', }); } diff --git a/src/objects/ads-pixel.js b/src/objects/ads-pixel.js index 7f75a08c..8e719652 100644 --- a/src/objects/ads-pixel.js +++ b/src/objects/ads-pixel.js @@ -178,16 +178,6 @@ export default class AdsPixel extends AbstractCrudObject { ); } - createMeapitocapiconsolidationhelper (fields: Array, params: Object = {}, pathOverride?: ?string = null): Promise { - return this.createEdge( - '/meapitocapiconsolidationhelper', - fields, - params, - null, - pathOverride, - ); - } - getOfflineEventUploads (fields: Array, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> { return this.getEdge( OfflineConversionDataSetUpload, diff --git a/src/objects/analytics-segment.js b/src/objects/analytics-segment.js new file mode 100644 index 00000000..0b594866 --- /dev/null +++ b/src/objects/analytics-segment.js @@ -0,0 +1,50 @@ + /* + * 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'; + +/** + * AnalyticsSegment + * @extends AbstractCrudObject + * @see {@link https://developers.facebook.com/docs/marketing-api/} + */ +export default class AnalyticsSegment extends AbstractCrudObject { + static get Fields (): Object { + return Object.freeze({ + custom_audience_ineligiblity_reasons: 'custom_audience_ineligiblity_reasons', + description: 'description', + estimated_custom_audience_size: 'estimated_custom_audience_size', + event_info_rules: 'event_info_rules', + event_rules: 'event_rules', + filter_set: 'filter_set', + has_demographic_rules: 'has_demographic_rules', + id: 'id', + is_all_user: 'is_all_user', + is_eligible_for_push_campaign: 'is_eligible_for_push_campaign', + is_internal: 'is_internal', + name: 'name', + percentile_rules: 'percentile_rules', + time_last_seen: 'time_last_seen', + time_last_updated: 'time_last_updated', + user_property_rules: 'user_property_rules', + web_param_rules: 'web_param_rules', + }); + } + + + + get (fields: Array, params: Object = {}): AnalyticsSegment { + // $FlowFixMe : Support Generic Types + return this.read( + fields, + params + ); + } +} diff --git a/src/objects/branded-content-shadow-ig-media-id.js b/src/objects/branded-content-shadow-ig-media-id.js new file mode 100644 index 00000000..8dd18a8d --- /dev/null +++ b/src/objects/branded-content-shadow-ig-media-id.js @@ -0,0 +1,28 @@ + /* + * 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'; + +/** + * BrandedContentShadowIGMediaID + * @extends AbstractCrudObject + * @see {@link https://developers.facebook.com/docs/marketing-api/} + */ +export default class BrandedContentShadowIGMediaID extends AbstractCrudObject { + static get Fields (): Object { + return Object.freeze({ + eligibility_errors: 'eligibility_errors', + id: 'id', + owner_id: 'owner_id', + permalink: 'permalink', + }); + } + +} diff --git a/src/objects/branded-content-shadow-ig-user-id.js b/src/objects/branded-content-shadow-ig-user-id.js new file mode 100644 index 00000000..08b64ab4 --- /dev/null +++ b/src/objects/branded-content-shadow-ig-user-id.js @@ -0,0 +1,25 @@ + /* + * 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'; + +/** + * BrandedContentShadowIGUserID + * @extends AbstractCrudObject + * @see {@link https://developers.facebook.com/docs/marketing-api/} + */ +export default class BrandedContentShadowIGUserID extends AbstractCrudObject { + static get Fields (): Object { + return Object.freeze({ + id: 'id', + }); + } + +} diff --git a/src/objects/business.js b/src/objects/business.js index 11764909..40fcf01d 100644 --- a/src/objects/business.js +++ b/src/objects/business.js @@ -46,6 +46,7 @@ import BusinessPageRequest from './business-page-request'; import BusinessRoleRequest from './business-role-request'; import ProfilePictureSource from './profile-picture-source'; import WhatsAppBusinessPreVerifiedPhoneNumber from './whats-app-business-pre-verified-phone-number'; +import WhatsAppBusinessPartnerClientVerificationSubmission from './whats-app-business-partner-client-verification-submission'; import SystemUser from './system-user'; import AdVideo from './ad-video'; @@ -1307,6 +1308,16 @@ export default class Business extends AbstractCrudObject { ); } + getSelfCertifiedWhatsappBusinessSubmissions (fields: Array, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> { + return this.getEdge( + WhatsAppBusinessPartnerClientVerificationSubmission, + fields, + params, + fetchFirstPage, + '/self_certified_whatsapp_business_submissions' + ); + } + createSetupManagedPartnerAdAccount (fields: Array, params: Object = {}, pathOverride?: ?string = null): Promise { return this.createEdge( '/setup_managed_partner_adaccounts', diff --git a/src/objects/campaign.js b/src/objects/campaign.js index 5510060d..8fa3a0df 100644 --- a/src/objects/campaign.js +++ b/src/objects/campaign.js @@ -75,6 +75,7 @@ export default class Campaign extends AbstractCrudObject { cost_cap: 'COST_CAP', lowest_cost_without_cap: 'LOWEST_COST_WITHOUT_CAP', lowest_cost_with_bid_cap: 'LOWEST_COST_WITH_BID_CAP', + lowest_cost_with_min_roas: 'LOWEST_COST_WITH_MIN_ROAS', }); } static get ConfiguredStatus (): Object { @@ -117,7 +118,7 @@ export default class Campaign extends AbstractCrudObject { last_week_mon_sun: 'last_week_mon_sun', last_week_sun_sat: 'last_week_sun_sat', last_year: 'last_year', - maximum: 'maximum', + lifetime: 'lifetime', this_month: 'this_month', this_quarter: 'this_quarter', this_week_mon_today: 'this_week_mon_today', diff --git a/src/objects/commerce-merchant-settings.js b/src/objects/commerce-merchant-settings.js index dd4f06da..25ebb8fa 100644 --- a/src/objects/commerce-merchant-settings.js +++ b/src/objects/commerce-merchant-settings.js @@ -96,16 +96,6 @@ export default class CommerceMerchantSettings extends AbstractCrudObject { ); } - getOnsiteConversionEvents (fields: Array, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> { - return this.getEdge( - AbstractObject, - fields, - params, - fetchFirstPage, - '/onsite_conversion_events' - ); - } - getOrderManagementApps (fields: Array, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> { return this.getEdge( Application, diff --git a/src/objects/custom-audience-data-source.js b/src/objects/custom-audience-data-source.js index ca1a6ad0..e7604163 100644 --- a/src/objects/custom-audience-data-source.js +++ b/src/objects/custom-audience-data-source.js @@ -85,6 +85,7 @@ export default class CustomAudienceDataSource extends AbstractCrudObject { web_pixel_combination_events: 'WEB_PIXEL_COMBINATION_EVENTS', web_pixel_hits: 'WEB_PIXEL_HITS', web_pixel_hits_custom_audience_users: 'WEB_PIXEL_HITS_CUSTOM_AUDIENCE_USERS', + whatsapp_subscriber_pool: 'WHATSAPP_SUBSCRIBER_POOL', }); } static get Type (): Object { diff --git a/src/objects/group.js b/src/objects/group.js index 46967d38..093072ed 100644 --- a/src/objects/group.js +++ b/src/objects/group.js @@ -59,9 +59,9 @@ export default class Group extends AbstractCrudObject { } static get PostPermissions (): Object { return Object.freeze({ - value_0: '0', - value_1: '1', - value_2: '2', + admin_only: 'ADMIN_ONLY', + anyone: 'ANYONE', + none: 'NONE', }); } static get Purpose (): Object { diff --git a/src/objects/ig-media.js b/src/objects/ig-media.js index cba48af3..af8b75a7 100644 --- a/src/objects/ig-media.js +++ b/src/objects/ig-media.js @@ -11,6 +11,7 @@ import {AbstractCrudObject} from './../abstract-crud-object'; import AbstractObject from './../abstract-object'; import Cursor from './../cursor'; +import BrandedContentShadowIGUserID from './branded-content-shadow-ig-user-id'; import ShadowIGMediaCollaborators from './shadow-ig-media-collaborators'; import IGComment from './ig-comment'; import InstagramInsightsResult from './instagram-insights-result'; @@ -45,6 +46,26 @@ export default class IGMedia extends AbstractCrudObject { } + getBrandedContentPartnerPromote (fields: Array, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> { + return this.getEdge( + BrandedContentShadowIGUserID, + fields, + params, + fetchFirstPage, + '/branded_content_partner_promote' + ); + } + + createBrandedContentPartnerPromote (fields: Array, params: Object = {}, pathOverride?: ?string = null): Promise { + return this.createEdge( + '/branded_content_partner_promote', + fields, + params, + BrandedContentShadowIGUserID, + pathOverride, + ); + } + getChildren (fields: Array, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> { return this.getEdge( IGMedia, diff --git a/src/objects/ig-user.js b/src/objects/ig-user.js index 1db49076..a7987adb 100644 --- a/src/objects/ig-user.js +++ b/src/objects/ig-user.js @@ -12,6 +12,9 @@ import {AbstractCrudObject} from './../abstract-crud-object'; import AbstractObject from './../abstract-object'; import Cursor from './../cursor'; import UserAvailableCatalogs from './user-available-catalogs'; +import IGBCAdsPermission from './igbc-ads-permission'; +import BrandedContentShadowIGMediaID from './branded-content-shadow-ig-media-id'; +import BrandedContentShadowIGUserID from './branded-content-shadow-ig-user-id'; import ShadowIGUserCatalogProductSearch from './shadow-ig-user-catalog-product-search'; import ContentPublishingLimitResponse from './content-publishing-limit-response'; import Dataset from './dataset'; @@ -59,6 +62,63 @@ export default class IGUser extends AbstractCrudObject { ); } + getBrandedContentAdPermissions (fields: Array, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> { + return this.getEdge( + IGBCAdsPermission, + fields, + params, + fetchFirstPage, + '/branded_content_ad_permissions' + ); + } + + createBrandedContentAdPermission (fields: Array, params: Object = {}, pathOverride?: ?string = null): Promise { + return this.createEdge( + '/branded_content_ad_permissions', + fields, + params, + IGBCAdsPermission, + pathOverride, + ); + } + + getBrandedContentAdvertisableMedias (fields: Array, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> { + return this.getEdge( + BrandedContentShadowIGMediaID, + fields, + params, + fetchFirstPage, + '/branded_content_advertisable_medias' + ); + } + + deleteBrandedContentTagApproval (params: Object = {}): Promise<*> { + return super.deleteEdge( + '/branded_content_tag_approval', + params + ); + } + + getBrandedContentTagApproval (fields: Array, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> { + return this.getEdge( + BrandedContentShadowIGUserID, + fields, + params, + fetchFirstPage, + '/branded_content_tag_approval' + ); + } + + createBrandedContentTagApproval (fields: Array, params: Object = {}, pathOverride?: ?string = null): Promise { + return this.createEdge( + '/branded_content_tag_approval', + fields, + params, + BrandedContentShadowIGUserID, + pathOverride, + ); + } + getCatalogProductSearch (fields: Array, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> { return this.getEdge( ShadowIGUserCatalogProductSearch, diff --git a/src/objects/insights-result.js b/src/objects/insights-result.js index 7be5022c..f885461a 100644 --- a/src/objects/insights-result.js +++ b/src/objects/insights-result.js @@ -42,7 +42,7 @@ export default class InsightsResult extends AbstractCrudObject { last_week_mon_sun: 'last_week_mon_sun', last_week_sun_sat: 'last_week_sun_sat', last_year: 'last_year', - maximum: 'maximum', + lifetime: 'lifetime', this_month: 'this_month', this_quarter: 'this_quarter', this_week_mon_today: 'this_week_mon_today', diff --git a/src/objects/instagram-insights-result.js b/src/objects/instagram-insights-result.js index c7875ef7..834a965c 100644 --- a/src/objects/instagram-insights-result.js +++ b/src/objects/instagram-insights-result.js @@ -38,11 +38,6 @@ export default class InstagramInsightsResult extends AbstractCrudObject { } static get Metric (): Object { return Object.freeze({ - carousel_album_engagement: 'carousel_album_engagement', - carousel_album_impressions: 'carousel_album_impressions', - carousel_album_reach: 'carousel_album_reach', - carousel_album_saved: 'carousel_album_saved', - carousel_album_video_views: 'carousel_album_video_views', clips_replays_count: 'clips_replays_count', comments: 'comments', engagement: 'engagement', diff --git a/src/objects/instagram-user.js b/src/objects/instagram-user.js index 64f23818..5b75c083 100644 --- a/src/objects/instagram-user.js +++ b/src/objects/instagram-user.js @@ -77,6 +77,16 @@ export default class InstagramUser extends AbstractCrudObject { ); } + getUpcomingEvents (fields: Array, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> { + return this.getEdge( + AbstractObject, + fields, + params, + fetchFirstPage, + '/upcoming_events' + ); + } + get (fields: Array, params: Object = {}): InstagramUser { // $FlowFixMe : Support Generic Types diff --git a/src/objects/page.js b/src/objects/page.js index a86c4f89..9edde58d 100644 --- a/src/objects/page.js +++ b/src/objects/page.js @@ -76,6 +76,7 @@ export default class Page extends AbstractCrudObject { app_id: 'app_id', artists_we_like: 'artists_we_like', attire: 'attire', + available_promo_offer_ids: 'available_promo_offer_ids', awards: 'awards', band_interests: 'band_interests', band_members: 'band_members', @@ -124,7 +125,6 @@ export default class Page extends AbstractCrudObject { has_lead_access: 'has_lead_access', has_transitioned_to_new_page_experience: 'has_transitioned_to_new_page_experience', has_whatsapp_business_number: 'has_whatsapp_business_number', - has_whatsapp_enterprise_number_using_cloud_api: 'has_whatsapp_enterprise_number_using_cloud_api', has_whatsapp_number: 'has_whatsapp_number', hometown: 'hometown', hours: 'hours', @@ -168,7 +168,6 @@ export default class Page extends AbstractCrudObject { offer_eligible: 'offer_eligible', overall_star_rating: 'overall_star_rating', owner_business: 'owner_business', - page_about_story: 'page_about_story', page_token: 'page_token', parent_page: 'parent_page', parking: 'parking', @@ -567,6 +566,7 @@ export default class Page extends AbstractCrudObject { message_context: 'message_context', message_deliveries: 'message_deliveries', message_echoes: 'message_echoes', + message_edits: 'message_edits', message_mention: 'message_mention', message_reactions: 'message_reactions', message_reads: 'message_reads', diff --git a/src/objects/product-catalog.js b/src/objects/product-catalog.js index 31c16cba..366efca7 100644 --- a/src/objects/product-catalog.js +++ b/src/objects/product-catalog.js @@ -57,6 +57,7 @@ export default class ProductCatalog extends AbstractCrudObject { feed_count: 'feed_count', id: 'id', is_catalog_segment: 'is_catalog_segment', + is_local_catalog: 'is_local_catalog', name: 'name', owner_business: 'owner_business', product_count: 'product_count', @@ -66,6 +67,12 @@ export default class ProductCatalog extends AbstractCrudObject { }); } + static get AdditionalVerticalOption (): Object { + return Object.freeze({ + local_da_catalog: 'LOCAL_DA_CATALOG', + local_products: 'LOCAL_PRODUCTS', + }); + } static get Vertical (): Object { return Object.freeze({ adoptable_pets: 'adoptable_pets', @@ -73,6 +80,7 @@ export default class ProductCatalog extends AbstractCrudObject { commerce: 'commerce', destinations: 'destinations', flights: 'flights', + generic: 'generic', home_listings: 'home_listings', hotels: 'hotels', jobs: 'jobs', diff --git a/src/objects/product-feed.js b/src/objects/product-feed.js index ba15af5f..0e79be01 100644 --- a/src/objects/product-feed.js +++ b/src/objects/product-feed.js @@ -145,6 +145,7 @@ export default class ProductFeed extends AbstractCrudObject { language_and_country: 'LANGUAGE_AND_COUNTRY', local: 'LOCAL', smart_pixel_language_or_country: 'SMART_PIXEL_LANGUAGE_OR_COUNTRY', + version: 'VERSION', }); } diff --git a/src/objects/product-item.js b/src/objects/product-item.js index 26a83adf..8c7691d9 100644 --- a/src/objects/product-item.js +++ b/src/objects/product-item.js @@ -402,10 +402,12 @@ export default class ProductItem extends AbstractCrudObject { } static get ErrorType (): Object { return Object.freeze({ + address_blocklisted_in_market: 'ADDRESS_BLOCKLISTED_IN_MARKET', ar_deleted_due_to_update: 'AR_DELETED_DUE_TO_UPDATE', ar_policy_violated: 'AR_POLICY_VIOLATED', available: 'AVAILABLE', bad_quality_image: 'BAD_QUALITY_IMAGE', + biz_msg_ai_agent_disabled_by_user: 'BIZ_MSG_AI_AGENT_DISABLED_BY_USER', cannot_edit_subscription_products: 'CANNOT_EDIT_SUBSCRIPTION_PRODUCTS', checkout_disabled_by_user: 'CHECKOUT_DISABLED_BY_USER', commerce_account_not_legally_compliant: 'COMMERCE_ACCOUNT_NOT_LEGALLY_COMPLIANT', @@ -418,8 +420,10 @@ export default class ProductItem extends AbstractCrudObject { empty_availability: 'EMPTY_AVAILABILITY', empty_condition: 'EMPTY_CONDITION', empty_description: 'EMPTY_DESCRIPTION', + empty_image_url: 'EMPTY_IMAGE_URL', empty_product_url: 'EMPTY_PRODUCT_URL', empty_seller_description: 'EMPTY_SELLER_DESCRIPTION', + empty_title: 'EMPTY_TITLE', external_merchant_id_mismatch: 'EXTERNAL_MERCHANT_ID_MISMATCH', generic_invalid_field: 'GENERIC_INVALID_FIELD', hidden_until_product_launch: 'HIDDEN_UNTIL_PRODUCT_LAUNCH', @@ -432,14 +436,28 @@ export default class ProductItem extends AbstractCrudObject { image_resolution_low: 'IMAGE_RESOLUTION_LOW', inactive_shopify_product: 'INACTIVE_SHOPIFY_PRODUCT', invalid_commerce_tax_category: 'INVALID_COMMERCE_TAX_CATEGORY', + invalid_consolidated_locality_information: 'INVALID_CONSOLIDATED_LOCALITY_INFORMATION', + invalid_dealer_communication_parameters: 'INVALID_DEALER_COMMUNICATION_PARAMETERS', + invalid_dma_codes: 'INVALID_DMA_CODES', + invalid_fb_page_id: 'INVALID_FB_PAGE_ID', invalid_images: 'INVALID_IMAGES', invalid_monetizer_return_policy: 'INVALID_MONETIZER_RETURN_POLICY', + invalid_offer_disclaimer_url: 'INVALID_OFFER_DISCLAIMER_URL', + invalid_offer_end_date: 'INVALID_OFFER_END_DATE', invalid_pre_order_params: 'INVALID_PRE_ORDER_PARAMS', + invalid_range_for_area_size: 'INVALID_RANGE_FOR_AREA_SIZE', + invalid_range_for_built_up_area_size: 'INVALID_RANGE_FOR_BUILT_UP_AREA_SIZE', + invalid_range_for_num_of_baths: 'INVALID_RANGE_FOR_NUM_OF_BATHS', + invalid_range_for_num_of_beds: 'INVALID_RANGE_FOR_NUM_OF_BEDS', + invalid_range_for_num_of_rooms: 'INVALID_RANGE_FOR_NUM_OF_ROOMS', + invalid_range_for_parking_spaces: 'INVALID_RANGE_FOR_PARKING_SPACES', invalid_shelter_page_id: 'INVALID_SHELTER_PAGE_ID', invalid_shipping_profile_params: 'INVALID_SHIPPING_PROFILE_PARAMS', invalid_subscription_disable_params: 'INVALID_SUBSCRIPTION_DISABLE_PARAMS', invalid_subscription_enable_params: 'INVALID_SUBSCRIPTION_ENABLE_PARAMS', invalid_subscription_params: 'INVALID_SUBSCRIPTION_PARAMS', + invalid_vehicle_state: 'INVALID_VEHICLE_STATE', + invalid_virtual_tour_url_domain: 'INVALID_VIRTUAL_TOUR_URL_DOMAIN', inventory_zero_availability_in_stock: 'INVENTORY_ZERO_AVAILABILITY_IN_STOCK', in_another_product_launch: 'IN_ANOTHER_PRODUCT_LAUNCH', item_group_not_specified: 'ITEM_GROUP_NOT_SPECIFIED', @@ -459,8 +477,10 @@ export default class ProductItem extends AbstractCrudObject { missing_size: 'MISSING_SIZE', missing_tax_category: 'MISSING_TAX_CATEGORY', negative_community_feedback: 'NEGATIVE_COMMUNITY_FEEDBACK', + negative_price: 'NEGATIVE_PRICE', not_enough_images: 'NOT_ENOUGH_IMAGES', not_enough_unique_products: 'NOT_ENOUGH_UNIQUE_PRODUCTS', + overlay_disclaimer_exceeded_max_length: 'OVERLAY_DISCLAIMER_EXCEEDED_MAX_LENGTH', part_of_product_launch: 'PART_OF_PRODUCT_LAUNCH', product_expired: 'PRODUCT_EXPIRED', product_item_hidden_from_all_shops: 'PRODUCT_ITEM_HIDDEN_FROM_ALL_SHOPS', diff --git a/src/objects/shop.js b/src/objects/shop.js index 54bca124..96c1358a 100644 --- a/src/objects/shop.js +++ b/src/objects/shop.js @@ -18,6 +18,7 @@ import {AbstractCrudObject} from './../abstract-crud-object'; export default class Shop extends AbstractCrudObject { static get Fields (): Object { return Object.freeze({ + commerce_merchant_settings: 'commerce_merchant_settings', fb_sales_channel: 'fb_sales_channel', id: 'id', ig_sales_channel: 'ig_sales_channel', diff --git a/src/objects/targeting-automation.js b/src/objects/targeting-automation.js new file mode 100644 index 00000000..3e3dec9c --- /dev/null +++ b/src/objects/targeting-automation.js @@ -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'; + +/** + * TargetingAutomation + * @extends AbstractCrudObject + * @see {@link https://developers.facebook.com/docs/marketing-api/} + */ +export default class TargetingAutomation extends AbstractCrudObject { + static get Fields (): Object { + return Object.freeze({ + advantage_audience: 'advantage_audience', + shared_audiences: 'shared_audiences', + value_expression: 'value_expression', + }); + } + +} diff --git a/src/objects/targeting.js b/src/objects/targeting.js index b333020c..b5accc8d 100644 --- a/src/objects/targeting.js +++ b/src/objects/targeting.js @@ -21,6 +21,7 @@ export default class Targeting extends AbstractCrudObject { adgroup_id: 'adgroup_id', age_max: 'age_max', age_min: 'age_min', + age_range: 'age_range', alternate_auto_targeting_option: 'alternate_auto_targeting_option', app_install_state: 'app_install_state', audience_network_positions: 'audience_network_positions', @@ -98,6 +99,7 @@ export default class Targeting extends AbstractCrudObject { regions: 'regions', relationship_statuses: 'relationship_statuses', site_category: 'site_category', + targeting_automation: 'targeting_automation', targeting_optimization: 'targeting_optimization', targeting_relaxation_types: 'targeting_relaxation_types', user_adclusters: 'user_adclusters', diff --git a/src/objects/whats-app-business-account.js b/src/objects/whats-app-business-account.js index fb08dd2b..df7ee2a1 100644 --- a/src/objects/whats-app-business-account.js +++ b/src/objects/whats-app-business-account.js @@ -31,6 +31,7 @@ export default class WhatsAppBusinessAccount extends AbstractCrudObject { health_status: 'health_status', id: 'id', is_enabled_for_insights: 'is_enabled_for_insights', + linked_commerce_account: 'linked_commerce_account', message_template_namespace: 'message_template_namespace', name: 'name', on_behalf_of_business_info: 'on_behalf_of_business_info', diff --git a/src/objects/whats-app-business-partner-client-verification-submission.js b/src/objects/whats-app-business-partner-client-verification-submission.js new file mode 100644 index 00000000..2b5fd5ac --- /dev/null +++ b/src/objects/whats-app-business-partner-client-verification-submission.js @@ -0,0 +1,31 @@ + /* + * 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'; + +/** + * WhatsAppBusinessPartnerClientVerificationSubmission + * @extends AbstractCrudObject + * @see {@link https://developers.facebook.com/docs/marketing-api/} + */ +export default class WhatsAppBusinessPartnerClientVerificationSubmission extends AbstractCrudObject { + static get Fields (): Object { + return Object.freeze({ + client_business_id: 'client_business_id', + id: 'id', + rejection_reasons: 'rejection_reasons', + submitted_info: 'submitted_info', + submitted_time: 'submitted_time', + update_time: 'update_time', + verification_status: 'verification_status', + }); + } + +}