Skip to content

Commit

Permalink
Merge pull request #1 from feugy/crc
Browse files Browse the repository at this point in the history
v2.3.0
  • Loading branch information
feugy committed Sep 24, 2017
2 parents 284dfe5 + ed49ac6 commit 891c102
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 22 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ Copyright [Damien Simonin Feugas][feugy] and other contributors, licensed under

## Changelog

### 2.3.0
- Expose CRC32 checksum header name
- Dependencies update

### 2.2.1
- Add extractValidate that allow validation objects in options
- Include API name in validation errors
Expand Down
8 changes: 6 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ <h1>Minimalist µServices</h1><p>The goal of <a href="https://github.com/feugy/m
<p>Please checkout the <a href="https://feugy.github.io/mini-utils/">API reference</a></p>
<p>This project was kindly sponsored by <a href="http://nearform.com">nearForm</a>.</p>
<h2>License</h2><p>Copyright <a href="https://github.com/feugy">Damien Simonin Feugas</a> and other contributors, licensed under <a href="./LICENSE">MIT</a>.</p>
<h2>Changelog</h2><h3>2.2.1</h3><ul>
<h2>Changelog</h2><h3>2.3.0</h3><ul>
<li>Expose CRC32 checksum header name</li>
<li>Dependencies update</li>
</ul>
<h3>2.2.1</h3><ul>
<li>Add extractValidate that allow validation objects in options</li>
<li>Include API name in validation errors</li>
<li>Better documentation</li>
Expand All @@ -89,7 +93,7 @@ <h3>1.0.0</h3><ul>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
8 changes: 7 additions & 1 deletion docs/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ <h1 class="page-title">index.js</h1>
*/
exports.extractValidate = (id, apis, opts) =>
apis[id].validate || opts &amp;&amp; opts.validate || null

/**
* HTTP header name used in response to exchange exposed API checksum.
* Will contain the CRC-32 checksum of the `JSON.stringify(exposed.apis)` array
*/
exports.checksumHeader = 'x-service-crc'
</code></pre>
</article>
</section>
Expand All @@ -220,7 +226,7 @@ <h1 class="page-title">index.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
87 changes: 79 additions & 8 deletions docs/module-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,76 @@ <h1 class="page-title">index</h1>



<h3 class="subsection-title">Members</h3>



<h4 class="name" id=".checksumHeader"><span class="type-signature">(static) </span>checksumHeader<span class="type-signature"></span></h4>


<p class="summary">HTTP header name used in response to exchange exposed API checksum.</p>




<dl class="details">


<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line177">line 177</a>
</li></ul></dd>































</dl>





<div class="description">
<p>HTTP header name used in response to exchange exposed API checksum.
Will contain the CRC-32 checksum of the <code>JSON.stringify(exposed.apis)</code> array</p>
</div>












<h3 class="subsection-title">Methods</h3>
Expand All @@ -153,7 +223,7 @@ <h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".arrayToObj"><span class="type-signature">(static) </span>arrayToObj<span class="signature">(array, properties)</span><span class="type-signature"> &rarr; {Object}</span></h4>


<p class="summary">Transform an array to an object, assigning each array item to a given property.</p>
<p class="summary"><p>Transform an array to an object, assigning each array item to a given property.</p></p>



Expand Down Expand Up @@ -336,7 +406,7 @@ <h5>Returns:</h5>
<h4 class="name" id=".extractGroups"><span class="type-signature">(static) </span>extractGroups<span class="signature">(opts)</span><span class="type-signature"> &rarr; {ExtractionResult}</span></h4>


<p class="summary">Extract API groups and API options from parameter</p>
<p class="summary"><p>Extract API groups and API options from parameter</p></p>



Expand Down Expand Up @@ -495,7 +565,7 @@ <h5>Returns:</h5>
<h4 class="name" id=".extractValidate"><span class="type-signature">(static) </span>extractValidate<span class="signature">(id, apis, opts)</span><span class="type-signature"> &rarr; {Joi|null}</span></h4>


