Skip to content

feat: add CIP analytics topic, SDK client, and report tooling#155

Merged
clavery merged 12 commits intomainfrom
feature/cip
Feb 16, 2026
Merged

feat: add CIP analytics topic, SDK client, and report tooling#155
clavery merged 12 commits intomainfrom
feature/cip

Conversation

@clavery
Copy link
Collaborator

@clavery clavery commented Feb 15, 2026

This PR introduces end-to-end CIP/CCAC support across both the CLI and SDK, delivering a complete analytics feature set for curated report workflows, metadata discovery, and raw SQL access.

CLI Additions

New cip topic and command model

  • Added a new top-level CLI topic: b2c cip.
  • Added b2c cip query for raw SQL execution with:
    • positional SQL argument support (including piped/heredoc stdin)
    • --file input mode
    • <FROM>/<TO> token replacement from date flags
    • table/csv/json output options
  • Added curated report subcommands under b2c cip report <report-name>

Metadata discovery commands

  • Added b2c cip tables to list metadata catalog tables with schema/pattern/type filtering.
  • Added b2c cip describe <table> to inspect table column structure (name/type/nullability).
  • Tuned default table output for readability (cip tables: table/type; cip describe: column/type/nullability).

Curated report command system

  • Implemented shared report command base utilities and shared flag definitions for consistent report UX.
  • Added report-specific command files for all curated reports (sales, OCAPI, search, payments, referrers, etc.).
  • Added --describe and --sql report options, including SQL piping support into cip query.

Auth, host, and output behavior

  • Enforced client-credentials-only auth on CIP commands and rejected user-auth paths.
  • Added --staging shorthand and automatic host selection behavior by tenant pattern, with explicit --cip-host override support.
  • Normalized output behavior so CSV/JSON formats write to stdout and global --json continues to work as expected.

SDK Additions

CIP client foundation

  • Added a new protobuf-based Avatica client (CipClient) and factory (createCipClient) in @salesforce/b2c-tooling-sdk for executing CIP SQL queries.
  • Implemented connection/session handling, statement execution/fetch paging, row decoding, and middleware integration.
  • Added host constants and selection support for production/staging analytics endpoints.

SDK configuration and exports

  • Added CIP host support to config mapping/resolution and CLI config extraction in the SDK.
  • Updated SDK/client barrel exports so CIP APIs are available from both root and subpath imports.
  • Extended TypeDoc entrypoints and API documentation to include CIP operations/types in generated docs.

Curated report and metadata operations API

  • Added operations/cip module with curated report catalog + typed interfaces.
  • Added report helpers for discovery, validation, SQL generation, and execution:
    • listCipReports
    • getCipReportByName
    • buildCipReportSql
    • executeCipReport
  • Added metadata helpers for table and column discovery:
    • listCipTables
    • describeCipTable
  • Added and expanded SDK tests for client behavior, report semantics, and metadata operations.

Docs, Skills, and Release Artifacts

  • Added/updated CLI docs for CIP commands and command index integration.
  • Added a new guide page: Analytics Reports (CIP/CCAC) with authentication, non-prod guidance, host behavior, query/report quick start, metadata discovery examples, output examples, and SDK references.
  • Updated CIP skill content to match final command model and best-practice usage guidance.
  • Added a changeset covering CLI and SDK package changes.

Validation

  • pnpm --filter @salesforce/b2c-tooling-sdk run typecheck:agent
  • pnpm --filter @salesforce/b2c-tooling-sdk run lint:agent
  • pnpm --filter @salesforce/b2c-tooling-sdk run test:agent
  • pnpm --filter @salesforce/b2c-cli run typecheck:agent
  • pnpm --filter @salesforce/b2c-cli run lint:agent
  • pnpm --filter @salesforce/b2c-cli run test:agent
  • pnpm run docs:build

@github-actions github-actions bot added the needs-3pl-review PR introduces net-new third-party dependencies and needs discussion label Feb 15, 2026
@clavery
Copy link
Collaborator Author

clavery commented Feb 15, 2026

3PL note: protobufjs is BSD 3-clause and support by SF opensource. It's also maintained by google and extremely popular.

@clavery clavery added 3pl-approved Maintainer approved net-new third-party dependency additions and removed needs-3pl-review PR introduces net-new third-party dependencies and needs discussion labels Feb 15, 2026
@clavery clavery merged commit 55c81c3 into main Feb 16, 2026
4 checks passed
@clavery clavery deleted the feature/cip branch February 16, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3pl-approved Maintainer approved net-new third-party dependency additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant