@avtechno/sfr 2.0.5 → 2.0.6
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/types/templates.d.mts +1 -1
- package/package.json +1 -1
- package/src/templates.mts +2 -2
- package/src/types/index.d.ts +10 -10
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare function REST<V, H, C>(struct: RESTHandlerDescriptor<V, H, C>): H & C;
|
|
2
2
|
export declare function WS<V, H, C>(struct: WSHandlerDescriptor<V, H, C>): H & C;
|
|
3
|
-
export declare function MQ<V, H
|
|
3
|
+
export declare function MQ<V, H>(struct: MQHandlerDescriptor<V, H>): H;
|
package/package.json
CHANGED
package/src/templates.mts
CHANGED
|
@@ -41,10 +41,10 @@ export function WS<V, H, C>(struct : WSHandlerDescriptor<V, H, C>): H & C {
|
|
|
41
41
|
return { validators, controllers, handlers, cfg } as H & C;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export function MQ<V, H
|
|
44
|
+
export function MQ<V, H>(struct : MQHandlerDescriptor<V, H>): H{
|
|
45
45
|
const validators : RequestValidators = struct.validators || {};
|
|
46
46
|
const controllers : RequestControllers = struct.controllers || {};
|
|
47
|
-
const handlers : MQRequestHandlers
|
|
47
|
+
const handlers : MQRequestHandlers = struct.handlers || {};
|
|
48
48
|
const cfg : SFRConfig = struct.cfg || {};
|
|
49
49
|
|
|
50
50
|
//Bind controller injections to each controllers
|
package/src/types/index.d.ts
CHANGED
|
@@ -377,7 +377,7 @@ declare type WSDeclarationArtifact = DeclarationArtifact & {
|
|
|
377
377
|
declare type MQNamespaceDeclaration = {
|
|
378
378
|
[namespace: string]: DeclarationArtifact & {
|
|
379
379
|
content: {
|
|
380
|
-
handlers: MQRequestHandlers
|
|
380
|
+
handlers: MQRequestHandlers
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
}
|
|
@@ -461,19 +461,19 @@ declare type PatternMQSet = {
|
|
|
461
461
|
"Topic": BroadcastMQ;
|
|
462
462
|
}
|
|
463
463
|
|
|
464
|
-
declare type MQHandlerDescriptor<V, H
|
|
464
|
+
declare type MQHandlerDescriptor<V, H> = {
|
|
465
465
|
cfg?: SFRConfig;
|
|
466
466
|
validators: RequestValidators & V;
|
|
467
|
-
handlers: MQRequestHandlers
|
|
468
|
-
controllers?: RequestControllers &
|
|
467
|
+
handlers: MQRequestHandlers & H & ThisType<HandlerFacilities>;
|
|
468
|
+
controllers?: RequestControllers & ThisType<ControllerFacilities >;
|
|
469
469
|
};
|
|
470
470
|
|
|
471
|
-
declare type MQRequestHandlers
|
|
472
|
-
"Point-to-Point"?: MQRequestHandlerMap & ThisType<{ mq: Omit<TargetedMQ, "type" | "reply"> } &
|
|
473
|
-
"Fanout"?: MQRequestHandlerMap & ThisType<{ mq: Omit<BroadcastMQ, "type"> } &
|
|
474
|
-
"Request-Reply"?: MQRequestHandlerMap & ThisType<{ mq: Omit<TargetedMQ, "type"> } &
|
|
475
|
-
"Direct"?: RoutingHandlerMap & ThisType<{ mq: Omit<BroadcastMQ, "type"> } &
|
|
476
|
-
"Topic"?: TopicHandlerMap & ThisType<{ mq: Omit<BroadcastMQ, "type"> } &
|
|
471
|
+
declare type MQRequestHandlers = {
|
|
472
|
+
"Point-to-Point"?: MQRequestHandlerMap & ThisType<{ mq: Omit<TargetedMQ, "type" | "reply"> } & HandlerFacilities>;
|
|
473
|
+
"Fanout"?: MQRequestHandlerMap & ThisType<{ mq: Omit<BroadcastMQ, "type"> } & HandlerFacilities>;
|
|
474
|
+
"Request-Reply"?: MQRequestHandlerMap & ThisType<{ mq: Omit<TargetedMQ, "type"> } & HandlerFacilities>;
|
|
475
|
+
"Direct"?: RoutingHandlerMap & ThisType<{ mq: Omit<BroadcastMQ, "type"> } & HandlerFacilities>;
|
|
476
|
+
"Topic"?: TopicHandlerMap & ThisType<{ mq: Omit<BroadcastMQ, "type"> } & HandlerFacilities>;
|
|
477
477
|
};
|
|
478
478
|
|
|
479
479
|
declare type MQRequestHandlerMap = {
|