@fastify/swagger-ui
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -24,1 +24,3 @@ 'use strict' | ||
}) | ||
module.exports.default = fastifySwaggerUi | ||
module.exports.fastifySwaggerUi = fastifySwaggerUi |
{ | ||
"name": "@fastify/swagger-ui", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Serve Swagger-ui for Fastify", | ||
@@ -56,4 +56,4 @@ "main": "index.js", | ||
"standard": "^17.0.0", | ||
"swagger-ui-dist": "4.15.2", | ||
"tap": "^16.2.0", | ||
"swagger-ui-dist": "4.15.5", | ||
"tap": "^16.3.2", | ||
"tsd": "^0.24.1" | ||
@@ -76,2 +76,5 @@ }, | ||
}, | ||
"pkg": { | ||
"assets": ["static/**/*"] | ||
}, | ||
"publishConfig": { | ||
@@ -78,0 +81,0 @@ "access": "public" |
@@ -29,71 +29,77 @@ import { FastifyPluginCallback, FastifyReply, FastifyRequest, onRequestHookHandler, preHandlerHookHandler } from 'fastify'; | ||
export const fastifySwaggerUi: FastifyPluginCallback<FastifySwaggerUiOptions>; | ||
type FastifySwaggerUi = FastifyPluginCallback<fastifySwaggerUi.FastifySwaggerUiOptions>; | ||
export interface FastifySwaggerUiOptions { | ||
baseDir?: string; | ||
/** | ||
* Overwrite the swagger url end-point | ||
* @default /documentation | ||
*/ | ||
routePrefix?: string; | ||
/** | ||
* Swagger UI Config | ||
*/ | ||
uiConfig?: FastifySwaggerUiConfigOptions | ||
initOAuth?: FastifySwaggerInitOAuthOptions | ||
/** | ||
* CSP Config | ||
*/ | ||
staticCSP?: boolean | string | Record<string, string | string[]> | ||
transformStaticCSP?: (header: string) => string | ||
/** | ||
* route hooks | ||
*/ | ||
uiHooks?: FastifySwaggerUiHooksOptions | ||
declare namespace fastifySwaggerUi { | ||
export interface FastifySwaggerUiOptions { | ||
baseDir?: string; | ||
/** | ||
* Overwrite the swagger url end-point | ||
* @default /documentation | ||
*/ | ||
routePrefix?: string; | ||
/** | ||
* Swagger UI Config | ||
*/ | ||
uiConfig?: FastifySwaggerUiConfigOptions | ||
initOAuth?: FastifySwaggerInitOAuthOptions | ||
/** | ||
* CSP Config | ||
*/ | ||
staticCSP?: boolean | string | Record<string, string | string[]> | ||
transformStaticCSP?: (header: string) => string | ||
/** | ||
* route hooks | ||
*/ | ||
uiHooks?: FastifySwaggerUiHooksOptions | ||
transformSpecification?: (swaggerObject: Readonly<Record<string, any>>, request: FastifyRequest, reply: FastifyReply) => Record<string, any> | ||
transformSpecificationClone?: boolean | ||
} | ||
transformSpecification?: (swaggerObject: Readonly<Record<string, any>>, request: FastifyRequest, reply: FastifyReply) => Record<string, any> | ||
transformSpecificationClone?: boolean | ||
} | ||
export type FastifySwaggerUiConfigOptions = Partial<{ | ||
deepLinking: boolean | ||
displayOperationId: boolean | ||
defaultModelsExpandDepth: number | ||
defaultModelExpandDepth: number | ||
defaultModelRendering: string | ||
displayRequestDuration: boolean | ||
docExpansion: string | ||
filter: boolean | string | ||
layout: string | ||
maxDisplayedTags: number | ||
showExtensions: boolean | ||
showCommonExtensions: boolean | ||
useUnsafeMarkdown: boolean | ||
syntaxHighlight: { | ||
activate?: boolean | ||
theme?: string | ||
} | false | ||
tryItOutEnabled: boolean | ||
validatorUrl: string | null | ||
supportedSubmitMethods: Array<'get' | 'post' | 'put' | 'delete' | 'patch' | 'options'> | ||
persistAuthorization: boolean | ||
}> | ||
export type FastifySwaggerUiConfigOptions = Partial<{ | ||
deepLinking: boolean | ||
displayOperationId: boolean | ||
defaultModelsExpandDepth: number | ||
defaultModelExpandDepth: number | ||
defaultModelRendering: string | ||
displayRequestDuration: boolean | ||
docExpansion: string | ||
filter: boolean | string | ||
layout: string | ||
maxDisplayedTags: number | ||
showExtensions: boolean | ||
showCommonExtensions: boolean | ||
useUnsafeMarkdown: boolean | ||
syntaxHighlight: { | ||
activate?: boolean | ||
theme?: string | ||
} | false | ||
tryItOutEnabled: boolean | ||
validatorUrl: string | null | ||
supportedSubmitMethods: Array<'get' | 'post' | 'put' | 'delete' | 'patch' | 'options'> | ||
persistAuthorization: boolean | ||
}> | ||
export type FastifySwaggerInitOAuthOptions = Partial<{ | ||
clientId: string, | ||
clientSecret: string, | ||
realm: string, | ||
appName: string, | ||
scopeSeparator: string, | ||
scopes: string | string[], | ||
additionalQueryStringParams: { [key: string]: any }, | ||
useBasicAuthenticationWithAccessCodeGrant: boolean, | ||
usePkceWithAuthorizationCodeGrant: boolean | ||
}> | ||
export type FastifySwaggerInitOAuthOptions = Partial<{ | ||
clientId: string, | ||
clientSecret: string, | ||
realm: string, | ||
appName: string, | ||
scopeSeparator: string, | ||
scopes: string | string[], | ||
additionalQueryStringParams: { [key: string]: any }, | ||
useBasicAuthenticationWithAccessCodeGrant: boolean, | ||
usePkceWithAuthorizationCodeGrant: boolean | ||
}> | ||
export type FastifySwaggerUiHooksOptions = Partial<{ | ||
onRequest?: onRequestHookHandler, | ||
preHandler?: preHandlerHookHandler, | ||
}> | ||
export type FastifySwaggerUiHooksOptions = Partial<{ | ||
onRequest?: onRequestHookHandler, | ||
preHandler?: preHandlerHookHandler, | ||
}> | ||
export default fastifySwaggerUi; | ||
export const fastifySwaggerUi: FastifySwaggerUi | ||
export { fastifySwaggerUi as default } | ||
} | ||
declare function fastifySwaggerUi(...params: Parameters<FastifySwaggerUi>): ReturnType<FastifySwaggerUi> | ||
export = fastifySwaggerUi; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
4446279
9804
2