Skip to content

Commit c44810f

Browse files
authored
Merge branch 'main' into W-21112167-Replications-API
2 parents 30873b5 + 211cea5 commit c44810f

39 files changed

Lines changed: 2105 additions & 199 deletions

docs/cli/content.md

Lines changed: 98 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
---
2-
description: Commands for exporting and listing Page Designer content from B2C Commerce content libraries.
2+
description: Commands for exporting, listing, and validating Page Designer content from B2C Commerce content libraries.
33
---
44

55
# Content Commands
66

7-
Commands for working with Page Designer content libraries on B2C Commerce instances.
7+
Commands for working with Page Designer content libraries and metadefinitions.
88

99
## Authentication
1010

11-
Content commands require OAuth authentication:
11+
The `content export` and `content list` commands require OAuth authentication:
1212

1313
| Operation | Auth Required |
1414
|-----------|--------------|
1515
| `content export` | OAuth (OCAPI for export job + WebDAV for assets) |
1616
| `content list` | OAuth (OCAPI for export job) |
17+
| `content validate` | None (local file validation) |
1718

1819
```bash
1920
export SFCC_CLIENT_ID=your-client-id
2021
export SFCC_CLIENT_SECRET=your-client-secret
2122
```
2223

23-
Both commands also support a `--library-file` flag for offline use with a local XML file, which skips authentication entirely.
24+
The `content export` and `content list` commands also support a `--library-file` flag for offline use with a local XML file, which skips authentication entirely.
2425

2526
For complete setup instructions, see the [Authentication Guide](/guide/authentication).
2627

@@ -201,3 +202,96 @@ footer-content (CONTENT ASSET)
201202
Pages show `id (typeId: type)`, components show `typeId (id)`, content assets show `id (CONTENT ASSET)`, and static assets show `path (STATIC ASSET)`. The tree uses color when output to a terminal: page names are bold, component type IDs are cyan, asset paths are green, and tree connectors are dim.
202203

