Socket
Socket
Sign inDemoInstall

@elysiajs/swagger

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elysiajs/swagger - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

3

dist/cjs/index.d.ts
import { type Elysia } from 'elysia';
import type { ElysiaSwaggerConfig } from './types';
export declare const swagger: <Path extends string = "/swagger">({ documentation, version, excludeStaticFile, path, exclude }?: ElysiaSwaggerConfig<Path>) => (app: Elysia) => Elysia<{
path: "";
export declare const swagger: <Path extends string = "/swagger">({ documentation, version, excludeStaticFile, path, exclude }?: ElysiaSwaggerConfig<Path>) => (app: Elysia) => Elysia<"", {
store: {};

@@ -6,0 +5,0 @@ request: {};

@@ -85,9 +85,9 @@ "use strict";

components: {
schemas: app.meta.defs
...documentation.components,
schemas: {
...app.meta.defs,
...documentation.components?.schemas
}
}
};
}, {
config: {
allowMeta: true
}
});

@@ -94,0 +94,0 @@ return app;

import { type Elysia } from 'elysia';
import type { ElysiaSwaggerConfig } from './types';
export declare const swagger: <Path extends string = "/swagger">({ documentation, version, excludeStaticFile, path, exclude }?: ElysiaSwaggerConfig<Path>) => (app: Elysia) => Elysia<{
path: "";
export declare const swagger: <Path extends string = "/swagger">({ documentation, version, excludeStaticFile, path, exclude }?: ElysiaSwaggerConfig<Path>) => (app: Elysia) => Elysia<"", {
store: {};

@@ -6,0 +5,0 @@ request: {};

@@ -82,9 +82,9 @@ import { filterPaths, registerSchemaPath } from './utils';

components: {
schemas: app.meta.defs
...documentation.components,
schemas: {
...app.meta.defs,
...documentation.components?.schemas
}
}
};
}, {
config: {
allowMeta: true
}
});

@@ -91,0 +91,0 @@ return app;

{
"name": "@elysiajs/swagger",
"version": "0.6.0",
"description": "Plugin for Elysia to auto-generate Swagger page",
"author": {
"name": "saltyAom",
"url": "https://github.com/SaltyAom",
"email": "saltyaom@gmail.com"
},
"main": "./dist/index.js",
"exports": {
"bun": "./dist/index.js",
"node": "./dist/cjs/index.js",
"require": "./dist/cjs/index.js",
"import": "./dist/index.js",
"default": "./dist/index.js"
},
"types": "./src/index.ts",
"keywords": [
"elysia",
"swagger"
],
"homepage": "https://github.com/elysiajs/elysia-swagger",
"repository": {
"type": "git",
"url": "https://github.com/elysiajs/elysia-swagger"
},
"bugs": "https://github.com/elysiajs/elysia-swagger/issues",
"license": "MIT",
"scripts": {
"dev": "bun run --hot example/index.ts",
"test": "bun wiptest && npm run test:node",
"test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js",
"build": "rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json",
"release": "npm run build && npm run test && npm publish --access public"
},
"peerDependencies": {
"elysia": ">= 0.6.0-alpha.3"
},
"devDependencies": {
"@types/node": "^20.1.4",
"bun-types": "^0.7.0",
"elysia": "0.6.0",
"eslint": "^8.40.0",
"rimraf": "4.3",
"typescript": "^5.0.4"
},
"dependencies": {
"lodash.clonedeep": "^4.5.0"
}
}
"name": "@elysiajs/swagger",
"version": "0.6.1",
"description": "Plugin for Elysia to auto-generate Swagger page",
"author": {
"name": "saltyAom",
"url": "https://github.com/SaltyAom",
"email": "saltyaom@gmail.com"
},
"main": "./dist/index.js",
"exports": {
"bun": "./dist/index.js",
"node": "./dist/cjs/index.js",
"require": "./dist/cjs/index.js",
"import": "./dist/index.js",
"default": "./dist/index.js"
},
"types": "./src/index.ts",
"keywords": [
"elysia",
"swagger"
],
"homepage": "https://github.com/elysiajs/elysia-swagger",
"repository": {
"type": "git",
"url": "https://github.com/elysiajs/elysia-swagger"
},
"bugs": "https://github.com/elysiajs/elysia-swagger/issues",
"license": "MIT",
"scripts": {
"dev": "bun run --watch example/index.ts",
"test": "bun wiptest && npm run test:node",
"test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js",
"build": "rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json",
"release": "npm run build && npm run test && npm publish --access public"
},
"peerDependencies": {
"elysia": ">= 0.6.7"
},
"devDependencies": {
"@types/lodash.clonedeep": "^4.5.7",
"@types/node": "^20.1.4",
"bun-types": "^0.7.0",
"elysia": "^0.6.10",
"eslint": "^8.40.0",
"rimraf": "4.3",
"typescript": "^5.0.4"
},
"dependencies": {
"lodash.clonedeep": "^4.5.0"
}
}

@@ -77,51 +77,46 @@ import { type Elysia, type InternalRoute } from 'elysia'

)
}).route(
'GET',
`${path}/json`,
() => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const routes = app.routes as InternalRoute[]
}).route('GET', `${path}/json`, () => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const routes = app.routes as InternalRoute[]
if (routes.length !== totalRoutes) {
totalRoutes = routes.length
if (routes.length !== totalRoutes) {
totalRoutes = routes.length
routes.forEach((route: InternalRoute<any>) => {
registerSchemaPath({
schema,
hook: route.hooks,
method: route.method,
path: route.path,
models: app.meta.defs,
contentType: route.hooks.type
})
routes.forEach((route: InternalRoute<any>) => {
registerSchemaPath({
schema,
hook: route.hooks,
method: route.method,
path: route.path,
models: app.meta.defs,
contentType: route.hooks.type
})
}
})
}
return {
openapi: '3.0.3',
...{
...documentation,
info: {
title: 'Elysia Documentation',
description: 'Developement documentation',
version: '0.0.0',
...documentation.info
}
},
paths: filterPaths(schema, {
excludeStaticFile,
exclude: Array.isArray(exclude) ? exclude : [exclude]
}),
components: {
schemas: app.meta.defs
return {
openapi: '3.0.3',
...{
...documentation,
info: {
title: 'Elysia Documentation',
description: 'Developement documentation',
version: '0.0.0',
...documentation.info
}
} satisfies OpenAPIV3.Document
},
{
config: {
allowMeta: true
},
paths: filterPaths(schema, {
excludeStaticFile,
exclude: Array.isArray(exclude) ? exclude : [exclude]
}),
components: {
...documentation.components,
schemas: {
...app.meta.defs,
...documentation.components?.schemas
}
}
}
)
} satisfies OpenAPIV3.Document
})

@@ -128,0 +123,0 @@ // This is intentional to prevent deeply nested type

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc