balance endpoint
This commit is contained in:
@@ -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<ItemBalanceResponse>;
|
||||
}
|
||||
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<RequestArgs> => {
|
||||
// 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<BalanceResponse>> {
|
||||
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<Array<FindAllLedgers200ResponseInner>> {
|
||||
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<BalanceResponse> {
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import {RouterLink, RouterView} from 'vue-router';
|
||||
import {useLedgerParam} from "@/ledger";
|
||||
import {isMain, useLedgerParam} from "@/ledger";
|
||||
import {routeNames} from "@/routes.ts";
|
||||
|
||||
const {ledgerId, ledger} = useLedgerParam();
|
||||
@@ -8,12 +8,12 @@ const {ledgerId, ledger} = useLedgerParam();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mt-4">
|
||||
<div v-if="ledger" class="mt-4">
|
||||
<div class="flex border-b-2 border-emerald-500">
|
||||
<RouterLink :to="{name: routeNames.viewLedgerBalance}" class="tab">
|
||||
<span>Balance</span>
|
||||
</RouterLink>
|
||||
<RouterLink :to="{name: routeNames.listLedgerTransactions}" class="tab">
|
||||
<RouterLink v-if="isMain(ledger)" :to="{name: routeNames.listLedgerTransactions}" class="tab">
|
||||
<span>Transactions</span>
|
||||
</RouterLink>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user