diff --git a/.changeset/ga-release-cli.md b/.changeset/ga-release-cli.md new file mode 100644 index 00000000..44be9897 --- /dev/null +++ b/.changeset/ga-release-cli.md @@ -0,0 +1,5 @@ +--- +'@salesforce/b2c-cli': major +--- + +Release v1.0 — B2C CLI is now Generally Available. diff --git a/.changeset/ga-release-sdk.md b/.changeset/ga-release-sdk.md new file mode 100644 index 00000000..dc44bc47 --- /dev/null +++ b/.changeset/ga-release-sdk.md @@ -0,0 +1,5 @@ +--- +'@salesforce/b2c-tooling-sdk': major +--- + +Release v1.0 — B2C Tooling SDK is now Generally Available. Added `./operations/ods`, `./safety`, and `./i18n` subpath exports. Consolidated all error types in `@salesforce/b2c-tooling-sdk/errors`. diff --git a/.claude/skills/sdk-module-development/SKILL.md b/.claude/skills/sdk-module-development/SKILL.md index 3ee6b757..279fa0ee 100644 --- a/.claude/skills/sdk-module-development/SKILL.md +++ b/.claude/skills/sdk-module-development/SKILL.md @@ -334,7 +334,20 @@ export { Feature } from './newmodule/index.js'; export type { FeatureConfig } from './newmodule/index.js'; ``` -### 6. Build and test +### 6. Add to TypeDoc entry points + +Add the new module's barrel file to `docs/typedoc.json` so API documentation is generated: + +```json +{ + "entryPoints": [ + "...", + "../packages/b2c-tooling-sdk/src/newmodule/index.ts" + ] +} +``` + +### 7. Build and test ```bash pnpm --filter @salesforce/b2c-tooling-sdk run build @@ -393,7 +406,7 @@ import { WebDavClient } from '../../src/clients/webdav.js'; 3. Create `index.ts` barrel with module-level JSDoc 4. Add export to `package.json` with development condition 5. Optionally add to main `src/index.ts` exports -6. Write tests in `test/` mirroring the src structure -7. Run `pnpm run build` to verify compilation -8. Run `pnpm run test` to verify tests pass -9. Update TypeDoc entry points in `typedoc.json` if needed +6. Add entry point to `docs/typedoc.json` for API doc generation +7. Write tests in `test/` mirroring the src structure +8. Run `pnpm run build` to verify compilation +9. Run `pnpm run test` to verify tests pass diff --git a/AGENTS.md b/AGENTS.md index 6b1f5b7e..871de89f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -92,6 +92,7 @@ The header is enforced by eslint via `eslint-plugin-header`. The canonical defin ## Documentation - Update docs in `./docs/` folder and relevant skills in `./skills/b2c-cli/skills/` when updating or adding CLI commands. +- When adding new SDK modules, update `docs/typedoc.json` entry points to include the new module's barrel file so API docs are generated. See [documentation skill](./.claude/skills/documentation/SKILL.md) for details on updating user guides, CLI reference, and API docs. @@ -178,7 +179,7 @@ Changeset guidelines: - a pull request can have multiple changesets; separate files for separate changes - Only list directly-changed packages in changeset frontmatter — do not include dependent packages (they get auto-bumped) - Select the appropriate semver bump: `patch` (bug fixes) or `minor` (new features) -- This is a pre-1.0 preview release, so there are no `major` breaking change bumps yet +- Use `major` for breaking changes that require consumers to update their code - Good changesets explain: - WHAT the change is - WHY the change was made diff --git a/README.md b/README.md index a308b650..76455df6 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![CI](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/actions/workflows/ci.yml/badge.svg)](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/actions/workflows/ci.yml) > [!NOTE] -> This project is currently in **Developer Preview**. Not all features are implemented, and the API may change in future releases. Please provide feedback via GitHub issues and Unofficial Slack. +> This project is **Generally Available (GA)**. Please provide feedback via GitHub issues. Salesforce B2C Commerce Command Line Tools. diff --git a/docs/cli/ecdn.md b/docs/cli/ecdn.md index 6fe93271..c7fdf7f3 100644 --- a/docs/cli/ecdn.md +++ b/docs/cli/ecdn.md @@ -107,23 +107,6 @@ At least one purge method must be specified. --- -### b2c ecdn cache ocapi-toggle - -Toggle OCAPI caching page rule. - -```bash -b2c ecdn cache ocapi-toggle --zone my-zone --enabled -b2c ecdn cache ocapi-toggle --zone my-zone --no-enabled -``` - -#### Flags - -| Flag | Description | -|------|-------------| -| `--enabled` | Enable or disable OCAPI caching | - ---- - ## Certificate Management ### b2c ecdn certificates list @@ -154,16 +137,6 @@ b2c ecdn certificates add --zone my-zone --hostname www.example.com --certificat --- -### b2c ecdn certificates get - -Get certificate details. - -```bash -b2c ecdn certificates get --zone my-zone --certificate-id abc123 -``` - ---- - ### b2c ecdn certificates update Update a certificate. @@ -410,142 +383,6 @@ b2c ecdn waf migrate --zone my-zone --- -## Custom Firewall Rules - -### b2c ecdn firewall list - -List custom firewall rules. - -```bash -b2c ecdn firewall list --zone my-zone -``` - ---- - -### b2c ecdn firewall create - -Create a custom firewall rule. - -```bash -b2c ecdn firewall create --zone my-zone --description "Block bad bots" --action block --filter '(cf.client.bot)' -``` - -#### Flags - -| Flag | Description | Required | -|------|-------------|----------| -| `--description` | Rule description | Yes | -| `--action` | Rule action (`block`, `challenge`, `js_challenge`, `managed_challenge`, `allow`, `log`, `bypass`) | Yes | -| `--filter` | Firewall filter expression | Yes | -| `--paused` | Create rule in paused state | No | -| `--priority` | Rule priority | No | - ---- - -### b2c ecdn firewall get - -Get a firewall rule. - -```bash -b2c ecdn firewall get --zone my-zone --rule-id abc123 -``` - ---- - -### b2c ecdn firewall update - -Update a firewall rule. - -```bash -b2c ecdn firewall update --zone my-zone --rule-id abc123 --action challenge -``` - ---- - -### b2c ecdn firewall delete - -Delete a firewall rule. - -```bash -b2c ecdn firewall delete --zone my-zone --rule-id abc123 -``` - ---- - -### b2c ecdn firewall reorder - -Reorder firewall rules. - -```bash -b2c ecdn firewall reorder --zone my-zone --rule-ids id1,id2,id3 -``` - ---- - -## Rate Limiting - -### b2c ecdn rate-limit list - -List rate limiting rules. - -```bash -b2c ecdn rate-limit list --zone my-zone -``` - ---- - -### b2c ecdn rate-limit create - -Create a rate limiting rule. - -```bash -b2c ecdn rate-limit create --zone my-zone --description "API rate limit" --threshold 100 --period 60 --action block --match-url '/api/*' -``` - -#### Flags - -| Flag | Description | Required | -|------|-------------|----------| -| `--description` | Rule description | Yes | -| `--threshold` | Request threshold | Yes | -| `--period` | Period in seconds | Yes | -| `--action` | Action (`block`, `challenge`, `js_challenge`, `managed_challenge`, `log`, `simulate`) | Yes | -| `--match-url` | URL pattern to match | Yes | -| `--match-methods` | HTTP methods (comma-separated) | No | -| `--timeout` | Block timeout in seconds | No | - ---- - -### b2c ecdn rate-limit get - -Get a rate limiting rule. - -```bash -b2c ecdn rate-limit get --zone my-zone --rule-id abc123 -``` - ---- - -### b2c ecdn rate-limit update - -Update a rate limiting rule. - -```bash -b2c ecdn rate-limit update --zone my-zone --rule-id abc123 --threshold 200 -``` - ---- - -### b2c ecdn rate-limit delete - -Delete a rate limiting rule. - -```bash -b2c ecdn rate-limit delete --zone my-zone --rule-id abc123 -``` - ---- - ## Logpush ### b2c ecdn logpush ownership diff --git a/docs/cli/sandbox.md b/docs/cli/sandbox.md index adc84a51..68b81569 100644 --- a/docs/cli/sandbox.md +++ b/docs/cli/sandbox.md @@ -409,6 +409,9 @@ b2c sandbox delete | Flag | Description | Default | |------|-------------|---------| | `--force`, `-f` | Skip confirmation prompt | `false` | +| `--wait`, `-w` | Wait for the sandbox to be fully deleted before returning | `false` | +| `--poll-interval` | Polling interval in seconds when using `--wait` | `10` | +| `--timeout` | Maximum time to wait in seconds when using `--wait` (0 for no timeout) | `600` | ### Examples @@ -421,12 +424,16 @@ b2c sandbox delete zzzv-123 # Delete without confirmation b2c sandbox delete zzzv_123 --force + +# Delete and wait for completion +b2c sandbox delete zzzv_123 --force --wait ``` ### Notes - The command will prompt for confirmation unless `--force` is used - Deleted sandboxes cannot be recovered +- Use `--wait` to block until the sandbox is fully removed --- diff --git a/docs/cli/slas.md b/docs/cli/slas.md index 1b8fe386..31ad5946 100644 --- a/docs/cli/slas.md +++ b/docs/cli/slas.md @@ -387,3 +387,45 @@ b2c slas client delete my-client-id --tenant-id abcd_123 --json - Deletion is permanent and cannot be undone - Active sessions using this client will be invalidated + +--- + +## b2c slas client open + +Open the SLAS Admin UI for a client in your browser. + +### Usage + +```bash +b2c slas client open --tenant-id +``` + +### Arguments + +| Argument | Description | Required | +|----------|-------------|----------| +| `CLIENTID` | SLAS client ID to open in the admin UI | Yes | + +### Flags + +| Flag | Environment Variable | Description | Required | +|------|---------------------|-------------|----------| +| `--tenant-id` | `SFCC_TENANT_ID` | SLAS tenant ID (organization ID) | Yes | +| `--short-code` | `SFCC_SHORTCODE` | SCAPI short code | Yes* | + +\* `--short-code` can be set via `SFCC_SHORTCODE` environment variable or `short-code` in `dw.json`. + +### Examples + +```bash +# Open the SLAS Admin UI for a specific client +b2c slas client open my-client-id --tenant-id abcd_123 + +# With explicit short code +b2c slas client open my-client-id --tenant-id abcd_123 --short-code kv7kzm78 +``` + +### Notes + +- Opens the SLAS Admin UI in your default browser +- The URL is also printed to the console if the browser fails to open diff --git a/docs/typedoc.json b/docs/typedoc.json index 9b762070..56b1fd29 100644 --- a/docs/typedoc.json +++ b/docs/typedoc.json @@ -6,6 +6,7 @@ "../packages/b2c-tooling-sdk/src/clients/index.ts", "../packages/b2c-tooling-sdk/src/instance/index.ts", "../packages/b2c-tooling-sdk/src/logging/index.ts", + "../packages/b2c-tooling-sdk/src/errors/index.ts", "../packages/b2c-tooling-sdk/src/operations/code/index.ts", "../packages/b2c-tooling-sdk/src/operations/content/index.ts", "../packages/b2c-tooling-sdk/src/operations/cip/index.ts", @@ -13,6 +14,16 @@ "../packages/b2c-tooling-sdk/src/operations/logs/index.ts", "../packages/b2c-tooling-sdk/src/operations/mrt/index.ts", "../packages/b2c-tooling-sdk/src/operations/ods/index.ts", + "../packages/b2c-tooling-sdk/src/operations/users/index.ts", + "../packages/b2c-tooling-sdk/src/operations/roles/index.ts", + "../packages/b2c-tooling-sdk/src/operations/bm-roles/index.ts", + "../packages/b2c-tooling-sdk/src/operations/sites/index.ts", + "../packages/b2c-tooling-sdk/src/operations/orgs/index.ts", + "../packages/b2c-tooling-sdk/src/slas/index.ts", + "../packages/b2c-tooling-sdk/src/safety/index.ts", + "../packages/b2c-tooling-sdk/src/discovery/index.ts", + "../packages/b2c-tooling-sdk/src/skills/index.ts", + "../packages/b2c-tooling-sdk/src/plugins/index.ts", "../packages/b2c-tooling-sdk/src/scaffold/index.ts", "../packages/b2c-tooling-sdk/src/docs/index.ts", "../packages/b2c-tooling-sdk/src/schemas/index.ts", diff --git a/packages/b2c-cli/package.json b/packages/b2c-cli/package.json index 47f8b31a..36542cb0 100644 --- a/packages/b2c-cli/package.json +++ b/packages/b2c-cli/package.json @@ -264,12 +264,6 @@ } } }, - "firewall": { - "description": "Manage custom firewall rules\n\nDocs: https://salesforcecommercecloud.github.io/b2c-developer-tooling/cli/ecdn.html" - }, - "rate-limit": { - "description": "Manage rate limiting rules\n\nDocs: https://salesforcecommercecloud.github.io/b2c-developer-tooling/cli/ecdn.html" - }, "logpush": { "description": "Manage log export configuration\n\nDocs: https://salesforcecommercecloud.github.io/b2c-developer-tooling/cli/ecdn.html", "subtopics": { diff --git a/packages/b2c-tooling-sdk/package.json b/packages/b2c-tooling-sdk/package.json index fb66cf7e..3d602708 100644 --- a/packages/b2c-tooling-sdk/package.json +++ b/packages/b2c-tooling-sdk/package.json @@ -331,6 +331,39 @@ "types": "./dist/cjs/telemetry/index.d.ts", "default": "./dist/cjs/telemetry/index.js" } + }, + "./operations/ods": { + "development": "./src/operations/ods/index.ts", + "import": { + "types": "./dist/esm/operations/ods/index.d.ts", + "default": "./dist/esm/operations/ods/index.js" + }, + "require": { + "types": "./dist/cjs/operations/ods/index.d.ts", + "default": "./dist/cjs/operations/ods/index.js" + } + }, + "./safety": { + "development": "./src/safety/index.ts", + "import": { + "types": "./dist/esm/safety/index.d.ts", + "default": "./dist/esm/safety/index.js" + }, + "require": { + "types": "./dist/cjs/safety/index.d.ts", + "default": "./dist/cjs/safety/index.js" + } + }, + "./i18n": { + "development": "./src/i18n/index.ts", + "import": { + "types": "./dist/esm/i18n/index.d.ts", + "default": "./dist/esm/i18n/index.js" + }, + "require": { + "types": "./dist/cjs/i18n/index.d.ts", + "default": "./dist/cjs/i18n/index.js" + } } }, "main": "./dist/cjs/index.js", diff --git a/packages/b2c-tooling-sdk/src/errors/index.ts b/packages/b2c-tooling-sdk/src/errors/index.ts index d1bd570e..fa42b639 100644 --- a/packages/b2c-tooling-sdk/src/errors/index.ts +++ b/packages/b2c-tooling-sdk/src/errors/index.ts @@ -9,3 +9,13 @@ * @module errors */ export {HTTPError} from './http-error.js'; +export {JobExecutionError} from '../operations/jobs/run.js'; +export {SafetyBlockedError} from '../safety/safety-middleware.js'; +export {MetaDefinitionDetectionError} from '../operations/content/validate.js'; +export {SandboxNotFoundError} from '../operations/ods/sandbox-lookup.js'; +export { + SandboxPollingTimeoutError, + SandboxPollingError, + SandboxTerminalStateError, +} from '../operations/ods/wait-for-sandbox.js'; +export {ClonePollingTimeoutError, ClonePollingError, CloneFailedError} from '../operations/ods/wait-for-clone.js';