adorn-api 1.0.12 → 1.0.14

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.
Files changed (171) hide show
  1. package/dist/adapter/express/auth.d.ts +8 -0
  2. package/dist/adapter/express/auth.d.ts.map +1 -1
  3. package/dist/adapter/express/bootstrap.d.ts +12 -0
  4. package/dist/adapter/express/bootstrap.d.ts.map +1 -1
  5. package/dist/adapter/express/coercion.d.ts +81 -1
  6. package/dist/adapter/express/coercion.d.ts.map +1 -1
  7. package/dist/adapter/express/index.d.ts +1 -0
  8. package/dist/adapter/express/index.d.ts.map +1 -1
  9. package/dist/adapter/express/merge.d.ts +17 -0
  10. package/dist/adapter/express/merge.d.ts.map +1 -1
  11. package/dist/adapter/express/openapi.d.ts +55 -0
  12. package/dist/adapter/express/openapi.d.ts.map +1 -1
  13. package/dist/adapter/express/router.d.ts +6 -0
  14. package/dist/adapter/express/router.d.ts.map +1 -1
  15. package/dist/adapter/express/swagger.d.ts +6 -0
  16. package/dist/adapter/express/swagger.d.ts.map +1 -1
  17. package/dist/adapter/express/types.d.ts +26 -0
  18. package/dist/adapter/express/types.d.ts.map +1 -1
  19. package/dist/adapter/express/validation.d.ts +19 -2
  20. package/dist/adapter/express/validation.d.ts.map +1 -1
  21. package/dist/cli.cjs +1016 -445
  22. package/dist/cli.cjs.map +1 -1
  23. package/dist/cli.js +1016 -445
  24. package/dist/cli.js.map +1 -1
  25. package/dist/compiler/analyze/index.d.ts +5 -0
  26. package/dist/compiler/analyze/index.d.ts.map +1 -0
  27. package/dist/compiler/analyze/scanControllers.d.ts +52 -0
  28. package/dist/compiler/analyze/scanControllers.d.ts.map +1 -1
  29. package/dist/compiler/cache/isStale.d.ts +26 -0
  30. package/dist/compiler/cache/isStale.d.ts.map +1 -1
  31. package/dist/compiler/cache/loadArtifacts.d.ts +36 -0
  32. package/dist/compiler/cache/loadArtifacts.d.ts.map +1 -1
  33. package/dist/compiler/cache/schema.d.ts +14 -0
  34. package/dist/compiler/cache/schema.d.ts.map +1 -1
  35. package/dist/compiler/cache/writeCache.d.ts +6 -0
  36. package/dist/compiler/cache/writeCache.d.ts.map +1 -1
  37. package/dist/compiler/gems.d.ts +75 -0
  38. package/dist/compiler/gems.d.ts.map +1 -0
  39. package/dist/compiler/generator/index.d.ts +7 -0
  40. package/dist/compiler/generator/index.d.ts.map +1 -0
  41. package/dist/compiler/generator/manifest.d.ts +23 -0
  42. package/dist/compiler/generator/manifest.d.ts.map +1 -0
  43. package/dist/compiler/generator/openapi.d.ts +118 -0
  44. package/dist/compiler/generator/openapi.d.ts.map +1 -0
  45. package/dist/compiler/graph/builder.d.ts +24 -0
  46. package/dist/compiler/graph/builder.d.ts.map +1 -0
  47. package/dist/compiler/graph/index.d.ts +7 -0
  48. package/dist/compiler/graph/index.d.ts.map +1 -0
  49. package/dist/compiler/graph/schemaGraph.d.ts +67 -0
  50. package/dist/compiler/graph/schemaGraph.d.ts.map +1 -0
  51. package/dist/compiler/graph/types.d.ts +203 -0
  52. package/dist/compiler/graph/types.d.ts.map +1 -0
  53. package/dist/compiler/index.d.ts +12 -0
  54. package/dist/compiler/index.d.ts.map +1 -0
  55. package/dist/compiler/ir/index.d.ts +7 -0
  56. package/dist/compiler/ir/index.d.ts.map +1 -0
  57. package/dist/compiler/ir/pipeline.d.ts +82 -0
  58. package/dist/compiler/ir/pipeline.d.ts.map +1 -0
  59. package/dist/compiler/ir/stages.d.ts +40 -0
  60. package/dist/compiler/ir/stages.d.ts.map +1 -0
  61. package/dist/compiler/ir/visitor.d.ts +98 -0
  62. package/dist/compiler/ir/visitor.d.ts.map +1 -0
  63. package/dist/compiler/manifest/emit.d.ts +14 -0
  64. package/dist/compiler/manifest/emit.d.ts.map +1 -1
  65. package/dist/compiler/manifest/format.d.ts +42 -0
  66. package/dist/compiler/manifest/format.d.ts.map +1 -1
  67. package/dist/compiler/manifest/index.d.ts +6 -0
  68. package/dist/compiler/manifest/index.d.ts.map +1 -0
  69. package/dist/compiler/runner/createProgram.d.ts +16 -0
  70. package/dist/compiler/runner/createProgram.d.ts.map +1 -1
  71. package/dist/compiler/runner/index.d.ts +5 -0
  72. package/dist/compiler/runner/index.d.ts.map +1 -0
  73. package/dist/compiler/schema/extractAnnotations.d.ts +47 -0
  74. package/dist/compiler/schema/extractAnnotations.d.ts.map +1 -1
  75. package/dist/compiler/schema/index.d.ts +6 -0
  76. package/dist/compiler/schema/index.d.ts.map +1 -0
  77. package/dist/compiler/schema/intersectionHandler.d.ts +44 -0
  78. package/dist/compiler/schema/intersectionHandler.d.ts.map +1 -0
  79. package/dist/compiler/schema/objectHandler.d.ts +106 -0
  80. package/dist/compiler/schema/objectHandler.d.ts.map +1 -0
  81. package/dist/compiler/schema/openapi.d.ts +16 -1
  82. package/dist/compiler/schema/openapi.d.ts.map +1 -1
  83. package/dist/compiler/schema/parameters.d.ts +90 -0
  84. package/dist/compiler/schema/parameters.d.ts.map +1 -0
  85. package/dist/compiler/schema/primitives.d.ts +68 -0
  86. package/dist/compiler/schema/primitives.d.ts.map +1 -0
  87. package/dist/compiler/schema/typeToJsonSchema.d.ts +22 -51
  88. package/dist/compiler/schema/typeToJsonSchema.d.ts.map +1 -1
  89. package/dist/compiler/schema/types.d.ts +69 -0
  90. package/dist/compiler/schema/types.d.ts.map +1 -0
  91. package/dist/compiler/schema/unionHandler.d.ts +70 -0
  92. package/dist/compiler/schema/unionHandler.d.ts.map +1 -0
  93. package/dist/compiler/transform/dedup.d.ts +35 -0
  94. package/dist/compiler/transform/dedup.d.ts.map +1 -0
  95. package/dist/compiler/transform/flatten.d.ts +50 -0
  96. package/dist/compiler/transform/flatten.d.ts.map +1 -0
  97. package/dist/compiler/transform/index.d.ts +7 -0
  98. package/dist/compiler/transform/index.d.ts.map +1 -0
  99. package/dist/compiler/transform/inline.d.ts +46 -0
  100. package/dist/compiler/transform/inline.d.ts.map +1 -0
  101. package/dist/compiler/validation/emitPrecompiledValidators.d.ts +16 -0
  102. package/dist/compiler/validation/emitPrecompiledValidators.d.ts.map +1 -1
  103. package/dist/compiler/validation/index.d.ts +5 -0
  104. package/dist/compiler/validation/index.d.ts.map +1 -0
  105. package/dist/decorators/Auth.d.ts +17 -0
  106. package/dist/decorators/Auth.d.ts.map +1 -1
  107. package/dist/decorators/Controller.d.ts +15 -0
  108. package/dist/decorators/Controller.d.ts.map +1 -1
  109. package/dist/decorators/Public.d.ts +13 -0
  110. package/dist/decorators/Public.d.ts.map +1 -1
  111. package/dist/decorators/Use.d.ts +18 -0
  112. package/dist/decorators/Use.d.ts.map +1 -1
  113. package/dist/decorators/methods.d.ts +20 -0
  114. package/dist/decorators/methods.d.ts.map +1 -1
  115. package/dist/express.cjs +73 -54
  116. package/dist/express.cjs.map +1 -1
  117. package/dist/express.js +73 -54
  118. package/dist/express.js.map +1 -1
  119. package/dist/http.d.ts +1 -2
  120. package/dist/http.d.ts.map +1 -1
  121. package/dist/index.cjs +161 -4
  122. package/dist/index.cjs.map +1 -1
  123. package/dist/index.d.ts +2 -0
  124. package/dist/index.d.ts.map +1 -1
  125. package/dist/index.js +156 -3
  126. package/dist/index.js.map +1 -1
  127. package/dist/metal/applyListQuery.d.ts +73 -0
  128. package/dist/metal/applyListQuery.d.ts.map +1 -1
  129. package/dist/metal/index.cjs +2 -2
  130. package/dist/metal/index.cjs.map +1 -1
  131. package/dist/metal/index.d.ts +4 -0
  132. package/dist/metal/index.d.ts.map +1 -1
  133. package/dist/metal/index.js +2 -2
  134. package/dist/metal/index.js.map +1 -1
  135. package/dist/metal/listQuery.d.ts +19 -0
  136. package/dist/metal/listQuery.d.ts.map +1 -1
  137. package/dist/metal/queryOptions.d.ts +8 -0
  138. package/dist/metal/queryOptions.d.ts.map +1 -1
  139. package/dist/metal/readMetalBag.d.ts +36 -0
  140. package/dist/metal/readMetalBag.d.ts.map +1 -1
  141. package/dist/metal/registerMetalEntities.d.ts +20 -0
  142. package/dist/metal/registerMetalEntities.d.ts.map +1 -1
  143. package/dist/metal/schemaFromEntity.d.ts +30 -0
  144. package/dist/metal/schemaFromEntity.d.ts.map +1 -1
  145. package/dist/metal/searchWhere.d.ts +39 -0
  146. package/dist/metal/searchWhere.d.ts.map +1 -1
  147. package/dist/metal/symbolMetadata.d.ts +6 -0
  148. package/dist/metal/symbolMetadata.d.ts.map +1 -1
  149. package/dist/runtime/auth/runtime.d.ts +155 -6
  150. package/dist/runtime/auth/runtime.d.ts.map +1 -1
  151. package/dist/runtime/metadata/bucket.d.ts +1 -2
  152. package/dist/runtime/metadata/bucket.d.ts.map +1 -1
  153. package/dist/runtime/metadata/key.d.ts +1 -1
  154. package/dist/runtime/metadata/key.d.ts.map +1 -1
  155. package/dist/runtime/metadata/read.d.ts +1 -2
  156. package/dist/runtime/metadata/read.d.ts.map +1 -1
  157. package/dist/runtime/metadata/types.d.ts +74 -0
  158. package/dist/runtime/metadata/types.d.ts.map +1 -1
  159. package/dist/runtime/polyfill.d.ts +1 -1
  160. package/dist/runtime/polyfill.d.ts.map +1 -1
  161. package/dist/runtime/upload.d.ts +37 -0
  162. package/dist/runtime/upload.d.ts.map +1 -1
  163. package/dist/runtime/validation/ajv.d.ts +100 -0
  164. package/dist/runtime/validation/ajv.d.ts.map +1 -1
  165. package/dist/runtime/validation/index.d.ts +9 -0
  166. package/dist/runtime/validation/index.d.ts.map +1 -1
  167. package/dist/scripts/adorn-example.cjs +238 -6
  168. package/dist/scripts/adorn-example.cjs.map +1 -1
  169. package/dist/utils/port.d.ts +9 -0
  170. package/dist/utils/port.d.ts.map +1 -0
  171. package/package.json +4 -1
