# @whook/whook

> Build strong and efficient REST web services.

Latest version **27.0.1** (published 2026-10-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @whook/whook
pnpm add @whook/whook
yarn add @whook/whook
bun add @whook/whook
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 27.0.1 |
| Published | 2026-10-29 |
| First published | 2019-02-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 31 |
| Author | Nicolas Froidure |
| Maintainers | nfroidure |
| Keywords | whook, knifecycle, REST, HTTP, OpenAPI, web, service, handler, server, framework |

## Links

- npm: https://www.npmjs.com/package/@whook/whook
- Repository: https://github.com/nfroidure/whook
- Issues: https://github.com/nfroidure/whook/issues
- Funding: https://github.com/sponsors/nfroidure
- npm.io page: https://npm.io/package/@whook/whook

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 27.0.1 (latest) — 2026-10-29
- 27.0.0 — 2026-10-27
- 26.3.0 — 2026-09-14
- 26.2.0 — 2026-09-07
- 26.1.0 — 2026-08-26
- 26.0.5 — 2026-08-20
- 26.0.2 — 2026-08-11
- 26.0.0 — 2026-08-07
- 25.2.0 — 2026-07-19
- 25.1.0 — 2026-06-08
- 25.0.0 — 2026-05-18
- 24.1.1 — 2026-05-15
- 24.1.0 — 2026-05-13
- 24.0.1 — 2026-04-22
- 24.0.0 — 2026-04-22
- … 126 more at https://npm.io/package/@whook/whook/versions

## README

[//]: # ( )
[//]: # (This file is automatically generated by a `metapak`)
[//]: # (module. Do not change it  except between the)
[//]: # (`content:start/end` flags, your changes would)
[//]: # (be overridden.)
[//]: # ( )
# @whook/whook
> Build strong and efficient REST web services.

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nfroidure/whook/blob/main/packages/whook-whook/LICENSE)


[//]: # (::contents:start)

`whook` allows you to create REST and GraphQL web services by providing its
ingredients and the recipe to make it work altogether.

The recipe is your Open API (version 3.1) definition while ingredients are
routes, crons, consumers, wrappers, services, commands and some environment
configuration.

## Quick start

```js
npm init @whook
```

Looks at the [repository's main README](https://github.com/nfroidure/whook) for
more documentation.

[//]: # (::contents:end)

# API
## Functions

<dl>
<dt><a href="#prepareProcess">prepareProcess(servicesNames, $)</a> ⇒</dt>
<dd><p>Runs the Whook&#39;s process</p>
</dd>
<dt><a href="#prepareEnvironment">prepareEnvironment($)</a> ⇒</dt>
<dd><p>Prepare the Whook process environment</p>
</dd>
<dt><a href="#pickFirstHeaderValue">pickFirstHeaderValue(name, headers)</a> ⇒ <code>string</code></dt>
<dd><p>Pick the first header value if exists</p>
</dd>
<dt><a href="#pickAllHeaderValues">pickAllHeaderValues(name, headers)</a> ⇒ <code>Array</code></dt>
<dd><p>Pick header values</p>
</dd>
<dt><a href="#initAPM">initAPM(services)</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Application monitoring service that simply log stringified contents.</p>
</dd>
<dt><a href="#initAvailablePort">initAvailablePort(services)</a> ⇒ <code>Promise.&lt;Number&gt;</code></dt>
<dd><p>Initialize the AVAILABLE_PORT service</p>
</dd>
<dt><a href="#initBasePath">initBasePath(services)</a> ⇒ <code>Promise.&lt;String&gt;</code></dt>
<dd><p>Initialize the BASE_PATH service.</p>
</dd>
<dt><a href="#initBaseURL">initBaseURL(services)</a> ⇒ <code>Promise.&lt;String&gt;</code></dt>
<dd><p>Initialize the BASE_URL service according to the HOST/PORT
 so that applications fallbacks to that default base URL.</p>
</dd>
<dt><a href="#initSchemaValidators">initSchemaValidators(services)</a> ⇒ <code>Promise.&lt;Number&gt;</code></dt>
<dd><p>Initialize the schema validator service for
 application schemas validation. This central
 place is aimed to compile schemas once and
 use them many times.</p>
</dd>
<dt><a href="#initCommands">initCommands(services)</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Initialize the COMMANDS service gathering the project commands.</p>
</dd>
<dt><a href="#initCommandsHandlers">initCommandsHandlers(services)</a> ⇒ <code>Promise.&lt;function()&gt;</code></dt>
<dd><p>Initialize the Whook command handlers to know which
 command to run for a given command name.</p>
</dd>
<dt><a href="#initCommandsWrappers">initCommandsWrappers(services)</a> ⇒ <code>Promise.&lt;function()&gt;</code></dt>
<dd><p>A simple passthrough service proxying the COMMANDS_WRAPPERS.</p>
</dd>
<dt><a href="#initConsumersDefinitions">initConsumersDefinitions(services)</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Initialize the CONSUMERS_DECLARATIONS service gathering the project consumers.</p>
</dd>
<dt><a href="#initConsumersHandlers">initConsumersHandlers(services)</a> ⇒ <code>Promise.&lt;function()&gt;</code></dt>
<dd><p>Initialize the Whook consumer handlers to know which
 consumer to run for a given consumer name.</p>
</dd>
<dt><a href="#initConsumersWrappers">initConsumersWrappers(services)</a> ⇒ <code>Promise.&lt;function()&gt;</code></dt>
<dd><p>A simple passthrough service proxying the CONSUMERS_WRAPPERS.</p>
</dd>
<dt><a href="#initCronsDefinitions">initCronsDefinitions(services)</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Initialize the CRONS_DECLARATIONS service gathering the project crons.</p>
</dd>
<dt><a href="#initCronsHandlers">initCronsHandlers(services)</a> ⇒ <code>Promise.&lt;function()&gt;</code></dt>
<dd><p>Initialize the Whook cron handlers used to know which
 cron to run for a given cron name.</p>
</dd>
<dt><a href="#initCronsWrappers">initCronsWrappers(services)</a> ⇒ <code>Promise.&lt;function()&gt;</code></dt>
<dd><p>A simple passthrough service proxying the CRONS_WRAPPERS.</p>
</dd>
<dt><a href="#initDefinitions">initDefinitions(services)</a> ⇒ <code>Promise.&lt;String&gt;</code></dt>
<dd><p>Initialize the DEFINITIONS service.</p>
</dd>
<dt><a href="#initErrorHandler">initErrorHandler(services)</a> ⇒ <code>Promise</code></dt>
<dd><p>Initialize an error handler for the
HTTP router</p>
</dd>
<dt><a href="#initHost">initHost(services)</a> ⇒ <code>Promise.&lt;String&gt;</code></dt>
<dd><p>Initialize the HOST service from ENV or auto-detection if
 none specified in ENV</p>
</dd>
<dt><a href="#initHTTPRouter">initHTTPRouter(services)</a> ⇒ <code>Promise</code></dt>
<dd><p>Initialize an HTTP router</p>
</dd>
<dt><a href="#initHTTPServer">initHTTPServer(services)</a> ⇒ <code><a href="#HTTPServer">Promise.&lt;HTTPServer&gt;</a></code></dt>
<dd><p>Initialize an HTTP server</p>
</dd>
<dt><a href="#initHTTPSServer">initHTTPSServer(services)</a> ⇒ <code><a href="#HTTPSServer">Promise.&lt;HTTPSServer&gt;</a></code></dt>
<dd><p>Initialize an HTTPS server</p>
</dd>
<dt><a href="#initHTTPTransaction">initHTTPTransaction(services)</a> ⇒ <code><a href="#WhookHTTPTransaction">Promise.&lt;WhookHTTPTransaction&gt;</a></code></dt>
<dd><p>Instantiate the httpTransaction service</p>
</dd>
<dt><a href="#initInternalIP">initInternalIP(services)</a> ⇒ <code>Promise.&lt;String&gt;</code></dt>
<dd><p>Initialize the INTERNAL_IP service</p>
</dd>
<dt><a href="#initMainHandler">initMainHandler(services)</a> ⇒ <code>Promise.&lt;function()&gt;</code></dt>
<dd><p>An initializer to build a single Whook handler.</p>
</dd>
<dt><a href="#initObfuscator">initObfuscator(services)</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Obfuscate sensible information.</p>
</dd>
<dt><a href="#initPort">initPort(services)</a> ⇒ <code>Promise.&lt;Number&gt;</code></dt>
<dd><p>Initialize the PORT service from ENV</p>
</dd>
<dt><a href="#wrapEnvForBuild">wrapEnvForBuild(services)</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Wrap the ENV service in order to filter ENV vars for the build</p>
</dd>
<dt><a href="#initRoutesDeclarations">initRoutesDeclarations(services)</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Initialize the ROUTES_DECLARATIONS service gathering
 the project routes definitions.</p>
</dd>
<dt><a href="#initRoutesHandlers">initRoutesHandlers(services)</a> ⇒ <code>Promise.&lt;function()&gt;</code></dt>
<dd><p>Initialize the Whook routes handlers used by the router
 to know which handler to run for a given route.</p>
</dd>
<dt><a href="#initRoutesWrappers">initRoutesWrappers(services)</a> ⇒ <code>Promise.&lt;function()&gt;</code></dt>
<dd><p>A simple passthrough service proxying the ROUTES_WRAPPERS.</p>
</dd>
<dt><a href="#initSchemaValidators">initSchemaValidators(services)</a> ⇒ <code>Promise.&lt;Number&gt;</code></dt>
<dd><p>Initialize the schema validator service for
 application schemas validation. This central
 place is aimed to compile schemas once and
 use them many times.</p>
</dd>
<dt><a href="#initSSLCertificates">initSSLCertificates(services)</a> ⇒ <code>Promise.&lt;SSLCertificates&gt;</code></dt>
<dd><p>Initialize an SSL certificate service</p>
</dd>
<dt><a href="#initTransformersDeclarations">initTransformersDeclarations(services)</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Initialize the TRANSFORMERS_DECLARATIONS service gathering the project transformers.</p>
</dd>
<dt><a href="#initTransformersHandlers">initTransformersHandlers(services)</a> ⇒ <code>Promise.&lt;function()&gt;</code></dt>
<dd><p>Initialize the Whook transformer handlers to know which
 transformer to run for a given transformer name.</p>
</dd>
<dt><a href="#initTransformersWrappers">initTransformersWrappers(services)</a> ⇒ <code>Promise.&lt;function()&gt;</code></dt>
<dd><p>A simple passthrough service proxying the TRANSFORMERS_WRAPPERS.</p>
</dd>
<dt><a href="#initWhookResolvedPlugins">initWhookResolvedPlugins(services)</a> ⇒ <code>Promise.&lt;string&gt;</code></dt>
<dd><p>Resolves the Whook plugins from their names</p>
</dd>
<dt><a href="#initWrappersDeclarations">initWrappersDeclarations(services)</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Initialize the WRAPPERS_DECLARATIONS service gathering the project wrappers.</p>
</dd>
</dl>

## Typedefs

<dl>
<dt><a href="#HTTPServer">HTTPServer</a></dt>
<dd></dd>
<dt><a href="#HTTPSServer">HTTPSServer</a></dt>
<dd></dd>
<dt><a href="#WhookHTTPTransaction">WhookHTTPTransaction</a></dt>
<dd></dd>
</dl>

<a name="prepareProcess"></a>

## prepareProcess(servicesNames, $) ⇒
Runs the Whook's process

**Kind**: global function  
**Returns**: Object
A promise of the injected services  

| Param | Type | Description |
| --- | --- | --- |
| servicesNames | <code>Array.&lt;String&gt;</code> | Root dependencies names to instanciate and return |
| $ | <code>Knifecycle</code> | The Knifecycle instance to use for the run |

<a name="prepareEnvironment"></a>

## prepareEnvironment($) ⇒
Prepare the Whook process environment

**Kind**: global function  
**Returns**: Promise<Knifecycle>
A promise of the Knifecycle instance  

| Param | Type | Description |
| --- | --- | --- |
| $ | <code>Knifecycle</code> | The Knifecycle instance to set the various services |

<a name="pickFirstHeaderValue"></a>

## pickFirstHeaderValue(name, headers) ⇒ <code>string</code>
Pick the first header value if exists

**Kind**: global function  
**Returns**: <code>string</code> - The value if defined.  

| Param | Type | Description |
| --- | --- | --- |
| name | <code>string</code> | The header name |
| headers | <code>Object</code> | The headers map |

<a name="pickAllHeaderValues"></a>

## pickAllHeaderValues(name, headers) ⇒ <code>Array</code>
Pick header values

**Kind**: global function  
**Returns**: <code>Array</code> - The values in an array.  

| Param | Type | Description |
| --- | --- | --- |
| name | <code>string</code> | The header name |
| headers | <code>Object</code> | The headers map |

<a name="initAPM"></a>

## initAPM(services) ⇒ <code>Promise.&lt;Object&gt;</code>
Application monitoring service that simply log stringified contents.

**Kind**: global function  
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise of the apm service.  

| Param | Type | Description |
| --- | --- | --- |
| services | <code>Object</code> | The services to inject |
| [services.log] | <code>function</code> | A logging function |

<a name="initAvailablePort"></a>

## initAvailablePort(services) ⇒ <code>Promise.&lt;Number&gt;</code>
Initialize the AVAILABLE_PORT service

**Kind**: global function  
**Returns**: <code>Promise.&lt;Number&gt;</code> - A promise of a number representing the available port.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.log] | <code>Object</code> | <code>noop</code> | An optional logging service |
| services.importer | <code>Object</code> |  | A service allowing to dynamically import ES modules |

<a name="initBasePath"></a>

## initBasePath(services) ⇒ <code>Promise.&lt;String&gt;</code>
Initialize the BASE_PATH service.

**Kind**: global function  
**Returns**: <code>Promise.&lt;String&gt;</code> - A promise of a containing the actual host.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| services.ENV | <code>Object</code> |  | The process environment |
| services.CONFIG | <code>Object</code> |  | The injected CONFIG value |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |

<a name="initBaseURL"></a>

## initBaseURL(services) ⇒ <code>Promise.&lt;String&gt;</code>
Initialize the BASE_URL service according to the HOST/PORT
 so that applications fallbacks to that default base URL.

**Kind**: global function  
**Returns**: <code>Promise.&lt;String&gt;</code> - A promise of a containing the actual host.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| services.ENV | <code>Object</code> |  | The process environment |
| services.CONFIG | <code>Object</code> |  | The injected CONFIG value |
| [services.PROTOCOL] | <code>Object</code> |  | The injected PROTOCOL value |
| services.HOST | <code>Object</code> |  | The injected HOST value |
| services.PORT | <code>Object</code> |  | The injected PORT value |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |

<a name="initSchemaValidators"></a>

## initSchemaValidators(services) ⇒ <code>Promise.&lt;Number&gt;</code>
Initialize the schema validator service for
 application schemas validation. This central
 place is aimed to compile schemas once and
 use them many times.

**Kind**: global function  
**Returns**: <code>Promise.&lt;Number&gt;</code> - A promise of a schema validators registry  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.SCHEMA_VALIDATORS_OPTIONS] | <code>Object</code> | <code>{}</code> | Options for the schema validators registry |
| [services.ENV] | <code>Object</code> | <code>{}</code> | An optional environment object |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |
| services.API | <code>Object</code> |  | A valid Open API file |

<a name="initCommands"></a>

## initCommands(services) ⇒ <code>Promise.&lt;Object&gt;</code>
Initialize the COMMANDS service gathering the project commands.

**Kind**: global function  
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise of a containing the actual host.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.WHOOK_PLUGINS] | <code>Array.&lt;String&gt;</code> |  | The activated plugins |
| services.WHOOK_RESOLVED_PLUGINS | <code>Array</code> |  | The resolved plugins |
| [services.DECLARATIONS_OPTIONS] | <code>Object</code> |  | The options to load the project commands |
| [services.COMMAND_DEFINITION_FILTER] | <code>Object</code> |  | A function to filter the project commands per definitions |
| services.importer | <code>Object</code> |  | A service allowing to dynamically import ES modules |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |

<a name="initCommandsHandlers"></a>

## initCommandsHandlers(services) ⇒ <code>Promise.&lt;function()&gt;</code>
Initialize the Whook command handlers to know which
 command to run for a given command name.

**Kind**: global function  
**Returns**: <code>Promise.&lt;function()&gt;</code> - A promise of the `COMMANDS_HANDLERS` hash.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.DEFINITIONS] | <code>Array</code> |  | The definitions that declares wrappers to wrap the commands with |
| [services.COMMANDS_WRAPPERS_ORDER] | <code>Array</code> |  | An optional array to choose wrappers application order |
| services.COMMANDS_WRAPPERS | <code>Array</code> |  | An optional list of wrappers to inject |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |
| services.COMMANDS_HANDLERS | <code>Object</code> |  | The rest is a hash of commands handlers mapped by name |

<a name="initCommandsWrappers"></a>

## initCommandsWrappers(services) ⇒ <code>Promise.&lt;function()&gt;</code>
A simple passthrough service proxying the COMMANDS_WRAPPERS.

**Kind**: global function  
**Returns**: <code>Promise.&lt;function()&gt;</code> - A promise of the `COMMANDS_WRAPPERS` hash.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.DEFINITIONS] | <code>Array</code> |  | The definitions that declares wrappers to wrap the commands with |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |
| services.COMMANDS_WRAPPERS | <code>Object</code> |  | The dependencies must all be injected wrappers |

<a name="initConsumersDefinitions"></a>

## initConsumersDefinitions(services) ⇒ <code>Promise.&lt;Object&gt;</code>
Initialize the CONSUMERS_DECLARATIONS service gathering the project consumers.

**Kind**: global function  
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise of a containing the actual host.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.WHOOK_PLUGINS] | <code>Array.&lt;String&gt;</code> |  | The activated plugins |
| services.WHOOK_RESOLVED_PLUGINS | <code>Array</code> |  | The resolved plugins |
| [services.DECLARATIONS_OPTIONS] | <code>Object</code> |  | The options to load the project files |
| [services.CONSUMER_DEFINITION_FILTER] | <code>Object</code> |  | A function to filter the project consumers per definitions |
| services.importer | <code>Object</code> |  | A service allowing to dynamically import ES modules |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |

<a name="initConsumersHandlers"></a>

## initConsumersHandlers(services) ⇒ <code>Promise.&lt;function()&gt;</code>
Initialize the Whook consumer handlers to know which
 consumer to run for a given consumer name.

**Kind**: global function  
**Returns**: <code>Promise.&lt;function()&gt;</code> - A promise of the `CONSUMERS_HANDLERS` hash.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.DEFINITIONS] | <code>Array</code> |  | The definitions that declares wrappers to wrap the consumers with |
| [services.CONSUMERS_WRAPPERS_ORDER] | <code>Array</code> |  | An optional array to choose wrappers application order |
| services.CONSUMERS_WRAPPERS | <code>Array</code> |  | An optional list of wrappers to inject |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |
| services.CONSUMERS_HANDLERS | <code>Object</code> |  | The rest is a hash of consumers handlers mapped by name |

<a name="initConsumersWrappers"></a>

## initConsumersWrappers(services) ⇒ <code>Promise.&lt;function()&gt;</code>
A simple passthrough service proxying the CONSUMERS_WRAPPERS.

**Kind**: global function  
**Returns**: <code>Promise.&lt;function()&gt;</code> - A promise of the `CONSUMERS_WRAPPERS` hash.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.DEFINITIONS] | <code>Array</code> |  | The definitions that declares wrappers to wrap the consumers with |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |
| services.CONSUMERS_WRAPPERS | <code>Object</code> |  | The dependencies must all be injected wrappers |

<a name="initCronsDefinitions"></a>

## initCronsDefinitions(services) ⇒ <code>Promise.&lt;Object&gt;</code>
Initialize the CRONS_DECLARATIONS service gathering the project crons.

**Kind**: global function  
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise of a containing the actual host.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.WHOOK_PLUGINS] | <code>Array.&lt;String&gt;</code> |  | The activated plugins |
| services.WHOOK_RESOLVED_PLUGINS | <code>Array</code> |  | The resolved plugins |
| [services.DECLARATIONS_OPTIONS] | <code>Object</code> |  | The options to load the project files |
| [services.CRON_DEFINITION_FILTER] | <code>Object</code> |  | A function to filter the project crons per definitions |
| services.importer | <code>Object</code> |  | A service allowing to dynamically import ES modules |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |

