esisl_genoa_client 0.1.0 → 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 (249) 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 +53 -38
  5. package/dist/apis/AssetsApi.d.ts +25 -25
  6. package/dist/apis/AssetsApi.js +79 -56
  7. package/dist/apis/CalendarApi.d.ts +17 -17
  8. package/dist/apis/CalendarApi.js +53 -39
  9. package/dist/apis/CharacterApi.d.ts +57 -57
  10. package/dist/apis/CharacterApi.js +183 -134
  11. package/dist/apis/ClonesApi.d.ts +9 -9
  12. package/dist/apis/ClonesApi.js +27 -20
  13. package/dist/apis/ContactsApi.d.ts +37 -37
  14. package/dist/apis/ContactsApi.js +118 -85
  15. package/dist/apis/ContractsApi.d.ts +37 -37
  16. package/dist/apis/ContractsApi.js +118 -83
  17. package/dist/apis/CorporationApi.d.ts +89 -89
  18. package/dist/apis/CorporationApi.js +287 -206
  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 +66 -47
  23. package/dist/apis/FactionWarfareApi.d.ts +33 -33
  24. package/dist/apis/FactionWarfareApi.js +105 -74
  25. package/dist/apis/FittingsApi.d.ts +13 -13
  26. package/dist/apis/FittingsApi.js +40 -30
  27. package/dist/apis/FleetsApi.d.ts +57 -57
  28. package/dist/apis/FleetsApi.js +183 -136
  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 +14 -11
  33. package/dist/apis/IndustryApi.d.ts +33 -33
  34. package/dist/apis/IndustryApi.js +105 -74
  35. package/dist/apis/InsuranceApi.d.ts +5 -5
  36. package/dist/apis/InsuranceApi.js +14 -11
  37. package/dist/apis/KillmailsApi.d.ts +13 -13
  38. package/dist/apis/KillmailsApi.js +40 -29
  39. package/dist/apis/LocationApi.d.ts +13 -13
  40. package/dist/apis/LocationApi.js +40 -29
  41. package/dist/apis/LoyaltyApi.d.ts +9 -9
  42. package/dist/apis/LoyaltyApi.js +27 -20
  43. package/dist/apis/MailApi.d.ts +37 -37
  44. package/dist/apis/MailApi.js +118 -98
  45. package/dist/apis/MarketApi.d.ts +45 -45
  46. package/dist/apis/MarketApi.js +144 -101
  47. package/dist/apis/MetaApi.d.ts +64 -10
  48. package/dist/apis/MetaApi.js +114 -21
  49. package/dist/apis/PlanetaryInteractionApi.d.ts +17 -17
  50. package/dist/apis/PlanetaryInteractionApi.js +53 -38
  51. package/dist/apis/RoutesApi.d.ts +27 -39
  52. package/dist/apis/RoutesApi.js +50 -61
  53. package/dist/apis/SearchApi.d.ts +5 -5
  54. package/dist/apis/SearchApi.js +14 -11
  55. package/dist/apis/SkillsApi.d.ts +13 -13
  56. package/dist/apis/SkillsApi.js +40 -29
  57. package/dist/apis/SovereigntyApi.d.ts +13 -13
  58. package/dist/apis/SovereigntyApi.js +40 -29
  59. package/dist/apis/StatusApi.d.ts +5 -5
  60. package/dist/apis/StatusApi.js +14 -11
  61. package/dist/apis/UniverseApi.d.ts +121 -121
  62. package/dist/apis/UniverseApi.js +391 -272
  63. package/dist/apis/UserInterfaceApi.d.ts +21 -21
  64. package/dist/apis/UserInterfaceApi.js +66 -52
  65. package/dist/apis/WalletApi.d.ts +25 -25
  66. package/dist/apis/WalletApi.js +79 -62
  67. package/dist/apis/WarsApi.d.ts +13 -13
  68. package/dist/apis/WarsApi.js +40 -29
  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 +7 -55
  74. package/dist/runtime.js +6 -304
  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 +50 -30
  214. package/src/apis/AssetsApi.ts +74 -44
  215. package/src/apis/CalendarApi.ts +50 -30
  216. package/src/apis/CharacterApi.ts +170 -104
  217. package/src/apis/ClonesApi.ts +26 -16
  218. package/src/apis/ContactsApi.ts +110 -65
  219. package/src/apis/ContractsApi.ts +110 -65
  220. package/src/apis/CorporationApi.ts +266 -160
  221. package/src/apis/CorporationProjectsApi.ts +634 -0
  222. package/src/apis/DogmaApi.ts +62 -37
  223. package/src/apis/FactionWarfareApi.ts +98 -58
  224. package/src/apis/FittingsApi.ts +38 -23
  225. package/src/apis/FleetsApi.ts +170 -100
  226. package/src/apis/FreelanceJobsApi.ts +846 -0
  227. package/src/apis/IncursionsApi.ts +14 -9
  228. package/src/apis/IndustryApi.ts +98 -58
  229. package/src/apis/InsuranceApi.ts +14 -9
  230. package/src/apis/KillmailsApi.ts +38 -23
  231. package/src/apis/LocationApi.ts +38 -23
  232. package/src/apis/LoyaltyApi.ts +26 -16
  233. package/src/apis/MailApi.ts +110 -73
  234. package/src/apis/MarketApi.ts +134 -79
  235. package/src/apis/MetaApi.ts +135 -16
  236. package/src/apis/PlanetaryInteractionApi.ts +50 -30
  237. package/src/apis/RoutesApi.ts +61 -67
  238. package/src/apis/SearchApi.ts +14 -9
  239. package/src/apis/SkillsApi.ts +38 -23
  240. package/src/apis/SovereigntyApi.ts +38 -23
  241. package/src/apis/StatusApi.ts +14 -9
  242. package/src/apis/UniverseApi.ts +362 -212
  243. package/src/apis/UserInterfaceApi.ts +62 -37
  244. package/src/apis/WalletApi.ts +74 -48
  245. package/src/apis/WarsApi.ts +38 -23
  246. package/src/apis/index.ts +2 -0
  247. package/src/models/index.ts +2374 -308
  248. package/src/runtime.ts +16 -222
  249. package/esisl_genoa_client-0.1.0.tgz +0 -0
