diff --git a/docs/mammon-api.yml b/docs/mammon-api.yml index bb34f7c..9297720 100644 --- a/docs/mammon-api.yml +++ b/docs/mammon-api.yml @@ -350,6 +350,29 @@ paths: type: array items: $ref: "#/components/schemas/TransactionResponse" + /ledgers/{ledgerId}/balance: + get: + tags: + - ledger + operationId: findBalanceByLedgerId + parameters: + - name: ledgerId + in: path + required: true + schema: + type: string + format: uuid + responses: + "404": + description: Not Found + "400": + description: Bad Request + "200": + description: OK + content: + '*/*': + schema: + $ref: "#/components/schemas/BalanceResponse" /characters: get: tags: @@ -660,6 +683,30 @@ components: enum: - ISK - ITEM + BalanceResponse: + type: object + properties: + iskBalance: + type: number + itemBalances: + type: array + items: + $ref: "#/components/schemas/ItemBalanceResponse" + required: + - iskBalance + - itemBalances + ItemBalanceResponse: + type: object + properties: + typeId: + type: integer + format: int64 + quantity: + type: integer + format: int64 + required: + - quantity + - typeId CharacterResponse: type: object properties: diff --git a/src/generated/mammon/api.ts b/src/generated/mammon/api.ts index 190e77e..d73e605 100644 --- a/src/generated/mammon/api.ts +++ b/src/generated/mammon/api.ts @@ -23,6 +23,10 @@ import type { RequestArgs } from './base'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base'; +export interface BalanceResponse { + 'iskBalance': number; + 'itemBalances': Array; +} export interface CharacterResponse { 'characterId': number; 'name': string; @@ -76,6 +80,10 @@ export const IskTransferResponseTypeEnum = { export type IskTransferResponseTypeEnum = typeof IskTransferResponseTypeEnum[keyof typeof IskTransferResponseTypeEnum]; +export interface ItemBalanceResponse { + 'typeId': number; + 'quantity': number; +} export interface ItemTransferResponse extends TransferResponse { 'fromLedgerId': string; 'toLedgerId': string; @@ -635,6 +643,39 @@ export const LedgerApiAxiosParamCreator = function (configuration?: Configuratio options: localVarRequestOptions, }; }, + /** + * + * @param {string} ledgerId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findBalanceByLedgerId: async (ledgerId: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'ledgerId' is not null or undefined + assertParamExists('findBalanceByLedgerId', 'ledgerId', ledgerId) + const localVarPath = `/ledgers/{ledgerId}/balance` + .replace('{ledgerId}', encodeURIComponent(String(ledgerId))); + // 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, + }; + }, /** * * @param {string} ledgerId @@ -788,6 +829,18 @@ export const LedgerApiFp = function(configuration?: Configuration) { const localVarOperationServerBasePath = operationServerMap['LedgerApi.findAllLedgers']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + /** + * + * @param {string} ledgerId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async findBalanceByLedgerId(ledgerId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.findBalanceByLedgerId(ledgerId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LedgerApi.findBalanceByLedgerId']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** * * @param {string} ledgerId @@ -861,6 +914,15 @@ export const LedgerApiFactory = function (configuration?: Configuration, basePat findAllLedgers(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.findAllLedgers(options).then((request) => request(axios, basePath)); }, + /** + * + * @param {string} ledgerId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findBalanceByLedgerId(ledgerId: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.findBalanceByLedgerId(ledgerId, options).then((request) => request(axios, basePath)); + }, /** * * @param {string} ledgerId @@ -926,6 +988,16 @@ export class LedgerApi extends BaseAPI { return LedgerApiFp(this.configuration).findAllLedgers(options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @param {string} ledgerId + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + public findBalanceByLedgerId(ledgerId: string, options?: RawAxiosRequestConfig) { + return LedgerApiFp(this.configuration).findBalanceByLedgerId(ledgerId, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @param {string} ledgerId diff --git a/src/pages/ledger/ViewLedger.vue b/src/pages/ledger/ViewLedger.vue index 83bb39f..2f72a38 100644 --- a/src/pages/ledger/ViewLedger.vue +++ b/src/pages/ledger/ViewLedger.vue @@ -1,6 +1,6 @@