Compare commits
7 Commits
9acbc101e1
...
457d2a5161
| Author | SHA1 | Date | |
|---|---|---|---|
| 457d2a5161 | |||
| 1358aaa705 | |||
| d7bae268da | |||
| 9310397320 | |||
| ba81d7b6a8 | |||
| 676ff961ed | |||
| b40b58f866 |
+276
-121
@@ -6,10 +6,61 @@ servers:
|
||||
- url: http://localhost:8080
|
||||
description: Generated server url
|
||||
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}:
|
||||
put:
|
||||
tags:
|
||||
- ledger-controller
|
||||
- ledger
|
||||
operationId: updateMainLedger
|
||||
parameters:
|
||||
- name: ledgerId
|
||||
@@ -38,7 +89,7 @@ paths:
|
||||
/ledgers/combined/{ledgerId}:
|
||||
put:
|
||||
tags:
|
||||
- ledger-controller
|
||||
- ledger
|
||||
operationId: updateCombinedLedger
|
||||
parameters:
|
||||
- name: ledgerId
|
||||
@@ -64,67 +115,11 @@ paths:
|
||||
'*/*':
|
||||
schema:
|
||||
$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:
|
||||
get:
|
||||
tags:
|
||||
- rule-book-controller
|
||||
operationId: findByCharacterId
|
||||
- character-rule-book
|
||||
operationId: findCharacterRuleBookByCharacterId
|
||||
parameters:
|
||||
- name: characterId
|
||||
in: path
|
||||
@@ -142,11 +137,11 @@ paths:
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: "#/components/schemas/RuleBookResponse"
|
||||
post:
|
||||
$ref: "#/components/schemas/CharacterRuleBookResponse"
|
||||
put:
|
||||
tags:
|
||||
- rule-book-controller
|
||||
operationId: setCharacterRuleBook
|
||||
- character-rule-book
|
||||
operationId: setCharacterRuleBookForCharacter
|
||||
parameters:
|
||||
- name: characterId
|
||||
in: path
|
||||
@@ -160,6 +155,45 @@ paths:
|
||||
schema:
|
||||
$ref: "#/components/schemas/SetCharacterRuleBookRequest"
|
||||
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:
|
||||
"404":
|
||||
description: Not Found
|
||||
@@ -171,10 +205,66 @@ paths:
|
||||
'*/*':
|
||||
schema:
|
||||
$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}:
|
||||
post:
|
||||
tags:
|
||||
- activity-controller
|
||||
- activity
|
||||
operationId: fetchNewActivitiesForCharacter
|
||||
parameters:
|
||||
- name: characterId
|
||||
@@ -193,8 +283,8 @@ paths:
|
||||
/ledgers:
|
||||
get:
|
||||
tags:
|
||||
- ledger-controller
|
||||
operationId: findAll
|
||||
- ledger
|
||||
operationId: findAllLedgers
|
||||
responses:
|
||||
"404":
|
||||
description: Not Found
|
||||
@@ -213,8 +303,8 @@ paths:
|
||||
/ledgers/{ledgerId}:
|
||||
get:
|
||||
tags:
|
||||
- ledger-controller
|
||||
operationId: findById
|
||||
- ledger
|
||||
operationId: findLedgerById
|
||||
parameters:
|
||||
- name: ledgerId
|
||||
in: path
|
||||
@@ -238,8 +328,8 @@ paths:
|
||||
/characters:
|
||||
get:
|
||||
tags:
|
||||
- character-controller
|
||||
operationId: getCharacters
|
||||
- character
|
||||
operationId: findAllCharacters
|
||||
responses:
|
||||
"404":
|
||||
description: Not Found
|
||||
@@ -255,6 +345,72 @@ paths:
|
||||
$ref: "#/components/schemas/CharacterResponse"
|
||||
components:
|
||||
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:
|
||||
type: object
|
||||
properties:
|
||||
@@ -321,6 +477,55 @@ components:
|
||||
- ledgerId
|
||||
- memberLedgerIds
|
||||
- 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:
|
||||
type: object
|
||||
properties:
|
||||
@@ -341,56 +546,6 @@ components:
|
||||
required:
|
||||
- memberLedgerIds
|
||||
- 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:
|
||||
type: object
|
||||
discriminator:
|
||||
|
||||
+2
-1
@@ -2,11 +2,12 @@
|
||||
import { computed } from 'vue';
|
||||
import { RouterView, useRoute } from 'vue-router';
|
||||
import { Sidebar } from './sidebar';
|
||||
import { routeNames } from '@/routes';
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const hideSidebar = computed(() => {
|
||||
return route.name === 'callback' || route.name === 'about';
|
||||
return route.name === routeNames.callback || route.name === routeNames.about;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {activityControllerApi, characterControllerApi} from "@/mammon";
|
||||
import {activityApi, characterApi} from "@/mammon";
|
||||
import {defineStore} from "pinia";
|
||||
import {ref} from "vue";
|
||||
import {CharacterResponse} from "@/generated/mammon";
|
||||
@@ -18,9 +18,9 @@ export const useCharactersStore = defineStore('characters', () => {
|
||||
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();
|
||||
|
||||
|
||||
@@ -1,22 +1,37 @@
|
||||
<script setup lang="ts">
|
||||
import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/vue/24/outline';
|
||||
import { vOnClickOutside } from '@vueuse/components';
|
||||
import { useEventListener } from '@vueuse/core';
|
||||
import { ref } from 'vue';
|
||||
import {ChevronDownIcon, ChevronUpIcon} from '@heroicons/vue/24/outline';
|
||||
import {vOnClickOutside} from '@vueuse/components';
|
||||
import {useEventListener} from '@vueuse/core';
|
||||
import {ref} from 'vue';
|
||||
|
||||
interface Props {
|
||||
inline?: boolean;
|
||||
autoClose: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
inline: false,
|
||||
autoClose: true
|
||||
})
|
||||
|
||||
const isOpen = ref(false);
|
||||
|
||||
const doAutoClose = () => {
|
||||
if (props.autoClose) {
|
||||
isOpen.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
useEventListener('keyup', e => {
|
||||
if (e.key === 'Escape') {
|
||||
isOpen.value = false;
|
||||
doAutoClose();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<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">
|
||||
<slot name="button" />
|
||||
<Transition
|
||||
enter-active-class="transition-transform"
|
||||
enter-from-class="rotate-180"
|
||||
@@ -25,6 +40,7 @@ useEventListener('keyup', e => {
|
||||
<ChevronDownIcon v-if="!isOpen" class="chevron" />
|
||||
<ChevronUpIcon v-else class="chevron" />
|
||||
</Transition>
|
||||
<slot name="button" />
|
||||
</button>
|
||||
|
||||
<Transition
|
||||
@@ -32,7 +48,10 @@ useEventListener('keyup', e => {
|
||||
enter-from-class="opacity-0"
|
||||
leave-from-class="transition-opacity"
|
||||
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">
|
||||
<slot />
|
||||
</div>
|
||||
@@ -45,6 +64,6 @@ useEventListener('keyup', e => {
|
||||
@reference "tailwindcss";
|
||||
|
||||
.chevron {
|
||||
@apply w-4 h-4 ms-1;
|
||||
@apply w-4 h-4 me-1;
|
||||
}
|
||||
</style>
|
||||
|
||||
+449
-140
@@ -27,6 +27,11 @@ export interface CharacterResponse {
|
||||
'characterId': number;
|
||||
'name': string;
|
||||
}
|
||||
export interface CharacterRuleBookResponse {
|
||||
'characterId': number;
|
||||
'ruleBookId': string;
|
||||
'bindings': { [key: string]: string; };
|
||||
}
|
||||
export interface CombinedLedgerResponse extends LedgerResponse {
|
||||
'ledgerId': string;
|
||||
'name': string;
|
||||
@@ -48,10 +53,15 @@ export interface CreateCombinedLedgerRequest {
|
||||
export interface CreateMainLedgerRequest {
|
||||
'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 {
|
||||
'type'?: LedgerResponseTypeEnum;
|
||||
@@ -78,16 +88,18 @@ export const MainLedgerResponseTypeEnum = {
|
||||
export type MainLedgerResponseTypeEnum = typeof MainLedgerResponseTypeEnum[keyof typeof MainLedgerResponseTypeEnum];
|
||||
|
||||
export interface RuleBookResponse {
|
||||
'characterId': number;
|
||||
'ruleSets': { [key: string]: RuleSetResponse; };
|
||||
'ruleBookId': string;
|
||||
'name': string;
|
||||
'ledgerRefs': Array<string>;
|
||||
'rules': { [key: string]: RuleResponse; };
|
||||
}
|
||||
export interface RuleResponse {
|
||||
'rate': RuleResponseRateEnum;
|
||||
'fromLedgerId'?: string;
|
||||
'toLedgerId'?: string;
|
||||
export interface RuleClauseResponse {
|
||||
'rate': RuleClauseResponseRateEnum;
|
||||
'fromLedgerRef': string;
|
||||
'toLedgerRef': string;
|
||||
}
|
||||
|
||||
export const RuleResponseRateEnum = {
|
||||
export const RuleClauseResponseRateEnum = {
|
||||
None: 'NONE',
|
||||
Value: 'VALUE',
|
||||
JitaBuy: 'JITA_BUY',
|
||||
@@ -95,13 +107,14 @@ export const RuleResponseRateEnum = {
|
||||
EveEstimate: 'EVE_ESTIMATE',
|
||||
} as const;
|
||||
|
||||
export type RuleResponseRateEnum = typeof RuleResponseRateEnum[keyof typeof RuleResponseRateEnum];
|
||||
export type RuleClauseResponseRateEnum = typeof RuleClauseResponseRateEnum[keyof typeof RuleClauseResponseRateEnum];
|
||||
|
||||
export interface RuleSetResponse {
|
||||
'rules': Array<RuleResponse>;
|
||||
export interface RuleResponse {
|
||||
'clauses': Array<RuleClauseResponse>;
|
||||
}
|
||||
export interface SetCharacterRuleBookRequest {
|
||||
'ruleSets': { [key: string]: RuleSetResponse; };
|
||||
'ruleBookId': string;
|
||||
'bindings': { [key: string]: string; };
|
||||
}
|
||||
export interface UpdateCombinedLedgerRequest {
|
||||
'name': string;
|
||||
@@ -110,11 +123,16 @@ export interface UpdateCombinedLedgerRequest {
|
||||
export interface UpdateMainLedgerRequest {
|
||||
'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 {
|
||||
/**
|
||||
*
|
||||
@@ -152,10 +170,10 @@ export const ActivityControllerApiAxiosParamCreator = function (configuration?:
|
||||
};
|
||||
|
||||
/**
|
||||
* ActivityControllerApi - functional programming interface
|
||||
* ActivityApi - functional programming interface
|
||||
*/
|
||||
export const ActivityControllerApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosParamCreator = ActivityControllerApiAxiosParamCreator(configuration)
|
||||
export const ActivityApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosParamCreator = ActivityApiAxiosParamCreator(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
@@ -166,17 +184,17 @@ export const ActivityControllerApiFp = function(configuration?: Configuration) {
|
||||
async fetchNewActivitiesForCharacter(characterId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.fetchNewActivitiesForCharacter(characterId, options);
|
||||
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);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* ActivityControllerApi - factory interface
|
||||
* ActivityApi - factory interface
|
||||
*/
|
||||
export const ActivityControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = ActivityControllerApiFp(configuration)
|
||||
export const ActivityApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = ActivityApiFp(configuration)
|
||||
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
|
||||
@@ -201,23 +219,23 @@ export class ActivityControllerApi extends BaseAPI {
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
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 {
|
||||
/**
|
||||
*
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getCharacters: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
findAllCharacters: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/characters`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
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) {
|
||||
const localVarAxiosParamCreator = CharacterControllerApiAxiosParamCreator(configuration)
|
||||
export const CharacterApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosParamCreator = CharacterApiAxiosParamCreator(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async getCharacters(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<CharacterResponse>>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.getCharacters(options);
|
||||
async findAllCharacters(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<CharacterResponse>>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.findAllCharacters(options);
|
||||
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);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* CharacterControllerApi - factory interface
|
||||
* CharacterApi - factory interface
|
||||
*/
|
||||
export const CharacterControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = CharacterControllerApiFp(configuration)
|
||||
export const CharacterApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = CharacterApiFp(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getCharacters(options?: RawAxiosRequestConfig): AxiosPromise<Array<CharacterResponse>> {
|
||||
return localVarFp.getCharacters(options).then((request) => request(axios, basePath));
|
||||
findAllCharacters(options?: RawAxiosRequestConfig): AxiosPromise<Array<CharacterResponse>> {
|
||||
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.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
public getCharacters(options?: RawAxiosRequestConfig) {
|
||||
return CharacterControllerApiFp(this.configuration).getCharacters(options).then((request) => request(this.axios, this.basePath));
|
||||
public findAllCharacters(options?: RawAxiosRequestConfig) {
|
||||
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 {
|
||||
/**
|
||||
*
|
||||
@@ -375,7 +562,7 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
findAll: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
findAllLedgers: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/ledgers`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
@@ -405,9 +592,9 @@ export const LedgerControllerApiAxiosParamCreator = function (configuration?: Co
|
||||
* @param {*} [options] Override http request option.
|
||||
* @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
|
||||
assertParamExists('findById', 'ledgerId', ledgerId)
|
||||
assertParamExists('findLedgerById', 'ledgerId', ledgerId)
|
||||
const localVarPath = `/ledgers/{ledgerId}`
|
||||
.replace('{ledgerId}', encodeURIComponent(String(ledgerId)));
|
||||
// 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) {
|
||||
const localVarAxiosParamCreator = LedgerControllerApiAxiosParamCreator(configuration)
|
||||
export const LedgerApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosParamCreator = LedgerApiAxiosParamCreator(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
@@ -526,7 +713,7 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
|
||||
async createCombinedLedger(createCombinedLedgerRequest: CreateCombinedLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CombinedLedgerResponse>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.createCombinedLedger(createCombinedLedgerRequest, options);
|
||||
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);
|
||||
},
|
||||
/**
|
||||
@@ -538,7 +725,7 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
|
||||
async createMainLedger(createMainLedgerRequest: CreateMainLedgerRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MainLedgerResponse>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.createMainLedger(createMainLedgerRequest, options);
|
||||
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);
|
||||
},
|
||||
/**
|
||||
@@ -546,10 +733,10 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async findAll(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<FindAll200ResponseInner>>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.findAll(options);
|
||||
async findAllLedgers(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<FindAllLedgers200ResponseInner>>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.findAllLedgers(options);
|
||||
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);
|
||||
},
|
||||
/**
|
||||
@@ -558,10 +745,10 @@ export const LedgerControllerApiFp = function(configuration?: Configuration) {
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async findById(ledgerId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FindAll200ResponseInner>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.findById(ledgerId, options);
|
||||
async findLedgerById(ledgerId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FindAllLedgers200ResponseInner>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.findLedgerById(ledgerId, options);
|
||||
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);
|
||||
},
|
||||
/**
|
||||
@@ -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>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.updateCombinedLedger(ledgerId, updateCombinedLedgerRequest, options);
|
||||
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);
|
||||
},
|
||||
/**
|
||||
@@ -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>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.updateMainLedger(ledgerId, updateMainLedgerRequest, options);
|
||||
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);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* LedgerControllerApi - factory interface
|
||||
* LedgerApi - factory interface
|
||||
*/
|
||||
export const LedgerControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = LedgerControllerApiFp(configuration)
|
||||
export const LedgerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = LedgerApiFp(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
@@ -622,8 +809,8 @@ export const LedgerControllerApiFactory = function (configuration?: Configuratio
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
findAll(options?: RawAxiosRequestConfig): AxiosPromise<Array<FindAll200ResponseInner>> {
|
||||
return localVarFp.findAll(options).then((request) => request(axios, basePath));
|
||||
findAllLedgers(options?: RawAxiosRequestConfig): AxiosPromise<Array<FindAllLedgers200ResponseInner>> {
|
||||
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.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
findById(ledgerId: string, options?: RawAxiosRequestConfig): AxiosPromise<FindAll200ResponseInner> {
|
||||
return localVarFp.findById(ledgerId, options).then((request) => request(axios, basePath));
|
||||
findLedgerById(ledgerId: string, options?: RawAxiosRequestConfig): AxiosPromise<FindAllLedgers200ResponseInner> {
|
||||
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
|
||||
@@ -668,7 +855,7 @@ export class LedgerControllerApi extends BaseAPI {
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
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}
|
||||
*/
|
||||
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.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
public findAll(options?: RawAxiosRequestConfig) {
|
||||
return LedgerControllerApiFp(this.configuration).findAll(options).then((request) => request(this.axios, this.basePath));
|
||||
public findAllLedgers(options?: RawAxiosRequestConfig) {
|
||||
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.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
public findById(ledgerId: string, options?: RawAxiosRequestConfig) {
|
||||
return LedgerControllerApiFp(this.configuration).findById(ledgerId, options).then((request) => request(this.axios, this.basePath));
|
||||
public findLedgerById(ledgerId: string, options?: RawAxiosRequestConfig) {
|
||||
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}
|
||||
*/
|
||||
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}
|
||||
*/
|
||||
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 {
|
||||
/**
|
||||
*
|
||||
@@ -762,10 +949,10 @@ export const ProcessingControllerApiAxiosParamCreator = function (configuration?
|
||||
};
|
||||
|
||||
/**
|
||||
* ProcessingControllerApi - functional programming interface
|
||||
* ProcessingApi - functional programming interface
|
||||
*/
|
||||
export const ProcessingControllerApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosParamCreator = ProcessingControllerApiAxiosParamCreator(configuration)
|
||||
export const ProcessingApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosParamCreator = ProcessingApiAxiosParamCreator(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
@@ -775,17 +962,17 @@ export const ProcessingControllerApiFp = function(configuration?: Configuration)
|
||||
async processNewActivities(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.processNewActivities(options);
|
||||
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);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* ProcessingControllerApi - factory interface
|
||||
* ProcessingApi - factory interface
|
||||
*/
|
||||
export const ProcessingControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = ProcessingControllerApiFp(configuration)
|
||||
export const ProcessingApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = ProcessingApiFp(configuration)
|
||||
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.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
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 {
|
||||
/**
|
||||
*
|
||||
* @param {number} characterId
|
||||
* @param {CreateRuleBookRequest} createRuleBookRequest
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
findByCharacterId: async (characterId: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'characterId' is not null or undefined
|
||||
assertParamExists('findByCharacterId', 'characterId', characterId)
|
||||
const localVarPath = `/characters/{characterId}/rule-book`
|
||||
.replace('{characterId}', encodeURIComponent(String(characterId)));
|
||||
createRuleBook: async (createRuleBookRequest: CreateRuleBookRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'createRuleBookRequest' is not null or undefined
|
||||
assertParamExists('createRuleBook', 'createRuleBookRequest', createRuleBookRequest)
|
||||
const localVarPath = `/rule-books`;
|
||||
// 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.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
let baseOptions;
|
||||
@@ -854,18 +1071,15 @@ export const RuleBookControllerApiAxiosParamCreator = function (configuration?:
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @param {number} characterId
|
||||
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest
|
||||
* @param {string} ruleBookId
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
setCharacterRuleBook: async (characterId: number, setCharacterRuleBookRequest: SetCharacterRuleBookRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'characterId' is not null or undefined
|
||||
assertParamExists('setCharacterRuleBook', 'characterId', characterId)
|
||||
// verify required parameter 'setCharacterRuleBookRequest' is not null or undefined
|
||||
assertParamExists('setCharacterRuleBook', 'setCharacterRuleBookRequest', setCharacterRuleBookRequest)
|
||||
const localVarPath = `/characters/{characterId}/rule-book`
|
||||
.replace('{characterId}', encodeURIComponent(String(characterId)));
|
||||
findRuleBookById: async (ruleBookId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
// verify required parameter 'ruleBookId' is not null or undefined
|
||||
assertParamExists('findRuleBookById', 'ruleBookId', ruleBookId)
|
||||
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;
|
||||
@@ -873,7 +1087,43 @@ export const RuleBookControllerApiAxiosParamCreator = function (configuration?:
|
||||
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 localVarQueryParameter = {} as any;
|
||||
|
||||
@@ -883,7 +1133,7 @@ export const RuleBookControllerApiAxiosParamCreator = function (configuration?:
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||
localVarRequestOptions.data = serializeDataIfNeeded(setCharacterRuleBookRequest, localVarRequestOptions, configuration)
|
||||
localVarRequestOptions.data = serializeDataIfNeeded(updateRuleBookRequest, localVarRequestOptions, configuration)
|
||||
|
||||
return {
|
||||
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) {
|
||||
const localVarAxiosParamCreator = RuleBookControllerApiAxiosParamCreator(configuration)
|
||||
export const RuleBookApiFp = function(configuration?: Configuration) {
|
||||
const localVarAxiosParamCreator = RuleBookApiAxiosParamCreator(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @param {number} characterId
|
||||
* @param {CreateRuleBookRequest} createRuleBookRequest
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async findByCharacterId(characterId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RuleBookResponse>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.findByCharacterId(characterId, options);
|
||||
async createRuleBook(createRuleBookRequest: CreateRuleBookRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RuleBookResponse>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.createRuleBook(createRuleBookRequest, options);
|
||||
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);
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @param {number} characterId
|
||||
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async setCharacterRuleBook(characterId: number, setCharacterRuleBookRequest: SetCharacterRuleBookRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RuleBookResponse>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.setCharacterRuleBook(characterId, setCharacterRuleBookRequest, options);
|
||||
async findAllRuleBooks(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<RuleBookResponse>>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.findAllRuleBooks(options);
|
||||
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);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* RuleBookControllerApi - factory interface
|
||||
* RuleBookApi - factory interface
|
||||
*/
|
||||
export const RuleBookControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = RuleBookControllerApiFp(configuration)
|
||||
export const RuleBookApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
||||
const localVarFp = RuleBookApiFp(configuration)
|
||||
return {
|
||||
/**
|
||||
*
|
||||
* @param {number} characterId
|
||||
* @param {CreateRuleBookRequest} createRuleBookRequest
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
findByCharacterId(characterId: number, options?: RawAxiosRequestConfig): AxiosPromise<RuleBookResponse> {
|
||||
return localVarFp.findByCharacterId(characterId, options).then((request) => request(axios, basePath));
|
||||
createRuleBook(createRuleBookRequest: CreateRuleBookRequest, options?: RawAxiosRequestConfig): AxiosPromise<RuleBookResponse> {
|
||||
return localVarFp.createRuleBook(createRuleBookRequest, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @param {number} characterId
|
||||
* @param {SetCharacterRuleBookRequest} setCharacterRuleBookRequest
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
setCharacterRuleBook(characterId: number, setCharacterRuleBookRequest: SetCharacterRuleBookRequest, options?: RawAxiosRequestConfig): AxiosPromise<RuleBookResponse> {
|
||||
return localVarFp.setCharacterRuleBook(characterId, setCharacterRuleBookRequest, options).then((request) => request(axios, basePath));
|
||||
findAllRuleBooks(options?: RawAxiosRequestConfig): AxiosPromise<Array<RuleBookResponse>> {
|
||||
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.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
public findByCharacterId(characterId: number, options?: RawAxiosRequestConfig) {
|
||||
return RuleBookControllerApiFp(this.configuration).findByCharacterId(characterId, options).then((request) => request(this.axios, this.basePath));
|
||||
public createRuleBook(createRuleBookRequest: CreateRuleBookRequest, options?: RawAxiosRequestConfig) {
|
||||
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.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
public setCharacterRuleBook(characterId: number, setCharacterRuleBookRequest: SetCharacterRuleBookRequest, options?: RawAxiosRequestConfig) {
|
||||
return RuleBookControllerApiFp(this.configuration).setCharacterRuleBook(characterId, setCharacterRuleBookRequest, options).then((request) => request(this.axios, this.basePath));
|
||||
public findAllRuleBooks(options?: RawAxiosRequestConfig) {
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from "@/generated/mammon";
|
||||
import {defineStore} from "pinia";
|
||||
import {ref, triggerRef} from "vue";
|
||||
import {ledgerControllerApi} from "@/mammon";
|
||||
import {ledgerApi} from "@/mammon";
|
||||
|
||||
export const LedgerTypes = LedgerResponseTypeEnum;
|
||||
|
||||
@@ -20,6 +20,8 @@ export type MainLedger = MainLedgerResponse & {type: MainLedgerResponseTypeEnum}
|
||||
export type CombinedLedger = CombinedLedgerResponse & {type: CombinedLedgerResponseTypeEnum}
|
||||
export type Ledger = MainLedger | CombinedLedger;
|
||||
|
||||
|
||||
export const systemLedgerRef = 'system';
|
||||
export const systemLedger = {
|
||||
type: LedgerTypes.Main,
|
||||
ledgerId: "",
|
||||
@@ -57,12 +59,12 @@ export const useLedgersStore = defineStore('ledgers', () => {
|
||||
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 createMain = (ledger: CreateMainLedgerRequest) => ledgerControllerApi.createMainLedger(ledger).then(response => addLedger(response.data as Ledger));
|
||||
const createCombined = (ledger: CreateCombinedLedgerRequest) => ledgerControllerApi.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 updateCombined = (ledgerId: string, ledger: UpdateCombinedLedgerRequest) => ledgerControllerApi.updateCombinedLedger(ledgerId, ledger).then(response => replaceLedger(response.data as Ledger));
|
||||
const createMain = (ledger: CreateMainLedgerRequest) => ledgerApi.createMainLedger(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) => ledgerApi.updateMainLedger(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();
|
||||
|
||||
|
||||
+12
-10
@@ -1,11 +1,12 @@
|
||||
import {logResource} from "@/service";
|
||||
import axios from "axios";
|
||||
import {
|
||||
ActivityControllerApi,
|
||||
CharacterControllerApi,
|
||||
LedgerControllerApi,
|
||||
ProcessingControllerApi,
|
||||
RuleBookControllerApi
|
||||
ActivityApi,
|
||||
CharacterApi,
|
||||
CharacterRuleBookApi,
|
||||
LedgerApi,
|
||||
ProcessingApi,
|
||||
RuleBookApi
|
||||
} from "@/generated/mammon";
|
||||
|
||||
export const mammonUrl = import.meta.env.VITE_MAMMON_URL;
|
||||
@@ -20,8 +21,9 @@ const mammonAxiosInstance = axios.create({
|
||||
})
|
||||
logResource(mammonAxiosInstance)
|
||||
|
||||
export const ledgerControllerApi = new LedgerControllerApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
export const characterControllerApi = new CharacterControllerApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
export const ruleBookControllerApi = new RuleBookControllerApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
export const activityControllerApi = new ActivityControllerApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
export const processingControllerApi = new ProcessingControllerApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
export const ledgerApi = new LedgerApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
export const characterApi = new CharacterApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
export const ruleBookApi = new RuleBookApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
export const characterRuleBookApi = new CharacterRuleBookApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
export const activityApi = new ActivityApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
export const processingApi = new ProcessingApi(undefined, mammonUrl, mammonAxiosInstance);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ClipboardButton } from '@/components';
|
||||
import { InformationCircleIcon } from '@heroicons/vue/24/outline';
|
||||
import { routeNames } from '@/routes';
|
||||
|
||||
|
||||
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="" />
|
||||
<template v-if="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 />
|
||||
</RouterLink>
|
||||
<ClipboardButton v-if="!hideCopy" :value="name" />
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import {RouterView} from 'vue-router';
|
||||
import {CreateLedgerModal} from "@/ledger";
|
||||
import {ref} from "vue";
|
||||
import {processingControllerApi} from "@/mammon";
|
||||
import {processingApi} from "@/mammon";
|
||||
|
||||
const createLedgerModal = ref<typeof CreateLedgerModal>();
|
||||
</script>
|
||||
@@ -10,7 +10,7 @@ const createLedgerModal = ref<typeof CreateLedgerModal>();
|
||||
<template>
|
||||
<div class="mt-4">
|
||||
<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>
|
||||
</div>
|
||||
<CreateLedgerModal ref="createLedgerModal" />
|
||||
|
||||
+4
-15
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { RouterLink, RouterView } from 'vue-router';
|
||||
|
||||
import {RouterLink, RouterView} from 'vue-router';
|
||||
import {routeNames} from '@/routes';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mt-4">
|
||||
<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>
|
||||
</RouterLink>
|
||||
<RouterLink to="/market/tracking" class="tab">
|
||||
@@ -18,15 +18,4 @@ import { RouterLink, RouterView } from 'vue-router';
|
||||
</div>
|
||||
<RouterView />
|
||||
</div>
|
||||
</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>
|
||||
</template>
|
||||
+13
-2
@@ -1,7 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import {RouterLink, RouterView} from "vue-router";
|
||||
import {routeNames} from '@/routes';
|
||||
</script>
|
||||
|
||||
<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>
|
||||
@@ -7,6 +7,7 @@ import {BookmarkIcon, BookmarkSlashIcon, ShoppingCartIcon} from '@heroicons/vue/
|
||||
import log from "loglevel";
|
||||
import {computed, ref, watch} from "vue";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {routeNames} from "@/routes";
|
||||
import {computedAsync} from "@vueuse/core";
|
||||
|
||||
const buyModal = ref<typeof BuyModal>();
|
||||
@@ -52,7 +53,7 @@ const view = () => {
|
||||
}
|
||||
|
||||
router.push({
|
||||
name: 'market-types',
|
||||
name: routeNames.marketTypes,
|
||||
params: {
|
||||
type: inputItem.value.id
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
@@ -1,57 +1,120 @@
|
||||
<script setup lang="ts">
|
||||
import {Character, CharacterLabel, useCharactersStore} from "@/characters";
|
||||
import {useRoute} from "vue-router";
|
||||
import {ref, watch, watchEffect} from "vue";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {ref, watch} from "vue";
|
||||
import {useDebounceFn} from "@vueuse/core";
|
||||
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 character = ref<Character>();
|
||||
const ruleBookId = ref<string>();
|
||||
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 characterId = character.value?.characterId;
|
||||
const save = async () => {
|
||||
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) {
|
||||
ruleBook.value = await findByCharacterId(characterId);
|
||||
}
|
||||
});
|
||||
|
||||
const save = () => {
|
||||
const characterId = character.value?.characterId;
|
||||
|
||||
if (characterId && ruleBook.value) {
|
||||
setCharacterRuleBook(characterId, ruleBook.value);
|
||||
} else {
|
||||
await update(ruleBookId.value, {
|
||||
name: name.value,
|
||||
ledgerRefs: ledgerRefs.value,
|
||||
rules: rules.value
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
watch(useRoute(), async route => {
|
||||
if (route.params.characterId) {
|
||||
const id = parseInt(typeof route.params.characterId === 'string' ? route.params.characterId : route.params.characterId[0]);
|
||||
const addLedgerRef = () => {
|
||||
ledgerRefs.value = [...ledgerRefs.value, '']
|
||||
}
|
||||
const updateLedgerRef = useDebounceFn((index: number, value: string) => {
|
||||
ledgerRefs.value[index] = value;
|
||||
}, 500);
|
||||
|
||||
character.value = await findCharacterById(id);
|
||||
log.info('Loaded character:', character.value);
|
||||
const removeLedgerRef = (index: number) => {
|
||||
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 {
|
||||
character.value = undefined;
|
||||
log.info('No character to load');
|
||||
ruleBookId.value = undefined;
|
||||
name.value = '';
|
||||
ledgerRefs.value = [];
|
||||
rules.value = {};
|
||||
log.info('No rule book 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 class="grid mb-2 mt-4">
|
||||
<div class="flex flex-col">
|
||||
<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>
|
||||
<button @click="save">Save</button>
|
||||
</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>
|
||||
</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>
|
||||
@@ -1,17 +1,22 @@
|
||||
<script setup lang="ts">
|
||||
import {storeToRefs} from "pinia";
|
||||
import {CharacterLabel, useCharactersStore} from "@/characters";
|
||||
import {PencilSquareIcon} from "@heroicons/vue/24/outline";
|
||||
import {PencilSquareIcon, TrashIcon} from "@heroicons/vue/24/outline";
|
||||
import {useRuleBooksStore} from "@/rules";
|
||||
import {routeNames} from "@/routes";
|
||||
|
||||
const {characters} = storeToRefs(useCharactersStore());
|
||||
const {ruleBooks} = storeToRefs(useRuleBooksStore());
|
||||
|
||||
</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: 'character-rulebook', params: { characterId: character.characterId } }"><PencilSquareIcon /></RouterLink>
|
||||
<div class="flex justify-end border-b-1">
|
||||
<RouterLink class="button mb-2 ms-2" :to="{ name: routeNames.newRuleBook}">New Rule Book</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>
|
||||
</template>
|
||||
+26
-7
@@ -1,21 +1,40 @@
|
||||
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[] = [
|
||||
{path: '/', name: 'home', component: () => import('@/pages/Index.vue')},
|
||||
{path: '/callback', name: 'callback', component: () => import('@/pages/Index.vue')},
|
||||
{path: '/', name: routeNames.home, component: () => import('@/pages/Index.vue')},
|
||||
{path: '/callback', name: routeNames.callback, component: () => import('@/pages/Index.vue')},
|
||||
|
||||
{path: '/ledgers', component: () => import('@/pages/Ledgers.vue'), children: [
|
||||
{path: '', component: () => import('@/pages/ledger/ListLedgers.vue')},
|
||||
]},
|
||||
|
||||
{path: '/rules', component: () => import('@/pages/Rules.vue'), children: [
|
||||
{path: '', component: () => import('./pages/rules/ListRuleBooks.vue')},
|
||||
{path: '/characters/:characterId/rule-book', name: 'character-rulebook', component: () => import('@/pages/rules/EditRuleBook.vue')},
|
||||
{path: '', redirect: '/rule-books'},
|
||||
{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: '', 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: 'acquisitions', component: () => import('@/pages/market/Acquisitions.vue')},
|
||||
]},
|
||||
@@ -25,5 +44,5 @@ export const routes: RouteRecordRaw[] = [
|
||||
{path: '/tools', component: () => import('@/pages/Tools.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;
|
||||
@@ -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
@@ -1,37 +1,76 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import {RuleResponse} from "@/generated/mammon";
|
||||
import {computed} from "vue";
|
||||
import {isMain, Ledger, LedgerSelect, systemLedger, useLedgersStore} from "@/ledger";
|
||||
import {ratesTypes} from "@/rules/rules.ts";
|
||||
import {RuleClauseResponse, RuleClauseResponseRateEnum, RuleResponse} from "@/generated/mammon";
|
||||
import RuleClauseInput from "@/rules/RuleClauseInput.vue";
|
||||
import {computed, useTemplateRef} from "vue";
|
||||
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 {findById} = ledgersStore;
|
||||
const ledgers = computed<Ledger[]>(() => [systemLedger, ...ledgersStore.ledgers.filter(isMain)]);
|
||||
const props = defineProps<Props>()
|
||||
|
||||
const ledgerComputed = (key: 'fromLedgerId' | 'toLedgerId') => computed<Ledger>({
|
||||
get: () => rule.value && rule.value[key] ? findById(rule.value[key]) ?? systemLedger : systemLedger,
|
||||
set: value => {
|
||||
if (value) {
|
||||
rule.value = {...rule.value, [key]: value.ledgerId.length ? value.ledgerId : undefined}
|
||||
}
|
||||
}
|
||||
const rule = defineModel<RuleResponse>({default: {clauses:[]}});
|
||||
const clauses = computed<RuleClauseResponse[]>({
|
||||
get: () => rule.value && rule.value.clauses ? rule.value.clauses : [],
|
||||
set: value => rule.value = {clauses: value}
|
||||
})
|
||||
|
||||
const fromLedger = ledgerComputed('fromLedgerId')
|
||||
const toLedger = ledgerComputed('toLedgerId')
|
||||
const addClause = () => {
|
||||
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>
|
||||
|
||||
<template>
|
||||
From:
|
||||
<LedgerSelect class="me-2 grow" v-model="fromLedger" :ledgers="ledgers" />
|
||||
To:
|
||||
<LedgerSelect class="me-2 grow" v-model="toLedger" :ledgers="ledgers" />
|
||||
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>
|
||||
<div class="flex-col">
|
||||
<div ref="sortable-container" class="flex-col">
|
||||
<div class="flex items-end gap-2 mt-2" v-for="(clause, index) in clauses" :key="index">
|
||||
<span class="sortable-handle flex">
|
||||
<Bars4Icon class="w-6"/>
|
||||
</span>
|
||||
<RuleClauseInput :ledgerRefs="ledgerRefs" :modelValue="clause" @update:modelValue="v => setClause(index, v)" />
|
||||
<button class="btn-icon" @click="removeClause(index)"><TrashIcon /></button>
|
||||
</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>
|
||||
|
||||
@@ -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
@@ -1,3 +1,3 @@
|
||||
export * from "./rules";
|
||||
|
||||
export {default as RuleSetInput} from './RuleSetInput.vue';
|
||||
export {default as RuleInput} from './RuleInput.vue';
|
||||
+49
-7
@@ -1,16 +1,28 @@
|
||||
import {ruleBookControllerApi} from "@/mammon";
|
||||
import {RuleBookResponse, RuleResponseRateEnum, RuleSetResponse} from "@/generated/mammon";
|
||||
import {characterRuleBookApi, ruleBookApi} from "@/mammon";
|
||||
import {
|
||||
CharacterRuleBookResponse,
|
||||
CreateRuleBookRequest,
|
||||
RuleBookResponse,
|
||||
RuleClauseResponseRateEnum,
|
||||
RuleResponse,
|
||||
SetCharacterRuleBookRequest
|
||||
} from "@/generated/mammon";
|
||||
import {defineStore} from "pinia";
|
||||
import {ref, triggerRef} from "vue";
|
||||
|
||||
export const activityTypes = {
|
||||
itemBought: {key: "ITEM_BOUGHT", name: "Item Bought"},
|
||||
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"},
|
||||
// itemManufactured: {id: "ITEM_MANUFACTURED", name: "Item Manufactured"}
|
||||
} as const;
|
||||
|
||||
export type Activity = { key: ActivityType, name: string }
|
||||
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 = {
|
||||
None: {key: "NONE", name: "0 ISK"},
|
||||
@@ -20,11 +32,41 @@ export const ratesTypes = {
|
||||
EveEstimate: {key: "EVE_ESTIMATE", name: "Eve Estimate"},
|
||||
} 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)
|
||||
.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);
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import {Dropdown} from '@/components';
|
||||
import {RouterLink} from 'vue-router';
|
||||
import {routeNames} from '@/routes';
|
||||
|
||||
const links = [
|
||||
{name: "Ledger", path: "/ledgers"},
|
||||
@@ -28,7 +29,7 @@ const logout = async () => {
|
||||
<RouterLink class="sidebar-button py-0.5 px-2" to="/characters">Characters</RouterLink>
|
||||
</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>
|
||||
<a class="sidebar-button py-0.5 px-2 text-amber-700" @click="logout">Logout</a>
|
||||
|
||||
+9
-1
@@ -72,9 +72,17 @@
|
||||
}
|
||||
|
||||
.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 {
|
||||
@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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user