@avtechno/sfr 2.0.7 → 2.0.9

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.
@@ -97,15 +97,15 @@ export class SFRPipeline {
97
97
  this.pattern_channels = Object.fromEntries(channels);
98
98
  SFRPipeline.injections.rest.handlers = {
99
99
  ...SFRPipeline.injections.rest.handlers,
100
- mq: this.pattern_channels
100
+ mq_patterns: this.pattern_channels,
101
101
  };
102
102
  SFRPipeline.injections.mq.handlers = {
103
103
  ...SFRPipeline.injections.mq.handlers,
104
- mq: this.pattern_channels
104
+ mq_patterns: this.pattern_channels,
105
105
  };
106
106
  SFRPipeline.injections.ws.handlers = {
107
107
  ...SFRPipeline.injections.ws.handlers,
108
- mq: this.pattern_channels
108
+ mq_patterns: this.pattern_channels,
109
109
  };
110
110
  }
111
111
  // Inject Socket.IO server into WS handlers
@@ -44,9 +44,9 @@ export function MQ(struct) {
44
44
  Object.entries(handlers).forEach(([pattern, handlermap]) => {
45
45
  Object.entries(handlermap).forEach(([k, v]) => {
46
46
  /* @ts-ignore */
47
- const { mq } = (SFRPipeline.injections.mq.handlers || {});
47
+ const { mq_patterns } = (SFRPipeline.injections.mq.handlers || {});
48
48
  /* @ts-ignore */
49
- handlers[pattern][k] = { ...v, fn: v.fn.bind({ ...controllers, mq: mq ? mq[pattern] : null }) };
49
+ handlers[pattern][k] = { ...v, fn: v.fn.bind({ ...controllers, mq: mq_patterns[pattern], ...SFRPipeline.injections.mq.handlers }) };
50
50
  });
51
51
  });
52
52
  /* @ts-ignore */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avtechno/sfr",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "description": "An opinionated way of writing services using ExpressJS.",
5
5
  "type": "module",
6
6
  "files": [
@@ -117,17 +117,17 @@ export class SFRPipeline {
117
117
 
118
118
  SFRPipeline.injections.rest.handlers = {
119
119
  ...SFRPipeline.injections.rest.handlers,
120
- mq: this.pattern_channels
120
+ mq_patterns: this.pattern_channels,
121
121
  }
122
122
 
123
123
  SFRPipeline.injections.mq.handlers = {
124
124
  ...SFRPipeline.injections.mq.handlers,
125
- mq: this.pattern_channels
125
+ mq_patterns: this.pattern_channels,
126
126
  }
127
127
 
128
128
  SFRPipeline.injections.ws.handlers = {
129
129
  ...SFRPipeline.injections.ws.handlers,
130
- mq: this.pattern_channels
130
+ mq_patterns: this.pattern_channels,
131
131
  }
132
132
  }
133
133
 
package/src/templates.mts CHANGED
@@ -54,9 +54,9 @@ export function MQ<V, H>(struct : MQHandlerDescriptor<V, H>): H{
54
54
  Object.entries(handlers).forEach(([pattern, handlermap])=>{
55
55
  Object.entries(handlermap).forEach(([k, v])=> {
56
56
  /* @ts-ignore */
57
- const {mq} = (SFRPipeline.injections.mq.handlers || {});
57
+ const {mq_patterns} = (SFRPipeline.injections.mq.handlers || {});
58
58
  /* @ts-ignore */
59
- handlers[pattern][k] = {...v, fn : v.fn.bind({ ...controllers, mq : mq ? mq[pattern] : null, ...SFRPipeline.injections.mq.handlers})};
59
+ handlers[pattern][k] = {...v, fn : v.fn.bind({ ...controllers, mq : mq_patterns[pattern], ...SFRPipeline.injections.mq.handlers})};
60
60
  });
61
61
  });
62
62
  /* @ts-ignore */