86133 | aaa3f5d | 2025-04-20 21:33:29 +0800 | [diff] [blame^] | 1 | declare namespace API { |
| 2 | type ApiResponse = { |
| 3 | code?: number; |
| 4 | type?: string; |
| 5 | message?: string; |
| 6 | }; |
| 7 | |
| 8 | type Category = { |
| 9 | id?: number; |
| 10 | name?: string; |
| 11 | }; |
| 12 | |
| 13 | type deleteOrderParams = { |
| 14 | /** ID of the order that needs to be deleted */ |
| 15 | orderId: number; |
| 16 | }; |
| 17 | |
| 18 | type deletePetParams = { |
| 19 | api_key?: string; |
| 20 | /** Pet id to delete */ |
| 21 | petId: number; |
| 22 | }; |
| 23 | |
| 24 | type deleteUserParams = { |
| 25 | /** The name that needs to be deleted */ |
| 26 | username: string; |
| 27 | }; |
| 28 | |
| 29 | type findPetsByStatusParams = { |
| 30 | /** Status values that need to be considered for filter */ |
| 31 | status: ('available' | 'pending' | 'sold')[]; |
| 32 | }; |
| 33 | |
| 34 | type findPetsByTagsParams = { |
| 35 | /** Tags to filter by */ |
| 36 | tags: string[]; |
| 37 | }; |
| 38 | |
| 39 | type getOrderByIdParams = { |
| 40 | /** ID of pet that needs to be fetched */ |
| 41 | orderId: number; |
| 42 | }; |
| 43 | |
| 44 | type getPetByIdParams = { |
| 45 | /** ID of pet to return */ |
| 46 | petId: number; |
| 47 | }; |
| 48 | |
| 49 | type getUserByNameParams = { |
| 50 | /** The name that needs to be fetched. Use user1 for testing. */ |
| 51 | username: string; |
| 52 | }; |
| 53 | |
| 54 | type loginUserParams = { |
| 55 | /** The user name for login */ |
| 56 | username: string; |
| 57 | /** The password for login in clear text */ |
| 58 | password: string; |
| 59 | }; |
| 60 | |
| 61 | type Order = { |
| 62 | id?: number; |
| 63 | petId?: number; |
| 64 | quantity?: number; |
| 65 | shipDate?: string; |
| 66 | /** Order Status */ |
| 67 | status?: 'placed' | 'approved' | 'delivered'; |
| 68 | complete?: boolean; |
| 69 | }; |
| 70 | |
| 71 | type Pet = { |
| 72 | id?: number; |
| 73 | category?: Category; |
| 74 | name: string; |
| 75 | photoUrls: string[]; |
| 76 | tags?: Tag[]; |
| 77 | /** pet status in the store */ |
| 78 | status?: 'available' | 'pending' | 'sold'; |
| 79 | }; |
| 80 | |
| 81 | type Tag = { |
| 82 | id?: number; |
| 83 | name?: string; |
| 84 | }; |
| 85 | |
| 86 | type updatePetWithFormParams = { |
| 87 | /** ID of pet that needs to be updated */ |
| 88 | petId: number; |
| 89 | }; |
| 90 | |
| 91 | type updateUserParams = { |
| 92 | /** name that need to be updated */ |
| 93 | username: string; |
| 94 | }; |
| 95 | |
| 96 | type uploadFileParams = { |
| 97 | /** ID of pet to update */ |
| 98 | petId: number; |
| 99 | }; |
| 100 | |
| 101 | type User = { |
| 102 | id?: number; |
| 103 | username?: string; |
| 104 | firstName?: string; |
| 105 | lastName?: string; |
| 106 | email?: string; |
| 107 | password?: string; |
| 108 | phone?: string; |
| 109 | /** User Status */ |
| 110 | userStatus?: number; |
| 111 | }; |
| 112 | } |