Skip to content

Commit 2937621

Browse files
author
Sylvain Maucourt
committed
fixes compatibility with SDK7.1
1 parent 204b659 commit 2937621

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ Keep-Alive: timeout=5
165165
X-Powered-By: Express
166166
167167
{
168-
"herowId": "rtegflkgt"
168+
"herowId": "rtegflkgt",
169+
"modifiedDate": 0
169170
}
170171
```
171172

@@ -244,6 +245,7 @@ X-Powered-By: Express
244245
"zones": [
245246
{
246247
"access": {
248+
"id": "fdrlerAdfv",
247249
"address": "54 Rue de Paradis, 75010 Paris, France",
248250
"name": "HEROW"
249251
},

app.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ test('should send informations when adId is more than 10 characters and optins c
245245

246246
t.equal(response.statusCode, 200, 'with a status code 200')
247247
t.same(response.json(), {
248-
herowId: 'test'
248+
herowId: 'test',
249+
modifiedDate: 0
249250
}, 'with test as herowId')
250251
})
251252

data/data.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
{"zones:client:u09t":[
2929
{
3030
"access": {
31+
"id": "dfsflER",
3132
"address": "Juvisy-sur-Orge, France",
3233
"name": "HOME"
3334
},

routes/information.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ module.exports = async function (fastify, options) {
3939
200: {
4040
type: 'object',
4141
properties: {
42-
herowId: { type: 'string' }
42+
herowId: { type: 'string' },
43+
modifiedDate: { type: 'number' }
4344
}
4445
}
4546
}
@@ -50,7 +51,8 @@ module.exports = async function (fastify, options) {
5051
await fastify.redis.set('device:' + req.deviceId, JSON.stringify(req.body))
5152
await fastify.redis.expire('device:' + req.deviceId, expiration)
5253
res.send({
53-
herowId: herowId
54+
herowId: herowId,
55+
modifiedDate: 0
5456
})
5557
})
5658
}

routes/logs.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict'
22

3+
const crypto = require('crypto')
4+
35
module.exports = async function (fastify, options) {
46

57
fastify.post('/queue', {
@@ -25,9 +27,10 @@ module.exports = async function (fastify, options) {
2527
}
2628
}
2729
}, async (req, res) => {
30+
req.body.id = await crypto.randomBytes(10).toString('hex')
2831
req.body.type = "app_mobile"
2932
req.body.date = Date.now()
30-
req.body.herow_id = req.herowId
33+
req.body.data.herow_id = req.herowId
3134
req.body.data.sdk = req.client
3235
req.body.data.company = req.client
3336
req.body.data.db = req.client

0 commit comments

Comments
 (0)