storj/private/apigen/example/apidocs.gen.md
Ivan Fraixedes 9338f3f088
private/apigen: Add a TypeScript client mock generator
Implement a TypeScript client mock generator to generate mocks with
static data specified in the API definition.

Change-Id: I11419f4bbf72576fcd829f9d4acd8471034ca571
2023-10-25 14:43:01 +02:00

3.6 KiB

API Docs

Description:

Version: v0

List of Endpoints

Get Documents (go to full list)

Get the paths to all the documents under the specified paths

GET /api/v0/docs/

Response body:

[
	{
		id: string // UUID formatted as `00000000-0000-0000-0000-000000000000`
		path: string
		date: string // Date timestamp formatted as `2006-01-02T15:00:00Z`
		metadata: 		{
			owner: string
			tags: 			[
unknown
			]

		}

		last_retrievals: 		[
			{
				user: string
				when: string // Date timestamp formatted as `2006-01-02T15:00:00Z`
			}

		]

	}

]

Get One (go to full list)

Get the document in the specified path

GET /api/v0/docs/{path}

Path Params:

name type elaboration
path string

Response body:

{
	id: string // UUID formatted as `00000000-0000-0000-0000-000000000000`
	date: string // Date timestamp formatted as `2006-01-02T15:00:00Z`
	pathParam: string
	body: string
	version: 	{
		date: string // Date timestamp formatted as `2006-01-02T15:00:00Z`
		number: number
	}

}

Get a tag (go to full list)

Get the tag of the document in the specified path and tag label

GET /api/v0/docs/{path}/tag/{tagName}

Path Params:

name type elaboration
path string
tagName string

Response body:

unknown

Get Version (go to full list)

Get all the version of the document in the specified path

GET /api/v0/docs/{path}/versions

Path Params:

name type elaboration
path string

Response body:

[
	{
		date: string // Date timestamp formatted as `2006-01-02T15:00:00Z`
		number: number
	}

]

Update Content (go to full list)

Update the content of the document with the specified path and ID if the last update is before the indicated date

POST /api/v0/docs/{path}

Query Params:

name type elaboration
id string UUID formatted as 00000000-0000-0000-0000-000000000000
date string Date timestamp formatted as 2006-01-02T15:00:00Z

Path Params:

name type elaboration
path string

Request body:

{
	content: string
}

Response body:

{
	id: string // UUID formatted as `00000000-0000-0000-0000-000000000000`
	date: string // Date timestamp formatted as `2006-01-02T15:00:00Z`
	pathParam: string
	body: string
}

Get Users (go to full list)

Get the list of registered users

GET /api/v0/users/

Response body:

[
	{
		name: string
		surname: string
		email: string
	}

]

Create User (go to full list)

Create a user

POST /api/v0/users/

Request body:

[
	{
		name: string
		surname: string
		email: string
	}

]