https://github.com/openmindlab/sfcc-webdav
Salesforce commerce cloud simple webdav APIs for development.
https://github.com/openmindlab/sfcc-webdav
Last synced: 5 months ago
JSON representation
Salesforce commerce cloud simple webdav APIs for development.
- Host: GitHub
- URL: https://github.com/openmindlab/sfcc-webdav
- Owner: openmindlab
- License: mit
- Created: 2019-07-27T07:57:45.000Z (almost 7 years ago)
- Default Branch: develop
- Last Pushed: 2023-11-11T04:18:20.000Z (over 2 years ago)
- Last Synced: 2025-08-09T15:53:10.918Z (11 months ago)
- Language: JavaScript
- Size: 127 KB
- Stars: 1
- Watchers: 5
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# sfcc-webdav
> Salesforce Commerce Cloud simple webdav API
## Features
* API for upload and delete files via webdav, useful for real-time upload of changes file during development
* Authentication via OCAPI client, uses dw.json for configuration
## Installation
```bash
$ npm i sfcc-webdav
```
## Requirements
* Node >= 10
## Configuration
Requires a dw.json with client_id/secret
```json
{
"hostname": "dev01-mysandbox.demandware.net",
"client_id": "a12464ae-b484-4b90-4dfe-17e20844e9f0",
"client_secret": "mysupersecretpassword"
}
```
### API client configuration
The API client must be created from the account.demandware.com consoleand must be granted the required permissions for accessing the `cartridges` folder through webdav.
For doing so access Business Manager and add the following in Administration -> Organization -> WebDAV Client Permissions. Replace client id with your client id, you may need to merge these settings with existing ones.
```json
{
"clients": [
{
"client_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"permissions": [
{
"path": "/cartridges",
"operations": [
"read_write"
]
}
]
}
]
}
```
## Usage
```javascript
const sfccwebdav = require('sfcc-webdav');
sfccwebdav.fileUpload('/path/to/local/file', '/cartridges/mycodeversion/app_storefront/cartridge/static/filetoupload');
sfccwebdav.fileDelete('/path/to/local/file', '/cartridges/mycodeversion/app_storefront/cartridge/static/filetodelete');
```
## License
Released under the MIT license.