diff --git a/README.md b/README.md index 5496d2f..338ae56 100644 --- a/README.md +++ b/README.md @@ -21,41 +21,41 @@ For more information, go to the modules. ## Setup guide -To use the Slack Connector you need to be signed in to [Slack](https://slack.com/). +### Step 1: Sign in to Slack -Sign-In Page +1. To use the Slack Connector you need to be signed in to [Slack](https://slack.com/). If you haven't created an account already, you can create it [here](https://slack.com/get-started#/createnew). -If you haven't created an account already, you can create it [here](https://slack.com/get-started#/createnew). + Sign-In Page -### Step 1: Create a new Slack application +### Step 2: Create a new Slack application 1. Navigate to your apps in [Slack API](https://api.slack.com/) and create a new Slack app. -Create Slack App + Create Slack App 2. Provide an app name and choose a workspace of your choice. -Create Slack App Popup + Create Slack App Popup 3. Click on the "Create App" button. -### Step 2: Add scopes to the token +### Step 3: Add scopes to the token 1. Once the application is created, go to the "Add Features and Functionality" section and click on "Permissions" to set the token scopes. -Add features and functionality + Add features and functionality 2. In the **User Token Scopes** section set the following token scopes. -User Token Scopes + User Token Scopes 3. Install the application to workspace. -Install to workspace + Install to workspace 4. Copy the OAuth token that is generated upon installation. -Copy token + Copy token ## Quickstart @@ -104,7 +104,7 @@ bal run The `Slack` connector provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/ballerina-platform/module-ballerinax-slack/tree/master/examples), covering the following use cases: -1. [Automated Survey Report](https://github.com/ballerina-platform/module-ballerinax-slack/tree/master/examples/automated-survey-report) - This use case demonstrates how the Slack API can be utilized to generate a summarized report of daily stand up chats in the general channel. +1. [Automated Summary Report](https://github.com/ballerina-platform/module-ballerinax-slack/tree/master/examples/automated-summary-report) - This use case demonstrates how the Slack API can be utilized to generate a summarized report of daily stand up chats in the general channel. 2. [Survey Feedback Analysis](https://github.com/ballerina-platform/module-ballerinax-slack/tree/master/examples/survey-feedback-analysis) - This use case demonstrates how the Slack API can be utilized to perform a company-wide survey by creating a dedicated channel to receive and track feedback replies. diff --git a/ballerina/Module.md b/ballerina/Module.md index 405ca85..fa956d3 100644 --- a/ballerina/Module.md +++ b/ballerina/Module.md @@ -4,41 +4,41 @@ ## Setup guide -To use the Slack Connector you need to be signed in to [Slack](https://slack.com/). +### Step 1: Sign in to Slack -Sign-In Page +1. To use the Slack Connector you need to be signed in to [Slack](https://slack.com/). If you haven't created an account already, you can create it [here](https://slack.com/get-started#/createnew). -If you haven't created an account already, you can create it [here](https://slack.com/get-started#/createnew). + Sign-In Page -### Step 1: Create a new Slack application +### Step 2: Create a new Slack application 1. Navigate to your apps in [Slack API](https://api.slack.com/) and create a new Slack app. -Create Slack App + Create Slack App 2. Provide an app name and choose a workspace of your choice. -Create Slack App Popup + Create Slack App Popup 3. Click on the "Create App" button. -### Step 2: Add scopes to the token +### Step 3: Add scopes to the token 1. Once the application is created, go to the "Add Features and Functionality" section and click on "Permissions" to set the token scopes. -Add features and functionality + Add features and functionality 2. In the **User Token Scopes** section set the following token scopes. -User Token Scopes + User Token Scopes 3. Install the application to workspace. -Install to workspace + Install to workspace 4. Copy the OAuth token that is generated upon installation. -Copy token + Copy token ## Quickstart @@ -87,6 +87,6 @@ bal run The `Slack` connector provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/ballerina-platform/module-ballerinax-slack/tree/master/examples), covering the following use cases: -1. [Automated Survey Report](https://github.com/ballerina-platform/module-ballerinax-slack/tree/master/examples/automated-survey-report) - This use case demonstrates how the Slack API can be utilized to generate a summarized report of daily stand up chats in the general channel. +1. [Automated Summary Report](https://github.com/ballerina-platform/module-ballerinax-slack/tree/master/examples/automated-summary-report) - This use case demonstrates how the Slack API can be utilized to generate a summarized report of daily stand up chats in the general channel. 2. [Survey Feedback Analysis](https://github.com/ballerina-platform/module-ballerinax-slack/tree/master/examples/survey-feedback-analysis) - This use case demonstrates how the Slack API can be utilized to perform a company-wide survey by creating a dedicated channel to receive and track feedback replies. \ No newline at end of file diff --git a/ballerina/Package.md b/ballerina/Package.md index 405ca85..fa956d3 100644 --- a/ballerina/Package.md +++ b/ballerina/Package.md @@ -4,41 +4,41 @@ ## Setup guide -To use the Slack Connector you need to be signed in to [Slack](https://slack.com/). +### Step 1: Sign in to Slack -Sign-In Page +1. To use the Slack Connector you need to be signed in to [Slack](https://slack.com/). If you haven't created an account already, you can create it [here](https://slack.com/get-started#/createnew). -If you haven't created an account already, you can create it [here](https://slack.com/get-started#/createnew). + Sign-In Page -### Step 1: Create a new Slack application +### Step 2: Create a new Slack application 1. Navigate to your apps in [Slack API](https://api.slack.com/) and create a new Slack app. -Create Slack App + Create Slack App 2. Provide an app name and choose a workspace of your choice. -Create Slack App Popup + Create Slack App Popup 3. Click on the "Create App" button. -### Step 2: Add scopes to the token +### Step 3: Add scopes to the token 1. Once the application is created, go to the "Add Features and Functionality" section and click on "Permissions" to set the token scopes. -Add features and functionality + Add features and functionality 2. In the **User Token Scopes** section set the following token scopes. -User Token Scopes + User Token Scopes 3. Install the application to workspace. -Install to workspace + Install to workspace 4. Copy the OAuth token that is generated upon installation. -Copy token + Copy token ## Quickstart @@ -87,6 +87,6 @@ bal run The `Slack` connector provides practical examples illustrating usage in various scenarios. Explore these [examples](https://github.com/ballerina-platform/module-ballerinax-slack/tree/master/examples), covering the following use cases: -1. [Automated Survey Report](https://github.com/ballerina-platform/module-ballerinax-slack/tree/master/examples/automated-survey-report) - This use case demonstrates how the Slack API can be utilized to generate a summarized report of daily stand up chats in the general channel. +1. [Automated Summary Report](https://github.com/ballerina-platform/module-ballerinax-slack/tree/master/examples/automated-summary-report) - This use case demonstrates how the Slack API can be utilized to generate a summarized report of daily stand up chats in the general channel. 2. [Survey Feedback Analysis](https://github.com/ballerina-platform/module-ballerinax-slack/tree/master/examples/survey-feedback-analysis) - This use case demonstrates how the Slack API can be utilized to perform a company-wide survey by creating a dedicated channel to receive and track feedback replies. \ No newline at end of file diff --git a/docs/spec/sanitations.md b/docs/spec/sanitations.md index 78d3227..ff37a43 100644 --- a/docs/spec/sanitations.md +++ b/docs/spec/sanitations.md @@ -1,4 +1,3 @@ -@@ -0,0 +1,24 @@ _Author_: @Chilliwiddit \ _Created_: 2024/06/25 \ _Edition_: Swan Lake diff --git a/examples/automated-summary-report/main.bal b/examples/automated-summary-report/main.bal index 94f563a..16b2869 100644 --- a/examples/automated-summary-report/main.bal +++ b/examples/automated-summary-report/main.bal @@ -1,35 +1,30 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.org). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + import ballerina/io; +import ballerina/http; import ballerina/log; import ballerinax/slack; configurable string token = ?; -# Holds slack channel information. -type ChannelType record { - string id; -}; - -# Holds response struture of the channels list. -type Channels record {| - boolean ok; - ChannelType[] channels; -|}; - -# Holds information of each text -type TextType record { - string text; -}; - -# Holds the response structure of the conversation history. -type History record { - boolean ok; - TextType[] texts; -}; - // Initialize the Slack client with the provided token. final slack:Client slack = check new Client({ auth: { - token: value + token } }); diff --git a/examples/automated-summary-report/types.bal b/examples/automated-summary-report/types.bal new file mode 100644 index 0000000..1d9679c --- /dev/null +++ b/examples/automated-summary-report/types.bal @@ -0,0 +1,37 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.org). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +# Holds slack channel information. +type ChannelType record { + string id; +}; + +# Holds response struture of the channels list. +type Channels record {| + boolean ok; + ChannelType[] channels; +|}; + +# Holds information of each text +type TextType record { + string text; +}; + +# Holds the response structure of the conversation history. +type History record { + boolean ok; + TextType[] texts; +};