Skip to content

Commit

Permalink
Use client.config module for ConnectionConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
kasthuriraajan committed Oct 11, 2022
1 parent ac7b88a commit dbfac99
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 438 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Ballerina Build
uses: ballerina-platform/ballerina-action/@master
uses: ballerina-platform/ballerina-action/@2201.2.1
with:
args:
pack
Expand All @@ -24,7 +24,7 @@ jobs:
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
WORKBOOK_PATH: ${{ secrets.WORKBOOK_PATH }}
- name: Ballerina Push
uses: ballerina-platform/ballerina-action/@master
uses: ballerina-platform/ballerina-action/@2201.2.1
with:
args:
push
Expand Down
2 changes: 1 addition & 1 deletion excel/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
distribution = "2201.2.0"
distribution = "2201.2.1"
org= "ballerinax"
name= "microsoft.excel"
version= "2.3.0"
Expand Down
21 changes: 15 additions & 6 deletions excel/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "time"}
]
modules = [
{org = "ballerina", packageName = "crypto", moduleName = "crypto"}
]

[[package]]
org = "ballerina"
Expand Down Expand Up @@ -188,7 +185,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "log"
version = "2.4.0"
version = "2.4.1"
dependencies = [
{org = "ballerina", name = "io"},
{org = "ballerina", name = "jballerina.java"},
Expand Down Expand Up @@ -287,16 +284,28 @@ dependencies = [
{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerinax"
name = "client.config"
version = "1.0.1"
dependencies = [
{org = "ballerina", name = "http"},
{org = "ballerina", name = "oauth2"}
]
modules = [
{org = "ballerinax", packageName = "client.config", moduleName = "client.config"}
]

[[package]]
org = "ballerinax"
name = "microsoft.excel"
version = "2.3.0"
dependencies = [
{org = "ballerina", name = "crypto"},
{org = "ballerina", name = "http"},
{org = "ballerina", name = "log"},
{org = "ballerina", name = "os"},
{org = "ballerina", name = "test"}
{org = "ballerina", name = "test"},
{org = "ballerinax", name = "client.config"}
]
modules = [
{org = "ballerinax", packageName = "microsoft.excel", moduleName = "microsoft.excel"}
Expand Down
2 changes: 1 addition & 1 deletion excel/Package.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This package provides the capability to perform CRUD operations in Microsoft Exc
### Compatibility
| | Version |
|---------------------|--------------------|
| Ballerina Language | Swan Lake 2201.2.0 |
| Ballerina Language | Swan Lake 2201.2.1 |
| Microsoft Graph API | v1.0 |

## Report issues
Expand Down
19 changes: 2 additions & 17 deletions excel/client.bal
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// under the License.

import ballerina/http;
import ballerinax/'client.config;

# Ballerina Microsoft Excel connector provides the capability to access Microsoft Graph Excel API
# It provides capability to perform perform CRUD (Create, Read, Update, and Delete) operations on
Expand All @@ -33,23 +34,7 @@ public isolated client class Client {
# + configuration - Configurations required to initialize the client
# + return - An error on failure of initialization or else `()`
public isolated function init(ConnectionConfig config) returns error? {
http:ClientConfiguration httpClientConfig = {
auth: let var authConfig = config.auth in (authConfig is BearerTokenConfig ? authConfig : {...authConfig}),
httpVersion: config.httpVersion,
http1Settings: {...config.http1Settings},
http2Settings: config.http2Settings,
timeout: config.timeout,
forwarded: config.forwarded,
poolConfig: config.poolConfig,
cache: config.cache,
compression: config.compression,
circuitBreaker: config.circuitBreaker,
retryConfig: config.retryConfig,
responseLimits: config.responseLimits,
secureSocket: config.secureSocket,
proxy: config.proxy,
validation: config.validation
};
http:ClientConfiguration httpClientConfig = check config:constructHTTPClientConfig(config);
self.excelClient = check new (BASE_URL, httpClientConfig);
}

Expand Down
Loading

0 comments on commit dbfac99

Please sign in to comment.