Remove nuxt + 100 other things..
This commit is contained in:
+2
-2
@@ -1,8 +1,8 @@
|
||||
FORMAT: 1A
|
||||
HOST: http://localhost:5000
|
||||
HOST: https://simplenotes.be/api
|
||||
|
||||
# Notes API
|
||||
|
||||
<!-- include(./users/index.apib) -->
|
||||
<!-- include(./notes/index.apib) -->
|
||||
<!-- include(./tags/index.apib) -->
|
||||
<!-- include(./tags/index.apib) -->
|
||||
|
||||
+100
-133
@@ -1,162 +1,129 @@
|
||||
# Data Structures
|
||||
|
||||
## Chapter (object)
|
||||
+ title: Chapter 1 (string)
|
||||
+ content: ... (string)
|
||||
|
||||
|
||||
# Group Notes
|
||||
|
||||
## Notes [/notes]
|
||||
|
||||
### Create a Note [POST]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Request (text/markdown; charset=UTF-8)
|
||||
+ Headers
|
||||
Authorization: Bearer <token>
|
||||
|
||||
+ Attributes (object)
|
||||
+ title: `This is a title` (string)
|
||||
+ tags: Dev, Server (array[string])
|
||||
+ chapters (array)
|
||||
+ (object)
|
||||
+ title: `Chapter 1` (string)
|
||||
+ content: `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.` (string)
|
||||
|
||||
|
||||
Authorization: Bearer <token>
|
||||
Accept: application/json
|
||||
|
||||
+ Body
|
||||
|
||||
---
|
||||
title: example
|
||||
tags: ["some", "tags"]
|
||||
---
|
||||
# A story
|
||||
|
||||
- a
|
||||
- b
|
||||
|
||||
|
||||
+ Response 201 (application/json)
|
||||
+ Attributes (object)
|
||||
+ uuid: `107c90ae-a41e-4c8e-b5e3-1a269cfe044b` (string)
|
||||
|
||||
### Get Notes [GET]
|
||||
{
|
||||
"title": "example",
|
||||
"tags": [
|
||||
"some",
|
||||
"tags"
|
||||
],
|
||||
"markdown": "---\ntitle: example\ntags: [\"some\", \"tags\"]\n---\n# A story\n\n- a\n- b",
|
||||
"html": "<h1>A story</h1>\n<ul><li>a</li><li>b</li></ul>\n",
|
||||
"uuid": "42aa1078-130e-47ee-b82d-b1d62f3ea054",
|
||||
"updatedAt": "2020-07-16T01:03:46.7766"
|
||||
}
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer <token>
|
||||
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Attributes (array)
|
||||
+ (object)
|
||||
+ uuid: `123e4567-e89b-12d3-a456-426614174000` (string)
|
||||
+ title: Kotlin (string)
|
||||
+ tags: Dev, Server (array[string])
|
||||
+ updatedAt: `2020-01-20T00:00:00` (string)
|
||||
+ (object)
|
||||
+ uuid: `107c90ae-a41e-4c8e-b5e3-1a269cfe044b` (string)
|
||||
+ title: Java (string)
|
||||
+ tags: Dev (array[string])
|
||||
+ updatedAt: `2018-01-20T00:00:00` (string)
|
||||
|
||||
|
||||
|
||||
|
||||
## Note [/notes/{noteUuid}]
|
||||
## Notes [/notes{?limit,after}]
|
||||
|
||||
+ Parameters
|
||||
+ noteUuid: `123e4567-e89b-12d3-a456-426614174000` (string) - The note UUID.
|
||||
+ limit: 10 (number, optional) - The number of notes to return
|
||||
+ Default: `20`
|
||||
+ after: `9bd36653-6397-4c5b-b8b7-158d9de208ef` (string, optional) - The UUID of the note before the requested ones
|
||||
|
||||
|
||||
|
||||
### Get All Notes [GET]
|
||||
|
||||
+ Request
|
||||
|
||||
+ Headers
|
||||
|
||||
Authorization: Bearer <token>
|
||||
Accept: application/json
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Body
|
||||
|
||||
[
|
||||
{
|
||||
"uuid": "42aa1078-130e-47ee-b82d-b1d62f3ea054",
|
||||
"title": "example",
|
||||
"updatedAt": "2020-07-16T01:03:46",
|
||||
"tags": [
|
||||
"some",
|
||||
"tags"
|
||||
]
|
||||
},
|
||||
{
|
||||
"uuid": "e61271e9-ba86-4428-a788-49946d1954c5",
|
||||
"title": "test",
|
||||
"updatedAt": "2020-07-16T00:22:02",
|
||||
"tags": [
|
||||
"babar",
|
||||
"fait",
|
||||
"du",
|
||||
"ski"
|
||||
]
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
## Note [/notes/{uuid}]
|
||||
|
||||
+ Parameters
|
||||
+ uuid: `123e4567-e89b-12d3-a456-426614174000` (required, string) - The note UUID.
|
||||
|
||||
|
||||
### Get a Note [GET]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Request
|
||||
+ Headers
|
||||
Authorization: Bearer <token>
|
||||
|
||||
|
||||
Authorization: Bearer <token>
|
||||
Accept: application/json
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Attributes (object)
|
||||
+ uuid: `123e4567-e89b-12d3-a456-426614174000` (string)
|
||||
+ title: `This is a title` (string)
|
||||
+ updatedAt: `2020-05-08T11:56:01` (string)
|
||||
+ tags: Dev, Server (array[string])
|
||||
+ chapters (array)
|
||||
+ (Chapter)
|
||||
+ title: Introduction
|
||||
+ content: ...
|
||||
+ (Chapter)
|
||||
+ title: Objects
|
||||
+ content: ...
|
||||
|
||||
+ Response 404
|
||||
+ Body
|
||||
|
||||
|
||||
### Update a Note [PATCH]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer <token>
|
||||
|
||||
+ Attributes (object)
|
||||
+ title: NewTitle (string)
|
||||
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer <token>
|
||||
|
||||
+ Attributes (object)
|
||||
+ tags: new, tags (array[string])
|
||||
|
||||
|
||||
+ Response 200
|
||||
{
|
||||
"uuid": "8ba68c64-11f1-4424-a0cb-cba54a65298f",
|
||||
"title": "example",
|
||||
"markdown": "---\ntitle: example\ntags: [\"some\", \"tags\"]\n---\n# A story\n\n- a\n- b",
|
||||
"html": "<h1>A story</h1>\n<ul><li>a</li><li>b</li></ul>\n",
|
||||
"updatedAt": "2020-07-16T01:13:37",
|
||||
"tags": [
|
||||
"some",
|
||||
"tags"
|
||||
]
|
||||
}
|
||||
|
||||
+ Response 404
|
||||
|
||||
|
||||
### Update a Note [PUT]
|
||||
|
||||
#### TODO
|
||||
|
||||
### Delete a Note [DELETE]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer <token>
|
||||
|
||||
+ Response 200
|
||||
|
||||
+ Response 404
|
||||
|
||||
|
||||
## Chapters [/notes/{noteTitle}/chapters/{chapterNumber}]
|
||||
|
||||
+ Parameters
|
||||
+ noteTitle: `Kotlin` (string) - The title of the Note.
|
||||
+ chapterNumber: `Kotlin` (number) - The chapter number.
|
||||
|
||||
### Post a chapter [POST]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Request
|
||||
+ Headers
|
||||
Authorization: Bearer <token>
|
||||
+ Attributes (Chapter)
|
||||
+ title: Chapter 1 (string)
|
||||
+ content: ... (string)
|
||||
|
||||
+ Response 201
|
||||
|
||||
+ Response 404
|
||||
|
||||
### Patch a chapter [PATCH]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer <token>
|
||||
|
||||
+ Attributes (object)
|
||||
+ title: new title (string)
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer <token>
|
||||
|
||||
+ Attributes (object)
|
||||
+ content: ... (string)
|
||||
|
||||
+ Response 200
|
||||
|
||||
+ Response 404
|
||||
|
||||
|
||||
### Delete a chapter [DELETE]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Headers
|
||||
Authorization: Bearer <token>
|
||||
Authorization: Bearer <token>
|
||||
Accept: application/json
|
||||
|
||||
+ Response 200
|
||||
|
||||
|
||||
+13
-6
@@ -4,11 +4,18 @@
|
||||
|
||||
### Get all tags [GET]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Request
|
||||
+ Headers
|
||||
Authorization: Bearer <token>
|
||||
|
||||
|
||||
|
||||
Authorization: Bearer <token>
|
||||
Accept: application/json
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Attributes
|
||||
+ tags: Dev, Server (array[string])
|
||||
+ Body
|
||||
|
||||
[
|
||||
"markdown",
|
||||
"md",
|
||||
"code",
|
||||
"java"
|
||||
]
|
||||
|
||||
+72
-47
@@ -1,41 +1,37 @@
|
||||
# Data Structures
|
||||
|
||||
## Login (object)
|
||||
+ username: babar (string)
|
||||
+ password: tortue (string)
|
||||
|
||||
|
||||
## InvalidCredentials (object)
|
||||
+ description: Invalid credentials (string),
|
||||
+ error: Bad Request (string),
|
||||
+ status_code: 401 (number)
|
||||
|
||||
# Group Accounts
|
||||
|
||||
## Account [/user]
|
||||
|
||||
### Register a new user [POST]
|
||||
### Create an account [POST]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Attributes (object)
|
||||
+ username: babar (string)
|
||||
+ password: tortue (string)
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Attributes (object)
|
||||
+ message: Created (string)
|
||||
+ Headers
|
||||
|
||||
Accept: application/json
|
||||
|
||||
+ Body
|
||||
|
||||
{
|
||||
"username": "user",
|
||||
"password": "apassword"
|
||||
}
|
||||
|
||||
|
||||
+ Response 200
|
||||
|
||||
+ Response 409
|
||||
|
||||
+ Response 409 (application/json)
|
||||
+ Attributes (object)
|
||||
+ message: User already exists (string)
|
||||
|
||||
### Delete a user [DELETE]
|
||||
|
||||
+ Request
|
||||
+ Headers
|
||||
Authorization: Bearer <token>
|
||||
|
||||
+ Response 200 (application/json)
|
||||
Authorization: Bearer <token>
|
||||
Accept: application/json
|
||||
|
||||
+ Response 200
|
||||
|
||||
+ Response 404
|
||||
|
||||
|
||||
## Authentication [/user/login]
|
||||
@@ -44,43 +40,72 @@ Authenticate one user to access protected routing.
|
||||
### Authenticate a user [POST]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Attributes (Login)
|
||||
+ Headers
|
||||
|
||||
Accept: application/json
|
||||
|
||||
+ Body
|
||||
|
||||
{
|
||||
"username": "user",
|
||||
"password": "myrealpassword"
|
||||
}
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Attributes
|
||||
+ token: <token>
|
||||
+ refreshToken: `<refresh-token>`
|
||||
+ Body
|
||||
|
||||
+ Response 401 (application/json)
|
||||
+ Attributes (InvalidCredentials)
|
||||
{
|
||||
"token": "<token>",
|
||||
"refreshToken": "<token>"
|
||||
}
|
||||
|
||||
+ Response 401
|
||||
|
||||
## Token refresh [/user/refresh_token]
|
||||
|
||||
### Refresh JWT token [POST]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Attributes
|
||||
+ refreshToken: `<refresh-token>`
|
||||
+ Headers
|
||||
|
||||
Accept: application/json
|
||||
|
||||
+ Body
|
||||
|
||||
{
|
||||
"refreshToken": "<refresh-token>"
|
||||
}
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Attributes
|
||||
+ token: <token>
|
||||
+ refreshToken: `<refresh-token>`
|
||||
+ Body
|
||||
|
||||
{
|
||||
"token": "<token>",
|
||||
"refreshToken": "<refresh-token>"
|
||||
}
|
||||
|
||||
|
||||
+ Response 401
|
||||
|
||||
+ Response 401 (application/json)
|
||||
+ Attributes (InvalidCredentials)
|
||||
|
||||
## User Info [/user/me]
|
||||
Receive the username and email from the currently logged in user
|
||||
|
||||
### Get User Info [GET]
|
||||
|
||||
+ Request (application/json)
|
||||
+ Request
|
||||
+ Headers
|
||||
Authorization: Bearer <token>
|
||||
|
||||
|
||||
|
||||
Authorization: Bearer <token>
|
||||
Accept: application/json
|
||||
|
||||
|
||||
+ Response 200 (application/json)
|
||||
+ Attributes
|
||||
+ user: (object)
|
||||
+ username: babar (string)
|
||||
+ Body
|
||||
|
||||
{
|
||||
"user": {
|
||||
"username": "user"
|
||||
}
|
||||
}
|
||||
|
||||
+ Response 401
|
||||
|
||||
Reference in New Issue
Block a user