eve-esi-types 3.0.1 → 3.0.3

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/lib/rq-util.d.mts CHANGED
@@ -181,6 +181,9 @@ export declare function getLogger(): {
181
181
  clog: (...args: any[]) => void;
182
182
  rlog: (...args: any[]) => void;
183
183
  };
184
+ export type TFireWithoutAuth = {
185
+ fireWithoutAuth<M extends TESIEntryMethod, RealEP extends ReplacePathParams<keyof TESIResponseOKMap[M] & string> | keyof TESIResponseOKMap[M], EP extends InferEndpointOrigin<RealEP, keyof TESIResponseOKMap[M]> extends never ? RealEP : InferEndpointOrigin<RealEP, keyof TESIResponseOKMap[M]>, PathParams extends RealEP extends EP ? IfNeedPathParams<EP> : TPathParamsNever, Opt extends IdentifyParameters<TESIResponseOKMap[M][Extract<EP, keyof TESIResponseOKMap[M]>], ESIRequestOptions & PathParams>, R extends InferESIResponseResult<M, Extract<EP, keyof TESIResponseOKMap[M]>>, HasOpt = HasRequireParams<TESIResponseOKMap[M][Extract<EP, keyof TESIResponseOKMap[M]>]> extends never ? 0 : 1>(fn: TESIRequestFunctionSignature2<ESIRequestOptions> | TESIRequestFunctionMethods2<ESIRequestOptions>, method: M, endpoint: RealEP, ...opt: HasOpt extends 1 ? [Opt] : [Opt?]): Promise<R>;
186
+ }["fireWithoutAuth"];
184
187
  /**
185
188
  * Need typescript v5.5 later
186
189
  * @import * as ESI from "../v2";
@@ -189,12 +192,6 @@ export declare function getLogger(): {
189
192
  * @typedef {ESI.IESIRequestFunction2<ESIRequestOptions>} IESIRequestFunction2
190
193
  * @typedef {ESI.TESIRequestFunctionMethods2<ESIRequestOptions>} TESIRequestFunctionMethods2
191
194
  */
192
- /**
193
- * #### Fire a request that does not require authentication.
194
- *
195
- * @type {import("./rq-util.d.mts").fireWithoutAuth}
196
- */
197
- export declare function fireWithoutAuth<M extends TESIEntryMethod, RealEP extends ReplacePathParams<keyof TESIResponseOKMap[M] & string> | keyof TESIResponseOKMap[M], EP extends InferEndpointOrigin<RealEP, keyof TESIResponseOKMap[M]> extends never ? RealEP : InferEndpointOrigin<RealEP, keyof TESIResponseOKMap[M]>, PathParams extends RealEP extends EP ? IfNeedPathParams<EP> : TPathParamsNever, Opt extends IdentifyParameters<TESIResponseOKMap[M][Extract<EP, keyof TESIResponseOKMap[M]>], ESIRequestOptions & PathParams>, R extends InferESIResponseResult<M, Extract<EP, keyof TESIResponseOKMap[M]>>>(fn: TESIRequestFunctionSignature2<ESIRequestOptions> | TESIRequestFunctionMethods2<ESIRequestOptions>, method: M, endpoint: RealEP, opt?: Opt): Promise<R>;
198
195
  /**
199
196
  * #### Fire a request that does not require authentication.
200
197
  *
package/lib/rq-util.mjs CHANGED
@@ -320,29 +320,27 @@ export function getLogger() {
320
320
  const rlog = consoleUtil.getLogger("- - -> Run ESI request".cyan);
321
321
  return { clog, rlog };
322
322
  }
323
- /**
324
- * Need typescript v5.5 later
325
- * @import * as ESI from "../v2";
326
- * @typedef {ESI.TESIResponseOKMap} TESIResponseOKMap
327
- * @typedef {ESI.TPathParamsNever} TPathParamsNever
328
- * @typedef {ESI.IESIRequestFunction2<ESIRequestOptions>} IESIRequestFunction2
329
- * @typedef {ESI.TESIRequestFunctionMethods2<ESIRequestOptions>} TESIRequestFunctionMethods2
330
- */
331
- // type ESIEndpointBrand<EP> = EP & { __esi: "x"; };
332
- // type EPPost = ESIEndpointBrand<keyof TESIResponseOKMap["post"]>;
333
323
  /**
334
324
  * #### Fire a request that does not require authentication.
335
325
  *
336
- * @type {import("./rq-util.d.mts").fireWithoutAuth}
326
+ * @type {import("./rq-util.d.mts").TFireWithoutAuth}
337
327
  */
