@navios/core 0.9.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/lib/{index-D9MNh6Tx.d.mts → index-B2ulzZIr.d.cts} +31 -2
  3. package/lib/index-B2ulzZIr.d.cts.map +1 -0
  4. package/lib/{index-Db1d3cwD.d.cts → index-C8lUQePd.d.mts} +31 -2
  5. package/lib/index-C8lUQePd.d.mts.map +1 -0
  6. package/lib/index.cjs +5 -2
  7. package/lib/index.d.cts +2 -2
  8. package/lib/index.d.mts +2 -2
  9. package/lib/index.mjs +3 -3
  10. package/lib/legacy-compat/index.cjs +133 -1
  11. package/lib/legacy-compat/index.cjs.map +1 -1
  12. package/lib/legacy-compat/index.d.cts +218 -6
  13. package/lib/legacy-compat/index.d.cts.map +1 -1
  14. package/lib/legacy-compat/index.d.mts +218 -6
  15. package/lib/legacy-compat/index.d.mts.map +1 -1
  16. package/lib/legacy-compat/index.mjs +128 -2
  17. package/lib/legacy-compat/index.mjs.map +1 -1
  18. package/lib/{src-Bo23RIo-.mjs → src-Baabu2R8.mjs} +6 -4
  19. package/lib/src-Baabu2R8.mjs.map +1 -0
  20. package/lib/{src-BRPtJ9fG.cjs → src-Cu9OAnfp.cjs} +6 -4
  21. package/lib/src-Cu9OAnfp.cjs.map +1 -0
  22. package/lib/testing/index.cjs +2 -2
  23. package/lib/testing/index.d.cts +1 -1
  24. package/lib/testing/index.d.mts +1 -1
  25. package/lib/testing/index.mjs +2 -2
  26. package/lib/{use-guards.decorator-CzVXuLkz.mjs → use-guards.decorator-ChJVzYLW.mjs} +27 -2
  27. package/lib/use-guards.decorator-ChJVzYLW.mjs.map +1 -0
  28. package/lib/{use-guards.decorator-Bs8oDHOi.cjs → use-guards.decorator-EvI2m2DK.cjs} +45 -2
  29. package/lib/use-guards.decorator-EvI2m2DK.cjs.map +1 -0
  30. package/package.json +3 -3
  31. package/src/attribute.factory.mts +19 -3
  32. package/src/legacy-compat/__type-tests__/legacy-decorators.spec-d.mts +112 -4
  33. package/src/legacy-compat/attribute.factory.mts +365 -0
  34. package/src/legacy-compat/context-compat.mts +2 -0
  35. package/src/legacy-compat/decorators/index.mts +1 -0
  36. package/src/legacy-compat/decorators/injectable.decorator.mts +41 -0
  37. package/src/legacy-compat/decorators/stream.decorator.mts +21 -14
  38. package/src/legacy-compat/index.mts +14 -3
  39. package/src/metadata/index.mts +1 -0
  40. package/src/metadata/navios-managed.metadata.mts +42 -0
  41. package/lib/index-D9MNh6Tx.d.mts.map +0 -1
  42. package/lib/index-Db1d3cwD.d.cts.map +0 -1
  43. package/lib/src-BRPtJ9fG.cjs.map +0 -1
  44. package/lib/src-Bo23RIo-.mjs.map +0 -1
  45. package/lib/use-guards.decorator-Bs8oDHOi.cjs.map +0 -1
  46. package/lib/use-guards.decorator-CzVXuLkz.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
- import { G as MultipartParams, J as ModuleOptions, K as MultipartResult, U as StreamParams, at as CanActivate, in as EndpointResult, on as ControllerOptions, rn as EndpointParams, rt as HttpHeader } from "../index-D9MNh6Tx.mjs";
2
- import { ClassType, ClassTypeWithInstance, InjectionToken } from "@navios/di";
1
+ import { G as MultipartParams, J as ModuleOptions, K as MultipartResult, Kt as ModuleMetadata, U as StreamParams, Zt as ControllerMetadata, at as CanActivate, cn as EndpointResult, rn as HandlerMetadata, rt as HttpHeader, sn as EndpointParams, un as ControllerOptions } from "../index-C8lUQePd.mjs";
2
+ import { ClassType, ClassTypeWithInstance, InjectableOptions, InjectionToken } from "@navios/di";
3
3
  import { ZodObject, ZodType, z as z$1 } from "zod/v4";
4
4
  import { BaseEndpointConfig, BaseStreamConfig, EndpointFunctionArgs, HttpMethod } from "@navios/builder";
5
5
 
@@ -184,12 +184,12 @@ declare function Multipart<Method extends HttpMethod = HttpMethod, Url extends s
184
184
  }): <T extends object>(target: T, propertyKey: string | symbol, descriptor: MultipartMethodDescriptor<Url, QuerySchema, RequestSchema, ResponseSchema>) => PropertyDescriptor | void;
185
185
  //#endregion
186
186
  //#region src/legacy-compat/decorators/stream.decorator.d.mts
187
+ type StreamParams$1<Url extends string, QuerySchema, RequestSchema> = QuerySchema extends ZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema, true> : EndpointFunctionArgs<Url, QuerySchema, undefined, true> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema, true> : EndpointFunctionArgs<Url, undefined, undefined, true>;
187
188
  /**
188
189
  * Type helper to constrain a PropertyDescriptor's value to match a stream endpoint signature.
189
- * Note: In legacy decorators, type constraints are checked when the decorator is applied,
190
- * but may not be preserved perfectly when decorators are stacked.
190
+ * Supports both with and without reply parameter (Bun doesn't use reply parameter).
191
191
  */
