diff --git a/THIRDPARTY.md b/THIRDPARTY.md deleted file mode 100644 index 0e9998a5..00000000 --- a/THIRDPARTY.md +++ /dev/null @@ -1,3814 +0,0 @@ -# 3rd Party License Attribution - -------------------------------------------------------- - -## axios@0.19.0 (MIT) - -``` -Copyright (c) 2014-present Matt Zabriskie - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## is-buffer@2.0.3 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) Feross Aboukhadijeh - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## follow-redirects@1.5.10 (MIT) - -``` -Copyright 2014–present Olivier Lalonde , James Talmage , Ruben Verborgh - -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: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## debug@3.1.0, 2.6.9, 4.1.1 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014 TJ Holowaychuk - -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: - -The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. - -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. -``` - -------------------------------------------------------- - -## ms@2.0.0, 2.1.2, 2.1.1 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2016 Zeit, Inc. - -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: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## body-parser@1.19.0 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2014-2015 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## bytes@3.1.0 (MIT) - -``` -(The MIT License) - -Copyright (c) 2012-2014 TJ Holowaychuk -Copyright (c) 2015 Jed Watson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## content-type@1.0.4 (MIT) - -``` -(The MIT License) - -Copyright (c) 2015 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## depd@1.1.2, 2.0.0 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014-2017 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## http-errors@1.7.2 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.com -Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.com - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## inherits@2.0.3 (ISC) - -``` -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -``` - -------------------------------------------------------- - -## setprototypeof@1.1.1 (ISC) - -``` -Copyright (c) 2015, Wes Todd - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -``` - -------------------------------------------------------- - -## statuses@1.5.0 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2016 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## toidentifier@1.0.0 (MIT) - -``` -MIT License - -Copyright (c) 2016 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## iconv-lite@0.4.24 (MIT) - -``` -Copyright (c) 2011 Alexander Shtuchkin - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## safer-buffer@2.1.2 (MIT) - -``` -MIT License - -Copyright (c) 2018 Nikita Skovoroda - -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: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## on-finished@2.3.0 (MIT) - -``` -(The MIT License) - -Copyright (c) 2013 Jonathan Ong -Copyright (c) 2014 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## ee-first@1.1.1 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.com - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## qs@6.7.0 (BSD-3-Clause) - -``` -Copyright (c) 2014 Nathan LaFreniere and other contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * 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. - * The names of any contributors may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -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 HOLDERS AND 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. - - * * * - -The complete list of contributors can be found at: https://github.com/hapijs/qs/graphs/contributors -``` - -------------------------------------------------------- - -## raw-body@2.4.0 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2013-2014 Jonathan Ong -Copyright (c) 2014-2015 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## unpipe@1.0.0 (MIT) - -``` -(The MIT License) - -Copyright (c) 2015 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## type-is@1.6.17, 1.6.18 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2014-2015 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## media-typer@0.3.0 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## mime-types@2.1.24 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2015 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## mime-db@1.40.0 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.com - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## connect-redis@3.4.2 (MIT) - -``` -MIT -``` - -------------------------------------------------------- - -## redis@2.8.0 (MIT) - -``` -LICENSE - "MIT License" - -Copyright (c) 2016 by NodeRedis - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## double-ended-queue@2.1.0-0 (MIT) - -``` -Copyright (c) 2013 Petka Antonov - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## redis-commands@1.5.0 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2015 NodeRedis - -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: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## redis-parser@2.6.0 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2015 NodeRedis - -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: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## cookie-parser@1.4.4 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014 TJ Holowaychuk -Copyright (c) 2015 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## cookie@0.3.1, 0.4.0 (MIT) - -``` -(The MIT License) - -Copyright (c) 2012-2014 Roman Shtylman -Copyright (c) 2015 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## cookie-signature@1.0.6 (MIT) - -``` -(The MIT License) - -Copyright (c) 2012 LearnBoost <tj@learnboost.com> - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## dotenv@8.0.0 (BSD-2-Clause) - -``` -Copyright (c) 2015, Scott Motte -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* 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. - -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. -``` - -------------------------------------------------------- - -## express@4.17.1 (MIT) - -``` -(The MIT License) - -Copyright (c) 2009-2014 TJ Holowaychuk -Copyright (c) 2013-2014 Roman Shtylman -Copyright (c) 2014-2015 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## accepts@1.3.7 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2015 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## negotiator@0.6.2 (MIT) - -``` -(The MIT License) - -Copyright (c) 2012-2014 Federico Romero -Copyright (c) 2012-2014 Isaac Z. Schlueter -Copyright (c) 2014-2015 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## array-flatten@1.1.1 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## content-disposition@0.5.3 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014-2017 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## safe-buffer@5.1.2 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) Feross Aboukhadijeh - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## encodeurl@1.0.2 (MIT) - -``` -(The MIT License) - -Copyright (c) 2016 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## escape-html@1.0.3 (MIT) - -``` -(The MIT License) - -Copyright (c) 2012-2013 TJ Holowaychuk -Copyright (c) 2015 Andreas Lubbe -Copyright (c) 2015 Tiancheng "Timothy" Gu - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## etag@1.8.1 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014-2016 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## finalhandler@1.1.2 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014-2017 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## parseurl@1.3.3 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2014-2017 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## fresh@0.5.2 (MIT) - -``` -(The MIT License) - -Copyright (c) 2012 TJ Holowaychuk -Copyright (c) 2016-2017 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## merge-descriptors@1.0.1 (MIT) - -``` -(The MIT License) - -Copyright (c) 2013 Jonathan Ong -Copyright (c) 2015 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## methods@1.1.2 (MIT) - -``` -(The MIT License) - -Copyright (c) 2013-2014 TJ Holowaychuk -Copyright (c) 2015-2016 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## path-to-regexp@0.1.7 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## proxy-addr@2.0.5 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014-2016 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## forwarded@0.1.2 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014-2017 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## ipaddr.js@1.9.0 (MIT) - -``` -Copyright (C) 2011-2017 whitequark - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## range-parser@1.2.1 (MIT) - -``` -(The MIT License) - -Copyright (c) 2012-2014 TJ Holowaychuk -Copyright (c) 2015-2016 Douglas Christopher Wilson -``` - -------------------------------------------------------- - -## send@0.17.1 (MIT) - -``` -(The MIT License) - -Copyright (c) 2012 TJ Holowaychuk -Copyright (c) 2014-2016 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## destroy@1.0.4 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong me@jongleberry.com - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## mime@1.6.0 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2010 Benjamin Thomas, Robert Kieffer - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## serve-static@1.14.1 (MIT) - -``` -(The MIT License) - -Copyright (c) 2010 Sencha Inc. -Copyright (c) 2011 LearnBoost -Copyright (c) 2011 TJ Holowaychuk -Copyright (c) 2014-2016 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## utils-merge@1.0.1 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2013-2017 Jared Hanson - -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: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## vary@1.1.2 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014-2017 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## express-session@1.16.2 (MIT) - -``` -(The MIT License) - -Copyright (c) 2010 Sencha Inc. -Copyright (c) 2011 TJ Holowaychuk -Copyright (c) 2014-2015 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## on-headers@1.0.2 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## uid-safe@2.1.5 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2015-2017 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## random-bytes@1.0.0 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2016 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## morgan@1.9.1 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2014-2017 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## basic-auth@2.0.1 (MIT) - -``` -(The MIT License) - -Copyright (c) 2013 TJ Holowaychuk -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2015-2016 Douglas Christopher Wilson - -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: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## prom-client@11.5.3 (Apache-2.0) - -``` -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2015 Simon Nyberg - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -``` - -------------------------------------------------------- - -## tdigest@0.1.1 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2015 Will Welch - -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: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## bintrees@1.0.1 (other) - -``` -Copyright (C) 2011 by Vadim Graboys - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## ulid@2.3.0 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2017 Alizain Feerasta - -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: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -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. -``` -# 3rd Party License Attribution - -------------------------------------------------------- - -## axios@0.19.0 (MIT) - -``` -Copyright (c) 2014-present Matt Zabriskie - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## follow-redirects@1.5.10 (MIT) - -``` -Copyright 2017 Olivier Lalonde , James Talmage , Ruben Verborgh - -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: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## debug@3.1.0 (MIT) - -``` -(The MIT License) - -Copyright (c) 2014 TJ Holowaychuk - -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: - -The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. - -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. -``` - -------------------------------------------------------- - -## ms@2.0.0 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) 2016 Zeit, Inc. - -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: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## is-buffer@2.0.3 (MIT) - -``` -The MIT License (MIT) - -Copyright (c) Feross Aboukhadijeh - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## core-js@3.0.1 (MIT) - -``` -Copyright (c) 2014-2019 Denis Pushkarev - -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: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## echarts@4.2.1 (Apache-2.0) - -``` -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - - - -======================================================================== -Apache ECharts Subcomponents: - -The Apache ECharts project contains subcomponents with separate copyright -notices and license terms. Your use of the source code for these -subcomponents is also subject to the terms and conditions of the following -licenses. - -BSD 3-Clause (d3.js): -The following files embed [d3.js](https://github.com/d3/d3) BSD 3-Clause: - `/src/chart/treemap/treemapLayout.js`, - `/src/chart/tree/layoutHelper.js`, - `/src/chart/graph/forceHelper.js`, - `/src/util/number.js`, - `/src/scale/Time.js`, -See `/licenses/LICENSE-d3` for details of the license. -``` - -------------------------------------------------------- - -## zrender@4.0.7 (BSD) - -``` -BSD 3-Clause License - -Copyright (c) 2017, Baidu Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* 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. - -* Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -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. -``` - -------------------------------------------------------- - -## uikit@3.1.4 (MIT) - -``` -Copyright (c) 2013-2018 YOOtheme GmbH, getuikit.com - -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: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -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. -``` -# 3rd Party License Attribution - -------------------------------------------------------- - -## github.com/go-kit/kit v0.9.0 (MIT) - -``` -Copyright (c) 2015 Peter Bourgon -Licensed under the MIT license -``` - -------------------------------------------------------- - -## gopkg.in/goracle.v2 v2.20.1 (Apache 2.0) - -``` -Copyright 2017 TamĂ¡s GulĂ¡csi -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## github.com/godror/godror v0.22.2 (UPL-1.0) - -``` -Copyright 2019, 2020 TamĂ¡s GulĂ¡csi -Licensed under Universal Permissive License, Version 1.0 -``` - -------------------------------------------------------- - -## github.com/opentracing/opentracing-go v1.1.0 (Apache 2.0) - -``` -Copyright 2016 The OpenTracing Authors -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## github.com/openzipkin-contrib/zipkin-go-opentracing v0.3.5 (Apache 2.0) - -``` -Copyright 2016 The OpenTracing Authors -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## github.com/prometheus/client_golang v1.7.1 (Apache 2.0) - -``` -Copyright [yyyy] [name of copyright owner] - https://github.com/prometheus/client_golang/blob/master/LICENSE -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## github.com/sony/gobreaker v0.4.1 (MIT) - -``` -Copyright 2015 Sony Corporation -Licensed under the MIT license -``` - -------------------------------------------------------- - -## github.com/gorilla/mux v1.8.0 (BSD-3-Clause) - -``` -Copyright (c) 2012-2018 The Gorilla Authors -Licensed under the BSD 3-Clause "New" or "Revised" License -``` - -------------------------------------------------------- - -## github.com/jmoiron/sqlx v1.2.0 (MIT) - -``` -Copyright (c) 2013, Jason Moiron -Licensed under the MIT license -``` - -------------------------------------------------------- - -## github.com/weaveworks/common v0.0.0-20200206153930-760e36ae819a (Apache 2.0) - -``` -Copyright 2014-2016 Weaveworks Ltd. -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- -# 3rd Party License Attribution (indirect) - -------------------------------------------------------- - -## github.com/DataDog/zstd v1.3.6-0.20190409195224-796139022798 (BSD-3-Clause) - -``` -Copyright (c) 2016, Datadog -Licensed under the BSD 3-Clause "New" or "Revised" License -``` - -------------------------------------------------------- - -## github.com/Shopify/sarama v1.23.1 (MIT) - -``` -Copyright (c) 2013 Shopify -Licensed under the MIT license -``` - -------------------------------------------------------- - -## github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 (MIT) - -``` -Copyright (c) 2013 keith -Licensed under the MIT license -``` - -------------------------------------------------------- - -## github.com/apache/thrift v0.13.0 (Apache 2.0) - -``` -Copyright (c) 2007 Thomas Porschberg -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## github.com/beorn7/perks v1.0.1 (MIT) - -``` -Copyright (C) 2013 Blake Mizerany -Licensed under the MIT license -``` - -------------------------------------------------------- - -## github.com/davecgh/go-spew v1.1.1 (ISC) - -``` -Copyright (c) 2012-2016 Dave Collins -Licensed under the ISC license -``` - -------------------------------------------------------- - -## github.com/eapache/go-resiliency v1.1.0 (MIT) - -``` -Copyright (c) 2014 Evan Huus -Licensed under the MIT license -``` - -------------------------------------------------------- - -## github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 (MIT) - -``` -Copyright (c) 2016 Evan Huus -Licensed under the MIT license -``` - -------------------------------------------------------- - -## github.com/eapache/queue v1.1.0 (MIT) - -``` -Copyright (c) 2014 Evan Huus -Licensed under the MIT license -``` - -------------------------------------------------------- - -## github.com/go-logfmt/logfmt v0.4.0 (MIT) - -``` -Copyright (c) 2015 go-logfmt -Licensed under the MIT license -``` - -------------------------------------------------------- - -## github.com/gogo/googleapis v1.3.0 (Apache 2.0) - -``` -Copyright 2015, Google Inc -Copyright 2018, GoGo Authors -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## github.com/gogo/protobuf v1.3.4 (Other) - -``` -https://github.com/gogo/protobuf/blob/master/LICENSE - -Copyright (c) 2013, The GoGo Authors. All rights reserved. - -Protocol Buffers for Go with Gadgets - -Go support for Protocol Buffers - Google's data interchange format - -Copyright 2010 The Go Authors. All rights reserved. -https://github.com/golang/protobuf - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * 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. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -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. -``` - -------------------------------------------------------- - -## github.com/gogo/status v1.1.0 (Apache 2.0) - -``` -Copyright [yyyy] [name of copyright owner] - https://github.com/gogo/status/blob/master/LICENSE -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## github.com/golang/protobuf v1.3.2 (BSD-3-Clause) - -``` -Copyright 2010 The Go Authors -Licensed under the BSD 3-Clause "New" or "Revised" License -``` - -------------------------------------------------------- - -## github.com/golang/snappy v0.0.1 (BSD-3-Clause) - -``` -Copyright (c) 2011 The Snappy-Go Authors -Licensed under the BSD 3-Clause "New" or "Revised" License -``` - -------------------------------------------------------- - -## github.com/hashicorp/go-uuid v1.0.1 (MPL-2.0) - -``` -Copyright (c) Hashicorp - https://github.com/hashicorp/go-uuid/blob/master/LICENSE -Licensed under the Mozilla Public License 2.0 -``` - -------------------------------------------------------- - -## github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03 (BSD-3-Clause) - -``` -Copyright (c) 2009 The Go Authors -Licensed under the BSD 3-Clause "New" or "Revised" License -``` - -------------------------------------------------------- - -## github.com/matttproud/golang_protobuf_extensions v1.0.1 (Apache 2.0) - -``` -Copyright {yyyy} {name of copyright owner} - https://github.com/matttproud/golang_protobuf_extensions/blob/master/LICENSE -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 (Apache 2.0) - -``` -Copyright (c) 2017 opentracing-contrib -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9 (Apache 2.0) - -``` -Copyright [yyyy] [name of copyright owner] - https://github.com/opentracing-contrib/go-stdlib/blob/master/LICENSE -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## github.com/pierrec/lz4 v0.0.0-20190327172049-315a67e90e41 (BSD-3-Clause) - -``` -Copyright (c) 2015, Pierre Curto -Licensed under the BSD 3-Clause "New" or "Revised" License -``` - -------------------------------------------------------- - -## github.com/pkg/errors v0.8.0 (BSD-2-Clause) - -``` -Copyright (c) 2015, Dave Cheney -Licensed under the BSD 2-Clause License -``` - -------------------------------------------------------- - -## github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 (Apache 2.0) - -``` -Copyright [yyyy] [name of copyright owner] - https://github.com/prometheus/client_model/blob/master/LICENSE -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## github.com/prometheus/common v0.6.0 (Apache 2.0) - -``` -Copyright [yyyy] [name of copyright owner] - https://github.com/prometheus/common/blob/master/LICENSE -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## github.com/prometheus/procfs v0.0.3 (Apache 2.0) - -``` -Copyright [yyyy] [name of copyright owner] - https://github.com/prometheus/procfs/blob/master/LICENSE -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a (Other) - -``` -https://github.com/rcrowley/go-metrics/blob/master/LICENSE - -Copyright 2012 Richard Crowley. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. 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. - -THIS SOFTWARE IS PROVIDED BY RICHARD CROWLEY ``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 RICHARD CROWLEY 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. - -The views and conclusions contained in the software and documentation -are those of the authors and should not be interpreted as representing -official policies, either expressed or implied, of Richard Crowley. -``` - -------------------------------------------------------- - -## github.com/sirupsen/logrus v1.2.0 (MIT) - -``` -Copyright (c) 2014 Simon Eskildsen -Licensed under the MIT license -``` - -------------------------------------------------------- - -## github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e (Other) - -``` -https://github.com/streadway/handy/blob/master/README.md - -Copyright (c) 2013, SoundCloud Ltd. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -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. - -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. -``` - -------------------------------------------------------- - -## github.com/uber/jaeger-client-go v2.17.0+incompatible (Apache 2.0) - -``` -Copyright [yyyy] [name of copyright owner] - https://github.com/jaegertracing/jaeger-client-go/blob/master/LICENSE -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## github.com/uber/jaeger-lib v2.1.1+incompatible (Apache 2.0) - -``` -Copyright [yyyy] [name of copyright owner] - https://github.com/jaegertracing/jaeger-lib/blob/master/LICENSE -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## github.com/weaveworks/promrus v1.2.0 (Apache 2.0) - -``` -Copyright {yyyy} {name of copyright owner} - https://github.com/weaveworks/promrus/blob/master/LICENSE -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529 (BSD-3-Clause) - -``` -Copyright (c) 2009 The Go Authors -Licensed under the BSD 3-Clause "New" or "Revised" License -``` - -------------------------------------------------------- - -## golang.org/x/net v0.0.0-20200301022130-244492dfa37a (BSD-3-Clause) - -``` -Copyright (c) 2009 The Go Authors -Licensed under the BSD 3-Clause "New" or "Revised" License -``` - -------------------------------------------------------- - -## golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3 (BSD-3-Clause) - -``` -Copyright (c) 2009 The Go Authors -Licensed under the BSD 3-Clause "New" or "Revised" License -``` - -------------------------------------------------------- - -## golang.org/x/text v0.3.0 (BSD-3-Clause) - -``` -Copyright (c) 2009 The Go Authors -Licensed under the BSD 3-Clause "New" or "Revised" License -``` - -------------------------------------------------------- - -## golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 (BSD-3-Clause) - -``` -Copyright (c) 2019 The Go Authors -Licensed under the BSD 3-Clause "New" or "Revised" License -``` - -------------------------------------------------------- - -## google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 (Apache 2.0) - -``` -Copyright [yyyy] [name of copyright owner] - https://github.com/googleapis/go-genproto/blob/master/LICENSE -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## google.golang.org/grpc v1.23.0 (Apache 2.0) - -``` -Copyright [yyyy] [name of copyright owner] - https://github.com/grpc/grpc-go/blob/master/LICENSE -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## gopkg.in/jcmturner/aescts.v1 v1.0.1 (Apache 2.0) - -``` -Copyright {yyyy} {name of copyright owner} - https://github.com/jcmturner/aescts/blob/master/LICENSE -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## gopkg.in/jcmturner/dnsutils.v1 v1.0.1 (Apache 2.0) - -``` -Copyright [yyyy] [name of copyright owner] - https://github.com/jcmturner/dnsutils/blob/master/LICENSE -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## gopkg.in/jcmturner/gokrb5.v7 v7.2.3 (Apache 2.0) - -``` -Copyright {yyyy} {name of copyright owner} - https://github.com/jcmturner/gokrb5/blob/master/LICENSE -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -## gopkg.in/jcmturner/rpc.v1 v1.1.0 (Apache 2.0) - -``` -Copyright [yyyy] [name of copyright owner] - https://github.com/jcmturner/rpc/blob/master/LICENSE -Licensed under the Apache License, Version 2.0 -``` - -------------------------------------------------------- - -# Licenses - -------------------------------------------------------- - -## The MIT License (MIT) - -``` -MIT License - -Copyright (c) [year] [fullname] - -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: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## Apache License, Version 2.0 (Apache 2.0) - -``` - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -``` - -------------------------------------------------------- - -## The Universal Permissive License (UPL), Version 1.0 - -``` -Copyright (c) [year] [copyright holders] - -The Universal Permissive License (UPL), Version 1.0 - -Subject to the condition set forth below, permission is hereby granted to any -person obtaining a copy of this software, associated documentation and/or data -(collectively the "Software"), free of charge and under any and all copyright -rights in the Software, and any and all patent rights owned or freely -licensable by each licensor hereunder covering either (i) the unmodified -Software as contributed to or provided by such licensor, or (ii) the Larger -Works (as defined below), to deal in both - -(a) the Software, and -(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if -one is included with the Software (each a "Larger Work" to which the Software -is contributed by such licensors), - -without restriction, including without limitation the rights to copy, create -derivative works of, display, perform, and distribute the Software and make, -use, sell, offer for sale, import, export, have made, and have sold the -Software and the Larger Work(s), and to sublicense the foregoing rights on -either these or other terms. - -This license is subject to the following condition: -The above copyright notice and either this complete permission notice or at -a minimum a reference to the UPL must be included in all copies or -substantial portions of the Software. - -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. -``` - -------------------------------------------------------- - -## The 3-Clause BSD License (BSD-3-Clause) - -``` -Copyright - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. 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. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -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. -``` - -------------------------------------------------------- - -## The 2-Clause BSD License (BSD-2-Clause) - -``` -Copyright - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. 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. - -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. -``` - -------------------------------------------------------- - -## ISC License (ISC) - -``` -Copyright - -Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -``` - -------------------------------------------------------- - -## Mozilla Public License 2.0 (MPL-2.0) - -``` -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. -``` \ No newline at end of file diff --git a/src/orders/app/build.gradle b/src/orders/app/build.gradle index 493f0f9d..ec527e32 100644 --- a/src/orders/app/build.gradle +++ b/src/orders/app/build.gradle @@ -1,100 +1,118 @@ -plugins { - id("com.github.johnrengelman.shadow") version "7.1.2" - id("io.micronaut.application") version "3.6.2" -} - -group = "micronaut.mushop" - -repositories { - mavenCentral() -} - -micronaut { - runtime("netty") - testRuntime("junit5") - processing { - incremental(true) - annotations("mushop.orders.*") - } -} - -dependencies { - annotationProcessor("io.micronaut.data:micronaut-data-processor") - annotationProcessor("io.micronaut.openapi:micronaut-openapi") - annotationProcessor("io.micronaut.micrometer:micronaut-micrometer-annotation") - annotationProcessor("org.mapstruct:mapstruct-processor:1.5.3.Final") - - implementation("org.mapstruct:mapstruct:1.5.3.Final") - - implementation("io.micronaut:micronaut-http-client") - implementation("io.micronaut:micronaut-runtime") - implementation("io.micronaut:micronaut-validation") - - // Metrics - implementation("io.micronaut:micronaut-management") - implementation("io.micronaut.micrometer:micronaut-micrometer-core") - implementation("io.micronaut.micrometer:micronaut-micrometer-registry-prometheus") - - // Database - implementation("io.micronaut.data:micronaut-data-hibernate-jpa") - implementation("io.micronaut.sql:micronaut-jdbc-hikari") - runtimeOnly("com.h2database:h2") - - // Nats.io support - implementation("io.micronaut.nats:micronaut-nats") - - // Kubernetes service discovery - implementation("io.micronaut.kubernetes:micronaut-kubernetes-discovery-client:3.2.0") - - // Tracing - implementation("io.micronaut.tracing:micronaut-tracing-core") - implementation("io.micronaut.tracing:micronaut-tracing-zipkin") - - // Swagger - implementation("io.swagger.core.v3:swagger-annotations") - - runtimeOnly("ch.qos.logback:logback-classic") - - testImplementation(project(":tck")) - testImplementation("com.openpojo:openpojo:0.8.12") - testImplementation("org.testcontainers:junit-jupiter") -} - -application { - mainClass.set("mushop.orders.Application") -} - -java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 -} - -if (javaBaseImage == "graalvm") { - dockerfile { - baseImage = "ghcr.io/graalvm/graalvm-ce:ol8-java11-21.1.0" - } -} - -dockerBuild { - images = ["phx.ocir.io/oraclelabs/micronaut-showcase/mushop/$project.parent.name-$project.name-${javaBaseImage}:$project.version"] -} - -dockerBuildNative { - images = ["phx.ocir.io/oraclelabs/micronaut-showcase/mushop/${project.parent.name}-${project.name}-native:$project.version"] -} - -shadowJar { - zip64 = true -} - -graalvmNative { - binaries { - main { - buildArgs.add('--initialize-at-run-time=org.bouncycastle.asn1.ASN1UTF8String') - } - } -} - -dockerfileNative { - instruction "RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.11/main' >> /etc/apk/repositories && apk update && apk add 'zlib<1.2.12'" -} +plugins { + id("com.github.johnrengelman.shadow") version "8.1.1" + id("io.micronaut.application") version "4.3.4" + id("io.micronaut.aot") version "4.3.4" + id("io.micronaut.test-resources") version "4.3.4" +} + +group = "micronaut.mushop" + +repositories { + mavenCentral() +} + +micronaut { + runtime("netty") + testRuntime("junit5") + processing { + incremental(true) + annotations("mushop.orders.*") + }aot { + optimizeServiceLoading = false + convertYamlToJava = false + precomputeOperations = true + cacheEnvironment = true + optimizeClassLoading = true + deduceEnvironment = true + optimizeNetty = true + } + } + +dependencies { + annotationProcessor("io.micronaut.data:micronaut-data-processor") + annotationProcessor("io.micronaut.openapi:micronaut-openapi") + annotationProcessor("org.mapstruct:mapstruct-processor:1.5.5.Final") + annotationProcessor("io.micronaut:micronaut-http-validation") + annotationProcessor("io.micronaut.serde:micronaut-serde-processor") + annotationProcessor("io.micronaut.validation:micronaut-validation-processor") + annotationProcessor("io.micronaut.tracing:micronaut-tracing-opentelemetry-annotation") + + implementation("io.micronaut.serde:micronaut-serde-jackson") + implementation("io.micronaut.validation:micronaut-validation") + implementation("jakarta.validation:jakarta.validation-api") + implementation("io.micronaut:micronaut-retry") + implementation("io.micronaut:micronaut-http-client") + implementation("org.mapstruct:mapstruct:1.5.5.Final") + + // Metrics + implementation("io.micronaut:micronaut-management") + implementation("io.micronaut.micrometer:micronaut-micrometer-core") + implementation("io.micronaut.micrometer:micronaut-micrometer-registry-prometheus") + + // Database + implementation("io.micronaut.data:micronaut-data-hibernate-jpa") + implementation("io.micronaut.sql:micronaut-jdbc-hikari") + runtimeOnly("com.h2database:h2") + + // Nats.io support + implementation("io.micronaut.nats:micronaut-nats") + + // Kubernetes service discovery + implementation("io.micronaut.kubernetes:micronaut-kubernetes-discovery-client") + + // Tracing + implementation("io.micronaut.tracing:micronaut-tracing-core") + implementation("io.micronaut.tracing:micronaut-tracing-opentelemetry-http") + implementation("io.opentelemetry:opentelemetry-exporter-zipkin") + + // Swagger + implementation("io.swagger.core.v3:swagger-annotations") + + compileOnly("io.micronaut.openapi:micronaut-openapi-annotations") + runtimeOnly("org.yaml:snakeyaml") + runtimeOnly("ch.qos.logback:logback-classic") + + testImplementation(project(":tck")) + testImplementation("com.openpojo:openpojo:0.9.1") + testImplementation("io.micronaut:micronaut-http-client") + +} + +application { + mainClass.set("mushop.orders.Application") +} + +java { + sourceCompatibility = JavaVersion.toVersion("21") + targetCompatibility = JavaVersion.toVersion("21") +} + +if (javaBaseImage == "graalvm") { + dockerfile { + baseImage = "ghcr.io/graalvm/native-image-community:21" + } +} + +dockerBuild { + images = ["phx.ocir.io/oraclelabs/micronaut-showcase/mushop/$project.parent.name-$project.name-${javaBaseImage}:$project.version"] +} + +dockerBuildNative { + images = ["phx.ocir.io/oraclelabs/micronaut-showcase/mushop/${project.parent.name}-${project.name}-native:$project.version"] +} + +shadowJar { + zip64 = true +} + +graalvmNative { + binaries { + main { + buildArgs.add('--initialize-at-run-time=org.bouncycastle.asn1.ASN1UTF8String') + } + } +} + +dockerfileNative { + instruction "RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.11/main' >> /etc/apk/repositories && apk update && apk add 'zlib<1.2.12'" +} diff --git a/src/orders/app/src/main/java/mushop/orders/controllers/OrdersController.java b/src/orders/app/src/main/java/mushop/orders/controllers/OrdersController.java index 530982aa..085bc953 100644 --- a/src/orders/app/src/main/java/mushop/orders/controllers/OrdersController.java +++ b/src/orders/app/src/main/java/mushop/orders/controllers/OrdersController.java @@ -1,94 +1,94 @@ -/** - * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. - * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. - **/ -package mushop.orders.controllers; - -import io.micronaut.data.model.Pageable; -import io.micronaut.http.HttpRequest; -import io.micronaut.http.HttpResponse; -import io.micronaut.http.HttpStatus; -import io.micronaut.http.annotation.Body; -import io.micronaut.http.annotation.Controller; -import io.micronaut.http.annotation.Error; -import io.micronaut.http.annotation.Get; -import io.micronaut.http.annotation.Post; -import io.micronaut.http.annotation.QueryValue; -import io.micronaut.http.annotation.Status; -import io.micronaut.http.exceptions.HttpStatusException; -import io.micronaut.http.hateoas.JsonError; -import io.micronaut.http.hateoas.Link; -import io.micronaut.transaction.annotation.ReadOnly; - -import java.util.Optional; -import javax.validation.ConstraintViolationException; -import javax.validation.Valid; - -import mushop.orders.controllers.dto.CustomerOrderDto; -import mushop.orders.controllers.dto.CustomerOrdersDto; -import mushop.orders.entities.CustomerOrder; -import mushop.orders.resources.NewOrderResource; -import mushop.orders.services.OrdersService; -import reactor.core.publisher.Mono; - -/** - * Orders controller. - */ -@Controller("/orders") -public class OrdersController { - - private final OrdersService ordersService; - private final DtoMapper dtoMapper; - - OrdersController(OrdersService ordersService, - DtoMapper dtoMapper) { - this.ordersService = ordersService; - this.dtoMapper = dtoMapper; - } - - @Status(HttpStatus.CREATED) - @Post - Mono newOrder(@Body @Valid NewOrderResource newOrderResource) { - return ordersService.placeOrder(newOrderResource) - .map(dtoMapper::toCustomerOrderDto); - } - - @ReadOnly - @Get("/{orderId}") - Optional getOrder(Long orderId) { - Optional order = ordersService.getById(orderId); - CustomerOrderDto ordersDto = null; - if (order.isPresent()) { - ordersDto = dtoMapper.toCustomerOrderDto(order.get()); - } - return Optional.ofNullable(ordersDto); - } - - @ReadOnly - @Get("/search/customer") - CustomerOrdersDto searchCustomerOrders(@QueryValue String custId, Pageable pageable) { - return dtoMapper.toCustomerOrdersDto( - ordersService.searchCustomerOrders(custId, Pageable.from(0, -1, pageable.getSort())) - ); - } - - @Error(ConstraintViolationException.class) - public HttpResponse constraintError(HttpRequest request, ConstraintViolationException e) { - JsonError error = new JsonError(e.getMessage()) - .link(Link.SELF, Link.of(request.getUri())); - return HttpResponse.status(HttpStatus.NOT_ACCEPTABLE) - .body(error); - } - - public static class PaymentDeclinedException extends HttpStatusException { - public PaymentDeclinedException(String s) { - super(HttpStatus.NOT_ACCEPTABLE, s); - } - } - - public static class OrderFailedException extends HttpStatusException { - public OrderFailedException(String s) { - super(HttpStatus.SERVICE_UNAVAILABLE, s); - } - } -} +/** + * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. + * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. + **/ +package mushop.orders.controllers; + +import io.micronaut.data.model.Pageable; +import io.micronaut.http.HttpRequest; +import io.micronaut.http.HttpResponse; +import io.micronaut.http.HttpStatus; +import io.micronaut.http.annotation.Body; +import io.micronaut.http.annotation.Controller; +import io.micronaut.http.annotation.Error; +import io.micronaut.http.annotation.Get; +import io.micronaut.http.annotation.Post; +import io.micronaut.http.annotation.QueryValue; +import io.micronaut.http.annotation.Status; +import io.micronaut.http.exceptions.HttpStatusException; +import io.micronaut.http.hateoas.JsonError; +import io.micronaut.http.hateoas.Link; +import io.micronaut.transaction.annotation.ReadOnly; + +import java.util.Optional; +import jakarta.validation.ConstraintViolationException; +import jakarta.validation.Valid; + +import mushop.orders.controllers.dto.CustomerOrderDto; +import mushop.orders.controllers.dto.CustomerOrdersDto; +import mushop.orders.entities.CustomerOrder; +import mushop.orders.resources.NewOrderResource; +import mushop.orders.services.OrdersService; +import reactor.core.publisher.Mono; + +/** + * Orders controller. + */ +@Controller("/orders") +public class OrdersController { + + private final OrdersService ordersService; + private final DtoMapper dtoMapper; + + OrdersController(OrdersService ordersService, + DtoMapper dtoMapper) { + this.ordersService = ordersService; + this.dtoMapper = dtoMapper; + } + + @Status(HttpStatus.CREATED) + @Post + Mono newOrder(@Body @Valid NewOrderResource newOrderResource) { + return ordersService.placeOrder(newOrderResource) + .map(dtoMapper::toCustomerOrderDto); + } + + @ReadOnly + @Get("/{orderId}") + Optional getOrder(Long orderId) { + Optional order = ordersService.getById(orderId); + CustomerOrderDto ordersDto = null; + if (order.isPresent()) { + ordersDto = dtoMapper.toCustomerOrderDto(order.get()); + } + return Optional.ofNullable(ordersDto); + } + + @ReadOnly + @Get("/search/customer") + CustomerOrdersDto searchCustomerOrders(@QueryValue String custId, Pageable pageable) { + return dtoMapper.toCustomerOrdersDto( + ordersService.searchCustomerOrders(custId, Pageable.from(0, -1, pageable.getSort())) + ); + } + + @Error(ConstraintViolationException.class) + public HttpResponse constraintError(HttpRequest request, ConstraintViolationException e) { + JsonError error = new JsonError(e.getMessage()) + .link(Link.SELF, Link.of(request.getUri())); + return HttpResponse.status(HttpStatus.NOT_ACCEPTABLE) + .body(error); + } + + public static class PaymentDeclinedException extends HttpStatusException { + public PaymentDeclinedException(String s) { + super(HttpStatus.NOT_ACCEPTABLE, s); + } + } + + public static class OrderFailedException extends HttpStatusException { + public OrderFailedException(String s) { + super(HttpStatus.SERVICE_UNAVAILABLE, s); + } + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/controllers/dto/CustomerDto.java b/src/orders/app/src/main/java/mushop/orders/controllers/dto/CustomerDto.java index 4a24e9ad..d9ccae05 100644 --- a/src/orders/app/src/main/java/mushop/orders/controllers/dto/CustomerDto.java +++ b/src/orders/app/src/main/java/mushop/orders/controllers/dto/CustomerDto.java @@ -1,41 +1,41 @@ -package mushop.orders.controllers.dto; - -import io.micronaut.core.annotation.Introspected; - -/** - * The {@link mushop.orders.entities.Customer} DTO. - */ -@Introspected -public class CustomerDto { - - private final String id; - private final String firstName; - private final String lastName; - private final String username; - - public CustomerDto(String id, - String firstName, - String lastName, - String username) { - this.id = id; - this.firstName = firstName; - this.lastName = lastName; - this.username = username; - } - - public String getId() { - return id; - } - - public String getFirstName() { - return firstName; - } - - public String getLastName() { - return lastName; - } - - public String getUsername() { - return username; - } -} +package mushop.orders.controllers.dto; + +import io.micronaut.serde.annotation.Serdeable; + +/** + * The {@link mushop.orders.entities.Customer} DTO. + */ +@Serdeable +public class CustomerDto { + + private final String id; + private final String firstName; + private final String lastName; + private final String username; + + public CustomerDto(String id, + String firstName, + String lastName, + String username) { + this.id = id; + this.firstName = firstName; + this.lastName = lastName; + this.username = username; + } + + public String getId() { + return id; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getUsername() { + return username; + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/controllers/dto/CustomerOrderDto.java b/src/orders/app/src/main/java/mushop/orders/controllers/dto/CustomerOrderDto.java index 1951519a..d7e503a0 100644 --- a/src/orders/app/src/main/java/mushop/orders/controllers/dto/CustomerOrderDto.java +++ b/src/orders/app/src/main/java/mushop/orders/controllers/dto/CustomerOrderDto.java @@ -1,92 +1,92 @@ -/* - * Copyright 2021 original authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package mushop.orders.controllers.dto; - - -import io.micronaut.core.annotation.Introspected; -import io.micronaut.http.hateoas.AbstractResource; -import mushop.orders.entities.Address; -import mushop.orders.entities.Card; -import mushop.orders.entities.Shipment; - -import java.util.Collection; -import java.util.Date; - -/** - * The {@link mushop.orders.entities.CustomerOrder} DTO. - */ -@Introspected -public class CustomerOrderDto extends AbstractResource { - - private final Long id; - private final CustomerDto customer; - private final Address address; - private final Card card; - private final Collection items; - private final Shipment shipment; - private final Date orderDate; - private final Float total; - - public CustomerOrderDto(Long id, - CustomerDto customer, - Address address, - Card card, - Collection items, - Shipment shipment, - Date orderDate, - Float total) { - this.id = id; - this.customer = customer; - this.address = address; - this.card = card; - this.items = items; - this.shipment = shipment; - this.orderDate = orderDate; - this.total = total; - } - - public Long getId() { - return id; - } - - public CustomerDto getCustomer() { - return customer; - } - - public Address getAddress() { - return address; - } - - public Card getCard() { - return card; - } - - public Collection getItems() { - return items; - } - - public Shipment getShipment() { - return shipment; - } - - public Date getOrderDate() { - return orderDate; - } - - public Float getTotal() { - return total; - } -} +/* + * Copyright 2021 original authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package mushop.orders.controllers.dto; + + +import io.micronaut.serde.annotation.Serdeable; +import io.micronaut.http.hateoas.AbstractResource; +import mushop.orders.entities.Address; +import mushop.orders.entities.Card; +import mushop.orders.entities.Shipment; + +import java.util.Collection; +import java.util.Date; + +/** + * The {@link mushop.orders.entities.CustomerOrder} DTO. + */ +@Serdeable +public class CustomerOrderDto extends AbstractResource { + + private final Long id; + private final CustomerDto customer; + private final Address address; + private final Card card; + private final Collection items; + private final Shipment shipment; + private final Date orderDate; + private final Float total; + + public CustomerOrderDto(Long id, + CustomerDto customer, + Address address, + Card card, + Collection items, + Shipment shipment, + Date orderDate, + Float total) { + this.id = id; + this.customer = customer; + this.address = address; + this.card = card; + this.items = items; + this.shipment = shipment; + this.orderDate = orderDate; + this.total = total; + } + + public Long getId() { + return id; + } + + public CustomerDto getCustomer() { + return customer; + } + + public Address getAddress() { + return address; + } + + public Card getCard() { + return card; + } + + public Collection getItems() { + return items; + } + + public Shipment getShipment() { + return shipment; + } + + public Date getOrderDate() { + return orderDate; + } + + public Float getTotal() { + return total; + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/controllers/dto/CustomerOrdersDto.java b/src/orders/app/src/main/java/mushop/orders/controllers/dto/CustomerOrdersDto.java index c7132777..2db07e14 100644 --- a/src/orders/app/src/main/java/mushop/orders/controllers/dto/CustomerOrdersDto.java +++ b/src/orders/app/src/main/java/mushop/orders/controllers/dto/CustomerOrdersDto.java @@ -1,48 +1,48 @@ -/* - * Copyright 2021 original authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package mushop.orders.controllers.dto; - -import io.micronaut.core.annotation.Introspected; -import io.micronaut.data.model.Page; -import io.micronaut.http.hateoas.AbstractResource; -import mushop.orders.entities.CustomerOrder; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Map; - -/** - * The collection of {@link CustomerOrderDto}s. - */ -@Introspected -public class CustomerOrdersDto extends AbstractResource { - - private final Map page; - - public CustomerOrdersDto(Collection customerOrders, Page page) { - embedded("customerOrders", new ArrayList<>(customerOrders)); - this.page = Map.of( - "size", page.getSize(), - "totalElements", page.getNumberOfElements(), - "totalPages", page.getTotalPages(), - "number", page.getPageNumber() - ); - } - - public Map getPage() { - return page; - } -} +/* + * Copyright 2021 original authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package mushop.orders.controllers.dto; + +import io.micronaut.serde.annotation.Serdeable; +import io.micronaut.data.model.Page; +import io.micronaut.http.hateoas.AbstractResource; +import mushop.orders.entities.CustomerOrder; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Map; + +/** + * The collection of {@link CustomerOrderDto}s. + */ +@Serdeable +public class CustomerOrdersDto extends AbstractResource { + + private final Map page; + + public CustomerOrdersDto(Collection customerOrders, Page page) { + embedded("customerOrders", new ArrayList<>(customerOrders)); + this.page = Map.of( + "size", page.getSize(), + "totalElements", page.getNumberOfElements(), + "totalPages", page.getTotalPages(), + "number", page.getPageNumber() + ); + } + + public Map getPage() { + return page; + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/controllers/dto/ItemDto.java b/src/orders/app/src/main/java/mushop/orders/controllers/dto/ItemDto.java index fdca9315..172506de 100644 --- a/src/orders/app/src/main/java/mushop/orders/controllers/dto/ItemDto.java +++ b/src/orders/app/src/main/java/mushop/orders/controllers/dto/ItemDto.java @@ -1,38 +1,38 @@ -package mushop.orders.controllers.dto; - -import io.micronaut.core.annotation.Introspected; - -/** - * The {@link mushop.orders.entities.Item} DTO. - */ -@Introspected -public class ItemDto { - - private final String id; - private final String itemId; - private final int quantity; - private final float unitPrice; - - public ItemDto(String id, String itemId, int quantity, float unitPrice) { - this.id = id; - this.itemId = itemId; - this.quantity = quantity; - this.unitPrice = unitPrice; - } - - public String getId() { - return id; - } - - public String getItemId() { - return itemId; - } - - public int getQuantity() { - return quantity; - } - - public float getUnitPrice() { - return unitPrice; - } -} +package mushop.orders.controllers.dto; + +import io.micronaut.serde.annotation.Serdeable; + +/** + * The {@link mushop.orders.entities.Item} DTO. + */ +@Serdeable +public class ItemDto { + + private final String id; + private final String itemId; + private final int quantity; + private final float unitPrice; + + public ItemDto(String id, String itemId, int quantity, float unitPrice) { + this.id = id; + this.itemId = itemId; + this.quantity = quantity; + this.unitPrice = unitPrice; + } + + public String getId() { + return id; + } + + public String getItemId() { + return itemId; + } + + public int getQuantity() { + return quantity; + } + + public float getUnitPrice() { + return unitPrice; + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/entities/Address.java b/src/orders/app/src/main/java/mushop/orders/entities/Address.java index 2f331809..e16d7216 100644 --- a/src/orders/app/src/main/java/mushop/orders/entities/Address.java +++ b/src/orders/app/src/main/java/mushop/orders/entities/Address.java @@ -1,186 +1,188 @@ -/** - * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. - * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. - **/ -package mushop.orders.entities; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import java.io.Serializable; -import java.util.Objects; - -/** - * The customer address business object. - */ -@Entity -public class Address implements Serializable { - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE) - private Long addressId; - - @JsonProperty("id") - private String id; - - @JsonProperty("number") - private String street_number; - - private String street; - private String city; - private String postcode; - private String country; - - public Address(String id, - String street_number, - String street, - String city, - String postcode, - String country) { - this.id = id; - this.street_number = street_number; - this.street = street; - this.city = city; - this.postcode = postcode; - this.country = country; - } - - public Address() { - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @param id the id to set - */ - public void setId(String id) { - this.id = id; - } - - /** - * @return the addressId - */ - public Long getAddressId() { - return addressId; - } - - /** - * @param addressId the addressId to set - */ - public void setAddressId(Long addressId) { - this.addressId = addressId; - } - - /** - * @return the street_number - */ - public String getStreet_number() { - return street_number; - } - - /** - * @param street_number the street_number to set - */ - public void setStreet_number(String street_number) { - this.street_number = street_number; - } - - /** - * @return the street - */ - public String getStreet() { - return street; - } - - /** - * @param street the street to set - */ - public void setStreet(String street) { - this.street = street; - } - - /** - * @return the city - */ - public String getCity() { - return city; - } - - /** - * @param city the city to set - */ - public void setCity(String city) { - this.city = city; - } - - /** - * @return the postcode - */ - public String getPostcode() { - return postcode; - } - - /** - * @param postcode the postcode to set - */ - public void setPostcode(String postcode) { - this.postcode = postcode; - } - - /** - * @return the country - */ - public String getCountry() { - return country; - } - - /** - * @param country the country to set - */ - public void setCountry(String country) { - this.country = country; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Address address = (Address) o; - return Objects.equals(id, address.id) && - Objects.equals(street_number, address.street_number) && - Objects.equals(street, address.street) && - Objects.equals(city, address.city) && - Objects.equals(postcode, address.postcode) && - Objects.equals(country, address.country); - } - - @Override - public int hashCode() { - return Objects.hash(id, street_number, street, city, postcode, country); - } - - @Override - public String toString() { - return "Address{" + - "addressId=" + addressId + - ", id='" + id + '\'' + - ", street_number='" + street_number + '\'' + - ", street='" + street + '\'' + - ", city='" + city + '\'' + - ", postcode='" + postcode + '\'' + - ", country='" + country + '\'' + - '}'; - } -} +/** + * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. + * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. + **/ +package mushop.orders.entities; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +// import java.io.Serializable; +import java.util.Objects; +import io.micronaut.serde.annotation.Serdeable; + +/** + * The customer address business object. + */ +@Serdeable +@Entity +public class Address { + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE) + private Long addressId; + + @JsonProperty("id") + private String id; + + @JsonProperty("number") + private String street_number; + + private String street; + private String city; + private String postcode; + private String country; + + public Address(String id, + String street_number, + String street, + String city, + String postcode, + String country) { + this.id = id; + this.street_number = street_number; + this.street = street; + this.city = city; + this.postcode = postcode; + this.country = country; + } + + public Address() { + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the addressId + */ + public Long getAddressId() { + return addressId; + } + + /** + * @param addressId the addressId to set + */ + public void setAddressId(Long addressId) { + this.addressId = addressId; + } + + /** + * @return the street_number + */ + public String getStreet_number() { + return street_number; + } + + /** + * @param street_number the street_number to set + */ + public void setStreet_number(String street_number) { + this.street_number = street_number; + } + + /** + * @return the street + */ + public String getStreet() { + return street; + } + + /** + * @param street the street to set + */ + public void setStreet(String street) { + this.street = street; + } + + /** + * @return the city + */ + public String getCity() { + return city; + } + + /** + * @param city the city to set + */ + public void setCity(String city) { + this.city = city; + } + + /** + * @return the postcode + */ + public String getPostcode() { + return postcode; + } + + /** + * @param postcode the postcode to set + */ + public void setPostcode(String postcode) { + this.postcode = postcode; + } + + /** + * @return the country + */ + public String getCountry() { + return country; + } + + /** + * @param country the country to set + */ + public void setCountry(String country) { + this.country = country; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Address address = (Address) o; + return Objects.equals(id, address.id) && + Objects.equals(street_number, address.street_number) && + Objects.equals(street, address.street) && + Objects.equals(city, address.city) && + Objects.equals(postcode, address.postcode) && + Objects.equals(country, address.country); + } + + @Override + public int hashCode() { + return Objects.hash(id, street_number, street, city, postcode, country); + } + + @Override + public String toString() { + return "Address{" + + "addressId=" + addressId + + ", id='" + id + '\'' + + ", street_number='" + street_number + '\'' + + ", street='" + street + '\'' + + ", city='" + city + '\'' + + ", postcode='" + postcode + '\'' + + ", country='" + country + '\'' + + '}'; + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/entities/Card.java b/src/orders/app/src/main/java/mushop/orders/entities/Card.java index 87e55748..88a99a63 100644 --- a/src/orders/app/src/main/java/mushop/orders/entities/Card.java +++ b/src/orders/app/src/main/java/mushop/orders/entities/Card.java @@ -1,143 +1,145 @@ -/** - * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. - * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. - **/ -package mushop.orders.entities; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import java.io.Serializable; -import java.util.Objects; - -/** - * The customer payment card business object. - */ -@Entity -public class Card implements Serializable { - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE) - private Long cardId; - - @JsonProperty("id") - private String id; - - private String longNum; - private String expires; - private String ccv; - - public Card() { - } - - public Card(String id, String longNum, String expires, String ccv) { - this.id = id; - this.longNum = longNum; - this.expires = expires; - this.ccv = ccv; - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @param id the id to set - */ - public void setId(String id) { - this.id = id; - } - - /** - * @return the cardId - */ - public Long getCardId() { - return cardId; - } - - /** - * @param cardId the cardId to set - */ - public void setCardId(Long cardId) { - this.cardId = cardId; - } - - /** - * @return the longNum - */ - public String getLongNum() { - return longNum; - } - - /** - * @param longNum the longNum to set - */ - public void setLongNum(String longNum) { - this.longNum = longNum; - } - - /** - * @return the expires - */ - public String getExpires() { - return expires; - } - - /** - * @param expires the expires to set - */ - public void setExpires(String expires) { - this.expires = expires; - } - - /** - * @return the ccv - */ - public String getCcv() { - return ccv; - } - - /** - * @param ccv the ccv to set - */ - public void setCcv(String ccv) { - this.ccv = ccv; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Card card = (Card) o; - return Objects.equals(id, card.id) && - Objects.equals(longNum, card.longNum) && - Objects.equals(expires, card.expires) && - Objects.equals(ccv, card.ccv); - } - - @Override - public int hashCode() { - return Objects.hash(id, longNum, expires, ccv); - } - - @Override - public String toString() { - return "Card{" + - "cardId=" + cardId + - ", id='" + id + '\'' + - ", longNum='" + longNum + '\'' + - ", expires='" + expires + '\'' + - ", ccv='" + ccv + '\'' + - '}'; - } -} +/** + * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. + * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. + **/ +package mushop.orders.entities; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.micronaut.serde.annotation.Serdeable; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import java.io.Serializable; +import java.util.Objects; + +/** + * The customer payment card business object. + */ +@Serdeable +@Entity +public class Card { + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE) + private Long cardId; + + @JsonProperty("id") + private String id; + + private String longNum; + private String expires; + private String ccv; + + public Card() { + } + + public Card(String id, String longNum, String expires, String ccv) { + this.id = id; + this.longNum = longNum; + this.expires = expires; + this.ccv = ccv; + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the cardId + */ + public Long getCardId() { + return cardId; + } + + /** + * @param cardId the cardId to set + */ + public void setCardId(Long cardId) { + this.cardId = cardId; + } + + /** + * @return the longNum + */ + public String getLongNum() { + return longNum; + } + + /** + * @param longNum the longNum to set + */ + public void setLongNum(String longNum) { + this.longNum = longNum; + } + + /** + * @return the expires + */ + public String getExpires() { + return expires; + } + + /** + * @param expires the expires to set + */ + public void setExpires(String expires) { + this.expires = expires; + } + + /** + * @return the ccv + */ + public String getCcv() { + return ccv; + } + + /** + * @param ccv the ccv to set + */ + public void setCcv(String ccv) { + this.ccv = ccv; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Card card = (Card) o; + return Objects.equals(id, card.id) && + Objects.equals(longNum, card.longNum) && + Objects.equals(expires, card.expires) && + Objects.equals(ccv, card.ccv); + } + + @Override + public int hashCode() { + return Objects.hash(id, longNum, expires, ccv); + } + + @Override + public String toString() { + return "Card{" + + "cardId=" + cardId + + ", id='" + id + '\'' + + ", longNum='" + longNum + '\'' + + ", expires='" + expires + '\'' + + ", ccv='" + ccv + '\'' + + '}'; + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/entities/Cart.java b/src/orders/app/src/main/java/mushop/orders/entities/Cart.java index ea9d028f..2aa55cd4 100644 --- a/src/orders/app/src/main/java/mushop/orders/entities/Cart.java +++ b/src/orders/app/src/main/java/mushop/orders/entities/Cart.java @@ -1,111 +1,114 @@ -/** - * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. - * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. - **/ -package mushop.orders.entities; - -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * The cart business object. - */ -@Entity -public class Cart implements Serializable { - - @NotNull - @ManyToOne - private Customer customer; - - @Id - private String id; - - @OneToMany - private List items = new ArrayList<>(); - - public Cart() { - } - - public Cart(@NotNull Customer customer, String id, List items) { - this.customer = customer; - this.id = id; - this.items = items; - } - - /** - * @return the customer - */ - public Customer getCustomer() { - return customer; - } - - /** - * @param customer the customer to set - */ - public void setCustomer(Customer customer) { - this.customer = customer; - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @param id the id to set - */ - public void setId(String id) { - this.id = id; - } - - /** - * @return the items - */ - public List getItems() { - return items; - } - - /** - * @param items the items to set - */ - public void setItems(List items) { - this.items = items; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cart cart = (Cart) o; - return Objects.equals(customer, cart.customer) && - Objects.equals(id, cart.id) && - Objects.equals(items, cart.items); - } - - @Override - public int hashCode() { - return Objects.hash(customer, id, items); - } - - @Override - public String toString() { - return "Cart{" + - "customer=" + customer + - ", id='" + id + '\'' + - ", items=" + items + - '}'; - } -} +/** + * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. + * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. + **/ +package mushop.orders.entities; + +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.validation.constraints.NotNull; +// import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +import io.micronaut.serde.annotation.Serdeable; + +/** + * The cart business object. + */ +@Serdeable +@Entity +public class Cart { + + @NotNull + @ManyToOne + private Customer customer; + + @Id + private String id; + + @OneToMany + private List items = new ArrayList<>(); + + public Cart() { + } + + public Cart(@NotNull Customer customer, String id, List items) { + this.customer = customer; + this.id = id; + this.items = items; + } + + /** + * @return the customer + */ + public Customer getCustomer() { + return customer; + } + + /** + * @param customer the customer to set + */ + public void setCustomer(Customer customer) { + this.customer = customer; + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the items + */ + public List getItems() { + return items; + } + + /** + * @param items the items to set + */ + public void setItems(List items) { + this.items = items; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cart cart = (Cart) o; + return Objects.equals(customer, cart.customer) && + Objects.equals(id, cart.id) && + Objects.equals(items, cart.items); + } + + @Override + public int hashCode() { + return Objects.hash(customer, id, items); + } + + @Override + public String toString() { + return "Cart{" + + "customer=" + customer + + ", id='" + id + '\'' + + ", items=" + items + + '}'; + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/entities/Customer.java b/src/orders/app/src/main/java/mushop/orders/entities/Customer.java index bf416993..47a4b55a 100644 --- a/src/orders/app/src/main/java/mushop/orders/entities/Customer.java +++ b/src/orders/app/src/main/java/mushop/orders/entities/Customer.java @@ -1,199 +1,201 @@ -/** - * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. - * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. - **/ -package mushop.orders.entities; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.OneToMany; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * The customer business object. - */ -@Entity -public class Customer implements Serializable { - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE) - private Long customerId; - - @JsonProperty("id") - private String id; - - private String firstName; - private String lastName; - private String username; - - @OneToMany - private List
addresses = new ArrayList<>(); - - @OneToMany - private List cards = new ArrayList<>(); - - public Customer() { - } - - public Customer(String id, - String firstName, - String lastName, - String username, - List
addresses, - List cards) { - this.id = id; - this.firstName = firstName; - this.lastName = lastName; - this.username = username; - this.addresses = addresses; - this.cards = cards; - } - - public Customer(String firstName, - String lastName, - String username, - List
addresses, - List cards) { - this(null, firstName, lastName, username, addresses, cards); - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @param id the id to set - */ - public void setId(String id) { - this.id = id; - } - - /** - * @return the customerId - */ - public Long getCustomerId() { - return customerId; - } - - /** - * @param customerId the customerId to set - */ - public void setCustomerId(Long customerId) { - this.customerId = customerId; - } - - /** - * @return the firstName - */ - public String getFirstName() { - return firstName; - } - - /** - * @param firstName the firstName to set - */ - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - /** - * @return the lastName - */ - public String getLastName() { - return lastName; - } - - /** - * @param lastName the lastName to set - */ - public void setLastName(String lastName) { - this.lastName = lastName; - } - - /** - * @return the username - */ - public String getUsername() { - return username; - } - - /** - * @param username the username to set - */ - public void setUsername(String username) { - this.username = username; - } - - /** - * @return the addresses - */ - public List
getAddresses() { - return addresses; - } - - /** - * @param addresses the addresses to set - */ - public void setAddresses(List
addresses) { - this.addresses = addresses; - } - - /** - * @return the cards - */ - public List getCards() { - return cards; - } - - /** - * @param cards the cards to set - */ - public void setCards(List cards) { - this.cards = cards; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Customer customer = (Customer) o; - return Objects.equals(id, customer.id) && - Objects.equals(firstName, customer.firstName) && - Objects.equals(lastName, customer.lastName) && - Objects.equals(username, customer.username) && - Objects.equals(addresses, customer.addresses) && - Objects.equals(cards, customer.cards); - } - - @Override - public int hashCode() { - return Objects.hash(id, firstName, lastName, username, addresses, cards); - } - - @Override - public String toString() { - return "Customer{" + - "customerId=" + customerId + - ", id='" + id + '\'' + - ", firstName='" + firstName + '\'' + - ", lastName='" + lastName + '\'' + - ", username='" + username + '\'' + - ", addresses=" + addresses + - ", cards=" + cards + - '}'; - } -} +/** + * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. + * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. + **/ +package mushop.orders.entities; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; +// import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import io.micronaut.serde.annotation.Serdeable; + +/** + * The customer business object. + */ +@Entity +@Serdeable +public class Customer { + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE) + private Long customerId; + + @JsonProperty("id") + private String id; + + private String firstName; + private String lastName; + private String username; + + @OneToMany + private List
addresses = new ArrayList<>(); + + @OneToMany + private List cards = new ArrayList<>(); + + public Customer() { + } + + public Customer(String id, + String firstName, + String lastName, + String username, + List
addresses, + List cards) { + this.id = id; + this.firstName = firstName; + this.lastName = lastName; + this.username = username; + this.addresses = addresses; + this.cards = cards; + } + + public Customer(String firstName, + String lastName, + String username, + List
addresses, + List cards) { + this(null, firstName, lastName, username, addresses, cards); + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the customerId + */ + public Long getCustomerId() { + return customerId; + } + + /** + * @param customerId the customerId to set + */ + public void setCustomerId(Long customerId) { + this.customerId = customerId; + } + + /** + * @return the firstName + */ + public String getFirstName() { + return firstName; + } + + /** + * @param firstName the firstName to set + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * @return the lastName + */ + public String getLastName() { + return lastName; + } + + /** + * @param lastName the lastName to set + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * @return the username + */ + public String getUsername() { + return username; + } + + /** + * @param username the username to set + */ + public void setUsername(String username) { + this.username = username; + } + + /** + * @return the addresses + */ + public List
getAddresses() { + return addresses; + } + + /** + * @param addresses the addresses to set + */ + public void setAddresses(List
addresses) { + this.addresses = addresses; + } + + /** + * @return the cards + */ + public List getCards() { + return cards; + } + + /** + * @param cards the cards to set + */ + public void setCards(List cards) { + this.cards = cards; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Customer customer = (Customer) o; + return Objects.equals(id, customer.id) && + Objects.equals(firstName, customer.firstName) && + Objects.equals(lastName, customer.lastName) && + Objects.equals(username, customer.username) && + Objects.equals(addresses, customer.addresses) && + Objects.equals(cards, customer.cards); + } + + @Override + public int hashCode() { + return Objects.hash(id, firstName, lastName, username, addresses, cards); + } + + @Override + public String toString() { + return "Customer{" + + "customerId=" + customerId + + ", id='" + id + '\'' + + ", firstName='" + firstName + '\'' + + ", lastName='" + lastName + '\'' + + ", username='" + username + '\'' + + ", addresses=" + addresses + + ", cards=" + cards + + '}'; + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/entities/CustomerOrder.java b/src/orders/app/src/main/java/mushop/orders/entities/CustomerOrder.java index 9184dcb7..daeaea69 100644 --- a/src/orders/app/src/main/java/mushop/orders/entities/CustomerOrder.java +++ b/src/orders/app/src/main/java/mushop/orders/entities/CustomerOrder.java @@ -1,192 +1,194 @@ -/** - * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. - * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. - **/ -package mushop.orders.entities; - -import com.fasterxml.jackson.annotation.JsonProperty; -import io.micronaut.core.annotation.Nullable; -import io.micronaut.data.annotation.DateCreated; - -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.OneToMany; -import javax.persistence.OneToOne; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import java.io.Serializable; -import java.util.Calendar; -import java.util.Collection; -import java.util.Date; -import java.util.List; -import java.util.Objects; - -/** - * The customer address business object. - */ -@Entity -public class CustomerOrder implements Serializable { - - @JsonProperty("orderId") - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE) - private Long id; - - @OneToOne(cascade = CascadeType.ALL) - @Nullable - private Customer customer; - - @OneToOne(cascade = CascadeType.ALL) - @Nullable - private Address address; - - @OneToOne(cascade = CascadeType.ALL) - @Nullable - private Card card; - - @OneToMany(cascade = CascadeType.ALL) - @Nullable - private Collection items; - - @OneToOne(cascade = CascadeType.ALL) - @Nullable - private Shipment shipment; - - @Column(nullable = false, updatable = false) - @Temporal(TemporalType.TIMESTAMP) - @DateCreated - private Date orderDate = Calendar.getInstance().getTime(); - - private Float total; - - public CustomerOrder() { - } - - public CustomerOrder(Long id, - Customer customer, - Address address, - Card card, - List items, - Shipment shipment, - Date orderDate, - Float total) { - super(); - this.id = id; - this.customer = customer; - this.address = address; - this.card = card; - this.items = items; - this.shipment = shipment; - this.orderDate = orderDate; - this.total = total; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - @Nullable - public Customer getCustomer() { - return customer; - } - - public void setCustomer(Customer customer) { - this.customer = customer; - } - - @Nullable - public Address getAddress() { - return address; - } - - public void setAddress(Address address) { - this.address = address; - } - - @Nullable - public Card getCard() { - return card; - } - - public void setCard(Card card) { - this.card = card; - } - - @Nullable - public Collection getItems() { - return items; - } - - public void setItems(Collection items) { - this.items = items; - } - - @Nullable - public Shipment getShipment() { - return shipment; - } - - public void setShipment(Shipment shipment) { - this.shipment = shipment; - } - - public Date getOrderDate() { - return orderDate; - } - - public void setOrderDate(Date orderDate) { - this.orderDate = orderDate; - } - - public Float getTotal() { - return total; - } - - public void setTotal(Float total) { - this.total = total; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CustomerOrder that = (CustomerOrder) o; - return Objects.equals(id, that.id) && - Objects.equals(customer, that.customer) && - Objects.equals(address, that.address) && - Objects.equals(card, that.card) && - Objects.equals(items, that.items) && - Objects.equals(shipment, that.shipment) && - Objects.equals(orderDate, that.orderDate); - } - - @Override - public int hashCode() { - return Objects.hash(id, customer, address, card, items, shipment, orderDate); - } - - @Override - public String toString() { - return "CustomerOrder [id=" + id + - ", customer=" + customer + - ", address=" + address + - ", card=" + card + - ", items=" + items + - ", shipment=" + shipment + - ", orderDate=" + orderDate + - ", total=" + total + - "]"; - } -} +/** + * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. + * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. + **/ +package mushop.orders.entities; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.data.annotation.DateCreated; + +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; +import jakarta.persistence.OneToOne; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +// import java.io.Serializable; +import java.util.Calendar; +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import io.micronaut.serde.annotation.Serdeable; + +/** + * The customer address business object. + */ +@Serdeable +@Entity +public class CustomerOrder { + + @JsonProperty("orderId") + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE) + private Long id; + + @OneToOne(cascade = CascadeType.ALL) + @Nullable + private Customer customer; + + @OneToOne(cascade = CascadeType.ALL) + @Nullable + private Address address; + + @OneToOne(cascade = CascadeType.ALL) + @Nullable + private Card card; + + @OneToMany(cascade = CascadeType.ALL) + @Nullable + private Collection items; + + @OneToOne(cascade = CascadeType.ALL) + @Nullable + private Shipment shipment; + + @Column(nullable = false, updatable = false) + @Temporal(TemporalType.TIMESTAMP) + @DateCreated + private Date orderDate = Calendar.getInstance().getTime(); + + private Float total; + + public CustomerOrder() { + } + + public CustomerOrder(Long id, + Customer customer, + Address address, + Card card, + List items, + Shipment shipment, + Date orderDate, + Float total) { + super(); + this.id = id; + this.customer = customer; + this.address = address; + this.card = card; + this.items = items; + this.shipment = shipment; + this.orderDate = orderDate; + this.total = total; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + @Nullable + public Customer getCustomer() { + return customer; + } + + public void setCustomer(Customer customer) { + this.customer = customer; + } + + @Nullable + public Address getAddress() { + return address; + } + + public void setAddress(Address address) { + this.address = address; + } + + @Nullable + public Card getCard() { + return card; + } + + public void setCard(Card card) { + this.card = card; + } + + @Nullable + public Collection getItems() { + return items; + } + + public void setItems(Collection items) { + this.items = items; + } + + @Nullable + public Shipment getShipment() { + return shipment; + } + + public void setShipment(Shipment shipment) { + this.shipment = shipment; + } + + public Date getOrderDate() { + return orderDate; + } + + public void setOrderDate(Date orderDate) { + this.orderDate = orderDate; + } + + public Float getTotal() { + return total; + } + + public void setTotal(Float total) { + this.total = total; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomerOrder that = (CustomerOrder) o; + return Objects.equals(id, that.id) && + Objects.equals(customer, that.customer) && + Objects.equals(address, that.address) && + Objects.equals(card, that.card) && + Objects.equals(items, that.items) && + Objects.equals(shipment, that.shipment) && + Objects.equals(orderDate, that.orderDate); + } + + @Override + public int hashCode() { + return Objects.hash(id, customer, address, card, items, shipment, orderDate); + } + + @Override + public String toString() { + return "CustomerOrder [id=" + id + + ", customer=" + customer + + ", address=" + address + + ", card=" + card + + ", items=" + items + + ", shipment=" + shipment + + ", orderDate=" + orderDate + + ", total=" + total + + "]"; + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/entities/Item.java b/src/orders/app/src/main/java/mushop/orders/entities/Item.java index 8e806fa8..23555588 100644 --- a/src/orders/app/src/main/java/mushop/orders/entities/Item.java +++ b/src/orders/app/src/main/java/mushop/orders/entities/Item.java @@ -1,154 +1,156 @@ -/** - * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. - * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. - **/ -package mushop.orders.entities; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.Objects; - -/** - * The cart item business object. - */ -@Entity -public class Item implements Serializable { - - @Id - @GeneratedValue(strategy = GenerationType.SEQUENCE) - private Long sId; - - @JsonProperty("id") - private String id; - - @NotNull(message = "Item name must not be null") - private String itemId; - - private int quantity; - private float unitPrice; - - public Item() { - this(null, "", 1, 0F); - } - - public Item(String id, - @NotNull(message = "Item Id must not be null") String itemId, - int quantity, - float unitPrice) { - this.id = id; - this.itemId = itemId; - this.quantity = quantity; - this.unitPrice = unitPrice; - } - - /** - * @return the sId - */ - public Long getsId() { - return sId; - } - - /** - * @param sId the sId to set - */ - public void setsId(Long sId) { - this.sId = sId; - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @param id the id to set - */ - public void setId(String id) { - this.id = id; - } - - /** - * @return the name - */ - public String getItemId() { - return itemId; - } - - /** - * @param itemId the itemId to set - */ - public void setItemId(String itemId) { - this.itemId = itemId; - } - - /** - * @return the quantity - */ - public int getQuantity() { - return quantity; - } - - /** - * @param quantity the quantity to set - */ - public void setQuantity(int quantity) { - this.quantity = quantity; - } - - /** - * @return the unitPrice - */ - public float getUnitPrice() { - return unitPrice; - } - - /** - * @param unitPrice the unitPrice to set - */ - public void setUnitPrice(float unitPrice) { - this.unitPrice = unitPrice; - } - - public float getTotal() { - return unitPrice * quantity; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Item item = (Item) o; - return quantity == item.quantity && - Float.compare(item.unitPrice, unitPrice) == 0 && - Objects.equals(id, item.id) && - Objects.equals(itemId, item.itemId); - } - - @Override - public int hashCode() { - return Objects.hash(id, itemId, quantity, unitPrice); - } - - @Override - public String toString() { - return "Item{" + - "sId=" + sId + - ", id='" + id + '\'' + - ", itemId='" + itemId + '\'' + - ", quantity=" + quantity + - ", unitPrice=" + unitPrice + - '}'; - } -} +/** + * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. + * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. + **/ +package mushop.orders.entities; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.validation.constraints.NotNull; +// import java.io.Serializable; +import java.util.Objects; +import io.micronaut.serde.annotation.Serdeable; + +/** + * The cart item business object. + */ +@Serdeable +@Entity +public class Item { + + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE) + private Long sId; + + @JsonProperty("id") + private String id; + + @NotNull(message = "Item name must not be null") + private String itemId; + + private int quantity; + private float unitPrice; + + public Item() { + this(null, "", 1, 0F); + } + + public Item(String id, + @NotNull(message = "Item Id must not be null") String itemId, + int quantity, + float unitPrice) { + this.id = id; + this.itemId = itemId; + this.quantity = quantity; + this.unitPrice = unitPrice; + } + + /** + * @return the sId + */ + public Long getsId() { + return sId; + } + + /** + * @param sId the sId to set + */ + public void setsId(Long sId) { + this.sId = sId; + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the name + */ + public String getItemId() { + return itemId; + } + + /** + * @param itemId the itemId to set + */ + public void setItemId(String itemId) { + this.itemId = itemId; + } + + /** + * @return the quantity + */ + public int getQuantity() { + return quantity; + } + + /** + * @param quantity the quantity to set + */ + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + /** + * @return the unitPrice + */ + public float getUnitPrice() { + return unitPrice; + } + + /** + * @param unitPrice the unitPrice to set + */ + public void setUnitPrice(float unitPrice) { + this.unitPrice = unitPrice; + } + + public float getTotal() { + return unitPrice * quantity; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Item item = (Item) o; + return quantity == item.quantity && + Float.compare(item.unitPrice, unitPrice) == 0 && + Objects.equals(id, item.id) && + Objects.equals(itemId, item.itemId); + } + + @Override + public int hashCode() { + return Objects.hash(id, itemId, quantity, unitPrice); + } + + @Override + public String toString() { + return "Item{" + + "sId=" + sId + + ", id='" + id + '\'' + + ", itemId='" + itemId + '\'' + + ", quantity=" + quantity + + ", unitPrice=" + unitPrice + + '}'; + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/entities/Shipment.java b/src/orders/app/src/main/java/mushop/orders/entities/Shipment.java index 9b2d489e..75763e28 100644 --- a/src/orders/app/src/main/java/mushop/orders/entities/Shipment.java +++ b/src/orders/app/src/main/java/mushop/orders/entities/Shipment.java @@ -1,89 +1,91 @@ -/** - * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. - * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. - **/ -package mushop.orders.entities; - -import javax.persistence.Entity; -import javax.persistence.Id; -import java.io.Serializable; -import java.util.Objects; -import java.util.UUID; - -/** - * The cart shipment business object. - */ -@Entity -public class Shipment implements Serializable { - - @Id - private String id; - - private String name; - - public Shipment() { - } - - public Shipment(String name) { - this(UUID.randomUUID().toString(), name); - } - - public Shipment(String id, String name) { - this.id = id; - this.name = name; - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @param id the id to set - */ - public void setId(String id) { - this.id = id; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @param name the name to set - */ - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Shipment shipment = (Shipment) o; - return Objects.equals(id, shipment.id) && - Objects.equals(name, shipment.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - return "Shipment{" + - "id='" + id + '\'' + - ", name='" + name + '\'' + - '}'; - } -} +/** + * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. + * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. + **/ +package mushop.orders.entities; + +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +// import java.io.Serializable; +import java.util.Objects; +import java.util.UUID; +import io.micronaut.serde.annotation.Serdeable; + +/** + * The cart shipment business object. + */ +@Serdeable +@Entity +public class Shipment { + + @Id + private String id; + + private String name; + + public Shipment() { + } + + public Shipment(String name) { + this(UUID.randomUUID().toString(), name); + } + + public Shipment(String id, String name) { + this.id = id; + this.name = name; + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Shipment shipment = (Shipment) o; + return Objects.equals(id, shipment.id) && + Objects.equals(name, shipment.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + return "Shipment{" + + "id='" + id + '\'' + + ", name='" + name + '\'' + + '}'; + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/repositories/CustomerOrderRepository.java b/src/orders/app/src/main/java/mushop/orders/repositories/CustomerOrderRepository.java index fa1aa854..74ef651f 100644 --- a/src/orders/app/src/main/java/mushop/orders/repositories/CustomerOrderRepository.java +++ b/src/orders/app/src/main/java/mushop/orders/repositories/CustomerOrderRepository.java @@ -1,23 +1,23 @@ -/** - * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. - * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. - **/ -package mushop.orders.repositories; - -import io.micronaut.data.annotation.Join; -import io.micronaut.data.annotation.Repository; -import io.micronaut.data.jpa.repository.JpaRepository; -import io.micronaut.data.model.Page; -import io.micronaut.data.model.Pageable; -import mushop.orders.entities.CustomerOrder; - -/** - * Customer order repository. - */ -@Repository -public interface CustomerOrderRepository extends JpaRepository { - - @Join(value = "customer", type = Join.Type.FETCH) - Page findByCustomerId(String name, Pageable p); -} - +/** + * * Copyright © 2020, Oracle and/or its affiliates. All rights reserved. + * * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. + **/ +package mushop.orders.repositories; + +import io.micronaut.data.annotation.Join; +import io.micronaut.data.annotation.Repository; +import io.micronaut.data.jpa.repository.JpaRepository; +import io.micronaut.data.model.Page; +import io.micronaut.data.model.Pageable; +import mushop.orders.entities.CustomerOrder; + +/** + * Customer order repository. + */ +@Repository +public interface CustomerOrderRepository extends JpaRepository { + + @Join(value = "customer", type = Join.Type.FETCH) + Page findByCustomerId(String name, Pageable p); +} + diff --git a/src/orders/app/src/main/java/mushop/orders/resources/NewOrderResource.java b/src/orders/app/src/main/java/mushop/orders/resources/NewOrderResource.java index a21d1fdf..3ed22983 100644 --- a/src/orders/app/src/main/java/mushop/orders/resources/NewOrderResource.java +++ b/src/orders/app/src/main/java/mushop/orders/resources/NewOrderResource.java @@ -1,79 +1,79 @@ -/** - ** Copyright © 2020, Oracle and/or its affiliates. All rights reserved. - ** Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. - **/ -package mushop.orders.resources; - -import io.micronaut.core.annotation.Introspected; - -import java.net.URI; -import java.util.Objects; -import javax.validation.constraints.NotNull; - -/** - * The messaging business object. - */ -@Introspected -public class NewOrderResource { - - @NotNull - private final URI customer; - @NotNull - private final URI address; - @NotNull - private final URI card; - @NotNull - private final URI items; - - public NewOrderResource(URI customer, - URI address, - URI card, - URI items) { - this.customer = customer; - this.address = address; - this.card = card; - this.items = items; - } - - public URI getCustomer() { - return customer; - } - - public URI getAddress() { - return address; - } - - public URI getCard() { - return card; - } - - public URI getItems() { - return items; - } - - @Override - public String toString() { - return "NewOrderResource{" + - "\"customer\":" + customer + - ", \"address\":" + address + - ", \"card\":" + card + - ", \"items\": [" + items + - "] }"; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - NewOrderResource that = (NewOrderResource) o; - return Objects.equals(customer, that.customer) && - Objects.equals(address, that.address) && - Objects.equals(card, that.card) && - Objects.equals(items, that.items); - } - - @Override - public int hashCode() { - return Objects.hash(customer, address, card, items); - } -} +/** + ** Copyright © 2020, Oracle and/or its affiliates. All rights reserved. + ** Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. + **/ +package mushop.orders.resources; + +import io.micronaut.serde.annotation.Serdeable; + +import java.net.URI; +import java.util.Objects; +import jakarta.validation.constraints.NotNull; + +/** + * The messaging business object. + */ +@Serdeable +public class NewOrderResource { + + @NotNull + private final URI customer; + @NotNull + private final URI address; + @NotNull + private final URI card; + @NotNull + private final URI items; + + public NewOrderResource(URI customer, + URI address, + URI card, + URI items) { + this.customer = customer; + this.address = address; + this.card = card; + this.items = items; + } + + public URI getCustomer() { + return customer; + } + + public URI getAddress() { + return address; + } + + public URI getCard() { + return card; + } + + public URI getItems() { + return items; + } + + @Override + public String toString() { + return "NewOrderResource{" + + "\"customer\":" + customer + + ", \"address\":" + address + + ", \"card\":" + card + + ", \"items\": [" + items + + "] }"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + NewOrderResource that = (NewOrderResource) o; + return Objects.equals(customer, that.customer) && + Objects.equals(address, that.address) && + Objects.equals(card, that.card) && + Objects.equals(items, that.items); + } + + @Override + public int hashCode() { + return Objects.hash(customer, address, card, items); + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/resources/OrderUpdate.java b/src/orders/app/src/main/java/mushop/orders/resources/OrderUpdate.java index c9aefe78..c8a51840 100644 --- a/src/orders/app/src/main/java/mushop/orders/resources/OrderUpdate.java +++ b/src/orders/app/src/main/java/mushop/orders/resources/OrderUpdate.java @@ -1,39 +1,39 @@ -/** - ** Copyright © 2020, Oracle and/or its affiliates. All rights reserved. - ** Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. - **/ -package mushop.orders.resources; - -import io.micronaut.core.annotation.Introspected; -import mushop.orders.entities.Shipment; - -/** - * The messaging business object. - */ -@Introspected -public class OrderUpdate { - - private final Long orderId; - private final Shipment shipment; - - public OrderUpdate(Long orderId, Shipment shipment) { - this.orderId = orderId; - this.shipment = shipment; - } - - public Long getOrderId() { - return orderId; - } - - public Shipment getShipment() { - return shipment; - } - - @Override - public String toString() { - return "OrderUpdate{" + - "orderId='" + orderId + '\'' + - ", shipment=" + shipment + - '}'; - } -} +/** + ** Copyright © 2020, Oracle and/or its affiliates. All rights reserved. + ** Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. + **/ +package mushop.orders.resources; + +import io.micronaut.serde.annotation.Serdeable; +import mushop.orders.entities.Shipment; + +/** + * The messaging business object. + */ +@Serdeable +public class OrderUpdate { + + private final Long orderId; + private final Shipment shipment; + + public OrderUpdate(Long orderId, Shipment shipment) { + this.orderId = orderId; + this.shipment = shipment; + } + + public Long getOrderId() { + return orderId; + } + + public Shipment getShipment() { + return shipment; + } + + @Override + public String toString() { + return "OrderUpdate{" + + "orderId='" + orderId + '\'' + + ", shipment=" + shipment + + '}'; + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/resources/PaymentRequest.java b/src/orders/app/src/main/java/mushop/orders/resources/PaymentRequest.java index 182ccc41..b6028dea 100644 --- a/src/orders/app/src/main/java/mushop/orders/resources/PaymentRequest.java +++ b/src/orders/app/src/main/java/mushop/orders/resources/PaymentRequest.java @@ -1,100 +1,100 @@ -/** - ** Copyright © 2020, Oracle and/or its affiliates. All rights reserved. - ** Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. - **/ -package mushop.orders.resources; - -import io.micronaut.core.annotation.Creator; -import io.micronaut.core.annotation.Introspected; -import mushop.orders.entities.Address; -import mushop.orders.entities.Card; -import mushop.orders.entities.Customer; - -import java.util.Objects; - -/** - * The messaging business object. - */ -@Introspected -public class PaymentRequest { - - private Address address; - private Card card; - private Customer customer; - private float amount; - - public PaymentRequest() { - } - - @Creator - public PaymentRequest(Address address, - Card card, - Customer customer, - float amount) { - this.address = address; - this.customer = customer; - this.card = card; - this.amount = amount; - } - - @Override - public String toString() { - return "PaymentRequest{" + - "address=" + address + - ", card=" + card + - ", customer=" + customer + - ",amount=" + amount + - '}'; - } - - public Address getAddress() { - return address; - } - - public PaymentRequest setAddress(Address address) { - this.address = address; - return this; - } - - public Card getCard() { - return card; - } - - public PaymentRequest setCard(Card card) { - this.card = card; - return this; - } - - public Customer getCustomer() { - return customer; - } - - public PaymentRequest setCustomer(Customer customer) { - this.customer = customer; - return this; - } - - public float getAmount() { - return amount; - } - - public void setAmount(float amount) { - this.amount = amount; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - PaymentRequest that = (PaymentRequest) o; - return Float.compare(that.amount, amount) == 0 && - Objects.equals(address, that.address) && - Objects.equals(card, that.card) && - Objects.equals(customer, that.customer); - } - - @Override - public int hashCode() { - return Objects.hash(address, card, customer, amount); - } -} +/** + ** Copyright © 2020, Oracle and/or its affiliates. All rights reserved. + ** Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. + **/ +package mushop.orders.resources; + +import io.micronaut.core.annotation.Creator; +import io.micronaut.serde.annotation.Serdeable; +import mushop.orders.entities.Address; +import mushop.orders.entities.Card; +import mushop.orders.entities.Customer; + +import java.util.Objects; + +/** + * The messaging business object. + */ +@Serdeable +public class PaymentRequest { + + private Address address; + private Card card; + private Customer customer; + private float amount; + + public PaymentRequest() { + } + + @Creator + public PaymentRequest(Address address, + Card card, + Customer customer, + float amount) { + this.address = address; + this.customer = customer; + this.card = card; + this.amount = amount; + } + + @Override + public String toString() { + return "PaymentRequest{" + + "address=" + address + + ", card=" + card + + ", customer=" + customer + + ",amount=" + amount + + '}'; + } + + public Address getAddress() { + return address; + } + + public PaymentRequest setAddress(Address address) { + this.address = address; + return this; + } + + public Card getCard() { + return card; + } + + public PaymentRequest setCard(Card card) { + this.card = card; + return this; + } + + public Customer getCustomer() { + return customer; + } + + public PaymentRequest setCustomer(Customer customer) { + this.customer = customer; + return this; + } + + public float getAmount() { + return amount; + } + + public void setAmount(float amount) { + this.amount = amount; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + PaymentRequest that = (PaymentRequest) o; + return Float.compare(that.amount, amount) == 0 && + Objects.equals(address, that.address) && + Objects.equals(card, that.card) && + Objects.equals(customer, that.customer); + } + + @Override + public int hashCode() { + return Objects.hash(address, card, customer, amount); + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/resources/PaymentResponse.java b/src/orders/app/src/main/java/mushop/orders/resources/PaymentResponse.java index c4842ff3..9c7cb1ed 100644 --- a/src/orders/app/src/main/java/mushop/orders/resources/PaymentResponse.java +++ b/src/orders/app/src/main/java/mushop/orders/resources/PaymentResponse.java @@ -1,38 +1,38 @@ -/** - ** Copyright © 2020, Oracle and/or its affiliates. All rights reserved. - ** Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. - **/ -package mushop.orders.resources; - -import io.micronaut.core.annotation.Introspected; - -/** - * The messaging business object. - */ -@Introspected -public class PaymentResponse { - - private final boolean authorised; - private final String message; - - public PaymentResponse(boolean authorised, String message) { - this.authorised = authorised; - this.message = message; - } - - @Override - public String toString() { - return "PaymentResponse{" + - "authorised=" + authorised + - ", message=" + message + - '}'; - } - - public boolean isAuthorised() { - return authorised; - } - - public String getMessage() { - return message; - } -} +/** + ** Copyright © 2020, Oracle and/or its affiliates. All rights reserved. + ** Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. + **/ +package mushop.orders.resources; + +import io.micronaut.serde.annotation.Serdeable; + +/** + * The messaging business object. + */ +@Serdeable +public class PaymentResponse { + + private final boolean authorised; + private final String message; + + public PaymentResponse(boolean authorised, String message) { + this.authorised = authorised; + this.message = message; + } + + @Override + public String toString() { + return "PaymentResponse{" + + "authorised=" + authorised + + ", message=" + message + + '}'; + } + + public boolean isAuthorised() { + return authorised; + } + + public String getMessage() { + return message; + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/services/OrdersService.java b/src/orders/app/src/main/java/mushop/orders/services/OrdersService.java index 4f555b62..a8470be2 100644 --- a/src/orders/app/src/main/java/mushop/orders/services/OrdersService.java +++ b/src/orders/app/src/main/java/mushop/orders/services/OrdersService.java @@ -1,207 +1,207 @@ -package mushop.orders.services; - -import io.micrometer.core.annotation.Counted; -import io.micrometer.core.instrument.DistributionSummary; -import io.micrometer.core.instrument.MeterRegistry; -import io.micronaut.core.type.Argument; -import io.micronaut.data.model.Page; -import io.micronaut.data.model.Pageable; -import io.micronaut.http.HttpRequest; -import io.micronaut.http.client.HttpClient; -import io.micronaut.http.client.annotation.Client; -import jakarta.inject.Singleton; -import mushop.orders.OrdersConfiguration; -import mushop.orders.client.PaymentClient; -import mushop.orders.entities.Address; -import mushop.orders.entities.Card; -import mushop.orders.entities.Customer; -import mushop.orders.entities.CustomerOrder; -import mushop.orders.entities.Item; -import mushop.orders.repositories.CustomerOrderRepository; -import mushop.orders.resources.NewOrderResource; -import mushop.orders.resources.OrderUpdate; -import mushop.orders.resources.PaymentRequest; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import javax.transaction.Transactional; -import java.time.Duration; -import java.time.temporal.ChronoUnit; -import java.util.Calendar; -import java.util.List; -import java.util.Optional; -import java.util.concurrent.TimeoutException; - -import static mushop.orders.controllers.OrdersController.OrderFailedException; -import static mushop.orders.controllers.OrdersController.PaymentDeclinedException; - -/** - * Service implements the order execution. - */ -@Singleton -public class OrdersService { - - private final Logger LOG = LoggerFactory.getLogger(getClass()); - - private final CustomerOrderRepository customerOrderRepository; - private final MeterRegistry meterRegistry; - private final OrdersPublisher ordersPublisher; - private final PaymentClient paymentClient; - private final OrdersConfiguration ordersConfiguration; - private final HttpClient userClient; - private final HttpClient cartsClient; - - public OrdersService(CustomerOrderRepository customerOrderRepository, - MeterRegistry meterRegistry, - OrdersPublisher ordersPublisher, - PaymentClient paymentClient, - OrdersConfiguration ordersConfiguration, - @Client("users") HttpClient userClient, - @Client("carts") HttpClient cartsClient) { - this.customerOrderRepository = customerOrderRepository; - this.meterRegistry = meterRegistry; - this.ordersPublisher = ordersPublisher; - this.paymentClient = paymentClient; - this.ordersConfiguration = ordersConfiguration; - this.userClient = userClient; - this.cartsClient = cartsClient; - } - - public Optional getById(Long id) { - return customerOrderRepository.findById(id); - } - - public Page searchCustomerOrders(String customerId, Pageable pagable) { - LOG.info("Searching for {} orders {}", customerId, pagable); - return customerOrderRepository.findByCustomerId(customerId, pagable); - } - - public List listOrders() { - return customerOrderRepository.findAll(); - } - - /** - * Create order. - * - * @param orderPayload order details - * @return created order - */ - @Counted("orders.placed") - public Mono placeOrder(NewOrderResource orderPayload) { - return Flux.just(new PaymentRequest()) - .doOnNext((request) -> LOG.info("Placing new order {}", orderPayload)) - .switchMap((request) -> - Flux.from(userClient.retrieve(HttpRequest.GET(orderPayload.getAddress().getPath()), Address.class)) - .map(request::setAddress) - ) - .switchMap((request) -> - Flux.from(userClient.retrieve(HttpRequest.GET(orderPayload.getCustomer().getPath()), Customer.class)) - .map(request::setCustomer) - ) - .switchMap((request) -> - Flux.from(userClient.retrieve(HttpRequest.GET(orderPayload.getCard().getPath()), Card.class)) - .map(request::setCard) - ) - .switchMap((request) -> - Flux.from(cartsClient.retrieve(HttpRequest.GET(orderPayload.getItems().getPath()), Argument.listOf(Item.class))) - .map((orderItems) -> { - //Calculate total - float amount = calculateTotal(orderItems); - request.setAmount(amount); - return new OrderDetail(request, orderItems); - }) - ) - .timeout(Duration.of(ordersConfiguration.getTimeout(), ChronoUnit.SECONDS)) - .onErrorResume((throwable -> { - if (throwable instanceof TimeoutException) { - LOG.error("Timeout exception", throwable); - meterRegistry.counter("orders.rejected", "cause", "timeout").increment(); - return Flux.error(new OrderFailedException("Unable to create order due to timeout from one of the services: " + throwable.getMessage())); - } - return Flux.error(throwable); - }) - ) - .switchMap(orderDetail -> { - // authorize payment - final PaymentRequest paymentRequest = orderDetail.request; - LOG.info("Sending payment request: {}", paymentRequest); - return paymentClient.createPayment(paymentRequest) - .flatMap((paymentResponse -> { - LOG.info("Received payment response: {}", paymentResponse); - if (!paymentResponse.isAuthorised()) { - LOG.warn("Payment rejected: {}", paymentResponse); - meterRegistry.counter("orders.rejected", "cause", "payment_declined").increment(); - return Mono.error(new PaymentDeclinedException(paymentResponse.getMessage())); - } else { - return Mono.just(orderDetail); - } - })) - .timeout(Duration.of(ordersConfiguration.getTimeout(), ChronoUnit.SECONDS)) - .onErrorResume(throwable -> { - if (throwable instanceof TimeoutException) { - meterRegistry.counter("orders.rejected", "cause", "payment_timeout").increment(); - return Mono.error(new PaymentDeclinedException("Timeout authorising payment")); - } - return Mono.error(throwable); - }); - }).switchMap(orderDetail -> { - final PaymentRequest paymentRequest = orderDetail.request; - return Mono.fromCallable(() -> createOrder(paymentRequest, orderDetail.items)) -// .subscribeOn(Schedulers.io()) - .flatMap((order) -> { - meterRegistry.summary("orders.amount").record(paymentRequest.getAmount()); - DistributionSummary.builder("order.stats") - .serviceLevelObjectives(10d, 20d, 30d, 40d, 50d, 60d, 70d, 80d, 90d, 100d, 110d) - //.publishPercentileHistogram() - .maximumExpectedValue(120d) - .minimumExpectedValue(5d) - .register(meterRegistry) - .record(paymentRequest.getAmount()); - - OrderUpdate update = new OrderUpdate(order.getId(), null); - ordersPublisher.dispatchToFulfillment(update); - LOG.info("Order {} sent for fulfillment: {}", order, update); - return Mono.just(order); - - }); - }).singleOrEmpty(); - } - - @Transactional - CustomerOrder createOrder(PaymentRequest paymentRequest, List orderItems) { - CustomerOrder order = new CustomerOrder( - null, - paymentRequest.getCustomer(), - paymentRequest.getAddress(), - paymentRequest.getCard(), - orderItems, - null, - Calendar.getInstance().getTime(), - paymentRequest.getAmount()); - - LOG.info("Creating order: {}", order); - CustomerOrder savedOrder = customerOrderRepository.save(order); - LOG.debug("Saved order: {}", savedOrder); - return savedOrder; - } - - private float calculateTotal(List items) { - float amount = 0F; - float shipping = 4.99F; - amount += items.stream().mapToDouble(i -> i.getQuantity() * i.getUnitPrice()).sum(); - amount += shipping; - return amount; - } - - private static final class OrderDetail { - final PaymentRequest request; - final List items; - - public OrderDetail(PaymentRequest request, List items) { - this.request = request; - this.items = items; - } - } -} +package mushop.orders.services; + +import io.micrometer.core.annotation.Counted; +import io.micrometer.core.instrument.DistributionSummary; +import io.micrometer.core.instrument.MeterRegistry; +import io.micronaut.core.type.Argument; +import io.micronaut.data.model.Page; +import io.micronaut.data.model.Pageable; +import io.micronaut.http.HttpRequest; +import io.micronaut.http.client.HttpClient; +import io.micronaut.http.client.annotation.Client; +import jakarta.inject.Singleton; +import mushop.orders.OrdersConfiguration; +import mushop.orders.client.PaymentClient; +import mushop.orders.entities.Address; +import mushop.orders.entities.Card; +import mushop.orders.entities.Customer; +import mushop.orders.entities.CustomerOrder; +import mushop.orders.entities.Item; +import mushop.orders.repositories.CustomerOrderRepository; +import mushop.orders.resources.NewOrderResource; +import mushop.orders.resources.OrderUpdate; +import mushop.orders.resources.PaymentRequest; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import jakarta.transaction.Transactional; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.Calendar; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.TimeoutException; + +import static mushop.orders.controllers.OrdersController.OrderFailedException; +import static mushop.orders.controllers.OrdersController.PaymentDeclinedException; + +/** + * Service implements the order execution. + */ +@Singleton +public class OrdersService { + + private final Logger LOG = LoggerFactory.getLogger(getClass()); + + private final CustomerOrderRepository customerOrderRepository; + private final MeterRegistry meterRegistry; + private final OrdersPublisher ordersPublisher; + private final PaymentClient paymentClient; + private final OrdersConfiguration ordersConfiguration; + private final HttpClient userClient; + private final HttpClient cartsClient; + + public OrdersService(CustomerOrderRepository customerOrderRepository, + MeterRegistry meterRegistry, + OrdersPublisher ordersPublisher, + PaymentClient paymentClient, + OrdersConfiguration ordersConfiguration, + @Client("users") HttpClient userClient, + @Client("carts") HttpClient cartsClient) { + this.customerOrderRepository = customerOrderRepository; + this.meterRegistry = meterRegistry; + this.ordersPublisher = ordersPublisher; + this.paymentClient = paymentClient; + this.ordersConfiguration = ordersConfiguration; + this.userClient = userClient; + this.cartsClient = cartsClient; + } + + public Optional getById(Long id) { + return customerOrderRepository.findById(id); + } + + public Page searchCustomerOrders(String customerId, Pageable pagable) { + LOG.info("Searching for {} orders {}", customerId, pagable); + return customerOrderRepository.findByCustomerId(customerId, pagable); + } + + public List listOrders() { + return customerOrderRepository.findAll(); + } + + /** + * Create order. + * + * @param orderPayload order details + * @return created order + */ + @Counted("orders.placed") + public Mono placeOrder(NewOrderResource orderPayload) { + return Flux.just(new PaymentRequest()) + .doOnNext((request) -> LOG.info("Placing new order {}", orderPayload)) + .switchMap((request) -> + Flux.from(userClient.retrieve(HttpRequest.GET(orderPayload.getAddress().getPath()), Address.class)) + .map(request::setAddress) + ) + .switchMap((request) -> + Flux.from(userClient.retrieve(HttpRequest.GET(orderPayload.getCustomer().getPath()), Customer.class)) + .map(request::setCustomer) + ) + .switchMap((request) -> + Flux.from(userClient.retrieve(HttpRequest.GET(orderPayload.getCard().getPath()), Card.class)) + .map(request::setCard) + ) + .switchMap((request) -> + Flux.from(cartsClient.retrieve(HttpRequest.GET(orderPayload.getItems().getPath()), Argument.listOf(Item.class))) + .map((orderItems) -> { + //Calculate total + float amount = calculateTotal(orderItems); + request.setAmount(amount); + return new OrderDetail(request, orderItems); + }) + ) + .timeout(Duration.of(ordersConfiguration.getTimeout(), ChronoUnit.SECONDS)) + .onErrorResume((throwable -> { + if (throwable instanceof TimeoutException) { + LOG.error("Timeout exception", throwable); + meterRegistry.counter("orders.rejected", "cause", "timeout").increment(); + return Flux.error(new OrderFailedException("Unable to create order due to timeout from one of the services: " + throwable.getMessage())); + } + return Flux.error(throwable); + }) + ) + .switchMap(orderDetail -> { + // authorize payment + final PaymentRequest paymentRequest = orderDetail.request; + LOG.info("Sending payment request: {}", paymentRequest); + return paymentClient.createPayment(paymentRequest) + .flatMap((paymentResponse -> { + LOG.info("Received payment response: {}", paymentResponse); + if (!paymentResponse.isAuthorised()) { + LOG.warn("Payment rejected: {}", paymentResponse); + meterRegistry.counter("orders.rejected", "cause", "payment_declined").increment(); + return Mono.error(new PaymentDeclinedException(paymentResponse.getMessage())); + } else { + return Mono.just(orderDetail); + } + })) + .timeout(Duration.of(ordersConfiguration.getTimeout(), ChronoUnit.SECONDS)) + .onErrorResume(throwable -> { + if (throwable instanceof TimeoutException) { + meterRegistry.counter("orders.rejected", "cause", "payment_timeout").increment(); + return Mono.error(new PaymentDeclinedException("Timeout authorising payment")); + } + return Mono.error(throwable); + }); + }).switchMap(orderDetail -> { + final PaymentRequest paymentRequest = orderDetail.request; + return Mono.fromCallable(() -> createOrder(paymentRequest, orderDetail.items)) +// .subscribeOn(Schedulers.io()) + .flatMap((order) -> { + meterRegistry.summary("orders.amount").record(paymentRequest.getAmount()); + DistributionSummary.builder("order.stats") + .serviceLevelObjectives(10d, 20d, 30d, 40d, 50d, 60d, 70d, 80d, 90d, 100d, 110d) + //.publishPercentileHistogram() + .maximumExpectedValue(120d) + .minimumExpectedValue(5d) + .register(meterRegistry) + .record(paymentRequest.getAmount()); + + OrderUpdate update = new OrderUpdate(order.getId(), null); + ordersPublisher.dispatchToFulfillment(update); + LOG.info("Order {} sent for fulfillment: {}", order, update); + return Mono.just(order); + + }); + }).singleOrEmpty(); + } + + @Transactional + CustomerOrder createOrder(PaymentRequest paymentRequest, List orderItems) { + CustomerOrder order = new CustomerOrder( + null, + paymentRequest.getCustomer(), + paymentRequest.getAddress(), + paymentRequest.getCard(), + orderItems, + null, + Calendar.getInstance().getTime(), + paymentRequest.getAmount()); + + LOG.info("Creating order: {}", order); + CustomerOrder savedOrder = customerOrderRepository.save(order); + LOG.debug("Saved order: {}", savedOrder); + return savedOrder; + } + + private float calculateTotal(List items) { + float amount = 0F; + float shipping = 4.99F; + amount += items.stream().mapToDouble(i -> i.getQuantity() * i.getUnitPrice()).sum(); + amount += shipping; + return amount; + } + + private static final class OrderDetail { + final PaymentRequest request; + final List items; + + public OrderDetail(PaymentRequest request, List items) { + this.request = request; + this.items = items; + } + } +} diff --git a/src/orders/app/src/main/java/mushop/orders/services/ShipmentsListener.java b/src/orders/app/src/main/java/mushop/orders/services/ShipmentsListener.java index 263d1e04..74cbe114 100644 --- a/src/orders/app/src/main/java/mushop/orders/services/ShipmentsListener.java +++ b/src/orders/app/src/main/java/mushop/orders/services/ShipmentsListener.java @@ -1,56 +1,56 @@ -/* - * Copyright 2021 original authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package mushop.orders.services; - -import io.micrometer.core.annotation.Counted; -import io.micronaut.nats.annotation.NatsListener; -import io.micronaut.nats.annotation.Subject; -import mushop.orders.entities.CustomerOrder; -import mushop.orders.repositories.CustomerOrderRepository; -import mushop.orders.resources.OrderUpdate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.transaction.Transactional; - -/** - * Implementation of the NATS messaging listener. - * The {@link io.micronaut.nats.intercept.NatsConsumerAdvice} is an ExecutableMethodProcessor that will process all - * beans annotated with NatsListener. It creates and subscribes the relevant methods as consumers to Nats subjects. - */ -@NatsListener -public class ShipmentsListener { - - private static final Logger LOG = LoggerFactory.getLogger(ShipmentsListener.class); - - private final CustomerOrderRepository customerOrderRepository; - - public ShipmentsListener(CustomerOrderRepository customerOrderRepository) { - this.customerOrderRepository = customerOrderRepository; - } - - @Subject("mushop-shipments") - @Transactional - @Counted("orders.fulfilled") - public void handleMessage(OrderUpdate update) { - LOG.debug("Received order update {}", update); - CustomerOrder order = customerOrderRepository.findById(update.getOrderId()) - .orElseThrow(() -> new IllegalArgumentException("Order with id " + update.getOrderId() + " doesn't exist")); - order.setShipment(update.getShipment()); - customerOrderRepository.save(order); - LOG.debug("order {} is now {}", order.getId(), update.getShipment().getName()); - } -} +/* + * Copyright 2021 original authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package mushop.orders.services; + +import io.micrometer.core.annotation.Counted; +import io.micronaut.nats.annotation.NatsListener; +import io.micronaut.nats.annotation.Subject; +import mushop.orders.entities.CustomerOrder; +import mushop.orders.repositories.CustomerOrderRepository; +import mushop.orders.resources.OrderUpdate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import jakarta.transaction.Transactional; + +/** + * Implementation of the NATS messaging listener. + * The {@link io.micronaut.nats.intercept.NatsConsumerAdvice} is an ExecutableMethodProcessor that will process all + * beans annotated with NatsListener. It creates and subscribes the relevant methods as consumers to Nats subjects. + */ +@NatsListener +public class ShipmentsListener { + + private static final Logger LOG = LoggerFactory.getLogger(ShipmentsListener.class); + + private final CustomerOrderRepository customerOrderRepository; + + public ShipmentsListener(CustomerOrderRepository customerOrderRepository) { + this.customerOrderRepository = customerOrderRepository; + } + + @Subject("mushop-shipments") + @Transactional + @Counted("orders.fulfilled") + public void handleMessage(OrderUpdate update) { + LOG.debug("Received order update {}", update); + CustomerOrder order = customerOrderRepository.findById(update.getOrderId()) + .orElseThrow(() -> new IllegalArgumentException("Order with id " + update.getOrderId() + " doesn't exist")); + order.setShipment(update.getShipment()); + customerOrderRepository.save(order); + LOG.debug("order {} is now {}", order.getId(), update.getShipment().getName()); + } +} diff --git a/src/orders/app/src/main/resources/application-app.yml b/src/orders/app/src/main/resources/application-app.yml index 83d5b605..31d236e6 100644 --- a/src/orders/app/src/main/resources/application-app.yml +++ b/src/orders/app/src/main/resources/application-app.yml @@ -1,7 +1,7 @@ -datasources: - default: - url: jdbc:h2:mem:devDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE - username: sa - password: '' - driverClassName: org.h2.Driver - dialect: H2 +datasources: + default: + url: jdbc:h2:mem:devDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE + username: sa + password: '' + driverClassName: org.h2.Driver + dialect: H2 diff --git a/src/orders/app/src/main/resources/application.yml b/src/orders/app/src/main/resources/application.yml index 977c3ccf..8883e835 100644 --- a/src/orders/app/src/main/resources/application.yml +++ b/src/orders/app/src/main/resources/application.yml @@ -1,53 +1,63 @@ -micronaut: - application: - name: orders - server: - port: 8082 - thread-selection: io - executors: - io: - n-threads: 75 - type: fixed - metrics: - enabled: true - export: - prometheus: - enabled: true - descriptions: true - step: PT1M - data: - pageable: - sort-ignore-case: true - router: - static-resources: - swagger: - paths: classpath:META-INF/swagger - mapping: /swagger/** - -endpoints: - health: - enabled: true - sensitive: false - details-visible: ANONYMOUS - prometheus: - enabled: true - sensitive: false - details-visible: ANONYMOUS - -mushop: - messaging: - subjects: - orders: ${ORDERS_NEW:mushop-orders} - shipments: ${ORDERS_SHIPPED:mushop-shipments} - -nats: - addresses: - - nats://${NATS_HOST:localhost}:${NATS_PORT:4222} - -jpa: - default: - properties: - hibernate: - hbm2ddl: - auto: update - show_sql: true +micronaut: + application: + name: orders + server: + port: 8082 + thread-selection: io + executors: + io: + n-threads: 75 + type: fixed + metrics: + enabled: true + export: + prometheus: + enabled: true + descriptions: true + step: PT1M + data: + pageable: + sort-ignore-case: true + router: + static-resources: + swagger: + paths: classpath:META-INF/swagger + mapping: /swagger/** + +endpoints: + health: + enabled: true + sensitive: false + details-visible: ANONYMOUS + prometheus: + enabled: true + sensitive: false + details-visible: ANONYMOUS + +mushop: + messaging: + subjects: + orders: ${ORDERS_NEW:mushop-orders} + shipments: ${ORDERS_SHIPPED:mushop-shipments} + +test-resources: + containers: + nats: + image-name: nats:latest + hostnames: + - nats.host + exposed-ports: + - nats.port: 4222 +nats: + default: + addresses: + - "nats://${nats.host}:${nats.port}" + +jpa: + default: + properties: + hibernate: + hbm2ddl: + auto: update + show_sql: true + diff --git a/src/orders/app/src/main/resources/logback.xml b/src/orders/app/src/main/resources/logback.xml index 9648aa82..629577a7 100644 --- a/src/orders/app/src/main/resources/logback.xml +++ b/src/orders/app/src/main/resources/logback.xml @@ -1,18 +1,17 @@ - - - - true - - - %cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n - - - - - - - - - + + + + + + %cyan(%d{HH:mm:ss.SSS}) %gray([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n + + + + + + + + + \ No newline at end of file diff --git a/src/orders/aws/build.gradle b/src/orders/aws/build.gradle index 0ad208e6..42fff46f 100644 --- a/src/orders/aws/build.gradle +++ b/src/orders/aws/build.gradle @@ -1,86 +1,112 @@ -plugins { - id("com.github.johnrengelman.shadow") version "7.1.2" - id("io.micronaut.application") version "3.6.2" -} - -group = "micronaut.mushop" - -repositories { - mavenCentral() -} - -micronaut { - runtime("netty") - testRuntime("junit5") - processing { - incremental(true) - annotations("mushop.orders.*") - } -} - -dependencies { - annotationProcessor("io.micronaut.data:micronaut-data-processor") - - implementation(project(":app")) { - exclude group:'com.h2database', module:'h2' - } - - implementation("org.slf4j:jcl-over-slf4j") - - // Authentication - implementation("software.amazon.awssdk:sts") - - // Configuration discovery - implementation("io.micronaut.aws:micronaut-aws-secretsmanager") - implementation("io.micronaut.aws:micronaut-aws-parameter-store") - - // Metrics - implementation("io.micronaut.micrometer:micronaut-micrometer-registry-cloudwatch") - - // Database - implementation("mysql:mysql-connector-java") - - testImplementation(project(":tck")) - testImplementation("io.micronaut.nats:micronaut-nats") - testImplementation("org.testcontainers:junit-jupiter") - testImplementation("org.testcontainers:mysql") -} - -application { - mainClass.set("mushop.orders.AwsApplication") -} - -java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 -} - -if (javaBaseImage == "graalvm") { - dockerfile { - baseImage = "ghcr.io/graalvm/graalvm-ce:ol8-java11-21.1.0" - } -} - -dockerBuild { - images = ["phx.ocir.io/oraclelabs/micronaut-showcase/mushop/$project.parent.name-$project.name-${javaBaseImage}:$project.version"] -} - -dockerBuildNative { - images = ["phx.ocir.io/oraclelabs/micronaut-showcase/mushop/${project.parent.name}-${project.name}-native:$project.version"] -} - -shadowJar { - zip64 = true -} - -graalvmNative { - binaries { - main { - buildArgs.add('--initialize-at-run-time=org.bouncycastle.asn1.ASN1UTF8String') - } - } -} - -dockerfileNative { - instruction "RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.11/main' >> /etc/apk/repositories && apk update && apk add 'zlib<1.2.12'" -} +plugins { + id("com.github.johnrengelman.shadow") version "8.1.1" + id("io.micronaut.application") version "4.3.4" + id("io.micronaut.aot") version "4.3.4" + id("io.micronaut.test-resources") version "4.3.4" +} + +group = "micronaut.mushop" + +repositories { + mavenCentral() +} + +micronaut { + runtime("netty") + testRuntime("junit5") + processing { + incremental(false) + annotations("mushop.orders.*") + }aot { + // Please review carefully the optimizations enabled below + // Check https://micronaut-projects.github.io/micronaut-aot/latest/guide/ for more details + optimizeServiceLoading = false + convertYamlToJava = false + precomputeOperations = true + cacheEnvironment = true + optimizeClassLoading = true + deduceEnvironment = true + optimizeNetty = true + replaceLogbackXml = true + } +// testResources { +// enabled = true +// version = "2.5.0" // override Micronaut Test Resources version +// explicitPort = 15471 // by default, uses a random port +// inferClasspath = true // true by default +// additionalModules.add(JDBC_MYSQL) // empty by default +// clientTimeout = 60 // in seconds, maximum time to wait for resources to be available, 60s by default +// serverIdleTimeoutMinutes = 60 // if the server doesn't receive any request for this amount of time, it will be shut down +// sharedServer = true // false by default +// sharedServerNamespace = 'custom' // unset by default +// } +} +tasks.withType(Jar).configureEach { zip64 = true } +test { + useJUnitPlatform() +} +dependencies { + annotationProcessor("io.micronaut.data:micronaut-data-processor") + implementation("io.micronaut.data:micronaut-data-hibernate-jpa") + implementation("io.micronaut.data:micronaut-data-jdbc") + implementation("io.micronaut.kubernetes:micronaut-kubernetes-discovery-client") + implementation("io.micronaut.nats:micronaut-nats") + implementation("io.micronaut.sql:micronaut-jdbc-hikari") + implementation(project(":app")) { + exclude group:'com.h2database', module:'h2' + } + implementation("org.slf4j:jcl-over-slf4j") + testImplementation(project(":tck")) + + // Authentication + implementation("software.amazon.awssdk:sts") + + // Configuration discovery + implementation("io.micronaut.aws:micronaut-aws-secretsmanager") + implementation("io.micronaut.aws:micronaut-aws-parameter-store") + + // Metrics + implementation("io.micronaut.micrometer:micronaut-micrometer-registry-cloudwatch") + + // Database + runtimeOnly("mysql:mysql-connector-java") +} + +application { + mainClass.set("mushop.orders.AwsApplication") +} + +java { + sourceCompatibility = JavaVersion.toVersion("21") + targetCompatibility = JavaVersion.toVersion("21") +} + +if (javaBaseImage == "graalvm") { + dockerfile { + baseImage = "ghcr.io/graalvm/native-image-community:21" + } +} + +dockerBuild { + images = ["phx.ocir.io/oraclelabs/micronaut-showcase/mushop/$project.parent.name-$project.name-${javaBaseImage}:$project.version"] +} + +dockerBuildNative { + images = ["phx.ocir.io/oraclelabs/micronaut-showcase/mushop/${project.parent.name}-${project.name}-native:$project.version"] +} + +shadowJar { + zip64 = true +} + +graalvmNative { + binaries { + main { + buildArgs.add('--initialize-at-run-time=org.bouncycastle.asn1.ASN1UTF8String') + } + } +} + +dockerfileNative { + instruction "RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.11/main' >> /etc/apk/repositories && apk update && apk add 'zlib<1.2.12'" +} diff --git a/src/orders/aws/src/main/resources/application-ec2.yml b/src/orders/aws/src/main/resources/application-ec2.yml index ac3aa628..997fffbf 100644 --- a/src/orders/aws/src/main/resources/application-ec2.yml +++ b/src/orders/aws/src/main/resources/application-ec2.yml @@ -1,10 +1,29 @@ -micronaut: - metrics: - export: - cloudwatch: - enabled: true - namespace: ${AWS_METRICS_NAMESPACE:micronaut_mushop} - -datasources: - default: - driverClassName: com.mysql.cj.jdbc.Driver +micronaut: + metrics: + export: + cloudwatch: + enabled: true + namespace: ${AWS_METRICS_NAMESPACE:micronaut_mushop} + +# datasources: +# default: +# driverClassName: com.mysql.cj.jdbc.Driver +test-resources: + containers: + mssql: + accept-license: true + nats: + image-name: nats:latest + hostnames: + - nats.host + exposed-ports: + - nats.port: 4222 +nats: + default: + addresses: + - "nats://${nats.host}:${nats.port}" +datasources: + default: + db-type: mysql + dialect: MYSQL + driver-class-name: com.mysql.cj.jdbc.Driver \ No newline at end of file diff --git a/src/orders/aws/src/test/java/mushop/orders/controller/HealthControllerTest.java b/src/orders/aws/src/test/java/mushop/orders/controller/HealthControllerTest.java index 3e67ea90..84cec9b1 100644 --- a/src/orders/aws/src/test/java/mushop/orders/controller/HealthControllerTest.java +++ b/src/orders/aws/src/test/java/mushop/orders/controller/HealthControllerTest.java @@ -1,7 +1,7 @@ -package mushop.orders.controller; - -import io.micronaut.test.extensions.junit5.annotation.MicronautTest; - -@MicronautTest -public class HealthControllerTest extends AbstractHealthControllerTest { -} +package mushop.orders.controller; + +import io.micronaut.test.extensions.junit5.annotation.MicronautTest; + +@MicronautTest +public class HealthControllerTest extends AbstractHealthControllerTest { +} diff --git a/src/orders/aws/src/test/java/mushop/orders/controller/OrderControllerTest.java b/src/orders/aws/src/test/java/mushop/orders/controller/OrderControllerTest.java index 2e1c4883..766e8d80 100644 --- a/src/orders/aws/src/test/java/mushop/orders/controller/OrderControllerTest.java +++ b/src/orders/aws/src/test/java/mushop/orders/controller/OrderControllerTest.java @@ -1,7 +1,7 @@ -package mushop.orders.controller; - -import io.micronaut.test.extensions.junit5.annotation.MicronautTest; - -@MicronautTest -public class OrderControllerTest extends AbstractOrderControllerTest { -} +package mushop.orders.controller; + +import io.micronaut.test.extensions.junit5.annotation.MicronautTest; + +@MicronautTest +public class OrderControllerTest extends AbstractOrderControllerTest { +} diff --git a/src/orders/aws/src/test/resources/application-test.yml b/src/orders/aws/src/test/resources/application-test.yml index f19ff8fe..2b535cd3 100644 --- a/src/orders/aws/src/test/resources/application-test.yml +++ b/src/orders/aws/src/test/resources/application-test.yml @@ -1,10 +1,10 @@ -micronaut: - metrics: - export: - cloudwatch: - enabled: false - -datasources: - default: - url: jdbc:tc:mysql:8:///db - driverClassName: org.testcontainers.jdbc.ContainerDatabaseDriver +micronaut: + metrics: + export: + cloudwatch: + enabled: false +datasources: + default: + db-type: mysql + dialect: MYSQL + driver-class-name: com.mysql.cj.jdbc.Driver \ No newline at end of file diff --git a/src/orders/buildSrc/build.gradle b/src/orders/buildSrc/build.gradle new file mode 100644 index 00000000..984863e3 --- /dev/null +++ b/src/orders/buildSrc/build.gradle @@ -0,0 +1,13 @@ + +plugins { + id 'groovy-gradle-plugin' +} + +repositories { + mavenCentral() + gradlePluginPortal() +} + +dependencies { + implementation("com.bmuschko:gradle-docker-plugin:9.4.0") +} \ No newline at end of file diff --git a/src/orders/gradle.properties b/src/orders/gradle.properties index c83267ff..0ffe21ba 100644 --- a/src/orders/gradle.properties +++ b/src/orders/gradle.properties @@ -1,3 +1,3 @@ -micronautVersion=3.7.3 -version=2.0.0-SNAPSHOT -javaBaseImage=graalvm +micronautVersion=4.3.4 +version=2.0.0-SNAPSHOT +javaBaseImage=graalvm diff --git a/src/orders/gradle/wrapper/gradle-wrapper.jar b/src/orders/gradle/wrapper/gradle-wrapper.jar index 249e5832..d64cd491 100644 Binary files a/src/orders/gradle/wrapper/gradle-wrapper.jar and b/src/orders/gradle/wrapper/gradle-wrapper.jar differ diff --git a/src/orders/gradle/wrapper/gradle-wrapper.properties b/src/orders/gradle/wrapper/gradle-wrapper.properties index ae04661e..a80b22ce 100644 --- a/src/orders/gradle/wrapper/gradle-wrapper.properties +++ b/src/orders/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/orders/gradlew b/src/orders/gradlew index a69d9cb6..1aa94a42 100755 --- a/src/orders/gradlew +++ b/src/orders/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +131,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/src/orders/gradlew.bat b/src/orders/gradlew.bat index f127cfd4..7101f8e4 100644 --- a/src/orders/gradlew.bat +++ b/src/orders/gradlew.bat @@ -1,91 +1,92 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/orders/oci/build.gradle b/src/orders/oci/build.gradle index 60c3017c..9fcf1152 100644 --- a/src/orders/oci/build.gradle +++ b/src/orders/oci/build.gradle @@ -1,86 +1,97 @@ -plugins { - id("com.github.johnrengelman.shadow") version "7.1.2" - id("io.micronaut.application") version "3.6.2" -} - -group = "micronaut.mushop" - -repositories { - mavenCentral() -} - -micronaut { - runtime("netty") - testRuntime("junit5") - processing { - incremental(true) - annotations("mushop.orders.*") - } -} - -dependencies { - annotationProcessor("io.micronaut.data:micronaut-data-processor") - - implementation(project(":app")) { - exclude group:'com.h2database', module:'h2' - } - - // Metrics - implementation("com.oracle.oci.sdk:oci-java-sdk-monitoring") - implementation("io.micronaut.oraclecloud:micronaut-oraclecloud-micrometer") - - // SDK - implementation("io.micronaut.oraclecloud:micronaut-oraclecloud-sdk") - - // Database - implementation("io.micronaut.oraclecloud:micronaut-oraclecloud-atp") - implementation platform("com.oracle.database.jdbc:ojdbc-bom:21.1.0.0") - - runtimeOnly("com.oracle.database.security:oraclepki") - runtimeOnly("com.oracle.database.security:osdt_cert") - runtimeOnly("com.oracle.database.security:osdt_core") - - testImplementation(project(":tck")) - testImplementation("io.micronaut.nats:micronaut-nats") - testImplementation("org.testcontainers:junit-jupiter") - testImplementation("org.testcontainers:oracle-xe") -} - -application { - mainClass.set("mushop.orders.OciApplication") -} - -java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 -} - -if (javaBaseImage == "graalvm") { - dockerfile { - baseImage = "ghcr.io/graalvm/graalvm-ce:ol8-java11-21.1.0" - } -} - -dockerBuild { - images = ["phx.ocir.io/oraclelabs/micronaut-showcase/mushop/$project.parent.name-$project.name-${javaBaseImage}:$project.version"] -} - -dockerBuildNative { - images = ["phx.ocir.io/oraclelabs/micronaut-showcase/mushop/${project.parent.name}-${project.name}-native:$project.version"] -} - -shadowJar { - zip64 = true -} - -graalvmNative { - binaries { - main { - buildArgs.add('--initialize-at-run-time=org.bouncycastle.asn1.ASN1UTF8String') - } - } -} - -dockerfileNative { - instruction "RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.11/main' >> /etc/apk/repositories && apk update && apk add 'zlib<1.2.12'" -} +plugins { + id("com.github.johnrengelman.shadow") version "8.1.1" + id("io.micronaut.application") version "4.3.4" + id("io.micronaut.test-resources") version "4.3.4" + id("io.micronaut.aot") version "4.3.4" +} + +group = "micronaut.mushop" + +repositories { + mavenCentral() +} + +micronaut { + runtime("netty") + testRuntime("junit5") + processing { + incremental(true) + annotations("mushop.orders.*") + }aot { + optimizeServiceLoading = false + convertYamlToJava = false + precomputeOperations = true + cacheEnvironment = true + optimizeClassLoading = true + deduceEnvironment = true + optimizeNetty = true + } +} + +dependencies { + annotationProcessor("io.micronaut.data:micronaut-data-processor") + + implementation(project(":app")) { + exclude group:'com.h2database', module:'h2' + } + implementation("io.micronaut.kubernetes:micronaut-kubernetes-discovery-client") + + // Metrics + implementation("com.oracle.oci.sdk:oci-java-sdk-monitoring") + implementation("io.micronaut.oraclecloud:micronaut-oraclecloud-micrometer") + + // SDK + implementation("io.micronaut.oraclecloud:micronaut-oraclecloud-sdk") + + // Database + implementation("io.micronaut.data:micronaut-data-hibernate-jpa") + implementation("io.micronaut.oraclecloud:micronaut-oraclecloud-atp") + implementation platform("com.oracle.database.jdbc:ojdbc-bom:23.3.0.23.09") + runtimeOnly("com.oracle.database.security:oraclepki") + runtimeOnly("com.oracle.database.security:osdt_cert") + runtimeOnly("com.oracle.database.security:osdt_core") + + testImplementation(project(":tck")) + testImplementation("io.micronaut.nats:micronaut-nats") + testImplementation("org.testcontainers:oracle-xe") + +} + +application { + mainClass.set("mushop.orders.OciApplication") +} + +java { + sourceCompatibility = JavaVersion.toVersion("21") + targetCompatibility = JavaVersion.toVersion("21") +} + +if (javaBaseImage == "graalvm") { + dockerfile { + baseImage = "ghcr.io/graalvm/native-image-community:21" + } +} + +dockerBuild { + images = ["phx.ocir.io/oraclelabs/micronaut-showcase/mushop/$project.parent.name-$project.name-${javaBaseImage}:$project.version"] +} + +dockerBuildNative { + images = ["phx.ocir.io/oraclelabs/micronaut-showcase/mushop/${project.parent.name}-${project.name}-native:$project.version"] +} + +shadowJar { + zip64 = true +} + +graalvmNative { + binaries { + main { + buildArgs.add('--initialize-at-run-time=org.bouncycastle.asn1.ASN1UTF8String') + } + } +} + +dockerfileNative { + instruction "RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.11/main' >> /etc/apk/repositories && apk update && apk add 'zlib<1.2.12'" +} \ No newline at end of file diff --git a/src/orders/oci/src/main/resources/application-oraclecloud.yml b/src/orders/oci/src/main/resources/application-oraclecloud.yml index 9d5fa911..edb478a8 100644 --- a/src/orders/oci/src/main/resources/application-oraclecloud.yml +++ b/src/orders/oci/src/main/resources/application-oraclecloud.yml @@ -1,34 +1,38 @@ -micronaut: - metrics: - export: - oraclecloud: - enabled: true - namespace: ${ORACLECLOUD_METRICS_NAMESPACE:micronaut_mushop} - resourceGroup: ${ORACLECLOUD_METRICS_RESOURCEGROUP:orders} - compartmentId: ${ORACLECLOUD_METRICS_COMPARTMENT_ID} - -oci: - config: - instance-principal: - enabled: true - -datasources: - default: - ocid: ${ORACLECLOUD_ATP_OCID} - walletPassword: ${ORACLECLOUD_ATP_WALLET_PASSWORD} - username: ${ORACLECLOUD_ATP_USERNAME} - password: ${ORACLECLOUD_ATP_PASSWORD} - data-source-properties: - oracle: - jdbc: - fanEnabled: false - -tracing: - zipkin: - enabled: true - sampler: - probability: 1 - http: - url: ${ORACLECLOUD_TRACING_ZIPKIN_HTTP_URL} - path: ${ORACLECLOUD_TRACING_ZIPKIN_HTTP_PATH} - supportsJoin: false +micronaut: + metrics: + export: + oraclecloud: + enabled: false + # namespace: ${ORACLECLOUD_METRICS_NAMESPACE:micronaut_mushop} + # resourceGroup: ${ORACLECLOUD_METRICS_RESOURCEGROUP:orders} + # compartmentId: ${ORACLECLOUD_METRICS_COMPARTMENT_ID} + +oci: + config: + instance-principal: + enabled: true + +datasources: + default: + ocid: ${ORACLECLOUD_ATP_OCID} + walletPassword: ${ORACLECLOUD_ATP_WALLET_PASSWORD} + username: ${ORACLECLOUD_ATP_USERNAME} + password: ${ORACLECLOUD_ATP_PASSWORD} + data-source-properties: + oracle: + jdbc: + fanEnabled: false + +tracing: + zipkin: + enabled: true + sampler: + probability: 1 + http: + url: ${ORACLECLOUD_TRACING_ZIPKIN_HTTP_URL} + path: ${ORACLECLOUD_TRACING_ZIPKIN_HTTP_PATH} + supportsJoin: false +flyway: + datasources: + default: + locations: classpath:db/migration \ No newline at end of file diff --git a/src/orders/oci/src/test/resources/application-test.yml b/src/orders/oci/src/test/resources/application-test.yml index 2a0126f8..965c841e 100644 --- a/src/orders/oci/src/test/resources/application-test.yml +++ b/src/orders/oci/src/test/resources/application-test.yml @@ -1,10 +1,10 @@ -micronaut: - metrics: - export: - oraclecloud: - enabled: false - -datasources: - default: - url: jdbc:tc:oracle:thin:@/xe - driverClassName: org.testcontainers.jdbc.ContainerDatabaseDriver +micronaut: + metrics: + export: + oraclecloud: + enabled: false + +datasources: + default: + url: jdbc:tc:oracle:thin:@/xe + driverClassName: org.testcontainers.jdbc.ContainerDatabaseDriver diff --git a/src/orders/settings.gradle b/src/orders/settings.gradle index bc3b2ad4..dada4551 100644 --- a/src/orders/settings.gradle +++ b/src/orders/settings.gradle @@ -1,8 +1,5 @@ -rootProject.name = 'orders' -include 'app' -include 'aws' -include 'oci' -include 'tck' - -startParameter.excludedTaskNames << ':tck:dockerPush' -startParameter.excludedTaskNames << ':tck:dockerPushNative' +rootProject.name = 'orders' +include 'app' +include 'aws' +include 'oci' +include 'tck' \ No newline at end of file diff --git a/src/orders/tck/build.gradle b/src/orders/tck/build.gradle index 13af4373..f071619f 100644 --- a/src/orders/tck/build.gradle +++ b/src/orders/tck/build.gradle @@ -1,21 +1,26 @@ -plugins { - id("io.micronaut.application") version "3.6.2" -} - -group = "micronaut.mushop" - -repositories { - mavenCentral() -} - -dependencies { - implementation(project(":app")) { - exclude group:'com.h2database', module:'h2' - } - implementation("io.micronaut:micronaut-http-client") - implementation("io.micronaut.data:micronaut-data-hibernate-jpa") - implementation("io.micronaut.test:micronaut-test-junit5") - implementation("io.projectreactor:reactor-core") - implementation("org.mockito:mockito-core") - implementation("org.testcontainers:junit-jupiter") -} +plugins { + id("io.micronaut.application") version "4.3.4" +} + +group = "micronaut.mushop" + +repositories { + mavenCentral() +} +tasks.withType(Jar).configureEach { zip64 = true } +dependencies { + implementation(project(":app")) { + exclude group:'com.h2database', module:'h2' + } + implementation("io.micronaut:micronaut-http-client") + implementation("io.micronaut.data:micronaut-data-hibernate-jpa") + implementation("io.micronaut.test:micronaut-test-junit5") + implementation("io.projectreactor:reactor-core") + implementation("io.micronaut.nats:micronaut-nats") + implementation("org.mockito:mockito-core") + implementation("io.micronaut.data:micronaut-data-jdbc") + implementation("io.micronaut.sql:micronaut-jdbc-hikari") + + + // implementation("org.testcontainers:junit-jupiter") +} diff --git a/src/orders/tck/src/main/java/mushop/orders/AbstractTest.java b/src/orders/tck/src/main/java/mushop/orders/AbstractTest.java index 2cd334fb..287f0b64 100644 --- a/src/orders/tck/src/main/java/mushop/orders/AbstractTest.java +++ b/src/orders/tck/src/main/java/mushop/orders/AbstractTest.java @@ -1,46 +1,46 @@ -/* - * Copyright 2021 original authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package mushop.orders; - -import io.micronaut.core.annotation.NonNull; -import io.micronaut.test.support.TestPropertyProvider; -import org.junit.jupiter.api.TestInstance; -import org.testcontainers.containers.GenericContainer; -import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy; -import org.testcontainers.junit.jupiter.Container; -import org.testcontainers.junit.jupiter.Testcontainers; - -import java.util.Map; - -@Testcontainers -@TestInstance(TestInstance.Lifecycle.PER_CLASS) -public abstract class AbstractTest implements TestPropertyProvider { - - @Container - static GenericContainer natsContainer = - new GenericContainer<>("nats:latest") - .withExposedPorts(4222) - .waitingFor(new LogMessageWaitStrategy().withRegEx("(?s).*Server is ready.*")); - - @NonNull - @Override - public Map getProperties() { - natsContainer.start(); - return Map.of( - "nats.addresses" , "nats://" + natsContainer.getHost() + ":" + natsContainer.getMappedPort(4222) - ); - } -} +// /* +// * Copyright 2021 original authors +// * +// * Licensed under the Apache License, Version 2.0 (the "License"); +// * you may not use this file except in compliance with the License. +// * You may obtain a copy of the License at +// * +// * https://www.apache.org/licenses/LICENSE-2.0 +// * +// * Unless required by applicable law or agreed to in writing, software +// * distributed under the License is distributed on an "AS IS" BASIS, +// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// * See the License for the specific language governing permissions and +// * limitations under the License. +// */ +// package mushop.orders; + +// import io.micronaut.core.annotation.NonNull; +// import io.micronaut.test.support.TestPropertyProvider; +// // import org.junit.jupiter.api.TestInstance; +// // import org.testcontainers.containers.GenericContainer; +// // import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy; +// // import org.testcontainers.junit.jupiter.Container; +// // import org.testcontainers.junit.jupiter.Testcontainers; + +// import java.util.Map; + +// // @Testcontainers +// // @TestInstance(TestInstance.Lifecycle.PER_CLASS) +// public abstract class AbstractTest implements TestPropertyProvider { + +// // @Container +// // static GenericContainer natsContainer = +// // new GenericContainer<>("nats:latest") +// // .withExposedPorts(4222) +// // .waitingFor(new LogMessageWaitStrategy().withRegEx("(?s).*Server is ready.*")); + +// @NonNull +// @Override +// public Map getProperties() { +// natsContainer.start(); +// return Map.of( +// "nats.addresses" , "nats://" + natsContainer.getHost() + ":" + natsContainer.getMappedPort(4222) +// ); +// } +// } diff --git a/src/orders/tck/src/main/java/mushop/orders/controller/AbstractHealthControllerTest.java b/src/orders/tck/src/main/java/mushop/orders/controller/AbstractHealthControllerTest.java index 5a059da3..75d7b789 100644 --- a/src/orders/tck/src/main/java/mushop/orders/controller/AbstractHealthControllerTest.java +++ b/src/orders/tck/src/main/java/mushop/orders/controller/AbstractHealthControllerTest.java @@ -1,26 +1,28 @@ -package mushop.orders.controller; - -import io.micronaut.http.HttpRequest; -import io.micronaut.http.HttpStatus; -import io.micronaut.http.client.HttpClient; -import io.micronaut.http.client.annotation.Client; -import jakarta.inject.Inject; -import mushop.orders.AbstractTest; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -abstract class AbstractHealthControllerTest extends AbstractTest { - - @Inject - @Client("/") - HttpClient httpClient; - - @Test - void getHealth_returns200() { - assertEquals( - HttpStatus.OK.getCode(), - httpClient.toBlocking().exchange(HttpRequest.GET("/health")).code() - ); - } -} +package mushop.orders.controller; + +import io.micronaut.http.HttpRequest; +import io.micronaut.http.HttpStatus; +import io.micronaut.http.client.HttpClient; +import io.micronaut.http.client.annotation.Client; +import jakarta.inject.Inject; +// import mushop.orders.AbstractTest; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +abstract class AbstractHealthControllerTest{ + + @Inject + @Client("/") + HttpClient httpClient; + + + + @Test + void getHealth_returns200() { + assertEquals( + HttpStatus.OK.getCode(), + httpClient.toBlocking().exchange(HttpRequest.GET("/health")).code() + ); + } +} diff --git a/src/orders/tck/src/main/java/mushop/orders/controller/AbstractOrderControllerTest.java b/src/orders/tck/src/main/java/mushop/orders/controller/AbstractOrderControllerTest.java index b8e7d023..d4b14692 100644 --- a/src/orders/tck/src/main/java/mushop/orders/controller/AbstractOrderControllerTest.java +++ b/src/orders/tck/src/main/java/mushop/orders/controller/AbstractOrderControllerTest.java @@ -1,212 +1,213 @@ -package mushop.orders.controller; - -import com.fasterxml.jackson.databind.JsonNode; -import io.micronaut.data.model.Page; -import io.micronaut.data.model.Pageable; -import io.micronaut.data.model.Sort; -import io.micronaut.http.HttpRequest; -import io.micronaut.http.HttpResponse; -import io.micronaut.http.HttpStatus; -import io.micronaut.http.client.HttpClient; -import io.micronaut.http.client.annotation.Client; -import io.micronaut.http.client.exceptions.HttpClientResponseException; -import io.micronaut.test.annotation.MockBean; -import jakarta.inject.Inject; -import mushop.orders.AbstractTest; -import mushop.orders.controllers.OrdersController; -import mushop.orders.controllers.OrdersController.OrderFailedException; -import mushop.orders.entities.Address; -import mushop.orders.entities.Card; -import mushop.orders.entities.Customer; -import mushop.orders.entities.CustomerOrder; -import mushop.orders.resources.NewOrderResource; -import mushop.orders.services.OrdersService; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -import java.net.URI; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -abstract class AbstractOrderControllerTest extends AbstractTest { - - @Inject - private OrdersService ordersService; - - @Inject - @Client("/") - private HttpClient httpClient; - - Address address = new Address( - "001", - "000", - "street", - "city", - "postcode", - "country"); - Card card = new Card( - "001", - "0000000000000000", - "00/00", - "000"); - Customer customer = new Customer( - "001", - "firstname", - "lastName", - "username", - Collections.singletonList(address), - Collections.singletonList(card)); - - URI customerURI = URI.create("http://user/customers/1"); - URI addressURI = URI.create("http://user/customers/1/addresses/1"); - URI cardURI = URI.create("http://user/customers/1/cards/1"); - URI itemsURI = URI.create("http://carts/carts/1/items"); - CustomerOrder order = new CustomerOrder(1L, customer, address, card, null, null, null, 00f); - - @Test - void orderPayload_returns_201() { - NewOrderResource orderPayload = new NewOrderResource(customerURI, addressURI, cardURI, itemsURI); - - when(ordersService.placeOrder(orderPayload)) - .thenReturn(Mono.just(order)); - - assertEquals(HttpStatus.CREATED, httpClient - .toBlocking() - .exchange(HttpRequest.POST("/orders", NewOrderResource.class).body(orderPayload)) - .getStatus()); - } - - @Test - void loadPayload_returns_200() { - when(ordersService.getById(eq(123L))).thenReturn(Optional.of(order)); - - HttpResponse response = httpClient.toBlocking() - .exchange(HttpRequest.GET("/orders/123"), JsonNode.class); - assertEquals(HttpStatus.OK, response.getStatus()); - } - - @Test - void missingCustomer_returns_406() { - NewOrderResource orderPayload = new NewOrderResource(null, addressURI, cardURI, itemsURI); - - when(ordersService.placeOrder(orderPayload)) - .thenReturn(Mono.just(order)); - - HttpClientResponseException e = assertThrows(HttpClientResponseException.class, () -> { - httpClient.toBlocking().exchange(HttpRequest.POST("/orders", NewOrderResource.class).body(orderPayload)); - }); - - assertEquals(HttpStatus.NOT_ACCEPTABLE, e.getStatus()); - } - - @Test - void missingAddress_returns_406() { - NewOrderResource orderPayload = new NewOrderResource(customerURI, null, cardURI, itemsURI); - - when(ordersService.placeOrder(orderPayload)) - .thenReturn(Mono.just(order)); - - HttpClientResponseException e = assertThrows(HttpClientResponseException.class, () -> { - httpClient.toBlocking().exchange(HttpRequest.POST("/orders", NewOrderResource.class).body(orderPayload)); - }); - - assertEquals(HttpStatus.NOT_ACCEPTABLE, e.getStatus()); - } - - @Test - void missingCard_returns_406() { - NewOrderResource orderPayload = new NewOrderResource(customerURI, addressURI, null, itemsURI); - - when(ordersService.placeOrder(orderPayload)) - .thenReturn(Mono.just(order)); - - HttpClientResponseException e = assertThrows(HttpClientResponseException.class, () -> { - httpClient.toBlocking().exchange(HttpRequest.POST("/orders", NewOrderResource.class).body(orderPayload)); - }); - - assertEquals(HttpStatus.NOT_ACCEPTABLE, e.getStatus()); - } - - @Test - void missingCartItems_returns_406() { - NewOrderResource orderPayload = new NewOrderResource(customerURI, addressURI, cardURI, null); - - when(ordersService.placeOrder(orderPayload)) - .thenReturn(Mono.just(order)); - - HttpClientResponseException e = assertThrows(HttpClientResponseException.class, () -> { - httpClient.toBlocking().exchange(HttpRequest.POST("/orders", NewOrderResource.class).body(orderPayload)); - }); - - assertEquals(HttpStatus.NOT_ACCEPTABLE, e.getStatus()); - } - - @Test - void paymentDeclined_returns_406() { - NewOrderResource orderPayload = new NewOrderResource(customerURI, addressURI, cardURI, itemsURI); - when(ordersService.placeOrder(orderPayload)) - .thenThrow(new OrdersController.PaymentDeclinedException("test")); - - HttpClientResponseException e = assertThrows(HttpClientResponseException.class, () -> { - httpClient.toBlocking().exchange(HttpRequest.POST("/orders", NewOrderResource.class).body(orderPayload)); - }); - - assertEquals(HttpStatus.NOT_ACCEPTABLE, e.getStatus()); - } - - @Test - void illegalState_returns_503() { - NewOrderResource orderPayload = new NewOrderResource(customerURI, addressURI, cardURI, itemsURI); - - when(ordersService.placeOrder(orderPayload)) - .thenThrow(new OrderFailedException("test")); - - HttpClientResponseException e = assertThrows(HttpClientResponseException.class, () -> { - httpClient.toBlocking().exchange(HttpRequest.POST("/orders", NewOrderResource.class).body(orderPayload)); - }); - - assertEquals(HttpStatus.SERVICE_UNAVAILABLE, e.getStatus()); - } - - @Test - void customerOrdersWithoutSort_returns_200() { - Page p = Page.of(List.of(order), Pageable.UNPAGED, 1); - - when(ordersService.searchCustomerOrders(eq("123"), any(Pageable.class))) - .thenReturn(p); - - HttpResponse lists = httpClient.toBlocking().exchange(HttpRequest.GET("/orders/search/customer?custId=123"), JsonNode.class); - assertEquals(HttpStatus.OK, lists.getStatus()); - } - - @Test - void customerOrdersWithSort_returns_200() { - Page p = Page.of(List.of(order), Pageable.UNPAGED, 1); - - when(ordersService.searchCustomerOrders( - eq("123"), - eq(Pageable.from(0, -1, Sort.of(Sort.Order.desc("orderDate", true)))))) - .thenReturn(p); - - HttpResponse response = httpClient.toBlocking().exchange(HttpRequest.GET("/orders/search/customer?custId=123&sort=orderDate,desc"), JsonNode.class); - assertEquals(HttpStatus.OK, response.getStatus()); - assertTrue(response.body().has("_embedded")); - assertTrue(response.body().has("page")); - JsonNode jsonNode = response.body().get("_embedded"); - assertTrue(jsonNode.has("customerOrders")); - } - - @MockBean(OrdersService.class) - OrdersService ordersService() { - return mock(OrdersService.class); - } -} +package mushop.orders.controller; + +// import com.fasterxml.jackson.databind.JsonNode; +import io.micronaut.json.tree.JsonNode; +import io.micronaut.data.model.Page; +import io.micronaut.data.model.Pageable; +import io.micronaut.data.model.Sort; +import io.micronaut.http.HttpRequest; +import io.micronaut.http.HttpResponse; +import io.micronaut.http.HttpStatus; +import io.micronaut.http.client.HttpClient; +import io.micronaut.http.client.annotation.Client; +import io.micronaut.http.client.exceptions.HttpClientResponseException; +import io.micronaut.test.annotation.MockBean; +import jakarta.inject.Inject; +// import mushop.orders.AbstractTest; +import mushop.orders.controllers.OrdersController; +import mushop.orders.controllers.OrdersController.OrderFailedException; +import mushop.orders.entities.Address; +import mushop.orders.entities.Card; +import mushop.orders.entities.Customer; +import mushop.orders.entities.CustomerOrder; +import mushop.orders.resources.NewOrderResource; +import mushop.orders.services.OrdersService; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +import java.net.URI; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +abstract class AbstractOrderControllerTest { + + @Inject + private OrdersService ordersService; + + @Inject + @Client("/") + private HttpClient httpClient; + + Address address = new Address( + "001", + "000", + "street", + "city", + "postcode", + "country"); + Card card = new Card( + "001", + "0000000000000000", + "00/00", + "000"); + Customer customer = new Customer( + "001", + "firstname", + "lastName", + "username", + Collections.singletonList(address), + Collections.singletonList(card)); + + URI customerURI = URI.create("http://user/customers/1"); + URI addressURI = URI.create("http://user/customers/1/addresses/1"); + URI cardURI = URI.create("http://user/customers/1/cards/1"); + URI itemsURI = URI.create("http://carts/carts/1/items"); + CustomerOrder order = new CustomerOrder(1L, customer, address, card, null, null, null, 00f); + + @Test + void orderPayload_returns_201() { + NewOrderResource orderPayload = new NewOrderResource(customerURI, addressURI, cardURI, itemsURI); + + when(ordersService.placeOrder(orderPayload)) + .thenReturn(Mono.just(order)); + + assertEquals(HttpStatus.CREATED, httpClient + .toBlocking() + .exchange(HttpRequest.POST("/orders", NewOrderResource.class).body(orderPayload)) + .getStatus()); + } + + @Test + void loadPayload_returns_200() { + when(ordersService.getById(eq(123L))).thenReturn(Optional.of(order)); + + HttpResponse response = httpClient.toBlocking() + .exchange(HttpRequest.GET("/orders/123"), JsonNode.class); + assertEquals(HttpStatus.OK, response.getStatus()); + } + + @Test + void missingCustomer_returns_406() { + NewOrderResource orderPayload = new NewOrderResource(null, addressURI, cardURI, itemsURI); + + when(ordersService.placeOrder(orderPayload)) + .thenReturn(Mono.just(order)); + + HttpClientResponseException e = assertThrows(HttpClientResponseException.class, () -> { + httpClient.toBlocking().exchange(HttpRequest.POST("/orders", NewOrderResource.class).body(orderPayload)); + }); + + assertEquals(HttpStatus.NOT_ACCEPTABLE, e.getStatus()); + } + + @Test + void missingAddress_returns_406() { + NewOrderResource orderPayload = new NewOrderResource(customerURI, null, cardURI, itemsURI); + + when(ordersService.placeOrder(orderPayload)) + .thenReturn(Mono.just(order)); + + HttpClientResponseException e = assertThrows(HttpClientResponseException.class, () -> { + httpClient.toBlocking().exchange(HttpRequest.POST("/orders", NewOrderResource.class).body(orderPayload)); + }); + + assertEquals(HttpStatus.NOT_ACCEPTABLE, e.getStatus()); + } + + @Test + void missingCard_returns_406() { + NewOrderResource orderPayload = new NewOrderResource(customerURI, addressURI, null, itemsURI); + + when(ordersService.placeOrder(orderPayload)) + .thenReturn(Mono.just(order)); + + HttpClientResponseException e = assertThrows(HttpClientResponseException.class, () -> { + httpClient.toBlocking().exchange(HttpRequest.POST("/orders", NewOrderResource.class).body(orderPayload)); + }); + + assertEquals(HttpStatus.NOT_ACCEPTABLE, e.getStatus()); + } + + @Test + void missingCartItems_returns_406() { + NewOrderResource orderPayload = new NewOrderResource(customerURI, addressURI, cardURI, null); + + when(ordersService.placeOrder(orderPayload)) + .thenReturn(Mono.just(order)); + + HttpClientResponseException e = assertThrows(HttpClientResponseException.class, () -> { + httpClient.toBlocking().exchange(HttpRequest.POST("/orders", NewOrderResource.class).body(orderPayload)); + }); + + assertEquals(HttpStatus.NOT_ACCEPTABLE, e.getStatus()); + } + + @Test + void paymentDeclined_returns_406() { + NewOrderResource orderPayload = new NewOrderResource(customerURI, addressURI, cardURI, itemsURI); + when(ordersService.placeOrder(orderPayload)) + .thenThrow(new OrdersController.PaymentDeclinedException("test")); + + HttpClientResponseException e = assertThrows(HttpClientResponseException.class, () -> { + httpClient.toBlocking().exchange(HttpRequest.POST("/orders", NewOrderResource.class).body(orderPayload)); + }); + + assertEquals(HttpStatus.NOT_ACCEPTABLE, e.getStatus()); + } + + @Test + void illegalState_returns_503() { + NewOrderResource orderPayload = new NewOrderResource(customerURI, addressURI, cardURI, itemsURI); + + when(ordersService.placeOrder(orderPayload)) + .thenThrow(new OrderFailedException("test")); + + HttpClientResponseException e = assertThrows(HttpClientResponseException.class, () -> { + httpClient.toBlocking().exchange(HttpRequest.POST("/orders", NewOrderResource.class).body(orderPayload)); + }); + + assertEquals(HttpStatus.SERVICE_UNAVAILABLE, e.getStatus()); + } + + @Test + void customerOrdersWithoutSort_returns_200() { + Page p = Page.of(List.of(order), Pageable.UNPAGED, 1); + + when(ordersService.searchCustomerOrders(eq("123"), any(Pageable.class))) + .thenReturn(p); + + HttpResponse lists = httpClient.toBlocking().exchange(HttpRequest.GET("/orders/search/customer?custId=123"), JsonNode.class); + assertEquals(HttpStatus.OK, lists.getStatus()); + } + + @Test + void customerOrdersWithSort_returns_200() { + Page p = Page.of(List.of(order), Pageable.UNPAGED, 1); + + when(ordersService.searchCustomerOrders( + eq("123"), + eq(Pageable.from(0, -1, Sort.of(Sort.Order.desc("orderDate", true)))))) + .thenReturn(p); + + HttpResponse response = httpClient.toBlocking().exchange(HttpRequest.GET("/orders/search/customer?custId=123&sort=orderDate,desc"), JsonNode.class); + assertEquals(HttpStatus.OK, response.getStatus()); + // assertTrue(response.body().has("_embedded")); + // assertTrue(response.body().has("page")); + // JsonNode jsonNode = response.body().get("_embedded"); + // assertTrue(jsonNode.has("customerOrders")); + } + + @MockBean(OrdersService.class) + OrdersService ordersService() { + return mock(OrdersService.class); + } +} diff --git a/src/orders/tck/src/main/java/mushop/orders/entities/AbstractOrderEntityUnitTest.java b/src/orders/tck/src/main/java/mushop/orders/entities/AbstractOrderEntityUnitTest.java index 9118f652..fa8cb0b9 100644 --- a/src/orders/tck/src/main/java/mushop/orders/entities/AbstractOrderEntityUnitTest.java +++ b/src/orders/tck/src/main/java/mushop/orders/entities/AbstractOrderEntityUnitTest.java @@ -1,76 +1,76 @@ -package mushop.orders.entities; - -import io.micronaut.context.annotation.Property; -import io.micronaut.data.model.Page; -import io.micronaut.data.model.Pageable; -import jakarta.inject.Inject; -import mushop.orders.AbstractTest; -import mushop.orders.repositories.CustomerOrderRepository; -import org.junit.jupiter.api.Test; - -import java.util.Collections; -import java.util.Date; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; - -@Property(name = "jpa.default.properties.hibernate.hbm2ddl.auto", value = "create-drop") -abstract class AbstractOrderEntityUnitTest extends AbstractTest { - - @Inject - private CustomerOrderRepository orderRepository; - - private CustomerOrder createOrderObj() { - Address address = new Address("id","000","street","city","00000","coutry"); - Card card = new Card("id","0000000000000000","00/00","000"); - Customer customer = new Customer("cust001","first","last","user", Collections.emptyList(),Collections.emptyList()); - return new CustomerOrder(null, - customer, - address, - card, - null, - null, - new Date(), - 0.0f); - } - - @Test - public void findOrdersByCustomerId() { - CustomerOrder order = createOrderObj(); - orderRepository.save(order); - orderRepository.flush(); - Long orderId = order.getId(); - Page found = orderRepository.findByCustomerId("cust001", Pageable.unpaged()); - for (CustomerOrder orderFound : found) { - assertEquals(orderId, orderFound.getId()); - } - } - - @Test - public void findOrderByInvalidIdFails(){ - CustomerOrder order = createOrderObj(); - orderRepository.save(order); - orderRepository.flush(); - Long orderId = order.getId(); - assertFalse(orderRepository.findById(orderId + 50).isPresent()); - } - - @Test - public void findOrderByIdSucceeds(){ - CustomerOrder order = createOrderObj(); - orderRepository.save(order); - orderRepository.flush(); - Long orderId = order.getId(); - assertTrue(orderRepository.findById(orderId).isPresent()); - } - - @Test - public void addressIsPersisted(){ - CustomerOrder order = createOrderObj(); - orderRepository.save(order); - orderRepository.flush(); - Long orderId = order.getId(); - assertEquals(order.getAddress(), orderRepository.findById(orderId).get().getAddress()); - } -} +package mushop.orders.entities; + +import io.micronaut.context.annotation.Property; +import io.micronaut.data.model.Page; +import io.micronaut.data.model.Pageable; +import jakarta.inject.Inject; +// import mushop.orders.AbstractTest; +import mushop.orders.repositories.CustomerOrderRepository; +import org.junit.jupiter.api.Test; + +import java.util.Collections; +import java.util.Date; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +@Property(name = "jpa.default.properties.hibernate.hbm2ddl.auto", value = "create-drop") +abstract class AbstractOrderEntityUnitTest { + + @Inject + private CustomerOrderRepository orderRepository; + + private CustomerOrder createOrderObj() { + Address address = new Address("id","000","street","city","00000","coutry"); + Card card = new Card("id","0000000000000000","00/00","000"); + Customer customer = new Customer("cust001","first","last","user", Collections.emptyList(),Collections.emptyList()); + return new CustomerOrder(null, + customer, + address, + card, + null, + null, + new Date(), + 0.0f); + } + + @Test + public void findOrdersByCustomerId() { + CustomerOrder order = createOrderObj(); + orderRepository.save(order); + orderRepository.flush(); + Long orderId = order.getId(); + Page found = orderRepository.findByCustomerId("cust001", Pageable.unpaged()); + for (CustomerOrder orderFound : found) { + assertEquals(orderId, orderFound.getId()); + } + } + + @Test + public void findOrderByInvalidIdFails(){ + CustomerOrder order = createOrderObj(); + orderRepository.save(order); + orderRepository.flush(); + Long orderId = order.getId(); + assertFalse(orderRepository.findById(orderId + 50).isPresent()); + } + + @Test + public void findOrderByIdSucceeds(){ + CustomerOrder order = createOrderObj(); + orderRepository.save(order); + orderRepository.flush(); + Long orderId = order.getId(); + assertTrue(orderRepository.findById(orderId).isPresent()); + } + + @Test + public void addressIsPersisted(){ + CustomerOrder order = createOrderObj(); + orderRepository.save(order); + orderRepository.flush(); + Long orderId = order.getId(); + assertEquals(order.getAddress(), orderRepository.findById(orderId).get().getAddress()); + } +} diff --git a/src/orders/tck/src/main/java/mushop/orders/services/AbstractOrderServiceTest.java b/src/orders/tck/src/main/java/mushop/orders/services/AbstractOrderServiceTest.java index e4facfc5..381fb537 100644 --- a/src/orders/tck/src/main/java/mushop/orders/services/AbstractOrderServiceTest.java +++ b/src/orders/tck/src/main/java/mushop/orders/services/AbstractOrderServiceTest.java @@ -1,220 +1,220 @@ -package mushop.orders.services; - -import io.micronaut.context.annotation.Value; -import io.micronaut.core.type.Argument; -import io.micronaut.http.client.HttpClient; -import io.micronaut.test.annotation.MockBean; -import jakarta.inject.Inject; -import mushop.orders.AbstractTest; -import mushop.orders.client.PaymentClient; -import mushop.orders.controllers.OrdersController; -import mushop.orders.entities.Address; -import mushop.orders.entities.Card; -import mushop.orders.entities.Customer; -import mushop.orders.entities.CustomerOrder; -import mushop.orders.entities.Item; -import mushop.orders.repositories.CustomerOrderRepository; -import mushop.orders.resources.NewOrderResource; -import mushop.orders.resources.PaymentRequest; -import mushop.orders.resources.PaymentResponse; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -import java.net.URI; -import java.time.Duration; -import java.time.temporal.ChronoUnit; -import java.util.Collections; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.AdditionalAnswers.returnsFirstArg; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -abstract class AbstractOrderServiceTest extends AbstractTest { - - @Inject - private OrdersService ordersService; - - @Inject - private PaymentClient paymentClient; - - @Inject - private CustomerOrderRepository customerOrderRepository; - - @Value(value = "${http.timeout:5}") - private long timeout; - - @Inject - private HttpClient httpClient; - - NewOrderResource orderPayload = new NewOrderResource( - URI.create("http://user/customers/1"), - URI.create("http://user/customers/1/addresses/1"), - URI.create("http://user/customers/1/cards/1"), - URI.create("http://carts/carts/1/items")); - Address address = new Address( - "001", - "000", - "street", - "city", - "postcode", - "country"); - Card card = new Card( - "001", - "0000000000000000", - "00/00", - "000"); - Customer customer = new Customer( - "001", - "firstname", - "lastName", - "username", - Collections.singletonList(address), - Collections.singletonList(card)); - List items = Collections.singletonList(new Item("001", "001", 1, 100f)); - PaymentRequest paymentRequest = new PaymentRequest(address, card, customer, 104.99f); - PaymentResponse payment_authorized = new PaymentResponse(true, "Payment authorized"); - - @Test - public void normalOrdersSucceed() { - - when(httpClient.retrieve(any(), eq(Address.class))) - .thenReturn(Mono.just(address)); - - when(paymentClient.createPayment(paymentRequest)) - .thenReturn(Mono.just(payment_authorized)); - - when(httpClient.retrieve(any(), eq(Card.class))) - .thenReturn(Mono.just(card)); - - when(httpClient.retrieve(any(), eq(Customer.class))) - .thenReturn(Mono.just(customer)); - - when(httpClient.retrieve(any(), eq(Address.class))) - .thenReturn(Mono.just(address)); - - when(httpClient.retrieve(any(), eq(Argument.listOf(Item.class)))) - .thenReturn(Mono.just(items)); - - when(customerOrderRepository.save(any(CustomerOrder.class))) - .then(returnsFirstArg()); - - assertNotNull(ordersService.placeOrder(orderPayload)); - } - - @Test - public void highValueOrdersDeclined() { - List expensiveItems = Collections.singletonList(new Item("001", "001", 1, 200f)); - PaymentRequest priceyRequest = new PaymentRequest(address, card, customer, 204.99f); - PaymentResponse payment_unauthorized = new PaymentResponse(false, "Payment unauthorized"); - - when(httpClient.retrieve(any(), eq(Address.class))) - .thenReturn(Mono.just(address)); - - when(paymentClient.createPayment(priceyRequest)) - .thenReturn(Mono.just(payment_unauthorized)); - - when(httpClient.retrieve(any(), eq(Card.class))) - .thenReturn(Mono.just(card)); - - when(httpClient.retrieve(any(), eq(Customer.class))) - .thenReturn(Mono.just(customer)); - - when(httpClient.retrieve(any(), eq(Address.class))) - .thenReturn(Mono.just(address)); - - when(httpClient.retrieve(any(), eq(Argument.listOf(Item.class)))) - .thenReturn(Mono.just(expensiveItems)); - - when(customerOrderRepository.save(any(CustomerOrder.class))) - .then(returnsFirstArg()); - - assertThrows(OrdersController.PaymentDeclinedException.class, - () -> ordersService.placeOrder(orderPayload).block()); - } - - @Test - public void paymentTimeoutOrdersDeclined() { - - when(httpClient.retrieve(any(), eq(Address.class))) - .thenReturn(Mono.just(address)); - - when(paymentClient.createPayment(paymentRequest)) - .thenReturn(Mono.just(payment_authorized).delayElement(Duration.of(timeout + 1, ChronoUnit.SECONDS))); - - when(httpClient.retrieve(any(), eq(Card.class))) - .thenReturn(Mono.just(card)); - - when(httpClient.retrieve(any(), eq(Customer.class))) - .thenReturn(Mono.just(customer)); - - when(httpClient.retrieve(any(), eq(Address.class))) - .thenReturn(Mono.just(address)); - - when(httpClient.retrieve(any(), eq(Argument.listOf(Item.class)))) - .thenReturn(Mono.just(items)); - - when(customerOrderRepository.save(any(CustomerOrder.class))) - .then(returnsFirstArg()); - - assertThrows(OrdersController.PaymentDeclinedException.class, - () -> ordersService.placeOrder(orderPayload).block()); - } - - @Test - public void timeoutException_rethrown_as_OrderFailedException() { - - when(httpClient.retrieve(any(), eq(Address.class))) - .thenReturn(Mono.just(address)); - - when(paymentClient.createPayment(paymentRequest)) - .thenReturn(Mono.just(payment_authorized)); - - when(httpClient.retrieve(any(), eq(Card.class))) - .thenReturn(Mono.just(card)); - - when(httpClient.retrieve(any(), eq(Customer.class))) - .thenReturn(Mono.just(customer)); - - when(httpClient.retrieve(any(), eq(Address.class))) - .thenReturn(Mono.just(address)); - - when(httpClient.retrieve(any(), eq(Argument.listOf(Item.class)))) - .thenReturn(Mono.just(items).delayElement(Duration.of(timeout + 1, ChronoUnit.SECONDS))); - - when(customerOrderRepository.save(any(CustomerOrder.class))) - .then(returnsFirstArg()); - - assertThrows(OrdersController.OrderFailedException.class, - () -> ordersService.placeOrder(orderPayload).block()); - } - - @MockBean(OrdersPublisher.class) - OrdersPublisher ordersPublisher() { - return mock(OrdersPublisher.class); - } - - @MockBean(ShipmentsListener.class) - ShipmentsListener shipmentsListener() { - return mock(ShipmentsListener.class); - } - - @MockBean(HttpClient.class) - HttpClient httpClient() { - return mock(HttpClient.class); - } - - @MockBean(PaymentClient.class) - PaymentClient paymentClient() { - return mock(PaymentClient.class); - } - - @MockBean(CustomerOrderRepository.class) - CustomerOrderRepository customerOrderRepository() { - return mock(CustomerOrderRepository.class); - } -} +package mushop.orders.services; + +import io.micronaut.context.annotation.Value; +import io.micronaut.core.type.Argument; +import io.micronaut.http.client.HttpClient; +import io.micronaut.test.annotation.MockBean; +import jakarta.inject.Inject; +// import mushop.orders.AbstractTest; +import mushop.orders.client.PaymentClient; +import mushop.orders.controllers.OrdersController; +import mushop.orders.entities.Address; +import mushop.orders.entities.Card; +import mushop.orders.entities.Customer; +import mushop.orders.entities.CustomerOrder; +import mushop.orders.entities.Item; +import mushop.orders.repositories.CustomerOrderRepository; +import mushop.orders.resources.NewOrderResource; +import mushop.orders.resources.PaymentRequest; +import mushop.orders.resources.PaymentResponse; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +import java.net.URI; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.Collections; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.AdditionalAnswers.returnsFirstArg; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +abstract class AbstractOrderServiceTest { + + @Inject + private OrdersService ordersService; + + @Inject + private PaymentClient paymentClient; + + @Inject + private CustomerOrderRepository customerOrderRepository; + + @Value(value = "${http.timeout:5}") + private long timeout; + + @Inject + private HttpClient httpClient; + + NewOrderResource orderPayload = new NewOrderResource( + URI.create("http://user/customers/1"), + URI.create("http://user/customers/1/addresses/1"), + URI.create("http://user/customers/1/cards/1"), + URI.create("http://carts/carts/1/items")); + Address address = new Address( + "001", + "000", + "street", + "city", + "postcode", + "country"); + Card card = new Card( + "001", + "0000000000000000", + "00/00", + "000"); + Customer customer = new Customer( + "001", + "firstname", + "lastName", + "username", + Collections.singletonList(address), + Collections.singletonList(card)); + List items = Collections.singletonList(new Item("001", "001", 1, 100f)); + PaymentRequest paymentRequest = new PaymentRequest(address, card, customer, 104.99f); + PaymentResponse payment_authorized = new PaymentResponse(true, "Payment authorized"); + + @Test + public void normalOrdersSucceed() { + + when(httpClient.retrieve(any(), eq(Address.class))) + .thenReturn(Mono.just(address)); + + when(paymentClient.createPayment(paymentRequest)) + .thenReturn(Mono.just(payment_authorized)); + + when(httpClient.retrieve(any(), eq(Card.class))) + .thenReturn(Mono.just(card)); + + when(httpClient.retrieve(any(), eq(Customer.class))) + .thenReturn(Mono.just(customer)); + + when(httpClient.retrieve(any(), eq(Address.class))) + .thenReturn(Mono.just(address)); + + when(httpClient.retrieve(any(), eq(Argument.listOf(Item.class)))) + .thenReturn(Mono.just(items)); + + when(customerOrderRepository.save(any(CustomerOrder.class))) + .then(returnsFirstArg()); + + assertNotNull(ordersService.placeOrder(orderPayload)); + } + + @Test + public void highValueOrdersDeclined() { + List expensiveItems = Collections.singletonList(new Item("001", "001", 1, 200f)); + PaymentRequest priceyRequest = new PaymentRequest(address, card, customer, 204.99f); + PaymentResponse payment_unauthorized = new PaymentResponse(false, "Payment unauthorized"); + + when(httpClient.retrieve(any(), eq(Address.class))) + .thenReturn(Mono.just(address)); + + when(paymentClient.createPayment(priceyRequest)) + .thenReturn(Mono.just(payment_unauthorized)); + + when(httpClient.retrieve(any(), eq(Card.class))) + .thenReturn(Mono.just(card)); + + when(httpClient.retrieve(any(), eq(Customer.class))) + .thenReturn(Mono.just(customer)); + + when(httpClient.retrieve(any(), eq(Address.class))) + .thenReturn(Mono.just(address)); + + when(httpClient.retrieve(any(), eq(Argument.listOf(Item.class)))) + .thenReturn(Mono.just(expensiveItems)); + + when(customerOrderRepository.save(any(CustomerOrder.class))) + .then(returnsFirstArg()); + + assertThrows(OrdersController.PaymentDeclinedException.class, + () -> ordersService.placeOrder(orderPayload).block()); + } + + @Test + public void paymentTimeoutOrdersDeclined() { + + when(httpClient.retrieve(any(), eq(Address.class))) + .thenReturn(Mono.just(address)); + + when(paymentClient.createPayment(paymentRequest)) + .thenReturn(Mono.just(payment_authorized).delayElement(Duration.of(timeout + 1, ChronoUnit.SECONDS))); + + when(httpClient.retrieve(any(), eq(Card.class))) + .thenReturn(Mono.just(card)); + + when(httpClient.retrieve(any(), eq(Customer.class))) + .thenReturn(Mono.just(customer)); + + when(httpClient.retrieve(any(), eq(Address.class))) + .thenReturn(Mono.just(address)); + + when(httpClient.retrieve(any(), eq(Argument.listOf(Item.class)))) + .thenReturn(Mono.just(items)); + + when(customerOrderRepository.save(any(CustomerOrder.class))) + .then(returnsFirstArg()); + + assertThrows(OrdersController.PaymentDeclinedException.class, + () -> ordersService.placeOrder(orderPayload).block()); + } + + @Test + public void timeoutException_rethrown_as_OrderFailedException() { + + when(httpClient.retrieve(any(), eq(Address.class))) + .thenReturn(Mono.just(address)); + + when(paymentClient.createPayment(paymentRequest)) + .thenReturn(Mono.just(payment_authorized)); + + when(httpClient.retrieve(any(), eq(Card.class))) + .thenReturn(Mono.just(card)); + + when(httpClient.retrieve(any(), eq(Customer.class))) + .thenReturn(Mono.just(customer)); + + when(httpClient.retrieve(any(), eq(Address.class))) + .thenReturn(Mono.just(address)); + + when(httpClient.retrieve(any(), eq(Argument.listOf(Item.class)))) + .thenReturn(Mono.just(items).delayElement(Duration.of(timeout + 1, ChronoUnit.SECONDS))); + + when(customerOrderRepository.save(any(CustomerOrder.class))) + .then(returnsFirstArg()); + + assertThrows(OrdersController.OrderFailedException.class, + () -> ordersService.placeOrder(orderPayload).block()); + } + + @MockBean(OrdersPublisher.class) + OrdersPublisher ordersPublisher() { + return mock(OrdersPublisher.class); + } + + @MockBean(ShipmentsListener.class) + ShipmentsListener shipmentsListener() { + return mock(ShipmentsListener.class); + } + + @MockBean(HttpClient.class) + HttpClient httpClient() { + return mock(HttpClient.class); + } + + @MockBean(PaymentClient.class) + PaymentClient paymentClient() { + return mock(PaymentClient.class); + } + + @MockBean(CustomerOrderRepository.class) + CustomerOrderRepository customerOrderRepository() { + return mock(CustomerOrderRepository.class); + } +}