338
- export function fireWithoutAuth(fn, method, endpoint, opt) {
328
+ const fireWithoutAuth = (fn, method, endpoint, ...opt) => {
339
329
  if (typeof fn === "function") {
340
330
  // @ts-expect-error TODO: ts(2345) The argument type does not match the type of the specified parameter
341
331
  return fn(method, endpoint, opt);
342
332
  }
343
333
  // @ts-expect-error TODO: ts(2345) The argument type does not match the type of the specified parameter
344
334
  return fn[method](endpoint, opt);
345
- }
335
+ };
336
+ /**
337
+ * Need typescript v5.5 later
338
+ * @import * as ESI from "../v2";
339
+ * @typedef {ESI.TESIResponseOKMap} TESIResponseOKMap
340
+ * @typedef {ESI.TPathParamsNever} TPathParamsNever
341
+ * @typedef {ESI.IESIRequestFunction2<ESIRequestOptions>} IESIRequestFunction2
342
+ * @typedef {ESI.TESIRequestFunctionMethods2<ESIRequestOptions>} TESIRequestFunctionMethods2
343
+ */
346
344
  /**
347
345
  * #### Fire a request that does not require authentication.
348
346
  *
@@ -418,7 +416,13 @@ export async function fireRequestsDoesNotRequireAuth(fn) {
418
416
  });
419
417
  // TODO: want TypeScript semantics to throw an error because there is a required query parameter, but it's not possible
420
418
  // Or rather, I don't know how to do it.
421
- await fireWithoutAuth(fn, "get", "/characters/{character_id}/search/");
419
+ await fireWithoutAuth(fn, "get", "/characters/{character_id}/search/", {
420
+ auth: true,
421
+ pathParams: 1234,
422
+ query: {
423
+ categories: ["alliance"], search: "test!!"
424
+ }
425
+ });
422
426
  log(willFailed);
423
427
  }
424
428
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eve-esi-types",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "Extracted the main type of ESI. use for ESI request response types (version 2 only)",
5
5
  "main": "v2/index.d.ts",
6
6
  "scripts": {
package/tagged-rq.mjs CHANGED
@@ -8,32 +8,46 @@
8
8
  /// <reference types="./v2"/>
9
9
  /**
10
10
  * @file tagged-rq.mts
11
- * @command node tagged-rq.mjs -x
11
+ * @command node tagged-rq.mjs -x -debug
12
12
  */
13
13
  import { esi } from "./lib/tagged-request-api.mjs";
14
- // import * as util from "./lib/rq-util.mjs";
14
+ import * as util from "./lib/rq-util.mjs";
15
15
  // Furthermore, the endpoint selected is narrowed down by "tags" and "method".
16
- esi.assets.get("/characters/2112625428/assets/", {
17
- auth: true
18
- }).then(console.log).catch(console.log);
16
+ esi.alliance.get("/alliances/").then(aIds => {
17
+ console.log(`get:alliances, id size=${aIds.length}`);
18
+ // for (const aid of aIds.slice(0, 20)) {
19
+ // esi.alliance.get(`/alliances/${aid}/`).then(console.log);
20
+ // }
21
+ });
19
22
  esi.character.get("/characters/{character_id}/", { pathParams: 2112625428 }).then(console.log);
20
- esi.mail.post("/characters/2112625428/mail/", /** @satisfies {Pick<TESIResponsePostEntry<"/characters/{character_id}/mail/">, "auth" | "body">} */ ({
21
- auth: true,
22
- body: {
23
- subject: "test!!",
24
- body: "",
25
- recipients: [{
26
- recipient_id: 2112625428, recipient_type: "character"
27
- }]
28
- },
29
- // token: "s.s.s"
30
- })).then(console.log).catch(console.log);
31
- esi.universe.get("/universe/structures/", { query: { filter: "market" } }).then(console.log);
32
23
  esi.universe.post("/universe/ids/", {
33
24
  body: ["the forge", "plex"]
34
25
  }).then(console.log);
