{"_id":"sails-hook-actions","_rev":"205233","name":"sails-hook-actions","description":"Allow Sails to load machines from an `api/actions` folder and load them using machine-as-action","dist-tags":{"latest":"1.1.1"},"maintainers":[{"name":"sgress454","email":"scott@balderdash.co"}],"time":{"modified":"2021-06-03T13:13:19.000Z","created":"2016-08-15T02:48:30.666Z","1.1.1":"2016-09-08T04:11:43.152Z","1.1.0":"2016-09-06T18:39:19.125Z","1.0.1":"2016-09-06T17:36:25.128Z","1.0.0":"2016-08-15T02:48:30.666Z"},"users":{},"author":{"name":"Scott Gress"},"repository":{"type":"git","url":"git://github.com/treelinehq/sails-hook-actions.git"},"versions":{"1.1.1":{"name":"sails-hook-actions","version":"1.1.1","description":"Allow Sails to load machines from an `api/actions` folder and load them using machine-as-action","main":"index.js","scripts":{"test":"mocha tests/** -t 10000 -R spec"},"author":{"name":"Scott Gress"},"license":"MIT","dependencies":{"lodash":"^3.10.1","machine-as-action":"^7.0.0","sails-build-dictionary":"^0.10.1","sails-util":"^0.11.0"},"devDependencies":{"mocha":"^3.0.2","sails":"github:balderdashy/sails#1.0"},"sails":{"isHook":true},"repository":{"type":"git","url":"git://github.com/treelinehq/sails-hook-actions.git"},"gitHead":"839fbcac9f7f90bbcd3d024629a8bdaa0d263106","bugs":{"url":"https://github.com/treelinehq/sails-hook-actions/issues"},"homepage":"https://github.com/treelinehq/sails-hook-actions#readme","_id":"sails-hook-actions@1.1.1","_shasum":"2ef318412168cc14e4bbd26273d1b9fe41e14f80","_from":".","_npmVersion":"2.15.8","_nodeVersion":"4.4.7","_npmUser":{"name":"sgress454","email":"sgress454@treeline.io"},"dist":{"shasum":"2ef318412168cc14e4bbd26273d1b9fe41e14f80","size":125027,"noattachment":false,"key":"/sails-hook-actions/-/sails-hook-actions-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/sails-hook-actions/download/sails-hook-actions-1.1.1.tgz"},"maintainers":[{"name":"sgress454","email":"scott@balderdash.co"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sails-hook-actions-1.1.1.tgz_1473307901110_0.21156650898046792"},"directories":{},"publish_time":1473307903152,"_cnpm_publish_time":1473307903152,"_hasShrinkwrap":false},"1.1.0":{"name":"sails-hook-actions","version":"1.1.0","description":"Allow Sails to load machines from an `api/actions` folder and load them using machine-as-action","main":"index.js","scripts":{"test":"mocha tests/** -t 10000 -R spec"},"author":{"name":"Scott Gress"},"license":"MIT","dependencies":{"lodash":"^3.10.1","machine-as-action":"^6.0.1","sails-build-dictionary":"^0.10.1","sails-util":"^0.11.0"},"devDependencies":{"mocha":"^3.0.2","sails":"github:balderdashy/sails#1.0"},"sails":{"isHook":true},"repository":{"type":"git","url":"git://github.com/treelinehq/sails-hook-actions.git"},"gitHead":"63d5c7e0ce11e3ec7c1a757cdb32c031cb0c9e90","bugs":{"url":"https://github.com/treelinehq/sails-hook-actions/issues"},"homepage":"https://github.com/treelinehq/sails-hook-actions#readme","_id":"sails-hook-actions@1.1.0","_shasum":"f69966625c7da21281d53477df3b8a1721f92a9f","_from":".","_npmVersion":"2.15.8","_nodeVersion":"4.4.7","_npmUser":{"name":"sgress454","email":"sgress454@treeline.io"},"dist":{"shasum":"f69966625c7da21281d53477df3b8a1721f92a9f","size":124833,"noattachment":false,"key":"/sails-hook-actions/-/sails-hook-actions-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/sails-hook-actions/download/sails-hook-actions-1.1.0.tgz"},"maintainers":[{"name":"sgress454","email":"scott@balderdash.co"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sails-hook-actions-1.1.0.tgz_1473187157286_0.4189076067414135"},"directories":{},"publish_time":1473187159125,"_cnpm_publish_time":1473187159125,"_hasShrinkwrap":false},"1.0.1":{"name":"sails-hook-actions","version":"1.0.1","description":"Allow Sails to load machines from an `api/actions` folder and load them using machine-as-action","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Scott Gress"},"license":"MIT","dependencies":{"lodash":"^3.10.1","machine-as-action":"^6.0.1","sails-build-dictionary":"^0.10.1","sails-util":"^0.11.0"},"sails":{"isHook":true,"hookName":"controllers"},"repository":{"type":"git","url":"git://github.com/treelinehq/sails-hook-actions.git"},"gitHead":"72eeddef48bf4548e885b8aa97505670a9031533","bugs":{"url":"https://github.com/treelinehq/sails-hook-actions/issues"},"homepage":"https://github.com/treelinehq/sails-hook-actions#readme","_id":"sails-hook-actions@1.0.1","_shasum":"76b2cb6dcadae9094584b57e17618cd62ab8852d","_from":".","_npmVersion":"2.15.8","_nodeVersion":"4.4.7","_npmUser":{"name":"sgress454","email":"sgress454@treeline.io"},"dist":{"shasum":"76b2cb6dcadae9094584b57e17618cd62ab8852d","size":10865,"noattachment":false,"key":"/sails-hook-actions/-/sails-hook-actions-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/sails-hook-actions/download/sails-hook-actions-1.0.1.tgz"},"maintainers":[{"name":"sgress454","email":"scott@balderdash.co"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/sails-hook-actions-1.0.1.tgz_1473183384164_0.6787884079385549"},"directories":{},"publish_time":1473183385128,"_cnpm_publish_time":1473183385128,"_hasShrinkwrap":false},"1.0.0":{"name":"sails-hook-actions","version":"1.0.0","description":"Allow Sails to load machines from an `api/actions` folder and load them using machine-as-action","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Scott Gress"},"license":"MIT","dependencies":{"lodash":"^3.10.1","machine-as-action":"^6.0.1","sails-build-dictionary":"^0.10.1","sails-util":"^0.11.0"},"sails":{"isHook":true,"hookName":"controllers"},"repository":{"type":"git","url":"git://github.com/treelinehq/sails-hook-actions.git"},"gitHead":"7a6e1ffc4d237768616fe70f306ae3cfc1938269","bugs":{"url":"https://github.com/treelinehq/sails-hook-actions/issues"},"homepage":"https://github.com/treelinehq/sails-hook-actions#readme","_id":"sails-hook-actions@1.0.0","_shasum":"404c2f425feaf9a9ba17222c97c0fea113ddd53f","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.2","_npmUser":{"name":"sgress454","email":"sgress454@treeline.io"},"dist":{"shasum":"404c2f425feaf9a9ba17222c97c0fea113ddd53f","size":6863,"noattachment":false,"key":"/sails-hook-actions/-/sails-hook-actions-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/sails-hook-actions/download/sails-hook-actions-1.0.0.tgz"},"maintainers":[{"name":"sgress454","email":"scott@balderdash.co"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sails-hook-actions-1.0.0.tgz_1471229308855_0.19169108476489782"},"directories":{},"publish_time":1471229310666,"_cnpm_publish_time":1471229310666,"_hasShrinkwrap":false}},"readme":"# sails-hook-actions\n\n[Sails JS](http://sailsjs.org) hook to load files from the `api/actions` folder and interpret them as machines compatible with [machine-as-action](https://github.com/treelinehq/machine-as-action).\n\nThis hook adds support for the `{action: 'some-action'}` route target syntax.  Traditional controller files (in `api/controllers`) and controller route target syntax are still supported.\n\n### Installation\n\n`npm install sails-hook-actions`\n\n### Usage\n*requires at least sails >= 0.12*\n\nCreate an `api/actions` folder, then add Javascript files (ending in `.js`) in that folder or in subfolders.  The files must be valid [node-machine](http://node-machine.org/) definitions, and may include the additional options described in the [machine actions](https://github.com/treelinehq/machine-as-action) docs (e.g. the `responseType` property for exits).\n\nTo point a route at an action, use the `{action: 'some-action-identity'}` syntax, for example:\n\n```\n'GET /hi': {action: 'say-hi'}\n'POST /user/go': {action: 'useractions/some-user-action'}\n```\n\nwhere the value of `action` is the identity of an action (i.e. its filepath relative to `api/actions`, lowercased and without the `.js` extension)\n","_attachments":{},"homepage":"https://github.com/treelinehq/sails-hook-actions#readme","bugs":{"url":"https://github.com/treelinehq/sails-hook-actions/issues"},"license":"MIT"}