{"_id":"@dabblelab/autopilot-helper","_rev":"2-fec1f795d2615adc3f1d0ba7ff1c2cbe","name":"@dabblelab/autopilot-helper","dist-tags":{"latest":"1.0.0-beta.1"},"versions":{"1.0.0-beta.1":{"name":"@dabblelab/autopilot-helper","version":"1.0.0-beta.1","description":"A collection of utility functions that help you write better and cleaner code for Twilio autopilot.","main":"index.js","bugs":{"url":"https://github.com/dabblelab/autopilot-helper/issues"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["twilio","autopilot","helper","utils"],"author":{"name":"Atharva Jagtap"},"license":"MIT","homepage":"https://github.com/dabblelab/autopilot-helper","engines":{"node":">=8.0.0"},"gitHead":"bc6a5ddcf449058f089c01a1ebf13742a39748cd","_id":"@dabblelab/autopilot-helper@1.0.0-beta.1","_npmVersion":"5.6.0","_nodeVersion":"8.11.4","_npmUser":{"name":"atharvaj","email":"atharva@dabblelab.com"},"dist":{"integrity":"sha512-ryxk4O/s6SmBVxSxfBu2eqfZdzGTLmLnWs2iQnrgyetLqfyG/laKfaZK5zqfIq0aywLykIQxGuX5akl3bx04tw==","shasum":"63e05e50cbdbe6b738c05912f3434b90422dc645","tarball":"https://registry.npmjs.org/@dabblelab/autopilot-helper/-/autopilot-helper-1.0.0-beta.1.tgz","fileCount":7,"unpackedSize":8409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeOTWTCRA9TVsSAnZWagAAywkP+gJk0CE9tqs+vv7IsKV8\nwWaX9nEasrQg5Is51UwgzuR1AJv72+cneiivrI9qIsCCyctdv5c383he7o1L\naK2F74Vp8zfYEe82bz7zyoGu55tnnvbKgEikvxu9axBcm2yfWgJnVfVR6gk4\nzGlry/qZFTbZpexyQasSQMMEERQkEq1eebXTgQXNWQ+Jjj46dcjVD3w4oUwt\nCNyqskgHI2hpfpFivupq7ug77jxcixzdc3plULK3TodIgBnwF0Hx4mKsPWF4\ndcG29sONWr302hZ8muZo3WEAR6PXoynuRnHyklTK6H7W/fD5kJ1NG0FdvpUj\n2H/uT97vXj1/3zKJyR6kSUL2SlZT/61SV0ZwT/bpKY7hLL78czNnLmANkm+g\nTzRP8uNbhiy1PmEa5/J2ndElUHX+E17uj2+MLr2gk1Z4qU7oXqZRBEZxNzDJ\nLEXtWBouqFKXnhPyf+7w2bFeH2Rfa+1qMIYnnwbSTrFNeRhpkB4FnoShlwBu\neta3Ix+MZLDRpbJnSUoxl6QkLBan1JaGIu8KJ88R+dzKPWw54wSmyoc4nKYv\nk/2j+27EH0VH1GS1zdgJjJTrM0A7XklrCh8ZdKI7yr76579BVav0Io0JG6S9\n4j1J/ecLemXPYgvT2F+d+IX8GD3NNtJj15PYzYwtBzd+j7iS0ysGHlodFw0D\nuK0d\r\n=fiQ9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICRTogbdbPNaxhxJKFNtvaXC/ehcoCwxSmd36imDg9PwAiADM07om9NAKOEmoJhCr+vwVqewbcDdZ20e/gh4heBT0A=="}]},"maintainers":[{"name":"atharvaj","email":"atharva@dabblelab.com"},{"name":"khalid0807","email":"khalid@dabblelab.com"},{"name":"stevetingiris","email":"steve@dabblelab.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/autopilot-helper_1.0.0-beta.1_1580807571057_0.7803895473151963"},"_hasShrinkwrap":false}},"time":{"created":"2020-02-04T09:12:50.789Z","1.0.0-beta.1":"2020-02-04T09:12:51.167Z","modified":"2022-04-05T02:31:43.093Z"},"maintainers":[{"email":"steve@dabblelab.com","name":"stevetingiris"},{"email":"khalid@dabblelab.com","name":"khalid0807"}],"description":"A collection of utility functions that help you write better and cleaner code for Twilio autopilot.","homepage":"https://github.com/dabblelab/autopilot-helper","keywords":["twilio","autopilot","helper","utils"],"author":{"name":"Atharva Jagtap"},"bugs":{"url":"https://github.com/dabblelab/autopilot-helper/issues"},"license":"MIT","readme":"# autopilot-helper\n\n### List of helper functions\n\n-   Response generator\n\n```javascript\nvar helper = require(\"autopilot-helper\");\n\nvar rsp = new helper.response();\n\nrsp.say(\"abc\");\nrsp.handoff(\"channel\", \"url\", \"method\");\nrsp.remember({ name: \"John doe\" });\nrsp.play(\"url\", 1); //audio url , loop count\ncallback(null, rsp.generate());\n```\n\noutput:\n\n```\n{\n    actions: [\n        {\n            say: 'abc'\n        },\n        {\n            handoff: {\n                channel: 'channel',\n                uri: 'url',\n                method: 'method'\n            }\n        },\n        {\n            remember: {\n                name: 'John doe'\n            }\n        },\n        {\n            play: {\n\t\t\t\tloop: 1,\n\t\t\t\turl: 'url'\n\t\t\t}\n        }\n    ]\n}\n```\n\n-   List of response methods supported\n\n    -   say(text)\n    -   collect(name, questions, redirect)\n    -   listen(tasks = false)\n    -   play(url, loop_count = 1)\n    -   redirect(url, method = false)\n    -   handoff(channel, url, method, voice_status_callback_url = false, voice_status_callback_method = false)\n    -   handoff_task_flex(channel, task_url, wait_url = false, wait_url_method = false, action = false, priority = false, timeout = false)\n    -   remember(remember_object)\n    -   show(body, images = false)\n\n-   Filter field values\n\n```javascript\nevent = {\n    Field_dept_var_Type: \"dept\",\n    Field_dept_var_Value: \"sales\",\n    Channel: \"sms\"\n};\n\nvar fields = helper.fields(event);\nconsole.log(fields[dept_var]);\n```\n\noutput:\n\n```\nsales\n```\n\n-   Random response\n\n```javascript\nvar event = {\n    Field_dept_var_Type: \"dept\",\n    Field_dept_var_Value: \"sales\",\n    Channel: \"sms\",\n    Memory: { name: \"John doe\" }\n};\nvar responses = [\"Hey {name} ,i am from {dept_var} department\", \"Which {dept_var}\"];\n\nvar random = helper.random(responses, event);\nconsole.log(random);\n```\n\noutput:\n\n```\nHey John doe ,i am from sales department\n```\n","readmeFilename":"README.md"}