Skip to content

Commit

Permalink
7.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PureCloud Jenkins committed May 14, 2021
1 parent 74080d1 commit d256982
Show file tree
Hide file tree
Showing 523 changed files with 54,921 additions and 972 deletions.
86 changes: 74 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ For direct use in a browser script:

```{"language":"html"}
<!-- Include the CJS SDK -->
<script src="https://sdk-cdn.mypurecloud.com/javascript-guest/7.1.0/purecloud-guest-chat-client.min.js"></script>
<script src="https://sdk-cdn.mypurecloud.com/javascript-guest/7.2.0/purecloud-guest-chat-client.min.js"></script>
<script type="text/javascript">
// Obtain a reference to the platformClient object
Expand All @@ -48,7 +48,7 @@ For direct use in a browser script:
<script type="text/javascript">
// Obtain a reference to the platformClient object
requirejs(['https://sdk-cdn.mypurecloud.com/javascript-guest/amd/7.1.0/purecloud-guest-chat-client.min.js'], (platformClient) => {
requirejs(['https://sdk-cdn.mypurecloud.com/javascript-guest/amd/7.2.0/purecloud-guest-chat-client.min.js'], (platformClient) => {
console.log(platformClient);
});
</script>
Expand Down Expand Up @@ -149,6 +149,78 @@ webChatApi.postWebchatGuestConversations(createChatBody)
.catch(console.error);
```

## SDK Logging

Logging of API requests and responses can be controlled by a number of parameters on the `Configuration`'s `Logger` instance.

`log_level` values:
1. LTrace (HTTP Method, URL, Request Body, HTTP Status Code, Request Headers, Response Headers)
2. LDebug (HTTP Method, URL, Request Body, HTTP Status Code, Request Headers)
3. LError (HTTP Method, URL, Request Body, Response Body, HTTP Status Code, Request Headers, Response Headers)
4. LNone - default

`log_format` values:
1. JSON
2. TEXT - default

By default, the request and response bodies are not logged because these can contain PII. Be mindful of this data if choosing to log it.
To log to a file, provide a `log_file_path` value. SDK users are responsible for the rotation of the log file. This feature is not available in browser-based applications.

Example logging configuration:
```{"language":"javascript"}
client.config.logger.log_level = client.config.logger.logLevelEnum.level.LTrace;
client.config.logger.log_format = client.config.logger.logFormatEnum.formats.JSON;
client.config.logger.log_request_body = true;
client.config.logger.log_response_body = true;
client.config.logger.log_to_console = true;
client.config.logger.log_file_path = "/var/log/javascriptguestsdk.log";
client.config.logger.setLogger(); // To apply above changes
```

#### Configuration file

**Note:** This feature is not available in browser-based applications

A number of configuration parameters can be applied using a configuration file. There are two sources for this file:

1. The SDK will look for `%USERPROFILE%\.genesyscloudjavascript-guest\config` on Windows if the environment variable USERPROFILE is defined, otherwise uses the path to the profile directory of the current user as home, or `$HOME/.genesyscloudjavascript-guest/config` on Unix.
2. Provide a valid file path to `client.config.setConfigPath()`

The SDK will constantly check to see if the config file has been updated, regardless of whether a config file was present at start-up. To disable this behaviour, set `client.config.live_reload_config` to false.
INI and JSON formats are supported. See below for examples of configuration values in both formats:

INI:
```{"language":"ini"}
[logging]
log_level = trace
log_format = text
log_to_console = false
log_file_path = /var/log/javascriptguestsdk.log
log_response_body = false
log_request_body = false
[general]
live_reload_config = true
host = https://api.mypurecloud.com
```

JSON:
```{"language":"json"}
{
"logging": {
"log_level": "trace",
"log_format": "text",
"log_to_console": false,
"log_file_path": "/var/log/javascriptguestsdk.log",
"log_response_body": false,
"log_request_body": false
},
"general": {
"live_reload_config": true,
"host": "https://api.mypurecloud.com"
}
}
```

## Environments

