diff --git a/docs/mammon-api.yml b/docs/mammon-api.yml index f8171cb..46f123b 100644 --- a/docs/mammon-api.yml +++ b/docs/mammon-api.yml @@ -959,7 +959,7 @@ paths: /ledgers/{ledgerId}/profit: get: tags: - - transaction + - profit summary: Get the daily profit series for a single ledger operationId: profitPerDayInLedger parameters: @@ -987,8 +987,8 @@ paths: /ledgers/{ledgerId}/margin: get: tags: - - transaction - summary: Get the daily FIFO-realized profit series for a single ledger + - profit + summary: Get the daily FIFO-realized margin series for a single ledger operationId: marginPerDayInLedger parameters: - name: ledgerId @@ -1000,10 +1000,10 @@ paths: format: uuid responses: "200": - description: "Daily FIFO-realized profit for the ledger, ascending by date,\ - \ only for days with a sale. iskIn is the sum of that day's profitable\ - \ trades, iskOut is the sum of that day's losing trades (as a positive\ - \ deficit); profit is iskIn minus iskOut." + description: "Daily FIFO-realized margin for the ledger, ascending by date,\ + \ only for days with a consumption. iskIn is the sum of that day's profitable\ + \ consumptions, iskOut is the sum of that day's losing consumptions (as\ + \ a positive deficit); profit is iskIn minus iskOut." content: '*/*': schema: @@ -2310,10 +2310,6 @@ components: format: uuid description: Ledger the acquisition is held in. example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - source: - $ref: "#/components/schemas/ActivitySourceResponse" - description: "Where the acquisition came from: a character, a corporation,\ - \ or nothing." marketTypeId: type: integer format: int64 @@ -2345,5 +2341,4 @@ components: - marketTypeId - quantity - remaining - - source - unitCost diff --git a/src/generated/mammon/api.ts b/src/generated/mammon/api.ts index 49ffa98..a79de42 100644 --- a/src/generated/mammon/api.ts +++ b/src/generated/mammon/api.ts @@ -35,10 +35,6 @@ export interface AcquisitionResponse { * Ledger the acquisition is held in. */ 'ledgerId': string; - /** - * Where the acquisition came from: a character, a corporation, or nothing. - */ - 'source': ActivitySourceResponse; /** * EVE market type (item) id that was acquired. */ @@ -3636,6 +3632,175 @@ export class MarketHistoryAdminControllerApi extends BaseAPI { +/** + * ProfitApi - axios parameter creator + */ +export const ProfitApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Get the daily FIFO-realized margin series for a single ledger + * @param {string} ledgerId Id of the ledger + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + marginPerDayInLedger: async (ledgerId: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'ledgerId' is not null or undefined + assertParamExists('marginPerDayInLedger', 'ledgerId', ledgerId) + const localVarPath = `/ledgers/{ledgerId}/margin` + .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, + }; + }, + /** + * + * @summary Get the daily profit series for a single ledger + * @param {string} ledgerId Id of the ledger + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + profitPerDayInLedger: async (ledgerId: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'ledgerId' is not null or undefined + assertParamExists('profitPerDayInLedger', 'ledgerId', ledgerId) + const localVarPath = `/ledgers/{ledgerId}/profit` + .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, + }; + }, + } +}; + +/** + * ProfitApi - functional programming interface + */ +export const ProfitApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ProfitApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Get the daily FIFO-realized margin series for a single ledger + * @param {string} ledgerId Id of the ledger + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async marginPerDayInLedger(ledgerId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.marginPerDayInLedger(ledgerId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ProfitApi.marginPerDayInLedger']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get the daily profit series for a single ledger + * @param {string} ledgerId Id of the ledger + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async profitPerDayInLedger(ledgerId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.profitPerDayInLedger(ledgerId, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ProfitApi.profitPerDayInLedger']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * ProfitApi - factory interface + */ +export const ProfitApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ProfitApiFp(configuration) + return { + /** + * + * @summary Get the daily FIFO-realized margin series for a single ledger + * @param {string} ledgerId Id of the ledger + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + marginPerDayInLedger(ledgerId: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.marginPerDayInLedger(ledgerId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get the daily profit series for a single ledger + * @param {string} ledgerId Id of the ledger + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + profitPerDayInLedger(ledgerId: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.profitPerDayInLedger(ledgerId, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * ProfitApi - object-oriented interface + */ +export class ProfitApi extends BaseAPI { + /** + * + * @summary Get the daily FIFO-realized margin series for a single ledger + * @param {string} ledgerId Id of the ledger + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + public marginPerDayInLedger(ledgerId: string, options?: RawAxiosRequestConfig) { + return ProfitApiFp(this.configuration).marginPerDayInLedger(ledgerId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get the daily profit series for a single ledger + * @param {string} ledgerId Id of the ledger + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + public profitPerDayInLedger(ledgerId: string, options?: RawAxiosRequestConfig) { + return ProfitApiFp(this.configuration).profitPerDayInLedger(ledgerId, options).then((request) => request(this.axios, this.basePath)); + } +} + + + /** * ReprocessingApi - axios parameter creator */ @@ -4192,74 +4357,6 @@ export const TransactionApiAxiosParamCreator = function (configuration?: Configu let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Get the daily FIFO-realized profit series for a single ledger - * @param {string} ledgerId Id of the ledger - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - marginPerDayInLedger: async (ledgerId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'ledgerId' is not null or undefined - assertParamExists('marginPerDayInLedger', 'ledgerId', ledgerId) - const localVarPath = `/ledgers/{ledgerId}/margin` - .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, - }; - }, - /** - * - * @summary Get the daily profit series for a single ledger - * @param {string} ledgerId Id of the ledger - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - profitPerDayInLedger: async (ledgerId: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'ledgerId' is not null or undefined - assertParamExists('profitPerDayInLedger', 'ledgerId', ledgerId) - const localVarPath = `/ledgers/{ledgerId}/profit` - .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, @@ -4287,32 +4384,6 @@ export const TransactionApiFp = function(configuration?: Configuration) { const localVarOperationServerBasePath = operationServerMap['TransactionApi.finAllTransactionsInLedger']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, - /** - * - * @summary Get the daily FIFO-realized profit series for a single ledger - * @param {string} ledgerId Id of the ledger - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async marginPerDayInLedger(ledgerId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.marginPerDayInLedger(ledgerId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['TransactionApi.marginPerDayInLedger']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get the daily profit series for a single ledger - * @param {string} ledgerId Id of the ledger - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async profitPerDayInLedger(ledgerId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.profitPerDayInLedger(ledgerId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['TransactionApi.profitPerDayInLedger']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, } }; @@ -4332,26 +4403,6 @@ export const TransactionApiFactory = function (configuration?: Configuration, ba finAllTransactionsInLedger(ledgerId: string, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.finAllTransactionsInLedger(ledgerId, options).then((request) => request(axios, basePath)); }, - /** - * - * @summary Get the daily FIFO-realized profit series for a single ledger - * @param {string} ledgerId Id of the ledger - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - marginPerDayInLedger(ledgerId: string, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.marginPerDayInLedger(ledgerId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get the daily profit series for a single ledger - * @param {string} ledgerId Id of the ledger - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - profitPerDayInLedger(ledgerId: string, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.profitPerDayInLedger(ledgerId, options).then((request) => request(axios, basePath)); - }, }; }; @@ -4369,28 +4420,6 @@ export class TransactionApi extends BaseAPI { public finAllTransactionsInLedger(ledgerId: string, options?: RawAxiosRequestConfig) { return TransactionApiFp(this.configuration).finAllTransactionsInLedger(ledgerId, options).then((request) => request(this.axios, this.basePath)); } - - /** - * - * @summary Get the daily FIFO-realized profit series for a single ledger - * @param {string} ledgerId Id of the ledger - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public marginPerDayInLedger(ledgerId: string, options?: RawAxiosRequestConfig) { - return TransactionApiFp(this.configuration).marginPerDayInLedger(ledgerId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get the daily profit series for a single ledger - * @param {string} ledgerId Id of the ledger - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - public profitPerDayInLedger(ledgerId: string, options?: RawAxiosRequestConfig) { - return TransactionApiFp(this.configuration).profitPerDayInLedger(ledgerId, options).then((request) => request(this.axios, this.basePath)); - } }