192
- type StreamMethodDescriptor<Url extends string, QuerySchema, RequestSchema> = TypedPropertyDescriptor<(params: QuerySchema extends ZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema, true> : EndpointFunctionArgs<Url, QuerySchema, undefined, true> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema, true> : EndpointFunctionArgs<Url, undefined, undefined, true>, reply: any) => Promise<void>>;
192
+ type StreamMethodDescriptor<Url extends string, QuerySchema, RequestSchema> = TypedPropertyDescriptor<(params: StreamParams$1<Url, QuerySchema, RequestSchema>, reply: any) => any> | TypedPropertyDescriptor<(params: StreamParams$1<Url, QuerySchema, RequestSchema>) => any> | TypedPropertyDescriptor<() => any>;
193
193
  /**
194
194
  * Legacy-compatible Stream decorator.
195
195
  *
@@ -215,5 +215,217 @@ declare function Stream<Method extends HttpMethod = HttpMethod, Url extends stri
215
215
  config: BaseStreamConfig<Method, Url, QuerySchema, RequestSchema>;
216
216
  }): <T extends object>(target: T, propertyKey: string | symbol, descriptor: StreamMethodDescriptor<Url, QuerySchema, RequestSchema>) => StreamMethodDescriptor<Url, QuerySchema, RequestSchema>;
217
217
  //#endregion
218
- export { Controller, type ControllerOptions, Endpoint, type EndpointParams, type EndpointResult, Header, HttpCode, Module, type ModuleOptions, Multipart, type MultipartParams, type MultipartResult, Stream, type StreamParams, UseGuards };
218
+ //#region src/legacy-compat/decorators/injectable.decorator.d.mts
219
+ /**
220
+ * Legacy-compatible Injectable decorator.
221
+ *
222
+ * Works with TypeScript experimental decorators (legacy API).
223
+ *
224
+ * @param options - Injectable configuration options
225
+ * @returns A class decorator compatible with legacy decorator API
226
+ *
227
+ * @example
228
+ * ```typescript
229
+ * @Injectable()
230
+ * export class UserService {
231
+ * getUser(id: string) {
232
+ * return { id, name: 'John' }
233
+ * }
234
+ * }
235
+ * ```
236
+ */
237
+ declare function Injectable(options?: InjectableOptions): (target: ClassType) => ClassType;
238
+ //#endregion
239
+ //#region src/legacy-compat/attribute.factory.d.mts
240
+ /**
241
+ * Type for a legacy class attribute decorator without a value.
242
+ *
243
+ * Attributes are custom metadata decorators that can be applied to modules,
244
+ * controllers, and endpoints.
245
+ */
246
+ type LegacyClassAttribute = (() => <T extends ClassType>(target: T) => T) & (() => <T extends object>(target: T, propertyKey: string | symbol, descriptor: PropertyDescriptor) => PropertyDescriptor) & {
247
+ token: symbol;
248
+ };
249
+ /**
250
+ * Type for a legacy class attribute decorator with a validated value.
251
+ *
252
+ * @typeParam S - The Zod schema type for validation
253
+ */
254
+ type LegacyClassSchemaAttribute<S extends ZodType> = ((value: z$1.input<S>) => <T extends ClassType>(target: T) => T) & ((value: z$1.input<S>) => <T extends object>(target: T, propertyKey: string | symbol, descriptor: PropertyDescriptor) => PropertyDescriptor) & {
255
+ token: symbol;
256
+ schema: ZodType;
257
+ };
258
+ /**
259
+ * Legacy-compatible factory for creating custom attribute decorators.
260
+ *
261
+ * Works with TypeScript experimental decorators (legacy API).
262
+ *
263
+ * Attributes allow you to add custom metadata to modules, controllers, and endpoints.
264
+ * This is useful for cross-cutting concerns like rate limiting, caching, API versioning, etc.
265
+ *
266
+ * @example
267
+ * ```typescript
268
+ * // Create a simple boolean attribute
269
+ * const Public = LegacyAttributeFactory.createAttribute(Symbol.for('Public'))
270
+ *
271
+ * // Use it as a decorator
272
+ * @Controller()
273
+ * @Public()
274
+ * export class PublicController { }
275
+ *
276
+ * // Check if attribute exists
277
+ * if (LegacyAttributeFactory.has(Public, controllerMetadata)) {
278
+ * // Skip authentication
279
+ * }
280
+ * ```
281
+ *
282
+ * @example
283
+ * ```typescript
284
+ * // Create an attribute with a validated value
285
+ * const RateLimit = LegacyAttributeFactory.createAttribute(
286
+ * Symbol.for('RateLimit'),
287
+ * z.object({ requests: z.number(), window: z.number() })
288
+ * )
289
+ *
290
+ * // Use it with a value
291
+ * @Endpoint(apiEndpoint)
292
+ * @RateLimit({ requests: 100, window: 60000 })
293
+ * async handler() { }
294
+ *
295
+ * // Get the value
296
+ * const limit = LegacyAttributeFactory.get(RateLimit, endpointMetadata)
297
+ * // limit is typed as { requests: number, window: number } | null
298
+ * ```
299
+ */
300
+ declare class LegacyAttributeFactory {
301
+ /**
302
+ * Creates a simple attribute decorator without a value.
303
+ *
304
+ * @param token - A unique symbol to identify this attribute
305
+ * @returns A decorator function that can be applied to classes or methods
306
+ *
307
+ * @example
308
+ * ```typescript
309
+ * const Public = LegacyAttributeFactory.createAttribute(Symbol.for('Public'))
310
+ *
311
+ * @Public()
312
+ * @Controller()
313
+ * export class PublicController { }
314
+ * ```
315
+ */
316
+ static createAttribute(token: symbol): LegacyClassAttribute;
317
+ /**
318
+ * Creates an attribute decorator with a validated value.
319
+ *
320
+ * @param token - A unique symbol to identify this attribute
321
+ * @param schema - A Zod schema to validate the attribute value
322
+ * @returns A decorator function that accepts a value and can be applied to classes or methods
323
+ *
324
+ * @example
325
+ * ```typescript
326
+ * const RateLimit = LegacyAttributeFactory.createAttribute(
327
+ * Symbol.for('RateLimit'),
328
+ * z.object({ requests: z.number(), window: z.number() })
329
+ * )
330
+ *
331
+ * @RateLimit({ requests: 100, window: 60000 })
332
+ * @Endpoint(apiEndpoint)
333
+ * async handler() { }
334
+ * ```
335
+ */
336
+ static createAttribute<T extends ZodType>(token: symbol, schema: T): LegacyClassSchemaAttribute<T>;
337
+ /**
338
+ * Gets the value of an attribute from metadata.
339
+ *
340
+ * Returns `null` if the attribute is not present.
341
+ * For simple attributes (without values), returns `true` if present.
342
+ *
343
+ * @param attribute - The attribute decorator
344
+ * @param target - The metadata object (module, controller, or handler)
345
+ * @returns The attribute value, `true` for simple attributes, or `null` if not found
346
+ *
347
+ * @example
348
+ * ```typescript
349
+ * const isPublic = LegacyAttributeFactory.get(Public, controllerMetadata)
350
+ * // isPublic is true | null
351
+ *
352
+ * const rateLimit = LegacyAttributeFactory.get(RateLimit, endpointMetadata)
353
+ * // rateLimit is { requests: number, window: number } | null
354
+ * ```
355
+ */
356
+ static get(attribute: LegacyClassAttribute, target: ModuleMetadata | ControllerMetadata | HandlerMetadata<any>): true | null;
357
+ static get<T extends ZodType>(attribute: LegacyClassSchemaAttribute<T>, target: ModuleMetadata | ControllerMetadata | HandlerMetadata<any>): z$1.output<T> | null;
358
+ /**
359
+ * Gets all values of an attribute from metadata (useful when an attribute can appear multiple times).
360
+ *
361
+ * Returns `null` if the attribute is not present.
362
+ *
363
+ * @param attribute - The attribute decorator
364
+ * @param target - The metadata object (module, controller, or handler)
365
+ * @returns An array of attribute values, or `null` if not found
366
+ *
367
+ * @example
368
+ * ```typescript
369
+ * const tags = LegacyAttributeFactory.getAll(Tag, endpointMetadata)
370
+ * // tags is string[] | null
371
+ * ```
372
+ */
373
+ static getAll(attribute: LegacyClassAttribute, target: ModuleMetadata | ControllerMetadata | HandlerMetadata<any>): Array<true> | null;
374
+ static getAll<T extends ZodType>(attribute: LegacyClassSchemaAttribute<T>, target: ModuleMetadata | ControllerMetadata | HandlerMetadata<any>): Array<z$1.output<T>> | null;
375
+ /**
376
+ * Gets the last value of an attribute from an array of metadata objects.
377
+ *
378
+ * Searches from the end of the array backwards, useful for finding the most
379
+ * specific attribute value (e.g., endpoint-level overrides module-level).
380
+ *
381
+ * @param attribute - The attribute decorator
382
+ * @param target - An array of metadata objects (typically [module, controller, handler])
383
+ * @returns The last attribute value found, or `null` if not found
384
+ *
385
+ * @example
386
+ * ```typescript
387
+ * // Check attribute hierarchy: endpoint -> controller -> module
388
+ * const rateLimit = LegacyAttributeFactory.getLast(RateLimit, [
389
+ * moduleMetadata,
390
+ * controllerMetadata,
391
+ * endpointMetadata
392
+ * ])
393
+ * ```
394
+ */
395
+ static getLast(attribute: LegacyClassAttribute, target: (ModuleMetadata | ControllerMetadata | HandlerMetadata<any>)[]): true | null;
396
+ static getLast<T extends ZodType>(attribute: LegacyClassSchemaAttribute<T>, target: (ModuleMetadata | ControllerMetadata | HandlerMetadata<any>)[]): z$1.output<T> | null;
397
+ /**
398
+ * Checks if an attribute is present on the metadata object.
399
+ *
400
+ * @param attribute - The attribute decorator
401
+ * @param target - The metadata object (module, controller, or handler)
402
+ * @returns `true` if the attribute is present, `false` otherwise
403
+ *
404
+ * @example
405
+ * ```typescript
406
+ * if (LegacyAttributeFactory.has(Public, controllerMetadata)) {
407
+ * // Skip authentication
408
+ * }
409
+ * ```
410
+ */
411
+ static has(attribute: LegacyClassAttribute, target: ModuleMetadata | ControllerMetadata | HandlerMetadata<any>): boolean;
412
+ static has<T extends ZodType>(attribute: LegacyClassSchemaAttribute<T>, target: ModuleMetadata | ControllerMetadata | HandlerMetadata<any>): boolean;
413
+ }
414
+ //#endregion
415
+ //#region src/legacy-compat/context-compat.d.mts
416
+ /**
417
+ * Creates a mock ClassDecoratorContext for legacy class decorators.
418
+ * @internal
419
+ */
420
+ declare function createClassContext(target: ClassType): ClassDecoratorContext;
421
+ /**
422
+ * Creates a mock ClassMethodDecoratorContext for legacy method decorators.
423
+ *
424
+ * Note: Method decorators need to share metadata with the class context
425
+ * because endpoint metadata is stored at the class level.
426
+ * @internal
427
+ */
428
+ declare function createMethodContext(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): ClassMethodDecoratorContext;
429
+ //#endregion
430
+ export { LegacyAttributeFactory as AttributeFactory, LegacyAttributeFactory, Controller, type ControllerOptions, Endpoint, type EndpointParams, type EndpointResult, Header, HttpCode, Injectable, type LegacyClassAttribute, type LegacyClassSchemaAttribute, Module, type ModuleOptions, Multipart, type MultipartParams, type MultipartResult, Stream, type StreamParams, UseGuards, createClassContext, createMethodContext };
219
431
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/legacy-compat/decorators/module.decorator.mts","../../src/legacy-compat/decorators/controller.decorator.mts","../../src/legacy-compat/decorators/endpoint.decorator.mts","../../src/legacy-compat/decorators/use-guards.decorator.mts","../../src/legacy-compat/decorators/header.decorator.mts","../../src/legacy-compat/decorators/http-code.decorator.mts","../../src/legacy-compat/decorators/multipart.decorator.mts","../../src/legacy-compat/decorators/stream.decorator.mts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AAuBA;;;;;;;;ACCA;;;;;;iBDDgB,MAAA,WACL,yBAMgB,cAAS;;;;;;;AAPpC;;;;;;;;ACCA;;;;;iBAAgB,UAAA,WAAoB,6BACT,cAAS;;;;;;;ADFpC;KERK,wBFSM,CAAA,YAAA,MAAA,EAAA,WAAA,EAAA,aAAA,EAAA,uBELc,OFKd,CAAA,GEJP,uBFIO,CAAA,CAAA,MAAA,EEFC,WFED,SEFqB,OFErB,GEDH,aFCG,SEDmB,OFCnB,GEAD,oBFAC,CEAoB,GFApB,EEAyB,WFAzB,EEAsC,aFAtC,EAAA,IAAA,CAAA,GECD,oBFDC,CECoB,GFDpB,EECyB,WFDzB,EAAA,SAAA,EAAA,IAAA,CAAA,GEEH,aFFG,SEEmB,OFFnB,GEGD,oBFHC,CEGoB,GFHpB,EAAA,SAAA,EEGoC,aFHpC,EAAA,IAAA,CAAA,GEID,oBFJC,CEIoB,GFJpB,EAAA,SAAA,EAAA,SAAA,EAAA,IAAA,CAAA,EAAA,GEKJ,OFLI,CEKI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PEG,SOFmB,OPEnB,GODD,oBPCC,CODoB,GPCpB,EODyB,WPCzB,EODsC,aPCtC,EAAA,IAAA,CAAA,GOAD,oBPAC,COAoB,GPApB,EOAyB,WPAzB,EAAA,SAAA,EAAA,IAAA,CAAA,GOCH,aPDG,SOCmB,OPDnB,GOED,oBPFC,COEoB,GPFpB,EAAA,SAAA,EOEoC,aPFpC,EAAA,IAAA,CAAA,GOGD,oBPHC,COGoB,GPHpB,EAAA,SAAA,EAAA,SAAA,EAAA,IAAA,CAAA,EAAA,KAAA,EAAA,GAAA,EAAA,GOKJ,OPLI,CAAA,IAAA,CAAA,CAAA;;;;;;;ACAX;;;;;;;;ACnBwC;;;;;;;AAmBJ,iBK6BpB,ML7BoB,CAAA,eK8BnB,UL9BmB,GK8BN,UL9BM,EAAA,YAAA,MAAA,GAAA,MAAA,EAAA,cAAA,SAAA,EAAA,gBKiClB,OLjCkB,CAAA,CAAA,QAAA,EAAA;EAAa,MAAA,EKmCvC,gBLnCuC,CKmCtB,MLnCsB,EKmCd,GLnCc,EKmCT,WLnCS,EKmCI,aLnCJ,CAAA;CAAvC,CAAA,EAAA,CAAA,UAAA,MAAA,CAAA,CAAA,MAAA,EKsCE,CLtCF,EAAA,WAAA,EAAA,MAAA,GAAA,MAAA,EAAA,UAAA,EKwCM,sBLxCN,CKwC6B,GLxC7B,EKwCkC,WLxClC,EKwC+C,aLxC/C,CAAA,EAAA,GKwC6D,sBLxC7D,CKwC6D,GLxC7D,EKwC6D,WLxC7D,EKwC6D,aLxC7D,CAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/legacy-compat/decorators/module.decorator.mts","../../src/legacy-compat/decorators/controller.decorator.mts","../../src/legacy-compat/decorators/endpoint.decorator.mts","../../src/legacy-compat/decorators/use-guards.decorator.mts","../../src/legacy-compat/decorators/header.decorator.mts","../../src/legacy-compat/decorators/http-code.decorator.mts","../../src/legacy-compat/decorators/multipart.decorator.mts","../../src/legacy-compat/decorators/stream.decorator.mts","../../src/legacy-compat/decorators/injectable.decorator.mts","../../src/legacy-compat/attribute.factory.mts","../../src/legacy-compat/context-compat.mts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AAuBA;;;;;;;;ACCA;;;;;;iBDDgB,MAAA,WACL,yBAMgB,cAAS;;;;;;;AAPpC;;;;;;;;ACCA;;;;;iBAAgB,UAAA,WAAoB,6BACT,cAAS;;;;;;;ADFpC;KERK,wBFSM,CAAA,YAAA,MAAA,EAAA,WAAA,EAAA,aAAA,EAAA,uBELc,OFKd,CAAA,GEJP,uBFIO,CAAA,CAAA,MAAA,EEFC,WFED,SEFqB,OFErB,GEDH,aFCG,SEDmB,OFCnB,GEAD,oBFAC,CEAoB,GFApB,EEAyB,WFAzB,EEAsC,aFAtC,EAAA,IAAA,CAAA,GECD,oBFDC,CECoB,GFDpB,EECyB,WFDzB,EAAA,SAAA,EAAA,IAAA,CAAA,GEEH,aFFG,SEEmB,OFFnB,GEGD,oBFHC,CEGoB,GFHpB,EAAA,SAAA,EEGoC,aFHpC,EAAA,IAAA,CAAA,GEID,oBFJC,CEIoB,GFJpB,EAAA,SAAA,EAAA,SAAA,EAAA,IAAA,CAAA,EAAA,GEKJ,OFLI,CEKI,GAAA,CAAE,KFLN,CEKY,cFLZ,CAAA,CAAA,CAAA;;;;;;;ACAX;;;;;;;;ACnBwC;;;;;;AAmBT,iBA4Bf,QA5Be,CAAA,eA6Bd,UA7Bc,GA6BD,UA7BC,EAAA,YAAA,MAAA,GAAA,MAAA,EAAA,cAAA,SAAA,EAAA,uBAgCN,OAhCM,GAgCI,OAhCJ,EAAA,gBAiCb,OAjCa,CAAA,CAAA,QAAA,EAAA;EAAK,MAAA,EAmC1B,kBAnC0B,CAoChC,MApCgC,EAqChC,GArCgC,EAsChC,WAtCgC,EAuChC,cAvCgC,EAwChC,aAxCgC,CAAA;CAAa,CAAA,EAAA,CAAA,MAAA,EAAA,GAAA,EAAA,WAAA,EAAA,MAAA,GAAA,MAAA,EAAA,UA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XuLkz.mjs";
1
+ import { M as getEndpointMetadata, O as getControllerMetadata, T as hasModuleMetadata, a as HttpCode$1, b as getManagedMetadata, i as Module$1, k as hasControllerMetadata, n as Stream$1, o as Header$1, r as Multipart$1, s as Endpoint$1, t as UseGuards$1, v as Controller$1, w as getModuleMetadata, x as hasManagedMetadata } from "../use-guards.decorator-ChJVzYLW.mjs";
2
+ import { Injectable as Injectable$1 } from "@navios/di";
2
3
 