<a name="initCronsHandlers"></a>

## initCronsHandlers(services) ⇒ <code>Promise.&lt;function()&gt;</code>
Initialize the Whook cron handlers used to know which
 cron to run for a given cron name.

**Kind**: global function  
**Returns**: <code>Promise.&lt;function()&gt;</code> - A promise of the `CRONS_HANDLERS` hash.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.DEFINITIONS] | <code>Array</code> |  | The definitions that declares wrappers to wrap the crons with |
| [services.CRONS_WRAPPERS_ORDER] | <code>Array</code> |  | An optional array to choose wrappers application order |
| services.CRONS_WRAPPERS | <code>Array</code> |  | An optional list of wrappers to inject |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |
| services.CRONS_HANDLERS | <code>Object</code> |  | The rest is a hash of crons handlers mapped by name |

<a name="initCronsWrappers"></a>

## initCronsWrappers(services) ⇒ <code>Promise.&lt;function()&gt;</code>
A simple passthrough service proxying the CRONS_WRAPPERS.

**Kind**: global function  
**Returns**: <code>Promise.&lt;function()&gt;</code> - A promise of the `CRONS_WRAPPERS` hash.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.DEFINITIONS] | <code>Array</code> |  | The definitions that declares wrappers to wrap the crons with |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |
| services.CRONS_WRAPPERS | <code>Object</code> |  | The dependencies must all be injected wrappers |

