feat(#14): Wire manual buy/sell to the mammon acquire/consume endpoints
This commit is contained in:
+201
-1
@@ -61,7 +61,33 @@ export interface AcquisitionResponse {
|
||||
'unitCost': number;
|
||||
}
|
||||
/**
|
||||
* Where an activity or transaction came from: a character, a corporation wallet, or nothing (a manual entry).
|
||||
* Where a manual activity is attributed: a character, a ledger, or nothing. CORPORATION is not accepted.
|
||||
*/
|
||||
export interface ActivitySourceRequest {
|
||||
/**
|
||||
* The kind of source.
|
||||
*/
|
||||
'type': ActivitySourceRequestTypeEnum;
|
||||
/**
|
||||
* EVE character id, when the source is a character.
|
||||
*/
|
||||
'characterId': number | null;
|
||||
/**
|
||||
* Ledger id, when the source is a ledger.
|
||||
*/
|
||||
'ledgerId': string | null;
|
||||
}
|
||||
|
||||
export const ActivitySourceRequestTypeEnum = {
|
||||
Character: 'CHARACTER',
|
||||
Ledger: 'LEDGER',
|
||||
None: 'NONE',
|
||||
} as const;
|
||||
|
||||
export type ActivitySourceRequestTypeEnum = typeof ActivitySourceRequestTypeEnum[keyof typeof ActivitySourceRequestTypeEnum];
|
||||
|
||||
/**
|
||||
* Where an activity or transaction came from: a character, a corporation wallet, a ledger, or nothing (a manual entry).
|
||||
*/
|
||||
export interface ActivitySourceResponse {
|
||||
/**
|
||||
@@ -80,11 +106,16 @@ export interface ActivitySourceResponse {
|
||||
* Corporation wallet division (1-7), when the source is a corporation and it is known.
|
||||
*/
|
||||
'division': number | null;
|
||||
/**
|
||||
* Ledger id, when the source is a ledger.
|
||||
*/
|
||||
'ledgerId': string | null;
|
||||
}
|
||||
|
||||
export const ActivitySourceResponseTypeEnum = {
|
||||
Character: 'CHARACTER',
|
||||
Corporation: 'CORPORATION',
|
||||
Ledger: 'LEDGER',
|
||||
None: 'NONE',
|
||||
} as const;
|
||||
|
||||
@@ -271,6 +302,39 @@ export interface MainLedgerResponse extends LedgerResponse {
|
||||
*/
|
||||
'balance': number;
|
||||
}
|
||||
/**
|
||||
* Request to manually record an acquisition (buy) or consumption (sell) of an item.
|
||||
*/
|
||||
export interface ManualActivityRequest {
|
||||
/**
|
||||
* Where the activity is attributed.
|
||||
*/
|
||||
'source': ActivitySourceRequest;
|
||||
/**
|
||||
* EVE type id of the traded item.
|
||||
*/
|
||||
'marketTypeId': number;
|
||||
/**
|
||||
* Number of units.
|
||||
*/
|
||||
'quantity': number;
|
||||
/**
|
||||
* Price per unit.
|
||||
*/
|
||||
'unitPrice': number;
|
||||
/**
|
||||
* When the activity happened. Defaults to now when omitted.
|
||||
*/
|
||||
'datetime': string | null;
|
||||
/**
|
||||
* Taxes paid. Defaults to 0 when omitted.
|
||||
*/
|
||||
'taxes': number | null;
|
||||
/**
|
||||
* Free-form description.
|
||||
*/
|
||||
'description': string | null;
|
||||
}
|
||||
/**
|
||||
* A single day of market history for a market type.
|
||||
*/
|
||||
@@ -803,6 +867,74 @@ export class AcquisitionApi extends BaseAPI {
|
||||
*/
|
||||
export const ActivityApiAxiosParamCreator = function (configuration?: Configuration) {
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary Manually record an acquisition (buy) of an item. Call POST /activities/process to fold it into acquisitions.
|
||||
* @param {ManualActivityRequest} manualActivityRequest
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
acquire: async (manualActivityRequest: ManualActivityRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'manualActivityRequest' is not null or undefined
|
||||
assertParamExists('acquire', 'manualActivityRequest', manualActivityRequest)
|
||||
const localVarPath = `/activity/acquire`;
|
||||
// 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['Content-Type'] = 'application/json';
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
localVarRequestOptions.data = serializeDataIfNeeded(manualActivityRequest, localVarRequestOptions, configuration)
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Manually record a consumption (sell) of an item. Call POST /activities/process to fold it into acquisitions.
|
||||
* @param {ManualActivityRequest} manualActivityRequest
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
consume: async (manualActivityRequest: ManualActivityRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'manualActivityRequest' is not null or undefined
|
||||
assertParamExists('consume', 'manualActivityRequest', manualActivityRequest)
|
||||
const localVarPath = `/activity/consume`;
|
||||
// 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['Content-Type'] = 'application/json';
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
localVarRequestOptions.data = serializeDataIfNeeded(manualActivityRequest, localVarRequestOptions, configuration)
|
||||
|
||||
return {
|
||||
url: toPathString(localVarUrlObj),
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Fetch new activities for the authenticated user\'s characters from the EVE API
|
||||
@@ -903,6 +1035,32 @@ export const ActivityApiAxiosParamCreator = function (configuration?: Configurat
|
||||
export const ActivityApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosParamCreator = ActivityApiAxiosParamCreator(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary Manually record an acquisition (buy) of an item. Call POST /activities/process to fold it into acquisitions.
|
||||
* @param {ManualActivityRequest} manualActivityRequest
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async acquire(manualActivityRequest: ManualActivityRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.acquire(manualActivityRequest, options);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath = operationServerMap['ActivityApi.acquire']?.[localVarOperationServerIndex]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Manually record a consumption (sell) of an item. Call POST /activities/process to fold it into acquisitions.
|
||||
* @param {ManualActivityRequest} manualActivityRequest
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async consume(manualActivityRequest: ManualActivityRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.consume(manualActivityRequest, options);
|
||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||
const localVarOperationServerBasePath = operationServerMap['ActivityApi.consume']?.[localVarOperationServerIndex]?.url;
|
||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Fetch new activities for the authenticated user\'s characters from the EVE API
|
||||
@@ -949,6 +1107,26 @@ export const ActivityApiFp = function(configuration?: Configuration) {
|
||||
export const ActivityApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = ActivityApiFp(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @summary Manually record an acquisition (buy) of an item. Call POST /activities/process to fold it into acquisitions.
|
||||
* @param {ManualActivityRequest} manualActivityRequest
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
acquire(manualActivityRequest: ManualActivityRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
||||
return localVarFp.acquire(manualActivityRequest, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Manually record a consumption (sell) of an item. Call POST /activities/process to fold it into acquisitions.
|
||||
* @param {ManualActivityRequest} manualActivityRequest
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
consume(manualActivityRequest: ManualActivityRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
||||
return localVarFp.consume(manualActivityRequest, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary Fetch new activities for the authenticated user\'s characters from the EVE API
|
||||
@@ -984,6 +1162,28 @@ export const ActivityApiFactory = function (configuration?: Configuration, baseP
|
||||
* ActivityApi - object-oriented interface
|
||||
*/
|
||||
export class ActivityApi extends BaseAPI {
|
||||
/**
|
||||
*
|
||||
* @summary Manually record an acquisition (buy) of an item. Call POST /activities/process to fold it into acquisitions.
|
||||
* @param {ManualActivityRequest} manualActivityRequest
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
public acquire(manualActivityRequest: ManualActivityRequest, options?: RawAxiosRequestConfig) {
|
||||
return ActivityApiFp(this.configuration).acquire(manualActivityRequest, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Manually record a consumption (sell) of an item. Call POST /activities/process to fold it into acquisitions.
|
||||
* @param {ManualActivityRequest} manualActivityRequest
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
public consume(manualActivityRequest: ManualActivityRequest, options?: RawAxiosRequestConfig) {
|
||||
return ActivityApiFp(this.configuration).consume(manualActivityRequest, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Fetch new activities for the authenticated user\'s characters from the EVE API
|
||||
|
||||
Reference in New Issue
Block a user