From bfa25e8f4a1281dbb9aa56ec8748495591a33890 Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Thu, 3 Dec 2020 20:42:21 +0100 Subject: [PATCH 01/25] Change UI from date to day and add sentence into chat --- front/src/actions/dashboard/boxes/weather.js | 12 +- .../components/boxs/weather/WeatherBox.jsx | 4 +- front/src/config/i18n/en.json | 11 +- front/src/config/i18n/fr.json | 11 +- server/lib/weather/index.js | 3 + server/lib/weather/weather.command.js | 70 +++++- server/package.json | 1 + .../test/lib/weather/weather.command.test.js | 211 ++++++++++++++++++ server/utils/constants.js | 3 + 9 files changed, 319 insertions(+), 7 deletions(-) create mode 100644 server/test/lib/weather/weather.command.test.js diff --git a/front/src/actions/dashboard/boxes/weather.js b/front/src/actions/dashboard/boxes/weather.js index a18a2def5b..3c1f78a1ba 100644 --- a/front/src/actions/dashboard/boxes/weather.js +++ b/front/src/actions/dashboard/boxes/weather.js @@ -17,6 +17,16 @@ const WEATHER_ICONS = { night: 'fe-moon' }; +const DAYS_OF_WEEKS = { + 0: 'dashboard.boxes.weather.daysOfWeek.sunday', + 1: 'dashboard.boxes.weather.daysOfWeek.monday', + 2: 'dashboard.boxes.weather.daysOfWeek.tuesday', + 3: 'dashboard.boxes.weather.daysOfWeek.wednesday', + 4: 'dashboard.boxes.weather.daysOfWeek.thursday', + 5: 'dashboard.boxes.weather.daysOfWeek.friday', + 6: 'dashboard.boxes.weather.daysOfWeek.saturday', +} + const translateWeatherToFeIcon = weather => get(WEATHER_ICONS, weather, { default: 'fe-question' }); function createActions(store) { @@ -38,7 +48,7 @@ function createActions(store) { }); weather.days.map(day => { day.weatherIcon = translateWeatherToFeIcon(day.weather); - day.datetime_beautiful = dayjs(day.datetime).format('D MMM'); + day.datetime_beautiful = DAYS_OF_WEEKS[dayjs(day.datetime).day()]; }); boxActions.mergeBoxData(state, BOX_KEY, x, y, { diff --git a/front/src/components/boxs/weather/WeatherBox.jsx b/front/src/components/boxs/weather/WeatherBox.jsx index c9bc0bd428..e6a8393a8f 100644 --- a/front/src/components/boxs/weather/WeatherBox.jsx +++ b/front/src/components/boxs/weather/WeatherBox.jsx @@ -267,7 +267,9 @@ class WeatherBoxComponent extends Component { daysDisplay = days.map(day => { return (
-
{day.datetime_beautiful}
+
+ +
diff --git a/front/src/config/i18n/en.json b/front/src/config/i18n/en.json index 5f51dafe39..78aab66eb8 100644 --- a/front/src/config/i18n/en.json +++ b/front/src/config/i18n/en.json @@ -195,7 +195,16 @@ "hourlyForecast": "Forecast for the next 8 hours", "dailyForecast": "Forecast for the next 7 days" }, - "minMaxDegreeValue": "{{min}}°/{{max}}°" + "minMaxDegreeValue": "{{min}}°/{{max}}°", + "daysOfWeek": { + "monday": "Monday", + "tuesday": "Tuesday", + "wednesday": "Wednesday", + "thursday": "Thrusday", + "friday": "Friday", + "saturday": "Saturday", + "sunday": "Sunday" + } }, "devicesInRoom": { "editRoomLabel": "Select the room you want to display here.", diff --git a/front/src/config/i18n/fr.json b/front/src/config/i18n/fr.json index 8b41d95398..06a2a14ea9 100644 --- a/front/src/config/i18n/fr.json +++ b/front/src/config/i18n/fr.json @@ -195,7 +195,16 @@ "hourlyForecast": "Prévisions pour les 8 prochaines heures", "dailyForecast": "Prévisions pour les 7 prochains jours" }, - "minMaxDegreeValue": "{{min}}°/{{max}}°" + "minMaxDegreeValue": "{{min}}°/{{max}}°", + "daysOfWeek": { + "monday": "Lundi", + "tuesday": "Mardi", + "wednesday": "Mercredi", + "thursday": "Jeudi", + "friday": "Vendredi", + "saturday": "Samedi", + "sunday": "Dimanche" + } }, "devicesInRoom": { "editRoomLabel": "Sélectionnez la pièce que vous souhaitez afficher ici.", diff --git a/server/lib/weather/index.js b/server/lib/weather/index.js index d05623bda3..f8204e4ddf 100644 --- a/server/lib/weather/index.js +++ b/server/lib/weather/index.js @@ -8,6 +8,9 @@ const Weather = function Weather(service, event, messageManager, house) { this.messageManager = messageManager; this.house = house; this.event.on(INTENTS.WEATHER.GET, this.command.bind(this)); + this.event.on(INTENTS.WEATHER.TOMORROW, this.command.bind(this)); + this.event.on(INTENTS.WEATHER.AFTER_TOMORROW, this.command.bind(this)); + this.event.on(INTENTS.WEATHER.DAY, this.command.bind(this)); }; Weather.prototype.get = get; diff --git a/server/lib/weather/weather.command.js b/server/lib/weather/weather.command.js index f0aea4ce8a..977344e901 100644 --- a/server/lib/weather/weather.command.js +++ b/server/lib/weather/weather.command.js @@ -1,5 +1,32 @@ +const dayjs = require('dayjs'); const logger = require('../../utils/logger'); -const { ServiceNotConfiguredError, NoValuesFoundError } = require('../../utils/coreErrors'); +const { ServiceNotConfiguredError, NoValuesFoundError, NotFoundError } = require('../../utils/coreErrors'); + + +const DAYS_OF_WEEKS = { + sunday: 0, + monday: 1, + tuesday: 2, + wednesday: 3, + thursday: 4, + friday: 5, + saturday: 6, +}; + +/** + * @description Get the weather by a day. + * @param {Object} weather - The weather object return by the external service. + * @param {string} day - The requested day. + * @returns {Object} The weather object for the requested day. + * @example + * getWeatherByDay(weather, day); + */ +function getWeatherByDay(weather, day) { + const filterWeatherDays = weather.days.filter((weatherDay) => { + return dayjs(weatherDay.datetime).day() === DAYS_OF_WEEKS[day]; + }); + return filterWeatherDays.length === 1 ? filterWeatherDays[0] : undefined; +} /** * @description Get the weather in a text request. @@ -11,19 +38,56 @@ const { ServiceNotConfiguredError, NoValuesFoundError } = require('../../utils/c */ async function command(message, classification, context) { let weather; + let weatherDay; try { + const houses = await this.house.get(); const house = houses[0]; if (!house || !house.latitude || !house.longitude) { throw new NoValuesFoundError(); } + weather = await this.get(house); switch (classification.intent) { case 'weather.get': - weather = await this.get(house); context.temperature = weather.temperature; context.units = weather.units === 'metric' ? '°C' : '°F'; - await this.messageManager.replyByIntent(message, `weather.get.success.${weather.weather}`, context); + + await this.messageManager.replyByIntent( + message, `weather.get.success.${weather.weather}`, context + ); + break; + case 'weather.tomorrow': + context.temperature_min = weather.days[0].temperature_min; + context.temperature_max = weather.days[0].temperature_max; + context.units = weather.units === 'metric' ? '°C' : '°F'; + await this.messageManager.replyByIntent( + message, `weather.tomorrow.success.${weather.days[0].weather}`, context + ); + break; + case 'weather.after-tomorrow': + context.temperature_min = weather.days[1].temperature_min; + context.temperature_max = weather.days[1].temperature_max; + context.units = weather.units === 'metric' ? '°C' : '°F'; + await this.messageManager.replyByIntent( + message, `weather.after-tomorrow.success.${weather.days[1].weather}`, context + ); + break; + case 'weather.day': + if (!context.day) { + throw new NotFoundError('day not found'); + } + weatherDay = getWeatherByDay(weather, context.day); + if(!weatherDay){ + throw new NotFoundError('weather for this day not found'); + } + context.temperature_min = weatherDay.temperature_min; + context.temperature_max = weatherDay.temperature_max; + context.units = weather.units === 'metric' ? '°C' : '°F'; + await this.messageManager.replyByIntent( + message, `weather.day.success.${weatherDay.weather}`, context + ); break; + default: throw new Error('Not found'); } diff --git a/server/package.json b/server/package.json index 66b9e66536..dbbc7a52fa 100644 --- a/server/package.json +++ b/server/package.json @@ -78,6 +78,7 @@ "bluebird": "^3.5.3", "compression": "^1.7.4", "cross-env": "^5.2.0", + "dayjs": "^1.9.6", "dockerode": "^2.5.8", "express": "^4.16.4", "express-rate-limit": "^4.0.3", diff --git a/server/test/lib/weather/weather.command.test.js b/server/test/lib/weather/weather.command.test.js new file mode 100644 index 0000000000..473b02942f --- /dev/null +++ b/server/test/lib/weather/weather.command.test.js @@ -0,0 +1,211 @@ +const { fake, assert } = require('sinon'); +const EvenEmitter = require('events'); +const Weather = require('../../../lib/weather'); + +const event = new EvenEmitter(); + +const fakeWeather = { + temperature: 54.87, + humidity: 0.76, + pressure: 1019.4, + datetime: new Date('2019-03-28T07:50:18.000Z'), + units: 'metric', + windSpeed: 5.25, + weather: 'cloud', + days: [ + { + datetime: '2020-12-04T11:00:00.000Z', + humidity: 65, + pressure: 992, + temperature_max: 11, + temperature_min: 6, + units: 'metric', + weather: 'rain', + wind_direction: 252, + wind_speed: 3.13 + }, + { + datetime: '2020-12-05T11:00:00.000Z', + humidity: 57, + pressure: 997, + temperature_max: 9, + temperature_min: 4, + units: 'metric', + weather: 'clear', + wind_direction: 324, + wind_speed: 1.95 + }, + { + datetime: '2020-12-06T11:00:00.000Z', + humidity: 67, + pressure: 1000, + temperature_max: 9, + temperature_min: 5, + units: 'metric', + weather: 'cloud', + wind_direction: 271, + wind_speed: 3.23 + }, + { + datetime: '2020-12-07T11:00:00.000Z', + humidity: 51, + pressure: 1006, + temperature_max: 10, + temperature_min: 6, + units: 'metric', + weather: 'cloud', + wind_direction: 304, + wind_speed: 6.27 + }, + { + datetime: '2020-12-08T11:00:00.000Z', + humidity: 86, + pressure: 1004, + temperature_max: 6, + temperature_min: 5, + units: 'metric', + weather: 'rain', + wind_direction: 43, + wind_speed: 2.14 + }, + { + datetime: '2020-12-09T11:00:00.000Z', + humidity: 61, + pressure: 1010, + temperature_max: 9, + temperature_min: 4, + units: 'metric', + weather: 'clear', + wind_direction: 318, + wind_speed: 2.55 + }, + { + datetime: '2020-12-10T11:00:00.000Z', + humidity: 60, + pressure: 1010, + temperature_max: 7, + temperature_min: 3, + units: 'metric', + weather: 'rain', + wind_direction: 96, + wind_speed: 0.98 + } + ] +}; + +const fakeHouses = [ + { + latitude: 112, + longitude: -2, + offset: 0, + language: 'fr', + units: 'metric', + } +]; + +const openWeather = { + weather: { + get: fake.resolves(fakeWeather), + }, +}; + +const houses = { + get: fake.resolves(fakeHouses), +}; + +const service = { + getService: () => openWeather, +}; + +describe('weather.command', () => { + let messageManager; + beforeEach(() => { + messageManager = { + replyByIntent: fake.resolves(true), + }; + }); + + + it('should get the weather', async () => { + const weather = new Weather(service, event, messageManager, houses); + const message = { + text: 'Meteo ?', + }; + await weather.command( + message, + { + intent: 'weather.get' + }, + {} + ); + assert.calledWith( + messageManager.replyByIntent, + message, + 'weather.get.success.cloud', + { temperature: 54.87, units: '°C' } + ); + }); + it('should get the weather for tomorrow', async () => { + const weather = new Weather(service, event, messageManager, houses); + const message = { + text: 'Meteo Tomorrow?', + }; + await weather.command( + message, + { + intent: 'weather.tomorrow' + }, + {} + ); + assert.calledWith( + messageManager.replyByIntent, + message, + 'weather.tomorrow.success.rain', + { temperature_max: 11, temperature_min: 6, units: '°C' } + ); + }); + it('should get the weather for after tomorrow', async () => { + const weather = new Weather(service, event, messageManager, houses); + const message = { + text: 'Meteo After Tomorrow?', + }; + await weather.command( + message, + { + intent: 'weather.after-tomorrow' + }, + {} + ); + assert.calledWith( + messageManager.replyByIntent, + message, + 'weather.after-tomorrow.success.clear', + { temperature_max: 9, temperature_min: 4, units: '°C' } + ); + }); + + it('should get the weather for next sunday', async () => { + const weather = new Weather(service, event, messageManager, houses); + const message = { + text: 'Meteo next sunday?', + }; + await weather.command( + message, + { + intent: 'weather.day' + }, + { + day: 'sunday' + } + ); + assert.calledWith( + messageManager.replyByIntent, + message, + 'weather.day.success.cloud', + { day: 'sunday', temperature_max: 9, temperature_min: 5, units: '°C' } + ); + }); + + + +}); diff --git a/server/utils/constants.js b/server/utils/constants.js index a95e37aff0..05e4a3f1ba 100644 --- a/server/utils/constants.js +++ b/server/utils/constants.js @@ -236,6 +236,9 @@ const INTENTS = { }, WEATHER: { GET: 'intent.weather.get', + TOMORROW: 'intent.weather.tomorrow', + AFTER_TOMORROW: 'intent.weather.after-tomorrow', + DAY: 'intent.weather.day', }, CAMERA: { GET_IMAGE_ROOM: 'intent.camera.get-image-room', From d207c504fa31ceba6a916abf8682f1537baeadc0 Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Thu, 3 Dec 2020 20:48:08 +0100 Subject: [PATCH 02/25] prettier --- front/src/actions/dashboard/boxes/weather.js | 4 +- server/lib/weather/weather.command.js | 20 +- .../test/lib/weather/weather.command.test.js | 356 +++++++++--------- 3 files changed, 185 insertions(+), 195 deletions(-) diff --git a/front/src/actions/dashboard/boxes/weather.js b/front/src/actions/dashboard/boxes/weather.js index 3c1f78a1ba..7a019ed1dd 100644 --- a/front/src/actions/dashboard/boxes/weather.js +++ b/front/src/actions/dashboard/boxes/weather.js @@ -24,8 +24,8 @@ const DAYS_OF_WEEKS = { 3: 'dashboard.boxes.weather.daysOfWeek.wednesday', 4: 'dashboard.boxes.weather.daysOfWeek.thursday', 5: 'dashboard.boxes.weather.daysOfWeek.friday', - 6: 'dashboard.boxes.weather.daysOfWeek.saturday', -} + 6: 'dashboard.boxes.weather.daysOfWeek.saturday' +}; const translateWeatherToFeIcon = weather => get(WEATHER_ICONS, weather, { default: 'fe-question' }); diff --git a/server/lib/weather/weather.command.js b/server/lib/weather/weather.command.js index 977344e901..d4367256c7 100644 --- a/server/lib/weather/weather.command.js +++ b/server/lib/weather/weather.command.js @@ -2,7 +2,6 @@ const dayjs = require('dayjs'); const logger = require('../../utils/logger'); const { ServiceNotConfiguredError, NoValuesFoundError, NotFoundError } = require('../../utils/coreErrors'); - const DAYS_OF_WEEKS = { sunday: 0, monday: 1, @@ -40,7 +39,6 @@ async function command(message, classification, context) { let weather; let weatherDay; try { - const houses = await this.house.get(); const house = houses[0]; if (!house || !house.latitude || !house.longitude) { @@ -52,16 +50,16 @@ async function command(message, classification, context) { context.temperature = weather.temperature; context.units = weather.units === 'metric' ? '°C' : '°F'; - await this.messageManager.replyByIntent( - message, `weather.get.success.${weather.weather}`, context - ); + await this.messageManager.replyByIntent(message, `weather.get.success.${weather.weather}`, context); break; case 'weather.tomorrow': context.temperature_min = weather.days[0].temperature_min; context.temperature_max = weather.days[0].temperature_max; context.units = weather.units === 'metric' ? '°C' : '°F'; await this.messageManager.replyByIntent( - message, `weather.tomorrow.success.${weather.days[0].weather}`, context + message, + `weather.tomorrow.success.${weather.days[0].weather}`, + context, ); break; case 'weather.after-tomorrow': @@ -69,7 +67,9 @@ async function command(message, classification, context) { context.temperature_max = weather.days[1].temperature_max; context.units = weather.units === 'metric' ? '°C' : '°F'; await this.messageManager.replyByIntent( - message, `weather.after-tomorrow.success.${weather.days[1].weather}`, context + message, + `weather.after-tomorrow.success.${weather.days[1].weather}`, + context, ); break; case 'weather.day': @@ -77,15 +77,13 @@ async function command(message, classification, context) { throw new NotFoundError('day not found'); } weatherDay = getWeatherByDay(weather, context.day); - if(!weatherDay){ + if (!weatherDay) { throw new NotFoundError('weather for this day not found'); } context.temperature_min = weatherDay.temperature_min; context.temperature_max = weatherDay.temperature_max; context.units = weather.units === 'metric' ? '°C' : '°F'; - await this.messageManager.replyByIntent( - message, `weather.day.success.${weatherDay.weather}`, context - ); + await this.messageManager.replyByIntent(message, `weather.day.success.${weatherDay.weather}`, context); break; default: diff --git a/server/test/lib/weather/weather.command.test.js b/server/test/lib/weather/weather.command.test.js index 473b02942f..6f4db6bc0c 100644 --- a/server/test/lib/weather/weather.command.test.js +++ b/server/test/lib/weather/weather.command.test.js @@ -5,207 +5,199 @@ const Weather = require('../../../lib/weather'); const event = new EvenEmitter(); const fakeWeather = { - temperature: 54.87, - humidity: 0.76, - pressure: 1019.4, - datetime: new Date('2019-03-28T07:50:18.000Z'), - units: 'metric', - windSpeed: 5.25, - weather: 'cloud', - days: [ - { - datetime: '2020-12-04T11:00:00.000Z', - humidity: 65, - pressure: 992, - temperature_max: 11, - temperature_min: 6, - units: 'metric', - weather: 'rain', - wind_direction: 252, - wind_speed: 3.13 - }, - { - datetime: '2020-12-05T11:00:00.000Z', - humidity: 57, - pressure: 997, - temperature_max: 9, - temperature_min: 4, - units: 'metric', - weather: 'clear', - wind_direction: 324, - wind_speed: 1.95 - }, - { - datetime: '2020-12-06T11:00:00.000Z', - humidity: 67, - pressure: 1000, - temperature_max: 9, - temperature_min: 5, - units: 'metric', - weather: 'cloud', - wind_direction: 271, - wind_speed: 3.23 - }, - { - datetime: '2020-12-07T11:00:00.000Z', - humidity: 51, - pressure: 1006, - temperature_max: 10, - temperature_min: 6, - units: 'metric', - weather: 'cloud', - wind_direction: 304, - wind_speed: 6.27 - }, - { - datetime: '2020-12-08T11:00:00.000Z', - humidity: 86, - pressure: 1004, - temperature_max: 6, - temperature_min: 5, - units: 'metric', - weather: 'rain', - wind_direction: 43, - wind_speed: 2.14 - }, - { - datetime: '2020-12-09T11:00:00.000Z', - humidity: 61, - pressure: 1010, - temperature_max: 9, - temperature_min: 4, - units: 'metric', - weather: 'clear', - wind_direction: 318, - wind_speed: 2.55 - }, - { - datetime: '2020-12-10T11:00:00.000Z', - humidity: 60, - pressure: 1010, - temperature_max: 7, - temperature_min: 3, - units: 'metric', - weather: 'rain', - wind_direction: 96, - wind_speed: 0.98 - } - ] + temperature: 54.87, + humidity: 0.76, + pressure: 1019.4, + datetime: new Date('2019-03-28T07:50:18.000Z'), + units: 'metric', + windSpeed: 5.25, + weather: 'cloud', + days: [ + { + datetime: '2020-12-04T11:00:00.000Z', + humidity: 65, + pressure: 992, + temperature_max: 11, + temperature_min: 6, + units: 'metric', + weather: 'rain', + wind_direction: 252, + wind_speed: 3.13, + }, + { + datetime: '2020-12-05T11:00:00.000Z', + humidity: 57, + pressure: 997, + temperature_max: 9, + temperature_min: 4, + units: 'metric', + weather: 'clear', + wind_direction: 324, + wind_speed: 1.95, + }, + { + datetime: '2020-12-06T11:00:00.000Z', + humidity: 67, + pressure: 1000, + temperature_max: 9, + temperature_min: 5, + units: 'metric', + weather: 'cloud', + wind_direction: 271, + wind_speed: 3.23, + }, + { + datetime: '2020-12-07T11:00:00.000Z', + humidity: 51, + pressure: 1006, + temperature_max: 10, + temperature_min: 6, + units: 'metric', + weather: 'cloud', + wind_direction: 304, + wind_speed: 6.27, + }, + { + datetime: '2020-12-08T11:00:00.000Z', + humidity: 86, + pressure: 1004, + temperature_max: 6, + temperature_min: 5, + units: 'metric', + weather: 'rain', + wind_direction: 43, + wind_speed: 2.14, + }, + { + datetime: '2020-12-09T11:00:00.000Z', + humidity: 61, + pressure: 1010, + temperature_max: 9, + temperature_min: 4, + units: 'metric', + weather: 'clear', + wind_direction: 318, + wind_speed: 2.55, + }, + { + datetime: '2020-12-10T11:00:00.000Z', + humidity: 60, + pressure: 1010, + temperature_max: 7, + temperature_min: 3, + units: 'metric', + weather: 'rain', + wind_direction: 96, + wind_speed: 0.98, + }, + ], }; const fakeHouses = [ - { - latitude: 112, - longitude: -2, - offset: 0, - language: 'fr', - units: 'metric', - } + { + latitude: 112, + longitude: -2, + offset: 0, + language: 'fr', + units: 'metric', + }, ]; const openWeather = { - weather: { - get: fake.resolves(fakeWeather), - }, + weather: { + get: fake.resolves(fakeWeather), + }, }; const houses = { - get: fake.resolves(fakeHouses), + get: fake.resolves(fakeHouses), }; const service = { - getService: () => openWeather, + getService: () => openWeather, }; describe('weather.command', () => { - let messageManager; - beforeEach(() => { - messageManager = { - replyByIntent: fake.resolves(true), - }; - }); - + let messageManager; + beforeEach(() => { + messageManager = { + replyByIntent: fake.resolves(true), + }; + }); - it('should get the weather', async () => { - const weather = new Weather(service, event, messageManager, houses); - const message = { - text: 'Meteo ?', - }; - await weather.command( - message, - { - intent: 'weather.get' - }, - {} - ); - assert.calledWith( - messageManager.replyByIntent, - message, - 'weather.get.success.cloud', - { temperature: 54.87, units: '°C' } - ); + it('should get the weather', async () => { + const weather = new Weather(service, event, messageManager, houses); + const message = { + text: 'Meteo ?', + }; + await weather.command( + message, + { + intent: 'weather.get', + }, + {}, + ); + assert.calledWith(messageManager.replyByIntent, message, 'weather.get.success.cloud', { + temperature: 54.87, + units: '°C', }); - it('should get the weather for tomorrow', async () => { - const weather = new Weather(service, event, messageManager, houses); - const message = { - text: 'Meteo Tomorrow?', - }; - await weather.command( - message, - { - intent: 'weather.tomorrow' - }, - {} - ); - assert.calledWith( - messageManager.replyByIntent, - message, - 'weather.tomorrow.success.rain', - { temperature_max: 11, temperature_min: 6, units: '°C' } - ); + }); + it('should get the weather for tomorrow', async () => { + const weather = new Weather(service, event, messageManager, houses); + const message = { + text: 'Meteo Tomorrow?', + }; + await weather.command( + message, + { + intent: 'weather.tomorrow', + }, + {}, + ); + assert.calledWith(messageManager.replyByIntent, message, 'weather.tomorrow.success.rain', { + temperature_max: 11, + temperature_min: 6, + units: '°C', }); - it('should get the weather for after tomorrow', async () => { - const weather = new Weather(service, event, messageManager, houses); - const message = { - text: 'Meteo After Tomorrow?', - }; - await weather.command( - message, - { - intent: 'weather.after-tomorrow' - }, - {} - ); - assert.calledWith( - messageManager.replyByIntent, - message, - 'weather.after-tomorrow.success.clear', - { temperature_max: 9, temperature_min: 4, units: '°C' } - ); + }); + it('should get the weather for after tomorrow', async () => { + const weather = new Weather(service, event, messageManager, houses); + const message = { + text: 'Meteo After Tomorrow?', + }; + await weather.command( + message, + { + intent: 'weather.after-tomorrow', + }, + {}, + ); + assert.calledWith(messageManager.replyByIntent, message, 'weather.after-tomorrow.success.clear', { + temperature_max: 9, + temperature_min: 4, + units: '°C', }); + }); - it('should get the weather for next sunday', async () => { - const weather = new Weather(service, event, messageManager, houses); - const message = { - text: 'Meteo next sunday?', - }; - await weather.command( - message, - { - intent: 'weather.day' - }, - { - day: 'sunday' - } - ); - assert.calledWith( - messageManager.replyByIntent, - message, - 'weather.day.success.cloud', - { day: 'sunday', temperature_max: 9, temperature_min: 5, units: '°C' } - ); + it('should get the weather for next sunday', async () => { + const weather = new Weather(service, event, messageManager, houses); + const message = { + text: 'Meteo next sunday?', + }; + await weather.command( + message, + { + intent: 'weather.day', + }, + { + day: 'sunday', + }, + ); + assert.calledWith(messageManager.replyByIntent, message, 'weather.day.success.cloud', { + day: 'sunday', + temperature_max: 9, + temperature_min: 5, + units: '°C', }); - - - + }); }); From f558996102537254fecf3a8bbc2c174ded5dc2b4 Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Thu, 3 Dec 2020 21:13:08 +0100 Subject: [PATCH 03/25] update package-lock.json --- server/package-lock.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/package-lock.json b/server/package-lock.json index b56a71578e..528775ad1a 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -2006,6 +2006,11 @@ "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==" }, + "dayjs": { + "version": "1.9.6", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.9.6.tgz", + "integrity": "sha512-HngNLtPEBWRo8EFVmHFmSXAjtCX8rGNqeXQI0Gh7wCTSqwaKgPIDqu9m07wABVopNwzvOeCb+2711vQhDlcIXw==" + }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", From 881b7943deb0161823f8af15ca39a1759ddc8f26 Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Fri, 4 Dec 2020 07:36:29 +0100 Subject: [PATCH 04/25] add some test for failed scenario --- .../test/lib/weather/weather.command.test.js | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/server/test/lib/weather/weather.command.test.js b/server/test/lib/weather/weather.command.test.js index 6f4db6bc0c..d2190d2d71 100644 --- a/server/test/lib/weather/weather.command.test.js +++ b/server/test/lib/weather/weather.command.test.js @@ -200,4 +200,34 @@ describe('weather.command', () => { units: '°C', }); }); + it("shouldn't get the weather without day", async () => { + const weather = new Weather(service, event, messageManager, houses); + const message = { + text: 'Meteo next?', + }; + await weather.command( + message, + { + intent: 'weather.day', + }, + {}, + ); + assert.calledWith(messageManager.replyByIntent, message, 'weather.get.fail', {}); + }); + it("shouldn't get the weather without a good day", async () => { + const weather = new Weather(service, event, messageManager, houses); + const message = { + text: 'Meteo next december?', + }; + await weather.command( + message, + { + intent: 'weather.day', + }, + { + day: 'december', + }, + ); + assert.calledWith(messageManager.replyByIntent, message, 'weather.get.fail', { day: 'december' }); + }); }); From af5eb5929a1db15f13d5d2d1498ea8c26b9ef64b Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Fri, 4 Dec 2020 21:21:34 +0100 Subject: [PATCH 05/25] Fix after review --- front/src/actions/dashboard/boxes/weather.js | 13 ++----------- front/src/components/boxs/weather/WeatherBox.jsx | 2 +- front/src/config/i18n/en.json | 11 +---------- front/src/config/i18n/fr.json | 11 +---------- server/lib/weather/weather.command.js | 16 ++++++++++------ server/lib/weather/weather.error.js | 9 +++++++++ server/test/lib/weather/weather.command.test.js | 2 +- 7 files changed, 25 insertions(+), 39 deletions(-) create mode 100644 server/lib/weather/weather.error.js diff --git a/front/src/actions/dashboard/boxes/weather.js b/front/src/actions/dashboard/boxes/weather.js index 7a019ed1dd..b5852864a4 100644 --- a/front/src/actions/dashboard/boxes/weather.js +++ b/front/src/actions/dashboard/boxes/weather.js @@ -17,15 +17,6 @@ const WEATHER_ICONS = { night: 'fe-moon' }; -const DAYS_OF_WEEKS = { - 0: 'dashboard.boxes.weather.daysOfWeek.sunday', - 1: 'dashboard.boxes.weather.daysOfWeek.monday', - 2: 'dashboard.boxes.weather.daysOfWeek.tuesday', - 3: 'dashboard.boxes.weather.daysOfWeek.wednesday', - 4: 'dashboard.boxes.weather.daysOfWeek.thursday', - 5: 'dashboard.boxes.weather.daysOfWeek.friday', - 6: 'dashboard.boxes.weather.daysOfWeek.saturday' -}; const translateWeatherToFeIcon = weather => get(WEATHER_ICONS, weather, { default: 'fe-question' }); @@ -47,8 +38,8 @@ function createActions(store) { hour.datetime_beautiful = dayjs(hour.datetime).format('HH'); }); weather.days.map(day => { - day.weatherIcon = translateWeatherToFeIcon(day.weather); - day.datetime_beautiful = DAYS_OF_WEEKS[dayjs(day.datetime).day()]; + day.weather_icon = translateWeatherToFeIcon(day.weather); + day.datetime_beautiful = dayjs(day.datetime).format('dddd'); }); boxActions.mergeBoxData(state, BOX_KEY, x, y, { diff --git a/front/src/components/boxs/weather/WeatherBox.jsx b/front/src/components/boxs/weather/WeatherBox.jsx index e6a8393a8f..5f38dcf562 100644 --- a/front/src/components/boxs/weather/WeatherBox.jsx +++ b/front/src/components/boxs/weather/WeatherBox.jsx @@ -268,7 +268,7 @@ class WeatherBoxComponent extends Component { return (
- + {day.datetime_beautiful}
diff --git a/front/src/config/i18n/en.json b/front/src/config/i18n/en.json index 78aab66eb8..5f51dafe39 100644 --- a/front/src/config/i18n/en.json +++ b/front/src/config/i18n/en.json @@ -195,16 +195,7 @@ "hourlyForecast": "Forecast for the next 8 hours", "dailyForecast": "Forecast for the next 7 days" }, - "minMaxDegreeValue": "{{min}}°/{{max}}°", - "daysOfWeek": { - "monday": "Monday", - "tuesday": "Tuesday", - "wednesday": "Wednesday", - "thursday": "Thrusday", - "friday": "Friday", - "saturday": "Saturday", - "sunday": "Sunday" - } + "minMaxDegreeValue": "{{min}}°/{{max}}°" }, "devicesInRoom": { "editRoomLabel": "Select the room you want to display here.", diff --git a/front/src/config/i18n/fr.json b/front/src/config/i18n/fr.json index 06a2a14ea9..8b41d95398 100644 --- a/front/src/config/i18n/fr.json +++ b/front/src/config/i18n/fr.json @@ -195,16 +195,7 @@ "hourlyForecast": "Prévisions pour les 8 prochaines heures", "dailyForecast": "Prévisions pour les 7 prochains jours" }, - "minMaxDegreeValue": "{{min}}°/{{max}}°", - "daysOfWeek": { - "monday": "Lundi", - "tuesday": "Mardi", - "wednesday": "Mercredi", - "thursday": "Jeudi", - "friday": "Vendredi", - "saturday": "Samedi", - "sunday": "Dimanche" - } + "minMaxDegreeValue": "{{min}}°/{{max}}°" }, "devicesInRoom": { "editRoomLabel": "Sélectionnez la pièce que vous souhaitez afficher ici.", diff --git a/server/lib/weather/weather.command.js b/server/lib/weather/weather.command.js index d4367256c7..39f24bed9e 100644 --- a/server/lib/weather/weather.command.js +++ b/server/lib/weather/weather.command.js @@ -1,6 +1,8 @@ const dayjs = require('dayjs'); const logger = require('../../utils/logger'); const { ServiceNotConfiguredError, NoValuesFoundError, NotFoundError } = require('../../utils/coreErrors'); +const { INTENTS } = require('../../utils/constants'); +const { NoWeatherFoundError } = require('./weather.error'); const DAYS_OF_WEEKS = { sunday: 0, @@ -45,14 +47,14 @@ async function command(message, classification, context) { throw new NoValuesFoundError(); } weather = await this.get(house); - switch (classification.intent) { - case 'weather.get': + switch (`intent.${classification.intent}`) { + case INTENTS.WEATHER.GET: context.temperature = weather.temperature; context.units = weather.units === 'metric' ? '°C' : '°F'; await this.messageManager.replyByIntent(message, `weather.get.success.${weather.weather}`, context); break; - case 'weather.tomorrow': + case INTENTS.WEATHER.TOMORROW: context.temperature_min = weather.days[0].temperature_min; context.temperature_max = weather.days[0].temperature_max; context.units = weather.units === 'metric' ? '°C' : '°F'; @@ -62,7 +64,7 @@ async function command(message, classification, context) { context, ); break; - case 'weather.after-tomorrow': + case INTENTS.WEATHER.AFTER_TOMORROW: context.temperature_min = weather.days[1].temperature_min; context.temperature_max = weather.days[1].temperature_max; context.units = weather.units === 'metric' ? '°C' : '°F'; @@ -72,13 +74,13 @@ async function command(message, classification, context) { context, ); break; - case 'weather.day': + case INTENTS.WEATHER.DAY: if (!context.day) { throw new NotFoundError('day not found'); } weatherDay = getWeatherByDay(weather, context.day); if (!weatherDay) { - throw new NotFoundError('weather for this day not found'); + throw new NoWeatherFoundError('weather for this day not found'); } context.temperature_min = weatherDay.temperature_min; context.temperature_max = weatherDay.temperature_max; @@ -95,6 +97,8 @@ async function command(message, classification, context) { this.messageManager.replyByIntent(message, 'weather.get.fail.not-configured', context); } else if (e instanceof NoValuesFoundError) { this.messageManager.replyByIntent(message, 'weather.get.fail.no-house', context); + } else if (e instanceof NoWeatherFoundError) { + await this.messageManager.replyByIntent(message, `weather.get.fail.no-weather`, context); } else { this.messageManager.replyByIntent(message, 'weather.get.fail', context); } diff --git a/server/lib/weather/weather.error.js b/server/lib/weather/weather.error.js new file mode 100644 index 0000000000..86b122e451 --- /dev/null +++ b/server/lib/weather/weather.error.js @@ -0,0 +1,9 @@ +class NoWeatherFoundError extends Error { + constructor(message) { + super(); + this.message = message; + } +} +module.exports = { + NoWeatherFoundError, +}; diff --git a/server/test/lib/weather/weather.command.test.js b/server/test/lib/weather/weather.command.test.js index d2190d2d71..9ff36b31cf 100644 --- a/server/test/lib/weather/weather.command.test.js +++ b/server/test/lib/weather/weather.command.test.js @@ -228,6 +228,6 @@ describe('weather.command', () => { day: 'december', }, ); - assert.calledWith(messageManager.replyByIntent, message, 'weather.get.fail', { day: 'december' }); + assert.calledWith(messageManager.replyByIntent, message, 'weather.get.fail.no-weather', { day: 'december' }); }); }); From e988706a2fb1c9c7eeda978e2e5e36d977cbadfc Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Fri, 4 Dec 2020 21:25:35 +0100 Subject: [PATCH 06/25] prettier front --- front/src/actions/dashboard/boxes/weather.js | 1 - front/src/components/boxs/weather/WeatherBox.jsx | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/front/src/actions/dashboard/boxes/weather.js b/front/src/actions/dashboard/boxes/weather.js index b5852864a4..f664685839 100644 --- a/front/src/actions/dashboard/boxes/weather.js +++ b/front/src/actions/dashboard/boxes/weather.js @@ -17,7 +17,6 @@ const WEATHER_ICONS = { night: 'fe-moon' }; - const translateWeatherToFeIcon = weather => get(WEATHER_ICONS, weather, { default: 'fe-question' }); function createActions(store) { diff --git a/front/src/components/boxs/weather/WeatherBox.jsx b/front/src/components/boxs/weather/WeatherBox.jsx index 5f38dcf562..c9bc0bd428 100644 --- a/front/src/components/boxs/weather/WeatherBox.jsx +++ b/front/src/components/boxs/weather/WeatherBox.jsx @@ -267,9 +267,7 @@ class WeatherBoxComponent extends Component { daysDisplay = days.map(day => { return (
-
- {day.datetime_beautiful} -
+
{day.datetime_beautiful}
From aa6cacdcbc93ecad999fc56917d7f89868bdc11c Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Tue, 15 Dec 2020 07:57:06 +0100 Subject: [PATCH 07/25] Add weather sentence from https://github.com/GladysAssistant/Gladys/pull/1010/files --- server/config/brain/weather/answers.en.json | 4 + server/config/brain/weather/answers.fr.json | 102 +++++++++++++++++- server/config/brain/weather/questions.en.json | 20 ++++ server/config/brain/weather/questions.fr.json | 27 +++++ 4 files changed, 152 insertions(+), 1 deletion(-) diff --git a/server/config/brain/weather/answers.en.json b/server/config/brain/weather/answers.en.json index 86ec889e8e..1469c16e9d 100644 --- a/server/config/brain/weather/answers.en.json +++ b/server/config/brain/weather/answers.en.json @@ -42,5 +42,9 @@ { "label": "weather.get.fail.no-house", "answers": ["You need to first configure your house and its location in parameters."] + }, + { + "label": "weather.get.fail.no-weather", + "answers": ["The weather forecast for that day couldn't be found."] } ] diff --git a/server/config/brain/weather/answers.fr.json b/server/config/brain/weather/answers.fr.json index f58ea4290f..837d29ab99 100644 --- a/server/config/brain/weather/answers.fr.json +++ b/server/config/brain/weather/answers.fr.json @@ -3,34 +3,130 @@ "label": "weather.get.success.snow", "answers": ["Il neige dehors et la température est de {{ temperature }} {{ units }}."] }, + { + "label": "weather.tomorrow.success.snow", + "answers": ["Demain il va neiger dehors et la température sera de {{ temperature }} {{ units }}."] + }, + { + "label": "weather.after-tomorrow.success.snow", + "answers": ["Après demain il va neiger dehors et la température sera de {{ temperature }} {{ units }}."] + }, + { + "label": "weather.day.success.snow", + "answers": ["%day% il va neiger dehors et la température sera de {{ temperature }} {{ units }}."] + }, { "label": "weather.get.success.rain", "answers": ["Il pleut dehors et la température est de {{ temperature }} {{ units }}."] }, + { + "label": "weather.tomorrow.success.rain", + "answers": ["Demain il va pleuvoir dehors et la température sera de {{ temperature }} {{ units }}."] + }, + { + "label": "weather.after-tomorrow.success.rain", + "answers": ["Après demain il va pleuvoir dehors et la température sera de {{ temperature }} {{ units }}."] + }, + { + "label": "weather.day.success.rain", + "answers": ["%day% il va pleuvoir dehors et la température sera de {{ temperature }} {{ units }}."] + }, { "label": "weather.get.success.clear", "answers": ["Le ciel est dégagé dehors et la température est de {{ temperature }} {{ units }}."] }, + { + "label": "weather.tomorrow.success.clear", + "answers": ["Demain le ciel sera dégagé dehors et la température sera de {{ temperature }} {{ units }}."] + }, + { + "label": "weather.after-tomorrow.success.clear", + "answers": ["Après demain le ciel sera dégagé dehors et la température sera de {{ temperature }} {{ units }}."] + }, + { + "label": "weather.day.success.clear", + "answers": ["%day% le ciel sera degagé dehors et la température sera de {{ temperature }} {{ units }}."] + }, { "label": "weather.get.success.cloud", "answers": ["Il fait nuageux dehors et la température est de {{ temperature }} {{ units }}."] }, + { + "label": "weather.tomorrow.success.cloud", + "answers": ["Demain il y aura des nuages dehors et la température sera de {{ temperature }} {{ units }}."] + }, + { + "label": "weather.after-tomorrow.success.cloud", + "answers": ["Après demain il y aura des nuages dehors et la température sera de {{ temperature }} {{ units }}."] + }, + { + "label": "weather.day.success.cloud", + "answers": ["%day% il y aura des nuages dehors et la température sera de {{ temperature }} {{ units }}."] + }, { "label": "weather.get.success.fog", "answers": ["Il y a du brouillard dehors et la température est de {{ temperature }} {{ units }}."] }, + { + "label": "weather.tomorrow.success.fog", + "answers": ["Demain il y aura du brouillard dehors et la température sera de {{ temperature }} {{ units }}."] + }, + { + "label": "weather.after-tomorrow.success.fog", + "answers": ["Après demain il y aura du brouillard dehors et la température sera de {{ temperature }} {{ units }}."] + }, + { + "label": "weather.day.success.fog", + "answers": ["%day% il y aura du brouillard dehors et la température sera de {{ temperature }} {{ units }}."] + }, { "label": "weather.get.success.sleet", - "answers": ["Il fait {{ temperature }} {{ units }} dehors avec une pluie glaciale..."] + "answers": ["Il fait {{ temperature }} {{ units }} dehors avec une pluie glaciale."] + }, + { + "label": "weather.tomorrow.success.sleet", + "answers": ["Demain il fera {{ temperature }} {{ units }} dehors avec une pluie glaciale."] + }, + { + "label": "weather.after-tomorrow.success.sleet", + "answers": ["Après demain il fera {{ temperature }} {{ units }} dehors avec une pluie glaciale."] + }, + { + "label": "weather.day.success.sleet", + "answers": ["%day% il fera {{ temperature }} {{ units }} dehors avec une pluie glaciale."] }, { "label": "weather.get.success.wind", "answers": ["Le temps est venteux aujourd'hui, et il fait {{ temperature }} {{ units }}."] }, + { + "label": "weather.tomorrow.success.wind", + "answers": ["Demain le temps sera venteux dehors et la température sera de {{ temperature }} {{ units }}."] + }, + { + "label": "weather.after-tomorrow.success.wind", + "answers": ["Après demain le temps sera venteux dehors et la température sera de {{ temperature }} {{ units }}."] + }, + { + "label": "weather.day.success.wind", + "answers": ["%day% le temps sera venteux dehors et la tempérture sera de {{ temperature }} {{ units }}."] + }, { "label": "weather.get.success.unknown", "answers": ["La température est de {{ temperature }} {{ units }}."] }, + { + "label": "weather.tomorrow.success.unknown", + "answers": ["Demain la température sera de {{ temperature }} {{ units }}."] + }, + { + "label": "weather.after-tomorrow.success.unknown", + "answers": ["Après demain la température sera de {{ temperature }} {{ units }}."] + }, + { + "label": "weather.day.success.unknown", + "answers": ["%day% la tempérture sera de {{ temperature }} {{ units }}."] + }, { "label": "weather.get.fail", "answers": ["Je n'ai pas réussi à récupérer la météo..."] @@ -44,5 +140,9 @@ "answers": [ "Vous devez d'abord configurer votre maison et la positionner sur la carte pour utiliser cette fonctionnalité." ] + }, + { + "label": "weather.get.fail.no-weather", + "answers": ["Les prévision météorologiques pour ce jour sont introuvables."] } ] diff --git a/server/config/brain/weather/questions.en.json b/server/config/brain/weather/questions.en.json index b6821d0180..89fd920f26 100644 --- a/server/config/brain/weather/questions.en.json +++ b/server/config/brain/weather/questions.en.json @@ -2,5 +2,25 @@ { "label": "weather.get", "questions": ["What's the weather like?"] + }, + { + "label": "weather.tomorrow", + "questions": ["Give me the weather for tomorrow", "What will the weather be like tomorrow ?", "weather tomorrow ?"] + }, + { + "label": "weather.after.tomorrow", + "questions": [ + "Give me the weather for afer tomorrow", + "What will the weather be like afer tomorrow ?", + "weather afer tomorrow ?" + ] + }, + { + "label": "weather.day", + "questions": [ + "Give me the weather for %day%", + "What will the weather be like %day% ?", + "weather %day% ?" + ] } ] diff --git a/server/config/brain/weather/questions.fr.json b/server/config/brain/weather/questions.fr.json index 716a927afa..90d9681eec 100644 --- a/server/config/brain/weather/questions.fr.json +++ b/server/config/brain/weather/questions.fr.json @@ -2,5 +2,32 @@ { "label": "weather.get", "questions": ["Quel temps fait-il ?", "Donne moi la météo"] + }, + { + "label": "weather.tomorrow", + "questions": [ + "Quel temps fait-il demain ?", + "Donne moi la météo pour demain", + "Quel temps fera t'il demain ?", + "Météo demain ?" + ] + }, + { + "label": "weather.after.tomorrow", + "questions": [ + "Quel temps fait-il après demain ?", + "Donne moi la météo pour après demain", + "Quel temps fera t'il après demain ?", + "Météo après demain ?" + ] + }, + { + "label": "weather.day", + "questions": [ + "Quel temps fait-il %day% ?", + "Donne moi la météo pour %day%", + "Quel temps fera t'il %day% ?", + "Météo %day% ?" + ] } ] From c3d36c6632523101dafef2ac99e432fafac0b934 Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Tue, 15 Dec 2020 09:45:19 +0100 Subject: [PATCH 08/25] pretty --- server/config/brain/weather/questions.en.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/server/config/brain/weather/questions.en.json b/server/config/brain/weather/questions.en.json index 89fd920f26..5ab2ac13f4 100644 --- a/server/config/brain/weather/questions.en.json +++ b/server/config/brain/weather/questions.en.json @@ -17,10 +17,6 @@ }, { "label": "weather.day", - "questions": [ - "Give me the weather for %day%", - "What will the weather be like %day% ?", - "weather %day% ?" - ] + "questions": ["Give me the weather for %day%", "What will the weather be like %day% ?", "weather %day% ?"] } ] From 88369f4bd30f6193b83590869af8e6a4600089e1 Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Tue, 15 Dec 2020 13:33:28 +0100 Subject: [PATCH 09/25] fix weather-after.tomorrow --- server/config/brain/weather/questions.en.json | 2 +- server/config/brain/weather/questions.fr.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/config/brain/weather/questions.en.json b/server/config/brain/weather/questions.en.json index 5ab2ac13f4..06df86e6aa 100644 --- a/server/config/brain/weather/questions.en.json +++ b/server/config/brain/weather/questions.en.json @@ -8,7 +8,7 @@ "questions": ["Give me the weather for tomorrow", "What will the weather be like tomorrow ?", "weather tomorrow ?"] }, { - "label": "weather.after.tomorrow", + "label": "weather-after.tomorrow", "questions": [ "Give me the weather for afer tomorrow", "What will the weather be like afer tomorrow ?", diff --git a/server/config/brain/weather/questions.fr.json b/server/config/brain/weather/questions.fr.json index 90d9681eec..1ab76f77a3 100644 --- a/server/config/brain/weather/questions.fr.json +++ b/server/config/brain/weather/questions.fr.json @@ -13,7 +13,7 @@ ] }, { - "label": "weather.after.tomorrow", + "label": "weather.after-tomorrow", "questions": [ "Quel temps fait-il après demain ?", "Donne moi la météo pour après demain", From 26db5a59be10f57d0b23de103f9c33ba944a7fdd Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Sat, 19 Dec 2020 21:50:27 +0100 Subject: [PATCH 10/25] Add weather into brain --- front/src/actions/dashboard/boxes/weather.js | 1 + server/config/brain/weather/answers.en.json | 168 ++++++++++++++-- server/config/brain/weather/answers.fr.json | 183 +++++++++++------- server/config/brain/weather/questions.en.json | 19 +- server/config/brain/weather/questions.fr.json | 22 --- server/lib/weather/weather.command.js | 107 +++++----- .../services/openweather/lib/formatResults.js | 2 +- .../test/lib/weather/weather.command.test.js | 114 ++++++++--- 8 files changed, 415 insertions(+), 201 deletions(-) diff --git a/front/src/actions/dashboard/boxes/weather.js b/front/src/actions/dashboard/boxes/weather.js index f664685839..622488578a 100644 --- a/front/src/actions/dashboard/boxes/weather.js +++ b/front/src/actions/dashboard/boxes/weather.js @@ -36,6 +36,7 @@ function createActions(store) { hour.weatherIcon = translateWeatherToFeIcon(hour.weather); hour.datetime_beautiful = dayjs(hour.datetime).format('HH'); }); + weather.days.shift(); weather.days.map(day => { day.weather_icon = translateWeatherToFeIcon(day.weather); day.datetime_beautiful = dayjs(day.datetime).format('dddd'); diff --git a/server/config/brain/weather/answers.en.json b/server/config/brain/weather/answers.en.json index 1469c16e9d..7957980542 100644 --- a/server/config/brain/weather/answers.en.json +++ b/server/config/brain/weather/answers.en.json @@ -1,36 +1,179 @@ [ { - "label": "weather.get.success.snow", + "label": "weather.get.success.now.snow", "answers": ["It's snowing outside and the temperature is {{ temperature }} {{ units }}."] }, { - "label": "weather.get.success.rain", + "label": "weather.get.success.now.rain", "answers": ["It's raining and temperature outside is {{ temperature }} {{ units }}."] }, { - "label": "weather.get.success.clear", + "label": "weather.get.success.now.clear", "answers": ["It's a clear day today. Temperature outside is {{ temperature }} {{ units }}."] }, { - "label": "weather.get.success.cloud", + "label": "weather.get.success.now.cloud", "answers": ["It's cloudy outside and temperature is {{ temperature }} {{ units }}."] }, { - "label": "weather.get.success.fog", + "label": "weather.get.success.now.fog", "answers": ["Foggy day today. Temperature outside is {{ temperature }} {{ units }}."] }, { - "label": "weather.get.success.sleet", + "label": "weather.get.success.now.sleet", "answers": ["Temperature outside is {{ temperature }} {{ units }}, with freezing rain and sleet."] }, { - "label": "weather.get.success.wind", + "label": "weather.get.success.now.wind", "answers": ["Windy day today. Temperature outside is {{ temperature }} {{ units }}."] }, { - "label": "weather.get.success.unknown", + "label": "weather.get.success.now.unknown", "answers": ["Temperature outside is {{ temperature }} {{ units }}."] }, + + + { + "label": "weather.get.success.today.snow", + "answers": ["Aujourd'hui, il neige et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.today.rain", + "answers": ["Aujourd'hui, il pleut et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.today.clear", + "answers": ["Aujourd'hui, le ciel est degagé et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.today.cloud", + "answers": ["Aujourd'hui, le ciel est nuageux et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.today.fog", + "answers": ["Aujourd'hui, il y a du brouillard et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.today.sleet", + "answers": ["Aujourd'hui, la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial."] + }, + { + "label": "weather.get.success.today.wind", + "answers": ["Aujourd'hui, Il y a beaucoup de vent et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.today.unknown", + "answers": ["Aujourd'hui, la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + + + + { + "label": "weather.get.success.tomorrow.snow", + "answers": ["Demain il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.tomorrow.rain", + "answers": ["Demain il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.tomorrow.clear", + "answers": ["Demain le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.tomorrow.cloud", + "answers": ["Demain il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.tomorrow.fog", + "answers": ["Demain il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.tomorrow.sleet", + "answers": ["Demain la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial."] + }, + { + "label": "weather.get.success.tomorrow.wind", + "answers": ["Demain le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.tomorrow.unknown", + "answers": ["Demain la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + + + + + { + "label": "weather.get.success.after-tomorrow.snow", + "answers": ["Après demain il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.after-tomorrow.rain", + "answers": ["Après demain il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.after-tomorrow.clear", + "answers": ["Après demain le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.after-tomorrow.cloud", + "answers": ["Après demain il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.after-tomorrow.fog", + "answers": ["Après demain il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.after-tomorrow.sleet", + "answers": ["Après demain la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial."] + }, + { + "label": "weather.get.success.after-tomorrow.wind", + "answers": ["Après demain le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.after-tomorrow.unknown", + "answers": ["Après demain la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + + + + { + "label": "weather.get.success.day.snow", + "answers": ["{{ day }} il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.day.rain", + "answers": ["{{ day }} il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.day.clear", + "answers": ["{{ day }} le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.day.cloud", + "answers": ["{{ day }} il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.day.fog", + "answers": ["{{ day }} il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.day.sleet", + "answers": ["{{ day }} la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial."] + }, + { + "label": "weather.get.success.day.wind", + "answers": ["{{ day }} le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.day.unknown", + "answers": ["{{ day }} la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + + + { "label": "weather.get.fail", "answers": ["There was an error while getting the weather."] @@ -39,12 +182,13 @@ "label": "weather.get.fail.not-configured", "answers": ["You need to configure the OpenWeather API in the Integration tab before using this feature."] }, - { - "label": "weather.get.fail.no-house", - "answers": ["You need to first configure your house and its location in parameters."] - }, { "label": "weather.get.fail.no-weather", "answers": ["The weather forecast for that day couldn't be found."] + }, + { + "label": "weather.get.fail.no-house", + "answers": ["You need to first configure your house and its location in parameters."] } + ] diff --git a/server/config/brain/weather/answers.fr.json b/server/config/brain/weather/answers.fr.json index 837d29ab99..0cfd42e370 100644 --- a/server/config/brain/weather/answers.fr.json +++ b/server/config/brain/weather/answers.fr.json @@ -1,132 +1,181 @@ [ { - "label": "weather.get.success.snow", + "label": "weather.get.success.now.snow", "answers": ["Il neige dehors et la température est de {{ temperature }} {{ units }}."] }, { - "label": "weather.tomorrow.success.snow", - "answers": ["Demain il va neiger dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.now.rain", + "answers": ["Il pleut dehors et la température est de {{ temperature }} {{ units }}."] }, { - "label": "weather.after-tomorrow.success.snow", - "answers": ["Après demain il va neiger dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.now.clear", + "answers": ["Le ciel est dégagé dehors et la température est de {{ temperature }} {{ units }}."] }, { - "label": "weather.day.success.snow", - "answers": ["%day% il va neiger dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.now.cloud", + "answers": ["Il fait nuageux dehors et la température est de {{ temperature }} {{ units }}."] }, { - "label": "weather.get.success.rain", - "answers": ["Il pleut dehors et la température est de {{ temperature }} {{ units }}."] + "label": "weather.get.success.now.fog", + "answers": ["Il y a du brouillard dehors et la température est de {{ temperature }} {{ units }}."] }, { - "label": "weather.tomorrow.success.rain", - "answers": ["Demain il va pleuvoir dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.now.sleet", + "answers": ["Il fait {{ temperature }} {{ units }} dehors avec une pluie glaciale."] }, { - "label": "weather.after-tomorrow.success.rain", - "answers": ["Après demain il va pleuvoir dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.now.wind", + "answers": ["Le temps est venteux aujourd'hui, et il fait {{ temperature }} {{ units }}."] }, { - "label": "weather.day.success.rain", - "answers": ["%day% il va pleuvoir dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.now.unknown", + "answers": ["La température est de {{ temperature }} {{ units }}."] }, + + + { - "label": "weather.get.success.clear", - "answers": ["Le ciel est dégagé dehors et la température est de {{ temperature }} {{ units }}."] + "label": "weather.get.success.today.snow", + "answers": ["Aujourd'hui, il neige et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.tomorrow.success.clear", - "answers": ["Demain le ciel sera dégagé dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.today.rain", + "answers": ["Aujourd'hui, il pleut et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.after-tomorrow.success.clear", - "answers": ["Après demain le ciel sera dégagé dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.today.clear", + "answers": ["Aujourd'hui, le ciel est degagé et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.day.success.clear", - "answers": ["%day% le ciel sera degagé dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.today.cloud", + "answers": ["Aujourd'hui, le ciel est nuageux et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.get.success.cloud", - "answers": ["Il fait nuageux dehors et la température est de {{ temperature }} {{ units }}."] + "label": "weather.get.success.today.fog", + "answers": ["Aujourd'hui, il y a du brouillard et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.tomorrow.success.cloud", - "answers": ["Demain il y aura des nuages dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.today.sleet", + "answers": ["Aujourd'hui, la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial."] }, { - "label": "weather.after-tomorrow.success.cloud", - "answers": ["Après demain il y aura des nuages dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.today.wind", + "answers": ["Aujourd'hui, Il y a beaucoup de vent et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.day.success.cloud", - "answers": ["%day% il y aura des nuages dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.today.unknown", + "answers": ["Aujourd'hui, la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, + + + { - "label": "weather.get.success.fog", - "answers": ["Il y a du brouillard dehors et la température est de {{ temperature }} {{ units }}."] + "label": "weather.get.success.tomorrow.snow", + "answers": ["Demain il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.tomorrow.success.fog", - "answers": ["Demain il y aura du brouillard dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.tomorrow.rain", + "answers": ["Demain il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.after-tomorrow.success.fog", - "answers": ["Après demain il y aura du brouillard dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.tomorrow.clear", + "answers": ["Demain le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.day.success.fog", - "answers": ["%day% il y aura du brouillard dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.tomorrow.cloud", + "answers": ["Demain il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.get.success.sleet", - "answers": ["Il fait {{ temperature }} {{ units }} dehors avec une pluie glaciale."] + "label": "weather.get.success.tomorrow.fog", + "answers": ["Demain il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.tomorrow.success.sleet", - "answers": ["Demain il fera {{ temperature }} {{ units }} dehors avec une pluie glaciale."] + "label": "weather.get.success.tomorrow.sleet", + "answers": ["Demain la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial."] }, { - "label": "weather.after-tomorrow.success.sleet", - "answers": ["Après demain il fera {{ temperature }} {{ units }} dehors avec une pluie glaciale."] + "label": "weather.get.success.tomorrow.wind", + "answers": ["Demain le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.day.success.sleet", - "answers": ["%day% il fera {{ temperature }} {{ units }} dehors avec une pluie glaciale."] + "label": "weather.get.success.tomorrow.unknown", + "answers": ["Demain la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, + + + { - "label": "weather.get.success.wind", - "answers": ["Le temps est venteux aujourd'hui, et il fait {{ temperature }} {{ units }}."] + "label": "weather.get.success.after-tomorrow.snow", + "answers": ["Après demain il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.tomorrow.success.wind", - "answers": ["Demain le temps sera venteux dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.after-tomorrow.rain", + "answers": ["Après demain il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.after-tomorrow.success.wind", - "answers": ["Après demain le temps sera venteux dehors et la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.after-tomorrow.clear", + "answers": ["Après demain le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.day.success.wind", - "answers": ["%day% le temps sera venteux dehors et la tempérture sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.after-tomorrow.cloud", + "answers": ["Après demain il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.get.success.unknown", - "answers": ["La température est de {{ temperature }} {{ units }}."] + "label": "weather.get.success.after-tomorrow.fog", + "answers": ["Après demain il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.after-tomorrow.sleet", + "answers": ["Après demain la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial."] + }, + { + "label": "weather.get.success.after-tomorrow.wind", + "answers": ["Après demain le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.after-tomorrow.unknown", + "answers": ["Après demain la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + + + + + { + "label": "weather.get.success.day.snow", + "answers": ["{{ day }} il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.day.rain", + "answers": ["{{ day }} il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.tomorrow.success.unknown", - "answers": ["Demain la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.day.clear", + "answers": ["{{ day }} le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.after-tomorrow.success.unknown", - "answers": ["Après demain la température sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.day.cloud", + "answers": ["{{ day }} il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, { - "label": "weather.day.success.unknown", - "answers": ["%day% la tempérture sera de {{ temperature }} {{ units }}."] + "label": "weather.get.success.day.fog", + "answers": ["{{ day }} il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] }, + { + "label": "weather.get.success.day.sleet", + "answers": ["{{ day }} la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial."] + }, + { + "label": "weather.get.success.day.wind", + "answers": ["{{ day }} le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + { + "label": "weather.get.success.day.unknown", + "answers": ["{{ day }} la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + }, + + + + { "label": "weather.get.fail", "answers": ["Je n'ai pas réussi à récupérer la météo..."] @@ -135,14 +184,14 @@ "label": "weather.get.fail.not-configured", "answers": ["Vous devez configurer un service de météo avant de pouvoir utiliser cette fonctionnalité."] }, + { + "label": "weather.get.fail.no-weather", + "answers": ["Les prévision météorologiques pour ce jour sont introuvables."] + }, { "label": "weather.get.fail.no-house", "answers": [ "Vous devez d'abord configurer votre maison et la positionner sur la carte pour utiliser cette fonctionnalité." ] - }, - { - "label": "weather.get.fail.no-weather", - "answers": ["Les prévision météorologiques pour ce jour sont introuvables."] } ] diff --git a/server/config/brain/weather/questions.en.json b/server/config/brain/weather/questions.en.json index 06df86e6aa..35fdf0e7ad 100644 --- a/server/config/brain/weather/questions.en.json +++ b/server/config/brain/weather/questions.en.json @@ -1,22 +1,11 @@ [ { "label": "weather.get", - "questions": ["What's the weather like?"] - }, - { - "label": "weather.tomorrow", - "questions": ["Give me the weather for tomorrow", "What will the weather be like tomorrow ?", "weather tomorrow ?"] - }, - { - "label": "weather-after.tomorrow", "questions": [ - "Give me the weather for afer tomorrow", - "What will the weather be like afer tomorrow ?", - "weather afer tomorrow ?" + "What's the weather like?", + "Give me the weather for tomorrow", + "What will the weather be like %day% ?", + "weather %day% ?" ] - }, - { - "label": "weather.day", - "questions": ["Give me the weather for %day%", "What will the weather be like %day% ?", "weather %day% ?"] } ] diff --git a/server/config/brain/weather/questions.fr.json b/server/config/brain/weather/questions.fr.json index 1ab76f77a3..c0cd328f2d 100644 --- a/server/config/brain/weather/questions.fr.json +++ b/server/config/brain/weather/questions.fr.json @@ -1,28 +1,6 @@ [ { "label": "weather.get", - "questions": ["Quel temps fait-il ?", "Donne moi la météo"] - }, - { - "label": "weather.tomorrow", - "questions": [ - "Quel temps fait-il demain ?", - "Donne moi la météo pour demain", - "Quel temps fera t'il demain ?", - "Météo demain ?" - ] - }, - { - "label": "weather.after-tomorrow", - "questions": [ - "Quel temps fait-il après demain ?", - "Donne moi la météo pour après demain", - "Quel temps fera t'il après demain ?", - "Météo après demain ?" - ] - }, - { - "label": "weather.day", "questions": [ "Quel temps fait-il %day% ?", "Donne moi la météo pour %day%", diff --git a/server/lib/weather/weather.command.js b/server/lib/weather/weather.command.js index 39f24bed9e..d988f94b2c 100644 --- a/server/lib/weather/weather.command.js +++ b/server/lib/weather/weather.command.js @@ -1,96 +1,81 @@ const dayjs = require('dayjs'); const logger = require('../../utils/logger'); -const { ServiceNotConfiguredError, NoValuesFoundError, NotFoundError } = require('../../utils/coreErrors'); +const { ServiceNotConfiguredError, NoValuesFoundError } = require('../../utils/coreErrors'); const { INTENTS } = require('../../utils/constants'); const { NoWeatherFoundError } = require('./weather.error'); -const DAYS_OF_WEEKS = { - sunday: 0, - monday: 1, - tuesday: 2, - wednesday: 3, - thursday: 4, - friday: 5, - saturday: 6, -}; /** - * @description Get the weather by a day. - * @param {Object} weather - The weather object return by the external service. - * @param {string} day - The requested day. - * @returns {Object} The weather object for the requested day. + * @description Capitalize First Letter. + * @param {string} string - The word. + * @returns {string} The capitalized first letter word. * @example - * getWeatherByDay(weather, day); + * capitalizeFirstLetter('word'); */ -function getWeatherByDay(weather, day) { - const filterWeatherDays = weather.days.filter((weatherDay) => { - return dayjs(weatherDay.datetime).day() === DAYS_OF_WEEKS[day]; - }); - return filterWeatherDays.length === 1 ? filterWeatherDays[0] : undefined; +function capitalizeFirstLetter(string) { + return string.charAt(0).toUpperCase() + string.slice(1); } + /** * @description Get the weather in a text request. * @param {Object} message - The message sent by the user. * @param {Object} classification - The classification calculated by the brain. * @param {Object} context - The context object containing found variables in question. + * @returns {Object} Nothing. * @example * weather.command(message, classification, context); */ async function command(message, classification, context) { - let weather; - let weatherDay; try { const houses = await this.house.get(); const house = houses[0]; if (!house || !house.latitude || !house.longitude) { throw new NoValuesFoundError(); } - weather = await this.get(house); - switch (`intent.${classification.intent}`) { - case INTENTS.WEATHER.GET: + const weather = await this.get(house); + + if(`intent.${classification.intent}` === INTENTS.WEATHER.GET){ + const dateEntity = classification.entities.find((entity) => entity.entity === 'date'); + // console.log(dateEntity); + + if(dateEntity === undefined){ + // current day context.temperature = weather.temperature; context.units = weather.units === 'metric' ? '°C' : '°F'; - await this.messageManager.replyByIntent(message, `weather.get.success.${weather.weather}`, context); - break; - case INTENTS.WEATHER.TOMORROW: - context.temperature_min = weather.days[0].temperature_min; - context.temperature_max = weather.days[0].temperature_max; - context.units = weather.units === 'metric' ? '°C' : '°F'; - await this.messageManager.replyByIntent( - message, - `weather.tomorrow.success.${weather.days[0].weather}`, - context, - ); - break; - case INTENTS.WEATHER.AFTER_TOMORROW: - context.temperature_min = weather.days[1].temperature_min; - context.temperature_max = weather.days[1].temperature_max; - context.units = weather.units === 'metric' ? '°C' : '°F'; - await this.messageManager.replyByIntent( - message, - `weather.after-tomorrow.success.${weather.days[1].weather}`, - context, - ); - break; - case INTENTS.WEATHER.DAY: - if (!context.day) { - throw new NotFoundError('day not found'); + await this.messageManager.replyByIntent(message, `weather.get.success.now.${weather.weather}`, context); + }else{ + let diff; + if(dateEntity.resolution.type === 'interval'){ + diff = dayjs(dateEntity.resolution.strFutureValue).diff(dayjs().startOf('day'), 'day'); + }else{ + diff = dayjs(dateEntity.resolution.date).diff(dayjs().startOf('day'), 'day'); } - weatherDay = getWeatherByDay(weather, context.day); - if (!weatherDay) { + const weatherDay = weather.days[diff]; + + if(weatherDay !== undefined){ + context.temperature_min = weatherDay.temperature_min; + context.temperature_max = weatherDay.temperature_max; + context.units = weather.units === 'metric' ? '°C' : '°F'; + + if(diff <= 2 ){ + const days1 = ['today', 'tomorrow', 'after-tomorrow']; + const day = days1[diff]; + + await this.messageManager.replyByIntent(message, `weather.get.success.${day}.${weatherDay.weather}`, context); + }else{ + context.day = capitalizeFirstLetter(dateEntity.sourceText); + await this.messageManager.replyByIntent(message, `weather.get.success.day.${weatherDay.weather}`, context); + } + }else{ throw new NoWeatherFoundError('weather for this day not found'); } - context.temperature_min = weatherDay.temperature_min; - context.temperature_max = weatherDay.temperature_max; - context.units = weather.units === 'metric' ? '°C' : '°F'; - await this.messageManager.replyByIntent(message, `weather.day.success.${weatherDay.weather}`, context); - break; - - default: - throw new Error('Not found'); + } + }else{ + throw new Error('Not found'); } + } catch (e) { logger.debug(e); if (e instanceof ServiceNotConfiguredError) { @@ -98,7 +83,7 @@ async function command(message, classification, context) { } else if (e instanceof NoValuesFoundError) { this.messageManager.replyByIntent(message, 'weather.get.fail.no-house', context); } else if (e instanceof NoWeatherFoundError) { - await this.messageManager.replyByIntent(message, `weather.get.fail.no-weather`, context); + this.messageManager.replyByIntent(message, `weather.get.fail.no-weather`, context); } else { this.messageManager.replyByIntent(message, 'weather.get.fail', context); } diff --git a/server/services/openweather/lib/formatResults.js b/server/services/openweather/lib/formatResults.js index e74fbdde79..58a9ccaac6 100644 --- a/server/services/openweather/lib/formatResults.js +++ b/server/services/openweather/lib/formatResults.js @@ -68,7 +68,7 @@ function formatResults(options, result) { if (result.daily) { const dataDaily = result.daily; dataToReturn.days = []; - for (let i = 1; i < dataDaily.length; i += 1) { + for (let i = 0; i < dataDaily.length; i += 1) { dataToReturn.days.push({ temperature_min: Math.round(dataDaily[i].temp.min), temperature_max: Math.round(dataDaily[i].temp.max), diff --git a/server/test/lib/weather/weather.command.test.js b/server/test/lib/weather/weather.command.test.js index 9ff36b31cf..11f8c6aa50 100644 --- a/server/test/lib/weather/weather.command.test.js +++ b/server/test/lib/weather/weather.command.test.js @@ -1,5 +1,6 @@ const { fake, assert } = require('sinon'); const EvenEmitter = require('events'); +const dayjs = require('dayjs'); const Weather = require('../../../lib/weather'); const event = new EvenEmitter(); @@ -125,7 +126,7 @@ describe('weather.command', () => { }; }); - it('should get the weather', async () => { + it('should get the current weather', async () => { const weather = new Weather(service, event, messageManager, houses); const message = { text: 'Meteo ?', @@ -134,14 +135,42 @@ describe('weather.command', () => { message, { intent: 'weather.get', + entities: [] }, {}, ); - assert.calledWith(messageManager.replyByIntent, message, 'weather.get.success.cloud', { + assert.calledWith(messageManager.replyByIntent, message, 'weather.get.success.now.cloud', { temperature: 54.87, units: '°C', }); }); + it('should get the weather for today', async () => { + const weather = new Weather(service, event, messageManager, houses); + const message = { + text: 'Meteo Today?', + }; + await weather.command( + message, + { + intent: 'weather.get', + entities: [ + { + entity: 'date', + resolution: { + type: 'date', + date: dayjs().toDate() + } + } + ] + }, + {}, + ); + assert.calledWith(messageManager.replyByIntent, message, 'weather.get.success.today.rain', { + temperature_max: 11, + temperature_min: 6, + units: '°C', + }); + }); it('should get the weather for tomorrow', async () => { const weather = new Weather(service, event, messageManager, houses); const message = { @@ -150,13 +179,22 @@ describe('weather.command', () => { await weather.command( message, { - intent: 'weather.tomorrow', + intent: 'weather.get', + entities: [ + { + entity: 'date', + resolution: { + type: 'date', + date: dayjs().add(1, 'day').toDate() + } + } + ] }, {}, ); - assert.calledWith(messageManager.replyByIntent, message, 'weather.tomorrow.success.rain', { - temperature_max: 11, - temperature_min: 6, + assert.calledWith(messageManager.replyByIntent, message, 'weather.get.success.tomorrow.clear', { + temperature_max: 9, + temperature_min: 4, units: '°C', }); }); @@ -168,13 +206,22 @@ describe('weather.command', () => { await weather.command( message, { - intent: 'weather.after-tomorrow', + intent: 'weather.get', + entities: [ + { + entity: 'date', + resolution: { + type: 'date', + date: dayjs().add(2, 'days').toDate() + } + } + ] }, {}, ); - assert.calledWith(messageManager.replyByIntent, message, 'weather.after-tomorrow.success.clear', { + assert.calledWith(messageManager.replyByIntent, message, 'weather.get.success.after-tomorrow.cloud', { temperature_max: 9, - temperature_min: 4, + temperature_min: 5, units: '°C', }); }); @@ -187,15 +234,23 @@ describe('weather.command', () => { await weather.command( message, { - intent: 'weather.day', - }, - { - day: 'sunday', + intent: 'weather.get', + entities: [ + { + entity: 'date', + sourceText: 'sunday', + resolution: { + type: 'interval', + strFutureValue: dayjs().add(4, 'days').toDate() + } + } + ] }, + {}, ); - assert.calledWith(messageManager.replyByIntent, message, 'weather.day.success.cloud', { - day: 'sunday', - temperature_max: 9, + assert.calledWith(messageManager.replyByIntent, message, 'weather.get.success.day.rain', { + day: 'Sunday', + temperature_max: 6, temperature_min: 5, units: '°C', }); @@ -208,26 +263,39 @@ describe('weather.command', () => { await weather.command( message, { - intent: 'weather.day', + intent: 'weather.get', + entities: [], }, {}, ); - assert.calledWith(messageManager.replyByIntent, message, 'weather.get.fail', {}); + assert.calledWith(messageManager.replyByIntent, message, 'weather.get.success.now.cloud', { + temperature: 54.87, + units: '°C', + }); }); - it("shouldn't get the weather without a good day", async () => { + it("shouldn't get the weather with a too far day", async () => { const weather = new Weather(service, event, messageManager, houses); const message = { - text: 'Meteo next december?', + text: 'Meteo next far day?', }; await weather.command( message, { - intent: 'weather.day', + intent: 'weather.get', + entities: [ + { + entity: 'date', + sourceText: 'sunday', + resolution: { + type: 'interval', + strFutureValue: dayjs().add(30, 'days').toDate() + } + } + ] }, { - day: 'december', }, ); - assert.calledWith(messageManager.replyByIntent, message, 'weather.get.fail.no-weather', { day: 'december' }); + assert.calledWith(messageManager.replyByIntent, message, 'weather.get.fail.no-weather', {}); }); }); From 53d514ae3323f4affbb2cd43614df3efb3e3beab Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Sat, 19 Dec 2020 21:51:56 +0100 Subject: [PATCH 11/25] Add weather into brain --- server/config/brain/weather/answers.en.json | 139 +++++++++++------ server/config/brain/weather/answers.fr.json | 140 ++++++++++++------ server/lib/weather/weather.command.js | 29 ++-- .../test/lib/weather/weather.command.test.js | 73 ++++----- 4 files changed, 247 insertions(+), 134 deletions(-) diff --git a/server/config/brain/weather/answers.en.json b/server/config/brain/weather/answers.en.json index 7957980542..b63f3f8734 100644 --- a/server/config/brain/weather/answers.en.json +++ b/server/config/brain/weather/answers.en.json @@ -32,148 +32,202 @@ "answers": ["Temperature outside is {{ temperature }} {{ units }}."] }, - { "label": "weather.get.success.today.snow", - "answers": ["Aujourd'hui, il neige et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Aujourd'hui, il neige et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.today.rain", - "answers": ["Aujourd'hui, il pleut et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Aujourd'hui, il pleut et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.today.clear", - "answers": ["Aujourd'hui, le ciel est degagé et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Aujourd'hui, le ciel est degagé et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.today.cloud", - "answers": ["Aujourd'hui, le ciel est nuageux et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Aujourd'hui, le ciel est nuageux et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.today.fog", - "answers": ["Aujourd'hui, il y a du brouillard et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Aujourd'hui, il y a du brouillard et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.today.sleet", - "answers": ["Aujourd'hui, la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial."] + "answers": [ + "Aujourd'hui, la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial." + ] }, { "label": "weather.get.success.today.wind", - "answers": ["Aujourd'hui, Il y a beaucoup de vent et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Aujourd'hui, Il y a beaucoup de vent et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.today.unknown", - "answers": ["Aujourd'hui, la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Aujourd'hui, la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, - - { "label": "weather.get.success.tomorrow.snow", - "answers": ["Demain il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Demain il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.tomorrow.rain", - "answers": ["Demain il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Demain il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.tomorrow.clear", - "answers": ["Demain le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Demain le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.tomorrow.cloud", - "answers": ["Demain il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Demain il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.tomorrow.fog", - "answers": ["Demain il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Demain il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.tomorrow.sleet", - "answers": ["Demain la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial."] + "answers": [ + "Demain la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial." + ] }, { "label": "weather.get.success.tomorrow.wind", - "answers": ["Demain le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Demain le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.tomorrow.unknown", - "answers": ["Demain la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Demain la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, - - - { "label": "weather.get.success.after-tomorrow.snow", - "answers": ["Après demain il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Après demain il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.after-tomorrow.rain", - "answers": ["Après demain il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Après demain il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.after-tomorrow.clear", - "answers": ["Après demain le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Après demain le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.after-tomorrow.cloud", - "answers": ["Après demain il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Après demain il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.after-tomorrow.fog", - "answers": ["Après demain il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Après demain il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.after-tomorrow.sleet", - "answers": ["Après demain la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial."] + "answers": [ + "Après demain la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial." + ] }, { "label": "weather.get.success.after-tomorrow.wind", - "answers": ["Après demain le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Après demain le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.after-tomorrow.unknown", - "answers": ["Après demain la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Après demain la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, - - { "label": "weather.get.success.day.snow", - "answers": ["{{ day }} il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "{{ day }} il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.day.rain", - "answers": ["{{ day }} il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "{{ day }} il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.day.clear", - "answers": ["{{ day }} le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "{{ day }} le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.day.cloud", - "answers": ["{{ day }} il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "{{ day }} il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.day.fog", - "answers": ["{{ day }} il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "{{ day }} il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.day.sleet", - "answers": ["{{ day }} la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial."] + "answers": [ + "{{ day }} la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial." + ] }, { "label": "weather.get.success.day.wind", - "answers": ["{{ day }} le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "{{ day }} le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.day.unknown", - "answers": ["{{ day }} la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "{{ day }} la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, - - { "label": "weather.get.fail", "answers": ["There was an error while getting the weather."] @@ -190,5 +244,4 @@ "label": "weather.get.fail.no-house", "answers": ["You need to first configure your house and its location in parameters."] } - ] diff --git a/server/config/brain/weather/answers.fr.json b/server/config/brain/weather/answers.fr.json index 0cfd42e370..823c197872 100644 --- a/server/config/brain/weather/answers.fr.json +++ b/server/config/brain/weather/answers.fr.json @@ -32,150 +32,202 @@ "answers": ["La température est de {{ temperature }} {{ units }}."] }, - - { "label": "weather.get.success.today.snow", - "answers": ["Aujourd'hui, il neige et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Aujourd'hui, il neige et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.today.rain", - "answers": ["Aujourd'hui, il pleut et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Aujourd'hui, il pleut et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.today.clear", - "answers": ["Aujourd'hui, le ciel est degagé et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Aujourd'hui, le ciel est degagé et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.today.cloud", - "answers": ["Aujourd'hui, le ciel est nuageux et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Aujourd'hui, le ciel est nuageux et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.today.fog", - "answers": ["Aujourd'hui, il y a du brouillard et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Aujourd'hui, il y a du brouillard et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.today.sleet", - "answers": ["Aujourd'hui, la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial."] + "answers": [ + "Aujourd'hui, la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial." + ] }, { "label": "weather.get.success.today.wind", - "answers": ["Aujourd'hui, Il y a beaucoup de vent et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Aujourd'hui, Il y a beaucoup de vent et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.today.unknown", - "answers": ["Aujourd'hui, la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Aujourd'hui, la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, - - { "label": "weather.get.success.tomorrow.snow", - "answers": ["Demain il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Demain il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.tomorrow.rain", - "answers": ["Demain il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Demain il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.tomorrow.clear", - "answers": ["Demain le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Demain le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.tomorrow.cloud", - "answers": ["Demain il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Demain il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.tomorrow.fog", - "answers": ["Demain il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Demain il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.tomorrow.sleet", - "answers": ["Demain la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial."] + "answers": [ + "Demain la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial." + ] }, { "label": "weather.get.success.tomorrow.wind", - "answers": ["Demain le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Demain le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.tomorrow.unknown", - "answers": ["Demain la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Demain la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, - - { "label": "weather.get.success.after-tomorrow.snow", - "answers": ["Après demain il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Après demain il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.after-tomorrow.rain", - "answers": ["Après demain il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Après demain il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.after-tomorrow.clear", - "answers": ["Après demain le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Après demain le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.after-tomorrow.cloud", - "answers": ["Après demain il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Après demain il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.after-tomorrow.fog", - "answers": ["Après demain il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Après demain il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.after-tomorrow.sleet", - "answers": ["Après demain la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial."] + "answers": [ + "Après demain la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial." + ] }, { "label": "weather.get.success.after-tomorrow.wind", - "answers": ["Après demain le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Après demain le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.after-tomorrow.unknown", - "answers": ["Après demain la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "Après demain la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, - - - { "label": "weather.get.success.day.snow", - "answers": ["{{ day }} il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "{{ day }} il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.day.rain", - "answers": ["{{ day }} il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "{{ day }} il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.day.clear", - "answers": ["{{ day }} le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "{{ day }} le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.day.cloud", - "answers": ["{{ day }} il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "{{ day }} il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.day.fog", - "answers": ["{{ day }} il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "{{ day }} il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.day.sleet", - "answers": ["{{ day }} la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial."] + "answers": [ + "{{ day }} la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial." + ] }, { "label": "weather.get.success.day.wind", - "answers": ["{{ day }} le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "{{ day }} le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, { "label": "weather.get.success.day.unknown", - "answers": ["{{ day }} la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}."] + "answers": [ + "{{ day }} la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + ] }, - - - { "label": "weather.get.fail", "answers": ["Je n'ai pas réussi à récupérer la météo..."] diff --git a/server/lib/weather/weather.command.js b/server/lib/weather/weather.command.js index d988f94b2c..dbd8ab0ce8 100644 --- a/server/lib/weather/weather.command.js +++ b/server/lib/weather/weather.command.js @@ -4,7 +4,6 @@ const { ServiceNotConfiguredError, NoValuesFoundError } = require('../../utils/c const { INTENTS } = require('../../utils/constants'); const { NoWeatherFoundError } = require('./weather.error'); - /** * @description Capitalize First Letter. * @param {string} string - The word. @@ -16,7 +15,6 @@ function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } - /** * @description Get the weather in a text request. * @param {Object} message - The message sent by the user. @@ -35,47 +33,50 @@ async function command(message, classification, context) { } const weather = await this.get(house); - if(`intent.${classification.intent}` === INTENTS.WEATHER.GET){ + if (`intent.${classification.intent}` === INTENTS.WEATHER.GET) { const dateEntity = classification.entities.find((entity) => entity.entity === 'date'); // console.log(dateEntity); - if(dateEntity === undefined){ + if (dateEntity === undefined) { // current day context.temperature = weather.temperature; context.units = weather.units === 'metric' ? '°C' : '°F'; await this.messageManager.replyByIntent(message, `weather.get.success.now.${weather.weather}`, context); - }else{ + } else { let diff; - if(dateEntity.resolution.type === 'interval'){ + if (dateEntity.resolution.type === 'interval') { diff = dayjs(dateEntity.resolution.strFutureValue).diff(dayjs().startOf('day'), 'day'); - }else{ + } else { diff = dayjs(dateEntity.resolution.date).diff(dayjs().startOf('day'), 'day'); } const weatherDay = weather.days[diff]; - if(weatherDay !== undefined){ + if (weatherDay !== undefined) { context.temperature_min = weatherDay.temperature_min; context.temperature_max = weatherDay.temperature_max; context.units = weather.units === 'metric' ? '°C' : '°F'; - if(diff <= 2 ){ + if (diff <= 2) { const days1 = ['today', 'tomorrow', 'after-tomorrow']; const day = days1[diff]; - await this.messageManager.replyByIntent(message, `weather.get.success.${day}.${weatherDay.weather}`, context); - }else{ + await this.messageManager.replyByIntent( + message, + `weather.get.success.${day}.${weatherDay.weather}`, + context, + ); + } else { context.day = capitalizeFirstLetter(dateEntity.sourceText); await this.messageManager.replyByIntent(message, `weather.get.success.day.${weatherDay.weather}`, context); } - }else{ + } else { throw new NoWeatherFoundError('weather for this day not found'); } } - }else{ + } else { throw new Error('Not found'); } - } catch (e) { logger.debug(e); if (e instanceof ServiceNotConfiguredError) { diff --git a/server/test/lib/weather/weather.command.test.js b/server/test/lib/weather/weather.command.test.js index 11f8c6aa50..86c2425a38 100644 --- a/server/test/lib/weather/weather.command.test.js +++ b/server/test/lib/weather/weather.command.test.js @@ -135,7 +135,7 @@ describe('weather.command', () => { message, { intent: 'weather.get', - entities: [] + entities: [], }, {}, ); @@ -150,20 +150,20 @@ describe('weather.command', () => { text: 'Meteo Today?', }; await weather.command( - message, - { - intent: 'weather.get', - entities: [ - { - entity: 'date', - resolution: { - type: 'date', - date: dayjs().toDate() - } - } - ] - }, - {}, + message, + { + intent: 'weather.get', + entities: [ + { + entity: 'date', + resolution: { + type: 'date', + date: dayjs().toDate(), + }, + }, + ], + }, + {}, ); assert.calledWith(messageManager.replyByIntent, message, 'weather.get.success.today.rain', { temperature_max: 11, @@ -185,10 +185,12 @@ describe('weather.command', () => { entity: 'date', resolution: { type: 'date', - date: dayjs().add(1, 'day').toDate() - } - } - ] + date: dayjs() + .add(1, 'day') + .toDate(), + }, + }, + ], }, {}, ); @@ -212,10 +214,12 @@ describe('weather.command', () => { entity: 'date', resolution: { type: 'date', - date: dayjs().add(2, 'days').toDate() - } - } - ] + date: dayjs() + .add(2, 'days') + .toDate(), + }, + }, + ], }, {}, ); @@ -241,10 +245,12 @@ describe('weather.command', () => { sourceText: 'sunday', resolution: { type: 'interval', - strFutureValue: dayjs().add(4, 'days').toDate() - } - } - ] + strFutureValue: dayjs() + .add(4, 'days') + .toDate(), + }, + }, + ], }, {}, ); @@ -288,13 +294,14 @@ describe('weather.command', () => { sourceText: 'sunday', resolution: { type: 'interval', - strFutureValue: dayjs().add(30, 'days').toDate() - } - } - ] - }, - { + strFutureValue: dayjs() + .add(30, 'days') + .toDate(), + }, + }, + ], }, + {}, ); assert.calledWith(messageManager.replyByIntent, message, 'weather.get.fail.no-weather', {}); }); From 78d4c9986873aa762f38560f5766cf9439fdaf1e Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Sun, 20 Dec 2020 08:12:03 +0100 Subject: [PATCH 12/25] Fix test --- .../test/services/openweather/openweather.test.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/server/test/services/openweather/openweather.test.js b/server/test/services/openweather/openweather.test.js index 53e3367d9c..c80baf3015 100644 --- a/server/test/services/openweather/openweather.test.js +++ b/server/test/services/openweather/openweather.test.js @@ -172,7 +172,18 @@ describe('OpenWeatherService', () => { ]; const days = [ - { + { + datetime: new Date('2020-11-16T11:00:00.000Z'), + humidity: 54, + pressure: 1021, + temperature_max: 17, + temperature_min: 14, + units: 'metric', + weather: 'rain', + wind_direction: 319, + wind_speed: 7.08, + }, + { datetime: new Date('2020-11-17T11:00:00.000Z'), humidity: 48, pressure: 1026, From ec8b0597ffc889448bb52e5de1c69d3901983cae Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Sun, 20 Dec 2020 08:16:27 +0100 Subject: [PATCH 13/25] prettier --- server/test/services/openweather/openweather.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/test/services/openweather/openweather.test.js b/server/test/services/openweather/openweather.test.js index c80baf3015..c39443e236 100644 --- a/server/test/services/openweather/openweather.test.js +++ b/server/test/services/openweather/openweather.test.js @@ -172,7 +172,7 @@ describe('OpenWeatherService', () => { ]; const days = [ - { + { datetime: new Date('2020-11-16T11:00:00.000Z'), humidity: 54, pressure: 1021, @@ -182,8 +182,8 @@ describe('OpenWeatherService', () => { weather: 'rain', wind_direction: 319, wind_speed: 7.08, - }, - { + }, + { datetime: new Date('2020-11-17T11:00:00.000Z'), humidity: 48, pressure: 1026, From d0f8f42cc2f0ae240cf28fb9f6e8852b68997c1e Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Thu, 31 Dec 2020 14:14:48 +0100 Subject: [PATCH 14/25] Change answers EN --- server/config/brain/weather/answers.en.json | 64 ++++++++++----------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/server/config/brain/weather/answers.en.json b/server/config/brain/weather/answers.en.json index b63f3f8734..35c0b91e37 100644 --- a/server/config/brain/weather/answers.en.json +++ b/server/config/brain/weather/answers.en.json @@ -35,196 +35,196 @@ { "label": "weather.get.success.today.snow", "answers": [ - "Aujourd'hui, il neige et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "Today, it's snowing and the temperature is between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.today.rain", "answers": [ - "Aujourd'hui, il pleut et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "Today, it's raining and the temperature is between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.today.clear", "answers": [ - "Aujourd'hui, le ciel est degagé et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "Today, the sky is clear and the temperature is between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.today.cloud", "answers": [ - "Aujourd'hui, le ciel est nuageux et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "Today, the sky is cloudy and the temperature is between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.today.fog", "answers": [ - "Aujourd'hui, il y a du brouillard et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "Today, it is foggy and the temperature is between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.today.sleet", "answers": [ - "Aujourd'hui, la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial." + "Today, the temperature is between {{temperature min}} {{units}} and {{temperature max}} {{units}} with freezing rain." ] }, { "label": "weather.get.success.today.wind", "answers": [ - "Aujourd'hui, Il y a beaucoup de vent et la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "Today, it's very windy and the temperature is between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.today.unknown", "answers": [ - "Aujourd'hui, la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "Today, the temperature is between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.tomorrow.snow", "answers": [ - "Demain il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "Tomorrow snow will fall out and the temperature will be between {{ temperature_min }} {{ units }} and {{ temperature_max }} {{ units }}." ] }, { "label": "weather.get.success.tomorrow.rain", "answers": [ - "Demain il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "Tomorrow it will rain outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.tomorrow.clear", "answers": [ - "Demain le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "Tomorrow the sky will be clear outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.tomorrow.cloud", "answers": [ - "Demain il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "Tomorrow there will be clouds outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.tomorrow.fog", "answers": [ - "Demain il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "Tomorrow there will be fog outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.tomorrow.sleet", "answers": [ - "Demain la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial." + "Tomorrow the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}} with freezing rain." ] }, { "label": "weather.get.success.tomorrow.wind", "answers": [ - "Demain le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "Tomorrow the weather will be windy outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.tomorrow.unknown", "answers": [ - "Demain la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "Tomorrow the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.after-tomorrow.snow", "answers": [ - "Après demain il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "The day after tomorrow it will snow outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.after-tomorrow.rain", "answers": [ - "Après demain il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "The day after tomorrow it will rain outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.after-tomorrow.clear", "answers": [ - "Après demain le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "The day after tomorrow the sky will be clear outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.after-tomorrow.cloud", "answers": [ - "Après demain il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "The day after tomorrow there will be clouds outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.after-tomorrow.fog", "answers": [ - "Après demain il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "The day after tomorrow there will be fog outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.after-tomorrow.sleet", "answers": [ - "Après demain la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial." + "The day after tomorrow the temperature is between {{temperature_min}} {{units}} and {{temperature_max}} {{units}} with freezing rain." ] }, { "label": "weather.get.success.after-tomorrow.wind", "answers": [ - "Après demain le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "The day after tomorrow it will be windy outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.after-tomorrow.unknown", "answers": [ - "Après demain la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "The day after tomorrow the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.day.snow", "answers": [ - "{{ day }} il va neiger dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "{{day}}, it's going to snow outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.day.rain", "answers": [ - "{{ day }} il va pleuvoir dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "{{ day }}, it will rain outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.day.clear", "answers": [ - "{{ day }} le ciel sera dégagé dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "{{ day }}, the sky will be clear outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.day.cloud", "answers": [ - "{{ day }} il y aura des nuages dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "{{ day }}, there will be clouds outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.day.fog", "answers": [ - "{{ day }} il y aura du brouillard dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "{{ day }} there will be fog outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.day.sleet", "answers": [ - "{{ day }} la température est comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }} avec une pluie glacial." + "{{ day }} the temperature is between {{temperature_min}} {{units}} and {{temperature_max}} {{units}} with freezing rain." ] }, { "label": "weather.get.success.day.wind", "answers": [ - "{{ day }} le temps sera venteux dehors et la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "{{ day }} it will be windy outside and the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, { "label": "weather.get.success.day.unknown", "answers": [ - "{{ day }} la température sera comprise entre {{ temperature_min }} {{ units }} et {{ temperature_max }} {{ units }}." + "{{ day }} the temperature will be between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." ] }, From 040cb3cc85d46aa666eb71ae84cbf6c1b1f672ce Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Thu, 31 Dec 2020 14:17:38 +0100 Subject: [PATCH 15/25] Prettier --- server/config/brain/weather/answers.en.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/config/brain/weather/answers.en.json b/server/config/brain/weather/answers.en.json index 35c0b91e37..36707a3eed 100644 --- a/server/config/brain/weather/answers.en.json +++ b/server/config/brain/weather/answers.en.json @@ -76,9 +76,7 @@ }, { "label": "weather.get.success.today.unknown", - "answers": [ - "Today, the temperature is between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}." - ] + "answers": ["Today, the temperature is between {{temperature_min}} {{units}} and {{temperature_max}} {{units}}."] }, { From c547ccc41f3e6db9e545026d8316acaab725b9d6 Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Tue, 26 Jan 2021 10:02:33 +0100 Subject: [PATCH 16/25] upgrade node-nlp --- server/config/brain/weather/questions.fr.json | 1 + server/lib/brain/brain.getReply.js | 7 +- server/lib/brain/brain.train.js | 13 +- server/lib/brain/index.js | 6 +- server/package-lock.json | 1627 +++++++++-------- server/package.json | 2 +- 6 files changed, 837 insertions(+), 819 deletions(-) diff --git a/server/config/brain/weather/questions.fr.json b/server/config/brain/weather/questions.fr.json index c0cd328f2d..3e95634edc 100644 --- a/server/config/brain/weather/questions.fr.json +++ b/server/config/brain/weather/questions.fr.json @@ -2,6 +2,7 @@ { "label": "weather.get", "questions": [ + "Donne moi la météo", "Quel temps fait-il %day% ?", "Donne moi la météo pour %day%", "Quel temps fera t'il %day% ?", diff --git a/server/lib/brain/brain.getReply.js b/server/lib/brain/brain.getReply.js index 080d0ab4fc..87eb4ac906 100644 --- a/server/lib/brain/brain.getReply.js +++ b/server/lib/brain/brain.getReply.js @@ -1,4 +1,5 @@ const { ConversationContext } = require('node-nlp'); + const Handlebars = require('handlebars'); const { NotFoundError } = require('../../utils/coreErrors'); @@ -12,11 +13,11 @@ const { NotFoundError } = require('../../utils/coreErrors'); * brain.getReply('en', 'light.turn-on.success'); */ function getReply(language, intent, context = new ConversationContext()) { - const text = this.nlpManager.getAnswer(language, intent, context); - if (!text) { + const text = this.nlpManager.findAllAnswers(language, intent); + if (text.length === 0) { throw new NotFoundError(`Answer with intent ${intent} and language ${language} not found`); } - return Handlebars.compile(text)(context); + return Handlebars.compile(text[0].answer)(context); } module.exports = { diff --git a/server/lib/brain/brain.train.js b/server/lib/brain/brain.train.js index 29d0b7f2f7..72a953f9c7 100644 --- a/server/lib/brain/brain.train.js +++ b/server/lib/brain/brain.train.js @@ -24,19 +24,24 @@ async function train() { // if there are slots in the question, we handle them if (question.slots) { question.slots.forEach((slot) => { - const trimEntity = this.nlpManager.addTrimEntity(slot.key); if (slot.betweenCondition) { - trimEntity.addBetweenCondition( + this.nlpManager.addBetweenCondition( 'en', + slot.key, slot.betweenCondition.between[0], slot.betweenCondition.between[1], slot.betweenCondition.options, ); } if (slot.afterLastCondition) { - trimEntity.addAfterLastCondition('en', slot.afterLastCondition.after, slot.afterLastCondition.options); + this.nlpManager.addAfterLastCondition( + 'en', + slot.key, + slot.afterLastCondition.after, + slot.afterLastCondition.options, + ); } - this.nlpManager.slotManager.addSlot(question.label, slot.key, slot.mandatory, { + this.nlpManager.nlp.slotManager.addSlot(question.label, slot.key, slot.mandatory, { [question.language]: slot.ifMissing, }); }); diff --git a/server/lib/brain/index.js b/server/lib/brain/index.js index d899748c58..a152a749e3 100644 --- a/server/lib/brain/index.js +++ b/server/lib/brain/index.js @@ -1,5 +1,6 @@ const { NlpManager } = require('node-nlp'); const { SUPPORTED_LANGUAGES } = require('../../config/brain/index'); + const { addRoom } = require('./brain.addRoom'); const { removeRoom } = require('./brain.removeRoom'); const { train } = require('./brain.train'); @@ -8,7 +9,10 @@ const { getReply } = require('./brain.getReply'); const { load } = require('./brain.load'); const Brain = function Brain() { - this.nlpManager = new NlpManager({ languages: SUPPORTED_LANGUAGES }); + this.nlpManager = new NlpManager({ + forceNER: true, + languages: SUPPORTED_LANGUAGES, + }); }; Brain.prototype.addRoom = addRoom; diff --git a/server/package-lock.json b/server/package-lock.json index 528775ad1a..7d091b7068 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -121,29 +121,20 @@ "to-fast-properties": "^2.0.0" } }, - "@bluelovers/fast-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@bluelovers/fast-glob/-/fast-glob-3.0.4.tgz", - "integrity": "sha512-djAOOjDWXolYArm5NXxOIX7Q7OGhAaRtMs5F968OxelWkMUU6PyU6tS66CFykVON4U5y8jXcsnVAFCaeuf1nEA==", - "requires": { - "bluebird": "^3", - "fast-glob": "^3" - } - }, "@ctrlpanel/pbkdf2": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@ctrlpanel/pbkdf2/-/pbkdf2-1.0.0.tgz", "integrity": "sha512-NC/J3R2tRUciBPQKcJJ8rz9BGIJYVCPbl699fblp6fBXCHWwAnrOu1oEdDqKhspxsKDj/yZTTDlnSLkmO+ovfA==" }, "@gladysassistant/gladys-gateway-js": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/@gladysassistant/gladys-gateway-js/-/gladys-gateway-js-3.2.7.tgz", - "integrity": "sha512-ZIDbZEfhw46zWo6Azc95jzFdlg9U9Ay2xcHrCcg3ktAoeeNGkthXWE1XMKXw+4VxR25OtW1SDzT4HfVcsbZVEQ==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/@gladysassistant/gladys-gateway-js/-/gladys-gateway-js-3.2.6.tgz", + "integrity": "sha512-M6Gwc7SwXBzb0ZAJ69VNxc9VRIKf43S+FJfmKNRbWqrhunDyEaKLf3hD0X5ugLb0pzmG1HyGVqzDrsiA93IOdA==", "requires": { "@ctrlpanel/pbkdf2": "^1.0.0", "array-buffer-to-hex": "^1.0.0", "auto-bind": "^2.1.0", - "axios": "^0.21.1", + "axios": "^0.18.0", "encode-utf8": "^1.0.2", "hex-to-array-buffer": "^1.1.0", "secure-remote-password": "^0.3.1", @@ -151,11 +142,20 @@ }, "dependencies": { "axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.1.tgz", + "integrity": "sha512-0BfJq4NSfQXd+SkFdrvFbG7addhYSBA2mQwISr46pD6E5iqkWg02RAs8vyTT/j0RTnoYmeXauBuSv1qKwR179g==", "requires": { - "follow-redirects": "^1.10.0" + "follow-redirects": "1.5.10", + "is-buffer": "^2.0.2" + } + }, + "follow-redirects": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", + "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", + "requires": { + "debug": "=3.1.0" } } } @@ -212,37 +212,42 @@ } }, "@microsoft/recognizers-text": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@microsoft/recognizers-text/-/recognizers-text-1.1.4.tgz", - "integrity": "sha512-hlSVXcaX5i8JcjuUJpVxmy2Z/GxvFXarF0KVySCFop57wNEnrLWMHe4I4DjP866G19VyIKRw+vPA32pkGhZgTg==" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@microsoft/recognizers-text/-/recognizers-text-1.3.0.tgz", + "integrity": "sha512-0gUhtS/0qSF6veB3Olu55IuJ0Skwg4u1IbJX9KFj1QeK8z6cw69/p637IPD2NgXLlXCy2HEqLvUW/mgbDp3rWg==" }, "@microsoft/recognizers-text-choice": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@microsoft/recognizers-text-choice/-/recognizers-text-choice-1.1.4.tgz", - "integrity": "sha512-4CddwFe4RVhZeJgW65ocBrEdeukBMghK8pgI0K0Qy2eA5ysPZQpeZ7BGSDz5QMQei5LPY+QaAQ3CHU+ORHoO7A==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@microsoft/recognizers-text-choice/-/recognizers-text-choice-1.3.0.tgz", + "integrity": "sha512-I2LQAJJ9TJthJYWZNzooJD6+5KUkr+H+m54XpjY+vKjR81DPVFUL/SWZVyv+cC7eePFwrDv3gUnkXYS+Lp0hmA==", "requires": { - "@microsoft/recognizers-text": "~1.1.4", + "@microsoft/recognizers-text": "~1.3.0", "grapheme-splitter": "^1.0.2" } }, + "@microsoft/recognizers-text-data-types-timex-expression": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@microsoft/recognizers-text-data-types-timex-expression/-/recognizers-text-data-types-timex-expression-1.3.0.tgz", + "integrity": "sha512-REHUXmMUI1jL3b9v+aSdzKxLxRdejsfg9McYRxY3LW0Gu4UbwD7Q+K6mtSo40cwg8uh6fiV9GY8hDuKXHH6dVA==" + }, "@microsoft/recognizers-text-date-time": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@microsoft/recognizers-text-date-time/-/recognizers-text-date-time-1.1.4.tgz", - "integrity": "sha512-leMnjN+KYNwNvRD5T4G0ORUzkjlek/BBZDvQIjAujtyrd/pkViUnuouWIPkFT/dbSOxXML8et54CSk2KfHiWIA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@microsoft/recognizers-text-date-time/-/recognizers-text-date-time-1.3.0.tgz", + "integrity": "sha512-bgw4TS726maTg53M6SQRHQOzOH0za0zmBWnnGo0wQdbDfK+bgq5aeDSD4k/HhXvfkOD6zzRd3+tG3Dqyp/kFaQ==", "requires": { - "@microsoft/recognizers-text": "~1.1.4", - "@microsoft/recognizers-text-number": "~1.1.4", - "@microsoft/recognizers-text-number-with-unit": "~1.1.4", + "@microsoft/recognizers-text": "~1.3.0", + "@microsoft/recognizers-text-number": "~1.3.0", + "@microsoft/recognizers-text-number-with-unit": "~1.3.0", "lodash.isequal": "^4.5.0", "lodash.tonumber": "^4.0.3" } }, "@microsoft/recognizers-text-number": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@microsoft/recognizers-text-number/-/recognizers-text-number-1.1.4.tgz", - "integrity": "sha512-6EmlR+HR+eJBIX7sQby1vs6LJB64wxLowHaGpIU9OCXFvZ5Nb0QT8qh10rC40v3Mtrz4DpScXfSXr9tWkIO5MQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@microsoft/recognizers-text-number/-/recognizers-text-number-1.3.0.tgz", + "integrity": "sha512-KVFxvaXW9E7UkuF0EYCghvCn0u+N5L7bBXeP4IKB6fXkQd6GAZ9zNA2Acdm9lJzCRxcsBYFbRLcRMrPHwAa32w==", "requires": { - "@microsoft/recognizers-text": "~1.1.4", + "@microsoft/recognizers-text": "~1.3.0", "bignumber.js": "^7.2.1", "lodash.escaperegexp": "^4.1.2", "lodash.sortby": "^4.7.0", @@ -250,66 +255,560 @@ } }, "@microsoft/recognizers-text-number-with-unit": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@microsoft/recognizers-text-number-with-unit/-/recognizers-text-number-with-unit-1.1.4.tgz", - "integrity": "sha512-zl+CfmfWK0x/x+iSgaBAevKTYO0F4+z7SYHAHztaaaGuX8FERw2jmUjSgVetm5KA3EveyCx0XYGU1mRNY8p7Eg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@microsoft/recognizers-text-number-with-unit/-/recognizers-text-number-with-unit-1.3.0.tgz", + "integrity": "sha512-FxBD1ZQLvr4c+ssVyqUjblg+i21GbzIsDEHd5VWon5wg+2qrqixlmP1mXsXG+iGRV3qqeZCtTFdqkwJ3MWhovA==", "requires": { - "@microsoft/recognizers-text": "~1.1.4", - "@microsoft/recognizers-text-number": "~1.1.4", + "@microsoft/recognizers-text": "~1.3.0", + "@microsoft/recognizers-text-number": "~1.3.0", "lodash.escaperegexp": "^4.1.2", "lodash.last": "^3.0.0", "lodash.max": "^4.0.1" } }, "@microsoft/recognizers-text-sequence": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@microsoft/recognizers-text-sequence/-/recognizers-text-sequence-1.1.4.tgz", - "integrity": "sha512-rb5j8/aE7HSOdIxaVfCGFrj0wWPpSq0CuykFg/A/iJNPP+FnAU71bgP5HexrwQcpCsDinauisX7u0DKIChrHRA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@microsoft/recognizers-text-sequence/-/recognizers-text-sequence-1.3.0.tgz", + "integrity": "sha512-LXZ9AakClrdPVfEphCJFETjw6n8w/LwW1Yoj9ZKcGI9PGvH6RR+haS4GSZuHeMhEacmaa3NkzD+I44qYIvym8Q==", "requires": { - "@microsoft/recognizers-text": "~1.1.4", + "@microsoft/recognizers-text": "~1.3.0", "grapheme-splitter": "^1.0.2" } }, "@microsoft/recognizers-text-suite": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@microsoft/recognizers-text-suite/-/recognizers-text-suite-1.1.4.tgz", - "integrity": "sha512-hNIaR4M2G0nNeI9WZxt9C0KYh/1vhjeKzX5Ds8XDdT0pxF7zwCSo19WNcPjrVK6aCOeZTw/ULofsAjdu9gSkcA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@microsoft/recognizers-text-suite/-/recognizers-text-suite-1.3.0.tgz", + "integrity": "sha512-uqG4vzy5N2CmBaeINny0bLdnGp0jDbT1moNoLC+Yim3G8kHOU9lpDfwA6VN6HTYaDM5854SNMEzLjJdS1TPFTw==", "requires": { - "@microsoft/recognizers-text": "~1.1.4", - "@microsoft/recognizers-text-choice": "~1.1.4", - "@microsoft/recognizers-text-date-time": "~1.1.4", - "@microsoft/recognizers-text-number": "~1.1.4", - "@microsoft/recognizers-text-number-with-unit": "~1.1.4", - "@microsoft/recognizers-text-sequence": "~1.1.4" + "@microsoft/recognizers-text": "~1.3.0", + "@microsoft/recognizers-text-choice": "~1.3.0", + "@microsoft/recognizers-text-data-types-timex-expression": "~1.3.0", + "@microsoft/recognizers-text-date-time": "~1.3.0", + "@microsoft/recognizers-text-number": "~1.3.0", + "@microsoft/recognizers-text-number-with-unit": "~1.3.0", + "@microsoft/recognizers-text-sequence": "~1.3.0" } }, - "@nodelib/fs.scandir": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", - "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "@nlpjs/builtin-duckling": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/builtin-duckling/-/builtin-duckling-4.19.1.tgz", + "integrity": "sha512-XrmVAxMTfZ+a7D0cHLpP1gFz5KxAhCMzm43DrnHP1aVSFW9uLtGffWEkCa04uIWNv6yqSf3AIc58n0xssn0YqQ==", "requires": { - "@nodelib/fs.stat": "2.0.3", - "run-parallel": "^1.1.9" + "@nlpjs/core": "^4.19.1" } }, - "@nodelib/fs.stat": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", - "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==" + "@nlpjs/builtin-microsoft": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/builtin-microsoft/-/builtin-microsoft-4.19.1.tgz", + "integrity": "sha512-dYLTGgpb0wpRAS4MHe3pTHt8jGBslSm/dsGB/jwPY9QaEngw8DdwOIjOngMVpb5g6NPUUzQowbrGOya6oRdkCA==", + "requires": { + "@microsoft/recognizers-text-suite": "1.3.0", + "@nlpjs/core": "^4.19.1" + } }, - "@nodelib/fs.walk": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", - "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "@nlpjs/core": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/core/-/core-4.19.1.tgz", + "integrity": "sha512-ClJaYE0ZfJzTGlx8QMFsyUHIdICjN/Q/Hpy0lCG3uyrf3+QfEQe3JeNogEyv0Wxrq0LvdWpYu3p8wYnZTPv34g==" + }, + "@nlpjs/core-loader": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/core-loader/-/core-loader-4.19.1.tgz", + "integrity": "sha512-Vn4SbA4YESHimjpyRBRuvtbfLJQ9+RkGyot10WvM3nuIVvoeVBz3ijbGLU+I+jAgN6e8V55tE30AXGN7i4XhoA==", "requires": { - "@nodelib/fs.scandir": "2.1.3", - "fastq": "^1.6.0" + "@nlpjs/core": "^4.19.1", + "@nlpjs/request": "^4.17.0" } }, - "@novel-segment/util": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@novel-segment/util/-/util-1.0.8.tgz", - "integrity": "sha512-kzneWLJHg6VZm2zNAMY9XZrebvUQwCFLq5jpukkYOoviOBMmrNFR6hNwG+ZD4h0KsPWCFMwIfABxHX9Tsxr8lQ==" + "@nlpjs/emoji": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/emoji/-/emoji-4.19.1.tgz", + "integrity": "sha512-nNjGsh+lYGDy9e+aLbb9qpmbszPkaER0rOOZA7Qz6CWu57SMWAUHAqwMiRcQUupVVnUUhTx8b5+XQzoOW+AJsQ==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/evaluator": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/@nlpjs/evaluator/-/evaluator-4.17.1.tgz", + "integrity": "sha512-dHaqDyfM6B6QmbNehG5lMukMWOZwcd/WwiC7jAh3eG/X73jNsPz9p66H3XyYpc3s9kfpxWIgc+S789Sar4uT/Q==", + "requires": { + "escodegen": "^2.0.0", + "esprima": "^4.0.1" + } + }, + "@nlpjs/lang-all": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-all/-/lang-all-4.19.1.tgz", + "integrity": "sha512-vUmz36sH8rhPYcxR/10+X/hH47Vi9X8MrE/dIb2Omq2N+dMLkEBqBmAFiaFGOF3+8PzHea8mgVJm5QVBaxmSwA==", + "requires": { + "@nlpjs/core": "^4.19.1", + "@nlpjs/lang-ar": "^4.19.1", + "@nlpjs/lang-bn": "^4.19.1", + "@nlpjs/lang-ca": "^4.19.1", + "@nlpjs/lang-cs": "^4.19.1", + "@nlpjs/lang-da": "^4.19.1", + "@nlpjs/lang-de": "^4.19.1", + "@nlpjs/lang-el": "^4.19.1", + "@nlpjs/lang-en": "^4.19.1", + "@nlpjs/lang-es": "^4.19.1", + "@nlpjs/lang-eu": "^4.19.1", + "@nlpjs/lang-fa": "^4.19.1", + "@nlpjs/lang-fi": "^4.19.1", + "@nlpjs/lang-fr": "^4.19.1", + "@nlpjs/lang-ga": "^4.19.1", + "@nlpjs/lang-gl": "^4.19.1", + "@nlpjs/lang-hi": "^4.19.1", + "@nlpjs/lang-hu": "^4.19.1", + "@nlpjs/lang-hy": "^4.19.1", + "@nlpjs/lang-id": "^4.19.1", + "@nlpjs/lang-it": "^4.19.1", + "@nlpjs/lang-ja": "^4.19.1", + "@nlpjs/lang-ko": "^4.19.1", + "@nlpjs/lang-lt": "^4.19.1", + "@nlpjs/lang-ms": "^4.19.1", + "@nlpjs/lang-ne": "^4.19.1", + "@nlpjs/lang-nl": "^4.19.1", + "@nlpjs/lang-no": "^4.19.1", + "@nlpjs/lang-pl": "^4.19.1", + "@nlpjs/lang-pt": "^4.19.1", + "@nlpjs/lang-ro": "^4.19.1", + "@nlpjs/lang-ru": "^4.19.1", + "@nlpjs/lang-sl": "^4.19.1", + "@nlpjs/lang-sr": "^4.19.1", + "@nlpjs/lang-sv": "^4.19.1", + "@nlpjs/lang-ta": "^4.19.1", + "@nlpjs/lang-th": "^4.19.1", + "@nlpjs/lang-tl": "^4.19.1", + "@nlpjs/lang-tr": "^4.19.1", + "@nlpjs/lang-uk": "^4.19.1", + "@nlpjs/lang-zh": "^4.19.1" + } + }, + "@nlpjs/lang-ar": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-ar/-/lang-ar-4.19.1.tgz", + "integrity": "sha512-+7HZ64eFqOS6ztvi/gZ7UjHchf9dRa/0IwO+5dX70CigmO2lSQPR8dFdLvYzwduekmzTd9OfqY0dXWCnuKJzDg==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-bn": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-bn/-/lang-bn-4.19.1.tgz", + "integrity": "sha512-uWZ6ocxQHmQRXBjRbmb+7mwScbTqeaixP/+YAb84OasdQ8pBNXNYBbpC/i1jzzHGYMnDBu6iE71Q02LQZUsatw==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-ca": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-ca/-/lang-ca-4.19.1.tgz", + "integrity": "sha512-KYQsFKhLjMC3otT/rTh/9Gc3QbhAKBzTVNSLHwY3IaOMUmQEK0CI+KLtSirzL/NUwJZ6XO0ngNyjlYzZW3sBGg==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-cs": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-cs/-/lang-cs-4.19.1.tgz", + "integrity": "sha512-sfEwCwy94zEGMeTI/YDBXiSCjypHK9qVKtZvw2C/jJTvZOU+ra5t0PK1lj877JLW1d33wQvLq6TxwivXvbSdEA==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-da": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-da/-/lang-da-4.19.1.tgz", + "integrity": "sha512-2Fjb3iEesrrKrJSZpfojYltkn0VIaf/zDdAFYwRZi7DeHM2W0l6nqDXROqv3s741fKbPtz2Y1oS8Q/6z7VYwZA==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-de": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-de/-/lang-de-4.19.1.tgz", + "integrity": "sha512-mSpigSN+qtW46XctBjJeZO1VwzFCd5ieOZCFJLm8sdsc0BTzi8ycbTLpbmKAowL2Cy6vxYEA6DYJeV11q2Ymxw==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-el": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-el/-/lang-el-4.19.1.tgz", + "integrity": "sha512-Rf5D/Tw/ZsSzi2eMLKGHiEc9RcLdZfu4GzFgKJWvoYQHcZu+a2ieCQWr4/AlUCEoRkhiKxKyKGXXZGRWL3YiQw==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-en": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-en/-/lang-en-4.19.1.tgz", + "integrity": "sha512-/WymRzeEf9TXTmHkcCe3hbH4lKMjeqJBN3x6DF/pn9v8IXNQREUCxmdGgEkNvoqmenvHzxs5jsqb2M4q5/HeoQ==", + "requires": { + "@nlpjs/core": "^4.19.1", + "@nlpjs/lang-en-min": "^4.19.1" + } + }, + "@nlpjs/lang-en-min": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-en-min/-/lang-en-min-4.19.1.tgz", + "integrity": "sha512-HGfTrOrnou2qlUu5KD7xPGZWhS9jxIZgGeq3CEW8SEvVtjaqB9roCKIvurkTCEdSK7dwINamo2db2VcdSS4Tzw==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-es": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-es/-/lang-es-4.19.1.tgz", + "integrity": "sha512-LkQUQWBD7F8O7uF9mYyp/xxKU43RLRNZkmrM2flhFtMF/lLU0kKTLDicpcbpuurzmKmjdRTYWhrFrbZQg2tM2g==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-eu": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-eu/-/lang-eu-4.19.1.tgz", + "integrity": "sha512-NwwZnT/vn/CVcyllwKsME1rkoVPg0mA5VNAVIuqR1m0RX/SYfYDtA+SWY4Hy/Ncf+Yb7WVHTRD6yoM/qWaCKXQ==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-fa": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-fa/-/lang-fa-4.19.1.tgz", + "integrity": "sha512-XajQ3HsCydZK+AAtX+d4Ous/9Gee74eJP9mgPZQ/I4LJ9/kIQ2r4QcJK/wEsPZPU0bRP3JAnwoOeD80fmRk7BQ==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-fi": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-fi/-/lang-fi-4.19.1.tgz", + "integrity": "sha512-V3gDI5D1rPUJV0ojO2QojVCamArqa/R12iuyDV/Gj4j5CKfw0SoesXCaVQO7BKlfcAjUKs7oWmQMogmmPDd4Bw==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-fr": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-fr/-/lang-fr-4.19.1.tgz", + "integrity": "sha512-rXdAsCtJe+Pw3IvhtSSQZYSpPa1LCFw57b8d6n8udzECPgnzP42nnrzsj3jglTzIEE5MFls2/dhFvMOEeKIPfQ==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-ga": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-ga/-/lang-ga-4.19.1.tgz", + "integrity": "sha512-ujzU+a3Km24sWWjk52HlxYZdnv61vzF9OzU/t+9sSWvphfNYqg2Ej2FL8j3y49KgwBZMILsGleNKhq8cy2Ljug==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-gl": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-gl/-/lang-gl-4.19.1.tgz", + "integrity": "sha512-0WGJwwoByfWvwlrzECNQOuAP8EqPC+Ztj1ephTcqvqezluUcDX3Xza05N6s2PpqpJMgnpeQMJk+coKcSS7I2bA==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-hi": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-hi/-/lang-hi-4.19.1.tgz", + "integrity": "sha512-4dr4ZTKw0BBKbpU6VvDUZMiyfBDgAXpCJYrbqZjTsjbQPKDK2vBUD3A8sWtp+kT0WxHQsLDuBbFhXLEvGaXdYg==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-hu": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-hu/-/lang-hu-4.19.1.tgz", + "integrity": "sha512-pnTirJ95+8d035FPNt7pSenBUT6++xCvVoyjlp6Dj7X7emr7Oj2TJaS2pPZzx7wRNEkULpFrHjo32WNsuFehdA==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-hy": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-hy/-/lang-hy-4.19.1.tgz", + "integrity": "sha512-32evM4Y2M/ljZQm603hH0eYC5NvKvB1lyExTInwKbtEjQzUBJ0PQEUQvKzD8pmqpUP5j5CIpRfIAPGrfYu9b2A==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-id": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-id/-/lang-id-4.19.1.tgz", + "integrity": "sha512-u0HheO4vn1L/iXCn5+RREIBMoz96fpFoTbqErsXnbomt88H0OoParfmQOr0ueyi0Akhq9cyHkgsecq123yx47Q==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-it": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-it/-/lang-it-4.19.1.tgz", + "integrity": "sha512-1hn/5qbameBKdQogDcSA7R/lrS2P1eXtNW6PYKopZwY1VFfatBuNOvbB2+X+X0naZdAnPIli6d82cOrZ+CR+Kg==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-ja": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-ja/-/lang-ja-4.19.1.tgz", + "integrity": "sha512-tfHxCoHEgyF3wU+4Hkb8MGwFYx7ZVFAYUiq3D9L6ncwl6ZKxIsEZBel6XjlfhWv1alBGZgZNSm9x5+Vqa2RmQQ==", + "requires": { + "@nlpjs/core": "^4.19.1", + "kuromoji": "^0.1.2" + } + }, + "@nlpjs/lang-ko": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-ko/-/lang-ko-4.19.1.tgz", + "integrity": "sha512-xj44BX+UDRWoelFtCqAlFrsGj3bf7qO5fJpuXW82NT4X6YptjkInze97LTNEWkTJWVasZm4M0lLmN68iT9zKqg==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-lt": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-lt/-/lang-lt-4.19.1.tgz", + "integrity": "sha512-sE/N3R4kXYE74ZbH192pfF4+lCMXp1wAo12iKDtTvzI3KtgUa7AAR7lQg80obGDNkQ4b065ZxGy8rudqO/kCnw==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-ms": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-ms/-/lang-ms-4.19.1.tgz", + "integrity": "sha512-AKNb5chebVKRd4tpu4TNRNCUxhVpHglSfixqQrJ/aAlvT4YUHU8ZqVTYntZlEyhRPMSfsvfgI0+eaNU0TKtxtw==", + "requires": { + "@nlpjs/core": "^4.19.1", + "@nlpjs/lang-id": "^4.19.1" + } + }, + "@nlpjs/lang-ne": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-ne/-/lang-ne-4.19.1.tgz", + "integrity": "sha512-QLwalf1jv+vgudKUiMY6RRc99zAPuEciuPvMRJmJKVqRinhXJyb+EEsGOZgWaVCfebIftdB3pMY96R8Ca+XwTg==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-nl": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-nl/-/lang-nl-4.19.1.tgz", + "integrity": "sha512-R6LnIy/oHb8Uw67WB5X3ebDPGFj1cYZLIe/kgdCEzFkZE/vA2a6S5F65tLgtarNtTQ9REVB2JEkajKHbCUFfPg==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-no": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-no/-/lang-no-4.19.1.tgz", + "integrity": "sha512-95g4OhSZqjlJMFbcIhqrRSOoL1JO/L/YZqZPVqOJd0xZZix24FEx8JDATmGfD0owMeZGxgxd5Lb3oTgFU6VR8A==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-pl": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-pl/-/lang-pl-4.19.1.tgz", + "integrity": "sha512-BHPbvbPx9e/uxAxJkLNyvjbqIwcUpTHnCA1lOKuTUqCkDJ0p7d0l6Cf2cIoN5gcV2XHcJmE/qMJwMmS8hmu/BQ==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-pt": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-pt/-/lang-pt-4.19.1.tgz", + "integrity": "sha512-YWivCQPX05FZmQVZxXH/TtpHqrz7vGNWD1li9KAP/2JL4zR+vE1Ec3ZiuJ0agPHpTcvbwGejfiW+s7YkWqCrcA==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-ro": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-ro/-/lang-ro-4.19.1.tgz", + "integrity": "sha512-xxmTU1GlszoSQtteziTs1072W5QkOLDTe4RO/phxxCjCEaFQvHDlKrVLO9pYoVUeQtKUbwb7wyrRkCDqPSmNNA==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-ru": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-ru/-/lang-ru-4.19.1.tgz", + "integrity": "sha512-Nqff30jwLeZA4WI9d9bgfVc1yBiNlTlsCdNQBlvBP7/TCizsYZBo3b+SLmzA87TsVfW0NyZpdhbmkeXW4TVC+Q==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-sl": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-sl/-/lang-sl-4.19.1.tgz", + "integrity": "sha512-JzqdPMx1moUE6GHZL+huhK/W9BHCv6GxLZSND6EjM+5/hfwc97xeQjnGdC3M5Z+a06rqjzTIXj4vtv61EhdrwA==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-sr": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-sr/-/lang-sr-4.19.1.tgz", + "integrity": "sha512-46zkBYyfTg8GUG6eBSCh8MRc3ZsEe6x4iSxu95Hs/aaYeADrkkPwreTg9xKCoFVLGXBPjiK6ukkPhborhoJLcw==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-sv": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-sv/-/lang-sv-4.19.1.tgz", + "integrity": "sha512-lC+QndPWivcQ1zNY5tUoX3hcfBFP4s4F+dgRo3QoDp1sLKhXIfevTB8XxDFmklKZ2iUhEvoe+fENdz2Iva8KQw==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-ta": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-ta/-/lang-ta-4.19.1.tgz", + "integrity": "sha512-2hpDU6HlzCH8T5DTmViuqsImp/oiZ3y4cHwYiv6a8lLmL/RE1t2p5wcAXhtSHHA4mc8n/ReMXHHZBuevwIaAJg==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-th": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-th/-/lang-th-4.19.1.tgz", + "integrity": "sha512-nWi7crXkR5pZbVvXMk7sCkHDxZWaq/mQMWSB/CoZWdARlbLiuX8xNXdbtLq9pCTENCRwZMzl1mY67O6enYOSBQ==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-tl": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-tl/-/lang-tl-4.19.1.tgz", + "integrity": "sha512-gRDPPOZSf7DAT4CxHsEEgWg5Nk2luQgzgaQZCcaex0DJqt0wtzvPcLACipzrwu7EgT0jNdKaR/rDU9wJbDn1sA==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-tr": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-tr/-/lang-tr-4.19.1.tgz", + "integrity": "sha512-o1Zj7QMG92HRKVJ7gIdmSA1QX5XYNqb7WJPWngCwys3HpfHHYRKIWDC20cs8DRo6nopr8p6xv6j9d0qvQ9Jzxg==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-uk": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-uk/-/lang-uk-4.19.1.tgz", + "integrity": "sha512-vFXxw7Mq4NRb1rlGmnaYUe7ymhS+xw2FTOAZIaoRc6Hy4Dv2RmkfPLjZlt3KwGLoK1cyG1cGl2tHgfzLUT+SSg==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/lang-zh": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/lang-zh/-/lang-zh-4.19.1.tgz", + "integrity": "sha512-2nF+2oxpWfiErkM/Kza4oTzQ+vjz6yTKM79FTKZOfKxRntGflwZyCkyQbDHn5iIXcC2hvH8hl3qMoYVPJT4oNw==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/language": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@nlpjs/language/-/language-4.17.0.tgz", + "integrity": "sha512-oYIztvs2c0NX9edQC0X3GMh/00L0iREU2j3cTagDm+CtWxV7+UsfrxxJHMVm4g+Dr6vDMVgQvfksGDRPAIgTsQ==" + }, + "@nlpjs/language-min": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@nlpjs/language-min/-/language-min-4.17.0.tgz", + "integrity": "sha512-MBmG28YyPY24q5mKlzufmZNNwiynmcjWT0r4mSI6hEKjiAhGLLakgAEtJNmOC1827G5bNqspR1PUGBaCxr/XeQ==" + }, + "@nlpjs/ner": { + "version": "4.19.7", + "resolved": "https://registry.npmjs.org/@nlpjs/ner/-/ner-4.19.7.tgz", + "integrity": "sha512-UiqoTFuDo844tKmsc+q74PNi2qelpRqaKhdNXMy+5MxYf9zr/25sPik7SOMzy3VApoTmGIcejiyYZye+ypXWrQ==", + "requires": { + "@nlpjs/core": "^4.19.1", + "@nlpjs/language-min": "^4.17.0", + "@nlpjs/similarity": "^4.17.0" + } + }, + "@nlpjs/neural": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@nlpjs/neural/-/neural-4.17.0.tgz", + "integrity": "sha512-3LUfHPRs27Z4W22O2AIq3e4y8NUDtKUVoMKT4N/4T/Hoy+PrL0aJRkorcu90w5CvkJwKMpLv8Dx0+dgQBsFH5g==" + }, + "@nlpjs/nlg": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/nlg/-/nlg-4.19.1.tgz", + "integrity": "sha512-lAkJ82e2IjXuJD3MFpLEJCQSALS8JqsEfsvBoqwm2Ev54asirUrsXyQ7m/MTfyfNCn+nMFWf5vPFWIVKQhtF1g==", + "requires": { + "@nlpjs/core": "^4.19.1" + } + }, + "@nlpjs/nlp": { + "version": "4.19.7", + "resolved": "https://registry.npmjs.org/@nlpjs/nlp/-/nlp-4.19.7.tgz", + "integrity": "sha512-Orc+dC2dgcgJp9djunOH12z7DydfYSjBm7TRZOvL9MRS3wNbS/SZKf0f02y0H+gQ904YpzHKnGUbOmefeBGs3Q==", + "requires": { + "@nlpjs/core": "^4.19.1", + "@nlpjs/ner": "^4.19.7", + "@nlpjs/nlg": "^4.19.1", + "@nlpjs/nlu": "^4.19.1", + "@nlpjs/sentiment": "^4.19.1", + "@nlpjs/slot": "^4.19.0" + } + }, + "@nlpjs/nlu": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/nlu/-/nlu-4.19.1.tgz", + "integrity": "sha512-S5xfv0vpj2U7Y3g4yRtXMvO6IbyjBJl5qHHwbcojhTvIZ44kReO8qzVQjxx55nULdPKQwuZtghDrI0cRIuL6Vw==", + "requires": { + "@nlpjs/core": "^4.19.1", + "@nlpjs/language-min": "^4.17.0", + "@nlpjs/neural": "^4.17.0", + "@nlpjs/similarity": "^4.17.0" + } + }, + "@nlpjs/request": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@nlpjs/request/-/request-4.17.0.tgz", + "integrity": "sha512-9LIdTcY5pAA+hPlX0qekeA699ux8JzcMe9Odjd2t2NEH0cVZSvrtNi+KHn/Eclk732H1erP7ciVncnT+hv9lAw==", + "requires": { + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0" + } + }, + "@nlpjs/sentiment": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@nlpjs/sentiment/-/sentiment-4.19.1.tgz", + "integrity": "sha512-8Swmw7cDf6kUoOGWmTm1FORj01BmV98x4pjiJCvqFpLBDMfg8QniO6ejNKD++Bk4nu0Vtolp641ULEhYwn5l2w==", + "requires": { + "@nlpjs/core": "^4.19.1", + "@nlpjs/language-min": "^4.17.0", + "@nlpjs/neural": "^4.17.0" + } + }, + "@nlpjs/similarity": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@nlpjs/similarity/-/similarity-4.17.0.tgz", + "integrity": "sha512-LCLlT2FuWtNtSpGtiwqv6n9n0i125jxcRHeyyVouMPlEGfsEgnRIe0AQH8N65PUNOChK1DG2NHjPPDMSUByfNg==" + }, + "@nlpjs/slot": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@nlpjs/slot/-/slot-4.19.0.tgz", + "integrity": "sha512-iIUrFPh9NGkhrF1Kf0IEKw6086sjlWrfJGf+JDN2Yomw1c6QJJjDGaBQh4Au5+7pD00kdA22xa+vLDGChhIp4A==" + }, + "@nlpjs/xtables": { + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/@nlpjs/xtables/-/xtables-4.17.0.tgz", + "integrity": "sha512-AA7OZlxQ8Dgis4kVii5YZ13BrWdvIwiDxmKuPTIgkdOjZ4m5MmJdA72DpOSKV/oG/TtH4mPkOz9/yva/0fiA0Q==", + "requires": { + "xlsx": "^0.16.2" + } }, "@sinonjs/commons": { "version": "1.6.0", @@ -347,6 +846,11 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" + }, "@types/geojson": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.6.tgz", @@ -363,12 +867,12 @@ "integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==" }, "@types/react": { - "version": "16.14.2", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.2.tgz", - "integrity": "sha512-BzzcAlyDxXl2nANlabtT4thtvbbnhee8hMmH/CcJrISDBVcJS1iOsP1f0OAgSdGE0MsY9tqcrb9YoZcOFv9dbQ==", + "version": "16.9.34", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.34.tgz", + "integrity": "sha512-8AJlYMOfPe1KGLKyHpflCg5z46n0b5DbRfqDksxBLBTUpB75ypDBAO9eCUcjNwE6LCUslwTz00yyG/X9gaVtow==", "requires": { "@types/prop-types": "*", - "csstype": "^3.0.2" + "csstype": "^2.2.0" } }, "JSONStream": { @@ -420,6 +924,29 @@ "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "requires": { + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "ajv": { "version": "6.10.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", @@ -749,11 +1276,6 @@ "resolved": "https://registry.npmjs.org/array-buffer-to-hex/-/array-buffer-to-hex-1.0.0.tgz", "integrity": "sha512-arycdkxgK1cj6s03GDb96tlCxOl1n3kg9M2OHseUc6Pqyqp+lgfceFPmG507eI5V+oxOSEnlOw/dFc7LXBXF4Q==" }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=" - }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -765,14 +1287,6 @@ "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", "dev": true }, - "array-hyper-unique": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-hyper-unique/-/array-hyper-unique-1.1.0.tgz", - "integrity": "sha512-yLDXM6eMgMFQFefFhJfdCbh76SXmAZ2D88/G8EuoqhhJbc9g35S9OBIQvYjgH6I3ktgBBEG+dBqtXjXL37VSaA==", - "requires": { - "deep-eql": "^4.0.0" - } - }, "array-includes": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", @@ -956,9 +1470,9 @@ } }, "base64-arraybuffer": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz", - "integrity": "sha1-mBjHngWbE1X5fgQooBfIOOkLqBI=" + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", + "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=" }, "bcrypt": { "version": "3.0.6", @@ -977,10 +1491,13 @@ "tweetnacl": "^0.14.3" } }, - "big.js": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", - "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==" + "better-assert": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", + "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", + "requires": { + "callsite": "1.0.0" + } }, "bignumber.js": { "version": "7.2.1", @@ -1107,14 +1624,6 @@ "concat-map": "0.0.1" } }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "requires": { - "fill-range": "^7.0.1" - } - }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -1212,26 +1721,17 @@ "write-file-atomic": "^2.4.2" } }, + "callsite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", + "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=" + }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" - }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "requires": { - "camelcase": "^2.0.0", - "map-obj": "^1.0.0" - } - }, "capture-stack-trace": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", @@ -1253,12 +1753,11 @@ } }, "cfb": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/cfb/-/cfb-1.1.3.tgz", - "integrity": "sha512-joXBW0nMuwV9no7UTMiyVJnQL6XIU3ThXVjFUDHgl9MpILPOomyfaGqC290VELZ48bbQKZXnQ81UT5HouTxHsw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.0.tgz", + "integrity": "sha512-sXMvHsKCICVR3Naq+J556K+ExBo9n50iKl6LGarlnvuA2035uMlGA/qVrc0wQtow5P1vJEw9UyrKLCbtIKz+TQ==", "requires": { "adler-32": "~1.2.0", - "commander": "^2.16.0", "crc-32": "~1.2.0", "printj": "~1.1.2" } @@ -1319,16 +1818,6 @@ "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, - "chinese-parseint": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/chinese-parseint/-/chinese-parseint-1.1.0.tgz", - "integrity": "sha1-wDX/drTxJgfAyVUkIj+MxzQXXGk=" - }, - "chinese_convert": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/chinese_convert/-/chinese_convert-1.0.8.tgz", - "integrity": "sha1-JaxM3WVlwVzrRkJvGlTZKAB6f3A=" - }, "chokidar": { "version": "2.1.8", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", @@ -1456,25 +1945,6 @@ "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", "dev": true }, - "cjk-conv": { - "version": "1.2.26", - "resolved": "https://registry.npmjs.org/cjk-conv/-/cjk-conv-1.2.26.tgz", - "integrity": "sha512-wgMZe/UElghCB5uXekCT96FWn3y54g9npS0YF0aSplf68dGBhByAMjJY8ClV9AZ5aEKIjsvLh514GbyxX8sddw==", - "requires": { - "array-hyper-unique": "^1.1.0", - "chinese_convert": "1.0.8", - "deepmerge-plus": "^2.1.3", - "japanese": "^1.2.0", - "regexp-helper": "^1.0.8", - "ts-type": "^1.2.9", - "uni-string": "^1.1.2" - } - }, - "class-proxy": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/class-proxy/-/class-proxy-1.1.2.tgz", - "integrity": "sha512-kowpC1EGn0b5ZxOMbF8f7IO03gg6dtI1rwBIHMfG5dEAeOVpZpukN9cT4K9cxv+IG8JihVdsqPr0V5bitB+pqQ==" - }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", @@ -1703,8 +2173,7 @@ "component-emitter": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" }, "component-inherit": { "version": "0.0.3", @@ -1859,11 +2328,6 @@ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, - "core-decorators": { - "version": "0.20.0", - "resolved": "https://registry.npmjs.org/core-decorators/-/core-decorators-0.20.0.tgz", - "integrity": "sha1-YFiWYkBTr4wo775zXCWjAaYcZcU=" - }, "core-js": { "version": "2.6.11", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", @@ -1911,11 +2375,6 @@ "capture-stack-trace": "^1.0.0" } }, - "crlf-normalize": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/crlf-normalize/-/crlf-normalize-1.0.3.tgz", - "integrity": "sha512-n+H8helYU03hMHL1W380VHNHdUW61WVpVTADjZoTzHMLyyu3IKAurTQyCG+neq61txELetenaXQWCPCtukcZBA==" - }, "cron-parser": { "version": "2.13.0", "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-2.13.0.tgz", @@ -1972,17 +2431,9 @@ "dev": true }, "csstype": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.6.tgz", - "integrity": "sha512-+ZAmfyWMT7TiIlzdqJgjMb7S4f1beorDbWbsocyK4RaiqA5RTX3K14bnBWmmA9QEM0gRdsjyyrEmcyga8Zsxmw==" - }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "requires": { - "array-find-index": "^1.0.1" - } + "version": "2.6.10", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.10.tgz", + "integrity": "sha512-D34BqZU4cIlMCY93rZHbrq9pjTAQJ3U8S8rfBqjwHxkGPThWFjzZDQpgMJY0QViLxth6ZKYiwFBo14RdN44U/w==" }, "d": { "version": "1.0.1", @@ -2030,14 +2481,6 @@ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, - "deep-eql": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.0.0.tgz", - "integrity": "sha512-GxJC5MOg2KyQlv6WiUF/VAnMj4MWnYiXo4oLgeptOELVoknyErb4Z8+5F/IM/K4g9/80YzzatxmWcyRwUseH0A==", - "requires": { - "type-detect": "^4.0.0" - } - }, "deep-equal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.0.tgz", @@ -2062,19 +2505,6 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" }, - "deepmerge": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-3.3.0.tgz", - "integrity": "sha512-GRQOafGHwMHpjPx9iCvTgpu9NojZ49q794EEL94JVEw6VaeA8XTUyBKvAkOOjBX9oJNiV6G3P+T+tihFjo2TqA==" - }, - "deepmerge-plus": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/deepmerge-plus/-/deepmerge-plus-2.1.3.tgz", - "integrity": "sha512-nmRWdc9y7aqrhnZ1bWA+LOQuMV9WY6roWrZ7HN86l+JQ4HYRKXSQwOTNHseU88Py/knsov4j5Qh5RuFqCsNN8g==", - "requires": { - "is-mergeable-object": "1.1.0" - } - }, "default-require-extensions": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", @@ -2325,11 +2755,6 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, "enabled": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", @@ -2358,43 +2783,54 @@ } }, "engine.io-client": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.5.0.tgz", - "integrity": "sha512-12wPRfMrugVw/DNyJk34GQ5vIVArEcVMXWugQGGuw2XxUSztFNmJggZmv8IZlLyEdnpO1QB9LkcjeWewO2vxtA==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.1.tgz", + "integrity": "sha512-RJNmA+A9Js+8Aoq815xpGAsgWH1VoSYM//2VgIiu9lNOaHFfLpTjH4tOzktBpjIs5lvOfiNY1dwf+NuU6D38Mw==", "requires": { - "component-emitter": "~1.3.0", + "component-emitter": "1.2.1", "component-inherit": "0.0.3", - "debug": "~3.1.0", + "debug": "~4.1.0", "engine.io-parser": "~2.2.0", "has-cors": "1.1.0", "indexof": "0.0.1", - "parseqs": "0.0.6", - "parseuri": "0.0.6", - "ws": "~7.4.2", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "ws": "~6.1.0", "xmlhttprequest-ssl": "~1.5.4", "yeast": "0.1.2" }, "dependencies": { - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "ws": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz", - "integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==" + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", + "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==", + "requires": { + "async-limiter": "~1.0.0" + } } } }, "engine.io-parser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.1.tgz", - "integrity": "sha512-x+dN/fBH8Ro8TFwJ+rkB2AmuVw9Yu2mockR/p3W8f8YtExwFgDvBDi0GWyb4ZLkpahtDGZgtr3zLovanJghPqg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.0.tgz", + "integrity": "sha512-6I3qD9iUxotsC5HEMuuGsKA0cXerGz+4uGcXQEkfBidgKf0amsjrrtwcbwK/nzpZBxclXlV7gGl9dgWvu4LF6w==", "requires": { "after": "0.8.2", "arraybuffer.slice": "~0.0.7", - "base64-arraybuffer": "0.1.4", + "base64-arraybuffer": "0.1.5", "blob": "0.0.5", "has-binary2": "~1.0.2" } @@ -2458,14 +2894,6 @@ "next-tick": "~1.0.0" } }, - "es6-class-prototype": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/es6-class-prototype/-/es6-class-prototype-1.0.4.tgz", - "integrity": "sha512-w772noDRF8U+iSsg+wesXRNP61bMbKzky8JAvYEtQOI/DptYMN5cnNnGnjERGXoB+uPrhATbPz/wx7YCRwrpiA==", - "requires": { - "class-proxy": "^1.1.2" - } - }, "es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", @@ -2518,21 +2946,21 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "escodegen": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.12.0.tgz", - "integrity": "sha512-TuA+EhsanGcme5T3R0L80u4t8CpbXQjegRmf7+FPTJrtCTErXFeelblRgHQa1FofEzqYYJmJ/OqjTwREp9qgmg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", + "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", "requires": { - "esprima": "^3.1.3", - "estraverse": "^4.2.0", + "esprima": "^4.0.1", + "estraverse": "^5.2.0", "esutils": "^2.0.2", "optionator": "^0.8.1", "source-map": "~0.6.1" }, "dependencies": { - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==" } } }, @@ -2988,7 +3416,8 @@ "estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true }, "esutils": { "version": "2.0.3", @@ -3270,18 +3699,6 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" }, - "fast-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.1.0.tgz", - "integrity": "sha512-TrUz3THiq2Vy3bjfQUB2wNyPdGBeGmdjbzzBLhfHN4YFurYptCKwGq/TfiRavbGywFRzY6U2CdmQ1zmsY5yYaw==", - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2" - } - }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", @@ -3298,20 +3715,17 @@ "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==", "dev": true }, - "fastq": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.0.tgz", - "integrity": "sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA==", - "requires": { - "reusify": "^1.0.0" - } - }, "fecha": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", "integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==", "dev": true }, + "fflate": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.3.11.tgz", + "integrity": "sha512-Rr5QlUeGN1mbOHlaqcSYMKVpPbgLy0AWT/W0EHxA6NGI12yO1jpoui2zBBvU2G824ltM6Ut8BFgfHSBGfkmS0A==" + }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", @@ -3340,14 +3754,6 @@ "merge-descriptors": "~1.0.0" } }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "requires": { - "to-regex-range": "^5.0.1" - } - }, "finalhandler": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", @@ -3382,15 +3788,6 @@ "pkg-dir": "^3.0.0" } }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, "flat-cache": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", @@ -4114,11 +4511,6 @@ "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "dev": true }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=" - }, "get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", @@ -4154,14 +4546,6 @@ "path-is-absolute": "^1.0.0" } }, - "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", - "requires": { - "is-glob": "^4.0.1" - } - }, "global-dirs": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", @@ -4354,11 +4738,6 @@ "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", "dev": true }, - "hex-lib": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/hex-lib/-/hex-lib-1.0.2.tgz", - "integrity": "sha512-qhDA/BRD81zbthBVL/l1l1ZAEhudWEoH9+4kY4EvBfWz9CpeuN5OI22nFByHHEIRnrlEV+D6318MsqgcjF7Esg==" - }, "hex-to-array-buffer": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/hex-to-array-buffer/-/hex-to-array-buffer-1.1.0.tgz", @@ -4393,6 +4772,31 @@ } } }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -4403,6 +4807,30 @@ "sshpk": "^1.7.0" } }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "requires": { + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -4452,14 +4880,6 @@ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "requires": { - "repeating": "^2.0.0" - } - }, "indexof": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", @@ -4624,6 +5044,11 @@ "resolved": "https://registry.npmjs.org/is-bluebird/-/is-bluebird-1.0.2.tgz", "integrity": "sha1-CWQ5Bg9KpBGr7hkUOoTWpVNG1uI=" }, + "is-buffer": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==" + }, "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", @@ -4699,15 +5124,8 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" - }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "requires": { - "number-is-nan": "^1.0.0" - } + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true }, "is-fullwidth-code-point": { "version": "1.0.0", @@ -4721,6 +5139,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -4735,11 +5154,6 @@ "is-path-inside": "^1.0.0" } }, - "is-mergeable-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-mergeable-object/-/is-mergeable-object-1.1.0.tgz", - "integrity": "sha512-JfyDDwUdtS4yHCgUpxOyKB9dnfZ0gecufxB0eytX6BmSXSE+8dbxDGt+V7CNRIRJ9sYFV/WQt2KJG6hNob2sBw==" - }, "is-nan": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.0.tgz", @@ -4754,11 +5168,6 @@ "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=", "dev": true }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - }, "is-obj": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", @@ -4833,11 +5242,6 @@ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" - }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -4954,16 +5358,6 @@ "handlebars": "^4.1.2" } }, - "japanese": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/japanese/-/japanese-1.2.0.tgz", - "integrity": "sha1-tyGAamsaVR4V+sTj11TfZSC9u0Y=", - "requires": { - "big.js": "^3.1.3", - "extend": "^3.0.0", - "meow": "~3.7.0" - } - }, "joi": { "version": "14.3.1", "resolved": "https://registry.npmjs.org/joi/-/joi-14.3.1.tgz", @@ -5235,18 +5629,6 @@ "uc.micro": "^1.0.1" } }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -5380,15 +5762,6 @@ "resolved": "https://registry.npmjs.org/long-timeout/-/long-timeout-0.1.1.tgz", "integrity": "sha1-lyHXiLR+C8taJMLivuGg2lXatRQ=" }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "requires": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" - } - }, "lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -5446,11 +5819,6 @@ "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" - }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -5517,30 +5885,6 @@ "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", "dev": true }, - "meow": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "requires": { - "camelcase-keys": "^2.0.0", - "decamelize": "^1.1.2", - "loud-rejection": "^1.0.0", - "map-obj": "^1.0.1", - "minimist": "^1.1.3", - "normalize-package-data": "^2.3.4", - "object-assign": "^4.0.1", - "read-pkg-up": "^1.0.1", - "redent": "^1.0.0", - "trim-newlines": "^1.0.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - } - } - }, "merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", @@ -5554,25 +5898,11 @@ "source-map": "^0.6.1" } }, - "merge2": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", - "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==" - }, "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, "mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -5908,16 +6238,25 @@ } }, "node-nlp": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/node-nlp/-/node-nlp-3.10.1.tgz", - "integrity": "sha512-ID/xgOiv8m6p4A/q6efGjePozy/vuK3OdwxIRaQPM602kfahq94cABWbIPriyH8/JlW4VVtWLiwy0Kk0EyMEDg==", - "requires": { - "@microsoft/recognizers-text-suite": "1.1.4", - "escodegen": "^1.12.0", - "esprima": "^4.0.1", - "kuromoji": "^0.1.2", - "novel-segment": "^2.5.0", - "xlsx": "^0.15.1" + "version": "4.19.7", + "resolved": "https://registry.npmjs.org/node-nlp/-/node-nlp-4.19.7.tgz", + "integrity": "sha512-/UXLzJazHZj15hbtj2efP8kekA75pPX37MrQ7torRCNSqDmryAQc3pm8XPm+1GZFvBC3go903I6Oe8LenEmyXg==", + "requires": { + "@nlpjs/builtin-duckling": "^4.19.1", + "@nlpjs/builtin-microsoft": "^4.19.1", + "@nlpjs/core-loader": "^4.19.1", + "@nlpjs/emoji": "^4.19.1", + "@nlpjs/evaluator": "^4.17.1", + "@nlpjs/lang-all": "^4.19.1", + "@nlpjs/language": "^4.17.0", + "@nlpjs/neural": "^4.17.0", + "@nlpjs/nlg": "^4.19.1", + "@nlpjs/nlp": "^4.19.7", + "@nlpjs/nlu": "^4.19.1", + "@nlpjs/request": "^4.17.0", + "@nlpjs/sentiment": "^4.19.1", + "@nlpjs/similarity": "^4.17.0", + "@nlpjs/xtables": "^4.17.0" } }, "node-pre-gyp": { @@ -6039,32 +6378,6 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, - "novel-segment": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/novel-segment/-/novel-segment-2.5.0.tgz", - "integrity": "sha512-/3GP7EJJONRzgjsZA4P+pJ5A+P0nUMJs2kEFsQl0uANVVv5OnUGwbY8QQ+KVyOhByNcPAg8pncnwiQgknz8Log==", - "requires": { - "@bluelovers/fast-glob": "^3.0.4", - "@novel-segment/util": "^1.0.8", - "array-hyper-unique": "^1.1.0", - "bluebird": "^3.5.5", - "cjk-conv": "^1.2.26", - "core-decorators": "^0.20.0", - "crlf-normalize": "^1.0.3", - "deepmerge-plus": "^2.1.3", - "fs-extra": "^8.1.0", - "hex-lib": "^1.0.2", - "lodash.clonedeep": "^4.5.0", - "regexp-cjk": "^3.3.8", - "segment-dict": "^2.3.16", - "sort-object-keys2": "^1.1.0", - "str-util": "^2.3.21", - "string-natural-compare": "^2.0.3", - "ts-enum-util": "4.0.1", - "ts-type": "^1.2.9", - "uni-string": "^1.1.2" - } - }, "npm-bundled": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", @@ -7221,6 +7534,11 @@ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, + "object-component": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", + "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=" + }, "object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", @@ -7489,19 +7807,26 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, "requires": { "error-ex": "^1.2.0" } }, "parseqs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz", - "integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w==" + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", + "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", + "requires": { + "better-assert": "~1.0.0" + } }, "parseuri": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz", - "integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==" + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", + "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", + "requires": { + "better-assert": "~1.0.0" + } }, "parseurl": { "version": "1.3.3", @@ -7520,14 +7845,6 @@ "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", "dev": true }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "requires": { - "pinkie-promise": "^2.0.0" - } - }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -7554,16 +7871,6 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.1.0.tgz", "integrity": "sha512-PtHLisEvUOepjc+sStXxJ/pDV/s5UBTOKWJY2SOz3e6E/iN/jLknY9WL72kTwRrwXDUbZTEAtSnJbz2fF127DA==" }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, "pathval": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", @@ -7575,11 +7882,6 @@ "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, - "picomatch": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", - "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==" - }, "pidtree": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.0.tgz", @@ -7589,20 +7891,8 @@ "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "requires": { - "pinkie": "^2.0.0" - } + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true }, "pkg-dir": { "version": "3.0.0", @@ -7776,25 +8066,6 @@ } } }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, "readable-stream": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", @@ -7947,15 +8218,6 @@ "resolve": "^1.1.6" } }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" - } - }, "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", @@ -7971,94 +8233,6 @@ "safe-regex": "^1.1.0" } }, - "regexp-cjk": { - "version": "3.3.8", - "resolved": "https://registry.npmjs.org/regexp-cjk/-/regexp-cjk-3.3.8.tgz", - "integrity": "sha512-KsFml0lwlJHbNfAx5stb2r2jwuLIres1PUKl4UMG/Yd40Jwj3ltI5/Gme6rBcxv3cl1oTdVhY8iNixRPfcTb4Q==", - "requires": { - "array-hyper-unique": "^1.1.0", - "cjk-conv": "^1.2.0", - "lodash": "^4.17.15", - "regexp-helper": "^1.0.8", - "regexp-parser-event": "^1.1.5", - "regexp-parser-literal": "^1.1.0", - "regexp-range": "^1.0.7", - "regexp-support": "^1.0.25" - } - }, - "regexp-helper": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/regexp-helper/-/regexp-helper-1.0.8.tgz", - "integrity": "sha512-4pumLQTWMxeom6ND3+NHRLa5E8D0BIkvw8PlPdB80PCxKX9rDWRmoJrpHXPltz/CbkxDzs43+xC63nsvOLrR5Q==", - "requires": { - "regexp-helper-core": "^1.0.6", - "regexp-support": "^1.0.24" - } - }, - "regexp-helper-core": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/regexp-helper-core/-/regexp-helper-core-1.0.7.tgz", - "integrity": "sha512-RSVJx7l7lyeFrduiZFE1RO8emrD5zdt92g9kV6KQZGVlBUVxUBw436qYN5eqJNFfPGIlHzpDoQHoNB1ryHpE0w==" - }, - "regexp-parser-event": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/regexp-parser-event/-/regexp-parser-event-1.1.5.tgz", - "integrity": "sha512-LofuoqV5xHhe63BXsz8rHezhf+NYMyKSzpQ+Aue+A4znxhGTibMdkBDceK118Ly2jWdkQycl/cIxvK61mVMQJg==", - "requires": { - "array-hyper-unique": "^1.0.7", - "regexp-parser-literal": "^1.1.0", - "regexpp2": "^1.3.0", - "ts-type": "^1.2.9" - } - }, - "regexp-parser-literal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/regexp-parser-literal/-/regexp-parser-literal-1.1.0.tgz", - "integrity": "sha512-F+9UMhTcGAlanyGy3BYjmcfMrInlXJ2gLis+sWQuUGTUlTgkIMssgr3STfye33YKkzKrd4u1BPyuR6RTp8OPPQ==", - "requires": { - "array-hyper-unique": "^1.0.7", - "emoji-regex": "^8.0.0", - "regexpp2": "^1.3.0", - "uni-string": "^1.1.0" - } - }, - "regexp-range": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/regexp-range/-/regexp-range-1.0.7.tgz", - "integrity": "sha512-/SEUEeehtB7gvBQ2wEkaRrLXEY76Gk6BB/uwwynVfkxfIf1GHJ6ZS57/YWYPwGrnMn9+etBx09J5KsQdc7WnFQ==", - "requires": { - "array-hyper-unique": "^1.0.7", - "fill-range": "^6.0.0", - "japanese": "^1.2.0" - }, - "dependencies": { - "fill-range": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-6.0.0.tgz", - "integrity": "sha512-HaePWycCxz/O/VsefR6fRhhZ+64gSwUAy5GIN1gX+8Z+JPFWvNsz2qaeYLq/hS3RgC06MlkZFSE+4UObHvbpXw==", - "requires": { - "is-number": "^7.0.0", - "to-regex-range": "^4.0.1" - } - }, - "to-regex-range": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-4.0.3.tgz", - "integrity": "sha512-AtJgwCeygrdcfleD1nolmv8TSJcsPvSsvnqQRzc1AkEa//+RRTseKZpaXOfZk2/U1B+bz0sRpkaF1oHX5YmHKg==", - "requires": { - "is-number": "^7.0.0" - } - } - } - }, - "regexp-support": { - "version": "1.0.25", - "resolved": "https://registry.npmjs.org/regexp-support/-/regexp-support-1.0.25.tgz", - "integrity": "sha512-NCTOLOC0VSY/0bdsDLDNnLZ/v3CaxxUYdZKJ+XWxiAypRrSUfUMI1CNXCksNS3xB8d0FiiwQUO4BsY5A3t51vg==", - "requires": { - "sort-object-keys2": "^1.1.0" - } - }, "regexp.prototype.flags": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz", @@ -8074,11 +8248,6 @@ "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, - "regexpp2": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/regexpp2/-/regexpp2-1.3.0.tgz", - "integrity": "sha512-0mdoMXcnqFF776obPrL9GxIegCFsESJRH776HbfpcRTVpC2+Sph6duvN1ThIoQBOd/7GszJAmCwhW3ZjxkUiiA==" - }, "registry-auth-token": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.4.0.tgz", @@ -8124,14 +8293,6 @@ "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "requires": { - "is-finite": "^1.0.0" - } - }, "request": { "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", @@ -8255,11 +8416,6 @@ } } }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" - }, "rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -8277,16 +8433,6 @@ "is-promise": "^2.1.0" } }, - "run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==" - }, - "runes2": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/runes2/-/runes2-0.4.7.tgz", - "integrity": "sha512-veh6J0PN4xsXopGyfpz9IslJMuRJ4PQZ3J6BVFxjQSw7ownKbsYqViT68EDZLrZnAGI/gxm4Q0kr7y7B0vPIGw==" - }, "rxjs": { "version": "6.5.3", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz", @@ -8334,25 +8480,6 @@ "pad-start": "^1.0.2" } }, - "segment-dict": { - "version": "2.3.16", - "resolved": "https://registry.npmjs.org/segment-dict/-/segment-dict-2.3.16.tgz", - "integrity": "sha512-4dxduxeroSGQvfalUIG1g2xGZT0BZ6TQblUxFDUn3QnBscsjuyr/gEZHH69HbPr4799zZxt2Q3siu0PpIt5aeA==", - "requires": { - "@bluelovers/fast-glob": "^3.0.4", - "@novel-segment/util": "^1.0.8", - "bluebird": "^3.5.5", - "core-decorators": "^0.20.0", - "crlf-normalize": "^1.0.3", - "fast-glob": "^3.0.4", - "fs-extra": "^8.1.0", - "split2": "^3.1.1", - "stream-pipe": "^1.0.1", - "through2": "^3.0.1", - "uni-string": "^1.1.2", - "upath2": "^2.1.3" - } - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -8748,52 +8875,51 @@ } }, "socket.io-client": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.4.0.tgz", - "integrity": "sha512-M6xhnKQHuuZd4Ba9vltCLT9oa+YvTsP8j9NcEiLElfIg8KeYPyhWOes6x4t+LTAC8enQbE/995AdTem2uNyKKQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.3.0.tgz", + "integrity": "sha512-cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA==", "requires": { "backo2": "1.0.2", + "base64-arraybuffer": "0.1.5", "component-bind": "1.0.0", - "component-emitter": "~1.3.0", - "debug": "~3.1.0", - "engine.io-client": "~3.5.0", + "component-emitter": "1.2.1", + "debug": "~4.1.0", + "engine.io-client": "~3.4.0", "has-binary2": "~1.0.2", + "has-cors": "1.1.0", "indexof": "0.0.1", - "parseqs": "0.0.6", - "parseuri": "0.0.6", + "object-component": "0.0.3", + "parseqs": "0.0.5", + "parseuri": "0.0.5", "socket.io-parser": "~3.3.0", "to-array": "0.1.4" }, "dependencies": { - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" } } }, "socket.io-parser": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.2.tgz", - "integrity": "sha512-FJvDBuOALxdCI9qwRrO/Rfp9yfndRtc1jSgVgV8FDraihmSP/MLGD5PEuJrNfjALvcQ+vMDM/33AWOYP/JSjDg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.0.tgz", + "integrity": "sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng==", "requires": { - "component-emitter": "~1.3.0", + "component-emitter": "1.2.1", "debug": "~3.1.0", "isarray": "2.0.1" - }, - "dependencies": { - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" - } } }, - "sort-object-keys2": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/sort-object-keys2/-/sort-object-keys2-1.1.0.tgz", - "integrity": "sha512-yV3GAWYQp+xOqDw8f484cmZY8NACX1fITTM/dUlXteRAdZHOmdJUI0ibuDHH+454kIvorXuJiJCA5evUtPfoVw==" - }, "sorted-array-functions": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/sorted-array-functions/-/sorted-array-functions-1.2.0.tgz", @@ -8878,26 +9004,6 @@ "extend-shallow": "^3.0.0" } }, - "split2": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/split2/-/split2-3.1.1.tgz", - "integrity": "sha512-emNzr1s7ruq4N+1993yht631/JH+jaj0NYBosuKmLcq+JkGQ9MmTw1RB1fGaTCzUuseRIClrlSLHRNYGwWQ58Q==", - "requires": { - "readable-stream": "^3.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", - "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -8938,9 +9044,9 @@ } }, "ssf": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/ssf/-/ssf-0.10.2.tgz", - "integrity": "sha512-rDhAPm9WyIsY8eZEKyE8Qsotb3j/wBdvMWBUsOhJdfhKGLfQidRjiBUV0y/MkyCLiXQ38FG6LWW/VYUtqlIDZQ==", + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz", + "integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==", "requires": { "frac": "~1.1.2" } @@ -9000,50 +9106,6 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, - "str-util": { - "version": "2.3.21", - "resolved": "https://registry.npmjs.org/str-util/-/str-util-2.3.21.tgz", - "integrity": "sha512-kdPeZKVHzwLm+AxiKIWQpEVbJG+YNNjE6Upu4KJCJ14MNQ2moW2iKqAx4gsj0rvjsHE7C08iyuCpDNqPPXxwAQ==", - "requires": { - "chinese-parseint": "^1.1.0", - "cjk-conv": "^1.1.57", - "deepmerge": "^3.2.0", - "is-fullwidth-code-point": "^3.0.0", - "japanese": "^1.2.0", - "strip-ansi": "^5.2.0", - "uni-string": "^1.1.2" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "stream-pipe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-pipe/-/stream-pipe-1.0.1.tgz", - "integrity": "sha512-8XfkJV83Mm5tmxbf0nhVOzJ6ptBGEzpuFh7h5il8ZSgGv9xCrS3DqT4vkmt3LetCuRSoAVfrN6tkZrcM07BQHQ==" - }, - "string-natural-compare": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/string-natural-compare/-/string-natural-compare-2.0.3.tgz", - "integrity": "sha512-4Kcl12rNjc+6EKhY8QyDVuQTAlMWwRiNbsxnVwBUKFr7dYPQuXVrtNU4sEkjF9LHY0AY6uVbB3ktbkIH4LC+BQ==" - }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -9101,28 +9163,12 @@ "ansi-regex": "^2.0.0" } }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "requires": { - "is-utf8": "^0.2.0" - } - }, "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", - "requires": { - "get-stdin": "^4.0.1" - } - }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -9382,14 +9428,6 @@ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, - "through2": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", - "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", - "requires": { - "readable-stream": "2 || 3" - } - }, "timed-out": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", @@ -9472,14 +9510,6 @@ "safe-regex": "^1.1.0" } }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "requires": { - "is-number": "^7.0.0" - } - }, "toidentifier": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", @@ -9588,30 +9618,12 @@ } } }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=" - }, "triple-beam": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==", "dev": true }, - "ts-enum-util": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/ts-enum-util/-/ts-enum-util-4.0.1.tgz", - "integrity": "sha512-ipCgRzaCp8jK8Ug/ePNvf2+YkW2qBNEKCeJu4sTsNL2/Vgzf6EqOIe8xNhUqK50e16ID9ShHYnAZo//jaKdZxA==" - }, - "ts-type": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/ts-type/-/ts-type-1.2.9.tgz", - "integrity": "sha512-g1tViOMrT41WoKYvVVz2zPRQJiG/47V43X3yd7qdnpQs79KBTl7V+fqdQ3UtH8DDyu7BDVMXdfN5+yW3RUZq0w==", - "requires": { - "typedarray-dts": "^1.0.0" - } - }, "tslib": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", @@ -9646,7 +9658,8 @@ "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true }, "type-is": { "version": "1.6.18", @@ -9662,11 +9675,6 @@ "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, - "typedarray-dts": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typedarray-dts/-/typedarray-dts-1.0.0.tgz", - "integrity": "sha512-Ka0DBegjuV9IPYFT1h0Qqk5U4pccebNIJCGl8C5uU7xtOs+jpJvKGAY4fHGK25hTmXZOEUl9Cnsg5cS6K/b5DA==" - }, "uc.micro": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", @@ -9718,15 +9726,6 @@ "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==", "dev": true }, - "uni-string": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/uni-string/-/uni-string-1.1.2.tgz", - "integrity": "sha512-m1z6KZScZiaFwoJ3BCzU3MON7ZT7tdd15pnCBOiQASwQPN9UlgORpH97JbolZBqioZAyBTLRzSgUoKlyt8C/dw==", - "requires": { - "es6-class-prototype": "^1.0.4", - "runes2": "^0.4.7" - } - }, "union-value": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", @@ -9851,11 +9850,6 @@ "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", "dev": true }, - "upath2": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/upath2/-/upath2-2.1.3.tgz", - "integrity": "sha512-Ncq46HIWbpcpH5jc0UMNKfcd5KUrszSrF/9KknzpgRM7WTmSjcEL3skp4SShk2KJniNIPZh/Pm1zg/PdWiCrNw==" - }, "update-notifier": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz", @@ -10066,6 +10060,16 @@ "@types/node": "*" } }, + "wmf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz", + "integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==" + }, + "word": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz", + "integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==" + }, "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", @@ -10155,17 +10159,20 @@ "dev": true }, "xlsx": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.15.1.tgz", - "integrity": "sha512-z+o4+QPMc32EPboLCzJAz94o0Zyy+8jrmWTsVpfzwknFln9qDO6/HN1KrGGVC4//sGA7dh4R3HA4fhbGIKCDOA==", + "version": "0.16.9", + "resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.16.9.tgz", + "integrity": "sha512-gxi1I3EasYvgCX1vN9pGyq920Ron4NO8PNfhuoA3Hpq6Y8f0ECXiy4OLrK4QZBnj1jx3QD+8Fq5YZ/3mPZ5iXw==", "requires": { "adler-32": "~1.2.0", - "cfb": "^1.1.3", + "cfb": "^1.1.4", "codepage": "~1.14.0", "commander": "~2.17.1", "crc-32": "~1.2.0", "exit-on-epipe": "~1.0.1", - "ssf": "~0.10.2" + "fflate": "^0.3.8", + "ssf": "~0.11.2", + "wmf": "~1.0.1", + "word": "~0.3.0" }, "dependencies": { "commander": { diff --git a/server/package.json b/server/package.json index dbbc7a52fa..2ca7d5d033 100644 --- a/server/package.json +++ b/server/package.json @@ -89,9 +89,9 @@ "joi": "^14.3.1", "jsonwebtoken": "^8.4.0", "lodash.clonedeep": "^4.5.0", - "node-nlp": "^3.0.3", "node-schedule": "^1.3.2", "node-webcrypto-ossl": "^1.0.48", + "node-nlp": "^4.19.7", "path-to-regexp": "^3.0.0", "queue": "^6.0.0", "semver": "^6.1.1", From 760891b7a9586edd378d29f2d8cbfa17fd58cf59 Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Sat, 30 Jan 2021 18:27:07 +0100 Subject: [PATCH 17/25] Fix after review --- front/src/components/boxs/weather/WeatherBox.jsx | 6 ++++-- front/src/config/i18n/en.json | 11 ++++++++++- front/src/config/i18n/fr.json | 11 ++++++++++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/front/src/components/boxs/weather/WeatherBox.jsx b/front/src/components/boxs/weather/WeatherBox.jsx index c9bc0bd428..6b02338139 100644 --- a/front/src/components/boxs/weather/WeatherBox.jsx +++ b/front/src/components/boxs/weather/WeatherBox.jsx @@ -176,7 +176,7 @@ const WeatherBox = ({ children, ...props }) => ( color: 'grey' }} > - {props.units === 'si' ? 'km/h' : 'm/h'} + {props.units === 'metric' ? 'm/h' : 'm/h'}
@@ -267,7 +267,9 @@ class WeatherBoxComponent extends Component { daysDisplay = days.map(day => { return (
-
{day.datetime_beautiful}
+
+ {} +
diff --git a/front/src/config/i18n/en.json b/front/src/config/i18n/en.json index 5f51dafe39..e9527c92df 100644 --- a/front/src/config/i18n/en.json +++ b/front/src/config/i18n/en.json @@ -13,7 +13,16 @@ "percent": "%", "degreeValue": "{{value}}°", "workInProgress": "Work in progress...", - "save": "Save" + "save": "Save", + "daysOfTheWeek": { + "monday": "Monday", + "tuesday": "Tuesday", + "wednesday": "Wednesday", + "thursday": "Thursday", + "friday": "Friday", + "saturday": "Saturday", + "sunday": "Sunday" + } }, "calendar": { "allDay": "All Day", diff --git a/front/src/config/i18n/fr.json b/front/src/config/i18n/fr.json index 8b41d95398..f0e8450052 100644 --- a/front/src/config/i18n/fr.json +++ b/front/src/config/i18n/fr.json @@ -13,7 +13,16 @@ "percent": "%", "degreeValue": "{{value}}°", "workInProgress": "Travail en cours...", - "save": "Enregistrer" + "save": "Enregistrer", + "daysOfTheWeek": { + "monday": "Lundi", + "tuesday": "Mardi", + "wednesday": "Mercredi", + "thursday": "Jeudi", + "friday": "Vendredi", + "saturday": "Samedi", + "sunday": "Dimanche" + } }, "calendar": { "allDay": "Toute la journée", From 2edea3fbae464a59f66660d70a1daa77e561c4ff Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Sat, 30 Jan 2021 18:28:26 +0100 Subject: [PATCH 18/25] Fix after review --- front/src/components/boxs/weather/WeatherBox.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/src/components/boxs/weather/WeatherBox.jsx b/front/src/components/boxs/weather/WeatherBox.jsx index 6b02338139..7d6120a64e 100644 --- a/front/src/components/boxs/weather/WeatherBox.jsx +++ b/front/src/components/boxs/weather/WeatherBox.jsx @@ -176,7 +176,7 @@ const WeatherBox = ({ children, ...props }) => ( color: 'grey' }} > - {props.units === 'metric' ? 'm/h' : 'm/h'} + {props.units === 'metric' ? 'm/s' : 'm/h'}
From 4b25b72d07bbf617a51ef2c82b76f94857557ae2 Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Mon, 1 Feb 2021 08:26:36 +0100 Subject: [PATCH 19/25] Fix after review --- front/src/components/boxs/weather/WeatherBox.jsx | 10 ++++++++-- front/src/config/i18n/en.json | 6 +++++- front/src/config/i18n/fr.json | 6 +++++- server/lib/weather/weather.command.js | 3 ++- server/utils/constants.js | 6 ++++++ 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/front/src/components/boxs/weather/WeatherBox.jsx b/front/src/components/boxs/weather/WeatherBox.jsx index 7d6120a64e..c241d413f9 100644 --- a/front/src/components/boxs/weather/WeatherBox.jsx +++ b/front/src/components/boxs/weather/WeatherBox.jsx @@ -4,6 +4,8 @@ import { Text } from 'preact-i18n'; import { Link } from 'preact-router/match'; import cx from 'classnames'; +import { WEATHER_UNITS } from '../../../../../server/utils/constants'; + import actions from '../../../actions/dashboard/boxes/weather'; import { RequestStatus, @@ -123,7 +125,7 @@ const WeatherBox = ({ children, ...props }) => ( fontSize: '30px' }} > - {props.units === 'metric' ? 'C' : 'F'} + {props.units === WEATHER_UNITS.METRIC ? : }
@@ -176,7 +178,11 @@ const WeatherBox = ({ children, ...props }) => ( color: 'grey' }} > - {props.units === 'metric' ? 'm/s' : 'm/h'} + {props.units === WEATHER_UNITS.METRIC ? ( + + ) : ( + + )}
diff --git a/front/src/config/i18n/en.json b/front/src/config/i18n/en.json index e9527c92df..33ab969b4b 100644 --- a/front/src/config/i18n/en.json +++ b/front/src/config/i18n/en.json @@ -22,7 +22,11 @@ "friday": "Friday", "saturday": "Saturday", "sunday": "Sunday" - } + }, + "celsius": "C", + "fahrenheit": "F", + "metersPerSec": "m/s", + "milesPerHour": "m/h" }, "calendar": { "allDay": "All Day", diff --git a/front/src/config/i18n/fr.json b/front/src/config/i18n/fr.json index f0e8450052..30ee67be72 100644 --- a/front/src/config/i18n/fr.json +++ b/front/src/config/i18n/fr.json @@ -22,7 +22,11 @@ "friday": "Vendredi", "saturday": "Samedi", "sunday": "Dimanche" - } + }, + "celsius": "C", + "fahrenheit": "F", + "metersPerSec": "m/s", + "milesPerHour": "m/h" }, "calendar": { "allDay": "Toute la journée", diff --git a/server/lib/weather/weather.command.js b/server/lib/weather/weather.command.js index dbd8ab0ce8..ef5cebe24a 100644 --- a/server/lib/weather/weather.command.js +++ b/server/lib/weather/weather.command.js @@ -3,6 +3,7 @@ const logger = require('../../utils/logger'); const { ServiceNotConfiguredError, NoValuesFoundError } = require('../../utils/coreErrors'); const { INTENTS } = require('../../utils/constants'); const { NoWeatherFoundError } = require('./weather.error'); +const { NotFoundError } = require('../../utils/coreErrors'); /** * @description Capitalize First Letter. @@ -75,7 +76,7 @@ async function command(message, classification, context) { } } } else { - throw new Error('Not found'); + throw new NotFoundError('Not found'); } } catch (e) { logger.debug(e); diff --git a/server/utils/constants.js b/server/utils/constants.js index 05e4a3f1ba..34f5cc15ff 100644 --- a/server/utils/constants.js +++ b/server/utils/constants.js @@ -348,6 +348,10 @@ const DEVICE_FEATURE_UNITS = { CM: 'cm', }; +const WEATHER_UNITS = { + METRIC: 'metric', +}; + const DEVICE_FEATURE_UNITS_BY_CATEGORY = { [DEVICE_FEATURE_CATEGORIES.BATTERY]: [DEVICE_FEATURE_UNITS.PERCENT], [DEVICE_FEATURE_CATEGORIES.CO2_SENSOR]: [DEVICE_FEATURE_UNITS.PPM], @@ -528,3 +532,5 @@ module.exports.DASHBOARD_BOX_TYPE = DASHBOARD_BOX_TYPE; module.exports.DASHBOARD_BOX_TYPE_LIST = DASHBOARD_BOX_TYPE_LIST; module.exports.ERROR_MESSAGES = ERROR_MESSAGES; + +module.exports.WEATHER_UNITS = WEATHER_UNITS; From ba1802f41efe46e181545dbc7726499f733cff93 Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Wed, 10 Feb 2021 15:23:52 +0100 Subject: [PATCH 20/25] npm install --- server/package-lock.json | 188 ++++++++++++++------------------------- 1 file changed, 68 insertions(+), 120 deletions(-) diff --git a/server/package-lock.json b/server/package-lock.json index 7d091b7068..5bc1fec44e 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -127,14 +127,14 @@ "integrity": "sha512-NC/J3R2tRUciBPQKcJJ8rz9BGIJYVCPbl699fblp6fBXCHWwAnrOu1oEdDqKhspxsKDj/yZTTDlnSLkmO+ovfA==" }, "@gladysassistant/gladys-gateway-js": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/@gladysassistant/gladys-gateway-js/-/gladys-gateway-js-3.2.6.tgz", - "integrity": "sha512-M6Gwc7SwXBzb0ZAJ69VNxc9VRIKf43S+FJfmKNRbWqrhunDyEaKLf3hD0X5ugLb0pzmG1HyGVqzDrsiA93IOdA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@gladysassistant/gladys-gateway-js/-/gladys-gateway-js-3.2.7.tgz", + "integrity": "sha512-ZIDbZEfhw46zWo6Azc95jzFdlg9U9Ay2xcHrCcg3ktAoeeNGkthXWE1XMKXw+4VxR25OtW1SDzT4HfVcsbZVEQ==", "requires": { "@ctrlpanel/pbkdf2": "^1.0.0", "array-buffer-to-hex": "^1.0.0", "auto-bind": "^2.1.0", - "axios": "^0.18.0", + "axios": "^0.21.1", "encode-utf8": "^1.0.2", "hex-to-array-buffer": "^1.1.0", "secure-remote-password": "^0.3.1", @@ -142,20 +142,11 @@ }, "dependencies": { "axios": { - "version": "0.18.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.1.tgz", - "integrity": "sha512-0BfJq4NSfQXd+SkFdrvFbG7addhYSBA2mQwISr46pD6E5iqkWg02RAs8vyTT/j0RTnoYmeXauBuSv1qKwR179g==", + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", "requires": { - "follow-redirects": "1.5.10", - "is-buffer": "^2.0.2" - } - }, - "follow-redirects": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", - "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", - "requires": { - "debug": "=3.1.0" + "follow-redirects": "^1.10.0" } } } @@ -867,12 +858,12 @@ "integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==" }, "@types/react": { - "version": "16.9.34", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.34.tgz", - "integrity": "sha512-8AJlYMOfPe1KGLKyHpflCg5z46n0b5DbRfqDksxBLBTUpB75ypDBAO9eCUcjNwE6LCUslwTz00yyG/X9gaVtow==", + "version": "16.14.3", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.3.tgz", + "integrity": "sha512-zPrXn03hmPYqh9DznqSFQsoRtrQ4aHgnZDO+hMGvsE/PORvDTdJCHQ6XvJV31ic+0LzF73huPFXUb++W6Kri0Q==", "requires": { "@types/prop-types": "*", - "csstype": "^2.2.0" + "csstype": "^3.0.2" } }, "JSONStream": { @@ -1470,9 +1461,9 @@ } }, "base64-arraybuffer": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", - "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=" + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz", + "integrity": "sha1-mBjHngWbE1X5fgQooBfIOOkLqBI=" }, "bcrypt": { "version": "3.0.6", @@ -1491,14 +1482,6 @@ "tweetnacl": "^0.14.3" } }, - "better-assert": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", - "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", - "requires": { - "callsite": "1.0.0" - } - }, "bignumber.js": { "version": "7.2.1", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", @@ -1721,11 +1704,6 @@ "write-file-atomic": "^2.4.2" } }, - "callsite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", - "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=" - }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -2173,7 +2151,8 @@ "component-emitter": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true }, "component-inherit": { "version": "0.0.3", @@ -2431,9 +2410,9 @@ "dev": true }, "csstype": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.10.tgz", - "integrity": "sha512-D34BqZU4cIlMCY93rZHbrq9pjTAQJ3U8S8rfBqjwHxkGPThWFjzZDQpgMJY0QViLxth6ZKYiwFBo14RdN44U/w==" + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.6.tgz", + "integrity": "sha512-+ZAmfyWMT7TiIlzdqJgjMb7S4f1beorDbWbsocyK4RaiqA5RTX3K14bnBWmmA9QEM0gRdsjyyrEmcyga8Zsxmw==" }, "d": { "version": "1.0.1", @@ -2783,54 +2762,43 @@ } }, "engine.io-client": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.1.tgz", - "integrity": "sha512-RJNmA+A9Js+8Aoq815xpGAsgWH1VoSYM//2VgIiu9lNOaHFfLpTjH4tOzktBpjIs5lvOfiNY1dwf+NuU6D38Mw==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.5.0.tgz", + "integrity": "sha512-12wPRfMrugVw/DNyJk34GQ5vIVArEcVMXWugQGGuw2XxUSztFNmJggZmv8IZlLyEdnpO1QB9LkcjeWewO2vxtA==", "requires": { - "component-emitter": "1.2.1", + "component-emitter": "~1.3.0", "component-inherit": "0.0.3", - "debug": "~4.1.0", + "debug": "~3.1.0", "engine.io-parser": "~2.2.0", "has-cors": "1.1.0", "indexof": "0.0.1", - "parseqs": "0.0.5", - "parseuri": "0.0.5", - "ws": "~6.1.0", + "parseqs": "0.0.6", + "parseuri": "0.0.6", + "ws": "~7.4.2", "xmlhttprequest-ssl": "~1.5.4", "yeast": "0.1.2" }, "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" }, "ws": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", - "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==", - "requires": { - "async-limiter": "~1.0.0" - } + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.3.tgz", + "integrity": "sha512-hr6vCR76GsossIRsr8OLR9acVVm1jyfEWvhbNjtgPOrfvAlKzvyeg/P6r8RuDjRyrcQoPQT7K0DGEPc7Ae6jzA==" } } }, "engine.io-parser": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.0.tgz", - "integrity": "sha512-6I3qD9iUxotsC5HEMuuGsKA0cXerGz+4uGcXQEkfBidgKf0amsjrrtwcbwK/nzpZBxclXlV7gGl9dgWvu4LF6w==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.1.tgz", + "integrity": "sha512-x+dN/fBH8Ro8TFwJ+rkB2AmuVw9Yu2mockR/p3W8f8YtExwFgDvBDi0GWyb4ZLkpahtDGZgtr3zLovanJghPqg==", "requires": { "after": "0.8.2", "arraybuffer.slice": "~0.0.7", - "base64-arraybuffer": "0.1.5", + "base64-arraybuffer": "0.1.4", "blob": "0.0.5", "has-binary2": "~1.0.2" } @@ -5044,11 +5012,6 @@ "resolved": "https://registry.npmjs.org/is-bluebird/-/is-bluebird-1.0.2.tgz", "integrity": "sha1-CWQ5Bg9KpBGr7hkUOoTWpVNG1uI=" }, - "is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==" - }, "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", @@ -7534,11 +7497,6 @@ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, - "object-component": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", - "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=" - }, "object-copy": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", @@ -7813,20 +7771,14 @@ } }, "parseqs": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", - "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", - "requires": { - "better-assert": "~1.0.0" - } + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz", + "integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w==" }, "parseuri": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", - "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", - "requires": { - "better-assert": "~1.0.0" - } + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz", + "integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==" }, "parseurl": { "version": "1.3.3", @@ -8875,49 +8827,45 @@ } }, "socket.io-client": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.3.0.tgz", - "integrity": "sha512-cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.4.0.tgz", + "integrity": "sha512-M6xhnKQHuuZd4Ba9vltCLT9oa+YvTsP8j9NcEiLElfIg8KeYPyhWOes6x4t+LTAC8enQbE/995AdTem2uNyKKQ==", "requires": { "backo2": "1.0.2", - "base64-arraybuffer": "0.1.5", "component-bind": "1.0.0", - "component-emitter": "1.2.1", - "debug": "~4.1.0", - "engine.io-client": "~3.4.0", + "component-emitter": "~1.3.0", + "debug": "~3.1.0", + "engine.io-client": "~3.5.0", "has-binary2": "~1.0.2", - "has-cors": "1.1.0", "indexof": "0.0.1", - "object-component": "0.0.3", - "parseqs": "0.0.5", - "parseuri": "0.0.5", + "parseqs": "0.0.6", + "parseuri": "0.0.6", "socket.io-parser": "~3.3.0", "to-array": "0.1.4" }, "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" } } }, "socket.io-parser": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.0.tgz", - "integrity": "sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.2.tgz", + "integrity": "sha512-FJvDBuOALxdCI9qwRrO/Rfp9yfndRtc1jSgVgV8FDraihmSP/MLGD5PEuJrNfjALvcQ+vMDM/33AWOYP/JSjDg==", "requires": { - "component-emitter": "1.2.1", + "component-emitter": "~1.3.0", "debug": "~3.1.0", "isarray": "2.0.1" + }, + "dependencies": { + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" + } } }, "sorted-array-functions": { From 35faaab0f7e7f520d664f14d3096ad04c821ddf4 Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Mon, 15 Feb 2021 21:41:09 +0100 Subject: [PATCH 21/25] Fix after review --- server/lib/brain/index.js | 3 ++- server/lib/weather/weather.command.js | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/lib/brain/index.js b/server/lib/brain/index.js index a152a749e3..5eb260b166 100644 --- a/server/lib/brain/index.js +++ b/server/lib/brain/index.js @@ -10,8 +10,9 @@ const { load } = require('./brain.load'); const Brain = function Brain() { this.nlpManager = new NlpManager({ - forceNER: true, languages: SUPPORTED_LANGUAGES, + nlu: { log: false }, + autoSave: false, }); }; diff --git a/server/lib/weather/weather.command.js b/server/lib/weather/weather.command.js index ef5cebe24a..ab6c85350f 100644 --- a/server/lib/weather/weather.command.js +++ b/server/lib/weather/weather.command.js @@ -36,7 +36,6 @@ async function command(message, classification, context) { if (`intent.${classification.intent}` === INTENTS.WEATHER.GET) { const dateEntity = classification.entities.find((entity) => entity.entity === 'date'); - // console.log(dateEntity); if (dateEntity === undefined) { // current day From 22150c212400a1b87056a026c7466de60235f040 Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Sun, 28 Feb 2021 21:13:17 +0100 Subject: [PATCH 22/25] Fix after review --- front/src/components/boxs/weather/WeatherBox.jsx | 9 ++++++--- front/src/config/i18n/en.json | 10 +--------- front/src/config/i18n/fr.json | 9 --------- server/lib/weather/weather.command.js | 8 +++++--- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/front/src/components/boxs/weather/WeatherBox.jsx b/front/src/components/boxs/weather/WeatherBox.jsx index c241d413f9..7c2732949b 100644 --- a/front/src/components/boxs/weather/WeatherBox.jsx +++ b/front/src/components/boxs/weather/WeatherBox.jsx @@ -3,6 +3,7 @@ import { connect } from 'unistore/preact'; import { Text } from 'preact-i18n'; import { Link } from 'preact-router/match'; import cx from 'classnames'; +import dayjs from 'dayjs'; import { WEATHER_UNITS } from '../../../../../server/utils/constants'; @@ -211,7 +212,7 @@ const WeatherBox = ({ children, ...props }) => ( ); -@connect('DashboardBoxDataWeather,DashboardBoxStatusWeather', actions) +@connect('DashboardBoxDataWeather,DashboardBoxStatusWeather,user', actions) class WeatherBoxComponent extends Component { componentDidMount() { // get the weather @@ -273,8 +274,10 @@ class WeatherBoxComponent extends Component { daysDisplay = days.map(day => { return (
-
- {} +
+ {dayjs(day.datetime) + .locale(props.user.language) + .format('dddd')}
diff --git a/front/src/config/i18n/en.json b/front/src/config/i18n/en.json index 33ab969b4b..bb044bef5a 100644 --- a/front/src/config/i18n/en.json +++ b/front/src/config/i18n/en.json @@ -14,15 +14,7 @@ "degreeValue": "{{value}}°", "workInProgress": "Work in progress...", "save": "Save", - "daysOfTheWeek": { - "monday": "Monday", - "tuesday": "Tuesday", - "wednesday": "Wednesday", - "thursday": "Thursday", - "friday": "Friday", - "saturday": "Saturday", - "sunday": "Sunday" - }, + "celsius": "C", "fahrenheit": "F", "metersPerSec": "m/s", diff --git a/front/src/config/i18n/fr.json b/front/src/config/i18n/fr.json index 30ee67be72..1242c29670 100644 --- a/front/src/config/i18n/fr.json +++ b/front/src/config/i18n/fr.json @@ -14,15 +14,6 @@ "degreeValue": "{{value}}°", "workInProgress": "Travail en cours...", "save": "Enregistrer", - "daysOfTheWeek": { - "monday": "Lundi", - "tuesday": "Mardi", - "wednesday": "Mercredi", - "thursday": "Jeudi", - "friday": "Vendredi", - "saturday": "Samedi", - "sunday": "Dimanche" - }, "celsius": "C", "fahrenheit": "F", "metersPerSec": "m/s", diff --git a/server/lib/weather/weather.command.js b/server/lib/weather/weather.command.js index ab6c85350f..303b81baad 100644 --- a/server/lib/weather/weather.command.js +++ b/server/lib/weather/weather.command.js @@ -44,12 +44,14 @@ async function command(message, classification, context) { await this.messageManager.replyByIntent(message, `weather.get.success.now.${weather.weather}`, context); } else { - let diff; + let diffDate; if (dateEntity.resolution.type === 'interval') { - diff = dayjs(dateEntity.resolution.strFutureValue).diff(dayjs().startOf('day'), 'day'); + diffDate = dateEntity.resolution.strFutureValue; } else { - diff = dayjs(dateEntity.resolution.date).diff(dayjs().startOf('day'), 'day'); + diffDate = dateEntity.resolution.date; } + const diff = dayjs(diffDate).diff(dayjs().startOf('day'), 'day'); + const weatherDay = weather.days[diff]; if (weatherDay !== undefined) { From df675030458a314c4a8655fe0868fd14c572c7f2 Mon Sep 17 00:00:00 2001 From: Corentin Allemand Date: Wed, 10 Mar 2021 19:47:18 +0100 Subject: [PATCH 23/25] Fix after review --- front/src/config/i18n/en.json | 1 - 1 file changed, 1 deletion(-) diff --git a/front/src/config/i18n/en.json b/front/src/config/i18n/en.json index bb044bef5a..811f3a1c8b 100644 --- a/front/src/config/i18n/en.json +++ b/front/src/config/i18n/en.json @@ -14,7 +14,6 @@ "degreeValue": "{{value}}°", "workInProgress": "Work in progress...", "save": "Save", - "celsius": "C", "fahrenheit": "F", "metersPerSec": "m/s", From 839daf8fbf23b43a40f3a2fd8b71dee66482071e Mon Sep 17 00:00:00 2001 From: Pierre-Gilles Leymarie Date: Mon, 22 Mar 2021 14:58:10 +0800 Subject: [PATCH 24/25] Update package-lock.json --- server/package-lock.json | 609 ++++++++++++++++++++++++++------------- 1 file changed, 406 insertions(+), 203 deletions(-) diff --git a/server/package-lock.json b/server/package-lock.json index 251e836976..49d03a0bf1 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -3892,25 +3892,29 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true, "optional": true }, "aproba": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "dev": true, "optional": true, "requires": { @@ -3920,13 +3924,15 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true, "optional": true }, "brace-expansion": { "version": "1.1.11", - "bundled": true, + "resolved": false, + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "optional": true, "requires": { @@ -3936,37 +3942,43 @@ }, "chownr": { "version": "1.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true, "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true, "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true, "optional": true }, "core-util-is": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true, "optional": true }, "debug": { "version": "4.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "optional": true, "requires": { @@ -3975,25 +3987,29 @@ }, "deep-extend": { "version": "0.6.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "dev": true, "optional": true, "requires": { @@ -4002,13 +4018,15 @@ }, "fs.realpath": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "bundled": true, + "resolved": false, + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "optional": true, "requires": { @@ -4024,7 +4042,8 @@ }, "glob": { "version": "7.1.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "optional": true, "requires": { @@ -4038,13 +4057,15 @@ }, "has-unicode": { "version": "2.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.24", - "bundled": true, + "resolved": false, + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "optional": true, "requires": { @@ -4053,7 +4074,8 @@ }, "ignore-walk": { "version": "3.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "optional": true, "requires": { @@ -4062,7 +4084,8 @@ }, "inflight": { "version": "1.0.6", - "bundled": true, + "resolved": false, + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "optional": true, "requires": { @@ -4072,19 +4095,22 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true, "optional": true }, "ini": { "version": "1.3.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "optional": true, "requires": { @@ -4093,13 +4119,15 @@ }, "isarray": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "optional": true, "requires": { @@ -4108,13 +4136,15 @@ }, "minimist": { "version": "0.0.8", - "bundled": true, + "resolved": false, + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true, "optional": true }, "minipass": { "version": "2.3.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "dev": true, "optional": true, "requires": { @@ -4124,7 +4154,8 @@ }, "minizlib": { "version": "1.2.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", "dev": true, "optional": true, "requires": { @@ -4133,7 +4164,8 @@ }, "mkdirp": { "version": "0.5.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "optional": true, "requires": { @@ -4142,13 +4174,15 @@ }, "ms": { "version": "2.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true, "optional": true }, "needle": { "version": "2.3.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", "dev": true, "optional": true, "requires": { @@ -4159,7 +4193,8 @@ }, "node-pre-gyp": { "version": "0.12.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", "dev": true, "optional": true, "requires": { @@ -4177,7 +4212,8 @@ }, "nopt": { "version": "4.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "optional": true, "requires": { @@ -4187,13 +4223,15 @@ }, "npm-bundled": { "version": "1.0.6", - "bundled": true, + "resolved": false, + "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", "dev": true, "optional": true }, "npm-packlist": { "version": "1.4.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", "dev": true, "optional": true, "requires": { @@ -4203,7 +4241,8 @@ }, "npmlog": { "version": "4.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "optional": true, "requires": { @@ -4215,19 +4254,22 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true, "optional": true }, "object-assign": { "version": "4.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, "optional": true }, "once": { "version": "1.4.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "optional": true, "requires": { @@ -4236,19 +4278,22 @@ }, "os-homedir": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "optional": true, "requires": { @@ -4258,19 +4303,22 @@ }, "path-is-absolute": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true, "optional": true }, "rc": { "version": "1.2.8", - "bundled": true, + "resolved": false, + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, "optional": true, "requires": { @@ -4282,7 +4330,8 @@ "dependencies": { "minimist": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true, "optional": true } @@ -4290,7 +4339,8 @@ }, "readable-stream": { "version": "2.3.6", - "bundled": true, + "resolved": false, + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "optional": true, "requires": { @@ -4305,7 +4355,8 @@ }, "rimraf": { "version": "2.6.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "optional": true, "requires": { @@ -4314,43 +4365,50 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true, "optional": true }, "safer-buffer": { "version": "2.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true, "optional": true }, "semver": { "version": "5.7.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true, "optional": true }, "string-width": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "optional": true, "requires": { @@ -4361,7 +4419,8 @@ }, "string_decoder": { "version": "1.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "optional": true, "requires": { @@ -4370,7 +4429,8 @@ }, "strip-ansi": { "version": "3.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "optional": true, "requires": { @@ -4379,13 +4439,15 @@ }, "strip-json-comments": { "version": "2.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "optional": true }, "tar": { "version": "4.4.8", - "bundled": true, + "resolved": false, + "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", "dev": true, "optional": true, "requires": { @@ -4400,13 +4462,15 @@ }, "util-deprecate": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "optional": true }, "wide-align": { "version": "1.1.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, "optional": true, "requires": { @@ -4415,13 +4479,15 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true, "optional": true }, "yallist": { "version": "3.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", "dev": true, "optional": true } @@ -6496,12 +6562,14 @@ "dependencies": { "ansi-regex": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, "append-transform": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", "dev": true, "requires": { "default-require-extensions": "^2.0.0" @@ -6509,17 +6577,20 @@ }, "archy": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", "dev": true }, "arrify": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, "async": { "version": "2.6.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", "dev": true, "requires": { "lodash": "^4.17.11" @@ -6527,12 +6598,14 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, "brace-expansion": { "version": "1.1.11", - "bundled": true, + "resolved": false, + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -6541,7 +6614,8 @@ }, "caching-transform": { "version": "3.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-Y1KTLNwSPd4ljsDrFOtyXVmm7Gnk42yQitNq43AhE+cwUR/e4T+rmOHs1IPtzBg8066GBJfTOj1rQYFSWSsH2g==", "dev": true, "requires": { "hasha": "^3.0.0", @@ -6552,12 +6626,14 @@ }, "camelcase": { "version": "5.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", "dev": true }, "cliui": { "version": "4.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "dev": true, "requires": { "string-width": "^2.1.1", @@ -6567,28 +6643,33 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, "commander": { "version": "2.17.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", "dev": true, "optional": true }, "commondir": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, "concat-map": { "version": "0.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, "convert-source-map": { "version": "1.6.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", "dev": true, "requires": { "safe-buffer": "~5.1.1" @@ -6596,7 +6677,8 @@ }, "cross-spawn": { "version": "4.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", "dev": true, "requires": { "lru-cache": "^4.0.1", @@ -6605,7 +6687,8 @@ }, "debug": { "version": "4.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { "ms": "^2.1.1" @@ -6613,12 +6696,14 @@ }, "decamelize": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, "default-require-extensions": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", "dev": true, "requires": { "strip-bom": "^3.0.0" @@ -6626,7 +6711,8 @@ }, "end-of-stream": { "version": "1.4.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "dev": true, "requires": { "once": "^1.4.0" @@ -6634,7 +6720,8 @@ }, "error-ex": { "version": "1.3.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { "is-arrayish": "^0.2.1" @@ -6642,12 +6729,14 @@ }, "es6-error": { "version": "4.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, "execa": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", "dev": true, "requires": { "cross-spawn": "^6.0.0", @@ -6661,7 +6750,8 @@ "dependencies": { "cross-spawn": { "version": "6.0.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { "nice-try": "^1.0.4", @@ -6675,7 +6765,8 @@ }, "find-cache-dir": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-LDUY6V1Xs5eFskUVYtIwatojt6+9xC9Chnlk/jYOOvn3FAFfSaWddxahDGyNHh0b2dMXa6YW2m0tk8TdVaXHlA==", "dev": true, "requires": { "commondir": "^1.0.1", @@ -6685,7 +6776,8 @@ }, "find-up": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { "locate-path": "^3.0.0" @@ -6693,7 +6785,8 @@ }, "foreground-child": { "version": "1.5.6", - "bundled": true, + "resolved": false, + "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", "dev": true, "requires": { "cross-spawn": "^4", @@ -6702,17 +6795,20 @@ }, "fs.realpath": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, "get-caller-file": { "version": "1.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", "dev": true }, "get-stream": { "version": "4.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", "dev": true, "requires": { "pump": "^3.0.0" @@ -6720,7 +6816,8 @@ }, "glob": { "version": "7.1.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -6733,12 +6830,14 @@ }, "graceful-fs": { "version": "4.1.15", - "bundled": true, + "resolved": false, + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", "dev": true }, "handlebars": { "version": "4.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w==", "dev": true, "requires": { "async": "^2.5.0", @@ -6749,19 +6848,22 @@ "dependencies": { "source-map": { "version": "0.6.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } }, "has-flag": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "hasha": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-UqMvq4Vp1BymmmH/GiFPjrfIvTk=", "dev": true, "requires": { "is-stream": "^1.0.1" @@ -6769,17 +6871,20 @@ }, "hosted-git-info": { "version": "2.7.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", "dev": true }, "imurmurhash": { "version": "0.1.4", - "bundled": true, + "resolved": false, + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, "inflight": { "version": "1.0.6", - "bundled": true, + "resolved": false, + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { "once": "^1.3.0", @@ -6788,42 +6893,50 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "invert-kv": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", "dev": true }, "is-arrayish": { "version": "0.2.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, "is-fullwidth-code-point": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "is-stream": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, "isexe": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, "istanbul-lib-coverage": { "version": "2.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw==", "dev": true }, "istanbul-lib-hook": { "version": "2.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-CLmEqwEhuCYtGcpNVJjLV1DQyVnIqavMLFHV/DP+np/g3qvdxu3gsPqYoJMXm15sN84xOlckFB3VNvRbf5yEgA==", "dev": true, "requires": { "append-transform": "^1.0.0" @@ -6831,7 +6944,8 @@ }, "istanbul-lib-report": { "version": "2.0.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-sOiLZLAWpA0+3b5w5/dq0cjm2rrNdAfHWaGhmn7XEFW6X++IV9Ohn+pnELAl9K3rfpaeBfbmH9JU5sejacdLeA==", "dev": true, "requires": { "istanbul-lib-coverage": "^2.0.3", @@ -6841,7 +6955,8 @@ "dependencies": { "supports-color": { "version": "6.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -6851,7 +6966,8 @@ }, "istanbul-lib-source-maps": { "version": "3.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-JX4v0CiKTGp9fZPmoxpu9YEkPbEqCqBbO3403VabKjH+NRXo72HafD5UgnjTEqHL2SAjaZK1XDuDOkn6I5QVfQ==", "dev": true, "requires": { "debug": "^4.1.1", @@ -6863,14 +6979,16 @@ "dependencies": { "source-map": { "version": "0.6.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } }, "istanbul-reports": { "version": "2.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-FzNahnidyEPBCI0HcufJoSEoKykesRlFcSzQqjH9x0+LC8tnnE/p/90PBLu8iZTxr8yYZNyTtiAujUqyN+CIxw==", "dev": true, "requires": { "handlebars": "^4.1.0" @@ -6878,12 +6996,14 @@ }, "json-parse-better-errors": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, "lcid": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", "dev": true, "requires": { "invert-kv": "^2.0.0" @@ -6891,7 +7011,8 @@ }, "load-json-file": { "version": "4.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -6902,7 +7023,8 @@ }, "locate-path": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { "p-locate": "^3.0.0", @@ -6911,17 +7033,20 @@ }, "lodash": { "version": "4.17.11", - "bundled": true, + "resolved": false, + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true }, "lodash.flattendeep": { "version": "4.4.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, "lru-cache": { "version": "4.1.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "dev": true, "requires": { "pseudomap": "^1.0.2", @@ -6930,7 +7055,8 @@ }, "make-dir": { "version": "1.3.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "dev": true, "requires": { "pify": "^3.0.0" @@ -6938,7 +7064,8 @@ }, "map-age-cleaner": { "version": "0.1.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", "dev": true, "requires": { "p-defer": "^1.0.0" @@ -6946,7 +7073,8 @@ }, "mem": { "version": "4.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-I5u6Q1x7wxO0kdOpYBB28xueHADYps5uty/zg936CiG8NTe5sJL8EjrCuLneuDW3PlMdZBGDIn8BirEVdovZvg==", "dev": true, "requires": { "map-age-cleaner": "^0.1.1", @@ -6956,7 +7084,8 @@ }, "merge-source-map": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", "dev": true, "requires": { "source-map": "^0.6.1" @@ -6964,19 +7093,22 @@ "dependencies": { "source-map": { "version": "0.6.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } }, "mimic-fn": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, "minimatch": { "version": "3.0.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -6984,12 +7116,14 @@ }, "minimist": { "version": "0.0.10", - "bundled": true, + "resolved": false, + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", "dev": true }, "mkdirp": { "version": "0.5.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { "minimist": "0.0.8" @@ -6997,24 +7131,28 @@ "dependencies": { "minimist": { "version": "0.0.8", - "bundled": true, + "resolved": false, + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true } } }, "ms": { "version": "2.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, "nice-try": { "version": "1.0.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, "normalize-package-data": { "version": "2.5.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "requires": { "hosted-git-info": "^2.1.4", @@ -7025,7 +7163,8 @@ }, "npm-run-path": { "version": "2.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "requires": { "path-key": "^2.0.0" @@ -7033,12 +7172,14 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, "once": { "version": "1.4.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { "wrappy": "1" @@ -7046,7 +7187,8 @@ }, "optimist": { "version": "0.6.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { "minimist": "~0.0.1", @@ -7055,12 +7197,14 @@ }, "os-homedir": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, "os-locale": { "version": "3.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", "dev": true, "requires": { "execa": "^1.0.0", @@ -7070,22 +7214,26 @@ }, "p-defer": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", "dev": true }, "p-finally": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", "dev": true }, "p-is-promise": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==", "dev": true }, "p-limit": { "version": "2.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -7093,7 +7241,8 @@ }, "p-locate": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "requires": { "p-limit": "^2.0.0" @@ -7101,12 +7250,14 @@ }, "p-try": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", "dev": true }, "package-hash": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA==", "dev": true, "requires": { "graceful-fs": "^4.1.15", @@ -7117,7 +7268,8 @@ }, "parse-json": { "version": "4.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", "dev": true, "requires": { "error-ex": "^1.3.1", @@ -7126,27 +7278,32 @@ }, "path-exists": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true }, "path-is-absolute": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, "path-key": { "version": "2.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, "path-parse": { "version": "1.0.6", - "bundled": true, + "resolved": false, + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, "path-type": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", "dev": true, "requires": { "pify": "^3.0.0" @@ -7154,12 +7311,14 @@ }, "pify": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true }, "pkg-dir": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", "dev": true, "requires": { "find-up": "^3.0.0" @@ -7167,12 +7326,14 @@ }, "pseudomap": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, "pump": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, "requires": { "end-of-stream": "^1.1.0", @@ -7181,7 +7342,8 @@ }, "read-pkg": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", "dev": true, "requires": { "load-json-file": "^4.0.0", @@ -7191,7 +7353,8 @@ }, "read-pkg-up": { "version": "4.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", "dev": true, "requires": { "find-up": "^3.0.0", @@ -7200,7 +7363,8 @@ }, "release-zalgo": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", "dev": true, "requires": { "es6-error": "^4.0.1" @@ -7208,17 +7372,20 @@ }, "require-directory": { "version": "2.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, "require-main-filename": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", "dev": true }, "resolve": { "version": "1.10.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -7226,12 +7393,14 @@ }, "resolve-from": { "version": "4.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, "rimraf": { "version": "2.6.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "requires": { "glob": "^7.1.3" @@ -7239,22 +7408,26 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "semver": { "version": "5.6.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", "dev": true }, "set-blocking": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, "shebang-command": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { "shebang-regex": "^1.0.0" @@ -7262,17 +7435,20 @@ }, "shebang-regex": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, "signal-exit": { "version": "3.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, "spawn-wrap": { "version": "1.4.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-vMwR3OmmDhnxCVxM8M+xO/FtIp6Ju/mNaDfCMMW7FDcLRTPFWUswec4LXJHTJE2hwTI9O0YBfygu4DalFl7Ylg==", "dev": true, "requires": { "foreground-child": "^1.5.6", @@ -7285,7 +7461,8 @@ }, "spdx-correct": { "version": "3.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -7294,12 +7471,14 @@ }, "spdx-exceptions": { "version": "2.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", "dev": true }, "spdx-expression-parse": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "dev": true, "requires": { "spdx-exceptions": "^2.1.0", @@ -7308,12 +7487,14 @@ }, "spdx-license-ids": { "version": "3.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==", "dev": true }, "string-width": { "version": "2.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", @@ -7322,7 +7503,8 @@ }, "strip-ansi": { "version": "4.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { "ansi-regex": "^3.0.0" @@ -7330,17 +7512,20 @@ }, "strip-bom": { "version": "3.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, "strip-eof": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, "test-exclude": { "version": "5.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-gwf0S2fFsANC55fSeSqpb8BYk6w3FDvwZxfNjeF6FRgvFa43r+7wRiA/Q0IxoRU37wB/LE8IQ4221BsNucTaCA==", "dev": true, "requires": { "arrify": "^1.0.1", @@ -7351,7 +7536,8 @@ }, "uglify-js": { "version": "3.4.9", - "bundled": true, + "resolved": false, + "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", "dev": true, "optional": true, "requires": { @@ -7361,7 +7547,8 @@ "dependencies": { "source-map": { "version": "0.6.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "optional": true } @@ -7369,12 +7556,14 @@ }, "uuid": { "version": "3.3.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", "dev": true }, "validate-npm-package-license": { "version": "3.0.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "requires": { "spdx-correct": "^3.0.0", @@ -7383,7 +7572,8 @@ }, "which": { "version": "1.3.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -7391,17 +7581,20 @@ }, "which-module": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, "wordwrap": { "version": "0.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", "dev": true }, "wrap-ansi": { "version": "2.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { "string-width": "^1.0.1", @@ -7410,12 +7603,14 @@ "dependencies": { "ansi-regex": { "version": "2.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { "number-is-nan": "^1.0.0" @@ -7423,7 +7618,8 @@ }, "string-width": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { "code-point-at": "^1.0.0", @@ -7433,7 +7629,8 @@ }, "strip-ansi": { "version": "3.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -7443,12 +7640,14 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "write-file-atomic": { "version": "2.4.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-s0b6vB3xIVRLWywa6X9TOMA7k9zio0TMOsl9ZnDkliA/cfJlpHXAscj0gbHVJiTdIuAYpIyqS5GW91fqm6gG5g==", "dev": true, "requires": { "graceful-fs": "^4.1.11", @@ -7458,17 +7657,20 @@ }, "y18n": { "version": "4.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, "yallist": { "version": "2.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "dev": true }, "yargs": { "version": "12.0.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", "dev": true, "requires": { "cliui": "^4.0.0", @@ -7487,7 +7689,8 @@ }, "yargs-parser": { "version": "11.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", "dev": true, "requires": { "camelcase": "^5.0.0", From bab2ea140e8e80c2d8007433d31fff2db598f378 Mon Sep 17 00:00:00 2001 From: Pierre-Gilles Leymarie Date: Fri, 26 Mar 2021 10:37:43 +0800 Subject: [PATCH 25/25] Add a betweenCondition in tests --- server/config/brain/taxi/questions.en.json | 12 ++++++++++-- server/lib/brain/brain.train.js | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/server/config/brain/taxi/questions.en.json b/server/config/brain/taxi/questions.en.json index ceaeafd3e5..f25c389827 100644 --- a/server/config/brain/taxi/questions.en.json +++ b/server/config/brain/taxi/questions.en.json @@ -1,9 +1,17 @@ [ { "label": "taxi.order", - "questions": ["Order me a taxi in %datetime% to %city%"], - "answers": ["Ok, got it. I'll order a taxi in {{datetime}} to {{city}}"], + "questions": ["Order me a taxi from %from% to %city% %datetime% "], + "answers": ["Ok, got it. I'll order a taxi in {{datetime}} from {{from}} to {{city}}"], "slots": [ + { + "key": "from", + "mandatory": true, + "ifMissing": "Where should I pick you?", + "betweenCondition": { + "between": ["from", "to"] + } + }, { "key": "city", "mandatory": true, diff --git a/server/lib/brain/brain.train.js b/server/lib/brain/brain.train.js index 72a953f9c7..6216873751 100644 --- a/server/lib/brain/brain.train.js +++ b/server/lib/brain/brain.train.js @@ -26,7 +26,7 @@ async function train() { question.slots.forEach((slot) => { if (slot.betweenCondition) { this.nlpManager.addBetweenCondition( - 'en', + question.language, slot.key, slot.betweenCondition.between[0], slot.betweenCondition.between[1], @@ -35,7 +35,7 @@ async function train() { } if (slot.afterLastCondition) { this.nlpManager.addAfterLastCondition( - 'en', + question.language, slot.key, slot.afterLastCondition.after, slot.afterLastCondition.options,