From 1dc4b900e95cd2aede64e6b8eddf542da915ea7a Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 14 Jan 2026 10:44:43 +0100 Subject: [PATCH] feat: add Swagger universal types and utilities for API documentation --- src/index.node.ts | 8 +++++++- src/node/api/swagger.universal.ts | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/node/api/swagger.universal.ts diff --git a/src/index.node.ts b/src/index.node.ts index b174aa2..6bc6a5a 100644 --- a/src/index.node.ts +++ b/src/index.node.ts @@ -42,4 +42,10 @@ export { // utility functions for environment parsing export { parsePackageJsonEnvironments -} from "./node/apps/utils.environment.js"; \ No newline at end of file +} from "./node/apps/utils.environment.js"; + +// Swagger universal types and utilities +export { + type AppSchemaTemplate, + SwaggerTypes +} from "./node/api/swagger.universal.js"; \ No newline at end of file diff --git a/src/node/api/swagger.universal.ts b/src/node/api/swagger.universal.ts new file mode 100644 index 0000000..feeeaf0 --- /dev/null +++ b/src/node/api/swagger.universal.ts @@ -0,0 +1,26 @@ +/** + * Universal Swagger types and utilities + * This interface can be extended for more precise typing if needed. + */ +export interface AppSchemaTemplate { + body?: Record; + querystring?: Record; + params?: Record; + headers?: Record; + response?: Record; + description?: string; + tags?: string[]; + summary?: string; + [key: string]: any; +} + +/** + * Shared swagger types used in API documentation + */ +export enum SwaggerTypes { + String = "string", + Number = "number", + Object = "object", + Array = "array", + Boolean = "boolean" +} \ No newline at end of file