Skip to content

Commit 37da4cb

Browse files
committed
Add v1 /users/{id}/getRecentActivity docs
1 parent 9dac752 commit 37da4cb

File tree

3 files changed

+156
-26
lines changed

3 files changed

+156
-26
lines changed

public/swagger/v1.json

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3661,6 +3661,82 @@
36613661
"deprecated": false
36623662
}
36633663
},
3664+
"/users/{id}/getRecentActivity": {
3665+
"get": {
3666+
"tags": [
3667+
"user"
3668+
],
3669+
"parameters": [
3670+
{
3671+
"name": "id",
3672+
"in": "path",
3673+
"description": "user id",
3674+
"required": true,
3675+
"schema": {
3676+
"type": "string",
3677+
"format": "JSON"
3678+
}
3679+
},
3680+
{
3681+
"name": "dateRange",
3682+
"in": "query",
3683+
"required": true,
3684+
"schema": {
3685+
"type": "string",
3686+
"format": "JSON"
3687+
}
3688+
}
3689+
],
3690+
"responses": {
3691+
"200": {
3692+
"description": "Request was successful",
3693+
"content": {
3694+
"application/json": {
3695+
"schema": {
3696+
"type": "array",
3697+
"items": {
3698+
"$ref": "#/components/schemas/x-any"
3699+
}
3700+
}
3701+
},
3702+
"application/xml": {
3703+
"schema": {
3704+
"type": "array",
3705+
"items": {
3706+
"$ref": "#/components/schemas/x-any"
3707+
}
3708+
}
3709+
},
3710+
"text/xml": {
3711+
"schema": {
3712+
"type": "array",
3713+
"items": {
3714+
"$ref": "#/components/schemas/x-any"
3715+
}
3716+
}
3717+
},
3718+
"application/javascript": {
3719+
"schema": {
3720+
"type": "array",
3721+
"items": {
3722+
"$ref": "#/components/schemas/x-any"
3723+
}
3724+
}
3725+
},
3726+
"text/javascript": {
3727+
"schema": {
3728+
"type": "array",
3729+
"items": {
3730+
"$ref": "#/components/schemas/x-any"
3731+
}
3732+
}
3733+
}
3734+
}
3735+
}
3736+
},
3737+
"deprecated": false
3738+
}
3739+
},
36643740
"/reports/vehicle-summary": {
36653741
"post": {
36663742
"tags": [

swagger/v1-enums.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
export const notificationTriggerTypes = [
3+
'lowBat',
4+
'button',
5+
'expiresDaily',
6+
'expiresWeekly',
7+
'geofence',
8+
'newLoc',
9+
'newWakeLoc',
10+
'acc',
11+
'newReading',
12+
'speed',
13+
'distance',
14+
'alertMode',
15+
'temp',
16+
'temp_bme',
17+
'humidity',
18+
'pressure',
19+
'extAccel',
20+
'geoEntry',
21+
'proximity',
22+
// 'ultraLevel',
23+
// 'newAvailLoc',
24+
// 'newMsg',
25+
// 'lightLevel'
26+
];

swagger/v1-overrides.ts

Lines changed: 54 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { notificationTriggerTypes } from "./v1-enums.js";
2+
13
export const v1SummaryOverrides = {
24
'post-users-login': 'Login',
35
// points
@@ -40,7 +42,8 @@ export const v1SummaryOverrides = {
4042
'get-devices-id-activateOnResellerPlan': 'Activate device on reseller plan',
4143
'get-devices-id-setNtripSettings': 'Set the NTRIP settings for a device.',
4244
'post-reports-activity': 'Device Activity',
43-
'post-reports-vehicle-summary': 'Vehicle Summary'
45+
'post-reports-vehicle-summary': 'Vehicle Summary',
46+
'get-users-id-getRecentActivity': 'Get recent activity for a user'
4447
};
4548

4649
export const v1DescriptionOverrides = {
@@ -62,6 +65,7 @@ Use [filtering](/apis/v1/filtering) to get a specific [type](/terminology/readin
6265
`Configure SQS Notifications for a device.
6366
6467
There is a [full guide](/guides/notifications-setup-sqs) written for this endpoint.`,
68+
'get-users-id-getRecentActivity': 'Gets recent activity for a user, which focuses around notifications that have been triggered.',
6569
};
6670

6771
export const v1Deprecated = [
@@ -113,6 +117,7 @@ export const v1ReTag = {
113117
'delete-devices-id-readings-fk': 'readings',
114118
'get-devices-id-readings-fk': 'readings',
115119
'get-devices-id-readings': 'readings',
120+
'get-users-id-getRecentActivity': 'notifications',
116121
'get-devices-id-notificationTriggers-fk': 'notifications',
117122
'delete-devices-id-notificationTriggers-fk': 'notifications',
118123
'put-devices-id-notificationTriggers-fk': 'notifications',
@@ -157,6 +162,10 @@ export const V1ParamExamples = {
157162
'sqsArn': 'arn:aws:sqs:us-east-1:123456789012:my-queue',
158163
// 'types': [ 'newLoc', 'newReading' ],
159164
},
165+
'get-users-id-getRecentActivity': {
166+
'id': '5678',
167+
'dateRange': '[1756249200000,1756388711959]',
168+
},
160169
};
161170

162171
export const V1ResponseExamples = {
@@ -303,6 +312,49 @@ export const V1ResponseExamples = {
303312
}
304313
}
305314
}
315+
},
316+
'get-users-id-getRecentActivity': {
317+
'200': {
318+
'application/json': {
319+
schema: {
320+
type: 'array',
321+
items: {
322+
type: 'object',
323+
properties: {
324+
created: { type: 'string', format: 'date-time' },
325+
params: {
326+
type: 'object',
327+
properties: {
328+
type: {
329+
type: 'string',
330+
enum: notificationTriggerTypes
331+
},
332+
subtype: { type: 'string' },
333+
name: { type: 'string' },
334+
zones: {
335+
type: 'array',
336+
items: { type: 'string' }
337+
},
338+
message: { type: 'string' }
339+
}
340+
},
341+
deviceId: {
342+
type: 'number',
343+
description: 'The ID of the device that generated this activity.'
344+
},
345+
pointId: {
346+
type: 'number',
347+
description: 'Either a datapoint ID or a reading ID, depending on the type of activity.'
348+
},
349+
triggerId: {
350+
type: 'number',
351+
description: 'The ID of the notification trigger that caused this activity, if applicable.'
352+
}
353+
}
354+
}
355+
}
356+
}
357+
}
306358
}
307359
};
308360

@@ -342,31 +394,7 @@ export const V1ParamSchemaTypes = {
342394
export const V1SchemaPropertyOverrides = {
343395
'notificationTrigger': {
344396
'type': {
345-
enum: [
346-
'lowBat',
347-
'button',
348-
'expiresDaily',
349-
'expiresWeekly',
350-
'geofence',
351-
'newLoc',
352-
'newWakeLoc',
353-
'acc',
354-
'newReading',
355-
'speed',
356-
'distance',
357-
'alertMode',
358-
'temp',
359-
'temp_bme',
360-
'humidity',
361-
'pressure',
362-
'extAccel',
363-
'geoEntry',
364-
'proximity',
365-
// 'ultraLevel',
366-
// 'newAvailLoc',
367-
// 'newMsg',
368-
// 'lightLevel'
369-
]
397+
enum: notificationTriggerTypes,
370398
}
371399
}
372400
};

0 commit comments

Comments
 (0)