├── .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 | 154 | 155 | # concat-map 156 | 157 | Copyright (c) James Halliday 158 | 159 | Permission is hereby granted, free of charge, to any person obtaining a copy of 160 | this software and associated documentation files (the "Software"), to deal in 161 | the Software without restriction, including without limitation the rights to 162 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 163 | the Software, and to permit persons to whom the Software is furnished to do so, 164 | subject to the following conditions: 165 | 166 | The above copyright notice and this permission notice shall be included in all 167 | copies or substantial portions of the Software. 168 | 169 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 170 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 171 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 172 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 173 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 174 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 175 | 176 | 177 | # deep-equal 178 | 179 | Copyright (c) James Halliday 180 | 181 | 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: 182 | 183 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 184 | 185 | 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. 186 | 187 | 188 | # defined 189 | 190 | Copyright (c) James Halliday 191 | 192 | 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: 193 | 194 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 195 | 196 | 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. 197 | 198 | 199 | # detective 200 | 201 | Copyright (c) James Halliday 202 | 203 | 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: 204 | 205 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 206 | 207 | 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. 208 | 209 | 210 | # get-stdin 211 | 212 | Copyright (c) Sindre Sorhus (sindresorhus.com) 213 | 214 | 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: 215 | 216 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 217 | 218 | 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. 219 | 220 | 221 | # i 222 | 223 | Copyright (c) Pavan Kumar Sunkara 224 | 225 | 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: 226 | 227 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 228 | 229 | 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. 230 | 231 | # invert-kv 232 | 233 | Copyright (c) Sindre Sorhus (sindresorhus.com) 234 | 235 | 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: 236 | 237 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 238 | 239 | 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. 240 | 241 | 242 | 243 | # jsdoctypeparser 244 | 245 | "Copyright (c) 2018 Kuniwak 246 | 247 | 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: 248 | 249 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 250 | 251 | 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." 252 | 253 | 254 | # resolve 255 | 256 | Copyright (c) James Halliday 257 | 258 | 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: 259 | 260 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 261 | 262 | 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. 263 | 264 | # wordwrap 265 | 266 | Copyright (c) James Halliday 267 | 268 | 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: 269 | 270 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 271 | 272 | 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 | 20 | ## Submitting Issues 21 | 22 | * You can create an issue [here](https://github.com/howdyai/botkit-storage-firebase/issues/new), 23 | but before doing that please read the notes below and include as many details as 24 | possible with your report. If you can, please include: 25 | * The version of Botkit you are using 26 | * The operating system you are using 27 | * If applicable, what you were doing when the issue arose and what you 28 | expected to happen 29 | * Other things that will help resolve your issue: 30 | * Screenshots and animated GIFs 31 | * Error output that appears in your terminal, dev tools or as an alert 32 | * Perform a [cursory search](https://github.com/howdyai/botkit-storage-firebase/issues?utf8=✓&q=is%3Aissue+) 33 | to see if a similar issue has already been submitted 34 | 35 | ## Submitting Pull Requests 36 | 37 | * Include screenshots and animated GIFs in your pull request whenever possible. 38 | * Follow the JavaScript coding style with details from `.jscsrc` and `.editorconfig` files and use necessary plugins for your text editor. 39 | * Write documentation in [Markdown](https://daringfireball.net/projects/markdown). 40 | * Use short, present tense commit messages. See [Commit Message Styleguide](#git-commit-messages). 41 | 42 | ## Styleguides 43 | 44 | ### General Code 45 | 46 | * End files with a newline. 47 | * Place requires in the following order: 48 | * Built in Node Modules (such as `path`) 49 | * Local Modules (using relative paths) 50 | * Avoid platform-dependent code: 51 | * Use `path.join()` to concatenate filenames. 52 | * Using a plain `return` when returning explicitly at the end of a function. 53 | * Not `return null`, `return undefined`, `null`, or `undefined` 54 | 55 | ### Git Commit Messages 56 | 57 | * Use the present tense ("Add feature" not "Added feature") 58 | * Use the imperative mood ("Move cursor to..." not "Moves cursor to...") 59 | * Limit the first line to 72 characters or less 60 | * Reference issues and pull requests liberally 61 | -------------------------------------------------------------------------------- /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-firebase 2 | 3 | A Firebase storage module for Botkit. 4 | 5 | ## Usage 6 | 7 | Just require `botkit-storage-firebase` and pass it a config with a `firebase_uri` option. 8 | Then pass the returned storage when creating your Botkit controller. Botkit will do the rest. 9 | 10 | Make sure everything you store has an `id` property, that's what you'll use to look it up later. 11 | 12 | ``` 13 | var Botkit = require('botkit'), 14 | firebaseStorage = require('botkit-storage-firebase')({databaseURL: '...'}), 15 | controller = Botkit.slackbot({ 16 | storage: firebaseStorage 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 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./src'); 2 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "botkit-storage-firebase", 3 | "version": "1.0.1", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@firebase/app": { 8 | "version": "0.3.4", 9 | "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.3.4.tgz", 10 | "integrity": "sha512-Q6sNpWZ3x+FeuBkLCCRrsOraGJOKVLUCc9Amj8zu2vAC1v2uWifRR6kZ60TrpaIxtY4N6pcPTaG0YIUT5lgeSA==", 11 | "requires": { 12 | "@firebase/app-types": "0.3.2", 13 | "@firebase/util": "0.2.2", 14 | "dom-storage": "2.1.0", 15 | "tslib": "1.9.0", 16 | "xmlhttprequest": "1.8.0" 17 | } 18 | }, 19 | "@firebase/app-types": { 20 | "version": "0.3.2", 21 | "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.3.2.tgz", 22 | "integrity": "sha512-ZD8lTgW07NGgo75bTyBJA8Lt9+NweNzot7lrsBtIvfciwUzaFJLsv2EShqjBeuhF7RpG6YFucJ6m67w5buCtzw==" 23 | }, 24 | "@firebase/auth": { 25 | "version": "0.7.8", 26 | "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-0.7.8.tgz", 27 | "integrity": "sha512-49WyZekDuqoekW5Yl9JG+CNJb65UcWKgeI2fA9hDUdxQ2d0xFHcEVJGkEiHrgkv2a4/v44UP9xggQrvmbUg23w==", 28 | "requires": { 29 | "@firebase/auth-types": "0.3.4" 30 | } 31 | }, 32 | "@firebase/auth-types": { 33 | "version": "0.3.4", 34 | "resolved": "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.3.4.tgz", 35 | "integrity": "sha512-0r3gSQk9jw5orFHCTUIgao0zan6dHt2J0BO3t/uEzbod+uwqvUn/gh+yg+kK6HX92Fg8E7y030KX4Bw/aXt0Ew==" 36 | }, 37 | "@firebase/database": { 38 | "version": "0.3.6", 39 | "resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.3.6.tgz", 40 | "integrity": "sha512-r02JOqTLcd2/qn7QkkJvIAxMiMxmeyd5B76kl9hHAs+3cil5mUzHnI3svtb4h0VIJYDHFKJMlVl/bE3GfcTR3A==", 41 | "requires": { 42 | "@firebase/database-types": "0.3.2", 43 | "@firebase/logger": "0.1.1", 44 | "@firebase/util": "0.2.2", 45 | "faye-websocket": "0.11.1", 46 | "tslib": "1.9.0" 47 | } 48 | }, 49 | "@firebase/database-types": { 50 | "version": "0.3.2", 51 | "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-0.3.2.tgz", 52 | "integrity": "sha512-9ZYdvYQ6r3aaHJarhUM5Hf6lQWu3ZJme+RR0o8qfBb9L04TL3uNjt+AJFku1ysVPntTn+9GqJjiIB2/OC3JtwA==" 53 | }, 54 | "@firebase/firestore": { 55 | "version": "0.8.6", 56 | "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-0.8.6.tgz", 57 | "integrity": "sha512-/mEnGgGJxXJfAW6hvMOiPGv3cPS5z0azCMzcKlAQ2/lhXyQotubqWDnJmNcdyi1LGZ3QGBesB3K8U4x6tZXTIQ==", 58 | "requires": { 59 | "@firebase/firestore-types": "0.7.0", 60 | "@firebase/logger": "0.1.1", 61 | "@firebase/webchannel-wrapper": "0.2.11", 62 | "grpc": "1.13.1", 63 | "tslib": "1.9.0" 64 | } 65 | }, 66 | "@firebase/firestore-types": { 67 | "version": "0.7.0", 68 | "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-0.7.0.tgz", 69 | "integrity": "sha512-jyKRcKnSh3CSEPL4xGOZNoOXEiv7YmFK/JEcdd/4cAH17/Xo+Pk67gk1E648LRKh6QPghgNvzNTY5R10mKbQNw==" 70 | }, 71 | "@firebase/functions": { 72 | "version": "0.3.1", 73 | "resolved": "https://registry.npmjs.org/@firebase/functions/-/functions-0.3.1.tgz", 74 | "integrity": "sha512-6A38x7zPU6zCTyOgGx2v+z4ugcsWnciL6YkcZXLNlCLveUmFdL0DmaW5MEBSpSOOe8kOJMl7f3aaD6lWUHNOBg==", 75 | "requires": { 76 | "@firebase/functions-types": "0.2.0", 77 | "@firebase/messaging-types": "0.2.3", 78 | "isomorphic-fetch": "2.2.1", 79 | "tslib": "1.9.0" 80 | } 81 | }, 82 | "@firebase/functions-types": { 83 | "version": "0.2.0", 84 | "resolved": "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.2.0.tgz", 85 | "integrity": "sha512-q1FB3YKEAnWd+FpIL5Xn0B1BXO2IowrAdrSViXkFxNZVpp9iCzQ8Ytcbr3V1xUr3dnmoW/V7zkZJZGuwBgiVhw==" 86 | }, 87 | "@firebase/logger": { 88 | "version": "0.1.1", 89 | "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.1.1.tgz", 90 | "integrity": "sha512-5jn3HHbEfdOwychyIEIkP1cik+MW/vvoOavTOzwDkH+fv6Bx+HBUOzh09M7sCYzXFtKzjbUax9+g39mJNBLklQ==" 91 | }, 92 | "@firebase/messaging": { 93 | "version": "0.3.6", 94 | "resolved": "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.3.6.tgz", 95 | "integrity": "sha512-Sz/fWOXMa3HxDZxE64Fm335kwP9um1rmun5PIka7od7I4hZ8US+SjYVyUe6jWTh1V/YjcqDi6Xkhoj2nF8yu9g==", 96 | "requires": { 97 | "@firebase/messaging-types": "0.2.3", 98 | "@firebase/util": "0.2.2", 99 | "tslib": "1.9.0" 100 | } 101 | }, 102 | "@firebase/messaging-types": { 103 | "version": "0.2.3", 104 | "resolved": "https://registry.npmjs.org/@firebase/messaging-types/-/messaging-types-0.2.3.tgz", 105 | "integrity": "sha512-avwCgZzcx2uxIW/wT3p3G/EyHftIrvMyiTS7AA7dxDlzfx+8dpAeTsb1+jsHJT4F6foSh5HG17Nw8sDzYuxH1Q==" 106 | }, 107 | "@firebase/polyfill": { 108 | "version": "0.3.3", 109 | "resolved": "https://registry.npmjs.org/@firebase/polyfill/-/polyfill-0.3.3.tgz", 110 | "integrity": "sha512-xs8IZf1WEbufYXyfV8YjmiFZOaujRRq0T03NteihYfuGVTTym7z5SmvLvEHLEUjf2fgeobPEzZ2JgrCQHS+QHw==", 111 | "requires": { 112 | "core-js": "2.5.5", 113 | "promise-polyfill": "7.1.2", 114 | "whatwg-fetch": "2.0.4" 115 | }, 116 | "dependencies": { 117 | "whatwg-fetch": { 118 | "version": "2.0.4", 119 | "resolved": "http://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", 120 | "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" 121 | } 122 | } 123 | }, 124 | "@firebase/storage": { 125 | "version": "0.2.4", 126 | "resolved": "https://registry.npmjs.org/@firebase/storage/-/storage-0.2.4.tgz", 127 | "integrity": "sha512-uqA6CoZYkugk69ImqB16VBPP7JRPRfZwcUP9CsE0GPVGQkZQQfBGwzIyEoFA8lUfVLrvxQiL0sQvHUXZ945LMg==", 128 | "requires": { 129 | "@firebase/storage-types": "0.2.3", 130 | "tslib": "1.9.0" 131 | } 132 | }, 133 | "@firebase/storage-types": { 134 | "version": "0.2.3", 135 | "resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.2.3.tgz", 136 | "integrity": "sha512-RaZeam2LgsB7xwAtOQr4G0Geoyf7D5TnLF3a12By6Rh0Z9PqBSlWn0SVYGW3SkmxIdqvWZMZvCyamUlqQvQzWw==" 137 | }, 138 | "@firebase/util": { 139 | "version": "0.2.2", 140 | "resolved": "https://registry.npmjs.org/@firebase/util/-/util-0.2.2.tgz", 141 | "integrity": "sha512-vfRjmCWuxtJx3txHocaNlDwCDwwv6KLL5YtlSNi73wBdvF3UfnpLGrth7G3X6gn5rDhOKamRg2+9L8cfsjSS1A==", 142 | "requires": { 143 | "tslib": "1.9.0" 144 | } 145 | }, 146 | "@firebase/webchannel-wrapper": { 147 | "version": "0.2.11", 148 | "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.2.11.tgz", 149 | "integrity": "sha512-WyMXDxk/WZ+f2lOCeEvDWUce2f5Kk2sNfvArK8f+PlUnzFdy/MBzLXrmbMgyZXP7GP4ooUxYV8Sdmoh1hGk1Uw==" 150 | }, 151 | "@sinonjs/commons": { 152 | "version": "1.3.0", 153 | "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.3.0.tgz", 154 | "integrity": "sha512-j4ZwhaHmwsCb4DlDOIWnI5YyKDNMoNThsmwEpfHx6a1EpsGZ9qYLxP++LMlmBRjtGptGHFsGItJ768snllFWpA==", 155 | "dev": true, 156 | "requires": { 157 | "type-detect": "4.0.8" 158 | } 159 | }, 160 | "@sinonjs/formatio": { 161 | "version": "3.0.0", 162 | "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.0.0.tgz", 163 | "integrity": "sha512-vdjoYLDptCgvtJs57ULshak3iJe4NW3sJ3g36xVDGff5AE8P30S6A093EIEPjdi2noGhfuNOEkbxt3J3awFW1w==", 164 | "dev": true, 165 | "requires": { 166 | "@sinonjs/samsam": "2.1.0" 167 | }, 168 | "dependencies": { 169 | "@sinonjs/samsam": { 170 | "version": "2.1.0", 171 | "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-2.1.0.tgz", 172 | "integrity": "sha512-5x2kFgJYupaF1ns/RmharQ90lQkd2ELS8A9X0ymkAAdemYHGtI2KiUHG8nX2WU0T1qgnOU5YMqnBM2V7NUanNw==", 173 | "dev": true, 174 | "requires": { 175 | "array-from": "^2.1.1" 176 | } 177 | } 178 | } 179 | }, 180 | "@sinonjs/samsam": { 181 | "version": "2.1.2", 182 | "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-2.1.2.tgz", 183 | "integrity": "sha512-ZwTHAlC9akprWDinwEPD4kOuwaYZlyMwVJIANsKNC3QVp0AHB04m7RnB4eqeWfgmxw8MGTzS9uMaw93Z3QcZbw==", 184 | "dev": true 185 | }, 186 | "abbrev": { 187 | "version": "1.0.9", 188 | "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", 189 | "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", 190 | "dev": true 191 | }, 192 | "amdefine": { 193 | "version": "1.0.1", 194 | "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", 195 | "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", 196 | "dev": true, 197 | "optional": true 198 | }, 199 | "ansi-regex": { 200 | "version": "2.1.1", 201 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 202 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" 203 | }, 204 | "argparse": { 205 | "version": "1.0.10", 206 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", 207 | "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", 208 | "dev": true, 209 | "requires": { 210 | "sprintf-js": "~1.0.2" 211 | } 212 | }, 213 | "array-from": { 214 | "version": "2.1.1", 215 | "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", 216 | "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", 217 | "dev": true 218 | }, 219 | "ascli": { 220 | "version": "1.0.1", 221 | "resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.1.tgz", 222 | "integrity": "sha1-vPpZdKYvGOgcq660lzKrSoj5Brw=", 223 | "requires": { 224 | "colour": "~0.7.1", 225 | "optjs": "~3.2.2" 226 | } 227 | }, 228 | "async": { 229 | "version": "1.5.2", 230 | "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", 231 | "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", 232 | "dev": true 233 | }, 234 | "balanced-match": { 235 | "version": "1.0.0", 236 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 237 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" 238 | }, 239 | "brace-expansion": { 240 | "version": "1.1.11", 241 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 242 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 243 | "requires": { 244 | "balanced-match": "^1.0.0", 245 | "concat-map": "0.0.1" 246 | } 247 | }, 248 | "browser-stdout": { 249 | "version": "1.3.1", 250 | "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", 251 | "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", 252 | "dev": true 253 | }, 254 | "bytebuffer": { 255 | "version": "5.0.1", 256 | "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.1.tgz", 257 | "integrity": "sha1-WC7qSxqHO20CCkjVjfhfC7ps/d0=", 258 | "requires": { 259 | "long": "~3" 260 | } 261 | }, 262 | "camelcase": { 263 | "version": "2.1.1", 264 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", 265 | "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=" 266 | }, 267 | "cliui": { 268 | "version": "3.2.0", 269 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", 270 | "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", 271 | "requires": { 272 | "string-width": "^1.0.1", 273 | "strip-ansi": "^3.0.1", 274 | "wrap-ansi": "^2.0.0" 275 | } 276 | }, 277 | "code-point-at": { 278 | "version": "1.1.0", 279 | "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", 280 | "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" 281 | }, 282 | "colour": { 283 | "version": "0.7.1", 284 | "resolved": "https://registry.npmjs.org/colour/-/colour-0.7.1.tgz", 285 | "integrity": "sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g=" 286 | }, 287 | "commander": { 288 | "version": "2.17.1", 289 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", 290 | "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", 291 | "dev": true, 292 | "optional": true 293 | }, 294 | "concat-map": { 295 | "version": "0.0.1", 296 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 297 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" 298 | }, 299 | "core-js": { 300 | "version": "2.5.5", 301 | "resolved": "http://registry.npmjs.org/core-js/-/core-js-2.5.5.tgz", 302 | "integrity": "sha1-sU3ek2xkDAV5prUMq8wTLdYSfjs=" 303 | }, 304 | "decamelize": { 305 | "version": "1.2.0", 306 | "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", 307 | "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" 308 | }, 309 | "deep-is": { 310 | "version": "0.1.3", 311 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", 312 | "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", 313 | "dev": true 314 | }, 315 | "diff": { 316 | "version": "3.5.0", 317 | "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", 318 | "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", 319 | "dev": true 320 | }, 321 | "dom-storage": { 322 | "version": "2.1.0", 323 | "resolved": "https://registry.npmjs.org/dom-storage/-/dom-storage-2.1.0.tgz", 324 | "integrity": "sha512-g6RpyWXzl0RR6OTElHKBl7nwnK87GUyZMYC7JWsB/IA73vpqK2K6LT39x4VepLxlSsWBFrPVLnsSR5Jyty0+2Q==" 325 | }, 326 | "encoding": { 327 | "version": "0.1.12", 328 | "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", 329 | "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", 330 | "requires": { 331 | "iconv-lite": "~0.4.13" 332 | } 333 | }, 334 | "escape-string-regexp": { 335 | "version": "1.0.5", 336 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 337 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 338 | "dev": true 339 | }, 340 | "escodegen": { 341 | "version": "1.8.1", 342 | "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", 343 | "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", 344 | "dev": true, 345 | "requires": { 346 | "esprima": "^2.7.1", 347 | "estraverse": "^1.9.1", 348 | "esutils": "^2.0.2", 349 | "optionator": "^0.8.1", 350 | "source-map": "~0.2.0" 351 | } 352 | }, 353 | "esprima": { 354 | "version": "2.7.3", 355 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", 356 | "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", 357 | "dev": true 358 | }, 359 | "estraverse": { 360 | "version": "1.9.3", 361 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", 362 | "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", 363 | "dev": true 364 | }, 365 | "esutils": { 366 | "version": "2.0.2", 367 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", 368 | "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", 369 | "dev": true 370 | }, 371 | "fast-levenshtein": { 372 | "version": "2.0.6", 373 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", 374 | "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", 375 | "dev": true 376 | }, 377 | "faye-websocket": { 378 | "version": "0.11.1", 379 | "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.1.tgz", 380 | "integrity": "sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg=", 381 | "requires": { 382 | "websocket-driver": ">=0.5.1" 383 | } 384 | }, 385 | "fill-keys": { 386 | "version": "1.0.2", 387 | "resolved": "https://registry.npmjs.org/fill-keys/-/fill-keys-1.0.2.tgz", 388 | "integrity": "sha1-mo+jb06K1jTjv2tPPIiCVRRS6yA=", 389 | "dev": true, 390 | "requires": { 391 | "is-object": "~1.0.1", 392 | "merge-descriptors": "~1.0.0" 393 | } 394 | }, 395 | "firebase": { 396 | "version": "5.5.7", 397 | "resolved": "https://registry.npmjs.org/firebase/-/firebase-5.5.7.tgz", 398 | "integrity": "sha512-hbQQVaj9X9RDeKLl0YzxcMhq0O1VRZSoVcdxyN73S7myg/9zVUsq+ozCCHG3vaIFDB9g3pF/A0fcEZo4SuWPqQ==", 399 | "requires": { 400 | "@firebase/app": "0.3.4", 401 | "@firebase/auth": "0.7.8", 402 | "@firebase/database": "0.3.6", 403 | "@firebase/firestore": "0.8.6", 404 | "@firebase/functions": "0.3.1", 405 | "@firebase/messaging": "0.3.6", 406 | "@firebase/polyfill": "0.3.3", 407 | "@firebase/storage": "0.2.4" 408 | } 409 | }, 410 | "fs.realpath": { 411 | "version": "1.0.0", 412 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 413 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" 414 | }, 415 | "glob": { 416 | "version": "5.0.15", 417 | "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", 418 | "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", 419 | "dev": true, 420 | "requires": { 421 | "inflight": "^1.0.4", 422 | "inherits": "2", 423 | "minimatch": "2 || 3", 424 | "once": "^1.3.0", 425 | "path-is-absolute": "^1.0.0" 426 | } 427 | }, 428 | "growl": { 429 | "version": "1.10.5", 430 | "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", 431 | "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", 432 | "dev": true 433 | }, 434 | "grpc": { 435 | "version": "1.13.1", 436 | "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.13.1.tgz", 437 | "integrity": "sha512-yl0xChnlUISTefOPU2NQ1cYPh5m/DTatEUV6jdRyQPE9NCrtPq7Gn6J2alMTglN7ufYbJapOd00dvhGurHH6HQ==", 438 | "requires": { 439 | "lodash": "^4.17.5", 440 | "nan": "^2.0.0", 441 | "node-pre-gyp": "^0.10.0", 442 | "protobufjs": "^5.0.3" 443 | }, 444 | "dependencies": { 445 | "abbrev": { 446 | "version": "1.1.1", 447 | "bundled": true 448 | }, 449 | "ansi-regex": { 450 | "version": "2.1.1", 451 | "bundled": true 452 | }, 453 | "aproba": { 454 | "version": "1.2.0", 455 | "bundled": true 456 | }, 457 | "are-we-there-yet": { 458 | "version": "1.1.5", 459 | "bundled": true, 460 | "requires": { 461 | "delegates": "^1.0.0", 462 | "readable-stream": "^2.0.6" 463 | } 464 | }, 465 | "balanced-match": { 466 | "version": "1.0.0", 467 | "bundled": true 468 | }, 469 | "brace-expansion": { 470 | "version": "1.1.11", 471 | "bundled": true, 472 | "requires": { 473 | "balanced-match": "^1.0.0", 474 | "concat-map": "0.0.1" 475 | } 476 | }, 477 | "chownr": { 478 | "version": "1.0.1", 479 | "bundled": true 480 | }, 481 | "code-point-at": { 482 | "version": "1.1.0", 483 | "bundled": true 484 | }, 485 | "concat-map": { 486 | "version": "0.0.1", 487 | "bundled": true 488 | }, 489 | "console-control-strings": { 490 | "version": "1.1.0", 491 | "bundled": true 492 | }, 493 | "core-util-is": { 494 | "version": "1.0.2", 495 | "bundled": true 496 | }, 497 | "debug": { 498 | "version": "2.6.9", 499 | "bundled": true, 500 | "requires": { 501 | "ms": "2.0.0" 502 | } 503 | }, 504 | "deep-extend": { 505 | "version": "0.6.0", 506 | "bundled": true 507 | }, 508 | "delegates": { 509 | "version": "1.0.0", 510 | "bundled": true 511 | }, 512 | "detect-libc": { 513 | "version": "1.0.3", 514 | "bundled": true 515 | }, 516 | "fs-minipass": { 517 | "version": "1.2.5", 518 | "bundled": true, 519 | "requires": { 520 | "minipass": "^2.2.1" 521 | } 522 | }, 523 | "fs.realpath": { 524 | "version": "1.0.0", 525 | "bundled": true 526 | }, 527 | "gauge": { 528 | "version": "2.7.4", 529 | "bundled": true, 530 | "requires": { 531 | "aproba": "^1.0.3", 532 | "console-control-strings": "^1.0.0", 533 | "has-unicode": "^2.0.0", 534 | "object-assign": "^4.1.0", 535 | "signal-exit": "^3.0.0", 536 | "string-width": "^1.0.1", 537 | "strip-ansi": "^3.0.1", 538 | "wide-align": "^1.1.0" 539 | } 540 | }, 541 | "glob": { 542 | "version": "7.1.2", 543 | "bundled": true, 544 | "requires": { 545 | "fs.realpath": "^1.0.0", 546 | "inflight": "^1.0.4", 547 | "inherits": "2", 548 | "minimatch": "^3.0.4", 549 | "once": "^1.3.0", 550 | "path-is-absolute": "^1.0.0" 551 | } 552 | }, 553 | "has-unicode": { 554 | "version": "2.0.1", 555 | "bundled": true 556 | }, 557 | "iconv-lite": { 558 | "version": "0.4.23", 559 | "bundled": true, 560 | "requires": { 561 | "safer-buffer": ">= 2.1.2 < 3" 562 | } 563 | }, 564 | "ignore-walk": { 565 | "version": "3.0.1", 566 | "bundled": true, 567 | "requires": { 568 | "minimatch": "^3.0.4" 569 | } 570 | }, 571 | "inflight": { 572 | "version": "1.0.6", 573 | "bundled": true, 574 | "requires": { 575 | "once": "^1.3.0", 576 | "wrappy": "1" 577 | } 578 | }, 579 | "inherits": { 580 | "version": "2.0.3", 581 | "bundled": true 582 | }, 583 | "ini": { 584 | "version": "1.3.5", 585 | "bundled": true 586 | }, 587 | "is-fullwidth-code-point": { 588 | "version": "1.0.0", 589 | "bundled": true, 590 | "requires": { 591 | "number-is-nan": "^1.0.0" 592 | } 593 | }, 594 | "isarray": { 595 | "version": "1.0.0", 596 | "bundled": true 597 | }, 598 | "minimatch": { 599 | "version": "3.0.4", 600 | "bundled": true, 601 | "requires": { 602 | "brace-expansion": "^1.1.7" 603 | } 604 | }, 605 | "minimist": { 606 | "version": "1.2.0", 607 | "bundled": true 608 | }, 609 | "minipass": { 610 | "version": "2.3.3", 611 | "bundled": true, 612 | "requires": { 613 | "safe-buffer": "^5.1.2", 614 | "yallist": "^3.0.0" 615 | } 616 | }, 617 | "minizlib": { 618 | "version": "1.1.0", 619 | "bundled": true, 620 | "requires": { 621 | "minipass": "^2.2.1" 622 | } 623 | }, 624 | "mkdirp": { 625 | "version": "0.5.1", 626 | "bundled": true, 627 | "requires": { 628 | "minimist": "0.0.8" 629 | }, 630 | "dependencies": { 631 | "minimist": { 632 | "version": "0.0.8", 633 | "bundled": true 634 | } 635 | } 636 | }, 637 | "ms": { 638 | "version": "2.0.0", 639 | "bundled": true 640 | }, 641 | "needle": { 642 | "version": "2.2.1", 643 | "bundled": true, 644 | "requires": { 645 | "debug": "^2.1.2", 646 | "iconv-lite": "^0.4.4", 647 | "sax": "^1.2.4" 648 | } 649 | }, 650 | "node-pre-gyp": { 651 | "version": "0.10.3", 652 | "bundled": true, 653 | "requires": { 654 | "detect-libc": "^1.0.2", 655 | "mkdirp": "^0.5.1", 656 | "needle": "^2.2.1", 657 | "nopt": "^4.0.1", 658 | "npm-packlist": "^1.1.6", 659 | "npmlog": "^4.0.2", 660 | "rc": "^1.2.7", 661 | "rimraf": "^2.6.1", 662 | "semver": "^5.3.0", 663 | "tar": "^4" 664 | } 665 | }, 666 | "nopt": { 667 | "version": "4.0.1", 668 | "bundled": true, 669 | "requires": { 670 | "abbrev": "1", 671 | "osenv": "^0.1.4" 672 | } 673 | }, 674 | "npm-bundled": { 675 | "version": "1.0.3", 676 | "bundled": true 677 | }, 678 | "npm-packlist": { 679 | "version": "1.1.11", 680 | "bundled": true, 681 | "requires": { 682 | "ignore-walk": "^3.0.1", 683 | "npm-bundled": "^1.0.1" 684 | } 685 | }, 686 | "npmlog": { 687 | "version": "4.1.2", 688 | "bundled": true, 689 | "requires": { 690 | "are-we-there-yet": "~1.1.2", 691 | "console-control-strings": "~1.1.0", 692 | "gauge": "~2.7.3", 693 | "set-blocking": "~2.0.0" 694 | } 695 | }, 696 | "number-is-nan": { 697 | "version": "1.0.1", 698 | "bundled": true 699 | }, 700 | "object-assign": { 701 | "version": "4.1.1", 702 | "bundled": true 703 | }, 704 | "once": { 705 | "version": "1.4.0", 706 | "bundled": true, 707 | "requires": { 708 | "wrappy": "1" 709 | } 710 | }, 711 | "os-homedir": { 712 | "version": "1.0.2", 713 | "bundled": true 714 | }, 715 | "os-tmpdir": { 716 | "version": "1.0.2", 717 | "bundled": true 718 | }, 719 | "osenv": { 720 | "version": "0.1.5", 721 | "bundled": true, 722 | "requires": { 723 | "os-homedir": "^1.0.0", 724 | "os-tmpdir": "^1.0.0" 725 | } 726 | }, 727 | "path-is-absolute": { 728 | "version": "1.0.1", 729 | "bundled": true 730 | }, 731 | "process-nextick-args": { 732 | "version": "2.0.0", 733 | "bundled": true 734 | }, 735 | "rc": { 736 | "version": "1.2.8", 737 | "bundled": true, 738 | "requires": { 739 | "deep-extend": "^0.6.0", 740 | "ini": "~1.3.0", 741 | "minimist": "^1.2.0", 742 | "strip-json-comments": "~2.0.1" 743 | } 744 | }, 745 | "readable-stream": { 746 | "version": "2.3.6", 747 | "bundled": true, 748 | "requires": { 749 | "core-util-is": "~1.0.0", 750 | "inherits": "~2.0.3", 751 | "isarray": "~1.0.0", 752 | "process-nextick-args": "~2.0.0", 753 | "safe-buffer": "~5.1.1", 754 | "string_decoder": "~1.1.1", 755 | "util-deprecate": "~1.0.1" 756 | } 757 | }, 758 | "rimraf": { 759 | "version": "2.6.2", 760 | "bundled": true, 761 | "requires": { 762 | "glob": "^7.0.5" 763 | } 764 | }, 765 | "safe-buffer": { 766 | "version": "5.1.2", 767 | "bundled": true 768 | }, 769 | "safer-buffer": { 770 | "version": "2.1.2", 771 | "bundled": true 772 | }, 773 | "sax": { 774 | "version": "1.2.4", 775 | "bundled": true 776 | }, 777 | "semver": { 778 | "version": "5.5.0", 779 | "bundled": true 780 | }, 781 | "set-blocking": { 782 | "version": "2.0.0", 783 | "bundled": true 784 | }, 785 | "signal-exit": { 786 | "version": "3.0.2", 787 | "bundled": true 788 | }, 789 | "string-width": { 790 | "version": "1.0.2", 791 | "bundled": true, 792 | "requires": { 793 | "code-point-at": "^1.0.0", 794 | "is-fullwidth-code-point": "^1.0.0", 795 | "strip-ansi": "^3.0.0" 796 | } 797 | }, 798 | "string_decoder": { 799 | "version": "1.1.1", 800 | "bundled": true, 801 | "requires": { 802 | "safe-buffer": "~5.1.0" 803 | } 804 | }, 805 | "strip-ansi": { 806 | "version": "3.0.1", 807 | "bundled": true, 808 | "requires": { 809 | "ansi-regex": "^2.0.0" 810 | } 811 | }, 812 | "strip-json-comments": { 813 | "version": "2.0.1", 814 | "bundled": true 815 | }, 816 | "tar": { 817 | "version": "4.4.4", 818 | "bundled": true, 819 | "requires": { 820 | "chownr": "^1.0.1", 821 | "fs-minipass": "^1.2.5", 822 | "minipass": "^2.3.3", 823 | "minizlib": "^1.1.0", 824 | "mkdirp": "^0.5.0", 825 | "safe-buffer": "^5.1.2", 826 | "yallist": "^3.0.2" 827 | } 828 | }, 829 | "util-deprecate": { 830 | "version": "1.0.2", 831 | "bundled": true 832 | }, 833 | "wide-align": { 834 | "version": "1.1.3", 835 | "bundled": true, 836 | "requires": { 837 | "string-width": "^1.0.2 || 2" 838 | } 839 | }, 840 | "wrappy": { 841 | "version": "1.0.2", 842 | "bundled": true 843 | }, 844 | "yallist": { 845 | "version": "3.0.2", 846 | "bundled": true 847 | } 848 | } 849 | }, 850 | "handlebars": { 851 | "version": "4.0.12", 852 | "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz", 853 | "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", 854 | "dev": true, 855 | "requires": { 856 | "async": "^2.5.0", 857 | "optimist": "^0.6.1", 858 | "source-map": "^0.6.1", 859 | "uglify-js": "^3.1.4" 860 | }, 861 | "dependencies": { 862 | "async": { 863 | "version": "2.6.1", 864 | "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", 865 | "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", 866 | "dev": true, 867 | "requires": { 868 | "lodash": "^4.17.10" 869 | } 870 | }, 871 | "source-map": { 872 | "version": "0.6.1", 873 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 874 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 875 | "dev": true 876 | } 877 | } 878 | }, 879 | "has-flag": { 880 | "version": "1.0.0", 881 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", 882 | "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", 883 | "dev": true 884 | }, 885 | "he": { 886 | "version": "1.1.1", 887 | "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", 888 | "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", 889 | "dev": true 890 | }, 891 | "http-parser-js": { 892 | "version": "0.5.0", 893 | "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.0.tgz", 894 | "integrity": "sha512-cZdEF7r4gfRIq7ezX9J0T+kQmJNOub71dWbgAXVHDct80TKP4MCETtZQ31xyv38UwgzkWPYF/Xc0ge55dW9Z9w==" 895 | }, 896 | "iconv-lite": { 897 | "version": "0.4.24", 898 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 899 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 900 | "requires": { 901 | "safer-buffer": ">= 2.1.2 < 3" 902 | } 903 | }, 904 | "inflight": { 905 | "version": "1.0.6", 906 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 907 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 908 | "requires": { 909 | "once": "^1.3.0", 910 | "wrappy": "1" 911 | } 912 | }, 913 | "inherits": { 914 | "version": "2.0.3", 915 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 916 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 917 | }, 918 | "invert-kv": { 919 | "version": "1.0.0", 920 | "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", 921 | "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" 922 | }, 923 | "is-fullwidth-code-point": { 924 | "version": "1.0.0", 925 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", 926 | "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", 927 | "requires": { 928 | "number-is-nan": "^1.0.0" 929 | } 930 | }, 931 | "is-object": { 932 | "version": "1.0.1", 933 | "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", 934 | "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", 935 | "dev": true 936 | }, 937 | "is-stream": { 938 | "version": "1.1.0", 939 | "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", 940 | "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" 941 | }, 942 | "isarray": { 943 | "version": "0.0.1", 944 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", 945 | "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", 946 | "dev": true 947 | }, 948 | "isexe": { 949 | "version": "2.0.0", 950 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 951 | "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", 952 | "dev": true 953 | }, 954 | "isomorphic-fetch": { 955 | "version": "2.2.1", 956 | "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", 957 | "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", 958 | "requires": { 959 | "node-fetch": "^1.0.1", 960 | "whatwg-fetch": ">=0.10.0" 961 | } 962 | }, 963 | "istanbul": { 964 | "version": "0.4.5", 965 | "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", 966 | "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", 967 | "dev": true, 968 | "requires": { 969 | "abbrev": "1.0.x", 970 | "async": "1.x", 971 | "escodegen": "1.8.x", 972 | "esprima": "2.7.x", 973 | "glob": "^5.0.15", 974 | "handlebars": "^4.0.1", 975 | "js-yaml": "3.x", 976 | "mkdirp": "0.5.x", 977 | "nopt": "3.x", 978 | "once": "1.x", 979 | "resolve": "1.1.x", 980 | "supports-color": "^3.1.0", 981 | "which": "^1.1.1", 982 | "wordwrap": "^1.0.0" 983 | } 984 | }, 985 | "js-yaml": { 986 | "version": "3.12.0", 987 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", 988 | "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", 989 | "dev": true, 990 | "requires": { 991 | "argparse": "^1.0.7", 992 | "esprima": "^4.0.0" 993 | }, 994 | "dependencies": { 995 | "esprima": { 996 | "version": "4.0.1", 997 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", 998 | "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", 999 | "dev": true 1000 | } 1001 | } 1002 | }, 1003 | "just-extend": { 1004 | "version": "3.0.0", 1005 | "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-3.0.0.tgz", 1006 | "integrity": "sha512-Fu3T6pKBuxjWT/p4DkqGHFRsysc8OauWr4ZRTY9dIx07Y9O0RkoR5jcv28aeD1vuAwhm3nLkDurwLXoALp4DpQ==", 1007 | "dev": true 1008 | }, 1009 | "lcid": { 1010 | "version": "1.0.0", 1011 | "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", 1012 | "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", 1013 | "requires": { 1014 | "invert-kv": "^1.0.0" 1015 | } 1016 | }, 1017 | "levn": { 1018 | "version": "0.3.0", 1019 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", 1020 | "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", 1021 | "dev": true, 1022 | "requires": { 1023 | "prelude-ls": "~1.1.2", 1024 | "type-check": "~0.3.2" 1025 | } 1026 | }, 1027 | "lodash": { 1028 | "version": "4.17.11", 1029 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", 1030 | "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" 1031 | }, 1032 | "lodash.get": { 1033 | "version": "4.4.2", 1034 | "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", 1035 | "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", 1036 | "dev": true 1037 | }, 1038 | "lolex": { 1039 | "version": "3.0.0", 1040 | "resolved": "https://registry.npmjs.org/lolex/-/lolex-3.0.0.tgz", 1041 | "integrity": "sha512-hcnW80h3j2lbUfFdMArd5UPA/vxZJ+G8vobd+wg3nVEQA0EigStbYcrG030FJxL6xiDDPEkoMatV9xIh5OecQQ==", 1042 | "dev": true 1043 | }, 1044 | "long": { 1045 | "version": "3.2.0", 1046 | "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", 1047 | "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" 1048 | }, 1049 | "merge-descriptors": { 1050 | "version": "1.0.1", 1051 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 1052 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", 1053 | "dev": true 1054 | }, 1055 | "minimatch": { 1056 | "version": "3.0.4", 1057 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 1058 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 1059 | "requires": { 1060 | "brace-expansion": "^1.1.7" 1061 | } 1062 | }, 1063 | "minimist": { 1064 | "version": "0.0.10", 1065 | "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", 1066 | "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", 1067 | "dev": true 1068 | }, 1069 | "mkdirp": { 1070 | "version": "0.5.1", 1071 | "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 1072 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 1073 | "dev": true, 1074 | "requires": { 1075 | "minimist": "0.0.8" 1076 | }, 1077 | "dependencies": { 1078 | "minimist": { 1079 | "version": "0.0.8", 1080 | "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 1081 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", 1082 | "dev": true 1083 | } 1084 | } 1085 | }, 1086 | "mocha": { 1087 | "version": "5.2.0", 1088 | "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", 1089 | "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", 1090 | "dev": true, 1091 | "requires": { 1092 | "browser-stdout": "1.3.1", 1093 | "commander": "2.15.1", 1094 | "debug": "3.1.0", 1095 | "diff": "3.5.0", 1096 | "escape-string-regexp": "1.0.5", 1097 | "glob": "7.1.2", 1098 | "growl": "1.10.5", 1099 | "he": "1.1.1", 1100 | "minimatch": "3.0.4", 1101 | "mkdirp": "0.5.1", 1102 | "supports-color": "5.4.0" 1103 | }, 1104 | "dependencies": { 1105 | "commander": { 1106 | "version": "2.15.1", 1107 | "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", 1108 | "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", 1109 | "dev": true 1110 | }, 1111 | "debug": { 1112 | "version": "3.1.0", 1113 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 1114 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 1115 | "dev": true, 1116 | "requires": { 1117 | "ms": "2.0.0" 1118 | } 1119 | }, 1120 | "glob": { 1121 | "version": "7.1.2", 1122 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", 1123 | "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", 1124 | "dev": true, 1125 | "requires": { 1126 | "fs.realpath": "^1.0.0", 1127 | "inflight": "^1.0.4", 1128 | "inherits": "2", 1129 | "minimatch": "^3.0.4", 1130 | "once": "^1.3.0", 1131 | "path-is-absolute": "^1.0.0" 1132 | } 1133 | }, 1134 | "has-flag": { 1135 | "version": "3.0.0", 1136 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 1137 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 1138 | "dev": true 1139 | }, 1140 | "supports-color": { 1141 | "version": "5.4.0", 1142 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", 1143 | "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", 1144 | "dev": true, 1145 | "requires": { 1146 | "has-flag": "^3.0.0" 1147 | } 1148 | } 1149 | } 1150 | }, 1151 | "module-not-found-error": { 1152 | "version": "1.0.1", 1153 | "resolved": "https://registry.npmjs.org/module-not-found-error/-/module-not-found-error-1.0.1.tgz", 1154 | "integrity": "sha1-z4tP9PKWQGdNbN0CsOO8UjwrvcA=", 1155 | "dev": true 1156 | }, 1157 | "ms": { 1158 | "version": "2.0.0", 1159 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 1160 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", 1161 | "dev": true 1162 | }, 1163 | "nan": { 1164 | "version": "2.11.1", 1165 | "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", 1166 | "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==" 1167 | }, 1168 | "nise": { 1169 | "version": "1.4.6", 1170 | "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.6.tgz", 1171 | "integrity": "sha512-1GedetLKzmqmgwabuMSqPsT7oumdR77SBpDfNNJhADRIeA3LN/2RVqR4fFqwvzhAqcTef6PPCzQwITE/YQ8S8A==", 1172 | "dev": true, 1173 | "requires": { 1174 | "@sinonjs/formatio": "3.0.0", 1175 | "just-extend": "^3.0.0", 1176 | "lolex": "^2.3.2", 1177 | "path-to-regexp": "^1.7.0", 1178 | "text-encoding": "^0.6.4" 1179 | }, 1180 | "dependencies": { 1181 | "lolex": { 1182 | "version": "2.7.5", 1183 | "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.5.tgz", 1184 | "integrity": "sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q==", 1185 | "dev": true 1186 | } 1187 | } 1188 | }, 1189 | "node-fetch": { 1190 | "version": "1.7.3", 1191 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", 1192 | "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", 1193 | "requires": { 1194 | "encoding": "^0.1.11", 1195 | "is-stream": "^1.0.1" 1196 | } 1197 | }, 1198 | "nopt": { 1199 | "version": "3.0.6", 1200 | "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", 1201 | "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", 1202 | "dev": true, 1203 | "requires": { 1204 | "abbrev": "1" 1205 | } 1206 | }, 1207 | "number-is-nan": { 1208 | "version": "1.0.1", 1209 | "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", 1210 | "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" 1211 | }, 1212 | "once": { 1213 | "version": "1.4.0", 1214 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 1215 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 1216 | "requires": { 1217 | "wrappy": "1" 1218 | } 1219 | }, 1220 | "optimist": { 1221 | "version": "0.6.1", 1222 | "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", 1223 | "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", 1224 | "dev": true, 1225 | "requires": { 1226 | "minimist": "~0.0.1", 1227 | "wordwrap": "~0.0.2" 1228 | }, 1229 | "dependencies": { 1230 | "wordwrap": { 1231 | "version": "0.0.3", 1232 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", 1233 | "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", 1234 | "dev": true 1235 | } 1236 | } 1237 | }, 1238 | "optionator": { 1239 | "version": "0.8.2", 1240 | "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", 1241 | "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", 1242 | "dev": true, 1243 | "requires": { 1244 | "deep-is": "~0.1.3", 1245 | "fast-levenshtein": "~2.0.4", 1246 | "levn": "~0.3.0", 1247 | "prelude-ls": "~1.1.2", 1248 | "type-check": "~0.3.2", 1249 | "wordwrap": "~1.0.0" 1250 | } 1251 | }, 1252 | "optjs": { 1253 | "version": "3.2.2", 1254 | "resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz", 1255 | "integrity": "sha1-aabOicRCpEQDFBrS+bNwvVu29O4=" 1256 | }, 1257 | "os-locale": { 1258 | "version": "1.4.0", 1259 | "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", 1260 | "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", 1261 | "requires": { 1262 | "lcid": "^1.0.0" 1263 | } 1264 | }, 1265 | "path-is-absolute": { 1266 | "version": "1.0.1", 1267 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 1268 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" 1269 | }, 1270 | "path-parse": { 1271 | "version": "1.0.6", 1272 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", 1273 | "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", 1274 | "dev": true 1275 | }, 1276 | "path-to-regexp": { 1277 | "version": "1.7.0", 1278 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", 1279 | "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", 1280 | "dev": true, 1281 | "requires": { 1282 | "isarray": "0.0.1" 1283 | } 1284 | }, 1285 | "prelude-ls": { 1286 | "version": "1.1.2", 1287 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", 1288 | "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", 1289 | "dev": true 1290 | }, 1291 | "promise-polyfill": { 1292 | "version": "7.1.2", 1293 | "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-7.1.2.tgz", 1294 | "integrity": "sha512-FuEc12/eKqqoRYIGBrUptCBRhobL19PS2U31vMNTfyck1FxPyMfgsXyW4Mav85y/ZN1hop3hOwRlUDok23oYfQ==" 1295 | }, 1296 | "protobufjs": { 1297 | "version": "5.0.3", 1298 | "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.3.tgz", 1299 | "integrity": "sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA==", 1300 | "requires": { 1301 | "ascli": "~1", 1302 | "bytebuffer": "~5", 1303 | "glob": "^7.0.5", 1304 | "yargs": "^3.10.0" 1305 | }, 1306 | "dependencies": { 1307 | "glob": { 1308 | "version": "7.1.3", 1309 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", 1310 | "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", 1311 | "requires": { 1312 | "fs.realpath": "^1.0.0", 1313 | "inflight": "^1.0.4", 1314 | "inherits": "2", 1315 | "minimatch": "^3.0.4", 1316 | "once": "^1.3.0", 1317 | "path-is-absolute": "^1.0.0" 1318 | } 1319 | } 1320 | } 1321 | }, 1322 | "proxyquire": { 1323 | "version": "2.1.0", 1324 | "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-2.1.0.tgz", 1325 | "integrity": "sha512-kptdFArCfGRtQFv3Qwjr10lwbEV0TBJYvfqzhwucyfEXqVgmnAkyEw/S3FYzR5HI9i5QOq4rcqQjZ6AlknlCDQ==", 1326 | "dev": true, 1327 | "requires": { 1328 | "fill-keys": "^1.0.2", 1329 | "module-not-found-error": "^1.0.0", 1330 | "resolve": "~1.8.1" 1331 | }, 1332 | "dependencies": { 1333 | "resolve": { 1334 | "version": "1.8.1", 1335 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", 1336 | "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", 1337 | "dev": true, 1338 | "requires": { 1339 | "path-parse": "^1.0.5" 1340 | } 1341 | } 1342 | } 1343 | }, 1344 | "resolve": { 1345 | "version": "1.1.7", 1346 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", 1347 | "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", 1348 | "dev": true 1349 | }, 1350 | "safer-buffer": { 1351 | "version": "2.1.2", 1352 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 1353 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 1354 | }, 1355 | "should": { 1356 | "version": "13.2.3", 1357 | "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", 1358 | "integrity": "sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==", 1359 | "dev": true, 1360 | "requires": { 1361 | "should-equal": "^2.0.0", 1362 | "should-format": "^3.0.3", 1363 | "should-type": "^1.4.0", 1364 | "should-type-adaptors": "^1.0.1", 1365 | "should-util": "^1.0.0" 1366 | } 1367 | }, 1368 | "should-equal": { 1369 | "version": "2.0.0", 1370 | "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-2.0.0.tgz", 1371 | "integrity": "sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==", 1372 | "dev": true, 1373 | "requires": { 1374 | "should-type": "^1.4.0" 1375 | } 1376 | }, 1377 | "should-format": { 1378 | "version": "3.0.3", 1379 | "resolved": "https://registry.npmjs.org/should-format/-/should-format-3.0.3.tgz", 1380 | "integrity": "sha1-m/yPdPo5IFxT04w01xcwPidxJPE=", 1381 | "dev": true, 1382 | "requires": { 1383 | "should-type": "^1.3.0", 1384 | "should-type-adaptors": "^1.0.1" 1385 | } 1386 | }, 1387 | "should-sinon": { 1388 | "version": "0.0.6", 1389 | "resolved": "https://registry.npmjs.org/should-sinon/-/should-sinon-0.0.6.tgz", 1390 | "integrity": "sha512-ScBOH5uW5QVFaONmUnIXANSR6z5B8IKzEmBP3HE5sPOCDuZ88oTMdUdnKoCVQdLcCIrRrhRLPS5YT+7H40a04g==", 1391 | "dev": true 1392 | }, 1393 | "should-type": { 1394 | "version": "1.4.0", 1395 | "resolved": "https://registry.npmjs.org/should-type/-/should-type-1.4.0.tgz", 1396 | "integrity": "sha1-B1bYzoRt/QmEOmlHcZ36DUz/XPM=", 1397 | "dev": true 1398 | }, 1399 | "should-type-adaptors": { 1400 | "version": "1.1.0", 1401 | "resolved": "https://registry.npmjs.org/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz", 1402 | "integrity": "sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==", 1403 | "dev": true, 1404 | "requires": { 1405 | "should-type": "^1.3.0", 1406 | "should-util": "^1.0.0" 1407 | } 1408 | }, 1409 | "should-util": { 1410 | "version": "1.0.0", 1411 | "resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.0.tgz", 1412 | "integrity": "sha1-yYzaN0qmsZDfi6h8mInCtNtiAGM=", 1413 | "dev": true 1414 | }, 1415 | "sinon": { 1416 | "version": "7.1.1", 1417 | "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.1.1.tgz", 1418 | "integrity": "sha512-iYagtjLVt1vN3zZY7D8oH7dkjNJEjLjyuzy8daX5+3bbQl8gaohrheB9VfH1O3L6LKuue5WTJvFluHiuZ9y3nQ==", 1419 | "dev": true, 1420 | "requires": { 1421 | "@sinonjs/commons": "^1.2.0", 1422 | "@sinonjs/formatio": "^3.0.0", 1423 | "@sinonjs/samsam": "^2.1.2", 1424 | "diff": "^3.5.0", 1425 | "lodash.get": "^4.4.2", 1426 | "lolex": "^3.0.0", 1427 | "nise": "^1.4.6", 1428 | "supports-color": "^5.5.0", 1429 | "type-detect": "^4.0.8" 1430 | }, 1431 | "dependencies": { 1432 | "has-flag": { 1433 | "version": "3.0.0", 1434 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 1435 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 1436 | "dev": true 1437 | }, 1438 | "supports-color": { 1439 | "version": "5.5.0", 1440 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 1441 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 1442 | "dev": true, 1443 | "requires": { 1444 | "has-flag": "^3.0.0" 1445 | } 1446 | } 1447 | } 1448 | }, 1449 | "source-map": { 1450 | "version": "0.2.0", 1451 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", 1452 | "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", 1453 | "dev": true, 1454 | "optional": true, 1455 | "requires": { 1456 | "amdefine": ">=0.0.4" 1457 | } 1458 | }, 1459 | "sprintf-js": { 1460 | "version": "1.0.3", 1461 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 1462 | "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", 1463 | "dev": true 1464 | }, 1465 | "string-width": { 1466 | "version": "1.0.2", 1467 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", 1468 | "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", 1469 | "requires": { 1470 | "code-point-at": "^1.0.0", 1471 | "is-fullwidth-code-point": "^1.0.0", 1472 | "strip-ansi": "^3.0.0" 1473 | } 1474 | }, 1475 | "strip-ansi": { 1476 | "version": "3.0.1", 1477 | "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 1478 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", 1479 | "requires": { 1480 | "ansi-regex": "^2.0.0" 1481 | } 1482 | }, 1483 | "supports-color": { 1484 | "version": "3.2.3", 1485 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", 1486 | "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", 1487 | "dev": true, 1488 | "requires": { 1489 | "has-flag": "^1.0.0" 1490 | } 1491 | }, 1492 | "text-encoding": { 1493 | "version": "0.6.4", 1494 | "resolved": "http://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz", 1495 | "integrity": "sha1-45mpgiV6J22uQou5KEXLcb3CbRk=", 1496 | "dev": true 1497 | }, 1498 | "tslib": { 1499 | "version": "1.9.0", 1500 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz", 1501 | "integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==" 1502 | }, 1503 | "type-check": { 1504 | "version": "0.3.2", 1505 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", 1506 | "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", 1507 | "dev": true, 1508 | "requires": { 1509 | "prelude-ls": "~1.1.2" 1510 | } 1511 | }, 1512 | "type-detect": { 1513 | "version": "4.0.8", 1514 | "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", 1515 | "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", 1516 | "dev": true 1517 | }, 1518 | "uglify-js": { 1519 | "version": "3.4.9", 1520 | "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", 1521 | "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", 1522 | "dev": true, 1523 | "optional": true, 1524 | "requires": { 1525 | "commander": "~2.17.1", 1526 | "source-map": "~0.6.1" 1527 | }, 1528 | "dependencies": { 1529 | "source-map": { 1530 | "version": "0.6.1", 1531 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 1532 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 1533 | "dev": true, 1534 | "optional": true 1535 | } 1536 | } 1537 | }, 1538 | "websocket-driver": { 1539 | "version": "0.7.0", 1540 | "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz", 1541 | "integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=", 1542 | "requires": { 1543 | "http-parser-js": ">=0.4.0", 1544 | "websocket-extensions": ">=0.1.1" 1545 | } 1546 | }, 1547 | "websocket-extensions": { 1548 | "version": "0.1.3", 1549 | "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", 1550 | "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==" 1551 | }, 1552 | "whatwg-fetch": { 1553 | "version": "3.0.0", 1554 | "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", 1555 | "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==" 1556 | }, 1557 | "which": { 1558 | "version": "1.3.1", 1559 | "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", 1560 | "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", 1561 | "dev": true, 1562 | "requires": { 1563 | "isexe": "^2.0.0" 1564 | } 1565 | }, 1566 | "window-size": { 1567 | "version": "0.1.4", 1568 | "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", 1569 | "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=" 1570 | }, 1571 | "wordwrap": { 1572 | "version": "1.0.0", 1573 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", 1574 | "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", 1575 | "dev": true 1576 | }, 1577 | "wrap-ansi": { 1578 | "version": "2.1.0", 1579 | "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", 1580 | "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", 1581 | "requires": { 1582 | "string-width": "^1.0.1", 1583 | "strip-ansi": "^3.0.1" 1584 | } 1585 | }, 1586 | "wrappy": { 1587 | "version": "1.0.2", 1588 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1589 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 1590 | }, 1591 | "xmlhttprequest": { 1592 | "version": "1.8.0", 1593 | "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", 1594 | "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=" 1595 | }, 1596 | "y18n": { 1597 | "version": "3.2.1", 1598 | "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", 1599 | "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" 1600 | }, 1601 | "yargs": { 1602 | "version": "3.32.0", 1603 | "resolved": "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", 1604 | "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", 1605 | "requires": { 1606 | "camelcase": "^2.0.1", 1607 | "cliui": "^3.0.3", 1608 | "decamelize": "^1.1.1", 1609 | "os-locale": "^1.4.0", 1610 | "string-width": "^1.0.1", 1611 | "window-size": "^0.1.4", 1612 | "y18n": "^3.2.0" 1613 | } 1614 | } 1615 | } 1616 | } 1617 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "botkit-storage-firebase", 3 | "version": "1.0.1", 4 | "description": "Firebase driver for Botkit", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "istanbul cover --report lcov --dir coverage/ _mocha ./tests --grep ./tests/*.js -- --colors" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/howdyai/botkit-storage-firebase.git" 12 | }, 13 | "keywords": [ 14 | "botkit", 15 | "firebase" 16 | ], 17 | "author": "Cole Furfaro-Strode", 18 | "license": "MIT", 19 | "bugs": { 20 | "url": "https://github.com/howdyai/botkit-storage-firebase/issues" 21 | }, 22 | "homepage": "https://github.com/howdyai/botkit-storage-firebase#readme", 23 | "dependencies": { 24 | "firebase": "^5.5.7" 25 | }, 26 | "devDependencies": { 27 | "istanbul": "^0.4.5", 28 | "mocha": "^5.2.0", 29 | "proxyquire": "^2.1.0", 30 | "should": "^13.2.3", 31 | "should-sinon": "0.0.6", 32 | "sinon": "^7.1.1" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | var firebase = require('firebase'); 2 | 3 | /** 4 | * The Botkit firebase driver 5 | * 6 | * @param {Object} config This must contain either a `firebase_uri` property (deprecated) or a `databaseURL` property 7 | * @returns {{teams: {get, save, all}, channels: {get, save, all}, users: {get, save, all}}} 8 | */ 9 | module.exports = function(config) { 10 | 11 | if (!config) { 12 | throw new Error('configuration is required.'); 13 | } 14 | 15 | // Backwards compatibility shim 16 | var configuration = {}; 17 | if (config.firebase_uri) { 18 | configuration.databaseURL = config.firebase_uri; 19 | } else if (!config.databaseURL) { 20 | throw new Error('databaseURL is required.'); 21 | } else { 22 | configuration = config; 23 | } 24 | 25 | var app = firebase.initializeApp(config), 26 | database = app.database(), 27 | rootRef = database.ref(), 28 | teamsRef = rootRef.child('teams'), 29 | usersRef = rootRef.child('users'), 30 | channelsRef = rootRef.child('channels'); 31 | 32 | return { 33 | teams: { 34 | get: get(teamsRef), 35 | save: save(teamsRef), 36 | all: all(teamsRef) 37 | }, 38 | channels: { 39 | get: get(channelsRef), 40 | save: save(channelsRef), 41 | all: all(channelsRef) 42 | }, 43 | users: { 44 | get: get(usersRef), 45 | save: save(usersRef), 46 | all: all(usersRef) 47 | } 48 | }; 49 | }; 50 | 51 | /** 52 | * Given a firebase ref, will return a function that will get a single value by ID 53 | * 54 | * @param {Object} firebaseRef A reference to the firebase Object 55 | * @returns {Function} The get function 56 | */ 57 | function get(firebaseRef) { 58 | return function(id, cb) { 59 | firebaseRef.child(id).once('value').then(function(snapshot) { 60 | cb(null, snapshot.val()); 61 | }, 62 | cb); 63 | }; 64 | } 65 | 66 | /** 67 | * Given a firebase ref, will return a function that will save an object. The object must have an id property 68 | * 69 | * @param {Object} firebaseRef A reference to the firebase Object 70 | * @returns {Function} The save function 71 | */ 72 | function save(firebaseRef) { 73 | return function(data, cb) { 74 | var firebase_update = {}; 75 | firebase_update[data.id] = data; 76 | firebaseRef.update(firebase_update).then(cb); 77 | }; 78 | } 79 | 80 | /** 81 | * Given a firebase ref, will return a function that will return all objects stored. 82 | * 83 | * @param {Object} firebaseRef A reference to the firebase Object 84 | * @returns {Function} The all function 85 | */ 86 | function all(firebaseRef) { 87 | return function(cb) { 88 | firebaseRef.once('value').then(function success(records) { 89 | var results = records.val(); 90 | 91 | if (!results) { 92 | return cb(null, []); 93 | } 94 | 95 | var list = Object.keys(results).map(function(key) { 96 | return results[key]; 97 | }); 98 | 99 | cb(null, list); 100 | }, cb); 101 | }; 102 | } 103 | -------------------------------------------------------------------------------- /tests/index.js: -------------------------------------------------------------------------------- 1 | var should = require('should'), 2 | sinon = require('sinon'), 3 | proxyquire = require('proxyquire').noCallThru(); 4 | 5 | require('should-sinon'); 6 | 7 | describe('Firebase', function() { 8 | var firebaseMock, 9 | appMock, 10 | databaseMock, 11 | childMock, 12 | rootRefMock, 13 | refMock, 14 | Storage; 15 | 16 | beforeEach(function() { 17 | childMock = { 18 | once: sinon.stub() 19 | }; 20 | 21 | refMock = { 22 | child: sinon.stub().returns(childMock), 23 | once: sinon.stub(), 24 | update: sinon.stub() 25 | }; 26 | 27 | rootRefMock = { 28 | child: sinon.stub().returns(refMock) 29 | }; 30 | 31 | databaseMock = { 32 | ref: sinon.stub().returns(rootRefMock) 33 | }; 34 | 35 | appMock = { 36 | database: sinon.stub().returns(databaseMock) 37 | }; 38 | 39 | firebaseMock = { 40 | initializeApp: sinon.stub().returns(appMock) 41 | }; 42 | 43 | Storage = proxyquire('../src/index', { 44 | firebase: firebaseMock 45 | }); 46 | }); 47 | 48 | describe('init', function() { 49 | 50 | it('should require a config', function() { 51 | Storage.should.throw('configuration is required.'); 52 | }); 53 | 54 | it('should require databaseURL', function() { 55 | (function() {Storage({});}).should.throw('databaseURL is required.'); 56 | }); 57 | 58 | it('should initialize firebase with databaseURL', function() { 59 | Storage({databaseURL: 'crystalbluepersuation'}); 60 | firebaseMock.initializeApp.should.be.calledWith({databaseURL: 'crystalbluepersuation'}); 61 | }); 62 | }); 63 | 64 | ['teams', 'channels', 'users'].forEach(function(method) { 65 | describe('get', function() { 66 | var records, 67 | record, 68 | config; 69 | 70 | beforeEach(function() { 71 | config = {databaseURL: 'right_here'}; 72 | 73 | record = {}; 74 | records = { 75 | val: sinon.stub().returns(record) 76 | }; 77 | }); 78 | 79 | it('should get records', function() { 80 | var cb = sinon.stub(); 81 | childMock.once.returns({ 82 | then: function(callback) { 83 | return callback(records); 84 | } 85 | }); 86 | 87 | Storage(config)[method].get('walterwhite', cb); 88 | childMock.once.firstCall.args[0].should.equal('value'); 89 | records.val.should.be.called; 90 | cb.should.be.calledWith(null, record); 91 | }); 92 | 93 | it('should call callback on error', function() { 94 | var cb = sinon.stub(), 95 | err = new Error('OOPS'); 96 | 97 | childMock.once.returns({ 98 | then: function(success, error) { 99 | return error(err); 100 | } 101 | }); 102 | 103 | Storage(config)[method].get('walterwhite', cb); 104 | childMock.once.firstCall.args[0].should.equal('value'); 105 | records.val.should.not.be.called; 106 | cb.should.be.calledWith(err); 107 | }); 108 | }); 109 | 110 | describe('save', function() { 111 | var config; 112 | 113 | beforeEach(function() { 114 | config = {databaseURL: 'right_here'}; 115 | }); 116 | 117 | it('should call firebase update', function() { 118 | var cb = sinon.stub(), 119 | data = {id: 'walterwhite'}, 120 | updateObj = {walterwhite: data}; 121 | 122 | refMock.update.returns({ 123 | then: function(callback) { 124 | return callback(); 125 | } 126 | }); 127 | 128 | Storage(config)[method].save(data, cb); 129 | refMock.update.should.be.calledWith(updateObj); 130 | cb.should.be.calledOnce(); 131 | }); 132 | }); 133 | 134 | describe('all', function() { 135 | 136 | var records, 137 | record, 138 | config; 139 | 140 | beforeEach(function() { 141 | config = {databaseURL: 'right_here'}; 142 | 143 | record = { 144 | 'walterwhite': {id: 'walterwhite', name: 'heisenberg'}, 145 | 'jessepinkman': {id: 'jessepinkman', name: 'capncook'} 146 | }; 147 | 148 | records = { 149 | val: sinon.stub().returns(record) 150 | }; 151 | }); 152 | 153 | it('should get records', function() { 154 | var cb = sinon.stub(), 155 | result = [record.walterwhite, record.jessepinkman]; 156 | 157 | refMock.once.returns({ 158 | then: function(callback) { 159 | return callback(records); 160 | } 161 | }); 162 | Storage(config)[method].all(cb); 163 | refMock.once.firstCall.args[0].should.equal('value'); 164 | records.val.should.be.called; 165 | cb.should.be.calledWith(null, result); 166 | }); 167 | 168 | it('should handle no records', function() { 169 | var cb = sinon.stub(); 170 | 171 | records.val.returns(undefined); 172 | refMock.once.returns({ 173 | then: function(callback) { 174 | return callback(records); 175 | } 176 | }); 177 | 178 | Storage(config)[method].all(cb); 179 | refMock.once.firstCall.args[0].should.equal('value'); 180 | records.val.should.be.called; 181 | cb.should.be.calledWith(null, []); 182 | }); 183 | 184 | it('should call callback on error', function() { 185 | var cb = sinon.stub(), 186 | err = new Error('OOPS'); 187 | 188 | refMock.once.returns({ 189 | then: function(success, error) { 190 | return error(err); 191 | } 192 | }); 193 | 194 | Storage(config)[method].all(cb); 195 | refMock.once.firstCall.args[0].should.equal('value'); 196 | records.val.should.not.be.called; 197 | cb.should.be.calledWith(err); 198 | }); 199 | }); 200 | }); 201 | }); 202 | --------------------------------------------------------------------------------