<a name="initDefinitions"></a>

## initDefinitions(services) ⇒ <code>Promise.&lt;String&gt;</code>
Initialize the DEFINITIONS service.

**Kind**: global function  
**Returns**: <code>Promise.&lt;String&gt;</code> - A promise of a containing the actual host.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.ROUTES_DECLARATIONS] | <code>Object</code> |  | The API routes declarations |
| [services.COMMANDS_DECLARATIONS] | <code>Object</code> |  | The commands declarations |
| [services.CRONS_DECLARATIONS] | <code>Object</code> |  | The crons declarations |
| [services.CONSUMERS_DECLARATIONS] | <code>Object</code> |  | The consumers declarations |
| [services.TRANSFORMERS_DECLARATIONS] | <code>Object</code> |  | The transformers declarations |
| [services.WRAPPERS_DECLARATIONS] | <code>Object</code> |  | The wrappers declarations |
| [services.SECURITY_DEFINITIONS] | <code>Object</code> |  | The security definitions |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |

<a name="initErrorHandler"></a>

## initErrorHandler(services) ⇒ <code>Promise</code>
Initialize an error handler for the
HTTP router

**Kind**: global function  
**Returns**: <code>Promise</code> - A promise of a function to handle errors  

| Param | Type | Description |
| --- | --- | --- |
| services | <code>Object</code> | The service dependencies |
| services.ENV | <code>Object</code> | The app ENV |
| [services.DEBUG_NODE_ENVS] | <code>Array</code> | The environnement that activate debugging  (prints stack trace in HTTP errors responses) |
| [services.STRINGIFIERS] | <code>Object</code> | The synchronous body stringifiers |
| [services.ERRORS_DESCRIPTORS] | <code>Object</code> | An hash of the various error descriptors |
| [services.DEFAULT_ERROR_CODE] | <code>Object</code> | A string giving the default error code |