203204
With `--json`, returns `{ data: [...] }` with each item containing `id`, `type`, `typeId`, and `children` count.
205+
206+
---
207+
208+
## b2c content validate
209+
210+
Validate Page Designer metadefinition JSON files against bundled JSON schemas. This is a local-only command — no instance connection or authentication is required.
211+
212+
The command auto-detects the schema type using file path conventions (`experience/pages/` → pagetype, `experience/components/` → componenttype) and falls back to inspecting the JSON properties. You can also specify the type explicitly with `--type`.
213+
214+
### Usage
215+
216+
```bash
217+
b2c content validate <files...>
218+
```
219+
220+
### Arguments
221+
222+
| Argument | Description | Required |
223+
|----------|-------------|----------|
224+
| `files` | One or more file paths, directories, or glob patterns | Yes |
225+
226+
When a directory is passed, all `*.json` files within it are validated recursively.
227+
228+
### Flags
229+
230+
In addition to [global flags](./index#global-flags):
231+
232+
| Flag | Description | Default |
233+
|------|-------------|---------|
234+
| `--type`, `-t` | Schema type to validate against (skips auto-detection) | Auto-detected |
235+
236+
Available schema types: `pagetype`, `componenttype`, `aspecttype`, `cmsrecord`, `customeditortype`, `contentassetpageconfig`, `contentassetcomponentconfig`, `contentassetstructuredcontentdata`, `image`.
237+
238+
### Examples
239+
240+
```bash
241+
# Validate a single page type definition
242+
b2c content validate cartridge/experience/pages/storePage.json
243+
244+
# Validate all metadefinitions in a directory recursively
245+
b2c content validate cartridge/experience/
246+
247+
# Validate with a glob pattern
248+
b2c content validate 'cartridge/experience/**/*.json'
249+
250+
# Explicitly specify the schema type
251+
b2c content validate --type componenttype mycomponent.json
252+
253+
# Validate multiple files
254+
b2c content validate pages/home.json pages/about.json components/hero.json
255+
256+
# JSON output for CI/scripting
257+
b2c content validate cartridge/experience/ --json
258+
```
259+
260+
### Output
261+
262+
The command prints a color-coded result for each file:
263+
264+
```
265+
PASS: experience/pages/storePage.json (pagetype)
266+
PASS: experience/components/hero.json (componenttype)
267+
FAIL: experience/components/broken.json (componenttype)
268+
ERROR at .attribute_definition_groups[0]: is required
269+
270+
2/3 file(s) valid, 1 error(s)
271+
```
272+
273+
The command exits with a non-zero status when any file fails validation.
274+
275+
With `--json`, returns a structured result:
276+
277+
```json
278+
{
279+
"results": [
280+
{
281+
"valid": true,
282+
"schemaType": "pagetype",
283+
"errors": [],
284+
"filePath": "/path/to/storePage.json"
285+
}
286+
],
287+
"totalFiles": 1,
288+
"validFiles": 1,
289+
"totalErrors": 0
290+
}
291+
```
292+
293+
### Notes
294+
295+
- Auto-detection uses file path conventions first: files under `experience/pages/` are validated as `pagetype`, files under `experience/components/` as `componenttype`. For other schema types, use `--type`.
296+
- Schemas are bundled with the SDK and follow the [Page Designer metadefinition specification](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-page-designer.html).
297+
- Use `b2c content validate` in CI pipelines to catch metadefinition errors before deployment.

docs/guide/third-party-plugins.md

Lines changed: 102 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: Community plugins for the B2C CLI including IntelliJ SFCC config integration and macOS Keychain credential storage.
2+
description: Community plugins for the B2C CLI including IntelliJ SFCC config integration, credential storage, docs search, catalog reduction, and pipeline visualization.
33
---
44

55
# 3rd Party Plugins
@@ -185,6 +185,107 @@ b2c code deploy
185185
b2c code deploy
186186
```
187187

188+
### Docs Viewer Plugin
189+
190+
**Repository:** [taurgis/b2c-plugin-docs-viewer](https://github.com/taurgis/b2c-plugin-docs-viewer)
191+
192+
Searches Salesforce Help and fetches Help or Developer docs content directly from the CLI. This is useful when you want to look up platform documentation without leaving your terminal.
193+
194+
#### Installation
195+
196+
```bash
197+
b2c plugins install b2c-plugin-help-docs-viewer
198+
```
199+
200+
If Playwright Chromium is not installed yet:
201+
202+
```bash
203+
npx playwright install chromium
204+
```
205+
206+
#### Features
207+
208+
- Searches Salesforce Help with boxed, column-aligned results
209+
- Fetches Help or Developer docs pages by URL or by ID from the latest search
210+
- Fetches search results and article content in one command
211+
- Reuses cached results for up to 5 days, with `--no-cache` to bypass caching
212+
- Supports JSON output and optional raw extracted HTML
213+
214+
#### Usage
215+
216+
```bash
217+
# Search Salesforce Help
218+
b2c docs search-help-site "b2c commerce roles" --limit 5
219+
220+
# Fetch an article by URL or by search result ID
221+
b2c docs help-site-article "https://help.salesforce.com/s/articleView?id=cc.b2c_roles_and_permissions.htm&type=5"
222+
b2c docs help-site-article 2
223+
224+
# Search and fetch details in one step
225+
b2c docs fetch-results-help-site "pipelines" --limit 3
226+
```
227+
228+
### Catalog Reducer Plugin
229+
230+
**Repository:** [taurgis/b2c-plugin-catalog-reducer](https://github.com/taurgis/b2c-plugin-catalog-reducer)
231+
232+
Generates smaller, representative Salesforce B2C Commerce catalog datasets from large source XML files. This is useful for creating fixtures, benchmarks, and reduced datasets for local development.
233+
234+
#### Installation
235+
236+
```bash
237+
b2c plugins install b2c-plugin-catalog-reducer
238+
```
239+
240+
#### Features
241+
242+
- Reduces large catalog XML files into smaller fixture datasets
243+
- Supports preferred product IDs, master-product targets, attribute-driven selection, and filler products
244+
- Writes catalog, inventory, and pricebook outputs in one run
245+
- Supports source-derived storefront catalogs and generated or source-derived pricebooks
246+
- Validates generated XML against bundled catalog, inventory, and pricebook schemas
247+
248+
#### Usage
249+
250+
```bash
251+
# Reduce a catalog using a custom config file
252+
b2c catalog reduce -i ./catalog.xml -o ./catalog-reduced.xml -c ./catalog-reducer.json
253+
```
254+
255+
The reducer writes the reduced catalog plus derived inventory and pricebook XML outputs. Relative paths in `pricebookSourceFiles` and `storefrontSourceFiles` are resolved from the config file location.
256+
257+
### Pipeline Visualizer Plugin
258+
259+
**Repository:** [taurgis/b2c-plugin-pipeline-visualizer](https://github.com/taurgis/b2c-plugin-pipeline-visualizer)
260+
261+
Generates ASCII and SVG previews of SFCC pipeline XML files. This is useful for inspecting pipeline structure, branch flow, and layout without opening Business Manager.
262+
263+
#### Installation
264+
265+
```bash
266+
b2c plugins install b2c-plugin-pipeline-visualizer
267+
```
268+
269+
#### Features
270+
271+
- Exports ASCII previews from pipeline XML files
272+
- Generates SVG image output for rendered pipeline layouts
273+
- Supports branch filtering for focused views
274+
- Can include grids, node lists, edge lists, and bendpoint details
275+
- Uses the same layout and edge routing logic across ASCII and SVG output
276+
277+
#### Usage
278+
279+
```bash
280+
# Export an ASCII view
281+
b2c pipeline ascii path/to/pipeline.xml --out debug/layouts/pipeline.txt
282+
283+
# Export an SVG image
284+
b2c pipeline image path/to/pipeline.xml --out debug/layouts/pipeline.svg
285+
```
286+
287+
Output is written to the file specified by `--out`.
288+
188289
## Creating Your Own Plugin
189290

190291
Want to create a plugin? See the [Extending the CLI](./extending) guide for documentation on:

docs/typedoc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"../packages/b2c-tooling-sdk/src/instance/index.ts",
88
"../packages/b2c-tooling-sdk/src/logging/index.ts",
99
"../packages/b2c-tooling-sdk/src/operations/code/index.ts",
10+
"../packages/b2c-tooling-sdk/src/operations/content/index.ts",
1011
"../packages/b2c-tooling-sdk/src/operations/cip/index.ts",
1112
"../packages/b2c-tooling-sdk/src/operations/jobs/index.ts",
1213
"../packages/b2c-tooling-sdk/src/operations/logs/index.ts",

packages/b2c-cli/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# @salesforce/b2c-cli
22

3+
## 0.10.0
4+
5+
### Minor Changes
6+
7+
- [#278](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/pull/278) [`8c31081`](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/commit/8c31081b47e57e6a21e62425e6f19da036fc3e34) - Add `content validate` command to validate Page Designer metadefinition JSON files against bundled schemas. Supports auto-detection of schema types from file paths and content, or explicit `--type` flag. Includes glob pattern support for validating multiple files. (Thanks [@clavery](https://github.com/clavery)!)
8+
9+
### Patch Changes
10+
11+
- Updated dependencies [[`8c31081`](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/commit/8c31081b47e57e6a21e62425e6f19da036fc3e34), [`e4b5094`](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/commit/e4b5094d9c1c2a60e1214bc236ce7ed84c5d158b)]:
12+
- @salesforce/b2c-tooling-sdk@0.11.0
13+
314
## 0.9.0
415

516
### Minor Changes

packages/b2c-cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@salesforce/b2c-cli",
33
"description": "A Salesforce B2C Commerce CLI",
4-
"version": "0.9.0",
4+
"version": "0.10.0",
55
"author": "Charles Lavery",
66
"bin": {
77
"b2c": "./bin/run.js"
@@ -105,7 +105,7 @@
105105
"description": "Deploy and manage code versions on instances\n\nDocs: https://salesforcecommercecloud.github.io/b2c-developer-tooling/cli/code.html"
106106
},
107107
"content": {
108-
"description": "Export and manage Page Designer content libraries"
108+
"description": "Export, list, and validate Page Designer content"
109109
},
110110
"cip": {
111111
"description": "Run CIP analytics SQL and curated reports\n\nDocs: https://salesforcecommercecloud.github.io/b2c-developer-tooling/cli/cip.html"

0 commit comments

Comments
 (0)