{"_id":"@avimesa/examples-group-api-amqp","_rev":"4-a7fe07e43e2a04181188db52cc5e7219","name":"@avimesa/examples-group-api-amqp","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@avimesa/examples-group-api-amqp","version":"0.0.1","description":"Group API examples using AMQP (0-9-1) and Node.js","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Avimesa/examples-nodejs-group-api-amqp.git"},"author":{"name":"travimesa"},"license":"SEE LICENSE IN LICENSE","bugs":{"url":"https://github.com/Avimesa/examples-nodejs-group-api-amqp/issues"},"homepage":"https://github.com/Avimesa/examples-nodejs-group-api-amqp#readme","dependencies":{"@avimesa/group-api-amqp":"0.0.8","amqplib":"^0.5.3","dotenv":"^6.2.0"},"gitHead":"69a7bbb7d47c1f0347e00663ddb9261fccfaf730","_id":"@avimesa/examples-group-api-amqp@0.0.1","_npmVersion":"6.4.1","_nodeVersion":"8.2.1","_npmUser":{"name":"travimesa","email":"travis@avimesa.com"},"dist":{"integrity":"sha512-G87enNnwm19RAVk+qc8YMML/xVqWppgpo2VOkGLRaFb8FtKHeHHO3L1qgQPjg/lsfL22mhqXYbEH9dBtahbUeg==","shasum":"0ceaf64aa2d4981f60481b521b5387808ecf2b4a","tarball":"https://registry.npmjs.org/@avimesa/examples-group-api-amqp/-/examples-group-api-amqp-0.0.1.tgz","fileCount":22,"unpackedSize":59176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNRr6CRA9TVsSAnZWagAAFq4P/2dIu8SR/QSpfnR7n7m4\nbWm7oSTDqNry+Mi69ss9S3+41TGSIHvkM02GpSnCJKE8oIL7btyomsSCCU7p\nJVD2SYfCvlh+XJGyd8iiHSSh586UKTSEaTNwU+D7KqQCkZk0ccIiDODTU9tu\nrYVE0kt+Dz9tyvHoLGynbLsSqWe4OJNIp3eXyh3pZwDfphv/53mFGGJAKp4y\nHyPlrZ7R2YCvgCuRYiEV2aYQmxuru9Nj695wCgWUDhKkb8g2DoOJcZq9elFN\nf+awlwzslz6w2NkWG5MFYsHxF85bNOQjPIuzx5vaJx+lpB1Irab/hD/ZLo5r\ni7zRYW0+bLglpDNAwU+MGaUdSu1iNCtpBKdZioP8o5oLv4GEfMy93puQoLxD\nYVt/4lavRBPEoaKY+YvHCF2R1K85fVvRcV+Q2fqU0Qc/JRkd4uL2BP9onTCf\nLcPTxwvIFZx4kYbiqKjyvsyzMmMcHqgYW6gmQsQzAY65owIB44IaVEUbEj+r\nzX7ftS28FjAUOBbvmfrkvRt29pySjEMpubm2PVs06+5okJrV9Ux6TBSp9uPY\nwHZBtF8v3Our9UVhsr7pvCmZnRYFysSRgcrcOnkhgKHiVDd1wTr+x7FVDWey\no4KxPMZ/6QDcFe/SP7kyK/UQ1zPzYvDqGhtCX1pykDShA3ZsaHVhL6tzKBY/\n7kLu\r\n=uL8y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG9MnmtRI7dJNqda9S7MZCszf6kpl0NrHU5mRyYVg+SzAiEAx70qtq3+F9UwREaqTjM1VC2QlwDS45KAj5QNurW7Eao="}]},"maintainers":[{"name":"travimesa","email":"travis@avimesa.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/examples-group-api-amqp_0.0.1_1546984185354_0.5997720119881205"},"_hasShrinkwrap":false},"0.0.2":{"name":"@avimesa/examples-group-api-amqp","version":"0.0.2","description":"Group API examples using AMQP (0-9-1) and Node.js","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Avimesa/examples-nodejs-group-api-amqp.git"},"author":{"name":"travimesa"},"license":"SEE LICENSE IN LICENSE","bugs":{"url":"https://github.com/Avimesa/examples-nodejs-group-api-amqp/issues"},"homepage":"https://github.com/Avimesa/examples-nodejs-group-api-amqp#readme","dependencies":{"@avimesa/group-api-amqp":"0.0.8","amqplib":"^0.5.3","dotenv":"^6.2.0"},"gitHead":"396b86139e4b148f91c6ff4a21729f6a667303ed","_id":"@avimesa/examples-group-api-amqp@0.0.2","_npmVersion":"6.4.1","_nodeVersion":"8.2.1","_npmUser":{"name":"travimesa","email":"travis@avimesa.com"},"dist":{"integrity":"sha512-83+5Yx9Q9ofuJSl4y/EyLOTSvUQiQE3vi+C0NuZnDwXDNR6tOYzueQLSHQ4GVjHYpoxiElsh/fMhK5yLTca5rg==","shasum":"58d7cc937b7f53e5ee33b642907a933aa69f7eaf","tarball":"https://registry.npmjs.org/@avimesa/examples-group-api-amqp/-/examples-group-api-amqp-0.0.2.tgz","fileCount":22,"unpackedSize":59176,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcNRupCRA9TVsSAnZWagAAgdYQAI+2tmOo10QMIw8ExDLO\nyUK+FyVMQmVZvjjw+xchgI1djlCM9T0gvpo+PTAZdQqJgk1JfF8DOBo6JtFL\nmEzFYqoaKvy/ZiHarGqLvUVvAgyL5KtUtKUq8KtJPZntg6vyhMj8qj+7f4sK\n0cswRGsCnDh6lPi0hGO5G7B8BkOWW+l8CZercreD79yi0BI1aqfIl5uVKmKe\ni/cqNyHRR7EbMeIBav1Bd598rZfWBGz1Td2Xyrpu8Otzg8d8+1uNZ7qeWGmq\n2psztyssAkxCTe07LKGBpcajKPMETLItHOKdZ9V2bvJ0qWdz2jgrMdxGtgQr\nkmEJKxAake1KvOPpjQafqOtAXDjJ0iFNgfLG12dYzWamJwjONV+MZExkWF8Y\n2AY8nMRo7IVhJoopq1LT3WEmX/cmrRwyMSk17Gm5KX/O2Gy6k/7gCmALfwff\n59jHixFrH5tuKnwyb5XUxXPUYAuyJNOWTnanmF96QfYuzWlmmbp6DEt2acRI\nUiJkcCEuNrwit06N7XuXILvIFsCc+VdEPxl+STJs2ZG0C1kM4CezWqWipzac\nd28oiScrD/NINHfczabOCsF4Z+IsUb+fcY1XJ9BPKxT0VC5MISkVPJK7i9iL\nbm3PQiStp2uBbyAUgHQ67PBJN8xFk8FLFIHtb+G9pPte4XOXDXzA+fZaRlOo\nAaJD\r\n=k63j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGL5y5xJe32XFznJVj9gv7yTZKmzsgcFoi2cG2MbSMAyAiAVhnblvHhgZum0NKaUTb5EuSMKM4aQvC/W4ZobpPurhw=="}]},"maintainers":[{"name":"travimesa","email":"travis@avimesa.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/examples-group-api-amqp_0.0.2_1546984360316_0.19513330648055693"},"_hasShrinkwrap":false}},"time":{"created":"2019-01-08T21:49:45.354Z","0.0.1":"2019-01-08T21:49:45.438Z","modified":"2022-04-04T16:47:32.718Z","0.0.2":"2019-01-08T21:52:40.488Z"},"maintainers":[{"email":"collin@avimesa.com","name":"kulrathknight"}],"description":"Group API examples using AMQP (0-9-1) and Node.js","homepage":"https://github.com/Avimesa/examples-nodejs-group-api-amqp#readme","repository":{"type":"git","url":"git+https://github.com/Avimesa/examples-nodejs-group-api-amqp.git"},"author":{"name":"travimesa"},"bugs":{"url":"https://github.com/Avimesa/examples-nodejs-group-api-amqp/issues"},"license":"SEE LICENSE IN LICENSE","readme":"# Avimesa Group API Examples, Node.js and AMQP\nGroup API examples using Node.js abd AMQP (0-9-1)\n\n## Introduction\n\nThis project contains simple example of how to interface with the Avimesa Device Cloud's Group API using Node.js and AMQP.  Common tasks are captured in a simple example application to illustrate how one could go about interfacing withe system.\n\n\n<a id=\"toc\"></a>\n## Table of Contents\n- [1. Overview](#1.-overview)\n- [2. Prerequisites](#2.-prerequisites)\n- [3. Usage](#3.-usage)\n- [4. Examples](#4.-examples)\n    - [actuate-device](#4.1-examples)\n    - [list-devices](#4.3-examples)\n    - [list-files](#4.4-examples)\n    - [message-count](#4.5-examples)\n    - [queue-purge](#4.6-examples)\n    - [queue-subscriber](#4.7-examples)\n    - [queue-temp-subscriber](#4.8-examples)\n    - [upload-files](#4.9-examples)\n\n\n<a id=\"1.-overview\"></a>\n## 1. Overview\n\n[Top](#toc)<br>\n<a id=\"2.-prerequisites\"></a>\n## 2. Prerequisites\n\n- Node.js\n- A valid Avimesa Device Cloud Group ID and Authentication Key\n\n[Top](#toc)<br>\n<a id=\"3.-usage\"></a>\n## 3. Usage\n\nCheckout and initialize the project:\n\n```\ngit clone https://github.com/Avimesa/examples-nodejs-group-api-amqp.git\ncd examples-nodejs-group-api-amqp\nnpm init\n```\n\nUpdate the credentials in the .env file in the root of the project:\n\n```\n# RMQ Server Hostname\nRMQ_HOSTNAME=rmqserv001.avimesa.com\n\n# RMQ Server Port\nRMQ_PORT=5672\n\n# RMQ Group ID / Vhost\nRMQ_GROUP_ID= *<TODO>*\n\n# RMQ Authentication Key\nRMQ_AUTH_KEY= *<TODO>*\n\n# Set this to 0 to allow certless TLS\nNODE_TLS_REJECT_UNAUTHORIZED=0\n```\n\nRun the example from its directory, for example to run the `queue-subscriber` example, do ths following from the root of the project:\n\n```\nnode queue-subscriber/index.js\n```\n\n[Top](#toc)<br>\n<a id=\"4.-examples\"></a>\n## 4. Examples\n\n\n<a id=\"4.1-examples\"></a>\n### actuate-device\n\n##### Summary:\n\nDevice actuation occurs by sending a command to the Device.  Because the device may be offline, a queue for the Device is available to cache the message.  The Device's queue is automatically configured by the Avimesa Device Cloud upon addition of the Device to the Group. \n\nTo actuate a device, we send a JSON command to the `actuation.dx` exchange, and use a routing key that is the Device's ID (lower case, string based UUID, no hyphens).\n\nThis is all done for you by the `actuate` API, where you just pass in a Device ID and a JSON message. \n\n\n\n[Top](#toc)<br>\n<a id=\"4.2-examples\"></a>\n### add-device\n\n##### Summary:\n\nThis example shows how to add a Device to the Device Cloud.  The Device ID must be a 32 character string using a-f or 0-9 (i.e. base16 values for a UUID...).  It also must be unique in the Avimesa Device Cloud instance, so one could use a UUID generator to make the Device ID.\n\nIn response to a successful Device addition, you get a 32 character string (base16, UUID) authentication key.  \n\nThe combination of the Device ID and Authentication key can then be used by an Avimesa Device. \n\n\n\n\n\n[Top](#toc)<br>\n<a id=\"4.3-examples\"></a>\n### list-devices\n\n##### Summary:\n\nAn Avimesa Group contains Devices.  This example shows how to query for a list of devices.\n\n\n\n[Top](#toc)<br>\n<a id=\"4.4-examples\"></a>\n### list-files\n\n##### Summary:\n\nEach Device in the Avimesa Device Cloud has its own file system.  This will contain things like the device script, device config, DFU files, and any temporary files used by te script engine.\n\nThis example shows listing a devices files.\n\n\n\n[Top](#toc)<br>\n<a id=\"4.5-examples\"></a>\n### message-count\n\n##### Summary:\n\nSometimes you want to see if there are any messages in a queue.  This example shows you how to do that.\n\n\n\n\n\n[Top](#toc)<br>\n<a id=\"4.6-examples\"></a>\n### queue-purge\n\n##### Summary:\n\nIt's possible that you will want to empty a queue, for example a device's actuation queue to clear any pending commands.\n\nThis example shows how to purge a queue.\n\n\n\n\n\n\n[Top](#toc)<br>\n<a id=\"4.7-examples\"></a>\n### queue-subscriber\n\n##### Summary:\n\nThis example consumes data from a queue.  When using the `consume` API, it's assumed that the user of this API is in charge of moving data to permanent storage.  Upon first connection, all pending messages are available.  This allows an application to go offline and not worry about data loss.\n\n\n\n\n\n[Top](#toc)<br>\n<a id=\"4.8-examples\"></a>\n### queue-temp-subscriber\n\n##### Summary:\n\nSometimes you want to 'listen' to a queue for live data passing through it, but not necessarily be responsible for handling the datastore.\n\nThis example shows how to create a temporary queue that will get data from the source of your choice by setting up a routing key.\n\n\n\n\n\n[Top](#toc)<br>\n<a id=\"4.9-examples\"></a>\n### upload-files\n\n##### Summary:\n\nThis example shows how one can upload a Device Driver Script and Device Configuration. \n\n\n\n\n\n[Top](#toc)<br>\n## 4. Dependencies\n\n```\n@avimesa/group-api-amqp\namqplib\ndotenv\n```","readmeFilename":"README.md"}