Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b52cbca
@W-22210602 CIP analytics vs extension dashboard
charithaT07 Apr 30, 2026
6cdb799
CIP analytics VS extension UX changes - claude assisted
charithaT07 Apr 30, 2026
23fa3be
@W-22210602: Adding Analytics report support in VS Code extension (#402)
amit-kumar8-sf May 6, 2026
4cb38e2
Merge remote-tracking branch 'upstream/main' into W-22210602-CIP-Anal…
charithaT07 May 6, 2026
dcddf48
adding some changes in query builder
charithaT07 May 7, 2026
8bd1550
added some changes in cip analytics vs extension
charithaT07 May 7, 2026
a019765
initial changes for supporting multi realm in CIP
charithaT07 May 11, 2026
de6b1ac
adding save query and multi realm support
charithaT07 May 12, 2026
5ede320
adding save query and multi realm support
charithaT07 May 12, 2026
eb984dd
fixing lint
charithaT07 May 12, 2026
3fc2331
Merge remote-tracking branch 'upstream/main' into W-22210602-CIP-Anal…
charithaT07 May 12, 2026
197f5f8
refactored to make the ux resuable
charithaT07 May 13, 2026
10f30dd
Merge remote-tracking branch 'upstream/main' into W-22210602-CIP-Anal…
charithaT07 May 13, 2026
9534f21
refactored to make the ux resuable
charithaT07 May 13, 2026
612a277
Merge remote-tracking branch 'upstream/main' into W-22210602-CIP-Anal…
charithaT07 May 13, 2026
9f5137a
Merge remote-tracking branch 'upstream/main' into W-22210602-CIP-Anal…
charithaT07 May 14, 2026
43bf330
Merge branch 'main' into W-22210602-CIP-Analytics-VS-extension
amit-kumar8-sf May 20, 2026
7abf605
Merge branch 'main' into W-22210602-CIP-Analytics-VS-extension
charithaT07 May 21, 2026
ec5e0c4
docs: add page-specific SEO descriptions to SCAPI schemas and CI/CD p…
clavery May 21, 2026
6a4e1de
fix: bump qs and picomatch to resolve CVE-2026-2391 and CVE-2026-3367…
kevinxh May 21, 2026
d9c2f6e
addressing the review comments
charithaT07 May 25, 2026
1910312
addressing the review comments
charithaT07 May 25, 2026
81cba44
Merge branch 'main' into W-22210602-CIP-Analytics-VS-extension
charithaT07 May 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/cip-analytics-vs-extension.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'b2c-vs-extension': minor
---

Add B2C-DX Analytics (CIP/CCAC) feature to the VS Code extension. Surfaces three webview panels:

- **Query Builder** — visual SELECT/FROM/WHERE/ORDER BY/LIMIT composer with raw-SQL toggle and a workspace-scoped Saved Queries library tagged per tenant.
- **Tables Browser** — schema explorer for the active CIP warehouse tenant.
- **Curated Reports** — parameter forms for every `cip report …` command with date pickers, validation, sortable result grid, and CSV/JSON export.

Adds multi-realm management (group, add, edit, switch, remove) so a single workspace can target multiple tenants. CIP commands now route through `registerSafeCommand` so SafetyGuard policies are enforced and a `cipAnalytics` feature category is recorded by usage telemetry. The shared webview stylesheet is copied into `dist/cip-analytics/` at build time so the packaged extension no longer reaches into `src/` for runtime assets.
36 changes: 36 additions & 0 deletions docs/guide/analytics-reports-cip-ccac.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,42 @@ See the SDK API reference:
- [createCipClient helper](/api/clients/functions/createCipClient)
- [CIP Operations API](/api/operations/cip/)

## VS Code IDE Integration

The B2C Commerce Developer Tools VS Code extension exposes the same CIP analytics workflows as a graphical experience. Open the **B2C-DX Analytics** view in the activity bar to access them.

::: tip
You don't need to install or configure the CLI separately — the extension uses the same SDK under the hood and reads from your workspace `dw.json` (or environment variables).
:::

### Available panels

- **Query Builder** — visual SELECT / FROM / WHERE / ORDER BY / LIMIT composer with a "Saved Queries" library so you can bookmark frequently-used queries per tenant. Switch to **SQL** mode for raw query editing.
- **Tables Browser** — schema explorer that lists every CIP warehouse table for the active tenant. Click a table to inspect its columns and types.
- **Curated Reports** — opens any `cip report` command (sales analytics, top-selling products, etc.) in a parameter form with date pickers, validation, CSV/JSON export, and a sortable result grid.

### Realm management

The sidebar tree groups tenants under named realms. Each realm can hold multiple connections (e.g., production + sandbox). Use the toolbar actions to:

- **Add Realm** — create a new realm group (e.g. `abcd`).
- **Configure / Edit** — set tenant ID, environment (production / staging / custom host), and run a connection test.
- **Switch Connection** — change which realm/tenant the open panels query against. All open Query Builder, Tables Browser, and Report panels follow the active connection.

### Saving queries

Inside the Query Builder, the **Save** button persists the current SQL into a workspace-scoped library, tagged with the active tenant. Saved queries appear in the **Saved Queries** dropdown — those authored against the current tenant are listed first; queries from other tenants appear dimmed below a divider so you can still recall them after switching connections.

The library is stored in VS Code workspace state (`b2c-dx.cipAnalytics.savedQueries`). It is not committed to source control.

### Telemetry

Opening any CIP Analytics panel records a single per-session usage event under the `cipAnalytics` feature category. No SQL text or query results are collected. To opt out, set `b2c-dx.telemetry.enabled` to `false` in VS Code settings (or disable VS Code's global telemetry). See the [VS Code extension configuration](/vscode-extension/configuration#verbosity-polling-telemetry) for details.

### Safety mode

CIP commands flow through the same SafetyGuard as the rest of the extension. If your workspace defines a [safety policy](/guide/safety) that blocks or confirms a CIP command, the policy is enforced before the panel opens.

## Next Steps

- [CIP Commands](/cli/cip) for full command reference and flags
Expand Down
3 changes: 2 additions & 1 deletion packages/b2c-vs-extension/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# B2C DX - VS Code Extension

VS Code extension for B2C Commerce developer experience: sandbox realm explorer, cartridge code sync, WebDAV browser, content libraries, SCAPI API browser, B2C script debugger, scaffold/CAP install, log tailing, and a Page Designer Assistant.
VS Code extension for B2C Commerce developer experience: sandbox realm explorer, cartridge code sync, WebDAV browser, content libraries, SCAPI API browser, B2C script debugger, scaffold/CAP install, log tailing, CIP analytics (Query Builder + curated reports), and a Page Designer Assistant.

**User-facing documentation:** [B2C DX VS Code Extension](https://salesforcecommercecloud.github.io/b2c-developer-tooling/vscode-extension/) — overview, installation, configuration, and feature tour.

Expand All @@ -17,6 +17,7 @@ This README is the source of truth for repo-level developer info (build/watch, l
- Scaffold (`New from Scaffold...`) and CAP install.
- Log tailing into a dedicated output channel.
- Page Designer Assistant webview (Storefront Next page generation).
- B2C-DX Analytics — CIP/CCAC Query Builder, Tables Browser, curated reports, multi-realm support, saved-query library.

See the [docs site](https://salesforcecommercecloud.github.io/b2c-developer-tooling/vscode-extension/features) for the full tour.

Expand Down
4 changes: 2 additions & 2 deletions packages/b2c-vs-extension/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ export default [
...tseslint.configs.recommended,
prettierPlugin,
{
files: ['**/*.ts'],
files: ['**/*.ts', '**/*.tsx'],
plugins: {
header: headerPlugin,
},
languageOptions: {
parserOptions: {ecmaVersion: 2022, sourceType: 'module'},
parserOptions: {ecmaVersion: 2022, sourceType: 'module', ecmaFeatures: {jsx: true}},
},
rules: {
'header/header': ['error', 'block', copyrightHeader],
Expand Down
177 changes: 176 additions & 1 deletion packages/b2c-vs-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
],
"type": "module",
"dependencies": {
"@salesforce/b2c-tooling-sdk": "workspace:*"
"@salesforce/b2c-tooling-sdk": "workspace:*",
"react": "18.3.1",
"react-dom": "18.3.1"
},
"engines": {
"vscode": "^1.105.1"
Expand Down Expand Up @@ -102,6 +104,11 @@
"type": "boolean",
"default": true,
"description": "Send anonymous usage telemetry (extension lifecycle and broad feature-category events). Honors VS Code's telemetry.telemetryLevel — disabling that disables this regardless of this setting."
},
"b2c-dx.features.cipAnalytics": {
"type": "boolean",
"default": true,
"description": "Enable the B2C-DX Analytics (CIP) sidebar for browsing tables and running curated reports."
}
}
},
Expand All @@ -127,6 +134,11 @@
"id": "b2c-dx-sandboxes",
"title": "B2C-DX Sandboxes",
"icon": "$(server-environment)"
},
{
"id": "b2c-dx-analytics",
"title": "B2C-DX Analytics",
"icon": "$(graph)"
}
]
},
Expand All @@ -151,6 +163,14 @@
"contextualTitle": "B2C-DX"
}
],
"b2c-dx-analytics": [
{
"id": "b2cCipAnalytics",
"name": "CIP Analytics",
"icon": "$(graph)",
"contextualTitle": "B2C-DX Analytics"
}
],
"b2c-dx-scapi": [
{
"id": "b2cApiBrowser",
Expand Down Expand Up @@ -187,6 +207,10 @@
{
"view": "b2cCartridgeExplorer",
"contents": "No cartridges found.\n\nCartridges are identified by .project files in the workspace.\n\n[Refresh](command:b2c-dx.codeSync.refreshCartridges)"
},
{
"view": "b2cCipAnalytics",
"contents": "Explore Commerce Intelligence Platform (CIP) data — build SQL queries visually, browse tables, and run curated reports.\n\n[Open Query Builder](command:b2c-dx.cipAnalytics.queryBuilder)\n[Browse Tables](command:b2c-dx.cipAnalytics.browseTables)\n\nRequires OAuth credentials (clientId, clientSecret) in dw.json.\n\n[Refresh](command:b2c-dx.cipAnalytics.refresh)"
}
],
"debuggers": [
Expand Down Expand Up @@ -253,6 +277,71 @@
"title": "Open API Documentation",
"category": "B2C DX - API Browser"
},
{
"command": "b2c-dx.cipAnalytics.refresh",
"title": "Refresh",
"icon": "$(refresh)",
"category": "B2C-DX Analytics"
},
{
"command": "b2c-dx.cipAnalytics.resetFromDwJson",
"title": "Reset from dw.json…",
"icon": "$(discard)",
"category": "B2C-DX Analytics"
},
{
"command": "b2c-dx.cipAnalytics.openReport",
"title": "Open Report",
"category": "B2C-DX Analytics"
},
{
"command": "b2c-dx.cipAnalytics.browseTables",
"title": "Browse Tables",
"icon": "$(table)",
"category": "B2C-DX Analytics"
},
{
"command": "b2c-dx.cipAnalytics.queryBuilder",
"title": "Open Query Builder",
"icon": "$(zap)",
"category": "B2C-DX Analytics"
},
{
"command": "b2c-dx.cipAnalytics.configureConnection",
"title": "Configure Connection…",
"icon": "$(gear)",
"category": "B2C-DX Analytics"
},
{
"command": "b2c-dx.cipAnalytics.testConnection",
"title": "Test Connection",
"icon": "$(debug-disconnect)",
"category": "B2C-DX Analytics"
},
{
"command": "b2c-dx.cipAnalytics.switchRealm",
"title": "Switch Realm…",
"icon": "$(server)",
"category": "B2C-DX Analytics"
},
{
"command": "b2c-dx.cipAnalytics.switchConnection",
"title": "Switch Connection…",
"icon": "$(plug)",
"category": "B2C-DX Analytics"
},
{
"command": "b2c-dx.cipAnalytics.addRealm",
"title": "Add Realm…",
"icon": "$(add)",
"category": "B2C-DX Analytics"
},
{
"command": "b2c-dx.cipAnalytics.removeRealm",
"title": "Remove Realm…",
"icon": "$(trash)",
"category": "B2C-DX Analytics"
},
{
"command": "b2c-dx.sandbox.refresh",
"title": "Refresh",
Expand Down Expand Up @@ -639,6 +728,26 @@
"when": "view == b2cCartridgeExplorer",
"group": "navigation"
},
{
"command": "b2c-dx.cipAnalytics.removeRealm",
"when": "view == b2cCipAnalytics",
"group": "navigation@0"
},
{
"command": "b2c-dx.cipAnalytics.addRealm",
"when": "view == b2cCipAnalytics",
"group": "navigation@0"
},
{
"command": "b2c-dx.cipAnalytics.refresh",
"when": "view == b2cCipAnalytics",
"group": "navigation@4"
},
{
"command": "b2c-dx.cipAnalytics.resetFromDwJson",
"when": "view == b2cCipAnalytics",
"group": "navigation@9"
},
{
"command": "b2c-dx.codeSync.deploy",
"when": "view == b2cCartridgeExplorer",
Expand All @@ -661,6 +770,26 @@
}
],
"view/item/context": [
{
"command": "b2c-dx.cipAnalytics.switchConnection",
"when": "view == b2cCipAnalytics && viewItem == cipRealm",
"group": "inline@0"
},
{
"command": "b2c-dx.cipAnalytics.removeRealm",
"when": "view == b2cCipAnalytics && viewItem == cipRealm",
"group": "2_realm@0"
},
{
"command": "b2c-dx.cipAnalytics.testConnection",
"when": "view == b2cCipAnalytics && viewItem == cipRealmInfo",
"group": "inline@0"
},
{
"command": "b2c-dx.cipAnalytics.configureConnection",
"when": "view == b2cCipAnalytics && viewItem == cipRealmInfo",
"group": "inline@1"
},
{
"command": "b2c-dx.webdav.addCatalog",
"when": "view == b2cWebdavExplorer && viewItem == virtual-root-catalogs",
Expand Down Expand Up @@ -869,6 +998,50 @@
}
],
"commandPalette": [
{
"command": "b2c-dx.cipAnalytics.refresh",
"when": "config.b2c-dx.features.cipAnalytics"
},
{
"command": "b2c-dx.cipAnalytics.resetFromDwJson",
"when": "config.b2c-dx.features.cipAnalytics"
},
{
"command": "b2c-dx.cipAnalytics.openReport",
"when": "config.b2c-dx.features.cipAnalytics"
},
{
"command": "b2c-dx.cipAnalytics.browseTables",
"when": "config.b2c-dx.features.cipAnalytics"
},
{
"command": "b2c-dx.cipAnalytics.queryBuilder",
"when": "config.b2c-dx.features.cipAnalytics"
},
{
"command": "b2c-dx.cipAnalytics.configureConnection",
"when": "config.b2c-dx.features.cipAnalytics"
},
{
"command": "b2c-dx.cipAnalytics.testConnection",
"when": "config.b2c-dx.features.cipAnalytics"
},
{
"command": "b2c-dx.cipAnalytics.switchRealm",
"when": "config.b2c-dx.features.cipAnalytics"
},
{
"command": "b2c-dx.cipAnalytics.switchConnection",
"when": "config.b2c-dx.features.cipAnalytics"
},
{
"command": "b2c-dx.cipAnalytics.addRealm",
"when": "config.b2c-dx.features.cipAnalytics"
},
{
"command": "b2c-dx.cipAnalytics.removeRealm",
"when": "config.b2c-dx.features.cipAnalytics"
},
{
"command": "b2c-dx.apiBrowser.openSwagger",
"when": "false"
Expand Down Expand Up @@ -1031,6 +1204,8 @@
"@eslint/compat": "catalog:",
"@types/mocha": "catalog:",
"@types/node": "catalog:",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@types/vscode": "^1.105.1",
"@vscode/test-cli": "^0.0.12",
"@vscode/test-electron": "^2.5.2",
Expand Down
Loading
Loading