feat(#5): use auth

This commit is contained in:
Sirttas
2026-06-28 14:18:09 +02:00
parent e7249df23f
commit 61fbc8e16b
11 changed files with 1263 additions and 26 deletions
+716 -3
View File
@@ -23,14 +23,41 @@ import type { RequestArgs } from './base';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
/**
* A single acquisition of a market type, tracking the remaining quantity available in the FIFO cost pool.
*/
export interface AcquisitionResponse {
/**
* Unique acquisition identifier.
*/
'acquisitionId': string;
/**
* EVE character id that made the acquisition.
*/
'characterId': number;
/**
* EVE market type (item) id that was acquired.
*/
'marketTypeId': number;
/**
* How the item entered the inventory.
*/
'source': AcquisitionResponseSourceEnum;
/**
* When the acquisition occurred.
*/
'datetime': string;
/**
* Quantity originally acquired.
*/
'quantity': number;
/**
* Quantity still remaining in the FIFO cost pool.
*/
'remaining': number;
/**
* Cost per unit at acquisition time, in ISK.
*/
'unitCost': number;
}
@@ -41,44 +68,140 @@ export const AcquisitionResponseSourceEnum = {
export type AcquisitionResponseSourceEnum = typeof AcquisitionResponseSourceEnum[keyof typeof AcquisitionResponseSourceEnum];
/**
* The balance of a ledger: its ISK total plus the quantity of each item type held.
*/
export interface BalanceResponse {
/**
* ISK balance of the ledger.
*/
'iskBalance': number;
/**
* Per-item-type quantities held in the ledger.
*/
'itemBalances': Array<ItemBalanceResponse>;
}
/**
* An EVE Online character.
*/
export interface CharacterResponse {
/**
* EVE character id.
*/
'characterId': number;
/**
* Character name.
*/
'name': string;
}
/**
* A rule book assigned to a character, with the ledger bindings that resolve its references.
*/
export interface CharacterRuleBookResponse {
/**
* The character the rule book is assigned to.
*/
'character': CharacterResponse;
/**
* Summary of the assigned rule book.
*/
'ruleBook': RuleBookSummaryResponse;
/**
* Bindings from each ledger reference name to the ledger id it resolves to for this character.
*/
'bindings': { [key: string]: string; };
}
/**
* A combined ledger: an aggregate whose balance is the sum of its member ledgers.
*/
export interface CombinedLedgerResponse extends LedgerResponse {
/**
* Unique ledger identifier.
*/
'ledgerId': string;
/**
* Ledger name.
*/
'name': string;
/**
* Aggregate ISK balance across all member ledgers.
*/
'balance': number;
/**
* Ids of the ledgers aggregated by this combined ledger.
*/
'memberLedgerIds': Array<string>;
}
/**
* Request to create a new combined ledger aggregating the given member ledgers.
*/
export interface CreateCombinedLedgerRequest {
/**
* Name for the new combined ledger.
*/
'name': string;
/**
* Ids of the ledgers to aggregate.
*/
'memberLedgerIds': Array<string>;
}
/**
* Request to create a new main ledger.
*/
export interface CreateMainLedgerRequest {
/**
* Name for the new ledger.
*/
'name': string;
}
/**
* Request to create a new rule book.
*/
export interface CreateRuleBookRequest {
/**
* Rule book name.
*/
'name': string;
/**
* Whether this rule book is used to derive acquisitions.
*/
'usedForAcquisitions': boolean;
/**
* Symbolic ledger references the script writes to; each must be bound to a ledger per character.
*/
'ledgerRefs': Array<string>;
/**
* The classification script source.
*/
'script': string;
}
/**
* Quartile statistics computed over a market type\'s price history.
*/
export interface HistoryQuartilesResponse {
/**
* EVE market type (item) id.
*/
'marketTypeId': number;
/**
* First quartile (25th percentile) price, in ISK.
*/
'q1': number;
/**
* Median (50th percentile) price, in ISK.
*/
'median': number;
/**
* Third quartile (75th percentile) price, in ISK.
*/
'q3': number;
/**
* Total traded volume over the period.
*/
'totalVolume': number;
/**
* Overall price trend over the period.
*/
'trend': HistoryQuartilesResponseTrendEnum;
}
@@ -90,56 +213,177 @@ export const HistoryQuartilesResponseTrendEnum = {
export type HistoryQuartilesResponseTrendEnum = typeof HistoryQuartilesResponseTrendEnum[keyof typeof HistoryQuartilesResponseTrendEnum];
/**
* A transfer of ISK from one ledger to another.
*/
export interface IskTransferResponse extends TransferResponse {
/**
* Id of the ledger the ISK is debited from.
*/
'fromLedgerId': string;
/**
* Id of the ledger the ISK is credited to.
*/
'toLedgerId': string;
/**
* Amount of ISK transferred.
*/
'amount': number;
}
/**
* Quantity of a single item type held in a ledger.
*/
export interface ItemBalanceResponse {
/**
* EVE market type (item) id.
*/
'typeId': number;
/**
* Number of units held.
*/
'quantity': number;
}
/**
* A transfer of an item stack from one ledger to another.
*/
export interface ItemTransferResponse extends TransferResponse {
/**
* Id of the ledger the items are debited from.
*/
'fromLedgerId': string;
/**
* Id of the ledger the items are credited to.
*/
'toLedgerId': string;
/**
* EVE market type (item) id transferred.
*/
'marketTypeId': number;
/**
* Number of units transferred.
*/
'quantity': number;
}
/**
* @type LedgerResponse
* A ledger, either a standalone main ledger or a combined ledger aggregating others.
*/
export type LedgerResponse = { type: 'COMBINED' } & CombinedLedgerResponse | { type: 'MAIN' } & MainLedgerResponse;
/**
* A main ledger: a standalone ledger with its own balance.
*/
export interface MainLedgerResponse extends LedgerResponse {
/**
* Unique ledger identifier.
*/
'ledgerId': string;
/**
* Ledger name.
*/
'name': string;
/**
* Current ISK balance of the ledger.
*/
'balance': number;
}
/**
* A single day of market history for a market type.
*/
export interface MarketHistoryResponse {
/**
* EVE market type (item) id.
*/
'marketTypeId': number;
/**
* Date the history entry covers.
*/
'date': string;
/**
* Average price for the day, in ISK.
*/
'average': number;
/**
* Highest price for the day, in ISK.
*/
'highest': number;
/**
* Lowest price for the day, in ISK.
*/
'lowest': number;
/**
* Number of orders for the day.
*/
'orderCount': number;
/**
* Traded volume for the day.
*/
'volume': number;
}
/**
* Current best buy and sell prices for a market type.
*/
export interface MarketPriceResponse {
/**
* EVE market type (item) id.
*/
'marketTypeId': number;
/**
* Best buy price, in ISK.
*/
'buy': number;
/**
* Best sell price, in ISK.
*/
'sell': number;
/**
* Number of market orders considered.
*/
'orderCount': number;
}
/**
* Result of a market scan combining current prices, history quartiles and a computed profitability score for a market type.
*/
export interface MarketScanResponse {
/**
* EVE market type (item) id.
*/
'marketTypeId': number;
/**
* Current best buy price, in ISK.
*/
'buy': number;
/**
* Current best sell price, in ISK.
*/
'sell': number;
/**
* First quartile (25th percentile) historical price, in ISK.
*/
'q1': number;
/**
* Median (50th percentile) historical price, in ISK.
*/
'median': number;
/**
* Third quartile (75th percentile) historical price, in ISK.
*/
'q3': number;
/**
* Total traded volume over the scanned period.
*/
'totalVolume': number;
/**
* Overall price trend over the scanned period.
*/
'trend': MarketScanResponseTrendEnum;
/**
* Estimated profit per unit after fees and taxes, in ISK.
*/
'profit': number;
/**
* Computed profitability score used to rank scan results.
*/
'score': number;
}
@@ -151,79 +395,273 @@ export const MarketScanResponseTrendEnum = {
export type MarketScanResponseTrendEnum = typeof MarketScanResponseTrendEnum[keyof typeof MarketScanResponseTrendEnum];
/**
* An EVE Online market type (item) and its static attributes.
*/
export interface MarketTypeResponse {
/**
* EVE market type (item) id.
*/
'id': number;
/**
* Item name.
*/
'name': string;
/**
* Group id the item belongs to.
*/
'groupId': number;
/**
* Market group id the item is listed under.
*/
'marketGroupId': number;
/**
* Item description.
*/
'description': string;
/**
* Whether the item is published and visible in game.
*/
'published': boolean;
'basePrice': number;
/**
* Base price of the item, in ISK, if defined.
*/
'basePrice': number | null;
/**
* Packaged volume of a single unit, in m³.
*/
'volume': number;
/**
* Number of units produced or reprocessed per portion.
*/
'portionSize': number;
'iconId': number;
/**
* Icon id for the item, if defined.
*/
'iconId': number | null;
}
/**
* A market type stack valued at current buy and sell prices.
*/
export interface MarketTypeStackAppraisalResponse {
/**
* EVE market type (item) id.
*/
'marketTypeId': number;
/**
* Number of units in the stack.
*/
'quantity': number;
/**
* Total buy value of the stack, in ISK.
*/
'buy': number;
/**
* Total sell value of the stack, in ISK.
*/
'sell': number;
/**
* Number of market orders considered for the valuation.
*/
'orderCount': number;
}
/**
* A quantity of a single market type to reprocess.
*/
export interface MarketTypeStackRequest {
/**
* EVE market type (item) id to reprocess.
*/
'marketTypeId': number;
/**
* Number of units to reprocess.
*/
'quantity': number;
}
/**
* A quantity of a single market type.
*/
export interface MarketTypeStackResponse {
/**
* EVE market type (item) id.
*/
'marketTypeId': number;
/**
* Number of units in the stack.
*/
'quantity': number;
}
/**
* The authenticated user and the characters they own.
*/
export interface MeResponse {
/**
* Unique user identifier.
*/
'userId': string;
/**
* Characters owned by the user.
*/
'characters': Array<CharacterResponse>;
}
/**
* A freshly minted access token.
*/
export interface RefreshResponse {
/**
* Short-lived bearer access token (JWT) for the Authorization header.
*/
'accessToken': string;
}
/**
* Request to reprocess a set of item stacks on behalf of a character.
*/
export interface ReprocessItemsRequest {
/**
* EVE character id whose reprocessing skills and facility standings are applied.
*/
'characterId': number;
/**
* Item stacks to reprocess.
*/
'items': Array<MarketTypeStackRequest>;
}
/**
* Result of reprocessing an item stack: the input stack and the resulting material outputs, each valued at market prices.
*/
export interface ReprocessingResultResponse {
/**
* The input stack that was reprocessed.
*/
'input': MarketTypeStackAppraisalResponse;
/**
* Material stacks yielded by reprocessing the input.
*/
'output': Array<MarketTypeStackAppraisalResponse>;
}
/**
* A rule book: a named script that classifies transactions, together with the ledger references it expects.
*/
export interface RuleBookResponse {
/**
* Unique rule book identifier.
*/
'ruleBookId': string;
/**
* Rule book name.
*/
'name': string;
/**
* Whether this rule book is used to derive acquisitions.
*/
'usedForAcquisitions': boolean;
/**
* Symbolic ledger references the script writes to; each must be bound to a ledger per character.
*/
'ledgerRefs': Array<string>;
/**
* The classification script source.
*/
'script': string;
}
/**
* Lightweight reference to a rule book: its id and name only.
*/
export interface RuleBookSummaryResponse {
/**
* Unique rule book identifier.
*/
'ruleBookId': string;
/**
* Rule book name.
*/
'name': string;
}
/**
* Request to assign a rule book to a character, binding each of its ledger references to a concrete ledger.
*/
export interface SetCharacterRuleBookRequest {
/**
* Id of the rule book to assign.
*/
'ruleBookId': string;
/**
* Bindings from each ledger reference name to the ledger id it resolves to for this character.
*/
'bindings': { [key: string]: string; };
}
/**
* A transaction: a dated, described group of transfers between ledgers.
*/
export interface TransactionResponse {
/**
* Unique transaction identifier.
*/
'transactionId': string;
'characterId': number;
/**
* EVE character id the transaction is attributed to, if any.
*/
'characterId': number | null;
/**
* When the transaction occurred.
*/
'datetime': string;
/**
* Human-readable description of the transaction.
*/
'description': string;
/**
* The transfers that make up this transaction.
*/
'transfers': Array<TransferResponse>;
}
/**
* @type TransferResponse
* A transfer between two ledgers, either of ISK or of an item stack.
*/
export type TransferResponse = { type: 'ISK' } & IskTransferResponse | { type: 'ITEM' } & ItemTransferResponse;
/**
* Request to update an existing combined ledger; replaces its name and member set.
*/
export interface UpdateCombinedLedgerRequest {
/**
* New name for the combined ledger.
*/
'name': string;
/**
* Ids of the ledgers to aggregate.
*/
'memberLedgerIds': Array<string>;
}
/**
* Request to update an existing main ledger.
*/
export interface UpdateMainLedgerRequest {
/**
* New name for the ledger.
*/
'name': string;
}
/**
* Request to update an existing rule book; replaces its mutable fields.
*/
export interface UpdateRuleBookRequest {
/**
* Rule book name.
*/
'name': string;
/**
* Whether this rule book is used to derive acquisitions.
*/
'usedForAcquisitions': boolean;
/**
* Symbolic ledger references the script writes to; each must be bound to a ledger per character.
*/
'ledgerRefs': Array<string>;
/**
* The classification script source.
*/
'script': string;
}
@@ -557,6 +995,281 @@ export class ActivityApi extends BaseAPI {
/**
* AuthApi - axios parameter creator
*/
export const AuthApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @summary Seed the current user in the session so the next SSO links the new character to them
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
addCharacter: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/characters/add`;
// 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;
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Revoke the refresh session and clear the refresh cookie
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
logout: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/logout`;
// 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;
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Return the authenticated user and the characters they own
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
me: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/me`;
// 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 Rotate the refresh session and mint a fresh access token
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
refresh: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/refresh`;
// 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;
localVarHeaderParameter['Accept'] = '*/*';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* AuthApi - functional programming interface
*/
export const AuthApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = AuthApiAxiosParamCreator(configuration)
return {
/**
*
* @summary Seed the current user in the session so the next SSO links the new character to them
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async addCharacter(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.addCharacter(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['AuthApi.addCharacter']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Revoke the refresh session and clear the refresh cookie
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async logout(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.logout(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['AuthApi.logout']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Return the authenticated user and the characters they own
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async me(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MeResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.me(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['AuthApi.me']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Rotate the refresh session and mint a fresh access token
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async refresh(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RefreshResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.refresh(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['AuthApi.refresh']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
}
};
/**
* AuthApi - factory interface
*/
export const AuthApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = AuthApiFp(configuration)
return {
/**
*
* @summary Seed the current user in the session so the next SSO links the new character to them
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
addCharacter(options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.addCharacter(options).then((request) => request(axios, basePath));
},
/**
*
* @summary Revoke the refresh session and clear the refresh cookie
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
logout(options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.logout(options).then((request) => request(axios, basePath));
},
/**
*
* @summary Return the authenticated user and the characters they own
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
me(options?: RawAxiosRequestConfig): AxiosPromise<MeResponse> {
return localVarFp.me(options).then((request) => request(axios, basePath));
},
/**
*
* @summary Rotate the refresh session and mint a fresh access token
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
refresh(options?: RawAxiosRequestConfig): AxiosPromise<RefreshResponse> {
return localVarFp.refresh(options).then((request) => request(axios, basePath));
},
};
};
/**
* AuthApi - object-oriented interface
*/
export class AuthApi extends BaseAPI {
/**
*
* @summary Seed the current user in the session so the next SSO links the new character to them
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public addCharacter(options?: RawAxiosRequestConfig) {
return AuthApiFp(this.configuration).addCharacter(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Revoke the refresh session and clear the refresh cookie
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public logout(options?: RawAxiosRequestConfig) {
return AuthApiFp(this.configuration).logout(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Return the authenticated user and the characters they own
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public me(options?: RawAxiosRequestConfig) {
return AuthApiFp(this.configuration).me(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Rotate the refresh session and mint a fresh access token
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public refresh(options?: RawAxiosRequestConfig) {
return AuthApiFp(this.configuration).refresh(options).then((request) => request(this.axios, this.basePath));
}
}
/**
* CharacterApi - axios parameter creator
*/