@furystack/websocket-api
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -1,2 +0,1 @@ | ||
import { Injector } from "@furystack/inject"; | ||
import { Data } from "ws"; | ||
@@ -7,4 +6,4 @@ import { IWebSocketAction } from "./models/IWebSocketAction"; | ||
readonly actions: IWebSocketAction[]; | ||
execute(data: Data, context: WebSocketContext, injector: Injector): void; | ||
execute(data: Data, context: WebSocketContext): void; | ||
constructor(actions: IWebSocketAction[]); | ||
} |
@@ -7,5 +7,5 @@ "use strict"; | ||
} | ||
execute(data, context, injector) { | ||
execute(data, context) { | ||
const action = this.actions.find((a) => a.canExecute(data)); | ||
action && action.execute(data, context, injector); | ||
action && action.execute(data, context); | ||
} | ||
@@ -12,0 +12,0 @@ } |
export * from "./ActionResolver"; | ||
export * from "./Decorators"; | ||
export * from "./WebSocketApi"; | ||
@@ -3,0 +4,0 @@ export * from "./models"; |
@@ -7,2 +7,3 @@ "use strict"; | ||
__export(require("./ActionResolver")); | ||
__export(require("./Decorators")); | ||
__export(require("./WebSocketApi")); | ||
@@ -9,0 +10,0 @@ __export(require("./WebSocketAction")); |
@@ -1,2 +0,1 @@ | ||
import { Injector } from "@furystack/inject"; | ||
import { Data } from "ws"; | ||
@@ -7,4 +6,4 @@ import { IWebSocketContext } from "./IWebSocketContext"; | ||
authorize: string[]; | ||
canExecute: (data: Data) => boolean; | ||
execute: (data: Data, context: IWebSocketContext, injector: Injector) => void; | ||
canExecute(data: Data): boolean; | ||
execute(data: Data, context: IWebSocketContext): void; | ||
} |
@@ -1,2 +0,1 @@ | ||
import { Injector } from "@furystack/inject"; | ||
import { Data } from "ws"; | ||
@@ -8,3 +7,3 @@ import { IWebSocketAction, IWebSocketContext } from "./models"; | ||
abstract canExecute(data: Data): boolean; | ||
abstract execute(data: Data, context: IWebSocketContext, injector: Injector): any; | ||
abstract execute(data: Data, context: IWebSocketContext): any; | ||
} |
@@ -52,3 +52,3 @@ "use strict"; | ||
}); | ||
this.resolver.execute(message, context, this.injector); | ||
this.resolver.execute(message, context); | ||
}); | ||
@@ -55,0 +55,0 @@ ws.on("close", () => { |
{ | ||
"name": "@furystack/websocket-api", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "HTTP Api FuryStack package", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -7,5 +7,5 @@ import { Injector } from "@furystack/inject"; | ||
export class ActionResolver { | ||
public execute(data: Data, context: WebSocketContext, injector: Injector) { | ||
public execute(data: Data, context: WebSocketContext) { | ||
const action = this.actions.find((a) => a.canExecute(data)); | ||
action && action.execute(data, context, injector); | ||
action && action.execute(data, context); | ||
} | ||
@@ -12,0 +12,0 @@ |
export * from "./ActionResolver"; | ||
export * from "./Decorators"; | ||
export * from "./WebSocketApi"; | ||
@@ -3,0 +4,0 @@ export * from "./models"; |
@@ -8,4 +8,4 @@ import { Injector } from "@furystack/inject"; | ||
authorize: string[]; | ||
canExecute: (data: Data) => boolean; | ||
execute: (data: Data, context: IWebSocketContext, injector: Injector) => void; | ||
canExecute(data: Data): boolean; | ||
execute(data: Data, context: IWebSocketContext): void; | ||
} |
@@ -8,3 +8,3 @@ import { Injector } from "@furystack/inject"; | ||
public abstract canExecute(data: Data): boolean; | ||
public abstract execute(data: Data, context: IWebSocketContext, injector: Injector): any; | ||
public abstract execute(data: Data, context: IWebSocketContext): any; | ||
} |
@@ -51,3 +51,3 @@ import { IApi, LoggerCollection } from "@furystack/core"; | ||
}); | ||
this.resolver.execute(message, context, this.injector); | ||
this.resolver.execute(message, context); | ||
}); | ||
@@ -54,0 +54,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56017
51
612