Skip to content

Commit a5ae91c

Browse files
committed
fix vitepress pages links
1 parent ec46a48 commit a5ae91c

4 files changed

Lines changed: 181 additions & 5 deletions

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pnpm run docs:preview
148148

149149
API documentation is auto-generated from JSDoc comments in the `@salesforce/b2c-tooling-sdk` package. The entry points are defined in `typedoc.json`:
150150

151-
See the [documentation site](https://verbose-adventure-1eqmr1r.pages.github.io/) for the generated API reference.
151+
See the [documentation site](https://salesforcecommercecloud.github.io/b2c-developer-tooling/) for the generated API reference.
152152

153153
- `auth` - Authentication strategies (OAuth, API Key, Basic)
154154
- `instance` - B2C instance configuration
@@ -184,3 +184,7 @@ For security concerns, please review our [Security Policy](./SECURITY.md). Repor
184184
## License
185185

186186
This project is licensed under the Apache License 2.0. See [LICENSE.txt](./LICENSE.txt) for full details.
187+
188+
## Disclaimer
189+
190+
This project is currently in **Developer Preview** and is provided "as-is" without warranty of any kind. It is not yet generally available (GA) and should not be used in production environments. Features, APIs, and functionality may change without notice in future releases.

docs/.vitepress/config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const guideSidebar = [
3131
export default defineConfig({
3232
title: 'B2C CLI',
3333
description: 'Salesforce Commerce Cloud B2C Command Line Tools',
34-
base: '',
34+
base: '/b2c-developer-tooling/',
3535

3636
// Show deeper heading levels in the outline
3737
markdown: {

packages/b2c-cli/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,16 @@ b2c code deploy -D # shorthand
189189
b2c code deploy --json
190190
```
191191

192-
See the [documentation](https://verbose-adventure-1eqmr1r.pages.github.io/cli/logging) for more logging options.
192+
See the [documentation](https://salesforcecommercecloud.github.io/b2c-developer-tooling/cli/logging) for more logging options.
193193

194194
## Documentation
195195

196-
Full documentation is available at: https://verbose-adventure-1eqmr1r.pages.github.io/
196+
Full documentation is available at: https://salesforcecommercecloud.github.io/b2c-developer-tooling/
197197

198198
## License
199199

200-
MIT
200+
This project is licensed under the Apache License 2.0. See [LICENSE.txt](../../LICENSE.txt) for full details.
201+
202+
## Disclaimer
203+
204+
This project is currently in **Developer Preview** and is provided "as-is" without warranty of any kind. It is not yet generally available (GA) and should not be used in production environments. Features, APIs, and functionality may change without notice in future releases.

packages/b2c-tooling-sdk/README.md

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# Salesforce Commerce Cloud B2C Tooling SDK
2+
3+
> [!NOTE]
4+
> This project is currently in **Developer Preview**. Not all features are implemented, and the API may change in future releases.
5+
6+
A TypeScript SDK for programmatic access to Salesforce Commerce Cloud B2C APIs including OCAPI, WebDAV, SLAS, ODS, and MRT.
7+
8+
[![Version](https://img.shields.io/npm/v/@salesforce/b2c-tooling-sdk.svg)](https://npmjs.org/package/@salesforce/b2c-tooling-sdk)
9+
10+
## Installation
11+
12+
```bash
13+
npm install @salesforce/b2c-tooling-sdk
14+
```
15+
16+
## Quick Start
17+
18+
### From Environment Configuration (Recommended)
19+
20+
The easiest way to create an instance is from environment configuration files:
21+
22+
```typescript
23+
import { B2CInstance } from '@salesforce/b2c-tooling-sdk';
24+
25+
// Load configuration from environment files (dw.json, etc.), override secrets from environment
26+
const instance = B2CInstance.fromEnvironment({
27+
clientId: process.env.SFCC_CLIENT_ID,
28+
clientSecret: process.env.SFCC_CLIENT_SECRET,
29+
});
30+
31+
// Use typed WebDAV client
32+
await instance.webdav.mkcol('Cartridges/v1');
33+
await instance.webdav.put('Cartridges/v1/app.zip', zipBuffer);
34+
35+
// Use typed OCAPI client (openapi-fetch)
36+
const { data, error } = await instance.ocapi.GET('/sites', {
37+
params: { query: { select: '(**)' } },
38+
});
39+
```
40+
41+
### Direct Construction
42+
43+
You can also construct an instance directly with configuration:
44+
45+
```typescript
46+
import { B2CInstance } from '@salesforce/b2c-tooling-sdk';
47+
48+
const instance = new B2CInstance(
49+
{ hostname: 'your-sandbox.demandware.net', codeVersion: 'v1' },
50+
{
51+
oauth: {
52+
clientId: 'your-client-id',
53+
clientSecret: 'your-client-secret'
54+
}
55+
}
56+
);
57+
```
58+
59+
## Features
60+
61+
### WebDAV Operations
62+
63+
```typescript
64+
// Create directories
65+
await instance.webdav.mkcol('Cartridges/v1');
66+
67+
// Upload files
68+
await instance.webdav.put('Cartridges/v1/app.zip', buffer, 'application/zip');
69+
70+
// Download files
71+
const content = await instance.webdav.get('Cartridges/v1/app.zip');
72+
73+
// List directory
74+
const entries = await instance.webdav.propfind('Cartridges');
75+
76+
// Check existence
77+
const exists = await instance.webdav.exists('Cartridges/v1');
78+
79+
// Delete
80+
await instance.webdav.delete('Cartridges/v1/old-file.zip');
81+
```
82+
83+
### OCAPI Client
84+
85+
The OCAPI client uses [openapi-fetch](https://openapi-ts.dev/openapi-fetch/) with full TypeScript support:
86+
87+
```typescript
88+
// List sites
89+
const { data, error } = await instance.ocapi.GET('/sites', {
90+
params: { query: { select: '(**)' } },
91+
});
92+
93+
// Activate a code version
94+
const { data, error } = await instance.ocapi.PATCH('/code_versions/{code_version_id}', {
95+
params: { path: { code_version_id: 'v1' } },
96+
body: { active: true },
97+
});
98+
```
99+
100+
### Code Deployment
101+
102+
```typescript
103+
import { findAndDeployCartridges, activateCodeVersion } from '@salesforce/b2c-tooling-sdk/operations/code';
104+
105+
// Deploy cartridges
106+
await findAndDeployCartridges(instance, './cartridges', { reload: true });
107+
108+
// Activate code version
109+
await activateCodeVersion(instance, 'v1');
110+
```
111+
112+
### Job Execution
113+
114+
```typescript
115+
import { executeJob, waitForJob, siteArchiveImport } from '@salesforce/b2c-tooling-sdk/operations/jobs';
116+
117+
// Run a job and wait for completion
118+
const execution = await executeJob(instance, 'my-job-id');
119+
const result = await waitForJob(instance, 'my-job-id', execution.id);
120+
121+
// Import a site archive
122+
await siteArchiveImport(instance, './site-data.zip');
123+
```
124+
125+
## Module Exports
126+
127+
The SDK provides subpath exports for tree-shaking and organization:
128+
129+
| Export | Description |
130+
|--------|-------------|
131+
| `@salesforce/b2c-tooling-sdk` | Main entry point with all exports |
132+
| `@salesforce/b2c-tooling-sdk/auth` | Authentication strategies (OAuth, Basic, API Key) |
133+
| `@salesforce/b2c-tooling-sdk/instance` | B2CInstance class |
134+
| `@salesforce/b2c-tooling-sdk/clients` | Low-level API clients (WebDAV, OCAPI, SLAS, ODS, MRT) |
135+
| `@salesforce/b2c-tooling-sdk/operations/code` | Code deployment operations |
136+
| `@salesforce/b2c-tooling-sdk/operations/jobs` | Job execution and site import/export |
137+
| `@salesforce/b2c-tooling-sdk/operations/sites` | Site management |
138+
| `@salesforce/b2c-tooling-sdk/logging` | Structured logging utilities |
139+
140+
## Logging
141+
142+
Configure logging for debugging HTTP requests:
143+
144+
```typescript
145+
import { configureLogger } from '@salesforce/b2c-tooling-sdk/logging';
146+
147+
// Enable debug logging (shows HTTP request summaries)
148+
configureLogger({ level: 'debug' });
149+
150+
// Enable trace logging (shows full request/response with headers and bodies)
151+
configureLogger({ level: 'trace' });
152+
```
153+
154+
## Documentation
155+
156+
Full documentation is available at: https://salesforcecommercecloud.github.io/b2c-developer-tooling/
157+
158+
## Requirements
159+
160+
- Node.js >= 22.16.0
161+
162+
## License
163+
164+
This project is licensed under the Apache License 2.0. See [LICENSE.txt](../../LICENSE.txt) for full details.
165+
166+
## Disclaimer
167+
168+
This project is currently in **Developer Preview** and is provided "as-is" without warranty of any kind. It is not yet generally available (GA) and should not be used in production environments. Features, APIs, and functionality may change without notice in future releases.

0 commit comments

Comments
 (0)