Skip to content

Commit

Permalink
Merge pull request #26 from flossbank/get-sessions
Browse files Browse the repository at this point in the history
Get sessions
  • Loading branch information
stripedpajamas authored Jun 30, 2020
2 parents 9f78610 + 52fcb25 commit 0e3a2ab
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
9 changes: 9 additions & 0 deletions api/user/get-sessions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const S = require('fluent-schema')
const { UserSessionDataPublic } = require('../../types/User')
const { Base200WithData } = require('../../common/reply')

module.exports = {
response: {
200: Base200WithData('userSessionData', UserSessionDataPublic)
}
}
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ module.exports = {
deleteDonation: require('./api/user/delete-donation'),
getInstalledPackages: require('./api/user/get-installed-packages'),
getDonationInfo: require('./api/user/get-donation-info'),
getSessions: require('./api/user/get-sessions'),
resumeSession: require('./api/user/resume')
},
stripe: {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flossbank/schema",
"version": "1.16.0",
"version": "1.17.0",
"devDependencies": {
"standard": "^14.3.1"
},
Expand Down
10 changes: 9 additions & 1 deletion types/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ const UserOptOutRequest = S.object()
S.boolean().required()
)

const UserSessionDataPublic = S.object()
.description('Properties regarding user session activity')
.prop(
'sessionCount',
S.number().description('Number of sessions started by user')
)

module.exports = {
UserPrivate,
UserKeyPair,
Expand All @@ -108,5 +115,6 @@ module.exports = {
UserPublic,
UserRegistration,
UserOptOutRequest,
UserBillingInfoPublic
UserBillingInfoPublic,
UserSessionDataPublic
}

0 comments on commit 0e3a2ab

Please sign in to comment.