Improve doc
This commit is contained in:
		| @@ -30,7 +30,14 @@ export const meta = { | ||||
| 			validator: $.optional.type(ID), | ||||
| 			transform: transform, | ||||
| 		}, | ||||
| 	} | ||||
| 	}, | ||||
|  | ||||
| 	res: { | ||||
| 		type: 'array', | ||||
| 		items: { | ||||
| 			type: 'Blocking', | ||||
| 		} | ||||
| 	}, | ||||
| }; | ||||
|  | ||||
| export default define(meta, async (ps, me) => { | ||||
|   | ||||
| @@ -30,7 +30,14 @@ export const meta = { | ||||
| 			validator: $.optional.type(ID), | ||||
| 			transform: transform, | ||||
| 		}, | ||||
| 	} | ||||
| 	}, | ||||
|  | ||||
| 	res: { | ||||
| 		type: 'array', | ||||
| 		items: { | ||||
| 			type: 'Muting', | ||||
| 		} | ||||
| 	}, | ||||
| }; | ||||
|  | ||||
| export default define(meta, async (ps, me) => { | ||||
|   | ||||
| @@ -67,7 +67,14 @@ export const meta = { | ||||
| 			validator: $.optional.type(ID), | ||||
| 			transform: transform, | ||||
| 		}, | ||||
| 	} | ||||
| 	}, | ||||
|  | ||||
| 	res: { | ||||
| 		type: 'array', | ||||
| 		items: { | ||||
| 			type: 'Note', | ||||
| 		} | ||||
| 	}, | ||||
| }; | ||||
|  | ||||
| export default define(meta, async (ps) => { | ||||
|   | ||||
| @@ -53,7 +53,14 @@ export const meta = { | ||||
| 			]), | ||||
| 			default: 'local' | ||||
| 		} | ||||
| 	} | ||||
| 	}, | ||||
|  | ||||
| 	res: { | ||||
| 		type: 'array', | ||||
| 		items: { | ||||
| 			type: 'User', | ||||
| 		} | ||||
| 	}, | ||||
| }; | ||||
|  | ||||
| const state: any = { // < https://github.com/Microsoft/TypeScript/issues/1863 | ||||
|   | ||||
| @@ -52,6 +52,23 @@ export const meta = { | ||||
| 		} | ||||
| 	}, | ||||
|  | ||||
| 	res: { | ||||
| 		type: 'object', | ||||
| 		properties: { | ||||
| 			users: { | ||||
| 				type: 'array', | ||||
| 				items: { | ||||
| 					type: 'User', | ||||
| 				} | ||||
| 			}, | ||||
| 			next: { | ||||
| 				type: 'string', | ||||
| 				format: 'id', | ||||
| 				nullable: true | ||||
| 			} | ||||
| 		} | ||||
| 	}, | ||||
|  | ||||
| 	errors: { | ||||
| 		noSuchUser: { | ||||
| 			message: 'No such user.', | ||||
|   | ||||
| @@ -52,6 +52,23 @@ export const meta = { | ||||
| 		} | ||||
| 	}, | ||||
|  | ||||
| 	res: { | ||||
| 		type: 'object', | ||||
| 		properties: { | ||||
| 			users: { | ||||
| 				type: 'array', | ||||
| 				items: { | ||||
| 					type: 'User', | ||||
| 				} | ||||
| 			}, | ||||
| 			next: { | ||||
| 				type: 'string', | ||||
| 				format: 'id', | ||||
| 				nullable: true | ||||
| 			} | ||||
| 		} | ||||
| 	}, | ||||
|  | ||||
| 	errors: { | ||||
| 		noSuchUser: { | ||||
| 			message: 'No such user.', | ||||
|   | ||||
| @@ -29,6 +29,13 @@ export const meta = { | ||||
| 		}, | ||||
| 	}, | ||||
|  | ||||
| 	res: { | ||||
| 		type: 'array', | ||||
| 		items: { | ||||
| 			type: 'User', | ||||
| 		} | ||||
| 	}, | ||||
|  | ||||
| 	errors: { | ||||
| 		noSuchUser: { | ||||
| 			message: 'No such user.', | ||||
|   | ||||
| @@ -31,7 +31,14 @@ export const meta = { | ||||
| 			validator: $.optional.num.min(0), | ||||
| 			default: 0 | ||||
| 		} | ||||
| 	} | ||||
| 	}, | ||||
|  | ||||
| 	res: { | ||||
| 		type: 'array', | ||||
| 		items: { | ||||
| 			type: 'User', | ||||
| 		} | ||||
| 	}, | ||||
| }; | ||||
|  | ||||
| export default define(meta, async (ps, me) => { | ||||
|   | ||||
| @@ -52,6 +52,13 @@ export const meta = { | ||||
| 			} | ||||
| 		}, | ||||
| 	}, | ||||
|  | ||||
| 	res: { | ||||
| 		type: 'array', | ||||
| 		items: { | ||||
| 			type: 'User', | ||||
| 		} | ||||
| 	}, | ||||
| }; | ||||
|  | ||||
| export default define(meta, async (ps, me) => { | ||||
|   | ||||
| @@ -221,5 +221,49 @@ export const schemas = { | ||||
| 			}, | ||||
| 		}, | ||||
| 		required: ['id', 'createdAt', 'name', 'type', 'datasize', 'md5'] | ||||
| 	} | ||||
| 	}, | ||||
|  | ||||
| 	Muting: { | ||||
| 		type: 'object', | ||||
| 		properties: { | ||||
| 			id: { | ||||
| 				type: 'string', | ||||
| 				format: 'id', | ||||
| 				description: 'The unique identifier for this mute.', | ||||
| 				example: 'xxxxxxxxxxxxxxxxxxxxxxxx', | ||||
| 			}, | ||||
| 			createdAt: { | ||||
| 				type: 'string', | ||||
| 				format: 'date-time', | ||||
| 				description: 'The date that the mute was created.' | ||||
| 			}, | ||||
| 			mutee: { | ||||
| 				$ref: '#/components/schemas/User', | ||||
| 				description: 'The mutee.' | ||||
| 			}, | ||||
| 		}, | ||||
| 		required: ['id', 'createdAt', 'mutee'] | ||||
| 	}, | ||||
|  | ||||
| 	Blocking: { | ||||
| 		type: 'object', | ||||
| 		properties: { | ||||
| 			id: { | ||||
| 				type: 'string', | ||||
| 				format: 'id', | ||||
| 				description: 'The unique identifier for this block.', | ||||
| 				example: 'xxxxxxxxxxxxxxxxxxxxxxxx', | ||||
| 			}, | ||||
| 			createdAt: { | ||||
| 				type: 'string', | ||||
| 				format: 'date-time', | ||||
| 				description: 'The date that the block was created.' | ||||
| 			}, | ||||
| 			blockee: { | ||||
| 				$ref: '#/components/schemas/User', | ||||
| 				description: 'The blockee.' | ||||
| 			}, | ||||
| 		}, | ||||
| 		required: ['id', 'createdAt', 'blockee'] | ||||
| 	}, | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 syuilo
					syuilo