Expand Down Expand Up @@ -281,16 +353,6 @@ Example error response object:
```


## Debug Logging

There are hooks to trace requests and responses. To enable debug tracing, provide a log object. Optionally, specify a maximum number of lines. If specified, the response body trace will be truncated. If not specified, the entire response body will be traced out.

```{"language":"javascript"}
const client = platformClient.ApiClient.instance;
client.setDebugLog(console.log, 25);
```


## Versioning

The SDK's version is incremented according to the [Semantic Versioning Specification](https://semver.org/). The decision to increment version numbers is determined by [diffing the Platform API's swagger](https://github.com/purecloudlabs/platform-client-sdk-common/blob/master/modules/swaggerDiff.js) for automated builds, and optionally forcing a version bump when a build is triggered manually (e.g. releasing a bugfix).
Expand Down
86 changes: 74 additions & 12 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ For direct use in a browser script:

```{"language":"html"}
<!-- Include the CJS SDK -->
<script src="https://sdk-cdn.mypurecloud.com/javascript-guest/7.1.0/purecloud-guest-chat-client.min.js"></script>
<script src="https://sdk-cdn.mypurecloud.com/javascript-guest/7.2.0/purecloud-guest-chat-client.min.js"></script>
<script type="text/javascript">
// Obtain a reference to the platformClient object
Expand All @@ -48,7 +48,7 @@ For direct use in a browser script:
<script type="text/javascript">
// Obtain a reference to the platformClient object
requirejs(['https://sdk-cdn.mypurecloud.com/javascript-guest/amd/7.1.0/purecloud-guest-chat-client.min.js'], (platformClient) => {
requirejs(['https://sdk-cdn.mypurecloud.com/javascript-guest/amd/7.2.0/purecloud-guest-chat-client.min.js'], (platformClient) => {
console.log(platformClient);
});
</script>
Expand Down Expand Up @@ -149,6 +149,78 @@ webChatApi.postWebchatGuestConversations(createChatBody)
.catch(console.error);
```

## SDK Logging

Logging of API requests and responses can be controlled by a number of parameters on the `Configuration`'s `Logger` instance.

`log_level` values:
1. LTrace (HTTP Method, URL, Request Body, HTTP Status Code, Request Headers, Response Headers)
2. LDebug (HTTP Method, URL, Request Body, HTTP Status Code, Request Headers)
3. LError (HTTP Method, URL, Request Body, Response Body, HTTP Status Code, Request Headers, Response Headers)
4. LNone - default

`log_format` values:
1. JSON
2. TEXT - default

By default, the request and response bodies are not logged because these can contain PII. Be mindful of this data if choosing to log it.
To log to a file, provide a `log_file_path` value. SDK users are responsible for the rotation of the log file. This feature is not available in browser-based applications.

Example logging configuration:
```{"language":"javascript"}
client.config.logger.log_level = client.config.logger.logLevelEnum.level.LTrace;
client.config.logger.log_format = client.config.logger.logFormatEnum.formats.JSON;
client.config.logger.log_request_body = true;
client.config.logger.log_response_body = true;
client.config.logger.log_to_console = true;
client.config.logger.log_file_path = "/var/log/javascriptguestsdk.log";
client.config.logger.setLogger(); // To apply above changes
```

#### Configuration file

**Note:** This feature is not available in browser-based applications

A number of configuration parameters can be applied using a configuration file. There are two sources for this file:

1. The SDK will look for `%USERPROFILE%\.genesyscloudjavascript-guest\config` on Windows if the environment variable USERPROFILE is defined, otherwise uses the path to the profile directory of the current user as home, or `$HOME/.genesyscloudjavascript-guest/config` on Unix.
2. Provide a valid file path to `client.config.setConfigPath()`

The SDK will constantly check to see if the config file has been updated, regardless of whether a config file was present at start-up. To disable this behaviour, set `client.config.live_reload_config` to false.
INI and JSON formats are supported. See below for examples of configuration values in both formats:

INI:
```{"language":"ini"}
[logging]
log_level = trace
log_format = text
log_to_console = false
log_file_path = /var/log/javascriptguestsdk.log
log_response_body = false
log_request_body = false
[general]
live_reload_config = true
host = https://api.mypurecloud.com
```

JSON:
```{"language":"json"}
{
"logging": {
"log_level": "trace",
"log_format": "text",
"log_to_console": false,
"log_file_path": "/var/log/javascriptguestsdk.log",
"log_response_body": false,
"log_request_body": false
},
"general": {
"live_reload_config": true,
"host": "https://api.mypurecloud.com"
}
}
```

## Environments

Expand Down Expand Up @@ -281,16 +353,6 @@ Example error response object:
```


## Debug Logging

There are hooks to trace requests and responses. To enable debug tracing, provide a log object. Optionally, specify a maximum number of lines. If specified, the response body trace will be truncated. If not specified, the entire response body will be traced out.

```{"language":"javascript"}
const client = platformClient.ApiClient.instance;
client.setDebugLog(console.log, 25);
```


## Versioning

The SDK's version is incremented according to the [Semantic Versioning Specification](https://semver.org/). The decision to increment version numbers is determined by [diffing the Platform API's swagger](https://github.com/purecloudlabs/platform-client-sdk-common/blob/master/modules/swaggerDiff.js) for automated builds, and optionally forcing a version bump when a build is triggered manually (e.g. releasing a bugfix).
Expand Down
Loading

0 comments on commit d256982

Please sign in to comment.