@tennac-booking/sdk 1.0.5 → 1.0.8

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 (130) hide show
  1. package/.openapi-generator/FILES +1 -1
  2. package/README.md +1 -2
  3. package/api.ts +8 -273
  4. package/dist/api.d.ts +4 -156
  5. package/dist/api.js +9 -174
  6. package/dist/esm/api.d.ts +4 -156
  7. package/dist/esm/api.js +9 -170
  8. package/docs/UsersApi.md +4 -4
  9. package/package.json +4 -4
  10. package/apis/AuthApi.ts +0 -157
  11. package/apis/UsersApi.ts +0 -56
  12. package/apis/index.ts +0 -4
  13. package/dist/apis/AuthApi.d.ts +0 -39
  14. package/dist/apis/AuthApi.js +0 -117
  15. package/dist/apis/UsersApi.d.ts +0 -26
  16. package/dist/apis/UsersApi.js +0 -58
  17. package/dist/apis/index.d.ts +0 -2
  18. package/dist/apis/index.js +0 -20
  19. package/dist/esm/apis/AuthApi.d.ts +0 -39
  20. package/dist/esm/apis/AuthApi.js +0 -113
  21. package/dist/esm/apis/UsersApi.d.ts +0 -26
  22. package/dist/esm/apis/UsersApi.js +0 -54
  23. package/dist/esm/apis/index.d.ts +0 -2
  24. package/dist/esm/apis/index.js +0 -4
  25. package/dist/esm/models/Booking.d.ts +0 -87
  26. package/dist/esm/models/Booking.js +0 -82
  27. package/dist/esm/models/Court.d.ts +0 -76
  28. package/dist/esm/models/Court.js +0 -72
  29. package/dist/esm/models/Slot.d.ts +0 -44
  30. package/dist/esm/models/Slot.js +0 -51
  31. package/dist/esm/models/SlotException.d.ts +0 -50
  32. package/dist/esm/models/SlotException.js +0 -55
  33. package/dist/esm/models/User.d.ts +0 -92
  34. package/dist/esm/models/User.js +0 -69
  35. package/dist/esm/models/index.d.ts +0 -5
  36. package/dist/esm/models/index.js +0 -7
  37. package/dist/esm/runtime.d.ts +0 -184
  38. package/dist/esm/runtime.js +0 -334
  39. package/dist/esm/src/apis/AuthApi.d.ts +0 -39
  40. package/dist/esm/src/apis/AuthApi.js +0 -113
  41. package/dist/esm/src/apis/UsersApi.d.ts +0 -26
  42. package/dist/esm/src/apis/UsersApi.js +0 -54
  43. package/dist/esm/src/apis/index.d.ts +0 -2
  44. package/dist/esm/src/apis/index.js +0 -4
  45. package/dist/esm/src/index.d.ts +0 -3
  46. package/dist/esm/src/index.js +0 -5
  47. package/dist/esm/src/models/Booking.d.ts +0 -87
  48. package/dist/esm/src/models/Booking.js +0 -82
  49. package/dist/esm/src/models/BookingStatus.d.ts +0 -25
  50. package/dist/esm/src/models/BookingStatus.js +0 -43
  51. package/dist/esm/src/models/Court.d.ts +0 -76
  52. package/dist/esm/src/models/Court.js +0 -72
  53. package/dist/esm/src/models/CourtStatus.d.ts +0 -25
  54. package/dist/esm/src/models/CourtStatus.js +0 -43
  55. package/dist/esm/src/models/Slot.d.ts +0 -44
  56. package/dist/esm/src/models/Slot.js +0 -51
  57. package/dist/esm/src/models/SlotException.d.ts +0 -50
  58. package/dist/esm/src/models/SlotException.js +0 -55
  59. package/dist/esm/src/models/StripeStatus.d.ts +0 -28
  60. package/dist/esm/src/models/StripeStatus.js +0 -46
  61. package/dist/esm/src/models/User.d.ts +0 -92
  62. package/dist/esm/src/models/User.js +0 -69
  63. package/dist/esm/src/models/index.d.ts +0 -5
  64. package/dist/esm/src/models/index.js +0 -7
  65. package/dist/esm/src/runtime.d.ts +0 -184
  66. package/dist/esm/src/runtime.js +0 -334
  67. package/dist/models/Booking.d.ts +0 -87
  68. package/dist/models/Booking.js +0 -90
  69. package/dist/models/Court.d.ts +0 -76
  70. package/dist/models/Court.js +0 -80
  71. package/dist/models/Slot.d.ts +0 -44
  72. package/dist/models/Slot.js +0 -58
  73. package/dist/models/SlotException.d.ts +0 -50
  74. package/dist/models/SlotException.js +0 -62
  75. package/dist/models/User.d.ts +0 -92
  76. package/dist/models/User.js +0 -76
  77. package/dist/models/index.d.ts +0 -5
  78. package/dist/models/index.js +0 -23
  79. package/dist/runtime.d.ts +0 -184
  80. package/dist/runtime.js +0 -350
  81. package/dist/src/apis/AuthApi.d.ts +0 -39
  82. package/dist/src/apis/AuthApi.js +0 -117
  83. package/dist/src/apis/UsersApi.d.ts +0 -26
  84. package/dist/src/apis/UsersApi.js +0 -58
  85. package/dist/src/apis/index.d.ts +0 -2
  86. package/dist/src/apis/index.js +0 -20
  87. package/dist/src/index.d.ts +0 -3
  88. package/dist/src/index.js +0 -21
  89. package/dist/src/models/Booking.d.ts +0 -87
  90. package/dist/src/models/Booking.js +0 -90
  91. package/dist/src/models/BookingStatus.d.ts +0 -25
  92. package/dist/src/models/BookingStatus.js +0 -51
  93. package/dist/src/models/Court.d.ts +0 -76
  94. package/dist/src/models/Court.js +0 -80
  95. package/dist/src/models/CourtStatus.d.ts +0 -25
  96. package/dist/src/models/CourtStatus.js +0 -51
  97. package/dist/src/models/Slot.d.ts +0 -44
  98. package/dist/src/models/Slot.js +0 -58
  99. package/dist/src/models/SlotException.d.ts +0 -50
  100. package/dist/src/models/SlotException.js +0 -62
  101. package/dist/src/models/StripeStatus.d.ts +0 -28
  102. package/dist/src/models/StripeStatus.js +0 -54
  103. package/dist/src/models/User.d.ts +0 -92
  104. package/dist/src/models/User.js +0 -76
  105. package/dist/src/models/index.d.ts +0 -5
  106. package/dist/src/models/index.js +0 -23
  107. package/dist/src/runtime.d.ts +0 -184
  108. package/dist/src/runtime.js +0 -350
  109. package/docs/AuthApi.md +0 -88
  110. package/models/Booking.ts +0 -142
  111. package/models/Court.ts +0 -130
  112. package/models/Slot.ts +0 -84
  113. package/models/SlotException.ts +0 -93
  114. package/models/User.ts +0 -149
  115. package/models/index.ts +0 -7
  116. package/runtime.ts +0 -432
  117. package/src/apis/AuthApi.ts +0 -157
  118. package/src/apis/UsersApi.ts +0 -56
  119. package/src/apis/index.ts +0 -4
  120. package/src/index.ts +0 -5
  121. package/src/models/Booking.ts +0 -142
  122. package/src/models/BookingStatus.ts +0 -53
  123. package/src/models/Court.ts +0 -130
  124. package/src/models/CourtStatus.ts +0 -53
  125. package/src/models/Slot.ts +0 -84
  126. package/src/models/SlotException.ts +0 -93
  127. package/src/models/StripeStatus.ts +0 -56
  128. package/src/models/User.ts +0 -149
  129. package/src/models/index.ts +0 -7
  130. package/src/runtime.ts +0 -432