<a name="initErrorHandler..errorHandler"></a>

### initErrorHandler~errorHandler(transactionId, responseSpec, err) ⇒ <code>Promise</code>
Handle an HTTP transaction error and
map it to a serializable response

**Kind**: inner method of [<code>initErrorHandler</code>](#initErrorHandler)  
**Returns**: <code>Promise</code> - A promise resolving when the operation
 completes  

| Param | Type | Description |
| --- | --- | --- |
| transactionId | <code>String</code> | A raw NodeJS HTTP incoming message |
| responseSpec | <code>Object</code> | The response specification |
| err | <code>YHTTPError</code> | The encountered error |

<a name="initHost"></a>

## initHost(services) ⇒ <code>Promise.&lt;String&gt;</code>
Initialize the HOST service from ENV or auto-detection if
 none specified in ENV

**Kind**: global function  
**Returns**: <code>Promise.&lt;String&gt;</code> - A promise of a containing the actual host.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.ENV] | <code>Object</code> | <code>{}</code> | An optional environment object |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |

<a name="initHTTPRouter"></a>

## initHTTPRouter(services) ⇒ <code>Promise</code>
Initialize an HTTP router

**Kind**: global function  
**Returns**: <code>Promise</code> - A promise of a function to handle HTTP requests.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.BUFFER_LIMIT] | <code>String</code> |  | The maximum bufferisation before parsing the  request body |
| services.ROUTES_HANDLERS | <code>Object</code> |  | The handlers for the operations describe  by the OpenAPI API definition |
| services.API | <code>Object</code> |  | The OpenAPI definition of the API |
| [services.PARSERS] | <code>Object</code> |  | The synchronous body parsers (for operations  that defines a request body schema) |
| [services.STRINGIFIERS] | <code>Object</code> |  | The synchronous body stringifiers (for  operations that defines a response body  schema) |
| [services.ENCODERS] | <code>Object</code> |  | A map of encoder stream constructors |
| [services.DECODERS] | <code>Object</code> |  | A map of decoder stream constructors |
| [services.queryParserBuilder] | <code>Object</code> |  | A query parser builder from OpenAPI parameters |
| [services.COERCION_OPTIONS] | <code>Object</code> |  | Options for type coercion of parameters values |
| [services.log] | <code>function</code> | <code>noop</code> | A logging function |
| services.httpTransaction | <code>function</code> |  | A function to create a new HTTP transaction |

