@redhat-ecosystem-engineering/petstore-client-test 0.0.1

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.
Files changed (81) hide show
  1. package/.openapi-generator/FILES +29 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +156 -0
  5. package/dist/apis/PetApi.d.ts +354 -0
  6. package/dist/apis/PetApi.js +423 -0
  7. package/dist/apis/StoreApi.d.ts +181 -0
  8. package/dist/apis/StoreApi.js +193 -0
  9. package/dist/apis/UserApi.d.ts +293 -0
  10. package/dist/apis/UserApi.js +318 -0
  11. package/dist/apis/index.d.ts +3 -0
  12. package/dist/apis/index.js +21 -0
  13. package/dist/esm/apis/PetApi.d.ts +354 -0
  14. package/dist/esm/apis/PetApi.js +419 -0
  15. package/dist/esm/apis/StoreApi.d.ts +181 -0
  16. package/dist/esm/apis/StoreApi.js +189 -0
  17. package/dist/esm/apis/UserApi.d.ts +293 -0
  18. package/dist/esm/apis/UserApi.js +314 -0
  19. package/dist/esm/apis/index.d.ts +3 -0
  20. package/dist/esm/apis/index.js +5 -0
  21. package/dist/esm/index.d.ts +3 -0
  22. package/dist/esm/index.js +5 -0
  23. package/dist/esm/models/Category.d.ts +38 -0
  24. package/dist/esm/models/Category.js +43 -0
  25. package/dist/esm/models/ModelApiResponse.d.ts +44 -0
  26. package/dist/esm/models/ModelApiResponse.js +45 -0
  27. package/dist/esm/models/Order.d.ts +71 -0
  28. package/dist/esm/models/Order.js +59 -0
  29. package/dist/esm/models/Pet.d.ts +73 -0
  30. package/dist/esm/models/Pet.js +65 -0
  31. package/dist/esm/models/Tag.d.ts +38 -0
  32. package/dist/esm/models/Tag.js +43 -0
  33. package/dist/esm/models/User.d.ts +74 -0
  34. package/dist/esm/models/User.js +55 -0
  35. package/dist/esm/models/index.d.ts +6 -0
  36. package/dist/esm/models/index.js +8 -0
  37. package/dist/esm/runtime.d.ts +184 -0
  38. package/dist/esm/runtime.js +334 -0
  39. package/dist/index.d.ts +3 -0
  40. package/dist/index.js +21 -0
  41. package/dist/models/Category.d.ts +38 -0
  42. package/dist/models/Category.js +50 -0
  43. package/dist/models/ModelApiResponse.d.ts +44 -0
  44. package/dist/models/ModelApiResponse.js +52 -0
  45. package/dist/models/Order.d.ts +71 -0
  46. package/dist/models/Order.js +67 -0
  47. package/dist/models/Pet.d.ts +73 -0
  48. package/dist/models/Pet.js +73 -0
  49. package/dist/models/Tag.d.ts +38 -0
  50. package/dist/models/Tag.js +50 -0
  51. package/dist/models/User.d.ts +74 -0
  52. package/dist/models/User.js +62 -0
  53. package/dist/models/index.d.ts +6 -0
  54. package/dist/models/index.js +24 -0
  55. package/dist/runtime.d.ts +184 -0
  56. package/dist/runtime.js +350 -0
  57. package/docs/Category.md +36 -0
  58. package/docs/ModelApiResponse.md +38 -0
  59. package/docs/Order.md +44 -0
  60. package/docs/Pet.md +44 -0
  61. package/docs/PetApi.md +622 -0
  62. package/docs/StoreApi.md +286 -0
  63. package/docs/Tag.md +36 -0
  64. package/docs/User.md +48 -0
  65. package/docs/UserApi.md +496 -0
  66. package/package.json +21 -0
  67. package/src/apis/PetApi.ts +739 -0
  68. package/src/apis/StoreApi.ts +323 -0
  69. package/src/apis/UserApi.ts +550 -0
  70. package/src/apis/index.ts +5 -0
  71. package/src/index.ts +5 -0
  72. package/src/models/Category.ts +73 -0
  73. package/src/models/ModelApiResponse.ts +81 -0
  74. package/src/models/Order.ts +117 -0
  75. package/src/models/Pet.ts +134 -0
  76. package/src/models/Tag.ts +73 -0
  77. package/src/models/User.ts +121 -0
  78. package/src/models/index.ts +8 -0
  79. package/src/runtime.ts +432 -0
  80. package/tsconfig.esm.json +7 -0
  81. package/tsconfig.json +16 -0
