@navios/openapi 0.7.0 → 0.9.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.
- package/CHANGELOG.md +72 -0
- package/dist/legacy-compat/__type-tests__/legacy-decorators.spec-d.d.mts +2 -0
- package/dist/legacy-compat/__type-tests__/legacy-decorators.spec-d.d.mts.map +1 -0
- package/dist/legacy-compat/__type-tests__/tsconfig.tsbuildinfo +1 -0
- package/dist/src/legacy-compat/decorators/api-deprecated.decorator.d.mts +35 -0
- package/dist/src/legacy-compat/decorators/api-deprecated.decorator.d.mts.map +1 -0
- package/dist/src/legacy-compat/decorators/api-exclude.decorator.d.mts +28 -0
- package/dist/src/legacy-compat/decorators/api-exclude.decorator.d.mts.map +1 -0
- package/dist/src/legacy-compat/decorators/api-operation.decorator.d.mts +60 -0
- package/dist/src/legacy-compat/decorators/api-operation.decorator.d.mts.map +1 -0
- package/dist/src/legacy-compat/decorators/api-security.decorator.d.mts +38 -0
- package/dist/src/legacy-compat/decorators/api-security.decorator.d.mts.map +1 -0
- package/dist/src/legacy-compat/decorators/api-stream.decorator.d.mts +52 -0
- package/dist/src/legacy-compat/decorators/api-stream.decorator.d.mts.map +1 -0
- package/dist/src/legacy-compat/decorators/api-summary.decorator.d.mts +26 -0
- package/dist/src/legacy-compat/decorators/api-summary.decorator.d.mts.map +1 -0
- package/dist/src/legacy-compat/decorators/api-tag.decorator.d.mts +44 -0
- package/dist/src/legacy-compat/decorators/api-tag.decorator.d.mts.map +1 -0
- package/dist/src/legacy-compat/decorators/index.d.mts +8 -0
- package/dist/src/legacy-compat/decorators/index.d.mts.map +1 -0
- package/dist/src/legacy-compat/index.d.mts +24 -0
- package/dist/src/legacy-compat/index.d.mts.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/tsconfig.spec.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/vitest.config.d.mts.map +1 -1
- package/lib/index-BYd1gzJQ.d.cts +594 -0
- package/lib/index-BYd1gzJQ.d.cts.map +1 -0
- package/lib/index-KzCwlPFD.d.mts +594 -0
- package/lib/index-KzCwlPFD.d.mts.map +1 -0
- package/lib/index.cjs +20 -1840
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +2 -594
- package/lib/index.d.mts +2 -594
- package/lib/index.mjs +2 -1822
- package/lib/index.mjs.map +1 -1
- package/lib/legacy-compat/index.cjs +314 -0
- package/lib/legacy-compat/index.cjs.map +1 -0
- package/lib/legacy-compat/index.d.cts +285 -0
- package/lib/legacy-compat/index.d.cts.map +1 -0
- package/lib/legacy-compat/index.d.mts +285 -0
- package/lib/legacy-compat/index.d.mts.map +1 -0
- package/lib/legacy-compat/index.mjs +271 -0
- package/lib/legacy-compat/index.mjs.map +1 -0
- package/lib/services-MFCyRMd8.mjs +1825 -0
- package/lib/services-MFCyRMd8.mjs.map +1 -0
- package/lib/services-kEHEZqLZ.cjs +1896 -0
- package/lib/services-kEHEZqLZ.cjs.map +1 -0
- package/package.json +15 -5
- package/src/__tests__/metadata.spec.mts +5 -7
- package/src/__tests__/services.spec.mts +6 -7
- package/src/legacy-compat/__type-tests__/legacy-decorators.spec-d.mts +347 -0
- package/src/legacy-compat/__type-tests__/tsconfig.json +15 -0
- package/src/legacy-compat/decorators/api-deprecated.decorator.mts +46 -0
- package/src/legacy-compat/decorators/api-exclude.decorator.mts +31 -0
- package/src/legacy-compat/decorators/api-operation.decorator.mts +60 -0
- package/src/legacy-compat/decorators/api-security.decorator.mts +45 -0
- package/src/legacy-compat/decorators/api-stream.decorator.mts +56 -0
- package/src/legacy-compat/decorators/api-summary.decorator.mts +34 -0
- package/src/legacy-compat/decorators/api-tag.decorator.mts +52 -0
- package/src/legacy-compat/decorators/index.mts +7 -0
- package/src/legacy-compat/index.mts +58 -0
- package/tsconfig.spec.json +4 -1
- package/tsdown.config.mts +2 -2
- package/vitest.config.mts +5 -1
- package/lib/index.d.cts.map +0 -1
- package/lib/index.d.mts.map +0 -1
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { a as _MetadataExtractorService, c as ApiOperationToken, d as ApiSummaryToken, f as ApiTagToken, i as _EndpointScannerService, l as ApiSecurityToken, n as _PathBuilderService, o as ApiDeprecatedToken, r as _SchemaConverterService, s as ApiExcludeToken, t as _OpenApiGeneratorService, u as ApiStreamToken } from "../services-MFCyRMd8.mjs";
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
|
+
import { LegacyAttributeFactory } from "@navios/core/legacy-compat";
|
|
4
|
+
|
|
5
|
+
//#region src/legacy-compat/decorators/api-tag.decorator.mts
|
|
6
|
+
const ApiTagSchema = z.object({
|
|
7
|
+
name: z.string(),
|
|
8
|
+
description: z.string().optional()
|
|
9
|
+
});
|
|
10
|
+
const BaseApiTag = LegacyAttributeFactory.createAttribute(ApiTagToken, ApiTagSchema);
|
|
11
|
+
/**
|
|
12
|
+
* Groups endpoints under a specific tag/folder in the documentation.
|
|
13
|
+
*
|
|
14
|
+
* Can be applied to controllers (affects all endpoints) or individual methods.
|
|
15
|
+
* When applied to both, the method-level tag takes precedence.
|
|
16
|
+
*
|
|
17
|
+
* Legacy-compatible version for TypeScript experimental decorators.
|
|
18
|
+
*
|
|
19
|
+
* @param name - The tag name
|
|
20
|
+
* @param description - Optional tag description
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // Apply to entire controller
|
|
25
|
+
* @Controller()
|
|
26
|
+
* @ApiTag('Users', 'User management operations')
|
|
27
|
+
* export class UserController {
|
|
28
|
+
* @Endpoint(getUser)
|
|
29
|
+
* async getUser() {}
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* // Apply to individual endpoint
|
|
33
|
+
* @Controller()
|
|
34
|
+
* export class MixedController {
|
|
35
|
+
* @Endpoint(getUser)
|
|
36
|
+
* @ApiTag('Users')
|
|
37
|
+
* async getUser() {}
|
|
38
|
+
*
|
|
39
|
+
* @Endpoint(getOrder)
|
|
40
|
+
* @ApiTag('Orders')
|
|
41
|
+
* async getOrder() {}
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/ function ApiTag(name, description) {
|
|
45
|
+
return BaseApiTag({
|
|
46
|
+
name,
|
|
47
|
+
description
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/legacy-compat/decorators/api-operation.decorator.mts
|
|
53
|
+
const ApiOperationSchema = z.object({
|
|
54
|
+
summary: z.string().optional(),
|
|
55
|
+
description: z.string().optional(),
|
|
56
|
+
operationId: z.string().optional(),
|
|
57
|
+
deprecated: z.boolean().optional(),
|
|
58
|
+
externalDocs: z.object({
|
|
59
|
+
url: z.string(),
|
|
60
|
+
description: z.string().optional()
|
|
61
|
+
}).optional()
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* Provides detailed operation metadata for an endpoint.
|
|
65
|
+
*
|
|
66
|
+
* Use this decorator when you need to specify multiple operation properties.
|
|
67
|
+
* For simple cases, consider using @ApiSummary instead.
|
|
68
|
+
*
|
|
69
|
+
* Legacy-compatible version for TypeScript experimental decorators.
|
|
70
|
+
*
|
|
71
|
+
* @param options - Operation configuration options
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* @Controller()
|
|
76
|
+
* export class UserController {
|
|
77
|
+
* @Endpoint(getUser)
|
|
78
|
+
* @ApiOperation({
|
|
79
|
+
* summary: 'Get user by ID',
|
|
80
|
+
* description: 'Retrieves a user by their unique identifier. Returns 404 if not found.',
|
|
81
|
+
* operationId: 'getUserById',
|
|
82
|
+
* })
|
|
83
|
+
* async getUser(params: EndpointParams<typeof getUser>) {}
|
|
84
|
+
*
|
|
85
|
+
* @Endpoint(legacyGetUser)
|
|
86
|
+
* @ApiOperation({
|
|
87
|
+
* summary: 'Get user (legacy)',
|
|
88
|
+
* deprecated: true,
|
|
89
|
+
* externalDocs: {
|
|
90
|
+
* url: 'https://docs.example.com/migration',
|
|
91
|
+
* description: 'Migration guide'
|
|
92
|
+
* }
|
|
93
|
+
* })
|
|
94
|
+
* async getLegacyUser() {}
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
97
|
+
*/ const ApiOperation = LegacyAttributeFactory.createAttribute(ApiOperationToken, ApiOperationSchema);
|
|
98
|
+
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/legacy-compat/decorators/api-summary.decorator.mts
|
|
101
|
+
const ApiSummarySchema = z.string();
|
|
102
|
+
/**
|
|
103
|
+
* Shorthand decorator for adding just a summary to an endpoint.
|
|
104
|
+
*
|
|
105
|
+
* This is equivalent to `@ApiOperation({ summary: '...' })` but more concise.
|
|
106
|
+
*
|
|
107
|
+
* Legacy-compatible version for TypeScript experimental decorators.
|
|
108
|
+
*
|
|
109
|
+
* @param summary - Short summary text for the endpoint
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* @Controller()
|
|
114
|
+
* export class UserController {
|
|
115
|
+
* @Endpoint(getUser)
|
|
116
|
+
* @ApiSummary('Get user by ID')
|
|
117
|
+
* async getUser() {}
|
|
118
|
+
*
|
|
119
|
+
* @Endpoint(createUser)
|
|
120
|
+
* @ApiSummary('Create a new user')
|
|
121
|
+
* async createUser() {}
|
|
122
|
+
* }
|
|
123
|
+
* ```
|
|
124
|
+
*/ const ApiSummary = LegacyAttributeFactory.createAttribute(ApiSummaryToken, ApiSummarySchema);
|
|
125
|
+
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/legacy-compat/decorators/api-deprecated.decorator.mts
|
|
128
|
+
const ApiDeprecatedSchema = z.object({ message: z.string().optional() });
|
|
129
|
+
const BaseApiDeprecated = LegacyAttributeFactory.createAttribute(ApiDeprecatedToken, ApiDeprecatedSchema);
|
|
130
|
+
/**
|
|
131
|
+
* Marks an endpoint as deprecated.
|
|
132
|
+
*
|
|
133
|
+
* Deprecated endpoints are shown with a visual indicator in documentation
|
|
134
|
+
* and may include a migration message.
|
|
135
|
+
*
|
|
136
|
+
* Legacy-compatible version for TypeScript experimental decorators.
|
|
137
|
+
*
|
|
138
|
+
* @param message - Optional deprecation message
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```typescript
|
|
142
|
+
* @Controller()
|
|
143
|
+
* export class UserController {
|
|
144
|
+
* // Simple deprecation
|
|
145
|
+
* @Endpoint(legacyGetUser)
|
|
146
|
+
* @ApiDeprecated()
|
|
147
|
+
* async getLegacyUser() {}
|
|
148
|
+
*
|
|
149
|
+
* // With migration message
|
|
150
|
+
* @Endpoint(oldCreateUser)
|
|
151
|
+
* @ApiDeprecated('Use POST /v2/users instead')
|
|
152
|
+
* async oldCreateUser() {}
|
|
153
|
+
* }
|
|
154
|
+
* ```
|
|
155
|
+
*/ function ApiDeprecated(message) {
|
|
156
|
+
return BaseApiDeprecated({ message });
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/legacy-compat/decorators/api-security.decorator.mts
|
|
161
|
+
const ApiSecuritySchema = z.record(z.string(), z.array(z.string()));
|
|
162
|
+
/**
|
|
163
|
+
* Specifies security requirements for an endpoint.
|
|
164
|
+
*
|
|
165
|
+
* The security requirement object maps security scheme names to their scopes.
|
|
166
|
+
* For schemes that don't use scopes (like API keys), use an empty array.
|
|
167
|
+
*
|
|
168
|
+
* Legacy-compatible version for TypeScript experimental decorators.
|
|
169
|
+
*
|
|
170
|
+
* @param requirements - Security requirements object
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```typescript
|
|
174
|
+
* @Controller()
|
|
175
|
+
* export class UserController {
|
|
176
|
+
* // Require bearer token authentication
|
|
177
|
+
* @Endpoint(getUser)
|
|
178
|
+
* @ApiSecurity({ bearerAuth: [] })
|
|
179
|
+
* async getUser() {}
|
|
180
|
+
*
|
|
181
|
+
* // Require multiple authentication methods
|
|
182
|
+
* @Endpoint(adminEndpoint)
|
|
183
|
+
* @ApiSecurity({ bearerAuth: [], apiKey: [] })
|
|
184
|
+
* async adminAction() {}
|
|
185
|
+
*
|
|
186
|
+
* // OAuth2 with specific scopes
|
|
187
|
+
* @Endpoint(writeUser)
|
|
188
|
+
* @ApiSecurity({ oauth2: ['users:write', 'users:read'] })
|
|
189
|
+
* async writeUser() {}
|
|
190
|
+
* }
|
|
191
|
+
* ```
|
|
192
|
+
*/ const ApiSecurity = LegacyAttributeFactory.createAttribute(ApiSecurityToken, ApiSecuritySchema);
|
|
193
|
+
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region src/legacy-compat/decorators/api-exclude.decorator.mts
|
|
196
|
+
/**
|
|
197
|
+
* Excludes an endpoint from OpenAPI documentation.
|
|
198
|
+
*
|
|
199
|
+
* Use this decorator for internal endpoints that should not be visible
|
|
200
|
+
* in the public API documentation.
|
|
201
|
+
*
|
|
202
|
+
* Legacy-compatible version for TypeScript experimental decorators.
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```typescript
|
|
206
|
+
* @Controller()
|
|
207
|
+
* export class HealthController {
|
|
208
|
+
* @Endpoint(healthCheck)
|
|
209
|
+
* @ApiExclude()
|
|
210
|
+
* async healthCheck() {
|
|
211
|
+
* return { status: 'ok' }
|
|
212
|
+
* }
|
|
213
|
+
*
|
|
214
|
+
* @Endpoint(internalMetrics)
|
|
215
|
+
* @ApiExclude()
|
|
216
|
+
* async internalMetrics() {
|
|
217
|
+
* return { ... }
|
|
218
|
+
* }
|
|
219
|
+
* }
|
|
220
|
+
* ```
|
|
221
|
+
*/ const ApiExclude = LegacyAttributeFactory.createAttribute(ApiExcludeToken);
|
|
222
|
+
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/legacy-compat/decorators/api-stream.decorator.mts
|
|
225
|
+
const ApiStreamSchema = z.object({
|
|
226
|
+
contentType: z.string(),
|
|
227
|
+
description: z.string().optional()
|
|
228
|
+
});
|
|
229
|
+
/**
|
|
230
|
+
* Specifies content type and description for stream endpoints.
|
|
231
|
+
*
|
|
232
|
+
* Stream endpoints don't have a responseSchema, so this decorator provides
|
|
233
|
+
* the necessary metadata for OpenAPI documentation.
|
|
234
|
+
*
|
|
235
|
+
* Legacy-compatible version for TypeScript experimental decorators.
|
|
236
|
+
*
|
|
237
|
+
* @param options - Stream response options
|
|
238
|
+
*
|
|
239
|
+
* @example
|
|
240
|
+
* ```typescript
|
|
241
|
+
* @Controller()
|
|
242
|
+
* export class FileController {
|
|
243
|
+
* // Binary file download
|
|
244
|
+
* @Stream(downloadFile)
|
|
245
|
+
* @ApiStream({
|
|
246
|
+
* contentType: 'application/octet-stream',
|
|
247
|
+
* description: 'Download file as binary stream'
|
|
248
|
+
* })
|
|
249
|
+
* async download(params: StreamParams<typeof downloadFile>, reply: Reply) {
|
|
250
|
+
* // Stream implementation
|
|
251
|
+
* }
|
|
252
|
+
* }
|
|
253
|
+
*
|
|
254
|
+
* @Controller()
|
|
255
|
+
* export class EventController {
|
|
256
|
+
* // Server-Sent Events
|
|
257
|
+
* @Stream(streamEvents)
|
|
258
|
+
* @ApiStream({
|
|
259
|
+
* contentType: 'text/event-stream',
|
|
260
|
+
* description: 'Real-time event stream'
|
|
261
|
+
* })
|
|
262
|
+
* async stream(params: StreamParams<typeof streamEvents>, reply: Reply) {
|
|
263
|
+
* // SSE implementation
|
|
264
|
+
* }
|
|
265
|
+
* }
|
|
266
|
+
* ```
|
|
267
|
+
*/ const ApiStream = LegacyAttributeFactory.createAttribute(ApiStreamToken, ApiStreamSchema);
|
|
268
|
+
|
|
269
|
+
//#endregion
|
|
270
|
+
export { ApiDeprecated, ApiDeprecatedToken, ApiExclude, ApiExcludeToken, ApiOperation, ApiOperationToken, ApiSecurity, ApiSecurityToken, ApiStream, ApiStreamToken, ApiSummary, ApiSummaryToken, ApiTag, ApiTagToken, _EndpointScannerService as EndpointScannerService, _MetadataExtractorService as MetadataExtractorService, _OpenApiGeneratorService as OpenApiGeneratorService, _PathBuilderService as PathBuilderService, _SchemaConverterService as SchemaConverterService };
|
|
271
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["LegacyAttributeFactory","z","ApiTagToken","ApiTagSchema","object","name","string","description","optional","BaseApiTag","createAttribute","ApiTag","LegacyAttributeFactory","z","ApiOperationToken","ApiOperationSchema","object","summary","string","optional","description","operationId","deprecated","boolean","externalDocs","url","ApiOperation","createAttribute","LegacyAttributeFactory","z","ApiSummaryToken","ApiSummarySchema","string","ApiSummary","createAttribute","LegacyAttributeFactory","z","ApiDeprecatedToken","ApiDeprecatedSchema","object","message","string","optional","BaseApiDeprecated","createAttribute","ApiDeprecated","LegacyAttributeFactory","z","ApiSecurityToken","ApiSecuritySchema","record","string","array","ApiSecurity","createAttribute","LegacyAttributeFactory","ApiExcludeToken","ApiExclude","createAttribute","LegacyAttributeFactory","z","ApiStreamToken","ApiStreamSchema","object","contentType","string","description","optional","ApiStream","createAttribute"],"sources":["../../src/legacy-compat/decorators/api-tag.decorator.mts","../../src/legacy-compat/decorators/api-operation.decorator.mts","../../src/legacy-compat/decorators/api-summary.decorator.mts","../../src/legacy-compat/decorators/api-deprecated.decorator.mts","../../src/legacy-compat/decorators/api-security.decorator.mts","../../src/legacy-compat/decorators/api-exclude.decorator.mts","../../src/legacy-compat/decorators/api-stream.decorator.mts"],"sourcesContent":["import { LegacyAttributeFactory } from '@navios/core/legacy-compat'\nimport { z } from 'zod/v4'\n\nimport { ApiTagToken } from '../../tokens/index.mjs'\n\nconst ApiTagSchema = z.object({\n name: z.string(),\n description: z.string().optional(),\n})\n\n/** Options for the @ApiTag decorator, inferred from the schema */\nexport type ApiTagOptions = z.infer<typeof ApiTagSchema>\n\nconst BaseApiTag = LegacyAttributeFactory.createAttribute(ApiTagToken, ApiTagSchema)\n\n/**\n * Groups endpoints under a specific tag/folder in the documentation.\n *\n * Can be applied to controllers (affects all endpoints) or individual methods.\n * When applied to both, the method-level tag takes precedence.\n *\n * Legacy-compatible version for TypeScript experimental decorators.\n *\n * @param name - The tag name\n * @param description - Optional tag description\n *\n * @example\n * ```typescript\n * // Apply to entire controller\n * @Controller()\n * @ApiTag('Users', 'User management operations')\n * export class UserController {\n * @Endpoint(getUser)\n * async getUser() {}\n * }\n *\n * // Apply to individual endpoint\n * @Controller()\n * export class MixedController {\n * @Endpoint(getUser)\n * @ApiTag('Users')\n * async getUser() {}\n *\n * @Endpoint(getOrder)\n * @ApiTag('Orders')\n * async getOrder() {}\n * }\n * ```\n */\nexport function ApiTag(name: string, description?: string) {\n return BaseApiTag({ name, description })\n}\n","import { LegacyAttributeFactory } from '@navios/core/legacy-compat'\nimport { z } from 'zod/v4'\n\nimport { ApiOperationToken } from '../../tokens/index.mjs'\n\nconst ApiOperationSchema = z.object({\n summary: z.string().optional(),\n description: z.string().optional(),\n operationId: z.string().optional(),\n deprecated: z.boolean().optional(),\n externalDocs: z\n .object({\n url: z.string(),\n description: z.string().optional(),\n })\n .optional(),\n})\n\n/** Options for the @ApiOperation decorator, inferred from the schema */\nexport type ApiOperationOptions = z.infer<typeof ApiOperationSchema>\n\n/**\n * Provides detailed operation metadata for an endpoint.\n *\n * Use this decorator when you need to specify multiple operation properties.\n * For simple cases, consider using @ApiSummary instead.\n *\n * Legacy-compatible version for TypeScript experimental decorators.\n *\n * @param options - Operation configuration options\n *\n * @example\n * ```typescript\n * @Controller()\n * export class UserController {\n * @Endpoint(getUser)\n * @ApiOperation({\n * summary: 'Get user by ID',\n * description: 'Retrieves a user by their unique identifier. Returns 404 if not found.',\n * operationId: 'getUserById',\n * })\n * async getUser(params: EndpointParams<typeof getUser>) {}\n *\n * @Endpoint(legacyGetUser)\n * @ApiOperation({\n * summary: 'Get user (legacy)',\n * deprecated: true,\n * externalDocs: {\n * url: 'https://docs.example.com/migration',\n * description: 'Migration guide'\n * }\n * })\n * async getLegacyUser() {}\n * }\n * ```\n */\nexport const ApiOperation = LegacyAttributeFactory.createAttribute(\n ApiOperationToken,\n ApiOperationSchema,\n)\n","import { LegacyAttributeFactory } from '@navios/core/legacy-compat'\nimport { z } from 'zod/v4'\n\nimport { ApiSummaryToken } from '../../tokens/index.mjs'\n\nconst ApiSummarySchema = z.string()\n\n/**\n * Shorthand decorator for adding just a summary to an endpoint.\n *\n * This is equivalent to `@ApiOperation({ summary: '...' })` but more concise.\n *\n * Legacy-compatible version for TypeScript experimental decorators.\n *\n * @param summary - Short summary text for the endpoint\n *\n * @example\n * ```typescript\n * @Controller()\n * export class UserController {\n * @Endpoint(getUser)\n * @ApiSummary('Get user by ID')\n * async getUser() {}\n *\n * @Endpoint(createUser)\n * @ApiSummary('Create a new user')\n * async createUser() {}\n * }\n * ```\n */\nexport const ApiSummary = LegacyAttributeFactory.createAttribute(\n ApiSummaryToken,\n ApiSummarySchema,\n)\n","import { LegacyAttributeFactory } from '@navios/core/legacy-compat'\nimport { z } from 'zod/v4'\n\nimport { ApiDeprecatedToken } from '../../tokens/index.mjs'\n\nconst ApiDeprecatedSchema = z.object({\n message: z.string().optional(),\n})\n\n/** Options for the @ApiDeprecated decorator, inferred from the schema */\nexport type ApiDeprecatedOptions = z.infer<typeof ApiDeprecatedSchema>\n\nconst BaseApiDeprecated = LegacyAttributeFactory.createAttribute(\n ApiDeprecatedToken,\n ApiDeprecatedSchema,\n)\n\n/**\n * Marks an endpoint as deprecated.\n *\n * Deprecated endpoints are shown with a visual indicator in documentation\n * and may include a migration message.\n *\n * Legacy-compatible version for TypeScript experimental decorators.\n *\n * @param message - Optional deprecation message\n *\n * @example\n * ```typescript\n * @Controller()\n * export class UserController {\n * // Simple deprecation\n * @Endpoint(legacyGetUser)\n * @ApiDeprecated()\n * async getLegacyUser() {}\n *\n * // With migration message\n * @Endpoint(oldCreateUser)\n * @ApiDeprecated('Use POST /v2/users instead')\n * async oldCreateUser() {}\n * }\n * ```\n */\nexport function ApiDeprecated(message?: string) {\n return BaseApiDeprecated({ message })\n}\n","import { LegacyAttributeFactory } from '@navios/core/legacy-compat'\nimport { z } from 'zod/v4'\n\nimport { ApiSecurityToken } from '../../tokens/index.mjs'\n\nconst ApiSecuritySchema = z.record(z.string(), z.array(z.string()))\n\n/** Security requirement for an endpoint, inferred from the schema */\nexport type ApiSecurityRequirement = z.infer<typeof ApiSecuritySchema>\n\n/**\n * Specifies security requirements for an endpoint.\n *\n * The security requirement object maps security scheme names to their scopes.\n * For schemes that don't use scopes (like API keys), use an empty array.\n *\n * Legacy-compatible version for TypeScript experimental decorators.\n *\n * @param requirements - Security requirements object\n *\n * @example\n * ```typescript\n * @Controller()\n * export class UserController {\n * // Require bearer token authentication\n * @Endpoint(getUser)\n * @ApiSecurity({ bearerAuth: [] })\n * async getUser() {}\n *\n * // Require multiple authentication methods\n * @Endpoint(adminEndpoint)\n * @ApiSecurity({ bearerAuth: [], apiKey: [] })\n * async adminAction() {}\n *\n * // OAuth2 with specific scopes\n * @Endpoint(writeUser)\n * @ApiSecurity({ oauth2: ['users:write', 'users:read'] })\n * async writeUser() {}\n * }\n * ```\n */\nexport const ApiSecurity = LegacyAttributeFactory.createAttribute(\n ApiSecurityToken,\n ApiSecuritySchema,\n)\n","import { LegacyAttributeFactory } from '@navios/core/legacy-compat'\n\nimport { ApiExcludeToken } from '../../tokens/index.mjs'\n\n/**\n * Excludes an endpoint from OpenAPI documentation.\n *\n * Use this decorator for internal endpoints that should not be visible\n * in the public API documentation.\n *\n * Legacy-compatible version for TypeScript experimental decorators.\n *\n * @example\n * ```typescript\n * @Controller()\n * export class HealthController {\n * @Endpoint(healthCheck)\n * @ApiExclude()\n * async healthCheck() {\n * return { status: 'ok' }\n * }\n *\n * @Endpoint(internalMetrics)\n * @ApiExclude()\n * async internalMetrics() {\n * return { ... }\n * }\n * }\n * ```\n */\nexport const ApiExclude = LegacyAttributeFactory.createAttribute(ApiExcludeToken)\n","import { LegacyAttributeFactory } from '@navios/core/legacy-compat'\nimport { z } from 'zod/v4'\n\nimport { ApiStreamToken } from '../../tokens/index.mjs'\n\nconst ApiStreamSchema = z.object({\n contentType: z.string(),\n description: z.string().optional(),\n})\n\n/** Options for the @ApiStream decorator, inferred from the schema */\nexport type ApiStreamOptions = z.infer<typeof ApiStreamSchema>\n\n/**\n * Specifies content type and description for stream endpoints.\n *\n * Stream endpoints don't have a responseSchema, so this decorator provides\n * the necessary metadata for OpenAPI documentation.\n *\n * Legacy-compatible version for TypeScript experimental decorators.\n *\n * @param options - Stream response options\n *\n * @example\n * ```typescript\n * @Controller()\n * export class FileController {\n * // Binary file download\n * @Stream(downloadFile)\n * @ApiStream({\n * contentType: 'application/octet-stream',\n * description: 'Download file as binary stream'\n * })\n * async download(params: StreamParams<typeof downloadFile>, reply: Reply) {\n * // Stream implementation\n * }\n * }\n *\n * @Controller()\n * export class EventController {\n * // Server-Sent Events\n * @Stream(streamEvents)\n * @ApiStream({\n * contentType: 'text/event-stream',\n * description: 'Real-time event stream'\n * })\n * async stream(params: StreamParams<typeof streamEvents>, reply: Reply) {\n * // SSE implementation\n * }\n * }\n * ```\n */\nexport const ApiStream = LegacyAttributeFactory.createAttribute(\n ApiStreamToken,\n ApiStreamSchema,\n)\n"],"mappings":";;;;;AAKA,MAAMG,eAAeF,EAAEG,OAAO;CAC5BC,MAAMJ,EAAEK,QAAM;CACdC,aAAaN,EAAEK,QAAM,CAAGE,UAAQ;CAClC,CAAA;AAKA,MAAMC,aAAaT,uBAAuBU,gBAAgBR,aAAaC,aAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCvE,SAAgBQ,OAAON,MAAcE,aAAoB;AACvD,QAAOE,WAAW;EAAEJ;EAAME;EAAY,CAAA;;;;;AC7CxC,MAAMQ,qBAAqBF,EAAEG,OAAO;CAClCC,SAASJ,EAAEK,QAAM,CAAGC,UAAQ;CAC5BC,aAAaP,EAAEK,QAAM,CAAGC,UAAQ;CAChCE,aAAaR,EAAEK,QAAM,CAAGC,UAAQ;CAChCG,YAAYT,EAAEU,SAAO,CAAGJ,UAAQ;CAChCK,cAAcX,EACXG,OAAO;EACNS,KAAKZ,EAAEK,QAAM;EACbE,aAAaP,EAAEK,QAAM,CAAGC,UAAQ;EAClC,CAAA,CACCA,UAAQ;CACb,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCA,MAAaO,eAAed,uBAAuBe,gBACjDb,mBACAC,mBAAAA;;;;ACrDF,MAAMgB,mBAAmBF,EAAEG,QAAM;;;;;;;;;;;;;;;;;;;;;;;GAyBjC,MAAaC,aAAaL,uBAAuBM,gBAC/CJ,iBACAC,iBAAAA;;;;AC3BF,MAAMO,sBAAsBF,EAAEG,OAAO,EACnCC,SAASJ,EAAEK,QAAM,CAAGC,UAAQ,EAC9B,CAAA;AAKA,MAAMC,oBAAoBR,uBAAuBS,gBAC/CP,oBACAC,oBAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BF,SAAgBO,cAAcL,SAAgB;AAC5C,QAAOG,kBAAkB,EAAEH,SAAQ,CAAA;;;;;ACvCrC,MAAMS,oBAAoBF,EAAEG,OAAOH,EAAEI,QAAM,EAAIJ,EAAEK,MAAML,EAAEI,QAAM,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoC/D,MAAaE,cAAcP,uBAAuBQ,gBAChDN,kBACAC,kBAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GCbF,MAAaQ,aAAaF,uBAAuBG,gBAAgBF,gBAAAA;;;;ACzBjE,MAAMM,kBAAkBF,EAAEG,OAAO;CAC/BC,aAAaJ,EAAEK,QAAM;CACrBC,aAAaN,EAAEK,QAAM,CAAGE,UAAQ;CAClC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CA,MAAaC,YAAYT,uBAAuBU,gBAC9CR,gBACAC,gBAAAA"}
|