From eac7e4e7b3e824a30e1b0b08fbb394cc6ff652b0 Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Fri, 29 Nov 2024 18:29:11 +0100 Subject: [PATCH 01/25] added: dockerfile and git actions --- .github/docker-community-push-latest.yaml | 23 +++++++++ .../docker-image-tag-community-tag-push.yaml | 48 +++++++++++++++++++ Dockerfile | 34 +++++++++++++ index.js | 8 ++-- package.json | 2 +- tybotRoute/test/anomaly-detection-test.js | 2 +- tybotRoute/test/conversation-actions-test.js_ | 2 +- tybotRoute/test/conversation-add-tags_test.js | 2 +- tybotRoute/test/conversation-askgpt_test.js | 2 +- tybotRoute/test/conversation-askgptv2_test.js | 2 +- tybotRoute/test/conversation-brevo_test.js | 2 +- tybotRoute/test/conversation-capture_test.js | 2 +- .../test/conversation-code_action_test.js | 2 +- .../test/conversation-customerio_test.js | 2 +- ...nversation-empty_text_in_reply_bug_test.js | 2 +- .../conversation-filters_in_reply_test.js | 2 +- tybotRoute/test/conversation-form-test.js | 2 +- .../test/conversation-gpt_assistant_test.js_ | 2 +- tybotRoute/test/conversation-gpt_task_test.js | 2 +- tybotRoute/test/conversation-hubspot_test.js | 2 +- ...sation-intent_with_json_attributes_test.js | 2 +- .../test/conversation-locked-intent-test.js | 2 +- tybotRoute/test/conversation-make_test.js | 2 +- .../conversation-message_metadata_test.js | 2 +- ...onversation-native_block_connector_test.js | 2 +- .../test/conversation-open_hours_test.js | 2 +- tybotRoute/test/conversation-qapla_test.js | 2 +- tybotRoute/test/conversation-reply_test.js | 2 +- .../conversation-replyv2_button_match_test.js | 2 +- .../test/conversation-replyv2_noinput_test.js | 2 +- .../test/conversation-send_whatsapp_test.js | 2 +- ...onversation-set_attributev2_action_test.js | 2 +- ...nversation-web_request_assign_json_test.js | 2 +- ...nversation-web_request_test_DEPRECATED.js_ | 2 +- .../test/conversation-web_requestv2_test.js | 2 +- tybotRoute/test/conversation-webhook_test.js | 2 +- .../test/json_condition-conversation_test.js | 2 +- ...on-with-intent-params-conversation_test.js | 2 +- 38 files changed, 143 insertions(+), 38 deletions(-) create mode 100644 .github/docker-community-push-latest.yaml create mode 100644 .github/docker-image-tag-community-tag-push.yaml create mode 100644 Dockerfile diff --git a/.github/docker-community-push-latest.yaml b/.github/docker-community-push-latest.yaml new file mode 100644 index 0000000..01f7fff --- /dev/null +++ b/.github/docker-community-push-latest.yaml @@ -0,0 +1,23 @@ +name: Docker Image Community latest CI - Tiledesk Chatbot + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + name: Check out the repo + - uses: docker/build-push-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: chat21/chat21-web-widget + push: true + tags: latest diff --git a/.github/docker-image-tag-community-tag-push.yaml b/.github/docker-image-tag-community-tag-push.yaml new file mode 100644 index 0000000..43d6d50 --- /dev/null +++ b/.github/docker-image-tag-community-tag-push.yaml @@ -0,0 +1,48 @@ +name: Publish Docker Community image tags - Tiledesk Chatbot + +env: + REGISTRY: tiledeskrepo + IMAGE_NAME: tiledesk-chatbot + +on: + push: + tags: + - '**' # Push events to every tag including hierarchical tags like + +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tag_with_ref: true + + - name: Generate Docker metadata + id: meta + uses: docker/metadata-action@v3 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + + - name: Build and push + uses: docker/build-push-action@v4 + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8382ab2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +FROM node:16 + +RUN sed -i 's/stable\/updates/stable-security\/updates/' /etc/apt/sources.list + + +RUN apt-get update + +# Create app directory +WORKDIR /usr/src/app + +ARG NPM_TOKEN + +RUN if [ "$NPM_TOKEN" ]; \ + then RUN COPY .npmrc_ .npmrc \ + else export SOMEVAR=world; \ + fi + + +# Install app dependencies +# A wildcard is used to ensure both package.json AND package-lock.json are copied +# where available (npm@5+) +COPY package*.json ./ + +RUN npm install --production + +RUN rm -f .npmrc + +# Bundle app source +COPY . . + +EXPOSE 3000 + +CMD [ "npm", "start" ] + diff --git a/index.js b/index.js index d5de91a..4a778c8 100644 --- a/index.js +++ b/index.js @@ -20,12 +20,12 @@ app.use("/langbot", chooserRoute); tybot.startApp( { - MONGODB_URI: process.env.mongoUrl, + MONGODB_URI: process.env.MONGODB_URI, // bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, - REDIS_HOST: process.env.REDIS_HOST, - REDIS_PORT: process.env.REDIS_PORT, - REDIS_PASSWORD: process.env.REDIS_PASSWORD, + REDIS_HOST: process.env.CACHE_REDIS_HOST, + REDIS_PORT: process.env.CACHE_REDIS_PORT, + REDIS_PASSWORD: process.env.CACHE_REDIS_PASSWORD, // CACHE_ENABLED: process.env.CACHE_ENABLED, log: process.env.TILEBOT_LOG }, () => { diff --git a/package.json b/package.json index 5145db8..47708ec 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "tiledesk-bot-web-sandbox", + "name": "@tiledesk/tiledesk-chatbot", "version": "1.0.0", "description": "", "main": "index.js", diff --git a/tybotRoute/test/anomaly-detection-test.js b/tybotRoute/test/anomaly-detection-test.js index 71b51b1..df2310a 100644 --- a/tybotRoute/test/anomaly-detection-test.js +++ b/tybotRoute/test/anomaly-detection-test.js @@ -27,7 +27,7 @@ describe('Conversation for anomaly detection test', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-actions-test.js_ b/tybotRoute/test/conversation-actions-test.js_ index 4bd7d08..024da9d 100644 --- a/tybotRoute/test/conversation-actions-test.js_ +++ b/tybotRoute/test/conversation-actions-test.js_ @@ -27,7 +27,7 @@ describe('Conversation for actions test', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-add-tags_test.js b/tybotRoute/test/conversation-add-tags_test.js index 378e078..85ee353 100644 --- a/tybotRoute/test/conversation-add-tags_test.js +++ b/tybotRoute/test/conversation-add-tags_test.js @@ -32,7 +32,7 @@ describe('Conversation for AddTags test', async () => { try { tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-askgpt_test.js b/tybotRoute/test/conversation-askgpt_test.js index 21737aa..1f524de 100644 --- a/tybotRoute/test/conversation-askgpt_test.js +++ b/tybotRoute/test/conversation-askgpt_test.js @@ -31,7 +31,7 @@ describe('Conversation for AskGPT test', async () => { try { tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-askgptv2_test.js b/tybotRoute/test/conversation-askgptv2_test.js index 0a46bbd..dcdd992 100644 --- a/tybotRoute/test/conversation-askgptv2_test.js +++ b/tybotRoute/test/conversation-askgptv2_test.js @@ -31,7 +31,7 @@ describe('Conversation for AskGPTV2 test', async () => { try { tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-brevo_test.js b/tybotRoute/test/conversation-brevo_test.js index 128e131..54557fc 100644 --- a/tybotRoute/test/conversation-brevo_test.js +++ b/tybotRoute/test/conversation-brevo_test.js @@ -31,7 +31,7 @@ describe('Conversation for brevo test', async () => { try { tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-capture_test.js b/tybotRoute/test/conversation-capture_test.js index a156e3f..5d9d624 100644 --- a/tybotRoute/test/conversation-capture_test.js +++ b/tybotRoute/test/conversation-capture_test.js @@ -31,7 +31,7 @@ describe('Conversation for capture test', async () => { try { tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-code_action_test.js b/tybotRoute/test/conversation-code_action_test.js index 258662b..468289a 100644 --- a/tybotRoute/test/conversation-code_action_test.js +++ b/tybotRoute/test/conversation-code_action_test.js @@ -29,7 +29,7 @@ describe('Conversation for Code Action test', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-customerio_test.js b/tybotRoute/test/conversation-customerio_test.js index 30aac65..a16b0aa 100644 --- a/tybotRoute/test/conversation-customerio_test.js +++ b/tybotRoute/test/conversation-customerio_test.js @@ -31,7 +31,7 @@ describe('Conversation for customerio test', async () => { try { tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-empty_text_in_reply_bug_test.js b/tybotRoute/test/conversation-empty_text_in_reply_bug_test.js index 8bac845..3984a59 100644 --- a/tybotRoute/test/conversation-empty_text_in_reply_bug_test.js +++ b/tybotRoute/test/conversation-empty_text_in_reply_bug_test.js @@ -29,7 +29,7 @@ describe('Conversation for test text empty bug', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-filters_in_reply_test.js b/tybotRoute/test/conversation-filters_in_reply_test.js index 33a0988..ff8325f 100644 --- a/tybotRoute/test/conversation-filters_in_reply_test.js +++ b/tybotRoute/test/conversation-filters_in_reply_test.js @@ -29,7 +29,7 @@ describe('Conversation for Filters in reply test', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-form-test.js b/tybotRoute/test/conversation-form-test.js index 104b06c..a5e55e6 100644 --- a/tybotRoute/test/conversation-form-test.js +++ b/tybotRoute/test/conversation-form-test.js @@ -50,7 +50,7 @@ describe('Conversation1 - Form filling', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-gpt_assistant_test.js_ b/tybotRoute/test/conversation-gpt_assistant_test.js_ index 6355e3b..fc9e5cc 100644 --- a/tybotRoute/test/conversation-gpt_assistant_test.js_ +++ b/tybotRoute/test/conversation-gpt_assistant_test.js_ @@ -29,7 +29,7 @@ describe('Conversation for DirAssistant test', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-gpt_task_test.js b/tybotRoute/test/conversation-gpt_task_test.js index 1408f44..913f661 100644 --- a/tybotRoute/test/conversation-gpt_task_test.js +++ b/tybotRoute/test/conversation-gpt_task_test.js @@ -31,7 +31,7 @@ describe('Conversation for GptTask test', async () => { try { tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-hubspot_test.js b/tybotRoute/test/conversation-hubspot_test.js index b7bfe8b..ae47fe1 100644 --- a/tybotRoute/test/conversation-hubspot_test.js +++ b/tybotRoute/test/conversation-hubspot_test.js @@ -31,7 +31,7 @@ describe('Conversation for hubspot test', async () => { try { tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-intent_with_json_attributes_test.js b/tybotRoute/test/conversation-intent_with_json_attributes_test.js index 361fa08..e1b2f5f 100644 --- a/tybotRoute/test/conversation-intent_with_json_attributes_test.js +++ b/tybotRoute/test/conversation-intent_with_json_attributes_test.js @@ -29,7 +29,7 @@ describe('Conversation for Intent JSON Attributes test', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-locked-intent-test.js b/tybotRoute/test/conversation-locked-intent-test.js index 908cbd3..6edf515 100644 --- a/tybotRoute/test/conversation-locked-intent-test.js +++ b/tybotRoute/test/conversation-locked-intent-test.js @@ -27,7 +27,7 @@ describe('Conversation1 - Form filling', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-make_test.js b/tybotRoute/test/conversation-make_test.js index 7cdc40d..2206a4e 100644 --- a/tybotRoute/test/conversation-make_test.js +++ b/tybotRoute/test/conversation-make_test.js @@ -31,7 +31,7 @@ describe('Conversation for make test', async () => { try { tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-message_metadata_test.js b/tybotRoute/test/conversation-message_metadata_test.js index cfa73a3..943ad4b 100644 --- a/tybotRoute/test/conversation-message_metadata_test.js +++ b/tybotRoute/test/conversation-message_metadata_test.js @@ -29,7 +29,7 @@ describe('Conversation for message.metadata test', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-native_block_connector_test.js b/tybotRoute/test/conversation-native_block_connector_test.js index 333352b..7d65ecf 100644 --- a/tybotRoute/test/conversation-native_block_connector_test.js +++ b/tybotRoute/test/conversation-native_block_connector_test.js @@ -29,7 +29,7 @@ describe('Conversation for Intent JSON Attributes test', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-open_hours_test.js b/tybotRoute/test/conversation-open_hours_test.js index 2c1523c..5874bce 100644 --- a/tybotRoute/test/conversation-open_hours_test.js +++ b/tybotRoute/test/conversation-open_hours_test.js @@ -32,7 +32,7 @@ describe('Conversation for Operating Hours test', async () => { try { tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-qapla_test.js b/tybotRoute/test/conversation-qapla_test.js index 118ec2a..e207311 100644 --- a/tybotRoute/test/conversation-qapla_test.js +++ b/tybotRoute/test/conversation-qapla_test.js @@ -31,7 +31,7 @@ describe('Conversation for Qapla test', async () => { try { tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-reply_test.js b/tybotRoute/test/conversation-reply_test.js index 57ec84a..0a057b3 100644 --- a/tybotRoute/test/conversation-reply_test.js +++ b/tybotRoute/test/conversation-reply_test.js @@ -31,7 +31,7 @@ describe('Conversation for Reply test', async () => { try { tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-replyv2_button_match_test.js b/tybotRoute/test/conversation-replyv2_button_match_test.js index 66fcb56..b82a69d 100644 --- a/tybotRoute/test/conversation-replyv2_button_match_test.js +++ b/tybotRoute/test/conversation-replyv2_button_match_test.js @@ -31,7 +31,7 @@ describe('Conversation for Reply v2 test', async () => { try { tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-replyv2_noinput_test.js b/tybotRoute/test/conversation-replyv2_noinput_test.js index 70e7e46..f37db92 100644 --- a/tybotRoute/test/conversation-replyv2_noinput_test.js +++ b/tybotRoute/test/conversation-replyv2_noinput_test.js @@ -31,7 +31,7 @@ describe('Conversation for Reply v2 test (noInput)', async () => { try { tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-send_whatsapp_test.js b/tybotRoute/test/conversation-send_whatsapp_test.js index 111da9d..d923955 100644 --- a/tybotRoute/test/conversation-send_whatsapp_test.js +++ b/tybotRoute/test/conversation-send_whatsapp_test.js @@ -31,7 +31,7 @@ describe('Conversation for GptTask test', async () => { try { tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-set_attributev2_action_test.js b/tybotRoute/test/conversation-set_attributev2_action_test.js index 9e52628..1c1ce96 100644 --- a/tybotRoute/test/conversation-set_attributev2_action_test.js +++ b/tybotRoute/test/conversation-set_attributev2_action_test.js @@ -29,7 +29,7 @@ describe('Conversation for Set Attribute (v2) Action test', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-web_request_assign_json_test.js b/tybotRoute/test/conversation-web_request_assign_json_test.js index 1e0d085..a1d5000 100644 --- a/tybotRoute/test/conversation-web_request_assign_json_test.js +++ b/tybotRoute/test/conversation-web_request_assign_json_test.js @@ -29,7 +29,7 @@ describe('Conversation for WebRequest assign test', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-web_request_test_DEPRECATED.js_ b/tybotRoute/test/conversation-web_request_test_DEPRECATED.js_ index 827669b..02a56a6 100644 --- a/tybotRoute/test/conversation-web_request_test_DEPRECATED.js_ +++ b/tybotRoute/test/conversation-web_request_test_DEPRECATED.js_ @@ -27,7 +27,7 @@ describe('DEPRECATED TEST', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-web_requestv2_test.js b/tybotRoute/test/conversation-web_requestv2_test.js index 4747ac1..527400a 100644 --- a/tybotRoute/test/conversation-web_requestv2_test.js +++ b/tybotRoute/test/conversation-web_requestv2_test.js @@ -29,7 +29,7 @@ describe('Conversation for WebRequestV2 test', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/conversation-webhook_test.js b/tybotRoute/test/conversation-webhook_test.js index 4d9194c..5345ff9 100644 --- a/tybotRoute/test/conversation-webhook_test.js +++ b/tybotRoute/test/conversation-webhook_test.js @@ -32,7 +32,7 @@ describe('Conversation for Webhook test', async () => { try { tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/json_condition-conversation_test.js b/tybotRoute/test/json_condition-conversation_test.js index fd939e2..c79529e 100644 --- a/tybotRoute/test/json_condition-conversation_test.js +++ b/tybotRoute/test/json_condition-conversation_test.js @@ -29,7 +29,7 @@ describe('Conversation for JSONCondition test', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, diff --git a/tybotRoute/test/json_condition-with-intent-params-conversation_test.js b/tybotRoute/test/json_condition-with-intent-params-conversation_test.js index f40cb84..e4f14f3 100644 --- a/tybotRoute/test/json_condition-with-intent-params-conversation_test.js +++ b/tybotRoute/test/json_condition-with-intent-params-conversation_test.js @@ -29,7 +29,7 @@ describe('Conversation for JSONCondition with intent params test', async () => { console.log("Starting tilebot server..."); tybot.startApp( { - // MONGODB_URI: process.env.mongoUrl, + // MONGODB_URI: process.env.MONGODB_URI, bots: bots_data, API_ENDPOINT: process.env.API_ENDPOINT, REDIS_HOST: process.env.REDIS_HOST, From 4189d85c816f60fe2ef5bb90c0119605bba48576 Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Fri, 29 Nov 2024 18:32:21 +0100 Subject: [PATCH 02/25] minor imple --- .github/{ => workflows}/docker-community-push-latest.yaml | 0 .github/{ => workflows}/docker-image-tag-community-tag-push.yaml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/docker-community-push-latest.yaml (100%) rename .github/{ => workflows}/docker-image-tag-community-tag-push.yaml (100%) diff --git a/.github/docker-community-push-latest.yaml b/.github/workflows/docker-community-push-latest.yaml similarity index 100% rename from .github/docker-community-push-latest.yaml rename to .github/workflows/docker-community-push-latest.yaml diff --git a/.github/docker-image-tag-community-tag-push.yaml b/.github/workflows/docker-image-tag-community-tag-push.yaml similarity index 100% rename from .github/docker-image-tag-community-tag-push.yaml rename to .github/workflows/docker-image-tag-community-tag-push.yaml From 640ad9ffcc014f53e2918b3f1656663eab4e34b1 Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Sat, 30 Nov 2024 16:19:56 +0100 Subject: [PATCH 03/25] minor fix --- .github/workflows/docker-image-tag-community-tag-push.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image-tag-community-tag-push.yaml b/.github/workflows/docker-image-tag-community-tag-push.yaml index 43d6d50..4d0ece3 100644 --- a/.github/workflows/docker-image-tag-community-tag-push.yaml +++ b/.github/workflows/docker-image-tag-community-tag-push.yaml @@ -23,7 +23,7 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + password: ${{ secrets.DOCKER_PASSWORD }} repository: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tag_with_ref: true From 482288b8fd216cc723f51409cd5f5746d905c2b7 Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Sat, 30 Nov 2024 16:22:38 +0100 Subject: [PATCH 04/25] minor fix --- .github/workflows/docker-image-tag-community-tag-push.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image-tag-community-tag-push.yaml b/.github/workflows/docker-image-tag-community-tag-push.yaml index 4d0ece3..d0181e8 100644 --- a/.github/workflows/docker-image-tag-community-tag-push.yaml +++ b/.github/workflows/docker-image-tag-community-tag-push.yaml @@ -22,7 +22,7 @@ jobs: uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} + username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} repository: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tag_with_ref: true From 208c66c1051b463f046634e7afac3cf141d33f5f Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Wed, 4 Dec 2024 15:49:39 +0100 Subject: [PATCH 05/25] minor improvement gitactions --- .../docker-community-push-latest.yaml | 26 ++++++++++++++----- tybotRoute/models/TiledeskChatbotUtil.js | 3 ++- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-community-push-latest.yaml b/.github/workflows/docker-community-push-latest.yaml index 01f7fff..6ef8af4 100644 --- a/.github/workflows/docker-community-push-latest.yaml +++ b/.github/workflows/docker-community-push-latest.yaml @@ -1,5 +1,9 @@ name: Docker Image Community latest CI - Tiledesk Chatbot +env: + REGISTRY: tiledeskrepo + IMAGE_NAME: tiledesk-chatbot + on: push: branches: [ master ] @@ -12,12 +16,20 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - name: Check out the repo - - uses: docker/build-push-action@v1 + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - repository: chat21/chat21-web-widget + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile push: true - tags: latest + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \ No newline at end of file diff --git a/tybotRoute/models/TiledeskChatbotUtil.js b/tybotRoute/models/TiledeskChatbotUtil.js index 77669c0..3ece792 100644 --- a/tybotRoute/models/TiledeskChatbotUtil.js +++ b/tybotRoute/models/TiledeskChatbotUtil.js @@ -708,7 +708,7 @@ class TiledeskChatbotUtil { message.attributes.payload = message.request.attributes.payload if (chatbot.log) {console.log("FORCED SET message.attributes.payload:", JSON.stringify(message.attributes.payload))} // if (projectId === "641864da99c1fb00131ba495") {console.log("641864da99c1fb00131ba495 > FORCED SET message.attributes.payload:", JSON.stringify(message.attributes.payload))} - } + } if (message.attributes) { if (chatbot.log) {console.log("Ok message.attributes", JSON.stringify(message.attributes));} // if (projectId === "641864da99c1fb00131ba495") {console.log("641864da99c1fb00131ba495 > Ok message.attributes", JSON.stringify(message.attributes));} @@ -918,6 +918,7 @@ class TiledeskChatbotUtil { } /** + * DEPRECATED * A stub to get the request parameters, hosted by tilebot on: * /${TILEBOT_ROUTE}/ext/parameters/requests/${requestId}?all * From 41b7e9cee02f96437a804efb6b55eb303934d2ac Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Thu, 5 Dec 2024 09:56:38 +0100 Subject: [PATCH 06/25] log removed --- tybotRoute/test/conversation-form-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tybotRoute/test/conversation-form-test.js b/tybotRoute/test/conversation-form-test.js index a5e55e6..76f5450 100644 --- a/tybotRoute/test/conversation-form-test.js +++ b/tybotRoute/test/conversation-form-test.js @@ -278,7 +278,7 @@ describe('Conversation1 - Form filling', async () => { }); it('(intent-to-intent) /move_to => /target_intent', (done) => { - console.log("ALWAYS PASSES: (intent-to-intent) /move_to => /target_intent"); + // console.log("ALWAYS PASSES: (intent-to-intent) /move_to => /target_intent"); try { let listener; let endpointServer = express(); From 8964876f26dec764510111ca17d57158088b6434 Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Fri, 13 Dec 2024 11:46:27 +0100 Subject: [PATCH 07/25] minor fix --- package-lock.json | 231 +++++++++++++++++++++++++++++++++++------- package.json | 2 +- tybotRoute/TdCache.js | 8 +- 3 files changed, 197 insertions(+), 44 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5dfcbce..ef93319 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "tiledesk-bot-web-sandbox", + "name": "@tiledesk/tiledesk-chatbot", "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "tiledesk-bot-web-sandbox", + "name": "@tiledesk/tiledesk-chatbot", "version": "1.0.0", "license": "ISC", "dependencies": { @@ -28,7 +28,7 @@ "mongoose": "^6.6.1", "nanoid": "^3.3.4", "npm": "^6.14.11", - "redis": "^3.1.2", + "redis": "^4.7.0", "uuid": "^9.0.0", "vm2": "^3.9.13" }, @@ -36,6 +36,59 @@ "mocha": "^8.4.0" } }, + "node_modules/@redis/bloom": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-1.2.0.tgz", + "integrity": "sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/client": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@redis/client/-/client-1.6.0.tgz", + "integrity": "sha512-aR0uffYI700OEEH4gYnitAnv3vzVGXCFvYfdpu/CJKvk4pHfLPEy/JSZyrpQ+15WhXe1yJRXLtfQ84s4mEXnPg==", + "dependencies": { + "cluster-key-slot": "1.1.2", + "generic-pool": "3.9.0", + "yallist": "4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@redis/graph": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@redis/graph/-/graph-1.1.1.tgz", + "integrity": "sha512-FEMTcTHZozZciLRl6GiiIB4zGm5z5F3F6a6FZCyrfxdKOhFlGkiAqlexWMBzCi4DcRoyiOsuLfW+cjlGWyExOw==", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/json": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@redis/json/-/json-1.0.7.tgz", + "integrity": "sha512-6UyXfjVaTBTJtKNG4/9Z8PSpKE6XgSyEb8iwaqDcy+uKrd/DGYHTWkUdnQDyzm727V7p21WUMhsqz5oy65kPcQ==", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/search": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@redis/search/-/search-1.2.0.tgz", + "integrity": "sha512-tYoDBbtqOVigEDMAcTGsRlMycIIjwMCgD8eR2t0NANeQmgK/lvxNAvYyb6bZDD4frHRhIHkJu2TBRvB0ERkOmw==", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/time-series": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-1.1.0.tgz", + "integrity": "sha512-c1Q99M5ljsIuc4YdaCwfUEXsofakb9c8+Zse2qxTadu8TalLXuAESzLvFAvNVbkmSlvlzIQOLpBCmWI9wTOt+g==", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, "node_modules/@tiledesk/helpcenter-query-client": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/@tiledesk/helpcenter-query-client/-/helpcenter-query-client-0.1.8.tgz", @@ -198,6 +251,14 @@ "form-data": "^4.0.0" } }, + "node_modules/@tiledesk/tiledesk-tybot-connector/node_modules/denque": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz", + "integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==", + "engines": { + "node": ">=0.10" + } + }, "node_modules/@tiledesk/tiledesk-tybot-connector/node_modules/dotenv": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", @@ -206,6 +267,24 @@ "node": ">=10" } }, + "node_modules/@tiledesk/tiledesk-tybot-connector/node_modules/redis": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/redis/-/redis-3.1.2.tgz", + "integrity": "sha512-grn5KoZLr/qrRQVwoSkmzdbw6pwF+/rwODtrOr6vuBRiR/f3rjSTGupbF90Zpqm2oenix8Do6RV7pYEkGwlKkw==", + "dependencies": { + "denque": "^1.5.0", + "redis-commands": "^1.7.0", + "redis-errors": "^1.2.0", + "redis-parser": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-redis" + } + }, "node_modules/@tiledesk/tiledesk-tybot-connector/node_modules/uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", @@ -691,6 +770,14 @@ "node": ">=8" } }, + "node_modules/cluster-key-slot": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", + "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1114,6 +1201,14 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, + "node_modules/generic-pool": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", + "integrity": "sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==", + "engines": { + "node": ">= 4" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -6247,21 +6342,16 @@ } }, "node_modules/redis": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/redis/-/redis-3.1.2.tgz", - "integrity": "sha512-grn5KoZLr/qrRQVwoSkmzdbw6pwF+/rwODtrOr6vuBRiR/f3rjSTGupbF90Zpqm2oenix8Do6RV7pYEkGwlKkw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/redis/-/redis-4.7.0.tgz", + "integrity": "sha512-zvmkHEAdGMn+hMRXuMBtu4Vo5P6rHQjLoHftu+lBqq8ZTA3RCVC/WzD790bkKKiNFp7d5/9PcSD19fJyyRvOdQ==", "dependencies": { - "denque": "^1.5.0", - "redis-commands": "^1.7.0", - "redis-errors": "^1.2.0", - "redis-parser": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-redis" + "@redis/bloom": "1.2.0", + "@redis/client": "1.6.0", + "@redis/graph": "1.1.1", + "@redis/json": "1.0.7", + "@redis/search": "1.2.0", + "@redis/time-series": "1.1.0" } }, "node_modules/redis-commands": { @@ -6288,14 +6378,6 @@ "node": ">=4" } }, - "node_modules/redis/node_modules/denque": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz", - "integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==", - "engines": { - "node": ">=0.10" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -6745,6 +6827,11 @@ "node": ">=10" } }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", @@ -6845,6 +6932,46 @@ } }, "dependencies": { + "@redis/bloom": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-1.2.0.tgz", + "integrity": "sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==", + "requires": {} + }, + "@redis/client": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@redis/client/-/client-1.6.0.tgz", + "integrity": "sha512-aR0uffYI700OEEH4gYnitAnv3vzVGXCFvYfdpu/CJKvk4pHfLPEy/JSZyrpQ+15WhXe1yJRXLtfQ84s4mEXnPg==", + "requires": { + "cluster-key-slot": "1.1.2", + "generic-pool": "3.9.0", + "yallist": "4.0.0" + } + }, + "@redis/graph": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@redis/graph/-/graph-1.1.1.tgz", + "integrity": "sha512-FEMTcTHZozZciLRl6GiiIB4zGm5z5F3F6a6FZCyrfxdKOhFlGkiAqlexWMBzCi4DcRoyiOsuLfW+cjlGWyExOw==", + "requires": {} + }, + "@redis/json": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@redis/json/-/json-1.0.7.tgz", + "integrity": "sha512-6UyXfjVaTBTJtKNG4/9Z8PSpKE6XgSyEb8iwaqDcy+uKrd/DGYHTWkUdnQDyzm727V7p21WUMhsqz5oy65kPcQ==", + "requires": {} + }, + "@redis/search": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@redis/search/-/search-1.2.0.tgz", + "integrity": "sha512-tYoDBbtqOVigEDMAcTGsRlMycIIjwMCgD8eR2t0NANeQmgK/lvxNAvYyb6bZDD4frHRhIHkJu2TBRvB0ERkOmw==", + "requires": {} + }, + "@redis/time-series": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-1.1.0.tgz", + "integrity": "sha512-c1Q99M5ljsIuc4YdaCwfUEXsofakb9c8+Zse2qxTadu8TalLXuAESzLvFAvNVbkmSlvlzIQOLpBCmWI9wTOt+g==", + "requires": {} + }, "@tiledesk/helpcenter-query-client": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/@tiledesk/helpcenter-query-client/-/helpcenter-query-client-0.1.8.tgz", @@ -6997,11 +7124,27 @@ "form-data": "^4.0.0" } }, + "denque": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz", + "integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==" + }, "dotenv": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==" }, + "redis": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/redis/-/redis-3.1.2.tgz", + "integrity": "sha512-grn5KoZLr/qrRQVwoSkmzdbw6pwF+/rwODtrOr6vuBRiR/f3rjSTGupbF90Zpqm2oenix8Do6RV7pYEkGwlKkw==", + "requires": { + "denque": "^1.5.0", + "redis-commands": "^1.7.0", + "redis-errors": "^1.2.0", + "redis-parser": "^3.0.0" + } + }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", @@ -7360,6 +7503,11 @@ } } }, + "cluster-key-slot": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", + "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==" + }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -7671,6 +7819,11 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, + "generic-pool": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", + "integrity": "sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==" + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -11467,21 +11620,16 @@ } }, "redis": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/redis/-/redis-3.1.2.tgz", - "integrity": "sha512-grn5KoZLr/qrRQVwoSkmzdbw6pwF+/rwODtrOr6vuBRiR/f3rjSTGupbF90Zpqm2oenix8Do6RV7pYEkGwlKkw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/redis/-/redis-4.7.0.tgz", + "integrity": "sha512-zvmkHEAdGMn+hMRXuMBtu4Vo5P6rHQjLoHftu+lBqq8ZTA3RCVC/WzD790bkKKiNFp7d5/9PcSD19fJyyRvOdQ==", "requires": { - "denque": "^1.5.0", - "redis-commands": "^1.7.0", - "redis-errors": "^1.2.0", - "redis-parser": "^3.0.0" - }, - "dependencies": { - "denque": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz", - "integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==" - } + "@redis/bloom": "1.2.0", + "@redis/client": "1.6.0", + "@redis/graph": "1.1.1", + "@redis/json": "1.0.7", + "@redis/search": "1.2.0", + "@redis/time-series": "1.1.0" } }, "redis-commands": { @@ -11832,6 +11980,11 @@ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, "yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", diff --git a/package.json b/package.json index 47708ec..7ce736b 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "minimist-string": "^1.0.2", "mongoose": "^6.6.1", "nanoid": "^3.3.4", - "redis": "^3.1.2", + "redis": "^4.7.0", "uuid": "^9.0.0", "vm2": "^3.9.13", "npm": "^6.14.11", diff --git a/tybotRoute/TdCache.js b/tybotRoute/TdCache.js index bbe7454..49b07be 100644 --- a/tybotRoute/TdCache.js +++ b/tybotRoute/TdCache.js @@ -21,10 +21,10 @@ class TdCache { * Connect redis client */ this.client = redis.createClient( - { - url: `redis://${this.redis_host}:${this.redis_port}`, - password: this.redis_password - }); + { + url: `redis://${this.redis_host}:${this.redis_port}`, + password: this.redis_password + }); this.client.on('error', err => { reject(err); if (callback) { From 1c27d679c121f1b9d378063a43421b83498597d4 Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Fri, 13 Dec 2024 11:51:30 +0100 Subject: [PATCH 08/25] log removed --- tybotRoute/index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tybotRoute/index.js b/tybotRoute/index.js index 0c91dd3..1688604 100644 --- a/tybotRoute/index.js +++ b/tybotRoute/index.js @@ -609,7 +609,7 @@ router.post('/block/:project_id/:bot_id/:block_id', async (req, res) => { async function startApp(settings, completionCallback) { console.log("Starting Tilebot..."); - console.log("Starting Tilebot with Settings:", settings); + // console.log("Starting Tilebot with Settings:", settings); if (settings.bots) { // static bots data source staticBots = settings.bots; } @@ -628,9 +628,6 @@ async function startApp(settings, completionCallback) { } if (settings.REDIS_HOST && settings.REDIS_PORT) { - console.log("startApp REDIS_HOST: ", settings.REDIS_HOST) - console.log("startApp REDIS_PORT: ", settings.REDIS_PORT) - console.log("startApp REDIS_PASSWORD: ", settings.REDIS_PASSWORD) tdcache = new TdCache({ host: settings.REDIS_HOST, port: settings.REDIS_PORT, @@ -705,7 +702,6 @@ async function startApp(settings, completionCallback) { } async function connectRedis() { - console.log("connectRedis tdcache: ", tdcache) if (tdcache) { try { console.log("(Tilebot) Connecting Redis..."); From ac65148134ba05dbe9bc0963d5e8a523146f3a9d Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Fri, 13 Dec 2024 14:51:34 +0100 Subject: [PATCH 09/25] version added: ### 1.0.1 --- CHANGELOG.md | 6 +++++- deploy.sh | 20 ++++++++++++++++++++ index.js | 14 ++++++++------ package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 deploy.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 64f0806..04a40f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ # Tiledesk native chatbot -### 0.1.1 updated MarckbotPlugs.js & DirectivesPlug.js \ No newline at end of file + +# 1.0.1 +- first deploy of Chatbot Plugs + +### 0.1.1 updated MarckbotPlugs.js & DirectivesPlug.js diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..0c3ec47 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,20 @@ +#npm version patch +version=`node -e 'console.log(require("./package.json").version)'` +echo "version $version" + +## Update package-lock.json +npm install + +## Push commit to git +git add . +git commit -m "version added: ### $version" +git push remote master + +## Create tag and npm +if [ "$version" != "" ]; then + git tag -a "$version" -m "`git log -1 --format=%s`" + echo "Created a new tag, $version" + git push --tags + cd ./tybotRoute + npm publish --access public +fi \ No newline at end of file diff --git a/index.js b/index.js index 4a778c8..a6f8a9e 100644 --- a/index.js +++ b/index.js @@ -4,16 +4,18 @@ var app = express(); var cors = require('cors'); app.use(cors()); -//const tybot = require("@tiledesk/tiledesk-tybot-connector"); +// const tybot = require("@tiledesk/tiledesk-tybot-connector"); const tybot = require("./tybotRoute"); -const templates = require("./templatesRoute"); -const chooser_bot = require("./chooserChatbotRoute"); const tybotRoute = tybot.router; -const templatesRoute = templates.router; -const chooserRoute = chooser_bot.router; app.use("/", tybotRoute); // /tybot + +const templates = require("./templatesRoute"); +const templatesRoute = templates.router; app.use("/chatbots", templatesRoute); -app.use("/langbot", chooserRoute); + +// const chooser_bot = require("./chooserChatbotRoute"); +// const chooserRoute = chooser_bot.router; +// app.use("/langbot", chooserRoute); // TEMP // const bots_data = require('./tybotRoute/test/conversation-actions_bot.js').bots_data; diff --git a/package-lock.json b/package-lock.json index ef93319..b2517bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.0", + "version": "1.0.1", "license": "ISC", "dependencies": { "@tiledesk/helpcenter-query-client": "^0.1.8", diff --git a/package.json b/package.json index 7ce736b..b391cc2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.0", + "version": "1.0.1", "description": "", "main": "index.js", "scripts": { From 9d6d9e4c0e842191359d1718328473933ac1b693 Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Fri, 13 Dec 2024 14:55:12 +0100 Subject: [PATCH 10/25] # v0.2.138-rc6 --- tybotRoute/CHANGELOG.md | 3 +++ tybotRoute/package-lock.json | 4 ++-- tybotRoute/package.json | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tybotRoute/CHANGELOG.md b/tybotRoute/CHANGELOG.md index a350dbd..0b2be0c 100644 --- a/tybotRoute/CHANGELOG.md +++ b/tybotRoute/CHANGELOG.md @@ -17,6 +17,9 @@ available on: - Added flowError on JSONCondition when result = null - Added fix on Filler --> +# v0.2.138-rc6 +- First deploy external + # v0.2.138-rc1 - Updated redis to 4.7.0 - Updated tdCache diff --git a/tybotRoute/package-lock.json b/tybotRoute/package-lock.json index 54f73e5..59bb09e 100644 --- a/tybotRoute/package-lock.json +++ b/tybotRoute/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.138-rc5", + "version": "0.2.138-rc6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.138-rc5", + "version": "0.2.138-rc6", "license": "ISC", "dependencies": { "@tiledesk/helpcenter-query-client": "^0.1.8", diff --git a/tybotRoute/package.json b/tybotRoute/package.json index b565ae3..1d91919 100644 --- a/tybotRoute/package.json +++ b/tybotRoute/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.138-rc5", + "version": "0.2.138-rc6", "description": "Tiledesk Tybot connector", "main": "index.js", "scripts": { From 4f901081b831b9a9e6764b335241edc696f8ac6b Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Wed, 18 Dec 2024 18:45:45 +0100 Subject: [PATCH 11/25] # 1.0.2 --- CHANGELOG.md | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04a40f4..d10ad87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Tiledesk native chatbot +# 1.0.2 +- bug-fixed: default engine for DirAskGPTV2 +- bug-fixed: block only hidden message + # 1.0.1 - first deploy of Chatbot Plugs diff --git a/package-lock.json b/package-lock.json index b2517bf..0777b7b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.1", + "version": "1.0.2", "license": "ISC", "dependencies": { "@tiledesk/helpcenter-query-client": "^0.1.8", diff --git a/package.json b/package.json index b391cc2..f33e677 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.1", + "version": "1.0.2", "description": "", "main": "index.js", "scripts": { From 81d3efcf1de18ddf1f08d499c55d71f3678bca10 Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Wed, 18 Dec 2024 18:48:20 +0100 Subject: [PATCH 12/25] 0.2.138-rc7 --- tybotRoute/package-lock.json | 4 ++-- tybotRoute/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tybotRoute/package-lock.json b/tybotRoute/package-lock.json index 6d75463..575d021 100644 --- a/tybotRoute/package-lock.json +++ b/tybotRoute/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.138-rc6", + "version": "0.2.138-rc7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.138-rc6", + "version": "0.2.138-rc7", "license": "ISC", "dependencies": { "@tiledesk/helpcenter-query-client": "^0.1.8", diff --git a/tybotRoute/package.json b/tybotRoute/package.json index 54a39d1..48551c1 100644 --- a/tybotRoute/package.json +++ b/tybotRoute/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.138-rc6", + "version": "0.2.138-rc7", "description": "Tiledesk Tybot connector", "main": "index.js", "scripts": { From e97e8ec45aa39df663282dc70981c8163be2490f Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Thu, 19 Dec 2024 09:44:43 +0100 Subject: [PATCH 13/25] redis upgraded to v4 --- tybotRoute/TdCache.js | 8 +- tybotRoute/index.js | 2 +- tybotRoute/package-lock.json | 217 ++++++++++++++++++++++------------- tybotRoute/package.json | 2 +- 4 files changed, 144 insertions(+), 85 deletions(-) diff --git a/tybotRoute/TdCache.js b/tybotRoute/TdCache.js index bbe7454..49b07be 100644 --- a/tybotRoute/TdCache.js +++ b/tybotRoute/TdCache.js @@ -21,10 +21,10 @@ class TdCache { * Connect redis client */ this.client = redis.createClient( - { - url: `redis://${this.redis_host}:${this.redis_port}`, - password: this.redis_password - }); + { + url: `redis://${this.redis_host}:${this.redis_port}`, + password: this.redis_password + }); this.client.on('error', err => { reject(err); if (callback) { diff --git a/tybotRoute/index.js b/tybotRoute/index.js index 74fd9d9..1688604 100644 --- a/tybotRoute/index.js +++ b/tybotRoute/index.js @@ -4,7 +4,7 @@ const bodyParser = require('body-parser'); const { TiledeskClient } = require('@tiledesk/tiledesk-client'); const { ExtApi } = require('./ExtApi.js'); const { ExtUtil } = require('./ExtUtil.js'); -const { TdCache } = require('./TdCache_v3.js'); +const { TdCache } = require('./TdCache.js'); const { TiledeskChatbot } = require('./models/TiledeskChatbot.js'); const { MongodbBotsDataSource } = require('./models/MongodbBotsDataSource.js'); // const { MongodbIntentsMachine } = require('./models/MongodbIntentsMachine.js'); diff --git a/tybotRoute/package-lock.json b/tybotRoute/package-lock.json index 575d021..581f388 100644 --- a/tybotRoute/package-lock.json +++ b/tybotRoute/package-lock.json @@ -27,7 +27,7 @@ "mongoose": "^6.3.5", "multer": "^1.4.5-lts.1", "nanoid": "^3.1.25", - "redis": "^3.1.2", + "redis": "^4.7.0", "uuid": "^3.3.3", "vm2": "^3.9.13" }, @@ -35,6 +35,59 @@ "mocha": "^8.4.0" } }, + "node_modules/@redis/bloom": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-1.2.0.tgz", + "integrity": "sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/client": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@redis/client/-/client-1.6.0.tgz", + "integrity": "sha512-aR0uffYI700OEEH4gYnitAnv3vzVGXCFvYfdpu/CJKvk4pHfLPEy/JSZyrpQ+15WhXe1yJRXLtfQ84s4mEXnPg==", + "dependencies": { + "cluster-key-slot": "1.1.2", + "generic-pool": "3.9.0", + "yallist": "4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@redis/graph": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@redis/graph/-/graph-1.1.1.tgz", + "integrity": "sha512-FEMTcTHZozZciLRl6GiiIB4zGm5z5F3F6a6FZCyrfxdKOhFlGkiAqlexWMBzCi4DcRoyiOsuLfW+cjlGWyExOw==", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/json": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@redis/json/-/json-1.0.7.tgz", + "integrity": "sha512-6UyXfjVaTBTJtKNG4/9Z8PSpKE6XgSyEb8iwaqDcy+uKrd/DGYHTWkUdnQDyzm727V7p21WUMhsqz5oy65kPcQ==", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/search": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@redis/search/-/search-1.2.0.tgz", + "integrity": "sha512-tYoDBbtqOVigEDMAcTGsRlMycIIjwMCgD8eR2t0NANeQmgK/lvxNAvYyb6bZDD4frHRhIHkJu2TBRvB0ERkOmw==", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, + "node_modules/@redis/time-series": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-1.1.0.tgz", + "integrity": "sha512-c1Q99M5ljsIuc4YdaCwfUEXsofakb9c8+Zse2qxTadu8TalLXuAESzLvFAvNVbkmSlvlzIQOLpBCmWI9wTOt+g==", + "peerDependencies": { + "@redis/client": "^1.0.0" + } + }, "node_modules/@tiledesk/helpcenter-query-client": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/@tiledesk/helpcenter-query-client/-/helpcenter-query-client-0.1.8.tgz", @@ -637,6 +690,14 @@ "node": ">=8" } }, + "node_modules/cluster-key-slot": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", + "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1132,6 +1193,14 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, + "node_modules/generic-pool": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", + "integrity": "sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==", + "engines": { + "node": ">= 4" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -2416,53 +2485,16 @@ } }, "node_modules/redis": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/redis/-/redis-3.1.2.tgz", - "integrity": "sha512-grn5KoZLr/qrRQVwoSkmzdbw6pwF+/rwODtrOr6vuBRiR/f3rjSTGupbF90Zpqm2oenix8Do6RV7pYEkGwlKkw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/redis/-/redis-4.7.0.tgz", + "integrity": "sha512-zvmkHEAdGMn+hMRXuMBtu4Vo5P6rHQjLoHftu+lBqq8ZTA3RCVC/WzD790bkKKiNFp7d5/9PcSD19fJyyRvOdQ==", "dependencies": { - "denque": "^1.5.0", - "redis-commands": "^1.7.0", - "redis-errors": "^1.2.0", - "redis-parser": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-redis" - } - }, - "node_modules/redis-commands": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.7.0.tgz", - "integrity": "sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ==" - }, - "node_modules/redis-errors": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", - "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", - "engines": { - "node": ">=4" - } - }, - "node_modules/redis-parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", - "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", - "dependencies": { - "redis-errors": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/redis/node_modules/denque": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz", - "integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==", - "engines": { - "node": ">=0.10" + "@redis/bloom": "1.2.0", + "@redis/client": "1.6.0", + "@redis/graph": "1.1.1", + "@redis/json": "1.0.7", + "@redis/search": "1.2.0", + "@redis/time-series": "1.1.0" } }, "node_modules/reinterval": { @@ -3250,6 +3282,46 @@ } }, "dependencies": { + "@redis/bloom": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-1.2.0.tgz", + "integrity": "sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==", + "requires": {} + }, + "@redis/client": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@redis/client/-/client-1.6.0.tgz", + "integrity": "sha512-aR0uffYI700OEEH4gYnitAnv3vzVGXCFvYfdpu/CJKvk4pHfLPEy/JSZyrpQ+15WhXe1yJRXLtfQ84s4mEXnPg==", + "requires": { + "cluster-key-slot": "1.1.2", + "generic-pool": "3.9.0", + "yallist": "4.0.0" + } + }, + "@redis/graph": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@redis/graph/-/graph-1.1.1.tgz", + "integrity": "sha512-FEMTcTHZozZciLRl6GiiIB4zGm5z5F3F6a6FZCyrfxdKOhFlGkiAqlexWMBzCi4DcRoyiOsuLfW+cjlGWyExOw==", + "requires": {} + }, + "@redis/json": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@redis/json/-/json-1.0.7.tgz", + "integrity": "sha512-6UyXfjVaTBTJtKNG4/9Z8PSpKE6XgSyEb8iwaqDcy+uKrd/DGYHTWkUdnQDyzm727V7p21WUMhsqz5oy65kPcQ==", + "requires": {} + }, + "@redis/search": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@redis/search/-/search-1.2.0.tgz", + "integrity": "sha512-tYoDBbtqOVigEDMAcTGsRlMycIIjwMCgD8eR2t0NANeQmgK/lvxNAvYyb6bZDD4frHRhIHkJu2TBRvB0ERkOmw==", + "requires": {} + }, + "@redis/time-series": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-1.1.0.tgz", + "integrity": "sha512-c1Q99M5ljsIuc4YdaCwfUEXsofakb9c8+Zse2qxTadu8TalLXuAESzLvFAvNVbkmSlvlzIQOLpBCmWI9wTOt+g==", + "requires": {} + }, "@tiledesk/helpcenter-query-client": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/@tiledesk/helpcenter-query-client/-/helpcenter-query-client-0.1.8.tgz", @@ -3727,6 +3799,11 @@ } } }, + "cluster-key-slot": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", + "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==" + }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -4100,6 +4177,11 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, + "generic-pool": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", + "integrity": "sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==" + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -5071,39 +5153,16 @@ } }, "redis": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/redis/-/redis-3.1.2.tgz", - "integrity": "sha512-grn5KoZLr/qrRQVwoSkmzdbw6pwF+/rwODtrOr6vuBRiR/f3rjSTGupbF90Zpqm2oenix8Do6RV7pYEkGwlKkw==", - "requires": { - "denque": "^1.5.0", - "redis-commands": "^1.7.0", - "redis-errors": "^1.2.0", - "redis-parser": "^3.0.0" - }, - "dependencies": { - "denque": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz", - "integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==" - } - } - }, - "redis-commands": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.7.0.tgz", - "integrity": "sha512-nJWqw3bTFy21hX/CPKHth6sfhZbdiHP6bTawSgQBlKOVRG7EZkfHbbHwQJnrE4vsQf0CMNE+3gJ4Fmm16vdVlQ==" - }, - "redis-errors": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", - "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==" - }, - "redis-parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", - "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/redis/-/redis-4.7.0.tgz", + "integrity": "sha512-zvmkHEAdGMn+hMRXuMBtu4Vo5P6rHQjLoHftu+lBqq8ZTA3RCVC/WzD790bkKKiNFp7d5/9PcSD19fJyyRvOdQ==", "requires": { - "redis-errors": "^1.0.0" + "@redis/bloom": "1.2.0", + "@redis/client": "1.6.0", + "@redis/graph": "1.1.1", + "@redis/json": "1.0.7", + "@redis/search": "1.2.0", + "@redis/time-series": "1.1.0" } }, "reinterval": { diff --git a/tybotRoute/package.json b/tybotRoute/package.json index 48551c1..4f92920 100644 --- a/tybotRoute/package.json +++ b/tybotRoute/package.json @@ -29,7 +29,7 @@ "mongoose": "^6.3.5", "multer": "^1.4.5-lts.1", "nanoid": "^3.1.25", - "redis": "^3.1.2", + "redis": "^4.7.0", "uuid": "^3.3.3", "vm2": "^3.9.13" }, From 60c1a6d1a6968a29fffb7bc0d1d20111c17d6b9a Mon Sep 17 00:00:00 2001 From: Gabriele Panico Date: Thu, 19 Dec 2024 09:46:28 +0100 Subject: [PATCH 14/25] # v0.2.138-rc8 --- tybotRoute/CHANGELOG.md | 4 ++++ tybotRoute/package-lock.json | 4 ++-- tybotRoute/package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tybotRoute/CHANGELOG.md b/tybotRoute/CHANGELOG.md index 0b2be0c..059eae7 100644 --- a/tybotRoute/CHANGELOG.md +++ b/tybotRoute/CHANGELOG.md @@ -17,6 +17,10 @@ available on: - Added flowError on JSONCondition when result = null - Added fix on Filler --> +# v0.2.138-rc8 +- Updated redis to 4.7.0 +- Updated tdCache + # v0.2.138-rc6 - First deploy external diff --git a/tybotRoute/package-lock.json b/tybotRoute/package-lock.json index 581f388..3193f2e 100644 --- a/tybotRoute/package-lock.json +++ b/tybotRoute/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.138-rc7", + "version": "0.2.138-rc8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.138-rc7", + "version": "0.2.138-rc8", "license": "ISC", "dependencies": { "@tiledesk/helpcenter-query-client": "^0.1.8", diff --git a/tybotRoute/package.json b/tybotRoute/package.json index 4f92920..3477c37 100644 --- a/tybotRoute/package.json +++ b/tybotRoute/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.138-rc7", + "version": "0.2.138-rc8", "description": "Tiledesk Tybot connector", "main": "index.js", "scripts": { From 1d80028e903564eb277174379da1b9ef4a4eefd9 Mon Sep 17 00:00:00 2001 From: Giovanni Troisi Date: Thu, 2 Jan 2025 17:08:03 +0100 Subject: [PATCH 15/25] improved ReplaceBotV2 action --- .../directives/DirReplaceBotV2.js | 138 +++++++++++++++--- 1 file changed, 118 insertions(+), 20 deletions(-) diff --git a/tybotRoute/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js b/tybotRoute/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js index 504b1d7..30d35be 100644 --- a/tybotRoute/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js +++ b/tybotRoute/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js @@ -2,6 +2,9 @@ const { TiledeskClient } = require('@tiledesk/tiledesk-client'); const { TiledeskChatbot } = require('../../models/TiledeskChatbot'); const { Filler } = require('../Filler'); +const axios = require("axios").default; +let https = require("https"); + class DirReplaceBotV2 { constructor(context) { @@ -52,30 +55,125 @@ class DirReplaceBotV2 { ); const filler = new Filler(); botName = filler.fill(botName, variables); - this.tdClient.replaceBotByName(this.requestId, botName, () => { - if (blockName) { - if (this.log) {console.log("Sending hidden /start message to bot in dept");} - const message = { - type: "text", - text: "/" + blockName, - attributes : { - subtype: "info" + + const HTTPREQUEST = { + url: this.API_ENDPOINT + "/" + this.context.projectId + "/requests/" + this.requestId + "/replace", + headers: { + 'Content-Type': 'application/json', + 'Authorization': 'JWT ' + this.context.token + }, + json: { name: botName}, + method: 'PUT' + } + + this.#myrequest( + HTTPREQUEST, async (err, resbody) => { + if (err) { + console.log("DirReplaceBot error: ", err); + if (callback) { + callback(); + return; } } - this.tdClient.sendSupportMessage( - this.requestId, - message, (err) => { - if (err) { - console.error("Error sending hidden message:", err.message); + + if (this.log) { console.log("DirReplaceBot replace resbody: ", resbody) }; + if (blockName) { + if (this.log) { console.log("Sending hidden /start message to bot in dept"); } + const message = { + type: "text", + text: "/" + blockName, + attributes: { + subtype: "info" } - if (this.log) {console.log("Hidden message sent.");} - callback(); - }); - } - else { - callback(); + } + this.tdClient.sendSupportMessage( + this.requestId, + message, (err) => { + if (err) { + console.error("Error sending hidden message:", err.message); + } + if (this.log) { console.log("Hidden message sent."); } + callback(); + }); + } + else { + callback(); + } } - }); + ) + + // this.tdClient.replaceBotByName(this.requestId, botName, () => { + // if (blockName) { + // if (this.log) {console.log("Sending hidden /start message to bot in dept");} + // const message = { + // type: "text", + // text: "/" + blockName, + // attributes : { + // subtype: "info" + // } + // } + // this.tdClient.sendSupportMessage( + // this.requestId, + // message, (err) => { + // if (err) { + // console.error("Error sending hidden message:", err.message); + // } + // if (this.log) {console.log("Hidden message sent.");} + // callback(); + // }); + // } + // else { + // callback(); + // } + // }); + } + + #myrequest(options, callback) { + if (this.log) { + console.log("API URL:", options.url); + console.log("** Options:", JSON.stringify(options)); + } + let axios_options = { + url: options.url, + method: options.method, + params: options.params, + headers: options.headers + } + if (options.json !== null) { + axios_options.data = options.json + } + if (this.log) { + console.log("axios_options:", JSON.stringify(axios_options)); + } + if (options.url.startsWith("https:")) { + const httpsAgent = new https.Agent({ + rejectUnauthorized: false, + }); + axios_options.httpsAgent = httpsAgent; + } + axios(axios_options) + .then((res) => { + if (this.log) { + console.log("Response for url:", options.url); + console.log("Response headers:\n", JSON.stringify(res.headers)); + } + if (res && res.status == 200 && res.data) { + if (callback) { + callback(null, res.data); + } + } + else { + if (callback) { + callback(new Error("Response status is not 200"), null); + } + } + }) + .catch((error) => { + console.error("(DirAskGPT) Axios error: ", JSON.stringify(error)); + if (callback) { + callback(error, null); + } + }); } } From 357163c3b4d2e74079e08a1f8f6b1db533681f3c Mon Sep 17 00:00:00 2001 From: Giovanni Troisi Date: Thu, 2 Jan 2025 17:58:44 +0100 Subject: [PATCH 16/25] updated CHANGELOG --- tybotRoute/CHANGELOG.md | 3 +++ tybotRoute/package-lock.json | 4 ++-- tybotRoute/package.json | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tybotRoute/CHANGELOG.md b/tybotRoute/CHANGELOG.md index 09996ba..e667f1d 100644 --- a/tybotRoute/CHANGELOG.md +++ b/tybotRoute/CHANGELOG.md @@ -17,6 +17,9 @@ available on: - Added flowError on JSONCondition when result = null - Added fix on Filler --> +# v0.2.139-rc1 +- Improved ReplaceBotV2 + # v0.2.138 - Bug-fixed: hiddenMessage not blocked - Bug-fixed: DirAskGPTV2 has hardcoded engine diff --git a/tybotRoute/package-lock.json b/tybotRoute/package-lock.json index d5c6639..7ffe1de 100644 --- a/tybotRoute/package-lock.json +++ b/tybotRoute/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.138", + "version": "0.2.139-rc1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.138", + "version": "0.2.139-rc1", "license": "ISC", "dependencies": { "@tiledesk/helpcenter-query-client": "^0.1.8", diff --git a/tybotRoute/package.json b/tybotRoute/package.json index 1cd8c94..6a4a40e 100644 --- a/tybotRoute/package.json +++ b/tybotRoute/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.138", + "version": "0.2.139-rc1", "description": "Tiledesk Tybot connector", "main": "index.js", "scripts": { From a29184acb9cc6d914bafdd3dcc024420788d12e3 Mon Sep 17 00:00:00 2001 From: Giovanni Troisi Date: Fri, 3 Jan 2025 09:46:33 +0100 Subject: [PATCH 17/25] version added: ### 1.0.3 --- deploy.sh | 0 package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 deploy.sh diff --git a/deploy.sh b/deploy.sh old mode 100644 new mode 100755 diff --git a/package-lock.json b/package-lock.json index 0777b7b..d4f6eb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.2", + "version": "1.0.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.2", + "version": "1.0.3", "license": "ISC", "dependencies": { "@tiledesk/helpcenter-query-client": "^0.1.8", diff --git a/package.json b/package.json index f33e677..b3ef9f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.2", + "version": "1.0.3", "description": "", "main": "index.js", "scripts": { From 13abd55556693c2615f0d07f61af881e2c57baf6 Mon Sep 17 00:00:00 2001 From: Giovanni Troisi Date: Fri, 3 Jan 2025 09:47:10 +0100 Subject: [PATCH 18/25] version added: ### 1.0.3 --- tybotRoute/package-lock.json | 4 ++-- tybotRoute/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tybotRoute/package-lock.json b/tybotRoute/package-lock.json index 6916209..6350747 100644 --- a/tybotRoute/package-lock.json +++ b/tybotRoute/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.139-rc1", + "version": "0.2.139-rc2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.139-rc1", + "version": "0.2.139-rc2", "license": "ISC", "dependencies": { "@tiledesk/helpcenter-query-client": "^0.1.8", diff --git a/tybotRoute/package.json b/tybotRoute/package.json index 9a49a9d..86f5319 100644 --- a/tybotRoute/package.json +++ b/tybotRoute/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.139-rc1", + "version": "0.2.139-rc2", "description": "Tiledesk Tybot connector", "main": "index.js", "scripts": { From f50760f32ac015ceb6cdd144f7a786beb3d326f2 Mon Sep 17 00:00:00 2001 From: Giovanni Troisi Date: Fri, 3 Jan 2025 09:49:06 +0100 Subject: [PATCH 19/25] version added: ### 1.0.4 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d4f6eb2..0b8737a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.3", + "version": "1.0.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.3", + "version": "1.0.4", "license": "ISC", "dependencies": { "@tiledesk/helpcenter-query-client": "^0.1.8", diff --git a/package.json b/package.json index b3ef9f8..83210cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.3", + "version": "1.0.4", "description": "", "main": "index.js", "scripts": { From 3fb34f3083ad1df332c452b10f2d623e6ba2f515 Mon Sep 17 00:00:00 2001 From: Giovanni Troisi Date: Fri, 3 Jan 2025 17:20:51 +0100 Subject: [PATCH 20/25] updated ReplaceBotV2 with slug --- .../tiledeskChatbotPlugs/directives/DirReplaceBotV2.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tybotRoute/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js b/tybotRoute/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js index 30d35be..44bb5f6 100644 --- a/tybotRoute/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js +++ b/tybotRoute/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js @@ -56,13 +56,20 @@ class DirReplaceBotV2 { const filler = new Filler(); botName = filler.fill(botName, variables); + let data; + if (action.nameAsSlug && action.nameAsSlug === true) { + data.slug = botName; + } else { + data.name = botName; + } + const HTTPREQUEST = { url: this.API_ENDPOINT + "/" + this.context.projectId + "/requests/" + this.requestId + "/replace", headers: { 'Content-Type': 'application/json', 'Authorization': 'JWT ' + this.context.token }, - json: { name: botName}, + json: data, method: 'PUT' } From 2a6dcd4687736de7ae7ca8caaa30b3907069c50f Mon Sep 17 00:00:00 2001 From: Giovanni Troisi Date: Fri, 3 Jan 2025 17:22:51 +0100 Subject: [PATCH 21/25] updated package.json version updated CHANGELOG --- tybotRoute/CHANGELOG.md | 3 +++ tybotRoute/package-lock.json | 4 ++-- tybotRoute/package.json | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tybotRoute/CHANGELOG.md b/tybotRoute/CHANGELOG.md index e667f1d..e414ad4 100644 --- a/tybotRoute/CHANGELOG.md +++ b/tybotRoute/CHANGELOG.md @@ -17,6 +17,9 @@ available on: - Added flowError on JSONCondition when result = null - Added fix on Filler --> +# v0.2.139-rc3 +- Improved ReplaceBotV2 with slug option + # v0.2.139-rc1 - Improved ReplaceBotV2 diff --git a/tybotRoute/package-lock.json b/tybotRoute/package-lock.json index 7ffe1de..283db9e 100644 --- a/tybotRoute/package-lock.json +++ b/tybotRoute/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.139-rc1", + "version": "0.2.139-rc3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.139-rc1", + "version": "0.2.139-rc3", "license": "ISC", "dependencies": { "@tiledesk/helpcenter-query-client": "^0.1.8", diff --git a/tybotRoute/package.json b/tybotRoute/package.json index 6a4a40e..2bdd3d2 100644 --- a/tybotRoute/package.json +++ b/tybotRoute/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.139-rc1", + "version": "0.2.139-rc3", "description": "Tiledesk Tybot connector", "main": "index.js", "scripts": { From e35d27e2b3f4c4047cf7f0c1d794611f0e4a5d4a Mon Sep 17 00:00:00 2001 From: Giovanni Troisi Date: Fri, 3 Jan 2025 17:37:55 +0100 Subject: [PATCH 22/25] updated external package.json version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0b8737a..af1e222 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.4", + "version": "1.0.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.4", + "version": "1.0.5", "license": "ISC", "dependencies": { "@tiledesk/helpcenter-query-client": "^0.1.8", diff --git a/package.json b/package.json index 83210cc..d532f2b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.4", + "version": "1.0.5", "description": "", "main": "index.js", "scripts": { From e7233955b09de22ad7baa9a505d7107c895ecc7c Mon Sep 17 00:00:00 2001 From: Giovanni Troisi Date: Wed, 8 Jan 2025 14:56:37 +0100 Subject: [PATCH 23/25] fix undefined data error in ReplaceBotV2 --- tybotRoute/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tybotRoute/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js b/tybotRoute/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js index 44bb5f6..aee2a57 100644 --- a/tybotRoute/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js +++ b/tybotRoute/tiledeskChatbotPlugs/directives/DirReplaceBotV2.js @@ -56,7 +56,7 @@ class DirReplaceBotV2 { const filler = new Filler(); botName = filler.fill(botName, variables); - let data; + let data = {}; if (action.nameAsSlug && action.nameAsSlug === true) { data.slug = botName; } else { From ad1a5af8add352ca85e5f6fbfa27cb8607797243 Mon Sep 17 00:00:00 2001 From: Giovanni Troisi Date: Wed, 8 Jan 2025 14:57:18 +0100 Subject: [PATCH 24/25] updated package.json version --- tybotRoute/package-lock.json | 4 ++-- tybotRoute/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tybotRoute/package-lock.json b/tybotRoute/package-lock.json index 283db9e..dd1a78a 100644 --- a/tybotRoute/package-lock.json +++ b/tybotRoute/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.139-rc3", + "version": "0.2.139-rc4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.139-rc3", + "version": "0.2.139-rc4", "license": "ISC", "dependencies": { "@tiledesk/helpcenter-query-client": "^0.1.8", diff --git a/tybotRoute/package.json b/tybotRoute/package.json index 2bdd3d2..dcbda99 100644 --- a/tybotRoute/package.json +++ b/tybotRoute/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-tybot-connector", - "version": "0.2.139-rc3", + "version": "0.2.139-rc4", "description": "Tiledesk Tybot connector", "main": "index.js", "scripts": { From a216f6d70ce09d69c9f23732c501df6c6841682b Mon Sep 17 00:00:00 2001 From: Giovanni Troisi Date: Wed, 8 Jan 2025 15:00:34 +0100 Subject: [PATCH 25/25] updated package.json version to 1.0.6 --- package-lock.json | 26 +++++++++++++++++++------- package.json | 2 +- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index af1e222..adb49b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.5", + "version": "1.0.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.5", + "version": "1.0.6", "license": "ISC", "dependencies": { "@tiledesk/helpcenter-query-client": "^0.1.8", @@ -4121,6 +4121,7 @@ }, "node_modules/npm/node_modules/lodash._baseindexof": { "version": "3.1.0", + "extraneous": true, "inBundle": true, "license": "MIT" }, @@ -4135,16 +4136,19 @@ }, "node_modules/npm/node_modules/lodash._bindcallback": { "version": "3.0.1", + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/lodash._cacheindexof": { "version": "3.0.2", + "extraneous": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/lodash._createcache": { "version": "3.1.2", + "extraneous": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -4158,6 +4162,7 @@ }, "node_modules/npm/node_modules/lodash._getnative": { "version": "3.9.1", + "extraneous": true, "inBundle": true, "license": "MIT" }, @@ -4173,6 +4178,7 @@ }, "node_modules/npm/node_modules/lodash.restparam": { "version": "3.6.1", + "extraneous": true, "inBundle": true, "license": "MIT" }, @@ -9950,7 +9956,8 @@ }, "lodash._baseindexof": { "version": "3.1.0", - "bundled": true + "bundled": true, + "extraneous": true }, "lodash._baseuniq": { "version": "4.6.0", @@ -9962,15 +9969,18 @@ }, "lodash._bindcallback": { "version": "3.0.1", - "bundled": true + "bundled": true, + "extraneous": true }, "lodash._cacheindexof": { "version": "3.0.2", - "bundled": true + "bundled": true, + "extraneous": true }, "lodash._createcache": { "version": "3.1.2", "bundled": true, + "extraneous": true, "requires": { "lodash._getnative": "^3.0.0" } @@ -9981,7 +9991,8 @@ }, "lodash._getnative": { "version": "3.9.1", - "bundled": true + "bundled": true, + "extraneous": true }, "lodash._root": { "version": "3.0.1", @@ -9993,7 +10004,8 @@ }, "lodash.restparam": { "version": "3.6.1", - "bundled": true + "bundled": true, + "extraneous": true }, "lodash.union": { "version": "4.6.0", diff --git a/package.json b/package.json index d532f2b..c2acf09 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tiledesk/tiledesk-chatbot", - "version": "1.0.5", + "version": "1.0.6", "description": "", "main": "index.js", "scripts": {