Compare commits
44 Commits
open-api
...
3737ceb33a
| Author | SHA1 | Date | |
|---|---|---|---|
| 3737ceb33a | |||
| 5ae114aeb1 | |||
| 0f30cdf8bb | |||
| a7905e4158 | |||
| 5c9c0cde60 | |||
| 7713c8e4ae | |||
| 9450d560c4 | |||
| fcd1e4c888 | |||
| 47c468bab6 | |||
| 1f0b08c122 | |||
| e6ccae9af3 | |||
| b3e4f76b18 | |||
| bff0b35c5f | |||
| bdeaa34851 | |||
| 7c2c6834c2 | |||
| 7dc4c9192b | |||
| e895602aa4 | |||
| 9c743ed514 | |||
| 520f59a0ca | |||
| ad8772d112 | |||
| c06b75ab96 | |||
| b0d66c9aa0 | |||
| 6b23bfb39f | |||
| 202959dd9e | |||
| 53fc2ed8fb | |||
| dfac93e1ff | |||
| fc95c3fdfd | |||
| 8c9d38de35 | |||
| 10d5edced9 | |||
| 855996486b | |||
| 9148bb3463 | |||
| edeffa7012 | |||
| 3d244e5e83 | |||
| 05f9255ef0 | |||
| c942450e86 | |||
| 00759473f2 | |||
| d9acd72d7b | |||
| 2639a5301a | |||
| 460b7aee72 | |||
| 3c393a1e0b | |||
| 0189b0db15 | |||
| 78b8c60329 | |||
| 48bbc03a91 | |||
| d493800226 |
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.gitignore
|
||||||
|
openapitools.json
|
||||||
|
README.md
|
||||||
|
.vscode
|
||||||
|
.idea
|
||||||
|
.gitea
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
name: Create and Push Release
|
name: Create and Push Release
|
||||||
|
run-name: Create and Push Release
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
@@ -13,6 +14,9 @@ jobs:
|
|||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Get version
|
- name: Get version
|
||||||
id: get-version
|
id: get-version
|
||||||
run: |
|
run: |
|
||||||
@@ -26,14 +30,16 @@ jobs:
|
|||||||
username: ${{ secrets.CI_SERVICE_ACCOUNT }}
|
username: ${{ secrets.CI_SERVICE_ACCOUNT }}
|
||||||
password: ${{ secrets.CI_SERVICE_ACCOUNT_PASSWORD }}
|
password: ${{ secrets.CI_SERVICE_ACCOUNT_PASSWORD }}
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Build & Push Image
|
- name: Build & Push Image
|
||||||
env:
|
env:
|
||||||
TAG: ${{ steps.get-version.outputs.version }}
|
TAG: ${{ steps.get-version.outputs.version }}
|
||||||
QUARKUS_CONTAINER_IMAGE_USERNAME: ${{ secrets.CI_SERVICE_ACCOUNT }}
|
QUARKUS_CONTAINER_IMAGE_USERNAME: ${{ secrets.CI_SERVICE_ACCOUNT }}
|
||||||
QUARKUS_CONTAINER_IMAGE_PASSWORD: ${{ secrets.CI_SERVICE_ACCOUNT_PASSWORD }}
|
QUARKUS_CONTAINER_IMAGE_PASSWORD: ${{ secrets.CI_SERVICE_ACCOUNT_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
docker build -t $REGISTRY_URL/$IMAGE_OWNER/$IMAGE_IMAGE:$TAG .
|
docker build -f docker/Dockerfile \
|
||||||
docker push $REGISTRY_URL/$IMAGE_OWNER/$IMAGE_IMAGE:$TAG
|
-t $REGISTRY_URL/$IMAGE_OWNER/$IMAGE_NAME:$TAG \
|
||||||
|
-t $REGISTRY_URL/$IMAGE_OWNER/$IMAGE_NAME:latest \
|
||||||
|
.
|
||||||
|
|
||||||
|
docker push $REGISTRY_URL/$IMAGE_OWNER/$IMAGE_NAME:$TAG
|
||||||
|
docker push $REGISTRY_URL/$IMAGE_OWNER/$IMAGE_NAME:latest
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,6 +6,7 @@ yarn-debug.log*
|
|||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
pnpm-debug.log*
|
pnpm-debug.log*
|
||||||
lerna-debug.log*
|
lerna-debug.log*
|
||||||
|
docker/docker-compose.yml
|
||||||
|
|
||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
|
|||||||
29
Dockerfile
29
Dockerfile
@@ -1,29 +0,0 @@
|
|||||||
# Stage 1: Build application
|
|
||||||
FROM node:22-bookworm-slim AS builder
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
COPY package*.json ./
|
|
||||||
RUN npm ci --omit=dev
|
|
||||||
COPY . .
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# Stage 2: Prepare static web server
|
|
||||||
FROM alpine:3.19 AS server-prep
|
|
||||||
RUN wget -O /tmp/sws.tar.gz \
|
|
||||||
https://github.com/static-web-server/static-web-server/releases/download/v2.17.0/static-web-server-v2.17.0-x86_64-unknown-linux-musl.tar.gz
|
|
||||||
RUN tar -xzf /tmp/sws.tar.gz -C /tmp \
|
|
||||||
--strip-components=1
|
|
||||||
|
|
||||||
# Stage 3: Create runtime image
|
|
||||||
FROM gcr.io/distroless/static-debian12:nonroot
|
|
||||||
|
|
||||||
COPY --from=builder --chown=nonroot:nonroot /app/dist /app
|
|
||||||
|
|
||||||
COPY --from=server-prep --chown=nonroot:nonroot /tmp/static-web-server /usr/local/bin/
|
|
||||||
|
|
||||||
USER nonroot
|
|
||||||
WORKDIR /app
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/static-web-server"]
|
|
||||||
CMD ["--port", "8080", "--root", "/app", "--log-level", "warn"]
|
|
||||||
36
docker/Dockerfile
Normal file
36
docker/Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
# Stage 1: Build application
|
||||||
|
FROM node:22-bookworm-slim AS builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm ci
|
||||||
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# Stage 2: Create runtime image
|
||||||
|
FROM nginxinc/nginx-unprivileged:1.25-alpine AS runtime
|
||||||
|
|
||||||
|
# Create writable directories
|
||||||
|
USER root
|
||||||
|
RUN mkdir -p /runtime-config && \
|
||||||
|
chown nginx:nginx /runtime-config && \
|
||||||
|
chown -R nginx:nginx /var/cache/nginx && \
|
||||||
|
chown -R nginx:nginx /var/run
|
||||||
|
USER nginx
|
||||||
|
|
||||||
|
# Copy built assets
|
||||||
|
COPY --from=builder --chown=nginx:nginx /app/dist /usr/share/nginx/html
|
||||||
|
|
||||||
|
# Copy nginx config template
|
||||||
|
COPY --chown=nginx:nginx nginx.conf.template /etc/nginx/templates/
|
||||||
|
|
||||||
|
# Copy entrypoint script
|
||||||
|
COPY --chown=nginx:nginx docker/entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
# Make entrypoint executable
|
||||||
|
USER root
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
USER nginx
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
48
docker/docker-compose.yml
Normal file
48
docker/docker-compose.yml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
services:
|
||||||
|
|
||||||
|
be:
|
||||||
|
image: gitea.smoothbrain.win/rak/dex:latest
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
environment:
|
||||||
|
QUARKUS_DATASOURCE_JDBC_URL:
|
||||||
|
QUARKUS_DATASOURCE_USERNAME:
|
||||||
|
QUARKUS_DATASOURCE_PASSWORD:
|
||||||
|
QUARKUS_OIDC_AUTH_SERVER_URL:
|
||||||
|
QUARKUS_OIDC_CLIENT_ID:
|
||||||
|
QUARKUS_OIDC_CREDENTIALS_SECRET:
|
||||||
|
QUARKUS_OIDC_TOKEN_AUDIENCE:
|
||||||
|
QUARKUS_OIDC_TOKEN_ISSUER:
|
||||||
|
QUARKUS_HTTP_INSECURE_REQUESTS: enabled
|
||||||
|
DEX_FILE_PATH:
|
||||||
|
networks:
|
||||||
|
- dex
|
||||||
|
|
||||||
|
frontend:
|
||||||
|
build:
|
||||||
|
context: ..
|
||||||
|
dockerfile: docker/Dockerfile
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
depends_on:
|
||||||
|
- be
|
||||||
|
environment:
|
||||||
|
API_HOST: be
|
||||||
|
API_PORT: 8080
|
||||||
|
networks:
|
||||||
|
- dex
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgres
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
POSTGRES_PASSWORD: dex
|
||||||
|
POSTGRES_DB: dex
|
||||||
|
POSTGRES_USER: dex
|
||||||
|
networks:
|
||||||
|
- dex
|
||||||
|
|
||||||
|
networks:
|
||||||
|
dex:
|
||||||
18
docker/entrypoint.sh
Normal file
18
docker/entrypoint.sh
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Create runtime config file in writable location
|
||||||
|
#cat > /runtime-config/config.js <<EOF
|
||||||
|
#window.__APP_CONFIG__ = {
|
||||||
|
# API_HOST: "${API_HOST}",
|
||||||
|
# API_PORT: "${API_PORT}"
|
||||||
|
#};
|
||||||
|
#EOF
|
||||||
|
|
||||||
|
# Generate nginx config from template (if using)
|
||||||
|
if [ -f "/etc/nginx/templates/nginx.conf.template" ]; then
|
||||||
|
envsubst '${API_HOST} ${API_PORT}' < /etc/nginx/templates/nginx.conf.template > /etc/nginx/nginx.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Start Nginx
|
||||||
|
exec nginx -g "daemon off;"
|
||||||
88
nginx.conf.template
Normal file
88
nginx.conf.template
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
# Main nginx configuration
|
||||||
|
worker_processes auto;
|
||||||
|
error_log /dev/stderr warn;
|
||||||
|
pid /tmp/nginx.pid; # Use writable location for PID
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
sendfile on;
|
||||||
|
keepalive_timeout 65;
|
||||||
|
access_log /dev/stdout;
|
||||||
|
client_body_temp_path /tmp/client_temp;
|
||||||
|
proxy_temp_path /tmp/proxy_temp;
|
||||||
|
fastcgi_temp_path /tmp/fastcgi_temp;
|
||||||
|
uwsgi_temp_path /tmp/uwsgi_temp;
|
||||||
|
scgi_temp_path /tmp/scgi_temp;
|
||||||
|
absolute_redirect off;
|
||||||
|
|
||||||
|
map $http_origin $cors_origin {
|
||||||
|
default "";
|
||||||
|
"~*" $http_origin;
|
||||||
|
}
|
||||||
|
|
||||||
|
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||||
|
|
||||||
|
upstream backend {
|
||||||
|
server ${API_HOST}:8080;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
# Handle client-side routing
|
||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
|
||||||
|
# Security headers
|
||||||
|
add_header X-Content-Type-Options nosniff;
|
||||||
|
add_header X-Frame-Options "DENY";
|
||||||
|
add_header Referrer-Policy "strict-origin-when-cross-origin";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Serve config.js from the writable location
|
||||||
|
location = /config.js {
|
||||||
|
alias /runtime-config/config.js;
|
||||||
|
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /api/ {
|
||||||
|
# Proxy to Quarkus
|
||||||
|
proxy_pass http://backend;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
|
||||||
|
# Relay CORS headers from the backend
|
||||||
|
proxy_pass_header Access-Control-Allow-Origin;
|
||||||
|
proxy_pass_header Access-Control-Allow-Methods;
|
||||||
|
proxy_pass_header Access-Control-Allow-Headers;
|
||||||
|
proxy_pass_header Access-Control-Allow-Credentials;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Cache static assets
|
||||||
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
||||||
|
expires 1y;
|
||||||
|
add_header Cache-Control "public, immutable";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Security headers
|
||||||
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||||
|
add_header X-Content-Type-Options "nosniff" always;
|
||||||
|
add_header Referrer-Policy "no-referrer-when-downgrade" always;
|
||||||
|
}
|
||||||
|
}
|
||||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -1,15 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "dex-ui-vue",
|
"name": "dex-ui-vue",
|
||||||
"version": "0.0.0",
|
"version": "0.0.14",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "dex-ui-vue",
|
"name": "dex-ui-vue",
|
||||||
"version": "0.0.0",
|
"version": "0.0.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@primeuix/themes": "^1.2.1",
|
"@primeuix/themes": "^1.2.1",
|
||||||
"@tailwindcss/vite": "^4.1.11",
|
"@tailwindcss/vite": "^4.1.11",
|
||||||
|
"@types/node": "^24.0.14",
|
||||||
"@vueuse/core": "^13.5.0",
|
"@vueuse/core": "^13.5.0",
|
||||||
"axios": "^1.10.0",
|
"axios": "^1.10.0",
|
||||||
"oidc-client-ts": "^3.3.0",
|
"oidc-client-ts": "^3.3.0",
|
||||||
@@ -23,7 +24,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@openapitools/openapi-generator-cli": "^2.20.2",
|
"@openapitools/openapi-generator-cli": "^2.20.2",
|
||||||
"@types/node": "^24.0.14",
|
|
||||||
"@vitejs/plugin-vue": "^6.0.0",
|
"@vitejs/plugin-vue": "^6.0.0",
|
||||||
"@vue/tsconfig": "^0.7.0",
|
"@vue/tsconfig": "^0.7.0",
|
||||||
"typescript": "~5.7.2",
|
"typescript": "~5.7.2",
|
||||||
@@ -1386,7 +1386,6 @@
|
|||||||
"version": "24.0.14",
|
"version": "24.0.14",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.14.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.14.tgz",
|
||||||
"integrity": "sha512-4zXMWD91vBLGRtHK3YbIoFMia+1nqEz72coM42C5ETjnNCa/heoj7NT1G67iAfOqMmcfhuCZ4uNpyz8EjlAejw==",
|
"integrity": "sha512-4zXMWD91vBLGRtHK3YbIoFMia+1nqEz72coM42C5ETjnNCa/heoj7NT1G67iAfOqMmcfhuCZ4uNpyz8EjlAejw==",
|
||||||
"devOptional": true,
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~7.8.0"
|
"undici-types": "~7.8.0"
|
||||||
@@ -4546,7 +4545,6 @@
|
|||||||
"version": "7.8.0",
|
"version": "7.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
|
||||||
"integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==",
|
"integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==",
|
||||||
"devOptional": true,
|
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/universalify": {
|
"node_modules/universalify": {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "dex-ui-vue",
|
"name": "dex-ui-vue",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.0",
|
"version": "0.0.14",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@primeuix/themes": "^1.2.1",
|
"@primeuix/themes": "^1.2.1",
|
||||||
"@tailwindcss/vite": "^4.1.11",
|
"@tailwindcss/vite": "^4.1.11",
|
||||||
|
"@types/node": "^24.0.14",
|
||||||
"@vueuse/core": "^13.5.0",
|
"@vueuse/core": "^13.5.0",
|
||||||
"axios": "^1.10.0",
|
"axios": "^1.10.0",
|
||||||
"oidc-client-ts": "^3.3.0",
|
"oidc-client-ts": "^3.3.0",
|
||||||
@@ -25,7 +26,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@openapitools/openapi-generator-cli": "^2.20.2",
|
"@openapitools/openapi-generator-cli": "^2.20.2",
|
||||||
"@types/node": "^24.0.14",
|
|
||||||
"@vitejs/plugin-vue": "^6.0.0",
|
"@vitejs/plugin-vue": "^6.0.0",
|
||||||
"@vue/tsconfig": "^0.7.0",
|
"@vue/tsconfig": "^0.7.0",
|
||||||
"typescript": "~5.7.2",
|
"typescript": "~5.7.2",
|
||||||
|
|||||||
4
public/config.template.js
Normal file
4
public/config.template.js
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
window.__RUNTIME_CONFIG__ = {
|
||||||
|
API_HOST: "__API_HOST__",
|
||||||
|
API_PORT: "__API_PORT__"
|
||||||
|
};
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex flex-col size-dvh">
|
<div class="flex flex-col size-full">
|
||||||
<!-- Navigator here -->
|
<!-- Navigator here -->
|
||||||
<Menubar
|
<Menubar
|
||||||
:model="items"
|
:model="items"
|
||||||
@@ -32,10 +32,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Menubar>
|
</Menubar>
|
||||||
<main class="app-main pt-[60px]">
|
<main class="app-main w-full pt-[60px]">
|
||||||
<Toast/>
|
<Toast/>
|
||||||
<RouterView/>
|
<RouterView/>
|
||||||
</main>
|
</main>
|
||||||
|
<footer class="fixed bottom-0 right-0">
|
||||||
|
v{{ version }}
|
||||||
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -44,6 +47,8 @@ import {ref} from "vue";
|
|||||||
import {useRouter} from "vue-router";
|
import {useRouter} from "vue-router";
|
||||||
import Toast from 'primevue/toast';
|
import Toast from 'primevue/toast';
|
||||||
import {useAuthStore} from "./stores/auth.ts";
|
import {useAuthStore} from "./stores/auth.ts";
|
||||||
|
// noinspection ES6UnusedImports Used in template
|
||||||
|
import { version } from '../package.json'
|
||||||
|
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
import axios from "axios";
|
|
||||||
import {userManager} from "../stores/auth.ts";
|
|
||||||
|
|
||||||
const axiosInstance = axios.create({
|
|
||||||
baseURL: import.meta.env.VITE_API_URL || 'http://localhost:8080'
|
|
||||||
})
|
|
||||||
|
|
||||||
axiosInstance.interceptors.request.use(async (config) => {
|
|
||||||
const user = await userManager.getUser()
|
|
||||||
if (user?.access_token) {
|
|
||||||
config.headers.Authorization = `Bearer ${user.access_token}`
|
|
||||||
}
|
|
||||||
return config
|
|
||||||
})
|
|
||||||
|
|
||||||
// Handle token expiration
|
|
||||||
axiosInstance.interceptors.response.use(
|
|
||||||
response => response,
|
|
||||||
async (error) => {
|
|
||||||
if (error.response?.status === 401) {
|
|
||||||
await userManager.signinRedirect()
|
|
||||||
}
|
|
||||||
return Promise.reject(error)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
export default axiosInstance;
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ All URIs are relative to *http://localhost*
|
|||||||
|------------- | ------------- | -------------|
|
|------------- | ------------- | -------------|
|
||||||
|[**apiSetsNameGet**](#apisetsnameget) | **GET** /api/sets/{name} | Find Set By Name|
|
|[**apiSetsNameGet**](#apisetsnameget) | **GET** /api/sets/{name} | Find Set By Name|
|
||||||
|[**apiSetsNameNewGet**](#apisetsnamenewget) | **GET** /api/sets/{name}/new | Fetch And Persist From Upstream|
|
|[**apiSetsNameNewGet**](#apisetsnamenewget) | **GET** /api/sets/{name}/new | Fetch And Persist From Upstream|
|
||||||
|[**apiSetsNameScrapeGet**](#apisetsnamescrapeget) | **GET** /api/sets/{name}/scrape | Scrape And Persist From Upstream|
|
|
||||||
|[**getCardSetPage**](#getcardsetpage) | **GET** /api/sets | Get a page of Card Sets with optional name query parameter|
|
|[**getCardSetPage**](#getcardsetpage) | **GET** /api/sets | Get a page of Card Sets with optional name query parameter|
|
||||||
|
|[**scrapeSetByName**](#scrapesetbyname) | **GET** /api/sets/{name}/scrape | Scrape a CardSet via name query parameter|
|
||||||
|
|
||||||
# **apiSetsNameGet**
|
# **apiSetsNameGet**
|
||||||
> SetDto apiSetsNameGet()
|
> SetDto apiSetsNameGet()
|
||||||
@@ -102,56 +102,6 @@ No authorization required
|
|||||||
- **Accept**: application/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
|
||||||
### HTTP response details
|
|
||||||
| Status code | Description | Response headers |
|
|
||||||
|-------------|-------------|------------------|
|
|
||||||
|**200** | Set retrieved | - |
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
# **apiSetsNameScrapeGet**
|
|
||||||
> apiSetsNameScrapeGet()
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import {
|
|
||||||
SetService,
|
|
||||||
Configuration
|
|
||||||
} from './api';
|
|
||||||
|
|
||||||
const configuration = new Configuration();
|
|
||||||
const apiInstance = new SetService(configuration);
|
|
||||||
|
|
||||||
let name: string; // (default to undefined)
|
|
||||||
|
|
||||||
const { status, data } = await apiInstance.apiSetsNameScrapeGet(
|
|
||||||
name
|
|
||||||
);
|
|
||||||
```
|
|
||||||
|
|
||||||
### Parameters
|
|
||||||
|
|
||||||
|Name | Type | Description | Notes|
|
|
||||||
|------------- | ------------- | ------------- | -------------|
|
|
||||||
| **name** | [**string**] | | defaults to undefined|
|
|
||||||
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
void (empty response body)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
No authorization required
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: Not defined
|
|
||||||
|
|
||||||
|
|
||||||
### HTTP response details
|
### HTTP response details
|
||||||
| Status code | Description | Response headers |
|
| Status code | Description | Response headers |
|
||||||
|-------------|-------------|------------------|
|
|-------------|-------------|------------------|
|
||||||
@@ -215,3 +165,53 @@ No authorization required
|
|||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
# **scrapeSetByName**
|
||||||
|
> scrapeSetByName()
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import {
|
||||||
|
SetService,
|
||||||
|
Configuration
|
||||||
|
} from './api';
|
||||||
|
|
||||||
|
const configuration = new Configuration();
|
||||||
|
const apiInstance = new SetService(configuration);
|
||||||
|
|
||||||
|
let name: string; // (default to undefined)
|
||||||
|
|
||||||
|
const { status, data } = await apiInstance.scrapeSetByName(
|
||||||
|
name
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
|Name | Type | Description | Notes|
|
||||||
|
|------------- | ------------- | ------------- | -------------|
|
||||||
|
| **name** | [**string**] | | defaults to undefined|
|
||||||
|
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
void (empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
|
||||||
|
### HTTP response details
|
||||||
|
| Status code | Description | Response headers |
|
||||||
|
|-------------|-------------|------------------|
|
||||||
|
|**200** | Set retrieved | - |
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* dex API
|
* dex API
|
||||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||||
*
|
*
|
||||||
* The version of the OpenAPI document: 0.0.1
|
* The version of the OpenAPI document: 0.0.6
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
@@ -90,40 +90,6 @@ export const SetServiceAxiosParamCreator = function (configuration?: Configurati
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
||||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
||||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
||||||
|
|
||||||
return {
|
|
||||||
url: toPathString(localVarUrlObj),
|
|
||||||
options: localVarRequestOptions,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary Scrape And Persist From Upstream
|
|
||||||
* @param {string} name
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
*/
|
|
||||||
apiSetsNameScrapeGet: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
||||||
// verify required parameter 'name' is not null or undefined
|
|
||||||
assertParamExists('apiSetsNameScrapeGet', 'name', name)
|
|
||||||
const localVarPath = `/api/sets/{name}/scrape`
|
|
||||||
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
|
|
||||||
// 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;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
@@ -169,6 +135,40 @@ export const SetServiceAxiosParamCreator = function (configuration?: Configurati
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: toPathString(localVarUrlObj),
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary Scrape a CardSet via name query parameter
|
||||||
|
* @param {string} name
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
scrapeSetByName: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
// verify required parameter 'name' is not null or undefined
|
||||||
|
assertParamExists('scrapeSetByName', 'name', name)
|
||||||
|
const localVarPath = `/api/sets/{name}/scrape`
|
||||||
|
.replace(`{${"name"}}`, encodeURIComponent(String(name)));
|
||||||
|
// 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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
@@ -214,19 +214,6 @@ export const SetServiceFp = function(configuration?: Configuration) {
|
|||||||
const localVarOperationServerBasePath = operationServerMap['SetService.apiSetsNameNewGet']?.[localVarOperationServerIndex]?.url;
|
const localVarOperationServerBasePath = operationServerMap['SetService.apiSetsNameNewGet']?.[localVarOperationServerIndex]?.url;
|
||||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary Scrape And Persist From Upstream
|
|
||||||
* @param {string} name
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
*/
|
|
||||||
async apiSetsNameScrapeGet(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
||||||
const localVarAxiosArgs = await localVarAxiosParamCreator.apiSetsNameScrapeGet(name, options);
|
|
||||||
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
||||||
const localVarOperationServerBasePath = operationServerMap['SetService.apiSetsNameScrapeGet']?.[localVarOperationServerIndex]?.url;
|
|
||||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary Get a page of Card Sets with optional name query parameter
|
* @summary Get a page of Card Sets with optional name query parameter
|
||||||
@@ -242,6 +229,19 @@ export const SetServiceFp = function(configuration?: Configuration) {
|
|||||||
const localVarOperationServerBasePath = operationServerMap['SetService.getCardSetPage']?.[localVarOperationServerIndex]?.url;
|
const localVarOperationServerBasePath = operationServerMap['SetService.getCardSetPage']?.[localVarOperationServerIndex]?.url;
|
||||||
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary Scrape a CardSet via name query parameter
|
||||||
|
* @param {string} name
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async scrapeSetByName(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
||||||
|
const localVarAxiosArgs = await localVarAxiosParamCreator.scrapeSetByName(name, options);
|
||||||
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
||||||
|
const localVarOperationServerBasePath = operationServerMap['SetService.scrapeSetByName']?.[localVarOperationServerIndex]?.url;
|
||||||
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -272,16 +272,6 @@ export const SetServiceFactory = function (configuration?: Configuration, basePa
|
|||||||
apiSetsNameNewGet(requestParameters: SetServiceApiSetsNameNewGetRequest, options?: RawAxiosRequestConfig): AxiosPromise<Array<SetDto>> {
|
apiSetsNameNewGet(requestParameters: SetServiceApiSetsNameNewGetRequest, options?: RawAxiosRequestConfig): AxiosPromise<Array<SetDto>> {
|
||||||
return localVarFp.apiSetsNameNewGet(requestParameters.name, options).then((request) => request(axios, basePath));
|
return localVarFp.apiSetsNameNewGet(requestParameters.name, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary Scrape And Persist From Upstream
|
|
||||||
* @param {SetServiceApiSetsNameScrapeGetRequest} requestParameters Request parameters.
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
*/
|
|
||||||
apiSetsNameScrapeGet(requestParameters: SetServiceApiSetsNameScrapeGetRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
|
||||||
return localVarFp.apiSetsNameScrapeGet(requestParameters.name, options).then((request) => request(axios, basePath));
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary Get a page of Card Sets with optional name query parameter
|
* @summary Get a page of Card Sets with optional name query parameter
|
||||||
@@ -292,6 +282,16 @@ export const SetServiceFactory = function (configuration?: Configuration, basePa
|
|||||||
getCardSetPage(requestParameters: SetServiceGetCardSetPageRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<PageSetDto> {
|
getCardSetPage(requestParameters: SetServiceGetCardSetPageRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise<PageSetDto> {
|
||||||
return localVarFp.getCardSetPage(requestParameters.name, requestParameters.page, requestParameters.pageSize, options).then((request) => request(axios, basePath));
|
return localVarFp.getCardSetPage(requestParameters.name, requestParameters.page, requestParameters.pageSize, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary Scrape a CardSet via name query parameter
|
||||||
|
* @param {SetServiceScrapeSetByNameRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
scrapeSetByName(requestParameters: SetServiceScrapeSetByNameRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
||||||
|
return localVarFp.scrapeSetByName(requestParameters.name, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -323,20 +323,6 @@ export interface SetServiceApiSetsNameNewGetRequest {
|
|||||||
readonly name: string
|
readonly name: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Request parameters for apiSetsNameScrapeGet operation in SetService.
|
|
||||||
* @export
|
|
||||||
* @interface SetServiceApiSetsNameScrapeGetRequest
|
|
||||||
*/
|
|
||||||
export interface SetServiceApiSetsNameScrapeGetRequest {
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @type {string}
|
|
||||||
* @memberof SetServiceApiSetsNameScrapeGet
|
|
||||||
*/
|
|
||||||
readonly name: string
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request parameters for getCardSetPage operation in SetService.
|
* Request parameters for getCardSetPage operation in SetService.
|
||||||
* @export
|
* @export
|
||||||
@@ -365,6 +351,20 @@ export interface SetServiceGetCardSetPageRequest {
|
|||||||
readonly pageSize?: number
|
readonly pageSize?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request parameters for scrapeSetByName operation in SetService.
|
||||||
|
* @export
|
||||||
|
* @interface SetServiceScrapeSetByNameRequest
|
||||||
|
*/
|
||||||
|
export interface SetServiceScrapeSetByNameRequest {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof SetServiceScrapeSetByName
|
||||||
|
*/
|
||||||
|
readonly name: string
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SetService - object-oriented interface
|
* SetService - object-oriented interface
|
||||||
* @export
|
* @export
|
||||||
@@ -396,18 +396,6 @@ export class SetService extends BaseAPI {
|
|||||||
return SetServiceFp(this.configuration).apiSetsNameNewGet(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
|
return SetServiceFp(this.configuration).apiSetsNameNewGet(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary Scrape And Persist From Upstream
|
|
||||||
* @param {SetServiceApiSetsNameScrapeGetRequest} requestParameters Request parameters.
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
* @memberof SetService
|
|
||||||
*/
|
|
||||||
public apiSetsNameScrapeGet(requestParameters: SetServiceApiSetsNameScrapeGetRequest, options?: RawAxiosRequestConfig) {
|
|
||||||
return SetServiceFp(this.configuration).apiSetsNameScrapeGet(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary Get a page of Card Sets with optional name query parameter
|
* @summary Get a page of Card Sets with optional name query parameter
|
||||||
@@ -419,5 +407,17 @@ export class SetService extends BaseAPI {
|
|||||||
public getCardSetPage(requestParameters: SetServiceGetCardSetPageRequest = {}, options?: RawAxiosRequestConfig) {
|
public getCardSetPage(requestParameters: SetServiceGetCardSetPageRequest = {}, options?: RawAxiosRequestConfig) {
|
||||||
return SetServiceFp(this.configuration).getCardSetPage(requestParameters.name, requestParameters.page, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
|
return SetServiceFp(this.configuration).getCardSetPage(requestParameters.name, requestParameters.page, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary Scrape a CardSet via name query parameter
|
||||||
|
* @param {SetServiceScrapeSetByNameRequest} requestParameters Request parameters.
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof SetService
|
||||||
|
*/
|
||||||
|
public scrapeSetByName(requestParameters: SetServiceScrapeSetByNameRequest, options?: RawAxiosRequestConfig) {
|
||||||
|
return SetServiceFp(this.configuration).scrapeSetByName(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
import type {UserManagerSettings} from "oidc-client-ts";
|
import type {UserManagerSettings} from "oidc-client-ts";
|
||||||
|
|
||||||
|
const redirectUri = import.meta.env.PROD
|
||||||
|
? "https://dex.smoothbrain.win"
|
||||||
|
: "http://localhost:5173";
|
||||||
|
|
||||||
export const oidcConfig: UserManagerSettings = {
|
export const oidcConfig: UserManagerSettings = {
|
||||||
authority: 'https://auth.smoothbrain.win/application/o/dex/',
|
authority: 'https://auth.smoothbrain.win/application/o/dex/',
|
||||||
client_id: 'K202NAqkgfjceLZr28gAVQgJDc6RjZfdrE1jNx0K',
|
client_id: 'K202NAqkgfjceLZr28gAVQgJDc6RjZfdrE1jNx0K',
|
||||||
redirect_uri: 'http://localhost:5173/callback',
|
redirect_uri: `${redirectUri}/callback`,
|
||||||
response_type: 'code',
|
response_type: 'code',
|
||||||
scope: 'openid profile email',
|
scope: 'openid profile email',
|
||||||
post_logout_redirect_uri: 'http://localhost:5173', // Homepage URL
|
post_logout_redirect_uri: redirectUri,
|
||||||
// automaticSilentRenew: true,
|
|
||||||
loadUserInfo: true,
|
loadUserInfo: true,
|
||||||
automaticSilentRenew: true,
|
automaticSilentRenew: true,
|
||||||
extraQueryParams: {
|
extraQueryParams: {
|
||||||
|
|||||||
8
src/components.d.ts
vendored
8
src/components.d.ts
vendored
@@ -11,19 +11,26 @@ declare module 'vue' {
|
|||||||
Avatar: typeof import('primevue/avatar')['default']
|
Avatar: typeof import('primevue/avatar')['default']
|
||||||
Badge: typeof import('primevue/badge')['default']
|
Badge: typeof import('primevue/badge')['default']
|
||||||
Button: typeof import('primevue/button')['default']
|
Button: typeof import('primevue/button')['default']
|
||||||
|
Card: typeof import('primevue/card')['default']
|
||||||
|
CardAttributes: typeof import('./components/CardAttributes.vue')['default']
|
||||||
CardFilterPanel: typeof import('./components/CardFilterPanel.vue')['default']
|
CardFilterPanel: typeof import('./components/CardFilterPanel.vue')['default']
|
||||||
CardListComponent: typeof import('./components/CardListComponent.vue')['default']
|
CardListComponent: typeof import('./components/CardListComponent.vue')['default']
|
||||||
CardListExpansion: typeof import('./components/CardListExpansion.vue')['default']
|
CardListExpansion: typeof import('./components/CardListExpansion.vue')['default']
|
||||||
|
CardSetImportModal: typeof import('./components/CardSetImportModal.vue')['default']
|
||||||
CardTable: typeof import('./components/CardTable.vue')['default']
|
CardTable: typeof import('./components/CardTable.vue')['default']
|
||||||
Carousel: typeof import('primevue/carousel')['default']
|
Carousel: typeof import('primevue/carousel')['default']
|
||||||
Column: typeof import('primevue/column')['default']
|
Column: typeof import('primevue/column')['default']
|
||||||
CustomTag: typeof import('./components/CustomTag.vue')['default']
|
CustomTag: typeof import('./components/CustomTag.vue')['default']
|
||||||
DataTable: typeof import('primevue/datatable')['default']
|
DataTable: typeof import('primevue/datatable')['default']
|
||||||
|
DataView: typeof import('primevue/dataview')['default']
|
||||||
|
Dialog: typeof import('primevue/dialog')['default']
|
||||||
Divider: typeof import('primevue/divider')['default']
|
Divider: typeof import('primevue/divider')['default']
|
||||||
DynamicAsset: typeof import('./components/DynamicAsset.vue')['default']
|
DynamicAsset: typeof import('./components/DynamicAsset.vue')['default']
|
||||||
Fieldset: typeof import('primevue/fieldset')['default']
|
Fieldset: typeof import('primevue/fieldset')['default']
|
||||||
FloatLabel: typeof import('primevue/floatlabel')['default']
|
FloatLabel: typeof import('primevue/floatlabel')['default']
|
||||||
Image: typeof import('primevue/image')['default']
|
Image: typeof import('primevue/image')['default']
|
||||||
|
InputGroup: typeof import('primevue/inputgroup')['default']
|
||||||
|
InputGroupAddon: typeof import('primevue/inputgroupaddon')['default']
|
||||||
InputNumber: typeof import('primevue/inputnumber')['default']
|
InputNumber: typeof import('primevue/inputnumber')['default']
|
||||||
InputText: typeof import('primevue/inputtext')['default']
|
InputText: typeof import('primevue/inputtext')['default']
|
||||||
LinkArrowsComponent: typeof import('./components/LinkArrowsComponent.vue')['default']
|
LinkArrowsComponent: typeof import('./components/LinkArrowsComponent.vue')['default']
|
||||||
@@ -39,5 +46,6 @@ declare module 'vue' {
|
|||||||
SplitButton: typeof import('primevue/splitbutton')['default']
|
SplitButton: typeof import('primevue/splitbutton')['default']
|
||||||
Tag: typeof import('primevue/tag')['default']
|
Tag: typeof import('primevue/tag')['default']
|
||||||
Textarea: typeof import('primevue/textarea')['default']
|
Textarea: typeof import('primevue/textarea')['default']
|
||||||
|
TreeTable: typeof import('primevue/treetable')['default']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
56
src/components/CardAttributes.vue
Normal file
56
src/components/CardAttributes.vue
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<template>
|
||||||
|
<div class="flex flex-wrap gap-4 justify-center">
|
||||||
|
<Tag
|
||||||
|
:value="card.cardType"
|
||||||
|
:severity="getCardSeverity(card.cardType)"
|
||||||
|
/>
|
||||||
|
<template v-if="isMonsterCard(card)">
|
||||||
|
<Tag
|
||||||
|
v-if="card.isPendulum"
|
||||||
|
value="PENDULUM"
|
||||||
|
:severity="getSeverityFromMonsterCardType(card.type)"
|
||||||
|
/>
|
||||||
|
<Tag
|
||||||
|
:value="card.type"
|
||||||
|
:severity="getSeverityFromMonsterCardType(card.type)"
|
||||||
|
/>
|
||||||
|
<Tag
|
||||||
|
v-for="subType in card.subTypes"
|
||||||
|
:value="subType"
|
||||||
|
severity="secondary"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-if="isSpellCard(card)">
|
||||||
|
<Tag
|
||||||
|
:value="card.type"
|
||||||
|
:severity="getSeverityFromSpellCardType(card.type)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-if="isTrapCard(card)">
|
||||||
|
<Tag
|
||||||
|
:value="card.type"
|
||||||
|
:severity="getSeverityFromTrapCardType(card.type)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</template><
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import type {Ref} from "vue";
|
||||||
|
import type {Card} from "@/api/openapi";
|
||||||
|
import {
|
||||||
|
getCardSeverity,
|
||||||
|
getSeverityFromMonsterCardType, getSeverityFromSpellCardType, getSeverityFromTrapCardType,
|
||||||
|
isMonsterCard,
|
||||||
|
isSpellCard,
|
||||||
|
isTrapCard
|
||||||
|
} from "@/util/card-type-util.ts";
|
||||||
|
|
||||||
|
const card: Ref<Card> = defineModel({
|
||||||
|
required: true
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>>`
|
||||||
@@ -2,10 +2,8 @@
|
|||||||
|
|
||||||
<Panel>
|
<Panel>
|
||||||
<ScrollPanel
|
<ScrollPanel
|
||||||
class="w-full"
|
|
||||||
style="height: 800px"
|
style="height: 800px"
|
||||||
>
|
>
|
||||||
|
|
||||||
<FloatLabel variant="on" class="my-2">
|
<FloatLabel variant="on" class="my-2">
|
||||||
<InputText
|
<InputText
|
||||||
fluid
|
fluid
|
||||||
|
|||||||
77
src/components/CardSetImportModal.vue
Normal file
77
src/components/CardSetImportModal.vue
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<template>
|
||||||
|
<Dialog
|
||||||
|
modal
|
||||||
|
:draggable="false"
|
||||||
|
:dismissable-mask="true"
|
||||||
|
:visible="visible"
|
||||||
|
@update:visible="emit('update:visible', $event)"
|
||||||
|
>
|
||||||
|
<template #header>
|
||||||
|
<div class="inline-flex items-center justify-center gap-2">
|
||||||
|
<span class="font-bold whitespace-nowrap">Import Set</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<span class="text-surface-500 dark:text-surface-400 block mb-8">Import a Set by its name</span>
|
||||||
|
<div class="flex items-center gap-4 mb-4">
|
||||||
|
<label for="setName" class="font-semibold w-24">Set Name</label>
|
||||||
|
<InputText id="setName" class="flex-auto" autocomplete="off" v-model="cardSetName"/>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<Button label="Cancel" text severity="secondary" @click="visible = false"/>
|
||||||
|
<Button label="Import" outlined severity="secondary" @click="importSet(cardSetName)"/>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import {inject, ref, type Ref, watch} from "vue";
|
||||||
|
import {SetService} from "@/api/openapi";
|
||||||
|
import {SetServiceKey} from "@/main.ts";
|
||||||
|
import {useToast} from "primevue";
|
||||||
|
|
||||||
|
const toast = useToast();
|
||||||
|
const emit = defineEmits(['update:visible'])
|
||||||
|
const visible: Ref<boolean> = defineModel("visible", {
|
||||||
|
required: true
|
||||||
|
})
|
||||||
|
|
||||||
|
const setService: SetService = inject(SetServiceKey) as SetService;
|
||||||
|
const cardSetName: Ref<string | null> = ref(null);
|
||||||
|
|
||||||
|
const importSet = async(name: string | null) => {
|
||||||
|
if (!name) {
|
||||||
|
toast.add({
|
||||||
|
severity: "warn",
|
||||||
|
summary: `Name of Set is required to import`,
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await setService.scrapeSetByName({
|
||||||
|
name: name,
|
||||||
|
});
|
||||||
|
|
||||||
|
toast.add({
|
||||||
|
severity: "info",
|
||||||
|
summary: `Import Job for Set '${cardSetName.value}' was started successfully`,
|
||||||
|
})
|
||||||
|
} catch (ex: unknown) {
|
||||||
|
toast.add({
|
||||||
|
severity: "error",
|
||||||
|
summary: `Error occurred trying to import Set '${cardSetName.value}'`,
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
cardSetName.value = null;
|
||||||
|
visible.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(visible, () => {
|
||||||
|
cardSetName.value = null;
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
54
src/main.ts
54
src/main.ts
@@ -10,7 +10,8 @@ import {
|
|||||||
AccordionContent,
|
AccordionContent,
|
||||||
AccordionHeader,
|
AccordionHeader,
|
||||||
AccordionPanel,
|
AccordionPanel,
|
||||||
DatePicker, Fluid,
|
DatePicker,
|
||||||
|
Fluid,
|
||||||
ToastService
|
ToastService
|
||||||
} from "primevue";
|
} from "primevue";
|
||||||
import {createPinia} from "pinia";
|
import {createPinia} from "pinia";
|
||||||
@@ -22,10 +23,15 @@ import DecksView from "./views/deck/DecksView.vue";
|
|||||||
import DeckView from "./views/deck/DeckView.vue";
|
import DeckView from "./views/deck/DeckView.vue";
|
||||||
import Callback from "./views/Callback.vue";
|
import Callback from "./views/Callback.vue";
|
||||||
import {useAuthStore} from "./stores/auth.ts";
|
import {useAuthStore} from "./stores/auth.ts";
|
||||||
import axiosInstance from "./api";
|
|
||||||
import SetsView from "./views/set/SetsView.vue";
|
import SetsView from "./views/set/SetsView.vue";
|
||||||
import JobsView from "./views/JobsView.vue";
|
import JobsView from "./views/JobsView.vue";
|
||||||
import {definePreset} from "@primeuix/themes";
|
import {definePreset} from "@primeuix/themes";
|
||||||
|
import {getConfig, initConfig} from "@/util/config.ts";
|
||||||
|
import axios from "axios";
|
||||||
|
import CreateDeckView from "@/views/deck/CreateDeckView.vue";
|
||||||
|
|
||||||
|
// Initialize configuration from window object
|
||||||
|
initConfig((window as any).__APP_CONFIG__ || {})
|
||||||
|
|
||||||
export const DeckServiceKey = Symbol("deckServiceKey")
|
export const DeckServiceKey = Symbol("deckServiceKey")
|
||||||
export const CardServiceKey = Symbol("cardServiceKey")
|
export const CardServiceKey = Symbol("cardServiceKey")
|
||||||
@@ -108,7 +114,8 @@ const routes: RouteRecordRaw[] = [
|
|||||||
{path: '/', component: HomeView},
|
{path: '/', component: HomeView},
|
||||||
{path: '/cards', component: CardsView, meta: {requiresAuth: false}},
|
{path: '/cards', component: CardsView, meta: {requiresAuth: false}},
|
||||||
{path: '/cards/:id', component: CardView, meta: {requiresAuth: true}},
|
{path: '/cards/:id', component: CardView, meta: {requiresAuth: true}},
|
||||||
{path: '/decks', component: DecksView, meta: {requiresAuth: true}},
|
{path: '/decks', component: DecksView, meta: {requiresAuth: false}},
|
||||||
|
{path: '/decks/create', component: CreateDeckView, meta: {requiresAuth: true}},
|
||||||
{path: '/decks/:id', component: DeckView, meta: {requiresAuth: true}},
|
{path: '/decks/:id', component: DeckView, meta: {requiresAuth: true}},
|
||||||
{path: '/sets', component: SetsView},
|
{path: '/sets', component: SetsView},
|
||||||
{path: '/sets/:id', component: DeckView, meta: {requiresAuth: true}},
|
{path: '/sets/:id', component: DeckView, meta: {requiresAuth: true}},
|
||||||
@@ -129,16 +136,47 @@ router.beforeEach(async (to) => {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
})
|
})
|
||||||
|
|
||||||
app.use(router);
|
app.use(router);
|
||||||
app.use(ToastService)
|
app.use(ToastService)
|
||||||
|
|
||||||
const deckService: DeckService = new DeckService(undefined, "http://localhost:8080", axiosInstance)
|
const apiUrl = import.meta.env.PROD
|
||||||
const cardService: CardService = new CardService(undefined, "http://localhost:8080", axiosInstance)
|
? "/"
|
||||||
const setService: SetService = new SetService(undefined, "http://localhost:8080", axiosInstance)
|
: `http://${getConfig().API_HOST}:${getConfig().API_PORT}`;
|
||||||
const cardPrintService: CardPrintService = new CardPrintService(undefined, "http://localhost:8080", axiosInstance)
|
|
||||||
const jobService: JobService = new JobService(undefined, "http://localhost:8080", axiosInstance)
|
const axiosInstance = axios.create({
|
||||||
|
baseURL: apiUrl,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
axiosInstance.interceptors.request.use(async (config) => {
|
||||||
|
const user = await userManager.getUser()
|
||||||
|
if (user?.access_token) {
|
||||||
|
config.headers.Authorization = `Bearer ${user.access_token}`
|
||||||
|
}
|
||||||
|
return config
|
||||||
|
})
|
||||||
|
|
||||||
|
// Handle token expiration
|
||||||
|
axiosInstance.interceptors.response.use(
|
||||||
|
response => response,
|
||||||
|
async (error) => {
|
||||||
|
if (error.response?.status === 401) {
|
||||||
|
await userManager.signinRedirect()
|
||||||
|
}
|
||||||
|
return Promise.reject(error)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
const deckService: DeckService = new DeckService(undefined, undefined, axiosInstance)
|
||||||
|
const cardService: CardService = new CardService(undefined, undefined, axiosInstance)
|
||||||
|
const setService: SetService = new SetService(undefined, undefined, axiosInstance)
|
||||||
|
const cardPrintService: CardPrintService = new CardPrintService(undefined, undefined, axiosInstance)
|
||||||
|
const jobService: JobService = new JobService(undefined, undefined, axiosInstance)
|
||||||
|
|
||||||
app.provide(DeckServiceKey, deckService)
|
app.provide(DeckServiceKey, deckService)
|
||||||
app.provide(CardServiceKey, cardService)
|
app.provide(CardServiceKey, cardService)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
body {
|
body {
|
||||||
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
|
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
width: 100%;
|
||||||
font-synthesis: none;
|
font-synthesis: none;
|
||||||
text-rendering: optimizeLegibility;
|
text-rendering: optimizeLegibility;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
import darkAttribute from "/src/assets/DARK.svg"
|
|
||||||
import divineAttribute from "/src/assets/DIVINE.svg"
|
|
||||||
import earthAttribute from "/src/assets/EARTH.svg"
|
|
||||||
import fireAttribute from "/src/assets/FIRE.svg"
|
|
||||||
import laughAttribute from "/src/assets/LAUGH.svg"
|
|
||||||
import lightAttribute from "/src/assets/LIGHT.svg"
|
|
||||||
import waterAttribute from "/src/assets/WATER.svg"
|
|
||||||
import windAttribute from "/src/assets/WIND.svg"
|
|
||||||
|
|
||||||
export {
|
|
||||||
darkAttribute,
|
|
||||||
divineAttribute,
|
|
||||||
earthAttribute,
|
|
||||||
fireAttribute,
|
|
||||||
laughAttribute,
|
|
||||||
lightAttribute,
|
|
||||||
waterAttribute,
|
|
||||||
windAttribute
|
|
||||||
}
|
|
||||||
@@ -24,6 +24,14 @@ export const isMonsterCard = (card: Card): card is MonsterCard => {
|
|||||||
return card.cardType === "MONSTER"
|
return card.cardType === "MONSTER"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const isSpellCard = (card: Card): card is SpellCard => {
|
||||||
|
return card.cardType === "SPELL"
|
||||||
|
}
|
||||||
|
|
||||||
|
export const isTrapCard = (card: Card): card is TrapCard => {
|
||||||
|
return card.cardType === "TRAP"
|
||||||
|
}
|
||||||
|
|
||||||
export const getMonsterCardType = (monsterCard: MonsterCard) => {
|
export const getMonsterCardType = (monsterCard: MonsterCard) => {
|
||||||
return `${monsterCard.type} MONSTER `
|
return `${monsterCard.type} MONSTER `
|
||||||
}
|
}
|
||||||
|
|||||||
20
src/util/config.ts
Normal file
20
src/util/config.ts
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
export interface AppConfig {
|
||||||
|
API_HOST: string;
|
||||||
|
API_PORT: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
let runtimeConfig: AppConfig = {
|
||||||
|
API_HOST: import.meta.env.VITE_API_HOST || '',
|
||||||
|
API_PORT: import.meta.env.VITE_API_PORT || 8080
|
||||||
|
};
|
||||||
|
|
||||||
|
export function initConfig(config: Partial<AppConfig>) {
|
||||||
|
runtimeConfig = {
|
||||||
|
...runtimeConfig,
|
||||||
|
...config
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getConfig(): AppConfig {
|
||||||
|
return runtimeConfig;
|
||||||
|
}
|
||||||
@@ -16,7 +16,7 @@ onMounted(async () => {
|
|||||||
await router.push('/'); // Redirect to home after login
|
await router.push('/'); // Redirect to home after login
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Login callback error:', error);
|
console.error('Login callback error:', error);
|
||||||
await router.push('/error'); // Handle errors
|
await router.push('/'); // Handle errors
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
||||||
import {type JobDto, JobService, JobType} from "../api/openapi";
|
import {type JobDto, JobService, JobType} from "@/api/openapi";
|
||||||
import {inject, onMounted, type Ref, ref} from "vue";
|
import {inject, onMounted, type Ref, ref} from "vue";
|
||||||
import {JobServiceKey} from "../main.ts";
|
import {JobServiceKey} from "../main.ts";
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex w-full min-h-content">
|
<div class="flex">
|
||||||
<Panel class="w-full m-4">
|
<Panel class="w-[50%] m-4">
|
||||||
<DataTable
|
<DataTable
|
||||||
class="my-4 ml-4 w-full"
|
|
||||||
tableStyle="min-width: 50rem"
|
|
||||||
dataKey="id"
|
dataKey="id"
|
||||||
paginator
|
paginator
|
||||||
lazy
|
lazy
|
||||||
@@ -44,33 +42,21 @@
|
|||||||
<!-- <Avatar image="https://upload.wikimedia.org/wikipedia/en/2/2b/Yugioh_Card_Back.jpg" class="mr-2" size="xlarge" shape="circle" />-->
|
<!-- <Avatar image="https://upload.wikimedia.org/wikipedia/en/2/2b/Yugioh_Card_Back.jpg" class="mr-2" size="xlarge" shape="circle" />-->
|
||||||
</template>
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
<Column field="name" header="Name">
|
<Column header="Name">
|
||||||
<template #body="slotProps">
|
<template #body="slotProps">
|
||||||
<p class="font-bold">
|
<div class="w-[50%]">
|
||||||
|
<p class="font-bold text-center">
|
||||||
{{ slotProps.data.name }}
|
{{ slotProps.data.name }}
|
||||||
</p>
|
</p>
|
||||||
|
<p class="text-muted-color text-center" v-if="isMonsterCard(slotProps.data)">
|
||||||
|
{{ slotProps.data.monsterType}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
<Column header="Card Type" filter>
|
<Column header="Attributes" class="w-[20%]">
|
||||||
<template #body="slotProps">
|
<template #body="slotProps">
|
||||||
<Tag
|
<CardAttributes v-model="slotProps.data"/>
|
||||||
:value="slotProps.data.cardType"
|
|
||||||
:severity="getCardSeverity(slotProps.data.cardType)"
|
|
||||||
></Tag>
|
|
||||||
</template>
|
|
||||||
</Column>
|
|
||||||
<Column header="Type">
|
|
||||||
<template #body="slotProps">
|
|
||||||
<Tag
|
|
||||||
v-if="slotProps.data.type !== 'FUSION'"
|
|
||||||
:value="slotProps.data.type"
|
|
||||||
:severity="getCardTypeSeverity(slotProps.data)"
|
|
||||||
/>
|
|
||||||
<CustomTag
|
|
||||||
v-else
|
|
||||||
color="purple"
|
|
||||||
:value="slotProps.data.type"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
<template #expansion="slotProps">
|
<template #expansion="slotProps">
|
||||||
@@ -81,17 +67,17 @@
|
|||||||
|
|
||||||
<CardFilterPanel
|
<CardFilterPanel
|
||||||
v-model="filters"
|
v-model="filters"
|
||||||
class="fixed right-0 w-[42%] m-4"
|
class="fixed right-0 w-content m-4 h-content"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import CardFilterPanel from "../../components/CardFilterPanel.vue";
|
import CardFilterPanel from "@/components/CardFilterPanel.vue";
|
||||||
import {getCardTypeSeverity, getCardSeverity} from "../../util/card-type-util.ts";
|
import {isMonsterCard} from "@/util/card-type-util.ts";
|
||||||
import {type Card, CardService, type CardServiceGetCardPageRequest} from "../../api/openapi";
|
import {type Card, CardService, type CardServiceGetCardPageRequest} from "@/api/openapi";
|
||||||
import {inject, onMounted, ref, type Ref, watch} from "vue";
|
import {inject, onMounted, ref, type Ref, watch} from "vue";
|
||||||
import {CardServiceKey} from "../../main.ts";
|
import {CardServiceKey} from "@/main.ts";
|
||||||
import type {
|
import type {
|
||||||
DataTableFilterEvent,
|
DataTableFilterEvent,
|
||||||
DataTablePageEvent,
|
DataTablePageEvent,
|
||||||
@@ -99,7 +85,7 @@ import type {
|
|||||||
DataTableSortEvent
|
DataTableSortEvent
|
||||||
} from "primevue";
|
} from "primevue";
|
||||||
import {useDebounceFn} from "@vueuse/core";
|
import {useDebounceFn} from "@vueuse/core";
|
||||||
import type {MutableCardRequest} from "../../api/mutableTypes.ts";
|
import type {MutableCardRequest} from "@/api/mutableTypes.ts";
|
||||||
|
|
||||||
const cardService: CardService = inject(CardServiceKey) as CardService;
|
const cardService: CardService = inject(CardServiceKey) as CardService;
|
||||||
|
|
||||||
@@ -143,7 +129,7 @@ const filters: Ref<MutableCardRequest> = ref({
|
|||||||
pageCount: 10
|
pageCount: 10
|
||||||
})
|
})
|
||||||
|
|
||||||
const getGetCardPage = async (filters: CardServiceGetCardPageRequest): Promise<void> => {
|
const getCardPage = async (filters: CardServiceGetCardPageRequest): Promise<void> => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const cardPage = (await cardService.getCardPage(filters)).data
|
const cardPage = (await cardService.getCardPage(filters)).data
|
||||||
|
|
||||||
@@ -156,7 +142,7 @@ const getGetCardPage = async (filters: CardServiceGetCardPageRequest): Promise<v
|
|||||||
const handlePaging = async (e: DataTablePageEvent) => {
|
const handlePaging = async (e: DataTablePageEvent) => {
|
||||||
filters.value.page = e.page;
|
filters.value.page = e.page;
|
||||||
filters.value.pageSize = e.rows
|
filters.value.pageSize = e.rows
|
||||||
await getGetCardPage(filters.value)
|
await getCardPage(filters.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSorting = (_: DataTableSortEvent) => {
|
const handleSorting = (_: DataTableSortEvent) => {
|
||||||
@@ -172,13 +158,13 @@ const handleRowSelect = (e: DataTableRowSelectEvent) => {
|
|||||||
console.log(JSON.stringify(e.data))
|
console.log(JSON.stringify(e.data))
|
||||||
}
|
}
|
||||||
|
|
||||||
const debouncedGetCardPage = useDebounceFn(getGetCardPage, 150)
|
const debouncedGetCardPage = useDebounceFn(getCardPage, 150)
|
||||||
|
|
||||||
watch(filters, async (newFiltersValue) => {
|
watch(filters, async (newFiltersValue) => {
|
||||||
await debouncedGetCardPage(newFiltersValue)
|
await debouncedGetCardPage(newFiltersValue)
|
||||||
})
|
})
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getGetCardPage(filters.value)
|
await getCardPage(filters.value)
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
283
src/views/deck/CreateDeckView.vue
Normal file
283
src/views/deck/CreateDeckView.vue
Normal file
@@ -0,0 +1,283 @@
|
|||||||
|
<template>
|
||||||
|
<div class="flex gap-4 m-4">
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-4 min-w-[40%]">
|
||||||
|
<Panel
|
||||||
|
header="Main Deck"
|
||||||
|
class="bg-primary-950 min-h-60"
|
||||||
|
@dragover.prevent
|
||||||
|
@drop="onDropToMainDeck"
|
||||||
|
>
|
||||||
|
<DataView
|
||||||
|
:value="mainDeck"
|
||||||
|
:pt="{
|
||||||
|
content: {
|
||||||
|
class: 'bg-inherit'
|
||||||
|
}
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<template #list="slotProps">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<div v-for="(card, index) in slotProps.items" :key="index">
|
||||||
|
<Card
|
||||||
|
:draggable="true"
|
||||||
|
class="text-lg font-medium mt-2"
|
||||||
|
@dragstart="onDragStart(card, 'deck')"
|
||||||
|
>
|
||||||
|
<template #content>
|
||||||
|
{{ card.name }}
|
||||||
|
<Button @click="removeFromDeck(card)">Remove</Button>
|
||||||
|
</template>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #empty>
|
||||||
|
Nope
|
||||||
|
</template>
|
||||||
|
</DataView>
|
||||||
|
</Panel>
|
||||||
|
|
||||||
|
<Panel
|
||||||
|
header="Extra Deck"
|
||||||
|
class="bg-indigo-950 min-h-60"
|
||||||
|
@dragover.prevent
|
||||||
|
@drop="onDropToExtraDeck"
|
||||||
|
>
|
||||||
|
<DataTable
|
||||||
|
:value="extraDeck"
|
||||||
|
:pt="{
|
||||||
|
emptyMessage: {
|
||||||
|
class: 'bg-indigo-950'
|
||||||
|
},
|
||||||
|
column: {
|
||||||
|
headerCell: {
|
||||||
|
class: 'bg-indigo-950 text-center'
|
||||||
|
},
|
||||||
|
columnHeaderContent: {
|
||||||
|
class: 'justify-center'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
bodyRow: {
|
||||||
|
class: 'bg-indigo-950 justify-center'
|
||||||
|
}
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<Column field="name" header="Card"/>
|
||||||
|
<Column header="Quantity" class="w-46">
|
||||||
|
<template #body>
|
||||||
|
<InputGroup class="w-full">
|
||||||
|
<InputGroupAddon>
|
||||||
|
<Button icon="pi pi-minus" severity="primary"/>
|
||||||
|
</InputGroupAddon>
|
||||||
|
<InputNumber :model-value="1"/>
|
||||||
|
<InputGroupAddon>
|
||||||
|
<Button icon="pi pi-plus" severity="primary"/>
|
||||||
|
</InputGroupAddon>
|
||||||
|
</InputGroup>
|
||||||
|
</template>
|
||||||
|
</Column>
|
||||||
|
<template #empty>
|
||||||
|
<div>
|
||||||
|
drag cards here senpai
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</DataTable>
|
||||||
|
</Panel>
|
||||||
|
|
||||||
|
<Panel
|
||||||
|
header="Side Deck"
|
||||||
|
class="bg-slate-800 min-h-50"
|
||||||
|
@dragover.prevent
|
||||||
|
@drop="onDropToSideDeck"
|
||||||
|
>
|
||||||
|
<DataView
|
||||||
|
:value="sideDeck"
|
||||||
|
:pt="{
|
||||||
|
content: {
|
||||||
|
class: 'bg-inherit'
|
||||||
|
}
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<template #list="slotProps">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<div v-for="(card, index) in slotProps.items" :key="index" class="flex flex-wrap">
|
||||||
|
<Card
|
||||||
|
:draggable="true"
|
||||||
|
class="text-lg font-medium mt-2 w-full"
|
||||||
|
@dragstart="onDragStart(card, 'deck')"
|
||||||
|
>
|
||||||
|
<template #content>
|
||||||
|
<div class="flex justify-between items-center gap-4">
|
||||||
|
<p>
|
||||||
|
{{ card.name }}
|
||||||
|
</p>
|
||||||
|
<InputGroup class="w-36">
|
||||||
|
<InputGroupAddon>
|
||||||
|
<Button icon="pi pi-minus" severity="primary"/>
|
||||||
|
</InputGroupAddon>
|
||||||
|
<InputNumber :model-value="1"/>
|
||||||
|
<InputGroupAddon>
|
||||||
|
<Button icon="pi pi-plus" severity="primary"/>
|
||||||
|
</InputGroupAddon>
|
||||||
|
</InputGroup>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #empty>
|
||||||
|
Nope
|
||||||
|
</template>
|
||||||
|
</DataView>
|
||||||
|
</Panel>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<Panel
|
||||||
|
header="Available Cards"
|
||||||
|
class="w-[50%] fixed right-0"
|
||||||
|
@dragover.prevent
|
||||||
|
@drop="onDropToPool"
|
||||||
|
>
|
||||||
|
<DataView :value="availableCards">
|
||||||
|
<template #list="slotProps">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<div v-for="(card, index) in slotProps.items" :key="index">
|
||||||
|
<Card
|
||||||
|
:draggable="true"
|
||||||
|
class="text-lg font-medium mt-2"
|
||||||
|
@dragstart="onDragStart(card, 'pool')"
|
||||||
|
>
|
||||||
|
<template #content>
|
||||||
|
{{ card.name }}
|
||||||
|
</template>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</DataView>
|
||||||
|
</Panel>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import {inject, onMounted, ref, type Ref} from "vue";
|
||||||
|
import {SetServiceKey} from "@/main.ts";
|
||||||
|
import {type Card, type SetDto, SetService} from "@/api/openapi";
|
||||||
|
|
||||||
|
const setService = inject(SetServiceKey) as SetService
|
||||||
|
const loading: Ref<boolean> = ref(false);
|
||||||
|
const decks: Ref<SetDto[]> = ref([]);
|
||||||
|
|
||||||
|
const page: Ref<number> = ref(0);
|
||||||
|
const pageSize: Ref<number> = ref(20);
|
||||||
|
const pageCount: Ref<number> = ref(0);
|
||||||
|
const totalRecords: Ref<number> = ref(0);
|
||||||
|
|
||||||
|
const getSetPage = async (page: number, pageSize: number): Promise<void> => {
|
||||||
|
loading.value = true;
|
||||||
|
const deckPage = (await setService.getCardSetPage({
|
||||||
|
page: page,
|
||||||
|
pageSize: pageSize
|
||||||
|
})).data
|
||||||
|
|
||||||
|
decks.value = deckPage.content
|
||||||
|
pageCount.value = deckPage.totalPages!!
|
||||||
|
totalRecords.value = deckPage.totalRecords!!
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await getSetPage(
|
||||||
|
page.value,
|
||||||
|
pageSize.value
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
// ----
|
||||||
|
// Initial card pool
|
||||||
|
const mainDeck: Ref<Card[]> = ref([])
|
||||||
|
const extraDeck: Ref<Card[]> = ref([])
|
||||||
|
const sideDeck: Ref<Card[]> = ref([])
|
||||||
|
|
||||||
|
const availableCards = ref([
|
||||||
|
{id: 1, name: 'Blue-Eyes White Dragon'},
|
||||||
|
{id: 2, name: 'Dark Magician'},
|
||||||
|
{id: 3, name: 'Red-Eyes Black Dragon'},
|
||||||
|
// ... more cards
|
||||||
|
])
|
||||||
|
|
||||||
|
// User's deck
|
||||||
|
|
||||||
|
// Track the dragged card and its origin
|
||||||
|
let draggedCard: Ref<Card | null> = ref(null)
|
||||||
|
let originPool: Ref<string | null> = ref(null)
|
||||||
|
|
||||||
|
function onDragStart(card: Card, from: string) {
|
||||||
|
draggedCard.value = card
|
||||||
|
originPool.value = from
|
||||||
|
}
|
||||||
|
|
||||||
|
function onDropToMainDeck() {
|
||||||
|
if (originPool.value === 'pool') {
|
||||||
|
// Prevent duplicates
|
||||||
|
if (draggedCard.value && !mainDeck.value.find(card => card.id === draggedCard.value?.id)) {
|
||||||
|
mainDeck.value.push(draggedCard.value)
|
||||||
|
}
|
||||||
|
} else if (originPool.value === 'deck') {
|
||||||
|
// Handle reordering within deck if desired
|
||||||
|
// For simplicity, no-op
|
||||||
|
}
|
||||||
|
resetDrag()
|
||||||
|
}
|
||||||
|
|
||||||
|
function onDropToExtraDeck() {
|
||||||
|
if (originPool.value === 'pool') {
|
||||||
|
// Prevent duplicates
|
||||||
|
if (draggedCard.value && !mainDeck.value.find(card => card.id === draggedCard.value?.id)) {
|
||||||
|
extraDeck.value.push(draggedCard.value)
|
||||||
|
}
|
||||||
|
} else if (originPool.value === 'deck') {
|
||||||
|
// Handle reordering within deck if desired
|
||||||
|
// For simplicity, no-op
|
||||||
|
}
|
||||||
|
resetDrag()
|
||||||
|
}
|
||||||
|
|
||||||
|
function onDropToSideDeck() {
|
||||||
|
if (originPool.value === 'pool') {
|
||||||
|
// Prevent duplicates
|
||||||
|
if (draggedCard.value && !mainDeck.value.find(card => card.id === draggedCard.value?.id)) {
|
||||||
|
sideDeck.value.push(draggedCard.value)
|
||||||
|
}
|
||||||
|
} else if (originPool.value === 'deck') {
|
||||||
|
// Handle reordering within deck if desired
|
||||||
|
// For simplicity, no-op
|
||||||
|
}
|
||||||
|
resetDrag()
|
||||||
|
}
|
||||||
|
|
||||||
|
function onDropToPool() {
|
||||||
|
if (originPool.value === 'deck') {
|
||||||
|
// Remove from deck and return to pool
|
||||||
|
mainDeck.value = mainDeck.value.filter(c => c.id !== draggedCard.value?.id)
|
||||||
|
}
|
||||||
|
resetDrag()
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeFromDeck(cardToRemove: Card) {
|
||||||
|
mainDeck.value = mainDeck.value.filter(card => card.id !== cardToRemove.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetDrag() {
|
||||||
|
draggedCard.value = null
|
||||||
|
originPool.value = null
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -1,73 +1,123 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="card">
|
<DataView :value="decks" :layout="layout">
|
||||||
<Carousel :value="decks" :numVisible="3" :numScroll="3">
|
<template #header>
|
||||||
<template #item="slotProps">
|
<div class="flex justify-end gap-4">
|
||||||
<div class="border border-surface-200 dark:border-surface-700 rounded m-2 p-4 w-96 h-auto">
|
<SelectButton v-model="layout" :options="layoutOptions" :allowEmpty="false">
|
||||||
<div class="mb-4">
|
<template #option="{ option }">
|
||||||
<div class="relative mx-auto">
|
<i :class="[option === 'list' ? 'pi pi-bars' : 'pi pi-table']" />
|
||||||
<img
|
</template>
|
||||||
:src="'https://upload.wikimedia.org/wikipedia/en/2/2b/Yugioh_Card_Back.jpg?20201122212343'"
|
</SelectButton>
|
||||||
class="w-full rounded"
|
<Button type="button" size="small" label="Build" icon="pi pi-plus" @click="router.push('/decks/create')"/>
|
||||||
alt="Deck"
|
</div>
|
||||||
/>
|
</template>
|
||||||
|
|
||||||
|
<template #list="slotProps">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<div v-for="(item, index) in slotProps.items" :key="index">
|
||||||
|
<div class="flex flex-col sm:flex-row sm:items-center p-6 gap-4" :class="{ 'border-t border-surface-200 dark:border-surface-700': index !== 0 }">
|
||||||
|
<div class="md:w-40 relative">
|
||||||
|
<img class="block xl:block mx-auto rounded w-full" src="https://m.media-amazon.com/images/I/81H7zpRNyRL.jpg" alt="peepee poopoo" />
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col md:flex-row justify-between md:items-center flex-1 gap-6">
|
||||||
|
<div class="flex flex-row md:flex-col justify-between items-start gap-2">
|
||||||
|
<div>
|
||||||
|
<span class="font-medium text-surface-500 dark:text-surface-400 text-sm">{{ item.category }}</span>
|
||||||
|
<div class="text-lg font-medium mt-2">{{ item.name }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="bg-surface-100 p-1" style="border-radius: 30px">
|
||||||
|
<div class="bg-surface-0 flex items-center gap-2 justify-center py-1 px-2" style="border-radius: 30px; box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.04), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)">
|
||||||
|
<span class="text-surface-900 font-medium text-sm">{{ item.rating }}</span>
|
||||||
|
<i class="pi pi-star-fill text-yellow-500"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col md:items-end gap-8">
|
||||||
|
<span class="text-xl font-semibold">${{ item.price }}</span>
|
||||||
|
<div class="flex flex-row-reverse md:flex-row gap-2">
|
||||||
|
<Button icon="pi pi-heart" outlined></Button>
|
||||||
|
<Button icon="pi pi-shopping-cart" label="Buy Now" :disabled="item.inventoryStatus === 'OUTOFSTOCK'" class="flex-auto md:flex-initial whitespace-nowrap"></Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-between ">
|
|
||||||
<p class="font-bold">
|
|
||||||
{{ slotProps.data.name }}
|
|
||||||
</p>
|
|
||||||
<Tag
|
|
||||||
value="[ARCHETYPE]"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify- items-center">
|
|
||||||
<SplitButton
|
|
||||||
label="View"
|
|
||||||
:model="deckMenuItems"
|
|
||||||
@click="viewDeck(slotProps.data.id)"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Carousel>
|
|
||||||
|
<template #grid="slotProps">
|
||||||
|
<div class="grid grid-cols-12 gap-4">
|
||||||
|
<div v-for="(deck, index) in slotProps.items" :key="index" class="col-span-12 sm:col-span-6 md:col-span-4 xl:col-span-6 p-2">
|
||||||
|
<div class="p-6 border border-surface-200 dark:border-surface-700 bg-surface-0 dark:bg-surface-900 rounded flex flex-col">
|
||||||
|
<div class="bg-surface-50 flex justify-center rounded p-4">
|
||||||
|
<div class="relative mx-auto">
|
||||||
|
<img class="rounded w-full" :src="`https://primefaces.org/cdn/primevue/images/product/${deck.image}`" :alt="deck.name" style="max-width: 300px"/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pt-6">
|
||||||
|
<div class="flex flex-row justify-between items-start gap-2">
|
||||||
|
<div>
|
||||||
|
<span class="font-medium text-surface-500 dark:text-surface-400 text-sm">[ARCHETYPE]</span>
|
||||||
|
<div class="text-lg font-medium mt-1">{{ deck.name }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="bg-surface-100 p-1" style="border-radius: 30px">
|
||||||
|
<div class="bg-surface-0 flex items-center gap-2 justify-center py-1 px-2" style="border-radius: 30px; box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.04), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)">
|
||||||
|
<span class="text-surface-900 font-medium text-sm">5</span>
|
||||||
|
<i class="pi pi-star-fill text-yellow-500"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col gap-6 mt-6">
|
||||||
|
<span class="text-2xl font-semibold">50€</span>
|
||||||
|
<div class="flex gap-2">
|
||||||
|
<Button icon="pi pi-shopping-cart" label="Buy Now" class="flex-auto whitespace-nowrap"></Button>
|
||||||
|
<Button icon="pi pi-heart" outlined></Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</DataView>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import {type Deck, DeckService} from "@/api/openapi";
|
||||||
import {type Deck, DeckService} from "../../api/openapi";
|
|
||||||
import {DeckServiceKey} from "../../main.ts";
|
|
||||||
import {inject, onMounted, ref, type Ref} from "vue";
|
import {inject, onMounted, ref, type Ref} from "vue";
|
||||||
import {useToast} from "primevue";
|
import {DeckServiceKey} from "@/main.ts";
|
||||||
import {useRouter} from "vue-router";
|
import {useRouter} from "vue-router";
|
||||||
|
|
||||||
const toast = useToast();
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
const layout: Ref<"grid" | "list"> = ref('grid');
|
||||||
|
const layoutOptions: Ref<string[]> = ref(['list', 'grid']);
|
||||||
|
const loading: Ref<boolean> = ref(false);
|
||||||
const deckService: DeckService = inject(DeckServiceKey) as DeckService;
|
const deckService: DeckService = inject(DeckServiceKey) as DeckService;
|
||||||
const decks: Ref<Deck[]> = ref([])
|
const decks: Ref<Deck[]> = ref([]);
|
||||||
|
|
||||||
const deckMenuItems = [
|
const page: Ref<number> = ref(0);
|
||||||
{
|
const pageSize: Ref<number> = ref(20);
|
||||||
label: 'Edit',
|
const pageCount: Ref<number> = ref(0);
|
||||||
command: () => {
|
const totalRecords: Ref<number> = ref(0);
|
||||||
toast.add({
|
|
||||||
severity: 'info',
|
|
||||||
summary: 'Not Implemented',
|
|
||||||
detail: 'Deck Editing isn\'t implemented yet',
|
|
||||||
life: 3000
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
const viewDeck = (deckId: number) => {
|
const getDeckPage = async (page: number, pageSize: number): Promise<void> => {
|
||||||
router.push(`/decks/${deckId}`);
|
loading.value = true;
|
||||||
|
const deckPage = (await deckService.getDecks({
|
||||||
|
page: page,
|
||||||
|
pageSize: pageSize
|
||||||
|
})).data
|
||||||
|
|
||||||
|
decks.value = deckPage.content
|
||||||
|
pageCount.value = deckPage.totalPages!!
|
||||||
|
totalRecords.value = deckPage.totalRecords!!
|
||||||
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted( async() => {
|
onMounted( async() => {
|
||||||
const decksResponse = await deckService.getDecks()
|
await getDeckPage(
|
||||||
|
page.value,
|
||||||
decks.value = decksResponse.data.content
|
pageSize.value
|
||||||
|
)
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<CardSetImportModal
|
||||||
|
:visible="importModalVisible"
|
||||||
|
@update:visible="args => importModalVisible = args"
|
||||||
|
/>
|
||||||
<DataTable
|
<DataTable
|
||||||
tableStyle="min-width: 50rem"
|
tableStyle="min-width: 50rem"
|
||||||
dataKey="id"
|
dataKey="id"
|
||||||
@@ -16,6 +20,11 @@
|
|||||||
@page="handlePaging"
|
@page="handlePaging"
|
||||||
@sort="handleSorting"
|
@sort="handleSorting"
|
||||||
>
|
>
|
||||||
|
<template #header>
|
||||||
|
<div class="flex justify-end">
|
||||||
|
<Button type="button" size="small" label="Import" icon="pi pi-download" @click="importModalVisible = true"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<Column header="Image">
|
<Column header="Image">
|
||||||
<template #body>
|
<template #body>
|
||||||
<Image alt="Image" preview class="h-64">
|
<Image alt="Image" preview class="h-64">
|
||||||
@@ -24,7 +33,9 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #image>
|
<template #image>
|
||||||
<div class="overflow-hidden">
|
<div class="overflow-hidden">
|
||||||
<img src="https://comicbook.com/wp-content/uploads/sites/4/2024/11/YuGiOh-Early-Days-Collection.png?resize=2000,1125" alt="image" width="650" height="650"/>
|
<img
|
||||||
|
src="https://comicbook.com/wp-content/uploads/sites/4/2024/11/YuGiOh-Early-Days-Collection.png?resize=2000,1125"
|
||||||
|
alt="image" width="650" height="650"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #preview="slotProps">
|
<template #preview="slotProps">
|
||||||
@@ -46,8 +57,8 @@
|
|||||||
</template>
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
<Column header="No. of Regional Sets">
|
<Column header="No. of Regional Sets">
|
||||||
<template #body="slotProps">
|
<template #body>
|
||||||
{{ slotProps.data.regionalSets.length }}
|
N/A
|
||||||
</template>
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
<template #footer> In total there are {{ sets ? sets.length : 0 }} Card Sets</template>
|
<template #footer> In total there are {{ sets ? sets.length : 0 }} Card Sets</template>
|
||||||
@@ -55,11 +66,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {type SetDto, SetService} from "../../api/openapi";
|
import {type SetDto, SetService} from "@/api/openapi";
|
||||||
import {inject, onMounted, ref, type Ref} from "vue";
|
import {inject, onMounted, ref, type Ref} from "vue";
|
||||||
import {SetServiceKey} from "../../main.ts";
|
import {SetServiceKey} from "@/main.ts";
|
||||||
import type {DataTablePageEvent, DataTableSortEvent} from "primevue";
|
import type {DataTablePageEvent, DataTableSortEvent} from "primevue";
|
||||||
|
|
||||||
|
const importModalVisible: Ref<boolean> = ref(false);
|
||||||
const setService: SetService = inject(SetServiceKey) as SetService;
|
const setService: SetService = inject(SetServiceKey) as SetService;
|
||||||
const loading: Ref<boolean> = ref(true);
|
const loading: Ref<boolean> = ref(true);
|
||||||
const sets: Ref<SetDto[]> = ref([])
|
const sets: Ref<SetDto[]> = ref([])
|
||||||
@@ -72,16 +84,16 @@ const first = ref(0);
|
|||||||
|
|
||||||
const fetchCardSetPage = async (page: number, pageSize: number): Promise<void> => {
|
const fetchCardSetPage = async (page: number, pageSize: number): Promise<void> => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const cardPage = (await setService.getCardSetPage({
|
const setPage = (await setService.getCardSetPage({
|
||||||
name: null,
|
name: null,
|
||||||
page: page,
|
page: page,
|
||||||
pageSize: pageSize
|
pageSize: pageSize
|
||||||
}
|
}
|
||||||
)).data
|
)).data
|
||||||
|
|
||||||
sets.value = cardPage.content
|
sets.value = setPage.content
|
||||||
pageCount.value = cardPage.totalPages!!
|
pageCount.value = setPage.totalPages!!
|
||||||
totalRecords.value = cardPage.totalRecords!!
|
totalRecords.value = setPage.totalRecords!!
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user