package/src/runtime.ts CHANGED
@@ -1,31 +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
11
+ apiFacade?: apiFacade; // external facade that provides `.esi.proxy(...)`
29
12
  }
30
13
 
31
14
  export class Configuration {
@@ -35,52 +18,16 @@ export class Configuration {
35
18
  this.configuration = configuration;
36
19
  }
37
20
 
38
- get basePath(): string {
39
- return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
40
- }
41
-
42
- get fetchApi(): FetchAPI | undefined {
43
- return this.configuration.fetchApi;
44
- }
45
-
46
- get middleware(): Middleware[] {
47
- return this.configuration.middleware || [];
48
- }
49
-
50
21
  get queryParamsStringify(): (params: HTTPQuery) => string {
51
22
  return this.configuration.queryParamsStringify || querystring;
52
23
  }
53
24
 
54
- get username(): string | undefined {
55
- return this.configuration.username;
56
- }
57
-
58
- get password(): string | undefined {
59
- return this.configuration.password;
60
- }
61
-
62
- get apiKey(): ((name: string) => string | Promise<string>) | undefined {
63
- const apiKey = this.configuration.apiKey;
64
- if (apiKey) {
65
- return typeof apiKey === 'function' ? apiKey : () => apiKey;
66
- }
67
- return undefined;
68
- }
69
-
70
- get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined {
71
- const accessToken = this.configuration.accessToken;
72
- if (accessToken) {
73
- return typeof accessToken === 'function' ? accessToken : async () => accessToken;
74
- }
75
- return undefined;
76
- }
77
-
78
25
  get headers(): HTTPHeaders | undefined {
79
26
  return this.configuration.headers;
80
27
  }
81
28
 
82
- get credentials(): RequestCredentials | undefined {
83
- return this.configuration.credentials;
29
+ get apiFacade(): any | undefined {
30
+ return this.configuration.apiFacade;
84
31
  }
85
32
  }
86
33
 
@@ -91,27 +38,8 @@ export const DefaultConfig = new Configuration();
91
38
  */
92
39
  export class BaseAPI {
93
40
 
94
- private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
95
- private middleware: Middleware[];
96
-
97
41
  constructor(protected configuration = DefaultConfig) {
98
- this.middleware = configuration.middleware;
99
- }
100
-
101
- withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]) {
102
- const next = this.clone<T>();
103
- next.middleware = next.middleware.concat(...middlewares);
104
- return next;
105
- }
106
-
107
- withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>) {
108
- const middlewares = preMiddlewares.map((pre) => ({ pre }));
109
- return this.withMiddleware<T>(...middlewares);
110
- }
111
-
112
- withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>) {
113
- const middlewares = postMiddlewares.map((post) => ({ post }));
114
- return this.withMiddleware<T>(...middlewares);
42
+
115
43
  }
116
44
 
