mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-10-26 19:14:12 +00:00 
			
		
		
		
	Improve doc
This commit is contained in:
		
							parent
							
								
									495aad6a2d
								
							
						
					
					
						commit
						eb8d1211ba
					
				
					 4 changed files with 52 additions and 1 deletions
				
			
		|  | @ -20,7 +20,14 @@ export const meta = { | |||
| 			validator: $.optional.num.range(1, 100), | ||||
| 			default: 10 | ||||
| 		} | ||||
| 	} | ||||
| 	}, | ||||
| 
 | ||||
| 	res: { | ||||
| 		type: 'array', | ||||
| 		items: { | ||||
| 			type: 'MessagingMessage', | ||||
| 		}, | ||||
| 	}, | ||||
| }; | ||||
| 
 | ||||
| export default define(meta, async (ps, user) => { | ||||
|  |  | |||
|  | @ -50,6 +50,13 @@ export const meta = { | |||
| 		} | ||||
| 	}, | ||||
| 
 | ||||
| 	res: { | ||||
| 		type: 'array', | ||||
| 		items: { | ||||
| 			type: 'MessagingMessage', | ||||
| 		}, | ||||
| 	}, | ||||
| 
 | ||||
| 	errors: { | ||||
| 		noSuchUser: { | ||||
| 			message: 'No such user.', | ||||
|  |  | |||
|  | @ -45,6 +45,10 @@ export const meta = { | |||
| 		} | ||||
| 	}, | ||||
| 
 | ||||
| 	res: { | ||||
| 		type: 'MessagingMessage', | ||||
| 	}, | ||||
| 
 | ||||
| 	errors: { | ||||
| 		recipientIsYourself: { | ||||
| 			message: 'You can not send a message to yourself.', | ||||
|  |  | |||
|  | @ -119,6 +119,39 @@ export const schemas = { | |||
| 		required: ['id', 'createdAt', 'title'] | ||||
| 	}, | ||||
| 
 | ||||
| 	MessagingMessage: { | ||||
| 		type: 'object', | ||||
| 		properties: { | ||||
| 			id: { | ||||
| 				type: 'string', | ||||
| 				format: 'id', | ||||
| 				description: 'The unique identifier for this MessagingMessage.', | ||||
| 				example: 'xxxxxxxxxxxxxxxxxxxxxxxx', | ||||
| 			}, | ||||
| 			createdAt: { | ||||
| 				type: 'string', | ||||
| 				format: 'date-time', | ||||
| 				description: 'The date that the MessagingMessage was created.' | ||||
| 			}, | ||||
| 			text: { | ||||
| 				type: 'string', | ||||
| 				nullable: true | ||||
| 			}, | ||||
| 			file: { | ||||
| 				type: 'DriveFile', | ||||
| 				nullable: true | ||||
| 			}, | ||||
| 			recipientId: { | ||||
| 				type: 'string', | ||||
| 				format: 'id', | ||||
| 			}, | ||||
| 			recipient: { | ||||
| 				$ref: '#/components/schemas/User' | ||||
| 			}, | ||||
| 		}, | ||||
| 		required: ['id', 'createdAt'] | ||||
| 	}, | ||||
| 
 | ||||
| 	Note: { | ||||
| 		type: 'object', | ||||
| 		properties: { | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue