# Sitefinity WebServices SDK

## Introduction

The Sitefinity WebServices JavaScript SDK is intended to help clients use the sitefinity OData web services by providing easy way to build requests and receive response data.

## Development

1. Run `$ npm install` in the root of the project.

The source code is available in the *src* folder.

To build the source code use:

```bash
npm run build:dev
```

To build and serve the source code on each change:

```bash
npm start
```

The output is located in the **dist** folder of the project - **sitefinity-webservices-sdk.js**

## Other commands

To build minified source code:

```bash
npm run build:prod
```

To prepare realese code (bulds minified source, creates documentation):

```bash
npm run build:release
```

The release output is located in the **dist** folder of the project. It contains the source and documentation.

## Documentation

 To generate the SDK documentation `$ npm run build:release` command must be executed. Docs can be found inside  the **dist/documentation** folder.

## Samples

There are examples how to use the SDK and create various types of request. The file is located in the **dist** folder - **samples.html**
To run it, you need to build the source code of the SDK.
Then replace **my_sandbox_location** with the server location you are using.

```js
var options = {
    serviceUrl: "my_sandbox_location" + "/api/default/"
}
```

Also replace **username** and **password** with the credentials of your user.

```js
sf.authentication.login("username", "password");
```

## License

The MIT License (MIT)

Copyright (c) 2022 Progress Software Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