35
- esi.fittings.delete("/characters/{character_id}/fittings/{fitting_id}/", {
36
- pathParams: [1234, 56789],
37
- auth: true
38
- });
39
- esi.character.post("/characters/affiliation/").catch(console.log);
26
+ esi.universe.post("/universe/names/", {
27
+ body: [44992, 434243723, 109299958, 10000002]
28
+ }).then(console.log);
29
+ esi.universe.get("/universe/structures/", { query: { filter: "market" } }).then(console.log);
30
+ // node tagged-rq.mjs -x -debug -withError
31
+ if (util.is("withError")) {
32
+ esi.assets.get("/characters/2112625428/assets/", {
33
+ auth: true
34
+ }).then(console.log).catch(console.log);
35
+ esi.mail.post("/characters/2112625428/mail/", /** @satisfies {Pick<TESIResponsePostEntry<"/characters/{character_id}/mail/">, "auth" | "body">} */ ({
36
+ auth: true,
37
+ body: {
38
+ subject: "test!!",
39
+ body: "",
40
+ recipients: [{
41
+ recipient_id: 2112625428, recipient_type: "character"
42
+ }]
43
+ },
44
+ // token: "s.s.s"
45
+ })).then(console.log).catch(console.log);
46
+ esi.fittings.delete("/characters/{character_id}/fittings/{fitting_id}/", {
47
+ pathParams: [1234, 56789],
48
+ auth: true
49
+ });
50
+ esi.character.post("/characters/affiliation/", {
51
+ body: [12345]
52
+ }).catch(console.log);
53
+ }
@@ -9,7 +9,7 @@
9
9
  * THIS DTS IS AUTO GENERATED, DO NOT EDIT
10
10
  *
11
11
  * @file eve-esi-types/v2/esi-tagged-types.d.ts
12
- * @summary This file is auto-generated and defines version 3.0.0 of the EVE Online ESI response types.
12
+ * @summary This file is auto-generated and defines version 3.0.3 of the EVE Online ESI response types.
13
13
  */
14
14
  import { TESIResponseOKMap, TPathParamsNever } from "./index.d.ts";
15
15
  export * from "./index.d.ts";
@@ -92,9 +92,10 @@ export declare type TaggedEndpointRequestFunction2<M extends TESIEntryMethod, Ta
92
92
  PathParams extends RealEP extends EP ? IfNeedPathParams<EP>: TPathParamsNever,
93
93
  Opt extends IdentifyParameters<TESIResponseOKMap[M][EP], ActualOpt & PathParams>,
94
94
  R extends InferESIResponseResult<M, EP>,
95
+ HasOpt = HasRequireParams<TESIResponseOKMap[M][EP]> extends never ? 0 : 1
95
96
  // RealEPX = ReplacePathParamsX<RealEPX>,
96
97
  // EPX = ReplacePathParams<EP>,
97
- >(endpoint: RealEP, options?: Opt) => Promise<R>;
98
+ >(endpoint: RealEP, ...options: HasOpt extends 1 ? [Opt] : [Opt?]) => Promise<R>;
98
99
 
99
100
 
100
101
  // - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -7,7 +7,7 @@
7
7
  * @minItems 1
8
8
  * @maxItems 1000
9
9
  */
10
- type PostCharactersAffiliationCharacters = number[];
10
+ type PostCharactersAffiliationCharacters = [number, ...number[]];
11
11
 
12
12
  /* post_characters_character_id_assets_locations body type, name: item_ids */
13
13
 
@@ -17,7 +17,7 @@ type PostCharactersAffiliationCharacters = number[];
17
17
  * @minItems 1
18
18
  * @maxItems 1000
19
19
  */
20
- type PostCharactersCharacterIdAssetsLocationsItemIds = number[];
20
+ type PostCharactersCharacterIdAssetsLocationsItemIds = [number, ...number[]];
21
21
 
22
22
  /* post_characters_character_id_assets_names body type, name: item_ids */
23
23
 
