@devninjas/chairo
Advanced tools
Comparing version 1.0.0 to 2.0.0
@@ -5,3 +5,4 @@ 'use strict'; | ||
const Hoek = require('hoek'); | ||
const Hoek = require('@hapi/hoek'); | ||
const TransformHoek = require('transform-hoek'); | ||
const Jsonic = require('jsonic'); | ||
@@ -38,3 +39,3 @@ const Seneca = require('seneca'); | ||
seneca.use('seneca-as-promised'); | ||
seneca.use('seneca-as-promised').use('seneca-promisify'); | ||
@@ -67,3 +68,2 @@ // need to wait for plugins to initialize at this point | ||
}, | ||
pkg: require('../package.json') | ||
@@ -139,2 +139,3 @@ }; | ||
} | ||
return result; | ||
@@ -175,3 +176,3 @@ } | ||
tpl[action] = 'result'; | ||
Hoek.merge(composed, Hoek.transform(source, tpl)); | ||
Hoek.merge(composed, TransformHoek.transform(source, tpl)); | ||
}); | ||
@@ -178,0 +179,0 @@ }; |
@@ -5,4 +5,4 @@ 'use strict'; | ||
const Joi = require('joi'); | ||
const Hoek = require('hoek'); | ||
const Joi = require('@hapi/joi'); | ||
const Hoek = require('@hapi/hoek'); | ||
@@ -15,3 +15,3 @@ // Declare internals | ||
const result = Joi.validate(options, internals.action); | ||
const result = internals.action.validate(options); | ||
Hoek.assert(!result.error, message); | ||
@@ -23,3 +23,3 @@ return result.value; | ||
const result = Joi.validate(options, internals.compose); | ||
const result = internals.compose.validate(options); | ||
Hoek.assert(!result.error, message); | ||
@@ -26,0 +26,0 @@ return result.value; |
{ | ||
"name": "@devninjas/chairo", | ||
"description": "Seneca micro-services plugin for hapi", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"repository": "git://github.com/snics/chairo", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "lab -a @hapi/code -vL -t 90 -L", | ||
"test-cov-html": "lab -a code -r html -o coverage.html", | ||
"cover": "lab -s -r lcov | coveralls" | ||
}, | ||
"keywords": [ | ||
@@ -14,32 +19,30 @@ "hapi", | ||
"engines": { | ||
"node": ">=4.0.0" | ||
"node": ">=12.0.0" | ||
}, | ||
"dependencies": { | ||
"boom": "7.1.x", | ||
"bounce": "1.2.x", | ||
"hoek": "5.0.x", | ||
"@hapi/boom": "^9.1.x", | ||
"@hapi/bounce": "^2.x.x", | ||
"@hapi/hoek": "^9.1.x", | ||
"@hapi/joi": "^17.1.1", | ||
"items": "2.1.x", | ||
"joi": "13.1.x", | ||
"jsonic": "0.3.x", | ||
"jsonic": "1.x.x", | ||
"seneca": "3.x.x", | ||
"seneca-as-promised": "2.0.x" | ||
"seneca-as-promised": "2.x.x", | ||
"seneca-promisify": "^2.x.x", | ||
"transform-hoek": "0.0.1" | ||
}, | ||
"peerDependencies": { | ||
"hapi": ">=11.x.x" | ||
"hapi": ">=18.x.x" | ||
}, | ||
"devDependencies": { | ||
"code": "5.x.x", | ||
"coveralls": "3.x.x", | ||
"@hapi/code": "^8.x.X", | ||
"@hapi/hapi": "^18.x.x", | ||
"@hapi/lab": "^24.x.x", | ||
"@hapi/vision": "^6.x.x", | ||
"coveralls": "3.1.x", | ||
"eslint": "4.x.x", | ||
"handlebars": "4.x.x", | ||
"hapi": "17.x.x", | ||
"lab": "15.x.x", | ||
"sinon": "4.3.x", | ||
"vision": "5.x.x" | ||
"sinon": "9.x.x" | ||
}, | ||
"scripts": { | ||
"test": "node node_modules/lab/bin/lab -a code -t 100 -L", | ||
"test-cov-html": "node node_modules/lab/bin/lab -a code -r html -o coverage.html", | ||
"cover": "lab -s -r lcov | coveralls" | ||
}, | ||
"license": "BSD-3-Clause" | ||
} |
# chairo | ||
[![npm version][npm-badge]][npm-url] | ||
[![Build Status][travis-badge]][travis-url] | ||
@@ -21,2 +20,7 @@ > This is a fork of [geek/chairo](https://github.com/geek/chairo) | ||
npm i @devninjas/chairo -s | ||
// Install for œhapi/hapi v18 or higher | ||
npm i @devninjas/chairo@2 -s | ||
// Install for œhapi/hapi v17 | ||
npm i @devninjas/chairo@1 -s | ||
``` | ||
@@ -315,5 +319,3 @@ | ||
[npm-badge]: https://badge.fury.io/js/chairo.svg | ||
[npm-url]: https://badge.fury.io/js/chairo | ||
[travis-badge]: https://api.travis-ci.org/hapijs/chairo.svg | ||
[travis-url]: https://travis-ci.org/hapijs/chairo | ||
[npm-badge]: https://badge.fury.io/js/%40devninjas%2Fchairo.svg | ||
[npm-url]: https://www.npmjs.com/package/@devninjas/chairo |
@@ -5,7 +5,7 @@ 'use strict'; | ||
const Code = require('code'); | ||
const Hapi = require('hapi'); | ||
const Lab = require('lab'); | ||
const Hapi = require('@hapi/hapi'); | ||
const Code = require('@hapi/code'); | ||
const Lab = require('@hapi/lab'); | ||
const Seneca = require('seneca'); | ||
const Vision = require('vision'); | ||
const Vision = require('@hapi/vision'); | ||
const Chairo = require('../'); | ||
@@ -61,2 +61,21 @@ const Sinon = require('sinon'); | ||
it('user seneca-promisify with message() and post', async (done) => { | ||
const server = new Hapi.Server(); | ||
await server.register({ plugin: Chairo }).catch((err) => { | ||
expect(err).to.not.exist(); | ||
}); | ||
let id = 0; | ||
server.seneca.message({ generate: 'id' }, async (message) => { | ||
return await { id: ++id }; | ||
}); | ||
const result = await server.seneca.post({ generate: 'id' }); | ||
expect(result).to.equal({ id: 1 }); | ||
}); | ||
it('uses passed in seneca instance if provided', async (done) => { | ||
@@ -516,3 +535,4 @@ | ||
return request.seneca.fixedargs.req$.url.path; | ||
expect(request.seneca.fixedargs.req$.url.pathname).to.exist(); | ||
return request.seneca.fixedargs.req$.url.pathname; | ||
}; | ||
@@ -519,0 +539,0 @@ |
Sorry, the diff of this file is not supported yet
43037
11
820
320
11
8
+ Added@hapi/boom@^9.1.x
+ Added@hapi/bounce@^2.x.x
+ Added@hapi/hoek@^9.1.x
+ Added@hapi/joi@^17.1.1
+ Addedseneca-promisify@^2.x.x
+ Addedtransform-hoek@0.0.1
+ Added@hapi/bounce@2.0.0(transitive)
+ Addedboom@7.3.0(transitive)
+ Addedjsonic@1.0.1(transitive)
+ Addedseneca-promisify@2.4.1(transitive)
+ Addedtransform-hoek@0.0.1(transitive)
- Removedboom@7.1.x
- Removedbounce@1.2.x
- Removedhoek@5.0.x
- Removedjoi@13.1.x
- Removedboom@7.1.1(transitive)
- Removedhoek@5.0.4(transitive)
- Removedjoi@13.1.2(transitive)
- Removedjsonic@0.3.1(transitive)
Updatedjsonic@1.x.x
Updatedseneca-as-promised@2.x.x