117
45
  /**
@@ -131,146 +59,10 @@ export class BaseAPI {
131
59
  return BaseAPI.jsonRegex.test(mime);
132
60
  }
133
61
 
134
- protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response> {
135
- const { url, init } = await this.createFetchParams(context, initOverrides);
136
- const response = await this.fetchApi(url, init);
137
- if (response && (response.status >= 200 && response.status < 300)) {
138
- return response;
139
- }
140
- throw new ResponseError(response, 'Response returned an error code');
141
- }
142
-
143
- private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) {
144
- let url = this.configuration.basePath + context.path;
145
- if (context.query !== undefined && Object.keys(context.query).length !== 0) {
146
- // only add the querystring to the URL if there are query parameters.
147
- // this is done to avoid urls ending with a "?" character which buggy webservers
148
- // do not handle correctly sometimes.
149
- url += '?' + this.configuration.queryParamsStringify(context.query);
150
- }
151
-
152
- const headers = Object.assign({}, this.configuration.headers, context.headers);
153
- Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
154
-
155
- const initOverrideFn =
156
- typeof initOverrides === "function"
157
- ? initOverrides
158
- : async () => initOverrides;
159
-
160
- const initParams = {
161
- method: context.method,
162
- headers,
163
- body: context.body,
164
- credentials: this.configuration.credentials,
165
- };
166
-
167
- const overriddenInit: RequestInit = {
168
- ...initParams,
169
- ...(await initOverrideFn({
170
- init: initParams,
171
- context,
172
- }))
173
- };
174
-
175
- let body: any;
176
- if (isFormData(overriddenInit.body)
177
- || (overriddenInit.body instanceof URLSearchParams)
178
- || isBlob(overriddenInit.body)) {
179
- body = overriddenInit.body;
180
- } else if (this.isJsonMime(headers['Content-Type'])) {
181
- body = JSON.stringify(overriddenInit.body);
182
- } else {
183
- body = overriddenInit.body;
184
- }
185
-
186
- const init: RequestInit = {
187
- ...overriddenInit,
188
- body
189
- };
190
-
191
- return { url, init };
192
- }
193
-
194
- private fetchApi = async (url: string, init: RequestInit) => {
195
- let fetchParams = { url, init };
196
- for (const middleware of this.middleware) {
197
- if (middleware.pre) {
198
- fetchParams = await middleware.pre({
199
- fetch: this.fetchApi,
200
- ...fetchParams,
201
- }) || fetchParams;
202
- }
203
- }
204
- let response: Response | undefined = undefined;
205
- try {
206
- response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
207
- } catch (e) {
208
- for (const middleware of this.middleware) {
209
- if (middleware.onError) {
210
- response = await middleware.onError({
211
- fetch: this.fetchApi,
212
- url: fetchParams.url,
213
- init: fetchParams.init,
214
- error: e,
215
- response: response ? response.clone() : undefined,
216
- }) || response;
217
- }
218
- }
219
- if (response === undefined) {
220
- if (e instanceof Error) {
221
- throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
222
- } else {
223
- throw e;
224
- }
225
- }
226
- }
227
- for (const middleware of this.middleware) {
228
- if (middleware.post) {
229
- response = await middleware.post({
230
- fetch: this.fetchApi,
231
- url: fetchParams.url,
232
- init: fetchParams.init,
233
- response: response.clone(),
234
- }) || response;
235
- }
236
- }
237
- return response;
238
- }
239
-
240
- /**
241
- * Create a shallow clone of `this` by constructing a new instance
242
- * and then shallow cloning data members.
243
- */
244
- private clone<T extends BaseAPI>(this: T): T {
245
- const constructor = this.constructor as any;
246
- const next = new constructor(this.configuration);
247
- next.middleware = this.middleware.slice();
248
- return next;
249
- }
62
+ private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
63
+
250
64
  };
251
65
 
252
- function isBlob(value: any): value is Blob {
253
- return typeof Blob !== 'undefined' && value instanceof Blob;
254
- }
255
-
256
- function isFormData(value: any): value is FormData {
257
- return typeof FormData !== "undefined" && value instanceof FormData;
258
- }
259
-
260
- export class ResponseError extends Error {
261
- override name: "ResponseError" = "ResponseError";
262
- constructor(public response: Response, msg?: string) {
263
- super(msg);
264
- }
265
- }
266
-
267
- export class FetchError extends Error {
268
- override name: "FetchError" = "FetchError";
269
- constructor(public cause: Error, msg?: string) {
270
- super(msg);
271
- }
272
- }
273
-
274
66
  export class RequiredError extends Error {
275
67
  override name: "RequiredError" = "RequiredError";
276
68
  constructor(public field: string, msg?: string) {
@@ -285,7 +77,7 @@ export const COLLECTION_FORMATS = {
285
77
  pipes: "|",
286
78
  };
287
79
 
288
- export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
80
+ export type apiFacade = any;
289
81
 
290
82
  export type Json = any;
291
83
  export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
@@ -297,11 +89,13 @@ export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'o
297
89
 
298
90
  export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise<RequestInit>
299
91
 
92
+
300
93
  export interface FetchParams {
301
94
  url: string;
302
95
  init: RequestInit;
303
96
  }
304
97
 
98
+
305
99
  export interface RequestOpts {
306
100
  path: string;
307
101
  method: HTTPMethod;
@@ -357,20 +151,20 @@ export interface Consume {
357
151
  }
358
152
 
359
153
  export interface RequestContext {
360
- fetch: FetchAPI;
154
+ fetch: apiFacade;
361
155
  url: string;
362
156
  init: RequestInit;
363
157
  }
364
158
 
365
159
  export interface ResponseContext {
366
- fetch: FetchAPI;
160
+ fetch: apiFacade;
367
161
  url: string;
368
162
  init: RequestInit;
369
163
  response: Response;
370
164
  }
371
165
 
372
166
  export interface ErrorContext {
373
- fetch: FetchAPI;
167
+ fetch: apiFacade;
374
168
  url: string;
375
169
  init: RequestInit;
376
170
  error: unknown;
Binary file