{"_id":"@matteo.collina/assets-pg","_rev":"12153926","name":"@matteo.collina/assets-pg","description":"Manage Assets as a module, with node and postgres","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"time":{"modified":"2017-12-03T11:17:25.000Z","created":"2015-06-30T08:57:01.199Z","4.0.0":"2017-12-03T11:17:17.096Z","3.0.0":"2017-02-02T09:06:32.307Z","1.2.0":"2016-09-27T14:08:58.050Z","2.0.0":"2016-06-05T15:34:31.175Z","1.1.1":"2015-06-30T10:34:27.934Z","1.1.0":"2015-06-30T09:59:04.047Z","1.0.0":"2015-06-30T08:57:01.199Z"},"users":{},"author":{"name":"Matteo Collina","email":"hello@matteocollina.com"},"repository":{"type":"git","url":"git+https://github.com/mcollina/assets-pg.git"},"versions":{"4.0.0":{"name":"@matteo.collina/assets-pg","version":"4.0.0","description":"Manage Assets as a module, with node and postgres","main":"assets.js","scripts":{"lint":"standard","test":"tap test.js","coverage":"tap --cov test.js"},"precommit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/mcollina/assets-pg.git"},"keywords":["asset","manage"],"author":{"name":"Matteo Collina","email":"hello@matteocollina.com"},"license":"MIT","bugs":{"url":"https://github.com/mcollina/assets-pg/issues"},"homepage":"https://github.com/mcollina/assets-pg#readme","devDependencies":{"pre-commit":"^1.1.3","standard":"^10.0.0","tap":"^10.7.3"},"dependencies":{"ajv":"^5.3.0","http-errors":"^1.6.2","with-conn-pg":"^2.1.0"},"gitHead":"f968f8a3216f8fd2088670a829c919c601eb996c","_id":"@matteo.collina/assets-pg@4.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"dist":{"shasum":"149b1882a268f91aed21652c3187d2785a977803","size":3981,"noattachment":false,"tarball":"https://registry.npm.taobao.org/@matteo.collina/assets-pg/download/@matteo.collina/assets-pg-4.0.0.tgz"},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/assets-pg-4.0.0.tgz_1512299836171_0.39246982824988663"},"directories":{},"publish_time":1512299837096,"_hasShrinkwrap":false,"_cnpm_publish_time":1512299837096},"3.0.0":{"name":"@matteo.collina/assets-pg","version":"3.0.0","description":"Manage Assets as a module, with node and postgres","main":"assets.js","scripts":{"lint":"standard","test":"tape test.js | faucet"},"precommit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/mcollina/assets-pg.git"},"keywords":["asset","manage"],"author":{"name":"Matteo Collina","email":"hello@matteocollina.com"},"license":"MIT","bugs":{"url":"https://github.com/mcollina/assets-pg/issues"},"homepage":"https://github.com/mcollina/assets-pg#readme","devDependencies":{"faucet":"0.0.1","pre-commit":"^1.1.3","standard":"^8.6.0","tape":"^4.6.0"},"dependencies":{"boom":"^4.1.0","joi":"^10.2.0","with-conn-pg":"^2.0.0"},"gitHead":"bdcdfd36c369faa1fc8211d4215760deccfc6de2","_id":"@matteo.collina/assets-pg@3.0.0","_shasum":"6b3b0e96fddfb5577af1faf9fe9ebbeb37fe869d","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.4","_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"dist":{"shasum":"6b3b0e96fddfb5577af1faf9fe9ebbeb37fe869d","size":4232,"noattachment":false,"tarball":"https://registry.npm.taobao.org/@matteo.collina/assets-pg/download/@matteo.collina/assets-pg-3.0.0.tgz"},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/assets-pg-3.0.0.tgz_1486026391721_0.1355326019693166"},"directories":{},"publish_time":1486026392307,"_cnpm_publish_time":1486026392307,"_hasShrinkwrap":false},"1.2.0":{"name":"@matteo.collina/assets-pg","version":"1.2.0","description":"Manage Assets as a module, with node and postgres","main":"assets.js","scripts":{"lint":"standard","test":"tape test.js | faucet"},"precommit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/mcollina/assets-pg.git"},"keywords":["asset","manage"],"author":{"name":"Matteo Collina","email":"hello@matteocollina.com"},"license":"MIT","bugs":{"url":"https://github.com/mcollina/assets-pg/issues"},"homepage":"https://github.com/mcollina/assets-pg#readme","devDependencies":{"faucet":"0.0.1","pre-commit":"^1.1.3","standard":"^7.1.0","tape":"^4.6.0"},"dependencies":{"boom":"^4.1.0","joi":"^9.0.4","with-conn-pg":"^1.0.0"},"gitHead":"1d3cc57c45f54e7d866adb35d1b51985f6fcf50b","_id":"@matteo.collina/assets-pg@1.2.0","_shasum":"52f0fcbd9eb71261f8cfc81a041fc0dc02d9c8c0","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"dist":{"shasum":"52f0fcbd9eb71261f8cfc81a041fc0dc02d9c8c0","size":4015,"noattachment":false,"tarball":"https://registry.npm.taobao.org/@matteo.collina/assets-pg/download/@matteo.collina/assets-pg-1.2.0.tgz"},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/assets-pg-1.2.0.tgz_1474985336586_0.4702599933370948"},"directories":{},"publish_time":1474985338050,"_cnpm_publish_time":1474985338050,"_hasShrinkwrap":false},"2.0.0":{"name":"@matteo.collina/assets-pg","version":"2.0.0","description":"Manage Assets as a module, with node and postgres","main":"assets.js","scripts":{"lint":"standard","test":"tape test.js | faucet"},"precommit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/mcollina/assets-pg.git"},"keywords":["asset","manage"],"author":{"name":"Matteo Collina","email":"hello@matteocollina.com"},"license":"MIT","bugs":{"url":"https://github.com/mcollina/assets-pg/issues"},"homepage":"https://github.com/mcollina/assets-pg#readme","devDependencies":{"faucet":"0.0.1","pre-commit":"^1.1.3","standard":"^7.1.0","tape":"^4.5.1"},"dependencies":{"boom":"^3.2.1","joi":"^8.4.1","with-conn-pg":"^1.0.0"},"gitHead":"432ba622b712ccc467799d97b5b2a11fa9180b83","_id":"@matteo.collina/assets-pg@2.0.0","_shasum":"0e84dd0faa3b85500a6056b9e0540e28725939e5","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"dist":{"shasum":"0e84dd0faa3b85500a6056b9e0540e28725939e5","size":4013,"noattachment":false,"tarball":"https://registry.npm.taobao.org/@matteo.collina/assets-pg/download/@matteo.collina/assets-pg-2.0.0.tgz"},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/assets-pg-2.0.0.tgz_1465140869613_0.7343079845886678"},"directories":{},"publish_time":1465140871175,"_cnpm_publish_time":1465140871175,"_hasShrinkwrap":false},"1.1.1":{"name":"@matteo.collina/assets-pg","version":"1.1.1","description":"Manage Assets as a module, with node and postgres","main":"assets.js","scripts":{"lint":"standard","test":"tape test.js | faucet"},"precommit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/mcollina/assets-pg.git"},"keywords":["asset","manage"],"author":{"name":"Matteo Collina","email":"hello@matteocollina.com"},"license":"MIT","bugs":{"url":"https://github.com/mcollina/assets-pg/issues"},"homepage":"https://github.com/mcollina/assets-pg#readme","devDependencies":{"faucet":"0.0.1","pre-commit":"^1.0.10","standard":"^4.3.3","tape":"^4.0.0"},"dependencies":{"boom":"^2.8.0","joi":"^6.5.0","with-conn-pg":"^1.0.0"},"gitHead":"dc13bfc44ace50379a27ebecca31058e6033adca","_id":"@matteo.collina/assets-pg@1.1.1","_shasum":"98b555e6270d7517f6da00f2429742f533072afa","_from":".","_npmVersion":"2.11.1","_nodeVersion":"2.3.0","_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"dist":{"shasum":"98b555e6270d7517f6da00f2429742f533072afa","size":4044,"noattachment":false,"tarball":"https://registry.npm.taobao.org/@matteo.collina/assets-pg/download/@matteo.collina/assets-pg-1.1.1.tgz"},"directories":{},"publish_time":1435660467934,"_cnpm_publish_time":1435660467934,"_hasShrinkwrap":false},"1.1.0":{"name":"@matteo.collina/assets-pg","version":"1.1.0","description":"Manage Assets as a module, with node and postgres","main":"assets.js","scripts":{"lint":"standard","test":"tape test.js | faucet"},"precommit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/mcollina/asset-service-pg.git"},"keywords":["asset","manage"],"author":{"name":"Matteo Collina","email":"hello@matteocollina.com"},"license":"MIT","bugs":{"url":"https://github.com/mcollina/asset-service-pg/issues"},"homepage":"https://github.com/mcollina/asset-service-pg#readme","devDependencies":{"faucet":"0.0.1","pre-commit":"^1.0.10","standard":"^4.3.3","tape":"^4.0.0"},"dependencies":{"boom":"^2.8.0","joi":"^6.5.0","with-conn-pg":"^1.0.0"},"gitHead":"ad5db83051ab880b9799262f585342795771c71b","_id":"@matteo.collina/assets-pg@1.1.0","_shasum":"7052d2835753b8961e4932c6096cff07963f6353","_from":".","_npmVersion":"2.11.1","_nodeVersion":"2.3.0","_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"dist":{"shasum":"7052d2835753b8961e4932c6096cff07963f6353","size":4053,"noattachment":false,"tarball":"https://registry.npm.taobao.org/@matteo.collina/assets-pg/download/@matteo.collina/assets-pg-1.1.0.tgz"},"directories":{},"publish_time":1435658344047,"_cnpm_publish_time":1435658344047,"_hasShrinkwrap":false},"1.0.0":{"name":"@matteo.collina/assets-pg","version":"1.0.0","description":"Manage Assets as a module, with node and postgres","main":"assets.js","scripts":{"lint":"standard","test":"tape test.js | faucet"},"precommit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/mcollina/asset-service-pg.git"},"keywords":["asset","manage"],"author":{"name":"Matteo Collina","email":"hello@matteocollina.com"},"license":"MIT","bugs":{"url":"https://github.com/mcollina/asset-service-pg/issues"},"homepage":"https://github.com/mcollina/asset-service-pg#readme","devDependencies":{"faucet":"0.0.1","pre-commit":"^1.0.10","standard":"^4.3.3","tape":"^4.0.0"},"dependencies":{"boom":"^2.8.0","fastfall":"^1.2.3","joi":"^6.5.0","pg":"^4.4.0"},"gitHead":"169cd827ce2da890da2b6828ab65cda63fc6b3a4","_id":"@matteo.collina/assets-pg@1.0.0","_shasum":"080c0ab0a43b79bf0e2b96d3e8f0aba31d4563a4","_from":".","_npmVersion":"2.11.1","_nodeVersion":"2.3.0","_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"dist":{"shasum":"080c0ab0a43b79bf0e2b96d3e8f0aba31d4563a4","size":4271,"noattachment":false,"tarball":"https://registry.npm.taobao.org/@matteo.collina/assets-pg/download/@matteo.collina/assets-pg-1.0.0.tgz"},"directories":{},"publish_time":1435654621199,"_cnpm_publish_time":1435654621199,"_hasShrinkwrap":false}},"readme":"# assets-pg\n\nManage Assets, with node and postgres\n\nAn asset can be in three states: `'wait'`, `'operational'` and\n`'error'`.\n\n## Install\n\n```\nnpm install @matteo.collina/assets-pg --save\n```\n\n\n## API\n\n * buildAssets()\n * assets.put()\n * assets.get()\n * assets.createSchema()\n * assets.dropSchema()\n\n-------------------------------------------------------\n\n\n### buildAssets(connectionString)\n\nThe factory for the assets module, you can just pass through a\n[pg](http:/npm.im/pg) connection string.\n\nExample:\n\n```js\nvar connString = 'postgres://localhost/assets_tests'\nvar assets = require('@matteo.collina/assets-pg')(connString)\n```\n\n-------------------------------------------------------\n\n\n### assets.put(object, callback(err, asset))\n\nAdds or updates an asset. An asset can have three properties:\n\n1. the `'id'`, which needs to be set only for existing assets\n2. the `'name'`\n3. the `'status'`, which can be any of\n `'wait'`, `'operational'` and `'error'`.\n\nValidation is provided by [ajv](http://npm.im/ajv), and a `new\ncreateError.UnprocessableEntity()` (from [http-errors](https://www.npmjs.com/package/http-errors))\nwith the ajv errors attached to the `details`.\n\nThe returned asset includes the `id`, if missing.\n\n-------------------------------------------------------\n\n\n### assets.get(id, callback(err, asset))\n\nFetches an assets, returns a\n`new createError.NotFound()` (from [http-errors](https://www.npmjs.com/package/http-errors))\nif not present.\n\n-------------------------------------------------------\n\n\n### assets.createSchema(callback(err))\n\nCreate the schema in PostgreSQL for this module.\n\n-------------------------------------------------------\n\n\n### assets.dropSchema(callback(err))\n\nDrop the schema in PostgreSQL for this module.\n\n-------------------------------------------------------\n\n\n### assets.end()\n\nEnds the PG connection pool.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/mcollina/assets-pg#readme","bugs":{"url":"https://github.com/mcollina/assets-pg/issues"},"license":"MIT"}