From 6799e2123f1242593f5f1c6de1f977eea1000988 Mon Sep 17 00:00:00 2001 From: Nivedhith Date: Wed, 3 Jul 2024 10:50:56 +0530 Subject: [PATCH 01/11] Add company survey example --- examples/README.md | 47 ++++++++++++++++ examples/build.gradle | 78 +++++++++++++++++++++++++++ examples/build.sh | 63 ++++++++++++++++++++++ examples/companySurvey/ballerina.toml | 5 ++ examples/companySurvey/main.bal | 21 ++++++++ 5 files changed, 214 insertions(+) create mode 100644 examples/README.md create mode 100644 examples/build.gradle create mode 100644 examples/build.sh create mode 100644 examples/companySurvey/ballerina.toml create mode 100644 examples/companySurvey/main.bal diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..23c0e2e --- /dev/null +++ b/examples/README.md @@ -0,0 +1,47 @@ +# Examples + +The `ballerinax/slack` connector provides practical examples illustrating usage in various scenarios, covering use cases like cache management, session management, and rate limiting. + +## Prerequisites + +1. Generate Slack token to authenticate the connector as described in the [Setup guide](https://central.ballerina.io/ballerinax/slack/latest#prerequisites). + +2. For each example, create a `Config.toml` file the related configuration. Here's an example of how your `Config.toml` file should look: + + ```toml + token = " + ``` + +## Running an Example + +Execute the following commands to build an example from the source: + +- To build an example: + + ```bash + bal build + ``` + +- To run an example: + + ```bash + bal run + ``` + +## Building the Examples with the Local Module + +**Warning**: Due to the absence of support for reading local repositories for single Ballerina files, the Bala of the module is manually written to the central repository as a workaround. Consequently, the bash script may modify your local Ballerina repositories. + +Execute the following commands to build all the examples against the changes you have made to the module locally: + +- To build all the examples: + + ```bash + ./build.sh build + ``` + +- To run all the examples: + + ```bash + ./build.sh run + ``` diff --git a/examples/build.gradle b/examples/build.gradle new file mode 100644 index 0000000..6c50681 --- /dev/null +++ b/examples/build.gradle @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * 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 org.apache.tools.ant.taskdefs.condition.Os + +apply plugin: 'java' + +def graalvmFlag = "" + +task testExamples { + if (project.hasProperty("balGraalVMTest")) { + graalvmFlag = "--graalvm" + } + doLast { + try { + exec { + workingDir project.projectDir + println("Working dir: ${workingDir}") + if (Os.isFamily(Os.FAMILY_WINDOWS)) { + commandLine 'cmd', "/c", "chmod +x ./build.sh && ./build.sh run && exit %%ERRORLEVEL%%" + } else { + commandLine 'sh', "-c", "chmod +x ./build.sh && ./build.sh run" + } + } + } catch (Exception e) { + println("Example Build failed: " + e.message) + throw e + } + } +} + +task buildExamples { + gradle.taskGraph.whenReady { graph -> + if (graph.hasTask(":slack-examples:test")) { + buildExamples.enabled = false + } else { + testExamples.enabled = false + } + } + doLast { + try { + exec { + workingDir project.projectDir + println("Working dir: ${workingDir}") + if (Os.isFamily(Os.FAMILY_WINDOWS)) { + commandLine 'cmd', "/c", "chmod +x ./build.sh && ./build.sh build && exit %%ERRORLEVEL%%" + } else { + commandLine 'sh', "-c", "chmod +x ./build.sh && ./build.sh build" + } + } + } catch (Exception e) { + println("Example Build failed: " + e.message) + throw e + } + } +} + +buildExamples.dependsOn ":slack-ballerina:build" +testExamples.dependsOn ":slack-ballerina:build" + +// TODO: Enable the examples build once https://github.com/ballerina-platform/ballerina-library/issues/6135 is fixed +// test.dependsOn testExamples +// build.dependsOn buildExamples diff --git a/examples/build.sh b/examples/build.sh new file mode 100644 index 0000000..10fe84c --- /dev/null +++ b/examples/build.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +BAL_EXAMPLES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +BAL_CENTRAL_DIR="$HOME/.ballerina/repositories/central.ballerina.io" +BAL_HOME_DIR="$BAL_EXAMPLES_DIR/../ballerina" + +set -e + +case "$1" in +build) + BAL_CMD="build" + ;; +run) + BAL_CMD="run" + ;; +*) + echo "Invalid command provided: '$1'. Please provide 'build' or 'run' as the command." + exit 1 + ;; +esac + +# Read Ballerina package name +BAL_PACKAGE_NAME=$(awk -F'"' '/^name/ {print $2}' "$BAL_HOME_DIR/Ballerina.toml") + +# Push the package to the local repository +cd "$BAL_HOME_DIR" && + bal pack && + bal push --repository=local + +# Remove the cache directories in the repositories +cacheDirs=$(ls -d $BAL_CENTRAL_DIR/cache-* 2>/dev/null) || true +for dir in "${cacheDirs[@]}"; do + [ -d "$dir" ] && rm -r "$dir" +done +echo "Successfully cleaned the cache directories" + +# Create the package directory in the central repository, this will not be present if no modules are pulled +mkdir -p "$BAL_CENTRAL_DIR/bala/ballerinax/$BAL_PACKAGE_NAME" + +# Update the central repository +BAL_DESTINATION_DIR="$HOME/.ballerina/repositories/central.ballerina.io/bala/ballerinax/$BAL_PACKAGE_NAME" +BAL_SOURCE_DIR="$HOME/.ballerina/repositories/local/bala/ballerinax/$BAL_PACKAGE_NAME" +[ -d "$BAL_DESTINATION_DIR" ] && rm -r "$BAL_DESTINATION_DIR" +[ -d "$BAL_SOURCE_DIR" ] && cp -r "$BAL_SOURCE_DIR" "$BAL_DESTINATION_DIR" +echo "Successfully updated the local central repositories" + +echo "$BAL_DESTINATION_DIR" +echo "$BAL_SOURCE_DIR" + +# Loop through examples in the examples directory +cd "$BAL_EXAMPLES_DIR" +for dir in $(find "$BAL_EXAMPLES_DIR" -type d -maxdepth 1 -mindepth 1); do + # Skip the build directory + if [[ "$dir" == *build ]]; then + continue + fi + (cd "$dir" && bal "$BAL_CMD" --offline && cd ..); +done + +# Remove generated JAR files +find "$BAL_HOME_DIR" -maxdepth 1 -type f -name "*.jar" | while read -r JAR_FILE; do + rm "$JAR_FILE" +done diff --git a/examples/companySurvey/ballerina.toml b/examples/companySurvey/ballerina.toml new file mode 100644 index 0000000..688947d --- /dev/null +++ b/examples/companySurvey/ballerina.toml @@ -0,0 +1,5 @@ +[package] +org = "wso2" +name = "company_survey" +version = "0.1.0" +distribution = "2201.9.0" \ No newline at end of file diff --git a/examples/companySurvey/main.bal b/examples/companySurvey/main.bal new file mode 100644 index 0000000..08b7711 --- /dev/null +++ b/examples/companySurvey/main.bal @@ -0,0 +1,21 @@ +import ballerina/io; +import ballerinax/slack; + +public function companySurvey() returns error? { + slack:Client cl = check new ({ + auth: { + token: value + } + }); + + json response1 = check cl->/conversations\.create.post({name: "survey-coordination"}); + io:println(response1); + + json response2 = check cl->/chat\.postMessage.post({channel: "survey-coordination", text: "Reply to this survey message to give input on the company"}); + io:println(response2); + + string ts_value = check response2.message.ts; + + json response3 = check cl->/conversations\.replies({channel: "survey-coordination", ts: ts_value}); + io:println(response3); +} From 3210d886e0f56c1b1515658a7051e407e5be3465 Mon Sep 17 00:00:00 2001 From: Nivedhith Date: Wed, 3 Jul 2024 14:51:23 +0530 Subject: [PATCH 02/11] Fix typo --- examples/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/README.md b/examples/README.md index 23c0e2e..e3bbf05 100644 --- a/examples/README.md +++ b/examples/README.md @@ -9,7 +9,7 @@ The `ballerinax/slack` connector provides practical examples illustrating usage 2. For each example, create a `Config.toml` file the related configuration. Here's an example of how your `Config.toml` file should look: ```toml - token = " + token = "" ``` ## Running an Example From 1c8dcaff9377696091c22b1815fa2aaca7d1e998 Mon Sep 17 00:00:00 2001 From: Nivedhith Date: Thu, 4 Jul 2024 09:25:53 +0530 Subject: [PATCH 03/11] Create company survey ReadMe --- .../companySurvey/Slack company survey.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 examples/companySurvey/Slack company survey.md diff --git a/examples/companySurvey/Slack company survey.md b/examples/companySurvey/Slack company survey.md new file mode 100644 index 0000000..0d51cbf --- /dev/null +++ b/examples/companySurvey/Slack company survey.md @@ -0,0 +1,25 @@ +# Slack Company Survey + +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. + +## Prerequisites + +### 1. Setup Slack account + +Generate Slack token to authenticate the connector as described in the [Setup guide](https://central.ballerina.io/ballerinax/slack/latest#prerequisites). + +### 2. Configuration + +Update your Slack account related configurations in the `Config.toml` file in the example root directory: + +```toml +token = "" +``` + +## Run the example + +Execute the following command to run the example: + +```ballerina +bal run +``` From 44237d25827ec9965deec8129ef2386eced310ad Mon Sep 17 00:00:00 2001 From: Nivedhith Date: Thu, 4 Jul 2024 09:26:25 +0530 Subject: [PATCH 04/11] Create config template --- examples/companySurvey/Config.toml.template | 1 + 1 file changed, 1 insertion(+) create mode 100644 examples/companySurvey/Config.toml.template diff --git a/examples/companySurvey/Config.toml.template b/examples/companySurvey/Config.toml.template new file mode 100644 index 0000000..ab10163 --- /dev/null +++ b/examples/companySurvey/Config.toml.template @@ -0,0 +1 @@ +token = "" From d6cb28f61514077791e01a44286f5347d7244459 Mon Sep 17 00:00:00 2001 From: Nivedhith Date: Thu, 4 Jul 2024 09:26:59 +0530 Subject: [PATCH 05/11] Add token value variable --- examples/companySurvey/main.bal | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/companySurvey/main.bal b/examples/companySurvey/main.bal index 08b7711..c522994 100644 --- a/examples/companySurvey/main.bal +++ b/examples/companySurvey/main.bal @@ -1,6 +1,8 @@ import ballerina/io; import ballerinax/slack; +configurable string value = ""; + public function companySurvey() returns error? { slack:Client cl = check new ({ auth: { From 733ff89618437ffb9c66deb1be3ab5d664ca79e1 Mon Sep 17 00:00:00 2001 From: Nivedhith Date: Thu, 4 Jul 2024 10:01:22 +0530 Subject: [PATCH 06/11] Declare token as configurable and client at module level --- examples/companySurvey/main.bal | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/companySurvey/main.bal b/examples/companySurvey/main.bal index c522994..caba6ba 100644 --- a/examples/companySurvey/main.bal +++ b/examples/companySurvey/main.bal @@ -1,14 +1,15 @@ import ballerina/io; import ballerinax/slack; -configurable string value = ""; +configurable string value = ?; + +final slack:Client cl = check new ({ + auth: { + token: value + } +}); public function companySurvey() returns error? { - slack:Client cl = check new ({ - auth: { - token: value - } - }); json response1 = check cl->/conversations\.create.post({name: "survey-coordination"}); io:println(response1); From c1f693156be10c280662a82b2fc287a43227764f Mon Sep 17 00:00:00 2001 From: Nivedhith Date: Thu, 4 Jul 2024 10:44:07 +0530 Subject: [PATCH 07/11] Write meaningful comments and variable names --- examples/companySurvey/main.bal | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/companySurvey/main.bal b/examples/companySurvey/main.bal index caba6ba..4540c41 100644 --- a/examples/companySurvey/main.bal +++ b/examples/companySurvey/main.bal @@ -1,9 +1,9 @@ -import ballerina/io; -import ballerinax/slack; +import ballerina/io; //importing the io module +import ballerinax/slack; //importing the slack connector module -configurable string value = ?; +configurable string value = ?; //initializing of the configurable token value variable -final slack:Client cl = check new ({ +final slack:Client slack = check new ({ //the initialization of the slack client at module variable auth: { token: value } @@ -11,14 +11,14 @@ final slack:Client cl = check new ({ public function companySurvey() returns error? { - json response1 = check cl->/conversations\.create.post({name: "survey-coordination"}); - io:println(response1); + json conversationsResponse = check slack->/conversations\.create.post({name: "survey-coordination"}); + io:println(conversationsResponse); //creation of a channel to coordinate surveys - json response2 = check cl->/chat\.postMessage.post({channel: "survey-coordination", text: "Reply to this survey message to give input on the company"}); - io:println(response2); + json messageResponse = check slack->/chat\.postMessage.post({channel: "survey-coordination", text: "Reply to this survey message to give input on the company"}); + io:println(messageResponse); //posting a message to the newly-created conversation - string ts_value = check response2.message.ts; + string timestamp_value = check messageResponse.message.ts; //the message response is used to extract the timestamp of the posted message - json response3 = check cl->/conversations\.replies({channel: "survey-coordination", ts: ts_value}); - io:println(response3); + json replyResponse = check slack->/conversations\.replies({channel: "survey-coordination", ts: timestamp_value}); + io:println(replyResponse); //the timestamp is used to extract the replies to the posted message } From 7a004ca9cdaf040645f6518f2fd0835dcfd5eb30 Mon Sep 17 00:00:00 2001 From: Nipuna Ranasinghe Date: Thu, 4 Jul 2024 19:14:40 +0530 Subject: [PATCH 08/11] Rename Ballerina.toml --- examples/companySurvey/{ballerina.toml => Ballerina.toml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/companySurvey/{ballerina.toml => Ballerina.toml} (100%) diff --git a/examples/companySurvey/ballerina.toml b/examples/companySurvey/Ballerina.toml similarity index 100% rename from examples/companySurvey/ballerina.toml rename to examples/companySurvey/Ballerina.toml From 1e55c247758d7cb225857f35d8a16abbc4c6e68a Mon Sep 17 00:00:00 2001 From: Nipuna Ranasinghe Date: Thu, 4 Jul 2024 22:29:19 +0530 Subject: [PATCH 09/11] Improve example and add license header --- examples/companySurvey/main.bal | 99 ++++++++++++++++++++++++++++----- 1 file changed, 86 insertions(+), 13 deletions(-) diff --git a/examples/companySurvey/main.bal b/examples/companySurvey/main.bal index 4540c41..7117e89 100644 --- a/examples/companySurvey/main.bal +++ b/examples/companySurvey/main.bal @@ -1,24 +1,97 @@ -import ballerina/io; //importing the io module -import ballerinax/slack; //importing the slack connector module +// 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. -configurable string value = ?; //initializing of the configurable token value variable +import ballerina/io; +import ballerina/log; +import ballerinax/slack; -final slack:Client slack = check new ({ //the initialization of the slack client at module variable +configurable string token = ?; + +string channelName = "survey-coordination"; +string surveyRequestMessage = "Reply to this survey message to give input on the company"; + +type MessagesItem record { + string text; + string thread_ts; + string ts; + string 'type; + string user; + string parent_user_id?; + string last_read?; + int reply_count?; + boolean subscribed?; + int unread_count?; +}; + +type Response_metadata record { + string next_cursor; +}; + +type RepliesResponse record { + boolean has_more; + MessagesItem[] messages; + boolean ok; + Response_metadata response_metadata; +}; + +final slack:Client slack = check new ({ auth: { - token: value + token } }); -public function companySurvey() returns error? { +public function main() returns error? { + + // Create a new channel for the survey + json|error createChannelResponse = check slack->/conversations\.create.post({name: channelName}); + if createChannelResponse is error { + log:printError("Error creating the survey conversation: ", createChannelResponse); + return; + } + + // Post a message to the conversation created and get the timestamp of the message + json|error sendMsgResponse = slack->/chat\.postMessage.post({channel: channelName, text: surveyRequestMessage}); + if sendMsgResponse is error { + log:printError("Error posting the survey message: ", sendMsgResponse); + return; + } + string messageTimestamp = check sendMsgResponse.message.ts; - json conversationsResponse = check slack->/conversations\.create.post({name: "survey-coordination"}); - io:println(conversationsResponse); //creation of a channel to coordinate surveys + // Check for replies to the survey message + json|error repliesResponse = slack->/conversations\.replies({channel: channelName, ts: messageTimestamp}); + if repliesResponse is error { + log:printError("Error getting replies to the survey message: ", repliesResponse); + return; + } - json messageResponse = check slack->/chat\.postMessage.post({channel: "survey-coordination", text: "Reply to this survey message to give input on the company"}); - io:println(messageResponse); //posting a message to the newly-created conversation + RepliesResponse|error replies = repliesResponse.cloneWithType(); + if replies is error { + log:printError("Error mapping the JSON response to the RepliesResponse type: ", replies); + return; + } - string timestamp_value = check messageResponse.message.ts; //the message response is used to extract the timestamp of the posted message + // Get the messages from the replies + MessagesItem[] messages = replies.messages; - json replyResponse = check slack->/conversations\.replies({channel: "survey-coordination", ts: timestamp_value}); - io:println(replyResponse); //the timestamp is used to extract the replies to the posted message + // Print the survey responses + io:println("Replies to the survey message:"); + io:println("-----------------------------"); + int counter = 1; + foreach MessagesItem message in messages { + io:println(string `Reply ${counter}: ${message.text}`); + counter += 1; + } } From 4d7a39a97e421cc7272b018e4db632d8c9283e5d Mon Sep 17 00:00:00 2001 From: Nipuna Ranasinghe Date: Thu, 4 Jul 2024 22:30:09 +0530 Subject: [PATCH 10/11] Fix Ballerina.toml content --- ballerina/Dependencies.toml | 34 ++++++++++++++++++- examples/companySurvey/Ballerina.toml | 9 +++-- .../companySurvey/Slack company survey.md | 4 +-- 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index a536a70..cf56ab6 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.9.0" +distribution-version = "2201.9.1" [[package]] org = "ballerina" @@ -147,6 +147,15 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + [[package]] org = "ballerina" name = "lang.int" @@ -205,6 +214,9 @@ dependencies = [ {org = "ballerina", name = "lang.value"}, {org = "ballerina", name = "observe"} ] +modules = [ + {org = "ballerina", packageName = "log", moduleName = "log"} +] [[package]] org = "ballerina" @@ -245,6 +257,9 @@ dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} ] +modules = [ + {org = "ballerina", packageName = "os", moduleName = "os"} +] [[package]] org = "ballerina" @@ -255,6 +270,20 @@ dependencies = [ {org = "ballerina", name = "time"} ] +[[package]] +org = "ballerina" +name = "test" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.error"} +] +modules = [ + {org = "ballerina", packageName = "test", moduleName = "test"} +] + [[package]] org = "ballerina" name = "time" @@ -293,6 +322,9 @@ version = "4.0.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "os"}, + {org = "ballerina", name = "test"}, {org = "ballerina", name = "url"}, {org = "ballerinai", name = "observe"} ] diff --git a/examples/companySurvey/Ballerina.toml b/examples/companySurvey/Ballerina.toml index 688947d..ed3d8c3 100644 --- a/examples/companySurvey/Ballerina.toml +++ b/examples/companySurvey/Ballerina.toml @@ -1,5 +1,10 @@ -[package] org = "wso2" name = "company_survey" version = "0.1.0" -distribution = "2201.9.0" \ No newline at end of file +distribution = "2201.9.0" + +[[dependency]] +org = "ballerinax" +name = "slack" +version = "4.0.0" +repository = "local" diff --git a/examples/companySurvey/Slack company survey.md b/examples/companySurvey/Slack company survey.md index 0d51cbf..b91e08d 100644 --- a/examples/companySurvey/Slack company survey.md +++ b/examples/companySurvey/Slack company survey.md @@ -1,4 +1,4 @@ -# Slack Company Survey +# Slack company survey feedback 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. @@ -10,7 +10,7 @@ Generate Slack token to authenticate the connector as described in the [Setup gu ### 2. Configuration -Update your Slack account related configurations in the `Config.toml` file in the example root directory: +Create a `Config.toml` file in the example root directory, and update your Slack account token as follows: ```toml token = "" From f32ca59149e4f3f19a557732d31f4a0a23c7631d Mon Sep 17 00:00:00 2001 From: Nipuna Ranasinghe Date: Thu, 4 Jul 2024 22:38:46 +0530 Subject: [PATCH 11/11] Fix example README symlink --- examples/companySurvey/Ballerina.toml | 10 ---------- examples/companySurvey/Config.toml.template | 1 - examples/survey-feedback-analysis/.github/README.md | 1 + examples/survey-feedback-analysis/Ballerina.toml | 4 ++++ .../Slack survey feedback anaysis.md} | 2 +- .../main.bal | 0 6 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 examples/companySurvey/Ballerina.toml delete mode 100644 examples/companySurvey/Config.toml.template create mode 120000 examples/survey-feedback-analysis/.github/README.md create mode 100644 examples/survey-feedback-analysis/Ballerina.toml rename examples/{companySurvey/Slack company survey.md => survey-feedback-analysis/Slack survey feedback anaysis.md} (94%) rename examples/{companySurvey => survey-feedback-analysis}/main.bal (100%) diff --git a/examples/companySurvey/Ballerina.toml b/examples/companySurvey/Ballerina.toml deleted file mode 100644 index ed3d8c3..0000000 --- a/examples/companySurvey/Ballerina.toml +++ /dev/null @@ -1,10 +0,0 @@ -org = "wso2" -name = "company_survey" -version = "0.1.0" -distribution = "2201.9.0" - -[[dependency]] -org = "ballerinax" -name = "slack" -version = "4.0.0" -repository = "local" diff --git a/examples/companySurvey/Config.toml.template b/examples/companySurvey/Config.toml.template deleted file mode 100644 index ab10163..0000000 --- a/examples/companySurvey/Config.toml.template +++ /dev/null @@ -1 +0,0 @@ -token = "" diff --git a/examples/survey-feedback-analysis/.github/README.md b/examples/survey-feedback-analysis/.github/README.md new file mode 120000 index 0000000..8e61c9d --- /dev/null +++ b/examples/survey-feedback-analysis/.github/README.md @@ -0,0 +1 @@ +../Slack survey feedback anaysis.md \ No newline at end of file diff --git a/examples/survey-feedback-analysis/Ballerina.toml b/examples/survey-feedback-analysis/Ballerina.toml new file mode 100644 index 0000000..ab37f21 --- /dev/null +++ b/examples/survey-feedback-analysis/Ballerina.toml @@ -0,0 +1,4 @@ +org = "wso2" +name = "survey_feedback_analysis" +version = "0.1.0" +distribution = "2201.9.0" diff --git a/examples/companySurvey/Slack company survey.md b/examples/survey-feedback-analysis/Slack survey feedback anaysis.md similarity index 94% rename from examples/companySurvey/Slack company survey.md rename to examples/survey-feedback-analysis/Slack survey feedback anaysis.md index b91e08d..505570c 100644 --- a/examples/companySurvey/Slack company survey.md +++ b/examples/survey-feedback-analysis/Slack survey feedback anaysis.md @@ -1,4 +1,4 @@ -# Slack company survey feedback +# Slack 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/examples/companySurvey/main.bal b/examples/survey-feedback-analysis/main.bal similarity index 100% rename from examples/companySurvey/main.bal rename to examples/survey-feedback-analysis/main.bal