@elysiajs/swagger
Advanced tools
Comparing version 1.0.5 to 1.1.0-exp.0
@@ -1,2 +0,2 @@ | ||
import { type Elysia } from 'elysia'; | ||
import { Elysia } from 'elysia'; | ||
import type { ElysiaSwaggerConfig } from './types'; | ||
@@ -8,3 +8,3 @@ /** | ||
*/ | ||
export declare const swagger: <Path extends string = "/swagger">({ provider, scalarVersion, scalarCDN, scalarConfig, documentation, version, excludeStaticFile, path, exclude, swaggerOptions, theme, autoDarkMode, excludeMethods, excludeTags }?: ElysiaSwaggerConfig<Path>) => (app: Elysia) => Elysia<"", false, { | ||
export declare const swagger: <Path extends string = "/swagger">({ provider, scalarVersion, scalarCDN, scalarConfig, documentation, version, excludeStaticFile, path, exclude, swaggerOptions, theme, autoDarkMode, excludeMethods, excludeTags }?: ElysiaSwaggerConfig<Path>) => Elysia<"", false, { | ||
decorator: {}; | ||
@@ -20,11 +20,12 @@ store: {}; | ||
macro: {}; | ||
macroFn: {}; | ||
}, {}, { | ||
decorator: {}; | ||
store: {}; | ||
derive: {}; | ||
resolve: {}; | ||
schema: {}; | ||
}, { | ||
derive: {}; | ||
resolve: {}; | ||
schema: {}; | ||
macro: {}; | ||
}>; | ||
export default swagger; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.swagger = void 0; | ||
/* eslint-disable @typescript-eslint/ban-ts-comment */ | ||
const elysia_1 = require("elysia"); | ||
const swagger_1 = require("./swagger"); | ||
@@ -26,3 +28,3 @@ const scalar_1 = require("./scalar"); | ||
excludeTags: [] | ||
}) => (app) => { | ||
}) => { | ||
const schema = {}; | ||
@@ -39,29 +41,33 @@ let totalRoutes = 0; | ||
const relativePath = path.startsWith('/') ? path.slice(1) : path; | ||
app.get(path, () => { | ||
const combinedSwaggerOptions = { | ||
url: `${relativePath}/json`, | ||
dom_id: '#swagger-ui', | ||
...swaggerOptions | ||
}; | ||
const stringifiedSwaggerOptions = JSON.stringify(combinedSwaggerOptions, (key, value) => { | ||
if (typeof value == 'function') | ||
return undefined; | ||
return value; | ||
const combinedSwaggerOptions = { | ||
url: `${relativePath}/json`, | ||
dom_id: '#swagger-ui', | ||
...swaggerOptions | ||
}; | ||
const stringifiedSwaggerOptions = JSON.stringify(combinedSwaggerOptions, (key, value) => { | ||
if (typeof value == 'function') | ||
return undefined; | ||
return value; | ||
}); | ||
const scalarConfiguration = { | ||
spec: { | ||
...scalarConfig.spec, | ||
url: `${relativePath}/json` | ||
}, | ||
...scalarConfig | ||
}; | ||
// ? This is intentional to prevent deeply nested type | ||
const app = new elysia_1.Elysia({ name: '@elysiajs/swagger' }); | ||
app.get(path, new Response(provider === 'swagger-ui' | ||
? (0, swagger_1.SwaggerUIRender)(info, version, theme, stringifiedSwaggerOptions, autoDarkMode) | ||
: (0, scalar_1.ScalarRender)(scalarVersion, scalarConfiguration, scalarCDN), { | ||
headers: { | ||
'content-type': 'text/html; charset=utf8' | ||
} | ||
})).get(path === '/' ? '/json' : `${path}/json`, () => { | ||
// @ts-expect-error private property | ||
const routes = app.getGlobalRoutes() ?? []; | ||
console.log({ | ||
routes | ||
}); | ||
const scalarConfiguration = { | ||
spec: { | ||
...scalarConfig.spec, | ||
url: `${relativePath}/json`, | ||
}, | ||
...scalarConfig | ||
}; | ||
return new Response(provider === 'swagger-ui' | ||
? (0, swagger_1.SwaggerUIRender)(info, version, theme, stringifiedSwaggerOptions, autoDarkMode) | ||
: (0, scalar_1.ScalarRender)(scalarVersion, scalarConfiguration, scalarCDN), { | ||
headers: { | ||
'content-type': 'text/html; charset=utf8' | ||
} | ||
}); | ||
}).get(path === '/' ? '/json' : `${path}/json`, () => { | ||
const routes = app.routes; | ||
if (routes.length !== totalRoutes) { | ||
@@ -95,3 +101,4 @@ totalRoutes = routes.length; | ||
}, | ||
paths: { ...(0, utils_1.filterPaths)(schema, { | ||
paths: { | ||
...(0, utils_1.filterPaths)(schema, { | ||
excludeStaticFile, | ||
@@ -112,3 +119,2 @@ exclude: Array.isArray(exclude) ? exclude : [exclude] | ||
}); | ||
// This is intentional to prevent deeply nested type | ||
return app; | ||
@@ -115,0 +121,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
declare const _default: "\n/* basic theme */\n.light-mode {\n --theme-color-1: #2a2f45;\n --theme-color-2: #757575;\n --theme-color-3: #8e8e8e;\n --theme-color-accent: #f06292;\n\n --theme-background-1: #fff;\n --theme-background-2: #f6f6f6;\n --theme-background-3: #e7e7e7;\n --theme-background-accent: #f062921f;\n\n --theme-border-color: rgba(0, 0, 0, 0.1);\n}\n.dark-mode {\n --theme-color-1: rgba(255, 255, 255, 0.9);\n --theme-color-2: rgba(156, 163, 175, 1);\n --theme-color-3: rgba(255, 255, 255, 0.44);\n --theme-color-accent: #f06292;\n\n --theme-background-1: #111728;\n --theme-background-2: #1e293b;\n --theme-background-3: #334155;\n --theme-background-accent: #f062921f;\n\n --theme-border-color: rgba(255, 255, 255, 0.1);\n}\n/* Document Sidebar */\n.light-mode .sidebar,\n.dark-mode .sidebar {\n --sidebar-background-1: var(--theme-background-1);\n --sidebar-item-hover-color: currentColor;\n --sidebar-item-hover-background: var(--theme-background-2);\n --sidebar-item-active-background: var(--theme-background-accent);\n --sidebar-border-color: transparent;\n --sidebar-color-1: var(--theme-color-1);\n --sidebar-color-2: var(--theme-color-2);\n --sidebar-color-active: var(--theme-color-accent);\n --sidebar-search-background: transparent;\n --sidebar-search-border-color: var(--theme-border-color);\n --sidebar-search--color: var(--theme-color-3);\n}\n/* Document header only shows on mobile*/\n.dark-mode .t-doc__header,\n.light-mode .t-doc__header {\n --header-background-1: rgba(255, 255, 255, 0.85);\n --header-border-color: transparent;\n --header-color-1: var(--theme-color-1);\n --header-color-2: var(--theme-color-2);\n --header-background-toggle: var(--theme-color-3);\n --header-call-to-action-color: var(--theme-color-accent);\n}\n\n.dark-mode .t-doc__header {\n --header-background-1: rgba(17, 23, 40, 0.75);\n}\n\n/* advanced */\n.light-mode {\n --theme-button-1: rgb(49 53 56);\n --theme-button-1-color: #fff;\n --theme-button-1-hover: rgb(28 31 33);\n\n --theme-color-green: #069061;\n --theme-color-red: #ef0006;\n --theme-color-yellow: #edbe20;\n --theme-color-blue: #0082d0;\n --theme-color-orange: #fb892c;\n --theme-color-purple: #5203d1;\n\n --theme-scrollbar-color: rgba(0, 0, 0, 0.18);\n --theme-scrollbar-color-active: rgba(0, 0, 0, 0.36);\n}\n.dark-mode {\n --theme-button-1: #f6f6f6;\n --theme-button-1-color: #000;\n --theme-button-1-hover: #e7e7e7;\n\n --theme-color-green: #a3ffa9;\n --theme-color-red: #ffa3a3;\n --theme-color-yellow: #fffca3;\n --theme-color-blue: #a5d6ff;\n --theme-color-orange: #e2ae83;\n --theme-color-purple: #d2a8ff;\n\n --theme-scrollbar-color: rgba(255, 255, 255, 0.24);\n --theme-scrollbar-color-active: rgba(255, 255, 255, 0.48);\n}\n/* Elysia Specific */\n.scalar-api-client__send-request-button,\n.show-api-client-button {\n background: #3c82f6 !important;\n}\n.show-api-client-button:before {\n display: none;\n}\n\n.sidebar-search:hover {\n transition: all 0.15s ease-in-out;\n --sidebar-search-border-color: var(--theme-color-accent) !important;\n color: var(--sidebar-color-1) !important;\n}\n.scalar-api-client__container .sidebar {\n --sidebar-border-color: var(--theme-border-color);\n}\n@media (min-width: 1150px) {\n .section-container:has( ~ .footer):before,\n .tag-section-container:before {\n content: \"\";\n position: absolute;\n top: -5px;\n left: 0;\n width: 100%;\n height: 10px;\n background: linear-gradient(90deg, var(--theme-background-1) 3%,transparent 10%);\n }\n}\n.section-flare {\n position: absolute;\n width: 100vw;\n height: 300px;\n --stripes: repeating-linear-gradient(\n 100deg,\n #fff 0%,\n #fff 7%,\n transparent 10%,\n transparent 12%,\n #fff 16%\n );\n --stripesDark: repeating-linear-gradient(\n 100deg,\n #000 0%,\n #000 7%,\n transparent 10%,\n transparent 12%,\n #000 16%\n );\n --rainbow: repeating-linear-gradient(\n 100deg,\n #60a5fa 10%,\n #e879f9 16%,\n #5eead4 22%,\n #60a5fa 30%\n );\n background-image: var(--stripes), var(--rainbow);\n background-size: 300%, 200%;\n background-position: 50% 50%, 50% 50%;\n filter: invert(100%);\n -webkit-mask-image: radial-gradient(\n ellipse at 100% 0%,\n black 40%,\n transparent 70%\n );\n mask-image: radial-gradient(ellipse at 100% 0%, black 40%, transparent 70%);\n pointer-events: none;\n opacity: 0.15;\n}\n.dark-mode .section-flare {\n background-image: var(--stripesDark), var(--rainbow);\n filter: opacity(50%) saturate(200%);\n opacity: 0.25;\n}\n.section-flare:after {\n content: \"\";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-image: var(--stripes), var(--rainbow);\n background-size: 200%, 100%;\n background-attachment: fixed;\n mix-blend-mode: difference;\n}\n.dark-mode .section-flare:after {\n background-image: var(--stripesDark), var(--rainbow);\n}\n@keyframes headerbackground {\n from {\n background: transparent;\n backdrop-filter: none;\n }\n to {\n background: var(--header-background-1);\n backdrop-filter: blur(12px);\n }\n}\n.light-mode .t-doc__header,\n.dark-mode .t-doc__header {\n animation: headerbackground forwards;\n animation-timeline: scroll();\n animation-range: 0px 200px;\n --header-border-color: transparent;\n}\n"; | ||
declare const _default: "\n/* basic theme */\n.light-mode {\n --theme-color-1: #2a2f45;\n --theme-color-2: #757575;\n --theme-color-3: #8e8e8e;\n --theme-color-accent: #f06292;\n\n --theme-background-1: #fff;\n --theme-background-2: #f6f6f6;\n --theme-background-3: #e7e7e7;\n --theme-background-accent: #f062921f;\n\n --theme-border-color: rgba(0, 0, 0, 0.1);\n}\n.dark-mode {\n --theme-color-1: rgba(255, 255, 255, 0.9);\n --theme-color-2: rgba(156, 163, 175, 1);\n --theme-color-3: rgba(255, 255, 255, 0.44);\n --theme-color-accent: #f06292;\n\n --theme-background-1: #111728;\n --theme-background-2: #1e293b;\n --theme-background-3: #334155;\n --theme-background-accent: #f062921f;\n\n --theme-border-color: rgba(255, 255, 255, 0.1);\n}\n/* Document Sidebar */\n.light-mode .sidebar,\n.dark-mode .sidebar {\n --sidebar-background-1: var(--theme-background-1);\n --sidebar-item-hover-color: currentColor;\n --sidebar-item-hover-background: var(--theme-background-2);\n --sidebar-item-active-background: var(--theme-background-accent);\n --sidebar-border-color: transparent;\n --sidebar-color-1: var(--theme-color-1);\n --sidebar-color-2: var(--theme-color-2);\n --sidebar-color-active: var(--theme-color-accent);\n --sidebar-search-background: transparent;\n --sidebar-search-border-color: var(--theme-border-color);\n --sidebar-search--color: var(--theme-color-3);\n}\n/* Document header only shows on mobile*/\n.dark-mode .t-doc__header,\n.light-mode .t-doc__header {\n --header-background-1: rgba(255, 255, 255, 0.85);\n --header-border-color: transparent;\n --header-color-1: var(--theme-color-1);\n --header-color-2: var(--theme-color-2);\n --header-background-toggle: var(--theme-color-3);\n --header-call-to-action-color: var(--theme-color-accent);\n}\n\n.dark-mode .t-doc__header {\n --header-background-1: rgba(17, 23, 40, 0.75);\n}\n\n/* advanced */\n.light-mode {\n --theme-button-1: rgb(49 53 56);\n --theme-button-1-color: #fff;\n --theme-button-1-hover: rgb(28 31 33);\n\n --theme-color-green: #069061;\n --theme-color-red: #ef0006;\n --theme-color-yellow: #edbe20;\n --theme-color-blue: #0082d0;\n --theme-color-orange: #fb892c;\n --theme-color-purple: #5203d1;\n\n --theme-scrollbar-color: rgba(0, 0, 0, 0.18);\n --theme-scrollbar-color-active: rgba(0, 0, 0, 0.36);\n}\n.dark-mode {\n --theme-button-1: #f6f6f6;\n --theme-button-1-color: #000;\n --theme-button-1-hover: #e7e7e7;\n\n --theme-color-green: #a3ffa9;\n --theme-color-red: #ffa3a3;\n --theme-color-yellow: #fffca3;\n --theme-color-blue: #a5d6ff;\n --theme-color-orange: #e2ae83;\n --theme-color-purple: #d2a8ff;\n\n --theme-scrollbar-color: rgba(255, 255, 255, 0.24);\n --theme-scrollbar-color-active: rgba(255, 255, 255, 0.48);\n}\n/* Elysia Specific */\n.scalar-api-client__send-request-button,\n.show-api-client-button {\n background: #3c82f6 !important;\n}\n.show-api-client-button:before {\n display: none;\n}\n\n.sidebar-search:hover {\n transition: all 0.15s ease-in-out;\n --sidebar-search-border-color: var(--theme-color-accent) !important;\n color: var(--sidebar-color-1) !important;\n}\n.scalar-api-client__container .sidebar {\n --sidebar-border-color: var(--theme-border-color);\n}\n@media (min-width: 1150px) {\n .section-container:has( ~ .footer):before,\n .tag-section-container:before {\n content: \"\";\n position: absolute;\n top: -5px;\n left: 0;\n width: 100%;\n height: 10px;\n background: linear-gradient(90deg, var(--theme-background-1) 3%,transparent 10%);\n }\n}\n.section-flare {\n position: absolute;\n width: 100vw;\n height: 300px;\n --stripes: repeating-linear-gradient(\n 100deg,\n #fff 0%,\n #fff 7%,\n transparent 10%,\n transparent 12%,\n #fff 16%\n );\n --stripesDark: repeating-linear-gradient(\n 100deg,\n #000 0%,\n #000 7%,\n transparent 10%,\n transparent 12%,\n #000 16%\n );\n --rainbow: repeating-linear-gradient(\n 100deg,\n #60a5fa 10%,\n #e879f9 16%,\n #5eead4 22%,\n #60a5fa 30%\n );\n background-image: var(--stripes), var(--rainbow);\n background-size: 300%, 200%;\n background-position: 50% 50%, 50% 50%;\n filter: invert(100%);\n -webkit-mask-image: radial-gradient(\n ellipse at 100% 0%,\n black 40%,\n transparent 70%\n );\n mask-image: radial-gradient(ellipse at 100% 0%, black 40%, transparent 70%);\n pointer-events: none;\n opacity: 0.15;\n}\n.dark-mode .section-flare {\n background-image: var(--stripesDark), var(--rainbow);\n filter: opacity(50%) saturate(200%);\n opacity: 0.25;\n}\n.section-flare:after {\n content: \"\";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-image: var(--stripes), var(--rainbow);\n background-size: 200%, 100%;\n mix-blend-mode: difference;\n}\n.dark-mode .section-flare:after {\n background-image: var(--stripesDark), var(--rainbow);\n}\n@keyframes headerbackground {\n from {\n background: transparent;\n backdrop-filter: none;\n }\n to {\n background: var(--header-background-1);\n backdrop-filter: blur(12px);\n }\n}\n.light-mode .t-doc__header,\n.dark-mode .t-doc__header {\n animation: headerbackground forwards;\n animation-timeline: scroll();\n animation-range: 0px 200px;\n --header-border-color: transparent;\n}\n"; | ||
export default _default; |
@@ -175,3 +175,2 @@ "use strict"; | ||
background-size: 200%, 100%; | ||
background-attachment: fixed; | ||
mix-blend-mode: difference; | ||
@@ -178,0 +177,0 @@ } |
@@ -17,3 +17,3 @@ import type { HTTPMethod, LocalHook } from 'elysia'; | ||
schema: Partial<OpenAPIV3.PathsObject>; | ||
contentType?: string | string[] | undefined; | ||
contentType?: string | string[]; | ||
path: string; | ||
@@ -20,0 +20,0 @@ method: HTTPMethod; |
@@ -157,5 +157,5 @@ "use strict"; | ||
[method.toLowerCase()]: { | ||
...((headerSchema || paramsSchema || querySchema || bodySchema | ||
...(headerSchema || paramsSchema || querySchema || bodySchema | ||
? { parameters } | ||
: {})), | ||
: {}), | ||
...(responseSchema | ||
@@ -162,0 +162,0 @@ ? { |
@@ -1,2 +0,2 @@ | ||
import { type Elysia } from 'elysia'; | ||
import { Elysia } from 'elysia'; | ||
import type { ElysiaSwaggerConfig } from './types'; | ||
@@ -8,3 +8,3 @@ /** | ||
*/ | ||
export declare const swagger: <Path extends string = "/swagger">({ provider, scalarVersion, scalarCDN, scalarConfig, documentation, version, excludeStaticFile, path, exclude, swaggerOptions, theme, autoDarkMode, excludeMethods, excludeTags }?: ElysiaSwaggerConfig<Path>) => (app: Elysia) => Elysia<"", false, { | ||
export declare const swagger: <Path extends string = "/swagger">({ provider, scalarVersion, scalarCDN, scalarConfig, documentation, version, excludeStaticFile, path, exclude, swaggerOptions, theme, autoDarkMode, excludeMethods, excludeTags }?: ElysiaSwaggerConfig<Path>) => Elysia<"", false, { | ||
decorator: {}; | ||
@@ -20,11 +20,12 @@ store: {}; | ||
macro: {}; | ||
macroFn: {}; | ||
}, {}, { | ||
decorator: {}; | ||
store: {}; | ||
derive: {}; | ||
resolve: {}; | ||
schema: {}; | ||
}, { | ||
derive: {}; | ||
resolve: {}; | ||
schema: {}; | ||
macro: {}; | ||
}>; | ||
export default swagger; |
@@ -0,1 +1,3 @@ | ||
/* eslint-disable @typescript-eslint/ban-ts-comment */ | ||
import { Elysia } from 'elysia'; | ||
import { SwaggerUIRender } from './swagger'; | ||
@@ -23,3 +25,3 @@ import { ScalarRender } from './scalar'; | ||
excludeTags: [] | ||
}) => (app) => { | ||
}) => { | ||
const schema = {}; | ||
@@ -36,29 +38,33 @@ let totalRoutes = 0; | ||
const relativePath = path.startsWith('/') ? path.slice(1) : path; | ||
app.get(path, () => { | ||
const combinedSwaggerOptions = { | ||
url: `${relativePath}/json`, | ||
dom_id: '#swagger-ui', | ||
...swaggerOptions | ||
}; | ||
const stringifiedSwaggerOptions = JSON.stringify(combinedSwaggerOptions, (key, value) => { | ||
if (typeof value == 'function') | ||
return undefined; | ||
return value; | ||
const combinedSwaggerOptions = { | ||
url: `${relativePath}/json`, | ||
dom_id: '#swagger-ui', | ||
...swaggerOptions | ||
}; | ||
const stringifiedSwaggerOptions = JSON.stringify(combinedSwaggerOptions, (key, value) => { | ||
if (typeof value == 'function') | ||
return undefined; | ||
return value; | ||
}); | ||
const scalarConfiguration = { | ||
spec: { | ||
...scalarConfig.spec, | ||
url: `${relativePath}/json` | ||
}, | ||
...scalarConfig | ||
}; | ||
// ? This is intentional to prevent deeply nested type | ||
const app = new Elysia({ name: '@elysiajs/swagger' }); | ||
app.get(path, new Response(provider === 'swagger-ui' | ||
? SwaggerUIRender(info, version, theme, stringifiedSwaggerOptions, autoDarkMode) | ||
: ScalarRender(scalarVersion, scalarConfiguration, scalarCDN), { | ||
headers: { | ||
'content-type': 'text/html; charset=utf8' | ||
} | ||
})).get(path === '/' ? '/json' : `${path}/json`, () => { | ||
// @ts-expect-error private property | ||
const routes = app.getGlobalRoutes() ?? []; | ||
console.log({ | ||
routes | ||
}); | ||
const scalarConfiguration = { | ||
spec: { | ||
...scalarConfig.spec, | ||
url: `${relativePath}/json`, | ||
}, | ||
...scalarConfig | ||
}; | ||
return new Response(provider === 'swagger-ui' | ||
? SwaggerUIRender(info, version, theme, stringifiedSwaggerOptions, autoDarkMode) | ||
: ScalarRender(scalarVersion, scalarConfiguration, scalarCDN), { | ||
headers: { | ||
'content-type': 'text/html; charset=utf8' | ||
} | ||
}); | ||
}).get(path === '/' ? '/json' : `${path}/json`, () => { | ||
const routes = app.routes; | ||
if (routes.length !== totalRoutes) { | ||
@@ -92,3 +98,4 @@ totalRoutes = routes.length; | ||
}, | ||
paths: { ...filterPaths(schema, { | ||
paths: { | ||
...filterPaths(schema, { | ||
excludeStaticFile, | ||
@@ -109,5 +116,4 @@ exclude: Array.isArray(exclude) ? exclude : [exclude] | ||
}); | ||
// This is intentional to prevent deeply nested type | ||
return app; | ||
}; | ||
export default swagger; |
@@ -1,2 +0,2 @@ | ||
declare const _default: "\n/* basic theme */\n.light-mode {\n --theme-color-1: #2a2f45;\n --theme-color-2: #757575;\n --theme-color-3: #8e8e8e;\n --theme-color-accent: #f06292;\n\n --theme-background-1: #fff;\n --theme-background-2: #f6f6f6;\n --theme-background-3: #e7e7e7;\n --theme-background-accent: #f062921f;\n\n --theme-border-color: rgba(0, 0, 0, 0.1);\n}\n.dark-mode {\n --theme-color-1: rgba(255, 255, 255, 0.9);\n --theme-color-2: rgba(156, 163, 175, 1);\n --theme-color-3: rgba(255, 255, 255, 0.44);\n --theme-color-accent: #f06292;\n\n --theme-background-1: #111728;\n --theme-background-2: #1e293b;\n --theme-background-3: #334155;\n --theme-background-accent: #f062921f;\n\n --theme-border-color: rgba(255, 255, 255, 0.1);\n}\n/* Document Sidebar */\n.light-mode .sidebar,\n.dark-mode .sidebar {\n --sidebar-background-1: var(--theme-background-1);\n --sidebar-item-hover-color: currentColor;\n --sidebar-item-hover-background: var(--theme-background-2);\n --sidebar-item-active-background: var(--theme-background-accent);\n --sidebar-border-color: transparent;\n --sidebar-color-1: var(--theme-color-1);\n --sidebar-color-2: var(--theme-color-2);\n --sidebar-color-active: var(--theme-color-accent);\n --sidebar-search-background: transparent;\n --sidebar-search-border-color: var(--theme-border-color);\n --sidebar-search--color: var(--theme-color-3);\n}\n/* Document header only shows on mobile*/\n.dark-mode .t-doc__header,\n.light-mode .t-doc__header {\n --header-background-1: rgba(255, 255, 255, 0.85);\n --header-border-color: transparent;\n --header-color-1: var(--theme-color-1);\n --header-color-2: var(--theme-color-2);\n --header-background-toggle: var(--theme-color-3);\n --header-call-to-action-color: var(--theme-color-accent);\n}\n\n.dark-mode .t-doc__header {\n --header-background-1: rgba(17, 23, 40, 0.75);\n}\n\n/* advanced */\n.light-mode {\n --theme-button-1: rgb(49 53 56);\n --theme-button-1-color: #fff;\n --theme-button-1-hover: rgb(28 31 33);\n\n --theme-color-green: #069061;\n --theme-color-red: #ef0006;\n --theme-color-yellow: #edbe20;\n --theme-color-blue: #0082d0;\n --theme-color-orange: #fb892c;\n --theme-color-purple: #5203d1;\n\n --theme-scrollbar-color: rgba(0, 0, 0, 0.18);\n --theme-scrollbar-color-active: rgba(0, 0, 0, 0.36);\n}\n.dark-mode {\n --theme-button-1: #f6f6f6;\n --theme-button-1-color: #000;\n --theme-button-1-hover: #e7e7e7;\n\n --theme-color-green: #a3ffa9;\n --theme-color-red: #ffa3a3;\n --theme-color-yellow: #fffca3;\n --theme-color-blue: #a5d6ff;\n --theme-color-orange: #e2ae83;\n --theme-color-purple: #d2a8ff;\n\n --theme-scrollbar-color: rgba(255, 255, 255, 0.24);\n --theme-scrollbar-color-active: rgba(255, 255, 255, 0.48);\n}\n/* Elysia Specific */\n.scalar-api-client__send-request-button,\n.show-api-client-button {\n background: #3c82f6 !important;\n}\n.show-api-client-button:before {\n display: none;\n}\n\n.sidebar-search:hover {\n transition: all 0.15s ease-in-out;\n --sidebar-search-border-color: var(--theme-color-accent) !important;\n color: var(--sidebar-color-1) !important;\n}\n.scalar-api-client__container .sidebar {\n --sidebar-border-color: var(--theme-border-color);\n}\n@media (min-width: 1150px) {\n .section-container:has( ~ .footer):before,\n .tag-section-container:before {\n content: \"\";\n position: absolute;\n top: -5px;\n left: 0;\n width: 100%;\n height: 10px;\n background: linear-gradient(90deg, var(--theme-background-1) 3%,transparent 10%);\n }\n}\n.section-flare {\n position: absolute;\n width: 100vw;\n height: 300px;\n --stripes: repeating-linear-gradient(\n 100deg,\n #fff 0%,\n #fff 7%,\n transparent 10%,\n transparent 12%,\n #fff 16%\n );\n --stripesDark: repeating-linear-gradient(\n 100deg,\n #000 0%,\n #000 7%,\n transparent 10%,\n transparent 12%,\n #000 16%\n );\n --rainbow: repeating-linear-gradient(\n 100deg,\n #60a5fa 10%,\n #e879f9 16%,\n #5eead4 22%,\n #60a5fa 30%\n );\n background-image: var(--stripes), var(--rainbow);\n background-size: 300%, 200%;\n background-position: 50% 50%, 50% 50%;\n filter: invert(100%);\n -webkit-mask-image: radial-gradient(\n ellipse at 100% 0%,\n black 40%,\n transparent 70%\n );\n mask-image: radial-gradient(ellipse at 100% 0%, black 40%, transparent 70%);\n pointer-events: none;\n opacity: 0.15;\n}\n.dark-mode .section-flare {\n background-image: var(--stripesDark), var(--rainbow);\n filter: opacity(50%) saturate(200%);\n opacity: 0.25;\n}\n.section-flare:after {\n content: \"\";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-image: var(--stripes), var(--rainbow);\n background-size: 200%, 100%;\n background-attachment: fixed;\n mix-blend-mode: difference;\n}\n.dark-mode .section-flare:after {\n background-image: var(--stripesDark), var(--rainbow);\n}\n@keyframes headerbackground {\n from {\n background: transparent;\n backdrop-filter: none;\n }\n to {\n background: var(--header-background-1);\n backdrop-filter: blur(12px);\n }\n}\n.light-mode .t-doc__header,\n.dark-mode .t-doc__header {\n animation: headerbackground forwards;\n animation-timeline: scroll();\n animation-range: 0px 200px;\n --header-border-color: transparent;\n}\n"; | ||
declare const _default: "\n/* basic theme */\n.light-mode {\n --theme-color-1: #2a2f45;\n --theme-color-2: #757575;\n --theme-color-3: #8e8e8e;\n --theme-color-accent: #f06292;\n\n --theme-background-1: #fff;\n --theme-background-2: #f6f6f6;\n --theme-background-3: #e7e7e7;\n --theme-background-accent: #f062921f;\n\n --theme-border-color: rgba(0, 0, 0, 0.1);\n}\n.dark-mode {\n --theme-color-1: rgba(255, 255, 255, 0.9);\n --theme-color-2: rgba(156, 163, 175, 1);\n --theme-color-3: rgba(255, 255, 255, 0.44);\n --theme-color-accent: #f06292;\n\n --theme-background-1: #111728;\n --theme-background-2: #1e293b;\n --theme-background-3: #334155;\n --theme-background-accent: #f062921f;\n\n --theme-border-color: rgba(255, 255, 255, 0.1);\n}\n/* Document Sidebar */\n.light-mode .sidebar,\n.dark-mode .sidebar {\n --sidebar-background-1: var(--theme-background-1);\n --sidebar-item-hover-color: currentColor;\n --sidebar-item-hover-background: var(--theme-background-2);\n --sidebar-item-active-background: var(--theme-background-accent);\n --sidebar-border-color: transparent;\n --sidebar-color-1: var(--theme-color-1);\n --sidebar-color-2: var(--theme-color-2);\n --sidebar-color-active: var(--theme-color-accent);\n --sidebar-search-background: transparent;\n --sidebar-search-border-color: var(--theme-border-color);\n --sidebar-search--color: var(--theme-color-3);\n}\n/* Document header only shows on mobile*/\n.dark-mode .t-doc__header,\n.light-mode .t-doc__header {\n --header-background-1: rgba(255, 255, 255, 0.85);\n --header-border-color: transparent;\n --header-color-1: var(--theme-color-1);\n --header-color-2: var(--theme-color-2);\n --header-background-toggle: var(--theme-color-3);\n --header-call-to-action-color: var(--theme-color-accent);\n}\n\n.dark-mode .t-doc__header {\n --header-background-1: rgba(17, 23, 40, 0.75);\n}\n\n/* advanced */\n.light-mode {\n --theme-button-1: rgb(49 53 56);\n --theme-button-1-color: #fff;\n --theme-button-1-hover: rgb(28 31 33);\n\n --theme-color-green: #069061;\n --theme-color-red: #ef0006;\n --theme-color-yellow: #edbe20;\n --theme-color-blue: #0082d0;\n --theme-color-orange: #fb892c;\n --theme-color-purple: #5203d1;\n\n --theme-scrollbar-color: rgba(0, 0, 0, 0.18);\n --theme-scrollbar-color-active: rgba(0, 0, 0, 0.36);\n}\n.dark-mode {\n --theme-button-1: #f6f6f6;\n --theme-button-1-color: #000;\n --theme-button-1-hover: #e7e7e7;\n\n --theme-color-green: #a3ffa9;\n --theme-color-red: #ffa3a3;\n --theme-color-yellow: #fffca3;\n --theme-color-blue: #a5d6ff;\n --theme-color-orange: #e2ae83;\n --theme-color-purple: #d2a8ff;\n\n --theme-scrollbar-color: rgba(255, 255, 255, 0.24);\n --theme-scrollbar-color-active: rgba(255, 255, 255, 0.48);\n}\n/* Elysia Specific */\n.scalar-api-client__send-request-button,\n.show-api-client-button {\n background: #3c82f6 !important;\n}\n.show-api-client-button:before {\n display: none;\n}\n\n.sidebar-search:hover {\n transition: all 0.15s ease-in-out;\n --sidebar-search-border-color: var(--theme-color-accent) !important;\n color: var(--sidebar-color-1) !important;\n}\n.scalar-api-client__container .sidebar {\n --sidebar-border-color: var(--theme-border-color);\n}\n@media (min-width: 1150px) {\n .section-container:has( ~ .footer):before,\n .tag-section-container:before {\n content: \"\";\n position: absolute;\n top: -5px;\n left: 0;\n width: 100%;\n height: 10px;\n background: linear-gradient(90deg, var(--theme-background-1) 3%,transparent 10%);\n }\n}\n.section-flare {\n position: absolute;\n width: 100vw;\n height: 300px;\n --stripes: repeating-linear-gradient(\n 100deg,\n #fff 0%,\n #fff 7%,\n transparent 10%,\n transparent 12%,\n #fff 16%\n );\n --stripesDark: repeating-linear-gradient(\n 100deg,\n #000 0%,\n #000 7%,\n transparent 10%,\n transparent 12%,\n #000 16%\n );\n --rainbow: repeating-linear-gradient(\n 100deg,\n #60a5fa 10%,\n #e879f9 16%,\n #5eead4 22%,\n #60a5fa 30%\n );\n background-image: var(--stripes), var(--rainbow);\n background-size: 300%, 200%;\n background-position: 50% 50%, 50% 50%;\n filter: invert(100%);\n -webkit-mask-image: radial-gradient(\n ellipse at 100% 0%,\n black 40%,\n transparent 70%\n );\n mask-image: radial-gradient(ellipse at 100% 0%, black 40%, transparent 70%);\n pointer-events: none;\n opacity: 0.15;\n}\n.dark-mode .section-flare {\n background-image: var(--stripesDark), var(--rainbow);\n filter: opacity(50%) saturate(200%);\n opacity: 0.25;\n}\n.section-flare:after {\n content: \"\";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-image: var(--stripes), var(--rainbow);\n background-size: 200%, 100%;\n mix-blend-mode: difference;\n}\n.dark-mode .section-flare:after {\n background-image: var(--stripesDark), var(--rainbow);\n}\n@keyframes headerbackground {\n from {\n background: transparent;\n backdrop-filter: none;\n }\n to {\n background: var(--header-background-1);\n backdrop-filter: blur(12px);\n }\n}\n.light-mode .t-doc__header,\n.dark-mode .t-doc__header {\n animation: headerbackground forwards;\n animation-timeline: scroll();\n animation-range: 0px 200px;\n --header-border-color: transparent;\n}\n"; | ||
export default _default; |
@@ -173,3 +173,2 @@ export default ` | ||
background-size: 200%, 100%; | ||
background-attachment: fixed; | ||
mix-blend-mode: difference; | ||
@@ -176,0 +175,0 @@ } |
@@ -17,3 +17,3 @@ import type { HTTPMethod, LocalHook } from 'elysia'; | ||
schema: Partial<OpenAPIV3.PathsObject>; | ||
contentType?: string | string[] | undefined; | ||
contentType?: string | string[]; | ||
path: string; | ||
@@ -20,0 +20,0 @@ method: HTTPMethod; |
@@ -147,5 +147,5 @@ import { Kind } from '@sinclair/typebox'; | ||
[method.toLowerCase()]: { | ||
...((headerSchema || paramsSchema || querySchema || bodySchema | ||
...(headerSchema || paramsSchema || querySchema || bodySchema | ||
? { parameters } | ||
: {})), | ||
: {}), | ||
...(responseSchema | ||
@@ -152,0 +152,0 @@ ? { |
{ | ||
"name": "@elysiajs/swagger", | ||
"version": "1.0.5", | ||
"version": "1.1.0-exp.0", | ||
"description": "Plugin for Elysia to auto-generate Swagger page", | ||
@@ -38,3 +38,3 @@ "author": { | ||
"peerDependencies": { | ||
"elysia": ">= 1.0.2" | ||
"elysia": ">= 1.1.0-exp.6" | ||
}, | ||
@@ -47,3 +47,3 @@ "devDependencies": { | ||
"@types/node": "^20.1.4", | ||
"elysia": "1.0.2", | ||
"elysia": "1.1.0-exp.4", | ||
"eslint": "^8.40.0", | ||
@@ -50,0 +50,0 @@ "rimraf": "4.3", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
161211
4153
23514
1