feat(#31): RFollow mammon location rename in the generated client

This commit is contained in:
Sirttas
2026-07-14 17:14:07 +02:00
parent 52addba909
commit 777cb74574
4 changed files with 228 additions and 226 deletions
+12 -10
View File
@@ -777,10 +777,11 @@ paths:
/locations/{id}:
get:
tags:
- universe
summary: Resolve a market location id to its name and containing solar system
and region
operationId: resolveLocation
- location
summary: "Resolve a market location id (NPC station or public structure, or\
\ a private structure reachable by the authenticated caller's characters)\
\ to its name and containing solar system and region"
operationId: findLocationById
parameters:
- name: id
in: path
@@ -795,7 +796,7 @@ paths:
content:
'*/*':
schema:
$ref: "#/components/schemas/MarketLocationResponse"
$ref: "#/components/schemas/DockableLocationResponse"
"400":
description: Returned when the id is not a market location id
"404":
@@ -803,9 +804,10 @@ paths:
/locations/search:
get:
tags:
- universe
summary: "Search NPC market locations (stations) whose name contains the given\
\ text, case-insensitively"
- location
summary: "Search market locations (NPC stations and public structures, plus\
\ private structures reachable by the authenticated caller's characters) whose\
\ name contains the given text, case-insensitively"
operationId: searchLocations
parameters:
- name: name
@@ -831,7 +833,7 @@ paths:
schema:
type: array
items:
$ref: "#/components/schemas/MarketLocationResponse"
$ref: "#/components/schemas/DockableLocationResponse"
"400":
description: |-
Returned when:
@@ -1701,7 +1703,7 @@ components:
- regionId
- volumeRemain
- volumeTotal
MarketLocationResponse:
DockableLocationResponse:
type: object
description: A market location (NPC station) with its containing solar system
and region.
+209 -209
View File
@@ -190,6 +190,35 @@ export interface CreateMainLedgerRequest {
*/
'name': string;
}
/**
* A market location (NPC station) with its containing solar system and region.
*/
export interface DockableLocationResponse {
/**
* EVE market location id (station id).
*/
'id': number;
/**
* Location name.
*/
'name': string;
/**
* Id of the solar system the location is in.
*/
'systemId': number;
/**
* Name of the solar system the location is in.
*/
'systemName': string;
/**
* Id of the region the location is in.
*/
'regionId': number;
/**
* Name of the region the location is in.
*/
'regionName': string;
}
/**
* Quartile statistics computed over a market type\'s price history.
*/
@@ -368,35 +397,6 @@ export interface MarketHistoryResponse {
*/
'volume': number;
}
/**
* A market location (NPC station) with its containing solar system and region.
*/
export interface MarketLocationResponse {
/**
* EVE market location id (station id).
*/
'id': number;
/**
* Location name.
*/
'name': string;
/**
* Id of the solar system the location is in.
*/
'systemId': number;
/**
* Name of the solar system the location is in.
*/
'systemName': string;
/**
* Id of the region the location is in.
*/
'regionId': number;
/**
* Name of the region the location is in.
*/
'regionName': string;
}
/**
* An open market order placed by one of the authenticated user\'s characters.
*/
@@ -2073,6 +2073,186 @@ export class LedgerApi extends BaseAPI {
/**
* LocationApi - axios parameter creator
*/
export const LocationApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @summary Resolve a market location id (NPC station or public structure, or a private structure reachable by the authenticated caller\'s characters) to its name and containing solar system and region
* @param {number} id Market location id (station id) to resolve, e.g. 60003760
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
findLocationById: async (id: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('findLocationById', 'id', id)
const localVarPath = `/locations/{id}`
.replace('{id}', encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
localVarHeaderParameter['Accept'] = '*/*';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Search market locations (NPC stations and public structures, plus private structures reachable by the authenticated caller\'s characters) whose name contains the given text, case-insensitively
* @param {string} name Text to match against the location name, e.g. name&#x3D;jita
* @param {number} [limit] Maximum number of results to return, defaults to 50
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
searchLocations: async (name: string, limit?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('searchLocations', 'name', name)
const localVarPath = `/locations/search`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (name !== undefined) {
localVarQueryParameter['name'] = name;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
localVarHeaderParameter['Accept'] = '*/*';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* LocationApi - functional programming interface
*/
export const LocationApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = LocationApiAxiosParamCreator(configuration)
return {
/**
*
* @summary Resolve a market location id (NPC station or public structure, or a private structure reachable by the authenticated caller\'s characters) to its name and containing solar system and region
* @param {number} id Market location id (station id) to resolve, e.g. 60003760
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async findLocationById(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DockableLocationResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.findLocationById(id, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['LocationApi.findLocationById']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Search market locations (NPC stations and public structures, plus private structures reachable by the authenticated caller\'s characters) whose name contains the given text, case-insensitively
* @param {string} name Text to match against the location name, e.g. name&#x3D;jita
* @param {number} [limit] Maximum number of results to return, defaults to 50
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async searchLocations(name: string, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<DockableLocationResponse>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.searchLocations(name, limit, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['LocationApi.searchLocations']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
}
};
/**
* LocationApi - factory interface
*/
export const LocationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = LocationApiFp(configuration)
return {
/**
*
* @summary Resolve a market location id (NPC station or public structure, or a private structure reachable by the authenticated caller\'s characters) to its name and containing solar system and region
* @param {number} id Market location id (station id) to resolve, e.g. 60003760
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
findLocationById(id: number, options?: RawAxiosRequestConfig): AxiosPromise<DockableLocationResponse> {
return localVarFp.findLocationById(id, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Search market locations (NPC stations and public structures, plus private structures reachable by the authenticated caller\'s characters) whose name contains the given text, case-insensitively
* @param {string} name Text to match against the location name, e.g. name&#x3D;jita
* @param {number} [limit] Maximum number of results to return, defaults to 50
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
searchLocations(name: string, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise<Array<DockableLocationResponse>> {
return localVarFp.searchLocations(name, limit, options).then((request) => request(axios, basePath));
},
};
};
/**
* LocationApi - object-oriented interface
*/
export class LocationApi extends BaseAPI {
/**
*
* @summary Resolve a market location id (NPC station or public structure, or a private structure reachable by the authenticated caller\'s characters) to its name and containing solar system and region
* @param {number} id Market location id (station id) to resolve, e.g. 60003760
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public findLocationById(id: number, options?: RawAxiosRequestConfig) {
return LocationApiFp(this.configuration).findLocationById(id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Search market locations (NPC stations and public structures, plus private structures reachable by the authenticated caller\'s characters) whose name contains the given text, case-insensitively
* @param {string} name Text to match against the location name, e.g. name&#x3D;jita
* @param {number} [limit] Maximum number of results to return, defaults to 50
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public searchLocations(name: string, limit?: number, options?: RawAxiosRequestConfig) {
return LocationApiFp(this.configuration).searchLocations(name, limit, options).then((request) => request(this.axios, this.basePath));
}
}
/**
* MarketApi - axios parameter creator
*/
@@ -3594,183 +3774,3 @@ export class TransactionApi extends BaseAPI {
/**
* UniverseApi - axios parameter creator
*/
export const UniverseApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @summary Resolve a market location id to its name and containing solar system and region
* @param {number} id Market location id (station id) to resolve, e.g. 60003760
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
resolveLocation: async (id: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('resolveLocation', 'id', id)
const localVarPath = `/locations/{id}`
.replace('{id}', encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
localVarHeaderParameter['Accept'] = '*/*';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Search NPC market locations (stations) whose name contains the given text, case-insensitively
* @param {string} name Text to match against the location name, e.g. name&#x3D;jita
* @param {number} [limit] Maximum number of results to return, defaults to 50
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
searchLocations: async (name: string, limit?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'name' is not null or undefined
assertParamExists('searchLocations', 'name', name)
const localVarPath = `/locations/search`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (name !== undefined) {
localVarQueryParameter['name'] = name;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
localVarHeaderParameter['Accept'] = '*/*';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* UniverseApi - functional programming interface
*/
export const UniverseApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = UniverseApiAxiosParamCreator(configuration)
return {
/**
*
* @summary Resolve a market location id to its name and containing solar system and region
* @param {number} id Market location id (station id) to resolve, e.g. 60003760
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async resolveLocation(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MarketLocationResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.resolveLocation(id, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['UniverseApi.resolveLocation']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Search NPC market locations (stations) whose name contains the given text, case-insensitively
* @param {string} name Text to match against the location name, e.g. name&#x3D;jita
* @param {number} [limit] Maximum number of results to return, defaults to 50
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async searchLocations(name: string, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<MarketLocationResponse>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.searchLocations(name, limit, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['UniverseApi.searchLocations']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
}
};
/**
* UniverseApi - factory interface
*/
export const UniverseApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = UniverseApiFp(configuration)
return {
/**
*
* @summary Resolve a market location id to its name and containing solar system and region
* @param {number} id Market location id (station id) to resolve, e.g. 60003760
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
resolveLocation(id: number, options?: RawAxiosRequestConfig): AxiosPromise<MarketLocationResponse> {
return localVarFp.resolveLocation(id, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Search NPC market locations (stations) whose name contains the given text, case-insensitively
* @param {string} name Text to match against the location name, e.g. name&#x3D;jita
* @param {number} [limit] Maximum number of results to return, defaults to 50
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
searchLocations(name: string, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise<Array<MarketLocationResponse>> {
return localVarFp.searchLocations(name, limit, options).then((request) => request(axios, basePath));
},
};
};
/**
* UniverseApi - object-oriented interface
*/
export class UniverseApi extends BaseAPI {
/**
*
* @summary Resolve a market location id to its name and containing solar system and region
* @param {number} id Market location id (station id) to resolve, e.g. 60003760
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public resolveLocation(id: number, options?: RawAxiosRequestConfig) {
return UniverseApiFp(this.configuration).resolveLocation(id, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Search NPC market locations (stations) whose name contains the given text, case-insensitively
* @param {string} name Text to match against the location name, e.g. name&#x3D;jita
* @param {number} [limit] Maximum number of results to return, defaults to 50
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public searchLocations(name: string, limit?: number, options?: RawAxiosRequestConfig) {
return UniverseApiFp(this.configuration).searchLocations(name, limit, options).then((request) => request(this.axios, this.basePath));
}
}
+3 -3
View File
@@ -7,13 +7,13 @@ import {
AuthApi,
CharacterApi,
LedgerApi,
LocationApi,
MarketApi,
MeResponse,
ReprocessingApi,
RuleBookApi,
RuleScriptApi,
TransactionApi,
UniverseApi
TransactionApi
} from "@/generated/mammon";
export const mammonUrl = import.meta.env.VITE_MAMMON_URL;
@@ -107,4 +107,4 @@ export const activityApi = new ActivityApi(undefined, mammonUrl, mammonAxiosInst
export const acquisitionApi = new AcquisitionApi(undefined, mammonUrl, mammonAxiosInstance);
export const marketApi = new MarketApi(undefined, mammonUrl, mammonAxiosInstance);
export const reprocessingApi = new ReprocessingApi(undefined, mammonUrl, mammonAxiosInstance);
export const universeApi = new UniverseApi(undefined, mammonUrl, mammonAxiosInstance);
export const locationApi = new LocationApi(undefined, mammonUrl, mammonAxiosInstance);
+4 -4
View File
@@ -1,7 +1,7 @@
import {universeApi} from '@/mammon/mammonService';
import type {MarketLocationResponse} from '@/generated/mammon';
import {locationApi} from '@/mammon/mammonService';
import type {DockableLocationResponse} from '@/generated/mammon';
export type MarketLocation = MarketLocationResponse;
export type MarketLocation = DockableLocationResponse;
const cache = new Map<number, MarketLocation>();
@@ -24,7 +24,7 @@ export const searchMarketLocations = async (search: string): Promise<MarketLocat
if (search.length === 0) {
return [];
}
const locations = await universeApi.searchLocations(search).then(r => r.data);
const locations = await locationApi.searchLocations(search).then(r => r.data);
locations.forEach(l => cache.set(l.id, l));
return locations.toSorted((a, b) => hubRank(a.id) - hubRank(b.id));
};