<a name="initHTTPRouter..httpRouter"></a>

### initHTTPRouter~httpRouter(req, res) ⇒ <code>Promise</code>
Handle an HTTP incoming message

**Kind**: inner method of [<code>initHTTPRouter</code>](#initHTTPRouter)  
**Returns**: <code>Promise</code> - A promise resolving when the operation
 completes  

| Param | Type | Description |
| --- | --- | --- |
| req | <code>HTTPRequest</code> | A raw NodeJS HTTP incoming message |
| res | <code>HTTPResponse</code> | A raw NodeJS HTTP response |

<a name="initHTTPServer"></a>

## initHTTPServer(services) ⇒ [<code>Promise.&lt;HTTPServer&gt;</code>](#HTTPServer)
Initialize an HTTP server

**Kind**: global function  
**Returns**: [<code>Promise.&lt;HTTPServer&gt;</code>](#HTTPServer) - A promise of an object with a NodeJS HTTP server
 in its `service` property.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.ENV] | <code>Object</code> |  | The process environment variables |
| services.ENV.DESTROY_SOCKETS | <code>String</code> |  | Whether the server sockets would be destroyed or if the  server should wait while sockets are kept alive |
| [services.HTTP_SERVER_OPTIONS] | <code>Object</code> |  | See https://nodejs.org/docs/latest/api/http.html#class-httpserver |
| services.HOST | <code>String</code> |  | The server host |
| services.PORT | <code>Number</code> |  | The server port |
| services.httpRouter | <code>function</code> |  | The function to run with the req/res tuple |
| [services.log] | <code>function</code> | <code>noop</code> | A logging function |

<a name="initHTTPSServer"></a>

## initHTTPSServer(services) ⇒ [<code>Promise.&lt;HTTPSServer&gt;</code>](#HTTPSServer)
Initialize an HTTPS server

**Kind**: global function  
**Returns**: [<code>Promise.&lt;HTTPSServer&gt;</code>](#HTTPSServer) - A promise of an object with a NodeJS HTTPS server
 in its `service` property.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.ENV] | <code>Object</code> |  | The process environment variables |
| services.ENV.DESTROY_SOCKETS | <code>String</code> |  | Whether the server sockets would be destroyed or if the  server should wait while sockets are kept alive |
| [services.SSL_CERTIFICATES] | <code>Object</code> |  | An object containing the SSL certificates |
| [services.HTTPS_SERVER_OPTIONS] | <code>Object</code> |  | See https://nodejs.org/docs/latest/api/http.html#class-httpserver |
| services.HOST | <code>String</code> |  | The server host |
| services.PORT | <code>Number</code> |  | The server port |
| services.httpRouter | <code>function</code> |  | The function to run with the req/res tuple |
| [services.log] | <code>function</code> | <code>noop</code> | A logging function |

<a name="initHTTPTransaction"></a>

## initHTTPTransaction(services) ⇒ [<code>Promise.&lt;WhookHTTPTransaction&gt;</code>](#WhookHTTPTransaction)
Instantiate the httpTransaction service

**Kind**: global function  
**Returns**: [<code>Promise.&lt;WhookHTTPTransaction&gt;</code>](#WhookHTTPTransaction) - A promise of the httpTransaction function  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.TIMEOUT] | <code>Number</code> | <code>30000</code> | A number indicating how many ms the transaction  should take to complete before being cancelled. |
| [services.TRANSACTIONS] | <code>Object</code> | <code>{}</code> | A hash of every current transactions |
| services.delay | <code>Object</code> |  | A delaying service |
| services.obfuscator | <code>Object</code> |  | A service to avoid logging sensible information |
| [services.log] | <code>function</code> |  | A logging function |
| [services.apm] | <code>function</code> |  | An apm function |
| [services.time] | <code>function</code> |  | A timing function |
| [services.uniqueId] | <code>function</code> |  | A function returning unique identifiers |

**Example**  
```js
import initHTTPTransaction from '@whook/whook';
import { log } from 'node:console';

const httpTransaction = await initHTTPTransaction({
  log,
  time: Date.now.bind(Date),
});
```
<a name="initHTTPTransaction..httpTransaction"></a>

### initHTTPTransaction~httpTransaction(req, res) ⇒ <code>Array</code>
Create a new HTTP transaction

**Kind**: inner method of [<code>initHTTPTransaction</code>](#initHTTPTransaction)  
**Returns**: <code>Array</code> - The normalized request and the HTTP
transaction created in an array.  

| Param | Type | Description |
| --- | --- | --- |
| req | <code>HTTPRequest</code> | A raw NodeJS HTTP incoming message |
| res | <code>HTTPResponse</code> | A raw NodeJS HTTP response |

<a name="initInternalIP"></a>

## initInternalIP(services) ⇒ <code>Promise.&lt;String&gt;</code>
Initialize the INTERNAL_IP service

**Kind**: global function  
**Returns**: <code>Promise.&lt;String&gt;</code> - A promise of containing the actual internal IP.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.log] | <code>Object</code> | <code>noop</code> | An optional logging service |
| services.importer | <code>Object</code> |  | A service allowing to dynamically import ES modules |

<a name="initMainHandler"></a>

## initMainHandler(services) ⇒ <code>Promise.&lt;function()&gt;</code>
An initializer to build a single Whook handler.

**Kind**: global function  
**Returns**: <code>Promise.&lt;function()&gt;</code> - A promise of the `MAIN_HANDLER` service.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.DEFINITIONS] | <code>Array</code> |  | The definitions that declares wrappers to wrap the handler with |
| services.MAIN_DEFINITION | <code>Object</code> |  | A definition for that handler |
| [services.MAIN_WRAPPERS_ORDER] | <code>Array</code> |  | An optional array to choose wrappers application order |
| services.MAIN_WRAPPERS | <code>Array</code> |  | An optional list of wrappers to inject |
| services.MAIN_WRAPPER | <code>function</code> |  | The main handler wrapper |
| services.BASE_HANDLER | <code>function</code> |  | The base handler |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |

<a name="initObfuscator"></a>

## initObfuscator(services) ⇒ <code>Promise.&lt;Object&gt;</code>
Obfuscate sensible information.

**Kind**: global function  
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise of an object containing the gathered constants.  

| Param | Type | Description |
| --- | --- | --- |
| services | <code>Object</code> | The service dependencies |
| [services.SHIELD_CHAR] | <code>Object</code> | The char for replacing sensible information |
| [services.MAX_CLEAR_CHARS] | <code>Object</code> | The maximum clear chars to display |
| [services.MAX_CLEAR_RATIO] | <code>Object</code> | The maximum clear chars ratio to display |
| [services.SENSIBLE_PROPS] | <code>Object</code> | Sensible properties names |
| [services.SENSIBLE_HEADERS] | <code>Object</code> | Sensible headers names |

**Example**  
```js
import { initObfuscator } from '@whook/whook';
import { alsoInject } from 'knifecycle';
import { log } from 'node:console';

const obfuscator = await initObfuscator();

log(obfuscator('my very secret information!));
// my ...on!
```
<a name="initPort"></a>

## initPort(services) ⇒ <code>Promise.&lt;Number&gt;</code>
Initialize the PORT service from ENV

**Kind**: global function  
**Returns**: <code>Promise.&lt;Number&gt;</code> - A promise of a number representing the actual port.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.ENV] | <code>Object</code> | <code>{}</code> | An optional environment object |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |

<a name="wrapEnvForBuild"></a>

## wrapEnvForBuild(services) ⇒ <code>Promise.&lt;Object&gt;</code>
Wrap the ENV service in order to filter ENV vars for the build

**Kind**: global function  
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise of an object containing the reshaped env vars.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.PROXIED_ENV_VARS] | <code>Object</code> | <code>{}</code> | A list of environment variable names to proxy |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |

<a name="initRoutesDeclarations"></a>

## initRoutesDeclarations(services) ⇒ <code>Promise.&lt;Object&gt;</code>
Initialize the ROUTES_DECLARATIONS service gathering
 the project routes definitions.

**Kind**: global function  
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise of a containing the actual host.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| services.APP_ENV | <code>String</code> |  | The application environment name |
| services.BASE_PATH | <code>String</code> |  | The API base path |
| [services.WHOOK_PLUGINS] | <code>Array.&lt;String&gt;</code> |  | The activated plugins |
| services.WHOOK_RESOLVED_PLUGINS | <code>Array</code> |  | The resolved plugins |
| [services.DECLARATIONS_OPTIONS] | <code>Object</code> |  | The options to load the files |
| [services.ROUTE_DEFINITION_FILTER] | <code>Object</code> |  | A function to filter the routes per definitions |
| services.importer | <code>Object</code> |  | A service allowing to dynamically import ES modules |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |

<a name="initRoutesHandlers"></a>

## initRoutesHandlers(services) ⇒ <code>Promise.&lt;function()&gt;</code>
Initialize the Whook routes handlers used by the router
 to know which handler to run for a given route.

**Kind**: global function  
**Returns**: <code>Promise.&lt;function()&gt;</code> - A promise of the `ROUTES_HANDLERS` hash.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.DEFINITIONS] | <code>Array</code> |  | The definitions that declares wrappers to wrap the routes with |
| [services.ROUTES_WRAPPERS_ORDER] | <code>Array</code> |  | An optional array to choose wrappers application order |
| services.ROUTES_WRAPPERS | <code>Array</code> |  | An optional list of wrappers to inject |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |
| services.ROUTES_HANDLERS | <code>Object</code> |  | The rest is a hash of routesHandlers mapped by their operation id |

<a name="initRoutesWrappers"></a>

## initRoutesWrappers(services) ⇒ <code>Promise.&lt;function()&gt;</code>
A simple passthrough service proxying the ROUTES_WRAPPERS.

**Kind**: global function  
**Returns**: <code>Promise.&lt;function()&gt;</code> - A promise of the `ROUTES_WRAPPERS` hash.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.DEFINITIONS] | <code>Array</code> |  | The definitions that declares wrappers to wrap the routes with |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |
| services.ROUTES_WRAPPERS | <code>Object</code> |  | The dependencies must all be injected wrappers |

<a name="initSchemaValidators"></a>

## initSchemaValidators(services) ⇒ <code>Promise.&lt;Number&gt;</code>
Initialize the schema validator service for
 application schemas validation. This central
 place is aimed to compile schemas once and
 use them many times.

**Kind**: global function  
**Returns**: <code>Promise.&lt;Number&gt;</code> - A promise of a schema validators registry  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.SCHEMA_VALIDATORS_OPTIONS] | <code>Object</code> | <code>{}</code> | Options for the schema validators registry |
| [services.ENV] | <code>Object</code> | <code>{}</code> | An optional environment object |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |
| services.API | <code>Object</code> |  | A valid Open API file |

<a name="initSSLCertificates"></a>

## initSSLCertificates(services) ⇒ <code>Promise.&lt;SSLCertificates&gt;</code>
Initialize an SSL certificate service

**Kind**: global function  
**Returns**: <code>Promise.&lt;SSLCertificates&gt;</code> - A promise of an object with certificates contents.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.ENV] | <code>Object</code> |  | The process environment variables |
| [services.log] | <code>function</code> | <code>noop</code> | A logging function |

<a name="initTransformersDeclarations"></a>

## initTransformersDeclarations(services) ⇒ <code>Promise.&lt;Object&gt;</code>
Initialize the TRANSFORMERS_DECLARATIONS service gathering the project transformers.

**Kind**: global function  
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise of a containing the actual host.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.WHOOK_PLUGINS] | <code>Array.&lt;String&gt;</code> |  | The activated plugins |
| services.WHOOK_RESOLVED_PLUGINS | <code>Array</code> |  | The resolved plugins |
| [services.DECLARATIONS_OPTIONS] | <code>Object</code> |  | The options to load the project files |
| [services.TRANSFORMER_DEFINITION_FILTER] | <code>Object</code> |  | A function to filter the project transformers per definitions |
| services.importer | <code>Object</code> |  | A service allowing to dynamically import ES modules |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |

<a name="initTransformersHandlers"></a>

## initTransformersHandlers(services) ⇒ <code>Promise.&lt;function()&gt;</code>
Initialize the Whook transformer handlers to know which
 transformer to run for a given transformer name.

**Kind**: global function  
**Returns**: <code>Promise.&lt;function()&gt;</code> - A promise of the `TRANSFORMERS_HANDLERS` hash.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| services.TRANSFORMERS_WRAPPERS | <code>Array</code> |  | An optional list of wrappers to inject |
| [services.TRANSFORMERS_WRAPPERS_ORDER] | <code>Array</code> |  | An optional array to choose wrappers application order |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |
| services.TRANSFORMERS_HANDLERS | <code>Object</code> |  | The rest is a hash of transformers handlers mapped by name |

<a name="initTransformersWrappers"></a>

## initTransformersWrappers(services) ⇒ <code>Promise.&lt;function()&gt;</code>
A simple passthrough service proxying the TRANSFORMERS_WRAPPERS.

**Kind**: global function  
**Returns**: <code>Promise.&lt;function()&gt;</code> - A promise of the `TRANSFORMERS_WRAPPERS` hash.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| services.DEFINITIONS | <code>Array</code> |  | The definitions that declares wrappers to wrap the transformers with |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |
| services.TRANSFORMERS_WRAPPERS | <code>Object</code> |  | The dependencies must all be injected wrappers |

<a name="initWhookResolvedPlugins"></a>

## initWhookResolvedPlugins(services) ⇒ <code>Promise.&lt;string&gt;</code>
Resolves the Whook plugins from their names

**Kind**: global function  
**Returns**: <code>Promise.&lt;string&gt;</code> - A promise of a number representing the actual port.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.WHOOK_PLUGINS] | <code>Array.&lt;String&gt;</code> |  | The activated plugins |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |

<a name="initWrappersDeclarations"></a>

## initWrappersDeclarations(services) ⇒ <code>Promise.&lt;Object&gt;</code>
Initialize the WRAPPERS_DECLARATIONS service gathering the project wrappers.

**Kind**: global function  
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise of a containing the actual host.  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> |  | The service dependencies |
| [services.WHOOK_PLUGINS] | <code>Array.&lt;String&gt;</code> |  | The activated plugins |
| services.WHOOK_RESOLVED_PLUGINS | <code>Array</code> |  | The resolved plugins |
| [services.DECLARATIONS_OPTIONS] | <code>Object</code> |  | The options to load the project wrappers |
| [services.WRAPPER_DEFINITION_FILTER] | <code>Object</code> |  | A function to filter the project wrappers per definitions |
| services.importer | <code>Object</code> |  | A service allowing to dynamically import ES modules |
| [services.log] | <code>function</code> | <code>noop</code> | An optional logging service |

<a name="HTTPServer"></a>

## HTTPServer
**Kind**: global typedef  
<a name="HTTPSServer"></a>

## HTTPSServer
**Kind**: global typedef  
<a name="WhookHTTPTransaction"></a>

## WhookHTTPTransaction
**Kind**: global typedef  

* [WhookHTTPTransaction](#WhookHTTPTransaction)
    * [.id](#WhookHTTPTransaction.id)
    * [.start](#WhookHTTPTransaction.start) ⇒ <code>Promise.&lt;Object&gt;</code>
    * [.catch](#WhookHTTPTransaction.catch) ⇒ <code>Promise</code>
    * [.end](#WhookHTTPTransaction.end) ⇒ <code>Promise.&lt;Object&gt;</code>

<a name="WhookHTTPTransaction.id"></a>

### WhookHTTPTransaction.id
Id of the transaction

**Kind**: static property of [<code>WhookHTTPTransaction</code>](#WhookHTTPTransaction)  
<a name="WhookHTTPTransaction.start"></a>

### WhookHTTPTransaction.start ⇒ <code>Promise.&lt;Object&gt;</code>
Start the transaction

**Kind**: static property of [<code>WhookHTTPTransaction</code>](#WhookHTTPTransaction)  
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise to be resolved with the signed token.  

| Param | Type | Description |
| --- | --- | --- |
| buildResponse | <code>function</code> | A function that builds a response |

<a name="WhookHTTPTransaction.catch"></a>

### WhookHTTPTransaction.catch ⇒ <code>Promise</code>
Catch a transaction error

**Kind**: static property of [<code>WhookHTTPTransaction</code>](#WhookHTTPTransaction)  
**Returns**: <code>Promise</code> - A promise to be resolved with the signed token.  

| Param | Type | Description |
| --- | --- | --- |
| err | <code>Error</code> | A function that builds a response |

<a name="WhookHTTPTransaction.end"></a>

### WhookHTTPTransaction.end ⇒ <code>Promise.&lt;Object&gt;</code>
End the transaction

**Kind**: static property of [<code>WhookHTTPTransaction</code>](#WhookHTTPTransaction)  
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise to be resolved with the signed token.  

| Param | Type | Description |
| --- | --- | --- |
| response | <code>Object</code> | A response for the transaction |


# Authors
- [Nicolas Froidure](http://insertafter.com/en/index.html)

# License
[MIT](https://github.com/nfroidure/whook/blob/main/packages/whook-whook/LICENSE)

---
_Source: https://npm.io/package/@whook/whook · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