@@ -1,44 +0,0 @@
1
- /**
2
- * Pickle Ball API
3
- * API for managing pickle ball games and players
4
- *
5
- * The version of the OpenAPI document: 1.0.0
6
- *
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 Slot
16
- */
17
- export interface Slot {
18
- /**
19
- *
20
- * @type {Date}
21
- * @memberof Slot
22
- */
23
- startDate: Date;
24
- /**
25
- *
26
- * @type {Date}
27
- * @memberof Slot
28
- */
29
- endDate: Date;
30
- /**
31
- *
32
- * @type {string}
33
- * @memberof Slot
34
- */
35
- courtId: string;
36
- }
37
- /**
38
- * Check if a given object implements the Slot interface.
39
- */
40
- export declare function instanceOfSlot(value: object): value is Slot;
41
- export declare function SlotFromJSON(json: any): Slot;
42
- export declare function SlotFromJSONTyped(json: any, ignoreDiscriminator: boolean): Slot;
43
- export declare function SlotToJSON(json: any): Slot;
44
- export declare function SlotToJSONTyped(value?: Slot | null, ignoreDiscriminator?: boolean): any;
@@ -1,58 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * Pickle Ball API
6
- * API for managing pickle ball games and players
7
- *
8
- * The version of the OpenAPI document: 1.0.0
9
- *
10
- *
11
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
- * https://openapi-generator.tech
13
- * Do not edit the class manually.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.instanceOfSlot = instanceOfSlot;
17
- exports.SlotFromJSON = SlotFromJSON;
18
- exports.SlotFromJSONTyped = SlotFromJSONTyped;
19
- exports.SlotToJSON = SlotToJSON;
20
- exports.SlotToJSONTyped = SlotToJSONTyped;
21
- /**
22
- * Check if a given object implements the Slot interface.
23
- */
24
- function instanceOfSlot(value) {
25
- if (!('startDate' in value) || value['startDate'] === undefined)
26
- return false;
27
- if (!('endDate' in value) || value['endDate'] === undefined)
28
- return false;
29
- if (!('courtId' in value) || value['courtId'] === undefined)
30
- return false;
31
- return true;
32
- }
33
- function SlotFromJSON(json) {
34
- return SlotFromJSONTyped(json, false);
35
- }
36
- function SlotFromJSONTyped(json, ignoreDiscriminator) {
37
- if (json == null) {
38
- return json;
39
- }
40
- return {
41
- 'startDate': (new Date(json['startDate'])),
42
- 'endDate': (new Date(json['endDate'])),
43
- 'courtId': json['courtId'],
44
- };
45
- }
46
- function SlotToJSON(json) {
47
- return SlotToJSONTyped(json, false);
48
- }
49
- function SlotToJSONTyped(value, ignoreDiscriminator = false) {
50
- if (value == null) {
51
- return value;
52
- }
53
- return {
54
- 'startDate': ((value['startDate']).toISOString()),
55
- 'endDate': ((value['endDate']).toISOString()),
56
- 'courtId': value['courtId'],
57
- };
58
- }
@@ -1,50 +0,0 @@
1
- /**
2
- * Pickle Ball API
3
- * API for managing pickle ball games and players
4
- *
5
- * The version of the OpenAPI document: 1.0.0
6
- *
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 SlotException
16
- */
17
- export interface SlotException {
18
- /**
19
- *
20
- * @type {Date}
21
- * @memberof SlotException
22
- */
23
- startDate: Date;
24
- /**
25
- *
26
- * @type {Date}
27
- * @memberof SlotException
28
- */
29
- endDate: Date;
30
- /**
31
- *
32
- * @type {string}
33
- * @memberof SlotException
34
- */
35
- courtId: string;
36
- /**
37
- *
38
- * @type {string}
39
- * @memberof SlotException
40
- */
41
- reason: string;
42
- }
43
- /**
44
- * Check if a given object implements the SlotException interface.
45
- */
46
- export declare function instanceOfSlotException(value: object): value is SlotException;
47
- export declare function SlotExceptionFromJSON(json: any): SlotException;
48
- export declare function SlotExceptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): SlotException;
49
- export declare function SlotExceptionToJSON(json: any): SlotException;
50
- export declare function SlotExceptionToJSONTyped(value?: SlotException | null, ignoreDiscriminator?: boolean): any;
@@ -1,62 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * Pickle Ball API
6
- * API for managing pickle ball games and players
7
- *
8
- * The version of the OpenAPI document: 1.0.0
9
- *
10
- *
11
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
- * https://openapi-generator.tech
13
- * Do not edit the class manually.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.instanceOfSlotException = instanceOfSlotException;
17
- exports.SlotExceptionFromJSON = SlotExceptionFromJSON;
18
- exports.SlotExceptionFromJSONTyped = SlotExceptionFromJSONTyped;
19
- exports.SlotExceptionToJSON = SlotExceptionToJSON;
20
- exports.SlotExceptionToJSONTyped = SlotExceptionToJSONTyped;
21
- /**
22
- * Check if a given object implements the SlotException interface.
23
- */
24
- function instanceOfSlotException(value) {
25
- if (!('startDate' in value) || value['startDate'] === undefined)
26
- return false;
27
- if (!('endDate' in value) || value['endDate'] === undefined)
28
- return false;
29
- if (!('courtId' in value) || value['courtId'] === undefined)
30
- return false;
31
- if (!('reason' in value) || value['reason'] === undefined)
32
- return false;
33
- return true;
34
- }
35
- function SlotExceptionFromJSON(json) {
36
- return SlotExceptionFromJSONTyped(json, false);
37
- }
38
- function SlotExceptionFromJSONTyped(json, ignoreDiscriminator) {
39
- if (json == null) {
40
- return json;
41
- }
42
- return {
43
- 'startDate': (new Date(json['startDate'])),
44
- 'endDate': (new Date(json['endDate'])),
45
- 'courtId': json['courtId'],
46
- 'reason': json['reason'],
47
- };
48
- }
49
- function SlotExceptionToJSON(json) {
50
- return SlotExceptionToJSONTyped(json, false);
51
- }
52
- function SlotExceptionToJSONTyped(value, ignoreDiscriminator = false) {
53
- if (value == null) {
54
- return value;
55
- }
56
- return {
57
- 'startDate': ((value['startDate']).toISOString()),
58
- 'endDate': ((value['endDate']).toISOString()),
59
- 'courtId': value['courtId'],
60
- 'reason': value['reason'],
61
- };
62
- }
@@ -1,92 +0,0 @@
1
- /**
2
- * Pickle Ball API
3
- * API for managing pickle ball games and players
4
- *
5
- * The version of the OpenAPI document: 1.0.0
6
- *
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 {string}
21
- * @memberof User
22
- */
23
- username?: string;
24
- /**
25
- *
26
- * @type {string}
27
- * @memberof User
28
- */
29
- firstName: string;
30
- /**
31
- *
32
- * @type {string}
33
- * @memberof User
34
- */
35
- lastName: string;
36
- /**
37
- *
38
- * @type {string}
39
- * @memberof User
40
- */
41
- email: string;
42
- /**
43
- *
44
- * @type {boolean}
45
- * @memberof User
46
- */
47
- isAccountVerified?: boolean;
48
- /**
49
- *
50
- * @type {string}
51
- * @memberof User
52
- */
53
- level?: string;
54
- /**
55
- *
56
- * @type {string}
57
- * @memberof User
58
- */
59
- stripeCustomerId?: string;
60
- /**
61
- *
62
- * @type {string}
63
- * @memberof User
64
- */
65
- phone?: string;
66
- /**
67
- *
68
- * @type {string}
69
- * @memberof User
70
- */
71
- password: string;
72
- /**
73
- *
74
- * @type {string}
75
- * @memberof User
76
- */
77
- profilePicture?: string;
78
- /**
79
- *
80
- * @type {boolean}
81
- * @memberof User
82
- */
83
- isAdmin?: boolean;
84
- }
85
- /**
86
- * Check if a given object implements the User interface.
87
- */
88
- export declare function instanceOfUser(value: object): value is User;
89
- export declare function UserFromJSON(json: any): User;
90
- export declare function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User;
91
- export declare function UserToJSON(json: any): User;
92
- export declare function UserToJSONTyped(value?: User | null, ignoreDiscriminator?: boolean): any;
@@ -1,76 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /**
5
- * Pickle Ball API
6
- * API for managing pickle ball games and players
7
- *
8
- * The version of the OpenAPI document: 1.0.0
9
- *
10
- *
11
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
- * https://openapi-generator.tech
13
- * Do not edit the class manually.
14
- */
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.instanceOfUser = instanceOfUser;
17
- exports.UserFromJSON = UserFromJSON;
18
- exports.UserFromJSONTyped = UserFromJSONTyped;
19
- exports.UserToJSON = UserToJSON;
20
- exports.UserToJSONTyped = UserToJSONTyped;
21
- /**
22
- * Check if a given object implements the User interface.
23
- */
24
- function instanceOfUser(value) {
25
- if (!('firstName' in value) || value['firstName'] === undefined)
26
- return false;
27
- if (!('lastName' in value) || value['lastName'] === undefined)
28
- return false;
29
- if (!('email' in value) || value['email'] === undefined)
30
- return false;
31
- if (!('password' in value) || value['password'] === undefined)
32
- return false;
33
- return true;
34
- }
35
- function UserFromJSON(json) {
36
- return UserFromJSONTyped(json, false);
37
- }
38
- function UserFromJSONTyped(json, ignoreDiscriminator) {
39
- if (json == null) {
40
- return json;
41
- }
42
- return {
43
- 'username': json['username'] == null ? undefined : json['username'],
44
- 'firstName': json['firstName'],
45
- 'lastName': json['lastName'],
46
- 'email': json['email'],
47
- 'isAccountVerified': json['isAccountVerified'] == null ? undefined : json['isAccountVerified'],
48
- 'level': json['level'] == null ? undefined : json['level'],
49
- 'stripeCustomerId': json['stripeCustomerId'] == null ? undefined : json['stripeCustomerId'],
50
- 'phone': json['phone'] == null ? undefined : json['phone'],
51
- 'password': json['password'],
52
- 'profilePicture': json['profilePicture'] == null ? undefined : json['profilePicture'],
53
- 'isAdmin': json['isAdmin'] == null ? undefined : json['isAdmin'],
54
- };
55
- }
56
- function UserToJSON(json) {
57
- return UserToJSONTyped(json, false);
58
- }
59
- function UserToJSONTyped(value, ignoreDiscriminator = false) {
60
- if (value == null) {
61
- return value;
62
- }
63
- return {
64
- 'username': value['username'],
65
- 'firstName': value['firstName'],
66
- 'lastName': value['lastName'],
67
- 'email': value['email'],
68
- 'isAccountVerified': value['isAccountVerified'],
69
- 'level': value['level'],
70
- 'stripeCustomerId': value['stripeCustomerId'],
71
- 'phone': value['phone'],
72
- 'password': value['password'],
73
- 'profilePicture': value['profilePicture'],
74
- 'isAdmin': value['isAdmin'],
75
- };
76
- }
@@ -1,5 +0,0 @@
1
- export * from './Booking';
2
- export * from './Court';
3
- export * from './Slot';
4
- export * from './SlotException';
5
- export * from './User';
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- /* tslint:disable */
18
- /* eslint-disable */
19
- __exportStar(require("./Booking"), exports);
20
- __exportStar(require("./Court"), exports);
21
- __exportStar(require("./Slot"), exports);
22
- __exportStar(require("./SlotException"), exports);
23
- __exportStar(require("./User"), exports);
package/dist/runtime.d.ts DELETED
@@ -1,184 +0,0 @@
1
- /**
2
- * Pickle Ball API
3
- * API for managing pickle ball games and players
4
- *
5
- * The version of the OpenAPI document: 1.0.0
6
- *
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
- }