esisl_genoa_client 0.1.1 → 0.1.5

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 (250) hide show
  1. package/.openapi-generator/FILES +105 -0
  2. package/README.md +117 -5
  3. package/dist/apis/AllianceApi.d.ts +17 -17
  4. package/dist/apis/AllianceApi.js +13 -17
  5. package/dist/apis/AssetsApi.d.ts +25 -25
  6. package/dist/apis/AssetsApi.js +19 -25
  7. package/dist/apis/CalendarApi.d.ts +17 -17
  8. package/dist/apis/CalendarApi.js +13 -18
  9. package/dist/apis/CharacterApi.d.ts +57 -57
  10. package/dist/apis/CharacterApi.js +43 -63
  11. package/dist/apis/ClonesApi.d.ts +9 -9
  12. package/dist/apis/ClonesApi.js +7 -9
  13. package/dist/apis/ContactsApi.d.ts +37 -37
  14. package/dist/apis/ContactsApi.js +28 -39
  15. package/dist/apis/ContractsApi.d.ts +37 -37
  16. package/dist/apis/ContractsApi.js +28 -37
  17. package/dist/apis/CorporationApi.d.ts +89 -89
  18. package/dist/apis/CorporationApi.js +67 -95
  19. package/dist/apis/CorporationProjectsApi.d.ts +284 -0
  20. package/dist/apis/CorporationProjectsApi.js +491 -0
  21. package/dist/apis/DogmaApi.d.ts +21 -21
  22. package/dist/apis/DogmaApi.js +16 -21
  23. package/dist/apis/FactionWarfareApi.d.ts +33 -33
  24. package/dist/apis/FactionWarfareApi.js +25 -33
  25. package/dist/apis/FittingsApi.d.ts +13 -13
  26. package/dist/apis/FittingsApi.js +10 -14
  27. package/dist/apis/FleetsApi.d.ts +57 -57
  28. package/dist/apis/FleetsApi.js +43 -65
  29. package/dist/apis/FreelanceJobsApi.d.ts +386 -0
  30. package/dist/apis/FreelanceJobsApi.js +656 -0
  31. package/dist/apis/IncursionsApi.d.ts +5 -5
  32. package/dist/apis/IncursionsApi.js +4 -5
  33. package/dist/apis/IndustryApi.d.ts +33 -33
  34. package/dist/apis/IndustryApi.js +25 -33
  35. package/dist/apis/InsuranceApi.d.ts +5 -5
  36. package/dist/apis/InsuranceApi.js +4 -5
  37. package/dist/apis/KillmailsApi.d.ts +13 -13
  38. package/dist/apis/KillmailsApi.js +10 -13
  39. package/dist/apis/LocationApi.d.ts +13 -13
  40. package/dist/apis/LocationApi.js +10 -13
  41. package/dist/apis/LoyaltyApi.d.ts +9 -9
  42. package/dist/apis/LoyaltyApi.js +7 -9
  43. package/dist/apis/MailApi.d.ts +37 -37
  44. package/dist/apis/MailApi.js +28 -52
  45. package/dist/apis/MarketApi.d.ts +45 -45
  46. package/dist/apis/MarketApi.js +34 -45
  47. package/dist/apis/MetaApi.d.ts +64 -10
  48. package/dist/apis/MetaApi.js +94 -10
  49. package/dist/apis/PlanetaryInteractionApi.d.ts +17 -17
  50. package/dist/apis/PlanetaryInteractionApi.js +13 -17
  51. package/dist/apis/RoutesApi.d.ts +27 -39
  52. package/dist/apis/RoutesApi.js +40 -55
  53. package/dist/apis/SearchApi.d.ts +5 -5
  54. package/dist/apis/SearchApi.js +4 -5
  55. package/dist/apis/SkillsApi.d.ts +13 -13
  56. package/dist/apis/SkillsApi.js +10 -13
  57. package/dist/apis/SovereigntyApi.d.ts +13 -13
  58. package/dist/apis/SovereigntyApi.js +10 -13
  59. package/dist/apis/StatusApi.d.ts +5 -5
  60. package/dist/apis/StatusApi.js +4 -5
  61. package/dist/apis/UniverseApi.d.ts +121 -121
  62. package/dist/apis/UniverseApi.js +91 -121
  63. package/dist/apis/UserInterfaceApi.d.ts +21 -21
  64. package/dist/apis/UserInterfaceApi.js +16 -26
  65. package/dist/apis/WalletApi.d.ts +25 -25
  66. package/dist/apis/WalletApi.js +19 -31
  67. package/dist/apis/WarsApi.d.ts +13 -13
  68. package/dist/apis/WarsApi.js +10 -13
  69. package/dist/apis/index.d.ts +2 -0
  70. package/dist/apis/index.js +2 -0
  71. package/dist/models/index.d.ts +2339 -295
  72. package/dist/models/index.js +165 -2
  73. package/dist/runtime.d.ts +6 -56
  74. package/dist/runtime.js +4 -309
  75. package/docs/AllianceApi.md +8 -8
  76. package/docs/AllianceId.md +14 -0
  77. package/docs/AssetsApi.md +12 -12
  78. package/docs/CalendarApi.md +8 -8
  79. package/docs/CaptureFwComplex.md +14 -0
  80. package/docs/CharacterApi.md +28 -28
  81. package/docs/CharacterId.md +14 -0
  82. package/docs/CharactersFreelanceJobsListing.md +14 -0
  83. package/docs/CharactersFreelanceJobsParticipation.md +16 -0
  84. package/docs/ClonesApi.md +4 -4
  85. package/docs/ConstellationId.md +14 -0
  86. package/docs/ContactsApi.md +18 -18
  87. package/docs/ContractsApi.md +18 -18
  88. package/docs/CorporationApi.md +44 -44
  89. package/docs/CorporationId.md +14 -0
  90. package/docs/CorporationItemDelivery.md +14 -0
  91. package/docs/CorporationProjectsApi.md +387 -0
  92. package/docs/CorporationsFreelanceJobsListing.md +15 -0
  93. package/docs/CorporationsFreelanceJobsParticipants.md +15 -0
  94. package/docs/CorporationsFreelanceJobsParticipantsParticipant.md +17 -0
  95. package/docs/CorporationsProjectsContribution.md +15 -0
  96. package/docs/CorporationsProjectsContributors.md +15 -0
  97. package/docs/CorporationsProjectsContributorsContributor.md +16 -0
  98. package/docs/CorporationsProjectsDetail.md +23 -0
  99. package/docs/CorporationsProjectsDetailConfiguration.md +31 -0
  100. package/docs/CorporationsProjectsDetailConfigurationcapturefwcomplex.md +16 -0
  101. package/docs/CorporationsProjectsDetailConfigurationcapturefwcomplexLocationsInner.md +16 -0
  102. package/docs/CorporationsProjectsDetailConfigurationdamageship.md +16 -0
  103. package/docs/CorporationsProjectsDetailConfigurationdamageshipIdentitiesInner.md +17 -0
  104. package/docs/CorporationsProjectsDetailConfigurationdamageshipShipsInner.md +15 -0
  105. package/docs/CorporationsProjectsDetailConfigurationdefendfwcomplex.md +16 -0
  106. package/docs/CorporationsProjectsDetailConfigurationdeliveritem.md +16 -0
  107. package/docs/CorporationsProjectsDetailConfigurationdeliveritemDockingLocationsInner.md +15 -0
  108. package/docs/CorporationsProjectsDetailConfigurationdeliveritemItemsInner.md +15 -0
  109. package/docs/CorporationsProjectsDetailConfigurationdestroynpc.md +14 -0
  110. package/docs/CorporationsProjectsDetailConfigurationdestroyship.md +16 -0
  111. package/docs/CorporationsProjectsDetailConfigurationearnloyaltypoints.md +14 -0
  112. package/docs/CorporationsProjectsDetailConfigurationlostship.md +16 -0
  113. package/docs/CorporationsProjectsDetailConfigurationmanufactureitem.md +16 -0
  114. package/docs/CorporationsProjectsDetailConfigurationmatcherarchetype.md +14 -0
  115. package/docs/CorporationsProjectsDetailConfigurationmatchercorporation.md +14 -0
  116. package/docs/CorporationsProjectsDetailConfigurationmatcherfaction.md +14 -0
  117. package/docs/CorporationsProjectsDetailConfigurationmatchersignature.md +14 -0
  118. package/docs/CorporationsProjectsDetailConfigurationminematerial.md +15 -0
  119. package/docs/CorporationsProjectsDetailConfigurationremoteboostshield.md +16 -0
  120. package/docs/CorporationsProjectsDetailConfigurationremoterepairarmor.md +16 -0
  121. package/docs/CorporationsProjectsDetailConfigurationsalvagewreck.md +14 -0
  122. package/docs/CorporationsProjectsDetailConfigurationscansignature.md +15 -0
  123. package/docs/CorporationsProjectsDetailConfigurationshipinsurance.md +18 -0
  124. package/docs/CorporationsProjectsDetailConfigurationunknown.md +15 -0
  125. package/docs/CorporationsProjectsDetailContribution.md +17 -0
  126. package/docs/CorporationsProjectsDetailCreator.md +15 -0
  127. package/docs/CorporationsProjectsDetailDetails.md +18 -0
  128. package/docs/CorporationsProjectsDetailProgress.md +15 -0
  129. package/docs/CorporationsProjectsDetailProject.md +19 -0
  130. package/docs/CorporationsProjectsDetailReward.md +15 -0
  131. package/docs/CorporationsProjectsListing.md +15 -0
  132. package/docs/Cursor.md +15 -0
  133. package/docs/DamageShip.md +14 -0
  134. package/docs/DefendFwComplex.md +14 -0
  135. package/docs/DeliverItem.md +14 -0
  136. package/docs/DestroyNpc.md +14 -0
  137. package/docs/DestroyShip.md +14 -0
  138. package/docs/DogmaApi.md +10 -10
  139. package/docs/EarnLoyaltyPoint.md +14 -0
  140. package/docs/FactionId.md +14 -0
  141. package/docs/FactionWarfareApi.md +16 -16
  142. package/docs/FittingsApi.md +6 -6
  143. package/docs/FleetsApi.md +28 -28
  144. package/docs/FreelanceJobsApi.md +546 -0
  145. package/docs/FreelanceJobsDetail.md +23 -0
  146. package/docs/FreelanceJobsDetailAccessandvisibility.md +16 -0
  147. package/docs/FreelanceJobsDetailBroadcastlocations.md +15 -0
  148. package/docs/FreelanceJobsDetailConfiguration.md +16 -0
  149. package/docs/FreelanceJobsDetailConfigurationParametersValue.md +17 -0
  150. package/docs/FreelanceJobsDetailContribution.md +18 -0
  151. package/docs/FreelanceJobsDetailCreator.md +15 -0
  152. package/docs/FreelanceJobsDetailCreatorcharacter.md +15 -0
  153. package/docs/FreelanceJobsDetailCreatorcorporation.md +15 -0
  154. package/docs/FreelanceJobsDetailDetails.md +19 -0
  155. package/docs/FreelanceJobsDetailFreelancejob.md +19 -0
  156. package/docs/FreelanceJobsDetailParameterboolean.md +14 -0
  157. package/docs/FreelanceJobsDetailParametercorporationitemdelivery.md +15 -0
  158. package/docs/FreelanceJobsDetailParametermatcher.md +14 -0
  159. package/docs/FreelanceJobsDetailParametermatchervalue.md +15 -0
  160. package/docs/FreelanceJobsDetailParameteroptions.md +14 -0
  161. package/docs/FreelanceJobsDetailProgress.md +15 -0
  162. package/docs/FreelanceJobsDetailRestrictions.md +15 -0
  163. package/docs/FreelanceJobsDetailReward.md +15 -0
  164. package/docs/FreelanceJobsListing.md +15 -0
  165. package/docs/GroupId.md +14 -0
  166. package/docs/GroupId1.md +14 -0
  167. package/docs/IncursionsApi.md +2 -2
  168. package/docs/IndustryApi.md +16 -16
  169. package/docs/InsuranceApi.md +2 -2
  170. package/docs/KillmailsApi.md +6 -6
  171. package/docs/LocationApi.md +6 -6
  172. package/docs/LostShip.md +14 -0
  173. package/docs/LoyaltyApi.md +4 -4
  174. package/docs/MailApi.md +18 -18
  175. package/docs/Manual.md +14 -0
  176. package/docs/ManufactureItem.md +14 -0
  177. package/docs/MarketApi.md +22 -22
  178. package/docs/Matcher.md +14 -0
  179. package/docs/MetaApi.md +82 -4
  180. package/docs/MetaChangelogEntry.md +1 -1
  181. package/docs/MetaStatus.md +14 -0
  182. package/docs/MetaStatusRoutestatus.md +16 -0
  183. package/docs/MineMaterial.md +14 -0
  184. package/docs/ModelBoolean.md +14 -0
  185. package/docs/Options.md +14 -0
  186. package/docs/PlanetaryInteractionApi.md +8 -8
  187. package/docs/RegionId.md +14 -0
  188. package/docs/RemoteBoostShield.md +14 -0
  189. package/docs/RemoteRepairArmor.md +14 -0
  190. package/docs/Route.md +14 -0
  191. package/docs/RouteConnection.md +15 -0
  192. package/docs/RouteRequestBody.md +17 -0
  193. package/docs/RoutesApi.md +22 -28
  194. package/docs/SalvageWreck.md +14 -0
  195. package/docs/ScanSignature.md +14 -0
  196. package/docs/SearchApi.md +2 -2
  197. package/docs/ShipInsurance.md +14 -0
  198. package/docs/SkillsApi.md +6 -6
  199. package/docs/SolarSystemId.md +14 -0
  200. package/docs/SovereigntyApi.md +6 -6
  201. package/docs/StationId.md +14 -0
  202. package/docs/StatusApi.md +2 -2
  203. package/docs/StructureId.md +14 -0
  204. package/docs/TypeId.md +14 -0
  205. package/docs/UniverseApi.md +60 -60
  206. package/docs/Unknown.md +14 -0
  207. package/docs/UserInterfaceApi.md +10 -10
  208. package/docs/WalletApi.md +12 -12
  209. package/docs/WarsApi.md +6 -6
  210. package/esisl_genoa_client-0.1.4.tgz +0 -0
  211. package/esisl_genoa_client-0.1.5.tgz +0 -0
  212. package/package.json +1 -1
  213. package/src/apis/AllianceApi.ts +25 -25
  214. package/src/apis/AssetsApi.ts +37 -37
  215. package/src/apis/CalendarApi.ts +25 -25
  216. package/src/apis/CharacterApi.ts +85 -89
  217. package/src/apis/ClonesApi.ts +13 -13
  218. package/src/apis/ContactsApi.ts +55 -55
  219. package/src/apis/ContractsApi.ts +55 -55
  220. package/src/apis/CorporationApi.ts +133 -137
  221. package/src/apis/CorporationProjectsApi.ts +634 -0
  222. package/src/apis/DogmaApi.ts +31 -31
  223. package/src/apis/FactionWarfareApi.ts +49 -49
  224. package/src/apis/FittingsApi.ts +19 -19
  225. package/src/apis/FleetsApi.ts +85 -85
  226. package/src/apis/FreelanceJobsApi.ts +846 -0
  227. package/src/apis/IncursionsApi.ts +7 -7
  228. package/src/apis/IndustryApi.ts +49 -49
  229. package/src/apis/InsuranceApi.ts +7 -7
  230. package/src/apis/KillmailsApi.ts +19 -19
  231. package/src/apis/LocationApi.ts +19 -19
  232. package/src/apis/LoyaltyApi.ts +13 -13
  233. package/src/apis/MailApi.ts +55 -63
  234. package/src/apis/MarketApi.ts +67 -67
  235. package/src/apis/MetaApi.ts +122 -13
  236. package/src/apis/PlanetaryInteractionApi.ts +25 -25
  237. package/src/apis/RoutesApi.ts +54 -65
  238. package/src/apis/SearchApi.ts +7 -7
  239. package/src/apis/SkillsApi.ts +19 -19
  240. package/src/apis/SovereigntyApi.ts +19 -19
  241. package/src/apis/StatusApi.ts +7 -7
  242. package/src/apis/UniverseApi.ts +181 -181
  243. package/src/apis/UserInterfaceApi.ts +31 -31
  244. package/src/apis/WalletApi.ts +37 -41
  245. package/src/apis/WarsApi.ts +19 -19
  246. package/src/apis/index.ts +2 -0
  247. package/src/models/index.ts +2374 -308
  248. package/src/runtime.ts +14 -225
  249. package/esisl_genoa_client-0.1.0.tgz +0 -0
  250. package/esisl_genoa_client-0.1.1.tgz +0 -0
