eve-esi-types 3.2.4 → 3.2.7
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/CHANGELOG.md +39 -0
- package/README.md +87 -63
- package/{v2 → dist/v2}/esi-tagged-types.d.ts +77 -44
- package/{v2 → dist/v2}/experimental-esi-types.d.ts +139 -29
- package/dist/v2/index.d.ts +621 -0
- package/{v2 → dist/v2}/response-map.d.ts +1 -1
- package/{v2 → dist/v2}/types-index.d.ts +1 -1
- package/dist/v2/types-util.d.ts +281 -0
- package/dist/v2/util.d.ts +149 -0
- package/lib/console-util.mjs +1 -1
- package/lib/request-api.d.mts +4 -4
- package/lib/request-api.mjs +15 -16
- package/lib/rq-util.d.mts +76 -15
- package/lib/rq-util.mjs +122 -48
- package/lib/tagged-request-api.d.mts +2 -2
- package/lib/tagged-request-api.mjs +2 -2
- package/minimal-rq.mjs +5 -5
- package/package.json +5 -5
- package/request-v3.d.mts +1 -8
- package/request-v3.mjs +16 -19
- package/tagged-rq.mjs +17 -6
- package/{jsconfig.json → tsconfig.json} +5 -5
- package/v2/index.d.ts +0 -515
- package/v2/types-util.d.ts +0 -171
- package/v2/util.d.ts +0 -72
- /package/{v2 → dist/v2}/globals/alliance.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/assets.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/calendar.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/character.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/clones.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/contacts.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/contracts.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/corporation.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/dogma.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/extra-types.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/factionwarfare.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/fittings.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/fleets.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/incursions.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/industry.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/insurance.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/killmails.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/location.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/loyalty.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/mail.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/market.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/planetaryinteraction.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/routes.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/search.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/skills.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/sovereignty.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/status.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/universe.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/wallet.d.ts +0 -0
- /package/{v2 → dist/v2}/globals/wars.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [3.2.7] - 2025-04-28
|
|
6
|
+
|
|
7
|
+
### 🚜 Refactor
|
|
8
|
+
|
|
9
|
+
- Add ESIEntryParamKeys, ESIEntryExtraKeys & ResolveEndpointRequest types
|
|
10
|
+
|
|
11
|
+
### ⚙️ Miscellaneous Tasks
|
|
12
|
+
|
|
13
|
+
- Update CHANGELOG.md
|
|
14
|
+
- Update JSDoc (rename EPX to EPO and add acronym definition)
|
|
15
|
+
- Update CHANGELOG.md
|
|
16
|
+
- Bump version to v3.2.7
|
|
17
|
+
|
|
18
|
+
## [3.2.6] - 2025-04-24
|
|
19
|
+
|
|
20
|
+
### 🐛 Bug Fixes
|
|
21
|
+
|
|
22
|
+
- `normalizeOptions` bug
|
|
23
|
+
|
|
24
|
+
### ⚙️ Miscellaneous Tasks
|
|
25
|
+
|
|
26
|
+
- Update CHANGELOG.md
|
|
27
|
+
- Update "main" field in package.json to point to dist folder
|
|
28
|
+
- Bump version to v3.2.6
|
|
29
|
+
|
|
30
|
+
## [3.2.5] - 2025-04-24
|
|
31
|
+
|
|
32
|
+
### 💼 Other
|
|
33
|
+
|
|
34
|
+
- Refactor v2/experimental-esi-types.d.ts
|
|
35
|
+
|
|
36
|
+
### ⚙️ Miscellaneous Tasks
|
|
37
|
+
|
|
38
|
+
- Update CHANGELOG.md
|
|
39
|
+
- Relocate v2 files to dist/v2 directory
|
|
40
|
+
- Update import paths to reflect new structure
|
|
41
|
+
- Update jsconfig.json for improved path resolution
|
|
42
|
+
- Bump version to v3.2.5
|
|
43
|
+
|
|
5
44
|
## [3.2.4] - 2025-04-22
|
|
6
45
|
|
|
7
46
|
### 🚜 Refactor
|
package/README.md
CHANGED
|
@@ -1,105 +1,129 @@
|
|
|
1
|
+
|
|
1
2
|
# eve-esi-types
|
|
2
|
-
Extracted main types of ESI.
|
|
3
|
+
Extracted main types of ESI (EVE Swagger Interface). This package is designed to handle ESI request and response types effectively.
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
1. [Overview](#overview)
|
|
9
|
+
2. [Installation](#installation)
|
|
10
|
+
3. [Usage](#usage)
|
|
11
|
+
4. [API Overview](#api-overview)
|
|
12
|
+
5. [Version Highlights](#version-highlights)
|
|
13
|
+
- [v3.2.7](#v327)
|
|
14
|
+
- [v3.0.0](#v300)
|
|
15
|
+
- [v2.3.0](#v230)
|
|
16
|
+
6. [References](#references)
|
|
5
17
|
|
|
6
|
-
|
|
18
|
+
---
|
|
7
19
|
|
|
8
|
-
|
|
9
|
-
|
|
20
|
+
## Overview
|
|
21
|
+
`eve-esi-types` helps developers interact with the EVE Online ESI API while leveraging strong TypeScript typings.
|
|
10
22
|
|
|
11
|
-
|
|
23
|
+
This package ensures type safety for ESI request parameters, response handling, and authentication requirements.
|
|
12
24
|
|
|
13
|
-
|
|
14
|
-
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install eve-esi-types
|
|
15
31
|
```
|
|
16
32
|
|
|
17
|
-
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
18
36
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> you can determine the result type of the ESI request, what query parameters are required,
|
|
22
|
-
> and whether OAuth authentication is necessary (`auth: true`).
|
|
37
|
+
This package is configured to **use ESI version 2 by default**.
|
|
38
|
+
If you need to work with version 1, refer to the [v1 branch](https://github.com/jeffy-g/eve-esi-types/tree/version-1.x).
|
|
23
39
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// P2 extends IfParameterizedPath<EP, Opt>,
|
|
30
|
-
// Opt extends IdentifyParameters<TESIResponseOKMap[M][EP], ESIRequestOptions>,
|
|
31
|
-
// R extends InferESIResponseResult<M, EP>
|
|
32
|
-
// >(mthd: M, endp: EP, pathParams?: P2, opt?: Opt): Promise<R>;
|
|
40
|
+
### Example Usage
|
|
41
|
+
A sample script, [`request-v3.mjs`](./request-v3.mjs), is provided.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
node request-v3.mjs
|
|
33
45
|
```
|
|
34
46
|
|
|
35
|
-
|
|
47
|
+
---
|
|
36
48
|
|
|
37
|
-
|
|
49
|
+
## API Overview
|
|
38
50
|
|
|
39
|
-
|
|
51
|
+
The core export of this package is the `TESIRequestFunctionSignature2` type. It specifies the required endpoint,
|
|
40
52
|
|
|
41
|
-
|
|
53
|
+
HTTP method, query parameters, OAuth requirement, and response type for ESI requests.
|
|
42
54
|
|
|
43
|
-
|
|
55
|
+
### Main Function Signature
|
|
44
56
|
|
|
45
57
|
```ts
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
58
|
+
type TESIRequestFunctionSignature2<ActualOpt extends Record<string, unknown>> = <
|
|
59
|
+
Mtd extends TESIEntryMethod,
|
|
60
|
+
REP extends ReplacePathParams<ESIEndpointOf<Mtd>> | ESIEndpointOf<Mtd>,
|
|
61
|
+
EPO extends ResolvedEndpoint<Mtd, REP>,
|
|
62
|
+
Params extends ResolveEndpointParameters<Mtd, REP, EPO, ActualOpt>,
|
|
63
|
+
Opt extends Params["finalOptions"]
|
|
64
|
+
>(
|
|
65
|
+
method: Mtd,
|
|
66
|
+
endpoint: REP,
|
|
67
|
+
...options: Params["optionIsRequire"] extends 1 ? [Opt] : [Opt?]
|
|
68
|
+
) => Promise<Params["result"]>;
|
|
51
69
|
```
|
|
52
70
|
|
|
53
|
-
+
|
|
71
|
+
### Authentication via Environment Variable (v3.2.7+)
|
|
54
72
|
|
|
55
|
-
|
|
56
|
-
// Minimal default ESI request body implementation
|
|
57
|
-
import { esi } from "eve-esi-types/lib/tagged-request-api.mjs";
|
|
73
|
+
You can enable authenticated requests by setting the environment variable `OAUTH_TOKEN` (for testing):
|
|
58
74
|
|
|
59
|
-
|
|
75
|
+
```bash
|
|
76
|
+
export OAUTH_TOKEN=<Your Access Token>
|
|
60
77
|
```
|
|
61
78
|
|
|
62
|
-
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Version Highlights
|
|
82
|
+
|
|
83
|
+
### v3.2.7
|
|
84
|
+
- Added support for specifying the `OAUTH_TOKEN` environment variable.
|
|
85
|
+
- Allows authenticated tests to run successfully by providing an OAuth access token.
|
|
63
86
|
|
|
64
|
-
|
|
87
|
+
---
|
|
65
88
|
|
|
66
|
-
|
|
67
|
-
|
|
89
|
+
### v3.0.0
|
|
90
|
+
- Renamed `TESIRequestFunctionSignature` to `TESIRequestFunctionSignature2`.
|
|
91
|
+
- Improved endpoint inference (`RealEP` and `EP`) for better TypeScript type safety.
|
|
68
92
|
|
|
93
|
+
#### New API Example
|
|
94
|
+
Reusable, narrowing-focused API request using `decoreateESIRequestBody`:
|
|
69
95
|
|
|
70
96
|
```ts
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// If RealEP points to an endpoint origin (not a replaced endpoint), the path parameter is required
|
|
76
|
-
PathParams extends RealEP extends EP ? IfNeedPathParams<EP> : TPathParamsNever,
|
|
77
|
-
Opt extends IdentifyParameters<TESIResponseOKMap[M][EP], ActualOpt & PathParams>,
|
|
78
|
-
R extends InferESIResponseResult<M, EP>
|
|
79
|
-
>(method: M, endpoint: RealEP, options?: Opt) => Promise<R>;
|
|
97
|
+
import * as taggedApi from "eve-esi-types/lib/tagged-request-api.mjs";
|
|
98
|
+
|
|
99
|
+
const esiRequest = taggedApi.decoreateESIRequestBody(...);
|
|
100
|
+
const response = await esiRequest.universe.get("/universe/structures/", { query: { filter: "market" } });
|
|
80
101
|
```
|
|
81
102
|
|
|
82
|
-
|
|
103
|
+
#### Other Renamed Signatures
|
|
104
|
+
- `IESIRequestFunction -> IESIRequestFunction2`
|
|
105
|
+
- `TESIRequestFunctionMethods -> TESIRequestFunctionMethods2`
|
|
83
106
|
|
|
84
|
-
|
|
85
|
-
+ `TESIRequestFunctionMethods` -> `TESIRequestFunctionMethods2`
|
|
86
|
-
+ `TESIRequestFunctionEachMethod` -> `TESIRequestFunctionEachMethod2`
|
|
87
|
-
+ etc. Also, `v2/esi-tagged-types.d.ts` too
|
|
107
|
+
---
|
|
88
108
|
|
|
89
|
-
###
|
|
109
|
+
### v2.3.0
|
|
110
|
+
- Introduced intuitive ESI request handling via **ESI Tagged Types**.
|
|
111
|
+
- Deprecated `injectESIRequestBody` in favor of `decoreateESIRequestBody` in later versions.
|
|
90
112
|
|
|
91
|
-
|
|
113
|
+
Minimal default implementation:
|
|
92
114
|
|
|
93
115
|
```ts
|
|
94
|
-
import
|
|
95
|
-
|
|
96
|
-
const esiRequest = taggedApi.decoreateESIRequestBody(...);
|
|
97
|
-
const ret = await esiRequest.universe.get("/universe/structures/", { query: { filter: "market" }});
|
|
116
|
+
import { esi } from "eve-esi-types/lib/tagged-request-api.mjs";
|
|
117
|
+
const response = await esi.universe.get("/universe/structures/", { query: { filter: "market" } });
|
|
98
118
|
```
|
|
99
119
|
|
|
120
|
+
---
|
|
100
121
|
|
|
101
122
|
## References
|
|
102
123
|
|
|
103
|
-
- [
|
|
124
|
+
- [ESI Types Utility Definitions](./docs/v3/esi-types-util3.md)
|
|
125
|
+
- [ESI Tagged Types Utility Definitions](./docs/esi-tagged-types.md)
|
|
126
|
+
|
|
127
|
+
---
|
|
104
128
|
|
|
105
|
-
|
|
129
|
+
Have questions or issues? Feel free to explore the [GitHub repository](https://github.com/jeffy-g/eve-esi-types) or open an issue!
|
|
@@ -9,15 +9,15 @@
|
|
|
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.2.
|
|
12
|
+
* @summary This file is auto-generated and defines version 3.2.7 of the EVE Online ESI response types.
|
|
13
13
|
*/
|
|
14
|
-
import type { TESIResponseOKMap } from "./index.d.ts";
|
|
14
|
+
import type { TESIResponseOKMap, ResolveEndpointParameters } from "./index.d.ts";
|
|
15
15
|
export type * from "./index.d.ts";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Converts a string to lower camel case.
|
|
19
19
|
*
|
|
20
|
-
* @template S
|
|
20
|
+
* @template S The string to convert.
|
|
21
21
|
* @example
|
|
22
22
|
* // returns "assets"
|
|
23
23
|
* LCamelCase<"Assets">
|
|
@@ -46,7 +46,7 @@ declare type InferSomethingBy<Tag, AsType extends InferSomethingByBrand = InferS
|
|
|
46
46
|
// - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
47
47
|
/**
|
|
48
48
|
* Maps HTTP methods to their corresponding tags.
|
|
49
|
-
* @template M
|
|
49
|
+
* @template M The HTTP method.
|
|
50
50
|
* @date 2025/2/28
|
|
51
51
|
*/
|
|
52
52
|
export declare type ESITags = InferSomethingBy<never, InferSomethingByTags>;
|
|
@@ -61,7 +61,7 @@ export declare type LESITags = LCamelCase<ESITags>;
|
|
|
61
61
|
/**
|
|
62
62
|
* Infers the HTTP method based on the provided tag.
|
|
63
63
|
*
|
|
64
|
-
* @template Tag
|
|
64
|
+
* @template Tag The tag to infer the method for.
|
|
65
65
|
* @date 2025/2/28
|
|
66
66
|
*/
|
|
67
67
|
export declare type InferMethod<Tag> = InferSomethingBy<Tag>;
|
|
@@ -80,16 +80,13 @@ type XPlanetary = InferMethod<"Planetary Interaction">;
|
|
|
80
80
|
*
|
|
81
81
|
* + Customed InferEndpointOrigin
|
|
82
82
|
*
|
|
83
|
-
* @template RealEP
|
|
84
|
-
* @template Endpoints
|
|
85
|
-
*
|
|
86
|
-
* @typeParam RealEP - The type of the real endpoint.
|
|
87
|
-
* @typeParam Endpoints - The type of the possible endpoints.
|
|
83
|
+
* @template RealEP The type of the real endpoint.
|
|
84
|
+
* @template Endpoints The type of the possible endpoints.
|
|
88
85
|
*
|
|
89
86
|
* @returns The inferred endpoint origin.
|
|
90
87
|
*/
|
|
91
88
|
type _InferEndpointOrigin<
|
|
92
|
-
RealEP extends unknown, Endpoints extends
|
|
89
|
+
RealEP extends unknown, Endpoints extends PropertyKey
|
|
93
90
|
> = {
|
|
94
91
|
[EP in Endpoints]: RealEP extends ReplacePathParams<EP>
|
|
95
92
|
? EP : never;
|
|
@@ -97,38 +94,75 @@ type _InferEndpointOrigin<
|
|
|
97
94
|
|
|
98
95
|
/**
|
|
99
96
|
* Creates a function type for making requests to tagged endpoints.
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* @template
|
|
106
|
-
* @template
|
|
107
|
-
* @template
|
|
108
|
-
* @template
|
|
109
|
-
*
|
|
110
|
-
* @
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* @
|
|
114
|
-
*
|
|
115
|
-
*
|
|
97
|
+
*
|
|
98
|
+
* This utility type defines a function signature for interacting with ESI endpoints
|
|
99
|
+
* that are associated with specific tags and HTTP methods. It ensures type safety
|
|
100
|
+
* by inferring the required parameters, options, and response types for the given endpoint.
|
|
101
|
+
*
|
|
102
|
+
* @template M - The HTTP method (e.g., "get", "post").
|
|
103
|
+
* @template Tag - The tag associated with the endpoint (e.g., "Assets", "Skills").
|
|
104
|
+
* @template ActualOpt - A record type representing additional options for the request.
|
|
105
|
+
* @template EndPoints - The possible endpoints associated with the tag and method.
|
|
106
|
+
*
|
|
107
|
+
* @param endpoint - The endpoint path, which can be parameterized or resolved.
|
|
108
|
+
* @param options - An optional object containing additional options for the request.
|
|
109
|
+
* If the endpoint has required parameters, this parameter must be provided.
|
|
110
|
+
* @returns A promise that resolves to the response type of the endpoint.
|
|
111
|
+
*
|
|
116
112
|
* @remarks
|
|
117
|
-
* The `...options:
|
|
118
|
-
* the
|
|
113
|
+
* - The `...options: Params["optionIsRequire"] extends 1 ? [Opt] : [Opt?]` parameter ensures
|
|
114
|
+
* that if the endpoint has required parameters, the `options` parameter must be provided.
|
|
115
|
+
* If there are no required parameters, the `options` parameter is optional.
|
|
116
|
+
* - This type leverages `ResolveEndpointParameters` to infer the required options and response type.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* // Example: Making a request to the "Assets" tag with the "get" method
|
|
121
|
+
* type AssetsRequest = TaggedEndpointRequestFunction2<"get", "Assets", ESIRequestOptions>;
|
|
122
|
+
* const fetchAssets: AssetsRequest = async (endpoint, ...options) => {
|
|
123
|
+
* // Implementation here
|
|
124
|
+
* throw new Error();
|
|
125
|
+
* };
|
|
126
|
+
* fetchAssets("/characters/{character_id}/assets/", {
|
|
127
|
+
* pathParams: 12345,
|
|
128
|
+
* auth: true,
|
|
129
|
+
* token: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
|
|
130
|
+
* }).then(response => {
|
|
131
|
+
* console.log(response);
|
|
132
|
+
* });
|
|
133
|
+
* ```
|
|
134
|
+
*
|
|
135
|
+
* @see {@link ResolveEndpointParameters}
|
|
136
|
+
* @see {@link SelectEndpointByTag}
|
|
137
|
+
* @see {@link InferESIResponseResult}
|
|
119
138
|
*/
|
|
139
|
+
/* ctt
|
|
120
140
|
export declare type TaggedEndpointRequestFunction2<
|
|
121
141
|
M extends TESIEntryMethod, Tag extends ESITags,
|
|
122
142
|
ActualOpt extends Record<string, unknown> = {},
|
|
123
143
|
EndPoints extends SelectEndpointByTag<Tag, M> = SelectEndpointByTag<Tag, M>,
|
|
124
144
|
> = <
|
|
125
145
|
REP extends ReplacePathParams<EndPoints> | EndPoints,
|
|
126
|
-
|
|
127
|
-
PPM extends InferPathParams<REP,
|
|
128
|
-
Opt extends IdentifyParameters<M,
|
|
129
|
-
Ret extends InferESIResponseResult<M,
|
|
130
|
-
HasOpt = HasRequireParams<M,
|
|
146
|
+
EPO extends _InferEndpointOrigin<REP, EndPoints> extends never ? REP: _InferEndpointOrigin<REP, EndPoints>,
|
|
147
|
+
PPM extends InferPathParams<REP, EPO>,
|
|
148
|
+
Opt extends IdentifyParameters<M, EPO, ActualOpt, PPM>,
|
|
149
|
+
Ret extends InferESIResponseResult<M, EPO>,
|
|
150
|
+
HasOpt = HasRequireParams<M, EPO, PPM>,
|
|
131
151
|
>(endpoint: REP, ...options: HasOpt extends 1 ? [Opt] : [Opt?]) => Promise<Ret>;
|
|
152
|
+
/*/
|
|
153
|
+
export declare type TaggedEndpointRequestFunction2<
|
|
154
|
+
M extends TESIEntryMethod, Tag extends ESITags,
|
|
155
|
+
ActualOpt extends Record<string, unknown> = {},
|
|
156
|
+
EndPoints extends SelectEndpointByTag<Tag, M> = SelectEndpointByTag<Tag, M>,
|
|
157
|
+
> = <
|
|
158
|
+
REP extends ReplacePathParams<EndPoints> | EndPoints,
|
|
159
|
+
EPO extends _InferEndpointOrigin<REP, EndPoints> extends never ? REP: _InferEndpointOrigin<REP, EndPoints>,
|
|
160
|
+
// @ts-expect-error TODO: 2025/4/28 TS2344: Type 'EPO' does not satisfy the constraint 'ResolvedEndpoint<M, REP>'
|
|
161
|
+
Params extends ResolveEndpointParameters<M, REP, EPO, ActualOpt>,
|
|
162
|
+
Opt extends Params["finalOptions"],
|
|
163
|
+
Ret extends Params["result"],
|
|
164
|
+
>(endpoint: REP, ...options: Params["optionIsRequire"] extends 1 ? [Opt] : [Opt?]) => Promise<Ret>;
|
|
165
|
+
//*/
|
|
132
166
|
|
|
133
167
|
|
|
134
168
|
// - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
@@ -137,8 +171,8 @@ export declare type TaggedEndpointRequestFunction2<
|
|
|
137
171
|
/**
|
|
138
172
|
* Maps tags to their corresponding endpoint request functions.
|
|
139
173
|
*
|
|
140
|
-
* @template Tag
|
|
141
|
-
* @template ActualOpt
|
|
174
|
+
* @template Tag The tag to map.
|
|
175
|
+
* @template ActualOpt The actual options for the request.
|
|
142
176
|
* @date 2025/2/28
|
|
143
177
|
*/
|
|
144
178
|
export declare type ESITaggedEndpointRequest2<Tag extends ESITags, ActualOpt extends Record<string, unknown> = {}> = {
|
|
@@ -153,19 +187,18 @@ export declare type ESITaggedEndpointRequest2<Tag extends ESITags, ActualOpt ext
|
|
|
153
187
|
/**
|
|
154
188
|
* Selects an endpoint by tag and method.
|
|
155
189
|
*
|
|
156
|
-
* @template Tag
|
|
157
|
-
* @template M
|
|
158
|
-
* @template EP - The endpoint path.
|
|
190
|
+
* @template Tag The tag associated with the endpoint.
|
|
191
|
+
* @template M The HTTP method.
|
|
159
192
|
* @date 2025/2/28
|
|
160
193
|
*/
|
|
161
194
|
export declare type SelectEndpointByTag<
|
|
162
195
|
Tag extends ESITags, M extends TESIEntryMethod
|
|
163
196
|
> = {
|
|
164
|
-
[EP in
|
|
197
|
+
[EP in ESIEndpointOf<M>]: TESIResponseOKMap[M][EP] extends { tag: infer ActualTag }
|
|
165
198
|
? ActualTag extends Tag
|
|
166
199
|
? EP : never
|
|
167
200
|
: never;
|
|
168
|
-
}[
|
|
201
|
+
}[ESIEndpointOf<M>];
|
|
169
202
|
/* ctt
|
|
170
203
|
type XAssetsEndpointGet = SelectEndpointByTag<"Assets", "get">;
|
|
171
204
|
type XAssetsEndpointPost = SelectEndpointByTag<"Assets", "post">;
|
|
@@ -175,7 +208,7 @@ type XAssetsEndpointPost = SelectEndpointByTag<"Assets", "post">;
|
|
|
175
208
|
/**
|
|
176
209
|
* Maps lower camel case tags to their corresponding endpoint request functions.
|
|
177
210
|
*
|
|
178
|
-
* @template ActualOpt
|
|
211
|
+
* @template ActualOpt The actual options for the request.
|
|
179
212
|
* @date 2025/3/12
|
|
180
213
|
*/
|
|
181
214
|
export declare type TaggedESIRequestMap2<ActualOpt extends Record<string, unknown> = {}> = {
|
|
@@ -189,9 +222,9 @@ export declare type TaggedESIRequestMap2<ActualOpt extends Record<string, unknow
|
|
|
189
222
|
* const esiRq: TaggedESIRequestMapPartial2<"factionWarfare" | "wallet">;
|
|
190
223
|
* ```
|
|
191
224
|
*
|
|
192
|
-
* @template
|
|
225
|
+
* @template LowerTags The properties to require in the partial map.
|
|
193
226
|
* @date 2025/2/28
|
|
194
227
|
*/
|
|
195
|
-
export declare type TaggedESIRequestMapPartial2<
|
|
228
|
+
export declare type TaggedESIRequestMapPartial2<LowerTags extends LCamelCase<ESITags>> = RequireThese<Partial<TaggedESIRequestMap2>, LowerTags>;
|
|
196
229
|
|
|
197
230
|
export as namespace XESI;
|