@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.
- package/.openapi-generator/FILES +29 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +156 -0
- package/dist/apis/PetApi.d.ts +354 -0
- package/dist/apis/PetApi.js +423 -0
- package/dist/apis/StoreApi.d.ts +181 -0
- package/dist/apis/StoreApi.js +193 -0
- package/dist/apis/UserApi.d.ts +293 -0
- package/dist/apis/UserApi.js +318 -0
- package/dist/apis/index.d.ts +3 -0
- package/dist/apis/index.js +21 -0
- package/dist/esm/apis/PetApi.d.ts +354 -0
- package/dist/esm/apis/PetApi.js +419 -0
- package/dist/esm/apis/StoreApi.d.ts +181 -0
- package/dist/esm/apis/StoreApi.js +189 -0
- package/dist/esm/apis/UserApi.d.ts +293 -0
- package/dist/esm/apis/UserApi.js +314 -0
- package/dist/esm/apis/index.d.ts +3 -0
- package/dist/esm/apis/index.js +5 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/models/Category.d.ts +38 -0
- package/dist/esm/models/Category.js +43 -0
- package/dist/esm/models/ModelApiResponse.d.ts +44 -0
- package/dist/esm/models/ModelApiResponse.js +45 -0
- package/dist/esm/models/Order.d.ts +71 -0
- package/dist/esm/models/Order.js +59 -0
- package/dist/esm/models/Pet.d.ts +73 -0
- package/dist/esm/models/Pet.js +65 -0
- package/dist/esm/models/Tag.d.ts +38 -0
- package/dist/esm/models/Tag.js +43 -0
- package/dist/esm/models/User.d.ts +74 -0
- package/dist/esm/models/User.js +55 -0
- package/dist/esm/models/index.d.ts +6 -0
- package/dist/esm/models/index.js +8 -0
- package/dist/esm/runtime.d.ts +184 -0
- package/dist/esm/runtime.js +334 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/Category.d.ts +38 -0
- package/dist/models/Category.js +50 -0
- package/dist/models/ModelApiResponse.d.ts +44 -0
- package/dist/models/ModelApiResponse.js +52 -0
- package/dist/models/Order.d.ts +71 -0
- package/dist/models/Order.js +67 -0
- package/dist/models/Pet.d.ts +73 -0
- package/dist/models/Pet.js +73 -0
- package/dist/models/Tag.d.ts +38 -0
- package/dist/models/Tag.js +50 -0
- package/dist/models/User.d.ts +74 -0
- package/dist/models/User.js +62 -0
- package/dist/models/index.d.ts +6 -0
- package/dist/models/index.js +24 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +350 -0
- package/docs/Category.md +36 -0
- package/docs/ModelApiResponse.md +38 -0
- package/docs/Order.md +44 -0
- package/docs/Pet.md +44 -0
- package/docs/PetApi.md +622 -0
- package/docs/StoreApi.md +286 -0
- package/docs/Tag.md +36 -0
- package/docs/User.md +48 -0
- package/docs/UserApi.md +496 -0
- package/package.json +21 -0
- package/src/apis/PetApi.ts +739 -0
- package/src/apis/StoreApi.ts +323 -0
- package/src/apis/UserApi.ts +550 -0
- package/src/apis/index.ts +5 -0
- package/src/index.ts +5 -0
- package/src/models/Category.ts +73 -0
- package/src/models/ModelApiResponse.ts +81 -0
- package/src/models/Order.ts +117 -0
- package/src/models/Pet.ts +134 -0
- package/src/models/Tag.ts +73 -0
- package/src/models/User.ts +121 -0
- package/src/models/index.ts +8 -0
- package/src/runtime.ts +432 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swagger Petstore - OpenAPI 3.0
|
|
3
|
+
* This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about Swagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we\'ve switched to the design first approach! You can now help us improve the API whether it\'s by making changes to the definition itself or to the code. That way, with time, we can improve the API in general, and expose some of the new features in OAS3. Some useful links: - [The Pet Store repository](https://github.com/swagger-api/swagger-petstore) - [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.27
|
|
6
|
+
* Contact: apiteam@swagger.io
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { Category } from './Category.js';
|
|
13
|
+
import type { Tag } from './Tag.js';
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @export
|
|
17
|
+
* @interface Pet
|
|
18
|
+
*/
|
|
19
|
+
export interface Pet {
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @type {number}
|
|
23
|
+
* @memberof Pet
|
|
24
|
+
*/
|
|
25
|
+
id?: number;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @type {string}
|
|
29
|
+
* @memberof Pet
|
|
30
|
+
*/
|
|
31
|
+
name: string;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @type {Category}
|
|
35
|
+
* @memberof Pet
|
|
36
|
+
*/
|
|
37
|
+
category?: Category;
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @type {Array<string>}
|
|
41
|
+
* @memberof Pet
|
|
42
|
+
*/
|
|
43
|
+
photoUrls: Array<string>;
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @type {Array<Tag>}
|
|
47
|
+
* @memberof Pet
|
|
48
|
+
*/
|
|
49
|
+
tags?: Array<Tag>;
|
|
50
|
+
/**
|
|
51
|
+
* pet status in the store
|
|
52
|
+
* @type {string}
|
|
53
|
+
* @memberof Pet
|
|
54
|
+
*/
|
|
55
|
+
status?: PetStatusEnum;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @export
|
|
59
|
+
*/
|
|
60
|
+
export declare const PetStatusEnum: {
|
|
61
|
+
readonly Available: "available";
|
|
62
|
+
readonly Pending: "pending";
|
|
63
|
+
readonly Sold: "sold";
|
|
64
|
+
};
|
|
65
|
+
export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
|
66
|
+
/**
|
|
67
|
+
* Check if a given object implements the Pet interface.
|
|
68
|
+
*/
|
|
69
|
+
export declare function instanceOfPet(value: object): value is Pet;
|
|
70
|
+
export declare function PetFromJSON(json: any): Pet;
|
|
71
|
+
export declare function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet;
|
|
72
|
+
export declare function PetToJSON(json: any): Pet;
|
|
73
|
+
export declare function PetToJSONTyped(value?: Pet | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Swagger Petstore - OpenAPI 3.0
|
|
5
|
+
* This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about Swagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we\'ve switched to the design first approach! You can now help us improve the API whether it\'s by making changes to the definition itself or to the code. That way, with time, we can improve the API in general, and expose some of the new features in OAS3. Some useful links: - [The Pet Store repository](https://github.com/swagger-api/swagger-petstore) - [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.27
|
|
8
|
+
* Contact: apiteam@swagger.io
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
import { CategoryFromJSON, CategoryToJSON, } from './Category.js';
|
|
15
|
+
import { TagFromJSON, TagToJSON, } from './Tag.js';
|
|
16
|
+
/**
|
|
17
|
+
* @export
|
|
18
|
+
*/
|
|
19
|
+
export const PetStatusEnum = {
|
|
20
|
+
Available: 'available',
|
|
21
|
+
Pending: 'pending',
|
|
22
|
+
Sold: 'sold'
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Check if a given object implements the Pet interface.
|
|
26
|
+
*/
|
|
27
|
+
export function instanceOfPet(value) {
|
|
28
|
+
if (!('name' in value) || value['name'] === undefined)
|
|
29
|
+
return false;
|
|
30
|
+
if (!('photoUrls' in value) || value['photoUrls'] === undefined)
|
|
31
|
+
return false;
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
export function PetFromJSON(json) {
|
|
35
|
+
return PetFromJSONTyped(json, false);
|
|
36
|
+
}
|
|
37
|
+
export function PetFromJSONTyped(json, ignoreDiscriminator) {
|
|
38
|
+
if (json == null) {
|
|
39
|
+
return json;
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
'id': json['id'] == null ? undefined : json['id'],
|
|
43
|
+
'name': json['name'],
|
|
44
|
+
'category': json['category'] == null ? undefined : CategoryFromJSON(json['category']),
|
|
45
|
+
'photoUrls': json['photoUrls'],
|
|
46
|
+
'tags': json['tags'] == null ? undefined : (json['tags'].map(TagFromJSON)),
|
|
47
|
+
'status': json['status'] == null ? undefined : json['status'],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export function PetToJSON(json) {
|
|
51
|
+
return PetToJSONTyped(json, false);
|
|
52
|
+
}
|
|
53
|
+
export function PetToJSONTyped(value, ignoreDiscriminator = false) {
|
|
54
|
+
if (value == null) {
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
'id': value['id'],
|
|
59
|
+
'name': value['name'],
|
|
60
|
+
'category': CategoryToJSON(value['category']),
|
|
61
|
+
'photoUrls': value['photoUrls'],
|
|
62
|
+
'tags': value['tags'] == null ? undefined : (value['tags'].map(TagToJSON)),
|
|
63
|
+
'status': value['status'],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swagger Petstore - OpenAPI 3.0
|
|
3
|
+
* This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about Swagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we\'ve switched to the design first approach! You can now help us improve the API whether it\'s by making changes to the definition itself or to the code. That way, with time, we can improve the API in general, and expose some of the new features in OAS3. Some useful links: - [The Pet Store repository](https://github.com/swagger-api/swagger-petstore) - [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.27
|
|
6
|
+
* Contact: apiteam@swagger.io
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface Tag
|
|
16
|
+
*/
|
|
17
|
+
export interface Tag {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {number}
|
|
21
|
+
* @memberof Tag
|
|
22
|
+
*/
|
|
23
|
+
id?: number;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof Tag
|
|
28
|
+
*/
|
|
29
|
+
name?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Check if a given object implements the Tag interface.
|
|
33
|
+
*/
|
|
34
|
+
export declare function instanceOfTag(value: object): value is Tag;
|
|
35
|
+
export declare function TagFromJSON(json: any): Tag;
|
|
36
|
+
export declare function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag;
|
|
37
|
+
export declare function TagToJSON(json: any): Tag;
|
|
38
|
+
export declare function TagToJSONTyped(value?: Tag | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Swagger Petstore - OpenAPI 3.0
|
|
5
|
+
* This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about Swagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we\'ve switched to the design first approach! You can now help us improve the API whether it\'s by making changes to the definition itself or to the code. That way, with time, we can improve the API in general, and expose some of the new features in OAS3. Some useful links: - [The Pet Store repository](https://github.com/swagger-api/swagger-petstore) - [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.27
|
|
8
|
+
* Contact: apiteam@swagger.io
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Check if a given object implements the Tag interface.
|
|
16
|
+
*/
|
|
17
|
+
export function instanceOfTag(value) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
export function TagFromJSON(json) {
|
|
21
|
+
return TagFromJSONTyped(json, false);
|
|
22
|
+
}
|
|
23
|
+
export function TagFromJSONTyped(json, ignoreDiscriminator) {
|
|
24
|
+
if (json == null) {
|
|
25
|
+
return json;
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
'id': json['id'] == null ? undefined : json['id'],
|
|
29
|
+
'name': json['name'] == null ? undefined : json['name'],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function TagToJSON(json) {
|
|
33
|
+
return TagToJSONTyped(json, false);
|
|
34
|
+
}
|
|
35
|
+
export function TagToJSONTyped(value, ignoreDiscriminator = false) {
|
|
36
|
+
if (value == null) {
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
'id': value['id'],
|
|
41
|
+
'name': value['name'],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swagger Petstore - OpenAPI 3.0
|
|
3
|
+
* This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about Swagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we\'ve switched to the design first approach! You can now help us improve the API whether it\'s by making changes to the definition itself or to the code. That way, with time, we can improve the API in general, and expose some of the new features in OAS3. Some useful links: - [The Pet Store repository](https://github.com/swagger-api/swagger-petstore) - [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.27
|
|
6
|
+
* Contact: apiteam@swagger.io
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface User
|
|
16
|
+
*/
|
|
17
|
+
export interface User {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {number}
|
|
21
|
+
* @memberof User
|
|
22
|
+
*/
|
|
23
|
+
id?: number;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof User
|
|
28
|
+
*/
|
|
29
|
+
username?: string;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof User
|
|
34
|
+
*/
|
|
35
|
+
firstName?: string;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof User
|
|
40
|
+
*/
|
|
41
|
+
lastName?: string;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof User
|
|
46
|
+
*/
|
|
47
|
+
email?: string;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @memberof User
|
|
52
|
+
*/
|
|
53
|
+
password?: string;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @type {string}
|
|
57
|
+
* @memberof User
|
|
58
|
+
*/
|
|
59
|
+
phone?: string;
|
|
60
|
+
/**
|
|
61
|
+
* User Status
|
|
62
|
+
* @type {number}
|
|
63
|
+
* @memberof User
|
|
64
|
+
*/
|
|
65
|
+
userStatus?: number;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Check if a given object implements the User interface.
|
|
69
|
+
*/
|
|
70
|
+
export declare function instanceOfUser(value: object): value is User;
|
|
71
|
+
export declare function UserFromJSON(json: any): User;
|
|
72
|
+
export declare function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User;
|
|
73
|
+
export declare function UserToJSON(json: any): User;
|
|
74
|
+
export declare function UserToJSONTyped(value?: User | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Swagger Petstore - OpenAPI 3.0
|
|
5
|
+
* This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about Swagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we\'ve switched to the design first approach! You can now help us improve the API whether it\'s by making changes to the definition itself or to the code. That way, with time, we can improve the API in general, and expose some of the new features in OAS3. Some useful links: - [The Pet Store repository](https://github.com/swagger-api/swagger-petstore) - [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.27
|
|
8
|
+
* Contact: apiteam@swagger.io
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Check if a given object implements the User interface.
|
|
16
|
+
*/
|
|
17
|
+
export function instanceOfUser(value) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
export function UserFromJSON(json) {
|
|
21
|
+
return UserFromJSONTyped(json, false);
|
|
22
|
+
}
|
|
23
|
+
export function UserFromJSONTyped(json, ignoreDiscriminator) {
|
|
24
|
+
if (json == null) {
|
|
25
|
+
return json;
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
'id': json['id'] == null ? undefined : json['id'],
|
|
29
|
+
'username': json['username'] == null ? undefined : json['username'],
|
|
30
|
+
'firstName': json['firstName'] == null ? undefined : json['firstName'],
|
|
31
|
+
'lastName': json['lastName'] == null ? undefined : json['lastName'],
|
|
32
|
+
'email': json['email'] == null ? undefined : json['email'],
|
|
33
|
+
'password': json['password'] == null ? undefined : json['password'],
|
|
34
|
+
'phone': json['phone'] == null ? undefined : json['phone'],
|
|
35
|
+
'userStatus': json['userStatus'] == null ? undefined : json['userStatus'],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export function UserToJSON(json) {
|
|
39
|
+
return UserToJSONTyped(json, false);
|
|
40
|
+
}
|
|
41
|
+
export function UserToJSONTyped(value, ignoreDiscriminator = false) {
|
|
42
|
+
if (value == null) {
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
'id': value['id'],
|
|
47
|
+
'username': value['username'],
|
|
48
|
+
'firstName': value['firstName'],
|
|
49
|
+
'lastName': value['lastName'],
|
|
50
|
+
'email': value['email'],
|
|
51
|
+
'password': value['password'],
|
|
52
|
+
'phone': value['phone'],
|
|
53
|
+
'userStatus': value['userStatus'],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swagger Petstore - OpenAPI 3.0
|
|
3
|
+
* This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about Swagger at [https://swagger.io](https://swagger.io). In the third iteration of the pet store, we\'ve switched to the design first approach! You can now help us improve the API whether it\'s by making changes to the definition itself or to the code. That way, with time, we can improve the API in general, and expose some of the new features in OAS3. Some useful links: - [The Pet Store repository](https://github.com/swagger-api/swagger-petstore) - [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.27
|
|
6
|
+
* Contact: apiteam@swagger.io
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
export declare const BASE_PATH: string;
|
|
13
|
+
export interface ConfigurationParameters {
|
|
14
|
+
basePath?: string;
|
|
15
|
+
fetchApi?: FetchAPI;
|
|
16
|
+
middleware?: Middleware[];
|
|
17
|
+
queryParamsStringify?: (params: HTTPQuery) => string;
|
|
18
|
+
username?: string;
|
|
19
|
+
password?: string;
|
|
20
|
+
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>);
|
|
21
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>);
|
|
22
|
+
headers?: HTTPHeaders;
|
|
23
|
+
credentials?: RequestCredentials;
|
|
24
|
+
}
|
|
25
|
+
export declare class Configuration {
|
|
26
|
+
private configuration;
|
|
27
|
+
constructor(configuration?: ConfigurationParameters);
|
|
28
|
+
set config(configuration: Configuration);
|
|
29
|
+
get basePath(): string;
|
|
30
|
+
get fetchApi(): FetchAPI | undefined;
|
|
31
|
+
get middleware(): Middleware[];
|
|
32
|
+
get queryParamsStringify(): (params: HTTPQuery) => string;
|
|
33
|
+
get username(): string | undefined;
|
|
34
|
+
get password(): string | undefined;
|
|
35
|
+
get apiKey(): ((name: string) => string | Promise<string>) | undefined;
|
|
36
|
+
get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined;
|
|
37
|
+
get headers(): HTTPHeaders | undefined;
|
|
38
|
+
get credentials(): RequestCredentials | undefined;
|
|
39
|
+
}
|
|
40
|
+
export declare const DefaultConfig: Configuration;
|
|
41
|
+
/**
|
|
42
|
+
* This is the base class for all generated API classes.
|
|
43
|
+
*/
|
|
44
|
+
export declare class BaseAPI {
|
|
45
|
+
protected configuration: Configuration;
|
|
46
|
+
private static readonly jsonRegex;
|
|
47
|
+
private middleware;
|
|
48
|
+
constructor(configuration?: Configuration);
|
|
49
|
+
withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]): T;
|
|
50
|
+
withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>): T;
|
|
51
|
+
withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>): T;
|
|
52
|
+
/**
|
|
53
|
+
* Check if the given MIME is a JSON MIME.
|
|
54
|
+
* JSON MIME examples:
|
|
55
|
+
* application/json
|
|
56
|
+
* application/json; charset=UTF8
|
|
57
|
+
* APPLICATION/JSON
|
|
58
|
+
* application/vnd.company+json
|
|
59
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
60
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
61
|
+
*/
|
|
62
|
+
protected isJsonMime(mime: string | null | undefined): boolean;
|
|
63
|
+
protected request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response>;
|
|
64
|
+
private createFetchParams;
|
|
65
|
+
private fetchApi;
|
|
66
|
+
/**
|
|
67
|
+
* Create a shallow clone of `this` by constructing a new instance
|
|
68
|
+
* and then shallow cloning data members.
|
|
69
|
+
*/
|
|
70
|
+
private clone;
|
|
71
|
+
}
|
|
72
|
+
export declare class ResponseError extends Error {
|
|
73
|
+
response: Response;
|
|
74
|
+
name: "ResponseError";
|
|
75
|
+
constructor(response: Response, msg?: string);
|
|
76
|
+
}
|
|
77
|
+
export declare class FetchError extends Error {
|
|
78
|
+
cause: Error;
|
|
79
|
+
name: "FetchError";
|
|
80
|
+
constructor(cause: Error, msg?: string);
|
|
81
|
+
}
|
|
82
|
+
export declare class RequiredError extends Error {
|
|
83
|
+
field: string;
|
|
84
|
+
name: "RequiredError";
|
|
85
|
+
constructor(field: string, msg?: string);
|
|
86
|
+
}
|
|
87
|
+
export declare const COLLECTION_FORMATS: {
|
|
88
|
+
csv: string;
|
|
89
|
+
ssv: string;
|
|
90
|
+
tsv: string;
|
|
91
|
+
pipes: string;
|
|
92
|
+
};
|
|
93
|
+
export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
|
|
94
|
+
export type Json = any;
|
|
95
|
+
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
|
|
96
|
+
export type HTTPHeaders = {
|
|
97
|
+
[key: string]: string;
|
|
98
|
+
};
|
|
99
|
+
export type HTTPQuery = {
|
|
100
|
+
[key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery;
|
|
101
|
+
};
|
|
102
|
+
export type HTTPBody = Json | FormData | URLSearchParams;
|
|
103
|
+
export type HTTPRequestInit = {
|
|
104
|
+
headers?: HTTPHeaders;
|
|
105
|
+
method: HTTPMethod;
|
|
106
|
+
credentials?: RequestCredentials;
|
|
107
|
+
body?: HTTPBody;
|
|
108
|
+
};
|
|
109
|
+
export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
|
|
110
|
+
export type InitOverrideFunction = (requestContext: {
|
|
111
|
+
init: HTTPRequestInit;
|
|
112
|
+
context: RequestOpts;
|
|
113
|
+
}) => Promise<RequestInit>;
|
|
114
|
+
export interface FetchParams {
|
|
115
|
+
url: string;
|
|
116
|
+
init: RequestInit;
|
|
117
|
+
}
|
|
118
|
+
export interface RequestOpts {
|
|
119
|
+
path: string;
|
|
120
|
+
method: HTTPMethod;
|
|
121
|
+
headers: HTTPHeaders;
|
|
122
|
+
query?: HTTPQuery;
|
|
123
|
+
body?: HTTPBody;
|
|
124
|
+
}
|
|
125
|
+
export declare function querystring(params: HTTPQuery, prefix?: string): string;
|
|
126
|
+
export declare function exists(json: any, key: string): boolean;
|
|
127
|
+
export declare function mapValues(data: any, fn: (item: any) => any): {
|
|
128
|
+
[key: string]: any;
|
|
129
|
+
};
|
|
130
|
+
export declare function canConsumeForm(consumes: Consume[]): boolean;
|
|
131
|
+
export interface Consume {
|
|
132
|
+
contentType: string;
|
|
133
|
+
}
|
|
134
|
+
export interface RequestContext {
|
|
135
|
+
fetch: FetchAPI;
|
|
136
|
+
url: string;
|
|
137
|
+
init: RequestInit;
|
|
138
|
+
}
|
|
139
|
+
export interface ResponseContext {
|
|
140
|
+
fetch: FetchAPI;
|
|
141
|
+
url: string;
|
|
142
|
+
init: RequestInit;
|
|
143
|
+
response: Response;
|
|
144
|
+
}
|
|
145
|
+
export interface ErrorContext {
|
|
146
|
+
fetch: FetchAPI;
|
|
147
|
+
url: string;
|
|
148
|
+
init: RequestInit;
|
|
149
|
+
error: unknown;
|
|
150
|
+
response?: Response;
|
|
151
|
+
}
|
|
152
|
+
export interface Middleware {
|
|
153
|
+
pre?(context: RequestContext): Promise<FetchParams | void>;
|
|
154
|
+
post?(context: ResponseContext): Promise<Response | void>;
|
|
155
|
+
onError?(context: ErrorContext): Promise<Response | void>;
|
|
156
|
+
}
|
|
157
|
+
export interface ApiResponse<T> {
|
|
158
|
+
raw: Response;
|
|
159
|
+
value(): Promise<T>;
|
|
160
|
+
}
|
|
161
|
+
export interface ResponseTransformer<T> {
|
|
162
|
+
(json: any): T;
|
|
163
|
+
}
|
|
164
|
+
export declare class JSONApiResponse<T> {
|
|
165
|
+
raw: Response;
|
|
166
|
+
private transformer;
|
|
167
|
+
constructor(raw: Response, transformer?: ResponseTransformer<T>);
|
|
168
|
+
value(): Promise<T>;
|
|
169
|
+
}
|
|
170
|
+
export declare class VoidApiResponse {
|
|
171
|
+
raw: Response;
|
|
172
|
+
constructor(raw: Response);
|
|
173
|
+
value(): Promise<void>;
|
|
174
|
+
}
|
|
175
|
+
export declare class BlobApiResponse {
|
|
176
|
+
raw: Response;
|
|
177
|
+
constructor(raw: Response);
|
|
178
|
+
value(): Promise<Blob>;
|
|
179
|
+
}
|
|
180
|
+
export declare class TextApiResponse {
|
|
181
|
+
raw: Response;
|
|
182
|
+
constructor(raw: Response);
|
|
183
|
+
value(): Promise<string>;
|
|
184
|
+
}
|