package/src/runtime.ts CHANGED
@@ -1,32 +1,14 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * EVE Stable Infrastructure (ESI) - tranquility
5
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
- *
7
- * The version of the OpenAPI document: 2020-01-01
8
- * Contact: arcyfa_github@pm.me
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
-
16
- export const BASE_PATH = "https://esi.evetech.net".replace(/\/+$/, "");
3
+ /*
4
+ This is no longer a working api it simply a service layer to call esi.proxy
5
+ */
17
6
 
18
7
  export interface ConfigurationParameters {
19
- basePath?: string; // override base path
20
- fetchApi?: FetchAPI; // override for fetch implementation
21
- middleware?: Middleware[]; // middleware to apply before/after fetch requests
8
+
22
9
  queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
23
- username?: string; // parameter for basic security
24
- password?: string; // parameter for basic security
25
- apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
26
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
27
10
  headers?: HTTPHeaders; //header params we want to use on every request
28
- credentials?: RequestCredentials; //value for the credentials param we want to use on each request
29
- apiFacade?: any; // external facade that provides `.esi.proxy(...)`
11
+ apiFacade?: apiFacade; // external facade that provides `.esi.proxy(...)`
30
12
  }
31
13
 
32
14
  export class Configuration {
@@ -36,54 +18,14 @@ export class Configuration {
36
18
  this.configuration = configuration;
37
19
  }
38
20
 
39
- get basePath(): string {
40
- return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
41
- }
42
-
43
- get fetchApi(): FetchAPI | undefined {
44
- return this.configuration.fetchApi;
45
- }
46
-
47
- get middleware(): Middleware[] {
48
- return this.configuration.middleware || [];
49
- }
50
-
51
21
  get queryParamsStringify(): (params: HTTPQuery) => string {
52
22
  return this.configuration.queryParamsStringify || querystring;
53
23
  }
54
24
 
55
- get username(): string | undefined {
56
- return this.configuration.username;
57
- }
58
-
59
- get password(): string | undefined {
60
- return this.configuration.password;
61
- }
62
-
63
- get apiKey(): ((name: string) => string | Promise<string>) | undefined {
64
- const apiKey = this.configuration.apiKey;
65
- if (apiKey) {
66
- return typeof apiKey === 'function' ? apiKey : () => apiKey;
67
- }
68
- return undefined;
69
- }
70
-
71
- get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined {
72
- const accessToken = this.configuration.accessToken;
73
- if (accessToken) {
74
- return typeof accessToken === 'function' ? accessToken : async () => accessToken;
75
- }
76
- return undefined;
77
- }
78
-
79
25
  get headers(): HTTPHeaders | undefined {
80
26
  return this.configuration.headers;
81
27
  }
82
28
 
83
- get credentials(): RequestCredentials | undefined {
84
- return this.configuration.credentials;
85
- }
86
-
87
29
  get apiFacade(): any | undefined {
88
30
  return this.configuration.apiFacade;
89
31
  }
@@ -96,27 +38,8 @@ export const DefaultConfig = new Configuration();
96
38
  */
97
39
  export class BaseAPI {
98
40
 
99
- private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
100
- private middleware: Middleware[];
101
-
102
41
  constructor(protected configuration = DefaultConfig) {
103
- this.middleware = configuration.middleware;
104
- }
105
-
106
- withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]) {
107
- const next = this.clone<T>();
108
- next.middleware = next.middleware.concat(...middlewares);
109
- return next;
110
- }
111
-
112
- withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>) {
113
- const middlewares = preMiddlewares.map((pre) => ({ pre }));
114
- return this.withMiddleware<T>(...middlewares);
115
- }
116
-
117
- withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>) {
118
- const middlewares = postMiddlewares.map((post) => ({ post }));
119
- return this.withMiddleware<T>(...middlewares);
42
+
120
43
  }