<p class="summary">Extract validation objects for a given API</p>
<p class="summary"><p>Extract validation objects for a given API</p></p>



Expand Down Expand Up @@ -767,7 +837,7 @@ <h5>Returns:</h5>
<h4 class="name" id=".getLogger"><span class="type-signature">(static) </span>getLogger<span class="signature">(opts<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Logger}</span></h4>


<p class="summary">Creates or re-use an existing logger</p>
<p class="summary"><p>Creates or re-use an existing logger</p></p>



Expand Down Expand Up @@ -940,7 +1010,7 @@ <h5>Returns:</h5>
<h4 class="name" id=".getParamNames"><span class="type-signature">(static) </span>getParamNames<span class="signature">(fn)</span><span class="type-signature"> &rarr; {Array.&lt;String>}</span></h4>


<p class="summary">Extract declared parameter names from funciton signature</p>
<p class="summary"><p>Extract declared parameter names from funciton signature</p></p>



Expand Down Expand Up @@ -1132,7 +1202,7 @@ <h5>Returns:</h5>
<h4 class="name" id=".isApi"><span class="type-signature">(static) </span>isApi<span class="signature">(apis)</span><span class="type-signature"> &rarr; {Boolean}</span></h4>


<p class="summary">Check if the exposed apis is acceptable for further processing</p>
<p class="summary"><p>Check if the exposed apis is acceptable for further processing</p></p>



Expand Down Expand Up @@ -1285,7 +1355,8 @@ <h5>Returns:</h5>
<h4 class="name" id=".validateParams"><span class="type-signature">(static) </span>validateParams<span class="signature">(values, schema, id, expected)</span><span class="type-signature"> &rarr; {Error|null}</span></h4>


<p class="summary">Validates some values with the given schema, with a custom error message whenmore values than expected are provided</p>
<p class="summary"><p>Validates some values with the given schema, with a custom error message when
more values than expected are provided</p></p>



Expand Down Expand Up @@ -1668,7 +1739,7 @@ <h5>Type:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
6 changes: 6 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,9 @@ exports.extractGroups = opts => {
*/
exports.extractValidate = (id, apis, opts) =>
apis[id].validate || opts && opts.validate || null

/**
* HTTP header name used in response to exchange exposed API checksum.
* Will contain the CRC-32 checksum of the `JSON.stringify(exposed.apis)` array
*/
exports.checksumHeader = 'x-service-crc'
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mini-service-utils",
"version": "2.2.1",
"version": "2.3.0",
"description": "Shared utilities mini-* libraries: Micro services done simply",
"author": "feugy <damien.feugas@gmail.com>",
"license": "MIT",
Expand All @@ -20,20 +20,20 @@
"watch-doc": "watch \"npm run doc\" ./lib"
},
"dependencies": {
"bunyan": "~1.8.9",
"joi": "~10.4.1"
"bunyan": "~2.0.2",
"joi": "~11.0.3"
},
"devDependencies": {
"coveralls": "~2.13.0",
"coveralls": "~2.13.1",
"docdash": "~0.4.0",
"eslint": "~3.19.0",
"husky": "~0.13.3",
"jsdoc": "~3.4.3",
"lab": "~11.1.0",
"eslint": "~4.7.2",
"husky": "~0.14.3",
"jsdoc": "~3.5.5",
"lab": "~14.3.1",
"lab-espower-transformer": "~1.1.0",
"next-update": "~1.5.1",
"nsp": "~2.6.3",
"power-assert": "~1.4.2",
"next-update": "~3.5.3",
"nsp": "~2.8.0",
"power-assert": "~1.4.4",
"rewire": "~2.5.2",
"watch": "~1.0.2"
}
Expand Down

0 comments on commit 891c102

Please sign in to comment.