├── .editorconfig ├── .gitignore ├── .jscsrc ├── ATTRIBUTIONS.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── index.js ├── package-lock.json ├── package.json ├── src └── index.js └── tests └── index.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_style = space 8 | indent_size = 4 9 | 10 | [*.json] 11 | indent_size = 2 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | -------------------------------------------------------------------------------- /.jscsrc: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "google", 3 | "disallowKeywords": ["with"], 4 | "disallowMultipleLineBreaks": null, 5 | "disallowMultipleVarDecl": null, 6 | "disallowSpaceBeforeComma": true, 7 | "disallowSpacesInsideObjectBrackets": null, 8 | "excludeFiles": ["coverage", "node_modules"], 9 | "maximumLineLength": 120, 10 | "requireCamelCaseOrUpperCaseIdentifiers": null, 11 | "requireCommaBeforeLineBreak": true, 12 | "requireCurlyBraces": null, 13 | "validateIndentation": 4 14 | } 15 | -------------------------------------------------------------------------------- /ATTRIBUTIONS.md: -------------------------------------------------------------------------------- 1 | 2 | # should-equal 3 | 4 | Copyright (c) 2014 Denis Bardadym 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | 12 | 13 | # should-format 14 | 15 | Copyright (c) 2014 Denis Bardadym 16 | 17 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 18 | 19 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | # should-sinon 24 | 25 | Copyright (c) 2015 Denis Bardadym 26 | 27 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 28 | 29 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 32 | 33 | 34 | # should-type 35 | 36 | Copyright (c) 2014 Denis Bardadym 37 | 38 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 41 | 42 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 43 | 44 | # slash 45 | 46 | Copyright (c) Sindre Sorhus (sindresorhus.com) 47 | 48 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 49 | 50 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 51 | 52 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 53 | 54 | 55 | # to-double-quotes 56 | 57 | Copyright (c) Sindre Sorhus (sindresorhus.com) 58 | 59 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 60 | 61 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 62 | 63 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 64 | 65 | # to-iso-string 66 | Copyright (c) 2016 Segment.io, Inc. (friends@segment.com) 67 | 68 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 69 | 70 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 71 | 72 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 73 | 74 | 75 | # try-resolve 76 | 77 | Copyright (c) Sebastian McKenzie 78 | 79 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 80 | 81 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 82 | 83 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 84 | 85 | 86 | # regenerator 87 | 88 | Copyright (c) 2014, Facebook, Inc. 89 | All rights reserved. 90 | 91 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 92 | 93 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 94 | 95 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 96 | 97 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 98 | 99 | ----- 100 | 101 | Additional Grant of Patent Rights Version 2 102 | 103 | "Software" means the Regenerator software distributed by Facebook, Inc. 104 | 105 | Facebook, Inc. ("Facebook") hereby grants to each recipient of the Software ("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (subject to the termination provision below) license under any Necessary Claims, to make, have made, use, sell, offer to sell, import, and otherwise transfer the Software. For avoidance of doubt, no license is granted under Facebook's rights in any patent claims that are infringed by (i) modifications to the Software made by you or any third party or (ii) the Software in combination with any software or other technology. 106 | 107 | The license granted hereunder will terminate, automatically and without notice, if you (or any of your subsidiaries, corporate affiliates or agents) initiate directly or indirectly, or take a direct financial interest in, any Patent Assertion: (i) against Facebook or any of its subsidiaries or corporate affiliates, (ii) against any party if such Patent Assertion arises in whole or in part from any software, technology, product or service of Facebook or any of its subsidiaries or corporate affiliates, or (iii) against any party relating to the Software. Notwithstanding the foregoing, if Facebook or any of its subsidiaries or corporate affiliates files a lawsuit alleging patent infringement against you in the first instance, and you respond by filing a patent infringement counterclaim in that lawsuit against that party that is unrelated to the Software, the license granted hereunder will not terminate under section (i) of this paragraph due to such counterclaim. 108 | 109 | A "Necessary Claim" is a claim of a patent owned by Facebook that is necessarily infringed by the Software standing alone. 110 | 111 | A "Patent Assertion" is any lawsuit or other action alleging direct, indirect, or contributory infringement or inducement to infringe any patent, including a cross-claim or counterclaim. 112 | 113 | # json-schema 114 | 115 | The "New" BSD License: 116 | ********************** 117 | 118 | Copyright (c) 2005-2018, The JS Foundation 119 | All rights reserved. 120 | 121 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 122 | 123 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 124 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 125 | * Neither the name of the JS Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 126 | 127 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 128 | 129 | 130 | # regjsparser 131 | 132 | Copyright (c) Julian Viereck and Contributors, All Rights Reserved. 133 | 134 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 135 | 136 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 137 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 138 | 139 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 140 | 141 | 142 | # babel 143 | 144 | Copyright (c) 2014-2018 Sebastian McKenzie and other contributors 145 | 146 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 147 | 148 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 149 | 150 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 151 | 152 | 153 | # concat-map 154 | 155 | Copyright (c) James Halliday 156 | 157 | Permission is hereby granted, free of charge, to any person obtaining a copy of 158 | this software and associated documentation files (the "Software"), to deal in 159 | the Software without restriction, including without limitation the rights to 160 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 161 | the Software, and to permit persons to whom the Software is furnished to do so, 162 | subject to the following conditions: 163 | 164 | The above copyright notice and this permission notice shall be included in all 165 | copies or substantial portions of the Software. 166 | 167 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 168 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 169 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 170 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 171 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 172 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 173 | 174 | 175 | # deep-equal 176 | 177 | Copyright (c) James Halliday 178 | 179 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 180 | 181 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 182 | 183 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 184 | 185 | 186 | # defined 187 | 188 | Copyright (c) James Halliday 189 | 190 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 191 | 192 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 193 | 194 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 195 | 196 | 197 | # detective 198 | 199 | Copyright (c) James Halliday 200 | 201 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 202 | 203 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 204 | 205 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 206 | 207 | 208 | # get-stdin 209 | 210 | Copyright (c) Sindre Sorhus (sindresorhus.com) 211 | 212 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 213 | 214 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 215 | 216 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 217 | 218 | 219 | # i 220 | 221 | Copyright (c) Pavan Kumar Sunkara 222 | 223 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 224 | 225 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 226 | 227 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 228 | 229 | # invert-kv 230 | 231 | Copyright (c) Sindre Sorhus (sindresorhus.com) 232 | 233 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 234 | 235 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 236 | 237 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 238 | 239 | 240 | # jsdoctypeparser 241 | 242 | "Copyright (c) 2018 Kuniwak 243 | 244 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 245 | 246 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 247 | 248 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." 249 | 250 | 251 | # minimist 252 | 253 | Copyright (c) James Halliday 254 | 255 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 256 | 257 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 258 | 259 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 260 | 261 | # resolve 262 | 263 | Copyright (c) James Halliday 264 | 265 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 266 | 267 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 268 | 269 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 270 | # wordwrap 271 | 272 | Copyright (c) James Halliday 273 | 274 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 275 | 276 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 277 | 278 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Instructions for Contributing Code 2 | 3 | This project welcomes contributions and suggestions. Most contributions require you to agree to a 4 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us 5 | the rights to use your contribution. For details, visit https://cla.microsoft.com. 6 | 7 | When you submit a pull request, a CLA-bot will automatically determine whether you need to provide 8 | a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions 9 | provided by the bot. You will only need to do this once across all repos using our CLA. 10 | 11 | When you submit a pull request, a CLA-bot will automatically determine whether you need to provide 12 | a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions 13 | provided by the bot. You will only need to do this once across all repos using our CLA. 14 | 15 | ## Code of Conduct 16 | 17 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 18 | 19 | ## Submitting Issues 20 | 21 | * You can create an issue [here](https://github.com/howdyai/botkit-storage-mongo/issues/new), 22 | but before doing that please read the notes below and include as many details as 23 | possible with your report. If you can, please include: 24 | * The version of Botkit you are using 25 | * The operating system you are using 26 | * If applicable, what you were doing when the issue arose and what you 27 | expected to happen 28 | * Other things that will help resolve your issue: 29 | * Screenshots and animated GIFs 30 | * Error output that appears in your terminal, dev tools or as an alert 31 | * Perform a [cursory search](https://github.com/howdyai/botkit-storage-mongo/issues?utf8=✓&q=is%3Aissue+) 32 | to see if a similar issue has already been submitted 33 | 34 | ## Submitting Pull Requests 35 | 36 | * Include screenshots and animated GIFs in your pull request whenever possible. 37 | * Follow the JavaScript coding style with details from `.jscsrc` and `.editorconfig` files and use necessary plugins for your text editor. 38 | * Write documentation in [Markdown](https://daringfireball.net/projects/markdown). 39 | * Use short, present tense commit messages. See [Commit Message Styleguide](#git-commit-messages). 40 | 41 | ## Styleguides 42 | 43 | ### General Code 44 | 45 | * End files with a newline. 46 | * Place requires in the following order: 47 | * Built in Node Modules (such as `path`) 48 | * Local Modules (using relative paths) 49 | * Avoid platform-dependent code: 50 | * Use `path.join()` to concatenate filenames. 51 | * Using a plain `return` when returning explicitly at the end of a function. 52 | * Not `return null`, `return undefined`, `null`, or `undefined` 53 | 54 | ### Git Commit Messages 55 | 56 | * Use the present tense ("Add feature" not "Added feature") 57 | * Use the imperative mood ("Move cursor to..." not "Moves cursor to...") 58 | * Limit the first line to 72 characters or less 59 | * Reference issues and pull requests liberally 60 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Howdy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # botkit-storage-redis 2 | A redis storage module for Botkit 3 | 4 | ## Usage 5 | 6 | Just require `botkit-storage-redis` and pass it your config options (or none if your cool with defaults). 7 | Then pass the returned storage when creating your Botkit controller. Botkit will do the rest! 8 | 9 | Make sure everything you store has an `id` property, that's what you'll use to look it up later. 10 | 11 | ``` 12 | var Botkit = require('botkit'), 13 | redisConfig = {...} 14 | redisStorage = require('botkit-storage-redis')(redisConfig), 15 | controller = Botkit.slackbot({ 16 | storage: redisStorage 17 | }); 18 | ``` 19 | 20 | ``` 21 | // then you can use the Botkit storage api, make sure you have an id property 22 | var beans = {id: 'cool', beans: ['pinto', 'garbanzo']}; 23 | controller.storage.teams.save(beans); 24 | beans = controller.storage.teams.get('cool'); 25 | 26 | ``` 27 | 28 | ### Options 29 | 30 | You can pass any options that are allowed by [node-redis](https://github.com/NodeRedis/node_redis). 31 | 32 | Additionally you can pass a `namespace` property which is used to namespace keys in Redis. `namespace` defaults to `botkit:store`. 33 | 34 | You can also pass a `methods` property which is an array of additional custom methods you want to add. The default methods are `teams`, `users`, and `channels`. -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./src'); 2 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "botkit-storage-redis", 3 | "version": "1.1.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@sinonjs/commons": { 8 | "version": "1.3.0", 9 | "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.3.0.tgz", 10 | "integrity": "sha512-j4ZwhaHmwsCb4DlDOIWnI5YyKDNMoNThsmwEpfHx6a1EpsGZ9qYLxP++LMlmBRjtGptGHFsGItJ768snllFWpA==", 11 | "dev": true, 12 | "requires": { 13 | "type-detect": "4.0.8" 14 | } 15 | }, 16 | "@sinonjs/formatio": { 17 | "version": "3.0.0", 18 | "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.0.0.tgz", 19 | "integrity": "sha512-vdjoYLDptCgvtJs57ULshak3iJe4NW3sJ3g36xVDGff5AE8P30S6A093EIEPjdi2noGhfuNOEkbxt3J3awFW1w==", 20 | "dev": true, 21 | "requires": { 22 | "@sinonjs/samsam": "2.1.0" 23 | }, 24 | "dependencies": { 25 | "@sinonjs/samsam": { 26 | "version": "2.1.0", 27 | "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-2.1.0.tgz", 28 | "integrity": "sha512-5x2kFgJYupaF1ns/RmharQ90lQkd2ELS8A9X0ymkAAdemYHGtI2KiUHG8nX2WU0T1qgnOU5YMqnBM2V7NUanNw==", 29 | "dev": true, 30 | "requires": { 31 | "array-from": "^2.1.1" 32 | } 33 | } 34 | } 35 | }, 36 | "@sinonjs/samsam": { 37 | "version": "2.1.2", 38 | "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-2.1.2.tgz", 39 | "integrity": "sha512-ZwTHAlC9akprWDinwEPD4kOuwaYZlyMwVJIANsKNC3QVp0AHB04m7RnB4eqeWfgmxw8MGTzS9uMaw93Z3QcZbw==", 40 | "dev": true 41 | }, 42 | "abbrev": { 43 | "version": "1.0.9", 44 | "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", 45 | "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", 46 | "dev": true 47 | }, 48 | "amdefine": { 49 | "version": "1.0.1", 50 | "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", 51 | "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", 52 | "dev": true, 53 | "optional": true 54 | }, 55 | "argparse": { 56 | "version": "1.0.10", 57 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", 58 | "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", 59 | "dev": true, 60 | "requires": { 61 | "sprintf-js": "~1.0.2" 62 | } 63 | }, 64 | "array-from": { 65 | "version": "2.1.1", 66 | "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", 67 | "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", 68 | "dev": true 69 | }, 70 | "async": { 71 | "version": "1.5.2", 72 | "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", 73 | "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", 74 | "dev": true 75 | }, 76 | "balanced-match": { 77 | "version": "1.0.0", 78 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 79 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 80 | "dev": true 81 | }, 82 | "brace-expansion": { 83 | "version": "1.1.11", 84 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 85 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 86 | "dev": true, 87 | "requires": { 88 | "balanced-match": "^1.0.0", 89 | "concat-map": "0.0.1" 90 | } 91 | }, 92 | "browser-stdout": { 93 | "version": "1.3.1", 94 | "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", 95 | "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", 96 | "dev": true 97 | }, 98 | "commander": { 99 | "version": "2.17.1", 100 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", 101 | "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", 102 | "dev": true, 103 | "optional": true 104 | }, 105 | "concat-map": { 106 | "version": "0.0.1", 107 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 108 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 109 | "dev": true 110 | }, 111 | "debug": { 112 | "version": "3.1.0", 113 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 114 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 115 | "dev": true, 116 | "requires": { 117 | "ms": "2.0.0" 118 | } 119 | }, 120 | "deep-is": { 121 | "version": "0.1.3", 122 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", 123 | "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", 124 | "dev": true 125 | }, 126 | "diff": { 127 | "version": "3.5.0", 128 | "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", 129 | "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", 130 | "dev": true 131 | }, 132 | "double-ended-queue": { 133 | "version": "2.1.0-0", 134 | "resolved": "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz", 135 | "integrity": "sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw=" 136 | }, 137 | "escape-string-regexp": { 138 | "version": "1.0.5", 139 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 140 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 141 | "dev": true 142 | }, 143 | "escodegen": { 144 | "version": "1.8.1", 145 | "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", 146 | "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", 147 | "dev": true, 148 | "requires": { 149 | "esprima": "^2.7.1", 150 | "estraverse": "^1.9.1", 151 | "esutils": "^2.0.2", 152 | "optionator": "^0.8.1", 153 | "source-map": "~0.2.0" 154 | } 155 | }, 156 | "esprima": { 157 | "version": "2.7.3", 158 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", 159 | "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", 160 | "dev": true 161 | }, 162 | "estraverse": { 163 | "version": "1.9.3", 164 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", 165 | "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", 166 | "dev": true 167 | }, 168 | "esutils": { 169 | "version": "2.0.2", 170 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", 171 | "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", 172 | "dev": true 173 | }, 174 | "fast-levenshtein": { 175 | "version": "2.0.6", 176 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", 177 | "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", 178 | "dev": true 179 | }, 180 | "fill-keys": { 181 | "version": "1.0.2", 182 | "resolved": "https://registry.npmjs.org/fill-keys/-/fill-keys-1.0.2.tgz", 183 | "integrity": "sha1-mo+jb06K1jTjv2tPPIiCVRRS6yA=", 184 | "dev": true, 185 | "requires": { 186 | "is-object": "~1.0.1", 187 | "merge-descriptors": "~1.0.0" 188 | } 189 | }, 190 | "fs.realpath": { 191 | "version": "1.0.0", 192 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 193 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 194 | "dev": true 195 | }, 196 | "glob": { 197 | "version": "5.0.15", 198 | "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", 199 | "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", 200 | "dev": true, 201 | "requires": { 202 | "inflight": "^1.0.4", 203 | "inherits": "2", 204 | "minimatch": "2 || 3", 205 | "once": "^1.3.0", 206 | "path-is-absolute": "^1.0.0" 207 | } 208 | }, 209 | "growl": { 210 | "version": "1.10.5", 211 | "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", 212 | "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", 213 | "dev": true 214 | }, 215 | "handlebars": { 216 | "version": "4.0.12", 217 | "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz", 218 | "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", 219 | "dev": true, 220 | "requires": { 221 | "async": "^2.5.0", 222 | "optimist": "^0.6.1", 223 | "source-map": "^0.6.1", 224 | "uglify-js": "^3.1.4" 225 | }, 226 | "dependencies": { 227 | "async": { 228 | "version": "2.6.1", 229 | "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", 230 | "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", 231 | "dev": true, 232 | "requires": { 233 | "lodash": "^4.17.10" 234 | } 235 | }, 236 | "source-map": { 237 | "version": "0.6.1", 238 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 239 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 240 | "dev": true 241 | } 242 | } 243 | }, 244 | "has-flag": { 245 | "version": "1.0.0", 246 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", 247 | "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", 248 | "dev": true 249 | }, 250 | "he": { 251 | "version": "1.1.1", 252 | "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", 253 | "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", 254 | "dev": true 255 | }, 256 | "inflight": { 257 | "version": "1.0.6", 258 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 259 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 260 | "dev": true, 261 | "requires": { 262 | "once": "^1.3.0", 263 | "wrappy": "1" 264 | } 265 | }, 266 | "inherits": { 267 | "version": "2.0.3", 268 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 269 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", 270 | "dev": true 271 | }, 272 | "is-object": { 273 | "version": "1.0.1", 274 | "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", 275 | "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", 276 | "dev": true 277 | }, 278 | "isarray": { 279 | "version": "0.0.1", 280 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", 281 | "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", 282 | "dev": true 283 | }, 284 | "isexe": { 285 | "version": "2.0.0", 286 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 287 | "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", 288 | "dev": true 289 | }, 290 | "istanbul": { 291 | "version": "0.4.5", 292 | "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", 293 | "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", 294 | "dev": true, 295 | "requires": { 296 | "abbrev": "1.0.x", 297 | "async": "1.x", 298 | "escodegen": "1.8.x", 299 | "esprima": "2.7.x", 300 | "glob": "^5.0.15", 301 | "handlebars": "^4.0.1", 302 | "js-yaml": "3.x", 303 | "mkdirp": "0.5.x", 304 | "nopt": "3.x", 305 | "once": "1.x", 306 | "resolve": "1.1.x", 307 | "supports-color": "^3.1.0", 308 | "which": "^1.1.1", 309 | "wordwrap": "^1.0.0" 310 | } 311 | }, 312 | "js-yaml": { 313 | "version": "3.12.0", 314 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", 315 | "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", 316 | "dev": true, 317 | "requires": { 318 | "argparse": "^1.0.7", 319 | "esprima": "^4.0.0" 320 | }, 321 | "dependencies": { 322 | "esprima": { 323 | "version": "4.0.1", 324 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", 325 | "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", 326 | "dev": true 327 | } 328 | } 329 | }, 330 | "just-extend": { 331 | "version": "3.0.0", 332 | "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-3.0.0.tgz", 333 | "integrity": "sha512-Fu3T6pKBuxjWT/p4DkqGHFRsysc8OauWr4ZRTY9dIx07Y9O0RkoR5jcv28aeD1vuAwhm3nLkDurwLXoALp4DpQ==", 334 | "dev": true 335 | }, 336 | "levn": { 337 | "version": "0.3.0", 338 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", 339 | "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", 340 | "dev": true, 341 | "requires": { 342 | "prelude-ls": "~1.1.2", 343 | "type-check": "~0.3.2" 344 | } 345 | }, 346 | "lodash": { 347 | "version": "4.17.11", 348 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", 349 | "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", 350 | "dev": true 351 | }, 352 | "lodash.get": { 353 | "version": "4.4.2", 354 | "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", 355 | "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", 356 | "dev": true 357 | }, 358 | "lolex": { 359 | "version": "3.0.0", 360 | "resolved": "https://registry.npmjs.org/lolex/-/lolex-3.0.0.tgz", 361 | "integrity": "sha512-hcnW80h3j2lbUfFdMArd5UPA/vxZJ+G8vobd+wg3nVEQA0EigStbYcrG030FJxL6xiDDPEkoMatV9xIh5OecQQ==", 362 | "dev": true 363 | }, 364 | "merge-descriptors": { 365 | "version": "1.0.1", 366 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 367 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", 368 | "dev": true 369 | }, 370 | "minimatch": { 371 | "version": "3.0.4", 372 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 373 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 374 | "dev": true, 375 | "requires": { 376 | "brace-expansion": "^1.1.7" 377 | } 378 | }, 379 | "minimist": { 380 | "version": "0.0.10", 381 | "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", 382 | "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", 383 | "dev": true 384 | }, 385 | "mkdirp": { 386 | "version": "0.5.1", 387 | "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 388 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 389 | "dev": true, 390 | "requires": { 391 | "minimist": "0.0.8" 392 | }, 393 | "dependencies": { 394 | "minimist": { 395 | "version": "0.0.8", 396 | "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 397 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", 398 | "dev": true 399 | } 400 | } 401 | }, 402 | "mocha": { 403 | "version": "5.2.0", 404 | "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", 405 | "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", 406 | "dev": true, 407 | "requires": { 408 | "browser-stdout": "1.3.1", 409 | "commander": "2.15.1", 410 | "debug": "3.1.0", 411 | "diff": "3.5.0", 412 | "escape-string-regexp": "1.0.5", 413 | "glob": "7.1.2", 414 | "growl": "1.10.5", 415 | "he": "1.1.1", 416 | "minimatch": "3.0.4", 417 | "mkdirp": "0.5.1", 418 | "supports-color": "5.4.0" 419 | }, 420 | "dependencies": { 421 | "commander": { 422 | "version": "2.15.1", 423 | "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", 424 | "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", 425 | "dev": true 426 | }, 427 | "glob": { 428 | "version": "7.1.2", 429 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", 430 | "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", 431 | "dev": true, 432 | "requires": { 433 | "fs.realpath": "^1.0.0", 434 | "inflight": "^1.0.4", 435 | "inherits": "2", 436 | "minimatch": "^3.0.4", 437 | "once": "^1.3.0", 438 | "path-is-absolute": "^1.0.0" 439 | } 440 | }, 441 | "has-flag": { 442 | "version": "3.0.0", 443 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 444 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 445 | "dev": true 446 | }, 447 | "supports-color": { 448 | "version": "5.4.0", 449 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", 450 | "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", 451 | "dev": true, 452 | "requires": { 453 | "has-flag": "^3.0.0" 454 | } 455 | } 456 | } 457 | }, 458 | "module-not-found-error": { 459 | "version": "1.0.1", 460 | "resolved": "https://registry.npmjs.org/module-not-found-error/-/module-not-found-error-1.0.1.tgz", 461 | "integrity": "sha1-z4tP9PKWQGdNbN0CsOO8UjwrvcA=", 462 | "dev": true 463 | }, 464 | "ms": { 465 | "version": "2.0.0", 466 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 467 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", 468 | "dev": true 469 | }, 470 | "nise": { 471 | "version": "1.4.6", 472 | "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.6.tgz", 473 | "integrity": "sha512-1GedetLKzmqmgwabuMSqPsT7oumdR77SBpDfNNJhADRIeA3LN/2RVqR4fFqwvzhAqcTef6PPCzQwITE/YQ8S8A==", 474 | "dev": true, 475 | "requires": { 476 | "@sinonjs/formatio": "3.0.0", 477 | "just-extend": "^3.0.0", 478 | "lolex": "^2.3.2", 479 | "path-to-regexp": "^1.7.0", 480 | "text-encoding": "^0.6.4" 481 | }, 482 | "dependencies": { 483 | "lolex": { 484 | "version": "2.7.5", 485 | "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.5.tgz", 486 | "integrity": "sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q==", 487 | "dev": true 488 | } 489 | } 490 | }, 491 | "nopt": { 492 | "version": "3.0.6", 493 | "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", 494 | "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", 495 | "dev": true, 496 | "requires": { 497 | "abbrev": "1" 498 | } 499 | }, 500 | "once": { 501 | "version": "1.4.0", 502 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 503 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 504 | "dev": true, 505 | "requires": { 506 | "wrappy": "1" 507 | } 508 | }, 509 | "optimist": { 510 | "version": "0.6.1", 511 | "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", 512 | "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", 513 | "dev": true, 514 | "requires": { 515 | "minimist": "~0.0.1", 516 | "wordwrap": "~0.0.2" 517 | }, 518 | "dependencies": { 519 | "wordwrap": { 520 | "version": "0.0.3", 521 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", 522 | "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", 523 | "dev": true 524 | } 525 | } 526 | }, 527 | "optionator": { 528 | "version": "0.8.2", 529 | "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", 530 | "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", 531 | "dev": true, 532 | "requires": { 533 | "deep-is": "~0.1.3", 534 | "fast-levenshtein": "~2.0.4", 535 | "levn": "~0.3.0", 536 | "prelude-ls": "~1.1.2", 537 | "type-check": "~0.3.2", 538 | "wordwrap": "~1.0.0" 539 | } 540 | }, 541 | "path-is-absolute": { 542 | "version": "1.0.1", 543 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 544 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 545 | "dev": true 546 | }, 547 | "path-parse": { 548 | "version": "1.0.6", 549 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", 550 | "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", 551 | "dev": true 552 | }, 553 | "path-to-regexp": { 554 | "version": "1.7.0", 555 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", 556 | "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", 557 | "dev": true, 558 | "requires": { 559 | "isarray": "0.0.1" 560 | } 561 | }, 562 | "prelude-ls": { 563 | "version": "1.1.2", 564 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", 565 | "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", 566 | "dev": true 567 | }, 568 | "proxyquire": { 569 | "version": "2.1.0", 570 | "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-2.1.0.tgz", 571 | "integrity": "sha512-kptdFArCfGRtQFv3Qwjr10lwbEV0TBJYvfqzhwucyfEXqVgmnAkyEw/S3FYzR5HI9i5QOq4rcqQjZ6AlknlCDQ==", 572 | "dev": true, 573 | "requires": { 574 | "fill-keys": "^1.0.2", 575 | "module-not-found-error": "^1.0.0", 576 | "resolve": "~1.8.1" 577 | }, 578 | "dependencies": { 579 | "resolve": { 580 | "version": "1.8.1", 581 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", 582 | "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", 583 | "dev": true, 584 | "requires": { 585 | "path-parse": "^1.0.5" 586 | } 587 | } 588 | } 589 | }, 590 | "redis": { 591 | "version": "2.8.0", 592 | "resolved": "https://registry.npmjs.org/redis/-/redis-2.8.0.tgz", 593 | "integrity": "sha512-M1OkonEQwtRmZv4tEWF2VgpG0JWJ8Fv1PhlgT5+B+uNq2cA3Rt1Yt/ryoR+vQNOQcIEgdCdfH0jr3bDpihAw1A==", 594 | "requires": { 595 | "double-ended-queue": "^2.1.0-0", 596 | "redis-commands": "^1.2.0", 597 | "redis-parser": "^2.6.0" 598 | } 599 | }, 600 | "redis-commands": { 601 | "version": "1.4.0", 602 | "resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.4.0.tgz", 603 | "integrity": "sha512-cu8EF+MtkwI4DLIT0x9P8qNTLFhQD4jLfxLR0cCNkeGzs87FN6879JOJwNQR/1zD7aSYNbU0hgsV9zGY71Itvw==" 604 | }, 605 | "redis-parser": { 606 | "version": "2.6.0", 607 | "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-2.6.0.tgz", 608 | "integrity": "sha1-Uu0J2srBCPGmMcB+m2mUHnoZUEs=" 609 | }, 610 | "resolve": { 611 | "version": "1.1.7", 612 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", 613 | "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", 614 | "dev": true 615 | }, 616 | "should": { 617 | "version": "13.2.3", 618 | "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", 619 | "integrity": "sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==", 620 | "dev": true, 621 | "requires": { 622 | "should-equal": "^2.0.0", 623 | "should-format": "^3.0.3", 624 | "should-type": "^1.4.0", 625 | "should-type-adaptors": "^1.0.1", 626 | "should-util": "^1.0.0" 627 | } 628 | }, 629 | "should-equal": { 630 | "version": "2.0.0", 631 | "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-2.0.0.tgz", 632 | "integrity": "sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==", 633 | "dev": true, 634 | "requires": { 635 | "should-type": "^1.4.0" 636 | } 637 | }, 638 | "should-format": { 639 | "version": "3.0.3", 640 | "resolved": "https://registry.npmjs.org/should-format/-/should-format-3.0.3.tgz", 641 | "integrity": "sha1-m/yPdPo5IFxT04w01xcwPidxJPE=", 642 | "dev": true, 643 | "requires": { 644 | "should-type": "^1.3.0", 645 | "should-type-adaptors": "^1.0.1" 646 | } 647 | }, 648 | "should-sinon": { 649 | "version": "0.0.6", 650 | "resolved": "https://registry.npmjs.org/should-sinon/-/should-sinon-0.0.6.tgz", 651 | "integrity": "sha512-ScBOH5uW5QVFaONmUnIXANSR6z5B8IKzEmBP3HE5sPOCDuZ88oTMdUdnKoCVQdLcCIrRrhRLPS5YT+7H40a04g==", 652 | "dev": true 653 | }, 654 | "should-type": { 655 | "version": "1.4.0", 656 | "resolved": "https://registry.npmjs.org/should-type/-/should-type-1.4.0.tgz", 657 | "integrity": "sha1-B1bYzoRt/QmEOmlHcZ36DUz/XPM=", 658 | "dev": true 659 | }, 660 | "should-type-adaptors": { 661 | "version": "1.1.0", 662 | "resolved": "https://registry.npmjs.org/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz", 663 | "integrity": "sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==", 664 | "dev": true, 665 | "requires": { 666 | "should-type": "^1.3.0", 667 | "should-util": "^1.0.0" 668 | } 669 | }, 670 | "should-util": { 671 | "version": "1.0.0", 672 | "resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.0.tgz", 673 | "integrity": "sha1-yYzaN0qmsZDfi6h8mInCtNtiAGM=", 674 | "dev": true 675 | }, 676 | "sinon": { 677 | "version": "7.1.1", 678 | "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.1.1.tgz", 679 | "integrity": "sha512-iYagtjLVt1vN3zZY7D8oH7dkjNJEjLjyuzy8daX5+3bbQl8gaohrheB9VfH1O3L6LKuue5WTJvFluHiuZ9y3nQ==", 680 | "dev": true, 681 | "requires": { 682 | "@sinonjs/commons": "^1.2.0", 683 | "@sinonjs/formatio": "^3.0.0", 684 | "@sinonjs/samsam": "^2.1.2", 685 | "diff": "^3.5.0", 686 | "lodash.get": "^4.4.2", 687 | "lolex": "^3.0.0", 688 | "nise": "^1.4.6", 689 | "supports-color": "^5.5.0", 690 | "type-detect": "^4.0.8" 691 | }, 692 | "dependencies": { 693 | "has-flag": { 694 | "version": "3.0.0", 695 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 696 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 697 | "dev": true 698 | }, 699 | "supports-color": { 700 | "version": "5.5.0", 701 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 702 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 703 | "dev": true, 704 | "requires": { 705 | "has-flag": "^3.0.0" 706 | } 707 | } 708 | } 709 | }, 710 | "source-map": { 711 | "version": "0.2.0", 712 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", 713 | "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", 714 | "dev": true, 715 | "optional": true, 716 | "requires": { 717 | "amdefine": ">=0.0.4" 718 | } 719 | }, 720 | "sprintf-js": { 721 | "version": "1.0.3", 722 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 723 | "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", 724 | "dev": true 725 | }, 726 | "supports-color": { 727 | "version": "3.2.3", 728 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", 729 | "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", 730 | "dev": true, 731 | "requires": { 732 | "has-flag": "^1.0.0" 733 | } 734 | }, 735 | "text-encoding": { 736 | "version": "0.6.4", 737 | "resolved": "http://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz", 738 | "integrity": "sha1-45mpgiV6J22uQou5KEXLcb3CbRk=", 739 | "dev": true 740 | }, 741 | "type-check": { 742 | "version": "0.3.2", 743 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", 744 | "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", 745 | "dev": true, 746 | "requires": { 747 | "prelude-ls": "~1.1.2" 748 | } 749 | }, 750 | "type-detect": { 751 | "version": "4.0.8", 752 | "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", 753 | "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", 754 | "dev": true 755 | }, 756 | "uglify-js": { 757 | "version": "3.4.9", 758 | "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", 759 | "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", 760 | "dev": true, 761 | "optional": true, 762 | "requires": { 763 | "commander": "~2.17.1", 764 | "source-map": "~0.6.1" 765 | }, 766 | "dependencies": { 767 | "source-map": { 768 | "version": "0.6.1", 769 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 770 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 771 | "dev": true, 772 | "optional": true 773 | } 774 | } 775 | }, 776 | "which": { 777 | "version": "1.3.1", 778 | "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", 779 | "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", 780 | "dev": true, 781 | "requires": { 782 | "isexe": "^2.0.0" 783 | } 784 | }, 785 | "wordwrap": { 786 | "version": "1.0.0", 787 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", 788 | "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", 789 | "dev": true 790 | }, 791 | "wrappy": { 792 | "version": "1.0.2", 793 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 794 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 795 | "dev": true 796 | } 797 | } 798 | } 799 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "botkit-storage-redis", 3 | "version": "1.1.0", 4 | "description": "A Redis storage driver for Botkit", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js", 8 | "pretest": "jscs ./", 9 | "test": "istanbul cover --report lcov --dir coverage/ _mocha ./tests --grep ./tests/*.js -- --colors" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/howdyai/botkit-storage-redis.git" 14 | }, 15 | "keywords": [ 16 | "botkit", 17 | "redis", 18 | "slack" 19 | ], 20 | "author": "", 21 | "license": "MIT", 22 | "bugs": { 23 | "url": "https://github.com/howdyai/botkit-storage-redis/issues" 24 | }, 25 | "homepage": "https://github.com/howdyai/botkit-storage-redis#readme", 26 | "dependencies": { 27 | "redis": "^2.8.0" 28 | }, 29 | "devDependencies": { 30 | "istanbul": "^0.4.5", 31 | "mocha": "^5.2.0", 32 | "proxyquire": "^2.1.0", 33 | "should": "^13.2.3", 34 | "should-sinon": "0.0.6", 35 | "sinon": "^7.1.1" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | // copied from https://github.com/howdyai/botkit version 0.0.5, original authors: @RafaelCosman and @guillaumepotier 2 | 3 | var redis = require('redis'); 4 | 5 | /** 6 | * botkit-storage-redis - Redis driver for Botkit 7 | * 8 | * @param {Object} config (optional) For full list of valid redis options, see 9 | * https://github.com/NodeRedis/node_redis#options-is-an-object-with-the-following-possible-properties 10 | * @property config.namespace {String} The namespace to use when storing entities. Defaults to 'botkit:store' 11 | * @return {Object} Storage interface for Botkit 12 | */ 13 | module.exports = function(config) { 14 | config = config || {}; 15 | config.namespace = config.namespace || 'botkit:store'; 16 | config.methods = config.methods || []; 17 | 18 | var storage = {}, 19 | client = redis.createClient(config), // could pass specific redis config here 20 | methods = ['teams', 'users', 'channels'].concat(config.methods); 21 | 22 | // Implements required API methods 23 | for (var i = 0; i < methods.length; i++) { 24 | storage[methods[i]] = getStorageObj(client, config.namespace + ':' + methods[i]); 25 | } 26 | 27 | return storage; 28 | }; 29 | 30 | /** 31 | * Function to generate a storage object for a given namespace 32 | * 33 | * @param {Object} client The redis client 34 | * @param {String} namespace The namespace to use for storing in Redis 35 | * @returns {{get: get, save: save, all: all, allById: allById}} 36 | */ 37 | function getStorageObj(client, namespace) { 38 | return { 39 | get: function(id, cb) { 40 | client.hget(namespace, id, function(err, res) { 41 | cb(err, res ? JSON.parse(res) : null); 42 | }); 43 | }, 44 | save: function(object, cb) { 45 | if (!object.id) { 46 | return cb(new Error('The given object must have an id property'), {}); 47 | } 48 | 49 | client.hset(namespace, object.id, JSON.stringify(object), cb); 50 | }, 51 | remove: function(id, cb) { 52 | client.hdel(namespace, [id], cb); 53 | }, 54 | all: function(cb, options) { 55 | client.hgetall(namespace, function(err, res) { 56 | if (err) { 57 | return cb(err); 58 | } 59 | 60 | var parsed, 61 | array = []; 62 | 63 | for (var i in res) { 64 | parsed = JSON.parse(res[i]); 65 | res[i] = parsed; 66 | array.push(parsed); 67 | } 68 | 69 | cb(null, options && options.type === 'object' ? res : array); 70 | }); 71 | } 72 | }; 73 | } 74 | -------------------------------------------------------------------------------- /tests/index.js: -------------------------------------------------------------------------------- 1 | var should = require('should'), sinon = require('sinon'), proxyquire = require('proxyquire').noCallThru(); 2 | 3 | require('should-sinon'); 4 | 5 | describe('Redis', function() { 6 | var Storage, 7 | redisMock, 8 | redisClientMock, 9 | defaultNamespace; 10 | 11 | beforeEach(function() { 12 | defaultNamespace = 'botkit:store'; 13 | 14 | redisClientMock = { 15 | hget: sinon.stub(), 16 | hset: sinon.stub(), 17 | hdel: sinon.stub(), 18 | hgetall: sinon.stub(), 19 | }; 20 | 21 | redisMock = { 22 | createClient: sinon.stub().returns(redisClientMock) 23 | }; 24 | 25 | Storage = proxyquire('../src/index', {'redis': redisMock}); 26 | }); 27 | 28 | describe('initialization', function() { 29 | 30 | it('should initialize redis with the config', function() { 31 | var config = {}; 32 | Storage(config); 33 | redisMock.createClient.should.be.calledWith(config); 34 | }); 35 | 36 | it('should set a custom namespace', function() { 37 | var config = {namespace: 'custom'}; 38 | Storage(config); 39 | config.should.have.property('namespace', 'custom'); 40 | }); 41 | 42 | it('should default the namespace', function() { 43 | var config = {}; 44 | Storage(config); 45 | config.should.have.property('namespace', defaultNamespace); 46 | }); 47 | 48 | it('should create a default config', function() { 49 | Storage(); 50 | redisMock.createClient.should.be.calledWith({namespace: defaultNamespace, 51 | methods: []}); 52 | }); 53 | }); 54 | 55 | ['teams', 'users', 'channels'].forEach(function(method) { 56 | describe(method, function() { 57 | var storageInterface, hash; 58 | 59 | beforeEach(function() { 60 | storageInterface = Storage(); 61 | hash = defaultNamespace + ':' + method; 62 | }); 63 | 64 | describe('get', function() { 65 | 66 | beforeEach(function() { 67 | sinon.spy(JSON, 'parse'); 68 | }); 69 | 70 | afterEach(function() { 71 | JSON.parse.restore(); 72 | }); 73 | 74 | it('should get by ID', function() { 75 | var result = '{}', 76 | cb = sinon.stub(); 77 | 78 | redisClientMock.hget.yields(null, result); 79 | 80 | storageInterface[method].get('walterwhite', cb); 81 | 82 | redisClientMock.hget.should.be.calledWithMatch(hash, 'walterwhite'); 83 | JSON.parse.should.be.calledWith(result); 84 | cb.should.be.calledWith(null, {}); 85 | }); 86 | 87 | it('should handle falsy result', function() { 88 | var cb = sinon.stub(); 89 | 90 | redisClientMock.hget.yields(null, ''); 91 | 92 | storageInterface[method].get('walterwhite', cb); 93 | 94 | redisClientMock.hget.should.be.calledWithMatch(hash, 'walterwhite'); 95 | JSON.parse.should.not.be.called; 96 | cb.should.be.calledWith(null, null); 97 | }); 98 | 99 | it('should call the callback with an error if redis fails', function() { 100 | var cb = sinon.stub(), err = new Error('OOPS!'); 101 | 102 | redisClientMock.hget.yields(err); 103 | 104 | storageInterface[method].get('walterwhite', cb); 105 | 106 | redisClientMock.hget.should.be.calledWithMatch(hash, 'walterwhite'); 107 | JSON.parse.should.not.be.called; 108 | cb.should.be.calledWith(err, null); 109 | }); 110 | }); 111 | 112 | describe('save', function() { 113 | 114 | beforeEach(function() { 115 | sinon.spy(JSON, 'stringify'); 116 | }); 117 | 118 | afterEach(function() { 119 | JSON.stringify.restore(); 120 | }); 121 | 122 | it('should throw an error if ID is not provided', function() { 123 | var obj = {}, 124 | cb = sinon.stub(); 125 | 126 | storageInterface[method].save(obj, cb); 127 | 128 | cb.firstCall.args[0].should.be.an.Error; 129 | cb.firstCall.args[1].should.match({}); 130 | }); 131 | 132 | it('should save to redis', function() { 133 | var obj = {id: 'heisenberg'}, cb = sinon.stub(); 134 | 135 | storageInterface[method].save(obj, cb); 136 | 137 | JSON.stringify.should.be.calledWith(obj); 138 | 139 | redisClientMock.hset.should.be.calledWith( 140 | defaultNamespace + ':' + method, 141 | 'heisenberg', 142 | '{"id":"heisenberg"}', 143 | cb 144 | ); 145 | }); 146 | }); 147 | 148 | describe('remove', function() { 149 | 150 | beforeEach(function() { 151 | sinon.spy(JSON, 'stringify'); 152 | }); 153 | 154 | afterEach(function() { 155 | JSON.stringify.restore(); 156 | }); 157 | 158 | it('should remove from redis', function() { 159 | var id = 'heisenberg', cb = sinon.stub(); 160 | 161 | storageInterface[method].remove(id, cb); 162 | 163 | redisClientMock.hdel.should.be.calledWith( 164 | defaultNamespace + ':' + method, 165 | ['heisenberg'], 166 | cb 167 | ); 168 | }); 169 | }); 170 | 171 | 172 | describe('all', function() { 173 | 174 | beforeEach(function() { 175 | sinon.spy(JSON, 'parse'); 176 | }); 177 | 178 | afterEach(function() { 179 | JSON.parse.restore(); 180 | }); 181 | 182 | it('should call callback with error if redis fails', function() { 183 | var cb = sinon.stub(), 184 | err = new Error('OOPS!'); 185 | 186 | redisClientMock.hgetall.yields(err); 187 | 188 | storageInterface[method].all(cb); 189 | 190 | redisClientMock.hgetall.should.be.calledWithMatch(hash); 191 | cb.should.be.calledWith(err); 192 | }); 193 | 194 | it('should return an array by default', function() { 195 | var cb = sinon.stub(), 196 | result = ['{"walterwhite":"heisenberg"}', '{"jessepinkman":"capncook"}']; 197 | 198 | redisClientMock.hgetall.yields(null, result); 199 | 200 | storageInterface[method].all(cb); 201 | 202 | redisClientMock.hgetall.should.be.calledWithMatch(hash); 203 | JSON.parse.should.be.calledTwice; 204 | cb.should.be.calledWithMatch(null, [{'walterwhite': 'heisenberg'}, {'jessepinkman': 'capncook'}]); 205 | }); 206 | 207 | it('should return an object if specified in options', function() { 208 | var cb = sinon.stub(), 209 | result = {key1: '{"walterwhite":"heisenberg"}', key2: '{"jessepinkman":"capncook"}'}; 210 | 211 | redisClientMock.hgetall.yields(null, result); 212 | 213 | storageInterface[method].all(cb, {type: 'object'}); 214 | 215 | redisClientMock.hgetall.should.be.calledWithMatch(hash); 216 | JSON.parse.should.be.calledTwice; 217 | cb.should.be.calledWithMatch( 218 | null, 219 | {key1: {'walterwhite': 'heisenberg'}, key2: {'jessepinkman': 'capncook'}} 220 | ); 221 | }); 222 | 223 | it('should return an array if something other than object is specified in options', function() { 224 | var cb = sinon.stub(), 225 | result = ['{"walterwhite":"heisenberg"}', '{"jessepinkman":"capncook"}']; 226 | 227 | redisClientMock.hgetall.yields(null, result); 228 | 229 | storageInterface[method].all(cb, {type: 'notobject'}); 230 | 231 | redisClientMock.hgetall.should.be.calledWithMatch(hash); 232 | JSON.parse.should.be.calledTwice; 233 | cb.should.be.calledWithMatch(null, [{'walterwhite': 'heisenberg'}, {'jessepinkman': 'capncook'}]); 234 | }); 235 | }); 236 | }); 237 | }); 238 | }); 239 | --------------------------------------------------------------------------------