@elysiajs/swagger
Advanced tools
Comparing version 0.1.0-rc.3 to 0.1.0-rc.4
import { type Elysia } from 'elysia'; | ||
import type { ElysiaSwaggerConfig } from './types'; | ||
/** | ||
* Plugin for [elysia](https://github.com/elysiajs/elysia) that auto-generate Swagger page. | ||
* | ||
* @see https://github.com/elysiajs/elysia-swagger | ||
*/ | ||
export declare const swagger: ({ swagger, excludeStaticFile, path, exclude }?: ElysiaSwaggerConfig) => (app: Elysia) => Elysia<import("elysia").ElysiaInstance<{ | ||
@@ -9,0 +4,0 @@ store: {}; |
@@ -11,7 +11,2 @@ import { SCHEMA } from 'elysia'; | ||
}; | ||
/** | ||
* Plugin for [elysia](https://github.com/elysiajs/elysia) that auto-generate Swagger page. | ||
* | ||
* @see https://github.com/elysiajs/elysia-swagger | ||
*/ | ||
export const swagger = ({ swagger = {}, excludeStaticFile = true, path = '/swagger', exclude = [] } = { | ||
@@ -42,3 +37,2 @@ swagger: {}, | ||
}, | ||
// @ts-ignore | ||
paths: filterPaths(context.store[SCHEMA], { | ||
@@ -45,0 +39,0 @@ excludeStaticFile, |
import type { OpenAPIV2 } from "openapi-types"; | ||
export interface ElysiaSwaggerConfig { | ||
/** | ||
* Customize Swagger config, refers to Swagger 2.0 config | ||
* | ||
* @see https://swagger.io/specification/v2/ | ||
*/ | ||
swagger?: Partial<OpenAPIV2.Document>; | ||
/** | ||
* Determine if Swagger should exclude static files. | ||
* | ||
* @default true | ||
*/ | ||
excludeStaticFile?: boolean; | ||
/** | ||
* The endpoint to expose Swagger | ||
* | ||
* @default '/swagger' | ||
*/ | ||
path?: string; | ||
/** | ||
* Paths to exclude from Swagger endpoint | ||
* | ||
* @default [] | ||
*/ | ||
exclude?: string | RegExp | (string | RegExp)[]; | ||
} |
{ | ||
"name": "@elysiajs/swagger", | ||
"version": "0.1.0-rc.3", | ||
"version": "0.1.0-rc.4", | ||
"description": "Plugin for Elysia to auto-generate Swagger page", | ||
@@ -12,3 +12,3 @@ "author": { | ||
"exports": { | ||
"require": "./dist/cjs/index.js", | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.js", | ||
@@ -33,5 +33,3 @@ "node": "./dist/index.js", | ||
"test": "bun wiptest", | ||
"build": "rimraf dist && npm run build:cjs && npm run build:esm", | ||
"build:cjs": "tsc --project tsconfig.cjs.json", | ||
"build:esm": "tsc --project tsconfig.esm.json", | ||
"build": "rimraf dist && tsc --project tsconfig.esm.json", | ||
"release": "npm run build && npm run test && npm publish --access public" | ||
@@ -38,0 +36,0 @@ }, |
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
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
13850
12
293