Skip to content

feat(e-commerce): parse CSV, Google product feed XML and Facebook catalog CSV into the catalog model #1264

Closed

Description

@gkhngyk

Summary

Many brands already keep a product feed for Google or Facebook, or can export a CSV. Parsing those formats into one catalog shape lets a brand bring its catalog in without a store connection. The framework's reference connector (#1263) and the Merchant Center connector use these parsers.

This is a pure library with fixtures and tests. No network calls and no database.

Scope

  • Module: server/src/lib/feeds/ (new), with:

    • parseCsvFeed(text, mapping?): a CSV with a header row. Common header names map by default (id, title, description, link, image_link, price, gtin, brand), and an explicit column mapping is optional.
    • parseGoogleFeedXml(text): Google product feed XML, both RSS 2.0 with the g: namespace and Atom.
    • parseFacebookCatalogCsv(text): the Facebook / Meta catalog CSV columns.
  • Output: one item per product in the catalog model's shape:

    • id, item_group_id, title, description, link, image link and additional images;
    • brand, GTIN, MPN, price and sale price (amount plus ISO currency, from values like 15.00 USD), availability, condition;
    • color, size, material, product type.

    Keep the field names in sync with feat(integrations): a connector framework for stores and marketplaces, with a catalog model #1263.

  • Errors:

    • A row missing a required field (id, title, link, price, availability) is skipped with a clear error: the row or item number, the field, and what was found.
    • A file that isn't the expected format fails with one error, not thousands.
  • Size: a 50 MB feed parses without holding more than one copy in memory. XML can use cheerio in XML mode, which the server already depends on (package.json). A small RFC 4180 CSV parser is enough: quoted fields, embedded commas and newlines. If you add a dependency, say why in the PR.

Acceptance criteria

  • Fixtures for each format pass in npm test, including:
    • a variant group (one item_group_id, three colors);
    • prices with and without a currency;
    • a quoted CSV field with a comma and a newline;
    • a row missing price, which is skipped with its row number in the error.
  • A Google feed and a Facebook CSV describing the same products parse into the same items.
  • No network or database access in the module.

Activity

  1. added
    enhancement
    help wanted
    integrations
    e-commerce
    agent-ready
    on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readye-commerceenhancementhelp wantedintegrations

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions