@di-framework/di-framework-http 0.0.0-prerelease.309 → 0.0.0-prerelease.310

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/dist/index.js CHANGED
@@ -606,9 +606,13 @@ function Endpoint(metadata) {
606
606
  const property = target[propertyKey];
607
607
  const constructor = typeof target === "function" ? target : target.constructor;
608
608
  registry_default.addTarget(constructor);
609
- property.isEndpoint = true;
609
+ if (property) {
610
+ property.isEndpoint = true;
611
+ if (metadata) {
612
+ property.metadata = metadata;
613
+ }
614
+ }
610
615
  if (metadata) {
611
- property.metadata = metadata;
612
616
  const existing = constructor[SCHEMAS] ?? new Set;
613
617
  extractSchemaRefs(metadata, existing);
614
618
  constructor[SCHEMAS] = existing;
package/dist/src/cli.js CHANGED
@@ -553,9 +553,13 @@ function Endpoint(metadata) {
553
553
  const property = target[propertyKey];
554
554
  const constructor = typeof target === "function" ? target : target.constructor;
555
555
  registry_default.addTarget(constructor);
556
- property.isEndpoint = true;
556
+ if (property) {
557
+ property.isEndpoint = true;
558
+ if (metadata) {
559
+ property.metadata = metadata;
560
+ }
561
+ }
557
562
  if (metadata) {
558
- property.metadata = metadata;
559
563
  const existing = constructor[SCHEMAS] ?? new Set;
560
564
  extractSchemaRefs(metadata, existing);
561
565
  constructor[SCHEMAS] = existing;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@di-framework/di-framework-http",
3
- "version": "0.0.0-prerelease.309",
3
+ "version": "0.0.0-prerelease.310",
4
4
  "description": "Extends di-framework with HTTP features",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -40,7 +40,7 @@
40
40
  "typescript": "^5"
41
41
  },
42
42
  "peerDependencies": {
43
- "@di-framework/di-framework": "^0.0.0-prerelease.309",
43
+ "@di-framework/di-framework": "^0.0.0-prerelease.310",
44
44
  "typescript": "^5"
45
45
  }
46
46
  }
package/src/decorators.ts CHANGED
@@ -78,9 +78,15 @@ export function Endpoint(metadata?: {
78
78
  // or we could register it explicitly here if we had path/method info.
79
79
  // Since TypedRouter adds path/method to the handler, we keep it as is
80
80
  // but we can ensure the metadata is attached.
81
- property.isEndpoint = true;
81
+ if (property) {
82
+ property.isEndpoint = true;
83
+ if (metadata) {
84
+ property.metadata = metadata;
85
+ }
86
+ }
87
+
88
+ // Also attach schemas if metadata is provided
82
89
  if (metadata) {
83
- property.metadata = metadata;
84
90
  const existing: Set<string> =
85
91
  (constructor as Record<symbol, Set<string>>)[SCHEMAS] ?? new Set<string>();
86
92
  extractSchemaRefs(metadata, existing);