From cd75885d47e507dfd3a38932a65c232db0931bf7 Mon Sep 17 00:00:00 2001 From: Cyril Beslay Date: Mon, 1 Mar 2021 21:55:08 +0100 Subject: [PATCH] chore: Update Sequelize to v6 --- front/src/actions/house.js | 10 +- front/src/actions/message.js | 6 +- front/src/actions/system.js | 2 +- front/src/config/demo.json | 170 +++++------ front/src/routes/chat/ChatItems.js | 4 +- .../routes/integration/all/ewelink/actions.js | 2 +- .../all/ewelink/discover-page/DiscoverTab.jsx | 6 +- .../all/mqtt/device-page/DeviceForm.jsx | 2 +- .../integration/all/rtsp-camera/actions.js | 2 +- .../routes/integration/all/tasmota/actions.js | 2 +- .../all/tasmota/discover-http/DiscoverTab.jsx | 6 +- .../all/tasmota/discover-mqtt/DiscoverTab.jsx | 6 +- .../settings-backup/GatewayBackupRow.jsx | 2 +- .../settings-gateway-open-api/OpenApiKey.js | 2 +- .../settings-gateway-users/UserRow.js | 2 +- .../settings-session/SessionDevice.jsx | 2 +- .../settings-system/SettingsSystemPage.jsx | 2 +- .../RestoreBackupRow.jsx | 2 +- server/api/controllers/area.controller.js | 12 +- server/api/controllers/calendar.controller.js | 24 +- server/api/controllers/camera.controller.js | 4 +- server/api/controllers/house.controller.js | 12 +- server/api/controllers/location.controller.js | 4 +- server/api/controllers/message.controller.js | 6 +- server/api/controllers/room.controller.js | 16 +- server/api/controllers/service.controller.js | 20 +- server/config/config.js | 3 - server/lib/dashboard/dashboard.get.js | 2 +- server/lib/device/device.purgeStates.js | 2 +- .../gateway/gateway.checkIfBackupNeeded.js | 2 +- server/lib/location/location.create.js | 2 +- server/lib/location/location.get.js | 2 +- server/lib/location/location.getLast.js | 2 +- server/lib/message/message.get.js | 4 +- server/lib/scene/scene.get.js | 2 +- server/lib/session/session.get.js | 6 +- server/lib/system/system.getContainers.js | 2 +- server/lib/user/user.getById.js | 4 +- server/lib/user/user.login.js | 4 +- .../migrations/20190205063641-create-user.js | 2 +- .../20190206102938-create-location.js | 2 +- .../migrations/20190206114851-create-house.js | 2 +- .../20190211033038-create-life-event.js | 2 +- .../migrations/20190211034727-create-room.js | 2 +- .../20190211035101-create-device.js | 2 +- .../20190211035238-create-device-feature.js | 2 +- ...90211041243-create-device-feature-state.js | 2 +- .../20190211042223-create-calendar.js | 2 +- .../20190211042644-create-calendar-event.js | 2 +- .../migrations/20190211043231-create-pod.js | 2 +- .../20190211043515-create-service.js | 2 +- .../20190211043957-create-variable.js | 2 +- .../20190211044205-create-script.js | 2 +- .../migrations/20190211044442-create-area.js | 2 +- .../20190211044839-create-dashboard.js | 2 +- .../migrations/20190211045110-create-scene.js | 2 +- .../20190211045641-create-trigger.js | 2 +- .../20190211050844-trigger_scene.js | 2 +- .../20190211051215-create-message.js | 2 +- .../20190212043623-create-session.js | 2 +- .../20190318084429-create-device-param.js | 2 +- .../20200123094438-add-triggers-attribute.js | 2 +- .../20200201125436-add-caldav-data.js | 2 +- .../20200207214849-add-calendar-event-url.js | 2 +- .../20201128203008-add-color-caldav.js | 2 +- .../migrations/20210129155044-multi-user.js | 2 +- server/package-lock.json | 269 ++++++++++-------- server/package.json | 4 +- server/seeders/20190205070000-house.js | 2 +- server/seeders/20190205071039-demo-user.js | 2 +- .../seeders/20190211053203-demo-location.js | 2 +- server/seeders/20190219041452-message.js | 2 +- server/seeders/20190226025926-service.js | 2 +- server/seeders/20190226025931-variable.js | 2 +- server/seeders/20190227043234-scene.js | 2 +- server/seeders/20190227081653-room.js | 2 +- server/seeders/20190227081656-device.js | 2 +- .../seeders/20190227081700-device-feature.js | 2 +- server/seeders/20190401042124-session.js | 2 +- server/seeders/20190403081927-calendar.js | 2 +- .../seeders/20190403081933-calendar-event.js | 2 +- server/seeders/20190416085240-device-param.js | 2 +- server/seeders/20190506074218-dashboard.js | 2 +- server/seeders/20190507083413-area.js | 2 +- .../dashboard/dashboard.controller.test.js | 10 +- .../gateway/gateway.controller.test.js | 4 +- server/test/controllers/house/house.test.js | 20 +- .../test/controllers/message/message.test.js | 4 +- server/test/controllers/room/room.test.js | 8 +- server/test/controllers/scene/scene.test.js | 2 +- server/test/controllers/user/user.get.test.js | 4 +- .../user/user.getBySelector.test.js | 4 +- .../controllers/user/user.getMySelf.test.js | 4 +- .../test/controllers/user/user.login.test.js | 4 +- .../test/controllers/weather/weather.test.js | 4 +- .../test/lib/calendar/calendar.event.test.js | 24 +- server/test/lib/calendar/calendar.test.js | 4 +- server/test/lib/dashboard/dashboard.test.js | 2 +- server/test/lib/device/device.create.test.js | 40 +-- .../lib/device/device.newStateEvent.test.js | 4 +- .../gateway/GladysGatewayClientMock.test.js | 6 +- server/test/lib/gateway/gateway.test.js | 6 +- server/test/lib/house/house.test.js | 20 +- server/test/lib/location/location.test.js | 4 +- server/test/lib/message/message.get.test.js | 2 +- server/test/lib/room/room.test.js | 16 +- server/test/lib/scene/scene.get.test.js | 4 +- .../lib/system/system.getContainers.test.js | 4 +- server/test/lib/user/user.get.test.js | 4 +- server/test/lib/user/user.getById.test.js | 4 +- .../test/lib/user/user.getBySelector.test.js | 4 +- .../lib/user/user.updateBySelector.test.js | 4 +- .../lib/calendar/syncUserCalendars.test.js | 20 +- server/test/services/tp-link/devices.json | 12 +- 114 files changed, 507 insertions(+), 469 deletions(-) diff --git a/front/src/actions/house.js b/front/src/actions/house.js index a8be2c9c26..1a2e472a6d 100644 --- a/front/src/actions/house.js +++ b/front/src/actions/house.js @@ -164,8 +164,8 @@ function createActions(store) { try { let houseCreatedOrUpdated; - // if house has property created_at, it means it has been created. - if (house.created_at) { + // if house has property createdAt, it means it has been created. + if (house.createdAt) { houseCreatedOrUpdated = await state.httpClient.patch(`/api/v1/house/${house.selector}`, house); } else { houseCreatedOrUpdated = await state.httpClient.post(`/api/v1/house`, house); @@ -198,8 +198,8 @@ function createActions(store) { rooms: { $set: roomsWithoutDeleted }, - created_at: { - $set: houseCreatedOrUpdated.created_at + createdAt: { + $set: houseCreatedOrUpdated.createdAt } } }, @@ -254,7 +254,7 @@ function createActions(store) { }); const house = state.houses[houseIndex]; try { - if (house.created_at && house.selector) { + if (house.createdAt && house.selector) { await state.httpClient.delete(`/api/v1/house/${house.selector}`); } const newState = update(state, { diff --git a/front/src/actions/message.js b/front/src/actions/message.js index bb56e4feaa..6deedd7c64 100644 --- a/front/src/actions/message.js +++ b/front/src/actions/message.js @@ -5,7 +5,7 @@ import uuid from 'uuid'; const TYPING_MIN_TIME = 400; const TYPING_MAX_TIME = 600; -const sortMessages = messages => messages.sort((a, b) => a.created_at - b.created_at); +const sortMessages = messages => messages.sort((a, b) => a.createdAt - b.createdAt); function createActions(store) { const actions = { @@ -24,7 +24,7 @@ function createActions(store) { try { let messages = await state.httpClient.get('/api/v1/message'); // Force date usage - messages.forEach(message => (message.created_at = new Date(message.created_at))); + messages.forEach(message => (message.createdAt = new Date(message.createdAt))); messages = sortMessages(messages); store.setState({ messages, @@ -76,7 +76,7 @@ function createActions(store) { try { const newMessage = { text: messageText, - created_at: new Date() + createdAt: new Date() }; const tempId = uuid.v4(); // we first push the message diff --git a/front/src/actions/system.js b/front/src/actions/system.js index 5ad89a1ccd..466aa7739e 100644 --- a/front/src/actions/system.js +++ b/front/src/actions/system.js @@ -69,7 +69,7 @@ function createActions(store) { try { const systemContainers = await state.httpClient.get('/api/v1/system/container'); systemContainers.forEach(container => { - container.created_at_formatted = dayjs(container.created_at * 1000) + container.createdAt_formatted = dayjs(container.createdAt * 1000) .locale(state.user.language) .fromNow(); }); diff --git a/front/src/config/demo.json b/front/src/config/demo.json index 3cadf9dddc..55b85e870c 100644 --- a/front/src/config/demo.json +++ b/front/src/config/demo.json @@ -7,8 +7,8 @@ "language": "en", "birthdate": "2011-02-04", "role": "admin", - "created_at": "2019-02-20T04:26:47.811Z", - "updated_at": "2019-02-20T04:26:47.811Z", + "createdAt": "2019-02-20T04:26:47.811Z", + "updatedAt": "2019-02-20T04:26:47.811Z", "refresh_token": "15535ed55088d46b9a01738bfb2b96f982fb16edb2a5241d078775a7db8aa38a8ae59e73f81aa5367b62b1daef8aea5e3b7de4ff66dc8fb00f6ed02b6c3eb14ac68b1716e9cdb9425f88bf2eeb5b8cc3b4eb66913bbd8e5084381dc22fe1ff092c0efd80f2ec766511f03121bdffcc02202a20d5916e6e58c6aed4a84fb9980a99b828c8ded74d17e3c91108f7e50dccb80281720b6b37fe26345371cd2b4a1134abfbc63689814375aee968af15dc24379c7c95200c0c1740817806abfca934ccb4fb183e4c95e19f55a2e4c8a3bb453cf0700a6f7baa7088b24297d212f2ccfc3586093c28e731e9909addbead2b9c095f1a7f8993f4ddd405", "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiOTJiZjk0NDEtYzljMC00YTVmLWI3YmItNGY3NmYwZWM0Yzk1Iiwic2NvcGUiOlsiZGFzaGJvYXJkOndyaXRlIiwiZGFzaGJvYXJkOnJlYWQiXSwic2Vzc2lvbl9pZCI6IjZhOTYyNzk2LTZlMGQtNDRiNC04Y2Y2LWRkMmJhYjhjY2M0ZiIsImlhdCI6MTU1MTA2NzM5MywiZXhwIjoxNTUxMTUzNzkzLCJhdWQiOiJ1c2VyIiwiaXNzIjoiZ2xhZHlzIn0.JfiRsTn4cyARIMElD5DgyFt7xKHPcTNnaMLKznbfVc4" }, @@ -21,8 +21,8 @@ "language": "en", "birthdate": "2011-02-04", "role": "admin", - "created_at": "2019-02-20T04:26:47.811Z", - "updated_at": "2019-02-20T04:26:47.811Z", + "createdAt": "2019-02-20T04:26:47.811Z", + "updatedAt": "2019-02-20T04:26:47.811Z", "refresh_token": "15535ed55088d46b9a01738bfb2b96f982fb16edb2a5241d078775a7db8aa38a8ae59e73f81aa5367b62b1daef8aea5e3b7de4ff66dc8fb00f6ed02b6c3eb14ac68b1716e9cdb9425f88bf2eeb5b8cc3b4eb66913bbd8e5084381dc22fe1ff092c0efd80f2ec766511f03121bdffcc02202a20d5916e6e58c6aed4a84fb9980a99b828c8ded74d17e3c91108f7e50dccb80281720b6b37fe26345371cd2b4a1134abfbc63689814375aee968af15dc24379c7c95200c0c1740817806abfca934ccb4fb183e4c95e19f55a2e4c8a3bb453cf0700a6f7baa7088b24297d212f2ccfc3586093c28e731e9909addbead2b9c095f1a7f8993f4ddd405", "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiOTJiZjk0NDEtYzljMC00YTVmLWI3YmItNGY3NmYwZWM0Yzk1Iiwic2NvcGUiOlsiZGFzaGJvYXJkOndyaXRlIiwiZGFzaGJvYXJkOnJlYWQiXSwic2Vzc2lvbl9pZCI6IjZhOTYyNzk2LTZlMGQtNDRiNC04Y2Y2LWRkMmJhYjhjY2M0ZiIsImlhdCI6MTU1MTA2NzM5MywiZXhwIjoxNTUxMTUzNzkzLCJhdWQiOiJ1c2VyIiwiaXNzIjoiZ2xhZHlzIn0.JfiRsTn4cyARIMElD5DgyFt7xKHPcTNnaMLKznbfVc4" }, @@ -46,8 +46,8 @@ "language": "en", "birthdate": "2011-02-04", "role": "admin", - "created_at": "2019-02-20T04:26:47.811Z", - "updated_at": "2019-02-20T04:26:47.811Z", + "createdAt": "2019-02-20T04:26:47.811Z", + "updatedAt": "2019-02-20T04:26:47.811Z", "refresh_token": "15535ed55088d46b9a01738bfb2b96f982fb16edb2a5241d078775a7db8aa38a8ae59e73f81aa5367b62b1daef8aea5e3b7de4ff66dc8fb00f6ed02b6c3eb14ac68b1716e9cdb9425f88bf2eeb5b8cc3b4eb66913bbd8e5084381dc22fe1ff092c0efd80f2ec766511f03121bdffcc02202a20d5916e6e58c6aed4a84fb9980a99b828c8ded74d17e3c91108f7e50dccb80281720b6b37fe26345371cd2b4a1134abfbc63689814375aee968af15dc24379c7c95200c0c1740817806abfca934ccb4fb183e4c95e19f55a2e4c8a3bb453cf0700a6f7baa7088b24297d212f2ccfc3586093c28e731e9909addbead2b9c095f1a7f8993f4ddd405", "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiOTJiZjk0NDEtYzljMC00YTVmLWI3YmItNGY3NmYwZWM0Yzk1Iiwic2NvcGUiOlsiZGFzaGJvYXJkOndyaXRlIiwiZGFzaGJvYXJkOnJlYWQiXSwic2Vzc2lvbl9pZCI6IjZhOTYyNzk2LTZlMGQtNDRiNC04Y2Y2LWRkMmJhYjhjY2M0ZiIsImlhdCI6MTU1MTA2NzM5MywiZXhwIjoxNTUxMTUzNzkzLCJhdWQiOiJ1c2VyIiwiaXNzIjoiZ2xhZHlzIn0.JfiRsTn4cyARIMElD5DgyFt7xKHPcTNnaMLKznbfVc4" }, @@ -59,8 +59,8 @@ "language": "en", "birthdate": "2011-02-04", "role": "admin", - "created_at": "2019-02-20T04:26:47.811Z", - "updated_at": "2019-02-20T04:26:47.811Z", + "createdAt": "2019-02-20T04:26:47.811Z", + "updatedAt": "2019-02-20T04:26:47.811Z", "refresh_token": "15535ed55088d46b9a01738bfb2b96f982fb16edb2a5241d078775a7db8aa38a8ae59e73f81aa5367b62b1daef8aea5e3b7de4ff66dc8fb00f6ed02b6c3eb14ac68b1716e9cdb9425f88bf2eeb5b8cc3b4eb66913bbd8e5084381dc22fe1ff092c0efd80f2ec766511f03121bdffcc02202a20d5916e6e58c6aed4a84fb9980a99b828c8ded74d17e3c91108f7e50dccb80281720b6b37fe26345371cd2b4a1134abfbc63689814375aee968af15dc24379c7c95200c0c1740817806abfca934ccb4fb183e4c95e19f55a2e4c8a3bb453cf0700a6f7baa7088b24297d212f2ccfc3586093c28e731e9909addbead2b9c095f1a7f8993f4ddd405", "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiOTJiZjk0NDEtYzljMC00YTVmLWI3YmItNGY3NmYwZWM0Yzk1Iiwic2NvcGUiOlsiZGFzaGJvYXJkOndyaXRlIiwiZGFzaGJvYXJkOnJlYWQiXSwic2Vzc2lvbl9pZCI6IjZhOTYyNzk2LTZlMGQtNDRiNC04Y2Y2LWRkMmJhYjhjY2M0ZiIsImlhdCI6MTU1MTA2NzM5MywiZXhwIjoxNTUxMTUzNzkzLCJhdWQiOiJ1c2VyIiwiaXNzIjoiZ2xhZHlzIn0.JfiRsTn4cyARIMElD5DgyFt7xKHPcTNnaMLKznbfVc4" }, @@ -137,8 +137,8 @@ } ] ], - "created_at": "2019-05-15T08:48:20.275Z", - "updated_at": "2019-05-16T06:29:44.767Z" + "createdAt": "2019-05-15T08:48:20.275Z", + "updatedAt": "2019-05-16T06:29:44.767Z" }, "patch /api/v1/dashboard/home": { "id": "329897d2-0620-458c-addf-4009ff5bc205", @@ -177,8 +177,8 @@ } ] ], - "created_at": "2019-05-15T08:48:20.275Z", - "updated_at": "2019-05-16T06:29:44.767Z" + "createdAt": "2019-05-15T08:48:20.275Z", + "updatedAt": "2019-05-16T06:29:44.767Z" }, "get /api/v1/house/main-house/weather": { "temperature": 27.9, @@ -192,8 +192,8 @@ "id": "6a29f33b-e5c9-4b08-9d3f-ced2cab80a87", "name": "Main house", "selector": "main-house", - "created_at": "2019-02-20T04:26:47.811Z", - "updated_at": "2019-02-20T04:26:47.811Z" + "createdAt": "2019-02-20T04:26:47.811Z", + "updatedAt": "2019-02-20T04:26:47.811Z" }, "options": { "latitude": 12, @@ -418,22 +418,22 @@ "id": "18da1930-abe9-4c99-ab9c-7ddd61aef692", "name": "DEVICE_STATE_HISTORY_IN_DAYS", "value": 90, - "created_at": "2019-02-20T04:26:47.811Z", - "updated_at": "2019-02-20T04:26:47.811Z" + "createdAt": "2019-02-20T04:26:47.811Z", + "updatedAt": "2019-02-20T04:26:47.811Z" }, "post /api/v1/house": { "id": "6a29f33b-e5c9-4b08-9d3f-ced2cab80a87", "name": "My House", "selector": "my-house", - "created_at": "2019-02-20T04:26:47.811Z", - "updated_at": "2019-02-20T04:26:47.811Z" + "createdAt": "2019-02-20T04:26:47.811Z", + "updatedAt": "2019-02-20T04:26:47.811Z" }, "post /api/v1/house/my-house/room": { "id": "1bdc3614-6082-43c3-9e4a-3b00781013a4", "name": "My room", "house_id": "6a29f33b-e5c9-4b08-9d3f-ced2cab80a87", - "created_at": "2019-02-20T04:26:47.811Z", - "updated_at": "2019-02-20T04:26:47.811Z" + "createdAt": "2019-02-20T04:26:47.811Z", + "updatedAt": "2019-02-20T04:26:47.811Z" }, "get /api/v1/room?expand=devices": [ { @@ -562,7 +562,7 @@ "receiver_id": "0cd30aef-9c4e-4a23-88e3-3547971296e5", "text": "It's a clear day today. Temperature outside is 26°C.", "is_read": true, - "created_at": "2019-02-12T07:45:07.556Z" + "createdAt": "2019-02-12T07:45:07.556Z" }, { "id": "247b1dd0-6fab-47a8-a9c8-1405deae0ae8", @@ -570,7 +570,7 @@ "receiver_id": null, "text": "What's the weather like?", "is_read": true, - "created_at": "2019-02-12T07:44:07.556Z" + "createdAt": "2019-02-12T07:44:07.556Z" }, { "id": "247b1dd0-6fab-47a8-a9c8-1405deae0ae8", @@ -578,7 +578,7 @@ "receiver_id": "0cd30aef-9c4e-4a23-88e3-3547971296e5", "text": "It's 24°C in the kitchen.", "is_read": true, - "created_at": "2019-02-12T07:49:07.557Z" + "createdAt": "2019-02-12T07:49:07.557Z" }, { "id": "247b1dd0-6fab-47a8-a9c8-1405deae0ae8", @@ -586,7 +586,7 @@ "receiver_id": null, "text": "What's the temperature in the kitchen?", "is_read": true, - "created_at": "2019-02-12T07:49:07.556Z" + "createdAt": "2019-02-12T07:49:07.556Z" } ], "post /api/v1/message": { @@ -595,7 +595,7 @@ "receiver_id": null, "text": "What time is it ?", "is_read": true, - "created_at": "2019-02-12T07:49:07.556Z" + "createdAt": "2019-02-12T07:49:07.556Z" }, "get /api/v1/scene": [ { @@ -788,8 +788,8 @@ "external_id": "test-sensor-external", "should_poll": false, "poll_frequency": null, - "created_at": "2019-02-12T07:49:07.556Z", - "updated_at": "2019-02-12T07:49:07.556Z", + "createdAt": "2019-02-12T07:49:07.556Z", + "updatedAt": "2019-02-12T07:49:07.556Z", "features": [ { "name": "Temperature", @@ -901,7 +901,7 @@ { "name": "Sonoff Basic Kitchen", "external_id": "tasmota:sonoff-basic", - "created_at": "2019-02-12T07:49:07.556Z", + "createdAt": "2019-02-12T07:49:07.556Z", "model": "sonoff-basic", "features": [ { @@ -925,7 +925,7 @@ "name": "Sonoff Mini Outside", "external_id": "tasmota:sonoff-mini", "model": "sonoff-basic", - "created_at": "2019-02-12T07:49:07.556Z", + "createdAt": "2019-02-12T07:49:07.556Z", "updatable": true, "features": [ { @@ -939,7 +939,7 @@ { "name": "Sonoff Basic Kitchen", "external_id": "tasmota:192.168.1.1", - "created_at": "2019-02-12T07:49:07.556Z", + "createdAt": "2019-02-12T07:49:07.556Z", "model": "sonoff-basic", "features": [ { @@ -975,7 +975,7 @@ "name": "Sonoff Mini Outside", "external_id": "tasmota:192.168.1.3", "model": "sonoff-basic", - "created_at": "2019-02-12T07:49:07.556Z", + "createdAt": "2019-02-12T07:49:07.556Z", "updatable": true, "features": [ { @@ -993,7 +993,7 @@ { "name": "192.168.1.3", "external_id": "tasmota:192.168.1.3", - "created_at": "2019-02-12T07:49:07.556Z", + "createdAt": "2019-02-12T07:49:07.556Z", "needAuthentication": true, "features": [ { @@ -1034,16 +1034,16 @@ "id": "99fac564-0844-44f6-866b-2b8dcf0d76eb", "path": "https://url-backup", "size": 1127680, - "created_at": "2019-06-25T07:01:24.846Z", - "updated_at": "2019-06-25T07:01:24.846Z", + "createdAt": "2019-06-25T07:01:24.846Z", + "updatedAt": "2019-06-25T07:01:24.846Z", "is_deleted": false }, { "id": "210460b2-c9a8-4891-9cca-464c3e19bfbb", "path": "https://url-backup", "size": 1013680, - "created_at": "2019-06-24T03:45:10.144Z", - "updated_at": "2019-06-24T03:45:10.144Z", + "createdAt": "2019-06-24T03:45:10.144Z", + "updatedAt": "2019-06-24T03:45:10.144Z", "is_deleted": false } ], @@ -1123,7 +1123,7 @@ "name": "/gladys", "state": "running", "id": "9e5f09775f897624deb1eb2ec8688c1b300d81bc3727fc71ae3290d3d8f71fa9", - "created_at": 1561506899 + "createdAt": 1561506899 } ], "get /api/v1/service": [ @@ -1135,8 +1135,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "LOADING", - "created_at": "2020-04-11T18:41:40.051Z", - "updated_at": "2020-10-18T10:13:22.365Z" + "createdAt": "2020-04-11T18:41:40.051Z", + "updatedAt": "2020-10-18T10:13:22.365Z" }, { "id": "40262062-2e71-412c-8da0-70bd03f03b90", @@ -1146,8 +1146,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "RUNNING", - "created_at": "2020-04-11T18:41:40.052Z", - "updated_at": "2020-10-30T07:44:07.731Z" + "createdAt": "2020-04-11T18:41:40.052Z", + "updatedAt": "2020-10-30T07:44:07.731Z" }, { "id": "4cd73c14-a929-4af0-a5e2-baed35802224", @@ -1157,8 +1157,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "RUNNING", - "created_at": "2020-04-11T18:41:40.053Z", - "updated_at": "2020-10-30T07:44:07.694Z" + "createdAt": "2020-04-11T18:41:40.053Z", + "updatedAt": "2020-10-30T07:44:07.694Z" }, { "id": "0c27de72-ced7-4f7f-8950-473b9e904e71", @@ -1168,8 +1168,8 @@ "version": "0.1.0", "has_message_feature": true, "status": "RUNNING", - "created_at": "2020-04-11T18:41:40.053Z", - "updated_at": "2020-10-30T07:44:07.518Z" + "createdAt": "2020-04-11T18:41:40.053Z", + "updatedAt": "2020-10-30T07:44:07.518Z" }, { "id": "09a3e250-940a-4f52-8595-e6268ffd7198", @@ -1179,8 +1179,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "RUNNING", - "created_at": "2020-04-11T18:41:40.053Z", - "updated_at": "2020-10-30T07:44:07.660Z" + "createdAt": "2020-04-11T18:41:40.053Z", + "updatedAt": "2020-10-30T07:44:07.660Z" }, { "id": "8070fb7c-908f-426a-bbbf-12dce1f27549", @@ -1190,8 +1190,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "UNKNOWN", - "created_at": "2020-04-11T18:41:40.054Z", - "updated_at": "2020-04-11T18:41:40.054Z" + "createdAt": "2020-04-11T18:41:40.054Z", + "updatedAt": "2020-04-11T18:41:40.054Z" }, { "id": "366fd9d7-bfbf-4c13-bd8c-4cc777799142", @@ -1201,8 +1201,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "RUNNING", - "created_at": "2020-04-11T18:41:40.055Z", - "updated_at": "2020-10-30T07:44:07.474Z" + "createdAt": "2020-04-11T18:41:40.055Z", + "updatedAt": "2020-10-30T07:44:07.474Z" }, { "id": "3772bbf5-b1d7-441f-9bd4-ef94920e31cd", @@ -1212,8 +1212,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "RUNNING", - "created_at": "2020-04-11T18:41:40.056Z", - "updated_at": "2020-10-30T07:44:07.594Z" + "createdAt": "2020-04-11T18:41:40.056Z", + "updatedAt": "2020-10-30T07:44:07.594Z" }, { "id": "7355bc7f-4109-40ba-819f-fb03f91969b0", @@ -1223,8 +1223,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "RUNNING", - "created_at": "2020-04-11T18:41:40.056Z", - "updated_at": "2020-10-30T07:44:07.627Z" + "createdAt": "2020-04-11T18:41:40.056Z", + "updatedAt": "2020-10-30T07:44:07.627Z" }, { "id": "2e0bc58b-11e2-4176-8ad3-9ebc8cdd2318", @@ -1234,8 +1234,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "ERROR", - "created_at": "2020-04-11T18:41:40.057Z", - "updated_at": "2020-10-30T07:44:07.785Z" + "createdAt": "2020-04-11T18:41:40.057Z", + "updatedAt": "2020-10-30T07:44:07.785Z" }, { "id": "d97ba3fa-872f-4ecc-879f-46c55a2930c6", @@ -1245,8 +1245,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "UNKNOWN", - "created_at": "2020-04-11T18:41:40.111Z", - "updated_at": "2020-04-11T18:41:40.111Z" + "createdAt": "2020-04-11T18:41:40.111Z", + "updatedAt": "2020-04-11T18:41:40.111Z" }, { "id": "6d3c7a63-e4b8-4650-bcd3-50cf42b2996f", @@ -1256,8 +1256,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "RUNNING", - "created_at": "2020-04-16T19:38:21.885Z", - "updated_at": "2020-10-30T07:44:07.558Z" + "createdAt": "2020-04-16T19:38:21.885Z", + "updatedAt": "2020-10-30T07:44:07.558Z" }, { "id": "39a278e9-66da-47cb-bdaa-264ba6418091", @@ -1267,8 +1267,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "RUNNING", - "created_at": "2020-08-19T13:04:57.309Z", - "updated_at": "2020-10-30T07:44:07.814Z" + "createdAt": "2020-08-19T13:04:57.309Z", + "updatedAt": "2020-10-30T07:44:07.814Z" }, { "id": "9682e167-e07f-4823-bd31-a60f957842e0", @@ -1278,8 +1278,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "UNKNOWN", - "created_at": "2020-08-30T15:55:19.467Z", - "updated_at": "2020-08-30T15:55:19.467Z" + "createdAt": "2020-08-30T15:55:19.467Z", + "updatedAt": "2020-08-30T15:55:19.467Z" }, { "id": "d6ea610f-1e33-4c08-89a3-1c8be2cc45f9", @@ -1289,8 +1289,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "LOADING", - "created_at": "2020-09-02T12:35:32.763Z", - "updated_at": "2020-10-18T09:28:14.935Z" + "createdAt": "2020-09-02T12:35:32.763Z", + "updatedAt": "2020-10-18T09:28:14.935Z" }, { "id": "c9fe2705-35dc-417b-b6fc-c4bbb9c69886", @@ -1300,8 +1300,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "RUNNING", - "created_at": "2020-11-11T18:41:40.052Z", - "updated_at": "2020-11-28T07:44:07.731Z" + "createdAt": "2020-11-11T18:41:40.052Z", + "updatedAt": "2020-11-28T07:44:07.731Z" } ], "get /api/v1/session": [ @@ -1313,8 +1313,8 @@ "last_seen": null, "revoked": false, "useragent": "Mozilla/5.0 (Linux; Android 6.0.1; SHIELD Tablet K1 Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/55.0.2883.91 Safari/537.36", - "created_at": "2019-06-26T01:00:50.138Z", - "updated_at": "2019-06-26T01:00:50.138Z" + "createdAt": "2019-06-26T01:00:50.138Z", + "updatedAt": "2019-06-26T01:00:50.138Z" }, { "id": "2367a8cf-47a8-4db7-83b0-f89c2c6c34ac", @@ -1324,8 +1324,8 @@ "last_seen": null, "revoked": false, "useragent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1", - "created_at": "2019-06-26T00:29:00.783Z", - "updated_at": "2019-06-26T00:29:00.783Z" + "createdAt": "2019-06-26T00:29:00.783Z", + "updatedAt": "2019-06-26T00:29:00.783Z" }, { "id": "2367a8cf-47a8-4db7-83b0-f89c2c6c34ac", @@ -1335,8 +1335,8 @@ "last_seen": null, "revoked": false, "useragent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246", - "created_at": "2019-06-26T00:29:00.783Z", - "updated_at": "2019-06-26T00:29:00.783Z" + "createdAt": "2019-06-26T00:29:00.783Z", + "updatedAt": "2019-06-26T00:29:00.783Z" }, { "id": "2367a8cf-47a8-4db7-83b0-f89c2c6c34ac", @@ -1345,8 +1345,8 @@ "valid_until": "2019-07-26T00:29:00.783Z", "last_seen": null, "revoked": false, - "created_at": "2019-06-26T00:29:00.783Z", - "updated_at": "2019-06-26T00:29:00.783Z" + "createdAt": "2019-06-26T00:29:00.783Z", + "updatedAt": "2019-06-26T00:29:00.783Z" } ], "get /api/v1/setup": { @@ -1480,8 +1480,8 @@ "external_id": "test-sensor-external", "should_poll": false, "poll_frequency": null, - "created_at": "2019-02-12T07:49:07.556Z", - "updated_at": "2019-02-12T07:49:07.556Z", + "createdAt": "2019-02-12T07:49:07.556Z", + "updatedAt": "2019-02-12T07:49:07.556Z", "features": [ { "name": "Temperature", @@ -1684,8 +1684,8 @@ "external_id": "test-sensor-external", "should_poll": false, "poll_frequency": null, - "created_at": "2019-02-12T07:49:07.556Z", - "updated_at": "2019-02-12T07:49:07.556Z", + "createdAt": "2019-02-12T07:49:07.556Z", + "updatedAt": "2019-02-12T07:49:07.556Z", "features": [ { "name": "Battery", @@ -1711,8 +1711,8 @@ "external_id": "bluetooth:external", "should_poll": false, "poll_frequency": null, - "created_at": "2019-02-12T07:49:07.556Z", - "updated_at": "2019-02-12T07:49:07.556Z", + "createdAt": "2019-02-12T07:49:07.556Z", + "updatedAt": "2019-02-12T07:49:07.556Z", "features": [ { "name": "Battery", @@ -1966,8 +1966,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "RUNNING", - "created_at": "2020-11-11T18:41:40.052Z", - "updated_at": "2020-11-28T07:44:07.731Z" + "createdAt": "2020-11-11T18:41:40.052Z", + "updatedAt": "2020-11-28T07:44:07.731Z" }, "get /api/v1/service/tp-link/device": [ { diff --git a/front/src/routes/chat/ChatItems.js b/front/src/routes/chat/ChatItems.js index f9d428a2ba..0d0d749634 100644 --- a/front/src/routes/chat/ChatItems.js +++ b/front/src/routes/chat/ChatItems.js @@ -26,7 +26,7 @@ const IncomingMessage = ({ children, ...props }) => (

{' '} - {dayjs(props.message.created_at) + {dayjs(props.message.createdAt) .locale(props.user.language) .fromNow()} @@ -44,7 +44,7 @@ const OutGoingMessage = ({ children, ...props }) => ( {props.message.tempId ? ( ) : ( - dayjs(props.message.created_at) + dayjs(props.message.createdAt) .locale(props.user.language) .fromNow() )} diff --git a/front/src/routes/integration/all/ewelink/actions.js b/front/src/routes/integration/all/ewelink/actions.js index 920b161a7e..fa290cddd9 100644 --- a/front/src/routes/integration/all/ewelink/actions.js +++ b/front/src/routes/integration/all/ewelink/actions.js @@ -184,7 +184,7 @@ function createActions(store) { }, async deleteDevice(state, index) { const device = state.eweLinkDevices[index]; - if (device.created_at) { + if (device.createdAt) { await state.httpClient.delete(`/api/v1/device/${device.selector}`); } const eweLinkDevices = update(state.eweLinkDevices, { diff --git a/front/src/routes/integration/all/ewelink/discover-page/DiscoverTab.jsx b/front/src/routes/integration/all/ewelink/discover-page/DiscoverTab.jsx index 28d1fd65b7..64ff05b7b1 100644 --- a/front/src/routes/integration/all/ewelink/discover-page/DiscoverTab.jsx +++ b/front/src/routes/integration/all/ewelink/discover-page/DiscoverTab.jsx @@ -46,10 +46,10 @@ const DeviceTab = ({ children, ...props }) => ( props.discoveredDevices.map((device, index) => ( } /> diff --git a/front/src/routes/integration/all/rtsp-camera/actions.js b/front/src/routes/integration/all/rtsp-camera/actions.js index 4761491444..d25eb22144 100644 --- a/front/src/routes/integration/all/rtsp-camera/actions.js +++ b/front/src/routes/integration/all/rtsp-camera/actions.js @@ -165,7 +165,7 @@ function createActions(store) { }, async deleteCamera(state, index) { const camera = state.rtspCameras[index]; - if (camera.created_at) { + if (camera.createdAt) { await state.httpClient.delete(`/api/v1/device/${camera.selector}`); } const rtspCameras = update(state.rtspCameras, { diff --git a/front/src/routes/integration/all/tasmota/actions.js b/front/src/routes/integration/all/tasmota/actions.js index 4bf72b96db..99af1e6ecd 100644 --- a/front/src/routes/integration/all/tasmota/actions.js +++ b/front/src/routes/integration/all/tasmota/actions.js @@ -109,7 +109,7 @@ function createActions(store) { }, async deleteDevice(state, index) { const device = state.tasmotaDevices[index]; - if (device.created_at) { + if (device.createdAt) { await state.httpClient.delete(`/api/v1/device/${device.selector}`); } const tasmotaDevices = update(state.tasmotaDevices, { diff --git a/front/src/routes/integration/all/tasmota/discover-http/DiscoverTab.jsx b/front/src/routes/integration/all/tasmota/discover-http/DiscoverTab.jsx index 8336808238..e71afc3c5d 100644 --- a/front/src/routes/integration/all/tasmota/discover-http/DiscoverTab.jsx +++ b/front/src/routes/integration/all/tasmota/discover-http/DiscoverTab.jsx @@ -33,10 +33,10 @@ const DeviceTab = props => ( props.discoveredDevices.map((device, index) => ( ( - {dayjs(props.backup.created_at) + {dayjs(props.backup.createdAt) .locale(props.user.language) .fromNow()} diff --git a/front/src/routes/settings/settings-gateway-open-api/OpenApiKey.js b/front/src/routes/settings/settings-gateway-open-api/OpenApiKey.js index e7cf4673d4..08b9cf23bf 100644 --- a/front/src/routes/settings/settings-gateway-open-api/OpenApiKey.js +++ b/front/src/routes/settings/settings-gateway-open-api/OpenApiKey.js @@ -10,7 +10,7 @@ const OpenApiKey = ({ children, ...props }) => { let language = props.user && props.user.language ? props.user.language : 'en'; - let createdAt = new Date(props.apiKey.created_at).toLocaleDateString(language, dateDisplayOptions); + let createdAt = new Date(props.apiKey.createdAt).toLocaleDateString(language, dateDisplayOptions); let lastUsed = props.apiKey.last_used === null ? ( diff --git a/front/src/routes/settings/settings-gateway-users/UserRow.js b/front/src/routes/settings/settings-gateway-users/UserRow.js index dfdbafdef8..a9cf459d29 100644 --- a/front/src/routes/settings/settings-gateway-users/UserRow.js +++ b/front/src/routes/settings/settings-gateway-users/UserRow.js @@ -22,7 +22,7 @@ const UserRow = ({ children, ...props }) => { {props.user.is_invitation !== false && } - {new Date(props.user.created_at).toLocaleDateString(props.user.language, dateDisplayOptions)} + {new Date(props.user.createdAt).toLocaleDateString(props.user.language, dateDisplayOptions)} diff --git a/front/src/routes/settings/settings-session/SessionDevice.jsx b/front/src/routes/settings/settings-session/SessionDevice.jsx index bc3162ea87..deeeb17f87 100644 --- a/front/src/routes/settings/settings-session/SessionDevice.jsx +++ b/front/src/routes/settings/settings-session/SessionDevice.jsx @@ -20,7 +20,7 @@ const SessionDevice = ({ children, ...props }) => {
{' '} - {dayjs(props.session.created_at) + {dayjs(props.session.createdAt) .locale(props.user.language) .fromNow()}
diff --git a/front/src/routes/settings/settings-system/SettingsSystemPage.jsx b/front/src/routes/settings/settings-system/SettingsSystemPage.jsx index 57983e95d2..4bae1dbb8d 100644 --- a/front/src/routes/settings/settings-system/SettingsSystemPage.jsx +++ b/front/src/routes/settings/settings-system/SettingsSystemPage.jsx @@ -164,7 +164,7 @@ const SystemPage = ({ children, ...props }) => ( props.systemContainers.map(container => ( {container.name} - {container.created_at_formatted} + {container.createdAt_formatted} - {dayjs(props.backup.created_at) + {dayjs(props.backup.createdAt) .locale(props.user.language) .fromNow()} diff --git a/server/api/controllers/area.controller.js b/server/api/controllers/area.controller.js index 18af9d0b6b..bec06d369c 100644 --- a/server/api/controllers/area.controller.js +++ b/server/api/controllers/area.controller.js @@ -25,8 +25,8 @@ module.exports = function AreaController(gladys) { * "longitude": 12, * "radius": 100, * "color": "#5042f4", - * "updated_at": "2019-05-09T03:11:03.819Z", - * "created_at": "2019-05-09T03:11:03.819Z" + * "updatedAt": "2019-05-09T03:11:03.819Z", + * "createdAt": "2019-05-09T03:11:03.819Z" * } */ async function create(req, res) { @@ -48,8 +48,8 @@ module.exports = function AreaController(gladys) { * "longitude": 12, * "radius": 100, * "color": "#5042f4", - * "updated_at": "2019-05-09T03:11:03.819Z", - * "created_at": "2019-05-09T03:11:03.819Z" + * "updatedAt": "2019-05-09T03:11:03.819Z", + * "createdAt": "2019-05-09T03:11:03.819Z" * } */ async function update(req, res) { @@ -82,8 +82,8 @@ module.exports = function AreaController(gladys) { * "longitude": 12, * "radius": 100, * "color": "#5042f4", - * "updated_at": "2019-05-09T03:11:03.819Z", - * "created_at": "2019-05-09T03:11:03.819Z" + * "updatedAt": "2019-05-09T03:11:03.819Z", + * "createdAt": "2019-05-09T03:11:03.819Z" * }] */ async function get(req, res) { diff --git a/server/api/controllers/calendar.controller.js b/server/api/controllers/calendar.controller.js index 2ed2a9740b..b8025510dc 100644 --- a/server/api/controllers/calendar.controller.js +++ b/server/api/controllers/calendar.controller.js @@ -37,8 +37,8 @@ module.exports = function CalendarController(gladys) { * "sync": true, * "notify": false, * "user_id": "e4e3f03e-60b9-485e-bc0a-c582b69089bd", - * "updated_at": "2019-05-09T03:14:29.820Z", - * "created_at": "2019-05-09T03:14:29.820Z" + * "updatedAt": "2019-05-09T03:14:29.820Z", + * "createdAt": "2019-05-09T03:14:29.820Z" * } */ async function create(req, res) { @@ -62,8 +62,8 @@ module.exports = function CalendarController(gladys) { * "sync": true, * "notify": false, * "user_id": "e4e3f03e-60b9-485e-bc0a-c582b69089bd", - * "updated_at": "2019-05-09T03:14:29.820Z", - * "created_at": "2019-05-09T03:14:29.820Z" + * "updatedAt": "2019-05-09T03:14:29.820Z", + * "createdAt": "2019-05-09T03:14:29.820Z" * } */ async function update(req, res) { @@ -97,8 +97,8 @@ module.exports = function CalendarController(gladys) { * "end": "2019-02-12T09:00:00.000Z", * "selector": "code-on-gladys", * "calendar_id": "8afba93a-e94f-4255-9d8b-db9e605e10b6", - * "updated_at": "2019-05-09T03:22:47.150Z", - * "created_at": "2019-05-09T03:22:47.150Z" + * "updatedAt": "2019-05-09T03:22:47.150Z", + * "createdAt": "2019-05-09T03:22:47.150Z" * } */ async function createEvent(req, res) { @@ -120,8 +120,8 @@ module.exports = function CalendarController(gladys) { * "end": "2019-02-12T09:00:00.000Z", * "selector": "code-on-gladys", * "calendar_id": "8afba93a-e94f-4255-9d8b-db9e605e10b6", - * "updated_at": "2019-05-09T03:22:47.150Z", - * "created_at": "2019-05-09T03:22:47.150Z" + * "updatedAt": "2019-05-09T03:22:47.150Z", + * "createdAt": "2019-05-09T03:22:47.150Z" * } */ async function updateEvent(req, res) { @@ -154,8 +154,8 @@ module.exports = function CalendarController(gladys) { * "sync": true, * "notify": false, * "user_id": "e4e3f03e-60b9-485e-bc0a-c582b69089bd", - * "updated_at": "2019-05-09T03:14:29.820Z", - * "created_at": "2019-05-09T03:14:29.820Z" + * "updatedAt": "2019-05-09T03:14:29.820Z", + * "createdAt": "2019-05-09T03:14:29.820Z" * }] */ async function get(req, res) { @@ -179,8 +179,8 @@ module.exports = function CalendarController(gladys) { * "start": "2019-05-09T00:00:00.000Z", * "end": "2019-05-09T23:00:00.000Z", * "full_day": false, - * "created_at": "2019-05-09T03:22:47.150Z", - * "updated_at": "2019-05-09T03:22:47.150Z", + * "createdAt": "2019-05-09T03:22:47.150Z", + * "updatedAt": "2019-05-09T03:22:47.150Z", * "calendar": { * "name": "My calendar", * "selector": "my-calendar" diff --git a/server/api/controllers/camera.controller.js b/server/api/controllers/camera.controller.js index 47d1176eff..ef76e63e11 100644 --- a/server/api/controllers/camera.controller.js +++ b/server/api/controllers/camera.controller.js @@ -17,8 +17,8 @@ module.exports = function HouseController(gladys) { * "external_id": "test-camera-external", * "should_poll": false, * "poll_frequency": null, - * "created_at": "2019-02-12T07:49:07.556Z", - * "updated_at": "2019-02-12T07:49:07.556Z", + * "createdAt": "2019-02-12T07:49:07.556Z", + * "updatedAt": "2019-02-12T07:49:07.556Z", * "features": [ * { * "name": "Test camera image", diff --git a/server/api/controllers/house.controller.js b/server/api/controllers/house.controller.js index e489da7556..84b49754f3 100644 --- a/server/api/controllers/house.controller.js +++ b/server/api/controllers/house.controller.js @@ -20,8 +20,8 @@ module.exports = function HouseController(gladys) { * "id": "7932e6b3-b944-49a9-8d63-b98b8ecb2509", * "name": "My house", * "selector": "my-house", - * "updated_at": "2019-05-09T03:43:54.247Z", - * "created_at": "2019-05-09T03:43:54.247Z" + * "updatedAt": "2019-05-09T03:43:54.247Z", + * "createdAt": "2019-05-09T03:43:54.247Z" * } */ async function create(req, res) { @@ -38,8 +38,8 @@ module.exports = function HouseController(gladys) { * "id": "7932e6b3-b944-49a9-8d63-b98b8ecb2509", * "name": "My house", * "selector": "my-house", - * "updated_at": "2019-05-09T03:43:54.247Z", - * "created_at": "2019-05-09T03:43:54.247Z" + * "updatedAt": "2019-05-09T03:43:54.247Z", + * "createdAt": "2019-05-09T03:43:54.247Z" * }] */ async function get(req, res) { @@ -57,8 +57,8 @@ module.exports = function HouseController(gladys) { * "id": "7932e6b3-b944-49a9-8d63-b98b8ecb2509", * "name": "My house", * "selector": "my-house" - * "updated_at": "2019-05-09T03:43:54.247Z", - * "created_at": "2019-05-09T03:43:54.247Z" + * "updatedAt": "2019-05-09T03:43:54.247Z", + * "createdAt": "2019-05-09T03:43:54.247Z" * } */ async function update(req, res) { diff --git a/server/api/controllers/location.controller.js b/server/api/controllers/location.controller.js index 2c70cb6356..8645406937 100644 --- a/server/api/controllers/location.controller.js +++ b/server/api/controllers/location.controller.js @@ -30,8 +30,8 @@ module.exports = function LocationController(gladys) { * "longitude": 12, * "altitude": 0, * "accuracy": 20, - * "created_at": "2019-05-09T02:40:36.723Z", - * "updated_at": "2019-05-09T02:40:36.723Z" + * "createdAt": "2019-05-09T02:40:36.723Z", + * "updatedAt": "2019-05-09T02:40:36.723Z" * } * ] */ diff --git a/server/api/controllers/message.controller.js b/server/api/controllers/message.controller.js index 8abd00df42..584da5d1d2 100644 --- a/server/api/controllers/message.controller.js +++ b/server/api/controllers/message.controller.js @@ -14,7 +14,7 @@ module.exports = function MessageController(gladys) { * "source": "api_client", * "language": "fr", * "source_user_id": "e4e3f03e-60b9-485e-bc0a-c582b69089bd", - * "created_at": "2019-05-09T03:40:52.881Z" + * "createdAt": "2019-05-09T03:40:52.881Z" * } */ async function create(req, res) { @@ -24,7 +24,7 @@ module.exports = function MessageController(gladys) { language: req.user.language, source_user_id: req.user.id, user: req.user, - created_at: req.body.created_at || new Date(), + createdAt: req.body.createdAt || new Date(), }; gladys.event.emit(EVENTS.MESSAGE.NEW, messageToSend); res.status(201).json({ @@ -32,7 +32,7 @@ module.exports = function MessageController(gladys) { source: 'api_client', language: req.user.language, source_user_id: req.user.id, - created_at: messageToSend.created_at, + createdAt: messageToSend.createdAt, }); } diff --git a/server/api/controllers/room.controller.js b/server/api/controllers/room.controller.js index 973dcfb330..9d33195fc5 100644 --- a/server/api/controllers/room.controller.js +++ b/server/api/controllers/room.controller.js @@ -18,8 +18,8 @@ module.exports = function RoomController(gladys) { * "name": "my room", * "selector": "my-room", * "house_id": "7932e6b3-b944-49a9-8d63-b98b8ecb2509", - * "updated_at": "2019-05-09T04:01:48.983Z", - * "created_at": "2019-05-09T04:01:48.983Z" + * "updatedAt": "2019-05-09T04:01:48.983Z", + * "createdAt": "2019-05-09T04:01:48.983Z" * } */ async function create(req, res) { @@ -38,8 +38,8 @@ module.exports = function RoomController(gladys) { * "name": "my room", * "selector": "my-room", * "house_id": "7932e6b3-b944-49a9-8d63-b98b8ecb2509", - * "updated_at": "2019-05-09T04:01:48.983Z", - * "created_at": "2019-05-09T04:01:48.983Z" + * "updatedAt": "2019-05-09T04:01:48.983Z", + * "createdAt": "2019-05-09T04:01:48.983Z" * } */ async function update(req, res) { @@ -71,8 +71,8 @@ module.exports = function RoomController(gladys) { * "name": "my room", * "selector": "my-room", * "house_id": "7932e6b3-b944-49a9-8d63-b98b8ecb2509", - * "updated_at": "2019-05-09T04:01:48.983Z", - * "created_at": "2019-05-09T04:01:48.983Z", + * "updatedAt": "2019-05-09T04:01:48.983Z", + * "createdAt": "2019-05-09T04:01:48.983Z", * "temperature": { * "temperature": 29, * "unit": "celsius" @@ -104,8 +104,8 @@ module.exports = function RoomController(gladys) { * "house_id": "a741dfa6-24de-4b46-afc7-370772f068d5", * "name": "Test room", * "selector": "test-room", - * "created_at": "2019-02-12T07:49:07.556Z", - * "updated_at": "2019-02-12T07:49:07.556Z", + * "createdAt": "2019-02-12T07:49:07.556Z", + * "updatedAt": "2019-02-12T07:49:07.556Z", * "devices": [ * { * "name": "Test device", diff --git a/server/api/controllers/service.controller.js b/server/api/controllers/service.controller.js index 4eebd2e31b..a2f3a9894c 100644 --- a/server/api/controllers/service.controller.js +++ b/server/api/controllers/service.controller.js @@ -14,8 +14,8 @@ module.exports = function ServiceController(gladys) { * "version":"0.1.0", * "status":"RUNNING", * "has_message_feature":false, - * "created_at":"2019-06-14T04:38:51.555Z", - * "updated_at":"2019-06-14T04:38:51.555Z" + * "createdAt":"2019-06-14T04:38:51.555Z", + * "updatedAt":"2019-06-14T04:38:51.555Z" * } */ async function start(req, res) { @@ -39,8 +39,8 @@ module.exports = function ServiceController(gladys) { * "version":"0.1.0", * "status":"STOPPED", * "has_message_feature":false, - * "created_at":"2019-06-14T04:38:51.555Z", - * "updated_at":"2019-06-14T04:38:51.555Z" + * "createdAt":"2019-06-14T04:38:51.555Z", + * "updatedAt":"2019-06-14T04:38:51.555Z" * } */ async function stop(req, res) { @@ -64,8 +64,8 @@ module.exports = function ServiceController(gladys) { * "version":"0.1.0", * "status":"RUNNING", * "has_message_feature":false, - * "created_at":"2019-06-14T04:38:51.555Z", - * "updated_at":"2019-06-14T04:38:51.555Z" + * "createdAt":"2019-06-14T04:38:51.555Z", + * "updatedAt":"2019-06-14T04:38:51.555Z" * } */ async function getByName(req, res) { @@ -87,8 +87,8 @@ module.exports = function ServiceController(gladys) { * "version":"0.1.0", * "status":"RUNNING", * "has_message_feature":false, - * "created_at":"2019-06-14T04:38:51.555Z", - * "updated_at":"2019-06-14T04:38:51.555Z" + * "createdAt":"2019-06-14T04:38:51.555Z", + * "updatedAt":"2019-06-14T04:38:51.555Z" * }, * { * "id": "25be132d-bc38-44c1-a240-2d2b72dd6bd9", @@ -98,8 +98,8 @@ module.exports = function ServiceController(gladys) { * "version":"0.1.0", * "status":"LOADING", * "has_message_feature":false, - * "created_at":"2019-06-14T04:38:51.555Z", - * "updated_at":"2019-06-14T04:38:51.555Z" + * "createdAt":"2019-06-14T04:38:51.555Z", + * "updatedAt":"2019-06-14T04:38:51.555Z" * } * ] */ diff --git a/server/config/config.js b/server/config/config.js index a844a39600..23107c5985 100644 --- a/server/config/config.js +++ b/server/config/config.js @@ -3,7 +3,6 @@ module.exports = { dialect: 'sqlite', storage: process.env.SQLITE_FILE_PATH || './gladys-development.db', logging: false, - operatorsAliases: false, define: { underscored: true, freezeTableName: true, @@ -21,7 +20,6 @@ module.exports = { test: { dialect: 'sqlite', storage: process.env.SQLITE_FILE_PATH || ':memory:', - operatorsAliases: false, logging: false, define: { underscored: true, @@ -40,7 +38,6 @@ module.exports = { production: { dialect: 'sqlite', storage: process.env.SQLITE_FILE_PATH || './gladys-production.db', - operatorsAliases: false, logging: false, define: { underscored: true, diff --git a/server/lib/dashboard/dashboard.get.js b/server/lib/dashboard/dashboard.get.js index 00b84509d1..4723f227b7 100644 --- a/server/lib/dashboard/dashboard.get.js +++ b/server/lib/dashboard/dashboard.get.js @@ -1,6 +1,6 @@ const db = require('../../models'); -const DEFAULT_FIELDS = ['id', 'name', 'selector', 'type', 'updated_at']; +const DEFAULT_FIELDS = ['id', 'name', 'selector', 'type', 'updatedAt']; /** * @description Get list of dashboard. diff --git a/server/lib/device/device.purgeStates.js b/server/lib/device/device.purgeStates.js index 56d834609c..bb9e8c6b6a 100644 --- a/server/lib/device/device.purgeStates.js +++ b/server/lib/device/device.purgeStates.js @@ -21,7 +21,7 @@ async function purgeStates() { // all date before this timestamp will be removed const timstampLimit = now - deviceStateHistoryInDaysInt * 24 * 60 * 60 * 1000; await queryInterface.bulkDelete('t_device_feature_state', { - created_at: { + createdAt: { [Op.lte]: new Date(timstampLimit), }, }); diff --git a/server/lib/gateway/gateway.checkIfBackupNeeded.js b/server/lib/gateway/gateway.checkIfBackupNeeded.js index b747d048a1..0894348194 100644 --- a/server/lib/gateway/gateway.checkIfBackupNeeded.js +++ b/server/lib/gateway/gateway.checkIfBackupNeeded.js @@ -14,7 +14,7 @@ async function checkIfBackupNeeded() { if (backups.length === 0) { shouldBackup = true; } else { - const lastBackupTimestamp = new Date(backups[0].created_at).getTime(); + const lastBackupTimestamp = new Date(backups[0].createdAt).getTime(); const yesterday = new Date().getTime() - 24 * 60 * 60 * 1000; if (lastBackupTimestamp <= yesterday) { shouldBackup = true; diff --git a/server/lib/location/location.create.js b/server/lib/location/location.create.js index 4438c38d4b..8dadadf486 100644 --- a/server/lib/location/location.create.js +++ b/server/lib/location/location.create.js @@ -30,7 +30,7 @@ async function create(userSelector, location) { last_longitude: createdLocation.longitude, last_altitude: createdLocation.altitude, last_accuracy: createdLocation.accuracy, - last_location_changed: createdLocation.created_at, + last_location_changed: createdLocation.createdAt, }); return createdLocation.get({ plain: true }); } diff --git a/server/lib/location/location.get.js b/server/lib/location/location.get.js index 912f98a184..4e9f4ef80c 100644 --- a/server/lib/location/location.get.js +++ b/server/lib/location/location.get.js @@ -29,7 +29,7 @@ async function get(userSelector, from, to) { const locations = await db.Location.findAll({ where: { user_id: user.id, - created_at: { + createdAt: { [Op.gte]: fromDate, [Op.lte]: toDate, }, diff --git a/server/lib/location/location.getLast.js b/server/lib/location/location.getLast.js index 4d7dcbfafd..2c73cc79a1 100644 --- a/server/lib/location/location.getLast.js +++ b/server/lib/location/location.getLast.js @@ -22,7 +22,7 @@ async function getLast(userSelector) { where: { user_id: user.id, }, - order: [['created_at', 'DESC']], + order: [['createdAt', 'DESC']], limit: 1, }); diff --git a/server/lib/message/message.get.js b/server/lib/message/message.get.js index 26018afce5..660aeba9c5 100644 --- a/server/lib/message/message.get.js +++ b/server/lib/message/message.get.js @@ -2,11 +2,11 @@ const { Op } = require('sequelize'); const db = require('../../models'); const DEFAULT_OPTIONS = { - fields: ['id', 'sender_id', 'receiver_id', 'text', 'file', 'is_read', 'created_at'], + fields: ['id', 'sender_id', 'receiver_id', 'text', 'file', 'is_read', 'createdAt'], take: 20, skip: 0, order_dir: 'DESC', - order_by: 'created_at', + order_by: 'createdAt', }; /** diff --git a/server/lib/scene/scene.get.js b/server/lib/scene/scene.get.js index d9770b251c..b01c71a025 100644 --- a/server/lib/scene/scene.get.js +++ b/server/lib/scene/scene.get.js @@ -3,7 +3,7 @@ const Sequelize = require('sequelize'); const db = require('../../models'); const DEFAULT_OPTIONS = { - fields: ['id', 'name', 'icon', 'selector', 'last_executed', 'updated_at'], + fields: ['id', 'name', 'icon', 'selector', 'last_executed', 'updatedAt'], skip: 0, order_dir: 'ASC', order_by: 'name', diff --git a/server/lib/session/session.get.js b/server/lib/session/session.get.js index 4f6616bb53..f1c5e55bf9 100644 --- a/server/lib/session/session.get.js +++ b/server/lib/session/session.get.js @@ -3,7 +3,7 @@ const db = require('../../models'); const DEFAULT_OPTIONS = { take: 20, skip: 0, - order_by: 'created_at', + order_by: 'createdAt', order_dir: 'desc', }; @@ -15,8 +15,8 @@ const FIELDS = [ 'last_seen', 'revoked', 'useragent', - 'created_at', - 'updated_at', + 'createdAt', + 'updatedAt', ]; /** diff --git a/server/lib/system/system.getContainers.js b/server/lib/system/system.getContainers.js index 3397aa9aca..a33b0c74a8 100644 --- a/server/lib/system/system.getContainers.js +++ b/server/lib/system/system.getContainers.js @@ -20,7 +20,7 @@ async function getContainers(options = { all: true }) { state: container.State, id: container.Id, networkMode: get(container, 'HostConfig.NetworkMode'), - created_at: container.Created, + createdAt: container.Created, }; }); } diff --git a/server/lib/user/user.getById.js b/server/lib/user/user.getById.js index 777709802e..283afd7e30 100644 --- a/server/lib/user/user.getById.js +++ b/server/lib/user/user.getById.js @@ -23,8 +23,8 @@ async function getById(id) { 'birthdate', 'role', 'temperature_unit_preference', - 'created_at', - 'updated_at', + 'createdAt', + 'updatedAt', ], }); if (user === null) { diff --git a/server/lib/user/user.login.js b/server/lib/user/user.login.js index cd3e115910..a6e0f4c922 100644 --- a/server/lib/user/user.login.js +++ b/server/lib/user/user.login.js @@ -24,8 +24,8 @@ async function login(email, password) { 'language', 'birthdate', 'role', - 'created_at', - 'updated_at', + 'createdAt', + 'updatedAt', ], }); if (user === null) { diff --git a/server/migrations/20190205063641-create-user.js b/server/migrations/20190205063641-create-user.js index 90a20c00df..d9408447a8 100644 --- a/server/migrations/20190205063641-create-user.js +++ b/server/migrations/20190205063641-create-user.js @@ -101,5 +101,5 @@ module.exports = { await queryInterface.addIndex('t_user', ['role']); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_user'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_user'), }; diff --git a/server/migrations/20190206102938-create-location.js b/server/migrations/20190206102938-create-location.js index 9c9bb14c92..b5f38e0c5a 100644 --- a/server/migrations/20190206102938-create-location.js +++ b/server/migrations/20190206102938-create-location.js @@ -45,5 +45,5 @@ module.exports = { await queryInterface.addIndex('t_location', ['user_id']); await queryInterface.addIndex('t_location', ['created_at']); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_location'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_location'), }; diff --git a/server/migrations/20190206114851-create-house.js b/server/migrations/20190206114851-create-house.js index fd821aa0e9..6077100a44 100644 --- a/server/migrations/20190206114851-create-house.js +++ b/server/migrations/20190206114851-create-house.js @@ -34,5 +34,5 @@ module.exports = { }, }); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_house'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_house'), }; diff --git a/server/migrations/20190211033038-create-life-event.js b/server/migrations/20190211033038-create-life-event.js index 696b28cf5b..29ee426380 100644 --- a/server/migrations/20190211033038-create-life-event.js +++ b/server/migrations/20190211033038-create-life-event.js @@ -46,5 +46,5 @@ module.exports = { await queryInterface.addIndex('t_life_event', ['house_id']); await queryInterface.addIndex('t_life_event', ['type']); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_life_event'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_life_event'), }; diff --git a/server/migrations/20190211034727-create-room.js b/server/migrations/20190211034727-create-room.js index ad40b462b2..d59d0c71b4 100644 --- a/server/migrations/20190211034727-create-room.js +++ b/server/migrations/20190211034727-create-room.js @@ -38,5 +38,5 @@ module.exports = { await queryInterface.addIndex('t_room', ['house_id']); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_room'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_room'), }; diff --git a/server/migrations/20190211035101-create-device.js b/server/migrations/20190211035101-create-device.js index 8a4dfb7218..4bac19a5f2 100644 --- a/server/migrations/20190211035101-create-device.js +++ b/server/migrations/20190211035101-create-device.js @@ -65,5 +65,5 @@ module.exports = { await queryInterface.addIndex('t_device', ['service_id']); await queryInterface.addIndex('t_device', ['room_id']); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_device'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_device'), }; diff --git a/server/migrations/20190211035238-create-device-feature.js b/server/migrations/20190211035238-create-device-feature.js index e7005cdb0d..f0a6331a73 100644 --- a/server/migrations/20190211035238-create-device-feature.js +++ b/server/migrations/20190211035238-create-device-feature.js @@ -85,5 +85,5 @@ module.exports = { await queryInterface.addIndex('t_device_feature', ['device_id']); await queryInterface.addIndex('t_device_feature', ['category']); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_device_feature'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_device_feature'), }; diff --git a/server/migrations/20190211041243-create-device-feature-state.js b/server/migrations/20190211041243-create-device-feature-state.js index f747adda89..f78fb7d341 100644 --- a/server/migrations/20190211041243-create-device-feature-state.js +++ b/server/migrations/20190211041243-create-device-feature-state.js @@ -32,5 +32,5 @@ module.exports = { await queryInterface.addIndex('t_device_feature_state', ['device_feature_id']); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_device_feature_state'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_device_feature_state'), }; diff --git a/server/migrations/20190211042223-create-calendar.js b/server/migrations/20190211042223-create-calendar.js index c8045421d6..9e9aa76d13 100644 --- a/server/migrations/20190211042223-create-calendar.js +++ b/server/migrations/20190211042223-create-calendar.js @@ -66,5 +66,5 @@ module.exports = { await queryInterface.addIndex('t_calendar', ['user_id']); await queryInterface.addIndex('t_calendar', ['service_id']); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_calendar'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_calendar'), }; diff --git a/server/migrations/20190211042644-create-calendar-event.js b/server/migrations/20190211042644-create-calendar-event.js index 1b509b2beb..a9ad8ba49d 100644 --- a/server/migrations/20190211042644-create-calendar-event.js +++ b/server/migrations/20190211042644-create-calendar-event.js @@ -58,5 +58,5 @@ module.exports = { await queryInterface.addIndex('t_calendar_event', ['start']); await queryInterface.addIndex('t_calendar_event', ['end']); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_calendar_event'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_calendar_event'), }; diff --git a/server/migrations/20190211043231-create-pod.js b/server/migrations/20190211043231-create-pod.js index 500ba1c105..d4f8fe081e 100644 --- a/server/migrations/20190211043231-create-pod.js +++ b/server/migrations/20190211043231-create-pod.js @@ -37,5 +37,5 @@ module.exports = { await queryInterface.addIndex('t_pod', ['room_id']); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_pod'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_pod'), }; diff --git a/server/migrations/20190211043515-create-service.js b/server/migrations/20190211043515-create-service.js index 7b4fb59dff..bbf668e3f3 100644 --- a/server/migrations/20190211043515-create-service.js +++ b/server/migrations/20190211043515-create-service.js @@ -53,5 +53,5 @@ module.exports = { unique: true, }); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_service'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_service'), }; diff --git a/server/migrations/20190211043957-create-variable.js b/server/migrations/20190211043957-create-variable.js index 62dd7f9e08..166857746d 100644 --- a/server/migrations/20190211043957-create-variable.js +++ b/server/migrations/20190211043957-create-variable.js @@ -48,5 +48,5 @@ module.exports = { unique: true, }); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_variable'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_variable'), }; diff --git a/server/migrations/20190211044205-create-script.js b/server/migrations/20190211044205-create-script.js index 631e14b170..e4561f710d 100644 --- a/server/migrations/20190211044205-create-script.js +++ b/server/migrations/20190211044205-create-script.js @@ -30,5 +30,5 @@ module.exports = { }, }); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_script'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_script'), }; diff --git a/server/migrations/20190211044442-create-area.js b/server/migrations/20190211044442-create-area.js index 6296d5a0bd..e676801ca9 100644 --- a/server/migrations/20190211044442-create-area.js +++ b/server/migrations/20190211044442-create-area.js @@ -42,5 +42,5 @@ module.exports = { }, }); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_area'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_area'), }; diff --git a/server/migrations/20190211044839-create-dashboard.js b/server/migrations/20190211044839-create-dashboard.js index 59238b6c20..aaaefcd1cd 100644 --- a/server/migrations/20190211044839-create-dashboard.js +++ b/server/migrations/20190211044839-create-dashboard.js @@ -34,5 +34,5 @@ module.exports = { }, }); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_dashboard'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_dashboard'), }; diff --git a/server/migrations/20190211045110-create-scene.js b/server/migrations/20190211045110-create-scene.js index a7a978eb6d..af1ec3beca 100644 --- a/server/migrations/20190211045110-create-scene.js +++ b/server/migrations/20190211045110-create-scene.js @@ -36,5 +36,5 @@ module.exports = { }, }); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_scene'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_scene'), }; diff --git a/server/migrations/20190211045641-create-trigger.js b/server/migrations/20190211045641-create-trigger.js index de3a2db968..0c163afd0d 100644 --- a/server/migrations/20190211045641-create-trigger.js +++ b/server/migrations/20190211045641-create-trigger.js @@ -41,5 +41,5 @@ module.exports = { }, }); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_trigger'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_trigger'), }; diff --git a/server/migrations/20190211050844-trigger_scene.js b/server/migrations/20190211050844-trigger_scene.js index db8f857f05..84d61a5939 100644 --- a/server/migrations/20190211050844-trigger_scene.js +++ b/server/migrations/20190211050844-trigger_scene.js @@ -43,5 +43,5 @@ module.exports = { await queryInterface.addIndex('t_trigger_scene', ['trigger_id']); await queryInterface.addIndex('t_trigger_scene', ['scene_id']); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_trigger_scene'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_trigger_scene'), }; diff --git a/server/migrations/20190211051215-create-message.js b/server/migrations/20190211051215-create-message.js index d71a15cec9..ae1ef37919 100644 --- a/server/migrations/20190211051215-create-message.js +++ b/server/migrations/20190211051215-create-message.js @@ -57,5 +57,5 @@ module.exports = { await queryInterface.addIndex('t_message', ['sender_id']); await queryInterface.addIndex('t_message', ['receiver_id']); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_message'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_message'), }; diff --git a/server/migrations/20190212043623-create-session.js b/server/migrations/20190212043623-create-session.js index a2696eb6f1..ad149b11b9 100644 --- a/server/migrations/20190212043623-create-session.js +++ b/server/migrations/20190212043623-create-session.js @@ -51,5 +51,5 @@ module.exports = { await queryInterface.addIndex('t_session', ['user_id']); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_session'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_session'), }; diff --git a/server/migrations/20190318084429-create-device-param.js b/server/migrations/20190318084429-create-device-param.js index 8727c4f160..b8cef37a47 100644 --- a/server/migrations/20190318084429-create-device-param.js +++ b/server/migrations/20190318084429-create-device-param.js @@ -39,5 +39,5 @@ module.exports = { unique: true, }); }, - down: (queryInterface, Sequelize) => queryInterface.dropTable('t_device_param'), + down: async (queryInterface, Sequelize) => queryInterface.dropTable('t_device_param'), }; diff --git a/server/migrations/20200123094438-add-triggers-attribute.js b/server/migrations/20200123094438-add-triggers-attribute.js index 759aa85917..1f77987639 100644 --- a/server/migrations/20200123094438-add-triggers-attribute.js +++ b/server/migrations/20200123094438-add-triggers-attribute.js @@ -8,5 +8,5 @@ module.exports = { // delete useless trigger_scene table await queryInterface.dropTable('t_trigger_scene'); }, - down: (queryInterface, Sequelize) => {}, + down: async (queryInterface, Sequelize) => {}, }; diff --git a/server/migrations/20200201125436-add-caldav-data.js b/server/migrations/20200201125436-add-caldav-data.js index 1d462f1770..04d1008c2a 100644 --- a/server/migrations/20200201125436-add-caldav-data.js +++ b/server/migrations/20200201125436-add-caldav-data.js @@ -10,5 +10,5 @@ module.exports = { ]); }, - down: (queryInterface, Sequelize) => {}, + down: async (queryInterface, Sequelize) => {}, }; diff --git a/server/migrations/20200207214849-add-calendar-event-url.js b/server/migrations/20200207214849-add-calendar-event-url.js index eb4cd3f1b4..f09b38e375 100644 --- a/server/migrations/20200207214849-add-calendar-event-url.js +++ b/server/migrations/20200207214849-add-calendar-event-url.js @@ -7,5 +7,5 @@ module.exports = { ]); }, - down: (queryInterface, Sequelize) => {}, + down: async (queryInterface, Sequelize) => {}, }; diff --git a/server/migrations/20201128203008-add-color-caldav.js b/server/migrations/20201128203008-add-color-caldav.js index 62926cdca0..0e2e0e0414 100644 --- a/server/migrations/20201128203008-add-color-caldav.js +++ b/server/migrations/20201128203008-add-color-caldav.js @@ -7,5 +7,5 @@ module.exports = { ]); }, - down: (queryInterface, Sequelize) => {}, + down: async (queryInterface, Sequelize) => {}, }; diff --git a/server/migrations/20210129155044-multi-user.js b/server/migrations/20210129155044-multi-user.js index 139b090a9e..7f3f7e3caf 100644 --- a/server/migrations/20210129155044-multi-user.js +++ b/server/migrations/20210129155044-multi-user.js @@ -33,5 +33,5 @@ module.exports = { } }, - down: (queryInterface, Sequelize) => {}, + down: async (queryInterface, Sequelize) => {}, }; diff --git a/server/package-lock.json b/server/package-lock.json index b56a71578e..6399099a82 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -347,15 +347,10 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, - "@types/geojson": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.6.tgz", - "integrity": "sha512-Xqg/lIZMrUd0VRmSRbCAewtwGZiAk3mEUDvV4op1tGl+LvyPcb/MIOSxTl9z+9+J+R4/vpjiCAT4xeKzH9ji1w==" - }, "@types/node": { - "version": "12.11.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.11.7.tgz", - "integrity": "sha512-JNbGaHFCLwgHn/iCckiGSOZ1XYHsKFwREtzPwSGCVld1SGhOlmZw2D4ZI94HQCrBHbADzW9m4LER/8olJTRGHA==" + "version": "14.14.31", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.31.tgz", + "integrity": "sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==" }, "@types/prop-types": { "version": "15.7.3", @@ -492,6 +487,11 @@ "color-convert": "^1.9.0" } }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" + }, "anymatch": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", @@ -1577,15 +1577,6 @@ } } }, - "cls-bluebird": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cls-bluebird/-/cls-bluebird-2.1.0.tgz", - "integrity": "sha1-N+8eCAqP+1XC9BZPU28ZGeeWiu4=", - "requires": { - "is-bluebird": "^1.0.2", - "shimmer": "^1.1.0" - } - }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -2258,9 +2249,9 @@ "dev": true }, "dottie": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.1.tgz", - "integrity": "sha512-ch5OQgvGDK2u8pSZeSYAQaV/lczImd7pMJ7BcEPXmnFVjy4yJIzP6CsODJUTH8mg1tyH1Z2abOiuJO3DjZ/GBw==" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.2.tgz", + "integrity": "sha512-fmrwR04lsniq/uSr8yikThDTrM7epXHBAAjH9TbeH3rEA8tdCO7mRzB9hdmdGyJCxF8KERo9CITcm3kGuoyMhg==" }, "doublearray": { "version": "0.0.2", @@ -3147,9 +3138,9 @@ }, "dependencies": { "type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz", - "integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.3.0.tgz", + "integrity": "sha512-rgPIqOdfK/4J9FhiVrZ3cveAjRRo5rsQBAIhnylX874y1DX/kEKSVdLsnuHB6l1KTjHyU01VjiMBHgU2adejyg==" } } }, @@ -4093,11 +4084,6 @@ "wide-align": "^1.1.0" } }, - "generic-pool": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.5.0.tgz", - "integrity": "sha512-dEkxmX+egB2o4NR80c/q+xzLLzLX+k68/K8xv81XprD+Sk7ZtP14VugeCz+fUwv5FzpWq40pPtAkzPRqT8ka9w==" - }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -4614,11 +4600,6 @@ "binary-extensions": "^1.0.0" } }, - "is-bluebird": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-bluebird/-/is-bluebird-1.0.2.tgz", - "integrity": "sha1-CWQ5Bg9KpBGr7hkUOoTWpVNG1uI=" - }, "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", @@ -4786,7 +4767,8 @@ "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true }, "is-redirect": { "version": "1.0.0", @@ -4970,15 +4952,30 @@ } }, "js-beautify": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.10.3.tgz", - "integrity": "sha512-wfk/IAWobz1TfApSdivH5PJ0miIHgDoYb1ugSqHcODPmaYu46rYe5FVuIEkhjg8IQiv6rDNPyhsqbsohI/C2vQ==", + "version": "1.13.5", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.13.5.tgz", + "integrity": "sha512-MsXlH6Z/BiRYSkSRW3clNDqDjSpiSNOiG8xYVUBXt4k0LnGvDhlTGOlHX1VFtAdoLmtwjxMG5qiWKy/g+Ipv5w==", "requires": { "config-chain": "^1.1.12", "editorconfig": "^0.15.3", "glob": "^7.1.3", - "mkdirp": "~0.5.1", - "nopt": "~4.0.1" + "mkdirp": "^1.0.4", + "nopt": "^5.0.0" + }, + "dependencies": { + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + }, + "nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "requires": { + "abbrev": "1" + } + } } }, "js-tokens": { @@ -5492,18 +5489,30 @@ "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, "memoizee": { - "version": "0.4.14", - "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.14.tgz", - "integrity": "sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg==", + "version": "0.4.15", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz", + "integrity": "sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==", "requires": { - "d": "1", - "es5-ext": "^0.10.45", - "es6-weak-map": "^2.0.2", + "d": "^1.0.1", + "es5-ext": "^0.10.53", + "es6-weak-map": "^2.0.3", "event-emitter": "^0.3.5", - "is-promise": "^2.1", - "lru-queue": "0.1", - "next-tick": "1", - "timers-ext": "^0.1.5" + "is-promise": "^2.2.2", + "lru-queue": "^0.1.0", + "next-tick": "^1.1.0", + "timers-ext": "^0.1.7" + }, + "dependencies": { + "is-promise": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", + "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==" + }, + "next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" + } } }, "memorystream": { @@ -8232,22 +8241,11 @@ "dev": true }, "retry-as-promised": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-2.3.2.tgz", - "integrity": "sha1-zZdO5P2bX+A8vzGHHuSCIcB3N7c=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-3.2.0.tgz", + "integrity": "sha512-CybGs60B7oYU/qSQ6kuaFmRd9sTZ6oXSc0toqePvV74Ac6/IFZSI1ReFQmtCN+uvW1Mtqdwpvt/LGOiCBAY2Mg==", "requires": { - "bluebird": "^3.4.6", - "debug": "^2.6.9" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - } + "any-promise": "^1.3.0" } }, "reusify": { @@ -8413,51 +8411,103 @@ } }, "sequelize": { - "version": "4.44.3", - "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-4.44.3.tgz", - "integrity": "sha512-r2A4EVDKRCcABcZhY4ItvbcosvMJKpQMooxg/S8ouRFrZzqMPQ9O2thOUfgW59q8ZcEa5ccNeqwg15MCciqPMg==", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.5.0.tgz", + "integrity": "sha512-owBt8fnzVy8E1OvyCyfCdVk7OOLyPVrBCMEf+CvRReC5oCyo+UqeXCtwaex9L6LM9ifZ1i3TG3sFeM5MgLK0CQ==", "requires": { - "bluebird": "^3.5.0", - "cls-bluebird": "^2.1.0", - "debug": "^3.1.0", - "depd": "^1.1.0", + "debug": "^4.1.1", "dottie": "^2.0.0", - "generic-pool": "3.5.0", "inflection": "1.12.0", - "lodash": "^4.17.1", - "moment": "^2.20.0", - "moment-timezone": "^0.5.14", - "retry-as-promised": "^2.3.2", - "semver": "^5.5.0", - "terraformer-wkt-parser": "^1.1.2", + "lodash": "^4.17.20", + "moment": "^2.26.0", + "moment-timezone": "^0.5.31", + "retry-as-promised": "^3.2.0", + "semver": "^7.3.2", + "sequelize-pool": "^6.0.0", "toposort-class": "^1.0.1", - "uuid": "^3.2.1", - "validator": "^10.4.0", - "wkx": "^0.4.1" + "uuid": "^8.1.0", + "validator": "^10.11.0", + "wkx": "^0.5.0" }, "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" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "moment": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", + "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" + }, + "moment-timezone": { + "version": "0.5.33", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.33.tgz", + "integrity": "sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w==", + "requires": { + "moment": ">= 2.9.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } } }, "sequelize-cli": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/sequelize-cli/-/sequelize-cli-5.5.1.tgz", - "integrity": "sha512-ZM4kUZvY3y14y+Rq3cYxGH7YDJz11jWHcN2p2x7rhAIemouu4CEXr5ebw30lzTBtyXV4j2kTO+nUjZOqzG7k+Q==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/sequelize-cli/-/sequelize-cli-6.2.0.tgz", + "integrity": "sha512-6WQ2x91hg30dUn66mXHnzvHATZ4pyI1GHSNbS/TNN/vRR4BLRSLijadeMgC8zqmKDsL0VqzVVopJWfJakuP++Q==", "requires": { - "bluebird": "^3.5.3", "cli-color": "^1.4.0", "fs-extra": "^7.0.1", "js-beautify": "^1.8.8", "lodash": "^4.17.5", "resolve": "^1.5.0", - "umzug": "^2.1.0", + "umzug": "^2.3.0", "yargs": "^13.1.0" }, "dependencies": { + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" + }, "fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", @@ -8467,9 +8517,22 @@ "jsonfile": "^4.0.0", "universalify": "^0.1.0" } + }, + "umzug": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/umzug/-/umzug-2.3.0.tgz", + "integrity": "sha512-Z274K+e8goZK8QJxmbRPhl89HPO1K+ORFtm6rySPhFKfKc5GHhqdzD0SGhSWHkzoXasqJuItdhorSvY7/Cgflw==", + "requires": { + "bluebird": "^3.7.2" + } } } }, + "sequelize-pool": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-6.1.0.tgz", + "integrity": "sha512-4YwEw3ZgK/tY/so+GfnSgXkdwIJJ1I32uZJztIEgZeAO6HMgj64OzySbWLgxj+tXhZCJnzRfkY9gINw8Ft8ZMg==" + }, "serve-static": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", @@ -8529,11 +8592,6 @@ "rechoir": "^0.6.2" } }, - "shimmer": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", - "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==" - }, "shx": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/shx/-/shx-0.3.2.tgz", @@ -9265,23 +9323,6 @@ "execa": "^0.7.0" } }, - "terraformer": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/terraformer/-/terraformer-1.0.9.tgz", - "integrity": "sha512-YlmQ1fsMWTkKGDGibCRWgmLzrpDRUr63Q025LJ/taYQ6j1Yb8q9McKF7NBi6ACAyUXO6F/bl9w6v4MY307y5Ag==", - "requires": { - "@types/geojson": "^1.0.0" - } - }, - "terraformer-wkt-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/terraformer-wkt-parser/-/terraformer-wkt-parser-1.2.0.tgz", - "integrity": "sha512-QU3iA54St5lF8Za1jg1oj4NYc8sn5tCZ08aNSWDeGzrsaV48eZk1iAVWasxhNspYBoCqdHuoot1pUTUrE1AJ4w==", - "requires": { - "@types/geojson": "^1.0.0", - "terraformer": "~1.0.5" - } - }, "test-exclude": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", @@ -10054,9 +10095,9 @@ } }, "wkx": { - "version": "0.4.8", - "resolved": "https://registry.npmjs.org/wkx/-/wkx-0.4.8.tgz", - "integrity": "sha512-ikPXMM9IR/gy/LwiOSqWlSL3X/J5uk9EO2hHNRXS41eTLXaUFEVw9fn/593jW/tE5tedNg8YjT5HkCa4FqQZyQ==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/wkx/-/wkx-0.5.0.tgz", + "integrity": "sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg==", "requires": { "@types/node": "*" } diff --git a/server/package.json b/server/package.json index 66b9e66536..8b316c030c 100644 --- a/server/package.json +++ b/server/package.json @@ -94,8 +94,8 @@ "path-to-regexp": "^3.0.0", "queue": "^6.0.0", "semver": "^6.1.1", - "sequelize": "^4.42.0", - "sequelize-cli": "^5.5.1", + "sequelize": "^6.5.0", + "sequelize-cli": "^6.2.0", "set-value": "^3.0.2", "sqlite3": "^4.0.6", "tracer": "^0.9.8", diff --git a/server/seeders/20190205070000-house.js b/server/seeders/20190205070000-house.js index bf67cdb465..fcbd810460 100644 --- a/server/seeders/20190205070000-house.js +++ b/server/seeders/20190205070000-house.js @@ -23,5 +23,5 @@ module.exports = { {}, ), - down: (queryInterface, Sequelize) => queryInterface.bulkDelete('t_house', null, {}), + down: async (queryInterface, Sequelize) => queryInterface.bulkDelete('t_house', null, {}), }; diff --git a/server/seeders/20190205071039-demo-user.js b/server/seeders/20190205071039-demo-user.js index e1c74a5dcb..174ea59cbc 100644 --- a/server/seeders/20190205071039-demo-user.js +++ b/server/seeders/20190205071039-demo-user.js @@ -44,5 +44,5 @@ module.exports = { {}, ), - down: (queryInterface, Sequelize) => queryInterface.bulkDelete('t_user', null, {}), + down: async (queryInterface, Sequelize) => queryInterface.bulkDelete('t_user', null, {}), }; diff --git a/server/seeders/20190211053203-demo-location.js b/server/seeders/20190211053203-demo-location.js index 1a9a89d0d1..aca7ee772f 100644 --- a/server/seeders/20190211053203-demo-location.js +++ b/server/seeders/20190211053203-demo-location.js @@ -15,5 +15,5 @@ module.exports = { {}, ), - down: (queryInterface, Sequelize) => queryInterface.bulkDelete('t_location', null, {}), + down: async (queryInterface, Sequelize) => queryInterface.bulkDelete('t_location', null, {}), }; diff --git a/server/seeders/20190219041452-message.js b/server/seeders/20190219041452-message.js index 05be12d7ba..605e9fac47 100644 --- a/server/seeders/20190219041452-message.js +++ b/server/seeders/20190219041452-message.js @@ -17,5 +17,5 @@ module.exports = { {}, ), - down: (queryInterface, Sequelize) => queryInterface.bulkDelete('t_message', null, {}), + down: async (queryInterface, Sequelize) => queryInterface.bulkDelete('t_message', null, {}), }; diff --git a/server/seeders/20190226025926-service.js b/server/seeders/20190226025926-service.js index 78a310cc61..a4011feb73 100644 --- a/server/seeders/20190226025926-service.js +++ b/server/seeders/20190226025926-service.js @@ -18,5 +18,5 @@ module.exports = { {}, ), - down: (queryInterface, Sequelize) => queryInterface.bulkDelete('t_service', null, {}), + down: async (queryInterface, Sequelize) => queryInterface.bulkDelete('t_service', null, {}), }; diff --git a/server/seeders/20190226025931-variable.js b/server/seeders/20190226025931-variable.js index c53b6ead3a..1830b781cd 100644 --- a/server/seeders/20190226025931-variable.js +++ b/server/seeders/20190226025931-variable.js @@ -41,5 +41,5 @@ module.exports = { {}, ), - down: (queryInterface, Sequelize) => queryInterface.bulkDelete('t_variable', null, {}), + down: async (queryInterface, Sequelize) => queryInterface.bulkDelete('t_variable', null, {}), }; diff --git a/server/seeders/20190227043234-scene.js b/server/seeders/20190227043234-scene.js index b55a369ba7..d92879e5fc 100644 --- a/server/seeders/20190227043234-scene.js +++ b/server/seeders/20190227043234-scene.js @@ -26,5 +26,5 @@ module.exports = { {}, ), - down: (queryInterface, Sequelize) => queryInterface.bulkDelete('t_scene', null, {}), + down: async (queryInterface, Sequelize) => queryInterface.bulkDelete('t_scene', null, {}), }; diff --git a/server/seeders/20190227081653-room.js b/server/seeders/20190227081653-room.js index 6b61762dfe..f3adaf9977 100644 --- a/server/seeders/20190227081653-room.js +++ b/server/seeders/20190227081653-room.js @@ -15,5 +15,5 @@ module.exports = { {}, ), - down: (queryInterface, Sequelize) => queryInterface.bulkDelete('t_room', null, {}), + down: async (queryInterface, Sequelize) => queryInterface.bulkDelete('t_room', null, {}), }; diff --git a/server/seeders/20190227081656-device.js b/server/seeders/20190227081656-device.js index a123566ccf..c8dada0dc1 100644 --- a/server/seeders/20190227081656-device.js +++ b/server/seeders/20190227081656-device.js @@ -37,5 +37,5 @@ module.exports = { {}, ), - down: (queryInterface, Sequelize) => queryInterface.bulkDelete('t_device', null, {}), + down: async (queryInterface, Sequelize) => queryInterface.bulkDelete('t_device', null, {}), }; diff --git a/server/seeders/20190227081700-device-feature.js b/server/seeders/20190227081700-device-feature.js index 9daf740be0..bdd1946e83 100644 --- a/server/seeders/20190227081700-device-feature.js +++ b/server/seeders/20190227081700-device-feature.js @@ -99,5 +99,5 @@ module.exports = { {}, ), - down: (queryInterface, Sequelize) => queryInterface.bulkDelete('t_device_feature', null, {}), + down: async (queryInterface, Sequelize) => queryInterface.bulkDelete('t_device_feature', null, {}), }; diff --git a/server/seeders/20190401042124-session.js b/server/seeders/20190401042124-session.js index 6b484b5dc3..a33d830b66 100644 --- a/server/seeders/20190401042124-session.js +++ b/server/seeders/20190401042124-session.js @@ -91,5 +91,5 @@ module.exports = { {}, ), - down: (queryInterface, Sequelize) => queryInterface.bulkDelete('t_session', null, {}), + down: async (queryInterface, Sequelize) => queryInterface.bulkDelete('t_session', null, {}), }; diff --git a/server/seeders/20190403081927-calendar.js b/server/seeders/20190403081927-calendar.js index 5a17859f95..cc8c15ab95 100644 --- a/server/seeders/20190403081927-calendar.js +++ b/server/seeders/20190403081927-calendar.js @@ -19,5 +19,5 @@ module.exports = { {}, ), - down: (queryInterface, Sequelize) => queryInterface.bulkDelete('t_calendar', null, {}), + down: async (queryInterface, Sequelize) => queryInterface.bulkDelete('t_calendar', null, {}), }; diff --git a/server/seeders/20190403081933-calendar-event.js b/server/seeders/20190403081933-calendar-event.js index 1e2dd1fb57..f2bb381703 100644 --- a/server/seeders/20190403081933-calendar-event.js +++ b/server/seeders/20190403081933-calendar-event.js @@ -31,5 +31,5 @@ module.exports = { {}, ), - down: (queryInterface, Sequelize) => queryInterface.bulkDelete('t_calendar_event', null, {}), + down: async (queryInterface, Sequelize) => queryInterface.bulkDelete('t_calendar_event', null, {}), }; diff --git a/server/seeders/20190416085240-device-param.js b/server/seeders/20190416085240-device-param.js index 983f1a0bb7..5acb1e8f03 100644 --- a/server/seeders/20190416085240-device-param.js +++ b/server/seeders/20190416085240-device-param.js @@ -15,5 +15,5 @@ module.exports = { {}, ), - down: (queryInterface, Sequelize) => queryInterface.bulkDelete('t_device_param', null, {}), + down: async (queryInterface, Sequelize) => queryInterface.bulkDelete('t_device_param', null, {}), }; diff --git a/server/seeders/20190506074218-dashboard.js b/server/seeders/20190506074218-dashboard.js index 6a1a2af14d..a24378b022 100644 --- a/server/seeders/20190506074218-dashboard.js +++ b/server/seeders/20190506074218-dashboard.js @@ -19,5 +19,5 @@ module.exports = { {}, ), - down: (queryInterface, Sequelize) => queryInterface.bulkDelete('t_dashboard', null, {}), + down: async (queryInterface, Sequelize) => queryInterface.bulkDelete('t_dashboard', null, {}), }; diff --git a/server/seeders/20190507083413-area.js b/server/seeders/20190507083413-area.js index 45a6754333..3e4d18da03 100644 --- a/server/seeders/20190507083413-area.js +++ b/server/seeders/20190507083413-area.js @@ -18,5 +18,5 @@ module.exports = { {}, ), - down: (queryInterface, Sequelize) => queryInterface.bulkDelete('t_area', null, {}), + down: async (queryInterface, Sequelize) => queryInterface.bulkDelete('t_area', null, {}), }; diff --git a/server/test/controllers/dashboard/dashboard.controller.test.js b/server/test/controllers/dashboard/dashboard.controller.test.js index 36fc7696fb..9cc8a1fc0c 100644 --- a/server/test/controllers/dashboard/dashboard.controller.test.js +++ b/server/test/controllers/dashboard/dashboard.controller.test.js @@ -38,7 +38,7 @@ describe('GET /api/v1/dashboard', () => { name: 'Test dashboard', selector: 'test-dashboard', type: 'main', - updated_at: '2019-02-12 07:49:07.556 +00:00', + updatedAt: '2019-02-12 07:49:07.556 +00:00', }, ]); }); @@ -65,8 +65,8 @@ describe('GET /api/v1/dashboard/:dashboard_selector', () => { }, ], ], - updated_at: '2019-02-12T07:49:07.556Z', - created_at: '2019-02-12T07:49:07.556Z', + updatedAt: '2019-02-12T07:49:07.556Z', + createdAt: '2019-02-12T07:49:07.556Z', }); }); }); @@ -95,8 +95,8 @@ describe('PATCH /api/v1/dashboard/:dashboard_selector', () => { }, ], ], - updated_at: res.body.updated_at, - created_at: '2019-02-12T07:49:07.556Z', + updatedAt: res.body.updatedAt, + createdAt: '2019-02-12T07:49:07.556Z', }); }); }); diff --git a/server/test/controllers/gateway/gateway.controller.test.js b/server/test/controllers/gateway/gateway.controller.test.js index 54146fe90b..51f87bd740 100644 --- a/server/test/controllers/gateway/gateway.controller.test.js +++ b/server/test/controllers/gateway/gateway.controller.test.js @@ -13,8 +13,8 @@ describe('GET /api/v1/gateway/backup', () => { account_id: 'f4fd09b6-eeef-4439-95db-ef7a37443757', path: 'http://backup.com', size: 37680, - created_at: '2019-06-10T07:01:24.846Z', - updated_at: '2019-06-10T07:01:24.846Z', + createdAt: '2019-06-10T07:01:24.846Z', + updatedAt: '2019-06-10T07:01:24.846Z', is_deleted: false, }, ]; diff --git a/server/test/controllers/house/house.test.js b/server/test/controllers/house/house.test.js index 5b47fc608c..e6a8d265f7 100644 --- a/server/test/controllers/house/house.test.js +++ b/server/test/controllers/house/house.test.js @@ -31,8 +31,8 @@ describe('GET /api/v1/house', () => { selector: 'pepper-house', latitude: null, longitude: null, - created_at: '2019-02-12T07:49:07.556Z', - updated_at: '2019-02-12T07:49:07.556Z', + createdAt: '2019-02-12T07:49:07.556Z', + updatedAt: '2019-02-12T07:49:07.556Z', }, { id: 'a741dfa6-24de-4b46-afc7-370772f068d5', @@ -40,8 +40,8 @@ describe('GET /api/v1/house', () => { selector: 'test-house', latitude: 12, longitude: 12, - created_at: '2019-02-12T07:49:07.556Z', - updated_at: '2019-02-12T07:49:07.556Z', + createdAt: '2019-02-12T07:49:07.556Z', + updatedAt: '2019-02-12T07:49:07.556Z', }, ]); }); @@ -62,8 +62,8 @@ describe('GET /api/v1/house', () => { selector: 'test-house', latitude: 12, longitude: 12, - created_at: '2019-02-12T07:49:07.556Z', - updated_at: '2019-02-12T07:49:07.556Z', + createdAt: '2019-02-12T07:49:07.556Z', + updatedAt: '2019-02-12T07:49:07.556Z', }, { id: '6295ad8b-b655-4422-9e6d-b4612da5d55f', @@ -71,8 +71,8 @@ describe('GET /api/v1/house', () => { selector: 'pepper-house', latitude: null, longitude: null, - created_at: '2019-02-12T07:49:07.556Z', - updated_at: '2019-02-12T07:49:07.556Z', + createdAt: '2019-02-12T07:49:07.556Z', + updatedAt: '2019-02-12T07:49:07.556Z', }, ]); }); @@ -93,8 +93,8 @@ describe('GET /api/v1/house', () => { selector: 'test-house', latitude: 12, longitude: 12, - created_at: '2019-02-12T07:49:07.556Z', - updated_at: '2019-02-12T07:49:07.556Z', + createdAt: '2019-02-12T07:49:07.556Z', + updatedAt: '2019-02-12T07:49:07.556Z', }, ]); }); diff --git a/server/test/controllers/message/message.test.js b/server/test/controllers/message/message.test.js index 86d8a1e64a..f49bed1db8 100644 --- a/server/test/controllers/message/message.test.js +++ b/server/test/controllers/message/message.test.js @@ -16,7 +16,7 @@ describe('POST /api/v1/message', () => { source: 'api_client', source_user_id: '0cd30aef-9c4e-4a23-88e3-3547971296e5', language: 'en', - created_at: res.body.created_at, + createdAt: res.body.createdAt, }); }); }); @@ -40,7 +40,7 @@ describe('GET /api/v1/message', () => { file: null, text: 'What time is it ?', is_read: true, - created_at: '2019-02-12T07:49:07.556Z', + createdAt: '2019-02-12T07:49:07.556Z', }, ]); }); diff --git a/server/test/controllers/room/room.test.js b/server/test/controllers/room/room.test.js index 1a1b495773..c6aa865b5b 100644 --- a/server/test/controllers/room/room.test.js +++ b/server/test/controllers/room/room.test.js @@ -57,8 +57,8 @@ describe('GET /api/v1/room/:room_selector', () => { house_id: 'a741dfa6-24de-4b46-afc7-370772f068d5', name: 'Test room', selector: 'test-room', - created_at: '2019-02-12T07:49:07.556Z', - updated_at: '2019-02-12T07:49:07.556Z', + createdAt: '2019-02-12T07:49:07.556Z', + updatedAt: '2019-02-12T07:49:07.556Z', }); }); }); @@ -77,8 +77,8 @@ describe('GET /api/v1/room/:room_selector', () => { temperature: 28.88888888888889, unit: 'celsius', }, - created_at: '2019-02-12T07:49:07.556Z', - updated_at: '2019-02-12T07:49:07.556Z', + createdAt: '2019-02-12T07:49:07.556Z', + updatedAt: '2019-02-12T07:49:07.556Z', }); }); }); diff --git a/server/test/controllers/scene/scene.test.js b/server/test/controllers/scene/scene.test.js index e00196e1b5..6730de1393 100644 --- a/server/test/controllers/scene/scene.test.js +++ b/server/test/controllers/scene/scene.test.js @@ -44,7 +44,7 @@ describe('GET /api/v1/scene', () => { icon: 'fe fe-bell', selector: 'test-scene', last_executed: null, - updated_at: '2019-02-12T07:49:07.556Z', + updatedAt: '2019-02-12T07:49:07.556Z', }, ]); }); diff --git a/server/test/controllers/user/user.get.test.js b/server/test/controllers/user/user.get.test.js index a5577567d8..400f2dab71 100644 --- a/server/test/controllers/user/user.get.test.js +++ b/server/test/controllers/user/user.get.test.js @@ -54,8 +54,8 @@ describe('GET /api/v1/user', () => { selector: 'pepper-house', latitude: null, longitude: null, - created_at: '2019-02-12T07:49:07.556Z', - updated_at: '2019-02-12T07:49:07.556Z', + createdAt: '2019-02-12T07:49:07.556Z', + updatedAt: '2019-02-12T07:49:07.556Z', }, }, ]); diff --git a/server/test/controllers/user/user.getBySelector.test.js b/server/test/controllers/user/user.getBySelector.test.js index a08a290b7d..8d59fdaae8 100644 --- a/server/test/controllers/user/user.getBySelector.test.js +++ b/server/test/controllers/user/user.getBySelector.test.js @@ -28,8 +28,8 @@ describe('GET /api/v1/user/:user_selector', () => { last_location_changed: null, current_house_id: null, last_house_changed: null, - created_at: '2019-02-12T07:49:07.556Z', - updated_at: '2019-02-12T07:49:07.556Z', + createdAt: '2019-02-12T07:49:07.556Z', + updatedAt: '2019-02-12T07:49:07.556Z', }); }); }); diff --git a/server/test/controllers/user/user.getMySelf.test.js b/server/test/controllers/user/user.getMySelf.test.js index 6098138e68..4e8c768700 100644 --- a/server/test/controllers/user/user.getMySelf.test.js +++ b/server/test/controllers/user/user.getMySelf.test.js @@ -18,8 +18,8 @@ describe('GET /api/v1/me', () => { temperature_unit_preference: 'celsius', language: 'en', role: 'admin', - created_at: '2019-02-12T07:49:07.556Z', - updated_at: '2019-02-12T07:49:07.556Z', + createdAt: '2019-02-12T07:49:07.556Z', + updatedAt: '2019-02-12T07:49:07.556Z', }); }); }); diff --git a/server/test/controllers/user/user.login.test.js b/server/test/controllers/user/user.login.test.js index 5716e72e84..dd04463d7c 100644 --- a/server/test/controllers/user/user.login.test.js +++ b/server/test/controllers/user/user.login.test.js @@ -20,8 +20,8 @@ describe('POST /api/v1/login', () => { language: 'en', birthdate: '12/12/1990', role: 'admin', - created_at: '2019-02-12T07:49:07.556Z', - updated_at: '2019-02-12T07:49:07.556Z', + createdAt: '2019-02-12T07:49:07.556Z', + updatedAt: '2019-02-12T07:49:07.556Z', refresh_token: res.body.refresh_token, access_token: res.body.access_token, session_id: res.body.session_id, diff --git a/server/test/controllers/weather/weather.test.js b/server/test/controllers/weather/weather.test.js index f7e69a5c0e..4e8c6e41fb 100644 --- a/server/test/controllers/weather/weather.test.js +++ b/server/test/controllers/weather/weather.test.js @@ -54,8 +54,8 @@ describe('GET /api/v1/house/:selector/weather', () => { selector: 'test-house', latitude: 12, longitude: 12, - created_at: '2019-02-12T07:49:07.556Z', - updated_at: '2019-02-12T07:49:07.556Z', + createdAt: '2019-02-12T07:49:07.556Z', + updatedAt: '2019-02-12T07:49:07.556Z', }, options: { latitude: 12, longitude: 12, language: 'en' }, }); diff --git a/server/test/lib/calendar/calendar.event.test.js b/server/test/lib/calendar/calendar.event.test.js index 20ef97f2b1..229cd5eb49 100644 --- a/server/test/lib/calendar/calendar.event.test.js +++ b/server/test/lib/calendar/calendar.event.test.js @@ -68,8 +68,8 @@ describe('calendar.getEvents', () => { end: new Date('2019-02-12T08:49:07.556Z'), url: '/remote.php/dav/calendars/tony/personal/eee42d70-24f2-4c18-949d-822f3f72594c.ics', full_day: false, - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), calendar: { name: 'Test Calendar', selector: 'test-calendar', @@ -93,8 +93,8 @@ describe('calendar.getEvents', () => { end: new Date('2019-02-12T08:49:07.556Z'), url: '/remote.php/dav/calendars/tony/personal/eee42d70-24f2-4c18-949d-822f3f72594c.ics', full_day: false, - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), calendar: { name: 'Test Calendar', selector: 'test-calendar', @@ -118,8 +118,8 @@ describe('calendar.getEvents', () => { end: new Date('2019-03-12T08:49:07.556Z'), url: '/remote.php/dav/calendars/tony/personal/47e754ac-bcef-4b53-ba5b-29dfb588e196.ics', full_day: false, - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), calendar: { name: 'Test Calendar', selector: 'test-calendar', @@ -143,8 +143,8 @@ describe('calendar.getEvents', () => { end: new Date('2019-03-12T08:49:07.556Z'), url: '/remote.php/dav/calendars/tony/personal/47e754ac-bcef-4b53-ba5b-29dfb588e196.ics', full_day: false, - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), calendar: { name: 'Test Calendar', selector: 'test-calendar', @@ -168,8 +168,8 @@ describe('calendar.getEvents', () => { end: new Date('2019-02-12T08:49:07.556Z'), url: '/remote.php/dav/calendars/tony/personal/eee42d70-24f2-4c18-949d-822f3f72594c.ics', full_day: false, - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), calendar: { name: 'Test Calendar', selector: 'test-calendar', @@ -186,8 +186,8 @@ describe('calendar.getEvents', () => { end: new Date('2019-03-12T08:49:07.556Z'), url: '/remote.php/dav/calendars/tony/personal/47e754ac-bcef-4b53-ba5b-29dfb588e196.ics', full_day: false, - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), calendar: { name: 'Test Calendar', selector: 'test-calendar', diff --git a/server/test/lib/calendar/calendar.test.js b/server/test/lib/calendar/calendar.test.js index 7ed826078d..328f6349f6 100644 --- a/server/test/lib/calendar/calendar.test.js +++ b/server/test/lib/calendar/calendar.test.js @@ -75,8 +75,8 @@ describe('calendar.get', () => { notify: false, ctag: null, sync_token: null, - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), }, ]); }); diff --git a/server/test/lib/dashboard/dashboard.test.js b/server/test/lib/dashboard/dashboard.test.js index c4b0624b53..77352263c8 100644 --- a/server/test/lib/dashboard/dashboard.test.js +++ b/server/test/lib/dashboard/dashboard.test.js @@ -53,7 +53,7 @@ describe('dashboard.get', () => { name: 'Test dashboard', type: 'main', selector: 'test-dashboard', - updated_at: '2019-02-12 07:49:07.556 +00:00', + updatedAt: '2019-02-12 07:49:07.556 +00:00', }, ]); }); diff --git a/server/test/lib/device/device.create.test.js b/server/test/lib/device/device.create.test.js index 9124cdb107..4b6d1feabc 100644 --- a/server/test/lib/device/device.create.test.js +++ b/server/test/lib/device/device.create.test.js @@ -33,8 +33,8 @@ describe('Device', () => { name: 'TEST_PARAM', value: '10', device_id: '7f85c2f8-86cc-4600-84db-6c074dadb4e8', - created_at: '2019-02-12 07:49:07.556 +00:00', - updated_at: '2019-02-12 07:49:07.556 +00:00', + createdAt: '2019-02-12 07:49:07.556 +00:00', + updatedAt: '2019-02-12 07:49:07.556 +00:00', }, ], }); @@ -47,16 +47,16 @@ describe('Device', () => { external_id: 'test-device-external', service_id: 'a810b8db-6d04-4697-bed3-c4b72c996279', room_id: '2398c689-8b47-43cc-ad32-e98d9be098b5', - created_at: '2019-02-12 07:49:07.556 +00:00', - updated_at: '2019-02-12 07:49:07.556 +00:00', + createdAt: '2019-02-12 07:49:07.556 +00:00', + updatedAt: '2019-02-12 07:49:07.556 +00:00', params: [ { id: 'c24b1f96-69d7-4e6e-aa44-f14406694c59', name: 'TEST_PARAM', value: 'UPDATED_VALUE', device_id: '7f85c2f8-86cc-4600-84db-6c074dadb4e8', - created_at: '2019-02-12 07:49:07.556 +00:00', - updated_at: '2019-02-12 07:49:07.556 +00:00', + createdAt: '2019-02-12 07:49:07.556 +00:00', + updatedAt: '2019-02-12 07:49:07.556 +00:00', }, ], }); @@ -81,8 +81,8 @@ describe('Device', () => { external_id: 'test-device-external', service_id: 'a810b8db-6d04-4697-bed3-c4b72c996279', room_id: '2398c689-8b47-43cc-ad32-e98d9be098b5', - created_at: '2019-02-12 07:49:07.556 +00:00', - updated_at: '2019-02-12 07:49:07.556 +00:00', + createdAt: '2019-02-12 07:49:07.556 +00:00', + updatedAt: '2019-02-12 07:49:07.556 +00:00', features: [ { name: 'New device feature', @@ -133,8 +133,8 @@ describe('Device', () => { last_value_changed: null, last_value_string: null, unit: null, - created_at: newDevice.features[0] && newDevice.features[0].created_at, - updated_at: newDevice.features[0] && newDevice.features[0].updated_at, + createdAt: newDevice.features[0] && newDevice.features[0].createdAt, + updatedAt: newDevice.features[0] && newDevice.features[0].updatedAt, }, ]); }); @@ -150,8 +150,8 @@ describe('Device', () => { name: 'TEST_PARAM', value: '10', device_id: '7f85c2f8-86cc-4600-84db-6c074dadb4e8', - created_at: '2019-02-12 07:49:07.556 +00:00', - updated_at: '2019-02-12 07:49:07.556 +00:00', + createdAt: '2019-02-12 07:49:07.556 +00:00', + updatedAt: '2019-02-12 07:49:07.556 +00:00', }, ], }); @@ -166,8 +166,8 @@ describe('Device', () => { poll_frequency: 60000, service_id: 'a810b8db-6d04-4697-bed3-c4b72c996279', room_id: '2398c689-8b47-43cc-ad32-e98d9be098b5', - created_at: '2019-02-12 07:49:07.556 +00:00', - updated_at: '2019-02-12 07:49:07.556 +00:00', + createdAt: '2019-02-12 07:49:07.556 +00:00', + updatedAt: '2019-02-12 07:49:07.556 +00:00', }); await device.create({ id: '7f85c2f8-86cc-4600-84db-6c074dadb4e8', @@ -178,8 +178,8 @@ describe('Device', () => { poll_frequency: 30000, service_id: 'a810b8db-6d04-4697-bed3-c4b72c996279', room_id: '2398c689-8b47-43cc-ad32-e98d9be098b5', - created_at: '2019-02-12 07:49:07.556 +00:00', - updated_at: '2019-02-12 07:49:07.556 +00:00', + createdAt: '2019-02-12 07:49:07.556 +00:00', + updatedAt: '2019-02-12 07:49:07.556 +00:00', }); }); it('should update device and delete params/features', async () => { @@ -194,8 +194,8 @@ describe('Device', () => { name: 'TEST_PARAM', value: '10', device_id: '7f85c2f8-86cc-4600-84db-6c074dadb4e8', - created_at: '2019-02-12 07:49:07.556 +00:00', - updated_at: '2019-02-12 07:49:07.556 +00:00', + createdAt: '2019-02-12 07:49:07.556 +00:00', + updatedAt: '2019-02-12 07:49:07.556 +00:00', }, ], }); @@ -208,8 +208,8 @@ describe('Device', () => { external_id: 'test-device-external', service_id: 'a810b8db-6d04-4697-bed3-c4b72c996279', room_id: '2398c689-8b47-43cc-ad32-e98d9be098b5', - created_at: '2019-02-12 07:49:07.556 +00:00', - updated_at: '2019-02-12 07:49:07.556 +00:00', + createdAt: '2019-02-12 07:49:07.556 +00:00', + updatedAt: '2019-02-12 07:49:07.556 +00:00', params: [], }); expect(newDevice).to.have.property('name', 'RENAMED_DEVICE'); diff --git a/server/test/lib/device/device.newStateEvent.test.js b/server/test/lib/device/device.newStateEvent.test.js index ba9a037b83..fdf02f8353 100644 --- a/server/test/lib/device/device.newStateEvent.test.js +++ b/server/test/lib/device/device.newStateEvent.test.js @@ -21,8 +21,8 @@ describe('Device', () => { last_value: 0, last_value_changed: '2019-02-12 07:49:07.556 +00:00', device_id: '7f85c2f8-86cc-4600-84db-6c074dadb4e8', - created_at: '2019-02-12 07:49:07.556 +00:00', - updated_at: '2019-02-12 07:49:07.556 +00:00', + createdAt: '2019-02-12 07:49:07.556 +00:00', + updatedAt: '2019-02-12 07:49:07.556 +00:00', }); const device = new Device(event, {}, stateManager); await device.newStateEvent({ device_feature_external_id: 'hue:binary:1', state: 12 }); diff --git a/server/test/lib/gateway/GladysGatewayClientMock.test.js b/server/test/lib/gateway/GladysGatewayClientMock.test.js index f3e2b75f94..1d7252ebb1 100644 --- a/server/test/lib/gateway/GladysGatewayClientMock.test.js +++ b/server/test/lib/gateway/GladysGatewayClientMock.test.js @@ -27,8 +27,8 @@ const GladysGatewayClientMock = function GladysGatewayClientMock() { account_id: 'b2d23f66-487d-493f-8acb-9c8adb400def', path: 'http://backup-url', size: 1000, - created_at: '2018-10-16T02:21:25.901Z', - updated_at: '2018-10-16T02:21:25.901Z', + createdAt: '2018-10-16T02:21:25.901Z', + updatedAt: '2018-10-16T02:21:25.901Z', is_deleted: false, }, ]), @@ -42,7 +42,7 @@ const GladysGatewayClientMock = function GladysGatewayClientMock() { }, getLatestGladysVersion: fake.resolves({ name: 'v4.0.0-alpha', - created_at: '2018-10-16T02:21:25.901Z', + createdAt: '2018-10-16T02:21:25.901Z', }), disconnect: fake.returns(null), newEventInstance: fake.returns(null), diff --git a/server/test/lib/gateway/gateway.test.js b/server/test/lib/gateway/gateway.test.js index 5a886e722b..f0666baf7b 100644 --- a/server/test/lib/gateway/gateway.test.js +++ b/server/test/lib/gateway/gateway.test.js @@ -110,8 +110,8 @@ describe('gateway', () => { account_id: 'b2d23f66-487d-493f-8acb-9c8adb400def', path: 'http://backup-url', size: 1000, - created_at: '2018-10-16T02:21:25.901Z', - updated_at: '2018-10-16T02:21:25.901Z', + createdAt: '2018-10-16T02:21:25.901Z', + updatedAt: '2018-10-16T02:21:25.901Z', is_deleted: false, }, ]); @@ -151,7 +151,7 @@ describe('gateway', () => { const gateway = new Gateway(variable, event, system, sequelize, config); const version = await gateway.getLatestGladysVersion(); expect(version).to.have.property('name'); - expect(version).to.have.property('created_at'); + expect(version).to.have.property('createdAt'); }); }); diff --git a/server/test/lib/house/house.test.js b/server/test/lib/house/house.test.js index 4d6f5d3bab..d2a786ca0f 100644 --- a/server/test/lib/house/house.test.js +++ b/server/test/lib/house/house.test.js @@ -71,8 +71,8 @@ describe('house.get', () => { selector: 'pepper-house', latitude: null, longitude: null, - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), }, { id: 'a741dfa6-24de-4b46-afc7-370772f068d5', @@ -80,8 +80,8 @@ describe('house.get', () => { selector: 'test-house', latitude: 12, longitude: 12, - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), }, ]); }); @@ -105,8 +105,8 @@ describe('house.getRooms', () => { house_id: 'a741dfa6-24de-4b46-afc7-370772f068d5', name: 'Test room', selector: 'test-room', - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), }, ]); }); @@ -128,7 +128,7 @@ describe('house.userSeen', () => { email: 'demo@demo.com', current_house_id: 'a741dfa6-24de-4b46-afc7-370772f068d5', last_house_changed: user.last_house_changed, - updated_at: user.updated_at, + updatedAt: user.updatedAt, }); assert.calledWith(event.emit, EVENTS.USER_PRESENCE.BACK_HOME, user); }); @@ -171,7 +171,7 @@ describe('house.userLeft', () => { email: 'demo@demo.com', current_house_id: null, last_house_changed: user.last_house_changed, - updated_at: user.updated_at, + updatedAt: user.updatedAt, }); assert.calledWith(userLeftEvent.emit, EVENTS.USER_PRESENCE.LEFT_HOME, user); }); @@ -220,8 +220,8 @@ describe('house.getBySelector', () => { selector: 'test-house', latitude: 12, longitude: 12, - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), }); }); it('should return not found', async () => { diff --git a/server/test/lib/location/location.test.js b/server/test/lib/location/location.test.js index af0726d77d..40f51ce94d 100644 --- a/server/test/lib/location/location.test.js +++ b/server/test/lib/location/location.test.js @@ -19,8 +19,8 @@ describe('location.create', () => { latitude: 12, longitude: 12, user_id: '0cd30aef-9c4e-4a23-88e3-3547971296e5', - updated_at: newLocation.updated_at, - created_at: newLocation.created_at, + updatedAt: newLocation.updatedAt, + createdAt: newLocation.createdAt, }); }); // this test was added because we add a performance problem with this function. diff --git a/server/test/lib/message/message.get.test.js b/server/test/lib/message/message.get.test.js index 7f277fe482..3d86589227 100644 --- a/server/test/lib/message/message.get.test.js +++ b/server/test/lib/message/message.get.test.js @@ -17,7 +17,7 @@ describe('message.get', () => { file: null, text: 'What time is it ?', is_read: true, - created_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), }, ]); }); diff --git a/server/test/lib/room/room.test.js b/server/test/lib/room/room.test.js index d00f1b4a78..0605c18013 100644 --- a/server/test/lib/room/room.test.js +++ b/server/test/lib/room/room.test.js @@ -90,8 +90,8 @@ describe('room.getBySelector', () => { house_id: 'a741dfa6-24de-4b46-afc7-370772f068d5', name: 'Test room', selector: 'test-room', - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), }); }); it('should get a room by selector with devices', async () => { @@ -103,8 +103,8 @@ describe('room.getBySelector', () => { house_id: 'a741dfa6-24de-4b46-afc7-370772f068d5', name: 'Test room', selector: 'test-room', - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), devices: roomFound.devices, }); roomFound.devices.forEach((device) => { @@ -155,8 +155,8 @@ describe('room.get', () => { expect(oneDevice).to.have.property('features'); expect(oneDevice).not.to.have.property('id'); expect(oneDevice).not.to.have.property('room_id'); - expect(oneDevice).not.to.have.property('created_at'); - expect(oneDevice).not.to.have.property('updated_at'); + expect(oneDevice).not.to.have.property('createdAt'); + expect(oneDevice).not.to.have.property('updatedAt'); oneDevice.features.forEach((oneFeature) => { expect(oneFeature).to.have.property('last_value'); expect(oneFeature).to.have.property('last_value_changed'); @@ -166,8 +166,8 @@ describe('room.get', () => { expect(oneFeature).to.have.property('max'); expect(oneFeature).not.to.have.property('id'); expect(oneFeature).not.to.have.property('device_id'); - expect(oneFeature).not.to.have.property('created_at'); - expect(oneFeature).not.to.have.property('updated_at'); + expect(oneFeature).not.to.have.property('createdAt'); + expect(oneFeature).not.to.have.property('updatedAt'); }); }); }); diff --git a/server/test/lib/scene/scene.get.test.js b/server/test/lib/scene/scene.get.test.js index 887895bc58..96b27725ae 100644 --- a/server/test/lib/scene/scene.get.test.js +++ b/server/test/lib/scene/scene.get.test.js @@ -13,7 +13,7 @@ describe('SceneManager.get', () => { expect(oneScene).to.have.property('name'); expect(oneScene).to.have.property('selector'); expect(oneScene).not.to.have.property('actions'); - expect(oneScene).to.have.property('updated_at'); + expect(oneScene).to.have.property('updatedAt'); expect(oneScene).to.have.property('last_executed'); }); }); @@ -30,7 +30,7 @@ describe('SceneManager.get', () => { icon: 'fe fe-bell', selector: 'test-scene', last_executed: null, - updated_at: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), }, ]); }); diff --git a/server/test/lib/system/system.getContainers.test.js b/server/test/lib/system/system.getContainers.test.js index abe6f692b4..86f5518b40 100644 --- a/server/test/lib/system/system.getContainers.test.js +++ b/server/test/lib/system/system.getContainers.test.js @@ -61,7 +61,7 @@ describe('system.getContainers', () => { expect(container).to.have.property('name'); expect(container).to.have.property('state'); expect(container).to.have.property('id'); - expect(container).to.have.property('created_at'); + expect(container).to.have.property('createdAt'); }); assert.calledOnce(system.dockerode.listContainers); @@ -82,7 +82,7 @@ describe('system.getContainers', () => { expect(container).to.have.property('name'); expect(container).to.have.property('state'); expect(container).to.have.property('id'); - expect(container).to.have.property('created_at'); + expect(container).to.have.property('createdAt'); }); assert.calledOnce(system.dockerode.listContainers); diff --git a/server/test/lib/user/user.get.test.js b/server/test/lib/user/user.get.test.js index 42e9c4bfa5..101735c463 100644 --- a/server/test/lib/user/user.get.test.js +++ b/server/test/lib/user/user.get.test.js @@ -27,8 +27,8 @@ describe('user.get', () => { selector: 'pepper-house', latitude: null, longitude: null, - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), }, }, ]); diff --git a/server/test/lib/user/user.getById.test.js b/server/test/lib/user/user.getById.test.js index ae086a38e0..bce0073e70 100644 --- a/server/test/lib/user/user.getById.test.js +++ b/server/test/lib/user/user.getById.test.js @@ -16,8 +16,8 @@ describe('user.getById', () => { birthdate: '12/12/1990', temperature_unit_preference: 'celsius', role: 'admin', - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), }); }); it('should throw notFound error', async () => { diff --git a/server/test/lib/user/user.getBySelector.test.js b/server/test/lib/user/user.getBySelector.test.js index 92c455718a..0e5166fd41 100644 --- a/server/test/lib/user/user.getBySelector.test.js +++ b/server/test/lib/user/user.getBySelector.test.js @@ -34,8 +34,8 @@ describe('user.getBySelector', () => { last_location_changed: null, current_house_id: '6295ad8b-b655-4422-9e6d-b4612da5d55f', last_house_changed: new Date('2019-02-12T07:49:07.556Z'), - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: new Date('2019-02-12T07:49:07.556Z'), + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: new Date('2019-02-12T07:49:07.556Z'), }); }); it('should destroy return not found', async () => { diff --git a/server/test/lib/user/user.updateBySelector.test.js b/server/test/lib/user/user.updateBySelector.test.js index 5765efdd3e..88690df0e6 100644 --- a/server/test/lib/user/user.updateBySelector.test.js +++ b/server/test/lib/user/user.updateBySelector.test.js @@ -37,8 +37,8 @@ describe('user.updateBySelector', () => { last_location_changed: null, current_house_id: '6295ad8b-b655-4422-9e6d-b4612da5d55f', last_house_changed: new Date('2019-02-12T07:49:07.556Z'), - created_at: new Date('2019-02-12T07:49:07.556Z'), - updated_at: updatedUser.updated_at, + createdAt: new Date('2019-02-12T07:49:07.556Z'), + updatedAt: updatedUser.updatedAt, }); }); it('should update user password', async () => { diff --git a/server/test/services/caldav/lib/calendar/syncUserCalendars.test.js b/server/test/services/caldav/lib/calendar/syncUserCalendars.test.js index f7c00ae068..54dbc5029f 100644 --- a/server/test/services/caldav/lib/calendar/syncUserCalendars.test.js +++ b/server/test/services/caldav/lib/calendar/syncUserCalendars.test.js @@ -125,8 +125,8 @@ describe('CalDAV sync', () => { sync_token: 'sync-token-1', sync: '1', notify: '0', - created_at: '2020-02-11 21:04:51.318 +00:00', - updated_at: '2020-02-11 21:04:51.318 +00:00', + createdAt: '2020-02-11 21:04:51.318 +00:00', + updatedAt: '2020-02-11 21:04:51.318 +00:00', }); sync.requestChanges @@ -209,8 +209,8 @@ describe('CalDAV sync', () => { end: '2018-06-09 00:00:00.000 +00:00', url: 'https://caldav.host.com/home/personal/event-1.ics', full_day: '1', - created_at: '2020-02-11 21:04:56.090 +00:00', - updated_at: '2020-02-11 21:04:56.090 +00:00', + createdAt: '2020-02-11 21:04:56.090 +00:00', + updatedAt: '2020-02-11 21:04:56.090 +00:00', }, }) .onSecondCall() @@ -227,8 +227,8 @@ describe('CalDAV sync', () => { end: '2018-06-09 00:00:00.000 +00:00', url: 'https://caldav.host.com/home/personal/event-1.ics', full_day: '1', - created_at: '2020-02-11 21:04:56.090 +00:00', - updated_at: '2020-02-11 21:04:56.090 +00:00', + createdAt: '2020-02-11 21:04:56.090 +00:00', + updatedAt: '2020-02-11 21:04:56.090 +00:00', }); await sync.syncUserCalendars(userId); @@ -325,8 +325,8 @@ describe('CalDAV sync', () => { sync_token: 'sync-token-1', sync: '1', notify: '0', - created_at: '2020-02-11 21:04:51.318 +00:00', - updated_at: '2020-02-11 21:04:51.318 +00:00', + createdAt: '2020-02-11 21:04:51.318 +00:00', + updatedAt: '2020-02-11 21:04:51.318 +00:00', }); sync.requestChanges.rejects(); @@ -376,8 +376,8 @@ describe('CalDAV sync', () => { sync_token: 'sync-token-1', sync: '1', notify: '0', - created_at: '2020-02-11 21:04:51.318 +00:00', - updated_at: '2020-02-11 21:04:51.318 +00:00', + createdAt: '2020-02-11 21:04:51.318 +00:00', + updatedAt: '2020-02-11 21:04:51.318 +00:00', }); sync.requestChanges.resolves([ diff --git a/server/test/services/tp-link/devices.json b/server/test/services/tp-link/devices.json index 77658e7a0a..1420590b07 100644 --- a/server/test/services/tp-link/devices.json +++ b/server/test/services/tp-link/devices.json @@ -41,8 +41,8 @@ "external_id": "tp-link:1235", "should_poll": true, "poll_frequency": 60000, - "created_at": "2020-11-21T13:55:56.556Z", - "updated_at": "2020-11-21T13:56:00.824Z", + "createdAt": "2020-11-21T13:55:56.556Z", + "updatedAt": "2020-11-21T13:56:00.824Z", "features": [ { "id": "34111749-eaa7-4540-8a24-88997a8cf27b", @@ -61,8 +61,8 @@ "last_value": 0, "last_value_string": null, "last_value_changed": "2020-11-21T13:56:52.059Z", - "created_at": "2020-11-21T13:55:56.563Z", - "updated_at": "2020-11-21T13:56:52.061Z" + "createdAt": "2020-11-21T13:55:56.563Z", + "updatedAt": "2020-11-21T13:56:52.061Z" } ], "params": [ @@ -87,8 +87,8 @@ "version": "0.1.0", "has_message_feature": false, "status": "RUNNING", - "created_at": "2020-11-20T18:08:00.226Z", - "updated_at": "2020-11-24T07:35:17.020Z" + "createdAt": "2020-11-20T18:08:00.226Z", + "updatedAt": "2020-11-24T07:35:17.020Z" } } ]