Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hyped

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyped - npm Package Compare versions

Comparing version 0.1.0-4 to 0.1.0-5

3

CHANGELOG.md
## 0.1.0
### prerelease 5
Add `_resource` and `_action` fields to resources so that consumers can determine "friendly" names by which each resource was produced.
### prerelease 4

@@ -4,0 +7,0 @@ Bug fix - acions with conditions should always render during options.

@@ -1,7 +0,52 @@

var gulp = require( 'gulp' ),
mocha = require( 'gulp-mocha' );
var istanbul = require( 'gulp-istanbul' );
var gulp = require( 'gulp' );
var mocha = require( 'gulp-mocha' );
var open = require( 'open' ); //jshint ignore : line
function cover( done ) {
gulp.src( [ './src/**/*.js' ] )
.pipe( istanbul() )
.pipe( istanbul.hookRequire() )
.on( 'finish', function() {
done( runSpecs() );
} );
}
function runSpecs() { // jshint ignore : line
return gulp.src( [ './spec/*.spec.js' ], { read: false } )
.pipe( mocha( { reporter: 'spec' } ) );
}
function writeReport( cb, openBrowser, tests ) {
tests
.on( 'error', function() {
cb();
} )
.pipe( istanbul.writeReports() )
.on( 'end', function() {
if( openBrowser ) {
open( './coverage/lcov-report/index.html' );
}
cb();
} );
}
gulp.task( 'continuous-coverage', function( cb ) {
cover( writeReport.bind( undefined, cb, false ) );
} );
gulp.task( 'continuous-test', function() {
return runSpecs();
} );
gulp.task( 'coverage', function( cb ) {
cover( writeReport.bind( undefined, cb, true ) );
} );
gulp.task( 'coverage-watch', function() {
gulp.watch( [ './src/**/*', './spec/*.spec.js' ], [ 'continuous-coverage' ] );
} );
gulp.task( 'test', function() {
return gulp.src( [ './spec/**.spec.js' ], { read: false } )
.pipe( mocha( { reporter: 'spec' } ) )
return runSpecs()
.on( 'end', process.exit.bind( process, 0 ) )

@@ -11,12 +56,10 @@ .on( 'error', process.exit.bind( process, 1 ) );

gulp.task( 'continuous-test', function() {
return gulp.src( [ './spec/**.spec.js' ], { read: false } )
.pipe( mocha( { reporter: 'spec' } ) );
gulp.task( 'test-watch', function() {
gulp.watch( [ './src/**/*', './spec/*.spec.js' ], [ 'continuous-test' ] );
} );
gulp.task( 'watch', function() {
gulp.watch( [ './src/**', './spec/**' ], [ 'continuous-test' ] );
gulp.task( 'default', [ 'continuous-coverage', 'coverage-watch' ], function() {
} );
gulp.task( 'default', [ 'continuous-test', 'watch' ], function() {
gulp.task( 'specs', [ 'continuous-test', 'test-watch' ], function() {
} );

4

package.json
{
"name": "hyped",
"version": "0.1.0-4",
"version": "0.1.0-5",
"description": "Hypermedia response generation engine",

@@ -17,3 +17,5 @@ "main": "src/index.js",

"gulp": "^3.8.6",
"gulp-istanbul": "^0.5.0",
"gulp-mocha": "^0.5.2",
"open": "0.0.5",
"request": "^2.47.0",

@@ -20,0 +22,0 @@ "should": "^4.0.4",

@@ -218,2 +218,4 @@ ## hyped

_origin: { href: "", method: "" },
_resource: "thing",
_action: "self",
_links: {

@@ -468,2 +470,22 @@ self: { href: "/thing/100", method: "get" },

```javascript
{
"id": 1,
"_origin": { "href": "/item/1", "method": "GET" }
...
}
```
### Resource and Action
We also expose the resource and action name as part of each resource (including embedded resources).
```javascript
{
"id": 1,
"_origin": { "href": "/item/1", "method": "GET" }
"_resource": "item",
"_action": "self"
}
```
### Links

@@ -470,0 +492,0 @@

@@ -34,3 +34,5 @@ var should = require( "should" ); // jshint ignore: line

self: { href: "/board/100", method: "GET" }
}
},
_resource: "board",
_action: "self"
};

@@ -37,0 +39,0 @@

@@ -55,2 +55,4 @@ var should = require( "should" ); // jshint ignore: line

},
_resource: "board",
_action: "self",
_links: {

@@ -76,2 +78,4 @@ self: {

},
_resource: "lane",
_action: "self",
_links: {

@@ -97,2 +101,4 @@ self: {

},
_resource: "card",
_action: "self",
_links: {

@@ -122,2 +128,4 @@ self: {

},
_resource: "card",
_action: "self",
_links: {

@@ -147,2 +155,4 @@ self: {

},
_resource: "card",
_action: "self",
_links: {

@@ -175,2 +185,4 @@ self: {

},
_resource: "lane",
_action: "self",
_links: {

@@ -196,2 +208,4 @@ self: {

},
_resource: "card",
_action: "self",
_links: {

@@ -224,2 +238,4 @@ self: {

},
_resource: "lane",
_action: "self",
_links: {

@@ -245,2 +261,4 @@ self: {

},
_resource: "card",
_action: "self",
_links: {

@@ -270,2 +288,4 @@ self: {

},
_resource: "card",
_action: "self",
_links: {

@@ -407,2 +427,4 @@ self: {

},
_resource: "board",
_action: "self",
_links: {

@@ -428,2 +450,4 @@ self: {

},
_resource: "lane",
_action: "self",
_links: {

@@ -449,2 +473,4 @@ self: {

},
_resource: "card",
_action: "self",
_links: {

@@ -474,2 +500,4 @@ self: {

},
_resource: "card",
_action: "self",
_links: {

@@ -499,2 +527,4 @@ self: {

},
_resource: "card",
_action: "self",
_links: {

@@ -527,2 +557,4 @@ self: {

},
_resource: "lane",
_action: "self",
_links: {

@@ -548,2 +580,4 @@ self: {

},
_resource: "card",
_action: "self",
_links: {

@@ -576,2 +610,4 @@ self: {

},
_resource: "lane",
_action: "self",
_links: {

@@ -597,2 +633,4 @@ self: {

},
_resource: "card",
_action: "self",
_links: {

@@ -622,2 +660,4 @@ self: {

},
_resource: "card",
_action: "self",
_links: {

@@ -738,2 +778,4 @@ self: {

},
_resource: "lane",
_action: "self",
_links: {

@@ -759,2 +801,4 @@ self: {

},
_resource: "card",
_action: "self",
_links: {

@@ -802,2 +846,4 @@ self: {

_origin: { href: "/test/api/card/301", method: "GET" },
_resource: "card",
_action: "self",
_links: {

@@ -814,2 +860,4 @@ self: { href: "/test/api/card/301", method: "GET" },

_origin: { href: "/test/api/card/302", method: "GET" },
_resource: "card",
_action: "self",
_links: {

@@ -826,2 +874,4 @@ self: { href: "/test/api/card/302", method: "GET" },

_origin: { href: "/test/api/card/303", method: "GET" },
_resource: "card",
_action: "self",
_links: {

@@ -838,2 +888,4 @@ self: { href: "/test/api/card/303", method: "GET" },

_origin: { href: "/test/api/card/304", method: "GET" },
_resource: "card",
_action: "self",
_links: {

@@ -850,2 +902,4 @@ self: { href: "/test/api/card/304", method: "GET" },

_origin: { href: "/test/api/card/305", method: "GET" },
_resource: "card",
_action: "self",
_links: {

@@ -862,2 +916,4 @@ self: { href: "/test/api/card/305", method: "GET" },

_origin: { href: "/test/api/card/306", method: "GET" },
_resource: "card",
_action: "self",
_links: {

@@ -864,0 +920,0 @@ self: { href: "/test/api/card/306", method: "GET" },

@@ -40,2 +40,4 @@ var should = require( "should" ); // jshint ignore: line

_origin: { href: "/account/100100", method: "GET" },
_resource: "account",
_action: "self",
_links: {

@@ -51,2 +53,4 @@ self: { href: "/account/100100", method: "GET" },

_origin: { href: "/account/100100", method: "GET" },
_resource: "account",
_action: "self",
_links: {

@@ -63,2 +67,4 @@ self: { href: "/account/100100", method: "GET" },

_origin: { href: "/account/100100", method: "GET" },
_resource: "account",
_action: "self",
_links: {

@@ -65,0 +71,0 @@ self: { href: "/account/100100", method: "GET" },

@@ -28,2 +28,4 @@ var should = require( "should" ); // jshint ignore: line

_origin: { href: "/board/100", method: "GET" },
_resource: "board",
_action: "self",
_links: {

@@ -30,0 +32,0 @@ self: { href: "/board/100", method: "GET" }

@@ -11,2 +11,4 @@ var should = require( "should" ); // jshint ignore: line

_origin: { href: "/board/100", method: "GET" },
_resource: "board",
_action: "self",
_links: {

@@ -22,2 +24,4 @@ self: { href: "/board/100", method: "GET" },

_origin: { href: "/board/100/lane/200", method: "GET" },
_resource: "lane",
_action: "self",
_links: {

@@ -31,2 +35,4 @@ self: { href: "/board/100/lane/200", method: "GET" },

_origin: { href: "/card/301", method: "GET" },
_resource: "card",
_action: "self",
_links: {

@@ -40,2 +46,4 @@ self: { href: "/card/301", method: "GET" },

_origin: { href: "/card/302", method: "GET" },
_resource: "card",
_action: "self",
_links: {

@@ -49,2 +57,4 @@ self: { href: "/card/302", method: "GET" },

_origin: { href: "/card/303", method: "GET" },
_resource: "card",
_action: "self",
_links: {

@@ -62,2 +72,4 @@ self: { href: "/card/303", method: "GET" },

_origin: { href: "/board/100/lane/201", method: "GET" },
_resource: "lane",
_action: "self",
_links: {

@@ -71,2 +83,4 @@ self: { href: "/board/100/lane/201", method: "GET" },

_origin: { href: "/card/304", method: "GET" },
_resource: "card",
_action: "self",
_links: {

@@ -84,2 +98,4 @@ self: { href: "/card/304", method: "GET" },

_origin: { href: "/board/100/lane/202", method: "GET" },
_resource: "lane",
_action: "self",
_links: {

@@ -93,2 +109,4 @@ self: { href: "/board/100/lane/202", method: "GET" },

_origin: { href: "/card/305", method: "GET" },
_resource: "card",
_action: "self",
_links: {

@@ -102,2 +120,4 @@ self: { href: "/card/305", method: "GET" },

_origin: { href: "/card/306", method: "GET" },
_resource: "card",
_action: "self",
_links: {

@@ -104,0 +124,0 @@ self: { href: "/card/306", method: "GET" },

@@ -264,2 +264,4 @@ var should = require( "should" ); // jshint ignore: line

_origin: { href: "/parent/1", method: "GET" },
_resource: "parent",
_action: "self",
_links: {

@@ -305,2 +307,4 @@ self: { href: "/parent/1", method: "GET" },

_origin: { href: "/parent/1", method: "GET" },
_resource: "parent",
_action: "self",
_links: {

@@ -341,2 +345,4 @@ self: { href: "/parent/1", method: "GET" },

_origin: { href: "/test/api/parent/1/child/2", method: "GET" },
_resource: "child",
_action: "self",
_links: {

@@ -348,3 +354,5 @@ self: { href: "/test/api/parent/1/child/2", method: "GET" }

{ id: 1,
_origin: { href: "/test/api/parent/1/child/2/grand/1", method: "GET" },
_origin: { href: "/test/api/parent/1/child/2/grand/1", method: "GET" },
_resource: "grandChild",
_action: "self",
_links: {

@@ -356,3 +364,5 @@ self: { href: "/test/api/parent/1/child/2/grand/1", method: "GET" },

{ id: 2,
_origin: { href: "/test/api/parent/1/child/2/grand/2", method: "GET" },
_origin: { href: "/test/api/parent/1/child/2/grand/2", method: "GET" },
_resource: "grandChild",
_action: "self",
_links: {

@@ -365,2 +375,4 @@ self: { href: "/test/api/parent/1/child/2/grand/2", method: "GET" },

_origin: { href: "/test/api/parent/1/child/2/grand/3", method: "GET" },
_resource: "grandChild",
_action: "self",
_links: {

@@ -373,2 +385,4 @@ self: { href: "/test/api/parent/1/child/2/grand/3", method: "GET" },

_origin: { href: "/test/api/parent/1/child/2/grand/4", method: "GET" },
_resource: "grandChild",
_action: "self",
_links: {

@@ -381,2 +395,4 @@ self: { href: "/test/api/parent/1/child/2/grand/4", method: "GET" },

_origin: { href: "/test/api/parent/1/child/2/grand/5", method: "GET" },
_resource: "grandChild",
_action: "self",
_links: {

@@ -482,2 +498,4 @@ self: { href: "/test/api/parent/1/child/2/grand/5", method: "GET" },

_origin: { href: "/parent/1", method: "GET" },
_resource: "parent",
_action: "self",
_links: {

@@ -495,2 +513,4 @@ self: { href: "/parent/1", method: "GET" },

_origin: { href: "/parent/2", method: "GET" },
_resource: "parent",
_action: "self",
_links: {

@@ -547,2 +567,4 @@ self: { href: "/parent/2", method: "GET" },

description: "the first item",
_resource: "child",
_action: "self",
_origin: { href: "/parent/1/child/1", method: "GET" },

@@ -558,2 +580,4 @@ _links: {

description: "the second item",
_resource: "child",
_action: "self",
_origin: { href: "/parent/1/child/2", method: "GET" },

@@ -560,0 +584,0 @@ _links: {

@@ -38,2 +38,4 @@ var should = require( "should" ); // jshint ignore: line

_origin: { href: "/board/100", method: "GET" },
_resource: "board",
_action: "self",
_links: {

@@ -51,2 +53,4 @@ self: { href: "/board/100", method: "GET" },

_origin: { href: "/board/100", method: "GET" },
_resource: "board",
_action: "self",
_links: {

@@ -110,2 +114,4 @@ self: { href: "/board/100", method: "GET" },

_origin: { href: "/prefix/board/100", method: "GET" },
_resource: "board",
_action: "self",
_links: {

@@ -123,2 +129,4 @@ self: { href: "/prefix/board/100", method: "GET" },

_origin: { href: "/prefix/board/100", method: "GET" },
_resource: "board",
_action: "self",
_links: {

@@ -125,0 +133,0 @@ self: { href: "/prefix/board/100", method: "GET" },

@@ -428,2 +428,4 @@ var _ = require( "lodash" );

body._origin = origin;
body._resource = resourceName;
body._action = actionName;
var embedded = _.reduce( action.embed, function( eAcc, child, childName ) {

@@ -430,0 +432,0 @@ var childFn = cache[ child.resource ][ child.render ];

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc