{"_id":"@cinemataztic/dch-tcp-helpers","_rev":"5-b1321a6219264551c3f19adcf61e1ec1","name":"@cinemataztic/dch-tcp-helpers","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.1":{"name":"@cinemataztic/dch-tcp-helpers","version":"0.1.1","author":{"name":"CinemaTaztic"},"license":"ISC","_id":"@cinemataztic/dch-tcp-helpers@0.1.1","maintainers":[{"name":"alkiko","email":"allan@alkiko.com"}],"dist":{"shasum":"a5b5f0d116d14ac23a35726aa6539fb32c0ad9be","tarball":"https://registry.npmjs.org/@cinemataztic/dch-tcp-helpers/-/dch-tcp-helpers-0.1.1.tgz","fileCount":5,"integrity":"sha512-4Iq9KsGEYSfU6vdf8sIsRP5far8Pb5GNMIIIv7dbCwN9DdZRXiuZgPkvqi9L+BY0hGB4EJsfxqj94n45wMoNgQ==","signatures":[{"sig":"MEQCIHQoARYS2AaF8eHAhC9dH8xTvBECasCEDtGqq7yJptF0AiBYejHdS6FQ0brQl60IuopziHz5dZ/L/Y5NqldxwbZH5Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3534,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMXy/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolTQ//Q0ojPHQC/CTdX72KbTxprjGSxLXYk1PdPbgUHGqDtoUt/0SZ\r\nhzsVcEGbfpACYL19F8wyrr8XXic8eSY2zTnmHMZ0vMlS4P6YdI6w/SrSb9a6\r\nEwSTxVZtMXD/UqhJBU0d4Iubcq9qXBIhDiuNDeqLqQl76Qmuo8+7pHnbfzFB\r\nzTmQMwejUw2uhInv5BumXgOB0EFOxz/NSv9fKPWGgZOuRp9HRgsKXshKcalK\r\nvb373xGLWzPWGtbx2K4dy8b3zaZftX/F9ubfKxuJTloGSEhNlMn3/MGZFTjX\r\n6OTM04aYVYzf/azeMSl8C9QTiBoE5aPifrGimMggI0yet9aOn65dMpsZ6Kgq\r\n30KR2JAc0nR78yL+eVvNcBLAaywQpR9Y47EZ5IUWKRZUfaZi2v10zdaL92Jb\r\nLaVoAmMHPIIl3OcJ7C6ojvie/nLRRTHNYl3LnZnfUJqHUmrUCUEbXTshwzDc\r\nrdgouF8hMW1xrKwXxCrlSLWV/A4FPDbD83+q8nHD297c2WiADvDg21PKYL/+\r\nd2nqA7AJLrGB+9+1T4i+Kq/gVAovYwC94VZJMzVMVSyeEzR4sSDQ4VunvRVL\r\n0u6tR+unaAihRry1WGcmNQkl9nT9osqzgktYtUGFkz656GfsrdddKpk8/NiF\r\nmTprtEM4AJvFP4BE8B6AKMGVfDbJhZxh9T0=\r\n=enlj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","gitHead":"8b612875e442eb9106f8bc1c9638e5b6d8bb2440","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"babel src --out-dir dist"},"_npmUser":{"name":"alkiko","email":"allan@alkiko.com"},"_npmVersion":"8.15.0","description":"A set of helper functions for independent daemons (-d) to communicate with the DCH-P","directories":{},"_nodeVersion":"16.17.0","_hasShrinkwrap":false,"devDependencies":{"jsdoc":"^3.6.10","@babel/cli":"^7.17.6","@babel/core":"^7.17.9","better-docs":"^2.7.2","babel-loader":"^8.2.5","@babel/preset-env":"^7.16.11"},"_npmOperationalInternal":{"tmp":"tmp/dch-tcp-helpers_0.1.1_1664187582905_0.32007730556881575","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"@cinemataztic/dch-tcp-helpers","version":"0.1.2","author":{"name":"CinemaTaztic"},"license":"ISC","_id":"@cinemataztic/dch-tcp-helpers@0.1.2","maintainers":[{"name":"mikkel_cinemataztic","email":"mw@cinemataztic.com"},{"name":"alkiko","email":"allan@alkiko.com"}],"dist":{"shasum":"85306a6809fa2997e3ef95fe77c0f56238cc78ac","tarball":"https://registry.npmjs.org/@cinemataztic/dch-tcp-helpers/-/dch-tcp-helpers-0.1.2.tgz","fileCount":5,"integrity":"sha512-RJ8VPj8UDbcgRKJMc99kixRKHSpc/ZU9TdXgMGjDUqd2HIoOJtK7G+n8OA8C2RrwX3pnbdZtGpn7gXBtYdXV7Q==","signatures":[{"sig":"MEUCIQDQAcnGheNmJanjcrPwh2spk+3rUkZBtsaDyoeKdnNSawIgJWpLzZpDByN+BbFI1BCMKCF7K9SlUG64x7a9TRmQcIo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3435,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjX6l7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqboA//Yq62hULz4B5KJRARF5BMRc0pHgpE0bebx2L3ikbEmF4FquIv\r\n/EMKlm+1quT3/4o+9KIZAkzpXkgpXVnA0O5DMWZu+HYlWVN+9kS4mB5cXbjP\r\n6Wb6mPMC40zEGe4jGLin7ROLIKaE8209dwZxlvzrRLQThX4IK8wyRPBY763X\r\nADlWnCHv5MVD2uM8GInGqVJGiuJFqky8N7VCOOUEzBWucvh9wxiUM0sjaTK2\r\nlNA9XFKdWk1q+jMA9jmpOPCPBuQb52xhWY4I2+0NXxbiAGCIlj5/Rqa2rrFN\r\nbPAZdjR66p8HSCCSjYhscZBTFVJNfQIjy3AchzaVGuXqSipdn9E0BrSEIpMu\r\nZyVR95uyf8B5HTY6UnBbl5wvA7tzmwE7VwGpD6AigNyAaiwkr83b3SUsQdLi\r\nxuL8yKrLEpfHn8yPyoq3bUi1oi4aF8piZctbCxiVNOwV1uBWuy2zSP5ZDiuU\r\n25gFQsiLc8Hjyk9z8jI/woElJ1ewJ1KkbsdsW11Q4z7tds2ikVd/2L79YCjB\r\ngAqpXbOShkH4LNZomY70QPsBFVeMOySjJ2tOpe2oETEvj6X7ObP8dWny6lAi\r\n+1z009MfFPDuYzD2h1Conv/Ad0FR8z6kQcms6sNaOl8ZW2JxUjeyJtmwsSYZ\r\nWtVnPRfG0CoPfRqjSMqAKUbWx4TmWDzWjGk=\r\n=7KiB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","gitHead":"e2938c2c9e36ba0ba7f123cf2815c54448115aa3","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"babel src --out-dir dist"},"_npmUser":{"name":"alkiko","email":"allan@alkiko.com"},"_npmVersion":"8.15.0","description":"A set of helper functions for independent daemons (-d) to communicate with the DCH-P","directories":{},"_nodeVersion":"16.17.1","_hasShrinkwrap":false,"devDependencies":{"jsdoc":"^3.6.10","@babel/cli":"^7.17.6","@babel/core":"^7.17.9","better-docs":"^2.7.2","babel-loader":"^8.2.5","@babel/preset-env":"^7.16.11"},"_npmOperationalInternal":{"tmp":"tmp/dch-tcp-helpers_0.1.2_1667213691070_0.6885562798263221","host":"s3://npm-registry-packages"}},"0.1.3":{"name":"@cinemataztic/dch-tcp-helpers","version":"0.1.3","author":{"name":"CinemaTaztic"},"license":"ISC","_id":"@cinemataztic/dch-tcp-helpers@0.1.3","maintainers":[{"name":"mikkel_cinemataztic","email":"mw@cinemataztic.com"},{"name":"alkiko","email":"allan@alkiko.com"}],"dist":{"shasum":"b7796df5b92bb7ca5e9034eda6095a78bb5a9ff9","tarball":"https://registry.npmjs.org/@cinemataztic/dch-tcp-helpers/-/dch-tcp-helpers-0.1.3.tgz","fileCount":6,"integrity":"sha512-MSc/piexNxDgy/+Y/nllhXI8mK3PVxymsFak8wC8aGaNQ7DNWvTXe8Nlxf9jlL30rqBjCNNxyirXcdio0Dn0rw==","signatures":[{"sig":"MEYCIQDr/cR2QxBU59daYeDwx7YwwHPXz/2STSgo02FbKkgbSgIhAIi4F48U9N2rgYB+SRS6WtGHkLGK8+tDPJeMD6UJiT1k","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7916},"main":"dist/index.js","gitHead":"1317f331b011379f468a7caf32cef0304976f8fd","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"babel src --out-dir dist"},"_npmUser":{"name":"alkiko","email":"allan@alkiko.com"},"_npmVersion":"8.19.4","description":"A set of helper functions for independent daemons (-d) to communicate with the DCH-P","directories":{},"_nodeVersion":"16.20.2","_hasShrinkwrap":false,"devDependencies":{"jsdoc":"^3.6.10","@babel/cli":"^7.17.6","@babel/core":"^7.17.9","better-docs":"^2.7.2","babel-loader":"^8.2.5","@babel/preset-env":"^7.16.11"},"_npmOperationalInternal":{"tmp":"tmp/dch-tcp-helpers_0.1.3_1696927083730_0.29548916652203183","host":"s3://npm-registry-packages"}}},"time":{"created":"2022-09-26T10:19:42.842Z","modified":"2026-01-27T14:36:40.179Z","0.1.1":"2022-09-26T10:19:43.063Z","0.1.2":"2022-10-31T10:54:51.253Z","0.1.3":"2023-10-10T08:38:03.935Z"},"author":{"name":"CinemaTaztic"},"license":"ISC","description":"A set of helper functions for independent daemons (-d) to communicate with the DCH-P","maintainers":[{"email":"allan@alkiko.com","name":"alkiko"}],"readme":"# DCH TCP Helpers\n\nThis is a collection of helper functions for interacting with the DCH through TCP.\n\n## Installation\n\nIt is available as an [npm package](https://www.npmjs.com/package/@cinemataztic/dch-tcp-helpers).\n\n```bash\nnpm install @cinemataztic/dch-tcp-helpers\n```\n\n## Usage\n\nThe package will by default contact the DCH on `127.0.0.1` with the port specified by the `INTERNAL_TCP_SERVER` environment variable. If this is not set, it will default to port 4455.\n\n## API\n\n### getDeviceInfo\n\nThe `getDeviceInfo` function takes no parameters and returns an object with the following properties:\n\n| Property    | Type   | Description                                                |\n| ----------- | ------ | ---------------------------------------------------------- |\n| status      | string | The result of the request. Either `success` or `error`.    |\n| deviceId    | string | The ID of the DCH-P.                                       |\n| screenId    | string | The ID of the screen connected to the DCH-P.               |\n| accessToken | string | The access token for interacting with Cinemataztic's APIs. |\n| networkName | string | The name of the advertising network.                       |\n| market      | string | The market the DCH-P is in.                                |\n| countryCode | string | The country code of the market.                            |\n| clusterName | string | The name of the cluster the DCH-P is in.                   |\n\n#### Example\n\n```javascript\nconst { getDeviceInfo } = require(\"@cinemataztic/dch-tcp-helpers\");\n\nconst {\n  status,\n  deviceId,\n  screenId,\n  accessToken,\n  networkName,\n  market,\n  countryCode,\n  clusterName,\n} = await getDeviceInfo();\n```\n\n### postLog\n\nThe `postLog` function takes four parameters and returns an object:\n\n`postLog` accepts the following parameters.\n\n| Parameter | Type                                                                 |\n| --------- | -------------------------------------------------------------------- |\n| message\\* | `string`                                                             |\n| severity  | `notice` , `warning` , `error` , `critical` ,`debug` default:`debug` |\n| target    | [`cloud`, `sentry`, `winston`] default:[`winston`]                   |\n| type      | `unity`,`general`,`internal`,`unknown`,`block` default:`general`     |\n\n`postLog` returns the following properties.\n\n| Property | Type   | Description                                              |\n| -------- | ------ | -------------------------------------------------------- |\n| status   | string | The result of the request. Either `success` or `failed`. |\n| message  | string | The status message.                                      |\n\n#### Example\n\n```javascript\nconst { postLog } = require(\"@cinemataztic/dch-tcp-helpers\");\n\nconst { status, message } = await postLog(\n  \"test\",\n  \"error\",\n  \"[winston,cloud]\",\n  \"general\"\n);\n```\n","readmeFilename":"README.md"}