@@ -27,7 +27,7 @@ type PostCharactersCharacterIdAssetsLocationsItemIds = number[];
27
27
  * @minItems 1
28
28
  * @maxItems 1000
29
29
  */
30
- type PostCharactersCharacterIdAssetsNamesItemIds = number[];
30
+ type PostCharactersCharacterIdAssetsNamesItemIds = [number, ...number[]];
31
31
 
32
32
  /* put_characters_character_id_calendar_event_id body type, name: response */
33
33
 
@@ -52,7 +52,7 @@ interface PutCharactersCharacterIdCalendarEventIdResponse {
52
52
  * @minItems 1
53
53
  * @maxItems 100
54
54
  */
55
- type PostCharactersCharacterIdContactsContactIds = number[];
55
+ type PostCharactersCharacterIdContactsContactIds = [number, ...number[]];
56
56
 
57
57
  /* put_characters_character_id_contacts body type, name: contact_ids */
58
58
 
@@ -62,7 +62,7 @@ type PostCharactersCharacterIdContactsContactIds = number[];
62
62
  * @minItems 1
63
63
  * @maxItems 100
64
64
  */
65
- type PutCharactersCharacterIdContactsContactIds = number[];
65
+ type PutCharactersCharacterIdContactsContactIds = [number, ...number[]];
66
66
 
67
67
  /* post_characters_character_id_cspa body type, name: characters */
68
68
 
@@ -72,7 +72,7 @@ type PutCharactersCharacterIdContactsContactIds = number[];
72
72
  * @minItems 1
73
73
  * @maxItems 100
74
74
  */
75
- type PostCharactersCharacterIdCspaCharacters = number[];
75
+ type PostCharactersCharacterIdCspaCharacters = [number, ...number[]];
76
76
 
77
77
  /* post_characters_character_id_fittings body type, name: fitting */
78
78
 
@@ -82,7 +82,7 @@ type PostCharactersCharacterIdCspaCharacters = number[];
82
82
  * @minItems 1
83
83
  * @maxItems 512
84
84
  */
85
- type PostCharactersCharacterIdFittingsItems = PostCharactersCharacterIdFittingsItem[];
85
+ type PostCharactersCharacterIdFittingsItems = [PostCharactersCharacterIdFittingsItem, ...PostCharactersCharacterIdFittingsItem[]];
86
86
  /**
87
87
  * Fitting location for the item. Entries placed in 'Invalid' will be discarded. If this leaves the fitting with nothing, it will cause an error.
88
88
  */
@@ -168,7 +168,7 @@ interface PostCharactersCharacterIdFittingsItem {
168
168
  * @minItems 1
169
169
  * @maxItems 50
170
170
  */
171
- type PostCharactersCharacterIdMailRecipients = PostCharactersCharacterIdMailRecipient[];
171
+ type PostCharactersCharacterIdMailRecipients = [PostCharactersCharacterIdMailRecipient, ...PostCharactersCharacterIdMailRecipient[]];
172
172
  /**
173
173
  * recipient_type string
174
174
  */
@@ -270,7 +270,7 @@ interface PutCharactersCharacterIdMailMailIdContents {
270
270
  * @minItems 1
271
271
  * @maxItems 1000
272
272
  */
273
- type PostCorporationsCorporationIdAssetsLocationsItemIds = number[];
273
+ type PostCorporationsCorporationIdAssetsLocationsItemIds = [number, ...number[]];
274
274
 
275
275
  /* post_corporations_corporation_id_assets_names body type, name: item_ids */
276
276
 
@@ -280,7 +280,7 @@ type PostCorporationsCorporationIdAssetsLocationsItemIds = number[];
280
280
  * @minItems 1
281
281
  * @maxItems 1000
282
282
  */
283
- type PostCorporationsCorporationIdAssetsNamesItemIds = number[];
283
+ type PostCorporationsCorporationIdAssetsNamesItemIds = [number, ...number[]];
284
284
 
285
285
  /* put_fleets_fleet_id body type, name: new_settings */
286
286
 
@@ -390,7 +390,7 @@ interface PutFleetsFleetIdWingsWingIdNaming {
390
390
  * @minItems 1
391
391
  * @maxItems 50
392
392
  */
393
- type PostUiOpenwindowNewmailRecipients = number[];
393
+ type PostUiOpenwindowNewmailRecipients = [number, ...number[]];
394
394
 
395
395
  /**
396
396
  * new_mail object
@@ -424,7 +424,7 @@ interface PostUiOpenwindowNewmailNewMail {
424
424
  * @minItems 1
425
425
  * @maxItems 500
426
426
  */
427
- type PostUniverseIdsNames = string[];
427
+ type PostUniverseIdsNames = [string, ...string[]];
428
428
 
429
429
  /* post_universe_names body type, name: ids */
430
430
 
@@ -434,7 +434,7 @@ type PostUniverseIdsNames = string[];
434
434
  * @minItems 1
435
435
  * @maxItems 1000
436
436
  */
437
- type PostUniverseNamesIds = number[];
437
+ type PostUniverseNamesIds = [number, ...number[]];
438
438
 
439
439
 
440
440
  /*! query types */
@@ -446,7 +446,7 @@ type PostUniverseNamesIds = number[];
446
446
  * @minItems 1
447
447
  * @maxItems 20
448
448
  */
449
- type DeleteCharactersCharacterIdContactsContactIds = number[];
449
+ type DeleteCharactersCharacterIdContactsContactIds = [number, ...number[]];
450
450
 
451
451
  /* post_characters_character_id_contacts, label_ids query type */
452
452
 
@@ -497,7 +497,7 @@ type GetCharactersCharacterIdSearchCategory =
497
497
  * @minItems 1
498
498
  * @maxItems 11
499
499
  */
500
- type GetCharactersCharacterIdSearchCategories = GetCharactersCharacterIdSearchCategory[];
500
+ type GetCharactersCharacterIdSearchCategories = [GetCharactersCharacterIdSearchCategory, ...GetCharactersCharacterIdSearchCategory[]];
501
501
 
502
502
  /* get_characters_character_id_search, search query type */
503
503
 
package/v2/index.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  * THIS DTS IS AUTO GENERATED, DO NOT EDIT
10
10
  *
11
11
  * @file eve-esi-types/v2/index.d.ts
12
- * @summary This file is auto-generated and defines version 3.0.0 of the EVE Online ESI response types.
12
+ * @summary This file is auto-generated and defines version 3.0.3 of the EVE Online ESI response types.
13
13
  */
14
14
 
15
15
  import type { TESIResponseOKMap } from "./response-map.d.ts";
@@ -138,8 +138,9 @@ declare global {
138
138
  // If RealEP points to an endpoint origin (not a replaced endpoint), the path parameter is required
139
139
  PathParams extends RealEP extends EP ? IfNeedPathParams<EP>: TPathParamsNever,
140
140
  Opt extends IdentifyParameters<TESIResponseOKMap[M][EP], ActualOpt & PathParams>,
141
- R extends InferESIResponseResult<M, EP>
142
- >(method: M, endpoint: RealEP, options?: Opt) => Promise<R>;
141
+ R extends InferESIResponseResult<M, EP>,
142
+ HasOpt = HasRequireParams<TESIResponseOKMap[M][EP]> extends never ? 0 : 1
143
+ >(method: M, endpoint: RealEP, ...options: HasOpt extends 1 ? [Opt] : [Opt?]) => Promise<R>;
143
144
 
144
145
  /**
145
146
  * Represents a function that can make ESI requests for a specific HTTP method.
@@ -165,8 +166,9 @@ declare global {
165
166
  EP extends InferEndpointOrigin<RealEP, keyof TESIResponseOKMap[M]> extends never ? RealEP: InferEndpointOrigin<RealEP, keyof TESIResponseOKMap[M]>,
166
167
  PathParams extends RealEP extends EP ? IfNeedPathParams<EP>: TPathParamsNever,
167
168
  Opt extends IdentifyParameters<TESIResponseOKMap[M][EP], ActualOpt & PathParams>,
168
- R extends InferESIResponseResult<M, EP>
169
- >(endpoint: RealEP, options?: Opt) => Promise<R>;
169
+ R extends InferESIResponseResult<M, EP>,
170
+ HasOpt = HasRequireParams<TESIResponseOKMap[M][EP]> extends never ? 0 : 1
171
+ >(endpoint: RealEP, ...options: HasOpt extends 1 ? [Opt] : [Opt?]) => Promise<R>;
170
172
 
171
173
  /**
172
174
  * Replaces path parameters in a string with numbers.
@@ -222,6 +224,22 @@ declare global {
222
224
  // }[keyof TESIResponseOKMap[Method]]
223
225
  // }[TESIEntryMethod];
224
226
 
227
+ /**
228
+ * Determines if the given entry has required parameters.
229
+ *
230
+ * This type checks if an entry has any required parameters by excluding the keys "result", "tag", and "cachedSeconds".
231
+ * If any keys remain after this exclusion, it means the entry has required parameters.
232
+ *
233
+ * @template Entry - The entry type to check for required parameters.
234
+ *
235
+ * @example
236
+ * ```ts
237
+ * type ExampleEntry = { result: string, tag: string, cachedSeconds: number, auth: string };
238
+ * type HasRequired = HasRequireParams<ExampleEntry>; // "auth"
239
+ * ```
240
+ */
241
+ type HasRequireParams<Entry> = Exclude<keyof Entry, "result" | "tag" | "cachedSeconds">;
242
+
225
243
  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
226
244
  // Version 2 types
227
245
  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -9,7 +9,7 @@
9
9
  * THIS DTS IS AUTO GENERATED, DO NOT EDIT
10
10
  *
11
11
  * @file eve-esi-types/v2/response-map.d.ts
12
- * @summary This file is auto-generated and defines version 3.0.0 of the EVE Online ESI response types.
12
+ * @summary This file is auto-generated and defines version 3.0.3 of the EVE Online ESI response types.
13
13
  */
14
14
  import "./types-index.d.ts";
15
15
 
@@ -9,7 +9,7 @@
9
9
  * THIS DTS IS AUTO GENERATED, DO NOT EDIT
10
10
  *
11
11
  * @file eve-esi-types/v2/types-index.d.ts
12
- * @summary This file is auto-generated and defines version 3.0.0 of the EVE Online ESI response types.
12
+ * @summary This file is auto-generated and defines version 3.0.3 of the EVE Online ESI response types.
13
13
  */
14
14
  import "./get_wars_ok.d.ts";
15
15
  import "./get_status_ok.d.ts";
package/v2.d.mts CHANGED
@@ -13,7 +13,6 @@ export declare const getRequestPending: () => number;
13
13
  /**
14
14
  * fire ESI request ESIRequestOptions
15
15
  *
16
- * @type {TESIRequestFunctionSignature2<ESIRequestOptions>}
17
16
  * @throws {ESIRequestError}
18
17
  * @async
19
18
  */
package/v2.mjs CHANGED
@@ -35,7 +35,7 @@ let LOG = isDebug();
35
35
  * Get the number of currently executing ESI requests
36
36
  */
37
37
  let ax = 0;
38
- /** @type {(m?: Truthy) => number} */
38
+ /** @type {function(Truthy=): number} */
39
39
  const incrementAx = (minus) => minus ? ax-- : ax++;
40
40
  /**
41
41
  * @returns Get The Current ESI request pending count.
@@ -47,11 +47,10 @@ export const getRequestPending = () => ax;
47
47
  /**
48
48
  * fire ESI request ESIRequestOptions
49
49
  *
50
- * @type {TESIRequestFunctionSignature2<ESIRequestOptions>}
51
50
  * @throws {ESIRequestError}
52
51
  * @async
53
52
  */
54
- export const fire = async (mthd, endp, opt) => {
53
+ export const fire = /** @type {TESIRequestFunctionSignature2<ESIRequestOptions>} */ (async (mthd, endp, opt) => {
55
54
  /** @type {number[]=} */
56
55
  let pathParams;
57
56
  if (opt && typeof opt.pathParams !== "undefined") {
@@ -81,7 +80,7 @@ export const fire = async (mthd, endp, opt) => {
81
80
  catch (e) {
82
81
  throw e;
83
82
  }
84
- };
83
+ });
85
84
  // It should complete correctly.
86
85
  /**
87
86
  * @param {TESIRequestFunctionSignature2<ESIRequestOptions>} fn