{"_id":"jmf-subscription","_rev":"6-141bf04edeab6b86c794983c8ea5f6e7","name":"jmf-subscription","description":"JMF Server in Node that also handles subscriptions and interpreting of JDF/JMF messages.","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"jmf-subscription","version":"1.0.0","description":"If you want to get some information from your Indigo/DFE, you can always send it a JMF. But if you are actively monitoring the status of the device, you're better off with a JMF subscription which will notify an HTTP endpoint when something changes. Below","main":"./src/js/interface.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"bin":{"jmf-spy":"./src/js/interface.js"},"repository":{"type":"git","url":"git+https://github.com/dominickp/JMF-Subscription.git"},"author":"","license":"ISC","bugs":{"url":"https://github.com/dominickp/JMF-Subscription/issues"},"homepage":"https://github.com/dominickp/JMF-Subscription#readme","dependencies":{"codecov.io":"^0.1.6","fs-extra":"^0.26.3","gulp":"^3.9.0","jshint":"^2.8.0","nedb":"^1.5.0","pug":"^2.0.0-alpha7","request":"^2.67.0","winston":"^2.1.1","xml2js":"^0.4.15","yargs":"^3.31.0"},"devDependencies":{"gulp-jasmine":"^2.2.1","gulp-jshint":"^2.0.0","jasmine":"^2.4.1","jshint":"^2.9.1-rc2","jshint-stylish":"^2.1.0"},"gitHead":"a23344897111c3087ec63964c64a5128f88fe5c3","_id":"jmf-subscription@1.0.0","_shasum":"49ec86c2fe1bce9e92940639782a33b83a75455f","_from":".","_npmVersion":"3.9.0","_nodeVersion":"5.6.0","_npmUser":{"name":"dominickp","email":"peluso.dominick@gmail.com"},"dist":{"shasum":"49ec86c2fe1bce9e92940639782a33b83a75455f","tarball":"https://registry.npmjs.org/jmf-subscription/-/jmf-subscription-1.0.0.tgz","integrity":"sha512-ccSXBfGrevLTRiw26TTZFl9i0k+PtL9dPU/MSeYR84voWNV8xmSHWJ4OcjJz1hrzq37tzD4vZsBdchtwmav8ug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDguD8365V1upVy0aX1yMgeC/7r3CgO5Af9ByaCI3A7/gIgfQVLo4eLELSzkL52TeexBsG0CxoSYXuoJgXB200Yhek="}]},"maintainers":[{"name":"dominickp","email":"peluso.dominick@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/jmf-subscription-1.0.0.tgz_1463756948551_0.03414447442628443"}},"1.0.1":{"name":"jmf-subscription","version":"1.0.1","description":"If you want to get some information from your Indigo/DFE, you can always send it a JMF. But if you are actively monitoring the status of the device, you're better off with a JMF subscription which will notify an HTTP endpoint when something changes. Below","main":"./src/js/interface.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"bin":{"jmf-spy":"./src/js/interface.js"},"repository":{"type":"git","url":"git+https://github.com/dominickp/JMF-Subscription.git"},"author":"","license":"ISC","bugs":{"url":"https://github.com/dominickp/JMF-Subscription/issues"},"homepage":"https://github.com/dominickp/JMF-Subscription#readme","dependencies":{"codecov.io":"^0.1.6","fs-extra":"^0.26.3","gulp":"^3.9.0","jshint":"^2.8.0","nedb":"^1.5.0","pug":"^2.0.0-alpha7","request":"^2.67.0","winston":"^2.1.1","xml2js":"^0.4.15","yargs":"^3.31.0"},"devDependencies":{"gulp-jasmine":"^2.2.1","gulp-jshint":"^2.0.0","jasmine":"^2.4.1","jshint":"^2.9.1-rc2","jshint-stylish":"^2.1.0"},"gitHead":"915660455576261e41d06bb2a206005af384b006","_id":"jmf-subscription@1.0.1","_shasum":"2b40892e751c864cd988b1131cb5d0a41d421c59","_from":".","_npmVersion":"3.9.0","_nodeVersion":"5.6.0","_npmUser":{"name":"dominickp","email":"peluso.dominick@gmail.com"},"dist":{"shasum":"2b40892e751c864cd988b1131cb5d0a41d421c59","tarball":"https://registry.npmjs.org/jmf-subscription/-/jmf-subscription-1.0.1.tgz","integrity":"sha512-prjMVk3puLazv0oVOpL0sxXOnaCaK3Oxsl+i32WY8dMxdlWSZYuXNuor/K+6VirSm7VMLQTUdQASQTr+JTPIJw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH+489mp2giMFIgNfSCinka0P9od/sQ0znKd+roBI8dlAiAh02YX2fs5GWNevfH6n3Yx3MmARkZziyOYVNhYbvWF/w=="}]},"maintainers":[{"name":"dominickp","email":"peluso.dominick@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/jmf-subscription-1.0.1.tgz_1463759986842_0.1974661962594837"}},"1.0.3":{"name":"jmf-subscription","version":"1.0.3","description":"JMF Server in Node that also handles subscriptions and interpreting of JDF/JMF messages.","main":"./src/js/interface.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"bin":{"jmf-spy":"./src/js/interface.js"},"repository":{"type":"git","url":"git+https://github.com/dominickp/JMF-Subscription.git"},"author":{"name":"Dominick Peluso"},"license":"ISC","bugs":{"url":"https://github.com/dominickp/JMF-Subscription/issues"},"homepage":"https://github.com/dominickp/JMF-Subscription#readme","dependencies":{"codecov.io":"^0.1.6","fs-extra":"^0.26.3","gulp":"^3.9.0","jshint":"^2.8.0","nedb":"^1.5.0","pug":"^2.0.0-alpha7","request":"^2.67.0","winston":"^2.1.1","xml2js":"^0.4.15","yargs":"^3.31.0"},"devDependencies":{"gulp-jasmine":"^2.2.1","gulp-jshint":"^2.0.0","jasmine":"^2.4.1","jshint":"^2.9.1-rc2","jshint-stylish":"^2.1.0"},"keywords":["jmf","jdf","indigo","dfe","print"],"gitHead":"2fdc5603d57515662c151909ab425dc96228d0db","_id":"jmf-subscription@1.0.3","_shasum":"f0389112288177f9c1c7cceca6cea0ec2cd7bc53","_from":".","_npmVersion":"3.9.0","_nodeVersion":"5.6.0","_npmUser":{"name":"dominickp","email":"peluso.dominick@gmail.com"},"dist":{"shasum":"f0389112288177f9c1c7cceca6cea0ec2cd7bc53","tarball":"https://registry.npmjs.org/jmf-subscription/-/jmf-subscription-1.0.3.tgz","integrity":"sha512-TP5Ta99YtAFF28gVaDdYFi6orRnruPP2wPtlPRLto2YrYFpgeKlxBBkntYp98zjgRsS7eAJkyR9cnQyk4aE4aA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkpRLVfJCcGAqf/MGSsCmDhHRtWc2TsibRMzTCiRoKzgIgI35obx3JqVV40DoF1UU+wxzYhr08SHxnX/P4pYejnAg="}]},"maintainers":[{"name":"dominickp","email":"peluso.dominick@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/jmf-subscription-1.0.3.tgz_1463760626754_0.23789458954706788"}},"1.0.4":{"name":"jmf-subscription","version":"1.0.4","description":"JMF Server in Node that also handles subscriptions and interpreting of JDF/JMF messages.","main":"./src/js/interface.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"bin":{"jmf-spy":"./src/js/interface.js"},"repository":{"type":"git","url":"git+https://github.com/dominickp/JMF-Subscription.git"},"author":{"name":"Dominick Peluso"},"license":"ISC","bugs":{"url":"https://github.com/dominickp/JMF-Subscription/issues"},"homepage":"https://github.com/dominickp/JMF-Subscription#readme","dependencies":{"codecov.io":"^0.1.6","fs-extra":"^0.26.3","gulp":"^3.9.0","jshint":"^2.8.0","nedb":"^1.5.0","pug":"^2.0.0-alpha7","request":"^2.67.0","winston":"^2.1.1","xml2js":"^0.4.15","yargs":"^3.31.0"},"devDependencies":{"gulp-jasmine":"^2.2.1","gulp-jshint":"^2.0.0","jasmine":"^2.4.1","jshint":"^2.9.1-rc2","jshint-stylish":"^2.1.0"},"keywords":["jmf","jdf","indigo","dfe","print"],"gitHead":"e992448970f654eb181ed83647a034b2ae3903ca","_id":"jmf-subscription@1.0.4","_shasum":"ad64326f862dce190fe4d9ad2d9e9456cc1c8deb","_from":".","_npmVersion":"3.9.0","_nodeVersion":"5.6.0","_npmUser":{"name":"dominickp","email":"peluso.dominick@gmail.com"},"dist":{"shasum":"ad64326f862dce190fe4d9ad2d9e9456cc1c8deb","tarball":"https://registry.npmjs.org/jmf-subscription/-/jmf-subscription-1.0.4.tgz","integrity":"sha512-ErYIUIHA+e9Oal7Y4A+NBgBKZgUQu0jlpECpHjsjbk+fQR560WIBSVGlhQFNNrAqXw2jeXxxiIb6Nfvt5/meYg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHJIETjl3eAPUQuMa5iqZcAq+Y+VtUzO80xbzOLqh/EXAiEA04SQrTTiJRdCIHoMidzwj9xSjqjhAJ0jLplB2yQeLjE="}]},"maintainers":[{"name":"dominickp","email":"peluso.dominick@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/jmf-subscription-1.0.4.tgz_1463770415532_0.6509156904648989"}}},"readme":"# JMF-Subscription\nIf you want to get some information from your Indigo/DFE, you can always send it a JMF. But if you are actively monitoring the status of the device, you're better off with a JMF subscription which will notify an HTTP endpoint when something changes. Below you'll find an example on how to implement a basic JMF subscription endpoint using Node.\n\n## Usage\n\n```\nnpm install jmf-subscription -g\njmf-spy --action=[action]\n```\n\n## subscribe\nUse this script to search and subscribe to your JMF devices. Takes two arguments. '--idp' is the URL to your IDP worker (on your DFE) and should end with /jmf/. '--server' is the IP and port of your JMF server (see server.js).\n\n```\ndominick$ jmf-spy --action=subscribe --idp http://192.168.1.40:8080/dpp/jmf/ --server http://192.168.1.70:9090\ninfo: Found Device ID: 192.168.1.45\ninfo: Found Device ID: HP-Indigo-BUDPB\ninfo: 2 two presses found.\ninfo:  http=http://192.168.1.40:8080/dpp/jmf/192.168.1.45\ninfo:  http=http://192.168.1.40:8080/dpp/jmf/HP-Indigo-BUDPB\ninfo:  result=HP-Indigo-BUDPB subscribed successfully.\ninfo:  result=192.168.1.45 subscribed successfully.\n```\n\n## server\nThis simple server opens a port and listens for subscription events from the JMF devices. Takes one argument. '--port' is the port the server should listen on.\n\n```\ndominick$ jmf-spy --action=server --port=9090\nServer listening on: http://localhost:9090\ninfo:  DeviceID=HP-Indigo-BUDPB, DeviceStatus=Running, StatusDetails=Indigo: Printing, ProductionCounter=49942091\ninfo:  DeviceID=HP-Indigo-BUDPB, DeviceStatus=Running, StatusDetails=Indigo: Printing, ProductionCounter=49942098\ninfo:  DeviceID=HP-Indigo-BUDPB, DeviceStatus=Running, StatusDetails=Indigo: Printing, ProductionCounter=49942109\ninfo:  DeviceID=HP-Indigo-BUDPB, DeviceStatus=Idle, StatusDetails=Indigo: Ready, ProductionCounter=49942109\ninfo:  DeviceID=192.168.1.45, DeviceStatus=Idle, StatusDetails=Indigo: Ready, ProductionCounter=35089299\ninfo:  DeviceID=192.168.1.45, DeviceStatus=Running, StatusDetails=Indigo: Printing, ProductionCounter=35089299\n\n```\nThe server also saves the JMF details in a simple nebd database. You can use pm2 to start the server on boot:\n```\npm2 start /var/node/JMF-Subscription/src/js/interface.js -- --action server --port 9090\npm2 save\n```\n\n## interpreter\nThis script reads the JMF updates from the server above from the database and converts them to usable time ranges that can be reported upon. It also posts those ranges in a JSON request to another endpoint and if successful, deletes them from the local data store. It will always leave the last update so the next range has something to start with. Takes one argument. '--range-endpoint' is the URI of the endpoint that accepts the ranges.\n\n```\ndominick$ node jmf-spy --action=interpreter --range-endpoint=http://insight.dev/switch-api/jmf-spy/add-ranges\n[ '192.168.1.45': 1, 'HP-Indigo-BUDPB': 1 ]\ninfo:  press=192.168.1.45, updates=563, ranges=178, totalRemoved=561\ninfo:  press=HP-Indigo-BUDPB, updates=276, ranges=165, totalRemoved=275\n\n```\n\nHere is an example HTTP request the interpreter would send to the range-endpoint:\n\n```\n{\"ranges\":[ \n    \n    { \"statusDetails\": \"Indigo: Ready\",\n    \"elapsedClicks\": 0,\n    \"diffMs\": 60000,\n    \"start\": 1452006000000,\n    \"end\": 1452006060000,\n    \"press\": \"HP-Indigo-BUDPB\" }\n    ]\n}\n```\n\nYou'll want to run the interpreter in an interval using something like cron, like so:\n\n```\n*/30 * * * * node /var/node/JMF-Subscription/src/js/interface.js --action=interpreter --range-endpoint=http://insight.dev/switch-api/jmf-spy/add-ranges >/dev/null 2>&1\n```\n\n## Reporting Example\nHere are some example reports you can use this data for. You'll have to put these together yourself.\n\n![Hours printing per day](https://i.imgur.com/38bRPFB.png)\n<img src=\"https://i.imgur.com/Tj8OAvB.png\" height=\"300\">\n<img src=\"https://i.imgur.com/2bZAJDD.png\" height=\"300\">\n\n## Info\nFor more information, see this post for now: http://forum.enfocus.com/viewtopic.php?f=13&t=761\n\n## Todo\n- Cancel subscriptions\n- Different type of subscriptions (QueueStatus)\n","maintainers":[{"name":"dominickp","email":"peluso.dominick@gmail.com"}],"time":{"modified":"2022-06-19T04:36:15.969Z","created":"2016-05-20T15:09:11.951Z","1.0.0":"2016-05-20T15:09:11.951Z","1.0.1":"2016-05-20T15:59:50.277Z","1.0.3":"2016-05-20T16:10:29.282Z","1.0.4":"2016-05-20T18:53:36.502Z"},"homepage":"https://github.com/dominickp/JMF-Subscription#readme","repository":{"type":"git","url":"git+https://github.com/dominickp/JMF-Subscription.git"},"bugs":{"url":"https://github.com/dominickp/JMF-Subscription/issues"},"license":"ISC","readmeFilename":"README.md","keywords":["jmf","jdf","indigo","dfe","print"],"author":{"name":"Dominick Peluso"}}