Skip to content

Commit 275629f

Browse files
committed
Generate api docs
1 parent 5feb676 commit 275629f

File tree

4 files changed

+41
-85
lines changed

4 files changed

+41
-85
lines changed

apidocs/openapi.json

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212
],
1313
"paths": {
14-
"/inbox": {
14+
"/init": {
1515
"post": {
1616
"description": "",
1717
"responses": {
@@ -26,34 +26,13 @@
2626
"schema": {
2727
"type": "object",
2828
"properties": {
29-
"@context": {
30-
"const": "https://www.w3.org/ns/activitystreams"
31-
},
32-
"@id": {
33-
"type": "string"
34-
},
35-
"@type": {
36-
"const": "Add"
37-
},
38-
"actor": {
39-
"type": "string",
40-
"format": "uri"
41-
},
42-
"object": {
43-
"type": "string",
44-
"format": "uri"
45-
},
46-
"target": {
29+
"email": {
4730
"type": "string",
4831
"format": "email"
4932
}
5033
},
5134
"required": [
52-
"@context",
53-
"@type",
54-
"actor",
55-
"object",
56-
"target"
35+
"email"
5736
],
5837
"additionalProperties": false
5938
}
@@ -82,9 +61,19 @@
8261
}
8362
}
8463
},
85-
"/status": {
64+
"/status/{webId}": {
8665
"get": {
8766
"description": "",
67+
"parameters": [
68+
{
69+
"name": "webId",
70+
"in": "path",
71+
"required": true,
72+
"schema": {
73+
"type": "string"
74+
}
75+
}
76+
],
8877
"responses": {
8978
"default": {
9079
"description": ""

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@koa/bodyparser": "^5.0.0",
5454
"@koa/cors": "^4.0.0",
5555
"@koa/router": "^12.0.0",
56-
"@ldhop/core": "^0.0.0-alpha.0",
56+
"@ldhop/core": "^0.0.0-alpha.1",
5757
"@solid/access-token-verifier": "^2.0.5",
5858
"ajv": "^8.12.0",
5959
"ajv-formats": "^2.1.1",

src/app.ts

Lines changed: 16 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -24,65 +24,26 @@ app.proxy = isBehindProxy
2424
const router = new Router()
2525

2626
router
27-
// .post(
28-
// '/inbox',
29-
// solidAuth,
30-
// /*
31-
// #swagger.requestBody = {
32-
// required: true,
33-
// content: {
34-
// 'application/json': {
35-
// schema: {
36-
// type: 'object',
37-
// properties: {
38-
// '@context': { const: 'https://www.w3.org/ns/activitystreams' },
39-
// '@id': { type: 'string' },
40-
// '@type': { const: 'Add' },
41-
// actor: { type: 'string', format: 'uri' },
42-
// object: { type: 'string', format: 'uri' },
43-
// target: { type: 'string', format: 'email' },
44-
// },
45-
// required: ['@context', '@type', 'actor', 'object', 'target'],
46-
// additionalProperties: false,
47-
// },
48-
// },
49-
// },
50-
// }
51-
// */
52-
// validateBody({
53-
// type: 'object',
54-
// properties: {
55-
// '@context': { const: 'https://www.w3.org/ns/activitystreams' },
56-
// '@id': { type: 'string' },
57-
// '@type': { const: 'Add' },
58-
// actor: { type: 'string', format: 'uri' },
59-
// object: { type: 'string', format: 'uri' },
60-
// target: { type: 'string', format: 'email' },
61-
// },
62-
// required: ['@context', '@type', 'actor', 'object', 'target'],
63-
// additionalProperties: false,
64-
// }),
65-
// initializeIntegration,
66-
// )
6727
.post(
6828
'/init',
6929
solidAuth,
7030
authorizeGroups(allowedGroups),
71-
// #swagger.requestBody = {
72-
// required: true,
73-
// content: {
74-
// 'application/json': {
75-
// schema: {
76-
// type: 'object',
77-
// properties: {
78-
// email: { type: 'string', format: 'email' },
79-
// },
80-
// required: ['email'],
81-
// additionalProperties: false,
82-
// },
83-
// },
84-
// },
85-
// }
31+
/* #swagger.requestBody = {
32+
required: true,
33+
content: {
34+
'application/json': {
35+
schema: {
36+
type: 'object',
37+
properties: {
38+
email: { type: 'string', format: 'email' },
39+
},
40+
required: ['email'],
41+
additionalProperties: false,
42+
},
43+
},
44+
},
45+
}
46+
*/
8647
validateBody({
8748
type: 'object',
8849
properties: { email: { type: 'string', format: 'email' } },

yarn.lock

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,12 +2541,13 @@
25412541
methods "^1.1.2"
25422542
path-to-regexp "^6.2.1"
25432543

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

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

8178+
utility-types@^3.10.0:
8179+
version "3.10.0"
8180+
resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.10.0.tgz#ea4148f9a741015f05ed74fd615e1d20e6bed82b"
8181+
integrity sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg==
8182+
81778183
81788184
version "1.0.1"
81798185
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"

0 commit comments

Comments
 (0)