@@ -1,5 +1,13 @@
1
1
  import type { Response, NextFunction } from "express";
2
2
  import type { AuthenticatedRequest, CreateRouterOptions, OpenAPI31 } from "./types.js";
3
3
  import type { BoundRoute } from "./merge.js";
4
+ /**
5
+ * Creates an authentication middleware for Express routes
6
+ *
7
+ * @param authConfig - Authentication configuration
8
+ * @param routeAuth - Route-specific authentication settings
9
+ * @param globalSecurity - Global security requirements from OpenAPI
10
+ * @returns Express middleware function
11
+ */
4
12
  export declare function createAuthMiddleware(authConfig: NonNullable<CreateRouterOptions["auth"]>, routeAuth: BoundRoute["auth"], globalSecurity: NonNullable<OpenAPI31["security"]>): (req: AuthenticatedRequest, res: Response, next: NextFunction) => Promise<void>;
5
13
  //# sourceMappingURL=auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/adapter/express/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,wBAAgB,oBAAoB,CAChC,UAAU,EAAE,WAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,EACpD,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,EAC7B,cAAc,EAAE,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,IAEpC,KAAK,oBAAoB,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,mBA4C7E"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/adapter/express/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAChC,UAAU,EAAE,WAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,EACpD,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,EAC7B,cAAc,EAAE,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,IAEpC,KAAK,oBAAoB,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,mBA4C7E"}
