public commit

This commit is contained in:
dswbx
2024-11-16 12:01:47 +01:00
commit 90f80c4280
582 changed files with 49291 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
---
title: 'Login (password)'
openapi: 'POST /api/auth/password/login'
---

View File

@@ -0,0 +1,4 @@
---
title: 'Me'
openapi: 'GET /api/auth/me'
---

View File

@@ -0,0 +1,4 @@
---
title: 'Register (password)'
openapi: 'POST /api/auth/password/register'
---

View File

@@ -0,0 +1,4 @@
---
title: 'Strategies'
openapi: 'GET /api/auth/strategies'
---

View File

@@ -0,0 +1,4 @@
---
title: 'Create Entity'
openapi: 'POST /api/data/{entity}'
---

View File

@@ -0,0 +1,4 @@
---
title: 'Delete Entity'
openapi: 'DELETE /api/data/{entity}/{id}'
---

View File

@@ -0,0 +1,4 @@
---
title: 'Get Entity'
openapi: 'GET /api/data/{entity}/{id}'
---

View File

@@ -0,0 +1,4 @@
---
title: 'List Entity'
openapi: 'GET /api/data/{entity}'
---

View File

@@ -0,0 +1,4 @@
---
title: 'Update Entity'
openapi: 'PATCH /api/data/{entity}/{id}'
---

View File

@@ -0,0 +1,4 @@
---
title: 'Create Plant'
openapi: 'POST /plants'
---

View File

@@ -0,0 +1,4 @@
---
title: 'Delete Plant'
openapi: 'DELETE /plants/{id}'
---

View File

@@ -0,0 +1,4 @@
---
title: 'Get Plants'
openapi: 'GET /plants'
---

View File

@@ -0,0 +1,23 @@
---
title: 'Introduction'
description: 'Example section for showcasing your API endpoints'
---
<Warning>
You need to make sure to point your request to your API server.
</Warning>
<Note>
This section is a work in progress. Updates will be made soon.
</Note>
## Authentication
All API endpoints are authenticated using Bearer tokens and picked up from the specification file.
```json
"security": [
{
"bearerAuth": []
}
]
```

View File

@@ -0,0 +1,391 @@
{
"openapi": "3.1.0",
"info": { "title": "bknd API", "version": "0.0.0" },
"paths": {
"/api/system/ping": {
"get": {
"summary": "Ping",
"responses": {
"200": {
"description": "Pong",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"pong": { "default": true, "type": "boolean" }
},
"required": ["pong"]
}
}
}
}
},
"tags": ["system"]
}
},
"/api/system/config": {
"get": {
"summary": "Get config",
"responses": {
"200": {
"description": "Config",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"version": { "type": "number" },
"server": { "type": "object", "properties": {} },
"data": { "type": "object", "properties": {} },
"auth": { "type": "object", "properties": {} },
"flows": { "type": "object", "properties": {} },
"media": { "type": "object", "properties": {} }
},
"required": [
"version",
"server",
"data",
"auth",
"flows",
"media"
]
}
}
}
}
},
"tags": ["system"]
}
},
"/api/system/schema": {
"get": {
"summary": "Get config",
"responses": {
"200": {
"description": "Config",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"version": { "type": "number" },
"schema": {
"type": "object",
"properties": {
"server": { "type": "object", "properties": {} },
"data": { "type": "object", "properties": {} },
"auth": { "type": "object", "properties": {} },
"flows": { "type": "object", "properties": {} },
"media": { "type": "object", "properties": {} }
},
"required": ["server", "data", "auth", "flows", "media"]
}
},
"required": ["version", "schema"]
}
}
}
}
},
"tags": ["system"]
}
},
"/api/data/{entity}": {
"get": {
"summary": "List entities",
"parameters": [
{
"name": "entity",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"responses": {
"200": {
"description": "List of entities",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": { "id": { "type": "number" } },
"required": ["id"]
}
}
}
}
}
},
"tags": ["data"]
},
"post": {
"summary": "Create entity",
"parameters": [
{
"name": "entity",
"in": "path",
"required": true,
"schema": { "type": "string" }
}
],
"requestBody": {
"content": {
"application/json": {
"schema": { "type": "object", "properties": {} }
}
}
},
"responses": {
"200": {
"description": "Entity",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": { "id": { "type": "number" } },
"required": ["id"]
}
}
}
}
},
"tags": ["data"]
}
},
"/api/data/{entity}/{id}": {
"get": {
"summary": "Get entity",
"parameters": [
{
"name": "entity",
"in": "path",
"required": true,
"schema": { "type": "string" }
},
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "number" }
}
],
"responses": {
"200": {
"description": "Entity",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": { "id": { "type": "number" } },
"required": ["id"]
}
}
}
}
},
"tags": ["data"]
},
"patch": {
"summary": "Update entity",
"parameters": [
{
"name": "entity",
"in": "path",
"required": true,
"schema": { "type": "string" }
},
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "number" }
}
],
"requestBody": {
"content": {
"application/json": {
"schema": { "type": "object", "properties": {} }
}
}
},
"responses": {
"200": {
"description": "Entity",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": { "id": { "type": "number" } },
"required": ["id"]
}
}
}
}
},
"tags": ["data"]
},
"delete": {
"summary": "Delete entity",
"parameters": [
{
"name": "entity",
"in": "path",
"required": true,
"schema": { "type": "string" }
},
{
"name": "id",
"in": "path",
"required": true,
"schema": { "type": "number" }
}
],
"responses": { "200": { "description": "Entity deleted" } },
"tags": ["data"]
}
},
"/api/auth/password/login": {
"post": {
"summary": "Login",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"email": { "type": "string" },
"password": { "type": "string" }
},
"required": ["email", "password"]
}
}
}
},
"responses": {
"200": {
"description": "User",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"user": {
"type": "object",
"properties": {
"id": { "type": "string" },
"email": { "type": "string" },
"name": { "type": "string" }
},
"required": ["id", "email", "name"]
}
},
"required": ["user"]
}
}
}
}
},
"tags": ["auth"]
}
},
"/api/auth/password/register": {
"post": {
"summary": "Register",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"email": { "type": "string" },
"password": { "type": "string" }
},
"required": ["email", "password"]
}
}
}
},
"responses": {
"200": {
"description": "User",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"user": {
"type": "object",
"properties": {
"id": { "type": "string" },
"email": { "type": "string" },
"name": { "type": "string" }
},
"required": ["id", "email", "name"]
}
},
"required": ["user"]
}
}
}
}
},
"tags": ["auth"]
}
},
"/api/auth/me": {
"get": {
"summary": "Get me",
"responses": {
"200": {
"description": "User",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"user": {
"type": "object",
"properties": {
"id": { "type": "string" },
"email": { "type": "string" },
"name": { "type": "string" }
},
"required": ["id", "email", "name"]
}
},
"required": ["user"]
}
}
}
}
},
"tags": ["auth"]
}
},
"/api/auth/strategies": {
"get": {
"summary": "Get auth strategies",
"responses": {
"200": {
"description": "Strategies",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"strategies": { "type": "object", "properties": {} }
},
"required": ["strategies"]
}
}
}
}
},
"tags": ["auth"]
}
}
}
}

View File

@@ -0,0 +1,4 @@
---
title: 'Config'
openapi: 'GET /api/system/config'
---

View File

@@ -0,0 +1,4 @@
---
title: 'Ping'
openapi: 'GET /api/system/ping'
---

View File

@@ -0,0 +1,4 @@
---
title: 'Schema'
openapi: 'GET /api/system/schema'
---