You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wiki/backend/api/pages.mjs

93 lines
1.7 KiB

/**
* Pages API Routes
*/
async function routes (app, options) {
app.get('/sites/:siteId/pages', {
schema: {
summary: 'List all pages',
tags: ['Pages'],
params: {
type: 'object',
properties: {
siteId: {
type: 'string',
format: 'uuid'
}
}
}
}
}, async (req, reply) => {
return []
})
app.get('/sites/:siteId/pages/:pageIdOrHash', {
schema: {
summary: 'List all pages',
tags: ['Pages'],
params: {
type: 'object',
properties: {
siteId: {
type: 'string',
format: 'uuid'
},
pageIdOrHash: {
type: 'string',
oneOf: [
{ format: 'uuid' },
{ pattern: '^[a-f0-9]+$' }
]
}
}
},
querystring: {
type: 'object',
properties: {
withContent: {
type: 'boolean',
default: false
}
}
}
}
}, async (req, reply) => {
return []
})
app.post('/sites/:siteId/pages/userPermissions', {
schema: {
summary: 'Get page user permissions',
tags: ['Pages'],
params: {
type: 'object',
properties: {
siteId: {
type: 'string',
format: 'uuid'
}
}
},
body: {
type: 'object',
required: ['path'],
properties: {
path: {
type: 'string',
minLength: 1,
maxLength: 255
}
},
examples: [
{
path: 'foo/bar'
}
]
}
}
}, async (req, reply) => {
return []
})
}
export default routes