@@ -1,6 +1,9 @@
1
1
  import express from "express";
2
2
  import { type Server } from "http";
3
3
  import { type CreateRouterOptions } from "./index.js";
4
+ /**
5
+ * Options for bootstrapping an Express server with Adorn API
6
+ */
4
7
  export interface BootstrapOptions {
5
8
  controllers: Array<new (...args: any[]) => any>;
6
9
  port?: number;
@@ -13,6 +16,9 @@ export interface BootstrapOptions {
13
16
  auth?: CreateRouterOptions["auth"];
14
17
  coerce?: CreateRouterOptions["coerce"];
15
18
  }
19
+ /**
20
+ * Result of bootstrapping an Express server
21
+ */
16
22
  export interface BootstrapResult {
17
23
  server: Server;
18
24
  app: express.Express;
@@ -21,5 +27,11 @@ export interface BootstrapResult {
21
27
  host: string;
22
28
  close: () => Promise<void>;
23
29
  }
30
+ /**
31
+ * Bootstraps an Express server with the provided controllers and options
32
+ *
33
+ * @param options - Configuration options for the server
34
+ * @returns Promise that resolves with the server instance and metadata
35
+ */
24
36
  export declare function bootstrap(options: BootstrapOptions): Promise<BootstrapResult>;
25
37
  //# sourceMappingURL=bootstrap.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../src/adapter/express/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAuB,KAAK,mBAAmB,EAA0C,MAAM,YAAY,CAAC;AAGnH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,KAAK,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAA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,IAAI,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAkG7E"}
@@ -1,13 +1,67 @@
1
1
  import type { Request } from "express";
2
2
  import type { CoerceLocation, DateCoercionOptions, CoerceOptions } from "./types.js";
3
+ /**
4
+ * Normalizes coercion options to ensure all properties are set
5
+ *
6
+ * @param coerce - Optional coercion options
7
+ * @returns Required coercion options with defaults applied
8
+ */
3
9
  export declare function normalizeCoerceOptions(coerce?: CoerceOptions): Required<CoerceOptions>;
10
+ /**
11
+ * Gets date coercion options for a specific location
12
+ *
13
+ * @param coerce - Required coercion options
14
+ * @param location - The location to get options for
15
+ * @returns Date coercion options for the specified location
16
+ */
4
17
  export declare function getDateCoercionOptions(coerce: Required<CoerceOptions>, location: CoerceLocation): DateCoercionOptions;
18
+ /**
19
+ * Coerces dates in a value based on the schema
20
+ *
21
+ * @param value - The value to coerce
22
+ * @param schema - The schema to use for coercion
23
+ * @param dateCoercion - Date coercion options
24
+ * @param components - OpenAPI components for schema resolution
25
+ * @returns The coerced value
26
+ */
5
27
  export declare function coerceDatesWithSchema(value: any, schema: Record<string, unknown> | null, dateCoercion: DateCoercionOptions, components: Record<string, Record<string, unknown>>): any;
28
+ /**
29
+ * Coerces a parameter value based on the schema
30
+ *
31
+ * @param value - The value to coerce
32
+ * @param schema - The schema to use for coercion
33
+ * @param dateCoercion - Date coercion options
34
+ * @param components - OpenAPI components for schema resolution
35
+ * @returns The coerced value
36
+ */
6
37
  export declare function coerceParamValue(value: any, schema: Record<string, unknown> | null, dateCoercion: DateCoercionOptions, components: Record<string, Record<string, unknown>>): any;
38
+ /**
39
+ * Coerces a value based on the schema
40
+ *
41
+ * @param value - The value to coerce
42
+ * @param schema - The schema to use for coercion
43
+ * @param dateCoercion - Date coercion options
44
+ * @param components - OpenAPI components for schema resolution
45
+ * @param options - Additional coercion options
46
+ * @returns The coerced value
47
+ */
7
48
  export declare function coerceWithSchema(value: any, schema: Record<string, unknown>, dateCoercion: DateCoercionOptions, components: Record<string, Record<string, unknown>>, options: {
8
49
  coercePrimitives: boolean;
9
50
  }): any;
51
+ /**
52
+ * Checks if a value is a plain object
53
+ *
54
+ * @param value - The value to check
55
+ * @returns True if the value is a plain object
56
+ */
10
57
  export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
58
+ /**
59
+ * Parses a query value based on its schema type and serialization options
60
+ *
61
+ * @param value - The raw query value
62
+ * @param param - The parameter configuration
63
+ * @returns The parsed value
64
+ */
11
65
  export declare function parseQueryValue(value: any, param: {
12
66
  schemaType?: string | string[];
13
67
  serialization?: {
@@ -15,8 +69,34 @@ export declare function parseQueryValue(value: any, param: {
15
69
  explode?: boolean;
16
70
  };
17
71
  }): any;
72
+ /**
73
+ * Gets the raw query string from a request
74
+ *
75
+ * @param req - The Express request object
76
+ * @returns The raw query string without the leading "?"
77
+ */
18
78
  export declare function getRawQueryString(req: Request): string;
19
- export declare function parseDeepObjectParams(rawQuery: string, names: Set<string>): Record<string, unknown>;
79
+ /**
80
+ * Parses query string parameters with deep object style
81
+ *
82
+ * @param rawQuery - The raw query string
83
+ * @param names - Set of parameter names that use deepObject style
84
+ * @param maxDepth - Maximum nesting depth (default: 5)
85
+ * @returns Object containing the parsed deep object parameters
86
+ */
87
+ export declare function parseDeepObjectParams(rawQuery: string, names: Set<string>, maxDepth?: number): Record<string, unknown>;
88
+ /**
89
+ * Parses cookies from a cookie header
90
+ *
91
+ * @param cookieHeader - The cookie header string
92
+ * @returns Object containing the parsed cookies
93
+ */
20
94
  export declare function parseCookies(cookieHeader: string | undefined): Record<string, string>;
95
+ /**
96
+ * Normalizes a sort parameter to an array of strings
97
+ *
98
+ * @param sort - The sort parameter (array or string)
99
+ * @returns Array of sort field names
100
+ */
21
101
  export declare function normalizeSort(sort: unknown): string[];
22
102
  //# sourceMappingURL=coercion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"coercion.d.ts","sourceRoot":"","sources":["../../../src/adapter/express/coercion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGrF,wBAAgB,sBAAsB,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,CAUtF;AAED,wBAAgB,sBAAsB,CAClC,MAAM,EAAE,QAAQ,CAAC,aAAa,CAAC,EAC/B,QAAQ,EAAE,cAAc,GACzB,mBAAmB,CAMrB;AAED,wBAAgB,qBAAqB,CACjC,KAAK,EAAE,GAAG,EACV,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACtC,YAAY,EAAE,mBAAmB,EACjC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACpD,GAAG,CAGL;AAED,wBAAgB,gBAAgB,CAC5B,KAAK,EAAE,GAAG,EACV,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACtC,YAAY,EAAE,mBAAmB,EACjC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACpD,GAAG,CAGL;AAED,wBAA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,EAAE,GAAG,EAAE,KAAK,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAAC,aAAa,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,GAAG,GAAG,CAgCjJ;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAKtD;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACjC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,EAClB,QAAQ,GAAE,MAAU,GACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiBzB;AAyDD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAcrF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,EAAE,CAQrD"}
@@ -2,4 +2,5 @@ export * from "./types.js";
2
2
  export * from "./router.js";
3
3
  export * from "./swagger.js";
4
4
  export { bootstrap, type BootstrapOptions } from "./bootstrap.js";
5
+ export { parseDeepObjectParams, getRawQueryString } from "./coercion.js";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapter/express/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapter/express/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
@@ -1,4 +1,7 @@
1
1
  import type { ManifestV1, OperationEntry } from "../../compiler/manifest/format.js";
2
+ /**
3
+ * Represents a route bound to a controller
4
+ */
2
5
  export interface BoundRoute {
3
6
  operationId: string;
4
7
  fullPath: string;
@@ -15,12 +18,26 @@ export interface BoundRoute {
15
18
  } | "public";
16
19
  controllerUse?: Array<string | ((req: any, res: any, next: (err?: any) => void) => any)>;
17
20
  }
21
+ /**
22
+ * Binds controllers to routes from the manifest
23
+ *
24
+ * @param params - Binding parameters including controllers and manifest
25
+ * @returns Array of bound routes
26
+ */
18
27
  export declare function bindRoutes(params: {
19
28
  controllers: Array<new (...args: any[]) => any>;
20
29
  manifest: ManifestV1;
21
30
  useCache?: boolean;
22
31
  }): BoundRoute[];
32
+ /**
33
+ * Clears the route cache
34
+ */
23
35
  export declare function clearRouteCache(): void;
36
+ /**
37
+ * Gets statistics about the route cache
38
+ *
39
+ * @returns Object containing cache size and keys
40
+ */
24
41
  export declare function getRouteCacheStats(): {
25
42
  size: number;
26
43
  keys: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../src/adapter/express/merge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAMpF,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC7C,cAAc,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;IAC5C,UAAU,EAAE,MAAM,CAAC;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C;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAKrE"}
@@ -1,11 +1,66 @@
1
1
  import type { BoundRoute } from "./merge.js";
2
2
  import type { OpenAPI31 } from "./types.js";
3
+ /**
4
+ * Converts an Express path to OpenAPI path format
5
+ *
6
+ * @param path - Express path with colon parameters
7
+ * @returns OpenAPI path with curly brace parameters
8
+ */
3
9
  export declare function toOpenApiPath(path: string): string;
10
+ /**
11
+ * Gets the OpenAPI operation for a given route
12
+ *
13
+ * @param openapi - The OpenAPI specification
14
+ * @param route - The bound route
15
+ * @returns OpenAPI operation object or null
16
+ */
4
17
  export declare function getOpenApiOperation(openapi: OpenAPI31, route: BoundRoute): any | null;
18
+ /**
19
+ * Creates an index of parameter schemas by location and name
20
+ *
21
+ * @param operation - OpenAPI operation object
22
+ * @returns Map of parameter schemas keyed by location:name
23
+ */
5
24
  export declare function getParamSchemaIndex(operation: any | null): Map<string, Record<string, unknown>>;
25
+ /**
26
+ * Gets a parameter schema from the index
27
+ *
28
+ * @param index - The parameter schema index
29
+ * @param location - The parameter location
30
+ * @param name - The parameter name
31
+ * @returns Parameter schema or null
32
+ */
6
33
  export declare function getParamSchemaFromIndex(index: Map<string, Record<string, unknown>>, location: "path" | "query" | "header" | "cookie", name: string): Record<string, unknown> | null;
34
+ /**
35
+ * Gets the request body schema for an operation
36
+ *
37
+ * @param operation - OpenAPI operation object
38
+ * @param contentType - Optional content type to retrieve
39
+ * @returns Request body schema or null
40
+ */
7
41
  export declare function getRequestBodySchema(operation: any | null, contentType?: string): Record<string, unknown> | null;
42
+ /**
43
+ * Creates a schema from a type
44
+ *
45
+ * @param schemaType - Schema type (string or array of strings)
46
+ * @returns Schema object or null
47
+ */
8
48
  export declare function schemaFromType(schemaType?: string | string[]): Record<string, unknown> | null;
49
+ /**
50
+ * Resolves a schema, following $ref references
51
+ *
52
+ * @param schema - The schema to resolve
53
+ * @param components - OpenAPI components for reference resolution
54
+ * @param seen - Set of already seen references to prevent cycles
55
+ * @returns Resolved schema
56
+ */
9
57
  export declare function resolveSchema(schema: Record<string, unknown>, components: Record<string, Record<string, unknown>>, seen?: Set<string>): Record<string, unknown>;
58
+ /**
59
+ * Gets a schema from OpenAPI by reference
60
+ *
61
+ * @param openapi - The OpenAPI specification
62
+ * @param ref - The schema reference
63
+ * @returns Schema object or null
64
+ */
10
65
  export declare function getSchemaByRef(openapi: OpenAPI31, ref: string): Record<string, unknown> | null;
11
66
  //# sourceMappingURL=openapi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../../src/adapter/express/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,GAAG,GAAG,GAAG,IAAI,CAKrF;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,GAAG,GAAG,IAAI,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAU/F;AAED,wBAAgB,uBAAuB,CACnC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAC3C,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,EAChD,IAAI,EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAEhC;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,GAAG,GAAG,IAAI,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAUhH;AAED,wBAAgB,cAAc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EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAEhC;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,GAAG,GAAG,IAAI,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAUhH;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAG7F;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACnD,IAAI,GAAE,GAAG,CAAC,MAAM,CAAa,GAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAczB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAI9F"}
@@ -1,4 +1,10 @@
1
1
  import { Router } from "express";
2
2
  import type { CreateRouterOptions } from "./types.js";
3
+ /**
4
+ * Creates an Express router with Adorn API controllers
5
+ *
6
+ * @param options - Router configuration options
7
+ * @returns Promise that resolves with the configured Express router
8
+ */
3
9
  export declare function createExpressRouter(options: CreateRouterOptions): Promise<Router>;
4
10
  //# sourceMappingURL=router.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/adapter/express/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAOjC,OAAO,KAAK,EAAa,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAuBjE,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmQvF"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/adapter/express/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAOjC,OAAO,KAAK,EAAa,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAuBjE;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6QvF"}
@@ -1,4 +1,10 @@
1
1
  import { Router } from "express";
2
2
  import type { SetupSwaggerOptions } from "./types.js";
3
+ /**
4
+ * Sets up Swagger UI for API documentation
5
+ *
6
+ * @param options - Swagger configuration options
7
+ * @returns Express router with Swagger endpoints
8
+ */
3
9
  export declare function setupSwagger(options?: SetupSwaggerOptions): Router;
4
10
  //# sourceMappingURL=swagger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"swagger.d.ts","sourceRoot":"","sources":["../../../src/adapter/express/swagger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAIjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,MAAM,CA4BtE"}
1
+ {"version":3,"file":"swagger.d.ts","sourceRoot":"","sources":["../../../src/adapter/express/swagger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAIjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,MAAM,CA4BtE"}
@@ -1,6 +1,9 @@
1
1
  import type { Request } from "express";
2
2
  import type { ManifestV1 } from "../../compiler/manifest/format.js";
3
3
  import type { AuthSchemeRuntime } from "../../runtime/auth/runtime.js";
4
+ /**
5
+ * OpenAPI 3.1 specification structure
6
+ */
4
7
  export interface OpenAPI31 {
5
8
  openapi: string;
6
9
  components: {
@@ -10,9 +13,15 @@ export interface OpenAPI31 {
10
13
  paths?: Record<string, Record<string, any>>;
11
14
  security?: Array<Record<string, string[]>>;
12
15
  }
16
+ /**
17
+ * Express request with authentication data
18
+ */
13
19
  export interface AuthenticatedRequest extends Request {
14
20
  auth?: any;
15
21
  }
22
+ /**
23
+ * Coercion options for request parameters
24
+ */
16
25
  export interface CoerceOptions {
17
26
  body?: boolean;
18
27
  query?: boolean;
@@ -22,6 +31,16 @@ export interface CoerceOptions {
22
31
  dateTime?: boolean;
23
32
  date?: boolean;
24
33
  }
34
+ /**
35
+ * Query parameter options
36
+ */
37
+ export interface QueryOptions {
38
+ /** Maximum nesting depth for deepObject parameters (default: 5) */
39
+ maxNestingDepth?: number;
40
+ }
41
+ /**
42
+ * Options for creating an Express router
43
+ */
25
44
  export interface CreateRouterOptions {
26
45
  controllers: Array<new (...args: any[]) => any>;
27
46
  artifactsDir?: string;
@@ -32,11 +51,15 @@ export interface CreateRouterOptions {
32
51
  };
33
52
  coerce?: CoerceOptions;
34
53
  defaultPageSize?: number;
54
+ queryOptions?: QueryOptions;
35
55
  middleware?: {
36
56
  global?: Array<string | ((req: any, res: any, next: (err?: any) => void) => any)>;
37
57
  named?: Record<string, (req: any, res: any, next: (err?: any) => void) => any>;
38
58
  };
39
59
  }
60
+ /**
61
+ * Options for setting up Swagger UI
62
+ */
40
63
  export interface SetupSwaggerOptions {
41
64
  artifactsDir?: string;
42
65
  jsonPath?: string;
@@ -50,6 +73,9 @@ export interface SetupSwaggerOptions {
50
73
  [key: string]: any;
51
74
  };
52
75
  }
76
+ /**
77
+ * Represents a validation error
78
+ */
53
79
  export interface ValidationError {
54
80
  path: string;
55
81
  message: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","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MAAM,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACvD,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACtB,CAAC;CACL;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC7E,MAAM,MAAM,mBAAmB,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC"}
@@ -2,9 +2,26 @@ import type { Request } from "express";
2
2
  import type { BoundRoute } from "./merge.js";
3
3
  import type { OpenAPI31, ValidationError } from "./types.js";
4
4
  import { createValidator } from "../../runtime/validation/ajv.js";
5
+ /**
6
+ * Validates a request using precompiled validators
7
+ *
8
+ * @param route - The bound route configuration
9
+ * @param req - The Express request object
10
+ * @param validators - Precompiled validators for the route
11
+ * @returns Array of validation errors, or null if validation passes
12
+ */
5
13
  export declare function validateRequestWithPrecompiled(route: BoundRoute, req: Request, validators: Record<string, {
6
14
  body?: (data: unknown) => boolean;
7
15
  response: Record<string, (data: unknown) => boolean>;
8
- }>): ValidationError[] | null;
9
- export declare function validateRequest(route: BoundRoute, req: Request, openapi: OpenAPI31, validator: ReturnType<typeof createValidator>): ValidationError[] | null;
16
+ }>, maxDepth?: number): ValidationError[] | null;
17
+ /**
18
+ * Validates a request against the OpenAPI schema
19
+ *
20
+ * @param route - The bound route configuration
21
+ * @param req - The Express request object
22
+ * @param openapi - The OpenAPI specification
23
+ * @param validator - The AJV validator instance
24
+ * @returns Array of validation errors, or null if validation passes
25
+ */
26
+ export declare function validateRequest(route: BoundRoute, req: Request, openapi: OpenAPI31, validator: ReturnType<typeof createValidator>, maxDepth?: number): ValidationError[] | null;
10
27
  //# sourceMappingURL=validation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/adapter/express/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAclE,wBAAgB,8BAA8B,CAC1C,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,OAAO,EACZ,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,CAAA;CAAE,CAAC,GACxH,eAAe,EAAE,GAAG,IAAI,CA6C1B;AAED,wBAAgB,eAAe,CAC3B,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,GAC9C,eAAe,EAAE,GAAG,IAAI,CAwH1B"}
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/adapter/express/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAclE;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