From 1d8bd500b56099f2195efa7e4a6e4595c259a67f Mon Sep 17 00:00:00 2001 From: shreyvishal Date: Tue, 9 Apr 2024 04:07:20 +0530 Subject: [PATCH 1/4] Added: Static Map Code --- controllers/Bot.js | 19 +++++++++++++++++-- server.js | 9 +++++++-- services/Actions.js | 25 ++++++++++++++++++++++++- 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/controllers/Bot.js b/controllers/Bot.js index eb68ad2..9a869f0 100644 --- a/controllers/Bot.js +++ b/controllers/Bot.js @@ -376,8 +376,23 @@ async function process_action(action, text, session, sender=null, format='applic return response; } - + async function downloadFile (req, res) { + try{ + const url = "https://maps.googleapis.com/maps/api/staticmap?size=300x300&path=enc:yrpqF`|x_SoFxgCwfApWyeBqkCa`Cq\_pHk`@qiLji@iuUo|@qoZaHwiRdFmgS|g@_dQn^eoXzy@ynO}AicKao@swPwjCo}U{vGofLceCwsEwzAuhFmdF{tNqoAg`PoKgoVngEgzLrm@}`FppB_mJgGsqD_zAanK{hDiyDshAqaEqdAwzBrf@izHao@ksAmjEikCeQmzHh_JocFnwEefDjeGswFtuCk|Tz~AavDllBosEfiAefInk@sfOd`FqlDhv@{yGwFivKuMmwM{{A}tEE{jF|m@guNpbTqoEncKibGpyIkqCh~K}hAhiKul@buAa`Bd`BwlBl~BsLz`JiwAlpTmoBnkOcu@h}N{oBb}YsNv}x@o~A`}VecAnrArf@zyImoDfnMacCtsGoyJpw^}nEjsGcwCxpIs^dzM|u@haQi}AjcP{vA|cNuiCdz_@ahGzyMwbCpjPpHh}b@gmCh}Ocn@d_R{aDthRwnCjrHsQl}IeyAlaPo|C|a@i{B`iAouFtJgjGuz@urAfdBwnEtiG{mBxLswEic@swBcFa`BmbA}dAxiAut@trAwcA}r@alB`eAm}@`rBeuD`t@sfI|o@{K{w@_o@`OjC|aBnc@jxB_o@`rAawBfr@{bDnpHamG`dNc{E`zJihJjr@i_Dm^}qCpk@swD`bCcdExjI}fHteM}vC`jIg|D|uDusIbuLefDvsFoqDdwH_y@`mBk_EsX_jFc`GcyAfd@eu@xyCctDhiEg_FrcHseFdxC{uEdeBiiBjqC_tDts@srLroAct@b{AcThpAiiBt]sx@viAkjHznHcjEjfDgpJ|bIs_F~_C}jBl`@|qAb{Ajy@zzI{w@zl@hHxy@az@o@r\le@n_@h|AWxzAeeA~`Eg`Dji@toAv[ay@~Pl^pGmi@vn@q^tFnc@duBqvAeXcIfw@uUbb@ayA}@}hC`~Bg_CdoCk{BjuDafAxcC`~@jaDlm@`eDyNr}Cyr@j{E}_CpoAqfDdxCw`CpcFqiCfhLasE~uJaaEdaD{hBtkDjQlmDjwBdoMb@|{Hv`MlqFfwDnoEdsEh~IeJftD{fDdzEksBpmHxAx}EnVlhIgz@f`DbZfwA|p@kmAfsB_`BpbAmc@~}AzmAoUdtAtjAl[xyAbqC~gA~eAxnBsHzfBuDldBnwAlk@kOfj@v{@pqAxzBrbEzdBhxBdYhmGmhGlhDm}BzaCo_G|[krBp_DuWp~DjgFreC~yBdrAquBpqE`_CxlAlpDd{AhtE_mCpcD~YdkDh_Cbx@~cC~`C&key=AIzaSyD1nA0k1OsFbmIAqD7N1nYrAI6CqkZbHDc" + const download_file_resp = await actionsService.download_file(url,path.join(__dirname,'../public')) + return res.status(200).json({ + status:true, + message:download_file_resp.message + }) + }catch(error){ + return res.status(400).json({ + status:false, + message:'Some Error Occured' + }) + } + } export default { process_wa_webhook, - process_text + process_text, + downloadFile } diff --git a/server.js b/server.js index d86d442..d6584b6 100644 --- a/server.js +++ b/server.js @@ -12,11 +12,16 @@ import { notify, triggerExceptionOnLocation } from './controllers/ControlCenter.js' +import path from 'path' +import { fileURLToPath } from 'url'; +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + const app = express() app.use(cors()) // parse application/x-www-form-urlencoded app.use(bodyParser.urlencoded({ extended: false })) - +app.use('/static', express.static(path.join(__dirname, 'public'))); // parse application/json app.use(bodyParser.json()) @@ -27,7 +32,7 @@ app.post('/notify', notify) app.post('/cancel-booking', cancelBooking) app.post('/update-catalog', updateCatalog) app.post('/trigger-exception', triggerExceptionOnLocation) - +app.get('/download', messageController.downloadFile); // Reset all sessions const db = new DBService() diff --git a/services/Actions.js b/services/Actions.js index 2d85ddf..11a9999 100644 --- a/services/Actions.js +++ b/services/Actions.js @@ -2,7 +2,8 @@ import twilio from 'twilio' import logger from '../utils/logger.js' import axios from 'axios' import AI from './AI.js' - +import {writeFileSync} from 'fs' +import path from 'path' const accountSid = process.env.TWILIO_ACCOUNT_SID const authToken = process.env.TWILIO_AUTH_TOKEN const twilioNumber = process.env.TWILIO_NUMBER @@ -123,6 +124,28 @@ class Actions { return false; } } + + async download_file(url, destination_path) { + try { + const response = await axios.get(url, 'GET',{responseType:'arraybuffer'}); + + const filePath = path.join(destination_path, 'downloaded-image.png'); + // const writer = createWriteStream(filePath); + console.log(Buffer.from(response.data)); + writeFileSync(filePath, response.data); + // response.data.pipe(writer); + // return new Promise((resolve, reject) => { + // writer.on('finish', resolve); + // writer.on('error', reject); + // }); + return { + message:'File downloaded successfully and saved at ' + filePath + } + } catch (error) { + logger.error(`Error sending message: ${error.message}`) + return false; + } + } } export default Actions From a8dcdba36490998cc37b980a4790e609c2d3f643 Mon Sep 17 00:00:00 2001 From: Mayur Virendra Date: Tue, 9 Apr 2024 05:09:28 +0530 Subject: [PATCH 2/4] Added static image url, added developer mode so the local code works fine --- .env.sample | 2 + .github/workflows/api_tests.yml | 2 + .github/workflows/deploy.yml | 3 + .github/workflows/lint_checks.yml | 3 + .github/workflows/unit_tests.yml | 3 + .gitignore | 3 + controllers/Bot.js | 30 +++---- server.js | 5 +- services/Actions.js | 116 ++++++++++++++++------------ tests/unit/controllers/bot.test.js | 6 +- tests/unit/services/actions.test.js | 1 + 11 files changed, 96 insertions(+), 78 deletions(-) diff --git a/.env.sample b/.env.sample index abc80ed..3df3238 100644 --- a/.env.sample +++ b/.env.sample @@ -9,3 +9,5 @@ TWILIO_NUMBER= TEST_RECEPIENT_NUMBER= STRAPI_TOURISM_TOKEN= GOOGLE_MAPS_API_KEY=your_api_key_here +SERVER_URL=http://13.201.62.138:3001 +DEVELOPER_MODE_ON=0 \ No newline at end of file diff --git a/.github/workflows/api_tests.yml b/.github/workflows/api_tests.yml index a162b70..fd84fed 100644 --- a/.github/workflows/api_tests.yml +++ b/.github/workflows/api_tests.yml @@ -25,6 +25,8 @@ jobs: echo "TEST_RECEPIENT_NUMBER=${{secrets.TEST_RECEPIENT_NUMBER}}" >> .env echo "STRAPI_TOURISM_TOKEN=${{secrets.STRAPI_TOURISM_TOKEN}}" >> .env echo "GOOGLE_MAPS_API_KEY=${{secrets.GOOGLE_MAPS_API_KEY}}" >> .env + echo "SERVER_URL=${{secrets.SERVER_URL}}" >> .env + echo "DEVELOPER_MODE_ON=${{secrets.DEVELOPER_MODE_ON}}" >> .env - name: Set up Node.js uses: actions/setup-node@v2 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fb21409..d4fcde1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -26,6 +26,9 @@ jobs: echo "TEST_RECEPIENT_NUMBER=${{secrets.TEST_RECEPIENT_NUMBER}}" >> .env echo "STRAPI_TOURISM_TOKEN=${{secrets.STRAPI_TOURISM_TOKEN}}" >> .env echo "GOOGLE_MAPS_API_KEY=${{secrets.GOOGLE_MAPS_API_KEY}}" >> .env + echo "SERVER_URL=${{secrets.SERVER_URL}}" >> .env + echo "DEVELOPER_MODE_ON=${{secrets.DEVELOPER_MODE_ON}}" >> .env + - name: Create SSH key file run: echo -e "${{ secrets.EC2_SSH_KEY }}" > ~/ec2_key env: diff --git a/.github/workflows/lint_checks.yml b/.github/workflows/lint_checks.yml index 6199017..34e1db1 100644 --- a/.github/workflows/lint_checks.yml +++ b/.github/workflows/lint_checks.yml @@ -25,6 +25,9 @@ jobs: echo "TEST_RECEPIENT_NUMBER=${{secrets.TEST_RECEPIENT_NUMBER}}" >> .env echo "STRAPI_TOURISM_TOKEN=${{secrets.STRAPI_TOURISM_TOKEN}}" >> .env echo "GOOGLE_MAPS_API_KEY=${{secrets.GOOGLE_MAPS_API_KEY}}" >> .env + echo "SERVER_URL=${{secrets.SERVER_URL}}" >> .env + echo "DEVELOPER_MODE_ON=${{secrets.DEVELOPER_MODE_ON}}" >> .env + - name: Set up Node.js uses: actions/setup-node@v2 with: diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 2a5bdea..1e426fe 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -25,6 +25,9 @@ jobs: echo "TEST_RECEPIENT_NUMBER=${{secrets.TEST_RECEPIENT_NUMBER}}" >> .env echo "STRAPI_TOURISM_TOKEN=${{secrets.STRAPI_TOURISM_TOKEN}}" >> .env echo "GOOGLE_MAPS_API_KEY=${{secrets.GOOGLE_MAPS_API_KEY}}" >> .env + echo "SERVER_URL=${{secrets.SERVER_URL}}" >> .env + echo "DEVELOPER_MODE_ON=${{secrets.DEVELOPER_MODE_ON}}" >> .env + - name: Set up Node.js uses: actions/setup-node@v2 with: diff --git a/.gitignore b/.gitignore index c48b9be..c8c4525 100644 --- a/.gitignore +++ b/.gitignore @@ -129,3 +129,6 @@ dist .yarn/install-state.gz .pnp.* .DS_Store + + +public/ \ No newline at end of file diff --git a/controllers/Bot.js b/controllers/Bot.js index 9a869f0..a9948b1 100644 --- a/controllers/Bot.js +++ b/controllers/Bot.js @@ -85,7 +85,8 @@ async function process_text(req, res) { let response= { raw: null, - formatted: null + formatted: null, + media:null }; const EMPTY_SESSION = { @@ -192,7 +193,12 @@ async function process_text(req, res) { session.selected_route = session.routes[index]; const url = `https://www.google.com/maps/dir/${session.selected_route.source_gps.lat},${session.selected_route.source_gps.lng}/${session.selected_route.destination_gps.lat},${session.selected_route.destination_gps.lng}/`; route_response.message = `Your route has been actived. Here is the link to navigate : ${url}. What do you want to do next?`; - + const map_image_url = await mapService.get_static_image_path([session.selected_route]); + if(map_image_url){ + const map_image_url_server = await actionsService.download_file(map_image_url); + logger.info(`Image url : ${map_image_url_server}`) + if(map_image_url_server) response.media=[map_image_url_server] + } } const formatting_response = await ai.format_response(route_response, [{ role: 'user', content: message },...session.text]); response.formatted = formatting_response.message; @@ -246,7 +252,7 @@ async function process_text(req, res) { // Send response if(format!='application/json'){ - await actionsService.send_message(sender, response.formatted) + await actionsService.send_message(sender, response.formatted, response.media || []) res.send("Done!") } else (raw_yn && response.raw) ? res.send(response.raw) : res.send(response.formatted) @@ -376,23 +382,7 @@ async function process_action(action, text, session, sender=null, format='applic return response; } - async function downloadFile (req, res) { - try{ - const url = "https://maps.googleapis.com/maps/api/staticmap?size=300x300&path=enc:yrpqF`|x_SoFxgCwfApWyeBqkCa`Cq\_pHk`@qiLji@iuUo|@qoZaHwiRdFmgS|g@_dQn^eoXzy@ynO}AicKao@swPwjCo}U{vGofLceCwsEwzAuhFmdF{tNqoAg`PoKgoVngEgzLrm@}`FppB_mJgGsqD_zAanK{hDiyDshAqaEqdAwzBrf@izHao@ksAmjEikCeQmzHh_JocFnwEefDjeGswFtuCk|Tz~AavDllBosEfiAefInk@sfOd`FqlDhv@{yGwFivKuMmwM{{A}tEE{jF|m@guNpbTqoEncKibGpyIkqCh~K}hAhiKul@buAa`Bd`BwlBl~BsLz`JiwAlpTmoBnkOcu@h}N{oBb}YsNv}x@o~A`}VecAnrArf@zyImoDfnMacCtsGoyJpw^}nEjsGcwCxpIs^dzM|u@haQi}AjcP{vA|cNuiCdz_@ahGzyMwbCpjPpHh}b@gmCh}Ocn@d_R{aDthRwnCjrHsQl}IeyAlaPo|C|a@i{B`iAouFtJgjGuz@urAfdBwnEtiG{mBxLswEic@swBcFa`BmbA}dAxiAut@trAwcA}r@alB`eAm}@`rBeuD`t@sfI|o@{K{w@_o@`OjC|aBnc@jxB_o@`rAawBfr@{bDnpHamG`dNc{E`zJihJjr@i_Dm^}qCpk@swD`bCcdExjI}fHteM}vC`jIg|D|uDusIbuLefDvsFoqDdwH_y@`mBk_EsX_jFc`GcyAfd@eu@xyCctDhiEg_FrcHseFdxC{uEdeBiiBjqC_tDts@srLroAct@b{AcThpAiiBt]sx@viAkjHznHcjEjfDgpJ|bIs_F~_C}jBl`@|qAb{Ajy@zzI{w@zl@hHxy@az@o@r\le@n_@h|AWxzAeeA~`Eg`Dji@toAv[ay@~Pl^pGmi@vn@q^tFnc@duBqvAeXcIfw@uUbb@ayA}@}hC`~Bg_CdoCk{BjuDafAxcC`~@jaDlm@`eDyNr}Cyr@j{E}_CpoAqfDdxCw`CpcFqiCfhLasE~uJaaEdaD{hBtkDjQlmDjwBdoMb@|{Hv`MlqFfwDnoEdsEh~IeJftD{fDdzEksBpmHxAx}EnVlhIgz@f`DbZfwA|p@kmAfsB_`BpbAmc@~}AzmAoUdtAtjAl[xyAbqC~gA~eAxnBsHzfBuDldBnwAlk@kOfj@v{@pqAxzBrbEzdBhxBdYhmGmhGlhDm}BzaCo_G|[krBp_DuWp~DjgFreC~yBdrAquBpqE`_CxlAlpDd{AhtE_mCpcD~YdkDh_Cbx@~cC~`C&key=AIzaSyD1nA0k1OsFbmIAqD7N1nYrAI6CqkZbHDc" - const download_file_resp = await actionsService.download_file(url,path.join(__dirname,'../public')) - return res.status(200).json({ - status:true, - message:download_file_resp.message - }) - }catch(error){ - return res.status(400).json({ - status:false, - message:'Some Error Occured' - }) - } - } export default { process_wa_webhook, - process_text, - downloadFile + process_text } diff --git a/server.js b/server.js index d6584b6..18ce7f5 100644 --- a/server.js +++ b/server.js @@ -19,10 +19,8 @@ const __dirname = path.dirname(__filename); const app = express() app.use(cors()) -// parse application/x-www-form-urlencoded app.use(bodyParser.urlencoded({ extended: false })) -app.use('/static', express.static(path.join(__dirname, 'public'))); -// parse application/json +app.use('/public', express.static(path.join(__dirname, 'public'))); app.use(bodyParser.json()) // Define endpoints here @@ -32,7 +30,6 @@ app.post('/notify', notify) app.post('/cancel-booking', cancelBooking) app.post('/update-catalog', updateCatalog) app.post('/trigger-exception', triggerExceptionOnLocation) -app.get('/download', messageController.downloadFile); // Reset all sessions const db = new DBService() diff --git a/services/Actions.js b/services/Actions.js index 11a9999..43a3fd5 100644 --- a/services/Actions.js +++ b/services/Actions.js @@ -2,13 +2,18 @@ import twilio from 'twilio' import logger from '../utils/logger.js' import axios from 'axios' import AI from './AI.js' -import {writeFileSync} from 'fs' +import {createWriteStream} from 'fs' import path from 'path' +import { v4 as uuidv4 } from 'uuid' +import { fileURLToPath } from 'url'; +const __filename = fileURLToPath(import.meta.url); const accountSid = process.env.TWILIO_ACCOUNT_SID const authToken = process.env.TWILIO_AUTH_TOKEN const twilioNumber = process.env.TWILIO_NUMBER const client = twilio(accountSid, authToken) +const __dirname = path.dirname(__filename); +const rootPath = path.resolve(__dirname, './'); class Actions { @@ -37,7 +42,7 @@ class Actions { if(request.data.context && request.data.context.action==='search'){ response.data.responses = response.data.responses.filter(res => res.message && res.message.catalog && res.message.catalog.providers && res.message.catalog.providers.length > 0) if(response.data.responses.length > 0) - response.data.responses = response.data.responses.slice(0, 1); + response.data.responses = response.data.responses.slice(0, 1); } responseObject = { status: true, @@ -93,59 +98,68 @@ class Actions { const format_response_response = await this.ai.format_response( call_api_response.data, [...context, { role: 'user', content: message }] - ) - response.formatted = format_response_response.message - } - } - } catch (error) { - logger.error(`Error processing instruction: ${error.message}`) - response.formatted = `Failed to process the instruction: ${error.message}` + ) + response.formatted = format_response_response.message + } + } + } catch (error) { + logger.error(`Error processing instruction: ${error.message}`) + response.formatted = `Failed to process the instruction: ${error.message}` + } + + return response; } - return response; - } - - async send_message(recipient, message, media_url=null) { - try { - let body = { - body: message, - from: `whatsapp:${twilioNumber}`, - to: recipient.includes('whatsapp:') ? recipient : `whatsapp:${recipient}`, - } - - if(media_url){ - body.mediaUrl = [media_url]; + async send_message(recipient, message, media_url=null) { + try { + let body = { + body: message, + from: `whatsapp:${twilioNumber}`, + to: recipient.includes('whatsapp:') ? recipient : `whatsapp:${recipient}`, + } + + if(media_url && !process.env.DEVELOPER_MODE_ON){ + body.mediaUrl = [media_url]; + } + let data = await client.messages.create(body) + const status = await client.messages(data.sid).fetch() + return { deliveryStatus: status.status } + } catch (error) { + logger.error(`Error sending message: ${error.message}`) + return false; } - let data = await client.messages.create(body) - const status = await client.messages(data.sid).fetch() - return { deliveryStatus: status.status } - } catch (error) { - logger.error(`Error sending message: ${error.message}`) - return false; } - } - - async download_file(url, destination_path) { - try { - const response = await axios.get(url, 'GET',{responseType:'arraybuffer'}); - - const filePath = path.join(destination_path, 'downloaded-image.png'); - // const writer = createWriteStream(filePath); - console.log(Buffer.from(response.data)); - writeFileSync(filePath, response.data); - // response.data.pipe(writer); - // return new Promise((resolve, reject) => { - // writer.on('finish', resolve); - // writer.on('error', reject); - // }); - return { - message:'File downloaded successfully and saved at ' + filePath + + async download_file(url) { + const destination_path = path.join(rootPath,'../public'); + try { + const response = await axios({ + method: 'GET', + url: url, + responseType: 'stream', + }); + + const fileName = `${uuidv4()}.png`; + const filePath = path.join(destination_path, fileName); + + // Create a write stream to save the file + const writer = createWriteStream(filePath); + + // Pipe the response data to the file + response.data.pipe(writer); + + return new Promise((resolve, reject) => { + writer.on('finish', ()=>{ + resolve(`${process.env.SERVER_URL}/public/${fileName}`) + }); + writer.on('error', reject); + + }); + } catch (error) { + logger.error(`Error sending message: ${error.message}`) + return null; } - } catch (error) { - logger.error(`Error sending message: ${error.message}`) - return false; } } -} - -export default Actions + + export default Actions diff --git a/tests/unit/controllers/bot.test.js b/tests/unit/controllers/bot.test.js index 03e1fe1..83c098e 100644 --- a/tests/unit/controllers/bot.test.js +++ b/tests/unit/controllers/bot.test.js @@ -60,7 +60,7 @@ describe('Test cases for Google maps', () => { expect(source_gps).to.have.property('lng'); }) - it('It should take a trip plannign input and generate static route image and directions link.', async () => { + it.only('It should take a trip plannign input and generate static route image and directions link.', async () => { const ask = "Can you plean a trip from Denver to Yellowstone national park?"; // identify source and destination @@ -90,8 +90,8 @@ describe('Test cases for Google maps', () => { const directions = `https://www.google.com/maps/dir/${source_gps.lat},${source_gps.lng}/${destination_gps.lat},${destination_gps.lng}/`; const route_image = `https://maps.googleapis.com/maps/api/staticmap?size=300x300&path=enc:${routes[selected_route].overview_polyline.points}&key=${process.env.GOOGLE_MAPS_API_KEY}`; - - await actionsService.send_message(process.env.TEST_RECEPIENT_NUMBER, `Here are the directions: ${directions}`); // should also pass the route image, its correctly throwing an error. + const server_route_image = await actionsService.download_file(route_image); + await actionsService.send_message(process.env.TEST_RECEPIENT_NUMBER, `Here are the directions: ${directions}`, server_route_image); logger.info(`directions: ${directions}`); logger.info(`route_image: ${route_image}`); expect(routes).to.be.an('array').that.is.not.empty; diff --git a/tests/unit/services/actions.test.js b/tests/unit/services/actions.test.js index 45994c5..5f43354 100644 --- a/tests/unit/services/actions.test.js +++ b/tests/unit/services/actions.test.js @@ -2,6 +2,7 @@ import * as chai from 'chai' const expect = chai.expect import ActionService from '../../../services/Actions.js' import { describe } from 'mocha' + const actionsService = new ActionService() describe.skip('Test cases for process_instruction function', ()=> { From 72af44906934f64a0ce877dc70aa5b1d1c25f16d Mon Sep 17 00:00:00 2001 From: Mayur Virendra Date: Tue, 9 Apr 2024 05:12:49 +0530 Subject: [PATCH 3/4] removed file download from test cases --- tests/unit/controllers/bot.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/controllers/bot.test.js b/tests/unit/controllers/bot.test.js index 83c098e..792befe 100644 --- a/tests/unit/controllers/bot.test.js +++ b/tests/unit/controllers/bot.test.js @@ -90,8 +90,8 @@ describe('Test cases for Google maps', () => { const directions = `https://www.google.com/maps/dir/${source_gps.lat},${source_gps.lng}/${destination_gps.lat},${destination_gps.lng}/`; const route_image = `https://maps.googleapis.com/maps/api/staticmap?size=300x300&path=enc:${routes[selected_route].overview_polyline.points}&key=${process.env.GOOGLE_MAPS_API_KEY}`; - const server_route_image = await actionsService.download_file(route_image); - await actionsService.send_message(process.env.TEST_RECEPIENT_NUMBER, `Here are the directions: ${directions}`, server_route_image); + // const server_route_image = await actionsService.download_file(route_image); + await actionsService.send_message(process.env.TEST_RECEPIENT_NUMBER, `Here are the directions: ${directions}`); logger.info(`directions: ${directions}`); logger.info(`route_image: ${route_image}`); expect(routes).to.be.an('array').that.is.not.empty; From cb52caf9f2ce72b851534f7866221b90d5443681 Mon Sep 17 00:00:00 2001 From: Mayur Virendra Date: Tue, 9 Apr 2024 05:21:47 +0530 Subject: [PATCH 4/4] Added .igtignore to public folder --- .gitignore | 2 -- public/.gitignore | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 public/.gitignore diff --git a/.gitignore b/.gitignore index c8c4525..4cec20e 100644 --- a/.gitignore +++ b/.gitignore @@ -130,5 +130,3 @@ dist .pnp.* .DS_Store - -public/ \ No newline at end of file diff --git a/public/.gitignore b/public/.gitignore new file mode 100644 index 0000000..86d0cb2 --- /dev/null +++ b/public/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file