adorn-api 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -2
- package/dist/adapter/express/index.d.ts.map +1 -1
- package/dist/cli.cjs +125 -34
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +124 -33
- package/dist/cli.js.map +1 -1
- package/dist/compiler/analyze/extractQueryStyle.d.ts +8 -0
- package/dist/compiler/analyze/extractQueryStyle.d.ts.map +1 -0
- package/dist/compiler/manifest/emit.d.ts.map +1 -1
- package/dist/compiler/schema/openapi.d.ts.map +1 -1
- package/dist/express.cjs +99 -16
- package/dist/express.cjs.map +1 -1
- package/dist/express.js +99 -16
- package/dist/express.js.map +1 -1
- package/dist/http.d.ts +4 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/index.cjs +7 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/metal/index.d.ts +1 -0
- package/dist/metal/index.d.ts.map +1 -1
- package/dist/metal/searchWhere.d.ts +42 -0
- package/dist/metal/searchWhere.d.ts.map +1 -0
- package/package.json +4 -4
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/runtime/polyfill.ts","../src/runtime/metadata/key.ts","../src/runtime/metadata/bucket.ts","../src/decorators/Controller.ts","../src/decorators/methods.ts","../src/decorators/Use.ts","../src/decorators/Auth.ts","../src/decorators/Public.ts","../src/runtime/metadata/read.ts","../src/schema/decorators.ts","../src/runtime/validation/ajv.ts","../src/http.ts","../src/compiler/cache/loadArtifacts.ts"],"sourcesContent":["import \"./runtime/polyfill.js\";\n\nexport { Controller, Get, Post, Put, Patch, Delete, Use, Auth, Public } from \"./decorators/index.js\";\nexport { readAdornBucket } from \"./runtime/metadata/read.js\";\nexport type { HttpMethod, RouteOperation, AdornBucket, AuthMeta, ExpressMw } from \"./runtime/metadata/types.js\";\nexport type { AuthSchemeRuntime, AuthResult } from \"./runtime/auth/runtime.js\";\nexport * from \"./schema/index.js\";\nexport { createValidator, formatValidationErrors, ValidationErrorResponse } from \"./runtime/validation/index.js\";\nexport {\n QueryStyle,\n File,\n PartType,\n Consumes,\n Produces,\n} from \"./http.js\";\nexport type { Cookies } from \"./http.js\";\nexport type { QueryStyleOptions, FilePartOptions, HttpMetadata } from \"./http.js\";\nexport type { UploadFile } from \"./runtime/upload.js\";\nexport { loadArtifacts, clearArtifactCache, getArtifactCacheStats } from \"./compiler/cache/loadArtifacts.js\";\n","// Polyfill Symbol.metadata for environments that don't support it\n// Must run before any decorated classes are imported\n(Symbol as any).metadata ??= Symbol(\"Symbol.metadata\");\n\n// Export a symbol to prevent tree-shaking\nexport const ADORN_POLYFILL = Symbol(\"adorn-polyfill\");\n","export const ADORN_META = Symbol.for(\"adorn-api/meta\");\n","import { ADORN_META } from \"./key.js\";\nimport type { AdornBucket } from \"./types.js\";\n\nexport function getBucket(metadata: DecoratorMetadata): AdornBucket {\n if (!metadata) {\n throw new Error(\"Decorator context.metadata is undefined. Ensure Symbol.metadata polyfill runs before decorators.\");\n }\n let bucket = metadata[ADORN_META] as AdornBucket | undefined;\n if (!bucket) {\n bucket = { ops: [], controllerUse: [] };\n metadata[ADORN_META] = bucket;\n }\n if (!bucket.controllerUse) {\n bucket.controllerUse = [];\n }\n return bucket;\n}\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\n\nexport function Controller(basePath: string) {\n return function <T extends new (...args: any[]) => any>(\n target: T,\n context: ClassDecoratorContext<T>\n ): T | void {\n const bucket = getBucket(context.metadata);\n bucket.basePath = basePath;\n };\n}\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\nimport type { HttpMethod } from \"../runtime/metadata/types.js\";\n\nfunction createMethodDecorator(httpMethod: HttpMethod, path: string) {\n return function <T extends (...args: any[]) => any>(\n target: T,\n context: ClassMethodDecoratorContext<any, T>\n ): T | void {\n if (context.private || context.static) {\n return;\n }\n\n const methodName = String(context.name);\n const bucket = getBucket(context.metadata);\n\n let op = bucket.ops.find(op => op.methodName === methodName);\n if (!op) {\n op = {\n httpMethod,\n path,\n methodName,\n };\n bucket.ops.push(op);\n } else {\n op.httpMethod = httpMethod;\n op.path = path;\n }\n };\n}\n\nexport const Get = (path: string) => createMethodDecorator(\"GET\", path);\nexport const Post = (path: string) => createMethodDecorator(\"POST\", path);\nexport const Put = (path: string) => createMethodDecorator(\"PUT\", path);\nexport const Patch = (path: string) => createMethodDecorator(\"PATCH\", path);\nexport const Delete = (path: string) => createMethodDecorator(\"DELETE\", path);\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\nimport type { ExpressMw, HttpMethod } from \"../runtime/metadata/types.js\";\n\ntype UseTarget = string | ExpressMw;\n\nexport function Use(...middleware: UseTarget[]) {\n return function (\n target: any,\n context: ClassDecoratorContext | ClassMethodDecoratorContext\n ) {\n if (context.kind === \"class\") {\n const bucket = getBucket(context.metadata);\n if (!bucket.controllerUse) {\n bucket.controllerUse = [];\n }\n bucket.controllerUse.push(...middleware);\n } else if (context.kind === \"method\") {\n const methodName = String(context.name);\n const bucket = getBucket(context.metadata);\n let op = bucket.ops.find(op => op.methodName === methodName);\n if (!op) {\n op = {\n httpMethod: \"GET\" as HttpMethod,\n path: \"/\",\n methodName,\n };\n bucket.ops.push(op);\n }\n if (!op.use) {\n op.use = [];\n }\n op.use.push(...middleware);\n } else {\n throw new Error(\"@Use decorator can only be applied to classes or methods\");\n }\n };\n}\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\nimport type { AuthMeta, HttpMethod } from \"../runtime/metadata/types.js\";\n\nexport function Auth(scheme: string, options?: { scopes?: string[]; optional?: boolean }) {\n return function (\n target: any,\n context: ClassMethodDecoratorContext\n ) {\n if (context.kind !== \"method\") {\n throw new Error(\"@Auth decorator can only be applied to methods\");\n }\n\n const methodName = String(context.name);\n const bucket = getBucket(context.metadata);\n let op = bucket.ops.find(op => op.methodName === methodName);\n if (!op) {\n op = {\n httpMethod: \"GET\" as HttpMethod,\n path: \"/\",\n methodName,\n };\n bucket.ops.push(op);\n }\n\n op.auth = {\n scheme,\n scopes: options?.scopes,\n optional: options?.optional ?? false,\n };\n };\n}\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\nimport type { HttpMethod } from \"../runtime/metadata/types.js\";\n\nexport function Public() {\n return function (\n target: any,\n context: ClassMethodDecoratorContext\n ) {\n if (context.kind !== \"method\") {\n throw new Error(\"@Public decorator can only be applied to methods\");\n }\n\n const methodName = String(context.name);\n const bucket = getBucket(context.metadata);\n let op = bucket.ops.find(op => op.methodName === methodName);\n if (!op) {\n op = {\n httpMethod: \"GET\" as HttpMethod,\n path: \"/\",\n methodName,\n };\n bucket.ops.push(op);\n }\n\n op.auth = \"public\";\n };\n}\n","import { ADORN_META } from \"./key.js\";\nimport type { AdornBucket } from \"./types.js\";\n\nexport function readAdornBucket(ctor: Function): AdornBucket | null {\n const metaSym = (Symbol as any).metadata as symbol | undefined;\n if (!metaSym) {\n return null;\n }\n\n const classMetadata = (ctor as any)[metaSym] as DecoratorMetadata | undefined;\n if (!classMetadata) {\n return null;\n }\n\n const bucket = classMetadata[ADORN_META] as AdornBucket | undefined;\n return bucket ?? null;\n}\n","const ADORN_META = Symbol.for(\"adorn-api.metadata\");\n\ninterface SchemaFrag {\n [key: string]: unknown;\n}\n\ninterface SchemaMetadata {\n schema: {\n props: Record<string, SchemaFrag[]>;\n };\n}\n\nfunction getOrCreateMetadata(metadata: Record<PropertyKey, unknown>): SchemaMetadata {\n const meta = (metadata[ADORN_META] ??= {}) as SchemaMetadata;\n meta.schema ??= { props: {} };\n return meta;\n}\n\nfunction pushSchemaFrag(\n target: Object,\n propertyKey: string | symbol,\n metadata: Record<PropertyKey, unknown>,\n frag: SchemaFrag\n): void {\n const meta = getOrCreateMetadata(metadata);\n const props = meta.schema.props;\n (props[propertyKey as string] ??= []).push(frag);\n}\n\ntype PropertyDecorator = (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => void;\n\nexport function Schema(frag: SchemaFrag): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, frag);\n };\n}\n\nexport function Min(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { minimum: n });\n };\n}\n\nexport function Max(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { maximum: n });\n };\n}\n\nexport function ExclusiveMin(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { exclusiveMinimum: n });\n };\n}\n\nexport function ExclusiveMax(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { exclusiveMaximum: n });\n };\n}\n\nexport function MinLength(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { minLength: n });\n };\n}\n\nexport function MaxLength(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { maxLength: n });\n };\n}\n\nexport function Pattern(re: RegExp | string): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { pattern: typeof re === \"string\" ? re : re.source });\n };\n}\n\nexport function Format(fmt: string): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { format: fmt });\n };\n}\n\nexport function MinItems(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { minItems: n });\n };\n}\n\nexport function MaxItems(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { maxItems: n });\n };\n}\n\nexport function MinProperties(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { minProperties: n });\n };\n}\n\nexport function MaxProperties(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { maxProperties: n });\n };\n}\n\nexport function MultipleOf(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { multipleOf: n });\n };\n}\n\nexport function Example(value: unknown): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { example: value });\n };\n}\n\nexport function Examples(values: unknown[]): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { examples: values });\n };\n}\n\nexport function Description(desc: string): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { description: desc });\n };\n}\n\nexport function Enum<T extends string | number>(vals: T[]): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { enum: vals });\n };\n}\n\nexport function Const<T>(val: T): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { const: val });\n };\n}\n\nexport function Default<T>(val: T): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { default: val });\n };\n}\n\nexport function AdditionalProperties(value: boolean | Record<string, unknown>): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { additionalProperties: value });\n };\n}\n\nexport function Closed(): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { additionalProperties: false });\n };\n}\n\nexport function ClosedUnevaluated(): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { unevaluatedProperties: false });\n };\n}\n\nexport function Union(mode: \"anyOf\" | \"oneOf\" | \"allOf\"): ClassDecorator {\n return function (target: Function): void {\n (target as any)[ADORN_META] = (target as any)[ADORN_META] ?? {};\n const meta = (target as any)[ADORN_META] as SchemaMetadata;\n meta.schema = meta.schema ?? { props: {} };\n (meta.schema as any).unionMode = mode;\n };\n}\n\nexport { ADORN_META };\nexport type { SchemaFrag, SchemaMetadata };\n","import Ajv from \"ajv\";\nimport addFormats from \"ajv-formats\";\nimport type { ErrorObject } from \"ajv\";\n\nexport interface ValidationError {\n path: string;\n message: string;\n keyword: string;\n params: Record<string, unknown>;\n}\n\nexport interface ValidationResult {\n valid: boolean;\n errors: ValidationError[] | null;\n}\n\nexport class ValidationErrorResponse extends Error {\n constructor(\n public statusCode: number,\n public errors: ValidationError[]\n ) {\n super(\"Validation failed\");\n this.name = \"ValidationErrorResponse\";\n }\n}\n\nexport function createValidator() {\n const ajv = new Ajv.default({\n allErrors: true,\n coerceTypes: false,\n strict: false,\n validateFormats: true,\n });\n\n addFormats.default(ajv);\n\n ajv.addFormat(\"br-phone\", /^\\(\\d{2}\\)\\s\\d{5}-\\d{4}$/);\n\n return ajv;\n}\n\nexport function validateData(\n ajv: ReturnType<typeof createValidator>,\n data: unknown,\n schema: Record<string, unknown>,\n dataPath: string = \"#\"\n): ValidationResult {\n const validate = ajv.compile(schema);\n const valid = validate(data);\n\n if (valid) {\n return { valid: true, errors: null };\n }\n\n const errors: ValidationError[] = (validate.errors || []).map((err: ErrorObject) => ({\n path: formatErrorPath(dataPath, err),\n message: err.message || \"Invalid value\",\n keyword: err.keyword,\n params: err.params as Record<string, unknown>,\n }));\n\n return { valid: false, errors };\n}\n\nfunction formatErrorPath(basePath: string, err: ErrorObject): string {\n const instancePath = err.instancePath;\n\n if (!instancePath || instancePath === \"\") {\n return basePath;\n }\n\n if (basePath === \"#\" || basePath.endsWith(\"/\")) {\n return `${basePath}${instancePath.slice(1)}`;\n }\n\n return `${basePath}${instancePath}`;\n}\n\nexport function formatValidationErrors(errors: ValidationError[]): Record<string, unknown> {\n const formatted: Record<string, string[]> = {};\n\n for (const error of errors) {\n const path = error.path || \"body\";\n if (!formatted[path]) {\n formatted[path] = [];\n }\n formatted[path].push(error.message);\n }\n\n return {\n error: \"Validation failed\",\n details: formatted,\n };\n}\n","import \"./runtime/polyfill.js\";\n\nconst ADORN_META = Symbol.for(\"adorn-api.metadata\");\n\ninterface HttpMetadata {\n consumes?: string[];\n produces?: string[];\n queryStyles?: Record<string, QueryStyleOptions>;\n fileParts?: Record<string, FilePartOptions>;\n cookies?: Record<string, boolean>;\n}\n\ninterface QueryStyleOptions {\n style?: \"form\" | \"spaceDelimited\" | \"pipeDelimited\" | \"deepObject\";\n explode?: boolean;\n allowReserved?: boolean;\n}\n\ninterface FilePartOptions {\n contentType?: string;\n headers?: Record<string, string>;\n}\n\ninterface DecoratorMetadata {\n [ADORN_META]?: HttpMetadata;\n}\n\nfunction getMetadata(target: Object): HttpMetadata {\n const metadata = (target as DecoratorMetadata)[ADORN_META] ?? {};\n (target as DecoratorMetadata)[ADORN_META] = metadata;\n return metadata;\n}\n\nexport type QueryStyle = QueryStyleOptions;\n\nexport function QueryStyle(options: QueryStyleOptions): ParameterDecorator {\n return function (_target: Object, _propertyKey: string | symbol, _parameterIndex: number): void {\n const metadata = getMetadata(_target);\n metadata.queryStyles ??= {};\n metadata.queryStyles[_propertyKey.toString()] = options;\n } as ParameterDecorator;\n}\n\nexport type PartType = FilePartOptions;\n\nexport function PartType(contentTypeOrOptions: string | FilePartOptions): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n const metadata = getMetadata(target);\n const options: FilePartOptions = typeof contentTypeOrOptions === \"string\"\n ? { contentType: contentTypeOrOptions }\n : contentTypeOrOptions;\n metadata.fileParts ??= {};\n metadata.fileParts[propertyKey.toString()] = options;\n };\n}\n\nexport function File(): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n const metadata = getMetadata(target);\n metadata.fileParts ??= {};\n metadata.fileParts[propertyKey.toString()] = metadata.fileParts[propertyKey.toString()] ?? {};\n };\n}\n\nexport function Consumes(...contentTypes: string[]): ClassDecorator {\n return function (target: Function): void {\n const metadata = getMetadata(target.prototype);\n metadata.consumes = contentTypes;\n };\n}\n\nexport function Produces(...contentTypes: string[]): ClassDecorator {\n return function (target: Function): void {\n const metadata = getMetadata(target.prototype);\n metadata.produces = contentTypes;\n };\n}\n\nexport type Cookies<T = any> = T;\n\nexport { ADORN_META };\nexport type { HttpMetadata, QueryStyleOptions, FilePartOptions };\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { stat } from \"node:fs/promises\";\n\ninterface OpenApi {\n openapi: string;\n components?: {\n schemas?: Record<string, unknown>;\n };\n paths?: Record<string, unknown>;\n info?: Record<string, unknown>;\n security?: Array<Record<string, string[]>>;\n}\n\ninterface Manifest {\n manifestVersion: number;\n generatedAt: string;\n generator: {\n name: string;\n version: string;\n typescript: string;\n };\n schemas: {\n kind: string;\n file: string;\n componentsSchemasPointer: string;\n };\n validation: {\n mode: \"none\" | \"ajv-runtime\" | \"precompiled\";\n precompiledModule: string | null;\n };\n controllers: Array<{\n controllerId: string;\n basePath: string;\n operations: Array<{\n operationId: string;\n http: {\n method: string;\n path: string;\n };\n handler: {\n methodName: string;\n };\n args: {\n body: {\n index: number;\n required: boolean;\n contentType: string;\n schemaRef: string;\n } | null;\n path: Array<{\n name: string;\n index: number;\n required: boolean;\n schemaRef: string;\n schemaType?: string | string[];\n }>;\n query: Array<{\n name: string;\n index: number;\n required: boolean;\n schemaRef: string;\n schemaType?: string | string[];\n }>;\n headers: Array<{\n name: string;\n index: number;\n required: boolean;\n schemaRef: string;\n schemaType?: string | string[];\n }>;\n cookies: Array<{\n name: string;\n index: number;\n required: boolean;\n schemaRef: string;\n schemaType?: string | string[];\n }>;\n };\n responses: Array<{\n status: number;\n contentType: string;\n schemaRef: string;\n isArray?: boolean;\n }>;\n }>;\n }>;\n}\n\ninterface ValidatorModule {\n validators: Record<string, {\n body?: (data: unknown) => boolean;\n response: Record<string, (data: unknown) => boolean>;\n }>;\n validateBody: (operationId: string, data: unknown) => { ok: boolean; errors: unknown[] | null };\n validateResponse: (operationId: string, status: number, contentType: string, data: unknown) => { ok: boolean; errors: unknown[] | null };\n}\n\ninterface ArtifactCacheEntry {\n openapi: OpenApi | null;\n manifest: Manifest | null;\n validators: ValidatorModule | null;\n mtimes: {\n openapi: number | null;\n manifest: number | null;\n validators: number | null;\n };\n}\n\nconst artifactCache = new Map<string, ArtifactCacheEntry>();\n\nasync function getMtime(filePath: string): Promise<number | null> {\n try {\n const stats = await stat(filePath);\n return stats.mtimeMs;\n } catch {\n return null;\n }\n}\n\nexport interface LoadArtifactsOptions {\n outDir: string;\n}\n\nexport interface LoadedArtifacts {\n openapi: OpenApi;\n manifest: Manifest;\n validators: ValidatorModule | null;\n}\n\nexport async function loadArtifacts(options: LoadArtifactsOptions): Promise<LoadedArtifacts> {\n const { outDir } = options;\n const cacheKey = path.resolve(outDir);\n\n let entry = artifactCache.get(cacheKey);\n\n const openapiPath = path.join(outDir, \"openapi.json\");\n const manifestPath = path.join(outDir, \"manifest.json\");\n const validatorsPath = path.join(outDir, \"validators.mjs\");\n\n const openapiMtime = await getMtime(openapiPath);\n const manifestMtime = await getMtime(manifestPath);\n const validatorsMtime = await getMtime(validatorsPath);\n\n if (entry) {\n const mtimesMatch = \n entry.mtimes.openapi === openapiMtime &&\n entry.mtimes.manifest === manifestMtime &&\n entry.mtimes.validators === validatorsMtime;\n\n if (mtimesMatch) {\n if (entry.openapi && entry.manifest) {\n return {\n openapi: entry.openapi,\n manifest: entry.manifest,\n validators: entry.validators,\n };\n }\n }\n }\n\n const openapiContent = fs.readFileSync(openapiPath, \"utf-8\");\n const manifestContent = fs.readFileSync(manifestPath, \"utf-8\");\n\n const openapi = JSON.parse(openapiContent) as OpenApi;\n const manifest = JSON.parse(manifestContent) as Manifest;\n\n let validators: ValidatorModule | null = null;\n\n if (manifest.validation.mode === \"precompiled\" && manifest.validation.precompiledModule) {\n try {\n const validatorsModule = await import(path.join(outDir, manifest.validation.precompiledModule));\n validators = validatorsModule as ValidatorModule;\n } catch (err) {\n console.warn(`Failed to load precompiled validators: ${err}`);\n }\n }\n\n artifactCache.set(cacheKey, {\n openapi,\n manifest,\n validators,\n mtimes: {\n openapi: openapiMtime,\n manifest: manifestMtime,\n validators: validatorsMtime,\n },\n });\n\n return {\n openapi,\n manifest,\n validators,\n };\n}\n\nexport function clearArtifactCache(outDir?: string): void {\n if (outDir) {\n const cacheKey = path.resolve(outDir);\n artifactCache.delete(cacheKey);\n } else {\n artifactCache.clear();\n }\n}\n\nexport function getArtifactCacheStats(): { size: number; keys: string[] } {\n return {\n size: artifactCache.size,\n keys: Array.from(artifactCache.keys()),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,oBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEC,OAAe,aAAa,uBAAO,iBAAiB;;;ACF9C,IAAM,aAAa,uBAAO,IAAI,gBAAgB;;;ACG9C,SAAS,UAAU,UAA0C;AAClE,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,MAAM,kGAAkG;AAAA,EACpH;AACA,MAAI,SAAS,SAAS,UAAU;AAChC,MAAI,CAAC,QAAQ;AACX,aAAS,EAAE,KAAK,CAAC,GAAG,eAAe,CAAC,EAAE;AACtC,aAAS,UAAU,IAAI;AAAA,EACzB;AACA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AAA,MACN,SAAS;AAAA,MACT,UAAU;AAAA,MACV,YAAY;AAAA,IACd;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,SAAS,mBAAmB,QAAuB;AACxD,MAAI,QAAQ;AACV,UAAM,WAAW,iBAAAA,QAAK,QAAQ,MAAM;AACpC,kBAAc,OAAO,QAAQ;AAAA,EAC/B,OAAO;AACL,kBAAc,MAAM;AAAA,EACtB;AACF;AAEO,SAAS,wBAA0D;AACxE,SAAO;AAAA,IACL,MAAM,cAAc;AAAA,IACpB,MAAM,MAAM,KAAK,cAAc,KAAK,CAAC;AAAA,EACvC;AACF;","names":["ADORN_META","path","op","op","op","op","ADORN_META","Ajv","addFormats","path","ADORN_META","path","fs"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/runtime/polyfill.ts","../src/runtime/metadata/key.ts","../src/runtime/metadata/bucket.ts","../src/decorators/Controller.ts","../src/decorators/methods.ts","../src/decorators/Use.ts","../src/decorators/Auth.ts","../src/decorators/Public.ts","../src/runtime/metadata/read.ts","../src/schema/decorators.ts","../src/runtime/validation/ajv.ts","../src/http.ts","../src/compiler/cache/loadArtifacts.ts"],"sourcesContent":["import \"./runtime/polyfill.js\";\n\nexport { Controller, Get, Post, Put, Patch, Delete, Use, Auth, Public } from \"./decorators/index.js\";\nexport { readAdornBucket } from \"./runtime/metadata/read.js\";\nexport type { HttpMethod, RouteOperation, AdornBucket, AuthMeta, ExpressMw } from \"./runtime/metadata/types.js\";\nexport type { AuthSchemeRuntime, AuthResult } from \"./runtime/auth/runtime.js\";\nexport * from \"./schema/index.js\";\nexport { createValidator, formatValidationErrors, ValidationErrorResponse } from \"./runtime/validation/index.js\";\nexport {\n QueryStyle,\n File,\n PartType,\n Consumes,\n Produces,\n} from \"./http.js\";\nexport type { Query, Body, Headers, Cookies } from \"./http.js\";\nexport type { QueryStyleOptions, FilePartOptions, HttpMetadata } from \"./http.js\";\nexport type { UploadFile } from \"./runtime/upload.js\";\nexport { loadArtifacts, clearArtifactCache, getArtifactCacheStats } from \"./compiler/cache/loadArtifacts.js\";\n","// Polyfill Symbol.metadata for environments that don't support it\n// Must run before any decorated classes are imported\n(Symbol as any).metadata ??= Symbol(\"Symbol.metadata\");\n\n// Export a symbol to prevent tree-shaking\nexport const ADORN_POLYFILL = Symbol(\"adorn-polyfill\");\n","export const ADORN_META = Symbol.for(\"adorn-api/meta\");\n","import { ADORN_META } from \"./key.js\";\nimport type { AdornBucket } from \"./types.js\";\n\nexport function getBucket(metadata: DecoratorMetadata): AdornBucket {\n if (!metadata) {\n throw new Error(\"Decorator context.metadata is undefined. Ensure Symbol.metadata polyfill runs before decorators.\");\n }\n let bucket = metadata[ADORN_META] as AdornBucket | undefined;\n if (!bucket) {\n bucket = { ops: [], controllerUse: [] };\n metadata[ADORN_META] = bucket;\n }\n if (!bucket.controllerUse) {\n bucket.controllerUse = [];\n }\n return bucket;\n}\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\n\nexport function Controller(basePath: string) {\n return function <T extends new (...args: any[]) => any>(\n target: T,\n context: ClassDecoratorContext<T>\n ): T | void {\n const bucket = getBucket(context.metadata);\n bucket.basePath = basePath;\n };\n}\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\nimport type { HttpMethod } from \"../runtime/metadata/types.js\";\n\nfunction createMethodDecorator(httpMethod: HttpMethod, path: string) {\n return function <T extends (...args: any[]) => any>(\n target: T,\n context: ClassMethodDecoratorContext<any, T>\n ): T | void {\n if (context.private || context.static) {\n return;\n }\n\n const methodName = String(context.name);\n const bucket = getBucket(context.metadata);\n\n let op = bucket.ops.find(op => op.methodName === methodName);\n if (!op) {\n op = {\n httpMethod,\n path,\n methodName,\n };\n bucket.ops.push(op);\n } else {\n op.httpMethod = httpMethod;\n op.path = path;\n }\n };\n}\n\nexport const Get = (path: string) => createMethodDecorator(\"GET\", path);\nexport const Post = (path: string) => createMethodDecorator(\"POST\", path);\nexport const Put = (path: string) => createMethodDecorator(\"PUT\", path);\nexport const Patch = (path: string) => createMethodDecorator(\"PATCH\", path);\nexport const Delete = (path: string) => createMethodDecorator(\"DELETE\", path);\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\nimport type { ExpressMw, HttpMethod } from \"../runtime/metadata/types.js\";\n\ntype UseTarget = string | ExpressMw;\n\nexport function Use(...middleware: UseTarget[]) {\n return function (\n target: any,\n context: ClassDecoratorContext | ClassMethodDecoratorContext\n ) {\n if (context.kind === \"class\") {\n const bucket = getBucket(context.metadata);\n if (!bucket.controllerUse) {\n bucket.controllerUse = [];\n }\n bucket.controllerUse.push(...middleware);\n } else if (context.kind === \"method\") {\n const methodName = String(context.name);\n const bucket = getBucket(context.metadata);\n let op = bucket.ops.find(op => op.methodName === methodName);\n if (!op) {\n op = {\n httpMethod: \"GET\" as HttpMethod,\n path: \"/\",\n methodName,\n };\n bucket.ops.push(op);\n }\n if (!op.use) {\n op.use = [];\n }\n op.use.push(...middleware);\n } else {\n throw new Error(\"@Use decorator can only be applied to classes or methods\");\n }\n };\n}\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\nimport type { AuthMeta, HttpMethod } from \"../runtime/metadata/types.js\";\n\nexport function Auth(scheme: string, options?: { scopes?: string[]; optional?: boolean }) {\n return function (\n target: any,\n context: ClassMethodDecoratorContext\n ) {\n if (context.kind !== \"method\") {\n throw new Error(\"@Auth decorator can only be applied to methods\");\n }\n\n const methodName = String(context.name);\n const bucket = getBucket(context.metadata);\n let op = bucket.ops.find(op => op.methodName === methodName);\n if (!op) {\n op = {\n httpMethod: \"GET\" as HttpMethod,\n path: \"/\",\n methodName,\n };\n bucket.ops.push(op);\n }\n\n op.auth = {\n scheme,\n scopes: options?.scopes,\n optional: options?.optional ?? false,\n };\n };\n}\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\nimport type { HttpMethod } from \"../runtime/metadata/types.js\";\n\nexport function Public() {\n return function (\n target: any,\n context: ClassMethodDecoratorContext\n ) {\n if (context.kind !== \"method\") {\n throw new Error(\"@Public decorator can only be applied to methods\");\n }\n\n const methodName = String(context.name);\n const bucket = getBucket(context.metadata);\n let op = bucket.ops.find(op => op.methodName === methodName);\n if (!op) {\n op = {\n httpMethod: \"GET\" as HttpMethod,\n path: \"/\",\n methodName,\n };\n bucket.ops.push(op);\n }\n\n op.auth = \"public\";\n };\n}\n","import { ADORN_META } from \"./key.js\";\nimport type { AdornBucket } from \"./types.js\";\n\nexport function readAdornBucket(ctor: Function): AdornBucket | null {\n const metaSym = (Symbol as any).metadata as symbol | undefined;\n if (!metaSym) {\n return null;\n }\n\n const classMetadata = (ctor as any)[metaSym] as DecoratorMetadata | undefined;\n if (!classMetadata) {\n return null;\n }\n\n const bucket = classMetadata[ADORN_META] as AdornBucket | undefined;\n return bucket ?? null;\n}\n","const ADORN_META = Symbol.for(\"adorn-api.metadata\");\n\ninterface SchemaFrag {\n [key: string]: unknown;\n}\n\ninterface SchemaMetadata {\n schema: {\n props: Record<string, SchemaFrag[]>;\n };\n}\n\nfunction getOrCreateMetadata(metadata: Record<PropertyKey, unknown>): SchemaMetadata {\n const meta = (metadata[ADORN_META] ??= {}) as SchemaMetadata;\n meta.schema ??= { props: {} };\n return meta;\n}\n\nfunction pushSchemaFrag(\n target: Object,\n propertyKey: string | symbol,\n metadata: Record<PropertyKey, unknown>,\n frag: SchemaFrag\n): void {\n const meta = getOrCreateMetadata(metadata);\n const props = meta.schema.props;\n (props[propertyKey as string] ??= []).push(frag);\n}\n\ntype PropertyDecorator = (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => void;\n\nexport function Schema(frag: SchemaFrag): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, frag);\n };\n}\n\nexport function Min(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { minimum: n });\n };\n}\n\nexport function Max(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { maximum: n });\n };\n}\n\nexport function ExclusiveMin(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { exclusiveMinimum: n });\n };\n}\n\nexport function ExclusiveMax(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { exclusiveMaximum: n });\n };\n}\n\nexport function MinLength(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { minLength: n });\n };\n}\n\nexport function MaxLength(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { maxLength: n });\n };\n}\n\nexport function Pattern(re: RegExp | string): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { pattern: typeof re === \"string\" ? re : re.source });\n };\n}\n\nexport function Format(fmt: string): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { format: fmt });\n };\n}\n\nexport function MinItems(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { minItems: n });\n };\n}\n\nexport function MaxItems(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { maxItems: n });\n };\n}\n\nexport function MinProperties(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { minProperties: n });\n };\n}\n\nexport function MaxProperties(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { maxProperties: n });\n };\n}\n\nexport function MultipleOf(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { multipleOf: n });\n };\n}\n\nexport function Example(value: unknown): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { example: value });\n };\n}\n\nexport function Examples(values: unknown[]): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { examples: values });\n };\n}\n\nexport function Description(desc: string): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { description: desc });\n };\n}\n\nexport function Enum<T extends string | number>(vals: T[]): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { enum: vals });\n };\n}\n\nexport function Const<T>(val: T): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { const: val });\n };\n}\n\nexport function Default<T>(val: T): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { default: val });\n };\n}\n\nexport function AdditionalProperties(value: boolean | Record<string, unknown>): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { additionalProperties: value });\n };\n}\n\nexport function Closed(): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { additionalProperties: false });\n };\n}\n\nexport function ClosedUnevaluated(): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { unevaluatedProperties: false });\n };\n}\n\nexport function Union(mode: \"anyOf\" | \"oneOf\" | \"allOf\"): ClassDecorator {\n return function (target: Function): void {\n (target as any)[ADORN_META] = (target as any)[ADORN_META] ?? {};\n const meta = (target as any)[ADORN_META] as SchemaMetadata;\n meta.schema = meta.schema ?? { props: {} };\n (meta.schema as any).unionMode = mode;\n };\n}\n\nexport { ADORN_META };\nexport type { SchemaFrag, SchemaMetadata };\n","import Ajv from \"ajv\";\nimport addFormats from \"ajv-formats\";\nimport type { ErrorObject } from \"ajv\";\n\nexport interface ValidationError {\n path: string;\n message: string;\n keyword: string;\n params: Record<string, unknown>;\n}\n\nexport interface ValidationResult {\n valid: boolean;\n errors: ValidationError[] | null;\n}\n\nexport class ValidationErrorResponse extends Error {\n constructor(\n public statusCode: number,\n public errors: ValidationError[]\n ) {\n super(\"Validation failed\");\n this.name = \"ValidationErrorResponse\";\n }\n}\n\nexport function createValidator() {\n const ajv = new Ajv.default({\n allErrors: true,\n coerceTypes: false,\n strict: false,\n validateFormats: true,\n });\n\n addFormats.default(ajv);\n\n ajv.addFormat(\"br-phone\", /^\\(\\d{2}\\)\\s\\d{5}-\\d{4}$/);\n\n return ajv;\n}\n\nexport function validateData(\n ajv: ReturnType<typeof createValidator>,\n data: unknown,\n schema: Record<string, unknown>,\n dataPath: string = \"#\"\n): ValidationResult {\n const validate = ajv.compile(schema);\n const valid = validate(data);\n\n if (valid) {\n return { valid: true, errors: null };\n }\n\n const errors: ValidationError[] = (validate.errors || []).map((err: ErrorObject) => ({\n path: formatErrorPath(dataPath, err),\n message: err.message || \"Invalid value\",\n keyword: err.keyword,\n params: err.params as Record<string, unknown>,\n }));\n\n return { valid: false, errors };\n}\n\nfunction formatErrorPath(basePath: string, err: ErrorObject): string {\n const instancePath = err.instancePath;\n\n if (!instancePath || instancePath === \"\") {\n return basePath;\n }\n\n if (basePath === \"#\" || basePath.endsWith(\"/\")) {\n return `${basePath}${instancePath.slice(1)}`;\n }\n\n return `${basePath}${instancePath}`;\n}\n\nexport function formatValidationErrors(errors: ValidationError[]): Record<string, unknown> {\n const formatted: Record<string, string[]> = {};\n\n for (const error of errors) {\n const path = error.path || \"body\";\n if (!formatted[path]) {\n formatted[path] = [];\n }\n formatted[path].push(error.message);\n }\n\n return {\n error: \"Validation failed\",\n details: formatted,\n };\n}\n","import \"./runtime/polyfill.js\";\n\nconst ADORN_META = Symbol.for(\"adorn-api.metadata\");\n\ninterface HttpMetadata {\n consumes?: string[];\n produces?: string[];\n queryStyles?: Record<string, QueryStyleOptions>;\n fileParts?: Record<string, FilePartOptions>;\n cookies?: Record<string, boolean>;\n}\n\ninterface QueryStyleOptions {\n style?: \"form\" | \"spaceDelimited\" | \"pipeDelimited\" | \"deepObject\";\n explode?: boolean;\n allowReserved?: boolean;\n}\n\ninterface FilePartOptions {\n contentType?: string;\n headers?: Record<string, string>;\n}\n\ntype DecoratorMetadata = Record<PropertyKey, unknown> & { [ADORN_META]?: HttpMetadata };\n\nfunction getMetadata(target: Object | DecoratorMetadata): HttpMetadata {\n const host = target as DecoratorMetadata;\n const metadata = host[ADORN_META] ?? {};\n host[ADORN_META] = metadata;\n return metadata;\n}\n\nexport type QueryStyle = QueryStyleOptions;\n\nexport function QueryStyle(options: QueryStyleOptions) {\n return function <T extends (...args: any[]) => any>(\n _target: T,\n context: ClassMethodDecoratorContext<any, T>\n ): void {\n if (context.private || context.static) return;\n const metadata = getMetadata(context.metadata);\n metadata.queryStyles ??= {};\n metadata.queryStyles[String(context.name)] = options;\n };\n}\n\nexport type PartType = FilePartOptions;\n\nexport function PartType(contentTypeOrOptions: string | FilePartOptions): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n const metadata = getMetadata(target);\n const options: FilePartOptions = typeof contentTypeOrOptions === \"string\"\n ? { contentType: contentTypeOrOptions }\n : contentTypeOrOptions;\n metadata.fileParts ??= {};\n metadata.fileParts[propertyKey.toString()] = options;\n };\n}\n\nexport function File(): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n const metadata = getMetadata(target);\n metadata.fileParts ??= {};\n metadata.fileParts[propertyKey.toString()] = metadata.fileParts[propertyKey.toString()] ?? {};\n };\n}\n\nexport function Consumes(...contentTypes: string[]): ClassDecorator {\n return function (target: Function): void {\n const metadata = getMetadata(target.prototype);\n metadata.consumes = contentTypes;\n };\n}\n\nexport function Produces(...contentTypes: string[]): ClassDecorator {\n return function (target: Function): void {\n const metadata = getMetadata(target.prototype);\n metadata.produces = contentTypes;\n };\n}\n\nexport type Query<T = any> = T;\nexport type Body<T = any> = T;\nexport type Headers<T = any> = T;\nexport type Cookies<T = any> = T;\n\nexport { ADORN_META };\nexport type { HttpMetadata, QueryStyleOptions, FilePartOptions };\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { stat } from \"node:fs/promises\";\n\ninterface OpenApi {\n openapi: string;\n components?: {\n schemas?: Record<string, unknown>;\n };\n paths?: Record<string, unknown>;\n info?: Record<string, unknown>;\n security?: Array<Record<string, string[]>>;\n}\n\ninterface Manifest {\n manifestVersion: number;\n generatedAt: string;\n generator: {\n name: string;\n version: string;\n typescript: string;\n };\n schemas: {\n kind: string;\n file: string;\n componentsSchemasPointer: string;\n };\n validation: {\n mode: \"none\" | \"ajv-runtime\" | \"precompiled\";\n precompiledModule: string | null;\n };\n controllers: Array<{\n controllerId: string;\n basePath: string;\n operations: Array<{\n operationId: string;\n http: {\n method: string;\n path: string;\n };\n handler: {\n methodName: string;\n };\n args: {\n body: {\n index: number;\n required: boolean;\n contentType: string;\n schemaRef: string;\n } | null;\n path: Array<{\n name: string;\n index: number;\n required: boolean;\n schemaRef: string;\n schemaType?: string | string[];\n }>;\n query: Array<{\n name: string;\n index: number;\n required: boolean;\n schemaRef: string;\n schemaType?: string | string[];\n }>;\n headers: Array<{\n name: string;\n index: number;\n required: boolean;\n schemaRef: string;\n schemaType?: string | string[];\n }>;\n cookies: Array<{\n name: string;\n index: number;\n required: boolean;\n schemaRef: string;\n schemaType?: string | string[];\n }>;\n };\n responses: Array<{\n status: number;\n contentType: string;\n schemaRef: string;\n isArray?: boolean;\n }>;\n }>;\n }>;\n}\n\ninterface ValidatorModule {\n validators: Record<string, {\n body?: (data: unknown) => boolean;\n response: Record<string, (data: unknown) => boolean>;\n }>;\n validateBody: (operationId: string, data: unknown) => { ok: boolean; errors: unknown[] | null };\n validateResponse: (operationId: string, status: number, contentType: string, data: unknown) => { ok: boolean; errors: unknown[] | null };\n}\n\ninterface ArtifactCacheEntry {\n openapi: OpenApi | null;\n manifest: Manifest | null;\n validators: ValidatorModule | null;\n mtimes: {\n openapi: number | null;\n manifest: number | null;\n validators: number | null;\n };\n}\n\nconst artifactCache = new Map<string, ArtifactCacheEntry>();\n\nasync function getMtime(filePath: string): Promise<number | null> {\n try {\n const stats = await stat(filePath);\n return stats.mtimeMs;\n } catch {\n return null;\n }\n}\n\nexport interface LoadArtifactsOptions {\n outDir: string;\n}\n\nexport interface LoadedArtifacts {\n openapi: OpenApi;\n manifest: Manifest;\n validators: ValidatorModule | null;\n}\n\nexport async function loadArtifacts(options: LoadArtifactsOptions): Promise<LoadedArtifacts> {\n const { outDir } = options;\n const cacheKey = path.resolve(outDir);\n\n let entry = artifactCache.get(cacheKey);\n\n const openapiPath = path.join(outDir, \"openapi.json\");\n const manifestPath = path.join(outDir, \"manifest.json\");\n const validatorsPath = path.join(outDir, \"validators.mjs\");\n\n const openapiMtime = await getMtime(openapiPath);\n const manifestMtime = await getMtime(manifestPath);\n const validatorsMtime = await getMtime(validatorsPath);\n\n if (entry) {\n const mtimesMatch = \n entry.mtimes.openapi === openapiMtime &&\n entry.mtimes.manifest === manifestMtime &&\n entry.mtimes.validators === validatorsMtime;\n\n if (mtimesMatch) {\n if (entry.openapi && entry.manifest) {\n return {\n openapi: entry.openapi,\n manifest: entry.manifest,\n validators: entry.validators,\n };\n }\n }\n }\n\n const openapiContent = fs.readFileSync(openapiPath, \"utf-8\");\n const manifestContent = fs.readFileSync(manifestPath, \"utf-8\");\n\n const openapi = JSON.parse(openapiContent) as OpenApi;\n const manifest = JSON.parse(manifestContent) as Manifest;\n\n let validators: ValidatorModule | null = null;\n\n if (manifest.validation.mode === \"precompiled\" && manifest.validation.precompiledModule) {\n try {\n const validatorsModule = await import(path.join(outDir, manifest.validation.precompiledModule));\n validators = validatorsModule as ValidatorModule;\n } catch (err) {\n console.warn(`Failed to load precompiled validators: ${err}`);\n }\n }\n\n artifactCache.set(cacheKey, {\n openapi,\n manifest,\n validators,\n mtimes: {\n openapi: openapiMtime,\n manifest: manifestMtime,\n validators: validatorsMtime,\n },\n });\n\n return {\n openapi,\n manifest,\n validators,\n };\n}\n\nexport function clearArtifactCache(outDir?: string): void {\n if (outDir) {\n const cacheKey = path.resolve(outDir);\n artifactCache.delete(cacheKey);\n } else {\n artifactCache.clear();\n }\n}\n\nexport function getArtifactCacheStats(): { size: number; keys: string[] } {\n return {\n size: artifactCache.size,\n keys: Array.from(artifactCache.keys()),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,oBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEC,OAAe,aAAa,uBAAO,iBAAiB;;;ACF9C,IAAM,aAAa,uBAAO,IAAI,gBAAgB;;;ACG9C,SAAS,UAAU,UAA0C;AAClE,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,MAAM,kGAAkG;AAAA,EACpH;AACA,MAAI,SAAS,SAAS,UAAU;AAChC,MAAI,CAAC,QAAQ;AACX,aAAS,EAAE,KAAK,CAAC,GAAG,eAAe,CAAC,EAAE;AACtC,aAAS,UAAU,IAAI;AAAA,EACzB;AACA,MAAI,CAAC,OAAO,eAAe;AACzB,WAAO,gBAAgB,CAAC;AAAA,EAC1B;AACA,SAAO;AACT;;;ACdO,SAAS,WAAW,UAAkB;AAC3C,SAAO,SACL,QACA,SACU;AACV,UAAM,SAAS,UAAU,QAAQ,QAAQ;AACzC,WAAO,WAAW;AAAA,EACpB;AACF;;;ACPA,SAAS,s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AAQ;AACV,UAAM,WAAW,iBAAAA,QAAK,QAAQ,MAAM;AACpC,kBAAc,OAAO,QAAQ;AAAA,EAC/B,OAAO;AACL,kBAAc,MAAM;AAAA,EACtB;AACF;AAEO,SAAS,wBAA0D;AACxE,SAAO;AAAA,IACL,MAAM,cAAc;AAAA,IACpB,MAAM,MAAM,KAAK,cAAc,KAAK,CAAC;AAAA,EACvC;AACF;","names":["ADORN_META","path","op","op","op","op","ADORN_META","Ajv","addFormats","path","ADORN_META","path","fs"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type { AuthSchemeRuntime, AuthResult } from "./runtime/auth/runtime.js";
|
|
|
6
6
|
export * from "./schema/index.js";
|
|
7
7
|
export { createValidator, formatValidationErrors, ValidationErrorResponse } from "./runtime/validation/index.js";
|
|
8
8
|
export { QueryStyle, File, PartType, Consumes, Produces, } from "./http.js";
|
|
9
|
-
export type { Cookies } from "./http.js";
|
|
9
|
+
export type { Query, Body, Headers, Cookies } from "./http.js";
|
|
10
10
|
export type { QueryStyleOptions, FilePartOptions, HttpMetadata } from "./http.js";
|
|
11
11
|
export type { UploadFile } from "./runtime/upload.js";
|
|
12
12
|
export { loadArtifacts, clearArtifactCache, getArtifactCacheStats } from "./compiler/cache/loadArtifacts.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACrG,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,6BAA6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AkB,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -323,15 +323,17 @@ function formatValidationErrors(errors) {
|
|
|
323
323
|
// src/http.ts
|
|
324
324
|
var ADORN_META3 = /* @__PURE__ */ Symbol.for("adorn-api.metadata");
|
|
325
325
|
function getMetadata(target) {
|
|
326
|
-
const
|
|
327
|
-
|
|
326
|
+
const host = target;
|
|
327
|
+
const metadata = host[ADORN_META3] ?? {};
|
|
328
|
+
host[ADORN_META3] = metadata;
|
|
328
329
|
return metadata;
|
|
329
330
|
}
|
|
330
331
|
function QueryStyle(options) {
|
|
331
|
-
return function(_target,
|
|
332
|
-
|
|
332
|
+
return function(_target, context) {
|
|
333
|
+
if (context.private || context.static) return;
|
|
334
|
+
const metadata = getMetadata(context.metadata);
|
|
333
335
|
metadata.queryStyles ??= {};
|
|
334
|
-
metadata.queryStyles[
|
|
336
|
+
metadata.queryStyles[String(context.name)] = options;
|
|
335
337
|
};
|
|
336
338
|
}
|
|
337
339
|
function PartType(contentTypeOrOptions) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/runtime/polyfill.ts","../src/runtime/metadata/key.ts","../src/runtime/metadata/bucket.ts","../src/decorators/Controller.ts","../src/decorators/methods.ts","../src/decorators/Use.ts","../src/decorators/Auth.ts","../src/decorators/Public.ts","../src/runtime/metadata/read.ts","../src/schema/decorators.ts","../src/runtime/validation/ajv.ts","../src/http.ts","../src/compiler/cache/loadArtifacts.ts"],"sourcesContent":["// Polyfill Symbol.metadata for environments that don't support it\n// Must run before any decorated classes are imported\n(Symbol as any).metadata ??= Symbol(\"Symbol.metadata\");\n\n// Export a symbol to prevent tree-shaking\nexport const ADORN_POLYFILL = Symbol(\"adorn-polyfill\");\n","export const ADORN_META = Symbol.for(\"adorn-api/meta\");\n","import { ADORN_META } from \"./key.js\";\nimport type { AdornBucket } from \"./types.js\";\n\nexport function getBucket(metadata: DecoratorMetadata): AdornBucket {\n if (!metadata) {\n throw new Error(\"Decorator context.metadata is undefined. Ensure Symbol.metadata polyfill runs before decorators.\");\n }\n let bucket = metadata[ADORN_META] as AdornBucket | undefined;\n if (!bucket) {\n bucket = { ops: [], controllerUse: [] };\n metadata[ADORN_META] = bucket;\n }\n if (!bucket.controllerUse) {\n bucket.controllerUse = [];\n }\n return bucket;\n}\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\n\nexport function Controller(basePath: string) {\n return function <T extends new (...args: any[]) => any>(\n target: T,\n context: ClassDecoratorContext<T>\n ): T | void {\n const bucket = getBucket(context.metadata);\n bucket.basePath = basePath;\n };\n}\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\nimport type { HttpMethod } from \"../runtime/metadata/types.js\";\n\nfunction createMethodDecorator(httpMethod: HttpMethod, path: string) {\n return function <T extends (...args: any[]) => any>(\n target: T,\n context: ClassMethodDecoratorContext<any, T>\n ): T | void {\n if (context.private || context.static) {\n return;\n }\n\n const methodName = String(context.name);\n const bucket = getBucket(context.metadata);\n\n let op = bucket.ops.find(op => op.methodName === methodName);\n if (!op) {\n op = {\n httpMethod,\n path,\n methodName,\n };\n bucket.ops.push(op);\n } else {\n op.httpMethod = httpMethod;\n op.path = path;\n }\n };\n}\n\nexport const Get = (path: string) => createMethodDecorator(\"GET\", path);\nexport const Post = (path: string) => createMethodDecorator(\"POST\", path);\nexport const Put = (path: string) => createMethodDecorator(\"PUT\", path);\nexport const Patch = (path: string) => createMethodDecorator(\"PATCH\", path);\nexport const Delete = (path: string) => createMethodDecorator(\"DELETE\", path);\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\nimport type { ExpressMw, HttpMethod } from \"../runtime/metadata/types.js\";\n\ntype UseTarget = string | ExpressMw;\n\nexport function Use(...middleware: UseTarget[]) {\n return function (\n target: any,\n context: ClassDecoratorContext | ClassMethodDecoratorContext\n ) {\n if (context.kind === \"class\") {\n const bucket = getBucket(context.metadata);\n if (!bucket.controllerUse) {\n bucket.controllerUse = [];\n }\n bucket.controllerUse.push(...middleware);\n } else if (context.kind === \"method\") {\n const methodName = String(context.name);\n const bucket = getBucket(context.metadata);\n let op = bucket.ops.find(op => op.methodName === methodName);\n if (!op) {\n op = {\n httpMethod: \"GET\" as HttpMethod,\n path: \"/\",\n methodName,\n };\n bucket.ops.push(op);\n }\n if (!op.use) {\n op.use = [];\n }\n op.use.push(...middleware);\n } else {\n throw new Error(\"@Use decorator can only be applied to classes or methods\");\n }\n };\n}\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\nimport type { AuthMeta, HttpMethod } from \"../runtime/metadata/types.js\";\n\nexport function Auth(scheme: string, options?: { scopes?: string[]; optional?: boolean }) {\n return function (\n target: any,\n context: ClassMethodDecoratorContext\n ) {\n if (context.kind !== \"method\") {\n throw new Error(\"@Auth decorator can only be applied to methods\");\n }\n\n const methodName = String(context.name);\n const bucket = getBucket(context.metadata);\n let op = bucket.ops.find(op => op.methodName === methodName);\n if (!op) {\n op = {\n httpMethod: \"GET\" as HttpMethod,\n path: \"/\",\n methodName,\n };\n bucket.ops.push(op);\n }\n\n op.auth = {\n scheme,\n scopes: options?.scopes,\n optional: options?.optional ?? false,\n };\n };\n}\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\nimport type { HttpMethod } from \"../runtime/metadata/types.js\";\n\nexport function Public() {\n return function (\n target: any,\n context: ClassMethodDecoratorContext\n ) {\n if (context.kind !== \"method\") {\n throw new Error(\"@Public decorator can only be applied to methods\");\n }\n\n const methodName = String(context.name);\n const bucket = getBucket(context.metadata);\n let op = bucket.ops.find(op => op.methodName === methodName);\n if (!op) {\n op = {\n httpMethod: \"GET\" as HttpMethod,\n path: \"/\",\n methodName,\n };\n bucket.ops.push(op);\n }\n\n op.auth = \"public\";\n };\n}\n","import { ADORN_META } from \"./key.js\";\nimport type { AdornBucket } from \"./types.js\";\n\nexport function readAdornBucket(ctor: Function): AdornBucket | null {\n const metaSym = (Symbol as any).metadata as symbol | undefined;\n if (!metaSym) {\n return null;\n }\n\n const classMetadata = (ctor as any)[metaSym] as DecoratorMetadata | undefined;\n if (!classMetadata) {\n return null;\n }\n\n const bucket = classMetadata[ADORN_META] as AdornBucket | undefined;\n return bucket ?? null;\n}\n","const ADORN_META = Symbol.for(\"adorn-api.metadata\");\n\ninterface SchemaFrag {\n [key: string]: unknown;\n}\n\ninterface SchemaMetadata {\n schema: {\n props: Record<string, SchemaFrag[]>;\n };\n}\n\nfunction getOrCreateMetadata(metadata: Record<PropertyKey, unknown>): SchemaMetadata {\n const meta = (metadata[ADORN_META] ??= {}) as SchemaMetadata;\n meta.schema ??= { props: {} };\n return meta;\n}\n\nfunction pushSchemaFrag(\n target: Object,\n propertyKey: string | symbol,\n metadata: Record<PropertyKey, unknown>,\n frag: SchemaFrag\n): void {\n const meta = getOrCreateMetadata(metadata);\n const props = meta.schema.props;\n (props[propertyKey as string] ??= []).push(frag);\n}\n\ntype PropertyDecorator = (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => void;\n\nexport function Schema(frag: SchemaFrag): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, frag);\n };\n}\n\nexport function Min(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { minimum: n });\n };\n}\n\nexport function Max(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { maximum: n });\n };\n}\n\nexport function ExclusiveMin(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { exclusiveMinimum: n });\n };\n}\n\nexport function ExclusiveMax(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { exclusiveMaximum: n });\n };\n}\n\nexport function MinLength(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { minLength: n });\n };\n}\n\nexport function MaxLength(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { maxLength: n });\n };\n}\n\nexport function Pattern(re: RegExp | string): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { pattern: typeof re === \"string\" ? re : re.source });\n };\n}\n\nexport function Format(fmt: string): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { format: fmt });\n };\n}\n\nexport function MinItems(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { minItems: n });\n };\n}\n\nexport function MaxItems(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { maxItems: n });\n };\n}\n\nexport function MinProperties(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { minProperties: n });\n };\n}\n\nexport function MaxProperties(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { maxProperties: n });\n };\n}\n\nexport function MultipleOf(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { multipleOf: n });\n };\n}\n\nexport function Example(value: unknown): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { example: value });\n };\n}\n\nexport function Examples(values: unknown[]): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { examples: values });\n };\n}\n\nexport function Description(desc: string): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { description: desc });\n };\n}\n\nexport function Enum<T extends string | number>(vals: T[]): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { enum: vals });\n };\n}\n\nexport function Const<T>(val: T): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { const: val });\n };\n}\n\nexport function Default<T>(val: T): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { default: val });\n };\n}\n\nexport function AdditionalProperties(value: boolean | Record<string, unknown>): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { additionalProperties: value });\n };\n}\n\nexport function Closed(): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { additionalProperties: false });\n };\n}\n\nexport function ClosedUnevaluated(): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { unevaluatedProperties: false });\n };\n}\n\nexport function Union(mode: \"anyOf\" | \"oneOf\" | \"allOf\"): ClassDecorator {\n return function (target: Function): void {\n (target as any)[ADORN_META] = (target as any)[ADORN_META] ?? {};\n const meta = (target as any)[ADORN_META] as SchemaMetadata;\n meta.schema = meta.schema ?? { props: {} };\n (meta.schema as any).unionMode = mode;\n };\n}\n\nexport { ADORN_META };\nexport type { SchemaFrag, SchemaMetadata };\n","import Ajv from \"ajv\";\nimport addFormats from \"ajv-formats\";\nimport type { ErrorObject } from \"ajv\";\n\nexport interface ValidationError {\n path: string;\n message: string;\n keyword: string;\n params: Record<string, unknown>;\n}\n\nexport interface ValidationResult {\n valid: boolean;\n errors: ValidationError[] | null;\n}\n\nexport class ValidationErrorResponse extends Error {\n constructor(\n public statusCode: number,\n public errors: ValidationError[]\n ) {\n super(\"Validation failed\");\n this.name = \"ValidationErrorResponse\";\n }\n}\n\nexport function createValidator() {\n const ajv = new Ajv.default({\n allErrors: true,\n coerceTypes: false,\n strict: false,\n validateFormats: true,\n });\n\n addFormats.default(ajv);\n\n ajv.addFormat(\"br-phone\", /^\\(\\d{2}\\)\\s\\d{5}-\\d{4}$/);\n\n return ajv;\n}\n\nexport function validateData(\n ajv: ReturnType<typeof createValidator>,\n data: unknown,\n schema: Record<string, unknown>,\n dataPath: string = \"#\"\n): ValidationResult {\n const validate = ajv.compile(schema);\n const valid = validate(data);\n\n if (valid) {\n return { valid: true, errors: null };\n }\n\n const errors: ValidationError[] = (validate.errors || []).map((err: ErrorObject) => ({\n path: formatErrorPath(dataPath, err),\n message: err.message || \"Invalid value\",\n keyword: err.keyword,\n params: err.params as Record<string, unknown>,\n }));\n\n return { valid: false, errors };\n}\n\nfunction formatErrorPath(basePath: string, err: ErrorObject): string {\n const instancePath = err.instancePath;\n\n if (!instancePath || instancePath === \"\") {\n return basePath;\n }\n\n if (basePath === \"#\" || basePath.endsWith(\"/\")) {\n return `${basePath}${instancePath.slice(1)}`;\n }\n\n return `${basePath}${instancePath}`;\n}\n\nexport function formatValidationErrors(errors: ValidationError[]): Record<string, unknown> {\n const formatted: Record<string, string[]> = {};\n\n for (const error of errors) {\n const path = error.path || \"body\";\n if (!formatted[path]) {\n formatted[path] = [];\n }\n formatted[path].push(error.message);\n }\n\n return {\n error: \"Validation failed\",\n details: formatted,\n };\n}\n","import \"./runtime/polyfill.js\";\n\nconst ADORN_META = Symbol.for(\"adorn-api.metadata\");\n\ninterface HttpMetadata {\n consumes?: string[];\n produces?: string[];\n queryStyles?: Record<string, QueryStyleOptions>;\n fileParts?: Record<string, FilePartOptions>;\n cookies?: Record<string, boolean>;\n}\n\ninterface QueryStyleOptions {\n style?: \"form\" | \"spaceDelimited\" | \"pipeDelimited\" | \"deepObject\";\n explode?: boolean;\n allowReserved?: boolean;\n}\n\ninterface FilePartOptions {\n contentType?: string;\n headers?: Record<string, string>;\n}\n\ninterface DecoratorMetadata {\n [ADORN_META]?: HttpMetadata;\n}\n\nfunction getMetadata(target: Object): HttpMetadata {\n const metadata = (target as DecoratorMetadata)[ADORN_META] ?? {};\n (target as DecoratorMetadata)[ADORN_META] = metadata;\n return metadata;\n}\n\nexport type QueryStyle = QueryStyleOptions;\n\nexport function QueryStyle(options: QueryStyleOptions): ParameterDecorator {\n return function (_target: Object, _propertyKey: string | symbol, _parameterIndex: number): void {\n const metadata = getMetadata(_target);\n metadata.queryStyles ??= {};\n metadata.queryStyles[_propertyKey.toString()] = options;\n } as ParameterDecorator;\n}\n\nexport type PartType = FilePartOptions;\n\nexport function PartType(contentTypeOrOptions: string | FilePartOptions): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n const metadata = getMetadata(target);\n const options: FilePartOptions = typeof contentTypeOrOptions === \"string\"\n ? { contentType: contentTypeOrOptions }\n : contentTypeOrOptions;\n metadata.fileParts ??= {};\n metadata.fileParts[propertyKey.toString()] = options;\n };\n}\n\nexport function File(): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n const metadata = getMetadata(target);\n metadata.fileParts ??= {};\n metadata.fileParts[propertyKey.toString()] = metadata.fileParts[propertyKey.toString()] ?? {};\n };\n}\n\nexport function Consumes(...contentTypes: string[]): ClassDecorator {\n return function (target: Function): void {\n const metadata = getMetadata(target.prototype);\n metadata.consumes = contentTypes;\n };\n}\n\nexport function Produces(...contentTypes: string[]): ClassDecorator {\n return function (target: Function): void {\n const metadata = getMetadata(target.prototype);\n metadata.produces = contentTypes;\n };\n}\n\nexport type Cookies<T = any> = T;\n\nexport { ADORN_META };\nexport type { HttpMetadata, QueryStyleOptions, FilePartOptions };\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { stat } from \"node:fs/promises\";\n\ninterface OpenApi {\n openapi: string;\n components?: {\n schemas?: Record<string, unknown>;\n };\n paths?: Record<string, unknown>;\n info?: Record<string, unknown>;\n security?: Array<Record<string, string[]>>;\n}\n\ninterface Manifest {\n manifestVersion: number;\n generatedAt: string;\n generator: {\n name: string;\n version: string;\n typescript: string;\n };\n schemas: {\n kind: string;\n file: string;\n componentsSchemasPointer: string;\n };\n validation: {\n mode: \"none\" | \"ajv-runtime\" | \"precompiled\";\n precompiledModule: string | null;\n };\n controllers: Array<{\n controllerId: string;\n basePath: string;\n operations: Array<{\n operationId: string;\n http: {\n method: string;\n path: string;\n };\n handler: {\n methodName: string;\n };\n args: {\n body: {\n index: number;\n required: boolean;\n contentType: string;\n schemaRef: string;\n } | null;\n path: Array<{\n name: string;\n index: number;\n required: boolean;\n schemaRef: string;\n schemaType?: string | string[];\n }>;\n query: Array<{\n name: string;\n index: number;\n required: boolean;\n schemaRef: string;\n schemaType?: string | string[];\n }>;\n headers: Array<{\n name: string;\n index: number;\n required: boolean;\n schemaRef: string;\n schemaType?: string | string[];\n }>;\n cookies: Array<{\n name: string;\n index: number;\n required: boolean;\n schemaRef: string;\n schemaType?: string | string[];\n }>;\n };\n responses: Array<{\n status: number;\n contentType: string;\n schemaRef: string;\n isArray?: boolean;\n }>;\n }>;\n }>;\n}\n\ninterface ValidatorModule {\n validators: Record<string, {\n body?: (data: unknown) => boolean;\n response: Record<string, (data: unknown) => boolean>;\n }>;\n validateBody: (operationId: string, data: unknown) => { ok: boolean; errors: unknown[] | null };\n validateResponse: (operationId: string, status: number, contentType: string, data: unknown) => { ok: boolean; errors: unknown[] | null };\n}\n\ninterface ArtifactCacheEntry {\n openapi: OpenApi | null;\n manifest: Manifest | null;\n validators: ValidatorModule | null;\n mtimes: {\n openapi: number | null;\n manifest: number | null;\n validators: number | null;\n };\n}\n\nconst artifactCache = new Map<string, ArtifactCacheEntry>();\n\nasync function getMtime(filePath: string): Promise<number | null> {\n try {\n const stats = await stat(filePath);\n return stats.mtimeMs;\n } catch {\n return null;\n }\n}\n\nexport interface LoadArtifactsOptions {\n outDir: string;\n}\n\nexport interface LoadedArtifacts {\n openapi: OpenApi;\n manifest: Manifest;\n validators: ValidatorModule | null;\n}\n\nexport async function loadArtifacts(options: LoadArtifactsOptions): Promise<LoadedArtifacts> {\n const { outDir } = options;\n const cacheKey = path.resolve(outDir);\n\n let entry = artifactCache.get(cacheKey);\n\n const openapiPath = path.join(outDir, \"openapi.json\");\n const manifestPath = path.join(outDir, \"manifest.json\");\n const validatorsPath = path.join(outDir, \"validators.mjs\");\n\n const openapiMtime = await getMtime(openapiPath);\n const manifestMtime = await getMtime(manifestPath);\n const validatorsMtime = await getMtime(validatorsPath);\n\n if (entry) {\n const mtimesMatch = \n entry.mtimes.openapi === openapiMtime &&\n entry.mtimes.manifest === manifestMtime &&\n entry.mtimes.validators === validatorsMtime;\n\n if (mtimesMatch) {\n if (entry.openapi && entry.manifest) {\n return {\n openapi: entry.openapi,\n manifest: entry.manifest,\n validators: entry.validators,\n };\n }\n }\n }\n\n const openapiContent = fs.readFileSync(openapiPath, \"utf-8\");\n const manifestContent = fs.readFileSync(manifestPath, \"utf-8\");\n\n const openapi = JSON.parse(openapiContent) as OpenApi;\n const manifest = JSON.parse(manifestContent) as Manifest;\n\n let validators: ValidatorModule | null = null;\n\n if (manifest.validation.mode === \"precompiled\" && manifest.validation.precompiledModule) {\n try {\n const validatorsModule = await import(path.join(outDir, manifest.validation.precompiledModule));\n validators = validatorsModule as ValidatorModule;\n } catch (err) {\n console.warn(`Failed to load precompiled validators: ${err}`);\n }\n }\n\n artifactCache.set(cacheKey, {\n openapi,\n manifest,\n validators,\n mtimes: {\n openapi: openapiMtime,\n manifest: manifestMtime,\n validators: validatorsMtime,\n },\n });\n\n return {\n openapi,\n manifest,\n validators,\n };\n}\n\nexport function clearArtifactCache(outDir?: string): void {\n if (outDir) {\n const cacheKey = path.resolve(outDir);\n artifactCache.delete(cacheKey);\n } else {\n artifactCache.clear();\n }\n}\n\nexport function getArtifactCacheStats(): { size: number; keys: string[] } {\n return {\n size: artifactCache.size,\n keys: Array.from(artifactCache.keys()),\n };\n}\n"],"mappings":";AAEC,OAAe,aAAa,uBAAO,iBAAiB;;;ACF9C,IAAM,aAAa,uBAAO,IAAI,gBAAgB;;;ACG9C,SAAS,UAAU,UAA0C;AA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,IACf,SAAS,KAAK;AACZ,cAAQ,KAAK,0CAA0C,GAAG,EAAE;AAAA,IAC9D;AAAA,EACF;AAEA,gBAAc,IAAI,UAAU;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,MACN,SAAS;AAAA,MACT,UAAU;AAAA,MACV,YAAY;AAAA,IACd;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,SAAS,mBAAmB,QAAuB;AACxD,MAAI,QAAQ;AACV,UAAM,WAAW,KAAK,QAAQ,MAAM;AACpC,kBAAc,OAAO,QAAQ;AAAA,EAC/B,OAAO;AACL,kBAAc,MAAM;AAAA,EACtB;AACF;AAEO,SAAS,wBAA0D;AACxE,SAAO;AAAA,IACL,MAAM,cAAc;AAAA,IACpB,MAAM,MAAM,KAAK,cAAc,KAAK,CAAC;AAAA,EACvC;AACF;","names":["path","op","op","op","op","ADORN_META","path","ADORN_META"]}
|
|
1
|
+
{"version":3,"sources":["../src/runtime/polyfill.ts","../src/runtime/metadata/key.ts","../src/runtime/metadata/bucket.ts","../src/decorators/Controller.ts","../src/decorators/methods.ts","../src/decorators/Use.ts","../src/decorators/Auth.ts","../src/decorators/Public.ts","../src/runtime/metadata/read.ts","../src/schema/decorators.ts","../src/runtime/validation/ajv.ts","../src/http.ts","../src/compiler/cache/loadArtifacts.ts"],"sourcesContent":["// Polyfill Symbol.metadata for environments that don't support it\n// Must run before any decorated classes are imported\n(Symbol as any).metadata ??= Symbol(\"Symbol.metadata\");\n\n// Export a symbol to prevent tree-shaking\nexport const ADORN_POLYFILL = Symbol(\"adorn-polyfill\");\n","export const ADORN_META = Symbol.for(\"adorn-api/meta\");\n","import { ADORN_META } from \"./key.js\";\nimport type { AdornBucket } from \"./types.js\";\n\nexport function getBucket(metadata: DecoratorMetadata): AdornBucket {\n if (!metadata) {\n throw new Error(\"Decorator context.metadata is undefined. Ensure Symbol.metadata polyfill runs before decorators.\");\n }\n let bucket = metadata[ADORN_META] as AdornBucket | undefined;\n if (!bucket) {\n bucket = { ops: [], controllerUse: [] };\n metadata[ADORN_META] = bucket;\n }\n if (!bucket.controllerUse) {\n bucket.controllerUse = [];\n }\n return bucket;\n}\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\n\nexport function Controller(basePath: string) {\n return function <T extends new (...args: any[]) => any>(\n target: T,\n context: ClassDecoratorContext<T>\n ): T | void {\n const bucket = getBucket(context.metadata);\n bucket.basePath = basePath;\n };\n}\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\nimport type { HttpMethod } from \"../runtime/metadata/types.js\";\n\nfunction createMethodDecorator(httpMethod: HttpMethod, path: string) {\n return function <T extends (...args: any[]) => any>(\n target: T,\n context: ClassMethodDecoratorContext<any, T>\n ): T | void {\n if (context.private || context.static) {\n return;\n }\n\n const methodName = String(context.name);\n const bucket = getBucket(context.metadata);\n\n let op = bucket.ops.find(op => op.methodName === methodName);\n if (!op) {\n op = {\n httpMethod,\n path,\n methodName,\n };\n bucket.ops.push(op);\n } else {\n op.httpMethod = httpMethod;\n op.path = path;\n }\n };\n}\n\nexport const Get = (path: string) => createMethodDecorator(\"GET\", path);\nexport const Post = (path: string) => createMethodDecorator(\"POST\", path);\nexport const Put = (path: string) => createMethodDecorator(\"PUT\", path);\nexport const Patch = (path: string) => createMethodDecorator(\"PATCH\", path);\nexport const Delete = (path: string) => createMethodDecorator(\"DELETE\", path);\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\nimport type { ExpressMw, HttpMethod } from \"../runtime/metadata/types.js\";\n\ntype UseTarget = string | ExpressMw;\n\nexport function Use(...middleware: UseTarget[]) {\n return function (\n target: any,\n context: ClassDecoratorContext | ClassMethodDecoratorContext\n ) {\n if (context.kind === \"class\") {\n const bucket = getBucket(context.metadata);\n if (!bucket.controllerUse) {\n bucket.controllerUse = [];\n }\n bucket.controllerUse.push(...middleware);\n } else if (context.kind === \"method\") {\n const methodName = String(context.name);\n const bucket = getBucket(context.metadata);\n let op = bucket.ops.find(op => op.methodName === methodName);\n if (!op) {\n op = {\n httpMethod: \"GET\" as HttpMethod,\n path: \"/\",\n methodName,\n };\n bucket.ops.push(op);\n }\n if (!op.use) {\n op.use = [];\n }\n op.use.push(...middleware);\n } else {\n throw new Error(\"@Use decorator can only be applied to classes or methods\");\n }\n };\n}\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\nimport type { AuthMeta, HttpMethod } from \"../runtime/metadata/types.js\";\n\nexport function Auth(scheme: string, options?: { scopes?: string[]; optional?: boolean }) {\n return function (\n target: any,\n context: ClassMethodDecoratorContext\n ) {\n if (context.kind !== \"method\") {\n throw new Error(\"@Auth decorator can only be applied to methods\");\n }\n\n const methodName = String(context.name);\n const bucket = getBucket(context.metadata);\n let op = bucket.ops.find(op => op.methodName === methodName);\n if (!op) {\n op = {\n httpMethod: \"GET\" as HttpMethod,\n path: \"/\",\n methodName,\n };\n bucket.ops.push(op);\n }\n\n op.auth = {\n scheme,\n scopes: options?.scopes,\n optional: options?.optional ?? false,\n };\n };\n}\n","import { getBucket } from \"../runtime/metadata/bucket.js\";\nimport type { HttpMethod } from \"../runtime/metadata/types.js\";\n\nexport function Public() {\n return function (\n target: any,\n context: ClassMethodDecoratorContext\n ) {\n if (context.kind !== \"method\") {\n throw new Error(\"@Public decorator can only be applied to methods\");\n }\n\n const methodName = String(context.name);\n const bucket = getBucket(context.metadata);\n let op = bucket.ops.find(op => op.methodName === methodName);\n if (!op) {\n op = {\n httpMethod: \"GET\" as HttpMethod,\n path: \"/\",\n methodName,\n };\n bucket.ops.push(op);\n }\n\n op.auth = \"public\";\n };\n}\n","import { ADORN_META } from \"./key.js\";\nimport type { AdornBucket } from \"./types.js\";\n\nexport function readAdornBucket(ctor: Function): AdornBucket | null {\n const metaSym = (Symbol as any).metadata as symbol | undefined;\n if (!metaSym) {\n return null;\n }\n\n const classMetadata = (ctor as any)[metaSym] as DecoratorMetadata | undefined;\n if (!classMetadata) {\n return null;\n }\n\n const bucket = classMetadata[ADORN_META] as AdornBucket | undefined;\n return bucket ?? null;\n}\n","const ADORN_META = Symbol.for(\"adorn-api.metadata\");\n\ninterface SchemaFrag {\n [key: string]: unknown;\n}\n\ninterface SchemaMetadata {\n schema: {\n props: Record<string, SchemaFrag[]>;\n };\n}\n\nfunction getOrCreateMetadata(metadata: Record<PropertyKey, unknown>): SchemaMetadata {\n const meta = (metadata[ADORN_META] ??= {}) as SchemaMetadata;\n meta.schema ??= { props: {} };\n return meta;\n}\n\nfunction pushSchemaFrag(\n target: Object,\n propertyKey: string | symbol,\n metadata: Record<PropertyKey, unknown>,\n frag: SchemaFrag\n): void {\n const meta = getOrCreateMetadata(metadata);\n const props = meta.schema.props;\n (props[propertyKey as string] ??= []).push(frag);\n}\n\ntype PropertyDecorator = (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => void;\n\nexport function Schema(frag: SchemaFrag): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, frag);\n };\n}\n\nexport function Min(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { minimum: n });\n };\n}\n\nexport function Max(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { maximum: n });\n };\n}\n\nexport function ExclusiveMin(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { exclusiveMinimum: n });\n };\n}\n\nexport function ExclusiveMax(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { exclusiveMaximum: n });\n };\n}\n\nexport function MinLength(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { minLength: n });\n };\n}\n\nexport function MaxLength(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { maxLength: n });\n };\n}\n\nexport function Pattern(re: RegExp | string): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { pattern: typeof re === \"string\" ? re : re.source });\n };\n}\n\nexport function Format(fmt: string): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { format: fmt });\n };\n}\n\nexport function MinItems(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { minItems: n });\n };\n}\n\nexport function MaxItems(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { maxItems: n });\n };\n}\n\nexport function MinProperties(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { minProperties: n });\n };\n}\n\nexport function MaxProperties(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { maxProperties: n });\n };\n}\n\nexport function MultipleOf(n: number): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { multipleOf: n });\n };\n}\n\nexport function Example(value: unknown): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { example: value });\n };\n}\n\nexport function Examples(values: unknown[]): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { examples: values });\n };\n}\n\nexport function Description(desc: string): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { description: desc });\n };\n}\n\nexport function Enum<T extends string | number>(vals: T[]): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { enum: vals });\n };\n}\n\nexport function Const<T>(val: T): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { const: val });\n };\n}\n\nexport function Default<T>(val: T): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { default: val });\n };\n}\n\nexport function AdditionalProperties(value: boolean | Record<string, unknown>): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { additionalProperties: value });\n };\n}\n\nexport function Closed(): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { additionalProperties: false });\n };\n}\n\nexport function ClosedUnevaluated(): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n pushSchemaFrag(target, propertyKey, {}, { unevaluatedProperties: false });\n };\n}\n\nexport function Union(mode: \"anyOf\" | \"oneOf\" | \"allOf\"): ClassDecorator {\n return function (target: Function): void {\n (target as any)[ADORN_META] = (target as any)[ADORN_META] ?? {};\n const meta = (target as any)[ADORN_META] as SchemaMetadata;\n meta.schema = meta.schema ?? { props: {} };\n (meta.schema as any).unionMode = mode;\n };\n}\n\nexport { ADORN_META };\nexport type { SchemaFrag, SchemaMetadata };\n","import Ajv from \"ajv\";\nimport addFormats from \"ajv-formats\";\nimport type { ErrorObject } from \"ajv\";\n\nexport interface ValidationError {\n path: string;\n message: string;\n keyword: string;\n params: Record<string, unknown>;\n}\n\nexport interface ValidationResult {\n valid: boolean;\n errors: ValidationError[] | null;\n}\n\nexport class ValidationErrorResponse extends Error {\n constructor(\n public statusCode: number,\n public errors: ValidationError[]\n ) {\n super(\"Validation failed\");\n this.name = \"ValidationErrorResponse\";\n }\n}\n\nexport function createValidator() {\n const ajv = new Ajv.default({\n allErrors: true,\n coerceTypes: false,\n strict: false,\n validateFormats: true,\n });\n\n addFormats.default(ajv);\n\n ajv.addFormat(\"br-phone\", /^\\(\\d{2}\\)\\s\\d{5}-\\d{4}$/);\n\n return ajv;\n}\n\nexport function validateData(\n ajv: ReturnType<typeof createValidator>,\n data: unknown,\n schema: Record<string, unknown>,\n dataPath: string = \"#\"\n): ValidationResult {\n const validate = ajv.compile(schema);\n const valid = validate(data);\n\n if (valid) {\n return { valid: true, errors: null };\n }\n\n const errors: ValidationError[] = (validate.errors || []).map((err: ErrorObject) => ({\n path: formatErrorPath(dataPath, err),\n message: err.message || \"Invalid value\",\n keyword: err.keyword,\n params: err.params as Record<string, unknown>,\n }));\n\n return { valid: false, errors };\n}\n\nfunction formatErrorPath(basePath: string, err: ErrorObject): string {\n const instancePath = err.instancePath;\n\n if (!instancePath || instancePath === \"\") {\n return basePath;\n }\n\n if (basePath === \"#\" || basePath.endsWith(\"/\")) {\n return `${basePath}${instancePath.slice(1)}`;\n }\n\n return `${basePath}${instancePath}`;\n}\n\nexport function formatValidationErrors(errors: ValidationError[]): Record<string, unknown> {\n const formatted: Record<string, string[]> = {};\n\n for (const error of errors) {\n const path = error.path || \"body\";\n if (!formatted[path]) {\n formatted[path] = [];\n }\n formatted[path].push(error.message);\n }\n\n return {\n error: \"Validation failed\",\n details: formatted,\n };\n}\n","import \"./runtime/polyfill.js\";\n\nconst ADORN_META = Symbol.for(\"adorn-api.metadata\");\n\ninterface HttpMetadata {\n consumes?: string[];\n produces?: string[];\n queryStyles?: Record<string, QueryStyleOptions>;\n fileParts?: Record<string, FilePartOptions>;\n cookies?: Record<string, boolean>;\n}\n\ninterface QueryStyleOptions {\n style?: \"form\" | \"spaceDelimited\" | \"pipeDelimited\" | \"deepObject\";\n explode?: boolean;\n allowReserved?: boolean;\n}\n\ninterface FilePartOptions {\n contentType?: string;\n headers?: Record<string, string>;\n}\n\ntype DecoratorMetadata = Record<PropertyKey, unknown> & { [ADORN_META]?: HttpMetadata };\n\nfunction getMetadata(target: Object | DecoratorMetadata): HttpMetadata {\n const host = target as DecoratorMetadata;\n const metadata = host[ADORN_META] ?? {};\n host[ADORN_META] = metadata;\n return metadata;\n}\n\nexport type QueryStyle = QueryStyleOptions;\n\nexport function QueryStyle(options: QueryStyleOptions) {\n return function <T extends (...args: any[]) => any>(\n _target: T,\n context: ClassMethodDecoratorContext<any, T>\n ): void {\n if (context.private || context.static) return;\n const metadata = getMetadata(context.metadata);\n metadata.queryStyles ??= {};\n metadata.queryStyles[String(context.name)] = options;\n };\n}\n\nexport type PartType = FilePartOptions;\n\nexport function PartType(contentTypeOrOptions: string | FilePartOptions): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n const metadata = getMetadata(target);\n const options: FilePartOptions = typeof contentTypeOrOptions === \"string\"\n ? { contentType: contentTypeOrOptions }\n : contentTypeOrOptions;\n metadata.fileParts ??= {};\n metadata.fileParts[propertyKey.toString()] = options;\n };\n}\n\nexport function File(): PropertyDecorator {\n return function (target: Object, propertyKey: string | symbol): void {\n const metadata = getMetadata(target);\n metadata.fileParts ??= {};\n metadata.fileParts[propertyKey.toString()] = metadata.fileParts[propertyKey.toString()] ?? {};\n };\n}\n\nexport function Consumes(...contentTypes: string[]): ClassDecorator {\n return function (target: Function): void {\n const metadata = getMetadata(target.prototype);\n metadata.consumes = contentTypes;\n };\n}\n\nexport function Produces(...contentTypes: string[]): ClassDecorator {\n return function (target: Function): void {\n const metadata = getMetadata(target.prototype);\n metadata.produces = contentTypes;\n };\n}\n\nexport type Query<T = any> = T;\nexport type Body<T = any> = T;\nexport type Headers<T = any> = T;\nexport type Cookies<T = any> = T;\n\nexport { ADORN_META };\nexport type { HttpMetadata, QueryStyleOptions, FilePartOptions };\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { stat } from \"node:fs/promises\";\n\ninterface OpenApi {\n openapi: string;\n components?: {\n schemas?: Record<string, unknown>;\n };\n paths?: Record<string, unknown>;\n info?: Record<string, unknown>;\n security?: Array<Record<string, string[]>>;\n}\n\ninterface Manifest {\n manifestVersion: number;\n generatedAt: string;\n generator: {\n name: string;\n version: string;\n typescript: string;\n };\n schemas: {\n kind: string;\n file: string;\n componentsSchemasPointer: string;\n };\n validation: {\n mode: \"none\" | \"ajv-runtime\" | \"precompiled\";\n precompiledModule: string | null;\n };\n controllers: Array<{\n controllerId: string;\n basePath: string;\n operations: Array<{\n operationId: string;\n http: {\n method: string;\n path: string;\n };\n handler: {\n methodName: string;\n };\n args: {\n body: {\n index: number;\n required: boolean;\n contentType: string;\n schemaRef: string;\n } | null;\n path: Array<{\n name: string;\n index: number;\n required: boolean;\n schemaRef: string;\n schemaType?: string | string[];\n }>;\n query: Array<{\n name: string;\n index: number;\n required: boolean;\n schemaRef: string;\n schemaType?: string | string[];\n }>;\n headers: Array<{\n name: string;\n index: number;\n required: boolean;\n schemaRef: string;\n schemaType?: string | string[];\n }>;\n cookies: Array<{\n name: string;\n index: number;\n required: boolean;\n schemaRef: string;\n schemaType?: string | string[];\n }>;\n };\n responses: Array<{\n status: number;\n contentType: string;\n schemaRef: string;\n isArray?: boolean;\n }>;\n }>;\n }>;\n}\n\ninterface ValidatorModule {\n validators: Record<string, {\n body?: (data: unknown) => boolean;\n response: Record<string, (data: unknown) => boolean>;\n }>;\n validateBody: (operationId: string, data: unknown) => { ok: boolean; errors: unknown[] | null };\n validateResponse: (operationId: string, status: number, contentType: string, data: unknown) => { ok: boolean; errors: unknown[] | null };\n}\n\ninterface ArtifactCacheEntry {\n openapi: OpenApi | null;\n manifest: Manifest | null;\n validators: ValidatorModule | null;\n mtimes: {\n openapi: number | null;\n manifest: number | null;\n validators: number | null;\n };\n}\n\nconst artifactCache = new Map<string, ArtifactCacheEntry>();\n\nasync function getMtime(filePath: string): Promise<number | null> {\n try {\n const stats = await stat(filePath);\n return stats.mtimeMs;\n } catch {\n return null;\n }\n}\n\nexport interface LoadArtifactsOptions {\n outDir: string;\n}\n\nexport interface LoadedArtifacts {\n openapi: OpenApi;\n manifest: Manifest;\n validators: ValidatorModule | null;\n}\n\nexport async function loadArtifacts(options: LoadArtifactsOptions): Promise<LoadedArtifacts> {\n const { outDir } = options;\n const cacheKey = path.resolve(outDir);\n\n let entry = artifactCache.get(cacheKey);\n\n const openapiPath = path.join(outDir, \"openapi.json\");\n const manifestPath = path.join(outDir, \"manifest.json\");\n const validatorsPath = path.join(outDir, \"validators.mjs\");\n\n const openapiMtime = await getMtime(openapiPath);\n const manifestMtime = await getMtime(manifestPath);\n const validatorsMtime = await getMtime(validatorsPath);\n\n if (entry) {\n const mtimesMatch = \n entry.mtimes.openapi === openapiMtime &&\n entry.mtimes.manifest === manifestMtime &&\n entry.mtimes.validators === validatorsMtime;\n\n if (mtimesMatch) {\n if (entry.openapi && entry.manifest) {\n return {\n openapi: entry.openapi,\n manifest: entry.manifest,\n validators: entry.validators,\n };\n }\n }\n }\n\n const openapiContent = fs.readFileSync(openapiPath, \"utf-8\");\n const manifestContent = fs.readFileSync(manifestPath, \"utf-8\");\n\n const openapi = JSON.parse(openapiContent) as OpenApi;\n const manifest = JSON.parse(manifestContent) as Manifest;\n\n let validators: ValidatorModule | null = null;\n\n if (manifest.validation.mode === \"precompiled\" && manifest.validation.precompiledModule) {\n try {\n const validatorsModule = await import(path.join(outDir, manifest.validation.precompiledModule));\n validators = validatorsModule as ValidatorModule;\n } catch (err) {\n console.warn(`Failed to load precompiled validators: ${err}`);\n }\n }\n\n artifactCache.set(cacheKey, {\n openapi,\n manifest,\n validators,\n mtimes: {\n openapi: openapiMtime,\n manifest: manifestMtime,\n validators: validatorsMtime,\n },\n });\n\n return {\n openapi,\n manifest,\n validators,\n };\n}\n\nexport function clearArtifactCache(outDir?: string): void {\n if (outDir) {\n const cacheKey = path.resolve(outDir);\n artifactCache.delete(cacheKey);\n } else {\n artifactCache.clear();\n }\n}\n\nexport function getArtifactCacheStats(): { size: number; keys: string[] } {\n return {\n size: artifactCache.size,\n keys: Array.from(artifactCache.keys()),\n };\n}\n"],"mappings":";AAEC,OAAe,aAAa,uBAAO,iBAAiB;;;ACF9C,IAAM,aAAa,uBAAO,IAAI,gBAAgB;;;ACG9C,SAAS,UAAU,UAA0C;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K,QAAQ,SAAS,WAAW,iBAAiB;AAC7F,mBAAa;AAAA,IACf,SAAS,KAAK;AACZ,cAAQ,KAAK,0CAA0C,GAAG,EAAE;AAAA,IAC9D;AAAA,EACF;AAEA,gBAAc,IAAI,UAAU;AAAA,IAC1B;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,MACN,SAAS;AAAA,MACT,UAAU;AAAA,MACV,YAAY;AAAA,IACd;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,SAAS,mBAAmB,QAAuB;AACxD,MAAI,QAAQ;AACV,UAAM,WAAW,KAAK,QAAQ,MAAM;AACpC,kBAAc,OAAO,QAAQ;AAAA,EAC/B,OAAO;AACL,kBAAc,MAAM;AAAA,EACtB;AACF;AAEO,SAAS,wBAA0D;AACxE,SAAO;AAAA,IACL,MAAM,cAAc;AAAA,IACpB,MAAM,MAAM,KAAK,cAAc,KAAK,CAAC;AAAA,EACvC;AACF;","names":["path","op","op","op","op","ADORN_META","path","ADORN_META"]}
|
package/dist/metal/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export { readMetalDecoratorBagFromConstructor, METAL_METADATA_KEY } from "./read
|
|
|
3
3
|
export { schemaFromEntity } from "./schemaFromEntity.js";
|
|
4
4
|
export { registerMetalEntities } from "./registerMetalEntities.js";
|
|
5
5
|
export type { SchemaFromEntityOptions, EntitySchemaMode, JsonSchema } from "./schemaFromEntity.js";
|
|
6
|
+
export type { SearchWhere, SearchWhereDepth, SearchWhereOptions, SearchWherePath } from "./searchWhere.js";
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/metal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,oCAAoC,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/metal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,oCAAoC,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnG,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { BelongsToReference, HasManyCollection, HasOneReference, ManyToManyCollection, SelectableKeys } from "metal-orm";
|
|
2
|
+
export type SearchWhereDepth = 0 | 1 | 2 | 3 | 4 | 5;
|
|
3
|
+
type PrevDepth = [0, 0, 1, 2, 3, 4];
|
|
4
|
+
type RelationWrapper = HasManyCollection<any> | ManyToManyCollection<any, any> | HasOneReference<any> | BelongsToReference<any>;
|
|
5
|
+
type RelationKeys<TEntity extends object> = {
|
|
6
|
+
[K in keyof TEntity & string]-?: NonNullable<TEntity[K]> extends RelationWrapper ? K : never;
|
|
7
|
+
}[keyof TEntity & string];
|
|
8
|
+
type RelationTarget<T> = T extends HasManyCollection<infer C extends object> ? C : T extends ManyToManyCollection<infer C extends object, any> ? C : T extends HasOneReference<infer C extends object> ? C : T extends BelongsToReference<infer C extends object> ? C : never;
|
|
9
|
+
type ScalarKeys<TEntity extends object> = SelectableKeys<TEntity> & keyof TEntity & string;
|
|
10
|
+
type AfterPrefix<Key extends string, Paths> = Paths extends `${Key}.${infer Rest}` ? Rest : never;
|
|
11
|
+
type IsWhitelistAll<IncludePaths> = [IncludePaths] extends [never] ? true : "*" extends IncludePaths ? true : false;
|
|
12
|
+
type IsExcludeAll<ExcludePaths> = "*" extends ExcludePaths ? true : false;
|
|
13
|
+
type HasDescendantPath<Key extends string, Paths> = [Extract<Paths, `${Key}.${string}`>] extends [never] ? false : true;
|
|
14
|
+
type IsScalarAllowed<Key extends string, IncludePaths, ExcludePaths> = IsExcludeAll<ExcludePaths> extends true ? false : IsWhitelistAll<IncludePaths> extends true ? [Extract<ExcludePaths, Key>] extends [never] ? true : false : [Extract<IncludePaths, Key>] extends [never] ? false : [Extract<ExcludePaths, Key>] extends [never] ? true : false;
|
|
15
|
+
type IsRelationAllowed<Key extends string, IncludePaths, ExcludePaths> = IsExcludeAll<ExcludePaths> extends true ? false : [Extract<ExcludePaths, Key | `${Key}.*`>] extends [never] ? IsWhitelistAll<IncludePaths> extends true ? true : [Extract<IncludePaths, Key | `${Key}.*`>] extends [never] ? HasDescendantPath<Key, IncludePaths> : true : false;
|
|
16
|
+
type ChildIncludePaths<Key extends string, IncludePaths> = IsWhitelistAll<IncludePaths> extends true ? never : [Extract<IncludePaths, Key | `${Key}.*`>] extends [never] ? AfterPrefix<Key, IncludePaths> : never;
|
|
17
|
+
type ChildExcludePaths<Key extends string, ExcludePaths> = IsExcludeAll<ExcludePaths> extends true ? "*" : AfterPrefix<Key, ExcludePaths>;
|
|
18
|
+
type ResolveDepth<Opts> = Opts extends {
|
|
19
|
+
maxDepth: infer D;
|
|
20
|
+
} ? D extends SearchWhereDepth ? D : 2 : 2;
|
|
21
|
+
type ResolveInclude<Opts> = Opts extends {
|
|
22
|
+
include: readonly (infer P)[];
|
|
23
|
+
} ? (P & string) : never;
|
|
24
|
+
type ResolveExclude<Opts> = Opts extends {
|
|
25
|
+
exclude: readonly (infer P)[];
|
|
26
|
+
} ? (P & string) : never;
|
|
27
|
+
type WhereShape<TEntity extends object, Depth extends SearchWhereDepth, IncludePaths, ExcludePaths> = {
|
|
28
|
+
[K in ScalarKeys<TEntity> as IsScalarAllowed<K, IncludePaths, ExcludePaths> extends true ? K : never]?: TEntity[K];
|
|
29
|
+
} & (Depth extends 0 ? {} : {
|
|
30
|
+
[K in RelationKeys<TEntity> as IsRelationAllowed<K, IncludePaths, ExcludePaths> extends true ? K : never]?: WhereShape<RelationTarget<NonNullable<TEntity[K]>>, PrevDepth[Depth], ChildIncludePaths<K, IncludePaths>, ChildExcludePaths<K, ExcludePaths>>;
|
|
31
|
+
});
|
|
32
|
+
export type SearchWherePath<TEntity extends object, Depth extends SearchWhereDepth = 2> = "*" | ScalarKeys<TEntity> | RelationKeys<TEntity> | (Depth extends 0 ? never : {
|
|
33
|
+
[K in RelationKeys<TEntity>]: `${K}.*` | `${K}.${SearchWherePath<RelationTarget<NonNullable<TEntity[K]>>, PrevDepth[Depth]>}`;
|
|
34
|
+
}[RelationKeys<TEntity>]);
|
|
35
|
+
export type SearchWhereOptions<TEntity extends object> = {
|
|
36
|
+
maxDepth?: SearchWhereDepth;
|
|
37
|
+
include?: readonly SearchWherePath<TEntity, 5>[];
|
|
38
|
+
exclude?: readonly SearchWherePath<TEntity, 5>[];
|
|
39
|
+
};
|
|
40
|
+
export type SearchWhere<TEntity extends object, Opts extends SearchWhereOptions<TEntity> = {}> = WhereShape<TEntity, ResolveDepth<Opts>, ResolveInclude<Opts>, ResolveExclude<Opts>>;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=searchWhere.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchWhere.d.ts","sourceRoot":"","sources":["../../src/metal/searchWhere.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,eAAe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AC,EAAE,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,OAAO,SAAS,MAAM,EAAE,IAAI,SAAS,kBAAkB,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,UAAU,CACzG,OAAO,EACP,YAAY,CAAC,IAAI,CAAC,EAClB,cAAc,CAAC,IAAI,CAAC,EACpB,cAAc,CAAC,IAAI,CAAC,CACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adorn-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Stage-3 decorator-first OpenAPI + routing toolkit",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"build:js": "tsup src/index.ts src/express.ts src/cli.ts src/schema/index.ts src/metal/index.ts --format esm,cjs --out-dir dist --sourcemap --no-splitting && tsup scripts/adorn-example.ts --format cjs --out-dir dist/scripts --sourcemap --no-splitting",
|
|
52
52
|
"build:types": "tsc -p tsconfig.build.json",
|
|
53
53
|
"build": "npm run clean && npm run build:js && npm run build:types",
|
|
54
|
-
"test": "
|
|
55
|
-
"test:staleness": "
|
|
54
|
+
"test": "vitest run",
|
|
55
|
+
"test:staleness": "vitest run test/cache/staleness.test.ts",
|
|
56
56
|
"dev": "tsx src/cli.ts dev",
|
|
57
57
|
"example": "tsx scripts/run-example.ts",
|
|
58
58
|
"example:list": "tsx scripts/adorn-example.ts --list",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"ajv": "^8.17.1",
|
|
66
66
|
"ajv-formats": "^3.0.1",
|
|
67
|
-
"metal-orm": "^1.0.
|
|
67
|
+
"metal-orm": "^1.0.74",
|
|
68
68
|
"swagger-ui-express": "^5.0.0",
|
|
69
69
|
"typescript": "^5.9.0"
|
|
70
70
|
},
|