Skip to content

@W-22453547 supporting interactive export of implex data units#521

Open
charithaT07 wants to merge 4 commits into
mainfrom
W-22453547-support-data-units
Open

@W-22453547 supporting interactive export of implex data units#521
charithaT07 wants to merge 4 commits into
mainfrom
W-22453547-support-data-units

Conversation

@charithaT07

@charithaT07 charithaT07 commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Brief description of what this PR does.

What this PR does

Adds an interactive Export view to the B2C VS Code extension for building site impex (site archive) exports without touching the CLI. You check the data units you want in a tree of checkboxes, click Export, and the extension runs the export job, downloads the archive over WebDAV, and extracts it locally.

What's included

VS Code extension — new Export view (b2cExportExplorer under the B2C-DX container):

  • Live discovery of sites, catalogs, and inventory lists from the configured instance (the categories OCAPI can enumerate).
  • Checkbox selection across all categories. Checking a site selects all of its data; you can also expand a site and pick individual flags (content, site_preferences, coupons, …). Unchecking one flag on an all-selected site exports "everything except that flag."
  • Global Data flags (meta_data, custom_types, locales, …) rendered from a fixed schema — no API call needed.
  • Add by ID for libraries, price books, and customer lists, which have no OCAPI list-all endpoint and so can't be auto-discovered.
  • Export runs siteArchiveExportToPath with a progress notification, then offers Reveal in Explorer/Finder. Graceful guards for "nothing selected" and per-category permission failures (a denied category warns and shows empty; the rest of the tree still works).
  • Toolbar actions: Export, Add by ID, Clear Selection, Refresh. Feature-flagged via b2c-dx.features.exportExplorer.

SDK — discoverExportableUnits(instance) (@salesforce/b2c-tooling-sdk/operations/jobs):

  • Lists exportable sites, catalogs, and inventory lists, paginating each collection and isolating per-category errors (a permission failure on one category returns a warning instead of failing the whole call).

Testing

  • SDK: 5 new unit tests for discoverExportableUnits (pagination, per-category permission failure, id-less docs).
  • Extension: 10 unit tests for the selection model → data_units translation (cascade, flag exception, partial selection, clear).
  • Typecheck, lint, format, and the esbuild bundle all pass.
  • Manually verified end-to-end against a live sandbox: discovery populates sites/catalogs/inventory lists after a RefArch import, the site→flags cascade works, and a real export downloads and extracts the archive.

Files

  • packages/b2c-tooling-sdk/src/operations/jobs/discover.ts (+ barrel export, tests)
  • packages/b2c-vs-extension/src/export-tree/export-selection.ts, export-tree-provider.ts, export-commands.ts, index.ts
  • packages/b2c-vs-extension/src/extension.ts, package.json — view/commands/menus/activation/feature flag
  • .changeset/interactive-impex-export-tree.md

Dependencies

  • No net-new third-party dependencies were added
  • If net-new third-party dependencies were added, rationale/discussion is included and 3pl-approved is set by a maintainer

  • Tests pass (pnpm test)
  • Code is formatted (pnpm run format)

@charithaT07 charithaT07 marked this pull request as ready for review June 25, 2026 12:35
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