121
44
 
122
45
  /**
@@ -136,146 +59,10 @@ export class BaseAPI {
136
59
  return BaseAPI.jsonRegex.test(mime);
137
60
  }
138
61
 
139
- protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response> {
140
- const { url, init } = await this.createFetchParams(context, initOverrides);
141
- const response = await this.fetchApi(url, init);
142
- if (response && (response.status >= 200 && response.status < 300)) {
143
- return response;
144
- }
145
- throw new ResponseError(response, 'Response returned an error code');
146
- }
147
-
148
- private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) {
149
- let url = this.configuration.basePath + context.path;
150
- if (context.query !== undefined && Object.keys(context.query).length !== 0) {
151
- // only add the querystring to the URL if there are query parameters.
152
- // this is done to avoid urls ending with a "?" character which buggy webservers
153
- // do not handle correctly sometimes.
154
- url += '?' + this.configuration.queryParamsStringify(context.query);
155
- }
156
-
157
- const headers = Object.assign({}, this.configuration.headers, context.headers);
158
- Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
159
-
160
- const initOverrideFn =
161
- typeof initOverrides === "function"
162
- ? initOverrides
163
- : async () => initOverrides;
164
-
165
- const initParams = {
166
- method: context.method,
167
- headers,
168
- body: context.body,
169
- credentials: this.configuration.credentials,
170
- };
171
-
172
- const overriddenInit: RequestInit = {
173
- ...initParams,
174
- ...(await initOverrideFn({
175
- init: initParams,
176
- context,
177
- }))
178
- };
179
-
180
- let body: any;
181
- if (isFormData(overriddenInit.body)
182
- || (overriddenInit.body instanceof URLSearchParams)
183
- || isBlob(overriddenInit.body)) {
184
- body = overriddenInit.body;
185
- } else if (this.isJsonMime(headers['Content-Type'])) {
186
- body = JSON.stringify(overriddenInit.body);
187
- } else {
188
- body = overriddenInit.body;
189
- }
190
-
191
- const init: RequestInit = {
192
- ...overriddenInit,
193
- body
194
- };
195
-
196
- return { url, init };
197
- }
198
-
199
- private fetchApi = async (url: string, init: RequestInit) => {
200
- let fetchParams = { url, init };
201
- for (const middleware of this.middleware) {
202
- if (middleware.pre) {
203
- fetchParams = await middleware.pre({
204
- fetch: this.fetchApi,
205
- ...fetchParams,
206
- }) || fetchParams;
207
- }
208
- }
209
- let response: Response | undefined = undefined;
210
- try {
211
- response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
212
- } catch (e) {
213
- for (const middleware of this.middleware) {
214
- if (middleware.onError) {
215
- response = await middleware.onError({
216
- fetch: this.fetchApi,
217
- url: fetchParams.url,
218
- init: fetchParams.init,
219
- error: e,
220
- response: response ? response.clone() : undefined,
221
- }) || response;
222
- }
223
- }
224
- if (response === undefined) {
225
- if (e instanceof Error) {
226
- throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
227
- } else {
228
- throw e;
229
- }
230
- }
231
- }
232
- for (const middleware of this.middleware) {
233
- if (middleware.post) {
234
- response = await middleware.post({
235
- fetch: this.fetchApi,
236
- url: fetchParams.url,
237
- init: fetchParams.init,
238
- response: response.clone(),
239
- }) || response;
240
- }
241
- }
242
- return response;
243
- }
244
-
245
- /**
246
- * Create a shallow clone of `this` by constructing a new instance
247
- * and then shallow cloning data members.
248
- */
249
- private clone<T extends BaseAPI>(this: T): T {
250
- const constructor = this.constructor as any;
251
- const next = new constructor(this.configuration);
252
- next.middleware = this.middleware.slice();
253
- return next;
254
- }
62
+ private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
63
+
255
64
  };
