Skip to content

feat(integrations): Meta Marketing API — structured use-case integrations#257

Open
lev-goryachev wants to merge 2 commits intomainfrom
integration/meta
Open

feat(integrations): Meta Marketing API — structured use-case integrations#257
lev-goryachev wants to merge 2 commits intomainfrom
integration/meta

Conversation

@lev-goryachev
Copy link
Contributor

Summary

  • Replaces monolithic fi_meta.py + fi_instagram.py + facebook/ subpackage with a flat set of use-case-specific integration files
  • Each file maps to one Meta API use case as shown in the Meta developer console
  • Shared HTTP client, exceptions, models and utils extracted into _fi_meta_helpers.py (underscore prefix prevents it from being auto-parsed as a tool)

Files

New integration files (one per API use case):

  • fi_meta_marketing_manage.py — Create & manage ads (campaigns, ad sets, ads, creatives, audiences, pixels, targeting, rules)
  • fi_meta_marketing_metrics.py — Measure ad performance (insights, async reports)
  • fi_meta_pages.py — Manage Facebook Pages and ad accounts
  • fi_meta_instagram.py, fi_meta_messenger.py, fi_meta_whatsapp.py, fi_meta_threads.py, fi_meta_catalog.py, fi_meta_app_ads.py, fi_meta_ad_leads.py — stubs for uncovered use cases

Helpers:

  • _fi_meta_helpers.pyFacebookAdsClient, all exceptions, all Pydantic models, validation utils

Deleted:

  • facebook/fi_facebook.py, facebook/client.py, facebook/exceptions.py, facebook/models.py, facebook/utils.py, facebook/campaigns.py, facebook/adsets.py, facebook/ads.py, facebook/audiences.py, facebook/pixels.py, facebook/targeting.py, facebook/rules.py, facebook/insights.py, facebook/accounts.py
  • fi_meta.py, fi_instagram.py

Test plan

  • Verify _fi_meta_helpers.py is NOT registered as a tool (underscore prefix)
  • Verify fi_meta_marketing_manage.py loads and responds to op=help
  • Verify fi_meta_marketing_metrics.py loads and responds to op=help
  • Verify fi_meta_pages.py loads and responds to op=help
  • Verify stub files return INTEGRATION_UNAVAILABLE appropriately

… use case)

Replace fi_meta.py, fi_instagram.py, and facebook/fi_facebook.py with flat
per-use-case files matching Meta developer console use cases:

  fi_meta_marketing_manage.py   - Create & manage ads (campaigns, adsets, ads,
                                  creatives, audiences, pixels, targeting, rules)
  fi_meta_marketing_metrics.py  - Measure ad performance (all insights endpoints)
  fi_meta_pages.py              - Manage Pages and ad accounts
  fi_meta_ad_leads.py           - Capture & manage ad leads (stub)
  fi_meta_app_ads.py            - App ads (stub)
  fi_meta_threads.py            - Threads API (stub)
  fi_meta_whatsapp.py           - WhatsApp Business (stub)
  fi_meta_catalog.py            - Catalog API (stub)
  fi_meta_messenger.py          - Messenger (stub)
  fi_meta_instagram.py          - Instagram messaging & content (stub)

facebook/ subpackage is kept as internal implementation library used by the
three real integration files above.
- Merge client.py + exceptions.py + models.py + utils.py into _fi_meta_helpers.py
- Inline campaigns/adsets/ads/audiences/pixels/targeting/rules into fi_meta_marketing_manage.py
- Inline insights.py into fi_meta_marketing_metrics.py
- Inline accounts.py into fi_meta_pages.py
- Delete facebook/ subpackage entirely

All fi_meta_*.py files now self-contained with single helper dep.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant