From 88def43510add7bfe141485ad60a27e8d096c19a Mon Sep 17 00:00:00 2001 From: Michal Raczka Date: Thu, 22 Mar 2018 17:45:50 +0100 Subject: [PATCH] Small docs fixes --- API.md | 5 ++++- README.md | 2 +- src/helpers/request-extract.js | 2 +- src/index.js | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/API.md b/API.md index 45d2a3c..3255e5b 100644 --- a/API.md +++ b/API.md @@ -99,6 +99,9 @@ Returns **[Function][42]** ## Context +An object that's available in all action handlers and routers as `req.hull`. +It's a set of parameters and modules to work in the context of current organization and connector instance. + ### helpers This is a set of additional helper functions being exposed at `req.hull.helpers`. They allow to perform common operation in the context of current request. They are similar o `req.hull.client.utils`, but operate at higher level, ensure good practises and should be used in the first place before falling back to raw utils. @@ -129,7 +132,7 @@ This is a method to request an extract of user base to be sent back to the Conne - `options` **[Object][37]** (optional, default `{}`) - `options.segment` **[Object][37]** (optional, default `null`) - `options.format` **[Object][37]** (optional, default `json`) - - `options.path` **[Object][37]** (optional, default `batch`) + - `options.path` **[Object][37]** (optional, default `/batch`) - `options.fields` **[Object][37]** (optional, default `[]`) - `options.additionalQuery` **[Object][37]** (optional, default `{}`) diff --git a/README.md b/README.md index 5a1c462..8f40b17 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ To get more details on how those helpers methods work please see [API REFERENCE] # Context Object -[Hull.Connector](#hullconnector) apply multiple middlewares to the request handler, including [Hull.Middleware](#hullmiddleware). The result is a **Context Object** that's available in all action handlers and routers as `req.hull`. It's a set of parameters and modules to work in the context of current organization and connector instance. This Context is divided into a base set by `Hull.Middleware` (if you use it standalone) and an extended set applied when using `Hull.Connector` and helpers method descibed above. +[Hull.Connector](#hullconnector) apply multiple middlewares to the request handler, including [Hull.Middleware](#hullmiddleware). The result is a **Context Object** that's available in all action handlers and routers as `req.hull`. It's a set of parameters and modules to work in the context of current organization and connector instance. This Context is divided into a base set by `Hull.Middleware` (if you use it standalone) and an extended set applied when using `Hull.Connector` and helpers method described above. Here is the base structure of the Context Object (we also provide Flow type for this object [here](./src/types/hull-req-context.js)). diff --git a/src/helpers/request-extract.js b/src/helpers/request-extract.js index 3298f02..2fad116 100644 --- a/src/helpers/request-extract.js +++ b/src/helpers/request-extract.js @@ -12,7 +12,7 @@ const _ = require("lodash"); * @param {Object} [options={}] * @param {Object} [options.segment=null] * @param {Object} [options.format=json] - * @param {Object} [options.path=batch] + * @param {Object} [options.path=/batch] * @param {Object} [options.fields=[]] * @param {Object} [options.additionalQuery={}] * @return {Promise} diff --git a/src/index.js b/src/index.js index 3f28ae6..b272d53 100644 --- a/src/index.js +++ b/src/index.js @@ -25,6 +25,9 @@ export type { */ /** + * An object that's available in all action handlers and routers as `req.hull`. + * It's a set of parameters and modules to work in the context of current organization and connector instance. + * * @namespace Context * @public */