256
65
 
257
- function isBlob(value: any): value is Blob {
258
- return typeof Blob !== 'undefined' && value instanceof Blob;
259
- }
260
-
261
- function isFormData(value: any): value is FormData {
262
- return typeof FormData !== "undefined" && value instanceof FormData;
263
- }
264
-
265
- export class ResponseError extends Error {
266
- override name: "ResponseError" = "ResponseError";
267
- constructor(public response: Response, msg?: string) {
268
- super(msg);
269
- }
270
- }
271
-
272
- export class FetchError extends Error {
273
- override name: "FetchError" = "FetchError";
274
- constructor(public cause: Error, msg?: string) {
275
- super(msg);
276
- }
277
- }
278
-
279
66
  export class RequiredError extends Error {
280
67
  override name: "RequiredError" = "RequiredError";
281
68
  constructor(public field: string, msg?: string) {
@@ -290,7 +77,7 @@ export const COLLECTION_FORMATS = {
290
77
  pipes: "|",
291
78
  };
292
79
 
293
- export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
80
+ export type apiFacade = any;
294
81
 
295
82
  export type Json = any;
296
83
  export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
@@ -302,11 +89,13 @@ export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'o
302
89
 
303
90
  export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise<RequestInit>
304
91
 
92
+
305
93
  export interface FetchParams {
306
94
  url: string;
307
95
  init: RequestInit;
308
96
  }
309
97
 
98
+
310
99
  export interface RequestOpts {
311
100
  path: string;
312
101
  method: HTTPMethod;
@@ -362,20 +151,20 @@ export interface Consume {
362
151
  }
363
152
 
364
153
  export interface RequestContext {
365
- fetch: FetchAPI;
154
+ fetch: apiFacade;
366
155
  url: string;
367
156
  init: RequestInit;
368
157
  }
369
158
 
370
159
  export interface ResponseContext {
371
- fetch: FetchAPI;
160
+ fetch: apiFacade;
372
161
  url: string;
373
162
  init: RequestInit;
374
163
  response: Response;
375
164
  }
376
165
 
377
166
  export interface ErrorContext {
378
- fetch: FetchAPI;
167
+ fetch: apiFacade;
379
168
  url: string;
380
169
  init: RequestInit;
381
170
  error: unknown;
Binary file
Binary file