diff --git a/docs/mammon-api.yml b/docs/mammon-api.yml index 4036f93..c5f12f3 100644 --- a/docs/mammon-api.yml +++ b/docs/mammon-api.yml @@ -147,7 +147,7 @@ paths: type: array items: $ref: "#/components/schemas/ReprocessingResultResponse" - /reprocessing/raw: + /reprocessing/paste: post: tags: - reprocessing @@ -205,7 +205,7 @@ paths: '*/*': schema: $ref: "#/components/schemas/RefreshResponse" - /market/types/parse: + /market/types/paste: post: tags: - market @@ -233,6 +233,44 @@ paths: "400": description: Returned when a line carries a quantity that is not a positive whole number + /market/prices/paste: + post: + tags: + - market + summary: "Parse a pasted EVE inventory block (item name + quantity, tab/newline\ + \ separated) and return the current valuation of each stack at the given market\ + \ location (Jita by default)" + operationId: pastePrices + parameters: + - name: locationId + in: query + description: Station or structure id of the market to price against; defaults + to Jita when omitted + required: false + schema: + type: integer + format: int64 + requestBody: + content: + text/plain: + schema: + type: string + description: "Raw inventory block copied from the EVE client, e.g. \"\ + Tritanium\\t1000\"" + required: true + responses: + "200": + description: "One stack appraisal per resolved market type, valued at current\ + \ buy and sell prices" + content: + '*/*': + schema: + type: array + items: + $ref: "#/components/schemas/MarketTypeStackAppraisalResponse" + "400": + description: Returned when the request body is not text/plain or locationId + is not a market location id /market/history/refresh: post: tags: @@ -641,8 +679,9 @@ paths: get: tags: - market - summary: "Return the current Jita order book (highest buy, lowest sell, order\ - \ count) for each requested market type" + summary: "Return the current order book (highest buy, lowest sell, order count)\ + \ for each requested market type, priced at the given market location (Jita\ + \ by default)" operationId: currentPrices parameters: - name: types @@ -654,6 +693,14 @@ paths: items: type: integer format: int64 + - name: locationId + in: query + description: Station or structure id of the market to price against; defaults + to Jita when omitted + required: false + schema: + type: integer + format: int64 responses: "200": description: "The order book for each requested type, one entry per type" @@ -668,6 +715,7 @@ paths: Returned when: - the types parameter is missing - a types value is not a numeric id + - locationId is not a market location id /market/orders: get: tags: @@ -726,6 +774,69 @@ paths: - the types parameter is missing - a types value is not a numeric id - the days parameter is not greater than 0 + /locations/{id}: + get: + tags: + - universe + summary: Resolve a market location id to its name and containing solar system + and region + operationId: resolveLocation + parameters: + - name: id + in: path + description: "Market location id (station id) to resolve, e.g. 60003760" + required: true + schema: + type: integer + format: int64 + responses: + "200": + description: The resolved market location + content: + '*/*': + schema: + $ref: "#/components/schemas/MarketLocationResponse" + "400": + description: Returned when the id is not a market location id + "404": + description: Returned when no market location has the given id + /locations/search: + get: + tags: + - universe + summary: "Search NPC market locations (stations) whose name contains the given\ + \ text, case-insensitively" + operationId: searchLocations + parameters: + - name: name + in: query + description: "Text to match against the location name, e.g. name=jita" + required: true + schema: + type: string + - name: limit + in: query + description: "Maximum number of results to return, defaults to 50" + required: false + schema: + type: integer + format: int32 + default: 50 + responses: + "200": + description: "The market locations matching the search, ordered by name\ + \ and capped at the requested limit" + content: + '*/*': + schema: + type: array + items: + $ref: "#/components/schemas/MarketLocationResponse" + "400": + description: |- + Returned when: + - the name parameter is missing + - the limit value is not a number /ledgers: get: tags: @@ -1590,6 +1701,45 @@ components: - regionId - volumeRemain - volumeTotal + MarketLocationResponse: + type: object + description: A market location (NPC station) with its containing solar system + and region. + properties: + id: + type: integer + format: int64 + description: EVE market location id (station id). + example: 60003760 + name: + type: string + description: Location name. + example: Jita IV - Moon 4 - Caldari Navy Assembly Plant + systemId: + type: integer + format: int64 + description: Id of the solar system the location is in. + example: 30000142 + systemName: + type: string + description: Name of the solar system the location is in. + example: Jita + regionId: + type: integer + format: int64 + description: Id of the region the location is in. + example: 10000002 + regionName: + type: string + description: Name of the region the location is in. + example: The Forge + required: + - id + - name + - regionId + - regionName + - systemId + - systemName LedgerResponse: description: "A ledger, either a standalone main ledger or a combined ledger\ \ aggregating others." diff --git a/src/generated/mammon/api.ts b/src/generated/mammon/api.ts index 9850233..3ce5d07 100644 --- a/src/generated/mammon/api.ts +++ b/src/generated/mammon/api.ts @@ -368,6 +368,35 @@ 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. */ @@ -2051,12 +2080,13 @@ export const MarketApiAxiosParamCreator = function (configuration?: Configuratio return { /** * - * @summary Return the current Jita order book (highest buy, lowest sell, order count) for each requested market type + * @summary Return the current order book (highest buy, lowest sell, order count) for each requested market type, priced at the given market location (Jita by default) * @param {Array} types Market type ids to price, e.g. types=34,35 + * @param {number} [locationId] Station or structure id of the market to price against; defaults to Jita when omitted * @param {*} [options] Override http request option. * @throws {RequiredError} */ - currentPrices: async (types: Array, options: RawAxiosRequestConfig = {}): Promise => { + currentPrices: async (types: Array, locationId?: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'types' is not null or undefined assertParamExists('currentPrices', 'types', types) const localVarPath = `/market/prices`; @@ -2075,6 +2105,10 @@ export const MarketApiAxiosParamCreator = function (configuration?: Configuratio localVarQueryParameter['types'] = types; } + if (locationId !== undefined) { + localVarQueryParameter['locationId'] = locationId; + } + localVarHeaderParameter['Accept'] = '*/*'; setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -2283,7 +2317,7 @@ export const MarketApiAxiosParamCreator = function (configuration?: Configuratio parseStacks: async (body: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'body' is not null or undefined assertParamExists('parseStacks', 'body', body) - const localVarPath = `/market/types/parse`; + const localVarPath = `/market/types/paste`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -2308,6 +2342,46 @@ export const MarketApiAxiosParamCreator = function (configuration?: Configuratio options: localVarRequestOptions, }; }, + /** + * + * @summary Parse a pasted EVE inventory block (item name + quantity, tab/newline separated) and return the current valuation of each stack at the given market location (Jita by default) + * @param {string} body + * @param {number} [locationId] Station or structure id of the market to price against; defaults to Jita when omitted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + pastePrices: async (body: string, locationId?: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('pastePrices', 'body', body) + const localVarPath = `/market/prices/paste`; + // 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: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (locationId !== undefined) { + localVarQueryParameter['locationId'] = locationId; + } + + localVarHeaderParameter['Content-Type'] = 'text/plain'; + localVarHeaderParameter['Accept'] = '*/*'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @summary Scan every tracked market type, returning volume-weighted price quartiles and the recent price trend for each @@ -2455,13 +2529,14 @@ export const MarketApiFp = function(configuration?: Configuration) { return { /** * - * @summary Return the current Jita order book (highest buy, lowest sell, order count) for each requested market type + * @summary Return the current order book (highest buy, lowest sell, order count) for each requested market type, priced at the given market location (Jita by default) * @param {Array} types Market type ids to price, e.g. types=34,35 + * @param {number} [locationId] Station or structure id of the market to price against; defaults to Jita when omitted * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async currentPrices(types: Array, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.currentPrices(types, options); + async currentPrices(types: Array, locationId?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.currentPrices(types, locationId, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['MarketApi.currentPrices']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); @@ -2546,6 +2621,20 @@ export const MarketApiFp = function(configuration?: Configuration) { const localVarOperationServerBasePath = operationServerMap['MarketApi.parseStacks']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + /** + * + * @summary Parse a pasted EVE inventory block (item name + quantity, tab/newline separated) and return the current valuation of each stack at the given market location (Jita by default) + * @param {string} body + * @param {number} [locationId] Station or structure id of the market to price against; defaults to Jita when omitted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async pastePrices(body: string, locationId?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.pastePrices(body, locationId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['MarketApi.pastePrices']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** * * @summary Scan every tracked market type, returning volume-weighted price quartiles and the recent price trend for each @@ -2602,13 +2691,14 @@ export const MarketApiFactory = function (configuration?: Configuration, basePat return { /** * - * @summary Return the current Jita order book (highest buy, lowest sell, order count) for each requested market type + * @summary Return the current order book (highest buy, lowest sell, order count) for each requested market type, priced at the given market location (Jita by default) * @param {Array} types Market type ids to price, e.g. types=34,35 + * @param {number} [locationId] Station or structure id of the market to price against; defaults to Jita when omitted * @param {*} [options] Override http request option. * @throws {RequiredError} */ - currentPrices(types: Array, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.currentPrices(types, options).then((request) => request(axios, basePath)); + currentPrices(types: Array, locationId?: number, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.currentPrices(types, locationId, options).then((request) => request(axios, basePath)); }, /** * @@ -2672,6 +2762,17 @@ export const MarketApiFactory = function (configuration?: Configuration, basePat parseStacks(body: string, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.parseStacks(body, options).then((request) => request(axios, basePath)); }, + /** + * + * @summary Parse a pasted EVE inventory block (item name + quantity, tab/newline separated) and return the current valuation of each stack at the given market location (Jita by default) + * @param {string} body + * @param {number} [locationId] Station or structure id of the market to price against; defaults to Jita when omitted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + pastePrices(body: string, locationId?: number, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.pastePrices(body, locationId, options).then((request) => request(axios, basePath)); + }, /** * * @summary Scan every tracked market type, returning volume-weighted price quartiles and the recent price trend for each @@ -2717,13 +2818,14 @@ export const MarketApiFactory = function (configuration?: Configuration, basePat export class MarketApi extends BaseAPI { /** * - * @summary Return the current Jita order book (highest buy, lowest sell, order count) for each requested market type + * @summary Return the current order book (highest buy, lowest sell, order count) for each requested market type, priced at the given market location (Jita by default) * @param {Array} types Market type ids to price, e.g. types=34,35 + * @param {number} [locationId] Station or structure id of the market to price against; defaults to Jita when omitted * @param {*} [options] Override http request option. * @throws {RequiredError} */ - public currentPrices(types: Array, options?: RawAxiosRequestConfig) { - return MarketApiFp(this.configuration).currentPrices(types, options).then((request) => request(this.axios, this.basePath)); + public currentPrices(types: Array, locationId?: number, options?: RawAxiosRequestConfig) { + return MarketApiFp(this.configuration).currentPrices(types, locationId, options).then((request) => request(this.axios, this.basePath)); } /** @@ -2794,6 +2896,18 @@ export class MarketApi extends BaseAPI { return MarketApiFp(this.configuration).parseStacks(body, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary Parse a pasted EVE inventory block (item name + quantity, tab/newline separated) and return the current valuation of each stack at the given market location (Jita by default) + * @param {string} body + * @param {number} [locationId] Station or structure id of the market to price against; defaults to Jita when omitted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + public pastePrices(body: string, locationId?: number, options?: RawAxiosRequestConfig) { + return MarketApiFp(this.configuration).pastePrices(body, locationId, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @summary Scan every tracked market type, returning volume-weighted price quartiles and the recent price trend for each @@ -2984,7 +3098,7 @@ export const ReprocessingApiAxiosParamCreator = function (configuration?: Config assertParamExists('reprocessRawItems', 'characterId', characterId) // verify required parameter 'body' is not null or undefined assertParamExists('reprocessRawItems', 'body', body) - const localVarPath = `/reprocessing/raw`; + const localVarPath = `/reprocessing/paste`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -3480,3 +3594,183 @@ 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 => { + // 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=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 => { + // 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> { + 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=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>> { + 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 { + 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=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> { + 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=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)); + } +} + + +