Compare commits

...

7 Commits

Author SHA1 Message Date
Sirttas 457d2a5161 cleanup rules 2026-05-31 18:57:10 +02:00
Sirttas 1358aaa705 cleanup routes names 2026-05-31 18:33:35 +02:00
Sirttas d7bae268da character rule book front 2026-05-31 18:20:46 +02:00
Sirttas 9310397320 character rule book front 2026-05-31 18:19:45 +02:00
Sirttas ba81d7b6a8 rule book front 2026-05-31 17:00:49 +02:00
Sirttas 676ff961ed rename rule set to rule 2026-05-28 13:15:15 +02:00
Sirttas b40b58f866 rename rule to rule clause 2026-05-28 11:37:09 +02:00
24 changed files with 1233 additions and 461 deletions
+276 -121
View File
@@ -6,10 +6,61 @@ servers:
- url: http://localhost:8080 - url: http://localhost:8080
description: Generated server url description: Generated server url
paths: paths:
/rule-books/{ruleBookId}:
get:
tags:
- rule-book
operationId: findRuleBookById
parameters:
- name: ruleBookId
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/RuleBookResponse"
put:
tags:
- rule-book
operationId: updateRuleBook
parameters:
- name: ruleBookId
in: path
required: true
schema:
type: string
format: uuid
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateRuleBookRequest"
required: true
responses:
"404":
description: Not Found
"400":
description: Bad Request
"200":
description: OK
content:
'*/*':
schema:
$ref: "#/components/schemas/RuleBookResponse"
/ledgers/main/{ledgerId}: /ledgers/main/{ledgerId}:
put: put:
tags: tags:
- ledger-controller - ledger
operationId: updateMainLedger operationId: updateMainLedger
parameters: parameters:
- name: ledgerId - name: ledgerId
@@ -38,7 +89,7 @@ paths:
/ledgers/combined/{ledgerId}: /ledgers/combined/{ledgerId}:
put: put:
tags: tags:
- ledger-controller - ledger
operationId: updateCombinedLedger operationId: updateCombinedLedger
parameters: parameters:
- name: ledgerId - name: ledgerId
@@ -64,67 +115,11 @@ paths:
'*/*': '*/*':
schema: schema:
$ref: "#/components/schemas/CombinedLedgerResponse" $ref: "#/components/schemas/CombinedLedgerResponse"
/process-activities:
post:
tags:
- processing-controller
operationId: processNewActivities
responses:
"404":
description: Not Found
"400":
description: Bad Request
"200":
description: OK
/ledgers/main:
post:
tags:
- ledger-controller
operationId: createMainLedger
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateMainLedgerRequest"
required: true
responses:
"404":
description: Not Found
"400":
description: Bad Request
"200":
description: OK
content:
'*/*':
schema:
$ref: "#/components/schemas/MainLedgerResponse"
/ledgers/combined:
post:
tags:
- ledger-controller
operationId: createCombinedLedger
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateCombinedLedgerRequest"
required: true
responses:
"404":
description: Not Found
"400":
description: Bad Request
"200":
description: OK
content:
'*/*':
schema:
$ref: "#/components/schemas/CombinedLedgerResponse"
/characters/{characterId}/rule-book: /characters/{characterId}/rule-book:
get: get:
tags: tags:
- rule-book-controller - character-rule-book
operationId: findByCharacterId operationId: findCharacterRuleBookByCharacterId
parameters: parameters:
- name: characterId - name: characterId
in: path in: path
@@ -142,11 +137,11 @@ paths:
content: content:
'*/*': '*/*':
schema: schema:
$ref: "#/components/schemas/RuleBookResponse" $ref: "#/components/schemas/CharacterRuleBookResponse"
post: put:
tags: tags:
- rule-book-controller - character-rule-book
operationId: setCharacterRuleBook operationId: setCharacterRuleBookForCharacter
parameters: parameters:
- name: characterId - name: characterId
in: path in: path
@@ -160,6 +155,45 @@ paths:
schema: schema:
$ref: "#/components/schemas/SetCharacterRuleBookRequest" $ref: "#/components/schemas/SetCharacterRuleBookRequest"
required: true required: true
responses:
"404":
description: Not Found
"400":
description: Bad Request
"200":
description: OK
content:
'*/*':
schema:
$ref: "#/components/schemas/CharacterRuleBookResponse"
/rule-books:
get:
tags:
- rule-book
operationId: findAllRuleBooks
responses:
"404":
description: Not Found
"400":
description: Bad Request
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/RuleBookResponse"
post:
tags:
- rule-book
operationId: createRuleBook
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateRuleBookRequest"
required: true
responses: responses:
"404": "404":
description: Not Found description: Not Found
@@ -171,10 +205,66 @@ paths:
'*/*': '*/*':
schema: schema:
$ref: "#/components/schemas/RuleBookResponse" $ref: "#/components/schemas/RuleBookResponse"
/process-activities:
post:
tags:
- processing
operationId: processNewActivities
responses:
"404":
description: Not Found
"400":
description: Bad Request
"200":
description: OK
/ledgers/main:
post:
tags:
- ledger
operationId: createMainLedger
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateMainLedgerRequest"
required: true
responses:
"404":
description: Not Found
"400":
description: Bad Request
"200":
description: OK
content:
'*/*':
schema:
$ref: "#/components/schemas/MainLedgerResponse"
/ledgers/combined:
post:
tags:
- ledger
operationId: createCombinedLedger
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateCombinedLedgerRequest"
required: true
responses:
"404":
description: Not Found
"400":
description: Bad Request
"200":
description: OK
content:
'*/*':
schema:
$ref: "#/components/schemas/CombinedLedgerResponse"
/activity/fetch/{characterId}: /activity/fetch/{characterId}:
post: post:
tags: tags:
- activity-controller - activity
operationId: fetchNewActivitiesForCharacter operationId: fetchNewActivitiesForCharacter
parameters: parameters:
- name: characterId - name: characterId
@@ -193,8 +283,8 @@ paths:
/ledgers: /ledgers:
get: get:
tags: tags:
- ledger-controller - ledger
operationId: findAll operationId: findAllLedgers
responses: responses:
"404": "404":
description: Not Found description: Not Found
@@ -213,8 +303,8 @@ paths:
/ledgers/{ledgerId}: /ledgers/{ledgerId}:
get: get:
tags: tags:
- ledger-controller - ledger
operationId: findById operationId: findLedgerById
parameters: parameters:
- name: ledgerId - name: ledgerId
in: path in: path
@@ -238,8 +328,8 @@ paths:
/characters: /characters:
get: get:
tags: tags:
- character-controller - character
operationId: getCharacters operationId: findAllCharacters
responses: responses:
"404": "404":
description: Not Found description: Not Found
@@ -255,6 +345,72 @@ paths:
$ref: "#/components/schemas/CharacterResponse" $ref: "#/components/schemas/CharacterResponse"
components: components:
schemas: schemas:
RuleClauseResponse:
type: object
properties:
rate:
type: string
enum:
- NONE
- VALUE
- JITA_BUY
- JITA_SELL
- EVE_ESTIMATE
fromLedgerRef:
type: string
toLedgerRef:
type: string
required:
- fromLedgerRef
- rate
- toLedgerRef
RuleResponse:
type: object
properties:
clauses:
type: array
items:
$ref: "#/components/schemas/RuleClauseResponse"
required:
- clauses
UpdateRuleBookRequest:
type: object
properties:
name:
type: string
ledgerRefs:
type: array
items:
type: string
rules:
type: object
additionalProperties:
$ref: "#/components/schemas/RuleResponse"
required:
- ledgerRefs
- name
- rules
RuleBookResponse:
type: object
properties:
ruleBookId:
type: string
format: uuid
name:
type: string
ledgerRefs:
type: array
items:
type: string
rules:
type: object
additionalProperties:
$ref: "#/components/schemas/RuleResponse"
required:
- ledgerRefs
- name
- ruleBookId
- rules
UpdateMainLedgerRequest: UpdateMainLedgerRequest:
type: object type: object
properties: properties:
@@ -321,6 +477,55 @@ components:
- ledgerId - ledgerId
- memberLedgerIds - memberLedgerIds
- name - name
SetCharacterRuleBookRequest:
type: object
properties:
ruleBookId:
type: string
format: uuid
bindings:
type: object
additionalProperties:
type: string
format: uuid
required:
- bindings
- ruleBookId
CharacterRuleBookResponse:
type: object
properties:
characterId:
type: integer
format: int64
ruleBookId:
type: string
format: uuid
bindings:
type: object
additionalProperties:
type: string
format: uuid
required:
- bindings
- characterId
- ruleBookId
CreateRuleBookRequest:
type: object
properties:
name:
type: string
ledgerRefs:
type: array
items:
type: string
rules:
type: object
additionalProperties:
$ref: "#/components/schemas/RuleResponse"
required:
- ledgerRefs
- name
- rules
CreateMainLedgerRequest: CreateMainLedgerRequest:
type: object type: object
properties: properties:
@@ -341,56 +546,6 @@ components:
required: required:
- memberLedgerIds - memberLedgerIds
- name - name
RuleResponse:
type: object
properties:
rate:
type: string
enum:
- NONE
- VALUE
- JITA_BUY
- JITA_SELL
- EVE_ESTIMATE
fromLedgerId:
type: string
format: uuid
toLedgerId:
type: string
format: uuid
required:
- rate
RuleSetResponse:
type: object
properties:
rules:
type: array
items:
$ref: "#/components/schemas/RuleResponse"
required:
- rules
SetCharacterRuleBookRequest:
type: object
properties:
ruleSets:
type: object
additionalProperties:
$ref: "#/components/schemas/RuleSetResponse"
required:
- ruleSets
RuleBookResponse:
type: object
properties:
characterId:
type: integer
format: int64
ruleSets:
type: object
additionalProperties:
$ref: "#/components/schemas/RuleSetResponse"
required:
- characterId
- ruleSets
LedgerResponse: LedgerResponse:
type: object type: object
discriminator: discriminator:
+2 -1
View File
@@ -2,11 +2,12 @@
import { computed } from 'vue'; import { computed } from 'vue';
import { RouterView, useRoute } from 'vue-router'; import { RouterView, useRoute } from 'vue-router';
import { Sidebar } from './sidebar'; import { Sidebar } from './sidebar';
import { routeNames } from '@/routes';
const route = useRoute(); const route = useRoute();
const hideSidebar = computed(() => { const hideSidebar = computed(() => {
return route.name === 'callback' || route.name === 'about'; return route.name === routeNames.callback || route.name === routeNames.about;
}); });
</script> </script>
+3 -3
View File
@@ -1,4 +1,4 @@
import {activityControllerApi, characterControllerApi} from "@/mammon"; import {activityApi, characterApi} from "@/mammon";
import {defineStore} from "pinia"; import {defineStore} from "pinia";
import {ref} from "vue"; import {ref} from "vue";
import {CharacterResponse} from "@/generated/mammon"; import {CharacterResponse} from "@/generated/mammon";
@@ -18,9 +18,9 @@ export const useCharactersStore = defineStore('characters', () => {
return character; return character;
} }
const reloadActivities = (characterId: number): Promise<void> => activityControllerApi.fetchNewActivitiesForCharacter(characterId) as Promise<void>; const reloadActivities = (characterId: number): Promise<void> => activityApi.fetchNewActivitiesForCharacter(characterId) as Promise<void>;
const refresh = () => characterControllerApi.getCharacters().then(response => characters.value = response.data); const refresh = () => characterApi.findAllCharacters().then(response => characters.value = response.data);
refresh(); refresh();
+28 -9
View File
@@ -1,22 +1,37 @@
<script setup lang="ts"> <script setup lang="ts">
import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/vue/24/outline'; import {ChevronDownIcon, ChevronUpIcon} from '@heroicons/vue/24/outline';
import { vOnClickOutside } from '@vueuse/components'; import {vOnClickOutside} from '@vueuse/components';
import { useEventListener } from '@vueuse/core'; import {useEventListener} from '@vueuse/core';
import { ref } from 'vue'; import {ref} from 'vue';
interface Props {
inline?: boolean;
autoClose: boolean;
}
const props = withDefaults(defineProps<Props>(), {
inline: false,
autoClose: true
})
const isOpen = ref(false); const isOpen = ref(false);
const doAutoClose = () => {
if (props.autoClose) {
isOpen.value = false;
}
}
useEventListener('keyup', e => { useEventListener('keyup', e => {
if (e.key === 'Escape') { if (e.key === 'Escape') {
isOpen.value = false; doAutoClose();
} }
}); });
</script> </script>
<template> <template>
<div class="dropdown" :class="{'dropdown-open': isOpen, 'dropdown-close': !isOpen}" v-on-click-outside="() => isOpen = false"> <div class="dropdown" :class="{'dropdown-open': isOpen, 'dropdown-close': !isOpen}" v-on-click-outside="doAutoClose">
<button @click="isOpen = !isOpen"> <button @click="isOpen = !isOpen">
<slot name="button" />
<Transition <Transition
enter-active-class="transition-transform" enter-active-class="transition-transform"
enter-from-class="rotate-180" enter-from-class="rotate-180"
@@ -25,6 +40,7 @@ useEventListener('keyup', e => {
<ChevronDownIcon v-if="!isOpen" class="chevron" /> <ChevronDownIcon v-if="!isOpen" class="chevron" />
<ChevronUpIcon v-else class="chevron" /> <ChevronUpIcon v-else class="chevron" />
</Transition> </Transition>
<slot name="button" />
</button> </button>
<Transition <Transition
@@ -32,7 +48,10 @@ useEventListener('keyup', e => {
enter-from-class="opacity-0" enter-from-class="opacity-0"
leave-from-class="transition-opacity" leave-from-class="transition-opacity"
leave-to-class="opacity-0"> leave-to-class="opacity-0">
<div v-if="isOpen" class="relative"> <div v-if="inline && isOpen">
<slot />
</div>
<div v-else-if="isOpen" class="relative">
<div class="z-10 divide-y rounded-b-md absolute"> <div class="z-10 divide-y rounded-b-md absolute">
<slot /> <slot />
</div> </div>
@@ -45,6 +64,6 @@ useEventListener('keyup', e => {
@reference "tailwindcss"; @reference "tailwindcss";
.chevron { .chevron {
@apply w-4 h-4 ms-1; @apply w-4 h-4 me-1;
} }
</style> </style>
+449 -140
View File
@@ -27,6 +27,11 @@ export interface CharacterResponse {
'characterId': number; 'characterId': number;
'name': string; 'name': string;
} }
export interface CharacterRuleBookResponse {
'characterId': number;
'ruleBookId': string;
'bindings': { [key: string]: string; };
}
export interface CombinedLedgerResponse extends LedgerResponse { export interface CombinedLedgerResponse extends LedgerResponse {
'ledgerId': string; 'ledgerId': string;
'name': string; 'name': string;
@@ -48,10 +53,15 @@ export interface CreateCombinedLedgerRequest {
export interface CreateMainLedgerRequest { export interface CreateMainLedgerRequest {
'name': string; 'name': string;
} }
export interface CreateRuleBookRequest {
'name': string;
'ledgerRefs': Array<string>;
'rules': { [key: string]: RuleResponse; };
}
/** /**
* @type FindAll200ResponseInner * @type FindAllLedgers200ResponseInner
*/ */
export type FindAll200ResponseInner = CombinedLedgerResponse | MainLedgerResponse; export type FindAllLedgers200ResponseInner = CombinedLedgerResponse | MainLedgerResponse;
export interface LedgerResponse { export interface LedgerResponse {
'type'?: LedgerResponseTypeEnum; 'type'?: LedgerResponseTypeEnum;
@@ -78,16 +88,18 @@ export const MainLedgerResponseTypeEnum = {
export type MainLedgerResponseTypeEnum = typeof MainLedgerResponseTypeEnum[keyof typeof MainLedgerResponseTypeEnum]; export type MainLedgerResponseTypeEnum = typeof MainLedgerResponseTypeEnum[keyof typeof MainLedgerResponseTypeEnum];
export interface RuleBookResponse { export interface RuleBookResponse {
'characterId': number; 'ruleBookId': string;
'ruleSets': { [key: string]: RuleSetResponse; }; 'name': string;
'ledgerRefs': Array<string>;
'rules': { [key: string]: RuleResponse; };
} }
export interface RuleResponse { export interface RuleClauseResponse {
'rate': RuleResponseRateEnum; 'rate': RuleClauseResponseRateEnum;
'fromLedgerId'?: string; 'fromLedgerRef': string;
'toLedgerId'?: string; 'toLedgerRef': string;
} }
export const RuleResponseRateEnum = { export const RuleClauseResponseRateEnum = {
None: 'NONE', None: 'NONE',
Value: 'VALUE', Value: 'VALUE',
JitaBuy: 'JITA_BUY', JitaBuy: 'JITA_BUY',
@@ -95,13 +107,14 @@ export const RuleResponseRateEnum = {
EveEstimate: 'EVE_ESTIMATE', EveEstimate: 'EVE_ESTIMATE',
} as const; } as const;
export type RuleResponseRateEnum = typeof RuleResponseRateEnum[keyof typeof RuleResponseRateEnum]; export type RuleClauseResponseRateEnum = typeof RuleClauseResponseRateEnum[keyof typeof RuleClauseResponseRateEnum];
export interface RuleSetResponse { export interface RuleResponse {
'rules': Array<RuleResponse>; 'clauses': Array<RuleClauseResponse>;
} }
export interface SetCharacterRuleBookRequest { export interface SetCharacterRuleBookRequest {
'ruleSets': { [key: string]: RuleSetResponse; }; 'ruleBookId': string;
'bindings': { [key: string]: string; };
} }
export interface UpdateCombinedLedgerRequest { export interface UpdateCombinedLedgerRequest {
'name': string; 'name': string;
@@ -110,11 +123,16 @@ export interface UpdateCombinedLedgerRequest {
export interface UpdateMainLedgerRequest { export interface UpdateMainLedgerRequest {
'name': string; 'name': string;
} }
export interface UpdateRuleBookRequest {
'name': string;
'ledgerRefs': Array<string>;
'rules': { [key: string]: RuleResponse; };
}
/** /**
* ActivityControllerApi - axios parameter creator * ActivityApi - axios parameter creator
*/ */
export const ActivityControllerApiAxiosParamCreator = function (configuration?: Configuration) { export const ActivityApiAxiosParamCreator = function (configuration?: Configuration) {
return { return {
/** /**
* *
@@ -152,10 +170,10 @@ export const ActivityControllerApiAxiosParamCreator = function (configuration?:
}; };
/** /**
* ActivityControllerApi - functional programming interface * ActivityApi - functional programming interface
*/ */
export const ActivityControllerApiFp = function(configuration?: Configuration) { export const ActivityApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = ActivityControllerApiAxiosParamCreator(configuration) const localVarAxiosParamCreator = ActivityApiAxiosParamCreator(configuration)
return { return {
/** /**
* *
@@ -166,17 +184,17 @@ export const ActivityControllerApiFp = function(configuration?: Configuration) {
async fetchNewActivitiesForCharacter(characterId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { async fetchNewActivitiesForCharacter(characterId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.fetchNewActivitiesForCharacter(characterId, options); const localVarAxiosArgs = await localVarAxiosParamCreator.fetchNewActivitiesForCharacter(characterId, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ActivityControllerApi.fetchNewActivitiesForCharacter']?.[localVarOperationServerIndex]?.url; const localVarOperationServerBasePath = operationServerMap['ActivityApi.fetchNewActivitiesForCharacter']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
}, },
} }
}; };
/** /**
* ActivityControllerApi - factory interface * ActivityApi - factory interface
*/ */
export const ActivityControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { export const ActivityApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = ActivityControllerApiFp(configuration) const localVarFp = ActivityApiFp(configuration)
return { return {
/** /**
* *
@@ -191,9 +209,9 @@ export const ActivityControllerApiFactory = function (configuration?: Configurat
}; };
/** /**
* ActivityControllerApi - object-oriented interface * ActivityApi - object-oriented interface
*/ */
export class ActivityControllerApi extends BaseAPI { export class ActivityApi extends BaseAPI {
/** /**
* *
* @param {number} characterId * @param {number} characterId
@@ -201,23 +219,23 @@ export class ActivityControllerApi extends BaseAPI {
* @throws {RequiredError} * @throws {RequiredError}
*/ */
public fetchNewActivitiesForCharacter(characterId: number, options?: RawAxiosRequestConfig) { public fetchNewActivitiesForCharacter(characterId: number, options?: RawAxiosRequestConfig) {
return ActivityControllerApiFp(this.configuration).fetchNewActivitiesForCharacter(characterId, options).then((request) => request(this.axios, this.basePath)); return ActivityApiFp(this.configuration).fetchNewActivitiesForCharacter(characterId, options).then((request) => request(this.axios, this.basePath));
} }
} }
/** /**
* CharacterControllerApi - axios parameter creator * CharacterApi - axios parameter creator
*/ */
export const CharacterControllerApiAxiosParamCreator = function (configuration?: Configuration) { export const CharacterApiAxiosParamCreator = function (configuration?: Configuration) {
return { return {
/** /**
* *
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
getCharacters: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { findAllCharacters: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/characters`; const localVarPath = `/characters`;
// use dummy base URL string because the URL constructor only accepts absolute URLs. // use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -245,62 +263,231 @@ export const CharacterControllerApiAxiosParamCreator = function (configuration?:
}; };
/** /**
* CharacterControllerApi - functional programming interface * CharacterApi - functional programming interface
*/ */
export const CharacterControllerApiFp = function(configuration?: Configuration) { export const CharacterApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = CharacterControllerApiAxiosParamCreator(configuration) const localVarAxiosParamCreator = CharacterApiAxiosParamCreator(configuration)
return { return {
/** /**
* *
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async getCharacters(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<CharacterResponse>>> { async findAllCharacters(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<CharacterResponse>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getCharacters(options); const localVarAxiosArgs = await localVarAxiosParamCreator.findAllCharacters(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['CharacterControllerApi.getCharacters']?.[localVarOperationServerIndex]?.url; const localVarOperationServerBasePath = operationServerMap['CharacterApi.findAllCharacters']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
}, },
} }
}; };
/** /**
* CharacterControllerApi - factory interface * CharacterApi - factory interface
*/ */
export const CharacterControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { export const CharacterApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = CharacterControllerApiFp(configuration) const localVarFp = CharacterApiFp(configuration)
return { return {
/** /**
* *
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
getCharacters(options?: RawAxiosRequestConfig): AxiosPromise<Array<CharacterResponse>> { findAllCharacters(options?: RawAxiosRequestConfig): AxiosPromise<Array<CharacterResponse>> {
return localVarFp.getCharacters(options).then((request) => request(axios, basePath)); return localVarFp.findAllCharacters(options).then((request) => request(axios, basePath));
}, },
}; };
}; };
/** /**
* CharacterControllerApi - object-oriented interface * CharacterApi - object-oriented interface
*/ */
export class CharacterControllerApi extends BaseAPI { export class CharacterApi extends BaseAPI {
/** /**
* *
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
public getCharacters(options?: RawAxiosRequestConfig) { public findAllCharacters(options?: RawAxiosRequestConfig) {
return CharacterControllerApiFp(this.configuration).getCharacters(options).then((request) => request(this.axios, this.basePath)); return CharacterApiFp(this.configuration).findAllCharacters(options).then((request) => request(this.axios, this.basePath));
} }
} }
/** /**
* LedgerControllerApi - axios parameter creator * CharacterRuleBookApi - axios parameter creator
*/ */
export const LedgerControllerApiAxiosParamCreator = function (configuration?: Configuration) { export const CharacterRuleBookApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @param {number} characterId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
findCharacterRuleBookByCharacterId: async (characterId: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'characterId' is not null or undefined
assertParamExists('findCharacterRuleBookByCharacterId', 'characterId', characterId)
const localVarPath = `/characters/{characterId}/rule-book`
.replace('{characterId}', encodeURIComponent(String(characterId)));
// 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 {number} characterId
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
setCharacterRuleBookForCharacter: async (characterId: number, setCharacterRuleBookRequest: SetCharacterRuleBookRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'characterId' is not null or undefined
assertParamExists('setCharacterRuleBookForCharacter', 'characterId', characterId)
// verify required parameter 'setCharacterRuleBookRequest' is not null or undefined
assertParamExists('setCharacterRuleBookForCharacter', 'setCharacterRuleBookRequest', setCharacterRuleBookRequest)
const localVarPath = `/characters/{characterId}/rule-book`
.replace('{characterId}', encodeURIComponent(String(characterId)));
// 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: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
localVarHeaderParameter['Content-Type'] = 'application/json';
localVarHeaderParameter['Accept'] = '*/*';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(setCharacterRuleBookRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* CharacterRuleBookApi - functional programming interface
*/
export const CharacterRuleBookApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = CharacterRuleBookApiAxiosParamCreator(configuration)
return {
/**
*
* @param {number} characterId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async findCharacterRuleBookByCharacterId(characterId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CharacterRuleBookResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.findCharacterRuleBookByCharacterId(characterId, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['CharacterRuleBookApi.findCharacterRuleBookByCharacterId']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @param {number} characterId
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async setCharacterRuleBookForCharacter(characterId: number, setCharacterRuleBookRequest: SetCharacterRuleBookRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CharacterRuleBookResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.setCharacterRuleBookForCharacter(characterId, setCharacterRuleBookRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['CharacterRuleBookApi.setCharacterRuleBookForCharacter']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
}
};
/**
* CharacterRuleBookApi - factory interface
*/
export const CharacterRuleBookApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = CharacterRuleBookApiFp(configuration)
return {
/**
*
* @param {number} characterId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
findCharacterRuleBookByCharacterId(characterId: number, options?: RawAxiosRequestConfig): AxiosPromise<CharacterRuleBookResponse> {
return localVarFp.findCharacterRuleBookByCharacterId(characterId, options).then((request) => request(axios, basePath));
},
/**
*
* @param {number} characterId
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
setCharacterRuleBookForCharacter(characterId: number, setCharacterRuleBookRequest: SetCharacterRuleBookRequest, options?: RawAxiosRequestConfig): AxiosPromise<CharacterRuleBookResponse> {
return localVarFp.setCharacterRuleBookForCharacter(characterId, setCharacterRuleBookRequest, options).then((request) => request(axios, basePath));
},
};
};
/**
* CharacterRuleBookApi - object-oriented interface
*/
export class CharacterRuleBookApi extends BaseAPI {
/**
*
* @param {number} characterId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public findCharacterRuleBookByCharacterId(characterId: number, options?: RawAxiosRequestConfig) {
return CharacterRuleBookApiFp(this.configuration).findCharacterRuleBookByCharacterId(characterId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {number} characterId
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public setCharacterRuleBookForCharacter(characterId: number, setCharacterRuleBookRequest: SetCharacterRuleBookRequest, options?: RawAxiosRequestConfig) {
return CharacterRuleBookApiFp(this.configuration).setCharacterRuleBookForCharacter(characterId, setCharacterRuleBookRequest, options).then((request) => request(this.axios, this.basePath));
}
}
/**
* LedgerApi - axios parameter creator
*/
export const LedgerApiAxiosParamCreator = function (configuration?: Configuration) {
return { return {
/** /**
* *
@@ -375,7 +562,7 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
findAll: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { findAllLedgers: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/ledgers`; const localVarPath = `/ledgers`;
// use dummy base URL string because the URL constructor only accepts absolute URLs. // use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -405,9 +592,9 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
findById: async (ledgerId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { findLedgerById: async (ledgerId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'ledgerId' is not null or undefined // verify required parameter 'ledgerId' is not null or undefined
assertParamExists('findById', 'ledgerId', ledgerId) assertParamExists('findLedgerById', 'ledgerId', ledgerId)
const localVarPath = `/ledgers/{ledgerId}` const localVarPath = `/ledgers/{ledgerId}`
.replace('{ledgerId}', encodeURIComponent(String(ledgerId))); .replace('{ledgerId}', encodeURIComponent(String(ledgerId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs. // use dummy base URL string because the URL constructor only accepts absolute URLs.
@@ -512,10 +699,10 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
}; };
/** /**
* LedgerControllerApi - functional programming interface * LedgerApi - functional programming interface
*/ */
export const LedgerControllerApiFp = function(configuration?: Configuration) { export const LedgerApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = LedgerControllerApiAxiosParamCreator(configuration) const localVarAxiosParamCreator = LedgerApiAxiosParamCreator(configuration)
return { return {
/** /**
* *
@@ -526,7 +713,7 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
async createCombinedLedger(createCombinedLedgerRequest: CreateCombinedLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CombinedLedgerResponse>> { async createCombinedLedger(createCombinedLedgerRequest: CreateCombinedLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CombinedLedgerResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createCombinedLedger(createCombinedLedgerRequest, options); const localVarAxiosArgs = await localVarAxiosParamCreator.createCombinedLedger(createCombinedLedgerRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['LedgerControllerApi.createCombinedLedger']?.[localVarOperationServerIndex]?.url; const localVarOperationServerBasePath = operationServerMap['LedgerApi.createCombinedLedger']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
}, },
/** /**
@@ -538,7 +725,7 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
async createMainLedger(createMainLedgerRequest: CreateMainLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MainLedgerResponse>> { async createMainLedger(createMainLedgerRequest: CreateMainLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MainLedgerResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createMainLedger(createMainLedgerRequest, options); const localVarAxiosArgs = await localVarAxiosParamCreator.createMainLedger(createMainLedgerRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['LedgerControllerApi.createMainLedger']?.[localVarOperationServerIndex]?.url; const localVarOperationServerBasePath = operationServerMap['LedgerApi.createMainLedger']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
}, },
/** /**
@@ -546,10 +733,10 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async findAll(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<FindAll200ResponseInner>>> { async findAllLedgers(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<FindAllLedgers200ResponseInner>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.findAll(options); const localVarAxiosArgs = await localVarAxiosParamCreator.findAllLedgers(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['LedgerControllerApi.findAll']?.[localVarOperationServerIndex]?.url; const localVarOperationServerBasePath = operationServerMap['LedgerApi.findAllLedgers']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
}, },
/** /**
@@ -558,10 +745,10 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async findById(ledgerId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FindAll200ResponseInner>> { async findLedgerById(ledgerId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FindAllLedgers200ResponseInner>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.findById(ledgerId, options); const localVarAxiosArgs = await localVarAxiosParamCreator.findLedgerById(ledgerId, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['LedgerControllerApi.findById']?.[localVarOperationServerIndex]?.url; const localVarOperationServerBasePath = operationServerMap['LedgerApi.findLedgerById']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
}, },
/** /**
@@ -574,7 +761,7 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
async updateCombinedLedger(ledgerId: string, updateCombinedLedgerRequest: UpdateCombinedLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CombinedLedgerResponse>> { async updateCombinedLedger(ledgerId: string, updateCombinedLedgerRequest: UpdateCombinedLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CombinedLedgerResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateCombinedLedger(ledgerId, updateCombinedLedgerRequest, options); const localVarAxiosArgs = await localVarAxiosParamCreator.updateCombinedLedger(ledgerId, updateCombinedLedgerRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['LedgerControllerApi.updateCombinedLedger']?.[localVarOperationServerIndex]?.url; const localVarOperationServerBasePath = operationServerMap['LedgerApi.updateCombinedLedger']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
}, },
/** /**
@@ -587,17 +774,17 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
async updateMainLedger(ledgerId: string, updateMainLedgerRequest: UpdateMainLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MainLedgerResponse>> { async updateMainLedger(ledgerId: string, updateMainLedgerRequest: UpdateMainLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MainLedgerResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateMainLedger(ledgerId, updateMainLedgerRequest, options); const localVarAxiosArgs = await localVarAxiosParamCreator.updateMainLedger(ledgerId, updateMainLedgerRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['LedgerControllerApi.updateMainLedger']?.[localVarOperationServerIndex]?.url; const localVarOperationServerBasePath = operationServerMap['LedgerApi.updateMainLedger']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
}, },
} }
}; };
/** /**
* LedgerControllerApi - factory interface * LedgerApi - factory interface
*/ */
export const LedgerControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { export const LedgerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = LedgerControllerApiFp(configuration) const localVarFp = LedgerApiFp(configuration)
return { return {
/** /**
* *
@@ -622,8 +809,8 @@ export const LedgerControllerApiFactory = function (configuration?: Configuratio
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
findAll(options?: RawAxiosRequestConfig): AxiosPromise<Array<FindAll200ResponseInner>> { findAllLedgers(options?: RawAxiosRequestConfig): AxiosPromise<Array<FindAllLedgers200ResponseInner>> {
return localVarFp.findAll(options).then((request) => request(axios, basePath)); return localVarFp.findAllLedgers(options).then((request) => request(axios, basePath));
}, },
/** /**
* *
@@ -631,8 +818,8 @@ export const LedgerControllerApiFactory = function (configuration?: Configuratio
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
findById(ledgerId: string, options?: RawAxiosRequestConfig): AxiosPromise<FindAll200ResponseInner> { findLedgerById(ledgerId: string, options?: RawAxiosRequestConfig): AxiosPromise<FindAllLedgers200ResponseInner> {
return localVarFp.findById(ledgerId, options).then((request) => request(axios, basePath)); return localVarFp.findLedgerById(ledgerId, options).then((request) => request(axios, basePath));
}, },
/** /**
* *
@@ -658,9 +845,9 @@ export const LedgerControllerApiFactory = function (configuration?: Configuratio
}; };
/** /**
* LedgerControllerApi - object-oriented interface * LedgerApi - object-oriented interface
*/ */
export class LedgerControllerApi extends BaseAPI { export class LedgerApi extends BaseAPI {
/** /**
* *
* @param {CreateCombinedLedgerRequest} createCombinedLedgerRequest * @param {CreateCombinedLedgerRequest} createCombinedLedgerRequest
@@ -668,7 +855,7 @@ export class LedgerControllerApi extends BaseAPI {
* @throws {RequiredError} * @throws {RequiredError}
*/ */
public createCombinedLedger(createCombinedLedgerRequest: CreateCombinedLedgerRequest, options?: RawAxiosRequestConfig) { public createCombinedLedger(createCombinedLedgerRequest: CreateCombinedLedgerRequest, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).createCombinedLedger(createCombinedLedgerRequest, options).then((request) => request(this.axios, this.basePath)); return LedgerApiFp(this.configuration).createCombinedLedger(createCombinedLedgerRequest, options).then((request) => request(this.axios, this.basePath));
} }
/** /**
@@ -678,7 +865,7 @@ export class LedgerControllerApi extends BaseAPI {
* @throws {RequiredError} * @throws {RequiredError}
*/ */
public createMainLedger(createMainLedgerRequest: CreateMainLedgerRequest, options?: RawAxiosRequestConfig) { public createMainLedger(createMainLedgerRequest: CreateMainLedgerRequest, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).createMainLedger(createMainLedgerRequest, options).then((request) => request(this.axios, this.basePath)); return LedgerApiFp(this.configuration).createMainLedger(createMainLedgerRequest, options).then((request) => request(this.axios, this.basePath));
} }
/** /**
@@ -686,8 +873,8 @@ export class LedgerControllerApi extends BaseAPI {
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
public findAll(options?: RawAxiosRequestConfig) { public findAllLedgers(options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).findAll(options).then((request) => request(this.axios, this.basePath)); return LedgerApiFp(this.configuration).findAllLedgers(options).then((request) => request(this.axios, this.basePath));
} }
/** /**
@@ -696,8 +883,8 @@ export class LedgerControllerApi extends BaseAPI {
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
public findById(ledgerId: string, options?: RawAxiosRequestConfig) { public findLedgerById(ledgerId: string, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).findById(ledgerId, options).then((request) => request(this.axios, this.basePath)); return LedgerApiFp(this.configuration).findLedgerById(ledgerId, options).then((request) => request(this.axios, this.basePath));
} }
/** /**
@@ -708,7 +895,7 @@ export class LedgerControllerApi extends BaseAPI {
* @throws {RequiredError} * @throws {RequiredError}
*/ */
public updateCombinedLedger(ledgerId: string, updateCombinedLedgerRequest: UpdateCombinedLedgerRequest, options?: RawAxiosRequestConfig) { public updateCombinedLedger(ledgerId: string, updateCombinedLedgerRequest: UpdateCombinedLedgerRequest, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).updateCombinedLedger(ledgerId, updateCombinedLedgerRequest, options).then((request) => request(this.axios, this.basePath)); return LedgerApiFp(this.configuration).updateCombinedLedger(ledgerId, updateCombinedLedgerRequest, options).then((request) => request(this.axios, this.basePath));
} }
/** /**
@@ -719,16 +906,16 @@ export class LedgerControllerApi extends BaseAPI {
* @throws {RequiredError} * @throws {RequiredError}
*/ */
public updateMainLedger(ledgerId: string, updateMainLedgerRequest: UpdateMainLedgerRequest, options?: RawAxiosRequestConfig) { public updateMainLedger(ledgerId: string, updateMainLedgerRequest: UpdateMainLedgerRequest, options?: RawAxiosRequestConfig) {
return LedgerControllerApiFp(this.configuration).updateMainLedger(ledgerId, updateMainLedgerRequest, options).then((request) => request(this.axios, this.basePath)); return LedgerApiFp(this.configuration).updateMainLedger(ledgerId, updateMainLedgerRequest, options).then((request) => request(this.axios, this.basePath));
} }
} }
/** /**
* ProcessingControllerApi - axios parameter creator * ProcessingApi - axios parameter creator
*/ */
export const ProcessingControllerApiAxiosParamCreator = function (configuration?: Configuration) { export const ProcessingApiAxiosParamCreator = function (configuration?: Configuration) {
return { return {
/** /**
* *
@@ -762,10 +949,10 @@ export const ProcessingControllerApiAxiosParamCreator = function (configuration?
}; };
/** /**
* ProcessingControllerApi - functional programming interface * ProcessingApi - functional programming interface
*/ */
export const ProcessingControllerApiFp = function(configuration?: Configuration) { export const ProcessingApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = ProcessingControllerApiAxiosParamCreator(configuration) const localVarAxiosParamCreator = ProcessingApiAxiosParamCreator(configuration)
return { return {
/** /**
* *
@@ -775,17 +962,17 @@ export const ProcessingControllerApiFp = function(configuration?: Configuration)
async processNewActivities(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { async processNewActivities(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.processNewActivities(options); const localVarAxiosArgs = await localVarAxiosParamCreator.processNewActivities(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ProcessingControllerApi.processNewActivities']?.[localVarOperationServerIndex]?.url; const localVarOperationServerBasePath = operationServerMap['ProcessingApi.processNewActivities']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
}, },
} }
}; };
/** /**
* ProcessingControllerApi - factory interface * ProcessingApi - factory interface
*/ */
export const ProcessingControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { export const ProcessingApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = ProcessingControllerApiFp(configuration) const localVarFp = ProcessingApiFp(configuration)
return { return {
/** /**
* *
@@ -799,37 +986,67 @@ export const ProcessingControllerApiFactory = function (configuration?: Configur
}; };
/** /**
* ProcessingControllerApi - object-oriented interface * ProcessingApi - object-oriented interface
*/ */
export class ProcessingControllerApi extends BaseAPI { export class ProcessingApi extends BaseAPI {
/** /**
* *
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
public processNewActivities(options?: RawAxiosRequestConfig) { public processNewActivities(options?: RawAxiosRequestConfig) {
return ProcessingControllerApiFp(this.configuration).processNewActivities(options).then((request) => request(this.axios, this.basePath)); return ProcessingApiFp(this.configuration).processNewActivities(options).then((request) => request(this.axios, this.basePath));
} }
} }
/** /**
* RuleBookControllerApi - axios parameter creator * RuleBookApi - axios parameter creator
*/ */
export const RuleBookControllerApiAxiosParamCreator = function (configuration?: Configuration) { export const RuleBookApiAxiosParamCreator = function (configuration?: Configuration) {
return { return {
/** /**
* *
* @param {number} characterId * @param {CreateRuleBookRequest} createRuleBookRequest
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
findByCharacterId: async (characterId: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { createRuleBook: async (createRuleBookRequest: CreateRuleBookRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'characterId' is not null or undefined // verify required parameter 'createRuleBookRequest' is not null or undefined
assertParamExists('findByCharacterId', 'characterId', characterId) assertParamExists('createRuleBook', 'createRuleBookRequest', createRuleBookRequest)
const localVarPath = `/characters/{characterId}/rule-book` const localVarPath = `/rule-books`;
.replace('{characterId}', encodeURIComponent(String(characterId))); // 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';
localVarHeaderParameter['Accept'] = '*/*';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(createRuleBookRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
findAllRuleBooks: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/rule-books`;
// use dummy base URL string because the URL constructor only accepts absolute URLs. // use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions; let baseOptions;
@@ -854,18 +1071,15 @@ export const RuleBookControllerApiAxiosParamCreator = function (configuration?:
}, },
/** /**
* *
* @param {number} characterId * @param {string} ruleBookId
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
setCharacterRuleBook: async (characterId: number, setCharacterRuleBookRequest: SetCharacterRuleBookRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { findRuleBookById: async (ruleBookId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'characterId' is not null or undefined // verify required parameter 'ruleBookId' is not null or undefined
assertParamExists('setCharacterRuleBook', 'characterId', characterId) assertParamExists('findRuleBookById', 'ruleBookId', ruleBookId)
// verify required parameter 'setCharacterRuleBookRequest' is not null or undefined const localVarPath = `/rule-books/{ruleBookId}`
assertParamExists('setCharacterRuleBook', 'setCharacterRuleBookRequest', setCharacterRuleBookRequest) .replace('{ruleBookId}', encodeURIComponent(String(ruleBookId)));
const localVarPath = `/characters/{characterId}/rule-book`
.replace('{characterId}', encodeURIComponent(String(characterId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs. // use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions; let baseOptions;
@@ -873,7 +1087,43 @@ export const RuleBookControllerApiAxiosParamCreator = function (configuration?:
baseOptions = configuration.baseOptions; baseOptions = configuration.baseOptions;
} }
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; 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} ruleBookId
* @param {UpdateRuleBookRequest} updateRuleBookRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateRuleBook: async (ruleBookId: string, updateRuleBookRequest: UpdateRuleBookRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'ruleBookId' is not null or undefined
assertParamExists('updateRuleBook', 'ruleBookId', ruleBookId)
// verify required parameter 'updateRuleBookRequest' is not null or undefined
assertParamExists('updateRuleBook', 'updateRuleBookRequest', updateRuleBookRequest)
const localVarPath = `/rule-books/{ruleBookId}`
.replace('{ruleBookId}', encodeURIComponent(String(ruleBookId)));
// 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: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any; const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any; const localVarQueryParameter = {} as any;
@@ -883,7 +1133,7 @@ export const RuleBookControllerApiAxiosParamCreator = function (configuration?:
setSearchParams(localVarUrlObj, localVarQueryParameter); setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(setCharacterRuleBookRequest, localVarRequestOptions, configuration) localVarRequestOptions.data = serializeDataIfNeeded(updateRuleBookRequest, localVarRequestOptions, configuration)
return { return {
url: toPathString(localVarUrlObj), url: toPathString(localVarUrlObj),
@@ -894,90 +1144,149 @@ export const RuleBookControllerApiAxiosParamCreator = function (configuration?:
}; };
/** /**
* RuleBookControllerApi - functional programming interface * RuleBookApi - functional programming interface
*/ */
export const RuleBookControllerApiFp = function(configuration?: Configuration) { export const RuleBookApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = RuleBookControllerApiAxiosParamCreator(configuration) const localVarAxiosParamCreator = RuleBookApiAxiosParamCreator(configuration)
return { return {
/** /**
* *
* @param {number} characterId * @param {CreateRuleBookRequest} createRuleBookRequest
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async findByCharacterId(characterId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RuleBookResponse>> { async createRuleBook(createRuleBookRequest: CreateRuleBookRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RuleBookResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.findByCharacterId(characterId, options); const localVarAxiosArgs = await localVarAxiosParamCreator.createRuleBook(createRuleBookRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['RuleBookControllerApi.findByCharacterId']?.[localVarOperationServerIndex]?.url; const localVarOperationServerBasePath = operationServerMap['RuleBookApi.createRuleBook']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
}, },
/** /**
* *
* @param {number} characterId
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async setCharacterRuleBook(characterId: number, setCharacterRuleBookRequest: SetCharacterRuleBookRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RuleBookResponse>> { async findAllRuleBooks(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<RuleBookResponse>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.setCharacterRuleBook(characterId, setCharacterRuleBookRequest, options); const localVarAxiosArgs = await localVarAxiosParamCreator.findAllRuleBooks(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['RuleBookControllerApi.setCharacterRuleBook']?.[localVarOperationServerIndex]?.url; const localVarOperationServerBasePath = operationServerMap['RuleBookApi.findAllRuleBooks']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @param {string} ruleBookId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async findRuleBookById(ruleBookId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RuleBookResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.findRuleBookById(ruleBookId, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['RuleBookApi.findRuleBookById']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @param {string} ruleBookId
* @param {UpdateRuleBookRequest} updateRuleBookRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateRuleBook(ruleBookId: string, updateRuleBookRequest: UpdateRuleBookRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RuleBookResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateRuleBook(ruleBookId, updateRuleBookRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['RuleBookApi.updateRuleBook']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
}, },
} }
}; };
/** /**
* RuleBookControllerApi - factory interface * RuleBookApi - factory interface
*/ */
export const RuleBookControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { export const RuleBookApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = RuleBookControllerApiFp(configuration) const localVarFp = RuleBookApiFp(configuration)
return { return {
/** /**
* *
* @param {number} characterId * @param {CreateRuleBookRequest} createRuleBookRequest
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
findByCharacterId(characterId: number, options?: RawAxiosRequestConfig): AxiosPromise<RuleBookResponse> { createRuleBook(createRuleBookRequest: CreateRuleBookRequest, options?: RawAxiosRequestConfig): AxiosPromise<RuleBookResponse> {
return localVarFp.findByCharacterId(characterId, options).then((request) => request(axios, basePath)); return localVarFp.createRuleBook(createRuleBookRequest, options).then((request) => request(axios, basePath));
}, },
/** /**
* *
* @param {number} characterId
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
setCharacterRuleBook(characterId: number, setCharacterRuleBookRequest: SetCharacterRuleBookRequest, options?: RawAxiosRequestConfig): AxiosPromise<RuleBookResponse> { findAllRuleBooks(options?: RawAxiosRequestConfig): AxiosPromise<Array<RuleBookResponse>> {
return localVarFp.setCharacterRuleBook(characterId, setCharacterRuleBookRequest, options).then((request) => request(axios, basePath)); return localVarFp.findAllRuleBooks(options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} ruleBookId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
findRuleBookById(ruleBookId: string, options?: RawAxiosRequestConfig): AxiosPromise<RuleBookResponse> {
return localVarFp.findRuleBookById(ruleBookId, options).then((request) => request(axios, basePath));
},
/**
*
* @param {string} ruleBookId
* @param {UpdateRuleBookRequest} updateRuleBookRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateRuleBook(ruleBookId: string, updateRuleBookRequest: UpdateRuleBookRequest, options?: RawAxiosRequestConfig): AxiosPromise<RuleBookResponse> {
return localVarFp.updateRuleBook(ruleBookId, updateRuleBookRequest, options).then((request) => request(axios, basePath));
}, },
}; };
}; };
/** /**
* RuleBookControllerApi - object-oriented interface * RuleBookApi - object-oriented interface
*/ */
export class RuleBookControllerApi extends BaseAPI { export class RuleBookApi extends BaseAPI {
/** /**
* *
* @param {number} characterId * @param {CreateRuleBookRequest} createRuleBookRequest
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
public findByCharacterId(characterId: number, options?: RawAxiosRequestConfig) { public createRuleBook(createRuleBookRequest: CreateRuleBookRequest, options?: RawAxiosRequestConfig) {
return RuleBookControllerApiFp(this.configuration).findByCharacterId(characterId, options).then((request) => request(this.axios, this.basePath)); return RuleBookApiFp(this.configuration).createRuleBook(createRuleBookRequest, options).then((request) => request(this.axios, this.basePath));
} }
/** /**
* *
* @param {number} characterId
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
public setCharacterRuleBook(characterId: number, setCharacterRuleBookRequest: SetCharacterRuleBookRequest, options?: RawAxiosRequestConfig) { public findAllRuleBooks(options?: RawAxiosRequestConfig) {
return RuleBookControllerApiFp(this.configuration).setCharacterRuleBook(characterId, setCharacterRuleBookRequest, options).then((request) => request(this.axios, this.basePath)); return RuleBookApiFp(this.configuration).findAllRuleBooks(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} ruleBookId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public findRuleBookById(ruleBookId: string, options?: RawAxiosRequestConfig) {
return RuleBookApiFp(this.configuration).findRuleBookById(ruleBookId, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @param {string} ruleBookId
* @param {UpdateRuleBookRequest} updateRuleBookRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public updateRuleBook(ruleBookId: string, updateRuleBookRequest: UpdateRuleBookRequest, options?: RawAxiosRequestConfig) {
return RuleBookApiFp(this.configuration).updateRuleBook(ruleBookId, updateRuleBookRequest, options).then((request) => request(this.axios, this.basePath));
} }
} }
+8 -6
View File
@@ -11,7 +11,7 @@ import {
} from "@/generated/mammon"; } from "@/generated/mammon";
import {defineStore} from "pinia"; import {defineStore} from "pinia";
import {ref, triggerRef} from "vue"; import {ref, triggerRef} from "vue";
import {ledgerControllerApi} from "@/mammon"; import {ledgerApi} from "@/mammon";
export const LedgerTypes = LedgerResponseTypeEnum; export const LedgerTypes = LedgerResponseTypeEnum;
@@ -20,6 +20,8 @@ export type MainLedger = MainLedgerResponse & {type: MainLedgerResponseTypeEnum}
export type CombinedLedger = CombinedLedgerResponse & {type: CombinedLedgerResponseTypeEnum} export type CombinedLedger = CombinedLedgerResponse & {type: CombinedLedgerResponseTypeEnum}
export type Ledger = MainLedger | CombinedLedger; export type Ledger = MainLedger | CombinedLedger;
export const systemLedgerRef = 'system';
export const systemLedger = { export const systemLedger = {
type: LedgerTypes.Main, type: LedgerTypes.Main,
ledgerId: "", ledgerId: "",
@@ -57,12 +59,12 @@ export const useLedgersStore = defineStore('ledgers', () => {
const findById = (ledgerId: string): Ledger | undefined => ledgers.value.find(l => l.ledgerId === ledgerId); const findById = (ledgerId: string): Ledger | undefined => ledgers.value.find(l => l.ledgerId === ledgerId);
const findAllById = (ledgerIds: string[]): Ledger[] => ledgerIds.map(findById).filter((x): x is Ledger => x !== undefined) const findAllById = (ledgerIds: string[]): Ledger[] => ledgerIds.map(findById).filter((x): x is Ledger => x !== undefined)
const createMain = (ledger: CreateMainLedgerRequest) => ledgerControllerApi.createMainLedger(ledger).then(response => addLedger(response.data as Ledger)); const createMain = (ledger: CreateMainLedgerRequest) => ledgerApi.createMainLedger(ledger).then(response => addLedger(response.data as Ledger));
const createCombined = (ledger: CreateCombinedLedgerRequest) => ledgerControllerApi.createCombinedLedger(ledger).then(response => addLedger(response.data as Ledger)); const createCombined = (ledger: CreateCombinedLedgerRequest) => ledgerApi.createCombinedLedger(ledger).then(response => addLedger(response.data as Ledger));
const updateMain = (ledgerId: string, ledger: UpdateMainLedgerRequest) => ledgerControllerApi.updateMainLedger(ledgerId, ledger).then(response => replaceLedger(response.data as Ledger)); const updateMain = (ledgerId: string, ledger: UpdateMainLedgerRequest) => ledgerApi.updateMainLedger(ledgerId, ledger).then(response => replaceLedger(response.data as Ledger));
const updateCombined = (ledgerId: string, ledger: UpdateCombinedLedgerRequest) => ledgerControllerApi.updateCombinedLedger(ledgerId, ledger).then(response => replaceLedger(response.data as Ledger)); const updateCombined = (ledgerId: string, ledger: UpdateCombinedLedgerRequest) => ledgerApi.updateCombinedLedger(ledgerId, ledger).then(response => replaceLedger(response.data as Ledger));
const refresh = () => ledgerControllerApi.findAll().then(response => ledgers.value = response.data as Ledger[]); const refresh = () => ledgerApi.findAllLedgers().then(response => ledgers.value = response.data as Ledger[]);
refresh(); refresh();
+12 -10
View File
@@ -1,11 +1,12 @@
import {logResource} from "@/service"; import {logResource} from "@/service";
import axios from "axios"; import axios from "axios";
import { import {
ActivityControllerApi, ActivityApi,
CharacterControllerApi, CharacterApi,
LedgerControllerApi, CharacterRuleBookApi,
ProcessingControllerApi, LedgerApi,
RuleBookControllerApi ProcessingApi,
RuleBookApi
} from "@/generated/mammon"; } from "@/generated/mammon";
export const mammonUrl = import.meta.env.VITE_MAMMON_URL; export const mammonUrl = import.meta.env.VITE_MAMMON_URL;
@@ -20,8 +21,9 @@ const mammonAxiosInstance = axios.create({
}) })
logResource(mammonAxiosInstance) logResource(mammonAxiosInstance)
export const ledgerControllerApi = new LedgerControllerApi(undefined, mammonUrl, mammonAxiosInstance); export const ledgerApi = new LedgerApi(undefined, mammonUrl, mammonAxiosInstance);
export const characterControllerApi = new CharacterControllerApi(undefined, mammonUrl, mammonAxiosInstance); export const characterApi = new CharacterApi(undefined, mammonUrl, mammonAxiosInstance);
export const ruleBookControllerApi = new RuleBookControllerApi(undefined, mammonUrl, mammonAxiosInstance); export const ruleBookApi = new RuleBookApi(undefined, mammonUrl, mammonAxiosInstance);
export const activityControllerApi = new ActivityControllerApi(undefined, mammonUrl, mammonAxiosInstance); export const characterRuleBookApi = new CharacterRuleBookApi(undefined, mammonUrl, mammonAxiosInstance);
export const processingControllerApi = new ProcessingControllerApi(undefined, mammonUrl, mammonAxiosInstance); export const activityApi = new ActivityApi(undefined, mammonUrl, mammonAxiosInstance);
export const processingApi = new ProcessingApi(undefined, mammonUrl, mammonAxiosInstance);
+2 -1
View File
@@ -1,6 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ClipboardButton } from '@/components'; import { ClipboardButton } from '@/components';
import { InformationCircleIcon } from '@heroicons/vue/24/outline'; import { InformationCircleIcon } from '@heroicons/vue/24/outline';
import { routeNames } from '@/routes';
interface Props { interface Props {
@@ -21,7 +22,7 @@ withDefaults(defineProps<Props>(), {
<img v-if="id" :src="`https://images.evetech.net/types/${id}/icon?size=32`" class="inline-block w-5 h-5 me-1 mt-1" alt="" /> <img v-if="id" :src="`https://images.evetech.net/types/${id}/icon?size=32`" class="inline-block w-5 h-5 me-1 mt-1" alt="" />
<template v-if="name"> <template v-if="name">
{{ name }} {{ name }}
<RouterLink v-if="id" :to="{ name: 'market-types', params: { type: id } }" class="button btn-icon ms-1 me-1 mt-1" title="Show item info"> <RouterLink v-if="id" :to="{ name: routeNames.marketTypes, params: { type: id } }" class="button btn-icon ms-1 me-1 mt-1" title="Show item info">
<InformationCircleIcon /> <InformationCircleIcon />
</RouterLink> </RouterLink>
<ClipboardButton v-if="!hideCopy" :value="name" /> <ClipboardButton v-if="!hideCopy" :value="name" />
+2 -2
View File
@@ -2,7 +2,7 @@
import {RouterView} from 'vue-router'; import {RouterView} from 'vue-router';
import {CreateLedgerModal} from "@/ledger"; import {CreateLedgerModal} from "@/ledger";
import {ref} from "vue"; import {ref} from "vue";
import {processingControllerApi} from "@/mammon"; import {processingApi} from "@/mammon";
const createLedgerModal = ref<typeof CreateLedgerModal>(); const createLedgerModal = ref<typeof CreateLedgerModal>();
</script> </script>
@@ -10,7 +10,7 @@ const createLedgerModal = ref<typeof CreateLedgerModal>();
<template> <template>
<div class="mt-4"> <div class="mt-4">
<div class="mb-4 border-b-1 flex justify-end"> <div class="mb-4 border-b-1 flex justify-end">
<button class="mb-2 ms-2" @click="processingControllerApi.processNewActivities()">Process Activities</button> <button class="mb-2 ms-2" @click="processingApi.processNewActivities()">Process Activities</button>
<button class="mb-2 ms-2" @click="createLedgerModal?.open()">New Ledger</button> <button class="mb-2 ms-2" @click="createLedgerModal?.open()">New Ledger</button>
</div> </div>
<CreateLedgerModal ref="createLedgerModal" /> <CreateLedgerModal ref="createLedgerModal" />
+4 -15
View File
@@ -1,12 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'; import {RouterLink, RouterView} from 'vue-router';
import {routeNames} from '@/routes';
</script> </script>
<template> <template>
<div class="mt-4"> <div class="mt-4">
<div class="flex border-b-2 border-emerald-500"> <div class="flex border-b-2 border-emerald-500">
<RouterLink :to="{name: 'market-types'}" class="tab"> <RouterLink :to="{name: routeNames.marketTypes}" class="tab">
<span>Item Info</span> <span>Item Info</span>
</RouterLink> </RouterLink>
<RouterLink to="/market/tracking" class="tab"> <RouterLink to="/market/tracking" class="tab">
@@ -18,15 +18,4 @@ import { RouterLink, RouterView } from 'vue-router';
</div> </div>
<RouterView /> <RouterView />
</div> </div>
</template> </template>
<style scoped>
@reference "tailwindcss";
a.tab {
@apply flex items-center px-4 me-2 rounded-t-md bg-slate-600 hover:bg-slate-700;
&.router-link-active {
@apply bg-emerald-500 hover:bg-emerald-700;
}
}
</style>
+13 -2
View File
@@ -1,7 +1,18 @@
<script setup lang="ts"> <script setup lang="ts">
import {RouterLink, RouterView} from "vue-router";
import {routeNames} from '@/routes';
</script> </script>
<template> <template>
<RouterView /> <div class="mt-4">
<div class="flex border-b-2 border-emerald-500">
<RouterLink :to="{ name: routeNames.listRuleBooks }" class="tab">
<span>Rule Books</span>
</RouterLink>
<RouterLink to="/characters/rules" class="tab">
<span>Characters Rules</span>
</RouterLink>
</div>
<RouterView />
</div>
</template> </template>
+2 -1
View File
@@ -7,6 +7,7 @@ import {BookmarkIcon, BookmarkSlashIcon, ShoppingCartIcon} from '@heroicons/vue/
import log from "loglevel"; import log from "loglevel";
import {computed, ref, watch} from "vue"; import {computed, ref, watch} from "vue";
import {useRoute, useRouter} from "vue-router"; import {useRoute, useRouter} from "vue-router";
import {routeNames} from "@/routes";
import {computedAsync} from "@vueuse/core"; import {computedAsync} from "@vueuse/core";
const buyModal = ref<typeof BuyModal>(); const buyModal = ref<typeof BuyModal>();
@@ -52,7 +53,7 @@ const view = () => {
} }
router.push({ router.push({
name: 'market-types', name: routeNames.marketTypes,
params: { params: {
type: inputItem.value.id type: inputItem.value.id
} }
+95
View File
@@ -0,0 +1,95 @@
<script setup lang="ts">
import {Character, CharacterLabel, useCharactersStore} from "@/characters";
import {useRoute} from "vue-router";
import {computed, ref, watch, watchEffect} from "vue";
import log from "loglevel";
import {
findCharacterRuleBookByCharacterId,
RuleBook,
setCharacterRuleBookForCharacter,
useRuleBooksStore
} from "@/rules";
import {storeToRefs} from "pinia";
import {isMain, Ledger, LedgerSelect, systemLedger, useLedgersStore} from "@/ledger";
type Bindings = { [key: string]: Ledger; };
const ruleBookStore = useRuleBooksStore();
const {findById: findCharacterRuleBookById} = ruleBookStore;
const {ruleBooks} = storeToRefs(ruleBookStore);
const {findById: findCharacterById} = useCharactersStore();
const {ledgers} = storeToRefs(useLedgersStore());
const ledgersToUse = computed(() => [systemLedger, ...ledgers.value.filter(isMain)]);
const character = ref<Character>();
const ruleBook = ref<RuleBook>();
const bindings = ref<Bindings>({});
watchEffect(async () => {
const characterId = character.value?.characterId;
if (characterId) {
const characterRuleBook = await findCharacterRuleBookByCharacterId(characterId);
ruleBook.value = findCharacterRuleBookById(characterRuleBook.ruleBookId);
bindings.value = Object.fromEntries(
Object.entries(characterRuleBook.bindings)
.map(([key, id]) => [key, ledgersToUse.value.find(l => l.ledgerId === id) ?? systemLedger])
);
}
});
const save = () => {
const characterId = character.value?.characterId;
const ruleBookId = ruleBook.value?.ruleBookId;
if (characterId && ruleBookId) {
setCharacterRuleBookForCharacter(characterId, {
ruleBookId,
bindings: Object.fromEntries(
Object.entries(bindings.value)
.map(([key, ledger]) => [key, ledger.ledgerId])
)
})
}
}
watch(useRoute(), async route => {
if (route.params.characterId) {
const id = parseInt(typeof route.params.characterId === 'string' ? route.params.characterId : route.params.characterId[0]);
character.value = await findCharacterById(id);
log.info('Loaded character:', character.value);
} else {
character.value = undefined;
log.info('No character to load');
}
}, { immediate: true })
</script>
<template>
<div v-if="character" class="grid mb-2 mt-4">
<div class="mb-2 border-b-1 flex">
<CharacterLabel class="flex grow mb-2" :character="character" :size="64" />
<div>
<button @click="save">Save</button>
</div>
</div>
<div class="flex-col border-b-1">
Rule Book:
<select class="me-2 mb-2 w-50" v-model="ruleBook">
<option v-for="rb in ruleBooks" :key="rb.ruleBookId" :value="rb">{{ rb.name }}</option>
</select>
</div>
<div class="flex-col border-b-1">
Ledger Bindings:
<div class="flex flex-wrap items-center mb-2 mt-2">
<div class="me-2" v-for="ref in ruleBook.ledgerRefs" :ref="ref">
<span class="me-1">{{ref}}:</span>
<LedgerSelect :ledgers="ledgersToUse" :modelValue="bindings[ref] ?? systemLedger" @update:modelValue="value => bindings[ref] = value" />
</div>
</div>
</div>
</div>
</template>
+99 -36
View File
@@ -1,57 +1,120 @@
<script setup lang="ts"> <script setup lang="ts">
import {Character, CharacterLabel, useCharactersStore} from "@/characters"; import {useRoute, useRouter} from "vue-router";
import {useRoute} from "vue-router"; import {ref, watch} from "vue";
import {ref, watch, watchEffect} from "vue"; import {useDebounceFn} from "@vueuse/core";
import log from "loglevel"; import log from "loglevel";
import {activityTypes, findByCharacterId, RuleBook, RuleSetInput, setCharacterRuleBook} from "@/rules"; import {activityTypes, RuleInput, Rules, useRuleBooksStore} from "@/rules";
import {PlusIcon, TrashIcon} from "@heroicons/vue/24/outline";
import {routeNames} from "@/routes";
import {Dropdown} from "@/components";
const {findById: findCharacterById} = useCharactersStore(); const ruleBookId = ref<string>();
const character = ref<Character>(); const name = ref<string>('');
const ledgerRefs = ref<string[]>([]);
const rules = ref<Rules>({});
const ruleBook = ref<RuleBook>(); const {findById, create, update, refresh} = useRuleBooksStore();
const router = useRouter();
watchEffect(async () => { const save = async () => {
const characterId = character.value?.characterId; if (!ruleBookId.value) {
const created = await create({
name: name.value,
ledgerRefs: ledgerRefs.value,
rules: rules.value
})
await router.push({ name: routeNames.editRuleBook, params: {ruleBookId: created.ruleBookId}})
if (characterId) { } else {
ruleBook.value = await findByCharacterId(characterId); await update(ruleBookId.value, {
} name: name.value,
}); ledgerRefs: ledgerRefs.value,
rules: rules.value
const save = () => { })
const characterId = character.value?.characterId;
if (characterId && ruleBook.value) {
setCharacterRuleBook(characterId, ruleBook.value);
} }
} }
watch(useRoute(), async route => { const addLedgerRef = () => {
if (route.params.characterId) { ledgerRefs.value = [...ledgerRefs.value, '']
const id = parseInt(typeof route.params.characterId === 'string' ? route.params.characterId : route.params.characterId[0]); }
const updateLedgerRef = useDebounceFn((index: number, value: string) => {
ledgerRefs.value[index] = value;
}, 500);
character.value = await findCharacterById(id); const removeLedgerRef = (index: number) => {
log.info('Loaded character:', character.value); ledgerRefs.value = ledgerRefs.value.toSpliced(index, 1)
}
watch(useRoute(), async route => {
if (route.params.ruleBookId) {
const promise = refresh(); // FIXME don't call refresh
const id = typeof route.params.ruleBookId === 'string' ? route.params.ruleBookId : route.params.ruleBookId[0];
await promise;
const ruleBook = findById(id);
ruleBookId.value = id;
name.value = ruleBook?.name ?? '';
ledgerRefs.value = [...ruleBook?.ledgerRefs];
rules.value = {...ruleBook?.rules}; // TODO fully clone rules
log.info('Loaded rule book:', ruleBook);
} else { } else {
character.value = undefined; ruleBookId.value = undefined;
log.info('No character to load'); name.value = '';
ledgerRefs.value = [];
rules.value = {};
log.info('No rule book to load');
} }
}, { immediate: true }) }, { immediate: true })
</script> </script>
<template> <template>
<div v-if="character" class="grid mb-2 mt-4"> <div class="grid mb-2 mt-4">
<div class="mb-2 border-b-1 flex"> <div class="flex flex-col">
<CharacterLabel class="flex grow mb-2" :character="character" :size="64" /> <div class="flex grow border-b-1">
Name:
<input class="mb-2 ms-2" type="text" v-model="name" />
</div>
<div class="border-b-1">
Ledgers References:
<div class="flex flex-wrap items-center">
<div class="flex items-center mb-2" v-for="(ledgerRef, index) in ledgerRefs" :key="index">
<input class="me-1" type="text" :value="ledgerRefs[index]" @input="updateLedgerRef(index, ($event.target as HTMLInputElement).value)" />
<button class="btn-icon me-2" @click="addLedgerRef"><TrashIcon /></button>
</div>
<div class="flex items-center mb-2">
<button class="btn-icon" @click="removeLedgerRef(index)"><PlusIcon /></button>
</div>
</div>
</div>
<div class="flex flex-col grow border-b-1" v-for="activityType in activityTypes" :key="activityType.key">
<Dropdown :inline="true" :autoClose="false" class="rule-dropdown">
<template #button>
<span>{{ activityType.name }}</span>
</template>
<RuleInput :ledgerRefs="ledgerRefs" v-model="rules[activityType.key]" />
</Dropdown>
</div>
</div>
<div class="mt-2 justify-end flex">
<div> <div>
<button @click="save">Save</button> <button @click="save">Save</button>
</div> </div>
</div> </div>
<div v-if="ruleBook" class="flex-col">
<div class="flex-col grow border-b-1" v-for="activityType in activityTypes" :key="activityType.key">
<span>{{ activityType.name }}</span>
<RuleSetInput v-model="ruleBook.ruleSets[activityType.key]" />
</div>
</div>
</div> </div>
</template> </template>
<style scoped>
@reference "tailwindcss";
.rule-dropdown :deep(>button) {
@apply bg-slate-800 hover:bg-slate-800 border-none flex items-center w-full;
}
.rule-dropdown.dropdown-open :deep(>button) {
@apply bg-slate-800 rounded-b-none;
}
</style>
@@ -0,0 +1,18 @@
<script setup lang="ts">
import {storeToRefs} from "pinia";
import {CharacterLabel, useCharactersStore} from "@/characters";
import {PencilSquareIcon} from "@heroicons/vue/24/outline";
import {routeNames} from "@/routes";
const {characters} = storeToRefs(useCharactersStore());
</script>
<template>
<div class="grid mb-2 mt-4">
<div v-for="character in characters" :key="character.characterId" class="flex items-center mb-2">
<CharacterLabel class="flex grow" :character="character" />
<RouterLink class="btn-icon ms-2" :to="{ name: routeNames.characterRulebook, params: { characterId: character.characterId } }"><PencilSquareIcon /></RouterLink>
</div>
</div>
</template>
+11 -6
View File
@@ -1,17 +1,22 @@
<script setup lang="ts"> <script setup lang="ts">
import {storeToRefs} from "pinia"; import {storeToRefs} from "pinia";
import {CharacterLabel, useCharactersStore} from "@/characters"; import {PencilSquareIcon, TrashIcon} from "@heroicons/vue/24/outline";
import {PencilSquareIcon} from "@heroicons/vue/24/outline"; import {useRuleBooksStore} from "@/rules";
import {routeNames} from "@/routes";
const {characters} = storeToRefs(useCharactersStore()); const {ruleBooks} = storeToRefs(useRuleBooksStore());
</script> </script>
<template> <template>
<div class="grid mb-2 mt-4"> <div class="grid mb-2 mt-4">
<div v-for="character in characters" :key="character.characterId" class="flex items-center mb-2"> <div class="flex justify-end border-b-1">
<CharacterLabel class="flex grow" :character="character" /> <RouterLink class="button mb-2 ms-2" :to="{ name: routeNames.newRuleBook}">New Rule Book</RouterLink>
<RouterLink class="btn-icon ms-2" :to="{ name: 'character-rulebook', params: { characterId: character.characterId } }"><PencilSquareIcon /></RouterLink> </div>
<div v-for="ruleBook in ruleBooks" :key="ruleBook.ruleBookId" class="flex items-center mt-2">
<span class="flex grow me-2">{{ruleBook.name}}</span>
<RouterLink class="btn-icon me-1" :to="{ name: routeNames.editRuleBook, params: { ruleBookId: ruleBook.ruleBookId } }"><PencilSquareIcon /></RouterLink>
<button class="btn-icon"><TrashIcon /></button>
</div> </div>
</div> </div>
</template> </template>
+26 -7
View File
@@ -1,21 +1,40 @@
import {RouteRecordRaw} from 'vue-router'; import {RouteRecordRaw} from 'vue-router';
export const routeNames = {
home: 'home',
callback: 'callback',
listRuleBooks: 'list-rule-books',
newRuleBook: 'new-rule-book',
editRuleBook: 'edit-rule-book',
characterRulebook: 'character-rulebook',
marketTypes: 'market-types',
about: 'about',
} as const;
export const routes: RouteRecordRaw[] = [ export const routes: RouteRecordRaw[] = [
{path: '/', name: 'home', component: () => import('@/pages/Index.vue')}, {path: '/', name: routeNames.home, component: () => import('@/pages/Index.vue')},
{path: '/callback', name: 'callback', component: () => import('@/pages/Index.vue')}, {path: '/callback', name: routeNames.callback, component: () => import('@/pages/Index.vue')},
{path: '/ledgers', component: () => import('@/pages/Ledgers.vue'), children: [ {path: '/ledgers', component: () => import('@/pages/Ledgers.vue'), children: [
{path: '', component: () => import('@/pages/ledger/ListLedgers.vue')}, {path: '', component: () => import('@/pages/ledger/ListLedgers.vue')},
]}, ]},
{path: '/rules', component: () => import('@/pages/Rules.vue'), children: [ {path: '/rules', component: () => import('@/pages/Rules.vue'), children: [
{path: '', component: () => import('./pages/rules/ListRuleBooks.vue')}, {path: '', redirect: '/rule-books'},
{path: '/characters/:characterId/rule-book', name: 'character-rulebook', component: () => import('@/pages/rules/EditRuleBook.vue')}, {path: '/rule-books', children: [
{path: '', name: routeNames.listRuleBooks, component: () => import('@/pages/rules/ListRuleBooks.vue')},
{path: 'new', name: routeNames.newRuleBook, component: () => import('@/pages/rules/EditRuleBook.vue')},
{path: ':ruleBookId', name: routeNames.editRuleBook, component: () => import('@/pages/rules/EditRuleBook.vue')},
]},
{path: '/characters/rules', children: [
{path: '', component: () => import('@/pages/rules/ListCharacterRuleBooks.vue')},
{path: '/characters/:characterId/rules', name: routeNames.characterRulebook, component: () => import('@/pages/rules/EditCharacterRuleBook.vue')},
]}
]}, ]},
{path: '/market', component: () => import('@/pages/Market.vue'), children: [ {path: '/market', component: () => import('@/pages/Market.vue'), children: [
{path: '', redirect: '/market/types'}, {path: '', redirect: '/market/types'},
{path: 'types/:type?', name: 'market-types', component: () => import('@/pages/market/TypeInfo.vue')}, {path: 'types/:type?', name: routeNames.marketTypes, component: () => import('@/pages/market/TypeInfo.vue')},
{path: 'tracking', component: () => import('@/pages/market/Tracking.vue')}, {path: 'tracking', component: () => import('@/pages/market/Tracking.vue')},
{path: 'acquisitions', component: () => import('@/pages/market/Acquisitions.vue')}, {path: 'acquisitions', component: () => import('@/pages/market/Acquisitions.vue')},
]}, ]},
@@ -25,5 +44,5 @@ export const routes: RouteRecordRaw[] = [
{path: '/tools', component: () => import('@/pages/Tools.vue')}, {path: '/tools', component: () => import('@/pages/Tools.vue')},
{path: '/characters', component: () => import('@/pages/Characters.vue')}, {path: '/characters', component: () => import('@/pages/Characters.vue')},
{path: '/about', name: 'about', component: () => import('@/pages/About.vue')}, {path: '/about', name: routeNames.about, component: () => import('@/pages/About.vue')},
]; ] as const;
+57
View File
@@ -0,0 +1,57 @@
<script setup lang="ts">
import {RuleClauseResponse} from "@/generated/mammon";
import {computed, watch} from "vue";
import {systemLedgerRef} from "@/ledger";
import {ratesTypes} from "@/rules/rules.ts";
interface Props {
ledgerRefs: string[];
}
const props = defineProps<Props>()
const rule = defineModel<RuleClauseResponse>({ default: {
rate: ratesTypes.None,
fromLedgerRef: systemLedgerRef,
toLedgerRef: systemLedgerRef,
}});
const ledgerRefsWithSystem = computed<string[]>(() => [systemLedgerRef, ...props.ledgerRefs])
watch(ledgerRefsWithSystem, (newVal, oldVal) => {
if (newVal.length !== oldVal.length) {
return;
}
if (rule.value.fromLedgerRef && rule.value.fromLedgerRef !== systemLedgerRef) {
rule.value.fromLedgerRef = newVal[oldVal.findIndex(v => v === rule.value.fromLedgerRef)]
}
if (rule.value.toLedgerRef && rule.value.toLedgerRef !== systemLedgerRef) {
rule.value.toLedgerRef = newVal[oldVal.findIndex(v => v === rule.value.toLedgerRef)]
}
})
</script>
<template>
From:
<select class="me-2 grow" v-model="rule.fromLedgerRef" :class="{'system-ledger': rule.fromLedgerRef === systemLedgerRef}">
<option v-for="l in ledgerRefsWithSystem" :key="l" :value="l" :class="{'system-ledger': l === systemLedgerRef}">{{ l }}</option>
</select>
To:
<select class="me-2 grow" v-model="rule.toLedgerRef" :class="{'system-ledger': rule.toLedgerRef === systemLedgerRef}">
<option v-for="l in ledgerRefsWithSystem" :key="l" :value="l" :class="{'system-ledger': l === systemLedgerRef}">{{ l }}</option>
</select>
At:
<select class="me-2 grow" v-model="rule.rate">
<option v-for="rateType in ratesTypes" :key="rateType.key" :value="rateType.key">{{ rateType.name }}</option>
</select>
</template>
<style scoped>
@reference "tailwindcss";
.system-ledger {
@apply text-emerald-400;
}
</style>
+65 -26
View File
@@ -1,37 +1,76 @@
<script setup lang="ts"> <script setup lang="ts">
import {RuleResponse} from "@/generated/mammon"; import {RuleClauseResponse, RuleClauseResponseRateEnum, RuleResponse} from "@/generated/mammon";
import {computed} from "vue"; import RuleClauseInput from "@/rules/RuleClauseInput.vue";
import {isMain, Ledger, LedgerSelect, systemLedger, useLedgersStore} from "@/ledger"; import {computed, useTemplateRef} from "vue";
import {ratesTypes} from "@/rules/rules.ts"; import {Bars4Icon, PlusIcon, TrashIcon} from '@heroicons/vue/24/outline';
import {useSortable} from "@vueuse/integrations/useSortable";
import {systemLedgerRef} from "@/ledger";
const rule = defineModel<RuleResponse>(); interface Props {
ledgerRefs: string[];
}
const ledgersStore = useLedgersStore(); const props = defineProps<Props>()
const {findById} = ledgersStore;
const ledgers = computed<Ledger[]>(() => [systemLedger, ...ledgersStore.ledgers.filter(isMain)]);
const ledgerComputed = (key: 'fromLedgerId' | 'toLedgerId') => computed<Ledger>({ const rule = defineModel<RuleResponse>({default: {clauses:[]}});
get: () => rule.value && rule.value[key] ? findById(rule.value[key]) ?? systemLedger : systemLedger, const clauses = computed<RuleClauseResponse[]>({
set: value => { get: () => rule.value && rule.value.clauses ? rule.value.clauses : [],
if (value) { set: value => rule.value = {clauses: value}
rule.value = {...rule.value, [key]: value.ledgerId.length ? value.ledgerId : undefined}
}
}
}) })
const fromLedger = ledgerComputed('fromLedgerId') const addClause = () => {
const toLedger = ledgerComputed('toLedgerId') clauses.value = [...clauses.value, {
rate: RuleClauseResponseRateEnum.None,
fromLedgerRef: systemLedgerRef,
toLedgerRef: systemLedgerRef
}]
}
const setClause = (index: number, clause?: RuleClauseResponse) => {
if (!clause) {
return;
}
clauses.value = clauses.value.with(index, clause)
}
const removeClause = (index: number) => {
clauses.value = clauses.value.toSpliced(index, 1)
}
const sortableContainer = useTemplateRef('sortable-container')
useSortable(sortableContainer, clauses, { handle: '.sortable-handle'});
</script> </script>
<template> <template>
From: <div class="flex-col">
<LedgerSelect class="me-2 grow" v-model="fromLedger" :ledgers="ledgers" /> <div ref="sortable-container" class="flex-col">
To: <div class="flex items-end gap-2 mt-2" v-for="(clause, index) in clauses" :key="index">
<LedgerSelect class="me-2 grow" v-model="toLedger" :ledgers="ledgers" /> <span class="sortable-handle flex">
At: <Bars4Icon class="w-6"/>
<select class="me-2 grow" v-model="rule.rate"> </span>
<option v-for="rateType in ratesTypes" :key="rateType.key" :value="rateType.key">{{ rateType.name }}</option> <RuleClauseInput :ledgerRefs="ledgerRefs" :modelValue="clause" @update:modelValue="v => setClause(index, v)" />
</select> <button class="btn-icon" @click="removeClause(index)"><TrashIcon /></button>
</template> </div>
</div>
<div class="flex justify-end mb-2 mt-2">
<button class="btn-icon" @click="addClause"><PlusIcon /></button>
</div>
</div>
</template>
<style scoped>
@reference "tailwindcss";
.sortable-handle {
@apply cursor-grab;
}
.sortable-chosen {
@apply cursor-grabbing;
}
.sortable-chosen .sortable-handle {
@apply cursor-grabbing;
}
</style>
-65
View File
@@ -1,65 +0,0 @@
<script setup lang="ts">
import {RuleResponse, RuleResponseRateEnum, RuleSetResponse} from "@/generated/mammon";
import RuleInput from "@/rules/RuleInput.vue";
import {computed, useTemplateRef} from "vue";
import {Bars4Icon, PlusIcon, TrashIcon} from '@heroicons/vue/24/outline';
import {useSortable} from "@vueuse/integrations/useSortable";
const ruleSet = defineModel<RuleSetResponse>();
const rules = computed<RuleResponse[]>({
get: () => ruleSet.value && ruleSet.value.rules ? ruleSet.value.rules : [],
set: value => ruleSet.value = {rules: value}
})
const addRule = () => {
rules.value = [...rules.value, {rate: RuleResponseRateEnum.None}]
}
const setRule = (index: number, rule?: RuleResponse) => {
if (!rule) {
return;
}
rules.value = rules.value.with(index, rule)
}
const removeRule = (index: number) => {
rules.value = rules.value.toSpliced(index, 1)
}
const sortableContainer = useTemplateRef('sortable-container')
useSortable(sortableContainer, rules, { handle: '.sortable-handle'});
</script>
<template>
<div class="flex-col">
<div ref="sortable-container" class="flex-col">
<div class="flex items-end gap-2 mt-2" v-for="(rule, index) in rules" :key="index">
<span class="sortable-handle flex">
<Bars4Icon class="w-6"/>
</span>
<RuleInput :modelValue="rule" @update:modelValue="v => setRule(index, v)" />
<button class="btn-icon" @click="removeRule(index)"><TrashIcon /></button>
</div>
</div>
<div class="flex justify-end mb-2 mt-2">
<button class="btn-icon" @click="addRule"><PlusIcon /></button>
</div>
</div>
</template>
<style scoped>
.sortable-handle {
@apply cursor-grab;
}
.sortable-chosen {
@apply cursor-grabbing;
}
.sortable-chosen .sortable-handle {
@apply cursor-grabbing;
}
</style>
+1 -1
View File
@@ -1,3 +1,3 @@
export * from "./rules"; export * from "./rules";
export {default as RuleSetInput} from './RuleSetInput.vue'; export {default as RuleInput} from './RuleInput.vue';
+49 -7
View File
@@ -1,16 +1,28 @@
import {ruleBookControllerApi} from "@/mammon"; import {characterRuleBookApi, ruleBookApi} from "@/mammon";
import {RuleBookResponse, RuleResponseRateEnum, RuleSetResponse} from "@/generated/mammon"; import {
CharacterRuleBookResponse,
CreateRuleBookRequest,
RuleBookResponse,
RuleClauseResponseRateEnum,
RuleResponse,
SetCharacterRuleBookRequest
} from "@/generated/mammon";
import {defineStore} from "pinia";
import {ref, triggerRef} from "vue";
export const activityTypes = { export const activityTypes = {
itemBought: {key: "ITEM_BOUGHT", name: "Item Bought"}, itemBought: {key: "ITEM_BOUGHT", name: "Item Bought"},
itemSold: {key: "ITEM_SOLD", name: "Item Sold"}, itemSold: {key: "ITEM_SOLD", name: "Item Sold"},
itemAcquiredManually: {key: "ITEM_ACQUIRED_MANUALLY", name: "Item Acquired Manually"},
itemConsumedManually: {key: "ITEM_CONSUME_MANUALLY", name: "Item Consumed Manually"},
// bountyEarned: {id: "BOUNTY_EARNED", name: "Bounty Earned"}, // bountyEarned: {id: "BOUNTY_EARNED", name: "Bounty Earned"},
// itemManufactured: {id: "ITEM_MANUFACTURED", name: "Item Manufactured"} // itemManufactured: {id: "ITEM_MANUFACTURED", name: "Item Manufactured"}
} as const; } as const;
export type Activity = { key: ActivityType, name: string } export type Activity = { key: ActivityType, name: string }
export type ActivityType = typeof activityTypes[keyof typeof activityTypes]['key']; export type ActivityType = typeof activityTypes[keyof typeof activityTypes]['key'];
export type RuleBook = RuleBookResponse & { ruleSets: { [key: ActivityType]: RuleSetResponse; } } export type Rules = { [key: ActivityType]: RuleResponse; };
export type RuleBook = RuleBookResponse & { rules: Rules }
export const ratesTypes = { export const ratesTypes = {
None: {key: "NONE", name: "0 ISK"}, None: {key: "NONE", name: "0 ISK"},
@@ -20,11 +32,41 @@ export const ratesTypes = {
EveEstimate: {key: "EVE_ESTIMATE", name: "Eve Estimate"}, EveEstimate: {key: "EVE_ESTIMATE", name: "Eve Estimate"},
} as const; } as const;
export type Rate = { key: RuleResponseRateEnum, name: string } export type Rate = { key: RuleClauseResponseRateEnum, name: string }
export const findByCharacterId = (characterId: number): Promise<RuleBook> => ruleBookControllerApi.findByCharacterId(characterId) export const useRuleBooksStore = defineStore('rule-books', () => {
const ruleBooks = ref<RuleBook[]>([]);
const addRuleBook = (ruleBook: RuleBook) => {
ruleBooks.value.push(ruleBook);
triggerRef(ruleBooks);
return ruleBook;
};
const replaceRuleBook = (ruleBook: RuleBook) => {
const index = ruleBooks.value.findIndex(rb => rb.ruleBookId === ruleBook.ruleBookId);
if (index !== -1) {
ruleBooks.value[index] = ruleBook;
}
triggerRef(ruleBooks);
return ruleBook;
};
const findById = (ruleBookId: string): RuleBook | undefined => ruleBooks.value.find(rb => rb.ruleBookId === ruleBookId);
const create = (ruleBook: CreateRuleBookRequest) => ruleBookApi.createRuleBook(ruleBook).then(response => addRuleBook(response.data));
const update = (ruleBookId: string, ruleBook: CreateRuleBookRequest) => ruleBookApi.updateRuleBook(ruleBookId, ruleBook).then(response => replaceRuleBook(response.data));
const refresh = () => ruleBookApi.findAllRuleBooks().then(response => ruleBooks.value = response.data as RuleBook[]);
refresh();
return {ruleBooks, findById, create, update, refresh};
})
export const findCharacterRuleBookByCharacterId = (characterId: number): Promise<CharacterRuleBookResponse> => characterRuleBookApi.findCharacterRuleBookByCharacterId(characterId)
.then(response => response.data) .then(response => response.data)
.catch(() => ({characterId, ruleSets: {}})); .catch(() => ({characterId, rules: {}}));
export const setCharacterRuleBook = (characterId: number, ruleBook: RuleBook): Promise<RuleBook> => ruleBookControllerApi.setCharacterRuleBook(characterId, ruleBook) export const setCharacterRuleBookForCharacter = (characterId: number, ruleBook: SetCharacterRuleBookRequest): Promise<CharacterRuleBookResponse> => characterRuleBookApi.setCharacterRuleBookForCharacter(characterId, ruleBook)
.then(response => response.data); .then(response => response.data);
+2 -1
View File
@@ -1,6 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import {Dropdown} from '@/components'; import {Dropdown} from '@/components';
import {RouterLink} from 'vue-router'; import {RouterLink} from 'vue-router';
import {routeNames} from '@/routes';
const links = [ const links = [
{name: "Ledger", path: "/ledgers"}, {name: "Ledger", path: "/ledgers"},
@@ -28,7 +29,7 @@ const logout = async () => {
<RouterLink class="sidebar-button py-0.5 px-2" to="/characters">Characters</RouterLink> <RouterLink class="sidebar-button py-0.5 px-2" to="/characters">Characters</RouterLink>
</li> </li>
<li> <li>
<RouterLink class="sidebar-button py-0.5 px-2" :to="{name: 'about'}">About EVE Online</RouterLink> <RouterLink class="sidebar-button py-0.5 px-2" :to="{name: routeNames.about}">About EVE Online</RouterLink>
</li> </li>
<li> <li>
<a class="sidebar-button py-0.5 px-2 text-amber-700" @click="logout">Logout</a> <a class="sidebar-button py-0.5 px-2 text-amber-700" @click="logout">Logout</a>
+9 -1
View File
@@ -72,9 +72,17 @@
} }
.btn-icon { .btn-icon {
@apply p-0 border-none bg-transparent hover:text-slate-400 hover:bg-transparent; @apply p-0 border-none bg-transparent hover:text-slate-400 hover:bg-transparent cursor-pointer;
> svg { > svg {
@apply w-6 h-6; @apply w-6 h-6;
} }
} }
a.tab {
@apply flex items-center px-4 me-2 rounded-t-md bg-slate-600 hover:bg-slate-700;
&.router-link-active {
@apply bg-emerald-500 hover:bg-emerald-700;
}
}
} }