3
4
  //#region src/legacy-compat/context-compat.mts
4
5
  /**
@@ -17,6 +18,7 @@ import { a as HttpCode$1, i as Module$1, n as Stream$1, o as Header$1, r as Mult
17
18
  }
18
19
  /**
19
20
  * Creates a mock ClassDecoratorContext for legacy class decorators.
21
+ * @internal
20
22
  */ function createClassContext(target) {
21
23
  if (!classMetadataMap.has(target)) classMetadataMap.set(target, {});
22
24
  const metadata = classMetadataMap.get(target);
@@ -32,6 +34,7 @@ import { a as HttpCode$1, i as Module$1, n as Stream$1, o as Header$1, r as Mult
32
34
  *
33
35
  * Note: Method decorators need to share metadata with the class context
34
36
  * because endpoint metadata is stored at the class level.
37
+ * @internal
35
38
  */ function createMethodContext(target, propertyKey, descriptor) {
36
39
  const constructor = getConstructor(target);
37
40
  if (!constructor) throw new Error("[Navios] Could not determine class constructor from method decorator target.");
@@ -304,5 +307,128 @@ import { a as HttpCode$1, i as Module$1, n as Stream$1, o as Header$1, r as Mult
304
307
  }
305
308
 
306
309
  //#endregion
307
- export { Controller, Endpoint, Header, HttpCode, Module, Multipart, Stream, UseGuards };
310
+ //#region src/legacy-compat/decorators/injectable.decorator.mts
311
+ /**
312
+ * Legacy-compatible Injectable decorator.
313
+ *
314
+ * Works with TypeScript experimental decorators (legacy API).
315
+ *
316
+ * @param options - Injectable configuration options
317
+ * @returns A class decorator compatible with legacy decorator API
318
+ *
319
+ * @example
320
+ * ```typescript
321
+ * @Injectable()
322
+ * export class UserService {
323
+ * getUser(id: string) {
324
+ * return { id, name: 'John' }
325
+ * }
326
+ * }
327
+ * ```
328
+ */ function Injectable(options = {}) {
329
+ return function(target) {
330
+ const context = createClassContext(target);
331
+ return (Object.keys(options).length === 0 ? Injectable$1() : Injectable$1(options))(target, context);
332
+ };
333
+ }
334
+
335
+ //#endregion
336
+ //#region src/legacy-compat/attribute.factory.mts
337
+ /**
338
+ * Legacy-compatible factory for creating custom attribute decorators.
339
+ *
340
+ * Works with TypeScript experimental decorators (legacy API).
341
+ *
342
+ * Attributes allow you to add custom metadata to modules, controllers, and endpoints.
343
+ * This is useful for cross-cutting concerns like rate limiting, caching, API versioning, etc.
344
+ *
345
+ * @example
346
+ * ```typescript
347
+ * // Create a simple boolean attribute
348
+ * const Public = LegacyAttributeFactory.createAttribute(Symbol.for('Public'))
349
+ *
350
+ * // Use it as a decorator
351
+ * @Controller()
352
+ * @Public()
353
+ * export class PublicController { }
354
+ *
355
+ * // Check if attribute exists
356
+ * if (LegacyAttributeFactory.has(Public, controllerMetadata)) {
357
+ * // Skip authentication
358
+ * }
359
+ * ```
360
+ *
361
+ * @example
362
+ * ```typescript
363
+ * // Create an attribute with a validated value
364
+ * const RateLimit = LegacyAttributeFactory.createAttribute(
365
+ * Symbol.for('RateLimit'),
366
+ * z.object({ requests: z.number(), window: z.number() })
367
+ * )
368
+ *
369
+ * // Use it with a value
370
+ * @Endpoint(apiEndpoint)
371
+ * @RateLimit({ requests: 100, window: 60000 })
372
+ * async handler() { }
373
+ *
374
+ * // Get the value
375
+ * const limit = LegacyAttributeFactory.get(RateLimit, endpointMetadata)
376
+ * // limit is typed as { requests: number, window: number } | null
377
+ * ```
378
+ */ var LegacyAttributeFactory = class {
379
+ static createAttribute(token, schema) {
380
+ const res = (value) => {
381
+ function decorator(target, propertyKey, descriptor) {
382
+ if (propertyKey !== void 0 && descriptor !== void 0) {
383
+ const context = createMethodContext(target, propertyKey, descriptor);
384
+ const metadata = getEndpointMetadata(descriptor.value, context);
385
+ if (schema) {
386
+ const validatedValue = schema.safeParse(value);
387
+ if (!validatedValue.success) throw new Error(`[Navios] Invalid value for attribute ${token.toString()}: ${validatedValue.error}`);
388
+ metadata.customAttributes.set(token, validatedValue.data);
389
+ } else metadata.customAttributes.set(token, true);
390
+ return descriptor;
391
+ } else {
392
+ const isController = hasControllerMetadata(target);
393
+ const isModule = hasModuleMetadata(target);
394
+ const isManaged = hasManagedMetadata(target);
395
+ if (!isController && !isModule && !isManaged) throw new Error("[Navios] Attribute can only be applied to classes with @Controller, @Module, or other Navios-managed decorators");
396
+ const context = createClassContext(target);
397
+ const metadata = isController ? getControllerMetadata(target, context) : isModule ? getModuleMetadata(target, context) : isManaged ? getManagedMetadata(target) : null;
398
+ if (!metadata) throw new Error("[Navios] Could not determine metadata for attribute target");
399
+ if (schema) {
400
+ const validatedValue = schema.safeParse(value);
401
+ if (!validatedValue.success) throw new Error(`[Navios] Invalid value for attribute ${token.toString()}: ${validatedValue.error}`);
402
+ metadata.customAttributes.set(token, validatedValue.data);
403
+ } else metadata.customAttributes.set(token, true);
404
+ return target;
405
+ }
406
+ }
407
+ return decorator;
408
+ };
409
+ res.token = token;
410
+ if (schema) res.schema = schema;
411
+ return res;
412
+ }
413
+ static get(attribute, target) {
414
+ return target.customAttributes.get(attribute.token) ?? null;
415
+ }
416
+ static getAll(attribute, target) {
417
+ const values = Array.from(target.customAttributes.entries()).filter(([key]) => key === attribute.token).map(([, value]) => value);
418
+ return values.length > 0 ? values : null;
419
+ }
420
+ static getLast(attribute, target) {
421
+ for (let i = target.length - 1; i >= 0; i--) {
422
+ const value = target[i].customAttributes.get(attribute.token);
423
+ if (value) return value;
424
+ }
425
+ return null;
426
+ }
427
+ static has(attribute, target) {
428
+ return target.customAttributes.has(attribute.token);
429
+ }
430
+ };
431
+
432
+ //#endregion
433
+ export { LegacyAttributeFactory as AttributeFactory, LegacyAttributeFactory, Controller, Endpoint, Header, HttpCode, Injectable, Module, Multipart, Stream, UseGuards, createClassContext, createMethodContext };
308
434
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["classMetadataMap","WeakMap","getConstructor","prototype","constructor","createClassContext","target","has","set","metadata","get","kind","name","addInitializer","createMethodContext","propertyKey","descriptor","Error","static","private","access","value","Module","OriginalModule","createClassContext","options","controllers","imports","guards","target","context","originalDecorator","Controller","OriginalController","createClassContext","options","target","context","originalDecorator","Endpoint","OriginalEndpoint","createMethodContext","endpoint","target","propertyKey","descriptor","Error","typedDescriptor","context","originalDecorator","result","value","UseGuards","OriginalUseGuards","createClassContext","createMethodContext","guards","decoratorImpl","target","propertyKey","descriptor","undefined","context","originalDecorator","result","value","Header","OriginalHeader","createMethodContext","name","value","target","propertyKey","descriptor","context","originalDecorator","result","HttpCode","OriginalHttpCode","createMethodContext","code","target","propertyKey","descriptor","context","originalDecorator","result","value","Multipart","OriginalMultipart","createMethodContext","endpoint","target","propertyKey","descriptor","Error","context","originalDecorator","result","value","Stream","OriginalStream","createMethodContext","endpoint","target","propertyKey","descriptor","context","originalDecorator","result","value"],"sources":["../../src/legacy-compat/context-compat.mts","../../src/legacy-compat/decorators/module.decorator.mts","../../src/legacy-compat/decorators/controller.decorator.mts","../../src/legacy-compat/decorators/endpoint.decorator.mts","../../src/legacy-compat/decorators/use-guards.decorator.mts","../../src/legacy-compat/decorators/header.decorator.mts","../../src/legacy-compat/decorators/http-code.decorator.mts","../../src/legacy-compat/decorators/multipart.decorator.mts","../../src/legacy-compat/decorators/stream.decorator.mts"],"sourcesContent":["/**\n * Compatibility layer for converting legacy decorator signatures to Stage 3 format.\n *\n * This module provides utilities to create mock Stage 3 decorator contexts\n * from legacy decorator arguments, and manages metadata storage using WeakMap.\n */\n\nimport type { ClassType } from '@navios/di'\n\n// WeakMap to store metadata for legacy decorators\n// Keyed by class constructor for class decorators\n// For method decorators, we use the class constructor (extracted from the prototype)\nconst classMetadataMap = new WeakMap<ClassType, Record<string | symbol, any>>()\n\n/**\n * Gets the constructor from a prototype (for method decorators).\n */\nfunction getConstructor(prototype: any): ClassType | null {\n if (!prototype || typeof prototype !== 'object') {\n return null\n }\n // In legacy decorators, target is the prototype\n // The constructor is typically available via prototype.constructor\n const constructor = prototype.constructor\n if (constructor && typeof constructor === 'function') {\n return constructor as ClassType\n }\n return null\n}\n\n/**\n * Creates a mock ClassDecoratorContext for legacy class decorators.\n */\nexport function createClassContext(target: ClassType): ClassDecoratorContext {\n // Get or create metadata storage for this class\n if (!classMetadataMap.has(target)) {\n classMetadataMap.set(target, {})\n }\n const metadata = classMetadataMap.get(target)!\n\n return {\n kind: 'class',\n name: target.name,\n metadata,\n addInitializer() {\n // Legacy decorators don't support initializers\n },\n } as ClassDecoratorContext\n}\n\n/**\n * Creates a mock ClassMethodDecoratorContext for legacy method decorators.\n *\n * Note: Method decorators need to share metadata with the class context\n * because endpoint metadata is stored at the class level.\n */\nexport function createMethodContext(\n target: any,\n propertyKey: string | symbol,\n descriptor: PropertyDescriptor,\n): ClassMethodDecoratorContext {\n // For method decorators, target is the prototype\n // We need to get the class constructor to access class-level metadata\n const constructor = getConstructor(target)\n if (!constructor) {\n throw new Error(\n '[Navios] Could not determine class constructor from method decorator target.',\n )\n }\n\n // Get or create metadata storage for the class\n // Method decorators share metadata with the class\n if (!classMetadataMap.has(constructor)) {\n classMetadataMap.set(constructor, {})\n }\n const metadata = classMetadataMap.get(constructor)!\n\n return {\n kind: 'method',\n name: propertyKey,\n metadata,\n static: false, // We can't determine this from legacy decorators\n private: false, // We can't determine this from legacy decorators\n access: {\n has: () => true,\n get: () => descriptor.value,\n set: () => {},\n },\n addInitializer() {\n // Legacy decorators don't support initializers\n },\n } as ClassMethodDecoratorContext\n}\n","import type { ClassType } from '@navios/di'\n\nimport { Module as OriginalModule, type ModuleOptions } from '../../decorators/module.decorator.mjs'\nimport { createClassContext } from '../context-compat.mjs'\n\n/**\n * Legacy-compatible Module decorator.\n * \n * Works with TypeScript experimental decorators (legacy API).\n * \n * @param options - Module configuration options\n * @returns A class decorator compatible with legacy decorator API\n * \n * @example\n * ```typescript\n * @Module({\n * controllers: [UserController, AuthController],\n * imports: [DatabaseModule],\n * guards: [AuthGuard],\n * })\n * export class AppModule {}\n * ```\n */\nexport function Module(\n options: ModuleOptions = {\n controllers: [],\n imports: [],\n guards: [],\n },\n) {\n return function (target: ClassType) {\n const context = createClassContext(target)\n const originalDecorator = OriginalModule(options)\n return originalDecorator(target, context)\n }\n}\n\n","import type { ClassType } from '@navios/di'\n\nimport type { ControllerOptions } from '../../decorators/controller.decorator.mjs'\n\nimport { Controller as OriginalController } from '../../decorators/controller.decorator.mjs'\nimport { createClassContext } from '../context-compat.mjs'\n\n/**\n * Legacy-compatible Controller decorator.\n *\n * Works with TypeScript experimental decorators (legacy API).\n *\n * @param options - Controller configuration options\n * @returns A class decorator compatible with legacy decorator API\n *\n * @example\n * ```typescript\n * @Controller({ guards: [AuthGuard] })\n * export class UserController {\n * @Endpoint(getUserEndpoint)\n * async getUser() { }\n * }\n * ```\n */\nexport function Controller(options: ControllerOptions = {}) {\n return function (target: ClassType) {\n const context = createClassContext(target)\n const originalDecorator = OriginalController(options)\n return originalDecorator(target, context)\n }\n}\n","import type {\n BaseEndpointConfig,\n EndpointFunctionArgs,\n HttpMethod,\n} from '@navios/builder'\nimport type { z, ZodType } from 'zod/v4'\n\nimport { Endpoint as OriginalEndpoint } from '../../decorators/endpoint.decorator.mjs'\nimport { createMethodContext } from '../context-compat.mjs'\n\n/**\n * Type helper to constrain a PropertyDescriptor's value to match an endpoint signature.\n * Note: In legacy decorators, type constraints are checked when the decorator is applied,\n * but may not be preserved perfectly when decorators are stacked.\n */\ntype EndpointMethodDescriptor<\n Url extends string,\n QuerySchema,\n RequestSchema,\n ResponseSchema extends ZodType,\n> = TypedPropertyDescriptor<\n (\n params: QuerySchema extends ZodType\n ? RequestSchema extends ZodType\n ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema, true>\n : EndpointFunctionArgs<Url, QuerySchema, undefined, true>\n : RequestSchema extends ZodType\n ? EndpointFunctionArgs<Url, undefined, RequestSchema, true>\n : EndpointFunctionArgs<Url, undefined, undefined, true>,\n ) => Promise<z.input<ResponseSchema>>\n>\n\n/**\n * Legacy-compatible Endpoint decorator.\n *\n * Works with TypeScript experimental decorators (legacy API).\n * Provides type safety by ensuring method signatures match the endpoint configuration.\n *\n * @param endpoint - The endpoint declaration from @navios/builder\n * @returns A method decorator compatible with legacy decorator API\n *\n * @example\n * ```typescript\n * @Controller()\n * export class UserController {\n * @Endpoint(getUserEndpoint)\n * async getUser(request: EndpointParams<typeof getUserEndpoint>): EndpointResult<typeof getUserEndpoint> {\n * return { id: '1', name: 'John' }\n * }\n * }\n * ```\n */\nexport function Endpoint<\n Method extends HttpMethod = HttpMethod,\n Url extends string = string,\n QuerySchema = undefined,\n ResponseSchema extends ZodType = ZodType,\n RequestSchema = ZodType,\n>(endpoint: {\n config: BaseEndpointConfig<\n Method,\n Url,\n QuerySchema,\n ResponseSchema,\n RequestSchema\n >\n}) {\n return function (\n target: any,\n propertyKey: string | symbol,\n descriptor: EndpointMethodDescriptor<\n Url,\n QuerySchema,\n RequestSchema,\n ResponseSchema\n >,\n ): PropertyDescriptor | void {\n if (!descriptor) {\n throw new Error(\n '[Navios] @Endpoint decorator requires a method descriptor. Make sure experimentalDecorators is enabled.',\n )\n }\n // Type check the descriptor value matches expected signature\n const typedDescriptor = descriptor as EndpointMethodDescriptor<\n Url,\n QuerySchema,\n RequestSchema,\n ResponseSchema\n >\n const context = createMethodContext(target, propertyKey, typedDescriptor)\n const originalDecorator = OriginalEndpoint(endpoint)\n // @ts-expect-error - we don't need to type the value\n const result = originalDecorator(typedDescriptor.value, context)\n if (result !== typedDescriptor.value) {\n typedDescriptor.value = result as any\n }\n return typedDescriptor\n }\n}\n","import type {\n ClassType,\n ClassTypeWithInstance,\n InjectionToken,\n} from '@navios/di'\n\nimport type { CanActivate } from '../../interfaces/index.mjs'\n\nimport { UseGuards as OriginalUseGuards } from '../../decorators/use-guards.decorator.mjs'\nimport { createClassContext, createMethodContext } from '../context-compat.mjs'\n\n/**\n * Legacy-compatible UseGuards decorator.\n *\n * Works with TypeScript experimental decorators (legacy API).\n * Can be applied to classes or methods.\n *\n * @param guards - Guard classes or injection tokens to apply\n * @returns A class or method decorator compatible with legacy decorator API\n *\n * @example\n * ```typescript\n * // Apply to a controller\n * @Controller()\n * @UseGuards(AuthGuard, RoleGuard)\n * export class UserController { }\n *\n * // Apply to a specific endpoint\n * @Controller()\n * export class UserController {\n * @Endpoint(getUserEndpoint)\n * @UseGuards(AuthGuard)\n * async getUser() { }\n * }\n * ```\n */\nexport function UseGuards(\n ...guards: (\n | ClassTypeWithInstance<CanActivate>\n | InjectionToken<CanActivate, undefined>\n )[]\n) {\n // Create the decorator function\n // Note: TypeScript's legacy decorator system has strict type checking for decorators\n // We use a flexible implementation that works for both class and method decorators\n function decoratorImpl(\n target: ClassType | Function,\n propertyKey?: string | symbol,\n descriptor?: PropertyDescriptor,\n ): any {\n // Determine if this is a class or method decorator\n if (propertyKey !== undefined && descriptor !== undefined) {\n // Method decorator\n const context = createMethodContext(\n target as Function,\n propertyKey,\n descriptor,\n )\n const originalDecorator = OriginalUseGuards(...guards)\n const result = originalDecorator(descriptor.value, context)\n if (result !== descriptor.value) {\n descriptor.value = result\n }\n return descriptor\n } else {\n // Class decorator\n const context = createClassContext(target as ClassType)\n const originalDecorator = OriginalUseGuards(...guards)\n return originalDecorator(target as ClassType, context)\n }\n }\n\n // Return with 'any' type to work around TypeScript's strict decorator checking\n // TypeScript's legacy decorator system cannot properly type-check decorators\n // that work as both class and method decorators. The runtime behavior is correct.\n // When used as a class decorator, it returns the class (preserving type at runtime)\n // When used as a method decorator, it returns the PropertyDescriptor\n // @ts-ignore - TypeScript limitation with dual-purpose legacy decorators\n return decoratorImpl as any\n}\n","import type { HttpHeader } from '../../interfaces/index.mjs'\n\nimport { Header as OriginalHeader } from '../../decorators/header.decorator.mjs'\nimport { createMethodContext } from '../context-compat.mjs'\n\n/**\n * Legacy-compatible Header decorator.\n * \n * Works with TypeScript experimental decorators (legacy API).\n * \n * @param name - The header name (e.g., 'Content-Type', 'Cache-Control')\n * @param value - The header value (string, number, or array of strings)\n * @returns A method decorator compatible with legacy decorator API\n * \n * @example\n * ```typescript\n * @Controller()\n * export class UserController {\n * @Endpoint(getUserEndpoint)\n * @Header('Cache-Control', 'max-age=3600')\n * async getUser() {\n * return { id: '1', name: 'John' }\n * }\n * }\n * ```\n */\nexport function Header(name: HttpHeader, value: string | number | string[]) {\n return function <T extends object>(\n target: T,\n propertyKey: string | symbol,\n descriptor: PropertyDescriptor,\n ) {\n const context = createMethodContext(target, propertyKey, descriptor)\n const originalDecorator = OriginalHeader(name, value)\n const result = originalDecorator(descriptor.value, context)\n if (result !== descriptor.value) {\n descriptor.value = result\n }\n return descriptor\n }\n}\n\n","import { HttpCode as OriginalHttpCode } from '../../decorators/http-code.decorator.mjs'\nimport { createMethodContext } from '../context-compat.mjs'\n\n/**\n * Legacy-compatible HttpCode decorator.\n *\n * Works with TypeScript experimental decorators (legacy API).\n *\n * @param code - The HTTP status code to return (e.g., 201, 204, 202)\n * @returns A method decorator compatible with legacy decorator API\n *\n * @example\n * ```typescript\n * @Controller()\n * export class UserController {\n * @Endpoint(createUserEndpoint)\n * @HttpCode(201)\n * async createUser() {\n * return { id: '1', name: 'John' }\n * }\n * }\n * ```\n */\nexport function HttpCode(code: number) {\n return function <T extends object>(\n target: T,\n propertyKey: string | symbol,\n descriptor: PropertyDescriptor,\n ) {\n const context = createMethodContext(target, propertyKey, descriptor)\n const originalDecorator = OriginalHttpCode(code)\n const result = originalDecorator(descriptor.value, context)\n if (result !== descriptor.value) {\n descriptor.value = result\n }\n return descriptor\n }\n}\n","import type {\n BaseEndpointConfig,\n EndpointFunctionArgs,\n HttpMethod,\n} from '@navios/builder'\nimport type { z, ZodObject, ZodType } from 'zod/v4'\n\nimport { Multipart as OriginalMultipart } from '../../decorators/multipart.decorator.mjs'\nimport { createMethodContext } from '../context-compat.mjs'\n\n/**\n * Type helper to constrain a PropertyDescriptor's value to match a multipart endpoint signature.\n * Note: In legacy decorators, type constraints are checked when the decorator is applied,\n * but may not be preserved perfectly when decorators are stacked.\n */\ntype MultipartMethodDescriptor<\n Url extends string,\n QuerySchema,\n RequestSchema,\n ResponseSchema extends ZodType,\n> = TypedPropertyDescriptor<\n (\n params: QuerySchema extends ZodObject\n ? RequestSchema extends ZodType\n ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema, true>\n : EndpointFunctionArgs<Url, QuerySchema, undefined, true>\n : RequestSchema extends ZodType\n ? EndpointFunctionArgs<Url, undefined, RequestSchema, true>\n : EndpointFunctionArgs<Url, undefined, undefined, true>,\n ) => Promise<z.input<ResponseSchema>>\n>\n\n/**\n * Legacy-compatible Multipart decorator.\n *\n * Works with TypeScript experimental decorators (legacy API).\n * Provides type safety by ensuring method signatures match the endpoint configuration.\n *\n * @param endpoint - The multipart endpoint declaration from @navios/builder\n * @returns A method decorator compatible with legacy decorator API\n *\n * @example\n * ```typescript\n * @Controller()\n * export class FileController {\n * @Multipart(uploadFileEndpoint)\n * async uploadFile(request: MultipartParams<typeof uploadFileEndpoint>): MultipartResult<typeof uploadFileEndpoint> {\n * const { file } = request.data\n * return { url: 'https://example.com/file.jpg' }\n * }\n * }\n * ```\n */\nexport function Multipart<\n Method extends HttpMethod = HttpMethod,\n Url extends string = string,\n QuerySchema = undefined,\n ResponseSchema extends ZodType = ZodType,\n RequestSchema = ZodType,\n>(endpoint: {\n config: BaseEndpointConfig<\n Method,\n Url,\n QuerySchema,\n ResponseSchema,\n RequestSchema\n >\n}) {\n return function <T extends object>(\n target: T,\n propertyKey: string | symbol,\n descriptor: MultipartMethodDescriptor<\n Url,\n QuerySchema,\n RequestSchema,\n ResponseSchema\n >,\n ): PropertyDescriptor | void {\n if (!descriptor) {\n throw new Error(\n '[Navios] @Multipart decorator requires a method descriptor. Make sure experimentalDecorators is enabled.',\n )\n }\n const context = createMethodContext(target, propertyKey, descriptor)\n const originalDecorator = OriginalMultipart(endpoint)\n // @ts-expect-error - we don't need to type the value\n const result = originalDecorator(descriptor.value, context)\n if (result !== descriptor.value) {\n descriptor.value = result as any\n }\n return descriptor\n }\n}\n","import type {\n BaseStreamConfig,\n EndpointFunctionArgs,\n HttpMethod,\n} from '@navios/builder'\nimport type { ZodObject, ZodType } from 'zod/v4'\n\nimport { Stream as OriginalStream } from '../../decorators/stream.decorator.mjs'\nimport { createMethodContext } from '../context-compat.mjs'\n\n/**\n * Type helper to constrain a PropertyDescriptor's value to match a stream endpoint signature.\n * Note: In legacy decorators, type constraints are checked when the decorator is applied,\n * but may not be preserved perfectly when decorators are stacked.\n */\ntype StreamMethodDescriptor<\n Url extends string,\n QuerySchema,\n RequestSchema,\n> = TypedPropertyDescriptor<\n (\n params: QuerySchema extends ZodObject\n ? RequestSchema extends ZodType\n ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema, true>\n : EndpointFunctionArgs<Url, QuerySchema, undefined, true>\n : RequestSchema extends ZodType\n ? EndpointFunctionArgs<Url, undefined, RequestSchema, true>\n : EndpointFunctionArgs<Url, undefined, undefined, true>,\n reply: any,\n ) => Promise<void>\n>\n\n/**\n * Legacy-compatible Stream decorator.\n *\n * Works with TypeScript experimental decorators (legacy API).\n * Provides type safety by ensuring method signatures match the endpoint configuration.\n *\n * @param endpoint - The stream endpoint declaration from @navios/builder\n * @returns A method decorator compatible with legacy decorator API\n *\n * @example\n * ```typescript\n * @Controller()\n * export class FileController {\n * @Stream(downloadFileEndpoint)\n * async downloadFile(request: StreamParams<typeof downloadFileEndpoint>, reply: any) {\n * const { fileId } = request.urlParams\n * // Stream file data to reply\n * }\n * }\n * ```\n */\nexport function Stream<\n Method extends HttpMethod = HttpMethod,\n Url extends string = string,\n QuerySchema = undefined,\n RequestSchema = ZodType,\n>(endpoint: {\n config: BaseStreamConfig<Method, Url, QuerySchema, RequestSchema>\n}) {\n return function <T extends object>(\n target: T,\n propertyKey: string | symbol,\n descriptor: StreamMethodDescriptor<Url, QuerySchema, RequestSchema>,\n ) {\n const context = createMethodContext(target, propertyKey, descriptor)\n const originalDecorator = OriginalStream(endpoint)\n // @ts-expect-error - we don't need to type the value\n const result = originalDecorator(descriptor.value, context)\n if (result !== descriptor.value) {\n descriptor.value = result as any\n }\n return descriptor\n }\n}\n"],"mappings":";;;;;;;;GAYA,MAAMA,mCAAmB,IAAIC,SAAAA;;;GAK7B,SAASC,eAAeC,WAAc;AACpC,KAAI,CAACA,aAAa,OAAOA,cAAc,SACrC,QAAO;CAIT,MAAMC,cAAcD,UAAU;AAC9B,KAAIC,eAAe,OAAOA,gBAAgB,WACxC,QAAOA;AAET,QAAO;;;;GAMT,SAAgBC,mBAAmBC,QAAiB;AAElD,KAAI,CAACN,iBAAiBO,IAAID,OAAAA,CACxBN,kBAAiBQ,IAAIF,QAAQ,EAAC,CAAA;CAEhC,MAAMG,WAAWT,iBAAiBU,IAAIJ,OAAAA;AAEtC,QAAO;EACLK,MAAM;EACNC,MAAMN,OAAOM;EACbH;EACAI,iBAAAA;EAGF;;;;;;;GASF,SAAgBC,oBACdR,QACAS,aACAC,YAA8B;CAI9B,MAAMZ,cAAcF,eAAeI,OAAAA;AACnC,KAAI,CAACF,YACH,OAAM,IAAIa,MACR,+EAAA;AAMJ,KAAI,CAACjB,iBAAiBO,IAAIH,YAAAA,CACxBJ,kBAAiBQ,IAAIJ,aAAa,EAAC,CAAA;AAIrC,QAAO;EACLO,MAAM;EACNC,MAAMG;EACNN,UALeT,iBAAiBU,IAAIN,YAAAA;EAMpCc,QAAQ;EACRC,SAAS;EACTC,QAAQ;GACNb,WAAW;GACXG,WAAWM,WAAWK;GACtBb,WAAK;GACP;EACAK,iBAAAA;EAGF;;;;;;;;;;;;;;;;;;;;;;GCpEF,SAAgBS,OACdG,UAAyB;CACvBC,aAAa,EAAE;CACfC,SAAS,EAAE;CACXC,QAAQ,EAAE;CACX,EAAA;AAED,QAAO,SAAUC,QAAiB;EAChC,MAAMC,UAAUN,mBAAmBK,OAAAA;AAEnC,SAD0BN,SAA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dG,WAAWH,OAAOI,QAAAA;AACnD,MAAIE,WAAWH,WAAWH,MACxBG,YAAWH,QAAQM;AAErB,SAAOH;;;;;;;;;;;;;;;;;;;;;;;;;GCfX,SAAgBI,SAASG,MAAY;AACnC,QAAO,SACLC,QACAC,aACAC,YAA8B;EAE9B,MAAMC,UAAUL,oBAAoBE,QAAQC,aAAaC,WAAAA;EAEzD,MAAMG,SADoBR,WAAiBE,KAAAA,CACVG,WAAWI,OAAOH,QAAAA;AACnD,MAAIE,WAAWH,WAAWI,MACxBJ,YAAWI,QAAQD;AAErB,SAAOH;;;;;;;;;;;;;;;;;;;;;;;;;;GCkBX,SAAgBK,UAMdG,UAQD;AACC,QAAO,SACLC,QACAC,aACAC,YAKC;AAED,MAAI,CAACA,WACH,OAAM,IAAIC,MACR,2GAAA;EAGJ,MAAMC,UAAUN,oBAAoBE,QAAQC,aAAaC,WAAAA;EAGzD,MAAMI,SAFoBT,YAAkBE,SAAAA,CAEXG,WAAWK,OAAOH,QAAAA;AACnD,MAAIE,WAAWJ,WAAWK,MACxBL,YAAWK,QAAQD;AAErB,SAAOJ;;;;;;;;;;;;;;;;;;;;;;;;;;GCrCX,SAAgBM,OAKdG,UAED;AACC,QAAO,SACLC,QACAC,aACAC,YAAmE;EAEnE,MAAMC,UAAUL,oBAAoBE,QAAQC,aAAaC,WAAAA;EAGzD,MAAMG,SAFoBR,SAAeE,SAAAA,CAERG,WAAWI,OAAOH,QAAAA;AACnD,MAAIE,WAAWH,WAAWI,MACxBJ,YAAWI,QAAQD;AAErB,SAAOH"}
1
+ {"version":3,"file":"index.mjs","names":["classMetadataMap","WeakMap","getConstructor","prototype","constructor","createClassContext","target","has","set","metadata","get","kind","name","addInitializer","createMethodContext","propertyKey","descriptor","Error","static","private","access","value","Module","OriginalModule","createClassContext","options","controllers","imports","guards","target","context","originalDecorator","Controller","OriginalController","createClassContext","options","target","context","originalDecorator","Endpoint","OriginalEndpoint","createMethodContext","endpoint","target","propertyKey","descriptor","Error","typedDescriptor","context","originalDecorator","result","value","UseGuards","OriginalUseGuards","createClassContext","createMethodContext","guards","decoratorImpl","target","propertyKey","descriptor","undefined","context","originalDecorator","result","value","Header","OriginalHeader","createMethodContext","name","value","target","propertyKey","descriptor","context","originalDecorator","result","HttpCode","OriginalHttpCode","createMethodContext","code","target","propertyKey","descriptor","context","originalDecorator","result","value","Multipart","OriginalMultipart","createMethodContext","endpoint","target","propertyKey","descriptor","Error","context","originalDecorator","result","value","Stream","OriginalStream","createMethodContext","endpoint","target","propertyKey","descriptor","context","originalDecorator","result","value","Injectable","OriginalInjectable","createClassContext","options","target","context","originalDecorator","Object","keys","length","getControllerMetadata","getEndpointMetadata","getModuleMetadata","hasControllerMetadata","hasModuleMetadata","getManagedMetadata","hasManagedMetadata","createClassContext","createMethodContext","LegacyAttributeFactory","createAttribute","token","schema","res","value","decorator","target","propertyKey","descriptor","isMethodDecorator","undefined","context","metadata","validatedValue","safeParse","success","Error","toString","error","customAttributes","set","data","isController","isModule","isManaged","get","attribute","getAll","values","Array","from","entries","filter","key","map","length","getLast","i","has","AttributeFactory"],"sources":["../../src/legacy-compat/context-compat.mts","../../src/legacy-compat/decorators/module.decorator.mts","../../src/legacy-compat/decorators/controller.decorator.mts","../../src/legacy-compat/decorators/endpoint.decorator.mts","../../src/legacy-compat/decorators/use-guards.decorator.mts","../../src/legacy-compat/decorators/header.decorator.mts","../../src/legacy-compat/decorators/http-code.decorator.mts","../../src/legacy-compat/decorators/multipart.decorator.mts","../../src/legacy-compat/decorators/stream.decorator.mts","../../src/legacy-compat/decorators/injectable.decorator.mts","../../src/legacy-compat/attribute.factory.mts"],"sourcesContent":["/**\n * Compatibility layer for converting legacy decorator signatures to Stage 3 format.\n *\n * This module provides utilities to create mock Stage 3 decorator contexts\n * from legacy decorator arguments, and manages metadata storage using WeakMap.\n */\n\nimport type { ClassType } from '@navios/di'\n\n// WeakMap to store metadata for legacy decorators\n// Keyed by class constructor for class decorators\n// For method decorators, we use the class constructor (extracted from the prototype)\nconst classMetadataMap = new WeakMap<ClassType, Record<string | symbol, any>>()\n\n/**\n * Gets the constructor from a prototype (for method decorators).\n */\nfunction getConstructor(prototype: any): ClassType | null {\n if (!prototype || typeof prototype !== 'object') {\n return null\n }\n // In legacy decorators, target is the prototype\n // The constructor is typically available via prototype.constructor\n const constructor = prototype.constructor\n if (constructor && typeof constructor === 'function') {\n return constructor as ClassType\n }\n return null\n}\n\n/**\n * Creates a mock ClassDecoratorContext for legacy class decorators.\n * @internal\n */\nexport function createClassContext(target: ClassType): ClassDecoratorContext {\n // Get or create metadata storage for this class\n if (!classMetadataMap.has(target)) {\n classMetadataMap.set(target, {})\n }\n const metadata = classMetadataMap.get(target)!\n\n return {\n kind: 'class',\n name: target.name,\n metadata,\n addInitializer() {\n // Legacy decorators don't support initializers\n },\n } as ClassDecoratorContext\n}\n\n/**\n * Creates a mock ClassMethodDecoratorContext for legacy method decorators.\n *\n * Note: Method decorators need to share metadata with the class context\n * because endpoint metadata is stored at the class level.\n * @internal\n */\nexport function createMethodContext(\n target: any,\n propertyKey: string | symbol,\n descriptor: PropertyDescriptor,\n): ClassMethodDecoratorContext {\n // For method decorators, target is the prototype\n // We need to get the class constructor to access class-level metadata\n const constructor = getConstructor(target)\n if (!constructor) {\n throw new Error(\n '[Navios] Could not determine class constructor from method decorator target.',\n )\n }\n\n // Get or create metadata storage for the class\n // Method decorators share metadata with the class\n if (!classMetadataMap.has(constructor)) {\n classMetadataMap.set(constructor, {})\n }\n const metadata = classMetadataMap.get(constructor)!\n\n return {\n kind: 'method',\n name: propertyKey,\n metadata,\n static: false, // We can't determine this from legacy decorators\n private: false, // We can't determine this from legacy decorators\n access: {\n has: () => true,\n get: () => descriptor.value,\n set: () => {},\n },\n addInitializer() {\n // Legacy decorators don't support initializers\n },\n } as ClassMethodDecoratorContext\n}\n","import type { ClassType } from '@navios/di'\n\nimport { Module as OriginalModule, type ModuleOptions } from '../../decorators/module.decorator.mjs'\nimport { createClassContext } from '../context-compat.mjs'\n\n/**\n * Legacy-compatible Module decorator.\n * \n * Works with TypeScript experimental decorators (legacy API).\n * \n * @param options - Module configuration options\n * @returns A class decorator compatible with legacy decorator API\n * \n * @example\n * ```typescript\n * @Module({\n * controllers: [UserController, AuthController],\n * imports: [DatabaseModule],\n * guards: [AuthGuard],\n * })\n * export class AppModule {}\n * ```\n */\nexport function Module(\n options: ModuleOptions = {\n controllers: [],\n imports: [],\n guards: [],\n },\n) {\n return function (target: ClassType) {\n const context = createClassContext(target)\n const originalDecorator = OriginalModule(options)\n return originalDecorator(target, context)\n }\n}\n\n","import type { ClassType } from '@navios/di'\n\nimport type { ControllerOptions } from '../../decorators/controller.decorator.mjs'\n\nimport { Controller as OriginalController } from '../../decorators/controller.decorator.mjs'\nimport { createClassContext } from '../context-compat.mjs'\n\n/**\n * Legacy-compatible Controller decorator.\n *\n * Works with TypeScript experimental decorators (legacy API).\n *\n * @param options - Controller configuration options\n * @returns A class decorator compatible with legacy decorator API\n *\n * @example\n * ```typescript\n * @Controller({ guards: [AuthGuard] })\n * export class UserController {\n * @Endpoint(getUserEndpoint)\n * async getUser() { }\n * }\n * ```\n */\nexport function Controller(options: ControllerOptions = {}) {\n return function (target: ClassType) {\n const context = createClassContext(target)\n const originalDecorator = OriginalController(options)\n return originalDecorator(target, context)\n }\n}\n","import type {\n BaseEndpointConfig,\n EndpointFunctionArgs,\n HttpMethod,\n} from '@navios/builder'\nimport type { z, ZodType } from 'zod/v4'\n\nimport { Endpoint as OriginalEndpoint } from '../../decorators/endpoint.decorator.mjs'\nimport { createMethodContext } from '../context-compat.mjs'\n\n/**\n * Type helper to constrain a PropertyDescriptor's value to match an endpoint signature.\n * Note: In legacy decorators, type constraints are checked when the decorator is applied,\n * but may not be preserved perfectly when decorators are stacked.\n */\ntype EndpointMethodDescriptor<\n Url extends string,\n QuerySchema,\n RequestSchema,\n ResponseSchema extends ZodType,\n> = TypedPropertyDescriptor<\n (\n params: QuerySchema extends ZodType\n ? RequestSchema extends ZodType\n ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema, true>\n : EndpointFunctionArgs<Url, QuerySchema, undefined, true>\n : RequestSchema extends ZodType\n ? EndpointFunctionArgs<Url, undefined, RequestSchema, true>\n : EndpointFunctionArgs<Url, undefined, undefined, true>,\n ) => Promise<z.input<ResponseSchema>>\n>\n\n/**\n * Legacy-compatible Endpoint decorator.\n *\n * Works with TypeScript experimental decorators (legacy API).\n * Provides type safety by ensuring method signatures match the endpoint configuration.\n *\n * @param endpoint - The endpoint declaration from @navios/builder\n * @returns A method decorator compatible with legacy decorator API\n *\n * @example\n * ```typescript\n * @Controller()\n * export class UserController {\n * @Endpoint(getUserEndpoint)\n * async getUser(request: EndpointParams<typeof getUserEndpoint>): EndpointResult<typeof getUserEndpoint> {\n * return { id: '1', name: 'John' }\n * }\n * }\n * ```\n */\nexport function Endpoint<\n Method extends HttpMethod = HttpMethod,\n Url extends string = string,\n QuerySchema = undefined,\n ResponseSchema extends ZodType = ZodType,\n RequestSchema = ZodType,\n>(endpoint: {\n config: BaseEndpointConfig<\n Method,\n Url,\n QuerySchema,\n ResponseSchema,\n RequestSchema\n >\n}) {\n return function (\n target: any,\n propertyKey: string | symbol,\n descriptor: EndpointMethodDescriptor<\n Url,\n QuerySchema,\n RequestSchema,\n ResponseSchema\n >,\n ): PropertyDescriptor | void {\n if (!descriptor) {\n throw new Error(\n '[Navios] @Endpoint decorator requires a method descriptor. Make sure experimentalDecorators is enabled.',\n )\n }\n // Type check the descriptor value matches expected signature\n const typedDescriptor = descriptor as EndpointMethodDescriptor<\n Url,\n QuerySchema,\n RequestSchema,\n ResponseSchema\n >\n const context = createMethodContext(target, propertyKey, typedDescriptor)\n const originalDecorator = OriginalEndpoint(endpoint)\n // @ts-expect-error - we don't need to type the value\n const result = originalDecorator(typedDescriptor.value, context)\n if (result !== typedDescriptor.value) {\n typedDescriptor.value = result as any\n }\n return typedDescriptor\n }\n}\n","import type {\n ClassType,\n ClassTypeWithInstance,\n InjectionToken,\n} from '@navios/di'\n\nimport type { CanActivate } from '../../interfaces/index.mjs'\n\nimport { UseGuards as OriginalUseGuards } from '../../decorators/use-guards.decorator.mjs'\nimport { createClassContext, createMethodContext } from '../context-compat.mjs'\n\n/**\n * Legacy-compatible UseGuards decorator.\n *\n * Works with TypeScript experimental decorators (legacy API).\n * Can be applied to classes or methods.\n *\n * @param guards - Guard classes or injection tokens to apply\n * @returns A class or method decorator compatible with legacy decorator API\n *\n * @example\n * ```typescript\n * // Apply to a controller\n * @Controller()\n * @UseGuards(AuthGuard, RoleGuard)\n * export class UserController { }\n *\n * // Apply to a specific endpoint\n * @Controller()\n * export class UserController {\n * @Endpoint(getUserEndpoint)\n * @UseGuards(AuthGuard)\n * async getUser() { }\n * }\n * ```\n */\nexport function UseGuards(\n ...guards: (\n | ClassTypeWithInstance<CanActivate>\n | InjectionToken<CanActivate, undefined>\n )[]\n) {\n // Create the decorator function\n // Note: TypeScript's legacy decorator system has strict type checking for decorators\n // We use a flexible implementation that works for both class and method decorators\n function decoratorImpl(\n target: ClassType | Function,\n propertyKey?: string | symbol,\n descriptor?: PropertyDescriptor,\n ): any {\n // Determine if this is a class or method decorator\n if (propertyKey !== undefined && descriptor !== undefined) {\n // Method decorator\n const context = createMethodContext(\n target as Function,\n propertyKey,\n descriptor,\n )\n const originalDecorator = OriginalUseGuards(...guards)\n const result = originalDecorator(descriptor.value, context)\n if (result !== descriptor.value) {\n descriptor.value = result\n }\n return descriptor\n } else {\n // Class decorator\n const context = createClassContext(target as ClassType)\n const originalDecorator = OriginalUseGuards(...guards)\n return originalDecorator(target as ClassType, context)\n }\n }\n\n // Return with 'any' type to work around TypeScript's strict decorator checking\n // TypeScript's legacy decorator system cannot properly type-check decorators\n // that work as both class and method decorators. The runtime behavior is correct.\n // When used as a class decorator, it returns the class (preserving type at runtime)\n // When used as a method decorator, it returns the PropertyDescriptor\n // @ts-ignore - TypeScript limitation with dual-purpose legacy decorators\n return decoratorImpl as any\n}\n","import type { HttpHeader } from '../../interfaces/index.mjs'\n\nimport { Header as OriginalHeader } from '../../decorators/header.decorator.mjs'\nimport { createMethodContext } from '../context-compat.mjs'\n\n/**\n * Legacy-compatible Header decorator.\n * \n * Works with TypeScript experimental decorators (legacy API).\n * \n * @param name - The header name (e.g., 'Content-Type', 'Cache-Control')\n * @param value - The header value (string, number, or array of strings)\n * @returns A method decorator compatible with legacy decorator API\n * \n * @example\n * ```typescript\n * @Controller()\n * export class UserController {\n * @Endpoint(getUserEndpoint)\n * @Header('Cache-Control', 'max-age=3600')\n * async getUser() {\n * return { id: '1', name: 'John' }\n * }\n * }\n * ```\n */\nexport function Header(name: HttpHeader, value: string | number | string[]) {\n return function <T extends object>(\n target: T,\n propertyKey: string | symbol,\n descriptor: PropertyDescriptor,\n ) {\n const context = createMethodContext(target, propertyKey, descriptor)\n const originalDecorator = OriginalHeader(name, value)\n const result = originalDecorator(descriptor.value, context)\n if (result !== descriptor.value) {\n descriptor.value = result\n }\n return descriptor\n }\n}\n\n","import { HttpCode as OriginalHttpCode } from '../../decorators/http-code.decorator.mjs'\nimport { createMethodContext } from '../context-compat.mjs'\n\n/**\n * Legacy-compatible HttpCode decorator.\n *\n * Works with TypeScript experimental decorators (legacy API).\n *\n * @param code - The HTTP status code to return (e.g., 201, 204, 202)\n * @returns A method decorator compatible with legacy decorator API\n *\n * @example\n * ```typescript\n * @Controller()\n * export class UserController {\n * @Endpoint(createUserEndpoint)\n * @HttpCode(201)\n * async createUser() {\n * return { id: '1', name: 'John' }\n * }\n * }\n * ```\n */\nexport function HttpCode(code: number) {\n return function <T extends object>(\n target: T,\n propertyKey: string | symbol,\n descriptor: PropertyDescriptor,\n ) {\n const context = createMethodContext(target, propertyKey, descriptor)\n const originalDecorator = OriginalHttpCode(code)\n const result = originalDecorator(descriptor.value, context)\n if (result !== descriptor.value) {\n descriptor.value = result\n }\n return descriptor\n }\n}\n","import type {\n BaseEndpointConfig,\n EndpointFunctionArgs,\n HttpMethod,\n} from '@navios/builder'\nimport type { z, ZodObject, ZodType } from 'zod/v4'\n\nimport { Multipart as OriginalMultipart } from '../../decorators/multipart.decorator.mjs'\nimport { createMethodContext } from '../context-compat.mjs'\n\n/**\n * Type helper to constrain a PropertyDescriptor's value to match a multipart endpoint signature.\n * Note: In legacy decorators, type constraints are checked when the decorator is applied,\n * but may not be preserved perfectly when decorators are stacked.\n */\ntype MultipartMethodDescriptor<\n Url extends string,\n QuerySchema,\n RequestSchema,\n ResponseSchema extends ZodType,\n> = TypedPropertyDescriptor<\n (\n params: QuerySchema extends ZodObject\n ? RequestSchema extends ZodType\n ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema, true>\n : EndpointFunctionArgs<Url, QuerySchema, undefined, true>\n : RequestSchema extends ZodType\n ? EndpointFunctionArgs<Url, undefined, RequestSchema, true>\n : EndpointFunctionArgs<Url, undefined, undefined, true>,\n ) => Promise<z.input<ResponseSchema>>\n>\n\n/**\n * Legacy-compatible Multipart decorator.\n *\n * Works with TypeScript experimental decorators (legacy API).\n * Provides type safety by ensuring method signatures match the endpoint configuration.\n *\n * @param endpoint - The multipart endpoint declaration from @navios/builder\n * @returns A method decorator compatible with legacy decorator API\n *\n * @example\n * ```typescript\n * @Controller()\n * export class FileController {\n * @Multipart(uploadFileEndpoint)\n * async uploadFile(request: MultipartParams<typeof uploadFileEndpoint>): MultipartResult<typeof uploadFileEndpoint> {\n * const { file } = request.data\n * return { url: 'https://example.com/file.jpg' }\n * }\n * }\n * ```\n */\nexport function Multipart<\n Method extends HttpMethod = HttpMethod,\n Url extends string = string,\n QuerySchema = undefined,\n ResponseSchema extends ZodType = ZodType,\n RequestSchema = ZodType,\n>(endpoint: {\n config: BaseEndpointConfig<\n Method,\n Url,\n QuerySchema,\n ResponseSchema,\n RequestSchema\n >\n}) {\n return function <T extends object>(\n target: T,\n propertyKey: string | symbol,\n descriptor: MultipartMethodDescriptor<\n Url,\n QuerySchema,\n RequestSchema,\n ResponseSchema\n >,\n ): PropertyDescriptor | void {\n if (!descriptor) {\n throw new Error(\n '[Navios] @Multipart decorator requires a method descriptor. Make sure experimentalDecorators is enabled.',\n )\n }\n const context = createMethodContext(target, propertyKey, descriptor)\n const originalDecorator = OriginalMultipart(endpoint)\n // @ts-expect-error - we don't need to type the value\n const result = originalDecorator(descriptor.value, context)\n if (result !== descriptor.value) {\n descriptor.value = result as any\n }\n return descriptor\n }\n}\n","import type {\n BaseStreamConfig,\n EndpointFunctionArgs,\n HttpMethod,\n} from '@navios/builder'\nimport type { ZodObject, ZodType } from 'zod/v4'\n\nimport { Stream as OriginalStream } from '../../decorators/stream.decorator.mjs'\nimport { createMethodContext } from '../context-compat.mjs'\n\ntype StreamParams<\n Url extends string,\n QuerySchema,\n RequestSchema,\n> = QuerySchema extends ZodObject\n ? RequestSchema extends ZodType\n ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema, true>\n : EndpointFunctionArgs<Url, QuerySchema, undefined, true>\n : RequestSchema extends ZodType\n ? EndpointFunctionArgs<Url, undefined, RequestSchema, true>\n : EndpointFunctionArgs<Url, undefined, undefined, true>\n\n/**\n * Type helper to constrain a PropertyDescriptor's value to match a stream endpoint signature.\n * Supports both with and without reply parameter (Bun doesn't use reply parameter).\n */\ntype StreamMethodDescriptor<\n Url extends string,\n QuerySchema,\n RequestSchema,\n> =\n | TypedPropertyDescriptor<\n (params: StreamParams<Url, QuerySchema, RequestSchema>, reply: any) => any\n >\n | TypedPropertyDescriptor<\n (params: StreamParams<Url, QuerySchema, RequestSchema>) => any\n >\n | TypedPropertyDescriptor<() => any>\n\n/**\n * Legacy-compatible Stream decorator.\n *\n * Works with TypeScript experimental decorators (legacy API).\n * Provides type safety by ensuring method signatures match the endpoint configuration.\n *\n * @param endpoint - The stream endpoint declaration from @navios/builder\n * @returns A method decorator compatible with legacy decorator API\n *\n * @example\n * ```typescript\n * @Controller()\n * export class FileController {\n * @Stream(downloadFileEndpoint)\n * async downloadFile(request: StreamParams<typeof downloadFileEndpoint>, reply: any) {\n * const { fileId } = request.urlParams\n * // Stream file data to reply\n * }\n * }\n * ```\n */\nexport function Stream<\n Method extends HttpMethod = HttpMethod,\n Url extends string = string,\n QuerySchema = undefined,\n RequestSchema = ZodType,\n>(endpoint: {\n config: BaseStreamConfig<Method, Url, QuerySchema, RequestSchema>\n}) {\n return function <T extends object>(\n target: T,\n propertyKey: string | symbol,\n descriptor: StreamMethodDescriptor<Url, QuerySchema, RequestSchema>,\n ) {\n const context = createMethodContext(target, propertyKey, descriptor)\n const originalDecorator = OriginalStream(endpoint)\n // @ts-expect-error - we don't need to type the value\n const result = originalDecorator(descriptor.value, context)\n if (result !== descriptor.value) {\n descriptor.value = result as any\n }\n return descriptor\n }\n}\n","import type { ClassType } from '@navios/di'\n\nimport {\n Injectable as OriginalInjectable,\n type InjectableOptions,\n} from '@navios/di'\n\nimport { createClassContext } from '../context-compat.mjs'\n\nexport type { InjectableOptions }\n\n/**\n * Legacy-compatible Injectable decorator.\n *\n * Works with TypeScript experimental decorators (legacy API).\n *\n * @param options - Injectable configuration options\n * @returns A class decorator compatible with legacy decorator API\n *\n * @example\n * ```typescript\n * @Injectable()\n * export class UserService {\n * getUser(id: string) {\n * return { id, name: 'John' }\n * }\n * }\n * ```\n */\nexport function Injectable(options: InjectableOptions = {}) {\n return function (target: ClassType) {\n const context = createClassContext(target)\n // Use the no-args overload when options is empty, otherwise pass options\n const originalDecorator =\n Object.keys(options).length === 0\n ? OriginalInjectable()\n : // @ts-expect-error - InjectableOptions is a union type, we let runtime handle it\n OriginalInjectable(options)\n return originalDecorator(target, context)\n }\n}\n","import type { ClassType } from '@navios/di'\nimport type { z, ZodType } from 'zod/v4'\n\nimport type {\n ControllerMetadata,\n HandlerMetadata,\n ModuleMetadata,\n} from '../metadata/index.mjs'\n\nimport {\n getControllerMetadata,\n getEndpointMetadata,\n getModuleMetadata,\n hasControllerMetadata,\n hasModuleMetadata,\n} from '../metadata/index.mjs'\nimport {\n getManagedMetadata,\n hasManagedMetadata,\n} from '../metadata/navios-managed.metadata.mjs'\nimport { createClassContext, createMethodContext } from './context-compat.mjs'\n\n/**\n * Type for a legacy class attribute decorator without a value.\n *\n * Attributes are custom metadata decorators that can be applied to modules,\n * controllers, and endpoints.\n */\nexport type LegacyClassAttribute = (() => <T extends ClassType>(\n target: T,\n) => T) &\n (() => <T extends object>(\n target: T,\n propertyKey: string | symbol,\n descriptor: PropertyDescriptor,\n ) => PropertyDescriptor) & {\n token: symbol\n }\n\n/**\n * Type for a legacy class attribute decorator with a validated value.\n *\n * @typeParam S - The Zod schema type for validation\n */\nexport type LegacyClassSchemaAttribute<S extends ZodType> = ((\n value: z.input<S>,\n) => <T extends ClassType>(target: T) => T) &\n ((\n value: z.input<S>,\n ) => <T extends object>(\n target: T,\n propertyKey: string | symbol,\n descriptor: PropertyDescriptor,\n ) => PropertyDescriptor) & {\n token: symbol\n schema: ZodType\n }\n\n/**\n * Legacy-compatible factory for creating custom attribute decorators.\n *\n * Works with TypeScript experimental decorators (legacy API).\n *\n * Attributes allow you to add custom metadata to modules, controllers, and endpoints.\n * This is useful for cross-cutting concerns like rate limiting, caching, API versioning, etc.\n *\n * @example\n * ```typescript\n * // Create a simple boolean attribute\n * const Public = LegacyAttributeFactory.createAttribute(Symbol.for('Public'))\n *\n * // Use it as a decorator\n * @Controller()\n * @Public()\n * export class PublicController { }\n *\n * // Check if attribute exists\n * if (LegacyAttributeFactory.has(Public, controllerMetadata)) {\n * // Skip authentication\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Create an attribute with a validated value\n * const RateLimit = LegacyAttributeFactory.createAttribute(\n * Symbol.for('RateLimit'),\n * z.object({ requests: z.number(), window: z.number() })\n * )\n *\n * // Use it with a value\n * @Endpoint(apiEndpoint)\n * @RateLimit({ requests: 100, window: 60000 })\n * async handler() { }\n *\n * // Get the value\n * const limit = LegacyAttributeFactory.get(RateLimit, endpointMetadata)\n * // limit is typed as { requests: number, window: number } | null\n * ```\n */\nexport class LegacyAttributeFactory {\n /**\n * Creates a simple attribute decorator without a value.\n *\n * @param token - A unique symbol to identify this attribute\n * @returns A decorator function that can be applied to classes or methods\n *\n * @example\n * ```typescript\n * const Public = LegacyAttributeFactory.createAttribute(Symbol.for('Public'))\n *\n * @Public()\n * @Controller()\n * export class PublicController { }\n * ```\n */\n static createAttribute(token: symbol): LegacyClassAttribute\n /**\n * Creates an attribute decorator with a validated value.\n *\n * @param token - A unique symbol to identify this attribute\n * @param schema - A Zod schema to validate the attribute value\n * @returns A decorator function that accepts a value and can be applied to classes or methods\n *\n * @example\n * ```typescript\n * const RateLimit = LegacyAttributeFactory.createAttribute(\n * Symbol.for('RateLimit'),\n * z.object({ requests: z.number(), window: z.number() })\n * )\n *\n * @RateLimit({ requests: 100, window: 60000 })\n * @Endpoint(apiEndpoint)\n * async handler() { }\n * ```\n */\n static createAttribute<T extends ZodType>(\n token: symbol,\n schema: T,\n ): LegacyClassSchemaAttribute<T>\n\n static createAttribute(token: symbol, schema?: ZodType) {\n const res = (value?: unknown) => {\n // Return a decorator that can handle both class and method targets\n function decorator(target: any): any\n function decorator(\n target: any,\n propertyKey: string | symbol,\n descriptor: PropertyDescriptor,\n ): PropertyDescriptor\n function decorator(\n target: any,\n propertyKey?: string | symbol,\n descriptor?: PropertyDescriptor,\n ): any {\n const isMethodDecorator =\n propertyKey !== undefined && descriptor !== undefined\n\n if (isMethodDecorator) {\n // Method decorator - apply to endpoint\n const context = createMethodContext(target, propertyKey, descriptor)\n const metadata = getEndpointMetadata(descriptor.value, context)\n\n if (schema) {\n const validatedValue = schema.safeParse(value)\n if (!validatedValue.success) {\n throw new Error(\n `[Navios] Invalid value for attribute ${token.toString()}: ${validatedValue.error}`,\n )\n }\n metadata.customAttributes.set(token, validatedValue.data)\n } else {\n metadata.customAttributes.set(token, true)\n }\n return descriptor\n } else {\n // Class decorator\n const isController = hasControllerMetadata(target as ClassType)\n const isModule = hasModuleMetadata(target as ClassType)\n const isManaged = hasManagedMetadata(target as ClassType)\n\n if (!isController && !isModule && !isManaged) {\n throw new Error(\n '[Navios] Attribute can only be applied to classes with @Controller, @Module, or other Navios-managed decorators',\n )\n }\n\n const context = createClassContext(target)\n const metadata = isController\n ? getControllerMetadata(target, context)\n : isModule\n ? getModuleMetadata(target, context)\n : isManaged\n ? getManagedMetadata(target)!\n : null\n\n if (!metadata) {\n throw new Error(\n '[Navios] Could not determine metadata for attribute target',\n )\n }\n\n if (schema) {\n const validatedValue = schema.safeParse(value)\n if (!validatedValue.success) {\n throw new Error(\n `[Navios] Invalid value for attribute ${token.toString()}: ${validatedValue.error}`,\n )\n }\n metadata.customAttributes.set(token, validatedValue.data)\n } else {\n metadata.customAttributes.set(token, true)\n }\n return target\n }\n }\n return decorator\n }\n res.token = token\n if (schema) {\n res.schema = schema\n }\n return res\n }\n\n /**\n * Gets the value of an attribute from metadata.\n *\n * Returns `null` if the attribute is not present.\n * For simple attributes (without values), returns `true` if present.\n *\n * @param attribute - The attribute decorator\n * @param target - The metadata object (module, controller, or handler)\n * @returns The attribute value, `true` for simple attributes, or `null` if not found\n *\n * @example\n * ```typescript\n * const isPublic = LegacyAttributeFactory.get(Public, controllerMetadata)\n * // isPublic is true | null\n *\n * const rateLimit = LegacyAttributeFactory.get(RateLimit, endpointMetadata)\n * // rateLimit is { requests: number, window: number } | null\n * ```\n */\n static get(\n attribute: LegacyClassAttribute,\n target: ModuleMetadata | ControllerMetadata | HandlerMetadata<any>,\n ): true | null\n static get<T extends ZodType>(\n attribute: LegacyClassSchemaAttribute<T>,\n target: ModuleMetadata | ControllerMetadata | HandlerMetadata<any>,\n ): z.output<T> | null\n static get(\n attribute: LegacyClassAttribute | LegacyClassSchemaAttribute<any>,\n target: ModuleMetadata | ControllerMetadata | HandlerMetadata<any>,\n ) {\n return target.customAttributes.get(attribute.token) ?? null\n }\n\n /**\n * Gets all values of an attribute from metadata (useful when an attribute can appear multiple times).\n *\n * Returns `null` if the attribute is not present.\n *\n * @param attribute - The attribute decorator\n * @param target - The metadata object (module, controller, or handler)\n * @returns An array of attribute values, or `null` if not found\n *\n * @example\n * ```typescript\n * const tags = LegacyAttributeFactory.getAll(Tag, endpointMetadata)\n * // tags is string[] | null\n * ```\n */\n static getAll(\n attribute: LegacyClassAttribute,\n target: ModuleMetadata | ControllerMetadata | HandlerMetadata<any>,\n ): Array<true> | null\n static getAll<T extends ZodType>(\n attribute: LegacyClassSchemaAttribute<T>,\n target: ModuleMetadata | ControllerMetadata | HandlerMetadata<any>,\n ): Array<z.output<T>> | null\n static getAll(\n attribute: LegacyClassAttribute | LegacyClassSchemaAttribute<any>,\n target: ModuleMetadata | ControllerMetadata | HandlerMetadata<any>,\n ) {\n const values = Array.from(target.customAttributes.entries())\n .filter(([key]) => key === attribute.token)\n .map(([, value]) => value)\n return values.length > 0 ? values : null\n }\n\n /**\n * Gets the last value of an attribute from an array of metadata objects.\n *\n * Searches from the end of the array backwards, useful for finding the most\n * specific attribute value (e.g., endpoint-level overrides module-level).\n *\n * @param attribute - The attribute decorator\n * @param target - An array of metadata objects (typically [module, controller, handler])\n * @returns The last attribute value found, or `null` if not found\n *\n * @example\n * ```typescript\n * // Check attribute hierarchy: endpoint -> controller -> module\n * const rateLimit = LegacyAttributeFactory.getLast(RateLimit, [\n * moduleMetadata,\n * controllerMetadata,\n * endpointMetadata\n * ])\n * ```\n */\n static getLast(\n attribute: LegacyClassAttribute,\n target: (ModuleMetadata | ControllerMetadata | HandlerMetadata<any>)[],\n ): true | null\n static getLast<T extends ZodType>(\n attribute: LegacyClassSchemaAttribute<T>,\n target: (ModuleMetadata | ControllerMetadata | HandlerMetadata<any>)[],\n ): z.output<T> | null\n static getLast(\n attribute: LegacyClassAttribute | LegacyClassSchemaAttribute<any>,\n target: (ModuleMetadata | ControllerMetadata | HandlerMetadata<any>)[],\n ) {\n for (let i = target.length - 1; i >= 0; i--) {\n const value = target[i].customAttributes.get(attribute.token)\n if (value) {\n return value\n }\n }\n return null\n }\n\n /**\n * Checks if an attribute is present on the metadata object.\n *\n * @param attribute - The attribute decorator\n * @param target - The metadata object (module, controller, or handler)\n * @returns `true` if the attribute is present, `false` otherwise\n *\n * @example\n * ```typescript\n * if (LegacyAttributeFactory.has(Public, controllerMetadata)) {\n * // Skip authentication\n * }\n * ```\n */\n static has(\n attribute: LegacyClassAttribute,\n target: ModuleMetadata | ControllerMetadata | HandlerMetadata<any>,\n ): boolean\n static has<T extends ZodType>(\n attribute: LegacyClassSchemaAttribute<T>,\n target: ModuleMetadata | ControllerMetadata | HandlerMetadata<any>,\n ): boolean\n static has(\n attribute: LegacyClassAttribute | LegacyClassSchemaAttribute<any>,\n target: ModuleMetadata | ControllerMetadata | HandlerMetadata<any>,\n ) {\n return target.customAttributes.has(attribute.token)\n }\n}\n\n// Re-export as AttributeFactory for convenience\nexport { LegacyAttributeFactory as AttributeFactory }\n"],"mappings":";;;;;;;;;GAYA,MAAMA,mCAAmB,IAAIC,SAAAA;;;GAK7B,SAASC,eAAeC,WAAc;AACpC,KAAI,CAACA,aAAa,OAAOA,cAAc,SACrC,QAAO;CAIT,MAAMC,cAAcD,UAAU;AAC9B,KAAIC,eAAe,OAAOA,gBAAgB,WACxC,QAAOA;AAET,QAAO;;;;;GAOT,SAAgBC,mBAAmBC,QAAiB;AAElD,KAAI,CAACN,iBAAiBO,IAAID,OAAAA,CACxBN,kBAAiBQ,IAAIF,QAAQ,EAAC,CAAA;CAEhC,MAAMG,WAAWT,iBAAiBU,IAAIJ,OAAAA;AAEtC,QAAO;EACLK,MAAM;EACNC,MAAMN,OAAOM;EACbH;EACAI,iBAAAA;EAGF;;;;;;;;GAUF,SAAgBC,oBACdR,QACAS,aACAC,YAA8B;CAI9B,MAAMZ,cAAcF,eAAeI,OAAAA;AACnC,KAAI,CAACF,YACH,OAAM,IAAIa,MACR,+EAAA;AAMJ,KAAI,CAACjB,iBAAiBO,IAAIH,YAAAA,CACxBJ,kBAAiBQ,IAAIJ,aAAa,EAAC,CAAA;AAIrC,QAAO;EACLO,MAAM;EACNC,MAAMG;EACNN,UALeT,iBAAi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AkBc,QAAQK,QAAAA,GAC1Ba,YACE7B,mBAAmBW,OAAAA,GACnB;AAER,SAAI,CAACM,SACH,OAAM,IAAII,MACR,6DAAA;AAIJ,SAAId,QAAQ;MACV,MAAMW,iBAAiBX,OAAOY,UAAUV,MAAAA;AACxC,UAAI,CAACS,eAAeE,QAClB,OAAM,IAAIC,MACR,wCAAwCf,MAAMgB,UAAQ,CAAG,IAAIJ,eAAeK,QAAO;AAGvFN,eAASO,iBAAiBC,IAAInB,OAAOY,eAAeQ,KAAI;WAExDT,UAASO,iBAAiBC,IAAInB,OAAO,KAAA;AAEvC,YAAOK;;;AAGX,UAAOD;;AAETF,MAAIF,QAAQA;AACZ,MAAIC,OACFC,KAAID,SAASA;AAEf,SAAOC;;CA8BT,OAAOsB,IACLC,WACApB,QACA;AACA,SAAOA,OAAOa,iBAAiBM,IAAIC,UAAUzB,MAAK,IAAK;;CA0BzD,OAAO0B,OACLD,WACApB,QACA;EACA,MAAMsB,SAASC,MAAMC,KAAKxB,OAAOa,iBAAiBY,SAAO,CAAA,CACtDC,QAAQ,CAACC,SAASA,QAAQP,UAAUzB,MAAK,CACzCiC,KAAK,GAAG9B,WAAWA,MAAAA;AACtB,SAAOwB,OAAOO,SAAS,IAAIP,SAAS;;CA+BtC,OAAOQ,QACLV,WACApB,QACA;AACA,OAAK,IAAI+B,IAAI/B,OAAO6B,SAAS,GAAGE,KAAK,GAAGA,KAAK;GAC3C,MAAMjC,QAAQE,OAAO+B,GAAGlB,iBAAiBM,IAAIC,UAAUzB,MAAK;AAC5D,OAAIG,MACF,QAAOA;;AAGX,SAAO;;CAyBT,OAAOkC,IACLZ,WACApB,QACA;AACA,SAAOA,OAAOa,iBAAiBmB,IAAIZ,UAAUzB,MAAK"}
@@ -1,4 +1,4 @@
1
- import { E as hasControllerMetadata, S as hasModuleMetadata, T as getControllerMetadata, _ as EndpointAdapterToken, b as extractModuleMetadata, c as XmlStreamAdapterToken, d as Reply, f as NaviosOptionsToken, k as getEndpointMetadata, l as StreamAdapterToken, m as HttpAdapterToken, p as MultipartAdapterToken, u as Request, x as getModuleMetadata } from "./use-guards.decorator-CzVXuLkz.mjs";
1
+ import { C as extractModuleMetadata, M as getEndpointMetadata, O as getControllerMetadata, T as hasModuleMetadata, _ as EndpointAdapterToken, b as getManagedMetadata, c as XmlStreamAdapterToken, d as Reply, f as NaviosOptionsToken, k as hasControllerMetadata, l as StreamAdapterToken, m as HttpAdapterToken, p as MultipartAdapterToken, u as Request, w as getModuleMetadata, x as hasManagedMetadata } from "./use-guards.decorator-ChJVzYLW.mjs";
2
2
  import { Container, Factory, Injectable, InjectableScope, InjectionToken, getInjectableToken, inject } from "@navios/di";
3
3
  import { env } from "node:process";
4
4
  import z, { z as z$1 } from "zod/v4";
@@ -2829,8 +2829,10 @@ var ModuleLoaderService = class {
2829
2829
  if (context.kind !== "class" && context.kind !== "method") throw new Error("[Navios] Attribute can only be applied to classes or methods");
2830
2830
  const isController = context.kind === "class" && hasControllerMetadata(target);
2831
2831
  const isModule = context.kind === "class" && hasModuleMetadata(target);
2832
- if (context.kind === "class" && !isController && !isModule) throw new Error("[Navios] Attribute can only be applied to classes with @Controller or @Module decorators");
2833
- let metadata = context.kind === "class" ? isController ? getControllerMetadata(target, context) : getModuleMetadata(target, context) : getEndpointMetadata(target, context);
2832
+ const isManaged = context.kind === "class" && hasManagedMetadata(target);
2833
+ if (context.kind === "class" && !isController && !isModule && !isManaged) throw new Error("[Navios] Attribute can only be applied to classes with @Controller, @Module, or other Navios-managed decorators");
2834
+ let metadata = context.kind === "class" ? isController ? getControllerMetadata(target, context) : isModule ? getModuleMetadata(target, context) : isManaged ? getManagedMetadata(target) : null : getEndpointMetadata(target, context);
2835
+ if (!metadata) throw new Error("[Navios] Could not determine metadata for attribute target");
2834
2836
  if (schema) {
2835
2837
  const validatedValue = schema.safeParse(value);
2836
2838
  if (!validatedValue.success) throw new Error(`[Navios] Invalid value for attribute ${token.toString()}: ${validatedValue.error}`);
@@ -5843,4 +5845,4 @@ var NaviosApplication = class {
5843
5845
 
5844
5846
  //#endregion
5845
5847
  export { LOG_LEVELS as $, Logger as A, isFunction as B, EnvConfigProvider as C, _ConfigService as D, ConfigServiceToken as E, runWithRequestId as F, isString as G, isNumber as H, setRequestIdEnabled as I, normalizePath as J, isSymbol as K, addLeadingSlash as L, loggerOptionsSchema as M, generateRequestId as N, _LoggerInstance as O, getRequestId as P, isLogLevel as Q, isConstructor as R, ConfigProviderOptions as S, ConfigServiceOptionsSchema as T, isObject as U, isNil as V, isPlainObject as W, isLogLevelEnabled as X, stripEndSlash as Y, filterLogLevels as Z, NotFoundException as _, _ReplyFactory as a, BadRequestException as b, _HttpAdapterFactory as c, _ModuleLoaderService as d, clc as et, _GuardRunnerService as f, UnauthorizedException as g, ConflictException as h, _StreamAdapterFactory as i, LoggerOutput as j, _ConsoleLogger as k, _EndpointAdapterFactory as l, _InstanceResolverService as m, _NaviosApplication as n, envInt as nt, _RequestFactory as o, ControllerResolverService as p, isUndefined as q, _XmlStreamAdapterFactory as r, envString as rt, _MultipartAdapterFactory as s, NaviosFactory as t, yellow as tt, AttributeFactory as u, InternalServerErrorException as v, provideConfig as w, HttpException as x, ForbiddenException as y, isEmpty as z };
5846
- //# sourceMappingURL=src-Bo23RIo-.mjs.map
5848
+ //# sourceMappingURL=src-Baabu2R8.mjs.map