wanzhuang-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +41 -0
- package/README.md +113 -0
- package/dist/commands/create.d.ts +10 -0
- package/dist/commands/create.js +145 -0
- package/dist/commands/generate.d.ts +8 -0
- package/dist/commands/generate.js +26 -0
- package/dist/commands/update.d.ts +6 -0
- package/dist/commands/update.js +26 -0
- package/dist/createApiTest/displayEnumLabel.d.ts +3 -0
- package/dist/createApiTest/displayEnumLabel.js +10 -0
- package/dist/createApiTest/displayTypeLabel.d.ts +19 -0
- package/dist/createApiTest/displayTypeLabel.js +135 -0
- package/dist/createApiTest/index.d.ts +6 -0
- package/dist/createApiTest/index.js +24 -0
- package/dist/createApiTest/pet.d.ts +58 -0
- package/dist/createApiTest/pet.js +102 -0
- package/dist/createApiTest/store.d.ts +28 -0
- package/dist/createApiTest/store.js +48 -0
- package/dist/createApiTest/types.d.ts +110 -0
- package/dist/createApiTest/types.js +17 -0
- package/dist/createApiTest/user.d.ts +50 -0
- package/dist/createApiTest/user.js +85 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +52 -0
- package/dist/utils/api.d.ts +1 -0
- package/dist/utils/api.js +48 -0
- package/dist/utils/configGen.d.ts +28 -0
- package/dist/utils/configGen.js +178 -0
- package/dist/utils/deps.d.ts +13 -0
- package/dist/utils/deps.js +47 -0
- package/dist/utils/fileOps.d.ts +29 -0
- package/dist/utils/fileOps.js +124 -0
- package/dist/utils/template.d.ts +12 -0
- package/dist/utils/template.js +31 -0
- package/package.json +44 -0
- package/src/commands/create.ts +141 -0
- package/src/commands/generate.ts +23 -0
- package/src/commands/update.ts +22 -0
- package/src/createApiTest/displayEnumLabel.ts +13 -0
- package/src/createApiTest/displayTypeLabel.ts +160 -0
- package/src/createApiTest/index.ts +10 -0
- package/src/createApiTest/pet.ts +159 -0
- package/src/createApiTest/store.ts +71 -0
- package/src/createApiTest/types.ts +134 -0
- package/src/createApiTest/user.ts +131 -0
- package/src/index.ts +54 -0
- package/src/utils/api.ts +47 -0
- package/src/utils/configGen.ts +139 -0
- package/src/utils/deps.ts +40 -0
- package/src/utils/fileOps.ts +86 -0
- package/src/utils/template.ts +32 -0
- package/templates/react/README.md +12 -0
- package/templates/react/eslint.config.js +33 -0
- package/templates/react/index.html +13 -0
- package/templates/react/package.json +27 -0
- package/templates/react/public/vite.svg +1 -0
- package/templates/react/src/App.css +42 -0
- package/templates/react/src/App.jsx +35 -0
- package/templates/react/src/assets/react.svg +1 -0
- package/templates/react/src/index.css +68 -0
- package/templates/react/src/main.jsx +10 -0
- package/templates/react/vite.config.js +7 -0
- package/templates/uniapp/index.html +20 -0
- package/templates/uniapp/package.json +67 -0
- package/templates/uniapp/shims-uni.d.ts +10 -0
- package/templates/uniapp/src/App.vue +17 -0
- package/templates/uniapp/src/main.js +10 -0
- package/templates/uniapp/src/manifest.json +72 -0
- package/templates/uniapp/src/pages/index/index.vue +48 -0
- package/templates/uniapp/src/pages.json +16 -0
- package/templates/uniapp/src/shime-uni.d.ts +6 -0
- package/templates/uniapp/src/static/logo.png +0 -0
- package/templates/uniapp/src/uni.scss +76 -0
- package/templates/uniapp/vite.config.js +8 -0
- package/templates/vue/.vscode/extensions.json +3 -0
- package/templates/vue/README.md +5 -0
- package/templates/vue/index.html +13 -0
- package/templates/vue/package.json +18 -0
- package/templates/vue/public/vite.svg +1 -0
- package/templates/vue/src/App.vue +30 -0
- package/templates/vue/src/assets/vue.svg +1 -0
- package/templates/vue/src/components/HelloWorld.vue +43 -0
- package/templates/vue/src/main.js +5 -0
- package/templates/vue/src/style.css +79 -0
- package/templates/vue/vite.config.js +7 -0
- package/tsconfig.json +19 -0
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
import * as API from './types';
|
|
4
|
+
|
|
5
|
+
export function displayApiResponse(field: keyof API.ApiResponse) {
|
|
6
|
+
return {
|
|
7
|
+
code: 'code',
|
|
8
|
+
type: 'type',
|
|
9
|
+
message: 'message',
|
|
10
|
+
}[field];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function displayCategory(field: keyof API.Category) {
|
|
14
|
+
return {
|
|
15
|
+
id: 'id',
|
|
16
|
+
name: 'name',
|
|
17
|
+
}[field];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function displayOrder(field: keyof API.Order) {
|
|
21
|
+
return {
|
|
22
|
+
id: 'id',
|
|
23
|
+
petId: 'petId',
|
|
24
|
+
quantity: 'quantity',
|
|
25
|
+
shipDate: 'shipDate',
|
|
26
|
+
status: 'Order Status',
|
|
27
|
+
complete: 'complete',
|
|
28
|
+
}[field];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function displayPet(field: keyof API.Pet) {
|
|
32
|
+
return {
|
|
33
|
+
id: 'id',
|
|
34
|
+
name: 'name',
|
|
35
|
+
category: 'category',
|
|
36
|
+
photoUrls: 'photoUrls',
|
|
37
|
+
tags: 'tags',
|
|
38
|
+
status: 'pet status in the store',
|
|
39
|
+
}[field];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function displaypetFindByStatusUsingGetParams(
|
|
43
|
+
field: keyof API.petFindByStatusUsingGetParams
|
|
44
|
+
) {
|
|
45
|
+
return {
|
|
46
|
+
status: 'Status values that need to be considered for filter',
|
|
47
|
+
}[field];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function displaypetFindByTagsUsingGetParams(
|
|
51
|
+
field: keyof API.petFindByTagsUsingGetParams
|
|
52
|
+
) {
|
|
53
|
+
return {
|
|
54
|
+
tags: 'Tags to filter by',
|
|
55
|
+
}[field];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function displaypetPetIdUploadImageUsingPostParams(
|
|
59
|
+
field: keyof API.petPetIdUploadImageUsingPostParams
|
|
60
|
+
) {
|
|
61
|
+
return {
|
|
62
|
+
petId: 'ID of pet to update',
|
|
63
|
+
additionalMetadata: 'Additional Metadata',
|
|
64
|
+
}[field];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function displaypetPetIdUsingDeleteParams(
|
|
68
|
+
field: keyof API.petPetIdUsingDeleteParams
|
|
69
|
+
) {
|
|
70
|
+
return {
|
|
71
|
+
petId: 'Pet id to delete',
|
|
72
|
+
}[field];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function displaypetPetIdUsingGetParams(
|
|
76
|
+
field: keyof API.petPetIdUsingGetParams
|
|
77
|
+
) {
|
|
78
|
+
return {
|
|
79
|
+
petId: 'ID of pet to return',
|
|
80
|
+
}[field];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function displaypetPetIdUsingPostParams(
|
|
84
|
+
field: keyof API.petPetIdUsingPostParams
|
|
85
|
+
) {
|
|
86
|
+
return {
|
|
87
|
+
petId: 'ID of pet that needs to be updated',
|
|
88
|
+
name: 'Name of pet that needs to be updated',
|
|
89
|
+
status: 'Status of pet that needs to be updated',
|
|
90
|
+
}[field];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function displaystoreOrderOrderIdUsingDeleteParams(
|
|
94
|
+
field: keyof API.storeOrderOrderIdUsingDeleteParams
|
|
95
|
+
) {
|
|
96
|
+
return {
|
|
97
|
+
orderId: 'ID of the order that needs to be deleted',
|
|
98
|
+
}[field];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function displaystoreOrderOrderIdUsingGetParams(
|
|
102
|
+
field: keyof API.storeOrderOrderIdUsingGetParams
|
|
103
|
+
) {
|
|
104
|
+
return {
|
|
105
|
+
orderId: 'ID of order that needs to be fetched',
|
|
106
|
+
}[field];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function displayTag(field: keyof API.Tag) {
|
|
110
|
+
return {
|
|
111
|
+
id: 'id',
|
|
112
|
+
name: 'name',
|
|
113
|
+
}[field];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function displayUser(field: keyof API.User) {
|
|
117
|
+
return {
|
|
118
|
+
id: 'id',
|
|
119
|
+
username: 'username',
|
|
120
|
+
firstName: 'firstName',
|
|
121
|
+
lastName: 'lastName',
|
|
122
|
+
email: 'email',
|
|
123
|
+
password: 'password',
|
|
124
|
+
phone: 'phone',
|
|
125
|
+
userStatus: 'User Status',
|
|
126
|
+
}[field];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function displayuserLoginUsingGetParams(
|
|
130
|
+
field: keyof API.userLoginUsingGetParams
|
|
131
|
+
) {
|
|
132
|
+
return {
|
|
133
|
+
username: 'The user name for login',
|
|
134
|
+
password: 'The password for login in clear text',
|
|
135
|
+
}[field];
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function displayuserUsernameUsingDeleteParams(
|
|
139
|
+
field: keyof API.userUsernameUsingDeleteParams
|
|
140
|
+
) {
|
|
141
|
+
return {
|
|
142
|
+
username: 'The name that needs to be deleted',
|
|
143
|
+
}[field];
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export function displayuserUsernameUsingGetParams(
|
|
147
|
+
field: keyof API.userUsernameUsingGetParams
|
|
148
|
+
) {
|
|
149
|
+
return {
|
|
150
|
+
username: 'The name that needs to be fetched. Use user1 for testing',
|
|
151
|
+
}[field];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function displayuserUsernameUsingPutParams(
|
|
155
|
+
field: keyof API.userUsernameUsingPutParams
|
|
156
|
+
) {
|
|
157
|
+
return {
|
|
158
|
+
username: 'name that need to be deleted',
|
|
159
|
+
}[field];
|
|
160
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
import request from './request';
|
|
4
|
+
|
|
5
|
+
import * as API from './types';
|
|
6
|
+
|
|
7
|
+
/** Update an existing pet. Update an existing pet by Id. 返回值: Unexpected error PUT /pet */
|
|
8
|
+
export async function petUsingPut({
|
|
9
|
+
body,
|
|
10
|
+
options,
|
|
11
|
+
}: {
|
|
12
|
+
body: API.Pet;
|
|
13
|
+
options?: { [key: string]: unknown };
|
|
14
|
+
}) {
|
|
15
|
+
return request<unknown>('/pet', {
|
|
16
|
+
method: 'PUT',
|
|
17
|
+
headers: {
|
|
18
|
+
'Content-Type': 'application/json',
|
|
19
|
+
},
|
|
20
|
+
data: body,
|
|
21
|
+
...(options || {}),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Add a new pet to the store. Add a new pet to the store. 返回值: Unexpected error POST /pet */
|
|
26
|
+
export async function petUsingPost({
|
|
27
|
+
body,
|
|
28
|
+
options,
|
|
29
|
+
}: {
|
|
30
|
+
body: API.Pet;
|
|
31
|
+
options?: { [key: string]: unknown };
|
|
32
|
+
}) {
|
|
33
|
+
return request<unknown>('/pet', {
|
|
34
|
+
method: 'POST',
|
|
35
|
+
headers: {
|
|
36
|
+
'Content-Type': 'application/json',
|
|
37
|
+
},
|
|
38
|
+
data: body,
|
|
39
|
+
...(options || {}),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Find pet by ID. Returns a single pet. 返回值: Unexpected error GET /pet/${param0} */
|
|
44
|
+
export async function petPetIdUsingGet({
|
|
45
|
+
params,
|
|
46
|
+
options,
|
|
47
|
+
}: {
|
|
48
|
+
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
|
49
|
+
params: API.petPetIdUsingGetParams;
|
|
50
|
+
options?: { [key: string]: unknown };
|
|
51
|
+
}) {
|
|
52
|
+
const { petId: param0, ...queryParams } = params;
|
|
53
|
+
|
|
54
|
+
return request<unknown>(`/pet/${param0}`, {
|
|
55
|
+
method: 'GET',
|
|
56
|
+
params: { ...queryParams },
|
|
57
|
+
...(options || {}),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Updates a pet in the store with form data. Updates a pet resource based on the form data. 返回值: Unexpected error POST /pet/${param0} */
|
|
62
|
+
export async function petPetIdUsingPost({
|
|
63
|
+
params,
|
|
64
|
+
options,
|
|
65
|
+
}: {
|
|
66
|
+
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
|
67
|
+
params: API.petPetIdUsingPostParams;
|
|
68
|
+
options?: { [key: string]: unknown };
|
|
69
|
+
}) {
|
|
70
|
+
const { petId: param0, ...queryParams } = params;
|
|
71
|
+
|
|
72
|
+
return request<unknown>(`/pet/${param0}`, {
|
|
73
|
+
method: 'POST',
|
|
74
|
+
params: {
|
|
75
|
+
...queryParams,
|
|
76
|
+
},
|
|
77
|
+
...(options || {}),
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Deletes a pet. Delete a pet. 返回值: Unexpected error DELETE /pet/${param0} */
|
|
82
|
+
export async function petPetIdUsingDelete({
|
|
83
|
+
params,
|
|
84
|
+
options,
|
|
85
|
+
}: {
|
|
86
|
+
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
|
87
|
+
params: API.petPetIdUsingDeleteParams;
|
|
88
|
+
options?: { [key: string]: unknown };
|
|
89
|
+
}) {
|
|
90
|
+
const { petId: param0, ...queryParams } = params;
|
|
91
|
+
|
|
92
|
+
return request<unknown>(`/pet/${param0}`, {
|
|
93
|
+
method: 'DELETE',
|
|
94
|
+
params: { ...queryParams },
|
|
95
|
+
...(options || {}),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Uploads an image. Upload image of the pet. 返回值: Unexpected error POST /pet/${param0}/uploadImage */
|
|
100
|
+
export async function petPetIdUploadImageUsingPost({
|
|
101
|
+
params,
|
|
102
|
+
body,
|
|
103
|
+
options,
|
|
104
|
+
}: {
|
|
105
|
+
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
|
106
|
+
params: API.petPetIdUploadImageUsingPostParams;
|
|
107
|
+
body: string;
|
|
108
|
+
options?: { [key: string]: unknown };
|
|
109
|
+
}) {
|
|
110
|
+
const { petId: param0, ...queryParams } = params;
|
|
111
|
+
|
|
112
|
+
return request<unknown>(`/pet/${param0}/uploadImage`, {
|
|
113
|
+
method: 'POST',
|
|
114
|
+
headers: {
|
|
115
|
+
'Content-Type': 'application/octet-stream',
|
|
116
|
+
},
|
|
117
|
+
params: {
|
|
118
|
+
...queryParams,
|
|
119
|
+
},
|
|
120
|
+
data: body,
|
|
121
|
+
...(options || {}),
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Finds Pets by status. Multiple status values can be provided with comma separated strings. 返回值: Unexpected error GET /pet/findByStatus */
|
|
126
|
+
export async function petFindByStatusUsingGet({
|
|
127
|
+
params,
|
|
128
|
+
options,
|
|
129
|
+
}: {
|
|
130
|
+
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
|
131
|
+
params: API.petFindByStatusUsingGetParams;
|
|
132
|
+
options?: { [key: string]: unknown };
|
|
133
|
+
}) {
|
|
134
|
+
return request<unknown>('/pet/findByStatus', {
|
|
135
|
+
method: 'GET',
|
|
136
|
+
params: {
|
|
137
|
+
...params,
|
|
138
|
+
},
|
|
139
|
+
...(options || {}),
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Finds Pets by tags. Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. 返回值: Unexpected error GET /pet/findByTags */
|
|
144
|
+
export async function petFindByTagsUsingGet({
|
|
145
|
+
params,
|
|
146
|
+
options,
|
|
147
|
+
}: {
|
|
148
|
+
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
|
149
|
+
params: API.petFindByTagsUsingGetParams;
|
|
150
|
+
options?: { [key: string]: unknown };
|
|
151
|
+
}) {
|
|
152
|
+
return request<unknown>('/pet/findByTags', {
|
|
153
|
+
method: 'GET',
|
|
154
|
+
params: {
|
|
155
|
+
...params,
|
|
156
|
+
},
|
|
157
|
+
...(options || {}),
|
|
158
|
+
});
|
|
159
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
import request from './request';
|
|
4
|
+
|
|
5
|
+
import * as API from './types';
|
|
6
|
+
|
|
7
|
+
/** Returns pet inventories by status. Returns a map of status codes to quantities. 返回值: Unexpected error GET /store/inventory */
|
|
8
|
+
export async function storeInventoryUsingGet({
|
|
9
|
+
options,
|
|
10
|
+
}: {
|
|
11
|
+
options?: { [key: string]: unknown };
|
|
12
|
+
}) {
|
|
13
|
+
return request<unknown>('/store/inventory', {
|
|
14
|
+
method: 'GET',
|
|
15
|
+
...(options || {}),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Place an order for a pet. Place a new order in the store. 返回值: Unexpected error POST /store/order */
|
|
20
|
+
export async function storeOrderUsingPost({
|
|
21
|
+
body,
|
|
22
|
+
options,
|
|
23
|
+
}: {
|
|
24
|
+
body: API.Order;
|
|
25
|
+
options?: { [key: string]: unknown };
|
|
26
|
+
}) {
|
|
27
|
+
return request<unknown>('/store/order', {
|
|
28
|
+
method: 'POST',
|
|
29
|
+
headers: {
|
|
30
|
+
'Content-Type': 'application/json',
|
|
31
|
+
},
|
|
32
|
+
data: body,
|
|
33
|
+
...(options || {}),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Find purchase order by ID. For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. 返回值: Unexpected error GET /store/order/${param0} */
|
|
38
|
+
export async function storeOrderOrderIdUsingGet({
|
|
39
|
+
params,
|
|
40
|
+
options,
|
|
41
|
+
}: {
|
|
42
|
+
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
|
43
|
+
params: API.storeOrderOrderIdUsingGetParams;
|
|
44
|
+
options?: { [key: string]: unknown };
|
|
45
|
+
}) {
|
|
46
|
+
const { orderId: param0, ...queryParams } = params;
|
|
47
|
+
|
|
48
|
+
return request<unknown>(`/store/order/${param0}`, {
|
|
49
|
+
method: 'GET',
|
|
50
|
+
params: { ...queryParams },
|
|
51
|
+
...(options || {}),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Delete purchase order by identifier. For valid response try integer IDs with value < 1000. Anything above 1000 or non-integers will generate API errors. 返回值: Unexpected error DELETE /store/order/${param0} */
|
|
56
|
+
export async function storeOrderOrderIdUsingDelete({
|
|
57
|
+
params,
|
|
58
|
+
options,
|
|
59
|
+
}: {
|
|
60
|
+
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
|
61
|
+
params: API.storeOrderOrderIdUsingDeleteParams;
|
|
62
|
+
options?: { [key: string]: unknown };
|
|
63
|
+
}) {
|
|
64
|
+
const { orderId: param0, ...queryParams } = params;
|
|
65
|
+
|
|
66
|
+
return request<unknown>(`/store/order/${param0}`, {
|
|
67
|
+
method: 'DELETE',
|
|
68
|
+
params: { ...queryParams },
|
|
69
|
+
...(options || {}),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
|
|
4
|
+
export type ApiResponse = {
|
|
5
|
+
code?: number;
|
|
6
|
+
type?: string;
|
|
7
|
+
message?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type Category = {
|
|
11
|
+
id?: number;
|
|
12
|
+
name?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type Order = {
|
|
16
|
+
id?: number;
|
|
17
|
+
petId?: number;
|
|
18
|
+
quantity?: number;
|
|
19
|
+
shipDate?: string;
|
|
20
|
+
/** Order Status */
|
|
21
|
+
status?: 'placed' | 'approved' | 'delivered';
|
|
22
|
+
complete?: boolean;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type Pet = {
|
|
26
|
+
id?: number;
|
|
27
|
+
name: string;
|
|
28
|
+
category?: Category;
|
|
29
|
+
photoUrls: string[];
|
|
30
|
+
tags?: Tag[];
|
|
31
|
+
/** pet status in the store */
|
|
32
|
+
status?: 'available' | 'pending' | 'sold';
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type petFindByStatusUsingGetParams = {
|
|
36
|
+
/** Status values that need to be considered for filter */
|
|
37
|
+
status: 'available' | 'pending' | 'sold';
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type petFindByTagsUsingGetParams = {
|
|
41
|
+
/** Tags to filter by */
|
|
42
|
+
tags: string[];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export type petPetIdUploadImageUsingPostParams = {
|
|
46
|
+
/** ID of pet to update */
|
|
47
|
+
petId: number;
|
|
48
|
+
/** Additional Metadata */
|
|
49
|
+
additionalMetadata?: string;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type petPetIdUsingDeleteParams = {
|
|
53
|
+
/** Pet id to delete */
|
|
54
|
+
petId: number;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type petPetIdUsingGetParams = {
|
|
58
|
+
/** ID of pet to return */
|
|
59
|
+
petId: number;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export type petPetIdUsingPostParams = {
|
|
63
|
+
/** ID of pet that needs to be updated */
|
|
64
|
+
petId: number;
|
|
65
|
+
/** Name of pet that needs to be updated */
|
|
66
|
+
name?: string;
|
|
67
|
+
/** Status of pet that needs to be updated */
|
|
68
|
+
status?: string;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export enum StatusEnum {
|
|
72
|
+
placed = 'placed',
|
|
73
|
+
approved = 'approved',
|
|
74
|
+
delivered = 'delivered',
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type IStatusEnum = keyof typeof StatusEnum;
|
|
78
|
+
|
|
79
|
+
export enum StatusEnum2 {
|
|
80
|
+
available = 'available',
|
|
81
|
+
pending = 'pending',
|
|
82
|
+
sold = 'sold',
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type IStatusEnum2 = keyof typeof StatusEnum2;
|
|
86
|
+
|
|
87
|
+
export type storeOrderOrderIdUsingDeleteParams = {
|
|
88
|
+
/** ID of the order that needs to be deleted */
|
|
89
|
+
orderId: number;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export type storeOrderOrderIdUsingGetParams = {
|
|
93
|
+
/** ID of order that needs to be fetched */
|
|
94
|
+
orderId: number;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export type Tag = {
|
|
98
|
+
id?: number;
|
|
99
|
+
name?: string;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export type User = {
|
|
103
|
+
id?: number;
|
|
104
|
+
username?: string;
|
|
105
|
+
firstName?: string;
|
|
106
|
+
lastName?: string;
|
|
107
|
+
email?: string;
|
|
108
|
+
password?: string;
|
|
109
|
+
phone?: string;
|
|
110
|
+
/** User Status */
|
|
111
|
+
userStatus?: number;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export type userLoginUsingGetParams = {
|
|
115
|
+
/** The user name for login */
|
|
116
|
+
username?: string;
|
|
117
|
+
/** The password for login in clear text */
|
|
118
|
+
password?: string;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export type userUsernameUsingDeleteParams = {
|
|
122
|
+
/** The name that needs to be deleted */
|
|
123
|
+
username: string;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export type userUsernameUsingGetParams = {
|
|
127
|
+
/** The name that needs to be fetched. Use user1 for testing */
|
|
128
|
+
username: string;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export type userUsernameUsingPutParams = {
|
|
132
|
+
/** name that need to be deleted */
|
|
133
|
+
username: string;
|
|
134
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
import request from './request';
|
|
4
|
+
|
|
5
|
+
import * as API from './types';
|
|
6
|
+
|
|
7
|
+
/** Create user. This can only be done by the logged in user. 返回值: Unexpected error POST /user */
|
|
8
|
+
export async function userUsingPost({
|
|
9
|
+
body,
|
|
10
|
+
options,
|
|
11
|
+
}: {
|
|
12
|
+
body: API.User;
|
|
13
|
+
options?: { [key: string]: unknown };
|
|
14
|
+
}) {
|
|
15
|
+
return request<unknown>('/user', {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
headers: {
|
|
18
|
+
'Content-Type': 'application/json',
|
|
19
|
+
},
|
|
20
|
+
data: body,
|
|
21
|
+
...(options || {}),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Get user by user name. Get user detail based on username. 返回值: Unexpected error GET /user/${param0} */
|
|
26
|
+
export async function userUsernameUsingGet({
|
|
27
|
+
params,
|
|
28
|
+
options,
|
|
29
|
+
}: {
|
|
30
|
+
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
|
31
|
+
params: API.userUsernameUsingGetParams;
|
|
32
|
+
options?: { [key: string]: unknown };
|
|
33
|
+
}) {
|
|
34
|
+
const { username: param0, ...queryParams } = params;
|
|
35
|
+
|
|
36
|
+
return request<unknown>(`/user/${param0}`, {
|
|
37
|
+
method: 'GET',
|
|
38
|
+
params: { ...queryParams },
|
|
39
|
+
...(options || {}),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Update user resource. This can only be done by the logged in user. 返回值: Unexpected error PUT /user/${param0} */
|
|
44
|
+
export async function userUsernameUsingPut({
|
|
45
|
+
params,
|
|
46
|
+
body,
|
|
47
|
+
options,
|
|
48
|
+
}: {
|
|
49
|
+
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
|
50
|
+
params: API.userUsernameUsingPutParams;
|
|
51
|
+
body: API.User;
|
|
52
|
+
options?: { [key: string]: unknown };
|
|
53
|
+
}) {
|
|
54
|
+
const { username: param0, ...queryParams } = params;
|
|
55
|
+
|
|
56
|
+
return request<unknown>(`/user/${param0}`, {
|
|
57
|
+
method: 'PUT',
|
|
58
|
+
headers: {
|
|
59
|
+
'Content-Type': 'application/json',
|
|
60
|
+
},
|
|
61
|
+
params: { ...queryParams },
|
|
62
|
+
data: body,
|
|
63
|
+
...(options || {}),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Delete user resource. This can only be done by the logged in user. 返回值: Unexpected error DELETE /user/${param0} */
|
|
68
|
+
export async function userUsernameUsingDelete({
|
|
69
|
+
params,
|
|
70
|
+
options,
|
|
71
|
+
}: {
|
|
72
|
+
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
|
73
|
+
params: API.userUsernameUsingDeleteParams;
|
|
74
|
+
options?: { [key: string]: unknown };
|
|
75
|
+
}) {
|
|
76
|
+
const { username: param0, ...queryParams } = params;
|
|
77
|
+
|
|
78
|
+
return request<unknown>(`/user/${param0}`, {
|
|
79
|
+
method: 'DELETE',
|
|
80
|
+
params: { ...queryParams },
|
|
81
|
+
...(options || {}),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Creates list of users with given input array. Creates list of users with given input array. 返回值: Unexpected error POST /user/createWithList */
|
|
86
|
+
export async function userCreateWithListUsingPost({
|
|
87
|
+
body,
|
|
88
|
+
options,
|
|
89
|
+
}: {
|
|
90
|
+
body: API.User[];
|
|
91
|
+
options?: { [key: string]: unknown };
|
|
92
|
+
}) {
|
|
93
|
+
return request<unknown>('/user/createWithList', {
|
|
94
|
+
method: 'POST',
|
|
95
|
+
headers: {
|
|
96
|
+
'Content-Type': 'application/json',
|
|
97
|
+
},
|
|
98
|
+
data: body,
|
|
99
|
+
...(options || {}),
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Logs user into the system. Log into the system. 返回值: Unexpected error GET /user/login */
|
|
104
|
+
export async function userLoginUsingGet({
|
|
105
|
+
params,
|
|
106
|
+
options,
|
|
107
|
+
}: {
|
|
108
|
+
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
|
109
|
+
params: API.userLoginUsingGetParams;
|
|
110
|
+
options?: { [key: string]: unknown };
|
|
111
|
+
}) {
|
|
112
|
+
return request<unknown>('/user/login', {
|
|
113
|
+
method: 'GET',
|
|
114
|
+
params: {
|
|
115
|
+
...params,
|
|
116
|
+
},
|
|
117
|
+
...(options || {}),
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Logs out current logged in user session. Log user out of the system. 返回值: Unexpected error GET /user/logout */
|
|
122
|
+
export async function userLogoutUsingGet({
|
|
123
|
+
options,
|
|
124
|
+
}: {
|
|
125
|
+
options?: { [key: string]: unknown };
|
|
126
|
+
}) {
|
|
127
|
+
return request<unknown>('/user/logout', {
|
|
128
|
+
method: 'GET',
|
|
129
|
+
...(options || {}),
|
|
130
|
+
});
|
|
131
|
+
}
|