Skip to content

Commit

Permalink
fix openapi spec, update scalar css
Browse files Browse the repository at this point in the history
  • Loading branch information
dromzeh committed May 5, 2024
1 parent 09cac3f commit 431c54d
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 135 deletions.
212 changes: 78 additions & 134 deletions src/openapi/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,137 +16,81 @@ export const OpenAPIConfig = {
}

export const CustomCSS: string = `
:root {
--theme-font: 'Inter', var(--system-fonts);
}
::moz-selection {
background: var(--theme-color-accent);
color: #fff;
}
::selection {
background: var(--theme-color-accent);
color: #fff;
}
/* basic theme */
.light-mode {
--theme-color-1: #2a2f45;
--theme-color-2: #757575;
--theme-color-3: #8e8e8e;
--theme-color-accent: #EA8FEA;
--theme-background-1: #fff;
--theme-background-2: #f6f6f6;
--theme-background-3: #e7e7e7;
--theme-background-accent: #8ab4f81f;
--theme-border-color: rgba(0, 0, 0, 0.1);
}
.dark-mode {
--theme-color-1: rgba(255, 255, 255, 0.9);
--theme-color-2: rgba(255, 255, 255, 0.62);
--theme-color-3: rgba(255, 255, 255, 0.44);
--theme-color-accent: #EA8FEA;
--theme-background-1: #09090B;
--theme-background-2: #111113;
--theme-background-3: #19191A;
--theme-background-accent: #8ab4f81f;
--theme-border-color: rgba(255, 255, 255, 0.1);
}
/* Document header */
.light-mode .t-doc__header {
--header-background-1: var(--theme-background-1);
--header-border-color: var(--theme-border-color);
--header-color-1: var(--theme-color-1);
--header-color-2: var(--theme-color-2);
--header-background-toggle: var(--theme-color-3);
--header-call-to-action-color: var(--theme-color-accent);
}
.dark-mode .t-doc__header {
--header-background-1: var(--theme-background-1);
--header-border-color: var(--theme-border-color);
--header-color-1: var(--theme-color-1);
--header-color-2: var(--theme-color-2);
--header-background-toggle: var(--theme-color-3);
--header-call-to-action-color: var(--theme-color-accent);
}
/* Document Sidebar */
.light-mode .t-doc__sidebar {
--sidebar-background-1: var(--theme-background-1);
--sidebar-item-hover-color: currentColor;
--sidebar-item-hover-background: var(--theme-background-2);
--sidebar-item-active-background: var(--theme-background-accent);
--sidebar-border-color: var(--theme-border-color);
--sidebar-color-1: var(--theme-color-1);
--sidebar-color-2: var(--theme-color-2);
--sidebar-color-active: var(--theme-color-accent);
--sidebar-search-background: transparent;
--sidebar-search-border-color: var(--theme-border-color);
--sidebar-search--color: var(--theme-color-3);
}
.dark-mode .sidebar {
--sidebar-background-1: var(--theme-background-1);
--sidebar-item-hover-color: currentColor;
--sidebar-item-hover-background: var(--theme-background-2);
--sidebar-item-active-background: var(--theme-background-accent);
--sidebar-border-color: var(--theme-border-color);
--sidebar-color-1: var(--theme-color-1);
--sidebar-color-2: var(--theme-color-2);
--sidebar-color-active: var(--theme-color-accent);
--sidebar-search-background: transparent;
--sidebar-search-border-color: var(--theme-border-color);
--sidebar-search--color: var(--theme-color-3);
}
.sidebar-heading-link {
font-weight: 600;
}
.item-entry-description {
color: rgba(255, 255, 255, 0.44) !important;
}
/* advanced */
.light-mode {
--theme-button-1: rgb(49 53 56);
--theme-button-1-color: #fff;
--theme-button-1-hover: rgb(28 31 33);
--theme-color-green: #C8FFD4;
--theme-color-red: #FF8080;
--theme-color-yellow: #edbe20;
--theme-color-blue: #B8E8FC;
--theme-color-orange: #FFCF96;
--theme-color-purple: #EA8FEA;
--theme-scrollbar-color: rgba(0, 0, 0, 0.18);
--theme-scrollbar-color-active: rgba(0, 0, 0, 0.36);
}
.dark-mode {
--theme-button-1: #f6f6f6;
--theme-button-1-color: #000;
--theme-button-1-hover: #e7e7e7;
--theme-color-green: #C8FFD4;
--theme-color-red: #FF8080;
--theme-color-yellow: #ffc90d;
--theme-color-blue: #B8E8FC;
--theme-color-orange: #FFCF96;
--theme-color-purple: #EA8FEA;
--theme-scrollbar-color: rgba(255, 255, 255, 0.24);
--theme-scrollbar-color-active: rgba(255, 255, 255, 0.48);
}
:root {
--theme-radius: 3px;
--theme-radius-lg: 6px;
--theme-radius-xl: 8px;
--theme-header-height: 50px;
}`
:root {
--scalar-font: 'Inter';
}
/* basic theme */
.light-mode {
--scalar-background-1: #fff;
--scalar-background-2: #f5f6f8;
--scalar-background-3: #e7e7e7;
--scalar-color-1: #2a2f45;
--scalar-color-2: #757575;
--scalar-color-3: #8e8e8e;
--scalar-color-accent: #EA8FEA;
--scalar-background-accent: #8ab4f81f;
--scalar-border-color: rgba(215, 215, 206, 0.5);
}
.dark-mode {
--scalar-background-1: #09090B;
--scalar-background-2: #111113;
--scalar-background-3: #19191A;
--scalar-color-1: rgba(255, 255, 255, 0.9);
--scalar-color-2: rgba(255, 255, 255, 0.62);
--scalar-color-3: rgba(255, 255, 255, 0.44);
--scalar-color-accent: #EA8FEA;
--scalar-background-accent: #8ab4f81f;
--scalar-border-color: rgba(255, 255, 255, 0.12);
}
/* Document header */
.light-mode .t-doc__header,
.dark-mode .t-doc__header {
--header-background-1: var(--scalar-background-1);
--header-border-color: var(--scalar-border-color);
--header-color-1: var(--scalar-color-1);
--header-color-2: var(--scalar-color-2);
--header-call-to-action-color: var(--scalar-color-accent);
}
/* Document Sidebar */
.light-mode .t-doc__sidebar,
.dark-mode .t-doc__sidebar {
--scalar-sidebar-background-1: var(--scalar-background-1);
--scalar-sidebar-color-1: var(--scalar-color-1);
--scalar-sidebar-color-2: var(--scalar-color-2);
--scalar-sidebar-border-color: var(--scalar-border-color);
--scalar-sidebar-item-hover-background: var(--scalar-background-3);
--scalar-sidebar-item-hover-color: currentColor;
--scalar-sidebar-item-active-background: var(--scalar-background-accent);
--scalar-sidebar-color-active: var(--scalar-color-accent);
--scalar-sidebar-search-background: var(--scalar-background-1);
--scalar-sidebar-search-color: var(--scalar-color-3);
--scalar-sidebar-search-border-color: var(--scalar-border-color);
}
/* advanced */
.light-mode {
--scalar-color-green: #C8FFD4;
--scalar-color-red: #FF8080;
--scalar-color-yellow: #edbe20;
--scalar-color-blue: #B8E8FC;
--scalar-color-orange: #FFCF96;
--scalar-color-purple: #EA8FEA;
}
.dark-mode {
--scalar-color-green: #C8FFD4;
--scalar-color-red: #FF8080;
--scalar-color-yellow: #ffc90d;
--scalar-color-blue: #B8E8FC;
--scalar-color-orange: #FFCF96;
--scalar-color-purple: #EA8FEA;
}
`
2 changes: 1 addition & 1 deletion src/v2/routes/asset/search-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const querySchema = z
param: {
description:
"The uploader usernames(s) of the asset(s) to retrieve. Comma seperated.",
name: "uploaders",
name: "uploader",
in: "query",
example: "user1,user2",
required: false,
Expand Down
11 changes: 11 additions & 0 deletions src/v2/routes/auth/account-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ const openRoute = createRoute({

export const UserCreateAccountRoute = (handler: AppHandler) => {
handler.openapi(openRoute, async (ctx) => {
const returnUnauth = true

if (returnUnauth) {
return ctx.json(
{
success: true,
},
401
)
}

const authSessionManager = new AuthSessionManager(ctx)

const { user } = await authSessionManager.validateSession()
Expand Down

0 comments on commit 431c54d

Please sign in to comment.