Skip to content

Commit 9e835ba

Browse files
author
PureCloud Jenkins
committed
211.0.0
1 parent 22fd321 commit 9e835ba

File tree

181 files changed

+8302
-1747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+8302
-1747
lines changed

README.md

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A JavaScript library to interface with the Genesys Cloud Platform API. View the
66
[![npm](https://img.shields.io/npm/v/purecloud-platform-client-v2.svg)](https://www.npmjs.com/package/purecloud-platform-client-v2)
77
[![Release Notes Badge](https://developer-content.genesys.cloud/images/sdk-release-notes.png)](https://github.com/MyPureCloud/platform-client-sdk-javascript/blob/master/releaseNotes.md)
88

9-
Documentation version purecloud-platform-client-v2@210.0.0
9+
Documentation version purecloud-platform-client-v2@211.0.0
1010

1111
## Preview APIs
1212

@@ -29,7 +29,7 @@ For direct use in a browser script:
2929

3030
```html
3131
<!-- Include the CJS SDK -->
32-
<script src="https://sdk-cdn.mypurecloud.com/javascript/210.0.0/purecloud-platform-client-v2.min.js"></script>
32+
<script src="https://sdk-cdn.mypurecloud.com/javascript/211.0.0/purecloud-platform-client-v2.min.js"></script>
3333

3434
<script type="text/javascript">
3535
// Obtain a reference to the platformClient object
@@ -46,7 +46,7 @@ For direct use in a browser script:
4646

4747
<script type="text/javascript">
4848
// Obtain a reference to the platformClient object
49-
requirejs(['https://sdk-cdn.mypurecloud.com/javascript/amd/210.0.0/purecloud-platform-client-v2.min.js'], (platformClient) => {
49+
requirejs(['https://sdk-cdn.mypurecloud.com/javascript/amd/211.0.0/purecloud-platform-client-v2.min.js'], (platformClient) => {
5050
console.log(platformClient);
5151
});
5252
</script>
@@ -560,6 +560,55 @@ agent = new HttpsProxyAgent({
560560
client.setProxyAgent(agent)
561561
```
562562

563+
### Using MTLS authentication via a Gateway
564+
565+
If there is MTLS authentication that need to be set for a gateway server (i.e. if the Genesys Cloud requests must be sent through an intermediate API gateway or equivalent, with MTLS enabled), you can use setMTLSCertificates to set the httpsAgent.
566+
567+
An example using `setMTLSCertificates` to setup MTLS for gateway is shown below
568+
569+
```javascript
570+
const client = platformClient.ApiClient.instance;
571+
client.setGateway({host: 'mygateway.mydomain.myextension', protocol: 'https', port: 1443, path_params_login: 'myadditionalpathforlogin', path_params_api: 'myadditionalpathforapi'});
572+
573+
client.setMTLSCertificates('mtls-test/localhost.cert.pem', 'mtls-test/localhost.key.pem', 'mtls-test/ca-chain.cert.pem')
574+
```
575+
576+
Please do note, these are used for setting a new proxy agent for the gateway server configuration.
577+
578+
If you want a custom proxy agent with MTLS , you can still use setProxyAgent method on client instance and inject your own httpsAgent.
579+
The responsibility of setting the agent options inside the custom proxy agent will be with the caller.
580+
581+
Use Either setMTLSCertificates, or setProxyAgent or setHttpClient based on your use case, as the properties will be overridden based on what is invoked last.
582+
583+
### Inject custom Http Client
584+
585+
By default the SDK will use axios as default http client.
586+
If you want to inject a new third party/custom implementation of client , you set the httpclient instance
587+
588+
The CustomHttpClient should be an instance of AbstractHttpClient defined in the SDK. which will implement the request method.
589+
Please find an example for the same.
590+
591+
```javascript
592+
593+
class CustomHttpClient extends AbstractHttpClient{
594+
595+
constructor() {
596+
super();
597+
this._axiosInstance = axios.create({});
598+
}
599+
600+
request(options) {
601+
return this._axiosInstance.request(options);
602+
}
603+
}
604+
605+
606+
const client = platformClient.ApiClient.instance;
607+
608+
httpClient = new CustomHttpClient();
609+
client.setHttpClient(httpClient)
610+
```
611+
563612
## Versioning
564613

565614
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).

build/README.md

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A JavaScript library to interface with the Genesys Cloud Platform API. View the
66
[![npm](https://img.shields.io/npm/v/purecloud-platform-client-v2.svg)](https://www.npmjs.com/package/purecloud-platform-client-v2)
77
[![Release Notes Badge](https://developer-content.genesys.cloud/images/sdk-release-notes.png)](https://github.com/MyPureCloud/platform-client-sdk-javascript/blob/master/releaseNotes.md)
88

9-
Documentation version purecloud-platform-client-v2@210.0.0
9+
Documentation version purecloud-platform-client-v2@211.0.0
1010

1111
## Preview APIs
1212

@@ -29,7 +29,7 @@ For direct use in a browser script:
2929

3030
```html
3131
<!-- Include the CJS SDK -->
32-
<script src="https://sdk-cdn.mypurecloud.com/javascript/210.0.0/purecloud-platform-client-v2.min.js"></script>
32+
<script src="https://sdk-cdn.mypurecloud.com/javascript/211.0.0/purecloud-platform-client-v2.min.js"></script>
3333

3434
<script type="text/javascript">
3535
// Obtain a reference to the platformClient object
@@ -46,7 +46,7 @@ For direct use in a browser script:
4646

4747
<script type="text/javascript">
4848
// Obtain a reference to the platformClient object
49-
requirejs(['https://sdk-cdn.mypurecloud.com/javascript/amd/210.0.0/purecloud-platform-client-v2.min.js'], (platformClient) => {
49+
requirejs(['https://sdk-cdn.mypurecloud.com/javascript/amd/211.0.0/purecloud-platform-client-v2.min.js'], (platformClient) => {
5050
console.log(platformClient);
5151
});
5252
</script>
@@ -560,6 +560,55 @@ agent = new HttpsProxyAgent({
560560
client.setProxyAgent(agent)
561561
```
562562

563+
### Using MTLS authentication via a Gateway
564+
565+
If there is MTLS authentication that need to be set for a gateway server (i.e. if the Genesys Cloud requests must be sent through an intermediate API gateway or equivalent, with MTLS enabled), you can use setMTLSCertificates to set the httpsAgent.
566+
567+
An example using `setMTLSCertificates` to setup MTLS for gateway is shown below
568+
569+
```javascript
570+
const client = platformClient.ApiClient.instance;
571+
client.setGateway({host: 'mygateway.mydomain.myextension', protocol: 'https', port: 1443, path_params_login: 'myadditionalpathforlogin', path_params_api: 'myadditionalpathforapi'});
572+
573+
client.setMTLSCertificates('mtls-test/localhost.cert.pem', 'mtls-test/localhost.key.pem', 'mtls-test/ca-chain.cert.pem')
574+
```
575+
576+
Please do note, these are used for setting a new proxy agent for the gateway server configuration.
577+
578+
If you want a custom proxy agent with MTLS , you can still use setProxyAgent method on client instance and inject your own httpsAgent.
579+
The responsibility of setting the agent options inside the custom proxy agent will be with the caller.
580+
581+
Use Either setMTLSCertificates, or setProxyAgent or setHttpClient based on your use case, as the properties will be overridden based on what is invoked last.
582+
583+
### Inject custom Http Client
584+
585+
By default the SDK will use axios as default http client.
586+
If you want to inject a new third party/custom implementation of client , you set the httpclient instance
587+
588+
The CustomHttpClient should be an instance of AbstractHttpClient defined in the SDK. which will implement the request method.
589+
Please find an example for the same.
590+
591+
```javascript
592+
593+
class CustomHttpClient extends AbstractHttpClient{
594+
595+
constructor() {
596+
super();
597+
this._axiosInstance = axios.create({});
598+
}
599+
600+
request(options) {
601+
return this._axiosInstance.request(options);
602+
}
603+
}
604+
605+
606+
const client = platformClient.ApiClient.instance;
607+
608+
httpClient = new CustomHttpClient();
609+
client.setHttpClient(httpClient)
610+
```
611+
563612
## Versioning
564613

565614
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).

0 commit comments

Comments
 (0)