@@ -0,0 +1,286 @@
1
+ # StoreApi
2
+
3
+ All URIs are relative to *https://petstore3.swagger.io/api/v3*
4
+
5
+ | Method | HTTP request | Description |
6
+ |------------- | ------------- | -------------|
7
+ | [**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by identifier. |
8
+ | [**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status. |
9
+ | [**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID. |
10
+ | [**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet. |
11
+
12
+
13
+
14
+ ## deleteOrder
15
+
16
+ > deleteOrder(orderId)
17
+
18
+ Delete purchase order by identifier.
19
+
20
+ For valid response try integer IDs with value < 1000. Anything above 1000 or non-integers will generate API errors.
21
+
22
+ ### Example
23
+
24
+ ```ts
25
+ import {
26
+ Configuration,
27
+ StoreApi,
28
+ } from '@redhat-ecosystem-engineering/petstore-client-test';
29
+ import type { DeleteOrderRequest } from '@redhat-ecosystem-engineering/petstore-client-test';
30
+
31
+ async function example() {
32
+ console.log("🚀 Testing @redhat-ecosystem-engineering/petstore-client-test SDK...");
33
+ const api = new StoreApi();
34
+
35
+ const body = {
36
+ // number | ID of the order that needs to be deleted
37
+ orderId: 789,
38
+ } satisfies DeleteOrderRequest;
39
+
40
+ try {
41
+ const data = await api.deleteOrder(body);
42
+ console.log(data);
43
+ } catch (error) {
44
+ console.error(error);
45
+ }
46
+ }
47
+
48
+ // Run the test
49
+ example().catch(console.error);
50
+ ```
51
+
52
+ ### Parameters
53
+
54
+
55
+ | Name | Type | Description | Notes |
56
+ |------------- | ------------- | ------------- | -------------|
57
+ | **orderId** | `number` | ID of the order that needs to be deleted | [Defaults to `undefined`] |
58
+
59
+ ### Return type
60
+
61
+ `void` (Empty response body)
62
+
63
+ ### Authorization
64
+
65
+ No authorization required
66
+
67
+ ### HTTP request headers
68
+
69
+ - **Content-Type**: Not defined
70
+ - **Accept**: Not defined
71
+
72
+
73
+ ### HTTP response details
74
+ | Status code | Description | Response headers |
75
+ |-------------|-------------|------------------|
76
+ | **200** | order deleted | - |
77
+ | **400** | Invalid ID supplied | - |
78
+ | **404** | Order not found | - |
79
+ | **0** | Unexpected error | - |
80
+
81
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
82
+
83
+
84
+ ## getInventory
85
+
86
+ > { [key: string]: number; } getInventory()
87
+
88
+ Returns pet inventories by status.
89
+
90
+ Returns a map of status codes to quantities.
91
+
92
+ ### Example
93
+
94
+ ```ts
95
+ import {
96
+ Configuration,
97
+ StoreApi,
98
+ } from '@redhat-ecosystem-engineering/petstore-client-test';
99
+ import type { GetInventoryRequest } from '@redhat-ecosystem-engineering/petstore-client-test';
100
+
101
+ async function example() {
102
+ console.log("🚀 Testing @redhat-ecosystem-engineering/petstore-client-test SDK...");
103
+ const config = new Configuration({
104
+ // To configure API key authorization: api_key
105
+ apiKey: "YOUR API KEY",
106
+ });
107
+ const api = new StoreApi(config);
108
+
109
+ try {
110
+ const data = await api.getInventory();
111
+ console.log(data);
112
+ } catch (error) {
113
+ console.error(error);
114
+ }
115
+ }
116
+
117
+ // Run the test
118
+ example().catch(console.error);
119
+ ```
120
+
121
+ ### Parameters
122
+
123
+ This endpoint does not need any parameter.
124
+
125
+ ### Return type
126
+
127
+ **{ [key: string]: number; }**
128
+
129
+ ### Authorization
130
+
131
+ [api_key](../README.md#api_key)
132
+
133
+ ### HTTP request headers
134
+
135
+ - **Content-Type**: Not defined
136
+ - **Accept**: `application/json`
137
+
138
+
139
+ ### HTTP response details
140
+ | Status code | Description | Response headers |
141
+ |-------------|-------------|------------------|
142
+ | **200** | successful operation | - |
143
+ | **0** | Unexpected error | - |
144
+
145
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
146
+
147
+
148
+ ## getOrderById
149
+
150
+ > Order getOrderById(orderId)
151
+
152
+ Find purchase order by ID.
153
+
154
+ For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.
155
+
156
+ ### Example
157
+
158
+ ```ts
159
+ import {
160
+ Configuration,
161
+ StoreApi,
162
+ } from '@redhat-ecosystem-engineering/petstore-client-test';
163
+ import type { GetOrderByIdRequest } from '@redhat-ecosystem-engineering/petstore-client-test';
164
+
165
+ async function example() {
166
+ console.log("🚀 Testing @redhat-ecosystem-engineering/petstore-client-test SDK...");
167
+ const api = new StoreApi();
168
+
169
+ const body = {
170
+ // number | ID of order that needs to be fetched
171
+ orderId: 789,
172
+ } satisfies GetOrderByIdRequest;
173
+
174
+ try {
175
+ const data = await api.getOrderById(body);
176
+ console.log(data);
177
+ } catch (error) {
178
+ console.error(error);
179
+ }
180
+ }
181
+
182
+ // Run the test
183
+ example().catch(console.error);
184
+ ```
185
+
186
+ ### Parameters
187
+
188
+
189
+ | Name | Type | Description | Notes |
190
+ |------------- | ------------- | ------------- | -------------|
191
+ | **orderId** | `number` | ID of order that needs to be fetched | [Defaults to `undefined`] |
192
+
193
+ ### Return type
194
+
195
+ [**Order**](Order.md)
196
+
197
+ ### Authorization
198
+
199
+ No authorization required
200
+
201
+ ### HTTP request headers
202
+
203
+ - **Content-Type**: Not defined
204
+ - **Accept**: `application/json`, `application/xml`
205
+
206
+
207
+ ### HTTP response details
208
+ | Status code | Description | Response headers |
209
+ |-------------|-------------|------------------|
210
+ | **200** | successful operation | - |
211
+ | **400** | Invalid ID supplied | - |
212
+ | **404** | Order not found | - |
213
+ | **0** | Unexpected error | - |
214
+
215
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
216
+
217
+
218
+ ## placeOrder
219
+
220
+ > Order placeOrder(order)
221
+
222
+ Place an order for a pet.
223
+
224
+ Place a new order in the store.
225
+
226
+ ### Example
227
+
228
+ ```ts
229
+ import {
230
+ Configuration,
231
+ StoreApi,
232
+ } from '@redhat-ecosystem-engineering/petstore-client-test';
233
+ import type { PlaceOrderRequest } from '@redhat-ecosystem-engineering/petstore-client-test';
234
+
235
+ async function example() {
236
+ console.log("🚀 Testing @redhat-ecosystem-engineering/petstore-client-test SDK...");
237
+ const api = new StoreApi();
238
+
239
+ const body = {
240
+ // Order (optional)
241
+ order: ...,
242
+ } satisfies PlaceOrderRequest;
243
+
244
+ try {
245
+ const data = await api.placeOrder(body);
246
+ console.log(data);
247
+ } catch (error) {
248
+ console.error(error);
249
+ }
250
+ }
251
+
252
+ // Run the test
253
+ example().catch(console.error);
254
+ ```
255
+
256
+ ### Parameters
257
+
258
+
259
+ | Name | Type | Description | Notes |
260
+ |------------- | ------------- | ------------- | -------------|
261
+ | **order** | [Order](Order.md) | | [Optional] |
262
+
263
+ ### Return type
264
+
265
+ [**Order**](Order.md)
266
+
267
+ ### Authorization
268
+
269
+ No authorization required
270
+
271
+ ### HTTP request headers
272
+
273
+ - **Content-Type**: `application/json`, `application/xml`, `application/x-www-form-urlencoded`
274
+ - **Accept**: `application/json`
275
+
276
+
277
+ ### HTTP response details
278
+ | Status code | Description | Response headers |
279
+ |-------------|-------------|------------------|
280
+ | **200** | successful operation | - |
281
+ | **400** | Invalid input | - |
282
+ | **422** | Validation exception | - |
283
+ | **0** | Unexpected error | - |
284
+
285
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
286
+
package/docs/Tag.md ADDED
@@ -0,0 +1,36 @@
1
+
2
+ # Tag
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | number
10
+ `name` | string
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { Tag } from '@redhat-ecosystem-engineering/petstore-client-test'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "id": null,
20
+ "name": null,
21
+ } satisfies Tag
22
+
23
+ console.log(example)
24
+
25
+ // Convert the instance to a JSON string
26
+ const exampleJSON: string = JSON.stringify(example)
27
+ console.log(exampleJSON)
28
+
29
+ // Parse the JSON string back to an object
30
+ const exampleParsed = JSON.parse(exampleJSON) as Tag
31
+ console.log(exampleParsed)
32
+ ```
33
+
34
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
35
+
36
+
package/docs/User.md ADDED
@@ -0,0 +1,48 @@
1
+
2
+ # User
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | number
10
+ `username` | string
11
+ `firstName` | string
12
+ `lastName` | string
13
+ `email` | string
14
+ `password` | string
15
+ `phone` | string
16
+ `userStatus` | number
17
+
18
+ ## Example
19
+
20
+ ```typescript
21
+ import type { User } from '@redhat-ecosystem-engineering/petstore-client-test'
22
+
23
+ // TODO: Update the object below with actual values
24
+ const example = {
25
+ "id": 10,
26
+ "username": theUser,
27
+ "firstName": John,
28
+ "lastName": James,
29
+ "email": john@email.com,
30
+ "password": 12345,
31
+ "phone": 12345,
32
+ "userStatus": 1,
33
+ } satisfies User
34
+
35
+ console.log(example)
36
+
37
+ // Convert the instance to a JSON string
38
+ const exampleJSON: string = JSON.stringify(example)
39
+ console.log(exampleJSON)
40
+
41
+ // Parse the JSON string back to an object
42
+ const exampleParsed = JSON.parse(exampleJSON) as User
43
+ console.log(exampleParsed)
44
+ ```
45
+
46
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
47
+
48
+