@living-architecture/riviere-extract-conventions 0.4.0 → 0.4.2

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.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { DomainOpContainer, APIContainer, EventHandlerContainer, UseCase, Event, UI, DomainOp, APIEndpoint, EventHandler, Custom, Ignore, getCustomType, } from './decorators';
2
- export type { HttpMethod, APIControllerDef, EventDef, EventHandlerDef, UIPageDef, DomainOpContainerDef, } from './interfaces';
2
+ export type { HttpMethod, APIControllerDef, EventDef, EventHandlerDef, IEventHandler, UIPageDef, DomainOpContainerDef, } from './interfaces';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EAErB,OAAO,EACP,KAAK,EACL,EAAE,EAEF,QAAQ,EACR,WAAW,EACX,YAAY,EAEZ,MAAM,EACN,MAAM,EAEN,aAAa,GACd,MAAM,cAAc,CAAA;AAGrB,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,eAAe,EACf,SAAS,EACT,oBAAoB,GACrB,MAAM,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EAErB,OAAO,EACP,KAAK,EACL,EAAE,EAEF,QAAQ,EACR,WAAW,EACX,YAAY,EAEZ,MAAM,EACN,MAAM,EAEN,aAAa,GACd,MAAM,cAAc,CAAA;AAGrB,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,eAAe,EACf,aAAa,EACb,SAAS,EACT,oBAAoB,GACrB,MAAM,cAAc,CAAA"}
@@ -9,12 +9,10 @@ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
9
9
  * Required properties:
10
10
  * - route: The URL path for this endpoint
11
11
  * - method: The HTTP method (GET, POST, PUT, PATCH, DELETE)
12
- * - handle: The request handler function
13
12
  */
14
13
  export interface APIControllerDef {
15
14
  readonly route: string;
16
15
  readonly method: HttpMethod;
17
- handle(req: Request, res: Response): void | Promise<void>;
18
16
  }
19
17
  /**
20
18
  * Interface for domain event classes.
@@ -32,11 +30,21 @@ export interface EventDef {
32
30
  *
33
31
  * Required properties:
34
32
  * - subscribedEvents: Array of event type names this handler processes
35
- * - handle: The event processing function
36
33
  */
37
34
  export interface EventHandlerDef {
38
35
  readonly subscribedEvents: readonly string[];
39
- handle(event: unknown): void | Promise<void>;
36
+ }
37
+ /**
38
+ * Generic event handler interface for use with fromGenericArg extraction.
39
+ * Classes implement this with a concrete event type to enable automatic
40
+ * subscribedEvents extraction from the generic argument.
41
+ *
42
+ * Example: class MyHandler implements IEventHandler<OrderPlaced> { ... }
43
+ * The extractor reads OrderPlaced from the generic arg as the subscribed event.
44
+ */
45
+ export interface IEventHandler<TEvent = unknown> {
46
+ readonly subscribedEvents: readonly string[];
47
+ readonly __eventType?: TEvent;
40
48
  }
41
49
  /**
42
50
  * Interface for UI page classes.
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEpE;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;IAC3B,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1D;AAED;;;;;;GA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AAM,CAAA;CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAA;CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@living-architecture/riviere-extract-conventions",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -32,6 +32,6 @@
32
32
  "!**/*.tsbuildinfo"
33
33
  ],
34
34
  "dependencies": {
35
- "@living-architecture/riviere-extract-config": "0.4.0"
35
+ "@living-architecture/riviere-extract-config": "0.4.1"
36
36
  }
37
37
  }