'use strict'; function register(router, { queries }) { router.get('/me', { summary: 'The current user, their operators and POPs', tag: 'me', response: { $ref: 'Me' }, errors: ['unauthorized'] }, ({ user }) => queries.me(user.id)); router.get('/notifications', { summary: 'Notifications for this user (cursor: after = last seen id)', tag: 'me', query: { type: 'object', properties: { after: { type: 'integer', minimum: 0 }, limit: { type: 'integer', minimum: 1, maximum: 100 } } }, response: { $ref: 'NotificationList' }, errors: ['unauthorized', 'validation_failed'], }, ({ user, query }) => queries.notifications(user.id, query)); } module.exports = { register };