Comparing version 1.13.40 to 1.13.41
@@ -333,2 +333,18 @@ /// <reference types="@fibjs/types" /> | ||
interface WebSocketMessageHandlerContext<DT = any> { | ||
app: FibApp.FibAppClass, | ||
data: DT | ||
/** | ||
* @description | ||
*/ | ||
websocket_msg: Class_WebSocketMessage, | ||
/** | ||
* @description websocket connection | ||
*/ | ||
websocket: Class_WebSocket | ||
/** | ||
* @description websocket's original request | ||
*/ | ||
request: FibApp.FibAppHttpRequest | ||
} | ||
interface Hooks { | ||
@@ -410,2 +426,3 @@ beforeSetupRoute?: FxOrmHook.HookActionCallback | ||
} | ||
readonly eventor: Class_EventEmitter | ||
@@ -412,0 +429,0 @@ addRpcMethod (name: string, fn: RpcMethod): number |
v1.13.40 / 2019-07-30 | ||
v1.13.41 / 2019-08-03 | ||
================== | ||
* feat: add FibAppClass['eventor'], support `onReceiveFibPushAct` event | ||
v1.13.40 / 2019-07-30 | ||
===================== | ||
* Release v1.13.40 | ||
* feat: tuning, allow pass `session` to options of `app.rpcCall`. | ||
@@ -6,0 +12,0 @@ * upgrade fib-rpc & @fibjs/ci |
@@ -10,2 +10,3 @@ const mq = require("mq"); | ||
const Session = require("fib-session"); | ||
const events_1 = require("events"); | ||
class App extends mq.Routing { | ||
@@ -19,6 +20,11 @@ constructor(connStr) { | ||
value: filterFibAppOptions(appOpts), | ||
writable: false | ||
writable: false, | ||
configurable: false | ||
}); | ||
// just for compatible | ||
this.__opts.graphqlTypeMap = this.__opts.graphqlTypeMap || dbSetupOpts.graphqlTypeMap || {}; | ||
Object.defineProperty(this, 'eventor', { | ||
value: new events_1.EventEmitter(), | ||
writable: false, | ||
configurable: false | ||
}); | ||
this.__opts.graphqlTypeMap = util.extend(this.__opts.graphqlTypeMap, dbSetupOpts.graphqlTypeMap); | ||
this.ormPool = setupDb(this, connStr, dbSetupOpts); | ||
@@ -25,0 +31,0 @@ appOpts.hooks = appOpts.hooks || {}; |
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const { trigger, wait } = require('@fxjs/orm/lib/orm/entry/Hook.js'); | ||
exports.trigger = trigger; | ||
exports.wait = wait; | ||
const orm_1 = require("@fxjs/orm"); | ||
exports.wait = orm_1.Helpers.hookWait; | ||
exports.trigger = orm_1.Helpers.hookTrigger; |
@@ -9,6 +9,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
const graphql_1 = require("../utils/graphql"); | ||
const rpc_1 = require("./rpc"); | ||
const websocket_rpc_1 = require("./websocket_rpc"); | ||
const batch_request_1 = require("../utils/batch-request"); | ||
const Hook = require("./hook"); | ||
const ROOT_PATH = '/'; | ||
const _ctx_1 = require("./_ctx"); | ||
function bind(app) { | ||
@@ -26,3 +26,2 @@ // bind it firstly | ||
const graphQLPathPrefix = app.__opts.graphQLPathPrefix; | ||
const rpcPathPrefix = app.__opts.rpcPathPrefix; | ||
const batchPathPrefix = app.__opts.batchPathPrefix; | ||
@@ -67,9 +66,7 @@ const enableFilterApiCollection = apiPathPrefix === viewPathPrefix; | ||
throw err; | ||
/* setup rpc :start */ | ||
if (rpcPathPrefix && rpcPathPrefix !== ROOT_PATH) { | ||
rpc_1.bind_rpc(app); | ||
} | ||
/* setup rpc :end */ | ||
/* setup websocket :start */ | ||
websocket_rpc_1.bind_websocket_and_rpc(app); | ||
/* setup websocket :end */ | ||
/* setup graphql :start */ | ||
const mergeRootAndGraphqlRoot = !graphQLPathPrefix || graphQLPathPrefix === ROOT_PATH; | ||
const mergeRootAndGraphqlRoot = !graphQLPathPrefix || graphQLPathPrefix === _ctx_1.ROOT_PATH; | ||
if (!mergeRootAndGraphqlRoot) | ||
@@ -91,3 +88,3 @@ app.post(graphQLPathPrefix, (req) => { | ||
/* setup batch task :end */ | ||
const mergeRootAndBatchRoot = !batchPathPrefix || batchPathPrefix === ROOT_PATH; | ||
const mergeRootAndBatchRoot = !batchPathPrefix || batchPathPrefix === _ctx_1.ROOT_PATH; | ||
if (!mergeRootAndBatchRoot) | ||
@@ -97,3 +94,3 @@ app.post(batchPathPrefix, (req) => batch_request_1.run_batch(app, req)); | ||
/* finally, root setup */ | ||
app.post(ROOT_PATH, (req) => { | ||
app.post(_ctx_1.ROOT_PATH, (req) => { | ||
if (graphql_1.is_graphql_request(req)) | ||
@@ -100,0 +97,0 @@ return mergeRootAndGraphqlRoot && graphql_1.run_graphql(app, req); |
{ | ||
"name": "fib-app", | ||
"version": "1.13.40", | ||
"version": "1.13.41", | ||
"description": "", | ||
@@ -47,3 +47,3 @@ "main": "./lib", | ||
"fib-pug": "0.0.2", | ||
"fib-push": "^1.4.1", | ||
"fib-push": "^1.4.2", | ||
"fib-session": "^0.4.1", | ||
@@ -68,3 +68,4 @@ "fib-typify": "^0.6.0", | ||
"0.26.0", | ||
"0.26.1" | ||
"0.26.1", | ||
"0.27.0" | ||
], | ||
@@ -71,0 +72,0 @@ "travis_services": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
175104
3842