@common-stack/server-core
Advanced tools
Comparing version 0.0.14-25 to 0.0.14-26
@@ -0,1 +1,2 @@ | ||
import 'reflect-metadata'; | ||
import 'jest'; |
@@ -29,3 +29,3 @@ import { IResolverOptions, IDirectiveOptions } from '../interfaces'; | ||
createContext(req: any, connectionParams: any, webSocket?: any): Promise<any>; | ||
createServiceContext: (options: any) => (req: any, connectionParams: any, webSocket?: any) => Promise<any>; | ||
createServiceContext(options: any): (req: any, connectionParams: any, webSocket?: any) => Promise<any>; | ||
createService(options: any): any; | ||
@@ -32,0 +32,0 @@ createResolvers(options?: IResolverOptions): any; |
@@ -107,7 +107,2 @@ module.exports = | ||
constructor(feature, ...features) { | ||
this.createServiceContext = (options) => async (req, connectionParams, webSocket) => { | ||
const services = this.createService(options); | ||
const results = await Promise.all(this.createContextFunc.map(createContext => createContext(req, connectionParams, webSocket))); | ||
return lodash_1.merge({}, ...results, Object.assign({}, services)); | ||
}; | ||
combine(arguments, arg => arg.catalogInfo).forEach(info => Object.keys(info).forEach(key => (exports.featureCatalog[key] = info[key]))); | ||
@@ -130,2 +125,9 @@ this.schema = combine(arguments, arg => arg.schema); | ||
} | ||
createServiceContext(options) { | ||
const services = this.createService(options); | ||
return async (req, connectionParams, webSocket) => { | ||
const results = await Promise.all(this.createContextFunc.map(createContext => createContext(req, connectionParams, webSocket))); | ||
return lodash_1.merge({}, ...results, Object.assign({}, services)); | ||
}; | ||
} | ||
createService(options) { | ||
@@ -132,0 +134,0 @@ const container = this.createContainers(options); |
{ | ||
"name": "@common-stack/server-core", | ||
"version": "0.0.14-25", | ||
"version": "0.0.14-26", | ||
"description": "xterm server services for Node", | ||
@@ -51,3 +51,3 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@common-stack/utils": "^0.0.14-25", | ||
"@common-stack/utils": "^0.0.14-26", | ||
"cross-env": "^5.1.3", | ||
@@ -54,0 +54,0 @@ "jest": "^22.1.0", |
Sorry, the diff of this file is not supported yet
21513
237