@zudojs/openapi 0.0.1

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 (139) hide show
  1. package/README.md +44 -0
  2. package/dist/.tsbuildinfo +1 -0
  3. package/dist/index.d.ts +50 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +42 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/openApiComponents/index.d.ts +9 -0
  8. package/dist/openApiComponents/index.d.ts.map +1 -0
  9. package/dist/openApiComponents/index.js +8 -0
  10. package/dist/openApiComponents/index.js.map +1 -0
  11. package/dist/openApiConstants/index.d.ts +5 -0
  12. package/dist/openApiConstants/index.d.ts.map +1 -0
  13. package/dist/openApiConstants/index.js +5 -0
  14. package/dist/openApiConstants/index.js.map +1 -0
  15. package/dist/openApiConstants/openApiConstants.core.d.ts +40 -0
  16. package/dist/openApiConstants/openApiConstants.core.d.ts.map +1 -0
  17. package/dist/openApiConstants/openApiConstants.core.js +40 -0
  18. package/dist/openApiConstants/openApiConstants.core.js.map +1 -0
  19. package/dist/openApiDocument/index.d.ts +8 -0
  20. package/dist/openApiDocument/index.d.ts.map +1 -0
  21. package/dist/openApiDocument/index.js +7 -0
  22. package/dist/openApiDocument/index.js.map +1 -0
  23. package/dist/openApiDocument/openApiDocument.builder.d.ts +60 -0
  24. package/dist/openApiDocument/openApiDocument.builder.d.ts.map +1 -0
  25. package/dist/openApiDocument/openApiDocument.builder.js +106 -0
  26. package/dist/openApiDocument/openApiDocument.builder.js.map +1 -0
  27. package/dist/openApiErrors/index.d.ts +8 -0
  28. package/dist/openApiErrors/index.d.ts.map +1 -0
  29. package/dist/openApiErrors/index.js +7 -0
  30. package/dist/openApiErrors/index.js.map +1 -0
  31. package/dist/openApiErrors/openApiError.base.d.ts +21 -0
  32. package/dist/openApiErrors/openApiError.base.d.ts.map +1 -0
  33. package/dist/openApiErrors/openApiError.base.js +28 -0
  34. package/dist/openApiErrors/openApiError.base.js.map +1 -0
  35. package/dist/openApiErrors/openApiError.core.d.ts +6 -0
  36. package/dist/openApiErrors/openApiError.core.d.ts.map +1 -0
  37. package/dist/openApiErrors/openApiError.core.js +6 -0
  38. package/dist/openApiErrors/openApiError.core.js.map +1 -0
  39. package/dist/openApiErrors/openApiError.types.d.ts +51 -0
  40. package/dist/openApiErrors/openApiError.types.d.ts.map +1 -0
  41. package/dist/openApiErrors/openApiError.types.js +125 -0
  42. package/dist/openApiErrors/openApiError.types.js.map +1 -0
  43. package/dist/openApiHttp/index.d.ts +7 -0
  44. package/dist/openApiHttp/index.d.ts.map +1 -0
  45. package/dist/openApiHttp/index.js +7 -0
  46. package/dist/openApiHttp/index.js.map +1 -0
  47. package/dist/openApiHttp/openApiHttpAdapter.core.d.ts +38 -0
  48. package/dist/openApiHttp/openApiHttpAdapter.core.d.ts.map +1 -0
  49. package/dist/openApiHttp/openApiHttpAdapter.core.js +61 -0
  50. package/dist/openApiHttp/openApiHttpAdapter.core.js.map +1 -0
  51. package/dist/openApiRegistry/index.d.ts +8 -0
  52. package/dist/openApiRegistry/index.d.ts.map +1 -0
  53. package/dist/openApiRegistry/index.js +7 -0
  54. package/dist/openApiRegistry/index.js.map +1 -0
  55. package/dist/openApiRegistry/openApiRegistry.core.d.ts +31 -0
  56. package/dist/openApiRegistry/openApiRegistry.core.d.ts.map +1 -0
  57. package/dist/openApiRegistry/openApiRegistry.core.js +150 -0
  58. package/dist/openApiRegistry/openApiRegistry.core.js.map +1 -0
  59. package/dist/openApiRegistry/openApiRegistry.type.d.ts +42 -0
  60. package/dist/openApiRegistry/openApiRegistry.type.d.ts.map +1 -0
  61. package/dist/openApiRegistry/openApiRegistry.type.js +3 -0
  62. package/dist/openApiRegistry/openApiRegistry.type.js.map +1 -0
  63. package/dist/openApiRouting/index.d.ts +9 -0
  64. package/dist/openApiRouting/index.d.ts.map +1 -0
  65. package/dist/openApiRouting/index.js +8 -0
  66. package/dist/openApiRouting/index.js.map +1 -0
  67. package/dist/openApiRouting/routeConverter.core.d.ts +23 -0
  68. package/dist/openApiRouting/routeConverter.core.d.ts.map +1 -0
  69. package/dist/openApiRouting/routeConverter.core.js +85 -0
  70. package/dist/openApiRouting/routeConverter.core.js.map +1 -0
  71. package/dist/openApiRouting/routeMetadata.type.d.ts +38 -0
  72. package/dist/openApiRouting/routeMetadata.type.d.ts.map +1 -0
  73. package/dist/openApiRouting/routeMetadata.type.js +2 -0
  74. package/dist/openApiRouting/routeMetadata.type.js.map +1 -0
  75. package/dist/openApiRouting/routeScanner.core.d.ts +57 -0
  76. package/dist/openApiRouting/routeScanner.core.d.ts.map +1 -0
  77. package/dist/openApiRouting/routeScanner.core.js +71 -0
  78. package/dist/openApiRouting/routeScanner.core.js.map +1 -0
  79. package/dist/openApiSchema/index.d.ts +11 -0
  80. package/dist/openApiSchema/index.d.ts.map +1 -0
  81. package/dist/openApiSchema/index.js +9 -0
  82. package/dist/openApiSchema/index.js.map +1 -0
  83. package/dist/openApiSchema/references.core.d.ts +9 -0
  84. package/dist/openApiSchema/references.core.d.ts.map +1 -0
  85. package/dist/openApiSchema/references.core.js +12 -0
  86. package/dist/openApiSchema/references.core.js.map +1 -0
  87. package/dist/openApiSchema/schemaConverter.core.d.ts +11 -0
  88. package/dist/openApiSchema/schemaConverter.core.d.ts.map +1 -0
  89. package/dist/openApiSchema/schemaConverter.core.js +141 -0
  90. package/dist/openApiSchema/schemaConverter.core.js.map +1 -0
  91. package/dist/openApiSchema/schemaRegistry.core.d.ts +28 -0
  92. package/dist/openApiSchema/schemaRegistry.core.d.ts.map +1 -0
  93. package/dist/openApiSchema/schemaRegistry.core.js +36 -0
  94. package/dist/openApiSchema/schemaRegistry.core.js.map +1 -0
  95. package/dist/openApiSerialization/index.d.ts +7 -0
  96. package/dist/openApiSerialization/index.d.ts.map +1 -0
  97. package/dist/openApiSerialization/index.js +7 -0
  98. package/dist/openApiSerialization/index.js.map +1 -0
  99. package/dist/openApiSerialization/openApiSerializer.core.d.ts +12 -0
  100. package/dist/openApiSerialization/openApiSerializer.core.d.ts.map +1 -0
  101. package/dist/openApiSerialization/openApiSerializer.core.js +26 -0
  102. package/dist/openApiSerialization/openApiSerializer.core.js.map +1 -0
  103. package/dist/openApiTypes/index.d.ts +7 -0
  104. package/dist/openApiTypes/index.d.ts.map +1 -0
  105. package/dist/openApiTypes/index.js +7 -0
  106. package/dist/openApiTypes/index.js.map +1 -0
  107. package/dist/openApiTypes/openApiComponent.type.d.ts +69 -0
  108. package/dist/openApiTypes/openApiComponent.type.d.ts.map +1 -0
  109. package/dist/openApiTypes/openApiComponent.type.js +5 -0
  110. package/dist/openApiTypes/openApiComponent.type.js.map +1 -0
  111. package/dist/openApiTypes/openApiDocument.type.d.ts +61 -0
  112. package/dist/openApiTypes/openApiDocument.type.d.ts.map +1 -0
  113. package/dist/openApiTypes/openApiDocument.type.js +5 -0
  114. package/dist/openApiTypes/openApiDocument.type.js.map +1 -0
  115. package/dist/openApiTypes/openApiPath.type.d.ts +48 -0
  116. package/dist/openApiTypes/openApiPath.type.d.ts.map +1 -0
  117. package/dist/openApiTypes/openApiPath.type.js +5 -0
  118. package/dist/openApiTypes/openApiPath.type.js.map +1 -0
  119. package/dist/openApiTypes/openApiSchema.type.d.ts +40 -0
  120. package/dist/openApiTypes/openApiSchema.type.d.ts.map +1 -0
  121. package/dist/openApiTypes/openApiSchema.type.js +5 -0
  122. package/dist/openApiTypes/openApiSchema.type.js.map +1 -0
  123. package/dist/openApiTypes/openApiSecurity.type.d.ts +29 -0
  124. package/dist/openApiTypes/openApiSecurity.type.d.ts.map +1 -0
  125. package/dist/openApiTypes/openApiSecurity.type.js +5 -0
  126. package/dist/openApiTypes/openApiSecurity.type.js.map +1 -0
  127. package/dist/openApiTypes/openApiTypes.core.d.ts +11 -0
  128. package/dist/openApiTypes/openApiTypes.core.d.ts.map +1 -0
  129. package/dist/openApiTypes/openApiTypes.core.js +11 -0
  130. package/dist/openApiTypes/openApiTypes.core.js.map +1 -0
  131. package/dist/openApiValidation/index.d.ts +8 -0
  132. package/dist/openApiValidation/index.d.ts.map +1 -0
  133. package/dist/openApiValidation/index.js +7 -0
  134. package/dist/openApiValidation/index.js.map +1 -0
  135. package/dist/openApiValidation/openApiValidator.core.d.ts +22 -0
  136. package/dist/openApiValidation/openApiValidator.core.d.ts.map +1 -0
  137. package/dist/openApiValidation/openApiValidator.core.js +114 -0
  138. package/dist/openApiValidation/openApiValidator.core.js.map +1 -0
  139. package/package.json +53 -0
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @zudojs/openapi/openApiConstants
3
+ */
4
+ export { DEFAULT_OPENAPI_VERSION, MAX_OPERATION_ID_LENGTH, COMPONENT_REF_PREFIX, DEFAULT_MEDIA_TYPE, STATUS_CODE_CATEGORIES, DEFAULT_SERVER_URL, DOCUMENT_CACHE_TTL_MS, } from "./openApiConstants.core.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/openApiConstants/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @zudojs/openapi/openApiConstants
3
+ */
4
+ export { DEFAULT_OPENAPI_VERSION, MAX_OPERATION_ID_LENGTH, COMPONENT_REF_PREFIX, DEFAULT_MEDIA_TYPE, STATUS_CODE_CATEGORIES, DEFAULT_SERVER_URL, DOCUMENT_CACHE_TTL_MS, } from "./openApiConstants.core.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/openApiConstants/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @zudojs/openapi/openApiConstants
3
+ *
4
+ * Shared constants for OpenAPI generation.
5
+ */
6
+ /**
7
+ * Default OpenAPI specification version.
8
+ */
9
+ export declare const DEFAULT_OPENAPI_VERSION: "3.1.0";
10
+ /**
11
+ * Maximum operation ID length allowed by OpenAPI.
12
+ */
13
+ export declare const MAX_OPERATION_ID_LENGTH = 128;
14
+ /**
15
+ * Component reference prefix.
16
+ */
17
+ export declare const COMPONENT_REF_PREFIX = "#/components";
18
+ /**
19
+ * Default media type for request/response bodies.
20
+ */
21
+ export declare const DEFAULT_MEDIA_TYPE = "application/json";
22
+ /**
23
+ * Status code categories.
24
+ */
25
+ export declare const STATUS_CODE_CATEGORIES: {
26
+ readonly INFORMATIONAL: "1XX";
27
+ readonly SUCCESS: "2XX";
28
+ readonly REDIRECT: "3XX";
29
+ readonly CLIENT_ERROR: "4XX";
30
+ readonly SERVER_ERROR: "5XX";
31
+ };
32
+ /**
33
+ * Default server URL.
34
+ */
35
+ export declare const DEFAULT_SERVER_URL = "http://localhost";
36
+ /**
37
+ * Cache TTL for generated documents (5 minutes).
38
+ */
39
+ export declare const DOCUMENT_CACHE_TTL_MS: number;
40
+ //# sourceMappingURL=openApiConstants.core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openApiConstants.core.d.ts","sourceRoot":"","sources":["../../src/openApiConstants/openApiConstants.core.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAG,OAAgB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,sBAAsB;aACjC,aAAa,EAAE,KAAK;aACpB,OAAO,EAAE,KAAK;aACd,QAAQ,EAAE,KAAK;aACf,YAAY,EAAE,KAAK;aACnB,YAAY,EAAE,KAAK;CACX,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,qBAAqB,QAAgB,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @zudojs/openapi/openApiConstants
3
+ *
4
+ * Shared constants for OpenAPI generation.
5
+ */
6
+ /**
7
+ * Default OpenAPI specification version.
8
+ */
9
+ export const DEFAULT_OPENAPI_VERSION = "3.1.0";
10
+ /**
11
+ * Maximum operation ID length allowed by OpenAPI.
12
+ */
13
+ export const MAX_OPERATION_ID_LENGTH = 128;
14
+ /**
15
+ * Component reference prefix.
16
+ */
17
+ export const COMPONENT_REF_PREFIX = "#/components";
18
+ /**
19
+ * Default media type for request/response bodies.
20
+ */
21
+ export const DEFAULT_MEDIA_TYPE = "application/json";
22
+ /**
23
+ * Status code categories.
24
+ */
25
+ export const STATUS_CODE_CATEGORIES = {
26
+ INFORMATIONAL: "1XX",
27
+ SUCCESS: "2XX",
28
+ REDIRECT: "3XX",
29
+ CLIENT_ERROR: "4XX",
30
+ SERVER_ERROR: "5XX",
31
+ };
32
+ /**
33
+ * Default server URL.
34
+ */
35
+ export const DEFAULT_SERVER_URL = "http://localhost";
36
+ /**
37
+ * Cache TTL for generated documents (5 minutes).
38
+ */
39
+ export const DOCUMENT_CACHE_TTL_MS = 5 * 60 * 1000;
40
+ //# sourceMappingURL=openApiConstants.core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openApiConstants.core.js","sourceRoot":"","sources":["../../src/openApiConstants/openApiConstants.core.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,OAAgB,CAAC;AAExD;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,aAAa,EAAE,KAAK;IACpB,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,KAAK;IACf,YAAY,EAAE,KAAK;IACnB,YAAY,EAAE,KAAK;CACX,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @zudojs/openapi/openApiDocument
3
+ *
4
+ * OpenAPI document builder.
5
+ */
6
+ export type { OpenAPIDocumentOptions } from "./openApiDocument.builder.js";
7
+ export { OpenAPIDocumentBuilder } from "./openApiDocument.builder.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/openApiDocument/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @zudojs/openapi/openApiDocument
3
+ *
4
+ * OpenAPI document builder.
5
+ */
6
+ export { OpenAPIDocumentBuilder } from "./openApiDocument.builder.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/openApiDocument/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,60 @@
1
+ import type { OpenAPIDocument } from "../openApiTypes/openApiTypes.core.js";
2
+ export interface OpenAPIDocumentOptions {
3
+ readonly info: {
4
+ readonly title: string;
5
+ readonly version: string;
6
+ readonly description?: string;
7
+ readonly summary?: string;
8
+ readonly termsOfService?: string;
9
+ readonly contact?: {
10
+ readonly name?: string;
11
+ readonly url?: string;
12
+ readonly email?: string;
13
+ };
14
+ readonly license?: {
15
+ readonly name: string;
16
+ readonly url?: string;
17
+ };
18
+ };
19
+ readonly openapi?: string;
20
+ readonly servers?: readonly {
21
+ readonly url: string;
22
+ readonly description?: string;
23
+ readonly variables?: Readonly<Record<string, {
24
+ readonly enum?: readonly string[];
25
+ readonly default: string;
26
+ readonly description?: string;
27
+ }>>;
28
+ }[];
29
+ readonly tags?: readonly {
30
+ readonly name: string;
31
+ readonly description?: string;
32
+ }[];
33
+ readonly security?: readonly Record<string, readonly string[]>[];
34
+ }
35
+ export declare class OpenAPIDocumentBuilder {
36
+ private readonly document;
37
+ constructor(options: OpenAPIDocumentOptions);
38
+ version(version: string): this;
39
+ addServer(server: {
40
+ readonly url: string;
41
+ readonly description?: string;
42
+ readonly variables?: Readonly<Record<string, {
43
+ readonly enum?: readonly string[];
44
+ readonly default: string;
45
+ readonly description?: string;
46
+ }>>;
47
+ }): this;
48
+ addTag(tag: {
49
+ readonly name: string;
50
+ readonly description?: string;
51
+ }): this;
52
+ addSecurity(security: Record<string, readonly string[]>): this;
53
+ addPath(path: string, pathItem: Record<string, unknown>): this;
54
+ addSchema(name: string, schema: unknown): this;
55
+ addResponse(name: string, response: unknown): this;
56
+ addParameter(name: string, parameter: unknown): this;
57
+ addSecurityScheme(name: string, scheme: unknown): this;
58
+ build(): Readonly<OpenAPIDocument>;
59
+ }
60
+ //# sourceMappingURL=openApiDocument.builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openApiDocument.builder.d.ts","sourceRoot":"","sources":["../../src/openApiDocument/openApiDocument.builder.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AAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAOxD;IAEM,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI,CAO1D;IAEM,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAU5D;IAEM,KAAK,IAAI,QAAQ,CAAC,eAAe,CAAC,CAkCxC;CACF"}
@@ -0,0 +1,106 @@
1
+ import { DEFAULT_OPENAPI_VERSION } from "../openApiConstants/openApiConstants.core.js";
2
+ export class OpenAPIDocumentBuilder {
3
+ document;
4
+ constructor(options) {
5
+ this.document = {
6
+ openapi: options.openapi ?? DEFAULT_OPENAPI_VERSION,
7
+ info: { ...options.info },
8
+ servers: options.servers?.map((s) => ({ ...s })),
9
+ paths: {},
10
+ components: {},
11
+ security: options.security?.map((s) => ({ ...s })),
12
+ tags: options.tags?.map((t) => ({ ...t })),
13
+ };
14
+ }
15
+ version(version) {
16
+ this.document.openapi = version;
17
+ return this;
18
+ }
19
+ addServer(server) {
20
+ this.document.servers = [...(this.document.servers ?? []), { ...server }];
21
+ return this;
22
+ }
23
+ addTag(tag) {
24
+ this.document.tags = [...(this.document.tags ?? []), { ...tag }];
25
+ return this;
26
+ }
27
+ addSecurity(security) {
28
+ this.document.security = [
29
+ ...(this.document.security ?? []),
30
+ { ...security },
31
+ ];
32
+ return this;
33
+ }
34
+ addPath(path, pathItem) {
35
+ this.document.paths[path] = pathItem;
36
+ return this;
37
+ }
38
+ addSchema(name, schema) {
39
+ const components = this.document.components ?? {};
40
+ this.document.components = {
41
+ ...components,
42
+ schemas: { ...(components.schemas ?? {}), [name]: schema },
43
+ };
44
+ return this;
45
+ }
46
+ addResponse(name, response) {
47
+ const components = this.document.components ?? {};
48
+ this.document.components = {
49
+ ...components,
50
+ responses: { ...(components.responses ?? {}), [name]: response },
51
+ };
52
+ return this;
53
+ }
54
+ addParameter(name, parameter) {
55
+ const components = this.document.components ?? {};
56
+ this.document.components = {
57
+ ...components,
58
+ parameters: { ...(components.parameters ?? {}), [name]: parameter },
59
+ };
60
+ return this;
61
+ }
62
+ addSecurityScheme(name, scheme) {
63
+ const components = this.document.components ?? {};
64
+ this.document.components = {
65
+ ...components,
66
+ securitySchemes: {
67
+ ...(components.securitySchemes ?? {}),
68
+ [name]: scheme,
69
+ },
70
+ };
71
+ return this;
72
+ }
73
+ build() {
74
+ const paths = Object.keys(this.document.paths).length === 0
75
+ ? {}
76
+ : this.document.paths;
77
+ const components = {};
78
+ if (this.document.components) {
79
+ for (const [key, value] of Object.entries(this.document.components)) {
80
+ if (value &&
81
+ typeof value === "object" &&
82
+ Object.keys(value).length > 0) {
83
+ components[key] = Object.freeze({ ...value });
84
+ }
85
+ }
86
+ }
87
+ return Object.freeze({
88
+ openapi: this.document.openapi,
89
+ info: Object.freeze(this.document.info),
90
+ servers: this.document.servers?.length
91
+ ? Object.freeze(this.document.servers)
92
+ : undefined,
93
+ paths: Object.freeze(paths),
94
+ ...(Object.keys(components).length > 0
95
+ ? { components: Object.freeze(components) }
96
+ : {}),
97
+ security: this.document.security?.length
98
+ ? Object.freeze(this.document.security)
99
+ : undefined,
100
+ tags: this.document.tags?.length
101
+ ? Object.freeze(this.document.tags)
102
+ : undefined,
103
+ });
104
+ }
105
+ }
106
+ //# sourceMappingURL=openApiDocument.builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openApiDocument.builder.js","sourceRoot":"","sources":["../../src/openApiDocument/openApiDocument.builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AA+DvF,MAAM,OAAO,sBAAsB;IAChB,QAAQ,CAAkB;IAE3C,YAAY,OAA+B;QACzC,IAAI,CAAC,QAAQ,GAAG;YACd,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,uBAAuB;YACnD,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE;YACzB,OAAO,EAA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EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAA6B;YACvD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC;gBACpC,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;gBAC3C,CAAC,CAAC,EAAE,CAAC;YACP,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM;gBACtC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBACvC,CAAC,CAAC,SAAS;YACb,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAC9B,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;gBACnC,CAAC,CAAC,SAAS;SACd,CAA8B,CAAC;IAClC,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @zudojs/openapi/openApiErrors
3
+ *
4
+ * OpenAPI-specific error classes.
5
+ */
6
+ export { OpenAPIError, OpenAPIValidationError, OpenAPIDocumentError, OpenAPIComponentError, OpenAPIComponentConflictError, OpenAPIReferenceError, OpenAPIRouteError, OpenAPISchemaError, OpenAPISerializationError, OpenAPIVersionError, OpenAPIOperationError, createOpenAPIError, isOpenAPIError, } from "./openApiError.core.js";
7
+ export type { OpenAPIErrorOptions, OpenAPIValidationIssue, } from "./openApiError.core.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/openApiErrors/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,EAC7B,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,GACf,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACV,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @zudojs/openapi/openApiErrors
3
+ *
4
+ * OpenAPI-specific error classes.
5
+ */
6
+ export { OpenAPIError, OpenAPIValidationError, OpenAPIDocumentError, OpenAPIComponentError, OpenAPIComponentConflictError, OpenAPIReferenceError, OpenAPIRouteError, OpenAPISchemaError, OpenAPISerializationError, OpenAPIVersionError, OpenAPIOperationError, createOpenAPIError, isOpenAPIError, } from "./openApiError.core.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/openApiErrors/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,EAC7B,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,GACf,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Base OpenAPI error and factory functions.
3
+ */
4
+ import { BaseError } from "@zudojs/errors";
5
+ /** Options for creating an OpenAPI error. */
6
+ export interface OpenAPIErrorOptions {
7
+ readonly code?: string;
8
+ readonly statusCode?: number;
9
+ readonly expose?: boolean;
10
+ readonly cause?: unknown;
11
+ readonly metadata?: Readonly<Record<string, unknown>>;
12
+ }
13
+ /** Base error for all OpenAPI subsystem failures. */
14
+ export declare class OpenAPIError extends BaseError {
15
+ constructor(message: string, options?: OpenAPIErrorOptions);
16
+ }
17
+ /** Creates an OpenAPI error. */
18
+ export declare function createOpenAPIError(message: string, options?: OpenAPIErrorOptions): OpenAPIError;
19
+ /** Determines whether an unknown value is an OpenAPI error. */
20
+ export declare function isOpenAPIError(value: unknown): value is OpenAPIError;
21
+ //# sourceMappingURL=openApiError.base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openApiError.base.d.ts","sourceRoot":"","sources":["../../src/openApiErrors/openApiError.base.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,SAAS,EAIV,MAAM,gBAAgB,CAAC;AAExB,6CAA6C;AAC7C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD;AAED,qDAAqD;AACrD,qBAAa,YAAa,SAAQ,SAAS;IACzC,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,EAY7D;CACF;AAED,gCAAgC;AAChC,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,mBAAwB,GAChC,YAAY,CAEd;AAED,+DAA+D;AAC/D,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Base OpenAPI error and factory functions.
3
+ */
4
+ import { BaseError, ErrorCode, ErrorCategory, ErrorSeverity, } from "@zudojs/errors";
5
+ /** Base error for all OpenAPI subsystem failures. */
6
+ export class OpenAPIError extends BaseError {
7
+ constructor(message, options = {}) {
8
+ super(message, {
9
+ code: options.code ?? ErrorCode.OPENAPI_DOCUMENT,
10
+ category: ErrorCategory.OPENAPI,
11
+ severity: ErrorSeverity.ERROR,
12
+ statusCode: options.statusCode ?? 500,
13
+ expose: options.expose ?? false,
14
+ cause: options.cause,
15
+ metadata: options.metadata,
16
+ });
17
+ this.name = "OpenAPIError";
18
+ }
19
+ }
20
+ /** Creates an OpenAPI error. */
21
+ export function createOpenAPIError(message, options = {}) {
22
+ return new OpenAPIError(message, options);
23
+ }
24
+ /** Determines whether an unknown value is an OpenAPI error. */
25
+ export function isOpenAPIError(value) {
26
+ return value instanceof OpenAPIError;
27
+ }
28
+ //# sourceMappingURL=openApiError.base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openApiError.base.js","sourceRoot":"","sources":["../../src/openApiErrors/openApiError.base.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,SAAS,EACT,SAAS,EACT,aAAa,EACb,aAAa,GACd,MAAM,gBAAgB,CAAC;AAWxB,qDAAqD;AACrD,MAAM,OAAO,YAAa,SAAQ,SAAS;IACzC,YAAY,OAAe,EAAE,OAAO,GAAwB,EAAE;QAC5D,KAAK,CAAC,OAAO,EAAE;YACb,IAAI,EAAG,OAAO,CAAC,IAAkB,IAAI,SAAS,CAAC,gBAAgB;YAC/D,QAAQ,EAAE,aAAa,CAAC,OAAO;YAC/B,QAAQ,EAAE,aAAa,CAAC,KAAK;YAC7B,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,GAAG;YACrC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,KAAK;YAC/B,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,QAAQ,EAAE,OAAO,CAAC,QACkC;SACrD,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AAED,gCAAgC;AAChC,MAAM,UAAU,kBAAkB,CAChC,OAAe,EACf,OAAO,GAAwB,EAAE;IAEjC,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,OAAO,KAAK,YAAY,YAAY,CAAC;AACvC,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * OpenAPI error types — re-exported from split modules.
3
+ */
4
+ export * from "./openApiError.base.js";
5
+ export * from "./openApiError.types.js";
6
+ //# sourceMappingURL=openApiError.core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openApiError.core.d.ts","sourceRoot":"","sources":["../../src/openApiErrors/openApiError.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * OpenAPI error types — re-exported from split modules.
3
+ */
4
+ export * from "./openApiError.base.js";
5
+ export * from "./openApiError.types.js";
6
+ //# sourceMappingURL=openApiError.core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openApiError.core.js","sourceRoot":"","sources":["../../src/openApiErrors/openApiError.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Specific OpenAPI error subclasses.
3
+ */
4
+ import { OpenAPIError, type OpenAPIErrorOptions } from "./openApiError.base.js";
5
+ /** Error thrown when OpenAPI validation fails. */
6
+ export declare class OpenAPIValidationError extends OpenAPIError {
7
+ constructor(message: string, issues?: readonly unknown[], options?: OpenAPIErrorOptions);
8
+ }
9
+ /** Error thrown when the OpenAPI document is invalid. */
10
+ export declare class OpenAPIDocumentError extends OpenAPIError {
11
+ constructor(message: string, options?: OpenAPIErrorOptions);
12
+ }
13
+ /** Error thrown when an OpenAPI component is invalid. */
14
+ export declare class OpenAPIComponentError extends OpenAPIError {
15
+ constructor(message: string, options?: OpenAPIErrorOptions);
16
+ }
17
+ /** Error thrown when an OpenAPI component conflicts with an existing component. */
18
+ export declare class OpenAPIComponentConflictError extends OpenAPIError {
19
+ constructor(message: string, options?: OpenAPIErrorOptions);
20
+ }
21
+ /** Error thrown when an OpenAPI reference is invalid. */
22
+ export declare class OpenAPIReferenceError extends OpenAPIError {
23
+ constructor(message: string, options?: OpenAPIErrorOptions);
24
+ }
25
+ /** Error thrown when an OpenAPI route is invalid. */
26
+ export declare class OpenAPIRouteError extends OpenAPIError {
27
+ constructor(message: string, options?: OpenAPIErrorOptions);
28
+ }
29
+ /** Error thrown when an OpenAPI schema is invalid. */
30
+ export declare class OpenAPISchemaError extends OpenAPIError {
31
+ constructor(message: string, options?: OpenAPIErrorOptions);
32
+ }
33
+ /** Error thrown when OpenAPI serialization fails. */
34
+ export declare class OpenAPISerializationError extends OpenAPIError {
35
+ constructor(message: string, options?: OpenAPIErrorOptions);
36
+ }
37
+ /** Error thrown when the OpenAPI version is unsupported. */
38
+ export declare class OpenAPIVersionError extends OpenAPIError {
39
+ constructor(message: string, options?: OpenAPIErrorOptions);
40
+ }
41
+ /** Error thrown when an OpenAPI operation is invalid. */
42
+ export declare class OpenAPIOperationError extends OpenAPIError {
43
+ constructor(message: string, options?: OpenAPIErrorOptions);
44
+ }
45
+ /** A single validation issue. */
46
+ export interface OpenAPIValidationIssue {
47
+ readonly path: readonly (string | number)[];
48
+ readonly message: string;
49
+ readonly severity: "error" | "warning";
50
+ }
51
+ //# sourceMappingURL=openApiError.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openApiError.types.d.ts","sourceRoot":"","sources":["../../src/openApiErrors/openApiError.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAEhF,kDAAkD;AAClD,qBAAa,sBAAuB,SAAQ,YAAY;IACtD,YACE,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,EAC3B,OAAO,GAAE,mBAAwB,EASlC;CACF;AAED,yDAAyD;AACzD,qBAAa,oBAAqB,SAAQ,YAAY;IACpD,YAAY,OAAO,EAAE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1,125 @@
1
+ /**
2
+ * Specific OpenAPI error subclasses.
3
+ */
4
+ import { OpenAPIError } from "./openApiError.base.js";
5
+ /** Error thrown when OpenAPI validation fails. */
6
+ export class OpenAPIValidationError extends OpenAPIError {
7
+ constructor(message, issues, options = {}) {
8
+ super(message, {
9
+ ...options,
10
+ code: options.code ?? "OPENAPI_VALIDATION",
11
+ statusCode: 400,
12
+ expose: true,
13
+ });
14
+ this.name = "OpenAPIValidationError";
15
+ }
16
+ }
17
+ /** Error thrown when the OpenAPI document is invalid. */
18
+ export class OpenAPIDocumentError extends OpenAPIError {
19
+ constructor(message, options = {}) {
20
+ super(message, {
21
+ ...options,
22
+ code: options.code ?? "OPENAPI_DOCUMENT",
23
+ statusCode: 500,
24
+ expose: false,
25
+ });
26
+ this.name = "OpenAPIDocumentError";
27
+ }
28
+ }
29
+ /** Error thrown when an OpenAPI component is invalid. */
30
+ export class OpenAPIComponentError extends OpenAPIError {
31
+ constructor(message, options = {}) {
32
+ super(message, {
33
+ ...options,
34
+ code: options.code ?? "OPENAPI_COMPONENT",
35
+ statusCode: 500,
36
+ expose: false,
37
+ });
38
+ this.name = "OpenAPIComponentError";
39
+ }
40
+ }
41
+ /** Error thrown when an OpenAPI component conflicts with an existing component. */
42
+ export class OpenAPIComponentConflictError extends OpenAPIError {
43
+ constructor(message, options = {}) {
44
+ super(message, {
45
+ ...options,
46
+ code: options.code ?? "OPENAPI_COMPONENT_CONFLICT",
47
+ statusCode: 409,
48
+ expose: true,
49
+ });
50
+ this.name = "OpenAPIComponentConflictError";
51
+ }
52
+ }
53
+ /** Error thrown when an OpenAPI reference is invalid. */
54
+ export class OpenAPIReferenceError extends OpenAPIError {
55
+ constructor(message, options = {}) {
56
+ super(message, {
57
+ ...options,
58
+ code: options.code ?? "OPENAPI_REFERENCE",
59
+ statusCode: 400,
60
+ expose: true,
61
+ });
62
+ this.name = "OpenAPIReferenceError";
63
+ }
64
+ }
65
+ /** Error thrown when an OpenAPI route is invalid. */
66
+ export class OpenAPIRouteError extends OpenAPIError {
67
+ constructor(message, options = {}) {
68
+ super(message, {
69
+ ...options,
70
+ code: options.code ?? "OPENAPI_ROUTE",
71
+ statusCode: 500,
72
+ expose: false,
73
+ });
74
+ this.name = "OpenAPIRouteError";
75
+ }
76
+ }
77
+ /** Error thrown when an OpenAPI schema is invalid. */
78
+ export class OpenAPISchemaError extends OpenAPIError {
79
+ constructor(message, options = {}) {
80
+ super(message, {
81
+ ...options,
82
+ code: options.code ?? "OPENAPI_SCHEMA",
83
+ statusCode: 500,
84
+ expose: false,
85
+ });
86
+ this.name = "OpenAPISchemaError";
87
+ }
88
+ }
89
+ /** Error thrown when OpenAPI serialization fails. */
90
+ export class OpenAPISerializationError extends OpenAPIError {
91
+ constructor(message, options = {}) {
92
+ super(message, {
93
+ ...options,
94
+ code: options.code ?? "OPENAPI_SERIALIZATION",
95
+ statusCode: 500,
96
+ expose: false,
97
+ });
98
+ this.name = "OpenAPISerializationError";
99
+ }
100
+ }
101
+ /** Error thrown when the OpenAPI version is unsupported. */
102
+ export class OpenAPIVersionError extends OpenAPIError {
103
+ constructor(message, options = {}) {
104
+ super(message, {
105
+ ...options,
106
+ code: options.code ?? "OPENAPI_VERSION",
107
+ statusCode: 400,
108
+ expose: true,
109
+ });
110
+ this.name = "OpenAPIVersionError";
111
+ }
112
+ }
113
+ /** Error thrown when an OpenAPI operation is invalid. */
114
+ export class OpenAPIOperationError extends OpenAPIError {
115
+ constructor(message, options = {}) {
116
+ super(message, {
117
+ ...options,
118
+ code: options.code ?? "OPENAPI_OPERATION",
119
+ statusCode: 500,
120
+ expose: false,
121
+ });
122
+ this.name = "OpenAPIOperationError";
123
+ }
124
+ }
125
+ //# sourceMappingURL=openApiError.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openApiError.types.js","sourceRoot":"","sources":["../../src/openApiErrors/openApiError.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAA4B,MAAM,wBAA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AG;YACf,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF;AAED,4DAA4D;AAC5D,MAAM,OAAO,mBAAoB,SAAQ,YAAY;IACnD,YAAY,OAAe,EAAE,OAAO,GAAwB,EAAE;QAC5D,KAAK,CAAC,OAAO,EAAE;YACb,GAAG,OAAO;YACV,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,iBAAiB;YACvC,UAAU,EAAE,GAAG;YACf,MAAM,EAAE,IAAI;SACb,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED,yDAAyD;AACzD,MAAM,OAAO,qBAAsB,SAAQ,YAAY;IACrD,YAAY,OAAe,EAAE,OAAO,GAAwB,EAAE;QAC5D,KAAK,CAAC,OAAO,EAAE;YACb,GAAG,OAAO;YACV,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,mBAAmB;YACzC,UAAU,EAAE,GAAG;YACf,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @zudojs/openapi/openApiHttp
3
+ *
4
+ * HTTP integration for OpenAPI document serving.
5
+ */
6
+ export { OpenAPIManager } from "./openApiHttpAdapter.core.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/openApiHttp/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @zudojs/openapi/openApiHttp
3
+ *
4
+ * HTTP integration for OpenAPI document serving.
5
+ */
6
+ export { OpenAPIManager } from "./openApiHttpAdapter.core.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/openApiHttp/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC"}