Skip to content

Commit

Permalink
Generate api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkvon committed Jan 16, 2024
1 parent 5feb676 commit 275629f
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 85 deletions.
39 changes: 14 additions & 25 deletions apidocs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"paths": {
"/inbox": {
"/init": {
"post": {
"description": "",
"responses": {
Expand All @@ -26,34 +26,13 @@
"schema": {
"type": "object",
"properties": {
"@context": {
"const": "https://www.w3.org/ns/activitystreams"
},
"@id": {
"type": "string"
},
"@type": {
"const": "Add"
},
"actor": {
"type": "string",
"format": "uri"
},
"object": {
"type": "string",
"format": "uri"
},
"target": {
"email": {
"type": "string",
"format": "email"
}
},
"required": [
"@context",
"@type",
"actor",
"object",
"target"
"email"
],
"additionalProperties": false
}
Expand Down Expand Up @@ -82,9 +61,19 @@
}
}
},
"/status": {
"/status/{webId}": {
"get": {
"description": "",
"parameters": [
{
"name": "webId",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"default": {
"description": ""
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@koa/bodyparser": "^5.0.0",
"@koa/cors": "^4.0.0",
"@koa/router": "^12.0.0",
"@ldhop/core": "^0.0.0-alpha.0",
"@ldhop/core": "^0.0.0-alpha.1",
"@solid/access-token-verifier": "^2.0.5",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
Expand Down
71 changes: 16 additions & 55 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,65 +24,26 @@ app.proxy = isBehindProxy
const router = new Router()

router
// .post(
// '/inbox',
// solidAuth,
// /*
// #swagger.requestBody = {
// required: true,
// content: {
// 'application/json': {
// schema: {
// type: 'object',
// properties: {
// '@context': { const: 'https://www.w3.org/ns/activitystreams' },
// '@id': { type: 'string' },
// '@type': { const: 'Add' },
// actor: { type: 'string', format: 'uri' },
// object: { type: 'string', format: 'uri' },
// target: { type: 'string', format: 'email' },
// },
// required: ['@context', '@type', 'actor', 'object', 'target'],
// additionalProperties: false,
// },
// },
// },
// }
// */
// validateBody({
// type: 'object',
// properties: {
// '@context': { const: 'https://www.w3.org/ns/activitystreams' },
// '@id': { type: 'string' },
// '@type': { const: 'Add' },
// actor: { type: 'string', format: 'uri' },
// object: { type: 'string', format: 'uri' },
// target: { type: 'string', format: 'email' },
// },
// required: ['@context', '@type', 'actor', 'object', 'target'],
// additionalProperties: false,
// }),
// initializeIntegration,
// )
.post(
'/init',
solidAuth,
authorizeGroups(allowedGroups),
// #swagger.requestBody = {
// required: true,
// content: {
// 'application/json': {
// schema: {
// type: 'object',
// properties: {
// email: { type: 'string', format: 'email' },
// },
// required: ['email'],
// additionalProperties: false,
// },
// },
// },
// }
/* #swagger.requestBody = {
required: true,
content: {
'application/json': {
schema: {
type: 'object',
properties: {
email: { type: 'string', format: 'email' },
},
required: ['email'],
additionalProperties: false,
},
},
},
}
*/
validateBody({
type: 'object',
properties: { email: { type: 'string', format: 'email' } },
Expand Down
14 changes: 10 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2541,12 +2541,13 @@
methods "^1.1.2"
path-to-regexp "^6.2.1"

"@ldhop/core@^0.0.0-alpha.0":
version "0.0.0-alpha.0"
resolved "https://registry.yarnpkg.com/@ldhop/core/-/core-0.0.0-alpha.0.tgz#4504a33b9a2cbf6199434391d606ecf14b31972b"
integrity sha512-XryHFesKAIO6AZPA3Z6jx71FwwtyiEt6ICd3/Xdar/sXPm/aT0qKqWAJthZZhbgW0r49X6NWs8NhT/GGYzEj3g==
"@ldhop/core@^0.0.0-alpha.1":
version "0.0.0-alpha.1"
resolved "https://registry.yarnpkg.com/@ldhop/core/-/core-0.0.0-alpha.1.tgz#c18ed9427cfd69dab55ab314d18305759d2d2dcb"
integrity sha512-64g79eUg2ev1KlZju0WgNeF5xZITO3WNdcaVb3sU/2jAI8mki89cQyY24AuoTWWcEl46FBZFEmmTDRORkWRd1Q==
dependencies:
n3 "^1.17.2"
utility-types "^3.10.0"

"@mapbox/node-pre-gyp@^1.0.0":
version "1.0.11"
Expand Down Expand Up @@ -8174,6 +8175,11 @@ util-deprecate@^1.0.1:
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==

utility-types@^3.10.0:
version "3.10.0"
resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.10.0.tgz#ea4148f9a741015f05ed74fd615e1d20e6bed82b"
integrity sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg==

[email protected]:
version "1.0.1"
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
Expand Down

0 comments on commit 275629f

Please sign in to comment.