{"_id":"azure-iotcentral-device-client","_rev":"39-503845d3d30bddcc39073230d970d756","name":"azure-iotcentral-device-client","dist-tags":{"latest":"2.0.1","beta":"2.0.1-beta.1","pnp-preview":"1.3.0-preview.5","prerelease":"2.0.0"},"versions":{"1.0.0":{"name":"azure-iotcentral-device-client","version":"1.0.0","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.8.2","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.4.1","azure-iot-provisioning-device-http":"^1.4.1","azure-iot-provisioning-device-mqtt":"^1.4.2","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","mqtt":"^2.18.8","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"308c947ae977c7242f56435ac008164ff108ecf8","_id":"azure-iotcentral-device-client@1.0.0","_npmVersion":"6.5.0","_nodeVersion":"8.4.0","_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"dist":{"integrity":"sha512-A64QrxYtkpqpNuoacJOQH9Rwr5M18/guWASQiiHt66hwFfGEHEsJ3dY7AZyO1pQO8L8NGEZmHQyPAWYpcTMlkA==","shasum":"177f87529ff88500576d907ea0065d9ac307ac5e","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.0.0.tgz","fileCount":15,"unpackedSize":49886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcStGSCRA9TVsSAnZWagAAZB0P/3sOOvVnzzUpI60kzdvs\nsPj9TV0nQiDQkyvD9FJGgAZ0xOBqa8gGwSHkKs4xcuWJwJAJEK/ZNuPnyXKN\nRehX5oNkYnIWVKXH38pT7omjKt0qmtwrJFogZXNukwonsJ9kBmOSo46/qcZq\nmb7uwWCGxPkBs4bUsgtRrGE70HLVt8LANBqpBxz6SI/5rWiWtOtrUvRg2KNT\n8RdxEgsOu0zARDK4QtFy0t5PQqKZx1n5Em+TmssJ9YfXVP5ShTSwqJJjd4Vj\n0Acmbxc6may99cHwo6iujmxK0VEmjKHgo4n6ofasawZbA5YcPy1TTXvhCT2f\n7UYNjE80DTIfaER2xIekRAHv3tiT/8IqWbUbuWQCtxSVTFZzO0FxXZTWBjQe\nq82vPsFg+rw4Q+71gwOIOeSzvFUUYEEwQyK/Li/Tchsyp2iAMA9pMjvgv8MH\n1xdg7NZES5X2y9dd2ID4jTJ2hVcaOWOm4GHlWxYwl8nWYAoML2QkPWgwYalb\nbikdWCcv5aH6EeAe1GsY88bz4JYFX7eB4W9Zr3/7wcmVZ4p6yE+ldttrrniU\nlJkXsMFfxQnWmatpsRto/vm8RHZPaSXxRXnF45tZMV6F6VqAfgPTh/Eu6aA2\nrRhUtuuJB5fuOiq0PxgRXR32ge0I2tH9fjG80rf8a3cnh+3eDUsWInGLd5pD\n28MC\r\n=+3Cd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGqkAwgeoW8cvFQjzb22hkL6uQy+93XTucM0EbRyKViQIgTL4rHPQqonTYcCAc0M6cMgINdOKadBONfCd3fF1paQI="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.0.0_1548407185662_0.9653574515321961"},"_hasShrinkwrap":false},"1.0.1-0":{"name":"azure-iotcentral-device-client","version":"1.0.1-0","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","scripts":{"build":"tsc"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.8.2","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.4.1","azure-iot-provisioning-device-http":"^1.4.1","azure-iot-provisioning-device-mqtt":"^1.4.2","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","mqtt":"^2.18.8","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"readme":"# Microsoft Azure IoTCentral SDK for Node.js\r\n\r\n## Prerequisites\r\n+ Node.js version 8.x or higher - https://nodejs.org\r\n\r\n## Installing `azure-iotcentral` and types\r\n\r\n```\r\nnpm install azure-iotcentral\r\n```\r\n## Samples\r\n\r\nWhen connecting a device to an IoT Central application an IoTCClient is initialized.\r\nSDK supports X509 and SymmetricKey authentication;\r\n\r\nX509\r\n```\r\nconst iotCentral = require('azure-iotcentral');\r\n\r\nconst scopeId = '';\r\nconst deviceId = '';\r\nconst passphrase = ''; //optional\r\nconst cert = {\r\n    cert: \"public cert\"\r\n    key: \"private key\",\r\n    passphrase: \"passphrase\"\r\n}\r\n\r\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'X509_CERT', cert);\r\n```\r\nSAS\r\n```\r\nconst iotCentral = require('azure-iotcentral');\r\n\r\nconst scopeId = 'scopeID';\r\nconst deviceId = 'deviceID';\r\nconst sasKey = 'masterKey';\r\n\r\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'symm_key', sasKey);\r\n```\r\n### Connect\r\nUsing callback\r\n```\r\niotc.connect(callback)\r\n```\r\nUsing promises\r\n```\r\niotc.connect().then(()=>{\r\n    console.log('Connected\");\r\n})\r\n```\r\nAfter successfull connection, IOTC context is available for further commands.\r\n\r\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\r\n\r\n### Send telemetry\r\n\r\nSend telemetry every 3 seconds\r\n```\r\nsetInterval(() => {\r\n            iotc.sendTelemetry({\r\n                field1: value1,\r\n                field2: value2,\r\n                field3: value3\r\n            }, sendCallback)\r\n```\r\n### Send state update\r\n```\r\niotc.sendState({fieldName:'fieldValue'},sendCallback);\r\n```\r\n### Send property update\r\n```\r\niotc.sendProperty({fieldName:'fieldValue'},sendCallback);\r\n```\r\n### Send event\r\n```\r\niotc.sendEvent(event,sendCallback);\r\n```\r\n### Listen to settings update\r\n\r\nListen to all settings changes\r\n```\r\niotc.on('SettingsUpdated',callback);\r\n```\r\nListen to specific setting\r\n```\r\niotc.on('SettingsUpdated.<SETTING_NAME>',callback);\r\n```\r\n\r\n### Listen to commands\r\n```\r\niotc.on('Command',callback);\r\n```\r\nTo provide feedbacks for the command like execution result or progress, the client can send back a property with the same name of the executing command.\r\n```\r\niotc.on('Command', (cmd) => {\r\n    // send execution start feedback\r\n    iotc.sendProperty({\r\n                [cmd.commandName]: { \r\n                    value: 'Command execution started at ' + new Date().toISOString(),\r\n                    requestId:cmd.requestId\r\n                    }\r\n            }, sendCallback);\r\n        });\r\n```\r\n\r\n## Generate x509 certificates\r\nIoT Central SDK comes with a tool to generate self-signed x509 certificates to be used when testing device connection.\r\nIf you want to generate certificates for 6 devices and also validate the authority you can run something like this:\r\n```\r\nconst IoTCentral = require('azure-iotcentral');\r\nconst readline = require('readline');\r\n\r\nconst certificateGenerator = new IoTCentral.CertificateGenerator(6);\r\ncertificateGenerator.init()\r\n    .then(() => {\r\n        console.log('Generating root certificate');\r\n        certificateGenerator.generateRoot.bind(certificateGenerator)()\r\n            .then(() => {\r\n                console.log('Generating device certificates');\r\n                certificateGenerator.createDevices.bind(certificateGenerator)()\r\n                    .then(() => {\r\n                        const rl = readline.createInterface({\r\n                            input: process.stdin,\r\n                            output: process.stdout\r\n                        });\r\n                        rl.question('Insert validation code: ', async (answer) => {\r\n                            const validationCert = await certificateGenerator.validate.bind(certificateGenerator)(answer);\r\n                            console.log(`Validation certificate create at '${validationCert}'`);\r\n                            rl.close()\r\n                        });\r\n                    })\r\n            })\r\n    });\r\n```\r\nThis example wait for a validation code which is provided by IoTCentral in the device configuration page when uploading primary or secondary root certificate.\r\nResulting device certificates can be used in connection example above.\r\n\r\n","readmeFilename":"README.md","gitHead":"4ad637438ef8277e8f85c9e4990c5f92e957a3dc","_id":"azure-iotcentral-device-client@1.0.1-0","_npmVersion":"6.5.0","_nodeVersion":"8.4.0","_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"dist":{"integrity":"sha512-3/ntZ0k0stI3YWxWAxOOzOo5Nj6GMRjIXwHDIVll7pb9nXAniQhmV+mfTO1Lvate8qHYqWHVifAZ8YFiNOAL1A==","shasum":"89656909b0fcf274bce875bc074312ced47bf2bf","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.0.1-0.tgz","fileCount":15,"unpackedSize":49930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcStcDCRA9TVsSAnZWagAAbjIQAJZ+J7mDPFpaYiaRikZc\nxYi1shC0vz0VBgaHXQ0oqQE0QqJYG5P3oUrMEvOtuhlB6jQ1G+tFThriDvjX\nWUaVwPgS+e5unPHjN7feoRt50jJvQGOa+9zf+tupLffRch0jGIwfC71ewKUN\nbaa1y+d4RjHek+AUAWTnN7/CLZhBl3xNvACliLVYACbqtIZYcLhpXNC2bdCH\n+Z+Pthsl+FLZO+7cJ51kZkW92VIb0ySfSBAfvsTgxxAjI3VH664l+MnBoRtl\nCOchzxbEUNZgNEIBT612nLAeFII5XmK+avwtsikvHDQv+GZ2kr4uWBp9R3YP\ngm0f0EAD28PJHa1oRgWYu9KoBkTPucMISq5lGM4ThzyD4vn+vueIGs/fiA9C\nsS6kAitQ0fTfwOQQ6kXKNQKmHJQApHUkL/NICqXZckh0C24qYoxW5Hmkv0Ew\nAP1newDJyHeJYAoCc2jAtm6xWGgyFLQauPuOfii5DaNzeG4sVTK3epDLmWL/\nFrg6fAanq6XFdaKJlT/9k3Qq0uvuP+yKx10FyUQShXlLUNgHx5FImRJJPftD\nYjA7zIv0S+HO8PClCQFbTv9QQi8WXP9g38q1j4QqdywGMlC1XxoYZFanLsFL\nsmwpYZJDHgp383APcJSB/LsqNnd+adDaywdfK8aPkUg40VAJpq0L0ocuBYI1\nf5s5\r\n=WJNz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBhhejXgLrpK4mXNkOj9ir6fMP1XfaSQdPdhTPj5PM9ZAiBqpep7VAfb/z5PHxTXmV49nXUpQ9ImwxscleS9kZafFw=="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.0.1-0_1548408578475_0.9782031252837184"},"_hasShrinkwrap":false},"1.0.1-1":{"name":"azure-iotcentral-device-client","version":"1.0.1-1","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.8.2","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.4.1","azure-iot-provisioning-device-http":"^1.4.1","azure-iot-provisioning-device-mqtt":"^1.4.2","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","mqtt":"^2.18.8","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"readme":"# Microsoft Azure IoTCentral SDK for Node.js\r\n\r\n## Prerequisites\r\n+ Node.js version 8.x or higher - https://nodejs.org\r\n\r\n## Installing `azure-iotcentral` and types\r\n\r\n```\r\nnpm install azure-iotcentral\r\n```\r\n## Samples\r\n\r\nWhen connecting a device to an IoT Central application an IoTCClient is initialized.\r\nSDK supports X509 and SymmetricKey authentication;\r\n\r\nX509\r\n```\r\nconst iotCentral = require('azure-iotcentral');\r\n\r\nconst scopeId = '';\r\nconst deviceId = '';\r\nconst passphrase = ''; //optional\r\nconst cert = {\r\n    cert: \"public cert\"\r\n    key: \"private key\",\r\n    passphrase: \"passphrase\"\r\n}\r\n\r\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'X509_CERT', cert);\r\n```\r\nSAS\r\n```\r\nconst iotCentral = require('azure-iotcentral');\r\n\r\nconst scopeId = 'scopeID';\r\nconst deviceId = 'deviceID';\r\nconst sasKey = 'masterKey';\r\n\r\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'symm_key', sasKey);\r\n```\r\n### Connect\r\nUsing callback\r\n```\r\niotc.connect(callback)\r\n```\r\nUsing promises\r\n```\r\niotc.connect().then(()=>{\r\n    console.log('Connected\");\r\n})\r\n```\r\nAfter successfull connection, IOTC context is available for further commands.\r\n\r\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\r\n\r\n### Send telemetry\r\n\r\nSend telemetry every 3 seconds\r\n```\r\nsetInterval(() => {\r\n            iotc.sendTelemetry({\r\n                field1: value1,\r\n                field2: value2,\r\n                field3: value3\r\n            }, sendCallback)\r\n```\r\n### Send state update\r\n```\r\niotc.sendState({fieldName:'fieldValue'},sendCallback);\r\n```\r\n### Send property update\r\n```\r\niotc.sendProperty({fieldName:'fieldValue'},sendCallback);\r\n```\r\n### Send event\r\n```\r\niotc.sendEvent(event,sendCallback);\r\n```\r\n### Listen to settings update\r\n\r\nListen to all settings changes\r\n```\r\niotc.on('SettingsUpdated',callback);\r\n```\r\nListen to specific setting\r\n```\r\niotc.on('SettingsUpdated.<SETTING_NAME>',callback);\r\n```\r\n\r\n### Listen to commands\r\n```\r\niotc.on('Command',callback);\r\n```\r\nTo provide feedbacks for the command like execution result or progress, the client can send back a property with the same name of the executing command.\r\n```\r\niotc.on('Command', (cmd) => {\r\n    // send execution start feedback\r\n    iotc.sendProperty({\r\n                [cmd.commandName]: { \r\n                    value: 'Command execution started at ' + new Date().toISOString(),\r\n                    requestId:cmd.requestId\r\n                    }\r\n            }, sendCallback);\r\n        });\r\n```\r\n\r\n## Generate x509 certificates\r\nIoT Central SDK comes with a tool to generate self-signed x509 certificates to be used when testing device connection.\r\nIf you want to generate certificates for 6 devices and also validate the authority you can run something like this:\r\n```\r\nconst IoTCentral = require('azure-iotcentral');\r\nconst readline = require('readline');\r\n\r\nconst certificateGenerator = new IoTCentral.CertificateGenerator(6);\r\ncertificateGenerator.init()\r\n    .then(() => {\r\n        console.log('Generating root certificate');\r\n        certificateGenerator.generateRoot.bind(certificateGenerator)()\r\n            .then(() => {\r\n                console.log('Generating device certificates');\r\n                certificateGenerator.createDevices.bind(certificateGenerator)()\r\n                    .then(() => {\r\n                        const rl = readline.createInterface({\r\n                            input: process.stdin,\r\n                            output: process.stdout\r\n                        });\r\n                        rl.question('Insert validation code: ', async (answer) => {\r\n                            const validationCert = await certificateGenerator.validate.bind(certificateGenerator)(answer);\r\n                            console.log(`Validation certificate create at '${validationCert}'`);\r\n                            rl.close()\r\n                        });\r\n                    })\r\n            })\r\n    });\r\n```\r\nThis example wait for a validation code which is provided by IoTCentral in the device configuration page when uploading primary or secondary root certificate.\r\nResulting device certificates can be used in connection example above.\r\n\r\n","readmeFilename":"README.md","gitHead":"922a5f9e542a06b217eef039b6a2801cb53e62e5","_id":"azure-iotcentral-device-client@1.0.1-1","_npmVersion":"6.5.0","_nodeVersion":"8.4.0","_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"dist":{"integrity":"sha512-YTL7Hpns/K2jjIP7fDTZnU2djOVnMCSMDO9wvE49+4+h2ObuWk788ernhkveZ/ySxe77b/udCZz5QlkTONvqcw==","shasum":"63f1baa23a156593c35b33c1d3925258c0ca5a1e","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.0.1-1.tgz","fileCount":20,"unpackedSize":64663,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcStitCRA9TVsSAnZWagAARkEP/jZBLuMYmK8lwosjdf78\naoSqNkNp6PjcGcmVi3RWHV5acKT+BEFyKC0s1S6asyhsCzX73163s977+hR4\nDTjk/yzNU545UK0WVuXY3ehizYwmEyRk5v4eAMhgizFXNIiU50uRZFFIYeCJ\nEvR+paoRvS6dyupBQHyEjNRVJR86+qw2F+Rb6KW1uRHzWdIIr1L3zBY4uw3S\nK6wOt1W1AcHrtyNqu8c+hzC+9SCst02wtAr9RBr4iuXC+O/WWY7j8yPPf0i7\nJe7kLTbvnIcxXZx6D0RtEgEVrf7FNeJQnbwZNevE3d7o0qRzIp7afE3bNq37\nJAb+VtGm3Ld1YWvj54WAamG6Ce/IqXouon3/igALMBx0F7VReheIctE3UStf\nHM4pR39uhuixaGBAjHvL9vgTv5/2cA+Zso3MpnDDXyq0/rCnWEuiHuABiPSg\nIVJAskDufCmnZOrhWlmqo9UXyPO+cgPY+yj1FZ7mkgxHNHNHbN2XycVpFm5D\nwqwc1LsRGdVDM7JTxXZXwyDYWpZHU7E1HD6fjBjo9DM1UM9FM5WPAQ1a+/1/\nAyP5obb2SXYKy3xU1ddsBIiTsWgZmr1VHrdZQu+iVWh6KvkFFEC8F40dBmZV\nsX+7vz2x2bnhGegsigTSbHZmt95qOexciW+7OounkpixLZnGoBhXFP2dCYn/\n6UZC\r\n=tJHZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYgUBazgjdFkfr9YtnTyjzr2AZ006p9npGcPqm1cTeowIhAIBvI1sPKke26cC09FiLQVtDm8zbkohY/B/9GEE3irbN"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.0.1-1_1548409004977_0.5933954751351964"},"_hasShrinkwrap":false},"1.0.1":{"name":"azure-iotcentral-device-client","version":"1.0.1","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.8.2","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.4.1","azure-iot-provisioning-device-http":"^1.4.1","azure-iot-provisioning-device-mqtt":"^1.4.2","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","mqtt":"^2.18.8","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"682a58a0059dae9fb05a76e8f8b6fa01eea12004","_id":"azure-iotcentral-device-client@1.0.1","_npmVersion":"6.5.0","_nodeVersion":"8.4.0","_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"dist":{"integrity":"sha512-4ZTX+DjyFrJEGskLyGMK2xD2hPS3rvrA1tZAp75zTKbsbQdUUPwoXXnB019XRZ1WgYDcej7frBt+qXDmKBaDWg==","shasum":"3dc7e1715b59fb4c7f2d06082f7b25e843742d5c","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.0.1.tgz","fileCount":21,"unpackedSize":67080,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcStqtCRA9TVsSAnZWagAAmPgP/1kbdhWSlPK9UpL7g124\nI/3pXRGmWz3H/oLDZJRUCbgy5KBMEiYdxslnrrtPx7LytwWIV8flQttR7uH3\n8ACfutIRJ001qPELYcqWPY1b+KkU7Er5S4uJeI7+VugsDpRJmEwzn11JwfKT\nWHTdeNno7sRrXNYWuwSVnXLWJYDHSHNC7R5QWQWi6dASzoy19n6pMLf4Gu9l\n9JGQv2BQ+/SwgaATDsIZtfFYbbhmw0rw8xf8u5oDhTBy+n2gSrhUvm0vKt4D\nNUwV6/joyRot1morViQ4cbL2KOZCO41EkGYAVZ6XOCnrT20pbVeQjrVIcQsE\n6HtLJEfYWPksaM/gdJPR8ocTMjhA5V6Em8ft0jya4qsXZmnm5p80uMl0FP0w\naf+j/7CaMh5fjo0mJyWhWExU3GMXMh9sszwXZEmb9AW7mKHiwnYlL+LyxhlE\nAg30LCUpwZ3Iy17Z1KxFeFZ57/8FLu4B8yab3f9F7HVzsK45JilaCj7nzSxp\ny4n+QUEeM9Ulsg/9qoYSErbqiKaT+lgsIuNvQSvGlGemPOBakhGh/m/7m+6l\n+x26BvJmZVoX/L1pl4219Y2U6+1FFoC5A7RpAXgD9Xa+svypz9o4DL+OqXEb\nu/3OWeI0hrUgVMsrgO8Z5PkNdFFeqAhTAyAIRXGxEZ2814p/d9F9+bCXq8Nv\nJD1+\r\n=/9dH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVkyY0Netw+qW1jFifzsecAq+CLQ/ICfsPwiCuCdN1PwIgA6ghlb5w8bAYHX65OXC/tCMyGfauSiPFceEGXvos4eA="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.0.1_1548409516695_0.3138935917018073"},"_hasShrinkwrap":false},"1.0.2":{"name":"azure-iotcentral-device-client","version":"1.0.2","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.8.2","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.4.1","azure-iot-provisioning-device-http":"^1.4.1","azure-iot-provisioning-device-mqtt":"^1.4.2","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","mqtt":"^2.18.8","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"c80165702220fe153a627e01f009f4b1999fbc47","_id":"azure-iotcentral-device-client@1.0.2","_npmVersion":"6.5.0","_nodeVersion":"8.4.0","_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"dist":{"integrity":"sha512-/Mtzh/Q/9iE8BO7glPx8Tty8rGfolVAXF2qUasWdvAGNM6Ttro9vwTGc6UKdFeU02ue77j304fqD1gk5J1TCtg==","shasum":"85e49311cfd6e625ed65b94483f7124f03fe4de2","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.0.2.tgz","fileCount":21,"unpackedSize":67671,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcS0R/CRA9TVsSAnZWagAASeQP/jhL1vzQ6OyVt1fqtA5f\n2mZn3lY1mG/w3Dqcgpx2bs52N/ajkpI/Cv9jHuKoZZt7nm0xN7Nji8tvAhwd\nE68yJ9eqtxXn7r96WOKqbCRzyR+/qsM2ccqGyhVNM+fd201jbq1oRdyeAyp2\nqCgLRujapkURW8ZP/lbe6JcuBOc7aQsJ06XP339OAGoR0OdjvJR9VCtHLkw0\nkconhKDAsY2qyiXf56Kl8v5vRjKtvfqquT8cGiFgmEL+bWC9vFzNyMZrYCyb\nhD848bUOLpvicpYI0C/AsYWKcin8nP1iP4FNVawO2oSxNEZwJHurwcFl9Y3m\nvoe6e8ud6/zx/wLKjfEGD+nNuhZoiER2DG9Kx61ExAurgeZHG0A+QVNqnAeS\nbLkPYin8HI+6soRrfeK4PQvZ9UhJINLnl0zczV6DfXTpAMmFYblvd/HNzBXN\nZuAu8DzdJAwpuNSiufz4vfTkYu/bfpPnMfUOl3QdvQoPAW0FWp+9/mDyicRi\n4rYt8rQMdswjB3Ha+rqnXHh7mxFRBLFLaFpIGJhmi8IR0189sAJZDYzEuW+7\nbcIodG13BMrHc0fU7SmbnISztKLqBfknKk/vlrGcTBHvLX/T3PMKyRedA/1m\nBTgFQLSIVeiu/0B1IfixA0IPKz87x/JvVxnsMf11GjzgcPJ+NetNx/Y0ioa1\n8Zpk\r\n=X7dX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICLU597rhVcZv8VqUIfQP7pA5pt6PJ79AyqekZmEdNhoAiAVLL1mAo0rHXrNY+F4dA7gKtc0cq2ZhNoyg/MSWLkpfA=="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.0.2_1548436607149_0.8454308875496337"},"_hasShrinkwrap":false},"1.0.3":{"name":"azure-iotcentral-device-client","version":"1.0.3","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.8.2","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.4.1","azure-iot-provisioning-device-http":"^1.4.1","azure-iot-provisioning-device-mqtt":"^1.4.2","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^2.18.8","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"9b7b96c3ece322ce62299385b8f9d019e58a82d6","_id":"azure-iotcentral-device-client@1.0.3","_nodeVersion":"8.4.0","_npmVersion":"6.8.0","dist":{"integrity":"sha512-xAySGRXLQYMjzZHzvzSNQIOfHFtdt2yRuq4s9wP1mbyQIrzsBUYmHAc2PU54qG+kHGlM+NMFUh/p7Kj/9M5cBQ==","shasum":"068b5fbcf7672405b835b1514ad1c5859aad5cb2","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.0.3.tgz","fileCount":21,"unpackedSize":67698,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcucZQCRA9TVsSAnZWagAAYygQAIyaOwBjOn7aV0bhbsVo\nCRlKXWhsk9Ae0taYUKxq9kGnw3r2KnSOycGL7KWdjOPpCdiBVikqPqf0jpRv\ndf/LwS3XLAQJoaoVV/tLbPMkqhwXC0bkypuSv6mQ5CBulE1uEJg9FETvFy2B\nZdE49WAl7Tw8RVX1XiriYC7vuwI5QpgqGRCMiRM5HKqJMTjODtJcmVDXBa8M\nqxegIV8nyZLYeGJI2eGb7PAB3tRIV7hIKOcOWsZTxVBtKOpNc711NjyXE3cV\nnlGbgdxKaN0R+0kcfvfIqaLL+Bb2S67nQsJD674qL8LyKOqoA2FqPlYFNtLe\n1DqekbmEzpJ9CiEYIHT51g3C6NN3yt20H3KRXQP3jGYMLdpsL8SreA7lWtw2\n1Y3xP0esVFpMbQXiRSWCL+UNITVsUBH9ix5uhAwzRqEH2yMFxv2JrqToFuyc\nj9C45j7TxbSFFhZV/zz44ZuydcSB/sv3cjZnO9j53rZ3ZDISKAXql+BEl3Yv\nYV+6k38oHSg6uKmJr1uit6Q+S3ILn0yCSC+DsDWpYRaLnha4IvQoAm+r2GKW\n9BJJDIWZ23cfH/zLcpH/8VACXm63Oq0+HsxbaEFIYy3DR272p58ihMIR/+2A\nPPwcmJzorpIofiTrDNYbOHEHZH36PU+4RtaBxx/NrdDBVJUCM10Ck4dNWToU\nl+Xh\r\n=+quj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZFksg47wNKI5eMZzuI1PWdysXI4m7gVd3MFz1+FKF+wIhAPA27xMybUnlBjyjQWLIWPMIgR3NFgGEZ27YBx7Zp+3O"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.0.3_1555678800026_0.9937002572520699"},"_hasShrinkwrap":false},"1.0.4":{"name":"azure-iotcentral-device-client","version":"1.0.4","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.8.2","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.4.1","azure-iot-provisioning-device-http":"^1.4.1","azure-iot-provisioning-device-mqtt":"^1.4.2","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^2.18.8","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"9d92d35d7db718b9dfa6e6cf13ab5379e5052a24","_id":"azure-iotcentral-device-client@1.0.4","_nodeVersion":"8.4.0","_npmVersion":"6.8.0","dist":{"integrity":"sha512-UuE70YEjBsQnOXvid57DcNunpZnkGTKgON0aWPSn1RU4F5sJJrIrwcviUvVTFwtAXw2v+2NgF8B5QVTX9saQbg==","shasum":"e97a3d8b55c5169654492c1905c8c5adc6d86322","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.0.4.tgz","fileCount":23,"unpackedSize":75852,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcvxnTCRA9TVsSAnZWagAA06YP+QEd7Qjmach6oXuvna5d\nmjMDu3bQOpFWmmmIS0zYz6iHVGIwCu6xwOrOR2n7Mc2JFmE/ZmBMealN2t+g\nhMVmkM+GLqo+Q5Gfi3qm8h/VURr59MPJMJefOuXsWGyoYJDa1AVSPHiaLmJ1\nK++ZHzWzJyvn1TibFjSayPZ4aBlSH+AuHHQjzc7sCdHdZ3bKZLKZobS8F1bz\nwM04JoEj5C4ls6rN9g+F6MDOPwksyBYFYsj/EcmQQROznUo254sgwkU+m5zW\nviOyxfCpYwBKE0n5JsJsZo6zxd/pBVpVkkR5trj3S0mjw+//vlwWIH2Q+TuM\nVMzyLPakz1s15ArsHMluk0tAuvi0ovlZC7uqxFKK1/f3J54WoUoVTRUUFEa9\ngbs3RsjqSZGDp4W4AoNoPjZLJyOwfh+TqEL5ZcS7s5+7f06NZ+NZaeulPaMy\nXJrYC2OkUCXZ5r4n7ftGDgvdce49g/lvnstAe0Z06pr+i/Yfi1rXMnZqqxAw\ncghaGA5ffXD+ITl6YJYpcrGMaBTYLYjmGxp1BZ3I5Vsq7L6s0iocUbf2L/rv\nyQvIhXBlVT+bDF2NCknspPyAdDO6kAWzsiz7t4ZxfgsJDaoiTISmm+EbF1nY\nTtzOf06B9imuHi8ps35mxPtwamee08wgjsl0vi6ScHO3j4Tgy6Cu0A2r5Ie6\n2yJs\r\n=RVp6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8oASE2wy6z1NxZIJ4q3xQyU0UnccpFAFRaXB3x5tBCgIgcuW4XoGW12f6JGHctOu/9ahqLCCf6dYW1yrcseLk8UE="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.0.4_1556027859039_0.418463733865053"},"_hasShrinkwrap":false},"1.0.5":{"name":"azure-iotcentral-device-client","version":"1.0.5","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.8.2","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.4.1","azure-iot-provisioning-device-http":"^1.4.1","azure-iot-provisioning-device-mqtt":"^1.4.2","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"d0d55e78f2ff22c8df1adb6e3c26d875d972bd00","_id":"azure-iotcentral-device-client@1.0.5","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-cWFgktpWve02KGtbTqP4HctkyMCHRqXmA3JEXzojku+cXFHxRp1LGzLmp0hp7kzbLIYY2gKrTgMh+qmFwrB6cA==","shasum":"64b90aacd743784922ee18e0a6a152bc1fb0b674","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.0.5.tgz","fileCount":23,"unpackedSize":75935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdI2JfCRA9TVsSAnZWagAA2sMP/jXA6wVnpS5GiH0gdMg6\nrcgwzqO/fSmWQcHLgA17cnhA8HBY/6xePSaGR9GYoURcsPAlMfbOt8dYCCjq\nJXwqg/M9cs5PtSfR5e1VLARfsiI0TDqz9f13/0OMSDs5Sh/MW5HGfWfs2H2L\nvUAw7MqFBk6NuF2jZRLZfUIfLLBlJdiL6lK3JD1vE7Uybuklg/pyIitpDTQ1\nBP7eUPttJ3bLjpaScwplCxg0gw1iF2n3NlhOXnInUL01zIha7EPy5HMCPoPS\nrhujMyPGO0egGiHUC3KWY5RssFREfplXahqheqYJtAdhO985eZ8a6jsay2i+\nMNQmyVQf25Rh2Bg230MJh8aLD3l6D5s9lYsVbrtiL0MziR96BYvltxSw+KVJ\nlqGYKAudTIm2DxtmdCdEJj8vxXlhx45vmF1b48b5At0DMlY1SraBjLTaTeTI\njzclNe1OOpsXXco0Df3CTpjpHHZFV3N2V1ttu3jqlXgQ6rgVppGqsRMVFB2J\nYTHPZeW8LdKMIn7mrUZwno/R264EUBBaZbQvwLuuEi4QvN9TlPzrC+Bi1oRB\n9LinpzFIMV9v93RXBmHZrHHtcBfUb0gfWuTqrRjzlYf93UQxU/YTtlFuXPT9\nFfXQLf9ans/l0MKQyy/iHNAqDQfPs4gs80v4Y71HRTmhERR0CthF2LaSHav4\nWEnv\r\n=B3Fz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEKZyE8DxotRUFo05+3Pw6Tpc5ClXwlKDag/jaGXODxBAiEA4cljzTLbUImIPs5yRTBR2708//pYNwjqTFAoXjxQe20="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.0.5_1562600030110_0.17158771648399207"},"_hasShrinkwrap":false},"1.0.6":{"name":"azure-iotcentral-device-client","version":"1.0.6","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.8.2","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.4.1","azure-iot-provisioning-device-http":"^1.4.1","azure-iot-provisioning-device-mqtt":"^1.4.2","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"a7bea1c3a9ea98a26aac09e7b45295011649b9a7","_id":"azure-iotcentral-device-client@1.0.6","_nodeVersion":"8.4.0","_npmVersion":"6.10.3","dist":{"integrity":"sha512-erjZx//SmLqN7GOLOBK9SdpVvSpehVCnh16K3Oc8/gTGvaFyWQwmlUHyaPeaJMjpAXbGdbyexgf7li0V3qIFug==","shasum":"74160bce9bacf90f84d64283f4c8974551f1d4df","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.0.6.tgz","fileCount":23,"unpackedSize":75952,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdWne7CRA9TVsSAnZWagAAljQQAJ0dU87n1iWM95g8Q9wx\nKfBOxhzY3Jn+1b3mdvcnrArxvq3Dik/pVw+NebvYwBaZsh9Ehu1hhZzrllxq\ncyDgw+GapsTrz9hwbT/eI93kTB3KoVeVlysQJpwvfOl5x/PVlzUTTp33IhhP\n4azAuBRzHmEM6zV3HdxPoYLv6aM4cZQpY0NbyJzt8Izpgyes9dOL24QlR5x7\nTNHkAcezsxcuH0ETVXAdcjOP3CLDcnF0FMnlESVG4nYVf91h84ohdxrn1L3c\nB/75TQ2fZwUBRgzrIqTQmddRbSz/CCjzzW8b+pM7/zjxMPCDt72nBv04+ZVY\nmtjbDUO7SFIIQnHVVWE0t0AXQDMhoSDL3gtjSI4acBwUs+5hcePnX7kF2w0Z\n5QakqDdIPPEOLY+u4bJVw5QibzRheFBiHZdwm8yRcPwJJ+k0pRcvAbpchOWk\nPy5/ZwZbwuiMc0bA7XyDyvCqjhTEiu0AMsM0ZAe8Ws+nWMCvyAYZK6EAYMuO\nqrH2171NS2SXIuLhMzu4Ng5s1OZkih3oKX7ced20ZohjQO7uxMQPonN/kmO9\n/uoxYOKdKaFRrzK9lnMVhRt2icvBMRpC4gKuPMnZLFKD44iYrH60EiF7j5CU\nUq9tE1SqtUVS0oVaCKvLsorlg8NAN3EVvXB3AjT2OTDrvlDUO2SK+2AkkEaO\n6a/p\r\n=55Q9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDn1lJxAuAs3OfOe6k32iHxbg7F0grxn0Oz2sRWl2q0UgIgEqReUwBUdN1sFLOrtn/Shu4KXf+VoEyNUeNpUfeTblk="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.0.6_1566209979290_0.08548211936631112"},"_hasShrinkwrap":false},"1.1.0":{"name":"azure-iotcentral-device-client","version":"1.1.0","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.11.0","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.6.1","azure-iot-provisioning-device-http":"^1.6.1","azure-iot-provisioning-device-mqtt":"^1.5.10","azure-iot-security-symmetric-key":"^1.5.10","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"0ce2289c7f4c3e0a0165d4de4297609777adebdf","_id":"azure-iotcentral-device-client@1.1.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-SURNO1G+1Y0Ku2WMa2KVCE+8AYX0hlpjiFxbgQ55/GPTu+M6ZZmptcWJYM3cYrz42mnC6f4F4HN50AeOrCtlDQ==","shasum":"a51f95d7566ba7369a056fdd7f97ffadf39b32e0","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.1.0.tgz","fileCount":25,"unpackedSize":80011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdXr1LCRA9TVsSAnZWagAAecMP/0bPXQmXjPLhaVOHoR7E\nebUEHrMgR9faHagRjazMABi45xxrQtuzd7eyrrOAfmeZH9bjC3LoFWaH+fD0\nrs1UHQYPfkpHUrK9+XzpFFItbx+AXJpa1vKaLO/yWoyQYnLpKrp0lBgjt/H0\njGbyjHuzlSgkC8mdqg6qCgdTJgQnkJ4RqzNGuDQuUSAUaILSfIYH4Lp2fKkr\nhEM4gUrLbrnEzeIY2kP/IoT0eIAYDag0JKUFE1ZxltpuvX6BC60C3n0FVJSu\nEa0q+FymFml+iNau4DFvios+DDVyEov2JtXfosQ9hi9UxkrIhMY3UO3+mSIG\nzW2B5Kz4UsA5WgG8WpAtKDn2NtMu81QDvBhw6ljAd4vPY6A5btUKY/Q3+iZt\nsAT3duRy4SfsUYJuIAGLud4gZD03zv6fHxehClnj10N5bXMEFBy+wlmEBY8U\nTFD0pAiNxUeZ/YewjRWrnJstgMna/4rzsxoHMx1kSc3WXfl1ZgjnTPj3uayU\nWKBStHnCig1n8yDdJ1ghL4elHSqUJVzKdw/Gs2IWNoza6NMZmcKMroBIhtke\nK7Lh/c6RshJnSOZsC95REuSAZSPhhgrcFTnkzYZN0nBWjOjHRJjjD7KSzqiu\n6qPFexuD3I+u7+oJnsLygsVsRfjzv46mlN4Sisy3370m/dDblw2umSkVuRL2\nUTHm\r\n=mHaw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcKnvHQ1ULuu75chpQ+XomLmgW+KGkgOxp4xE+7a+SxQIgOugqZ/IjtFLR7O10oct4oeiGIqO0+z0g8FpvLXKH5PQ="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.1.0_1566489930480_0.9189092780963015"},"_hasShrinkwrap":false},"1.1.1":{"name":"azure-iotcentral-device-client","version":"1.1.1","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.11.0","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.6.1","azure-iot-provisioning-device-http":"^1.6.1","azure-iot-provisioning-device-mqtt":"^1.5.10","azure-iot-security-symmetric-key":"^1.5.10","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"f610990c570f1810e116eff6e7dc7281c82c1290","_id":"azure-iotcentral-device-client@1.1.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-IEJQrh2dF5wcpOUHsFT6HmXSuCLJfjnk4F4cn02LuiKQJ1ggcZNWxFRNzKSE+n8C3WZjvWf4WgijVywrHXLZLg==","shasum":"07bd2b762c64f55fd662827a99f40ee22ee6f637","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.1.1.tgz","fileCount":25,"unpackedSize":80011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdXr4qCRA9TVsSAnZWagAAyX0QAI7XgPKy2wjNB38HEjm7\n0SDEg8Zmj6ObWfnW52WV+gF0TvOc4sLNg+dR5VHXNUU1UrsYcN230faFUvDI\n69A92ZgQPnaJZpI9LtPsyMjm3qstZWHHns4Qc1U9khTjL+4kziNvuWXBr5XN\nTp64ryHOaG8fc4ZXag+oIEDOqyhPHwxCQs4y5SV0Cl9WObW8XbMmWsl/7/yK\nLfydBZQShlGNI9X5jCiijw8vl9AhnEMwhi8Awv3AX2ZEDUQsRdCaUpZClGZQ\n/Y3aP7d/aqkS8i1vcd6OOsD3NW0baaLF21S9hYzrhTXutBfwwPqb0tE3okJ3\nLhctzJr0BU3XVDjVUFTwVwHzqaC2nOiLW1fpd/cByOEZjy59Sf/ogCwUtiJx\nFYr5hlmAaT7RfexVIC78PxY9lK+m7p3g/jgj0AHnZHaFFeiAXbPefZsMhxJe\ns+syNkUanDvpzNWKenicOWiELmdszFZWD83QCnLMiwDZWLCP96dSe6k6Q+D7\nMk8gnNkLUbyH/teXZpW4iXSM6aWU+Nc76hZ6qDo5sowng5JZMSqZ13xVOqpD\nt6+xFewC/CM/ke/pLlu+1Tie9Tn6TqWt/BMexN30rbKN1OPkQUobZq1RDpeh\ng4rE2/wutmIIkNVb7tNOe4VQbn2bb3tZA+MozwLns2L7SncgKh28m097EVi7\n1YSb\r\n=u2kq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxy1u0RUneiLB/6OAPIN8WDrE3cGW0/pxhYpUfrVBfYQIhAKljdxrs7vlIKyCIOQWwEWFDfPY5RvVXlXmO7wU1NILL"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.1.1_1566490153769_0.9138581299965225"},"_hasShrinkwrap":false},"1.1.2":{"name":"azure-iotcentral-device-client","version":"1.1.2","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.11.0","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.6.1","azure-iot-provisioning-device-http":"^1.6.1","azure-iot-provisioning-device-mqtt":"^1.5.10","azure-iot-security-symmetric-key":"^1.5.10","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"2e3e95495882fa62d3ea1f32d785389a622fe7a3","_id":"azure-iotcentral-device-client@1.1.2","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-+nt+IjgVMXR0jHOfS3lvn0wyYvmcWaLOYD1ntpaBrxIC2yf1hnUnb2XcA6/Rva38OaiHKEhk//46mTJ59fbTag==","shasum":"77003c0702414824bcc82263dc58ffbbc08c2481","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.1.2.tgz","fileCount":24,"unpackedSize":419820,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdXsCgCRA9TVsSAnZWagAAuxIP+gLR1yPGJZTSnyvMKzw0\nVFjBlWnGaKuHtMWl2ZZ5R/9CAIIJpssMmulvP3TzdA/kwfYdNtioZtbEiAu4\nGTdz1G6CatxA8p+W6Lu1QMIGj2FQHl48T6o/7bDl2cLQDRgxubOzdYkFpvEg\npVSWKICN+Wt1UOjl+I5WdzWTSPFXORxD0BAmWxb+PvW250nkw8pJktUpnz4j\nq/Vf+b0nUGBnjSbuNA/f4VY82H8EE1UOTGAveND5m5xv8W5lt/6KHAJZ9RrO\nzEKb4uD+hyFH/29QFKwoaYQDFBwDH7Opec/c9Z/E5m2x6iCgPetLOGTp/Zvl\nNo49joTloolKBIsTQLXzpFCgXOm9fefCuLVU8pf91IYJINVreQgl2kLgcG/L\nXKwbkCFWrXrEdAv4H79XAqu9IZb5f+6BN6BIAZBabNoXfDwnVX2iIWA8De8L\nZmSUjIhrPJn6Dr42CU1yyy2cZz2sJj+DCZ9WxvawDXeuRtwI6NBzWWUK2qZp\naB4OyJxFr6BfS//p8jD5z3zOG7rLRum4BL9Op2Z6+f5hSLfX6/u9CxnsVNxZ\nelc3tN2EU6PiptBYNW7FfrkSnme4mU+K/7uGa0HKDMS9aS1lE0wjRlWvMFqQ\nAv8OeICTctzMAoNAlpzmw44exsLvogte2Vpt9bXK6BWDCfa6jLEBT1QYVNur\nOlhc\r\n=l/cn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmqZ4CYU1NrIjoU6UFsUHFQJyqzSLPGakd6+9rht8igQIhALbfos+dFmZ+Fgv+HoEQ+HB+wzsnG7HG4s5kUK9nrY9P"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.1.2_1566490784040_0.8647847241485356"},"_hasShrinkwrap":false},"1.2.0":{"name":"azure-iotcentral-device-client","version":"1.2.0","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.11.0","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.6.1","azure-iot-provisioning-device-http":"^1.6.1","azure-iot-provisioning-device-mqtt":"^1.5.10","azure-iot-security-symmetric-key":"^1.5.10","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"19a78b76ef4f65803e227786671b4ef1ce1f4ccc","_id":"azure-iotcentral-device-client@1.2.0","_nodeVersion":"10.16.3","_npmVersion":"6.10.3","dist":{"integrity":"sha512-CTa3ZzoKpuaS9kU5/mxp52haZEj3NZol4LnNrn5OLMqyTffj6r9bmykEdYjBeO1Udima9FIfxgzP82i2/rvKXg==","shasum":"0d13ecbbbaaa5dea3a13c9123b8ae982e3d5d94c","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.2.0.tgz","fileCount":26,"unpackedSize":431674,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZ88ICRA9TVsSAnZWagAADEoP/jUxuFrzJsnuCilJyywA\nDFz2kaI+f+PmoqJ4ljkUHA3ksbpzBz/5INOkSiLAK+37o7edQHkbaNlYGd1c\nhn+8whBgSajT1ww7yRWEJVu7FW+hXvF+3QgscGMjj5AhcfZsz3eyNnUEQLie\nUuWdTPPCh4+rEBzdvpPISkqSM6scmXKY1L48jxCPt8qhzIaVUwFugg7TNVv3\nC2MZD8ZbjcK/G+zebJmpt1fYtTwAM91s5afn2FbIfksKx5pgvpKAP6CJv84s\nh8aqCkNWE73j1AS0boejHUZzsEvHuabplMIIJjm+V7NFeIEzPznrZt6NuOZn\n1/j/yvPD2jpXrZf7/oM03bQE6+3ROfESR3IJgAY5vngzTVGl095kxFJGmXjm\n1OqsssoQ0MA0yTkSmMP0kswCIAVvzccSx5H4n1o2JpG9hCmDRbydlIgh2mip\nSTJYLOvI21lJyvnQuKfDbJCWdh3mVzdGpwywqcUZJhIb7znb/0ifpqyJvXq2\nNZEIO5IwTe72Alr0VrPsei5/V80/S0zJM/YnCkO1E1P5y8oWMyTgENPXeJw9\nva2/5KH3D7lTQa556xfvjiaOH2WFsr+Igkf6eIPxlVXbVUWV0XwzSCCP97ka\n9v0HXjbiuVBEwxY8WHrR/jp0TSRPnuV0oNFcwKrE7+PB+b53BlXoVkH5RVI+\nResT\r\n=0DdH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD85tiKWAB0+VOx+HdpsZewm5gEul1MNCw+CCMNIFy5sQIhALLGqaNzEEMuuzyikq4R2dFBctUniPpsoBMaJCM740EQ"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.2.0_1567084295491_0.25770820339387046"},"_hasShrinkwrap":false},"1.2.1":{"name":"azure-iotcentral-device-client","version":"1.2.1","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.11.0","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.6.1","azure-iot-provisioning-device-http":"^1.6.1","azure-iot-provisioning-device-mqtt":"^1.5.10","azure-iot-security-symmetric-key":"^1.5.10","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"94b63b9339aa04968693c155d8a5cd09228cc218","_id":"azure-iotcentral-device-client@1.2.1","_nodeVersion":"10.16.3","_npmVersion":"6.10.3","dist":{"integrity":"sha512-+k9+agIul56cbP85rVUfHOLXZ5iSmRNnbtHFByxrA24cckSJOO8l0T2xrwaDcDCo4ZuDsE5OJHIuFaKG8hZ8mw==","shasum":"b28c3b41b0860165233ed4820fb4fbb9cea70838","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.2.1.tgz","fileCount":28,"unpackedSize":432937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdegYrCRA9TVsSAnZWagAAGsoP/ir3jvz/d+75xFns1kV4\n6bc04wE5EmSMsBFaFxkotopFz1sM2Td1VKVr1ZRAFm5qBNhF+XrdX12IKIWi\nSDQp+vocWoPMM7rVKaKVAKF3ox1xZn9DO6vNzkKadBYkkNZTwq2sZS+BQyAt\nrysMGD2ha2j9p0IyhmGQCOF95b1WueZsbrsJN+nteqjudznC/SZlMncTiCQ+\n4ecLADoSXhvLhhTkXCGCSomDWX5v3DqJYOMUtlYWuu5a4RkLmH5mSb+1oZO4\nt3uCcvZocbaKXaIOvvUOmdEtl3BD6Pc5/EjUOAUKyDSvkxNCqpUBZe5C3VXV\nyhduNcO006NB9m/lhh7xEC1xx0BNtSFrOU/jbH54jg73Yg2rMMjcrWigiTnM\nkToh/LgMSN4ueHdMhkpfszDrVF0o8ety8PRZ98CH5To9KMdtH5NlMUBnuwbk\n494ErsjTVljNbw5gMZ4O8j78JytCzjoMso7oL4+PoT8jTmj2P4//LjUl2Uxt\ncgrMOt7FdYz/0tEZ6FpDUbFE6BmJpMXoWkNJEmlVZFa1pjcqTSwCnS1h+KT+\n8DsUVVobaamQrpSZb7O20NaOagUxrNjBsuZxP/G3qtXiDO+OnH1Sz8r7F7W5\nm9coS6jKIH7APjhWQ0Tam31xupioh9X+ybGc7CrlWoN8Yzjt+C7bTN+84o+s\nUbw2\r\n=Gl6e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFEqttKMzzoCS3TVinzoX7/TImvtLOsrHwoHCGTs3/gaAiA7RMMbhtCRTBz1ukdfJSwnMSGP2orOCtsTXWu8fyQteQ=="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.2.1_1568278058697_0.776118828490932"},"_hasShrinkwrap":false},"1.2.2":{"name":"azure-iotcentral-device-client","version":"1.2.2","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.11.0","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.6.1","azure-iot-provisioning-device-http":"^1.6.1","azure-iot-provisioning-device-mqtt":"^1.5.10","azure-iot-security-symmetric-key":"^1.5.10","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"57304022c7151f3134502f838c105db07a3ea0dd","_id":"azure-iotcentral-device-client@1.2.2","_nodeVersion":"10.16.3","_npmVersion":"6.10.3","dist":{"integrity":"sha512-kWjFier/PuAjQpo4H3vM8CAMka4Uv5LN7gqwSI1YW8OijKbqDXp5EaWvaKyfcKidCevRowUREqGijVBPObUP+Q==","shasum":"c2e0e3dd0729ebeba86219a5f7b73b610c648d79","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.2.2.tgz","fileCount":36,"unpackedSize":443845,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdg5bvCRA9TVsSAnZWagAAybsP/2XPt0dzlxyAp+6PyPpi\nGYDPvIF9Nk4/UGGb/cSQ4r7vc2doT++XgvVZzQZm7e8tEtQR0BRuoPYZC8oz\nQHx7DinPWC3KjjWN+UUVxWGJ42S4ZQF9E1xxt98Ca6QDoigK/TRxbfInhEPu\nPQLvUwrDWuQ+69haeHq+JFT47drg2Qxu1NPDPjYahdDQ5YQTvxeBQJV+JKUf\nndhHLAzQXg1x3CWBmpOGVXs/1baYzRP+vzdCpXH4xGS9R7e67FIM7U85Y3cV\nOG+8hY/kAotncQXkOBWaJFHT7zbhT9f7VsoKdjLke6eMpWu5aQ1pn4vj67Ei\nTsF+my8tHxH7PHi7Lj/haukCj0zjVnsx74RaPFpSHACm5ANKhUKw+5MODzZb\nb3iADAQM6YuS6z13IF3pJsv9I8pAJb16fXUOTyqR5Ie7E6p5BKAquMlNqMYv\nfUC3qst8BrVPmL6FNmsbY9DR1o5fuQbXL4DtPwW0mCKKpbbRm2C3FAxQ6hec\nKhjuDxe02fHuiw/26afktOVNm3+PUw5bXBK/gGr+dgg98/8xRu66wTFZQDbd\n3aK4McqxTvdyW7f3ePcWEAPyMe/JjcRJIeqKFfeeHBG8gF7MFXyI7V2gRwhw\nAT3wzgZRSHaEJKtUYyYxk9ENMzXbZiVpu+IEz7Ac3Dp4+QG2Uk7sQjmg9DQm\nWPbd\r\n=ZVU4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIERGXjlF1G0Lrv8Mo8/lyhMUT1oHmNzlT3dHyy/aBGSEAiATVXJ2EpNuIYlnwDntHQbx24IQKqvUblJKgTyD9RbDCw=="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.2.2_1568904942396_0.10008835933213933"},"_hasShrinkwrap":false},"1.2.3-beta.0":{"name":"azure-iotcentral-device-client","version":"1.2.3-beta.0","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.11.0","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.6.1","azure-iot-provisioning-device-http":"^1.6.1","azure-iot-provisioning-device-mqtt":"^1.5.10","azure-iot-security-symmetric-key":"^1.5.10","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"ad3498525ddeea759e50f906204ea25ad14859a0","readme":"# Microsoft Azure IoTCentral SDK for Node.js\r\n\r\n[![Join the chat at https://gitter.im/iotdisc/community](https://badges.gitter.im/iotdisc.svg)](https://gitter.im/iotdisc/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\r\n[![Licensed under the MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/lucadruda/iotc-nodejs-device-client/blob/master/LICENSE)\r\n\r\n\r\n## Prerequisites\r\n+ Node.js version 8.x or higher - https://nodejs.org\r\n\r\n## Installing `azure-iotcentral-device-client` and types\r\n\r\n```\r\nnpm install azure-iotcentral-device-client\r\n```\r\n\r\n## Samples\r\n\r\nA couple of samples in Javascripts can be found [here](https://github.com/lucadruda/iotc-samples)\r\n\r\nWhen connecting a device to an IoT Central application an IoTCClient is initialized.\r\nSDK supports X509 and SymmetricKey authentication;\r\n\r\n#### X509\r\n```\r\nconst iotCentral = require('azure-iotcentral-device-client');\r\n\r\nconst scopeId = '';\r\nconst deviceId = '';\r\nconst passphrase = ''; //optional\r\nconst cert = {\r\n    cert: \"public cert\"\r\n    key: \"private key\",\r\n    passphrase: \"passphrase\"\r\n}\r\n\r\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'X509_CERT', cert);\r\n```\r\n\r\n#### SAS\r\n```\r\nconst iotCentral = require('azure-iotcentral-device-client');\r\n\r\nconst scopeId = 'scopeID';\r\nconst deviceId = 'deviceID';\r\nconst sasKey = 'masterKey';\r\n\r\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'symm_key', sasKey);\r\n```\r\n\r\n### Connect\r\nUsing callback\r\n```\r\niotc.connect(callback)\r\n```\r\nUsing promises\r\n```\r\niotc.connect().then(()=>{\r\n    console.log('Connected\");\r\n})\r\n```\r\nAfter successfull connection, IOTC context is available for further commands.\r\n\r\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\r\n\r\n### Send telemetry\r\n\r\nSend telemetry every 3 seconds\r\n```\r\nsetInterval(() => {\r\n            iotc.sendTelemetry({\r\n                field1: value1,\r\n                field2: value2,\r\n                field3: value3\r\n            }, timestamp, sendCallback)\r\n```\r\nAn optional timestamp field can be included in the send methods, to specify the UTC date and time of the message. This field must be in ISO format (e.g., YYYY-MM-DDTHH:mm:ss.sssZ). If timestamp is not provided, the current date and time will be used.\r\n\r\n### Send state update\r\n```\r\niotc.sendState({fieldName:'fieldValue'}, timestamp, sendCallback);\r\n```\r\n### Send event\r\n```\r\niotc.sendEvent(event, timestamp, sendCallback);\r\n```\r\n### Send property update\r\n```\r\niotc.sendProperty({fieldName:'fieldValue'}, sendCallback);\r\n```\r\n### Listen to settings update\r\n```\r\niotc.on('SettingsUpdate', callback);\r\n```\r\nTo provide setting sync aknowledgement, the client can send back a property with the same name of the setting and a particular value object.\r\n```\r\niotc.on('SettingsUpdated', (val) => {\r\n            Object.keys(val).forEach(setting => {\r\n                iotc.sendProperty({\r\n                    [setting]: {\r\n                        value: val[setting].value,\r\n                        status: 'completed',\r\n                        desiredVersion: val.$version,\r\n                        message: 'whatever'\r\n                    }\r\n                });\r\n            });\r\n        });\r\n```\r\n\r\n### Listen to commands\r\n```\r\niotc.on('Command',callback);\r\n```\r\nTo provide feedbacks for the command like execution result or progress, the client can send back a property with the same name of the executing command.\r\n```\r\niotc.on('Command', (cmd) => {\r\n    // send execution start feedback\r\n    iotc.sendProperty({\r\n                [cmd.commandName]: { \r\n                    value: 'Command execution started at ' + new Date().toISOString(),\r\n                    requestId:cmd.requestId\r\n                    }\r\n            }, sendCallback);\r\n        });\r\n```\r\n\r\n## One-touch device provisioning and approval\r\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\r\n\r\n### How to set IoTC template ID in your device\r\nTemplate Id can be found in the device explorer page of IoTCentral\r\n![Img](assets/modelId.jpg)\r\n\r\nThen call this method before connect():\r\n\r\n```\r\niotc.setModelId('<modelId>');\r\n```\r\n\r\n### Manual approval (default)\r\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\r\nThis can be done from explorer page after selecting the device\r\n![Img](assets/manual_approval.jpg)\r\n\r\n\r\n### Automatic approval\r\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\r\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\r\n\r\n![Img](assets/auto_approval.jpg)\r\n\r\n## Generate x509 certificates\r\nIoT Central SDK comes with a tool to generate self-signed x509 certificates to be used when testing device connection.\r\nIf you want to generate certificates for 6 devices and also validate the authority you can run something like this:\r\n```\r\nconst IoTCentral = require('azure-iotcentral');\r\nconst readline = require('readline');\r\n\r\nconst certificateGenerator = new IoTCentral.CertificateGenerator(6);\r\ncertificateGenerator.init()\r\n    .then(() => {\r\n        console.log('Generating root certificate');\r\n        certificateGenerator.generateRoot.bind(certificateGenerator)()\r\n            .then(() => {\r\n                console.log('Generating device certificates');\r\n                certificateGenerator.createDevices.bind(certificateGenerator)()\r\n                    .then(() => {\r\n                        const rl = readline.createInterface({\r\n                            input: process.stdin,\r\n                            output: process.stdout\r\n                        });\r\n                        rl.question('Insert validation code: ', async (answer) => {\r\n                            const validationCert = await certificateGenerator.validate.bind(certificateGenerator)(answer);\r\n                            console.log(`Validation certificate create at '${validationCert}'`);\r\n                            rl.close()\r\n                        });\r\n                    })\r\n            })\r\n    });\r\n```\r\nThis example wait for a validation code which is provided by IoTCentral in the device configuration page when uploading primary or secondary root certificate.\r\nResulting device certificates can be used in connection example above.","readmeFilename":"README.md","_id":"azure-iotcentral-device-client@1.2.3-beta.0","_nodeVersion":"10.16.3","_npmVersion":"6.10.3","dist":{"integrity":"sha512-nuk1t/Dh9hT0iblrxd368VqSHowqt26aOQk1J4KdDg7z5uJ6pUHwgk8DoplF988Ci3yeRYqujlq01a8BkOPJVw==","shasum":"3793c34ac916c12ddf896e8dc4b116dae980c97d","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.2.3-beta.0.tgz","fileCount":36,"unpackedSize":443744,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdiMv4CRA9TVsSAnZWagAAAYIP/iEY4pMrJoKjhcChBE0T\ne3RWXs2ZFbARBoFtL7Y8wG68S0gsh3Owy05iAV9+BxI4LRw071JGaDM/ksTk\nk1l5HweoJU+bMKVDexcefOvAuPZcBdGMdYcO2/rTzc8/8ni8C1EzGgLr2C5w\nz6FnbfBJj5fPwjNYKob27x4y7xKBhrkDU+PHs3qazwiolWFUCCsfxPYos+n3\nquL6Q2EQ6gJ2ZIv7LemLfgQLSgzn8Y6U1JxdrTC81xKnGa2IE2S6iZhrGFle\nFl2Ox1ydY5Rn+TKY5HLEVJYFPtCI5DriidWDSsufEkhzJVUE7+Q/N7+nJFw4\nybsJ4wm+nrxzGSqknZuvbXZzoDjufTAcfDqg7+cnvti3Xm0g5jxOUM/s6NrM\nHHRk4PKzfqVAVU2HfgIhyq1m65aMG8JXGehzy06vTUpl73Y966pIfzIIeqBQ\ngNmfiuiqnnTrbvRArlyv2eJI+NLr/xErwyx7hcXfxMFOPQPRdgy54XlTe3k4\neqatDXpsu+OScR7XBcmeCUD8BHqW+IvwUCOQ+5f5yVyFRpRRqztBNpNjhv6G\n/O6FYB8TCQaaRV9DboODL2wR8dK0NFBzjkPWAylyArIO0tovXR38N8gZZMJZ\n2HSNEGymsjP6dxlkpWirU1aCO7KC+3bF/als6bI/V5qysNAGHsADGITiOCjn\nmo6F\r\n=27GV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCb/66OjuJUbGgCS1+wsOzaqZtYcYy5xFFgOdA4nx8zEwIgHwUibp0aQxGmJB1Wv2l0Y48GT80J6c/8Hzxu658Ixi8="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.2.3-beta.0_1569246200114_0.9185664960697411"},"_hasShrinkwrap":false},"1.2.3-beta.1":{"name":"azure-iotcentral-device-client","version":"1.2.3-beta.1","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.11.0","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.6.1","azure-iot-provisioning-device-http":"^1.6.1","azure-iot-provisioning-device-mqtt":"^1.5.10","azure-iot-security-symmetric-key":"^1.5.10","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"5123309cd93555275174748d80ebade869f80cdf","readme":"# Microsoft Azure IoTCentral SDK for Node.js\r\n\r\n[![Join the chat at https://gitter.im/iotdisc/community](https://badges.gitter.im/iotdisc.svg)](https://gitter.im/iotdisc/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\r\n[![Licensed under the MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/lucadruda/iotc-nodejs-device-client/blob/master/LICENSE)\r\n\r\n\r\n## Prerequisites\r\n+ Node.js version 8.x or higher - https://nodejs.org\r\n\r\n## Installing `azure-iotcentral-device-client` and types\r\n\r\n```\r\nnpm install azure-iotcentral-device-client\r\n```\r\n\r\n## Samples\r\n\r\nA couple of samples in Javascripts can be found [here](https://github.com/lucadruda/iotc-samples)\r\n\r\nWhen connecting a device to an IoT Central application an IoTCClient is initialized.\r\nSDK supports X509 and SymmetricKey authentication;\r\n\r\n#### X509\r\n```\r\nconst iotCentral = require('azure-iotcentral-device-client');\r\n\r\nconst scopeId = '';\r\nconst deviceId = '';\r\nconst passphrase = ''; //optional\r\nconst cert = {\r\n    cert: \"public cert\"\r\n    key: \"private key\",\r\n    passphrase: \"passphrase\"\r\n}\r\n\r\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'X509_CERT', cert);\r\n```\r\n\r\n#### SAS\r\n```\r\nconst iotCentral = require('azure-iotcentral-device-client');\r\n\r\nconst scopeId = 'scopeID';\r\nconst deviceId = 'deviceID';\r\nconst sasKey = 'masterKey';\r\n\r\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'symm_key', sasKey);\r\n```\r\n\r\n### Connect\r\nUsing callback\r\n```\r\niotc.connect(callback)\r\n```\r\nUsing promises\r\n```\r\niotc.connect().then(()=>{\r\n    console.log('Connected\");\r\n})\r\n```\r\nAfter successfull connection, IOTC context is available for further commands.\r\n\r\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\r\n\r\n### Send telemetry\r\n\r\nSend telemetry every 3 seconds\r\n```\r\nsetInterval(() => {\r\n            iotc.sendTelemetry({\r\n                field1: value1,\r\n                field2: value2,\r\n                field3: value3\r\n            }, timestamp, sendCallback)\r\n```\r\nAn optional timestamp field can be included in the send methods, to specify the UTC date and time of the message. This field must be in ISO format (e.g., YYYY-MM-DDTHH:mm:ss.sssZ). If timestamp is not provided, the current date and time will be used.\r\n\r\n### Send state update\r\n```\r\niotc.sendState({fieldName:'fieldValue'}, timestamp, sendCallback);\r\n```\r\n### Send event\r\n```\r\niotc.sendEvent(event, timestamp, sendCallback);\r\n```\r\n### Send property update\r\n```\r\niotc.sendProperty({fieldName:'fieldValue'}, sendCallback);\r\n```\r\n### Listen to settings update\r\n```\r\niotc.on('SettingsUpdate', callback);\r\n```\r\nTo provide setting sync aknowledgement, the client can send back a property with the same name of the setting and a particular value object.\r\n```\r\niotc.on('SettingsUpdated', (val) => {\r\n            Object.keys(val).forEach(setting => {\r\n                iotc.sendProperty({\r\n                    [setting]: {\r\n                        value: val[setting].value,\r\n                        status: 'completed',\r\n                        desiredVersion: val.$version,\r\n                        message: 'whatever'\r\n                    }\r\n                });\r\n            });\r\n        });\r\n```\r\n\r\n### Listen to commands\r\n```\r\niotc.on('Command',callback);\r\n```\r\nTo provide feedbacks for the command like execution result or progress, the client can send back a property with the same name of the executing command.\r\n```\r\niotc.on('Command', (cmd) => {\r\n    // send execution start feedback\r\n    iotc.sendProperty({\r\n                [cmd.commandName]: { \r\n                    value: 'Command execution started at ' + new Date().toISOString(),\r\n                    requestId:cmd.requestId\r\n                    }\r\n            }, sendCallback);\r\n        });\r\n```\r\n\r\n## One-touch device provisioning and approval\r\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\r\n\r\n### How to set IoTC template ID in your device\r\nTemplate Id can be found in the device explorer page of IoTCentral\r\n![Img](assets/modelId.jpg)\r\n\r\nThen call this method before connect():\r\n\r\n```\r\niotc.setModelId('<modelId>');\r\n```\r\n\r\n### Manual approval (default)\r\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\r\nThis can be done from explorer page after selecting the device\r\n![Img](assets/manual_approval.jpg)\r\n\r\n\r\n### Automatic approval\r\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\r\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\r\n\r\n![Img](assets/auto_approval.jpg)\r\n\r\n## Generate x509 certificates\r\nIoT Central SDK comes with a tool to generate self-signed x509 certificates to be used when testing device connection.\r\nIf you want to generate certificates for 6 devices and also validate the authority you can run something like this:\r\n```\r\nconst IoTCentral = require('azure-iotcentral');\r\nconst readline = require('readline');\r\n\r\nconst certificateGenerator = new IoTCentral.CertificateGenerator(6);\r\ncertificateGenerator.init()\r\n    .then(() => {\r\n        console.log('Generating root certificate');\r\n        certificateGenerator.generateRoot.bind(certificateGenerator)()\r\n            .then(() => {\r\n                console.log('Generating device certificates');\r\n                certificateGenerator.createDevices.bind(certificateGenerator)()\r\n                    .then(() => {\r\n                        const rl = readline.createInterface({\r\n                            input: process.stdin,\r\n                            output: process.stdout\r\n                        });\r\n                        rl.question('Insert validation code: ', async (answer) => {\r\n                            const validationCert = await certificateGenerator.validate.bind(certificateGenerator)(answer);\r\n                            console.log(`Validation certificate create at '${validationCert}'`);\r\n                            rl.close()\r\n                        });\r\n                    })\r\n            })\r\n    });\r\n```\r\nThis example wait for a validation code which is provided by IoTCentral in the device configuration page when uploading primary or secondary root certificate.\r\nResulting device certificates can be used in connection example above.","readmeFilename":"README.md","_id":"azure-iotcentral-device-client@1.2.3-beta.1","_nodeVersion":"10.16.3","_npmVersion":"6.10.3","dist":{"integrity":"sha512-ogIm/FaUEp27MyvuNVG8us37xGjG1KabjW4uwKyK4HuPf3iH+47lT0HBABZrnqvWJDcGoopjmp9furMP5WuZOw==","shasum":"62406190cf7470ba8781be08aa92ecac68353984","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.2.3-beta.1.tgz","fileCount":29,"unpackedSize":416046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdiMweCRA9TVsSAnZWagAAHaYQAJ+JyJ11n1RcUoxeBl57\nVb1HdT/dtbAjTbUxN1hJbeTJ3X+JuLjQTHA8tDq+9M19DYW9sZIcunyqBghE\nqqnsDHacEW5SmJLbv6T30mE1O3rkD7/4QRkCOlUm2TqXeL9SYM52vMVak1oX\nwyK8xNN0xQ5TN3SHXwCEkfZYcqHG1KIH5IBAHPYN+2HBU2zRhODkTQQ6PUJM\n3X2cRUr5kZDI3Nzp36suE8LHutDCUY8ZjdOZTzeJkNgbJTH0NU+lnIAVSinF\nXiixwi0SuEwfXh7KD6VNbnMKCU9cL//PvVkrdB3mJvQSEgMa5ziqEta3vBpu\n4ACVeJ+AjjW/uNjT5SxraA590TsJpPwJyHooEiR5DLT0VA+AAcsQQ6/RRXcY\n5U7EEgLY3RCRPredOYQ6QE7YYPKhI0y9bZl4xTVMhNdmO5mO5Lx9htxdFLVx\nZKxvUX24gGzxkTGCi1St3V5SO006PO8tiHtGH2iHebyk7KalJrrAwCpk78+t\n6PJxkFI6wGJgBImm4Pnh9gOl/cyq8HapuNcXDFjr5J/R9Hoi+EyxrR4y4ve6\nPeT5GT4eEw16grZDPsvXAd3FeqG4Gw74GrL+gn0te+fLWxn2JIegjTwiJz8i\nnJPEZ2IW5Kw8bUQ9LOiqORnM+bV9SPFyAOmQMDZ2+uDjdnutznLPdlwxImi8\nEzW7\r\n=HlaA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFMk24VcaHSnHutLDdIFxzq+q1ENjsWPMxVk5pG9FyAwAiATi89UW10ycuwoTC0dEu9xOO/wje0EbkI90D4oH//aKg=="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.2.3-beta.1_1569246237903_0.01857311316814858"},"_hasShrinkwrap":false},"1.2.3-beta.2":{"name":"azure-iotcentral-device-client","version":"1.2.3-beta.2","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.11.0","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.6.1","azure-iot-provisioning-device-http":"^1.6.1","azure-iot-provisioning-device-mqtt":"^1.5.10","azure-iot-security-symmetric-key":"^1.5.10","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"9e43658e4230440780767848e5155611a2dd43c1","_id":"azure-iotcentral-device-client@1.2.3-beta.2","_nodeVersion":"10.16.3","_npmVersion":"6.10.3","dist":{"integrity":"sha512-WRoxh+XWQdWwZrFa72BDJtbQJPpZG8uTSK3WeeXh9pvtrTVsjYAXGGtwWQ9SYKQpyWadCAodiWNtmV+zDGxAVA==","shasum":"8899b16aa87e06f31a197d79bd3ee266c54478c1","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.2.3-beta.2.tgz","fileCount":32,"unpackedSize":417161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdiNCxCRA9TVsSAnZWagAAb7EP/1vojpRDUS57WG/ffJuK\nohdA0pI1rma7gfmBAHm1apZT81o7tR4aNkKTv0JczgiuWZuzUQmMHr6TGFcF\nKB3QKyWc89E+sAiWsM+yDHIwNpnffi81dYz88ndNotii6zZlKFYYRir12ZEf\nGxiv4FEbdkdyGYbc/dOKpbeCfEYhRE1m7ivUtylp4VPKigaO7b7pxnEmzAhw\nF0gd+MHsLjZ7u/+enDB76vTm/pcaqmfl8unwGNsQj/fJDUjrgAHPuPd6Goud\n8O9af2FNhVHSd4Js95J/iUeVysXQN+dOdpV8vJbT3gHFue2q3ICFClEAS/fC\nfgmkIuBUYiZazI5+VTUJzODDfdZa2OODFIL/paAeJPSdr6N/hjQT1Spsk4F5\n93Cf51WXopRJOqFw0A8ptUpXJqKr8oiHmDZXt9lTTI/IouRQgG8KxmTBoMWC\nMzHMRXl7LkGfeGLTMIh3aeTlzFl+ls/WKIr+4xwQE4mQbAO0r/DqaJIyUyN2\nVPyc+QyZJqtyvIfJpob8FYRkNYB8A3ScrIGEuDSAxA9v+RD6if6YLMr49JSs\nB4rPBcud+NClO6PeZeOG7guXoGg3JgFHPAmiD8uNnUCTtC18Pk/AZ5kPB6Jd\npa/GAm7i5ZDampRdQ9GwTUi+awGNpfMnlLA30M7dWIVa4E8aE18jJBEcx/NS\nq0du\r\n=dipN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsHWXm8eA2sdalRS7JUTGcNLjqWcX3j020n5WtrRUkTQIhAL6XHkiH3C+2w16GhQWfB92F1Hz9uskclcdkw0gxcx8z"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.2.3-beta.2_1569247408299_0.19926620292261"},"_hasShrinkwrap":false},"1.2.3-beta.3":{"name":"azure-iotcentral-device-client","version":"1.2.3-beta.3","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.11.0","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.6.1","azure-iot-provisioning-device-http":"^1.6.1","azure-iot-provisioning-device-mqtt":"^1.5.10","azure-iot-security-symmetric-key":"^1.5.10","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.12.3"},"gitHead":"7a9349c02be19447d4212d23fb2f19ff4555c611","_id":"azure-iotcentral-device-client@1.2.3-beta.3","_nodeVersion":"10.16.3","_npmVersion":"6.10.3","dist":{"integrity":"sha512-5mSqAdt59+m8aFhtx1lAGWCRZp1fFjayxeZspNQxGfuMkNhVXxc1bbrOJnkgVT7YvoOrnCeraybDvHaq+hBmHg==","shasum":"d45c3f9196a9081560842d87620cc1301c2c3dc0","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.2.3-beta.3.tgz","fileCount":32,"unpackedSize":417179,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdiNHfCRA9TVsSAnZWagAATboQAJGhb12i/D7Hz3G+8Gvq\ncuUsLnkaeNiszI/Nhhoy1IgMNCQIXTNtCdECGW5uhyj8flkdNvBZZuROURbs\nlNcHnahGp6KF9DS/aVjZOHPNSXNTwengKQTFORpQ07tfh8neBcdyeB+YU/+L\nse3GCDXTRSlkkk4xVzjJHQZsLlAPhX9PgG5SH6oWBvc4yTbz3Z1y05SXSrJC\nxJJ8u1H7jyPLCoTz6OF20DaJuP9/8wN0HmSiiU/kkuYSkIi0h4emETonNpT5\n4YdRfvIyq/uVUG2xBZnOItmDg1+UzIN+IMcGDaU/ILeXANO2+Dxnjq7lpuh6\n4qWsP6Rxg6E9NiB9wSllRp7xZ7dsz2CVsmDp/AElwOtVv4XJhwNx38toYRI6\nz1vfIdNU4OWFS2ry4xHXAxC4OEwbwwy/gD4uwnXbnq3RyPq3ybhqc1L+T04y\nxsin9j7wmrCoVoUlzlcMKY/3jyzecIsQdvsFQu0ZL0UxuRFb1YCoXcF1lAsX\n5Zxoc6AHVeBVZRboPUzX7AdAxzQJnKyInUufLjxnWbEmcz4n3JJes3/SGkZU\nPkzmTWsZqRvyQdDJo4YzBzdrKZri6yXmQPgc1TeINnPrJ21F9wJOYNqqaW5J\nPQfvd3CYJoQT90TWoUJFLGknpu0PK966zwwlnRDuLcT0Y7rqgZ+uxEdvXQ07\nUp2b\r\n=fBLm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDxgh3OVSr68UIIH1rCfMbCg+haoxbkZvNG8pEjJsc8pAiEAvpfcqXl9mdWnLIkBHcGXvsxyFaIyyiiq/vP3yZDV/6w="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.2.3-beta.3_1569247710387_0.38941109028178644"},"_hasShrinkwrap":false},"1.3.0-preview.1":{"name":"azure-iotcentral-device-client","version":"1.3.0-preview.1","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.12.0-preview.1","azure-iot-device-amqp":"^1.12.0-preview.1","azure-iot-device-http":"^1.12.0-preview.1","azure-iot-device-mqtt":"^1.12.0-preview.1","azure-iot-digitaltwins-device":"^1.0.0-preview.2","azure-iot-provisioning-device-amqp":"^1.6.1","azure-iot-provisioning-device-http":"^1.6.1","azure-iot-provisioning-device-mqtt":"^1.5.10","azure-iot-security-symmetric-key":"^1.5.10","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.14.22","typescript":"^3.6.4"},"gitHead":"b9bdcf128e65a4a02794aaee3b2d15a0b12aad91","readme":"# Microsoft Azure IoTCentral SDK for Node.js (PnP Preview)\r\n\r\n[![Join the chat at https://gitter.im/iotdisc/community](https://badges.gitter.im/iotdisc.svg)](https://gitter.im/iotdisc/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\r\n[![Licensed under the MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/lucadruda/iotc-nodejs-device-client/blob/master/LICENSE)\r\n\r\n\r\n## Prerequisites\r\n+ Node.js version 8.x or higher - https://nodejs.org\r\n\r\n## Installing `azure-iotcentral-device-client` and types\r\n\r\n```\r\nnpm install azure-iotcentral-device-client@pnp-preview\r\n```\r\n\r\n## Samples\r\n\r\nA couple of samples in Javascripts can be found [here](https://github.com/lucadruda/iotc-samples)\r\n\r\nWhen connecting a device to an IoT Central application an IoTCClient is initialized.\r\nSDK supports X509 and SymmetricKey authentication;\r\n\r\n#### X509\r\n```\r\nconst iotCentral = require('azure-iotcentral-device-client');\r\n\r\nconst scopeId = '';\r\nconst deviceId = '';\r\nconst passphrase = ''; //optional\r\nconst cert = {\r\n    cert: \"public cert\"\r\n    key: \"private key\",\r\n    passphrase: \"passphrase\"\r\n}\r\n\r\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'X509_CERT', cert);\r\n```\r\n\r\n#### SAS\r\n```\r\nconst iotCentral = require('azure-iotcentral-device-client');\r\n\r\nconst scopeId = 'scopeID';\r\nconst deviceId = 'deviceID';\r\nconst sasKey = 'masterKey';\r\n\r\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'symm_key', sasKey);\r\n```\r\n\r\n### Connect\r\nUsing callback\r\n```\r\niotc.connect(callback)\r\n```\r\nUsing promises\r\n```\r\niotc.connect().then(()=>{\r\n    console.log('Connected\");\r\n})\r\n```\r\nAfter successfull connection, IOTC context is available for further commands.\r\n\r\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\r\n\r\n### Send telemetry\r\n\r\nSend telemetry every 3 seconds\r\n```\r\nsetInterval(() => {\r\n            iotc.sendTelemetry({\r\n                field1: value1,\r\n                field2: value2,\r\n                field3: value3\r\n            }, timestamp, sendCallback)\r\n```\r\nAn optional timestamp field can be included in the send methods, to specify the UTC date and time of the message. This field must be in ISO format (e.g., YYYY-MM-DDTHH:mm:ss.sssZ). If timestamp is not provided, the current date and time will be used.\r\n\r\n### Send state update\r\n```\r\niotc.sendState({fieldName:'fieldValue'}, timestamp, sendCallback);\r\n```\r\n### Send event\r\n```\r\niotc.sendEvent(event, timestamp, sendCallback);\r\n```\r\n### Send property update\r\n```\r\niotc.sendProperty({fieldName:'fieldValue'}, sendCallback);\r\n```\r\n### Listen to settings update\r\n```\r\niotc.on('SettingsUpdate', callback);\r\n```\r\nTo provide setting sync aknowledgement, just call the _acknowledge()_ method.\r\n```\r\niotc.on('SettingsUpdated',(settings: ISetting[]) => {\r\n            settings.forEach(setting => {\r\n                // do work\r\n                setting.acknowledge('ack',[callback]);\r\n                // or setting.acknoledge() with no message\r\n            });\r\n        });\r\n```\r\n\r\n### Listen to commands\r\n```\r\niotc.on('Command',callback);\r\n```\r\nTo provide feedbacks for a command execution result or progress, call _acknowledge()_ or _update()_ respectively. Remember to specify the command type to better handle progress.\r\n```\r\niotc.on('Command', (cmd: ICommand) => {\r\n            if (cmd.name == 'updFirmware') {\r\n                cmd.type = CommandExecutionType.SYNC;\r\n                cmd.acknowledge('Update completed',[callback]);\r\n            }\r\n            else\r\n                if (cmd.name == 'downloadModel') {\r\n                    cmd.type = CommandExecutionType.ASYNC;\r\n                    cmd.update('Download in progress')\r\n                    .then(()=>{\r\n                        cmd.acknowledge('Command received')\r\n                        .then(()=>{\r\n                            setTimeout(async () => {\r\n                            cmd.update('Download completed');\r\n                            }, 5000);\r\n                        });\r\n                    });\r\n                }\r\n        });\r\n```\r\n\r\n## One-touch device provisioning and approval\r\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\r\n\r\n### How to set IoTC template ID in your device\r\nTemplate Id can be found in the device template page of IoTCentral after selecting \"View Identity\" on the corresponding Capability Model.\r\n\r\n![Img](assets/modelId.jpg)\r\n\r\nThen call this method before connect():\r\n\r\n```\r\niotc.setModelId('<modelId>');\r\n```\r\n\r\n### Automatic approval (default)\r\nBy default device auto-approval in IoT Central is enabled, which means a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\r\n\r\n### Manual approval\r\nTo change default behavior, administrator can disable device auto-approval from Device Connection page under the Administration section.\r\n\r\n![Img](assets/auto_approval.jpg)\r\n\r\n\r\nWhen disabled, administrator needs to approve the device registration to complete the provisioning process.\r\nThis can be done from explorer page after selecting the device\r\n\r\n![Img](assets/manual_approval.jpg)\r\n\r\n\r\n\r\n## Generate x509 certificates\r\nIoT Central SDK comes with a tool to generate self-signed x509 certificates to be used when testing device connection.\r\nIf you want to generate certificates for 6 devices and also validate the authority you can run something like this:\r\n```\r\nconst IoTCentral = require('azure-iotcentral');\r\nconst readline = require('readline');\r\n\r\nconst certificateGenerator = new IoTCentral.CertificateGenerator(6);\r\ncertificateGenerator.init()\r\n    .then(() => {\r\n        console.log('Generating root certificate');\r\n        certificateGenerator.generateRoot.bind(certificateGenerator)()\r\n            .then(() => {\r\n                console.log('Generating device certificates');\r\n                certificateGenerator.createDevices.bind(certificateGenerator)()\r\n                    .then(() => {\r\n                        const rl = readline.createInterface({\r\n                            input: process.stdin,\r\n                            output: process.stdout\r\n                        });\r\n                        rl.question('Insert validation code: ', async (answer) => {\r\n                            const validationCert = await certificateGenerator.validate.bind(certificateGenerator)(answer);\r\n                            console.log(`Validation certificate create at '${validationCert}'`);\r\n                            rl.close()\r\n                        });\r\n                    })\r\n            })\r\n    });\r\n```\r\nThis example wait for a validation code which is provided by IoTCentral in the device configuration page when uploading primary or secondary root certificate.\r\nResulting device certificates can be used in connection example above.","readmeFilename":"README.md","_id":"azure-iotcentral-device-client@1.3.0-preview.1","_nodeVersion":"10.16.3","_npmVersion":"6.10.3","dist":{"integrity":"sha512-UJK4/bvEM4POyJJ6GADFzqjwes7eIb5mPVcsjFItQ7f6ymNEcE7xBfvvWbAmDT75j12fq0NF7iK2SPYhN/fSnA==","shasum":"f1b4ce072cdef6fb7a6433632596169288289074","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.3.0-preview.1.tgz","fileCount":50,"unpackedSize":306264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJduu1pCRA9TVsSAnZWagAADosP/0TihKJQkzcwR7Oi3e4o\n9tN1Hjou+Tiy00wSTL9816diiZFzTeeUsmkohbV17QgTW8baDBX3OvhfM7ua\nsohdvq7J0G3xqfXylWaWAuNbN7YkSWZyHo5kqIrtdqT8XXXLt5weW6LGXW6F\nDlS/2uHwaSNAQ6OcYyOxYyU6tLnQQZmoNDZBwTotplGqJHOK5ucW3A9AmFP2\njE+H445jvzrL1191jKQpU7nrfj7VsjwqIEbuCzW9RYy3K6+G6cDH3PbmMzcW\nTAzKqyces9Oec03aTNLCPRgq5264mLbNPNR0ViRQqBjfbNYBFYRxUwZumhKL\niyTz55r9KmrF470yA44HU92HxTNwRROcJn5rKl00NsPXfKyTai/y5kCrumXh\n7YEAm0oQj9uXtqh43FQq9RtvRXMFOhkwYPGqLXSQbEpth7r13gc1Pkd/O9fx\nZ3+MietSCZQCPeQ1x/hpSmQe12onFBD7mcxeO4/AS5lE2vmPjYFCJiaZWNM3\ntLu5q1j+Vs43Fd/syS+Q6fEfepdmr0ZYLfA+n0ssks3tPXuO6AJk949mkvA3\nuS7ESYb19M7Iax+wgUHgwpZf755AuxZaorLhx2GbK7hDXJusG1nSshcthTU0\nSHkUFdOhIzdmg3qYMzOxOnBxGGcD6/R9hbSWtK8eeYUeec7F47nz3Bn+PQWS\nuKM+\r\n=IW1X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWhIDrk5AUKl3DBbaZQ0WxiluTeqNDd4hOVEFAanoz7AIhAIBhjMIwpWEKbX+J3Ttxdz+bp+TLvHnHOdli+0vDv9YT"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.3.0-preview.1_1572531560589_0.7271996403616281"},"_hasShrinkwrap":false},"1.2.3":{"name":"azure-iotcentral-device-client","version":"1.2.3","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.11.0","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.6.1","azure-iot-provisioning-device-http":"^1.6.1","azure-iot-provisioning-device-mqtt":"^1.5.10","azure-iot-security-symmetric-key":"^1.5.10","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.17.4"},"gitHead":"f8f71223fa18d24ed29f8d02b92772fe45419240","_id":"azure-iotcentral-device-client@1.2.3","_nodeVersion":"10.16.3","_npmVersion":"6.10.3","dist":{"integrity":"sha512-zBClIHUsF6NuEtkQr6pJJqyjnhxVgD11FmrW/21L8qK5zrTjd2M0pbgPd92IPHHGbPD0wiFThCTDtzzRmAtJmQ==","shasum":"842665cca83bec74812df44b96d942283d135a77","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.2.3.tgz","fileCount":50,"unpackedSize":463555,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6RniCRA9TVsSAnZWagAAUngP/20ER46xXYMgIBoLSJgA\nLVFCqNxg2Eio3ZLI4Ii4Cj3MCUNEKXPScmyjzuco8HqG/lggtLcnyuztBnfb\n3znlcv3ZDAiXEoyZb/eVuk6baYIo2uf7jJ9/JXpLy3S9R3dYRVJkWFw2OO0A\nrHel20J+Wkc1GTK7Mh3eOkoz2V8HxkvrMgtejfPgJY+0xVCIwLftTF0dYPox\nywu0clpNZVLA8JJqtilMHWIs9OqOW8ssYrpFugNr7AMAYN/CBIAtpx2LGeE3\nDnPSo9QRJiRwlwTJ4Vw2H4PF+mC05e+gXw4y4AiPLTEJpbQj4kE57dkwdlpr\nsPEecdG9onKU8SrYieKW2+RUjyWPWroxXwoSHB+qOU3UhSw7dDbKDfFidihh\n2+tfPvNIuysd8bepCM0Y/lHY2Xg9/Keo3hAY+x/fcS5tTqMMFIFPfgSpqL/r\nUYqaEya03Sp8TCA2wEvI3h43rq0RttDvYYt60D0Irxcdv0y2fhMcVRt5hzX1\neZcARwsMJb7o/veo0HUbLuD7ASQ5El9TPqOjI+FaMnNTMXaZFa6ojDgyMDiP\nF+u/zaMF5vaNEz/JmxyC1F561vzqSWU6nywBgniMEGrYJOBARhqy5nZGHWa5\nevaMj1nRBAzj3rlgMQYZee8PXmMZ+hDCQ0YQ0CpOszD0wg0crrgOBLeewADk\nwOsi\r\n=Ptrk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAVhuhQF7InnYL05TRSioQIr+pY5PvVZteCFcm8DW9ucAiEA6ucrEp6KrNed4Xu+98QYQeiTJUltUzM/y2Et4nh/5nY="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.2.3_1575557601792_0.9301922462922017"},"_hasShrinkwrap":false},"1.3.0-preview.2":{"name":"azure-iotcentral-device-client","version":"1.3.0-preview.2","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.12.0-preview.2","azure-iot-device":"^1.12.0-preview.2","azure-iot-device-amqp":"^1.12.0-preview.2","azure-iot-device-http":"^1.12.0-preview.2","azure-iot-device-mqtt":"^1.12.0-preview.2","azure-iot-digitaltwins-device":"^1.0.0-preview.3","azure-iot-provisioning-device":"^1.8.0-preview.2","azure-iot-provisioning-device-amqp":"^1.8.0-preview.2","azure-iot-provisioning-device-http":"^1.8.0-preview.2","azure-iot-provisioning-device-mqtt":"^1.8.0-preview.2","azure-iot-security-symmetric-key":"^1.8.0-preview.2","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.14.22","typescript":"^3.6.4"},"readme":"# Microsoft Azure IoTCentral SDK for Node.js (PnP Preview)\n\n[![Join the chat at https://gitter.im/iotdisc/community](https://badges.gitter.im/iotdisc.svg)](https://gitter.im/iotdisc/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![Licensed under the MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/lucadruda/iotc-nodejs-device-client/blob/master/LICENSE)\n\n\n## Prerequisites\n+ Node.js version 8.x or higher - https://nodejs.org\n\n## Installing `azure-iotcentral-device-client` and types\n\n```\nnpm install azure-iotcentral-device-client@pnp-preview\n```\n\n## Samples\n\nA couple of samples in Javascripts can be found [here](https://github.com/lucadruda/iotc-samples)\n\nWhen connecting a device to an IoT Central application an IIoTCClient is initialized.\nSDK supports X509 and SymmetricKey authentication;\n\n## Import\n\n```\nconst IoTCClient = require('azure-iotcentral-device-client').IoTCClient;\n```\n\n## Initialization\n\nCreate method instantiate an IIoTCClient. All available methods can be called using callbacks or promises.\nSupported authentications are x509 and SAS keys.\n\n#### X509\n```\nconst scopeId = '<SCOPE_ID>';\nconst deviceId = '<DEVICE_ID>';\nconst modelId='<CAPABILITY_MODEL_ID>';\nconst connectionType=IOTC_CONNECT.X509_CERT;\nconst passphrase = ''; //optional\nconst cert = {\n    cert: \"public cert\"\n    key: \"private key\",\n    passphrase: \"passphrase\"\n}\n\n\nconst iotc = IoTCClient.create(deviceId,scopeId,modelId,connectionType,cert);\n\n```\n- *scopeId*: The application DPS scope Id\n- *deviceId*: The unique name for the device\n- *modelId*: Id of capability model to assign device to.\n- *cert*: Certificate object\n- *connectionType*: Type of authentication. For certificate value is 'X509_CERT'.\n\n\n#### SAS\n```\n\nconst scopeId = '<SCOPE_ID>';\nconst deviceId = '<DEVICE_ID>';\nconst sasKey = '<SYMM_KEY>';\nconst modelId='<CAPABILITY_MODEL_ID>';\nconst connectionType=IOTC_CONNECT.SYMM_KEY;\n\nconst iotc = IoTCClient.create(deviceId,scopeId,modelId,connectionType,sasKey);\n\n```\n- *scopeId*: The application DPS scope Id\n- *deviceId*: The unique name for the device\n- *modelId*: Id of capability model to assign device to.\n- *sasKey*: The symmetric key (individual or group)\n- *connectionType*: Type of authentication. For symmetric keys use 'SYMM_KEY' for group enrollment with master key or 'DEVICE_KEY' for connection with device key.\n\n## Listen to events\n\nBefore starting a connection, you should register event listeners to receive properties and commands.\n\n### Listen to properties update\n```\niotc.on('PropertiesUpdate', callback);\n```\nTo provide properties sync aknowledgement, just call the _report()_ method.\n```\nconst propertyCallback = (prop) => {\n    console.log(`Received new value '${prop.value}' for property '${prop.name}' in interface '${prop.interfaceName}'`);\n\n    // eventually acknowledge property\n    prop.report(OperationStatus.SUCCESS);\n}\n\niotc.on('PropertiesUpdated',propertyCallback);\n```\n\n### Listen to commands\n```\niotc.on('Command',callback);\n```\nTo provide acknoledgments for command execution result or progress, call _acknowledge()_ or _update()_ respectively. \n```\nconst commandCallback = async (cmd) => {\n    console.log(`Received command '${cmd.name}' with parameter ${cmd.value} from interface '${cmd.interfaceName}'`);\n\n    // e.g. sync command\n    \n    if (cmd.name === 'stop') {\n        console.log('Received stop signal. Exiting...');\n        await cmd.acknowledge(OperationStatus.SUCCESS);\n        if (stopId) {\n            clearInterval(stopId);\n        }\n        process.exit(0);\n    }\n\n    // e.g. async command\n    \n    else if(cmd.name === 'changeSpeed'){\n        console.log('Changing speed);\n        await cmd.acknowledge(OperationStatus.SUCCESS);\n        // do work\n        await cmd.update(OperationStatus.SUCCESS,'Speed successfully changed');\n    }\n}\n```\n### Register interfaces\n\nBefore connecting the device, required interfaces must be declared.\n\nEach single interface can be declared with a single object when calling _addInterface()_.\n\n```\ne.g.\n\niotc.addInterface({\n    name: '<INTERFACE_NAME>',\n    id: '<INTERFACE_ID>',\n    telemetry: ['temperature', 'pressure', 'humidity'],\n    commands: ['stop'],\n    properties: ['fanSpeed']\n});\n```\n\nInterfaces can also be imported from a JSON capability model definition.\n\n```\niotc.setCapabilityModel({<'CAPABILITY_MODEL_JSON'>});\n```\n\n### Connect\n\n```\niotc.connect([callback])\n```\n\nAfter successfull connection, IOTC context is available for further commands.\n\nDevice can listen to connection status changes by registering for the 'ConnectionStatus' event:\n\n```\niotc.on(IOTC_EVENTS.ConnectionStatus, () => {\n    if (client.isConnected()) {\n        console.log('Device is connected!! Starting telemetry...');\n    }\n});\n```\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry for an interface. Multiple telemetries can be sent for the same interface.\n\n```\nlet obj = {\n            temperature: Math.floor(Math.random() * 100),\n            humidity: Math.floor(Math.random() * 100),\n            pressure: Math.floor(Math.random() * 100)\n        };\n        console.log(`Sending ${JSON.stringify(obj)}`);\n        client.sendTelemetry(obj, 'sensors');\n```\n\n### Send property update\n```\niotc.sendProperty({fieldName:'fieldValue'}, '<INTERFACE_NAME>');\n```\n\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central model Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device template page of IoTCentral after selecting \"View Identity\" on the corresponding Capability Model.\n\n![Img](assets/modelId.jpg)\n\n### Automatic approval (default)\nBy default device auto-approval in IoT Central is enabled, which means a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n### Manual approval\nTo change default behavior, administrator can disable device auto-approval from Device Connection page under the Administration section.\n\n![Img](assets/auto_approval.jpg)\n\n\nWhen disabled, administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n\n![Img](assets/manual_approval.jpg)\n\n\n\n## Generate x509 certificates\nIoT Central SDK comes with a tool to generate self-signed x509 certificates to be used when testing device connection.\nIf you want to generate certificates for 6 devices and also validate the authority you can run something like this:\n```\nconst IoTCentral = require('azure-iotcentral');\nconst readline = require('readline');\n\nconst certificateGenerator = new IoTCentral.CertificateGenerator(6);\ncertificateGenerator.init()\n    .then(() => {\n        console.log('Generating root certificate');\n        certificateGenerator.generateRoot.bind(certificateGenerator)()\n            .then(() => {\n                console.log('Generating device certificates');\n                certificateGenerator.createDevices.bind(certificateGenerator)()\n                    .then(() => {\n                        const rl = readline.createInterface({\n                            input: process.stdin,\n                            output: process.stdout\n                        });\n                        rl.question('Insert validation code: ', async (answer) => {\n                            const validationCert = await certificateGenerator.validate.bind(certificateGenerator)(answer);\n                            console.log(`Validation certificate create at '${validationCert}'`);\n                            rl.close()\n                        });\n                    })\n            })\n    });\n```\nThis example wait for a validation code which is provided by IoTCentral in the device configuration page when uploading primary or secondary root certificate.\nResulting device certificates can be used in connection example above.","readmeFilename":"README.md","gitHead":"f19c4b76846082fb4c349e0add74e0c082095622","_id":"azure-iotcentral-device-client@1.3.0-preview.2","_nodeVersion":"12.13.0","_npmVersion":"6.13.0","dist":{"integrity":"sha512-EzzG26Sp/QXc5W0Qvk3z2O6kJ6wNCHuipcEmi5p9NMC26ASKDU9i9Up18cYKWYcx6f6AuL+Mfw6FbW0h0fjotA==","shasum":"f2118959f9488b4c6974b0c97dc45af6571ddbde","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.3.0-preview.2.tgz","fileCount":62,"unpackedSize":312478,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd73zoCRA9TVsSAnZWagAANSMQAIzaExquUY7Pu5Nc9CHb\nfmDIYbYMnoSjiN1S3bf+tu0gbUwFQQ97HiFM7hFZOaUne9q0YrBFzWTZr69L\nUPqmp4IlAVMv5VzT8hnHHFxLobr2yqZkc1diy+sf+fPDlzBv7z/174MqJmH/\n04ShGTnBVHD4WfBavrLp2Hlz4cE7M43NCWuQi0U6H0K9D9InelNjRXT8eqnB\n4x1BNwifLyMUukzKZYiErcbIQm6PixQy7Dj4/T/nwbzmcF39vAaN1/LcCYXq\nYJqfxmhVwyLHWZum9yJHt7bV6kLeaSv3R2RrgfKasTIlaQBxPABotDDUmAEq\n3gOWNVi35BN1n8XSRgdPX4uY1iWx6yHgIDtBuI7rstgmAlnCtgLJkKMdt1eA\nS08OeYLAI77Bwnm2f5c0Aya2qHcHCwzms5V3YzTZ0ffhEp7ga/vbHx1G5rog\n9LLekwt3Vadu9NBUdqwDA/pPosJ1oJ9Xa9YdsCDAD2ET5USPx18RHTO9qImS\nTTS9nmzzPcc5J5yn7N+WNjm0X7FljO6Y1+hFu1gu8v/CDS8lYqhzz26D+J/X\nLzMnq+YwJSrZYAUuTy0w2DQmy0nqhL3HiH+I2ya0skT/gC1oezbZ9JVk8y3q\n2HgPI9wZUEKitL6VbbF+5XeEDvTwvnbKOPpJaRCob+o/pfGaxeUBo9Y28DkP\ny11r\r\n=c1Vd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxaXlOCOV+SiIrxMrdI7/RH5TZnutQ/m3mzlJ6ttYdWwIhAN0IHYh69q9d0AAKN/gbj74CKFk4cIeIKGh1OJRE1AeT"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.3.0-preview.2_1575976168168_0.048883804240499096"},"_hasShrinkwrap":false},"1.3.0-preview.3":{"name":"azure-iotcentral-device-client","version":"1.3.0-preview.3","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.12.0-preview.2","azure-iot-device":"^1.12.0-preview.2","azure-iot-device-amqp":"^1.12.0-preview.2","azure-iot-device-http":"^1.12.0-preview.2","azure-iot-device-mqtt":"^1.12.0-preview.2","azure-iot-digitaltwins-device":"^1.0.0-preview.3","azure-iot-provisioning-device":"^1.8.0-preview.2","azure-iot-provisioning-device-amqp":"^1.8.0-preview.2","azure-iot-provisioning-device-http":"^1.8.0-preview.2","azure-iot-provisioning-device-mqtt":"^1.8.0-preview.2","azure-iot-security-symmetric-key":"^1.8.0-preview.2","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.14.22","typescript":"^3.6.4"},"readme":"# Microsoft Azure IoTCentral SDK for Node.js (PnP Preview)\n\n[![Join the chat at https://gitter.im/iotdisc/community](https://badges.gitter.im/iotdisc.svg)](https://gitter.im/iotdisc/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![Licensed under the MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/lucadruda/iotc-nodejs-device-client/blob/master/LICENSE)\n\n\n## Prerequisites\n+ Node.js version 8.x or higher - https://nodejs.org\n\n## Installing `azure-iotcentral-device-client` and types\n\n```\nnpm install azure-iotcentral-device-client@pnp-preview\n```\n\n## Samples\n\nA couple of samples in Javascripts can be found [here](https://github.com/lucadruda/iotc-samples)\n\nWhen connecting a device to an IoT Central application an IIoTCClient is initialized.\nSDK supports X509 and SymmetricKey authentication;\n\n## Import\n\n```\nconst IoTCClient = require('azure-iotcentral-device-client').IoTCClient;\n```\n\n## Initialization\n\nCreate method instantiate an IIoTCClient. All available methods can be called using callbacks or promises.\nSupported authentications are x509 and SAS keys.\n\n#### X509\n```\nconst scopeId = '<SCOPE_ID>';\nconst deviceId = '<DEVICE_ID>';\nconst modelId='<CAPABILITY_MODEL_ID>';\nconst connectionType=IOTC_CONNECT.X509_CERT;\nconst passphrase = ''; //optional\nconst cert = {\n    cert: \"public cert\"\n    key: \"private key\",\n    passphrase: \"passphrase\"\n}\n\n\nconst iotc = IoTCClient.create(deviceId,scopeId,modelId,connectionType,cert);\n\n```\n- *scopeId*: The application DPS scope Id\n- *deviceId*: The unique name for the device\n- *modelId*: Id of capability model to assign device to. 'null' if not auto-provisioned.\n- *cert*: Certificate object\n- *connectionType*: Type of authentication. For certificate value is 'X509_CERT'.\n\n\n#### SAS\n```\n\nconst scopeId = '<SCOPE_ID>';\nconst deviceId = '<DEVICE_ID>';\nconst sasKey = '<SYMM_KEY>';\nconst modelId='<CAPABILITY_MODEL_ID>';\nconst connectionType=IOTC_CONNECT.SYMM_KEY;\n\nconst iotc = IoTCClient.create(deviceId,scopeId,modelId,connectionType,sasKey);\n\n```\n- *scopeId*: The application DPS scope Id\n- *deviceId*: The unique name for the device\n- *modelId*: Id of capability model to assign device to.\n- *sasKey*: The symmetric key (individual or group)\n- *connectionType*: Type of authentication. For symmetric keys use 'SYMM_KEY' for group enrollment with master key or 'DEVICE_KEY' for connection with device key.\n\n## Listen to events\n\nBefore starting a connection, you should register event listeners to receive properties and commands.\n\n### Listen to properties update\n```\niotc.on('PropertiesUpdate', callback);\n```\nTo provide properties sync aknowledgement, just call the _report()_ method.\n```\nconst propertyCallback = (prop) => {\n    console.log(`Received new value '${prop.value}' for property '${prop.name}' in interface '${prop.interfaceName}'`);\n\n    // eventually acknowledge property\n    prop.report(OperationStatus.SUCCESS);\n}\n\niotc.on('PropertiesUpdated',propertyCallback);\n```\n\n### Listen to commands\n```\niotc.on('Command',callback);\n```\nTo provide acknoledgments for command execution result or progress, call _acknowledge()_ or _update()_ respectively. \n```\nconst commandCallback = async (cmd) => {\n    console.log(`Received command '${cmd.name}' with parameter ${cmd.value} from interface '${cmd.interfaceName}'`);\n\n    // e.g. sync command\n    \n    if (cmd.name === 'stop') {\n        console.log('Received stop signal. Exiting...');\n        await cmd.acknowledge(OperationStatus.SUCCESS);\n        if (stopId) {\n            clearInterval(stopId);\n        }\n        process.exit(0);\n    }\n\n    // e.g. async command\n    \n    else if(cmd.name === 'changeSpeed'){\n        console.log('Changing speed);\n        await cmd.acknowledge(OperationStatus.SUCCESS);\n        // do work\n        await cmd.update(OperationStatus.SUCCESS,'Speed successfully changed');\n    }\n}\n```\n### Register interfaces\n\nBefore connecting the device, required interfaces must be declared.\n\nEach single interface can be declared with a single object when calling _addInterface()_.\n\n```\ne.g.\n\niotc.addInterface({\n    name: '<INTERFACE_NAME>',\n    id: '<INTERFACE_ID>',\n    telemetry: ['temperature', 'pressure', 'humidity'],\n    commands: ['stop'],\n    properties: ['fanSpeed']\n});\n```\n\nInterfaces can also be imported from a JSON capability model definition.\n\n```\niotc.setCapabilityModel({<'CAPABILITY_MODEL_JSON'>});\n```\n\n### Connect\n\n```\niotc.connect([callback])\n```\n\nAfter successfull connection, IOTC context is available for further commands.\n\nDevice can listen to connection status changes by registering for the 'ConnectionStatus' event:\n\n```\niotc.on(IOTC_EVENTS.ConnectionStatus, () => {\n    if (client.isConnected()) {\n        console.log('Device is connected!! Starting telemetry...');\n    }\n});\n```\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry for an interface. Multiple telemetries can be sent for the same interface.\n\n```\nlet obj = {\n            temperature: Math.floor(Math.random() * 100),\n            humidity: Math.floor(Math.random() * 100),\n            pressure: Math.floor(Math.random() * 100)\n        };\n        console.log(`Sending ${JSON.stringify(obj)}`);\n        client.sendTelemetry(obj, 'sensors');\n```\n\n### Send property update\n```\niotc.sendProperty({fieldName:'fieldValue'}, '<INTERFACE_NAME>');\n```\n\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central model Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device template page of IoTCentral after selecting \"View Identity\" on the corresponding Capability Model.\n\n![Img](assets/modelId.jpg)\n\n### Automatic approval (default)\nBy default device auto-approval in IoT Central is enabled, which means a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n### Manual approval\nTo change default behavior, administrator can disable device auto-approval from Device Connection page under the Administration section.\n\n![Img](assets/auto_approval.jpg)\n\n\nWhen disabled, administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n\n![Img](assets/manual_approval.jpg)\n\n\n\n## Generate x509 certificates\nIoT Central SDK comes with a tool to generate self-signed x509 certificates to be used when testing device connection.\nIf you want to generate certificates for 6 devices and also validate the authority you can run something like this:\n```\nconst IoTCentral = require('azure-iotcentral');\nconst readline = require('readline');\n\nconst certificateGenerator = new IoTCentral.CertificateGenerator(6);\ncertificateGenerator.init()\n    .then(() => {\n        console.log('Generating root certificate');\n        certificateGenerator.generateRoot.bind(certificateGenerator)()\n            .then(() => {\n                console.log('Generating device certificates');\n                certificateGenerator.createDevices.bind(certificateGenerator)()\n                    .then(() => {\n                        const rl = readline.createInterface({\n                            input: process.stdin,\n                            output: process.stdout\n                        });\n                        rl.question('Insert validation code: ', async (answer) => {\n                            const validationCert = await certificateGenerator.validate.bind(certificateGenerator)(answer);\n                            console.log(`Validation certificate create at '${validationCert}'`);\n                            rl.close()\n                        });\n                    })\n            })\n    });\n```\nThis example wait for a validation code which is provided by IoTCentral in the device configuration page when uploading primary or secondary root certificate.\nResulting device certificates can be used in connection example above.","readmeFilename":"README.md","gitHead":"5fd05f7267b9ec486dd9888a4bc8bfcb91da83cb","_id":"azure-iotcentral-device-client@1.3.0-preview.3","_nodeVersion":"12.13.0","_npmVersion":"6.13.0","dist":{"integrity":"sha512-nU4rj3PLG+rE1MdYkp8MPmSTBaAItd/j/LFMK36WTPZD+aTWtVd5j+QKOtmsJuvzpCx2JMCq0Sr/wv+2ItxmSQ==","shasum":"e578cb82e48e97616bd46333fbbff436740047d0","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.3.0-preview.3.tgz","fileCount":62,"unpackedSize":312585,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOpY5CRA9TVsSAnZWagAAqDsP/0Um4CraqG4aAPYD8rP9\nXuWv1zO/rcyAFOXWqSzlJ3y+Y/2IYVTdEG9neI8VgA2cB75Ba1hGXiN4JnZJ\nOlR1p2kG7zh4I11Wu6+aWB985UfpgUKNYJ00YNknrdvsYMZwJlXMIWakgWpo\nDUcTe7ExVLiJHkelaYEXbuZLSjRmNrvlb+UyTSAqXB4D7BcKxOXYQalsg8qb\n3S4koLYCJvpGBsyhAqoXw6tMDfvW5Zw81I0PJGYJvKfCFBE56VVPxIFsv98H\nnn2/liWTt7gMM1nHS5pf1vUpbFS96ZO/iAlBosOx9yPPC7FDC6RnXOwWsOyB\nufygHIE6IUf063btYWGf0coEsiR4uPcWIo2ey+95Tuq+UVxr0OPYhgog3HPD\nMXsIVqfcWBp/lDVrU/Vc+gNaQdfxK3AmxUSo4rMTuXALhv8dtpH42cFWxlGQ\nXFeTggq5tO2LAzJum2Qqz3ocK4Wd6ksfFFgzaEyfpUXGhu6HG1RbQgiVA4Fo\nG5FQahYQIoB/Q/fbcZEKAYYz4NhTo2Fm9VoXgQk5zuY8FKKHf5sl7SNhGk8F\npntVaNJMX6KMYspCK786BmNv5WGa3tSwjez+BY1c2jCGfOjILysHBm7YPT2k\noyQd1ELCFtKH5mYr9qqtBkn3lqcsa6YjNY7kkSOBgW45r7Q+x7mmCeMSuGCG\nsblw\r\n=xbmI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfpQReLSpW2kgwXHOqWBCSq8ixY7WMS6Czu7koe/7HBwIhAPKML+vRyZj5cfQr7sTd4pHMdJ11Qj5VzfkbQAKfPfNo"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.3.0-preview.3_1580897849104_0.2009010245072831"},"_hasShrinkwrap":false},"1.3.0-preview.4":{"name":"azure-iotcentral-device-client","version":"1.3.0-preview.4","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.12.0-preview.2","azure-iot-device":"^1.12.0-preview.2","azure-iot-device-amqp":"^1.12.0-preview.2","azure-iot-device-http":"^1.12.0-preview.2","azure-iot-device-mqtt":"^1.12.0-preview.2","azure-iot-digitaltwins-device":"^1.0.0-preview.3","azure-iot-provisioning-device":"^1.8.0-preview.2","azure-iot-provisioning-device-amqp":"^1.8.0-preview.2","azure-iot-provisioning-device-http":"^1.8.0-preview.2","azure-iot-provisioning-device-mqtt":"^1.8.0-preview.2","azure-iot-security-symmetric-key":"^1.8.0-preview.2","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.14.22","typescript":"^3.6.4"},"readme":"# Microsoft Azure IoTCentral SDK for Node.js (PnP Preview)\n\n[![Join the chat at https://gitter.im/iotdisc/community](https://badges.gitter.im/iotdisc.svg)](https://gitter.im/iotdisc/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![Licensed under the MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/lucadruda/iotc-nodejs-device-client/blob/master/LICENSE)\n\n\n## Prerequisites\n+ Node.js version 8.x or higher - https://nodejs.org\n\n## Installing `azure-iotcentral-device-client` and types\n\n```\nnpm install azure-iotcentral-device-client@pnp-preview\n```\n\n## Samples\n\nA couple of samples in Javascripts can be found [here](https://github.com/lucadruda/iotc-samples)\n\nWhen connecting a device to an IoT Central application an IIoTCClient is initialized.\nSDK supports X509 and SymmetricKey authentication;\n\n## Import\n\n```\nconst IoTCClient = require('azure-iotcentral-device-client').IoTCClient;\n```\n\n## Initialization\n\nCreate method instantiate an IIoTCClient. All available methods can be called using callbacks or promises.\nSupported authentications are x509 and SAS keys.\n\n#### X509\n```\nconst scopeId = '<SCOPE_ID>';\nconst deviceId = '<DEVICE_ID>';\nconst modelId='<CAPABILITY_MODEL_ID>';\nconst connectionType=IOTC_CONNECT.X509_CERT;\nconst passphrase = ''; //optional\nconst cert = {\n    cert: \"public cert\"\n    key: \"private key\",\n    passphrase: \"passphrase\"\n}\n\n\nconst iotc = IoTCClient.create(deviceId,scopeId,modelId,connectionType,cert);\n\n```\n- *scopeId*: The application DPS scope Id\n- *deviceId*: The unique name for the device\n- *modelId*: Id of capability model to assign device to. 'null' if not auto-provisioned.\n- *cert*: Certificate object\n- *connectionType*: Type of authentication. For certificate value is 'X509_CERT'.\n\n\n#### SAS\n```\n\nconst scopeId = '<SCOPE_ID>';\nconst deviceId = '<DEVICE_ID>';\nconst sasKey = '<SYMM_KEY>';\nconst modelId='<CAPABILITY_MODEL_ID>';\nconst connectionType=IOTC_CONNECT.SYMM_KEY;\n\nconst iotc = IoTCClient.create(deviceId,scopeId,modelId,connectionType,sasKey);\n\n```\n- *scopeId*: The application DPS scope Id\n- *deviceId*: The unique name for the device\n- *modelId*: Id of capability model to assign device to.\n- *sasKey*: The symmetric key (individual or group)\n- *connectionType*: Type of authentication. For symmetric keys use 'SYMM_KEY' for group enrollment with master key or 'DEVICE_KEY' for connection with device key.\n\n## Listen to events\n\nBefore starting a connection, you should register event listeners to receive properties and commands.\n\n### Listen to properties update\n```\niotc.on('PropertiesUpdate', callback);\n```\nTo provide properties sync aknowledgement, just call the _report()_ method.\n```\nconst propertyCallback = (prop) => {\n    console.log(`Received new value '${prop.value}' for property '${prop.name}' in interface '${prop.interfaceName}'`);\n\n    // eventually acknowledge property\n    prop.report(OperationStatus.SUCCESS);\n}\n\niotc.on('PropertiesUpdated',propertyCallback);\n```\n\n### Listen to commands\n```\niotc.on('Command',callback);\n```\nTo provide acknoledgments for command execution result or progress, call _acknowledge()_ or _update()_ respectively. \n```\nconst commandCallback = async (cmd) => {\n    console.log(`Received command '${cmd.name}' with parameter ${cmd.value} from interface '${cmd.interfaceName}'`);\n\n    // e.g. sync command\n    \n    if (cmd.name === 'stop') {\n        console.log('Received stop signal. Exiting...');\n        await cmd.acknowledge(OperationStatus.SUCCESS);\n        if (stopId) {\n            clearInterval(stopId);\n        }\n        process.exit(0);\n    }\n\n    // e.g. async command\n    \n    else if(cmd.name === 'changeSpeed'){\n        console.log('Changing speed);\n        await cmd.acknowledge(OperationStatus.SUCCESS);\n        // do work\n        await cmd.update(OperationStatus.SUCCESS,'Speed successfully changed');\n    }\n}\n```\n### Register interfaces\n\nBefore connecting the device, required interfaces must be declared.\n\nEach single interface can be declared with a single object when calling _addInterface()_.\n\n```\ne.g.\n\niotc.addInterface({\n    name: '<INTERFACE_NAME>',\n    id: '<INTERFACE_ID>',\n    telemetry: ['temperature', 'pressure', 'humidity'],\n    commands: ['stop'],\n    properties: ['fanSpeed']\n});\n```\n\nInterfaces can also be imported from a JSON capability model definition.\n\n```\niotc.setCapabilityModel({<'CAPABILITY_MODEL_JSON'>});\n```\n\n### Connect\n\n```\niotc.connect([callback])\n```\n\nAfter successfull connection, IOTC context is available for further commands.\n\nDevice can listen to connection status changes by registering for the 'ConnectionStatus' event:\n\n```\niotc.on(IOTC_EVENTS.ConnectionStatus, () => {\n    if (client.isConnected()) {\n        console.log('Device is connected!! Starting telemetry...');\n    }\n});\n```\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry for an interface. Multiple telemetries can be sent for the same interface.\n\n```\nlet obj = {\n            temperature: Math.floor(Math.random() * 100),\n            humidity: Math.floor(Math.random() * 100),\n            pressure: Math.floor(Math.random() * 100)\n        };\n        console.log(`Sending ${JSON.stringify(obj)}`);\n        client.sendTelemetry(obj, 'sensors');\n```\n\n### Send property update\n```\niotc.sendProperty({fieldName:'fieldValue'}, '<INTERFACE_NAME>');\n```\n\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central model Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device template page of IoTCentral after selecting \"View Identity\" on the corresponding Capability Model.\n\n![Img](assets/modelId.jpg)\n\n### Automatic approval (default)\nBy default device auto-approval in IoT Central is enabled, which means a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n### Manual approval\nTo change default behavior, administrator can disable device auto-approval from Device Connection page under the Administration section.\n\n![Img](assets/auto_approval.jpg)\n\n\nWhen disabled, administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n\n![Img](assets/manual_approval.jpg)\n\n\n\n## Generate x509 certificates\nIoT Central SDK comes with a tool to generate self-signed x509 certificates to be used when testing device connection.\nIf you want to generate certificates for 6 devices and also validate the authority you can run something like this:\n```\nconst IoTCentral = require('azure-iotcentral');\nconst readline = require('readline');\n\nconst certificateGenerator = new IoTCentral.CertificateGenerator(6);\ncertificateGenerator.init()\n    .then(() => {\n        console.log('Generating root certificate');\n        certificateGenerator.generateRoot.bind(certificateGenerator)()\n            .then(() => {\n                console.log('Generating device certificates');\n                certificateGenerator.createDevices.bind(certificateGenerator)()\n                    .then(() => {\n                        const rl = readline.createInterface({\n                            input: process.stdin,\n                            output: process.stdout\n                        });\n                        rl.question('Insert validation code: ', async (answer) => {\n                            const validationCert = await certificateGenerator.validate.bind(certificateGenerator)(answer);\n                            console.log(`Validation certificate create at '${validationCert}'`);\n                            rl.close()\n                        });\n                    })\n            })\n    });\n```\nThis example wait for a validation code which is provided by IoTCentral in the device configuration page when uploading primary or secondary root certificate.\nResulting device certificates can be used in connection example above.","readmeFilename":"README.md","gitHead":"b330d502a55841e1d2ff5d91665f51181993cf3d","_id":"azure-iotcentral-device-client@1.3.0-preview.4","_nodeVersion":"12.13.0","_npmVersion":"6.13.0","dist":{"integrity":"sha512-ZrJbYjs5SSdnq0sDH5deAPMNALTtn+1GC84u5XQpXUxjUPyRytMvtgGUblYwdmvD0j3fGiHJvVKX1sbZ1HjAGw==","shasum":"18a4ceaef76d7e0065b2156858ecb3c4d22380d2","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.3.0-preview.4.tgz","fileCount":62,"unpackedSize":312592,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOpkkCRA9TVsSAnZWagAAviwP/RgS+JxWvCwmPZ9OX2LE\nxK5uJhF3+LBesFgDkrKWAmNPHmwPe9GVOmZ2v5mr3hwjxBKLYCErPZJ1RaoI\nf6kp5nisjESTelshqaqUmxeN3AxV/sW2Xk2WMFLB89/ssntatRaZ5h0Hi5Ve\nEd+k1V60tJzQHFey8l6mYye5GmRLfNsug6sW2R7EHsC32CiaJd55T65+WAp1\ngSH0zpIIdvlaFj3DJ25DHgUb0kofoDhbLWoQkbvwn7EIDNlhMXmLWOEAAk69\nWO1X2/nt+Ot59b9ciqFXcZUDv9rUMEw18VfPf/hCk67DH4U1kU8ObAzngDbn\nBrcitnr94vO6eruDKHqSAmdRyWDPZyQLvcNQBvESWLGDcA1Vd9eam80RNBXE\nz91U4swxRcPS9Skiqo448rVBgFLMeMz+TSkyH835NS42a2SuCpbGE5Ip/GJM\nZI+BMPZE/bYbFmNC4fzfttE4fKGYCsyjHaIwV/B/yatNIrdWPb+Z8KqPPvcw\nRdooj/VJ7EG6DXBy71+WAlhVFDFRCZSqmIuZgd1EqQ9a5DeQLO+4QEq+EgbZ\n7WOsQ8/A0IpXtt+o3BOnI5qU4kglWl4IoNcCkMVFFJWIgmTtEI3BW8/SvyHN\nWZrSZ83mfvu49M+MlSYyh1qGZs9HDXChiOMO+i/Roi2m8QRqV+9iPvan03dz\nXJWW\r\n=dgCO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBk+Usk7AjaBLSFkiWYAJK6EwuBRTw/BzP3LisDFTvQvAiAlXw+rfsw3qfoReX5bVRrXJSoi3x6F0IpdoRGtxsMF5w=="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.3.0-preview.4_1580898595720_0.18063617740454574"},"_hasShrinkwrap":false},"1.3.0-preview.5":{"name":"azure-iotcentral-device-client","version":"1.3.0-preview.5","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.12.0-preview.2","azure-iot-device":"^1.12.0-preview.2","azure-iot-device-amqp":"^1.12.0-preview.2","azure-iot-device-http":"^1.12.0-preview.2","azure-iot-device-mqtt":"^1.12.0-preview.2","azure-iot-digitaltwins-device":"^1.0.0-preview.3","azure-iot-provisioning-device":"^1.8.0-preview.2","azure-iot-provisioning-device-amqp":"^1.8.0-preview.2","azure-iot-provisioning-device-http":"^1.8.0-preview.2","azure-iot-provisioning-device-mqtt":"^1.8.0-preview.2","azure-iot-security-symmetric-key":"^1.8.0-preview.2","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.14.22","typescript":"^3.6.4"},"gitHead":"98f976fb23f87c654f7302e0df594844e3ed4cd3","readme":"# Microsoft Azure IoTCentral SDK for Node.js (PnP Preview)\n\n[![Join the chat at https://gitter.im/iotdisc/community](https://badges.gitter.im/iotdisc.svg)](https://gitter.im/iotdisc/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![Licensed under the MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/lucadruda/iotc-nodejs-device-client/blob/master/LICENSE)\n\n\n## Prerequisites\n+ Node.js version 8.x or higher - https://nodejs.org\n\n## Installing `azure-iotcentral-device-client` and types\n\n```\nnpm install azure-iotcentral-device-client@pnp-preview\n```\n\n## Samples\n\nA couple of samples in Javascripts can be found [here](https://github.com/lucadruda/iotc-samples)\n\nWhen connecting a device to an IoT Central application an IIoTCClient is initialized.\nSDK supports X509 and SymmetricKey authentication;\n\n## Import\n\n```\nconst IoTCClient = require('azure-iotcentral-device-client').IoTCClient;\n```\n\n## Initialization\n\nCreate method instantiate an IIoTCClient. All available methods can be called using callbacks or promises.\nSupported authentications are x509 and SAS keys.\n\n#### X509\n```\nconst scopeId = '<SCOPE_ID>';\nconst deviceId = '<DEVICE_ID>';\nconst modelId='<CAPABILITY_MODEL_ID>';\nconst connectionType=IOTC_CONNECT.X509_CERT;\nconst passphrase = ''; //optional\nconst cert = {\n    cert: \"public cert\"\n    key: \"private key\",\n    passphrase: \"passphrase\"\n}\n\n\nconst iotc = IoTCClient.create(deviceId,scopeId,modelId,connectionType,cert);\n\n```\n- *scopeId*: The application DPS scope Id\n- *deviceId*: The unique name for the device\n- *modelId*: Id of capability model to assign device to. 'null' if not auto-provisioned.\n- *cert*: Certificate object\n- *connectionType*: Type of authentication. For certificate value is 'X509_CERT'.\n\n\n#### SAS\n```\n\nconst scopeId = '<SCOPE_ID>';\nconst deviceId = '<DEVICE_ID>';\nconst sasKey = '<SYMM_KEY>';\nconst modelId='<CAPABILITY_MODEL_ID>';\nconst connectionType=IOTC_CONNECT.SYMM_KEY;\n\nconst iotc = IoTCClient.create(deviceId,scopeId,modelId,connectionType,sasKey);\n\n```\n- *scopeId*: The application DPS scope Id\n- *deviceId*: The unique name for the device\n- *modelId*: Id of capability model to assign device to.\n- *sasKey*: The symmetric key (individual or group)\n- *connectionType*: Type of authentication. For symmetric keys use 'SYMM_KEY' for group enrollment with master key or 'DEVICE_KEY' for connection with device key.\n\n## Listen to events\n\nBefore starting a connection, you should register event listeners to receive properties and commands.\n\n### Listen to properties update\n```\niotc.on('PropertiesUpdate', callback);\n```\nTo provide properties sync aknowledgement, just call the _report()_ method.\n```\nconst propertyCallback = (prop) => {\n    console.log(`Received new value '${prop.value}' for property '${prop.name}' in interface '${prop.interfaceName}'`);\n\n    // eventually acknowledge property\n    prop.report(OperationStatus.SUCCESS);\n}\n\niotc.on('PropertiesUpdated',propertyCallback);\n```\n\n### Listen to commands\n```\niotc.on('Command',callback);\n```\nTo provide acknoledgments for command execution result or progress, call _acknowledge()_ or _update()_ respectively. \n```\nconst commandCallback = async (cmd) => {\n    console.log(`Received command '${cmd.name}' with parameter ${cmd.value} from interface '${cmd.interfaceName}'`);\n\n    // e.g. sync command\n    \n    if (cmd.name === 'stop') {\n        console.log('Received stop signal. Exiting...');\n        await cmd.acknowledge(OperationStatus.SUCCESS);\n        if (stopId) {\n            clearInterval(stopId);\n        }\n        process.exit(0);\n    }\n\n    // e.g. async command\n    \n    else if(cmd.name === 'changeSpeed'){\n        console.log('Changing speed);\n        await cmd.acknowledge(OperationStatus.SUCCESS);\n        // do work\n        await cmd.update(OperationStatus.SUCCESS,'Speed successfully changed');\n    }\n}\n```\n### Register interfaces\n\nBefore connecting the device, required interfaces must be declared.\n\nEach single interface can be declared with a single object when calling _addInterface()_.\n\n```\ne.g.\n\niotc.addInterface({\n    name: '<INTERFACE_NAME>',\n    id: '<INTERFACE_ID>',\n    telemetry: ['temperature', 'pressure', 'humidity'],\n    commands: ['stop'],\n    properties: ['fanSpeed']\n});\n```\n\nInterfaces can also be imported from a JSON capability model definition.\n\n```\niotc.setCapabilityModel({<'CAPABILITY_MODEL_JSON'>});\n```\n\n### Connect\n\n```\niotc.connect([callback])\n```\n\nAfter successfull connection, IOTC context is available for further commands.\n\nDevice can listen to connection status changes by registering for the 'ConnectionStatus' event:\n\n```\niotc.on(IOTC_EVENTS.ConnectionStatus, () => {\n    if (client.isConnected()) {\n        console.log('Device is connected!! Starting telemetry...');\n    }\n});\n```\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry for an interface. Multiple telemetries can be sent for the same interface.\n\n```\nlet obj = {\n            temperature: Math.floor(Math.random() * 100),\n            humidity: Math.floor(Math.random() * 100),\n            pressure: Math.floor(Math.random() * 100)\n        };\n        console.log(`Sending ${JSON.stringify(obj)}`);\n        client.sendTelemetry(obj, 'sensors');\n```\n\n### Send property update\n```\niotc.sendProperty({fieldName:'fieldValue'}, '<INTERFACE_NAME>');\n```\n\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central model Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device template page of IoTCentral after selecting \"View Identity\" on the corresponding Capability Model.\n\n![Img](assets/modelId.jpg)\n\n### Automatic approval (default)\nBy default device auto-approval in IoT Central is enabled, which means a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n### Manual approval\nTo change default behavior, administrator can disable device auto-approval from Device Connection page under the Administration section.\n\n![Img](assets/auto_approval.jpg)\n\n\nWhen disabled, administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n\n![Img](assets/manual_approval.jpg)\n\n\n\n## Generate x509 certificates\nIoT Central SDK comes with a tool to generate self-signed x509 certificates to be used when testing device connection.\nIf you want to generate certificates for 6 devices and also validate the authority you can run something like this:\n```\nconst IoTCentral = require('azure-iotcentral');\nconst readline = require('readline');\n\nconst certificateGenerator = new IoTCentral.CertificateGenerator(6);\ncertificateGenerator.init()\n    .then(() => {\n        console.log('Generating root certificate');\n        certificateGenerator.generateRoot.bind(certificateGenerator)()\n            .then(() => {\n                console.log('Generating device certificates');\n                certificateGenerator.createDevices.bind(certificateGenerator)()\n                    .then(() => {\n                        const rl = readline.createInterface({\n                            input: process.stdin,\n                            output: process.stdout\n                        });\n                        rl.question('Insert validation code: ', async (answer) => {\n                            const validationCert = await certificateGenerator.validate.bind(certificateGenerator)(answer);\n                            console.log(`Validation certificate create at '${validationCert}'`);\n                            rl.close()\n                        });\n                    })\n            })\n    });\n```\nThis example wait for a validation code which is provided by IoTCentral in the device configuration page when uploading primary or secondary root certificate.\nResulting device certificates can be used in connection example above.","readmeFilename":"README.md","_id":"azure-iotcentral-device-client@1.3.0-preview.5","_nodeVersion":"12.13.0","_npmVersion":"6.13.0","dist":{"integrity":"sha512-bn9bHk3pBnABahnyr0xm/iNw/N6pLHM6vW3G8t5MhrqTet4DzhylgCAjCNPP0lOfR5T1xTudPXnHsBTaYZW89Q==","shasum":"a254817188fd972cb311a3eb5265fbc564a23784","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.3.0-preview.5.tgz","fileCount":62,"unpackedSize":312600,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOpnLCRA9TVsSAnZWagAAM0IP/0PdhtJXOykw/2QaE47j\nt3Z1HeKJF56IzGBQ3SEPni1sLB2D2WcO/ulUUWYg673yDL/B95rYCzR527Xs\naiA0M75wB99zYgCUfbznd0AkJIktn/SBPJpOQ3bMAMGKDFTgvTI7QeSQVtX9\nADIJ2bMmBSW5kZdxwl84P//WB9vG7SPyIEMKII+Wv2siQo0Cccyhdn+hmURL\nlbVleHAHlox/JHdT/h/GGek5spOfz8wXI4I4zJjQquNMxoewWeq8gXzOS0pC\nN/e7jGrhs3ixTSAQEYdaBMBnASpkqkMNl7h6wihDPC/zXhFyc8zQN0Pz1HWM\nmaDVqoBO4TAwsO+eq9m0n2+pbxjZHln7Ieq1tKxfd9CSSVr6sjaMen0V6N6N\n+a7clAz7wn25/MVIzmrx9zUJkvcURB/r82U53qq3098IYRwJNvQYcsJqfCcm\nhnr9QK8uo4KU9fSaEREnEzHhPSrPb7knW5eBcaB8FkThVvrs+hj2uHpQ6FOc\nVrY8DqZVhs5w0fleMLz2HU7+rw8FzYhu75yQiiAr011KSqGrS988JNl7hZld\nlF2lKKfJSlZE6Wx5dweS3U8Nax2ZH4SIljiBw2ZBxyPCx5xiMeUxI2Sc8Wlr\nFFpARMvIwTHQnlmzkHJsKgV9pcPA4YXuSP2+R6636XxhVxMftqod6HZlWGNO\nnY/p\r\n=BGEF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBYkQFcRcr7T/hzlamWlTa6nVkXb52CCEKkeBk+J7MT3AiBEZ/m2wryD79raS0VrXhnFTLWmAZ/KLUcSUPpX8T7Zfw=="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.3.0-preview.5_1580898762642_0.5352496203744528"},"_hasShrinkwrap":false},"1.2.4":{"name":"azure-iotcentral-device-client","version":"1.2.4","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.11.0","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.6.1","azure-iot-provisioning-device-http":"^1.6.1","azure-iot-provisioning-device-mqtt":"^1.5.10","azure-iot-security-symmetric-key":"^1.5.10","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.17.4"},"gitHead":"22f1f3fd5fd08ad9314e19bfadb798e007d04be0","_id":"azure-iotcentral-device-client@1.2.4","_nodeVersion":"12.13.0","_npmVersion":"6.13.0","dist":{"integrity":"sha512-FIuI2NK9t2tFC6qq2oVCqTpJX4M64SMS80L4oYL1Su12ale0cDscIEjxkGdnR7cW8malXkCkhuWItR6Zs1onbQ==","shasum":"ea20c08b114ae9d24513855dc60e1aef26e06c26","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.2.4.tgz","fileCount":62,"unpackedSize":469945,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQnSTCRA9TVsSAnZWagAAXVoQAISIK4S2c5zbOMBOcyBs\n3Bfq9SgrpOIWesnaXmGIki63HVyXiAAQrDWPAaMXMNTAFlZI+f5Ydjw7dfWf\njeGLWsPAyZX7gIzFMklpVQTLU7Ts0OXLZloRICh3FmKCzssqxA15RPMqlPfB\n3E4SUacTnTvbUd/mKi0XepwQ5NcU4BP4fGzLR1kZOmX5JfwQ2igg73RtMOx5\na89lILgwEGJqNKdi8be+Kk3fe1RYko/COfUm+JS8bEI0FzMK2Sfqo5TmCVrw\n5hjO9wKUHlBgN2QjAiVNsaVdksw/wKvUgYXolNZygX2S0th9OYm4MHsAX3qp\nWaoi7vyAlcSlZi666KAmLoq1Zk6thvKhUva4oxNdahdcowQDf5J8g3cmAFF4\n4/E/h1F1fl7gx4uwk5T97BHx+5SLmSC+xajOfRnpZZIAAa03HEXRGWbdtkNm\n58T/AIQaw4dqvKw2bid8dTXemvnnuXliOAyAMFsLriHaTFjsTv24DKxGpbsQ\nAJmuszWG5QuIi+q4qAxk1yJEKCEhcpDAD9X7j5Sovo00otfA+GlI27a2coDI\n4ndk/49O0ySVZ3fD4CTuFJNUwKkRTImx4jXUldhu16LTmOyRiNxOgOYWlQCD\nvk775WCDMhalFmXcbuL/ruqgkCVfYmfhFyAwGhNUa9Lmgn3Ci/QwJDBmEM5j\neOFU\r\n=tOoM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAy1kMKGCreqmShx05TmuvPug++etg+nXtoliDdw3hIfAiEA2ty8Au//0dRZI+MvH2cFcLNQMWFvwvTsm1auHV/vAg8="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.2.4_1581413523204_0.18511634590879122"},"_hasShrinkwrap":false},"1.2.5":{"name":"azure-iotcentral-device-client","version":"1.2.5","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"build":"tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.11.0","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.6.1","azure-iot-provisioning-device-http":"^1.6.1","azure-iot-provisioning-device-mqtt":"^1.5.10","azure-iot-security-symmetric-key":"^1.5.10","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.17.4"},"gitHead":"7a77d39147e9e8ff9f7ac734c2de420591359bfc","_id":"azure-iotcentral-device-client@1.2.5","_nodeVersion":"12.13.0","_npmVersion":"6.13.0","dist":{"integrity":"sha512-YSJbpmm7j5OpAs7AM53RcjGFif77UVTR9W0nXLGaykcWg7MsPx3nOnbMTdSwM5tHthxFQ1NHn+v22Akgx5yEOw==","shasum":"ee36cb9284f3e0c21054a8b904e7440951a63c0e","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.2.5.tgz","fileCount":32,"unpackedSize":436936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQnTPCRA9TVsSAnZWagAAlMYQAJJ2Ld+T44GwhA+1v6wU\nF9jX+mleFge2wuR247KZaehiB3EwIWSQ+rGrQYP9G1lLFjSbRZayRofGmExA\nbkcEcQlcZ7X8zHukD9WFJRqtvt8IPvxli1RP8cWIMCFvLgNX/l/9if0qxkAw\nK5g85ILJrQ9aQQQZId4xfMhc0tVr1L7dkhHE9bIkGZM6rWK50O0awNZuz7tU\nusyYg3OsdW8IXSHawVtsslW+kNI+6goP9TqG7xcRobyWItgTtGUF7QCW3Rf4\nzwo6s7dvLVQHhNoHpleH2PY8GJr5xRA+aisAZuGsmWtEaw1yBB0dGZyI9esG\njd53ma/3l0eWpAGAi/L9pp3Y4JRM9OXMCl5Yw/vZHBr7Af/qBdH2ro8ubr4r\nhQGpKWcx1o6dWTErYZnjBzXtix+VZwOya2BaM9KFB8edkSMf9nw+bM9CvZgu\nnt7QBz5vFNE45DFgfFkCuhPD+W2/JRTgWyQx13D82Iykfz9uJEdw9RFURQis\nFwILp/t1VHBYIA3CkZfYRMnPKmLlmzPPt/OZy9EyPvIa+/D9R651fVGxks+Z\nlLzIvQL9ZM6DeXjTSjSoBJj4vgIclsaYIW7lhc6u11QvFjiHaAhfGNxDqCiD\n4Rf6O6/LVCPQMKy4loDEQxR7gP3q0w1hLlLWYHJk7BYES6p+kppvfM1QxpYY\neMOa\r\n=XSZ1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXi2LDFTBhPCXiy0C58NaUltlCDNhCmFcVItcYyLEYjwIhAORc6WJKabzSEe0sDOuuwVFgcEnF8kdiJVmRcUF+QYY2"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.2.5_1581413582818_0.17245294561884394"},"_hasShrinkwrap":false},"1.3.1-beta.0":{"name":"azure-iotcentral-device-client","version":"1.3.1-beta.0","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"clean":"rimraf ./dist","build":"npm run clean && tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.11.0","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.6.1","azure-iot-provisioning-device-http":"^1.6.1","azure-iot-provisioning-device-mqtt":"^1.5.10","azure-iot-security-symmetric-key":"^1.5.10","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.17.4"},"readme":"# Microsoft Azure IoTCentral SDK for Node.js\n\n[![Join the chat at https://gitter.im/iotdisc/community](https://badges.gitter.im/iotdisc.svg)](https://gitter.im/iotdisc/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![Licensed under the MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/lucadruda/iotc-nodejs-device-client/blob/master/LICENSE)\n\n\n## Prerequisites\n+ Node.js version 8.x or higher - https://nodejs.org\n\n## Installing `azure-iotcentral-device-client` and types\n\n```\nnpm install azure-iotcentral-device-client\n```\n\n## Samples\n\nA couple of samples in Javascripts can be found [here](https://github.com/lucadruda/iotc-samples)\n\nWhen connecting a device to an IoT Central application an IoTCClient is initialized.\nSDK supports X509 and SymmetricKey authentication;\n\n#### X509\n```\nconst iotCentral = require('azure-iotcentral-device-client');\n\nconst scopeId = '';\nconst deviceId = '';\nconst passphrase = ''; //optional\nconst cert = {\n    cert: \"public cert\"\n    key: \"private key\",\n    passphrase: \"passphrase\"\n}\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'X509_CERT', cert);\n```\n\n#### SAS\n```\nconst iotCentral = require('azure-iotcentral-device-client');\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'symm_key', sasKey);\n```\n\n### Connect\nUsing callback\n```\niotc.connect(callback)\n```\nUsing promises\n```\niotc.connect().then(()=>{\n    console.log('Connected\");\n})\n```\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```\nsetInterval(() => {\n            iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties, sendCallback)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send state update\n```\niotc.sendState({fieldName:'fieldValue'}, timestamp, sendCallback);\n```\n### Send event\n```\niotc.sendEvent(event, timestamp, sendCallback);\n```\n### Send property update\n```\niotc.sendProperty({fieldName:'fieldValue'}, sendCallback);\n```\n### Listen to settings update\n```\niotc.on('SettingsUpdate', callback);\n```\nTo provide setting sync aknowledgement, the client can send back a property with the same name of the setting and a particular value object.\n```\niotc.on('SettingsUpdated', (val) => {\n            Object.keys(val).forEach(setting => {\n                iotc.sendProperty({\n                    [setting]: {\n                        value: val[setting].value,\n                        status: 'completed',\n                        desiredVersion: val.$version,\n                        message: 'whatever'\n                    }\n                });\n            });\n        });\n```\n\n### Listen to commands\n```\niotc.on('Command',callback);\n```\nTo provide feedbacks for the command like execution result or progress, the client can send back a property with the same name of the executing command.\n```\niotc.on('Command', (cmd) => {\n    // send execution start feedback\n    iotc.sendProperty({\n                [cmd.commandName]: { \n                    value: 'Command execution started at ' + new Date().toISOString(),\n                    requestId:cmd.requestId\n                    }\n            }, sendCallback);\n        });\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](assets/auto_approval.jpg)\n\n## Generate x509 certificates\nIoT Central SDK comes with a tool to generate self-signed x509 certificates to be used when testing device connection.\nIf you want to generate certificates for 6 devices and also validate the authority you can run something like this:\n```\nconst IoTCentral = require('azure-iotcentral');\nconst readline = require('readline');\n\nconst certificateGenerator = new IoTCentral.CertificateGenerator(6);\ncertificateGenerator.init()\n    .then(() => {\n        console.log('Generating root certificate');\n        certificateGenerator.generateRoot.bind(certificateGenerator)()\n            .then(() => {\n                console.log('Generating device certificates');\n                certificateGenerator.createDevices.bind(certificateGenerator)()\n                    .then(() => {\n                        const rl = readline.createInterface({\n                            input: process.stdin,\n                            output: process.stdout\n                        });\n                        rl.question('Insert validation code: ', async (answer) => {\n                            const validationCert = await certificateGenerator.validate.bind(certificateGenerator)(answer);\n                            console.log(`Validation certificate create at '${validationCert}'`);\n                            rl.close()\n                        });\n                    })\n            })\n    });\n```\nThis example wait for a validation code which is provided by IoTCentral in the device configuration page when uploading primary or secondary root certificate.\nResulting device certificates can be used in connection example above.","readmeFilename":"README.md","gitHead":"7173d796cd331e7fb30b6732e71112f5fd48e634","_id":"azure-iotcentral-device-client@1.3.1-beta.0","_nodeVersion":"10.16.3","_npmVersion":"6.10.3","dist":{"integrity":"sha512-043sYZk/VuSM0E7k1kIbnA9G8l6Eth5SNZe1Hhhn3D9sGrmXTRnXbE9CB/z+JORIRHsMcfuF8DHwtitNUH77Rg==","shasum":"5a9cb400f7e29cbe415aa5ca642775e438de1355","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.3.1-beta.0.tgz","fileCount":32,"unpackedSize":440049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeYjtrCRA9TVsSAnZWagAATb8QAI5qbojA41aJrDzw3U6b\nEeu5uA6FfINfkUaNv8+158qLY202J93Be/Vhz3K8cPDW7vsmy9vSS++hXzYV\nWr3yLNBdQZMNpbAGDyOUC2X+cMk/uKaJ+XK2PExjOB9RInMvBfN+uJ+AfDnP\nGQF7z/kbKnkzLjgCXC29HSAT18Y8QMNO34M/rg7sgHa53JPRELPajzHLUB3b\nNTdowzktIyGf8hUIZPTvweKOsovHk3+MKRuSvcxyX47qryvwlmsO6ne5H0km\nShtYsonVquCbtX50n5wQ8pW5MGzGei9Bio22kj3o3Zd1TkoHKEYJRKwkn8VS\n5vbUkCZIg2Gs0JFXryh0XG+zezOqW2BGmPehmcyHnnpohuqrKp3kmufuTN06\nl18wCnJxepOxUmuPAQRj9Fm7u6LG2dRVvFbp3lFCKl/hvchLgEgInxQlN38c\n++5dNj9nP7R5B1cD+C94jK864o+w/+0NgBDBf++7SlBXHysLbQP8Io+7exrH\nsYp3n/Umxos7yS7PajeE0RUKkZISvrjAIKg3dZWbaGqYmVsMz8zchzBnAV7P\nEbCw7IROuseDUdBTRGVJzvjxnt+Zyce75Iy3nyDLzuINB2ocpI9ZmlGZdMCj\nL1fv6OI4ZHvIAp6mk88ip/zTCEPFDmKckHpaY84VYXrvQThc7Kgkrw6VnIZh\nt/i8\r\n=Z0Pk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID9xfbkTLJUeShbVGJAxIMVrs79hurVzJ+CgnY0Qms2nAiEAunI2z9/ZuwMayY2JA8T5rgzasD7wMnwUK4f3rCDPO+k="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.3.1-beta.0_1583496043242_0.0323212950612517"},"_hasShrinkwrap":false},"1.3.0":{"name":"azure-iotcentral-device-client","version":"1.3.0","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"clean":"rimraf ./dist","build":"npm run clean && tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.8.2","azure-iot-device":"^1.11.0","azure-iot-device-amqp":"^1.8.1","azure-iot-device-http":"^1.8.1","azure-iot-device-mqtt":"^1.8.1","azure-iot-provisioning-device-amqp":"^1.6.1","azure-iot-provisioning-device-http":"^1.6.1","azure-iot-provisioning-device-mqtt":"^1.5.10","azure-iot-security-symmetric-key":"^1.5.10","azure-iot-security-x509":"^1.3.2","azure-iothub":"^1.8.1","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.5","uuid":"^3.3.2"},"devDependencies":{"@types/node":"^10.17.4"},"gitHead":"84924f77388964cb213418ec344f92b488a485a1","_id":"azure-iotcentral-device-client@1.3.0","_nodeVersion":"12.16.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-0boktyS30hBbd+O7hL5tLCnyLIrLhfSUSNKvVGFXM5v9VlGQnCqYNH2RlfB8Isn9YCzDTye+3Qsjy8HRFaru0g==","shasum":"58fa086c98677e5e73c8725bf1c61a7a55efe3a9","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.3.0.tgz","fileCount":32,"unpackedSize":440044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegiisCRA9TVsSAnZWagAAAK4P/iAYnY1cw/hm/OARtoTj\nXT+nEq3lOXCSa3VD+GFFSyibn8ESyqqvkj+XJnxiOHCmefAq3FUHCTOKzI7C\njSNFJSMsystuzlrZFEA3DSkMEFmEJvScXj8mu/Ey58J71i8b0SOLQJN8pcpt\nI1XZQwrUu2ZUN7NUID02xnduHvqG6en+AsOVQbUePotUmRMo9PYgRm3AboFs\nxNizUFt6kDXzcEybVQOOFAioBtc9ZApy+q4ACs77PLpVozZPyFlJCun0nZIa\nOV/5hMQG+RRzZ1P1DP3vOGvtctq70PPRgsxokb/5RxlNghcs280yvqJXTGhV\n9bgOqRIUInCJiYctuOLHLuqMU2Rrh4YrGkaaV8imM+Za3pAv4vUnVVkYLK1A\nAxWqEnTY6CxJBu/RTeQRaboKWadDcvoY7HWJidTWLQxpq0GAwYLgEbLZCicO\nF2Zdg1implJqkXUk0eyIc9/DiFrZTizJt5RhgN6C/h8TaYr6KYVTVLsQPSNO\njtd0EIn4RPN/nH7lpYq8aPe/7/f0FrWBKytU3Ey6QpStb34P70VNiPpimfka\nd/h2n/6w8q3CYqO7L4TQMu0/KXDVxbHTSRV0YyDGM+jAjd9H+g6un2dSKW+p\nageuFOwKJbdBn3+3oESSPIen/V5LW2cg6Idp0XjAQbV+4aXVU1f2TUpSQqst\nCBic\r\n=yJw4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfkGPBmx7JQJgJuIJR9uGGVlPEZHWXL5aYPFW7raExCwIhAID6wGRef+t1XsEWseOHArw7lwHF8D+am6aDX9SaZ8Y2"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.3.0_1585588395821_0.5671472434572435"},"_hasShrinkwrap":false},"1.3.1":{"name":"azure-iotcentral-device-client","version":"1.3.1","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"clean":"rimraf ./dist","build":"npm run clean && tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.12.0","azure-iot-device":"^1.13.0","azure-iot-device-amqp":"^1.12.0","azure-iot-device-http":"^1.12.0","azure-iot-device-mqtt":"^1.12.0","azure-iot-provisioning-device-amqp":"^1.8.0","azure-iot-provisioning-device-http":"^1.8.0","azure-iot-provisioning-device-mqtt":"^1.7.0","azure-iot-security-symmetric-key":"^1.7.0","azure-iot-security-x509":"^1.7.0","azure-iothub":"^1.12.0","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.11","uuid":"^3.4.0"},"devDependencies":{"@types/node":"^10.17.18"},"gitHead":"b73c5d75cc85816541d4f9552899c5e7c3daab83","_id":"azure-iotcentral-device-client@1.3.1","_nodeVersion":"12.16.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-6NMKqitDwA3mVERohtV61M3P1GWyEGgrjnWrawoH/vQcAM2KoUN/VhW7rSGPBdF1wS+q1AFrdAcnbHa1A5kMxA==","shasum":"32e647549b6f371e2f38b24c3bfd775d954245a3","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.3.1.tgz","fileCount":32,"unpackedSize":440049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehF5xCRA9TVsSAnZWagAAQ2oQAJWFiEvciFX4bjH5exQU\nFXe5fyEJMOCTe5HPkNr/nTazq2U+joiJE/TS9pBgkDHKiAN69Sz86qU4bxvx\n3lVrl99t45uLV6JmMaaTgSzVLHP12C9YuAtAqn1Id9Boc8inK1d1TjTV/jJF\n3tX85lrR5oFMnLbfQLnzgt2zN+UyZ/+Xo65EMaekIBM3UHpdIIyZXsqftfA6\n3kRPIErMt4j+lnKYHmMI7aD2mEb/kMjYP7U5J/r5A87jakAM2yDgvYT6ufez\nKP4MKssV99pF2DbIdF6vmgXFTVJf2EI4gEcAJyi0+MthmAkPmFxeMKf9Ip9b\nnizMnWIPJ0fk4OZFrV7QnieS464OuttCNkkvy9Fii3BDNn/Csf3lcd6dOLvY\n/NZuvMn3RjiK3JLo0rtY2Ehzcz1c2jxE2P2c66GCSF1cUyeZglnxPD18h8Rl\n5kM+Kw9ppYDafyVRXubAKwVmOWzhvB99GuoajTDVeBg0VrOqFmc9UalY6Or1\nL5lySmhSzUp3zmyb5LzA6KYu72H9+UTKTzHNAMG396HQyvz2CQsEmWsUc/UZ\nTmJmozhigX0X7MKdB4gwhKx9DNVn/HHTbzbaNgkGCfXb3DEVHDwV34Mo5URh\nhsitI4P7A8w5NDZ7Aq36uxCLZbo4dw7lGbo75beSAAU/IG7xBDST7XGdGQwF\nQz/x\r\n=uT4s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCETpEEI4aHPo9TLdrXqY3zQTiajPpSecURncn/ix9pdgIhAMNI7KwMjnRpW1ewprBj7zbN9Hs/7h/jLOppff/Tb/gh"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.3.1_1585733233418_0.9877995894579876"},"_hasShrinkwrap":false},"1.3.2":{"name":"azure-iotcentral-device-client","version":"1.3.2","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"clean":"rimraf ./dist","build":"npm run clean && node_modules/.bin/tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.12.0","azure-iot-device":"^1.13.0","azure-iot-device-amqp":"^1.12.0","azure-iot-device-http":"^1.12.0","azure-iot-device-mqtt":"^1.12.0","azure-iot-provisioning-device-amqp":"^1.8.0","azure-iot-provisioning-device-http":"^1.8.0","azure-iot-provisioning-device-mqtt":"^1.7.0","azure-iot-security-symmetric-key":"^1.7.0","azure-iot-security-x509":"^1.7.0","azure-iothub":"^1.12.0","fs-extra":"^7.0.1","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.11","uuid":"^3.4.0"},"devDependencies":{"@types/node":"^10.17.18","rimraf":"^3.0.2","typescript":"^3.8.3"},"gitHead":"aa16afe70cbce4029413b0cecc4e5a71636198e4","_id":"azure-iotcentral-device-client@1.3.2","_nodeVersion":"12.13.0","_npmVersion":"6.13.0","dist":{"integrity":"sha512-yCn4qb2H3QWl7LMmkY6JMBs8q71tLv/NrpvVFuD9wPPETFsQQ6YJ3gTyCcIl22jtuvdy7DEEymA+PUowC3WXNQ==","shasum":"86148c255e96cef8b08f340f265eab2ebe546816","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.3.2.tgz","fileCount":32,"unpackedSize":438848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesoykCRA9TVsSAnZWagAAtkoP/A9LQ0sfo/rIwvCXGlwd\nqzG4W7y+pRMpPw+WGjuSPXsJuyT9QrkrwZnyr18lqwKV6oSa9FqwpN+i/4YJ\n72XOUfyNJRq5mQG8Z/zkL28EjHdtwQuxd19vRUw5imC7CchKjVG3+fBKeS7f\njot0IqUS1zJG2Ef/3AtgZuFM7aWZNtHYNs3uwG9nUmfdBA8fOhEM7EU+wEor\nBBdOep2Av3+EwEteKVOo1jGGBlcSA5tI+LvHNWiTdlNmorB7EawUYC+9PSfA\nN+oJeTIN1j6eH6eoutkkmqPrKgLIJiaAma91Lt4+GU4DT0iMHjy6GXdmlnM+\nLd+Y0HQuojCUy4yxdFj2kAC2EOEcHWW3f3LmNypvxJsLbSXlhjFHngPXH6zb\nRbbd5O0S5HbZgFdHqJeLKv0mdfQPJbehb9fw09/Xsbj5oqtP0Kgvzcvqvy5p\nk1sy7Tr0cmNRm7Cc2q5EIE7WBWTzwL5+VqERLT7YrjXrQGJySgz1bxJtGAr0\nWB1G7U62B5yd8d5mukLhsMlnQh1PlgIwCMxvIUUZP2Am9YeHA0L1HiANTp+G\nlY+XDt1WxulsGpO+WyGAR31XHTfCycKqvIYNPkN2PyvQx2YymDARKTrk7oAv\nuLbT44tJoldVB9JrnhjwJwPidMCE9z6IUT2Q+6vMd5ya7Oorft9AwuTzxZJb\nU9Fw\r\n=7EVY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSyUB9zw3a2Pd/OsOjxtlOmPPeMlsfwhxNU4J+K/N6DwIhAOB/1ajvZzAwBUQa8002JUhbd3y6Way6rUuccC8OMudZ"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.3.2_1588759715552_0.762923847929051"},"_hasShrinkwrap":false},"1.4.0":{"name":"azure-iotcentral-device-client","version":"1.4.0","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"clean":"rimraf ./dist","build":"npm run clean && node_modules/.bin/tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.12.5","azure-iot-device":"^1.17.1","azure-iot-device-amqp":"^1.13.1","azure-iot-device-http":"^1.13.1","azure-iot-device-mqtt":"^1.15.1","azure-iot-provisioning-device-amqp":"^1.8.5","azure-iot-provisioning-device-http":"^1.8.5","azure-iot-provisioning-device-mqtt":"^1.7.5","azure-iot-security-symmetric-key":"^1.7.5","azure-iot-security-x509":"^1.7.5","azure-iothub":"^1.12.5","fs-extra":"^9.0.1","mqtt":"^4.2.1","openssl-wrapper":"^0.3.4","rhea":"^1.0.24","uuid":"^8.3.0"},"devDependencies":{"@types/node":"^14.6.0","rimraf":"^3.0.2","typescript":"^4.0.2"},"gitHead":"d119fb2f446a0fc138df61c6e9eb459212f4b9c5","_id":"azure-iotcentral-device-client@1.4.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-IeTlc6pBkASlatswM/4BWrwTwqzXArIR93datAPM+ul8qeTivaLreXeGkr+2cn3jvUzqgTSA28+eZVnkjgPWfw==","shasum":"6cd354a952cb2ae08798b91f5771b27123846a97","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-1.4.0.tgz","fileCount":32,"unpackedSize":434832,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRjEVCRA9TVsSAnZWagAAkNoP/0Fe7NdzUMShCE9r6cpt\nGUALna9/rNEdyAn/WJsdS9SfnJWqs4ZjsOPaZq7klXk7FP3KxiGCm6q2ELbJ\ndAs9zL1yCDrM7iVZwRHwwWea3vhhEuwSXrg1rXBDqK46aFAr5hJRXIxeXerp\nX+fjYFi4iywllxKFErofqh/86q/MREa85A8Q+5QaBsPKm0cAO6KEzNm4kZCo\n5oqC3crh7fttU1gCLYbn/Fm+3Avb5FozxSgdX/09O7D5/NN63SRrgxBVhtrv\nyb93mhn2htVnWd9i7OQyzVrq3YR+BnQNEYnjHLkMFgB5IPHhyWJL3tGiGS8D\nIG7aEbVagSlbIaMAuL3tgRJEJ5hUgizHroarDjzX3bkQZ2CXpWBnPMd9KbnP\nH9Wnn2FEPnhQIdmCpz73HuqbjRAaD33dZlOuQVIMIjggy3mLiMg891SBP3xo\nvt7WOvm2u//qPdhOpfA+YZpWRJ93vnihTU+86qKDKQRjuxhzQZ6UacE3Q/UF\n0sP7f6AUk6HV/Ou2NxK2ai0/1+uqDmc6QLzlnLy3Wino7KpP1A/InJ8vrt3o\nAtSehbyH/RzVtf+ADOEHhLsMHgnAzOWfETZz8aP9c8s27oAfZd5QJZKKAhmk\n1ERanexRBsbgLIWEJv+d422DaxVlMY6IURQE7k4bNwlk1IYKdkQ1pZijkVq6\nMMHj\r\n=VxrI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+1KJ/5x/mh+VKujUdNhFHOmTMvxpyelPKlkfG0IEK1QIhAIzXQ4q/ZsEQxukZKEPyFhGvkb3/N0Ftfbc/frsxcY34"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_1.4.0_1598435604659_0.829806377252301"},"_hasShrinkwrap":false},"2.0.0-beta.0":{"name":"azure-iotcentral-device-client","version":"2.0.0-beta.0","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"clean":"rimraf ./dist","build":"npm run clean && tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.12.6","azure-iot-device":"^1.17.2","azure-iot-device-amqp":"^1.13.2","azure-iot-device-http":"^1.13.2","azure-iot-device-mqtt":"^1.15.2","azure-iot-provisioning-device-amqp":"^1.8.6","azure-iot-provisioning-device-http":"^1.8.6","azure-iot-provisioning-device-mqtt":"^1.7.6","azure-iot-security-symmetric-key":"^1.7.6","azure-iot-security-x509":"^1.7.6","azure-iothub":"^1.13.0","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.11","uuid":"^3.4.0"},"devDependencies":{"@types/node":"^10.17.18","rimraf":"^3.0.2"},"readme":"# Microsoft Azure IoTCentral SDK for Node.js\n\n[![Join the chat at https://gitter.im/iotdisc/community](https://badges.gitter.im/iotdisc.svg)](https://gitter.im/iotdisc/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![Licensed under the MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/lucadruda/iotc-nodejs-device-client/blob/master/LICENSE)\n\n\n## Prerequisites\n+ Node.js version 8.x or higher - https://nodejs.org\n\n## Installing `azure-iotcentral-device-client` and types\n\n```\nnpm install azure-iotcentral-device-client\n```\n\n## Samples\n\nA couple of samples in Javascripts can be found [here](https://github.com/lucadruda/iotc-samples)\n\nWhen connecting a device to an IoT Central application an IoTCClient is initialized.\nSDK supports X509 and SymmetricKey authentication;\n\n#### X509\n```\nconst iotCentral = require('azure-iotcentral-device-client');\n\nconst scopeId = '';\nconst deviceId = '';\nconst passphrase = ''; //optional\nconst cert = {\n    cert: \"public cert\"\n    key: \"private key\",\n    passphrase: \"passphrase\"\n}\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'X509_CERT', cert);\n```\n\n#### SAS\n```\nconst iotCentral = require('azure-iotcentral-device-client');\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'symm_key', sasKey);\n```\n\n### Connect\nUsing callback\n```\niotc.connect(callback)\n```\nUsing promises\n```\niotc.connect().then(()=>{\n    console.log('Connected\");\n})\n```\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```\nsetInterval(() => {\n            iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties, sendCallback)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send state update\n```\niotc.sendState({fieldName:'fieldValue'}, properties, sendCallback);\n```\n### Send event\n```\niotc.sendEvent(event, properties, sendCallback);\n```\n### Send property update\n```\niotc.sendProperty({fieldName:'fieldValue'}, sendCallback);\n```\n### Listen to settings update\n```\niotc.on('SettingsUpdate', callback);\n```\nTo provide setting sync aknowledgement, the client can send back a property with the same name of the setting and a particular value object.\n```\niotc.on('SettingsUpdated', (val) => {\n            Object.keys(val).forEach(setting => {\n                iotc.sendProperty({\n                    [setting]: {\n                        value: val[setting].value,\n                        status: 'completed',\n                        desiredVersion: val.$version,\n                        message: 'whatever'\n                    }\n                });\n            });\n        });\n```\n\n### Listen to commands\n```\niotc.on('Command',callback);\n```\nTo provide feedbacks for the command like execution result or progress, the client can send back a property with the same name of the executing command.\n```\niotc.on('Command', (cmd) => {\n    // send execution start feedback\n    iotc.sendProperty({\n                [cmd.commandName]: { \n                    value: 'Command execution started at ' + new Date().toISOString(),\n                    requestId:cmd.requestId\n                    }\n            }, sendCallback);\n        });\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](assets/auto_approval.jpg)\n\n## Generate x509 certificates\nIoT Central SDK comes with a tool to generate self-signed x509 certificates to be used when testing device connection.\nIf you want to generate certificates for 6 devices and also validate the authority you can run something like this:\n```\nconst IoTCentral = require('azure-iotcentral');\nconst readline = require('readline');\n\nconst certificateGenerator = new IoTCentral.CertificateGenerator(6);\ncertificateGenerator.init()\n    .then(() => {\n        console.log('Generating root certificate');\n        certificateGenerator.generateRoot.bind(certificateGenerator)()\n            .then(() => {\n                console.log('Generating device certificates');\n                certificateGenerator.createDevices.bind(certificateGenerator)()\n                    .then(() => {\n                        const rl = readline.createInterface({\n                            input: process.stdin,\n                            output: process.stdout\n                        });\n                        rl.question('Insert validation code: ', async (answer) => {\n                            const validationCert = await certificateGenerator.validate.bind(certificateGenerator)(answer);\n                            console.log(`Validation certificate create at '${validationCert}'`);\n                            rl.close()\n                        });\n                    })\n            })\n    });\n```\nThis example wait for a validation code which is provided by IoTCentral in the device configuration page when uploading primary or secondary root certificate.\nResulting device certificates can be used in connection example above.","readmeFilename":"README.md","gitHead":"2b920169c8aa4fd14a2ff46a0562c361356d5e1b","_id":"azure-iotcentral-device-client@2.0.0-beta.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-syGA0xbm6bvmttdbv7A6UH0DLLQSSMjn1KyAxfwOxr0Si6ch/I2/+XUPQLhvlkYttTiKGAeqWgVofE2LmuR6HQ==","shasum":"801afae11a4910ae8985b86fdde8a10b4a478685","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-2.0.0-beta.0.tgz","fileCount":35,"unpackedSize":441429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffeYLCRA9TVsSAnZWagAAFowP/1uc4IdZI6kIruVf8jmV\nOWBMV5MMKkXH2OX7MKnRiOQxKBp5Sj0kFWYLn2RY0cg5WJfLP9hU1uhXMZBi\nit0rL/xuKCg/O4LnG4ixQVxeCubLSNBMY9He9nayz/LRpAkTYaA8WaRn4O/k\nVWuklFe/Av5Pw2DKIv5zMmtUqeL4WMAt+L/4ZzcMmB6EGzw+ssN7vBxaibI1\nErceHcKGkPM1/9BLq30OCqyXulUDJtbhqEc9Z+lvpDPmImp3zEOQq7SqEtLV\nvD63V6OohvuIOw/QvhTw4bKusD/4b3YnS0IfAlDv2u20BpZooJ0SLruSeWdl\npYmz+syfWgSGRazP/LsMpqJJXcqcvKpIMwlQcERAlsMfzVRhpTgrehlUHE1j\n9Nbnpk6/nQpnIul3q4fhr00PeqkFyNodOOkvG+QpFy+m4rOJnWaEWsl0Lrw+\n4MtN/4xbUJSsiT9GhqRaplnjqEpyX8gcceur+uX6miUaxskl0igo/5mT/JWn\nHjRjEEtioTrTP9TnprIsRAdLlV8nxRMOotzaNlKiMHNoxSATHVfJZp1YJqgO\n7NZO/mB9M4qiHUwtF3m/kDgYIzt0XGlhwmp85TEAQl//nyMTdu3c5pvIDoZ0\nC/wNT0kmgs6an/vmV4D/7a47fJt6oAqbUIgd177tovBkh8zIvVUj1yWK60nD\nPhJh\r\n=OkpZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGof3IuEaD9Ir/CORXgYfa638Bbiwu4r4gHRbQUMrK1dAiBm1xeKyZydLX6vUMLHdIZQRhJOJpi1HKihts5PQSUjYg=="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_2.0.0-beta.0_1602086411182_0.00044277459180119827"},"_hasShrinkwrap":false},"2.0.0-beta.1":{"name":"azure-iotcentral-device-client","version":"2.0.0-beta.1","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"clean":"rimraf ./dist","build":"npm run clean && tsc","prepare":"npm run build"},"dependencies":{"azure-iot-common":"^1.12.6","azure-iot-device":"^1.17.2","azure-iot-device-amqp":"^1.13.2","azure-iot-device-http":"^1.13.2","azure-iot-device-mqtt":"^1.15.2","azure-iot-provisioning-device-amqp":"^1.8.6","azure-iot-provisioning-device-http":"^1.8.6","azure-iot-provisioning-device-mqtt":"^1.7.6","azure-iot-security-symmetric-key":"^1.7.6","azure-iot-security-x509":"^1.7.6","azure-iothub":"^1.13.0","mqtt":"^3.0.0","openssl-wrapper":"^0.3.4","rhea":"^0.3.11","uuid":"^3.4.0"},"devDependencies":{"@types/node":"^10.17.18","rimraf":"^3.0.2"},"readme":"# Microsoft Azure IoTCentral SDK for Node.js\n\n[![Join the chat at https://gitter.im/iotdisc/community](https://badges.gitter.im/iotdisc.svg)](https://gitter.im/iotdisc/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![Licensed under the MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/lucadruda/iotc-nodejs-device-client/blob/master/LICENSE)\n\n\n## Prerequisites\n+ Node.js version 8.x or higher - https://nodejs.org\n\n## Installing `azure-iotcentral-device-client` and types\n\n```\nnpm install azure-iotcentral-device-client\n```\n\n## Samples\n\nA couple of samples in Javascripts can be found [here](https://github.com/lucadruda/iotc-samples)\n\nWhen connecting a device to an IoT Central application an IoTCClient is initialized.\nSDK supports X509 and SymmetricKey authentication;\n\n#### X509\n```\nconst iotCentral = require('azure-iotcentral-device-client');\n\nconst scopeId = '';\nconst deviceId = '';\nconst passphrase = ''; //optional\nconst cert = {\n    cert: \"public cert\"\n    key: \"private key\",\n    passphrase: \"passphrase\"\n}\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'X509_CERT', cert);\n```\n\n#### SAS\n```\nconst iotCentral = require('azure-iotcentral-device-client');\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'symm_key', sasKey);\n```\n\n### Connect\nUsing callback\n```\niotc.connect(callback)\n```\nUsing promises\n```\niotc.connect().then(()=>{\n    console.log('Connected\");\n})\n```\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```\nsetInterval(() => {\n            iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties, sendCallback)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send state update\n```\niotc.sendState({fieldName:'fieldValue'}, properties, sendCallback);\n```\n### Send event\n```\niotc.sendEvent(event, properties, sendCallback);\n```\n### Send property update\n```\niotc.sendProperty({fieldName:'fieldValue'}, sendCallback);\n```\n### Listen to settings update\n```\niotc.on('SettingsUpdate', callback);\n```\nTo provide setting sync aknowledgement, the client can send back a property with the same name of the setting and a particular value object.\n```\niotc.on('SettingsUpdated', (val) => {\n            Object.keys(val).forEach(setting => {\n                iotc.sendProperty({\n                    [setting]: {\n                        value: val[setting].value,\n                        status: 'completed',\n                        desiredVersion: val.$version,\n                        message: 'whatever'\n                    }\n                });\n            });\n        });\n```\n\n### Listen to commands\n```\niotc.on('Command',callback);\n```\nTo provide feedbacks for the command like execution result or progress, the client can send back a property with the same name of the executing command.\n```\niotc.on('Command', (cmd) => {\n    // send execution start feedback\n    iotc.sendProperty({\n                [cmd.commandName]: { \n                    value: 'Command execution started at ' + new Date().toISOString(),\n                    requestId:cmd.requestId\n                    }\n            }, sendCallback);\n        });\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](assets/auto_approval.jpg)\n\n## Generate x509 certificates\nIoT Central SDK comes with a tool to generate self-signed x509 certificates to be used when testing device connection.\nIf you want to generate certificates for 6 devices and also validate the authority you can run something like this:\n```\nconst IoTCentral = require('azure-iotcentral');\nconst readline = require('readline');\n\nconst certificateGenerator = new IoTCentral.CertificateGenerator(6);\ncertificateGenerator.init()\n    .then(() => {\n        console.log('Generating root certificate');\n        certificateGenerator.generateRoot.bind(certificateGenerator)()\n            .then(() => {\n                console.log('Generating device certificates');\n                certificateGenerator.createDevices.bind(certificateGenerator)()\n                    .then(() => {\n                        const rl = readline.createInterface({\n                            input: process.stdin,\n                            output: process.stdout\n                        });\n                        rl.question('Insert validation code: ', async (answer) => {\n                            const validationCert = await certificateGenerator.validate.bind(certificateGenerator)(answer);\n                            console.log(`Validation certificate create at '${validationCert}'`);\n                            rl.close()\n                        });\n                    })\n            })\n    });\n```\nThis example wait for a validation code which is provided by IoTCentral in the device configuration page when uploading primary or secondary root certificate.\nResulting device certificates can be used in connection example above.","readmeFilename":"README.md","gitHead":"10219b022a8c9d64214c1fa76fb234e59c058044","_id":"azure-iotcentral-device-client@2.0.0-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-NQBFzHXUhSrp77DBI7D076cnmEnIDPakvy8v5mMK7qmi1OuCNn2hVSB3uKy1eVlYu6XNYsEvLpHNJrqy1qTQ5Q==","shasum":"b00f4879fa16456401e030e995da7d555ce8b713","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-2.0.0-beta.1.tgz","fileCount":35,"unpackedSize":442328,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffecMCRA9TVsSAnZWagAAXnMQAIzyyqIsPkGQGr0vgztT\n8VYC0rt+zibDQ+Vx+yltaodpz3FbyUn4C5uf4bnOGJ2afe/VJOiP2qb3Jhor\ncZpBV1w0GUlvu49G83kFTDfjTY+aAt3iGboqhz4YS9CqyCqzn5nOe7gE2jiQ\nZIMmnPRQTLZ5eWZM4AsB9DQ+vQ3lUTCRwEml1SqnNt4cOvtZnCcIZA6faHDH\nVSutdokfQw+pwA8Hg/YunhkyIrgc+khUwp7xgWGirpfE5Arnu5ulLPHIYMVx\ng+rJNhJxob1DboqCiqouhAMhVbA63jRSDHPmaJ2DjfmrS/9qEbCuJSAIe4K/\n6cqq2BXedacb2MxatpIdeYWF9/MH0wXAxEz0HJIUJAGnpBaw5zvAzKuOnFEY\nRHpmGFzbQMcBzIMtu5MKF+I1te2o3SwBcMHSBOcC7eT+WPPGosXtLEP31qAa\nm5rrbrTJ/v7EV9z7JvyMXvSns9k/9aM9APrHzUvkq/BUDEyGHporb+02Y/zw\nRg6z4ma8AGZ8OaNhf8fjkKflF6XSq9uHL8iEKdm+H518k08c92EmjY6kyKrN\nYPF4f878qxBC32Reie1gZQ4hlGfeCN+3wTB9x5qXYZOz8d5jtl2DXIo/W7MZ\nUfx70qVaOt+IzIQIL2XMKD9RyNGfD+8LsxL4zOOsPFpdwY1iEp9HgprKBX3v\nmLDb\r\n=554M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2UwsiWKiiOmPfDHGa9ytFVBPEK3tgWLvkGO5DjXN56wIgH1pQrbKPcWdjqCfI+Vs6egIbCWe0l+IyT0R5OkZxUGM="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_2.0.0-beta.1_1602086667620_0.2467630917773107"},"_hasShrinkwrap":false},"2.0.0":{"name":"azure-iotcentral-device-client","version":"2.0.0","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"clean":"rimraf ./dist","build":"npm run clean && tsc","build:samples":"tsc -p samples/ts","prepare":"npm run build && npm run build:samples","generate-certificates":"node ./dist/utils/certificates.js"},"dependencies":{"azure-iot-common":"^1.12.6","azure-iot-device":"^1.17.2","azure-iot-device-amqp":"^1.13.2","azure-iot-device-http":"^1.13.2","azure-iot-device-mqtt":"^1.15.2","azure-iot-provisioning-device-amqp":"^1.8.6","azure-iot-provisioning-device-http":"^1.8.6","azure-iot-provisioning-device-mqtt":"^1.7.6","azure-iot-security-symmetric-key":"^1.7.6","azure-iot-security-x509":"^1.7.6","azure-iothub":"^1.13.0","mqtt":"^3.0.0","node-forge":"^0.10.0","rhea":"^0.3.11","uuid":"^3.4.0"},"devDependencies":{"@types/node":"^10.17.37","@types/node-forge":"^0.9.5","rimraf":"^3.0.2","typescript":"^4.0.3"},"gitHead":"9a0cb3918aab7e09835f9c1dd18ed8e0fc3b2ade","_id":"azure-iotcentral-device-client@2.0.0","_nodeVersion":"12.16.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-8GtJGMO5771RPEsx528Vng7H3Q4UBiyx3XCl10DFrHIQlT62narB8hNny6Nb6I0/3WY+wjnCPHFKsmdKaeRqWw==","shasum":"834fbe523e8850e94370ec3ff910d4302a60d78d","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-2.0.0.tgz","fileCount":35,"unpackedSize":502220,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhDGACRA9TVsSAnZWagAAWrgP/2RROhZNtPArziRaEkYA\n9i2PkSJDWibvx02gLpjreEneUt3dCozMr2FzdVxtTnJXHEQ0kHzKUcrNrjXX\nN3EFAIHYV5XhdFo2biFrqC3QRA/TpvGOAmuQVWYafrXNGKzAoLbeiMEpXdNE\nF5vD6Wvk62TbCdXYyc+xfYZan7tRi8Th1AnaNNMSyswTOXdr7sAc1GuHUTpD\ndIyrt9xI0vdiQSFpgqQohjaVtrW77UOUfBP5yOz6GxH6DgGWJGaRS/RMJg5n\nniqHDf8PXq0eX6zs0APEIfwZsBzK4hOxpld2NMKseyZFIf3WzBaxbaGF3zUk\nKjAKpFk1qwdemzfYhBW+g1KrAbdx6ZkNNo5PueHOJVCdc0972GTc77SnCShi\nTaOlTjtfx/wpS+u4odrhZY7vQlUVMssrCFG/tay4YwySsFcOVO/X5VXDET60\n2DojaMVIp/KbSDXUcACyabJVSWRzMSPsXCyum8MipIVb99q49E29sArmoh7h\nuNYABNrOT+Utu/+yUDAwDhEjTI9bnOoGGlRxe14YeKd+Doi3KD5L7ci+dNHR\neZP76QBYxwG4nlLYTzi40n1tNlixnH5I9hQCt8x2XdQiMk+V76TeQZAbN+VE\nxLFJta5dHQKreNgX/zVfuopMkn+ABL2KFS4TxcSQxVoeSMKzAFzO6IBcyign\nYCQ6\r\n=glGp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcZFmFjbQNMAL+pp4deHXBZpZ6oLHLquOvVbHe/IdCMAIgRXmemM77o82o7UWHvwouSIhDPj3mGXRfPVHu0aMJjME="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_2.0.0_1602498944148_0.2826679857481751"},"_hasShrinkwrap":false},"2.0.1-beta.1":{"name":"azure-iotcentral-device-client","version":"2.0.1-beta.1","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"clean":"rimraf ./dist","build":"npm run clean && tsc","build:samples":"tsc -p samples/ts","prepare":"npm run build && npm run build:samples","generate-certificates":"node ./dist/utils/certificates.js"},"dependencies":{"@azure/storage-blob":"^12.2.1","azure-iot-common":"^1.12.6","azure-iot-device":"^1.17.2","azure-iot-device-amqp":"^1.13.2","azure-iot-device-http":"^1.13.2","azure-iot-device-mqtt":"^1.15.2","azure-iot-provisioning-device-amqp":"^1.8.6","azure-iot-provisioning-device-http":"^1.8.6","azure-iot-provisioning-device-mqtt":"^1.7.6","azure-iot-security-symmetric-key":"^1.7.6","azure-iot-security-x509":"^1.7.6","azure-iothub":"^1.13.0","mqtt":"^3.0.0","node-forge":"^0.10.0","rhea":"^0.3.11","uuid":"^3.4.0"},"devDependencies":{"@types/node":"^10.17.37","@types/node-forge":"^0.9.5","rimraf":"^3.0.2","typescript":"^4.0.3"},"readme":"# Microsoft Azure IoTCentral SDK for Node.js\n\n[![Join the chat at https://gitter.im/iotdisc/community](https://badges.gitter.im/iotdisc.svg)](https://gitter.im/iotdisc/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![Licensed under the MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/lucadruda/iotc-nodejs-device-client/blob/master/LICENSE)\n\n\n## Prerequisites\n+ Node.js version 8.x or higher - https://nodejs.org\n\n## Installing `azure-iotcentral-device-client` and types\n\n```\nnpm install azure-iotcentral-device-client\n```\n\n## Types\n\nSource code is written in Typescript so types are bundled with the package, you don't need to install any additional package.\n\n\n## Samples\n\nA couple of samples in Javascripts can be found [here](https://github.com/lucadruda/iotc-samples)\n\n\n## Instructions\n\nWhen connecting a device to an IoT Central application an IoTCClient is initialized.\nSDK supports X509 and SymmetricKey authentication;\n\n#### X509\n```js\nconst iotCentral = require('azure-iotcentral-device-client');\n\nconst scopeId = '';\nconst deviceId = '';\nconst passphrase = ''; //optional\nconst cert = {\n    cert: \"public cert\"\n    key: \"private key\",\n    passphrase: \"passphrase\"\n}\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'X509_CERT', cert);\n```\n\n#### SAS\n```js\nconst iotCentral = require('azure-iotcentral-device-client');\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'symm_key', sasKey);\n```\n\n### Connect\n```ts\nawait iotc.connect([timeout]);\n```\nAfter successfull connection, IOTC context is available for further commands.\n\n_connect_ accepts an optional timeout in seconds for connection operation.\n\n<br/>\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async () => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, [properties]);\n})\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'},[properties]);\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\n\n\n### Listen to properties update\n```js\niotc.on('Properties', callback);\n```\ne.g.\n```js\nconst onPropertyChange = async (prop)=>{\n    console.log(`New value ${prop.value} for property ${prop.name}`);\n    await prop.ack(); // sync property value with the cloud\n}\n\niotc.on('Properties',onPropertyChange);\n```\n\n### Listen to commands and offline commands\n```js\niotc.on('Commands', callback);\n```\ne.g.\n```js\nconst onCommandReceived = async (cmd) => {\n    console.log(`Received command '${cmd.name}'${cmd.requestPayload ? ` with payload ${cmd.requestPayload}` : '.'}`);\n    // command has been successfully executed\n    await cmd.reply(IIoTCCommandResponse.SUCCESS, 'Completed');\n}\n\niotc.on('Commands', callback);\n\n```\n\nFor offline command, callback will trigger both when device is connected and when a command is enqueued and device re-connect after disconnession.\n\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nDevice template id (a.k.a Model Id) is used when obtaining authorization codes for new devices and automatically assign them to the right template. By providing template id during credentials generation, user doesn't need to manually migrate or assign device from IoT Central site.\n\nIn order to get the unique identifier, open configuration page for required model under \"Device templates\" section.\n![Img](assets/modelId.png)\n\nClick on \"View Identity\" and in next screen copy model urn.\n![Img](assets/modelId_2.png)\n\n\nThen call this method before connect():\n\n```js\niotc.setModelId('<modelId>');\n```\n\n### Automatic approval (default)\nBy default device auto-approval in IoT Central is enabled, which means that administrators don't need to approve device registration to complete the provisioning process when device is not already created.\n\n![Img](assets/auto_approval.jpg)\n\n### Manual approval\nIf auto-approval is disabled, administrators need to manually approve new devices.\nThis can be done from explorer page after selecting the device\n![Img](assets/manual_approval.jpg)\n\n\n## Generate x509 certificates\nIoT Central SDK comes with an handy tool to generate self-signed x509 certificates to be used when testing device connection.\n\n```bash\nnpm run generate-certificates\n```\n\nThis example wait for a validation code which is provided by IoTCentral in the device configuration page when uploading primary or secondary root certificate.\nResulting device certificates can be used in connection example above.\n\nInstructions on connecting devices using x.509 on IoT Central [here.](https://docs.microsoft.com/en-us/azure/iot-central/core/concepts-get-connected#connect-devices-using-x509-certificates)","readmeFilename":"README.md","gitHead":"09298d269876ce7d190b56207ae4c24ff89e4964","_id":"azure-iotcentral-device-client@2.0.1-beta.1","_nodeVersion":"12.16.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-TFm40J4UxnCxfHkUpkU8amJxT0UJalEoiUcq2IBSp62c/vQSuTKKZCrFcBcR18t4NyE2+Jwd6n5xHXAqyJ4jDw==","shasum":"874a42614fc99691618cfdb0ecf85c5b728f2d95","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-2.0.1-beta.1.tgz","fileCount":35,"unpackedSize":504202,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJoiaCRA9TVsSAnZWagAA3XoP/2YlqCPITLYGX4kN4nSE\nfKVccmmpmS38wfrvq9DO2F1yuobRyyuVMRos/Jx0sYBBg+1KXCBscGSx2I7l\nU+MRjfsimobww58iyfkWJ8BDvIxnAF+VR8COU57muOqWsV/5feikGJoWaPOJ\nbvyCwS3k5qp4sI2kYt1A++fy5Qxqx1S7THq8fHWTrqg2WUCu22MlGV5XkRiM\nrvDwYgzRj+5OI4MC28XMwp2PywZPPqIeXPkjFkN/DFOwpP2313cf9+9YyL2S\nqmXH2bPylgCliz8Xa//2zSI9GaNN8SylbZSfWtqhdhLr9MIAb1b8ptwHP5fy\nmeyNyAAu0pi359TdbVzNXWpZ/jVb1NzsL8UhvzGB3sc5S1FIhlRyHTO3QE9S\nnaKUugOcg8UhrpClaRF02xn2YCcWeepdApOt7BkxpR/sn/3SIBvpkMQEcIwY\n66pjGhp6JNPBgX2PAB/BPcOPyLgXuDe5bhSCbi58BsqezM0Xh2jLEcX7Zr5u\nt1K6DBbnDdNydte+IVabCN7Ys72PmQQVtRUm0PFd+adNvGsLoZv0XuifayYb\nG0qtZ8tVCND5I+olK89Q7skFVv/zI83px0TpUsOJKBFo1/9OV+yBiBJwjxYV\n9ptsd1yPzc6MJbNgCUDhusBSGsAecm7IPTmRnAgtZX8/5OzcLFU3pNuPtI4k\nHiii\r\n=J+/v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9PFdw1Z6IuQMsHyP6mHmWbBwAX8tqe9hQZ8zfR99QxgIhAPevyL/BtKJ3ALuVUb3UEscKM7JgXSu4cE/trPMO598o"}]},"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_2.0.1-beta.1_1613138074142_0.1552196302557245"},"_hasShrinkwrap":false},"2.0.1":{"name":"azure-iotcentral-device-client","version":"2.0.1","description":"Azure IoTCentral NodeJs SDK","main":"dist/index.js","author":{"name":"Luca Druda"},"license":"MIT","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client","scripts":{"clean":"rimraf ./dist","build":"npm run clean && tsc","build:samples":"tsc -p samples/ts","prepare":"npm run build && npm run build:samples","generate-certificates":"node ./dist/utils/certificates.js"},"dependencies":{"@azure/storage-blob":"^12.5.0","azure-iot-common":"^1.12.8","azure-iot-device":"^1.17.3","azure-iot-device-amqp":"^1.13.3","azure-iot-device-http":"^1.13.3","azure-iot-device-mqtt":"^1.15.3","azure-iot-provisioning-device-amqp":"^1.8.7","azure-iot-provisioning-device-http":"^1.8.7","azure-iot-provisioning-device-mqtt":"^1.7.7","azure-iot-security-symmetric-key":"^1.7.7","azure-iot-security-x509":"^1.7.7","azure-iothub":"^1.14.0","mqtt":"^3.0.0","node-forge":"^0.10.0","rhea":"^0.3.11","uuid":"^3.4.0"},"devDependencies":{"@types/node":"^10.17.60","@types/node-forge":"^0.9.7","rimraf":"^3.0.2","typescript":"^4.2.4"},"gitHead":"497dcef1b1b7e71772fde13c20da8d6270926346","_id":"azure-iotcentral-device-client@2.0.1","_nodeVersion":"12.16.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-/eFwtSpyUFI/9pSlQWPUASdUPyNgbtOy4WLNtH7hUyrnwrplXReeNgy5ZusTmKMQiqfrcDmw6hdgKrVjBQkPBg==","shasum":"957a351dc69c88929f26886f9f3f091901430f81","tarball":"https://registry.npmjs.org/azure-iotcentral-device-client/-/azure-iotcentral-device-client-2.0.1.tgz","fileCount":35,"unpackedSize":504240,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgo+1bCRA9TVsSAnZWagAAfQQQAJW5gxWNGsR0m+rBAm90\nZvw9NfCFLPc/pK7TfBPz5qdYlutl3b9wSJznV31sZtChF4Yqb5eA43zCxGVS\nYBtR5S51e/rCW8zRPySqyPpPMbtfPyYiYI5KXFSZCAfbR8IzlbbzyTDW20/H\nMA88eETWrA2/Gy4lW7KCPnf0Vv46G9a5XHcKtvIQQgtUUYUN7ZxBGl/NgyA4\nqlzZMxRoP5uwvYTbUijvdGQ4Sfp5LHr1EG89UBjCjbvTuMolajzdC8yxwnCW\nMmO5+JXNZMMXB0oQSqzTymlu3CLzobmEwiP3jZM6khe5VqunfR3JM0IlELN5\nvEQmjabAIPaQAHfu4AntI3aDcYWm4O9jzpHco8OVeomAUul/kKsrpaMpoiTG\n0qAwd6wd88eRXHyAG/0nUHCgGzET/eGCo65t4+EDbABITIdvU8Y5b8q93n5o\nbBUBwpVB10S0YD8Xvqo3IZygdrLieoGr3XcBeV+9L3RS/EV/KkqlO4PqOWzl\nfXh3qX/IQvNeRXWantYweo7Z8RW3chIT7qtPmpwU50rRhuVIRGff4Yirttg0\n85x2HkjT7yp5NdEdjk+BoDazIk6oLScVz0Q5MOgZwe1edaK9GBu9PC1UKdEF\nW9+2EulgK7B7eaNkThItyX0vuSp3Tjx7duvHd9vQEHF6iBKtaZF6w3fiGc15\nsPKK\r\n=g0r2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCNMy93WUHZT5xWpwku4p8YgU4rEMSIstgSCe9qEN3DAIhAIp+iDgOwGUoJm7zluM4YMoplMFFl+voD3cyv38bXvO0"}]},"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/azure-iotcentral-device-client_2.0.1_1621355867352_0.9233165277475235"},"_hasShrinkwrap":false}},"time":{"created":"2019-01-25T09:06:25.661Z","1.0.0":"2019-01-25T09:06:25.851Z","modified":"2022-04-11T16:30:11.480Z","1.0.1-0":"2019-01-25T09:29:38.655Z","1.0.1-1":"2019-01-25T09:36:45.071Z","1.0.1":"2019-01-25T09:45:16.853Z","1.0.2":"2019-01-25T17:16:47.288Z","1.0.3":"2019-04-19T13:00:00.154Z","1.0.4":"2019-04-23T13:57:39.195Z","1.0.5":"2019-07-08T15:33:50.312Z","1.0.6":"2019-08-19T10:19:39.429Z","1.1.0":"2019-08-22T16:05:30.579Z","1.1.1":"2019-08-22T16:09:13.975Z","1.1.2":"2019-08-22T16:19:44.190Z","1.2.0":"2019-08-29T13:11:35.618Z","1.2.1":"2019-09-12T08:47:38.898Z","1.2.2":"2019-09-19T14:55:42.587Z","1.2.3-beta.0":"2019-09-23T13:43:20.307Z","1.2.3-beta.1":"2019-09-23T13:43:58.014Z","1.2.3-beta.2":"2019-09-23T14:03:28.519Z","1.2.3-beta.3":"2019-09-23T14:08:30.556Z","1.3.0-preview.1":"2019-10-31T14:19:20.750Z","1.2.3":"2019-12-05T14:53:21.938Z","1.3.0-preview.2":"2019-12-10T11:09:28.413Z","1.3.0-preview.3":"2020-02-05T10:17:29.266Z","1.3.0-preview.4":"2020-02-05T10:29:55.971Z","1.3.0-preview.5":"2020-02-05T10:32:42.887Z","1.2.4":"2020-02-11T09:32:03.399Z","1.2.5":"2020-02-11T09:33:03.005Z","1.3.1-beta.0":"2020-03-06T12:00:43.410Z","1.3.0":"2020-03-30T17:13:15.985Z","1.3.1":"2020-04-01T09:27:13.565Z","1.3.2":"2020-05-06T10:08:35.691Z","1.4.0":"2020-08-26T09:53:24.903Z","2.0.0-beta.0":"2020-10-07T16:00:11.374Z","2.0.0-beta.1":"2020-10-07T16:04:27.771Z","2.0.0":"2020-10-12T10:35:44.354Z","2.0.1-beta.1":"2021-02-12T13:54:34.302Z","2.0.1":"2021-05-18T16:37:47.495Z"},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"description":"Azure IoTCentral NodeJs SDK","author":{"name":"Luca Druda"},"license":"MIT","readme":"# Microsoft Azure IoTCentral SDK for Node.js\n\n[![Join the chat at https://gitter.im/iotdisc/community](https://badges.gitter.im/iotdisc.svg)](https://gitter.im/iotdisc/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![Licensed under the MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/lucadruda/iotc-nodejs-device-client/blob/master/LICENSE)\n\n\n## Prerequisites\n+ Node.js version 8.x or higher - https://nodejs.org\n\n## Installing `azure-iotcentral-device-client` and types\n\n```\nnpm install azure-iotcentral-device-client\n```\n\n## Types\n\nSource code is written in Typescript so types are bundled with the package, you don't need to install any additional package.\n\n\n## Samples\n\nA couple of samples in Javascripts can be found [here](https://github.com/lucadruda/iotc-samples)\n\n\n## Instructions\n\nWhen connecting a device to an IoT Central application an IoTCClient is initialized.\nSDK supports X509 and SymmetricKey authentication;\n\n#### X509\n```js\nconst iotCentral = require('azure-iotcentral-device-client');\n\nconst scopeId = '';\nconst deviceId = '';\nconst passphrase = ''; //optional\nconst cert = {\n    cert: \"public cert\"\n    key: \"private key\",\n    passphrase: \"passphrase\"\n}\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'X509_CERT', cert);\n```\n\n#### SAS\n```js\nconst iotCentral = require('azure-iotcentral-device-client');\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, 'symm_key', sasKey);\n```\n\n### Connect\n```ts\nawait iotc.connect([timeout]);\n```\nAfter successfull connection, IOTC context is available for further commands.\n\n_connect_ accepts an optional timeout in seconds for connection operation.\n\n<br/>\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async () => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, [properties]);\n})\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'},[properties]);\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\n\n\n### Listen to properties update\n```js\niotc.on('Properties', callback);\n```\ne.g.\n```js\nconst onPropertyChange = async (prop)=>{\n    console.log(`New value ${prop.value} for property ${prop.name}`);\n    await prop.ack(); // sync property value with the cloud\n}\n\niotc.on('Properties',onPropertyChange);\n```\n\n### Listen to commands and offline commands\n```js\niotc.on('Commands', callback);\n```\ne.g.\n```js\nconst onCommandReceived = async (cmd) => {\n    console.log(`Received command '${cmd.name}'${cmd.requestPayload ? ` with payload ${cmd.requestPayload}` : '.'}`);\n    // command has been successfully executed\n    await cmd.reply(IIoTCCommandResponse.SUCCESS, 'Completed');\n}\n\niotc.on('Commands', callback);\n\n```\n\nFor offline command, callback will trigger both when device is connected and when a command is enqueued and device re-connect after disconnession.\n\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nDevice template id (a.k.a Model Id) is used when obtaining authorization codes for new devices and automatically assign them to the right template. By providing template id during credentials generation, user doesn't need to manually migrate or assign device from IoT Central site.\n\nIn order to get the unique identifier, open configuration page for required model under \"Device templates\" section.\n![Img](assets/modelId.png)\n\nClick on \"View Identity\" and in next screen copy model urn.\n![Img](assets/modelId_2.png)\n\n\nThen call this method before connect():\n\n```js\niotc.setModelId('<modelId>');\n```\n\n### Automatic approval (default)\nBy default device auto-approval in IoT Central is enabled, which means that administrators don't need to approve device registration to complete the provisioning process when device is not already created.\n\n![Img](assets/auto_approval.jpg)\n\n### Manual approval\nIf auto-approval is disabled, administrators need to manually approve new devices.\nThis can be done from explorer page after selecting the device\n![Img](assets/manual_approval.jpg)\n\n\n## Generate x509 certificates\nIoT Central SDK comes with an handy tool to generate self-signed x509 certificates to be used when testing device connection.\n\n```bash\nnpm run generate-certificates\n```\n\nThis example wait for a validation code which is provided by IoTCentral in the device configuration page when uploading primary or secondary root certificate.\nResulting device certificates can be used in connection example above.\n\nInstructions on connecting devices using x.509 on IoT Central [here.](https://docs.microsoft.com/en-us/azure/iot-central/core/concepts-get-connected#connect-devices-using-x509-certificates)","readmeFilename":"README.md","homepage":"https://github.com/lucadruda/iotc_nodejs_device_client"}